diff --git a/cuda_toolkit/include/CL/cl.h b/cuda_toolkit/include/CL/cl.h new file mode 100644 index 0000000000000000000000000000000000000000..df0b4721f65c7779221ba17792a641d07b27b298 --- /dev/null +++ b/cuda_toolkit/include/CL/cl.h @@ -0,0 +1,2012 @@ +/******************************************************************************* + * Copyright (c) 2008-2020 The Khronos Group Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ + +#ifndef __OPENCL_CL_H +#define __OPENCL_CL_H + + +#ifndef __CL_VERSION_H +#define __CL_VERSION_H + +/* Detect which version to target */ +#if !defined(CL_TARGET_OPENCL_VERSION) +#pragma message("cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 300 (OpenCL 3.0)") +#define CL_TARGET_OPENCL_VERSION 300 +#endif +#if CL_TARGET_OPENCL_VERSION != 100 && \ + CL_TARGET_OPENCL_VERSION != 110 && \ + CL_TARGET_OPENCL_VERSION != 120 && \ + CL_TARGET_OPENCL_VERSION != 200 && \ + CL_TARGET_OPENCL_VERSION != 210 && \ + CL_TARGET_OPENCL_VERSION != 220 && \ + CL_TARGET_OPENCL_VERSION != 300 +#pragma message("cl_version: CL_TARGET_OPENCL_VERSION is not a valid value (100, 110, 120, 200, 210, 220, 300). Defaulting to 300 (OpenCL 3.0)") +#undef CL_TARGET_OPENCL_VERSION +#define CL_TARGET_OPENCL_VERSION 300 +#endif + + +/* OpenCL Version */ +#if CL_TARGET_OPENCL_VERSION >= 300 && !defined(CL_VERSION_3_0) +#define CL_VERSION_3_0 1 +#endif +#if CL_TARGET_OPENCL_VERSION >= 220 && !defined(CL_VERSION_2_2) +#define CL_VERSION_2_2 1 +#endif +#if CL_TARGET_OPENCL_VERSION >= 210 && !defined(CL_VERSION_2_1) +#define CL_VERSION_2_1 1 +#endif +#if CL_TARGET_OPENCL_VERSION >= 200 && !defined(CL_VERSION_2_0) +#define CL_VERSION_2_0 1 +#endif +#if CL_TARGET_OPENCL_VERSION >= 120 && !defined(CL_VERSION_1_2) +#define CL_VERSION_1_2 1 +#endif +#if CL_TARGET_OPENCL_VERSION >= 110 && !defined(CL_VERSION_1_1) +#define CL_VERSION_1_1 1 +#endif +#if CL_TARGET_OPENCL_VERSION >= 100 && !defined(CL_VERSION_1_0) +#define CL_VERSION_1_0 1 +#endif + +/* Allow deprecated APIs for older OpenCL versions. */ +#if CL_TARGET_OPENCL_VERSION <= 220 && !defined(CL_USE_DEPRECATED_OPENCL_2_2_APIS) +#define CL_USE_DEPRECATED_OPENCL_2_2_APIS +#endif +#if CL_TARGET_OPENCL_VERSION <= 210 && !defined(CL_USE_DEPRECATED_OPENCL_2_1_APIS) +#define CL_USE_DEPRECATED_OPENCL_2_1_APIS +#endif +#if CL_TARGET_OPENCL_VERSION <= 200 && !defined(CL_USE_DEPRECATED_OPENCL_2_0_APIS) +#define CL_USE_DEPRECATED_OPENCL_2_0_APIS +#endif +#if CL_TARGET_OPENCL_VERSION <= 120 && !defined(CL_USE_DEPRECATED_OPENCL_1_2_APIS) +#define CL_USE_DEPRECATED_OPENCL_1_2_APIS +#endif +#if CL_TARGET_OPENCL_VERSION <= 110 && !defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) +#define CL_USE_DEPRECATED_OPENCL_1_1_APIS +#endif +#if CL_TARGET_OPENCL_VERSION <= 100 && !defined(CL_USE_DEPRECATED_OPENCL_1_0_APIS) +#define CL_USE_DEPRECATED_OPENCL_1_0_APIS +#endif + +#endif /* __CL_VERSION_H */ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/******************************************************************************/ + +typedef struct _cl_platform_id * cl_platform_id; +typedef struct _cl_device_id * cl_device_id; +typedef struct _cl_context * cl_context; +typedef struct _cl_command_queue * cl_command_queue; +typedef struct _cl_mem * cl_mem; +typedef struct _cl_program * cl_program; +typedef struct _cl_kernel * cl_kernel; +typedef struct _cl_event * cl_event; +typedef struct _cl_sampler * cl_sampler; + +typedef cl_uint cl_bool; /* WARNING! Unlike cl_ types in cl_platform.h, cl_bool is not guaranteed to be the same size as the bool in kernels. */ +typedef cl_ulong cl_bitfield; +typedef cl_ulong cl_properties; +typedef cl_bitfield cl_device_type; +typedef cl_uint cl_platform_info; +typedef cl_uint cl_device_info; +typedef cl_bitfield cl_device_fp_config; +typedef cl_uint cl_device_mem_cache_type; +typedef cl_uint cl_device_local_mem_type; +typedef cl_bitfield cl_device_exec_capabilities; +#ifdef CL_VERSION_2_0 +typedef cl_bitfield cl_device_svm_capabilities; +#endif +typedef cl_bitfield cl_command_queue_properties; +#ifdef CL_VERSION_1_2 +typedef intptr_t cl_device_partition_property; +typedef cl_bitfield cl_device_affinity_domain; +#endif + +typedef intptr_t cl_context_properties; +typedef cl_uint cl_context_info; +#ifdef CL_VERSION_2_0 +typedef cl_properties cl_queue_properties; +#endif +typedef cl_uint cl_command_queue_info; +typedef cl_uint cl_channel_order; +typedef cl_uint cl_channel_type; +typedef cl_bitfield cl_mem_flags; +#ifdef CL_VERSION_2_0 +typedef cl_bitfield cl_svm_mem_flags; +#endif +typedef cl_uint cl_mem_object_type; +typedef cl_uint cl_mem_info; +#ifdef CL_VERSION_1_2 +typedef cl_bitfield cl_mem_migration_flags; +#endif +typedef cl_uint cl_image_info; +#ifdef CL_VERSION_1_1 +typedef cl_uint cl_buffer_create_type; +#endif +typedef cl_uint cl_addressing_mode; +typedef cl_uint cl_filter_mode; +typedef cl_uint cl_sampler_info; +typedef cl_bitfield cl_map_flags; +#ifdef CL_VERSION_2_0 +typedef intptr_t cl_pipe_properties; +typedef cl_uint cl_pipe_info; +#endif +typedef cl_uint cl_program_info; +typedef cl_uint cl_program_build_info; +#ifdef CL_VERSION_1_2 +typedef cl_uint cl_program_binary_type; +#endif +typedef cl_int cl_build_status; +typedef cl_uint cl_kernel_info; +#ifdef CL_VERSION_1_2 +typedef cl_uint cl_kernel_arg_info; +typedef cl_uint cl_kernel_arg_address_qualifier; +typedef cl_uint cl_kernel_arg_access_qualifier; +typedef cl_bitfield cl_kernel_arg_type_qualifier; +#endif +typedef cl_uint cl_kernel_work_group_info; +#ifdef CL_VERSION_2_1 +typedef cl_uint cl_kernel_sub_group_info; +#endif +typedef cl_uint cl_event_info; +typedef cl_uint cl_command_type; +typedef cl_uint cl_profiling_info; +#ifdef CL_VERSION_2_0 +typedef cl_properties cl_sampler_properties; +typedef cl_uint cl_kernel_exec_info; +#endif +#ifdef CL_VERSION_3_0 +typedef cl_bitfield cl_device_atomic_capabilities; +typedef cl_bitfield cl_device_device_enqueue_capabilities; +typedef cl_uint cl_khronos_vendor_id; +typedef cl_properties cl_mem_properties; +typedef cl_uint cl_version; +#endif + +typedef struct _cl_image_format { + cl_channel_order image_channel_order; + cl_channel_type image_channel_data_type; +} cl_image_format; + +#ifdef CL_VERSION_1_2 + +typedef struct _cl_image_desc { + cl_mem_object_type image_type; + size_t image_width; + size_t image_height; + size_t image_depth; + size_t image_array_size; + size_t image_row_pitch; + size_t image_slice_pitch; + cl_uint num_mip_levels; + cl_uint num_samples; +#ifdef CL_VERSION_2_0 +#if defined(__GNUC__) + __extension__ /* Prevents warnings about anonymous union in -pedantic builds */ +#endif +#if defined(_MSC_VER) && !defined(__STDC__) +#pragma warning( push ) +#pragma warning( disable : 4201 ) /* Prevents warning about nameless struct/union in /W4 builds */ +#endif +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wc11-extensions" /* Prevents warning about nameless union being C11 extension*/ +#endif +#if defined(_MSC_VER) && defined(__STDC__) + /* Anonymous unions are not supported in /Za builds */ +#else + union { +#endif +#endif + cl_mem buffer; +#ifdef CL_VERSION_2_0 +#if defined(_MSC_VER) && defined(__STDC__) + /* Anonymous unions are not supported in /Za builds */ +#else + cl_mem mem_object; + }; +#endif +#if defined(_MSC_VER) && !defined(__STDC__) +#pragma warning( pop ) +#endif +#ifdef __clang__ +#pragma clang diagnostic pop +#endif +#endif +} cl_image_desc; + +#endif + +#ifdef CL_VERSION_1_1 + +typedef struct _cl_buffer_region { + size_t origin; + size_t size; +} cl_buffer_region; + +#endif + +#ifdef CL_VERSION_3_0 + +#define CL_NAME_VERSION_MAX_NAME_SIZE 64 + +typedef struct _cl_name_version { + cl_version version; + char name[CL_NAME_VERSION_MAX_NAME_SIZE]; +} cl_name_version; + +#endif + +/******************************************************************************/ + +/* Error Codes */ +#define CL_SUCCESS 0 +#define CL_DEVICE_NOT_FOUND -1 +#define CL_DEVICE_NOT_AVAILABLE -2 +#define CL_COMPILER_NOT_AVAILABLE -3 +#define CL_MEM_OBJECT_ALLOCATION_FAILURE -4 +#define CL_OUT_OF_RESOURCES -5 +#define CL_OUT_OF_HOST_MEMORY -6 +#define CL_PROFILING_INFO_NOT_AVAILABLE -7 +#define CL_MEM_COPY_OVERLAP -8 +#define CL_IMAGE_FORMAT_MISMATCH -9 +#define CL_IMAGE_FORMAT_NOT_SUPPORTED -10 +#define CL_BUILD_PROGRAM_FAILURE -11 +#define CL_MAP_FAILURE -12 +#ifdef CL_VERSION_1_1 +#define CL_MISALIGNED_SUB_BUFFER_OFFSET -13 +#define CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST -14 +#endif +#ifdef CL_VERSION_1_2 +#define CL_COMPILE_PROGRAM_FAILURE -15 +#define CL_LINKER_NOT_AVAILABLE -16 +#define CL_LINK_PROGRAM_FAILURE -17 +#define CL_DEVICE_PARTITION_FAILED -18 +#define CL_KERNEL_ARG_INFO_NOT_AVAILABLE -19 +#endif + +#define CL_INVALID_VALUE -30 +#define CL_INVALID_DEVICE_TYPE -31 +#define CL_INVALID_PLATFORM -32 +#define CL_INVALID_DEVICE -33 +#define CL_INVALID_CONTEXT -34 +#define CL_INVALID_QUEUE_PROPERTIES -35 +#define CL_INVALID_COMMAND_QUEUE -36 +#define CL_INVALID_HOST_PTR -37 +#define CL_INVALID_MEM_OBJECT -38 +#define CL_INVALID_IMAGE_FORMAT_DESCRIPTOR -39 +#define CL_INVALID_IMAGE_SIZE -40 +#define CL_INVALID_SAMPLER -41 +#define CL_INVALID_BINARY -42 +#define CL_INVALID_BUILD_OPTIONS -43 +#define CL_INVALID_PROGRAM -44 +#define CL_INVALID_PROGRAM_EXECUTABLE -45 +#define CL_INVALID_KERNEL_NAME -46 +#define CL_INVALID_KERNEL_DEFINITION -47 +#define CL_INVALID_KERNEL -48 +#define CL_INVALID_ARG_INDEX -49 +#define CL_INVALID_ARG_VALUE -50 +#define CL_INVALID_ARG_SIZE -51 +#define CL_INVALID_KERNEL_ARGS -52 +#define CL_INVALID_WORK_DIMENSION -53 +#define CL_INVALID_WORK_GROUP_SIZE -54 +#define CL_INVALID_WORK_ITEM_SIZE -55 +#define CL_INVALID_GLOBAL_OFFSET -56 +#define CL_INVALID_EVENT_WAIT_LIST -57 +#define CL_INVALID_EVENT -58 +#define CL_INVALID_OPERATION -59 +#define CL_INVALID_GL_OBJECT -60 +#define CL_INVALID_BUFFER_SIZE -61 +#define CL_INVALID_MIP_LEVEL -62 +#define CL_INVALID_GLOBAL_WORK_SIZE -63 +#ifdef CL_VERSION_1_1 +#define CL_INVALID_PROPERTY -64 +#endif +#ifdef CL_VERSION_1_2 +#define CL_INVALID_IMAGE_DESCRIPTOR -65 +#define CL_INVALID_COMPILER_OPTIONS -66 +#define CL_INVALID_LINKER_OPTIONS -67 +#define CL_INVALID_DEVICE_PARTITION_COUNT -68 +#endif +#ifdef CL_VERSION_2_0 +#define CL_INVALID_PIPE_SIZE -69 +#define CL_INVALID_DEVICE_QUEUE -70 +#endif +#ifdef CL_VERSION_2_2 +#define CL_INVALID_SPEC_ID -71 +#define CL_MAX_SIZE_RESTRICTION_EXCEEDED -72 +#endif + + +/* cl_bool */ +#define CL_FALSE 0 +#define CL_TRUE 1 +#ifdef CL_VERSION_1_2 +#define CL_BLOCKING CL_TRUE +#define CL_NON_BLOCKING CL_FALSE +#endif + +/* cl_platform_info */ +#define CL_PLATFORM_PROFILE 0x0900 +#define CL_PLATFORM_VERSION 0x0901 +#define CL_PLATFORM_NAME 0x0902 +#define CL_PLATFORM_VENDOR 0x0903 +#define CL_PLATFORM_EXTENSIONS 0x0904 +#ifdef CL_VERSION_2_1 +#define CL_PLATFORM_HOST_TIMER_RESOLUTION 0x0905 +#endif +#ifdef CL_VERSION_3_0 +#define CL_PLATFORM_NUMERIC_VERSION 0x0906 +#define CL_PLATFORM_EXTENSIONS_WITH_VERSION 0x0907 +#endif + +/* cl_device_type - bitfield */ +#define CL_DEVICE_TYPE_DEFAULT (1 << 0) +#define CL_DEVICE_TYPE_CPU (1 << 1) +#define CL_DEVICE_TYPE_GPU (1 << 2) +#define CL_DEVICE_TYPE_ACCELERATOR (1 << 3) +#ifdef CL_VERSION_1_2 +#define CL_DEVICE_TYPE_CUSTOM (1 << 4) +#endif +#define CL_DEVICE_TYPE_ALL 0xFFFFFFFF + +/* cl_device_info */ +#define CL_DEVICE_TYPE 0x1000 +#define CL_DEVICE_VENDOR_ID 0x1001 +#define CL_DEVICE_MAX_COMPUTE_UNITS 0x1002 +#define CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS 0x1003 +#define CL_DEVICE_MAX_WORK_GROUP_SIZE 0x1004 +#define CL_DEVICE_MAX_WORK_ITEM_SIZES 0x1005 +#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR 0x1006 +#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT 0x1007 +#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT 0x1008 +#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG 0x1009 +#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT 0x100A +#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE 0x100B +#define CL_DEVICE_MAX_CLOCK_FREQUENCY 0x100C +#define CL_DEVICE_ADDRESS_BITS 0x100D +#define CL_DEVICE_MAX_READ_IMAGE_ARGS 0x100E +#define CL_DEVICE_MAX_WRITE_IMAGE_ARGS 0x100F +#define CL_DEVICE_MAX_MEM_ALLOC_SIZE 0x1010 +#define CL_DEVICE_IMAGE2D_MAX_WIDTH 0x1011 +#define CL_DEVICE_IMAGE2D_MAX_HEIGHT 0x1012 +#define CL_DEVICE_IMAGE3D_MAX_WIDTH 0x1013 +#define CL_DEVICE_IMAGE3D_MAX_HEIGHT 0x1014 +#define CL_DEVICE_IMAGE3D_MAX_DEPTH 0x1015 +#define CL_DEVICE_IMAGE_SUPPORT 0x1016 +#define CL_DEVICE_MAX_PARAMETER_SIZE 0x1017 +#define CL_DEVICE_MAX_SAMPLERS 0x1018 +#define CL_DEVICE_MEM_BASE_ADDR_ALIGN 0x1019 +#define CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE 0x101A +#define CL_DEVICE_SINGLE_FP_CONFIG 0x101B +#define CL_DEVICE_GLOBAL_MEM_CACHE_TYPE 0x101C +#define CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE 0x101D +#define CL_DEVICE_GLOBAL_MEM_CACHE_SIZE 0x101E +#define CL_DEVICE_GLOBAL_MEM_SIZE 0x101F +#define CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE 0x1020 +#define CL_DEVICE_MAX_CONSTANT_ARGS 0x1021 +#define CL_DEVICE_LOCAL_MEM_TYPE 0x1022 +#define CL_DEVICE_LOCAL_MEM_SIZE 0x1023 +#define CL_DEVICE_ERROR_CORRECTION_SUPPORT 0x1024 +#define CL_DEVICE_PROFILING_TIMER_RESOLUTION 0x1025 +#define CL_DEVICE_ENDIAN_LITTLE 0x1026 +#define CL_DEVICE_AVAILABLE 0x1027 +#define CL_DEVICE_COMPILER_AVAILABLE 0x1028 +#define CL_DEVICE_EXECUTION_CAPABILITIES 0x1029 +#define CL_DEVICE_QUEUE_PROPERTIES 0x102A /* deprecated */ +#ifdef CL_VERSION_2_0 +#define CL_DEVICE_QUEUE_ON_HOST_PROPERTIES 0x102A +#endif +#define CL_DEVICE_NAME 0x102B +#define CL_DEVICE_VENDOR 0x102C +#define CL_DRIVER_VERSION 0x102D +#define CL_DEVICE_PROFILE 0x102E +#define CL_DEVICE_VERSION 0x102F +#define CL_DEVICE_EXTENSIONS 0x1030 +#define CL_DEVICE_PLATFORM 0x1031 +#ifdef CL_VERSION_1_2 +#define CL_DEVICE_DOUBLE_FP_CONFIG 0x1032 +#endif +/* 0x1033 reserved for CL_DEVICE_HALF_FP_CONFIG which is already defined in "cl_ext.h" */ +#ifdef CL_VERSION_1_1 +#define CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF 0x1034 +#define CL_DEVICE_HOST_UNIFIED_MEMORY 0x1035 /* deprecated */ +#define CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR 0x1036 +#define CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT 0x1037 +#define CL_DEVICE_NATIVE_VECTOR_WIDTH_INT 0x1038 +#define CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG 0x1039 +#define CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT 0x103A +#define CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE 0x103B +#define CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF 0x103C +#define CL_DEVICE_OPENCL_C_VERSION 0x103D +#endif +#ifdef CL_VERSION_1_2 +#define CL_DEVICE_LINKER_AVAILABLE 0x103E +#define CL_DEVICE_BUILT_IN_KERNELS 0x103F +#define CL_DEVICE_IMAGE_MAX_BUFFER_SIZE 0x1040 +#define CL_DEVICE_IMAGE_MAX_ARRAY_SIZE 0x1041 +#define CL_DEVICE_PARENT_DEVICE 0x1042 +#define CL_DEVICE_PARTITION_MAX_SUB_DEVICES 0x1043 +#define CL_DEVICE_PARTITION_PROPERTIES 0x1044 +#define CL_DEVICE_PARTITION_AFFINITY_DOMAIN 0x1045 +#define CL_DEVICE_PARTITION_TYPE 0x1046 +#define CL_DEVICE_REFERENCE_COUNT 0x1047 +#define CL_DEVICE_PREFERRED_INTEROP_USER_SYNC 0x1048 +#define CL_DEVICE_PRINTF_BUFFER_SIZE 0x1049 +#endif +#ifdef CL_VERSION_2_0 +#define CL_DEVICE_IMAGE_PITCH_ALIGNMENT 0x104A +#define CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT 0x104B +#define CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS 0x104C +#define CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE 0x104D +#define CL_DEVICE_QUEUE_ON_DEVICE_PROPERTIES 0x104E +#define CL_DEVICE_QUEUE_ON_DEVICE_PREFERRED_SIZE 0x104F +#define CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE 0x1050 +#define CL_DEVICE_MAX_ON_DEVICE_QUEUES 0x1051 +#define CL_DEVICE_MAX_ON_DEVICE_EVENTS 0x1052 +#define CL_DEVICE_SVM_CAPABILITIES 0x1053 +#define CL_DEVICE_GLOBAL_VARIABLE_PREFERRED_TOTAL_SIZE 0x1054 +#define CL_DEVICE_MAX_PIPE_ARGS 0x1055 +#define CL_DEVICE_PIPE_MAX_ACTIVE_RESERVATIONS 0x1056 +#define CL_DEVICE_PIPE_MAX_PACKET_SIZE 0x1057 +#define CL_DEVICE_PREFERRED_PLATFORM_ATOMIC_ALIGNMENT 0x1058 +#define CL_DEVICE_PREFERRED_GLOBAL_ATOMIC_ALIGNMENT 0x1059 +#define CL_DEVICE_PREFERRED_LOCAL_ATOMIC_ALIGNMENT 0x105A +#endif +#ifdef CL_VERSION_2_1 +#define CL_DEVICE_IL_VERSION 0x105B +#define CL_DEVICE_MAX_NUM_SUB_GROUPS 0x105C +#define CL_DEVICE_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS 0x105D +#endif +#ifdef CL_VERSION_3_0 +#define CL_DEVICE_NUMERIC_VERSION 0x105E +#define CL_DEVICE_EXTENSIONS_WITH_VERSION 0x1060 +#define CL_DEVICE_ILS_WITH_VERSION 0x1061 +#define CL_DEVICE_BUILT_IN_KERNELS_WITH_VERSION 0x1062 +#define CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES 0x1063 +#define CL_DEVICE_ATOMIC_FENCE_CAPABILITIES 0x1064 +#define CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT 0x1065 +#define CL_DEVICE_OPENCL_C_ALL_VERSIONS 0x1066 +#define CL_DEVICE_PREFERRED_WORK_GROUP_SIZE_MULTIPLE 0x1067 +#define CL_DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT 0x1068 +#define CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT 0x1069 +/* 0x106A to 0x106E - Reserved for upcoming KHR extension */ +#define CL_DEVICE_OPENCL_C_FEATURES 0x106F +#define CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES 0x1070 +#define CL_DEVICE_PIPE_SUPPORT 0x1071 +#define CL_DEVICE_LATEST_CONFORMANCE_VERSION_PASSED 0x1072 +#endif + +/* cl_device_fp_config - bitfield */ +#define CL_FP_DENORM (1 << 0) +#define CL_FP_INF_NAN (1 << 1) +#define CL_FP_ROUND_TO_NEAREST (1 << 2) +#define CL_FP_ROUND_TO_ZERO (1 << 3) +#define CL_FP_ROUND_TO_INF (1 << 4) +#define CL_FP_FMA (1 << 5) +#ifdef CL_VERSION_1_1 +#define CL_FP_SOFT_FLOAT (1 << 6) +#endif +#ifdef CL_VERSION_1_2 +#define CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT (1 << 7) +#endif + +/* cl_device_mem_cache_type */ +#define CL_NONE 0x0 +#define CL_READ_ONLY_CACHE 0x1 +#define CL_READ_WRITE_CACHE 0x2 + +/* cl_device_local_mem_type */ +#define CL_LOCAL 0x1 +#define CL_GLOBAL 0x2 + +/* cl_device_exec_capabilities - bitfield */ +#define CL_EXEC_KERNEL (1 << 0) +#define CL_EXEC_NATIVE_KERNEL (1 << 1) + +/* cl_command_queue_properties - bitfield */ +#define CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE (1 << 0) +#define CL_QUEUE_PROFILING_ENABLE (1 << 1) +#ifdef CL_VERSION_2_0 +#define CL_QUEUE_ON_DEVICE (1 << 2) +#define CL_QUEUE_ON_DEVICE_DEFAULT (1 << 3) +#endif + +/* cl_context_info */ +#define CL_CONTEXT_REFERENCE_COUNT 0x1080 +#define CL_CONTEXT_DEVICES 0x1081 +#define CL_CONTEXT_PROPERTIES 0x1082 +#ifdef CL_VERSION_1_1 +#define CL_CONTEXT_NUM_DEVICES 0x1083 +#endif + +/* cl_context_properties */ +#define CL_CONTEXT_PLATFORM 0x1084 +#ifdef CL_VERSION_1_2 +#define CL_CONTEXT_INTEROP_USER_SYNC 0x1085 +#endif + +#ifdef CL_VERSION_1_2 + +/* cl_device_partition_property */ +#define CL_DEVICE_PARTITION_EQUALLY 0x1086 +#define CL_DEVICE_PARTITION_BY_COUNTS 0x1087 +#define CL_DEVICE_PARTITION_BY_COUNTS_LIST_END 0x0 +#define CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN 0x1088 + +#endif + +#ifdef CL_VERSION_1_2 + +/* cl_device_affinity_domain */ +#define CL_DEVICE_AFFINITY_DOMAIN_NUMA (1 << 0) +#define CL_DEVICE_AFFINITY_DOMAIN_L4_CACHE (1 << 1) +#define CL_DEVICE_AFFINITY_DOMAIN_L3_CACHE (1 << 2) +#define CL_DEVICE_AFFINITY_DOMAIN_L2_CACHE (1 << 3) +#define CL_DEVICE_AFFINITY_DOMAIN_L1_CACHE (1 << 4) +#define CL_DEVICE_AFFINITY_DOMAIN_NEXT_PARTITIONABLE (1 << 5) + +#endif + +#ifdef CL_VERSION_2_0 + +/* cl_device_svm_capabilities */ +#define CL_DEVICE_SVM_COARSE_GRAIN_BUFFER (1 << 0) +#define CL_DEVICE_SVM_FINE_GRAIN_BUFFER (1 << 1) +#define CL_DEVICE_SVM_FINE_GRAIN_SYSTEM (1 << 2) +#define CL_DEVICE_SVM_ATOMICS (1 << 3) + +#endif + +/* cl_command_queue_info */ +#define CL_QUEUE_CONTEXT 0x1090 +#define CL_QUEUE_DEVICE 0x1091 +#define CL_QUEUE_REFERENCE_COUNT 0x1092 +#define CL_QUEUE_PROPERTIES 0x1093 +#ifdef CL_VERSION_2_0 +#define CL_QUEUE_SIZE 0x1094 +#endif +#ifdef CL_VERSION_2_1 +#define CL_QUEUE_DEVICE_DEFAULT 0x1095 +#endif +#ifdef CL_VERSION_3_0 +#define CL_QUEUE_PROPERTIES_ARRAY 0x1098 +#endif + +/* cl_mem_flags and cl_svm_mem_flags - bitfield */ +#define CL_MEM_READ_WRITE (1 << 0) +#define CL_MEM_WRITE_ONLY (1 << 1) +#define CL_MEM_READ_ONLY (1 << 2) +#define CL_MEM_USE_HOST_PTR (1 << 3) +#define CL_MEM_ALLOC_HOST_PTR (1 << 4) +#define CL_MEM_COPY_HOST_PTR (1 << 5) +/* reserved (1 << 6) */ +#ifdef CL_VERSION_1_2 +#define CL_MEM_HOST_WRITE_ONLY (1 << 7) +#define CL_MEM_HOST_READ_ONLY (1 << 8) +#define CL_MEM_HOST_NO_ACCESS (1 << 9) +#endif +#ifdef CL_VERSION_2_0 +#define CL_MEM_SVM_FINE_GRAIN_BUFFER (1 << 10) /* used by cl_svm_mem_flags only */ +#define CL_MEM_SVM_ATOMICS (1 << 11) /* used by cl_svm_mem_flags only */ +#define CL_MEM_KERNEL_READ_AND_WRITE (1 << 12) +#endif + +#ifdef CL_VERSION_1_2 + +/* cl_mem_migration_flags - bitfield */ +#define CL_MIGRATE_MEM_OBJECT_HOST (1 << 0) +#define CL_MIGRATE_MEM_OBJECT_CONTENT_UNDEFINED (1 << 1) + +#endif + +/* cl_channel_order */ +#define CL_R 0x10B0 +#define CL_A 0x10B1 +#define CL_RG 0x10B2 +#define CL_RA 0x10B3 +#define CL_RGB 0x10B4 +#define CL_RGBA 0x10B5 +#define CL_BGRA 0x10B6 +#define CL_ARGB 0x10B7 +#define CL_INTENSITY 0x10B8 +#define CL_LUMINANCE 0x10B9 +#ifdef CL_VERSION_1_1 +#define CL_Rx 0x10BA +#define CL_RGx 0x10BB +#define CL_RGBx 0x10BC +#endif +#ifdef CL_VERSION_1_2 +#define CL_DEPTH 0x10BD +#define CL_DEPTH_STENCIL 0x10BE +#endif +#ifdef CL_VERSION_2_0 +#define CL_sRGB 0x10BF +#define CL_sRGBx 0x10C0 +#define CL_sRGBA 0x10C1 +#define CL_sBGRA 0x10C2 +#define CL_ABGR 0x10C3 +#endif + +/* cl_channel_type */ +#define CL_SNORM_INT8 0x10D0 +#define CL_SNORM_INT16 0x10D1 +#define CL_UNORM_INT8 0x10D2 +#define CL_UNORM_INT16 0x10D3 +#define CL_UNORM_SHORT_565 0x10D4 +#define CL_UNORM_SHORT_555 0x10D5 +#define CL_UNORM_INT_101010 0x10D6 +#define CL_SIGNED_INT8 0x10D7 +#define CL_SIGNED_INT16 0x10D8 +#define CL_SIGNED_INT32 0x10D9 +#define CL_UNSIGNED_INT8 0x10DA +#define CL_UNSIGNED_INT16 0x10DB +#define CL_UNSIGNED_INT32 0x10DC +#define CL_HALF_FLOAT 0x10DD +#define CL_FLOAT 0x10DE +#ifdef CL_VERSION_1_2 +#define CL_UNORM_INT24 0x10DF +#endif +#ifdef CL_VERSION_2_1 +#define CL_UNORM_INT_101010_2 0x10E0 +#endif + +/* cl_mem_object_type */ +#define CL_MEM_OBJECT_BUFFER 0x10F0 +#define CL_MEM_OBJECT_IMAGE2D 0x10F1 +#define CL_MEM_OBJECT_IMAGE3D 0x10F2 +#ifdef CL_VERSION_1_2 +#define CL_MEM_OBJECT_IMAGE2D_ARRAY 0x10F3 +#define CL_MEM_OBJECT_IMAGE1D 0x10F4 +#define CL_MEM_OBJECT_IMAGE1D_ARRAY 0x10F5 +#define CL_MEM_OBJECT_IMAGE1D_BUFFER 0x10F6 +#endif +#ifdef CL_VERSION_2_0 +#define CL_MEM_OBJECT_PIPE 0x10F7 +#endif + +/* cl_mem_info */ +#define CL_MEM_TYPE 0x1100 +#define CL_MEM_FLAGS 0x1101 +#define CL_MEM_SIZE 0x1102 +#define CL_MEM_HOST_PTR 0x1103 +#define CL_MEM_MAP_COUNT 0x1104 +#define CL_MEM_REFERENCE_COUNT 0x1105 +#define CL_MEM_CONTEXT 0x1106 +#ifdef CL_VERSION_1_1 +#define CL_MEM_ASSOCIATED_MEMOBJECT 0x1107 +#define CL_MEM_OFFSET 0x1108 +#endif +#ifdef CL_VERSION_2_0 +#define CL_MEM_USES_SVM_POINTER 0x1109 +#endif +#ifdef CL_VERSION_3_0 +#define CL_MEM_PROPERTIES 0x110A +#endif + +/* cl_image_info */ +#define CL_IMAGE_FORMAT 0x1110 +#define CL_IMAGE_ELEMENT_SIZE 0x1111 +#define CL_IMAGE_ROW_PITCH 0x1112 +#define CL_IMAGE_SLICE_PITCH 0x1113 +#define CL_IMAGE_WIDTH 0x1114 +#define CL_IMAGE_HEIGHT 0x1115 +#define CL_IMAGE_DEPTH 0x1116 +#ifdef CL_VERSION_1_2 +#define CL_IMAGE_ARRAY_SIZE 0x1117 +#define CL_IMAGE_BUFFER 0x1118 +#define CL_IMAGE_NUM_MIP_LEVELS 0x1119 +#define CL_IMAGE_NUM_SAMPLES 0x111A +#endif + + +/* cl_pipe_info */ +#ifdef CL_VERSION_2_0 +#define CL_PIPE_PACKET_SIZE 0x1120 +#define CL_PIPE_MAX_PACKETS 0x1121 +#endif +#ifdef CL_VERSION_3_0 +#define CL_PIPE_PROPERTIES 0x1122 +#endif + +/* cl_addressing_mode */ +#define CL_ADDRESS_NONE 0x1130 +#define CL_ADDRESS_CLAMP_TO_EDGE 0x1131 +#define CL_ADDRESS_CLAMP 0x1132 +#define CL_ADDRESS_REPEAT 0x1133 +#ifdef CL_VERSION_1_1 +#define CL_ADDRESS_MIRRORED_REPEAT 0x1134 +#endif + +/* cl_filter_mode */ +#define CL_FILTER_NEAREST 0x1140 +#define CL_FILTER_LINEAR 0x1141 + +/* cl_sampler_info */ +#define CL_SAMPLER_REFERENCE_COUNT 0x1150 +#define CL_SAMPLER_CONTEXT 0x1151 +#define CL_SAMPLER_NORMALIZED_COORDS 0x1152 +#define CL_SAMPLER_ADDRESSING_MODE 0x1153 +#define CL_SAMPLER_FILTER_MODE 0x1154 +#ifdef CL_VERSION_2_0 +/* These enumerants are for the cl_khr_mipmap_image extension. + They have since been added to cl_ext.h with an appropriate + KHR suffix, but are left here for backwards compatibility. */ +#define CL_SAMPLER_MIP_FILTER_MODE 0x1155 +#define CL_SAMPLER_LOD_MIN 0x1156 +#define CL_SAMPLER_LOD_MAX 0x1157 +#endif +#ifdef CL_VERSION_3_0 +#define CL_SAMPLER_PROPERTIES 0x1158 +#endif + +/* cl_map_flags - bitfield */ +#define CL_MAP_READ (1 << 0) +#define CL_MAP_WRITE (1 << 1) +#ifdef CL_VERSION_1_2 +#define CL_MAP_WRITE_INVALIDATE_REGION (1 << 2) +#endif + +/* cl_program_info */ +#define CL_PROGRAM_REFERENCE_COUNT 0x1160 +#define CL_PROGRAM_CONTEXT 0x1161 +#define CL_PROGRAM_NUM_DEVICES 0x1162 +#define CL_PROGRAM_DEVICES 0x1163 +#define CL_PROGRAM_SOURCE 0x1164 +#define CL_PROGRAM_BINARY_SIZES 0x1165 +#define CL_PROGRAM_BINARIES 0x1166 +#ifdef CL_VERSION_1_2 +#define CL_PROGRAM_NUM_KERNELS 0x1167 +#define CL_PROGRAM_KERNEL_NAMES 0x1168 +#endif +#ifdef CL_VERSION_2_1 +#define CL_PROGRAM_IL 0x1169 +#endif +#ifdef CL_VERSION_2_2 +#define CL_PROGRAM_SCOPE_GLOBAL_CTORS_PRESENT 0x116A +#define CL_PROGRAM_SCOPE_GLOBAL_DTORS_PRESENT 0x116B +#endif + +/* cl_program_build_info */ +#define CL_PROGRAM_BUILD_STATUS 0x1181 +#define CL_PROGRAM_BUILD_OPTIONS 0x1182 +#define CL_PROGRAM_BUILD_LOG 0x1183 +#ifdef CL_VERSION_1_2 +#define CL_PROGRAM_BINARY_TYPE 0x1184 +#endif +#ifdef CL_VERSION_2_0 +#define CL_PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE 0x1185 +#endif + +#ifdef CL_VERSION_1_2 + +/* cl_program_binary_type */ +#define CL_PROGRAM_BINARY_TYPE_NONE 0x0 +#define CL_PROGRAM_BINARY_TYPE_COMPILED_OBJECT 0x1 +#define CL_PROGRAM_BINARY_TYPE_LIBRARY 0x2 +#define CL_PROGRAM_BINARY_TYPE_EXECUTABLE 0x4 + +#endif + +/* cl_build_status */ +#define CL_BUILD_SUCCESS 0 +#define CL_BUILD_NONE -1 +#define CL_BUILD_ERROR -2 +#define CL_BUILD_IN_PROGRESS -3 + +/* cl_kernel_info */ +#define CL_KERNEL_FUNCTION_NAME 0x1190 +#define CL_KERNEL_NUM_ARGS 0x1191 +#define CL_KERNEL_REFERENCE_COUNT 0x1192 +#define CL_KERNEL_CONTEXT 0x1193 +#define CL_KERNEL_PROGRAM 0x1194 +#ifdef CL_VERSION_1_2 +#define CL_KERNEL_ATTRIBUTES 0x1195 +#endif + +#ifdef CL_VERSION_1_2 + +/* cl_kernel_arg_info */ +#define CL_KERNEL_ARG_ADDRESS_QUALIFIER 0x1196 +#define CL_KERNEL_ARG_ACCESS_QUALIFIER 0x1197 +#define CL_KERNEL_ARG_TYPE_NAME 0x1198 +#define CL_KERNEL_ARG_TYPE_QUALIFIER 0x1199 +#define CL_KERNEL_ARG_NAME 0x119A + +#endif + +#ifdef CL_VERSION_1_2 + +/* cl_kernel_arg_address_qualifier */ +#define CL_KERNEL_ARG_ADDRESS_GLOBAL 0x119B +#define CL_KERNEL_ARG_ADDRESS_LOCAL 0x119C +#define CL_KERNEL_ARG_ADDRESS_CONSTANT 0x119D +#define CL_KERNEL_ARG_ADDRESS_PRIVATE 0x119E + +#endif + +#ifdef CL_VERSION_1_2 + +/* cl_kernel_arg_access_qualifier */ +#define CL_KERNEL_ARG_ACCESS_READ_ONLY 0x11A0 +#define CL_KERNEL_ARG_ACCESS_WRITE_ONLY 0x11A1 +#define CL_KERNEL_ARG_ACCESS_READ_WRITE 0x11A2 +#define CL_KERNEL_ARG_ACCESS_NONE 0x11A3 + +#endif + +#ifdef CL_VERSION_1_2 + +/* cl_kernel_arg_type_qualifier */ +#define CL_KERNEL_ARG_TYPE_NONE 0 +#define CL_KERNEL_ARG_TYPE_CONST (1 << 0) +#define CL_KERNEL_ARG_TYPE_RESTRICT (1 << 1) +#define CL_KERNEL_ARG_TYPE_VOLATILE (1 << 2) +#ifdef CL_VERSION_2_0 +#define CL_KERNEL_ARG_TYPE_PIPE (1 << 3) +#endif + +#endif + +/* cl_kernel_work_group_info */ +#define CL_KERNEL_WORK_GROUP_SIZE 0x11B0 +#define CL_KERNEL_COMPILE_WORK_GROUP_SIZE 0x11B1 +#define CL_KERNEL_LOCAL_MEM_SIZE 0x11B2 +#define CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE 0x11B3 +#define CL_KERNEL_PRIVATE_MEM_SIZE 0x11B4 +#ifdef CL_VERSION_1_2 +#define CL_KERNEL_GLOBAL_WORK_SIZE 0x11B5 +#endif + +#ifdef CL_VERSION_2_1 + +/* cl_kernel_sub_group_info */ +#define CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE 0x2033 +#define CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE 0x2034 +#define CL_KERNEL_LOCAL_SIZE_FOR_SUB_GROUP_COUNT 0x11B8 +#define CL_KERNEL_MAX_NUM_SUB_GROUPS 0x11B9 +#define CL_KERNEL_COMPILE_NUM_SUB_GROUPS 0x11BA + +#endif + +#ifdef CL_VERSION_2_0 + +/* cl_kernel_exec_info */ +#define CL_KERNEL_EXEC_INFO_SVM_PTRS 0x11B6 +#define CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM 0x11B7 + +#endif + +/* cl_event_info */ +#define CL_EVENT_COMMAND_QUEUE 0x11D0 +#define CL_EVENT_COMMAND_TYPE 0x11D1 +#define CL_EVENT_REFERENCE_COUNT 0x11D2 +#define CL_EVENT_COMMAND_EXECUTION_STATUS 0x11D3 +#ifdef CL_VERSION_1_1 +#define CL_EVENT_CONTEXT 0x11D4 +#endif + +/* cl_command_type */ +#define CL_COMMAND_NDRANGE_KERNEL 0x11F0 +#define CL_COMMAND_TASK 0x11F1 +#define CL_COMMAND_NATIVE_KERNEL 0x11F2 +#define CL_COMMAND_READ_BUFFER 0x11F3 +#define CL_COMMAND_WRITE_BUFFER 0x11F4 +#define CL_COMMAND_COPY_BUFFER 0x11F5 +#define CL_COMMAND_READ_IMAGE 0x11F6 +#define CL_COMMAND_WRITE_IMAGE 0x11F7 +#define CL_COMMAND_COPY_IMAGE 0x11F8 +#define CL_COMMAND_COPY_IMAGE_TO_BUFFER 0x11F9 +#define CL_COMMAND_COPY_BUFFER_TO_IMAGE 0x11FA +#define CL_COMMAND_MAP_BUFFER 0x11FB +#define CL_COMMAND_MAP_IMAGE 0x11FC +#define CL_COMMAND_UNMAP_MEM_OBJECT 0x11FD +#define CL_COMMAND_MARKER 0x11FE +#define CL_COMMAND_ACQUIRE_GL_OBJECTS 0x11FF +#define CL_COMMAND_RELEASE_GL_OBJECTS 0x1200 +#ifdef CL_VERSION_1_1 +#define CL_COMMAND_READ_BUFFER_RECT 0x1201 +#define CL_COMMAND_WRITE_BUFFER_RECT 0x1202 +#define CL_COMMAND_COPY_BUFFER_RECT 0x1203 +#define CL_COMMAND_USER 0x1204 +#endif +#ifdef CL_VERSION_1_2 +#define CL_COMMAND_BARRIER 0x1205 +#define CL_COMMAND_MIGRATE_MEM_OBJECTS 0x1206 +#define CL_COMMAND_FILL_BUFFER 0x1207 +#define CL_COMMAND_FILL_IMAGE 0x1208 +#endif +#ifdef CL_VERSION_2_0 +#define CL_COMMAND_SVM_FREE 0x1209 +#define CL_COMMAND_SVM_MEMCPY 0x120A +#define CL_COMMAND_SVM_MEMFILL 0x120B +#define CL_COMMAND_SVM_MAP 0x120C +#define CL_COMMAND_SVM_UNMAP 0x120D +#endif +#ifdef CL_VERSION_3_0 +#define CL_COMMAND_SVM_MIGRATE_MEM 0x120E +#endif + +/* command execution status */ +#define CL_COMPLETE 0x0 +#define CL_RUNNING 0x1 +#define CL_SUBMITTED 0x2 +#define CL_QUEUED 0x3 + +/* cl_buffer_create_type */ +#ifdef CL_VERSION_1_1 +#define CL_BUFFER_CREATE_TYPE_REGION 0x1220 +#endif + +/* cl_profiling_info */ +#define CL_PROFILING_COMMAND_QUEUED 0x1280 +#define CL_PROFILING_COMMAND_SUBMIT 0x1281 +#define CL_PROFILING_COMMAND_START 0x1282 +#define CL_PROFILING_COMMAND_END 0x1283 +#ifdef CL_VERSION_2_0 +#define CL_PROFILING_COMMAND_COMPLETE 0x1284 +#endif + +/* cl_device_atomic_capabilities - bitfield */ +#ifdef CL_VERSION_3_0 +#define CL_DEVICE_ATOMIC_ORDER_RELAXED (1 << 0) +#define CL_DEVICE_ATOMIC_ORDER_ACQ_REL (1 << 1) +#define CL_DEVICE_ATOMIC_ORDER_SEQ_CST (1 << 2) +#define CL_DEVICE_ATOMIC_SCOPE_WORK_ITEM (1 << 3) +#define CL_DEVICE_ATOMIC_SCOPE_WORK_GROUP (1 << 4) +#define CL_DEVICE_ATOMIC_SCOPE_DEVICE (1 << 5) +#define CL_DEVICE_ATOMIC_SCOPE_ALL_DEVICES (1 << 6) +#endif + +/* cl_device_device_enqueue_capabilities - bitfield */ +#ifdef CL_VERSION_3_0 +#define CL_DEVICE_QUEUE_SUPPORTED (1 << 0) +#define CL_DEVICE_QUEUE_REPLACEABLE_DEFAULT (1 << 1) +#endif + +/* cl_khronos_vendor_id */ +#define CL_KHRONOS_VENDOR_ID_CODEPLAY 0x10004 + +#ifdef CL_VERSION_3_0 + +/* cl_version */ +#define CL_VERSION_MAJOR_BITS (10) +#define CL_VERSION_MINOR_BITS (10) +#define CL_VERSION_PATCH_BITS (12) + +#define CL_VERSION_MAJOR_MASK ((1 << CL_VERSION_MAJOR_BITS) - 1) +#define CL_VERSION_MINOR_MASK ((1 << CL_VERSION_MINOR_BITS) - 1) +#define CL_VERSION_PATCH_MASK ((1 << CL_VERSION_PATCH_BITS) - 1) + +#define CL_VERSION_MAJOR(version) \ + ((version) >> (CL_VERSION_MINOR_BITS + CL_VERSION_PATCH_BITS)) + +#define CL_VERSION_MINOR(version) \ + (((version) >> CL_VERSION_PATCH_BITS) & CL_VERSION_MINOR_MASK) + +#define CL_VERSION_PATCH(version) ((version) & CL_VERSION_PATCH_MASK) + +#define CL_MAKE_VERSION(major, minor, patch) \ + ((((major) & CL_VERSION_MAJOR_MASK) \ + << (CL_VERSION_MINOR_BITS + CL_VERSION_PATCH_BITS)) | \ + (((minor) & CL_VERSION_MINOR_MASK) << CL_VERSION_PATCH_BITS) | \ + ((patch) & CL_VERSION_PATCH_MASK)) + +#endif + +/********************************************************************************************************/ + +/* CL_NO_PROTOTYPES implies CL_NO_CORE_PROTOTYPES: */ +#if defined(CL_NO_PROTOTYPES) && !defined(CL_NO_CORE_PROTOTYPES) +#define CL_NO_CORE_PROTOTYPES +#endif + +#if !defined(CL_NO_CORE_PROTOTYPES) + +/* Platform API */ +extern CL_API_ENTRY cl_int CL_API_CALL +clGetPlatformIDs(cl_uint num_entries, + cl_platform_id * platforms, + cl_uint * num_platforms) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetPlatformInfo(cl_platform_id platform, + cl_platform_info param_name, + size_t param_value_size, + void * param_value, + size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0; + +/* Device APIs */ +extern CL_API_ENTRY cl_int CL_API_CALL +clGetDeviceIDs(cl_platform_id platform, + cl_device_type device_type, + cl_uint num_entries, + cl_device_id * devices, + cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetDeviceInfo(cl_device_id device, + cl_device_info param_name, + size_t param_value_size, + void * param_value, + size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0; + +#ifdef CL_VERSION_1_2 + +extern CL_API_ENTRY cl_int CL_API_CALL +clCreateSubDevices(cl_device_id in_device, + const cl_device_partition_property * properties, + cl_uint num_devices, + cl_device_id * out_devices, + cl_uint * num_devices_ret) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clRetainDevice(cl_device_id device) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clReleaseDevice(cl_device_id device) CL_API_SUFFIX__VERSION_1_2; + +#endif + +#ifdef CL_VERSION_2_1 + +extern CL_API_ENTRY cl_int CL_API_CALL +clSetDefaultDeviceCommandQueue(cl_context context, + cl_device_id device, + cl_command_queue command_queue) CL_API_SUFFIX__VERSION_2_1; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetDeviceAndHostTimer(cl_device_id device, + cl_ulong* device_timestamp, + cl_ulong* host_timestamp) CL_API_SUFFIX__VERSION_2_1; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetHostTimer(cl_device_id device, + cl_ulong * host_timestamp) CL_API_SUFFIX__VERSION_2_1; + +#endif + +/* Context APIs */ +extern CL_API_ENTRY cl_context CL_API_CALL +clCreateContext(const cl_context_properties * properties, + cl_uint num_devices, + const cl_device_id * devices, + void (CL_CALLBACK * pfn_notify)(const char * errinfo, + const void * private_info, + size_t cb, + void * user_data), + void * user_data, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_context CL_API_CALL +clCreateContextFromType(const cl_context_properties * properties, + cl_device_type device_type, + void (CL_CALLBACK * pfn_notify)(const char * errinfo, + const void * private_info, + size_t cb, + void * user_data), + void * user_data, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clRetainContext(cl_context context) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clReleaseContext(cl_context context) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetContextInfo(cl_context context, + cl_context_info param_name, + size_t param_value_size, + void * param_value, + size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0; + +#ifdef CL_VERSION_3_0 + +extern CL_API_ENTRY cl_int CL_API_CALL +clSetContextDestructorCallback(cl_context context, + void (CL_CALLBACK* pfn_notify)(cl_context context, + void* user_data), + void* user_data) CL_API_SUFFIX__VERSION_3_0; + +#endif + +/* Command Queue APIs */ + +#ifdef CL_VERSION_2_0 + +extern CL_API_ENTRY cl_command_queue CL_API_CALL +clCreateCommandQueueWithProperties(cl_context context, + cl_device_id device, + const cl_queue_properties * properties, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_2_0; + +#endif + +extern CL_API_ENTRY cl_int CL_API_CALL +clRetainCommandQueue(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clReleaseCommandQueue(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetCommandQueueInfo(cl_command_queue command_queue, + cl_command_queue_info param_name, + size_t param_value_size, + void * param_value, + size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0; + +/* Memory Object APIs */ +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateBuffer(cl_context context, + cl_mem_flags flags, + size_t size, + void * host_ptr, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +#ifdef CL_VERSION_1_1 + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateSubBuffer(cl_mem buffer, + cl_mem_flags flags, + cl_buffer_create_type buffer_create_type, + const void * buffer_create_info, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_1; + +#endif + +#ifdef CL_VERSION_1_2 + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateImage(cl_context context, + cl_mem_flags flags, + const cl_image_format * image_format, + const cl_image_desc * image_desc, + void * host_ptr, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2; + +#endif + +#ifdef CL_VERSION_2_0 + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreatePipe(cl_context context, + cl_mem_flags flags, + cl_uint pipe_packet_size, + cl_uint pipe_max_packets, + const cl_pipe_properties * properties, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_2_0; + +#endif + +#ifdef CL_VERSION_3_0 + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateBufferWithProperties(cl_context context, + const cl_mem_properties * properties, + cl_mem_flags flags, + size_t size, + void * host_ptr, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_3_0; + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateImageWithProperties(cl_context context, + const cl_mem_properties * properties, + cl_mem_flags flags, + const cl_image_format * image_format, + const cl_image_desc * image_desc, + void * host_ptr, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_3_0; + +#endif + +extern CL_API_ENTRY cl_int CL_API_CALL +clRetainMemObject(cl_mem memobj) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clReleaseMemObject(cl_mem memobj) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetSupportedImageFormats(cl_context context, + cl_mem_flags flags, + cl_mem_object_type image_type, + cl_uint num_entries, + cl_image_format * image_formats, + cl_uint * num_image_formats) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetMemObjectInfo(cl_mem memobj, + cl_mem_info param_name, + size_t param_value_size, + void * param_value, + size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetImageInfo(cl_mem image, + cl_image_info param_name, + size_t param_value_size, + void * param_value, + size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0; + +#ifdef CL_VERSION_2_0 + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetPipeInfo(cl_mem pipe, + cl_pipe_info param_name, + size_t param_value_size, + void * param_value, + size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_2_0; + +#endif + +#ifdef CL_VERSION_1_1 + +extern CL_API_ENTRY cl_int CL_API_CALL +clSetMemObjectDestructorCallback(cl_mem memobj, + void (CL_CALLBACK * pfn_notify)(cl_mem memobj, + void * user_data), + void * user_data) CL_API_SUFFIX__VERSION_1_1; + +#endif + +/* SVM Allocation APIs */ + +#ifdef CL_VERSION_2_0 + +extern CL_API_ENTRY void * CL_API_CALL +clSVMAlloc(cl_context context, + cl_svm_mem_flags flags, + size_t size, + cl_uint alignment) CL_API_SUFFIX__VERSION_2_0; + +extern CL_API_ENTRY void CL_API_CALL +clSVMFree(cl_context context, + void * svm_pointer) CL_API_SUFFIX__VERSION_2_0; + +#endif + +/* Sampler APIs */ + +#ifdef CL_VERSION_2_0 + +extern CL_API_ENTRY cl_sampler CL_API_CALL +clCreateSamplerWithProperties(cl_context context, + const cl_sampler_properties * sampler_properties, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_2_0; + +#endif + +extern CL_API_ENTRY cl_int CL_API_CALL +clRetainSampler(cl_sampler sampler) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clReleaseSampler(cl_sampler sampler) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetSamplerInfo(cl_sampler sampler, + cl_sampler_info param_name, + size_t param_value_size, + void * param_value, + size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0; + +/* Program Object APIs */ +extern CL_API_ENTRY cl_program CL_API_CALL +clCreateProgramWithSource(cl_context context, + cl_uint count, + const char ** strings, + const size_t * lengths, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_program CL_API_CALL +clCreateProgramWithBinary(cl_context context, + cl_uint num_devices, + const cl_device_id * device_list, + const size_t * lengths, + const unsigned char ** binaries, + cl_int * binary_status, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +#ifdef CL_VERSION_1_2 + +extern CL_API_ENTRY cl_program CL_API_CALL +clCreateProgramWithBuiltInKernels(cl_context context, + cl_uint num_devices, + const cl_device_id * device_list, + const char * kernel_names, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2; + +#endif + +#ifdef CL_VERSION_2_1 + +extern CL_API_ENTRY cl_program CL_API_CALL +clCreateProgramWithIL(cl_context context, + const void* il, + size_t length, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_2_1; + +#endif + +extern CL_API_ENTRY cl_int CL_API_CALL +clRetainProgram(cl_program program) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clReleaseProgram(cl_program program) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clBuildProgram(cl_program program, + cl_uint num_devices, + const cl_device_id * device_list, + const char * options, + void (CL_CALLBACK * pfn_notify)(cl_program program, + void * user_data), + void * user_data) CL_API_SUFFIX__VERSION_1_0; + +#ifdef CL_VERSION_1_2 + +extern CL_API_ENTRY cl_int CL_API_CALL +clCompileProgram(cl_program program, + cl_uint num_devices, + const cl_device_id * device_list, + const char * options, + cl_uint num_input_headers, + const cl_program * input_headers, + const char ** header_include_names, + void (CL_CALLBACK * pfn_notify)(cl_program program, + void * user_data), + void * user_data) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_program CL_API_CALL +clLinkProgram(cl_context context, + cl_uint num_devices, + const cl_device_id * device_list, + const char * options, + cl_uint num_input_programs, + const cl_program * input_programs, + void (CL_CALLBACK * pfn_notify)(cl_program program, + void * user_data), + void * user_data, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2; + +#endif + +#ifdef CL_VERSION_2_2 + +extern CL_API_ENTRY CL_API_PREFIX__VERSION_2_2_DEPRECATED cl_int CL_API_CALL +clSetProgramReleaseCallback(cl_program program, + void (CL_CALLBACK * pfn_notify)(cl_program program, + void * user_data), + void * user_data) CL_API_SUFFIX__VERSION_2_2_DEPRECATED; + +extern CL_API_ENTRY cl_int CL_API_CALL +clSetProgramSpecializationConstant(cl_program program, + cl_uint spec_id, + size_t spec_size, + const void* spec_value) CL_API_SUFFIX__VERSION_2_2; + +#endif + +#ifdef CL_VERSION_1_2 + +extern CL_API_ENTRY cl_int CL_API_CALL +clUnloadPlatformCompiler(cl_platform_id platform) CL_API_SUFFIX__VERSION_1_2; + +#endif + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetProgramInfo(cl_program program, + cl_program_info param_name, + size_t param_value_size, + void * param_value, + size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetProgramBuildInfo(cl_program program, + cl_device_id device, + cl_program_build_info param_name, + size_t param_value_size, + void * param_value, + size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0; + +/* Kernel Object APIs */ +extern CL_API_ENTRY cl_kernel CL_API_CALL +clCreateKernel(cl_program program, + const char * kernel_name, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clCreateKernelsInProgram(cl_program program, + cl_uint num_kernels, + cl_kernel * kernels, + cl_uint * num_kernels_ret) CL_API_SUFFIX__VERSION_1_0; + +#ifdef CL_VERSION_2_1 + +extern CL_API_ENTRY cl_kernel CL_API_CALL +clCloneKernel(cl_kernel source_kernel, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_2_1; + +#endif + +extern CL_API_ENTRY cl_int CL_API_CALL +clRetainKernel(cl_kernel kernel) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clReleaseKernel(cl_kernel kernel) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clSetKernelArg(cl_kernel kernel, + cl_uint arg_index, + size_t arg_size, + const void * arg_value) CL_API_SUFFIX__VERSION_1_0; + +#ifdef CL_VERSION_2_0 + +extern CL_API_ENTRY cl_int CL_API_CALL +clSetKernelArgSVMPointer(cl_kernel kernel, + cl_uint arg_index, + const void * arg_value) CL_API_SUFFIX__VERSION_2_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clSetKernelExecInfo(cl_kernel kernel, + cl_kernel_exec_info param_name, + size_t param_value_size, + const void * param_value) CL_API_SUFFIX__VERSION_2_0; + +#endif + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetKernelInfo(cl_kernel kernel, + cl_kernel_info param_name, + size_t param_value_size, + void * param_value, + size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0; + +#ifdef CL_VERSION_1_2 + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetKernelArgInfo(cl_kernel kernel, + cl_uint arg_indx, + cl_kernel_arg_info param_name, + size_t param_value_size, + void * param_value, + size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_2; + +#endif + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetKernelWorkGroupInfo(cl_kernel kernel, + cl_device_id device, + cl_kernel_work_group_info param_name, + size_t param_value_size, + void * param_value, + size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0; + +#ifdef CL_VERSION_2_1 + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetKernelSubGroupInfo(cl_kernel kernel, + cl_device_id device, + cl_kernel_sub_group_info param_name, + size_t input_value_size, + const void* input_value, + size_t param_value_size, + void* param_value, + size_t* param_value_size_ret) CL_API_SUFFIX__VERSION_2_1; + +#endif + +/* Event Object APIs */ +extern CL_API_ENTRY cl_int CL_API_CALL +clWaitForEvents(cl_uint num_events, + const cl_event * event_list) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetEventInfo(cl_event event, + cl_event_info param_name, + size_t param_value_size, + void * param_value, + size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0; + +#ifdef CL_VERSION_1_1 + +extern CL_API_ENTRY cl_event CL_API_CALL +clCreateUserEvent(cl_context context, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_1; + +#endif + +extern CL_API_ENTRY cl_int CL_API_CALL +clRetainEvent(cl_event event) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clReleaseEvent(cl_event event) CL_API_SUFFIX__VERSION_1_0; + +#ifdef CL_VERSION_1_1 + +extern CL_API_ENTRY cl_int CL_API_CALL +clSetUserEventStatus(cl_event event, + cl_int execution_status) CL_API_SUFFIX__VERSION_1_1; + +extern CL_API_ENTRY cl_int CL_API_CALL +clSetEventCallback(cl_event event, + cl_int command_exec_callback_type, + void (CL_CALLBACK * pfn_notify)(cl_event event, + cl_int event_command_status, + void * user_data), + void * user_data) CL_API_SUFFIX__VERSION_1_1; + +#endif + +/* Profiling APIs */ +extern CL_API_ENTRY cl_int CL_API_CALL +clGetEventProfilingInfo(cl_event event, + cl_profiling_info param_name, + size_t param_value_size, + void * param_value, + size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0; + +/* Flush and Finish APIs */ +extern CL_API_ENTRY cl_int CL_API_CALL +clFlush(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clFinish(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_0; + +/* Enqueued Commands APIs */ +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueReadBuffer(cl_command_queue command_queue, + cl_mem buffer, + cl_bool blocking_read, + size_t offset, + size_t size, + void * ptr, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_0; + +#ifdef CL_VERSION_1_1 + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueReadBufferRect(cl_command_queue command_queue, + cl_mem buffer, + cl_bool blocking_read, + const size_t * buffer_origin, + const size_t * host_origin, + const size_t * region, + size_t buffer_row_pitch, + size_t buffer_slice_pitch, + size_t host_row_pitch, + size_t host_slice_pitch, + void * ptr, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_1; + +#endif + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueWriteBuffer(cl_command_queue command_queue, + cl_mem buffer, + cl_bool blocking_write, + size_t offset, + size_t size, + const void * ptr, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_0; + +#ifdef CL_VERSION_1_1 + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueWriteBufferRect(cl_command_queue command_queue, + cl_mem buffer, + cl_bool blocking_write, + const size_t * buffer_origin, + const size_t * host_origin, + const size_t * region, + size_t buffer_row_pitch, + size_t buffer_slice_pitch, + size_t host_row_pitch, + size_t host_slice_pitch, + const void * ptr, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_1; + +#endif + +#ifdef CL_VERSION_1_2 + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueFillBuffer(cl_command_queue command_queue, + cl_mem buffer, + const void * pattern, + size_t pattern_size, + size_t offset, + size_t size, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_2; + +#endif + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueCopyBuffer(cl_command_queue command_queue, + cl_mem src_buffer, + cl_mem dst_buffer, + size_t src_offset, + size_t dst_offset, + size_t size, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_0; + +#ifdef CL_VERSION_1_1 + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueCopyBufferRect(cl_command_queue command_queue, + cl_mem src_buffer, + cl_mem dst_buffer, + const size_t * src_origin, + const size_t * dst_origin, + const size_t * region, + size_t src_row_pitch, + size_t src_slice_pitch, + size_t dst_row_pitch, + size_t dst_slice_pitch, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_1; + +#endif + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueReadImage(cl_command_queue command_queue, + cl_mem image, + cl_bool blocking_read, + const size_t * origin, + const size_t * region, + size_t row_pitch, + size_t slice_pitch, + void * ptr, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueWriteImage(cl_command_queue command_queue, + cl_mem image, + cl_bool blocking_write, + const size_t * origin, + const size_t * region, + size_t input_row_pitch, + size_t input_slice_pitch, + const void * ptr, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_0; + +#ifdef CL_VERSION_1_2 + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueFillImage(cl_command_queue command_queue, + cl_mem image, + const void * fill_color, + const size_t * origin, + const size_t * region, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_2; + +#endif + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueCopyImage(cl_command_queue command_queue, + cl_mem src_image, + cl_mem dst_image, + const size_t * src_origin, + const size_t * dst_origin, + const size_t * region, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueCopyImageToBuffer(cl_command_queue command_queue, + cl_mem src_image, + cl_mem dst_buffer, + const size_t * src_origin, + const size_t * region, + size_t dst_offset, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueCopyBufferToImage(cl_command_queue command_queue, + cl_mem src_buffer, + cl_mem dst_image, + size_t src_offset, + const size_t * dst_origin, + const size_t * region, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY void * CL_API_CALL +clEnqueueMapBuffer(cl_command_queue command_queue, + cl_mem buffer, + cl_bool blocking_map, + cl_map_flags map_flags, + size_t offset, + size_t size, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY void * CL_API_CALL +clEnqueueMapImage(cl_command_queue command_queue, + cl_mem image, + cl_bool blocking_map, + cl_map_flags map_flags, + const size_t * origin, + const size_t * region, + size_t * image_row_pitch, + size_t * image_slice_pitch, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueUnmapMemObject(cl_command_queue command_queue, + cl_mem memobj, + void * mapped_ptr, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_0; + +#ifdef CL_VERSION_1_2 + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueMigrateMemObjects(cl_command_queue command_queue, + cl_uint num_mem_objects, + const cl_mem * mem_objects, + cl_mem_migration_flags flags, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_2; + +#endif + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueNDRangeKernel(cl_command_queue command_queue, + cl_kernel kernel, + cl_uint work_dim, + const size_t * global_work_offset, + const size_t * global_work_size, + const size_t * local_work_size, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueNativeKernel(cl_command_queue command_queue, + void (CL_CALLBACK * user_func)(void *), + void * args, + size_t cb_args, + cl_uint num_mem_objects, + const cl_mem * mem_list, + const void ** args_mem_loc, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_0; + +#ifdef CL_VERSION_1_2 + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueMarkerWithWaitList(cl_command_queue command_queue, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueBarrierWithWaitList(cl_command_queue command_queue, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_2; + +#endif + +#ifdef CL_VERSION_2_0 + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueSVMFree(cl_command_queue command_queue, + cl_uint num_svm_pointers, + void * svm_pointers[], + void (CL_CALLBACK * pfn_free_func)(cl_command_queue queue, + cl_uint num_svm_pointers, + void * svm_pointers[], + void * user_data), + void * user_data, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_2_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueSVMMemcpy(cl_command_queue command_queue, + cl_bool blocking_copy, + void * dst_ptr, + const void * src_ptr, + size_t size, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_2_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueSVMMemFill(cl_command_queue command_queue, + void * svm_ptr, + const void * pattern, + size_t pattern_size, + size_t size, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_2_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueSVMMap(cl_command_queue command_queue, + cl_bool blocking_map, + cl_map_flags flags, + void * svm_ptr, + size_t size, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_2_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueSVMUnmap(cl_command_queue command_queue, + void * svm_ptr, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_2_0; + +#endif + +#ifdef CL_VERSION_2_1 + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueSVMMigrateMem(cl_command_queue command_queue, + cl_uint num_svm_pointers, + const void ** svm_pointers, + const size_t * sizes, + cl_mem_migration_flags flags, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_2_1; + +#endif + +#ifdef CL_VERSION_1_2 + +/* Extension function access + * + * Returns the extension function address for the given function name, + * or NULL if a valid function can not be found. The client must + * check to make sure the address is not NULL, before using or + * calling the returned function address. + */ +extern CL_API_ENTRY void * CL_API_CALL +clGetExtensionFunctionAddressForPlatform(cl_platform_id platform, + const char * func_name) CL_API_SUFFIX__VERSION_1_2; + +#endif + +#ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS + /* + * WARNING: + * This API introduces mutable state into the OpenCL implementation. It has been REMOVED + * to better facilitate thread safety. The 1.0 API is not thread safe. It is not tested by the + * OpenCL 1.1 conformance test, and consequently may not work or may not work dependably. + * It is likely to be non-performant. Use of this API is not advised. Use at your own risk. + * + * Software developers previously relying on this API are instructed to set the command queue + * properties when creating the queue, instead. + */ + extern CL_API_ENTRY cl_int CL_API_CALL + clSetCommandQueueProperty(cl_command_queue command_queue, + cl_command_queue_properties properties, + cl_bool enable, + cl_command_queue_properties * old_properties) CL_API_SUFFIX__VERSION_1_0_DEPRECATED; +#endif /* CL_USE_DEPRECATED_OPENCL_1_0_APIS */ + +/* Deprecated OpenCL 1.1 APIs */ +extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL +clCreateImage2D(cl_context context, + cl_mem_flags flags, + const cl_image_format * image_format, + size_t image_width, + size_t image_height, + size_t image_row_pitch, + void * host_ptr, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_1_DEPRECATED; + +extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL +clCreateImage3D(cl_context context, + cl_mem_flags flags, + const cl_image_format * image_format, + size_t image_width, + size_t image_height, + size_t image_depth, + size_t image_row_pitch, + size_t image_slice_pitch, + void * host_ptr, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_1_DEPRECATED; + +extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL +clEnqueueMarker(cl_command_queue command_queue, + cl_event * event) CL_API_SUFFIX__VERSION_1_1_DEPRECATED; + +extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL +clEnqueueWaitForEvents(cl_command_queue command_queue, + cl_uint num_events, + const cl_event * event_list) CL_API_SUFFIX__VERSION_1_1_DEPRECATED; + +extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL +clEnqueueBarrier(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_1_DEPRECATED; + +extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL +clUnloadCompiler(void) CL_API_SUFFIX__VERSION_1_1_DEPRECATED; + +extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED void * CL_API_CALL +clGetExtensionFunctionAddress(const char * func_name) CL_API_SUFFIX__VERSION_1_1_DEPRECATED; + +/* Deprecated OpenCL 2.0 APIs */ +extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_2_DEPRECATED cl_command_queue CL_API_CALL +clCreateCommandQueue(cl_context context, + cl_device_id device, + cl_command_queue_properties properties, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2_DEPRECATED; + +extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_2_DEPRECATED cl_sampler CL_API_CALL +clCreateSampler(cl_context context, + cl_bool normalized_coords, + cl_addressing_mode addressing_mode, + cl_filter_mode filter_mode, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2_DEPRECATED; + +extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_2_DEPRECATED cl_int CL_API_CALL +clEnqueueTask(cl_command_queue command_queue, + cl_kernel kernel, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_2_DEPRECATED; + +#endif /* !defined(CL_NO_CORE_PROTOTYPES) */ + +#ifdef __cplusplus +} +#endif + +#endif /* __OPENCL_CL_H */ diff --git a/cuda_toolkit/include/CL/cl.hpp b/cuda_toolkit/include/CL/cl.hpp new file mode 100644 index 0000000000000000000000000000000000000000..e994470a0aff1c63404fe0da3d6a14f44efecc8c --- /dev/null +++ b/cuda_toolkit/include/CL/cl.hpp @@ -0,0 +1,11692 @@ +// +// Copyright (c) 2008-2023 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/*! \file + * + * \brief C++ bindings for OpenCL 1.0, OpenCL 1.1, OpenCL 1.2, + * OpenCL 2.0, OpenCL 2.1, OpenCL 2.2, and OpenCL 3.0. + * \author Lee Howes and Bruce Merry + * + * Derived from the OpenCL 1.x C++ bindings written by + * Benedict R. Gaster, Laurent Morichetti and Lee Howes + * With additions and fixes from: + * Brian Cole, March 3rd 2010 and April 2012 + * Matt Gruenke, April 2012. + * Bruce Merry, February 2013. + * Tom Deakin and Simon McIntosh-Smith, July 2013 + * James Price, 2015- + * \version 2.2.0 + * \date 2019-09-18 + * + * Optional extension support + * + * cl_khr_d3d10_sharing + * #define CL_HPP_USE_DX_INTEROP + * cl_khr_il_program + * #define CL_HPP_USE_IL_KHR + * cl_khr_sub_groups + * #define CL_HPP_USE_CL_SUB_GROUPS_KHR + * + * Doxygen documentation for this header is available here: + * + * http://khronosgroup.github.io/OpenCL-CLHPP/ + * + * The latest version of this header can be found on the GitHub releases page: + * + * https://github.com/KhronosGroup/OpenCL-CLHPP/releases + * + * Bugs and patches can be submitted to the GitHub repository: + * + * https://github.com/KhronosGroup/OpenCL-CLHPP + */ + +/*! \mainpage + * \section intro Introduction + * For many large applications C++ is the language of choice and so it seems + * reasonable to define C++ bindings for OpenCL. + * + * The interface is contained with a single C++ header file \em opencl.hpp and all + * definitions are contained within the namespace \em cl. There is no additional + * requirement to include \em cl.h and to use either the C++ or original C + * bindings; it is enough to simply include \em opencl.hpp. + * + * The bindings themselves are lightweight and correspond closely to the + * underlying C API. Using the C++ bindings introduces no additional execution + * overhead. + * + * There are numerous compatibility, portability and memory management + * fixes in the new header as well as additional OpenCL 2.0 features. + * As a result the header is not directly backward compatible and for this + * reason we release it as opencl.hpp rather than a new version of cl.hpp. + * + * + * \section compatibility Compatibility + * Due to the evolution of the underlying OpenCL API the 2.0 C++ bindings + * include an updated approach to defining supported feature versions + * and the range of valid underlying OpenCL runtime versions supported. + * + * The combination of preprocessor macros CL_HPP_TARGET_OPENCL_VERSION and + * CL_HPP_MINIMUM_OPENCL_VERSION control this range. These are three digit + * decimal values representing OpenCL runtime versions. The default for + * the target is 300, representing OpenCL 3.0. The minimum is defined as 200. + * These settings would use 2.0 and newer API calls only. + * If backward compatibility with a 1.2 runtime is required, the minimum + * version may be set to 120. + * + * Note that this is a compile-time setting, and so affects linking against + * a particular SDK version rather than the versioning of the loaded runtime. + * + * The earlier versions of the header included basic vector and string + * classes based loosely on STL versions. These were difficult to + * maintain and very rarely used. For the 2.0 header we now assume + * the presence of the standard library unless requested otherwise. + * We use std::array, std::vector, std::shared_ptr and std::string + * throughout to safely manage memory and reduce the chance of a + * recurrance of earlier memory management bugs. + * + * These classes are used through typedefs in the cl namespace: + * cl::array, cl::vector, cl::pointer and cl::string. + * In addition cl::allocate_pointer forwards to std::allocate_shared + * by default. + * In all cases these standard library classes can be replaced with + * custom interface-compatible versions using the CL_HPP_NO_STD_ARRAY, + * CL_HPP_NO_STD_VECTOR, CL_HPP_NO_STD_UNIQUE_PTR and + * CL_HPP_NO_STD_STRING macros. + * + * The OpenCL 1.x versions of the C++ bindings included a size_t wrapper + * class to interface with kernel enqueue. This caused unpleasant interactions + * with the standard size_t declaration and led to namespacing bugs. + * In the 2.0 version we have replaced this with a std::array-based interface. + * However, the old behaviour can be regained for backward compatibility + * using the CL_HPP_ENABLE_SIZE_T_COMPATIBILITY macro. + * + * Finally, the program construction interface used a clumsy vector-of-pairs + * design in the earlier versions. We have replaced that with a cleaner + * vector-of-vectors and vector-of-strings design. However, for backward + * compatibility old behaviour can be regained with the + * CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY macro. + * + * In OpenCL 2.0 OpenCL C is not entirely backward compatibility with + * earlier versions. As a result a flag must be passed to the OpenCL C + * compiled to request OpenCL 2.0 compilation of kernels with 1.2 as + * the default in the absence of the flag. + * In some cases the C++ bindings automatically compile code for ease. + * For those cases the compilation defaults to OpenCL C 2.0. + * If this is not wanted, the CL_HPP_CL_1_2_DEFAULT_BUILD macro may + * be specified to assume 1.2 compilation. + * If more fine-grained decisions on a per-kernel bases are required + * then explicit build operations that take the flag should be used. + * + * + * \section parameterization Parameters + * This header may be parameterized by a set of preprocessor macros. + * + * - CL_HPP_TARGET_OPENCL_VERSION + * + * Defines the target OpenCL runtime version to build the header + * against. Defaults to 300, representing OpenCL 3.0. + * + * - CL_HPP_MINIMUM_OPENCL_VERSION + * + * Defines the minimum OpenCL runtime version to build the header + * against. Defaults to 200, representing OpenCL 2.0. + * + * - CL_HPP_NO_STD_STRING + * + * Do not use the standard library string class. cl::string is not + * defined and may be defined by the user before opencl.hpp is + * included. + * + * - CL_HPP_NO_STD_VECTOR + * + * Do not use the standard library vector class. cl::vector is not + * defined and may be defined by the user before opencl.hpp is + * included. + * + * - CL_HPP_NO_STD_ARRAY + * + * Do not use the standard library array class. cl::array is not + * defined and may be defined by the user before opencl.hpp is + * included. + * + * - CL_HPP_NO_STD_UNIQUE_PTR + * + * Do not use the standard library unique_ptr class. cl::pointer and + * the cl::allocate_pointer functions are not defined and may be + * defined by the user before opencl.hpp is included. + * + * - CL_HPP_ENABLE_EXCEPTIONS + * + * Enable exceptions for use in the C++ bindings header. This is the + * preferred error handling mechanism but is not required. + * + * - CL_HPP_ENABLE_SIZE_T_COMPATIBILITY + * + * Backward compatibility option to support cl.hpp-style size_t + * class. Replaces the updated std::array derived version and + * removal of size_t from the namespace. Note that in this case the + * new size_t class is placed in the cl::compatibility namespace and + * thus requires an additional using declaration for direct backward + * compatibility. + * + * - CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY + * + * Enable older vector of pairs interface for construction of + * programs. + * + * - CL_HPP_CL_1_2_DEFAULT_BUILD + * + * Default to OpenCL C 1.2 compilation rather than OpenCL C 2.0 + * applies to use of cl::Program construction and other program + * build variants. + * + * + * - CL_HPP_USE_CL_SUB_GROUPS_KHR + * + * Enable the cl_khr_subgroups extension. + * + * - CL_HPP_USE_DX_INTEROP + * + * Enable the cl_khr_d3d10_sharing extension. + * + * - CL_HPP_USE_IL_KHR + * + * Enable the cl_khr_il_program extension. + * + * + * \section example Example + * + * The following example shows a general use case for the C++ + * bindings, including support for the optional exception feature and + * also the supplied vector and string classes, see following sections for + * decriptions of these features. + * + * Note: the C++ bindings use std::call_once and therefore may need to be + * compiled using special command-line options (such as "-pthread") on some + * platforms! + * + * \code + #define CL_HPP_ENABLE_EXCEPTIONS + #define CL_HPP_TARGET_OPENCL_VERSION 200 + + #include + #include + #include + #include + #include + + const int numElements = 32; + + int main(void) + { + // Filter for a 2.0 or newer platform and set it as the default + std::vector platforms; + cl::Platform::get(&platforms); + cl::Platform plat; + for (auto &p : platforms) { + std::string platver = p.getInfo(); + if (platver.find("OpenCL 2.") != std::string::npos || + platver.find("OpenCL 3.") != std::string::npos) { + // Note: an OpenCL 3.x platform may not support all required features! + plat = p; + } + } + if (plat() == 0) { + std::cout << "No OpenCL 2.0 or newer platform found.\n"; + return -1; + } + + cl::Platform newP = cl::Platform::setDefault(plat); + if (newP != plat) { + std::cout << "Error setting default platform.\n"; + return -1; + } + + // C++11 raw string literal for the first kernel + std::string kernel1{R"CLC( + global int globalA; + kernel void updateGlobal() + { + globalA = 75; + } + )CLC"}; + + // Raw string literal for the second kernel + std::string kernel2{R"CLC( + typedef struct { global int *bar; } Foo; + kernel void vectorAdd(global const Foo* aNum, global const int *inputA, global const int *inputB, + global int *output, int val, write_only pipe int outPipe, queue_t childQueue) + { + output[get_global_id(0)] = inputA[get_global_id(0)] + inputB[get_global_id(0)] + val + *(aNum->bar); + write_pipe(outPipe, &val); + queue_t default_queue = get_default_queue(); + ndrange_t ndrange = ndrange_1D(get_global_size(0)/2, get_global_size(0)/2); + + // Have a child kernel write into third quarter of output + enqueue_kernel(default_queue, CLK_ENQUEUE_FLAGS_WAIT_KERNEL, ndrange, + ^{ + output[get_global_size(0)*2 + get_global_id(0)] = + inputA[get_global_size(0)*2 + get_global_id(0)] + inputB[get_global_size(0)*2 + get_global_id(0)] + globalA; + }); + + // Have a child kernel write into last quarter of output + enqueue_kernel(childQueue, CLK_ENQUEUE_FLAGS_WAIT_KERNEL, ndrange, + ^{ + output[get_global_size(0)*3 + get_global_id(0)] = + inputA[get_global_size(0)*3 + get_global_id(0)] + inputB[get_global_size(0)*3 + get_global_id(0)] + globalA + 2; + }); + } + )CLC"}; + + std::vector programStrings; + programStrings.push_back(kernel1); + programStrings.push_back(kernel2); + + cl::Program vectorAddProgram(programStrings); + try { + vectorAddProgram.build("-cl-std=CL2.0"); + } + catch (...) { + // Print build info for all devices + cl_int buildErr = CL_SUCCESS; + auto buildInfo = vectorAddProgram.getBuildInfo(&buildErr); + for (auto &pair : buildInfo) { + std::cerr << pair.second << std::endl << std::endl; + } + + return 1; + } + + typedef struct { int *bar; } Foo; + + // Get and run kernel that initializes the program-scope global + // A test for kernels that take no arguments + auto program2Kernel = + cl::KernelFunctor<>(vectorAddProgram, "updateGlobal"); + program2Kernel( + cl::EnqueueArgs( + cl::NDRange(1))); + + ////////////////// + // SVM allocations + + auto anSVMInt = cl::allocate_svm>(); + *anSVMInt = 5; + cl::SVMAllocator>> svmAllocReadOnly; + auto fooPointer = cl::allocate_pointer(svmAllocReadOnly); + fooPointer->bar = anSVMInt.get(); + cl::SVMAllocator> svmAlloc; + std::vector>> inputA(numElements, 1, svmAlloc); + cl::coarse_svm_vector inputB(numElements, 2, svmAlloc); + + ////////////// + // Traditional cl_mem allocations + + std::vector output(numElements, 0xdeadbeef); + cl::Buffer outputBuffer(output.begin(), output.end(), false); + cl::Pipe aPipe(sizeof(cl_int), numElements / 2); + + // Default command queue, also passed in as a parameter + cl::DeviceCommandQueue defaultDeviceQueue = cl::DeviceCommandQueue::makeDefault( + cl::Context::getDefault(), cl::Device::getDefault()); + + auto vectorAddKernel = + cl::KernelFunctor< + decltype(fooPointer)&, + int*, + cl::coarse_svm_vector&, + cl::Buffer, + int, + cl::Pipe&, + cl::DeviceCommandQueue + >(vectorAddProgram, "vectorAdd"); + + // Ensure that the additional SVM pointer is available to the kernel + // This one was not passed as a parameter + vectorAddKernel.setSVMPointers(anSVMInt); + + cl_int error; + vectorAddKernel( + cl::EnqueueArgs( + cl::NDRange(numElements/2), + cl::NDRange(numElements/2)), + fooPointer, + inputA.data(), + inputB, + outputBuffer, + 3, + aPipe, + defaultDeviceQueue, + error + ); + + cl::copy(outputBuffer, output.begin(), output.end()); + + cl::Device d = cl::Device::getDefault(); + + std::cout << "Output:\n"; + for (int i = 1; i < numElements; ++i) { + std::cout << "\t" << output[i] << "\n"; + } + std::cout << "\n\n"; + + return 0; + } + * + * \endcode + * + */ +#ifndef CL_HPP_ +#define CL_HPP_ + +/* Handle deprecated preprocessor definitions. In each case, we only check for + * the old name if the new name is not defined, so that user code can define + * both and hence work with either version of the bindings. + */ +#if !defined(CL_HPP_USE_DX_INTEROP) && defined(USE_DX_INTEROP) +# pragma message("opencl.hpp: USE_DX_INTEROP is deprecated. Define CL_HPP_USE_DX_INTEROP instead") +# define CL_HPP_USE_DX_INTEROP +#endif +#if !defined(CL_HPP_ENABLE_EXCEPTIONS) && defined(__CL_ENABLE_EXCEPTIONS) +# pragma message("opencl.hpp: __CL_ENABLE_EXCEPTIONS is deprecated. Define CL_HPP_ENABLE_EXCEPTIONS instead") +# define CL_HPP_ENABLE_EXCEPTIONS +#endif +#if !defined(CL_HPP_NO_STD_VECTOR) && defined(__NO_STD_VECTOR) +# pragma message("opencl.hpp: __NO_STD_VECTOR is deprecated. Define CL_HPP_NO_STD_VECTOR instead") +# define CL_HPP_NO_STD_VECTOR +#endif +#if !defined(CL_HPP_NO_STD_STRING) && defined(__NO_STD_STRING) +# pragma message("opencl.hpp: __NO_STD_STRING is deprecated. Define CL_HPP_NO_STD_STRING instead") +# define CL_HPP_NO_STD_STRING +#endif +#if defined(VECTOR_CLASS) +# pragma message("opencl.hpp: VECTOR_CLASS is deprecated. Alias cl::vector instead") +#endif +#if defined(STRING_CLASS) +# pragma message("opencl.hpp: STRING_CLASS is deprecated. Alias cl::string instead.") +#endif +#if !defined(CL_HPP_USER_OVERRIDE_ERROR_STRINGS) && defined(__CL_USER_OVERRIDE_ERROR_STRINGS) +# pragma message("opencl.hpp: __CL_USER_OVERRIDE_ERROR_STRINGS is deprecated. Define CL_HPP_USER_OVERRIDE_ERROR_STRINGS instead") +# define CL_HPP_USER_OVERRIDE_ERROR_STRINGS +#endif + +/* Warn about features that are no longer supported + */ +#if defined(__USE_DEV_VECTOR) +# pragma message("opencl.hpp: __USE_DEV_VECTOR is no longer supported. Expect compilation errors") +#endif +#if defined(__USE_DEV_STRING) +# pragma message("opencl.hpp: __USE_DEV_STRING is no longer supported. Expect compilation errors") +#endif + +/* Detect which version to target */ +#if !defined(CL_HPP_TARGET_OPENCL_VERSION) +# pragma message("opencl.hpp: CL_HPP_TARGET_OPENCL_VERSION is not defined. It will default to 300 (OpenCL 3.0)") +# define CL_HPP_TARGET_OPENCL_VERSION 300 +#endif +#if CL_HPP_TARGET_OPENCL_VERSION != 100 && \ + CL_HPP_TARGET_OPENCL_VERSION != 110 && \ + CL_HPP_TARGET_OPENCL_VERSION != 120 && \ + CL_HPP_TARGET_OPENCL_VERSION != 200 && \ + CL_HPP_TARGET_OPENCL_VERSION != 210 && \ + CL_HPP_TARGET_OPENCL_VERSION != 220 && \ + CL_HPP_TARGET_OPENCL_VERSION != 300 +# pragma message("opencl.hpp: CL_HPP_TARGET_OPENCL_VERSION is not a valid value (100, 110, 120, 200, 210, 220 or 300). It will be set to 300 (OpenCL 3.0).") +# undef CL_HPP_TARGET_OPENCL_VERSION +# define CL_HPP_TARGET_OPENCL_VERSION 300 +#endif + +/* Forward target OpenCL version to C headers if necessary */ +#if defined(CL_TARGET_OPENCL_VERSION) +/* Warn if prior definition of CL_TARGET_OPENCL_VERSION is lower than + * requested C++ bindings version */ +#if CL_TARGET_OPENCL_VERSION < CL_HPP_TARGET_OPENCL_VERSION +# pragma message("CL_TARGET_OPENCL_VERSION is already defined as is lower than CL_HPP_TARGET_OPENCL_VERSION") +#endif +#else +# define CL_TARGET_OPENCL_VERSION CL_HPP_TARGET_OPENCL_VERSION +#endif + +#if !defined(CL_HPP_MINIMUM_OPENCL_VERSION) +# define CL_HPP_MINIMUM_OPENCL_VERSION 200 +#endif +#if CL_HPP_MINIMUM_OPENCL_VERSION != 100 && \ + CL_HPP_MINIMUM_OPENCL_VERSION != 110 && \ + CL_HPP_MINIMUM_OPENCL_VERSION != 120 && \ + CL_HPP_MINIMUM_OPENCL_VERSION != 200 && \ + CL_HPP_MINIMUM_OPENCL_VERSION != 210 && \ + CL_HPP_MINIMUM_OPENCL_VERSION != 220 && \ + CL_HPP_MINIMUM_OPENCL_VERSION != 300 +# pragma message("opencl.hpp: CL_HPP_MINIMUM_OPENCL_VERSION is not a valid value (100, 110, 120, 200, 210, 220 or 300). It will be set to 100") +# undef CL_HPP_MINIMUM_OPENCL_VERSION +# define CL_HPP_MINIMUM_OPENCL_VERSION 100 +#endif +#if CL_HPP_MINIMUM_OPENCL_VERSION > CL_HPP_TARGET_OPENCL_VERSION +# error "CL_HPP_MINIMUM_OPENCL_VERSION must not be greater than CL_HPP_TARGET_OPENCL_VERSION" +#endif + +#if CL_HPP_MINIMUM_OPENCL_VERSION <= 100 && !defined(CL_USE_DEPRECATED_OPENCL_1_0_APIS) +# define CL_USE_DEPRECATED_OPENCL_1_0_APIS +#endif +#if CL_HPP_MINIMUM_OPENCL_VERSION <= 110 && !defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) +# define CL_USE_DEPRECATED_OPENCL_1_1_APIS +#endif +#if CL_HPP_MINIMUM_OPENCL_VERSION <= 120 && !defined(CL_USE_DEPRECATED_OPENCL_1_2_APIS) +# define CL_USE_DEPRECATED_OPENCL_1_2_APIS +#endif +#if CL_HPP_MINIMUM_OPENCL_VERSION <= 200 && !defined(CL_USE_DEPRECATED_OPENCL_2_0_APIS) +# define CL_USE_DEPRECATED_OPENCL_2_0_APIS +#endif +#if CL_HPP_MINIMUM_OPENCL_VERSION <= 210 && !defined(CL_USE_DEPRECATED_OPENCL_2_1_APIS) +# define CL_USE_DEPRECATED_OPENCL_2_1_APIS +#endif +#if CL_HPP_MINIMUM_OPENCL_VERSION <= 220 && !defined(CL_USE_DEPRECATED_OPENCL_2_2_APIS) +# define CL_USE_DEPRECATED_OPENCL_2_2_APIS +#endif + +#ifdef _WIN32 + +#include + +#if defined(CL_HPP_USE_DX_INTEROP) +#include +#include +#endif +#endif // _WIN32 + +#if defined(_MSC_VER) +#include +#endif // _MSC_VER + + // Check for a valid C++ version + +// Need to do both tests here because for some reason __cplusplus is not +// updated in visual studio +#if (!defined(_MSC_VER) && __cplusplus < 201103L) || (defined(_MSC_VER) && _MSC_VER < 1700) +#error Visual studio 2013 or another C++11-supporting compiler required +#endif + +#if defined(__APPLE__) || defined(__MACOSX) +#include +#else +#include +#endif // !__APPLE__ + +#if __cplusplus >= 201703L +# define CL_HPP_DEFINE_STATIC_MEMBER_ inline +#elif defined(_MSC_VER) +# define CL_HPP_DEFINE_STATIC_MEMBER_ __declspec(selectany) +#elif defined(__MINGW32__) +# define CL_HPP_DEFINE_STATIC_MEMBER_ __attribute__((selectany)) +#else +# define CL_HPP_DEFINE_STATIC_MEMBER_ __attribute__((weak)) +#endif // !_MSC_VER + +// Define deprecated prefixes and suffixes to ensure compilation +// in case they are not pre-defined +#if !defined(CL_API_PREFIX__VERSION_1_1_DEPRECATED) +#define CL_API_PREFIX__VERSION_1_1_DEPRECATED +#endif // #if !defined(CL_API_PREFIX__VERSION_1_1_DEPRECATED) +#if !defined(CL_API_SUFFIX__VERSION_1_1_DEPRECATED) +#define CL_API_SUFFIX__VERSION_1_1_DEPRECATED +#endif // #if !defined(CL_API_SUFFIX__VERSION_1_1_DEPRECATED) + +#if !defined(CL_API_PREFIX__VERSION_1_2_DEPRECATED) +#define CL_API_PREFIX__VERSION_1_2_DEPRECATED +#endif // #if !defined(CL_API_PREFIX__VERSION_1_2_DEPRECATED) +#if !defined(CL_API_SUFFIX__VERSION_1_2_DEPRECATED) +#define CL_API_SUFFIX__VERSION_1_2_DEPRECATED +#endif // #if !defined(CL_API_SUFFIX__VERSION_1_2_DEPRECATED) + +#if !defined(CL_API_PREFIX__VERSION_2_2_DEPRECATED) +#define CL_API_PREFIX__VERSION_2_2_DEPRECATED +#endif // #if !defined(CL_API_PREFIX__VERSION_2_2_DEPRECATED) +#if !defined(CL_API_SUFFIX__VERSION_2_2_DEPRECATED) +#define CL_API_SUFFIX__VERSION_2_2_DEPRECATED +#endif // #if !defined(CL_API_SUFFIX__VERSION_2_2_DEPRECATED) + +#if !defined(CL_CALLBACK) +#define CL_CALLBACK +#endif //CL_CALLBACK + +#include +#include +#include +#include +#include +#include + + +// Define a size_type to represent a correctly resolved size_t +#if defined(CL_HPP_ENABLE_SIZE_T_COMPATIBILITY) +namespace cl { + using size_type = ::size_t; +} // namespace cl +#else // #if defined(CL_HPP_ENABLE_SIZE_T_COMPATIBILITY) +namespace cl { + using size_type = size_t; +} // namespace cl +#endif // #if defined(CL_HPP_ENABLE_SIZE_T_COMPATIBILITY) + + +#if defined(CL_HPP_ENABLE_EXCEPTIONS) +#include +#endif // #if defined(CL_HPP_ENABLE_EXCEPTIONS) + +#if !defined(CL_HPP_NO_STD_VECTOR) +#include +namespace cl { + template < class T, class Alloc = std::allocator > + using vector = std::vector; +} // namespace cl +#endif // #if !defined(CL_HPP_NO_STD_VECTOR) + +#if !defined(CL_HPP_NO_STD_STRING) +#include +namespace cl { + using string = std::string; +} // namespace cl +#endif // #if !defined(CL_HPP_NO_STD_STRING) + +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 + +#if !defined(CL_HPP_NO_STD_UNIQUE_PTR) +#include +namespace cl { + // Replace unique_ptr and allocate_pointer for internal use + // to allow user to replace them + template + using pointer = std::unique_ptr; +} // namespace cl +#endif +#endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 200 +#if !defined(CL_HPP_NO_STD_ARRAY) +#include +namespace cl { + template < class T, size_type N > + using array = std::array; +} // namespace cl +#endif // #if !defined(CL_HPP_NO_STD_ARRAY) + +// Define size_type appropriately to allow backward-compatibility +// use of the old size_t interface class +#if defined(CL_HPP_ENABLE_SIZE_T_COMPATIBILITY) +namespace cl { + namespace compatibility { + /*! \brief class used to interface between C++ and + * OpenCL C calls that require arrays of size_t values, whose + * size is known statically. + */ + template + class size_t + { + private: + size_type data_[N]; + + public: + //! \brief Initialize size_t to all 0s + size_t() + { + for (int i = 0; i < N; ++i) { + data_[i] = 0; + } + } + + size_t(const array &rhs) + { + for (int i = 0; i < N; ++i) { + data_[i] = rhs[i]; + } + } + + size_type& operator[](int index) + { + return data_[index]; + } + + const size_type& operator[](int index) const + { + return data_[index]; + } + + //! \brief Conversion operator to T*. + operator size_type* () { return data_; } + + //! \brief Conversion operator to const T*. + operator const size_type* () const { return data_; } + + operator array() const + { + array ret; + + for (int i = 0; i < N; ++i) { + ret[i] = data_[i]; + } + return ret; + } + }; + } // namespace compatibility + + template + using size_t = compatibility::size_t; +} // namespace cl +#endif // #if defined(CL_HPP_ENABLE_SIZE_T_COMPATIBILITY) + +// Helper alias to avoid confusing the macros +namespace cl { + namespace detail { + using size_t_array = array; + } // namespace detail +} // namespace cl + + +/*! \namespace cl + * + * \brief The OpenCL C++ bindings are defined within this namespace. + * + */ +namespace cl { + +#define CL_HPP_CREATE_CL_EXT_FCN_PTR_ALIAS_(name) \ + using PFN_##name = name##_fn + +#define CL_HPP_INIT_CL_EXT_FCN_PTR_(name) \ + if (!pfn_##name) { \ + pfn_##name = (PFN_##name)clGetExtensionFunctionAddress(#name); \ + } + +#define CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, name) \ + if (!pfn_##name) { \ + pfn_##name = (PFN_##name) \ + clGetExtensionFunctionAddressForPlatform(platform, #name); \ + } + +#ifdef cl_khr_external_memory + enum class ExternalMemoryType : cl_external_memory_handle_type_khr; +#endif + + class Memory; + class Platform; + class Program; + class Device; + class Context; + class CommandQueue; + class DeviceCommandQueue; + class Memory; + class Buffer; + class Pipe; +#ifdef cl_khr_semaphore + class Semaphore; +#endif +#if defined(cl_khr_command_buffer) + class CommandBufferKhr; + class MutableCommandKhr; +#endif // cl_khr_command_buffer + +#if defined(CL_HPP_ENABLE_EXCEPTIONS) + /*! \brief Exception class + * + * This may be thrown by API functions when CL_HPP_ENABLE_EXCEPTIONS is defined. + */ + class Error : public std::exception + { + private: + cl_int err_; + const char * errStr_; + public: + /*! \brief Create a new CL error exception for a given error code + * and corresponding message. + * + * \param err error code value. + * + * \param errStr a descriptive string that must remain in scope until + * handling of the exception has concluded. If set, it + * will be returned by what(). + */ + Error(cl_int err, const char * errStr = nullptr) : err_(err), errStr_(errStr) + {} + + /*! \brief Get error string associated with exception + * + * \return A memory pointer to the error message string. + */ + const char * what() const noexcept override + { + if (errStr_ == nullptr) { + return "empty"; + } + else { + return errStr_; + } + } + + /*! \brief Get error code associated with exception + * + * \return The error code. + */ + cl_int err(void) const { return err_; } + }; +#define CL_HPP_ERR_STR_(x) #x +#else +#define CL_HPP_ERR_STR_(x) nullptr +#endif // CL_HPP_ENABLE_EXCEPTIONS + + +namespace detail +{ +#if defined(CL_HPP_ENABLE_EXCEPTIONS) +static inline cl_int errHandler ( + cl_int err, + const char * errStr = nullptr) +{ + if (err != CL_SUCCESS) { + throw Error(err, errStr); + } + return err; +} +#else +static inline cl_int errHandler (cl_int err, const char * errStr = nullptr) +{ + (void) errStr; // suppress unused variable warning + return err; +} +#endif // CL_HPP_ENABLE_EXCEPTIONS +} + + + +//! \cond DOXYGEN_DETAIL +#if !defined(CL_HPP_USER_OVERRIDE_ERROR_STRINGS) +#define __GET_DEVICE_INFO_ERR CL_HPP_ERR_STR_(clGetDeviceInfo) +#define __GET_PLATFORM_INFO_ERR CL_HPP_ERR_STR_(clGetPlatformInfo) +#define __GET_DEVICE_IDS_ERR CL_HPP_ERR_STR_(clGetDeviceIDs) +#define __GET_PLATFORM_IDS_ERR CL_HPP_ERR_STR_(clGetPlatformIDs) +#define __GET_CONTEXT_INFO_ERR CL_HPP_ERR_STR_(clGetContextInfo) +#define __GET_EVENT_INFO_ERR CL_HPP_ERR_STR_(clGetEventInfo) +#define __GET_EVENT_PROFILE_INFO_ERR CL_HPP_ERR_STR_(clGetEventProfileInfo) +#define __GET_MEM_OBJECT_INFO_ERR CL_HPP_ERR_STR_(clGetMemObjectInfo) +#define __GET_IMAGE_INFO_ERR CL_HPP_ERR_STR_(clGetImageInfo) +#define __GET_SAMPLER_INFO_ERR CL_HPP_ERR_STR_(clGetSamplerInfo) +#define __GET_KERNEL_INFO_ERR CL_HPP_ERR_STR_(clGetKernelInfo) +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 +#define __GET_KERNEL_ARG_INFO_ERR CL_HPP_ERR_STR_(clGetKernelArgInfo) +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 120 +#if CL_HPP_TARGET_OPENCL_VERSION >= 210 +#define __GET_KERNEL_SUB_GROUP_INFO_ERR CL_HPP_ERR_STR_(clGetKernelSubGroupInfo) +#else +#define __GET_KERNEL_SUB_GROUP_INFO_ERR CL_HPP_ERR_STR_(clGetKernelSubGroupInfoKHR) +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 210 +#define __GET_KERNEL_WORK_GROUP_INFO_ERR CL_HPP_ERR_STR_(clGetKernelWorkGroupInfo) +#define __GET_PROGRAM_INFO_ERR CL_HPP_ERR_STR_(clGetProgramInfo) +#define __GET_PROGRAM_BUILD_INFO_ERR CL_HPP_ERR_STR_(clGetProgramBuildInfo) +#define __GET_COMMAND_QUEUE_INFO_ERR CL_HPP_ERR_STR_(clGetCommandQueueInfo) + +#define __CREATE_CONTEXT_ERR CL_HPP_ERR_STR_(clCreateContext) +#define __CREATE_CONTEXT_FROM_TYPE_ERR CL_HPP_ERR_STR_(clCreateContextFromType) +#define __GET_SUPPORTED_IMAGE_FORMATS_ERR CL_HPP_ERR_STR_(clGetSupportedImageFormats) +#if CL_HPP_TARGET_OPENCL_VERSION >= 300 +#define __SET_CONTEXT_DESCTRUCTOR_CALLBACK_ERR CL_HPP_ERR_STR_(clSetContextDestructorCallback) +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 300 + +#define __CREATE_BUFFER_ERR CL_HPP_ERR_STR_(clCreateBuffer) +#define __COPY_ERR CL_HPP_ERR_STR_(cl::copy) +#define __CREATE_SUBBUFFER_ERR CL_HPP_ERR_STR_(clCreateSubBuffer) +#define __CREATE_GL_BUFFER_ERR CL_HPP_ERR_STR_(clCreateFromGLBuffer) +#define __CREATE_GL_RENDER_BUFFER_ERR CL_HPP_ERR_STR_(clCreateFromGLBuffer) +#define __GET_GL_OBJECT_INFO_ERR CL_HPP_ERR_STR_(clGetGLObjectInfo) +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 +#define __CREATE_IMAGE_ERR CL_HPP_ERR_STR_(clCreateImage) +#define __CREATE_GL_TEXTURE_ERR CL_HPP_ERR_STR_(clCreateFromGLTexture) +#define __IMAGE_DIMENSION_ERR CL_HPP_ERR_STR_(Incorrect image dimensions) +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 120 +#define __SET_MEM_OBJECT_DESTRUCTOR_CALLBACK_ERR CL_HPP_ERR_STR_(clSetMemObjectDestructorCallback) + +#define __CREATE_USER_EVENT_ERR CL_HPP_ERR_STR_(clCreateUserEvent) +#define __SET_USER_EVENT_STATUS_ERR CL_HPP_ERR_STR_(clSetUserEventStatus) +#define __SET_EVENT_CALLBACK_ERR CL_HPP_ERR_STR_(clSetEventCallback) +#define __WAIT_FOR_EVENTS_ERR CL_HPP_ERR_STR_(clWaitForEvents) + +#define __CREATE_KERNEL_ERR CL_HPP_ERR_STR_(clCreateKernel) +#define __SET_KERNEL_ARGS_ERR CL_HPP_ERR_STR_(clSetKernelArg) +#define __CREATE_PROGRAM_WITH_SOURCE_ERR CL_HPP_ERR_STR_(clCreateProgramWithSource) +#define __CREATE_PROGRAM_WITH_BINARY_ERR CL_HPP_ERR_STR_(clCreateProgramWithBinary) +#if CL_HPP_TARGET_OPENCL_VERSION >= 210 +#define __CREATE_PROGRAM_WITH_IL_ERR CL_HPP_ERR_STR_(clCreateProgramWithIL) +#else +#define __CREATE_PROGRAM_WITH_IL_ERR CL_HPP_ERR_STR_(clCreateProgramWithILKHR) +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 210 +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 +#define __CREATE_PROGRAM_WITH_BUILT_IN_KERNELS_ERR CL_HPP_ERR_STR_(clCreateProgramWithBuiltInKernels) +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 120 +#define __BUILD_PROGRAM_ERR CL_HPP_ERR_STR_(clBuildProgram) +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 +#define __COMPILE_PROGRAM_ERR CL_HPP_ERR_STR_(clCompileProgram) +#define __LINK_PROGRAM_ERR CL_HPP_ERR_STR_(clLinkProgram) +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 120 +#define __CREATE_KERNELS_IN_PROGRAM_ERR CL_HPP_ERR_STR_(clCreateKernelsInProgram) + +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 +#define __CREATE_COMMAND_QUEUE_WITH_PROPERTIES_ERR CL_HPP_ERR_STR_(clCreateCommandQueueWithProperties) +#define __CREATE_SAMPLER_WITH_PROPERTIES_ERR CL_HPP_ERR_STR_(clCreateSamplerWithProperties) +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 200 +#define __SET_COMMAND_QUEUE_PROPERTY_ERR CL_HPP_ERR_STR_(clSetCommandQueueProperty) +#define __ENQUEUE_READ_BUFFER_ERR CL_HPP_ERR_STR_(clEnqueueReadBuffer) +#define __ENQUEUE_READ_BUFFER_RECT_ERR CL_HPP_ERR_STR_(clEnqueueReadBufferRect) +#define __ENQUEUE_WRITE_BUFFER_ERR CL_HPP_ERR_STR_(clEnqueueWriteBuffer) +#define __ENQUEUE_WRITE_BUFFER_RECT_ERR CL_HPP_ERR_STR_(clEnqueueWriteBufferRect) +#define __ENQEUE_COPY_BUFFER_ERR CL_HPP_ERR_STR_(clEnqueueCopyBuffer) +#define __ENQEUE_COPY_BUFFER_RECT_ERR CL_HPP_ERR_STR_(clEnqueueCopyBufferRect) +#define __ENQUEUE_FILL_BUFFER_ERR CL_HPP_ERR_STR_(clEnqueueFillBuffer) +#define __ENQUEUE_READ_IMAGE_ERR CL_HPP_ERR_STR_(clEnqueueReadImage) +#define __ENQUEUE_WRITE_IMAGE_ERR CL_HPP_ERR_STR_(clEnqueueWriteImage) +#define __ENQUEUE_COPY_IMAGE_ERR CL_HPP_ERR_STR_(clEnqueueCopyImage) +#define __ENQUEUE_FILL_IMAGE_ERR CL_HPP_ERR_STR_(clEnqueueFillImage) +#define __ENQUEUE_COPY_IMAGE_TO_BUFFER_ERR CL_HPP_ERR_STR_(clEnqueueCopyImageToBuffer) +#define __ENQUEUE_COPY_BUFFER_TO_IMAGE_ERR CL_HPP_ERR_STR_(clEnqueueCopyBufferToImage) +#define __ENQUEUE_MAP_BUFFER_ERR CL_HPP_ERR_STR_(clEnqueueMapBuffer) +#define __ENQUEUE_MAP_SVM_ERR CL_HPP_ERR_STR_(clEnqueueSVMMap) +#define __ENQUEUE_FILL_SVM_ERR CL_HPP_ERR_STR_(clEnqueueSVMMemFill) +#define __ENQUEUE_COPY_SVM_ERR CL_HPP_ERR_STR_(clEnqueueSVMMemcpy) +#define __ENQUEUE_UNMAP_SVM_ERR CL_HPP_ERR_STR_(clEnqueueSVMUnmap) +#define __ENQUEUE_MAP_IMAGE_ERR CL_HPP_ERR_STR_(clEnqueueMapImage) +#define __ENQUEUE_UNMAP_MEM_OBJECT_ERR CL_HPP_ERR_STR_(clEnqueueUnMapMemObject) +#define __ENQUEUE_NDRANGE_KERNEL_ERR CL_HPP_ERR_STR_(clEnqueueNDRangeKernel) +#define __ENQUEUE_NATIVE_KERNEL CL_HPP_ERR_STR_(clEnqueueNativeKernel) +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 +#define __ENQUEUE_MIGRATE_MEM_OBJECTS_ERR CL_HPP_ERR_STR_(clEnqueueMigrateMemObjects) +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 120 +#if CL_HPP_TARGET_OPENCL_VERSION >= 210 +#define __ENQUEUE_MIGRATE_SVM_ERR CL_HPP_ERR_STR_(clEnqueueSVMMigrateMem) +#define __SET_DEFAULT_DEVICE_COMMAND_QUEUE_ERR CL_HPP_ERR_STR_(clSetDefaultDeviceCommandQueue) +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 210 + + +#define __ENQUEUE_ACQUIRE_GL_ERR CL_HPP_ERR_STR_(clEnqueueAcquireGLObjects) +#define __ENQUEUE_RELEASE_GL_ERR CL_HPP_ERR_STR_(clEnqueueReleaseGLObjects) + +#define __CREATE_PIPE_ERR CL_HPP_ERR_STR_(clCreatePipe) +#define __GET_PIPE_INFO_ERR CL_HPP_ERR_STR_(clGetPipeInfo) + +#define __RETAIN_ERR CL_HPP_ERR_STR_(Retain Object) +#define __RELEASE_ERR CL_HPP_ERR_STR_(Release Object) +#define __FLUSH_ERR CL_HPP_ERR_STR_(clFlush) +#define __FINISH_ERR CL_HPP_ERR_STR_(clFinish) +#define __VECTOR_CAPACITY_ERR CL_HPP_ERR_STR_(Vector capacity error) + +#if CL_HPP_TARGET_OPENCL_VERSION >= 210 +#define __GET_HOST_TIMER_ERR CL_HPP_ERR_STR_(clGetHostTimer) +#define __GET_DEVICE_AND_HOST_TIMER_ERR CL_HPP_ERR_STR_(clGetDeviceAndHostTimer) +#endif +#if CL_HPP_TARGET_OPENCL_VERSION >= 220 +#define __SET_PROGRAM_RELEASE_CALLBACK_ERR CL_HPP_ERR_STR_(clSetProgramReleaseCallback) +#define __SET_PROGRAM_SPECIALIZATION_CONSTANT_ERR CL_HPP_ERR_STR_(clSetProgramSpecializationConstant) +#endif + +#ifdef cl_khr_external_memory +#define __ENQUEUE_ACQUIRE_EXTERNAL_MEMORY_ERR CL_HPP_ERR_STR_(clEnqueueAcquireExternalMemObjectsKHR) +#define __ENQUEUE_RELEASE_EXTERNAL_MEMORY_ERR CL_HPP_ERR_STR_(clEnqueueReleaseExternalMemObjectsKHR) +#endif + +#ifdef cl_khr_semaphore +#define __GET_SEMAPHORE_KHR_INFO_ERR CL_HPP_ERR_STR_(clGetSemaphoreInfoKHR) +#define __CREATE_SEMAPHORE_KHR_WITH_PROPERTIES_ERR CL_HPP_ERR_STR_(clCreateSemaphoreWithPropertiesKHR) +#define __ENQUEUE_WAIT_SEMAPHORE_KHR_ERR CL_HPP_ERR_STR_(clEnqueueWaitSemaphoresKHR) +#define __ENQUEUE_SIGNAL_SEMAPHORE_KHR_ERR CL_HPP_ERR_STR_(clEnqueueSignalSemaphoresKHR) +#define __RETAIN_SEMAPHORE_KHR_ERR CL_HPP_ERR_STR_(clRetainSemaphoreKHR) +#define __RELEASE_SEMAPHORE_KHR_ERR CL_HPP_ERR_STR_(clReleaseSemaphoreKHR) +#endif + +#ifdef cl_khr_external_semaphore +#define __GET_SEMAPHORE_HANDLE_FOR_TYPE_KHR_ERR CL_HPP_ERR_STR_(clGetSemaphoreHandleForTypeKHR) +#endif // cl_khr_external_semaphore + +#if defined(cl_khr_command_buffer) +#define __CREATE_COMMAND_BUFFER_KHR_ERR CL_HPP_ERR_STR_(clCreateCommandBufferKHR) +#define __GET_COMMAND_BUFFER_INFO_KHR_ERR CL_HPP_ERR_STR_(clGetCommandBufferInfoKHR) +#define __FINALIZE_COMMAND_BUFFER_KHR_ERR CL_HPP_ERR_STR_(clFinalizeCommandBufferKHR) +#define __ENQUEUE_COMMAND_BUFFER_KHR_ERR CL_HPP_ERR_STR_(clEnqueueCommandBufferKHR) +#define __COMMAND_BARRIER_WITH_WAIT_LIST_KHR_ERR CL_HPP_ERR_STR_(clCommandBarrierWithWaitListKHR) +#define __COMMAND_COPY_BUFFER_KHR_ERR CL_HPP_ERR_STR_(clCommandCopyBufferKHR) +#define __COMMAND_COPY_BUFFER_RECT_KHR_ERR CL_HPP_ERR_STR_(clCommandCopyBufferRectKHR) +#define __COMMAND_COPY_BUFFER_TO_IMAGE_KHR_ERR CL_HPP_ERR_STR_(clCommandCopyBufferToImageKHR) +#define __COMMAND_COPY_IMAGE_KHR_ERR CL_HPP_ERR_STR_(clCommandCopyImageKHR) +#define __COMMAND_COPY_IMAGE_TO_BUFFER_KHR_ERR CL_HPP_ERR_STR_(clCommandCopyImageToBufferKHR) +#define __COMMAND_FILL_BUFFER_KHR_ERR CL_HPP_ERR_STR_(clCommandFillBufferKHR) +#define __COMMAND_FILL_IMAGE_KHR_ERR CL_HPP_ERR_STR_(clCommandFillImageKHR) +#define __COMMAND_NDRANGE_KERNEL_KHR_ERR CL_HPP_ERR_STR_(clCommandNDRangeKernelKHR) +#define __UPDATE_MUTABLE_COMMANDS_KHR_ERR CL_HPP_ERR_STR_(clUpdateMutableCommandsKHR) +#define __GET_MUTABLE_COMMAND_INFO_KHR_ERR CL_HPP_ERR_STR_(clGetMutableCommandInfoKHR) +#define __RETAIN_COMMAND_BUFFER_KHR_ERR CL_HPP_ERR_STR_(clRetainCommandBufferKHR) +#define __RELEASE_COMMAND_BUFFER_KHR_ERR CL_HPP_ERR_STR_(clReleaseCommandBufferKHR) +#endif // cl_khr_command_buffer + +#if defined(cl_ext_image_requirements_info) +#define __GET_IMAGE_REQUIREMENT_INFO_EXT_ERR CL_HPP_ERR_STR_(clGetImageRequirementsInfoEXT) +#endif //cl_ext_image_requirements_info + +/** + * CL 1.2 version that uses device fission. + */ +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 +#define __CREATE_SUB_DEVICES_ERR CL_HPP_ERR_STR_(clCreateSubDevices) +#else +#define __CREATE_SUB_DEVICES_ERR CL_HPP_ERR_STR_(clCreateSubDevicesEXT) +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 120 + +/** + * Deprecated APIs for 1.2 + */ +#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) +#define __ENQUEUE_MARKER_ERR CL_HPP_ERR_STR_(clEnqueueMarker) +#define __ENQUEUE_WAIT_FOR_EVENTS_ERR CL_HPP_ERR_STR_(clEnqueueWaitForEvents) +#define __ENQUEUE_BARRIER_ERR CL_HPP_ERR_STR_(clEnqueueBarrier) +#define __UNLOAD_COMPILER_ERR CL_HPP_ERR_STR_(clUnloadCompiler) +#define __CREATE_GL_TEXTURE_2D_ERR CL_HPP_ERR_STR_(clCreateFromGLTexture2D) +#define __CREATE_GL_TEXTURE_3D_ERR CL_HPP_ERR_STR_(clCreateFromGLTexture3D) +#define __CREATE_IMAGE2D_ERR CL_HPP_ERR_STR_(clCreateImage2D) +#define __CREATE_IMAGE3D_ERR CL_HPP_ERR_STR_(clCreateImage3D) +#endif // #if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) + +/** + * Deprecated APIs for 2.0 + */ +#if defined(CL_USE_DEPRECATED_OPENCL_1_2_APIS) +#define __CREATE_COMMAND_QUEUE_ERR CL_HPP_ERR_STR_(clCreateCommandQueue) +#define __ENQUEUE_TASK_ERR CL_HPP_ERR_STR_(clEnqueueTask) +#define __CREATE_SAMPLER_ERR CL_HPP_ERR_STR_(clCreateSampler) +#endif // #if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) + +/** + * CL 1.2 marker and barrier commands + */ +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 +#define __ENQUEUE_MARKER_WAIT_LIST_ERR CL_HPP_ERR_STR_(clEnqueueMarkerWithWaitList) +#define __ENQUEUE_BARRIER_WAIT_LIST_ERR CL_HPP_ERR_STR_(clEnqueueBarrierWithWaitList) +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 120 + +#if CL_HPP_TARGET_OPENCL_VERSION >= 210 +#define __CLONE_KERNEL_ERR CL_HPP_ERR_STR_(clCloneKernel) +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 210 + +#endif // CL_HPP_USER_OVERRIDE_ERROR_STRINGS +//! \endcond + +#ifdef cl_khr_external_memory +CL_HPP_CREATE_CL_EXT_FCN_PTR_ALIAS_(clEnqueueAcquireExternalMemObjectsKHR); +CL_HPP_CREATE_CL_EXT_FCN_PTR_ALIAS_(clEnqueueReleaseExternalMemObjectsKHR); + +CL_HPP_DEFINE_STATIC_MEMBER_ PFN_clEnqueueAcquireExternalMemObjectsKHR pfn_clEnqueueAcquireExternalMemObjectsKHR = nullptr; +CL_HPP_DEFINE_STATIC_MEMBER_ PFN_clEnqueueReleaseExternalMemObjectsKHR pfn_clEnqueueReleaseExternalMemObjectsKHR = nullptr; +#endif // cl_khr_external_memory + +#ifdef cl_khr_semaphore +CL_HPP_CREATE_CL_EXT_FCN_PTR_ALIAS_(clCreateSemaphoreWithPropertiesKHR); +CL_HPP_CREATE_CL_EXT_FCN_PTR_ALIAS_(clReleaseSemaphoreKHR); +CL_HPP_CREATE_CL_EXT_FCN_PTR_ALIAS_(clRetainSemaphoreKHR); +CL_HPP_CREATE_CL_EXT_FCN_PTR_ALIAS_(clEnqueueWaitSemaphoresKHR); +CL_HPP_CREATE_CL_EXT_FCN_PTR_ALIAS_(clEnqueueSignalSemaphoresKHR); +CL_HPP_CREATE_CL_EXT_FCN_PTR_ALIAS_(clGetSemaphoreInfoKHR); + +CL_HPP_DEFINE_STATIC_MEMBER_ PFN_clCreateSemaphoreWithPropertiesKHR pfn_clCreateSemaphoreWithPropertiesKHR = nullptr; +CL_HPP_DEFINE_STATIC_MEMBER_ PFN_clReleaseSemaphoreKHR pfn_clReleaseSemaphoreKHR = nullptr; +CL_HPP_DEFINE_STATIC_MEMBER_ PFN_clRetainSemaphoreKHR pfn_clRetainSemaphoreKHR = nullptr; +CL_HPP_DEFINE_STATIC_MEMBER_ PFN_clEnqueueWaitSemaphoresKHR pfn_clEnqueueWaitSemaphoresKHR = nullptr; +CL_HPP_DEFINE_STATIC_MEMBER_ PFN_clEnqueueSignalSemaphoresKHR pfn_clEnqueueSignalSemaphoresKHR = nullptr; +CL_HPP_DEFINE_STATIC_MEMBER_ PFN_clGetSemaphoreInfoKHR pfn_clGetSemaphoreInfoKHR = nullptr; +#endif // cl_khr_semaphore + +#ifdef cl_khr_external_semaphore +CL_HPP_CREATE_CL_EXT_FCN_PTR_ALIAS_(clGetSemaphoreHandleForTypeKHR); +CL_HPP_DEFINE_STATIC_MEMBER_ PFN_clGetSemaphoreHandleForTypeKHR pfn_clGetSemaphoreHandleForTypeKHR = nullptr; +#endif // cl_khr_external_semaphore + +#if defined(cl_khr_command_buffer) +CL_HPP_CREATE_CL_EXT_FCN_PTR_ALIAS_(clCreateCommandBufferKHR); +CL_HPP_CREATE_CL_EXT_FCN_PTR_ALIAS_(clFinalizeCommandBufferKHR); +CL_HPP_CREATE_CL_EXT_FCN_PTR_ALIAS_(clRetainCommandBufferKHR); +CL_HPP_CREATE_CL_EXT_FCN_PTR_ALIAS_(clReleaseCommandBufferKHR); +CL_HPP_CREATE_CL_EXT_FCN_PTR_ALIAS_(clGetCommandBufferInfoKHR); +CL_HPP_CREATE_CL_EXT_FCN_PTR_ALIAS_(clEnqueueCommandBufferKHR); +CL_HPP_CREATE_CL_EXT_FCN_PTR_ALIAS_(clCommandBarrierWithWaitListKHR); +CL_HPP_CREATE_CL_EXT_FCN_PTR_ALIAS_(clCommandCopyBufferKHR); +CL_HPP_CREATE_CL_EXT_FCN_PTR_ALIAS_(clCommandCopyBufferRectKHR); +CL_HPP_CREATE_CL_EXT_FCN_PTR_ALIAS_(clCommandCopyBufferToImageKHR); +CL_HPP_CREATE_CL_EXT_FCN_PTR_ALIAS_(clCommandCopyImageKHR); +CL_HPP_CREATE_CL_EXT_FCN_PTR_ALIAS_(clCommandCopyImageToBufferKHR); +CL_HPP_CREATE_CL_EXT_FCN_PTR_ALIAS_(clCommandFillBufferKHR); +CL_HPP_CREATE_CL_EXT_FCN_PTR_ALIAS_(clCommandFillImageKHR); +CL_HPP_CREATE_CL_EXT_FCN_PTR_ALIAS_(clCommandNDRangeKernelKHR); + +CL_HPP_DEFINE_STATIC_MEMBER_ PFN_clCreateCommandBufferKHR pfn_clCreateCommandBufferKHR = nullptr; +CL_HPP_DEFINE_STATIC_MEMBER_ PFN_clFinalizeCommandBufferKHR pfn_clFinalizeCommandBufferKHR = nullptr; +CL_HPP_DEFINE_STATIC_MEMBER_ PFN_clRetainCommandBufferKHR pfn_clRetainCommandBufferKHR = nullptr; +CL_HPP_DEFINE_STATIC_MEMBER_ PFN_clReleaseCommandBufferKHR pfn_clReleaseCommandBufferKHR = nullptr; +CL_HPP_DEFINE_STATIC_MEMBER_ PFN_clGetCommandBufferInfoKHR pfn_clGetCommandBufferInfoKHR = nullptr; +CL_HPP_DEFINE_STATIC_MEMBER_ PFN_clEnqueueCommandBufferKHR pfn_clEnqueueCommandBufferKHR = nullptr; +CL_HPP_DEFINE_STATIC_MEMBER_ PFN_clCommandBarrierWithWaitListKHR pfn_clCommandBarrierWithWaitListKHR = nullptr; +CL_HPP_DEFINE_STATIC_MEMBER_ PFN_clCommandCopyBufferKHR pfn_clCommandCopyBufferKHR = nullptr; +CL_HPP_DEFINE_STATIC_MEMBER_ PFN_clCommandCopyBufferRectKHR pfn_clCommandCopyBufferRectKHR = nullptr; +CL_HPP_DEFINE_STATIC_MEMBER_ PFN_clCommandCopyBufferToImageKHR pfn_clCommandCopyBufferToImageKHR = nullptr; +CL_HPP_DEFINE_STATIC_MEMBER_ PFN_clCommandCopyImageKHR pfn_clCommandCopyImageKHR = nullptr; +CL_HPP_DEFINE_STATIC_MEMBER_ PFN_clCommandCopyImageToBufferKHR pfn_clCommandCopyImageToBufferKHR = nullptr; +CL_HPP_DEFINE_STATIC_MEMBER_ PFN_clCommandFillBufferKHR pfn_clCommandFillBufferKHR = nullptr; +CL_HPP_DEFINE_STATIC_MEMBER_ PFN_clCommandFillImageKHR pfn_clCommandFillImageKHR = nullptr; +CL_HPP_DEFINE_STATIC_MEMBER_ PFN_clCommandNDRangeKernelKHR pfn_clCommandNDRangeKernelKHR = nullptr; +#endif /* cl_khr_command_buffer */ + +#if defined(cl_khr_command_buffer_mutable_dispatch) +CL_HPP_CREATE_CL_EXT_FCN_PTR_ALIAS_(clUpdateMutableCommandsKHR); +CL_HPP_CREATE_CL_EXT_FCN_PTR_ALIAS_(clGetMutableCommandInfoKHR); + +CL_HPP_DEFINE_STATIC_MEMBER_ PFN_clUpdateMutableCommandsKHR pfn_clUpdateMutableCommandsKHR = nullptr; +CL_HPP_DEFINE_STATIC_MEMBER_ PFN_clGetMutableCommandInfoKHR pfn_clGetMutableCommandInfoKHR = nullptr; +#endif /* cl_khr_command_buffer_mutable_dispatch */ + +#if defined(cl_ext_image_requirements_info) +CL_HPP_CREATE_CL_EXT_FCN_PTR_ALIAS_(clGetImageRequirementsInfoEXT); +CL_HPP_DEFINE_STATIC_MEMBER_ PFN_clGetImageRequirementsInfoEXT pfn_clGetImageRequirementsInfoEXT = nullptr; +#endif + +namespace detail { + +// Generic getInfoHelper. The final parameter is used to guide overload +// resolution: the actual parameter passed is an int, which makes this +// a worse conversion sequence than a specialization that declares the +// parameter as an int. +template +inline cl_int getInfoHelper(Functor f, cl_uint name, T* param, long) +{ + return f(name, sizeof(T), param, nullptr); +} + +// Specialized for getInfo +// Assumes that the output vector was correctly resized on the way in +template +inline cl_int getInfoHelper(Func f, cl_uint name, vector>* param, int) +{ + if (name != CL_PROGRAM_BINARIES) { + return CL_INVALID_VALUE; + } + if (param) { + // Create array of pointers, calculate total size and pass pointer array in + size_type numBinaries = param->size(); + vector binariesPointers(numBinaries); + + for (size_type i = 0; i < numBinaries; ++i) + { + binariesPointers[i] = (*param)[i].data(); + } + + cl_int err = f(name, numBinaries * sizeof(unsigned char*), binariesPointers.data(), nullptr); + + if (err != CL_SUCCESS) { + return err; + } + } + + + return CL_SUCCESS; +} + +// Specialized getInfoHelper for vector params +template +inline cl_int getInfoHelper(Func f, cl_uint name, vector* param, long) +{ + size_type required; + cl_int err = f(name, 0, nullptr, &required); + if (err != CL_SUCCESS) { + return err; + } + const size_type elements = required / sizeof(T); + + // Temporary to avoid changing param on an error + vector localData(elements); + err = f(name, required, localData.data(), nullptr); + if (err != CL_SUCCESS) { + return err; + } + if (param) { + *param = std::move(localData); + } + + return CL_SUCCESS; +} + +/* Specialization for reference-counted types. This depends on the + * existence of Wrapper::cl_type, and none of the other types having the + * cl_type member. Note that simplify specifying the parameter as Wrapper + * does not work, because when using a derived type (e.g. Context) the generic + * template will provide a better match. + */ +template +inline cl_int getInfoHelper( + Func f, cl_uint name, vector* param, int, typename T::cl_type = 0) +{ + size_type required; + cl_int err = f(name, 0, nullptr, &required); + if (err != CL_SUCCESS) { + return err; + } + + const size_type elements = required / sizeof(typename T::cl_type); + + vector value(elements); + err = f(name, required, value.data(), nullptr); + if (err != CL_SUCCESS) { + return err; + } + + if (param) { + // Assign to convert CL type to T for each element + param->resize(elements); + + // Assign to param, constructing with retain behaviour + // to correctly capture each underlying CL object + for (size_type i = 0; i < elements; i++) { + (*param)[i] = T(value[i], true); + } + } + return CL_SUCCESS; +} + +// Specialized GetInfoHelper for string params +template +inline cl_int getInfoHelper(Func f, cl_uint name, string* param, long) +{ + size_type required; + cl_int err = f(name, 0, nullptr, &required); + if (err != CL_SUCCESS) { + return err; + } + + // std::string has a constant data member + // a char vector does not + if (required > 0) { + vector value(required); + err = f(name, required, value.data(), nullptr); + if (err != CL_SUCCESS) { + return err; + } + if (param) { + param->assign(value.begin(), value.end() - 1); + } + } + else if (param) { + param->assign(""); + } + return CL_SUCCESS; +} + +// Specialized GetInfoHelper for clsize_t params +template +inline cl_int getInfoHelper(Func f, cl_uint name, array* param, long) +{ + size_type required; + cl_int err = f(name, 0, nullptr, &required); + if (err != CL_SUCCESS) { + return err; + } + + size_type elements = required / sizeof(size_type); + vector value(elements, 0); + + err = f(name, required, value.data(), nullptr); + if (err != CL_SUCCESS) { + return err; + } + + // Bound the copy with N to prevent overruns + // if passed N > than the amount copied + if (elements > N) { + elements = N; + } + for (size_type i = 0; i < elements; ++i) { + (*param)[i] = value[i]; + } + + return CL_SUCCESS; +} + +template struct ReferenceHandler; + +/* Specialization for reference-counted types. This depends on the + * existence of Wrapper::cl_type, and none of the other types having the + * cl_type member. Note that simplify specifying the parameter as Wrapper + * does not work, because when using a derived type (e.g. Context) the generic + * template will provide a better match. + */ +template +inline cl_int getInfoHelper(Func f, cl_uint name, T* param, int, typename T::cl_type = 0) +{ + typename T::cl_type value; + cl_int err = f(name, sizeof(value), &value, nullptr); + if (err != CL_SUCCESS) { + return err; + } + *param = value; + if (value != nullptr) + { + err = param->retain(); + if (err != CL_SUCCESS) { + return err; + } + } + return CL_SUCCESS; +} + +#define CL_HPP_PARAM_NAME_INFO_1_0_(F) \ + F(cl_platform_info, CL_PLATFORM_PROFILE, string) \ + F(cl_platform_info, CL_PLATFORM_VERSION, string) \ + F(cl_platform_info, CL_PLATFORM_NAME, string) \ + F(cl_platform_info, CL_PLATFORM_VENDOR, string) \ + F(cl_platform_info, CL_PLATFORM_EXTENSIONS, string) \ + \ + F(cl_device_info, CL_DEVICE_TYPE, cl_device_type) \ + F(cl_device_info, CL_DEVICE_VENDOR_ID, cl_uint) \ + F(cl_device_info, CL_DEVICE_MAX_COMPUTE_UNITS, cl_uint) \ + F(cl_device_info, CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS, cl_uint) \ + F(cl_device_info, CL_DEVICE_MAX_WORK_GROUP_SIZE, size_type) \ + F(cl_device_info, CL_DEVICE_MAX_WORK_ITEM_SIZES, cl::vector) \ + F(cl_device_info, CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR, cl_uint) \ + F(cl_device_info, CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT, cl_uint) \ + F(cl_device_info, CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT, cl_uint) \ + F(cl_device_info, CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG, cl_uint) \ + F(cl_device_info, CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT, cl_uint) \ + F(cl_device_info, CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE, cl_uint) \ + F(cl_device_info, CL_DEVICE_MAX_CLOCK_FREQUENCY, cl_uint) \ + F(cl_device_info, CL_DEVICE_ADDRESS_BITS, cl_uint) \ + F(cl_device_info, CL_DEVICE_MAX_READ_IMAGE_ARGS, cl_uint) \ + F(cl_device_info, CL_DEVICE_MAX_WRITE_IMAGE_ARGS, cl_uint) \ + F(cl_device_info, CL_DEVICE_MAX_MEM_ALLOC_SIZE, cl_ulong) \ + F(cl_device_info, CL_DEVICE_IMAGE2D_MAX_WIDTH, size_type) \ + F(cl_device_info, CL_DEVICE_IMAGE2D_MAX_HEIGHT, size_type) \ + F(cl_device_info, CL_DEVICE_IMAGE3D_MAX_WIDTH, size_type) \ + F(cl_device_info, CL_DEVICE_IMAGE3D_MAX_HEIGHT, size_type) \ + F(cl_device_info, CL_DEVICE_IMAGE3D_MAX_DEPTH, size_type) \ + F(cl_device_info, CL_DEVICE_IMAGE_SUPPORT, cl_bool) \ + F(cl_device_info, CL_DEVICE_MAX_PARAMETER_SIZE, size_type) \ + F(cl_device_info, CL_DEVICE_MAX_SAMPLERS, cl_uint) \ + F(cl_device_info, CL_DEVICE_MEM_BASE_ADDR_ALIGN, cl_uint) \ + F(cl_device_info, CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE, cl_uint) \ + F(cl_device_info, CL_DEVICE_SINGLE_FP_CONFIG, cl_device_fp_config) \ + F(cl_device_info, CL_DEVICE_DOUBLE_FP_CONFIG, cl_device_fp_config) \ + F(cl_device_info, CL_DEVICE_HALF_FP_CONFIG, cl_device_fp_config) \ + F(cl_device_info, CL_DEVICE_GLOBAL_MEM_CACHE_TYPE, cl_device_mem_cache_type) \ + F(cl_device_info, CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE, cl_uint)\ + F(cl_device_info, CL_DEVICE_GLOBAL_MEM_CACHE_SIZE, cl_ulong) \ + F(cl_device_info, CL_DEVICE_GLOBAL_MEM_SIZE, cl_ulong) \ + F(cl_device_info, CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE, cl_ulong) \ + F(cl_device_info, CL_DEVICE_MAX_CONSTANT_ARGS, cl_uint) \ + F(cl_device_info, CL_DEVICE_LOCAL_MEM_TYPE, cl_device_local_mem_type) \ + F(cl_device_info, CL_DEVICE_LOCAL_MEM_SIZE, cl_ulong) \ + F(cl_device_info, CL_DEVICE_ERROR_CORRECTION_SUPPORT, cl_bool) \ + F(cl_device_info, CL_DEVICE_PROFILING_TIMER_RESOLUTION, size_type) \ + F(cl_device_info, CL_DEVICE_ENDIAN_LITTLE, cl_bool) \ + F(cl_device_info, CL_DEVICE_AVAILABLE, cl_bool) \ + F(cl_device_info, CL_DEVICE_COMPILER_AVAILABLE, cl_bool) \ + F(cl_device_info, CL_DEVICE_EXECUTION_CAPABILITIES, cl_device_exec_capabilities) \ + F(cl_device_info, CL_DEVICE_PLATFORM, cl::Platform) \ + F(cl_device_info, CL_DEVICE_NAME, string) \ + F(cl_device_info, CL_DEVICE_VENDOR, string) \ + F(cl_device_info, CL_DRIVER_VERSION, string) \ + F(cl_device_info, CL_DEVICE_PROFILE, string) \ + F(cl_device_info, CL_DEVICE_VERSION, string) \ + F(cl_device_info, CL_DEVICE_EXTENSIONS, string) \ + \ + F(cl_context_info, CL_CONTEXT_REFERENCE_COUNT, cl_uint) \ + F(cl_context_info, CL_CONTEXT_DEVICES, cl::vector) \ + F(cl_context_info, CL_CONTEXT_PROPERTIES, cl::vector) \ + \ + F(cl_event_info, CL_EVENT_COMMAND_QUEUE, cl::CommandQueue) \ + F(cl_event_info, CL_EVENT_COMMAND_TYPE, cl_command_type) \ + F(cl_event_info, CL_EVENT_REFERENCE_COUNT, cl_uint) \ + F(cl_event_info, CL_EVENT_COMMAND_EXECUTION_STATUS, cl_int) \ + \ + F(cl_profiling_info, CL_PROFILING_COMMAND_QUEUED, cl_ulong) \ + F(cl_profiling_info, CL_PROFILING_COMMAND_SUBMIT, cl_ulong) \ + F(cl_profiling_info, CL_PROFILING_COMMAND_START, cl_ulong) \ + F(cl_profiling_info, CL_PROFILING_COMMAND_END, cl_ulong) \ + \ + F(cl_mem_info, CL_MEM_TYPE, cl_mem_object_type) \ + F(cl_mem_info, CL_MEM_FLAGS, cl_mem_flags) \ + F(cl_mem_info, CL_MEM_SIZE, size_type) \ + F(cl_mem_info, CL_MEM_HOST_PTR, void*) \ + F(cl_mem_info, CL_MEM_MAP_COUNT, cl_uint) \ + F(cl_mem_info, CL_MEM_REFERENCE_COUNT, cl_uint) \ + F(cl_mem_info, CL_MEM_CONTEXT, cl::Context) \ + \ + F(cl_image_info, CL_IMAGE_FORMAT, cl_image_format) \ + F(cl_image_info, CL_IMAGE_ELEMENT_SIZE, size_type) \ + F(cl_image_info, CL_IMAGE_ROW_PITCH, size_type) \ + F(cl_image_info, CL_IMAGE_SLICE_PITCH, size_type) \ + F(cl_image_info, CL_IMAGE_WIDTH, size_type) \ + F(cl_image_info, CL_IMAGE_HEIGHT, size_type) \ + F(cl_image_info, CL_IMAGE_DEPTH, size_type) \ + \ + F(cl_sampler_info, CL_SAMPLER_REFERENCE_COUNT, cl_uint) \ + F(cl_sampler_info, CL_SAMPLER_CONTEXT, cl::Context) \ + F(cl_sampler_info, CL_SAMPLER_NORMALIZED_COORDS, cl_bool) \ + F(cl_sampler_info, CL_SAMPLER_ADDRESSING_MODE, cl_addressing_mode) \ + F(cl_sampler_info, CL_SAMPLER_FILTER_MODE, cl_filter_mode) \ + \ + F(cl_program_info, CL_PROGRAM_REFERENCE_COUNT, cl_uint) \ + F(cl_program_info, CL_PROGRAM_CONTEXT, cl::Context) \ + F(cl_program_info, CL_PROGRAM_NUM_DEVICES, cl_uint) \ + F(cl_program_info, CL_PROGRAM_DEVICES, cl::vector) \ + F(cl_program_info, CL_PROGRAM_SOURCE, string) \ + F(cl_program_info, CL_PROGRAM_BINARY_SIZES, cl::vector) \ + F(cl_program_info, CL_PROGRAM_BINARIES, cl::vector>) \ + \ + F(cl_program_build_info, CL_PROGRAM_BUILD_STATUS, cl_build_status) \ + F(cl_program_build_info, CL_PROGRAM_BUILD_OPTIONS, string) \ + F(cl_program_build_info, CL_PROGRAM_BUILD_LOG, string) \ + \ + F(cl_kernel_info, CL_KERNEL_FUNCTION_NAME, string) \ + F(cl_kernel_info, CL_KERNEL_NUM_ARGS, cl_uint) \ + F(cl_kernel_info, CL_KERNEL_REFERENCE_COUNT, cl_uint) \ + F(cl_kernel_info, CL_KERNEL_CONTEXT, cl::Context) \ + F(cl_kernel_info, CL_KERNEL_PROGRAM, cl::Program) \ + \ + F(cl_kernel_work_group_info, CL_KERNEL_WORK_GROUP_SIZE, size_type) \ + F(cl_kernel_work_group_info, CL_KERNEL_COMPILE_WORK_GROUP_SIZE, cl::detail::size_t_array) \ + F(cl_kernel_work_group_info, CL_KERNEL_LOCAL_MEM_SIZE, cl_ulong) \ + \ + F(cl_command_queue_info, CL_QUEUE_CONTEXT, cl::Context) \ + F(cl_command_queue_info, CL_QUEUE_DEVICE, cl::Device) \ + F(cl_command_queue_info, CL_QUEUE_REFERENCE_COUNT, cl_uint) \ + F(cl_command_queue_info, CL_QUEUE_PROPERTIES, cl_command_queue_properties) + + +#define CL_HPP_PARAM_NAME_INFO_1_1_(F) \ + F(cl_context_info, CL_CONTEXT_NUM_DEVICES, cl_uint)\ + F(cl_device_info, CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF, cl_uint) \ + F(cl_device_info, CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR, cl_uint) \ + F(cl_device_info, CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT, cl_uint) \ + F(cl_device_info, CL_DEVICE_NATIVE_VECTOR_WIDTH_INT, cl_uint) \ + F(cl_device_info, CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG, cl_uint) \ + F(cl_device_info, CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT, cl_uint) \ + F(cl_device_info, CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE, cl_uint) \ + F(cl_device_info, CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF, cl_uint) \ + F(cl_device_info, CL_DEVICE_OPENCL_C_VERSION, string) \ + \ + F(cl_mem_info, CL_MEM_ASSOCIATED_MEMOBJECT, cl::Memory) \ + F(cl_mem_info, CL_MEM_OFFSET, size_type) \ + \ + F(cl_kernel_work_group_info, CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE, size_type) \ + F(cl_kernel_work_group_info, CL_KERNEL_PRIVATE_MEM_SIZE, cl_ulong) \ + \ + F(cl_event_info, CL_EVENT_CONTEXT, cl::Context) + +#define CL_HPP_PARAM_NAME_INFO_1_2_(F) \ + F(cl_program_info, CL_PROGRAM_NUM_KERNELS, size_type) \ + F(cl_program_info, CL_PROGRAM_KERNEL_NAMES, string) \ + \ + F(cl_program_build_info, CL_PROGRAM_BINARY_TYPE, cl_program_binary_type) \ + \ + F(cl_kernel_info, CL_KERNEL_ATTRIBUTES, string) \ + \ + F(cl_kernel_arg_info, CL_KERNEL_ARG_ADDRESS_QUALIFIER, cl_kernel_arg_address_qualifier) \ + F(cl_kernel_arg_info, CL_KERNEL_ARG_ACCESS_QUALIFIER, cl_kernel_arg_access_qualifier) \ + F(cl_kernel_arg_info, CL_KERNEL_ARG_TYPE_NAME, string) \ + F(cl_kernel_arg_info, CL_KERNEL_ARG_NAME, string) \ + F(cl_kernel_arg_info, CL_KERNEL_ARG_TYPE_QUALIFIER, cl_kernel_arg_type_qualifier) \ + \ + F(cl_kernel_work_group_info, CL_KERNEL_GLOBAL_WORK_SIZE, cl::detail::size_t_array) \ + \ + F(cl_device_info, CL_DEVICE_LINKER_AVAILABLE, cl_bool) \ + F(cl_device_info, CL_DEVICE_IMAGE_MAX_BUFFER_SIZE, size_type) \ + F(cl_device_info, CL_DEVICE_IMAGE_MAX_ARRAY_SIZE, size_type) \ + F(cl_device_info, CL_DEVICE_PARENT_DEVICE, cl::Device) \ + F(cl_device_info, CL_DEVICE_PARTITION_MAX_SUB_DEVICES, cl_uint) \ + F(cl_device_info, CL_DEVICE_PARTITION_PROPERTIES, cl::vector) \ + F(cl_device_info, CL_DEVICE_PARTITION_TYPE, cl::vector) \ + F(cl_device_info, CL_DEVICE_REFERENCE_COUNT, cl_uint) \ + F(cl_device_info, CL_DEVICE_PREFERRED_INTEROP_USER_SYNC, cl_bool) \ + F(cl_device_info, CL_DEVICE_PARTITION_AFFINITY_DOMAIN, cl_device_affinity_domain) \ + F(cl_device_info, CL_DEVICE_BUILT_IN_KERNELS, string) \ + F(cl_device_info, CL_DEVICE_PRINTF_BUFFER_SIZE, size_type) \ + \ + F(cl_image_info, CL_IMAGE_ARRAY_SIZE, size_type) \ + F(cl_image_info, CL_IMAGE_NUM_MIP_LEVELS, cl_uint) \ + F(cl_image_info, CL_IMAGE_NUM_SAMPLES, cl_uint) + +#define CL_HPP_PARAM_NAME_INFO_2_0_(F) \ + F(cl_device_info, CL_DEVICE_QUEUE_ON_HOST_PROPERTIES, cl_command_queue_properties) \ + F(cl_device_info, CL_DEVICE_QUEUE_ON_DEVICE_PROPERTIES, cl_command_queue_properties) \ + F(cl_device_info, CL_DEVICE_QUEUE_ON_DEVICE_PREFERRED_SIZE, cl_uint) \ + F(cl_device_info, CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE, cl_uint) \ + F(cl_device_info, CL_DEVICE_MAX_ON_DEVICE_QUEUES, cl_uint) \ + F(cl_device_info, CL_DEVICE_MAX_ON_DEVICE_EVENTS, cl_uint) \ + F(cl_device_info, CL_DEVICE_MAX_PIPE_ARGS, cl_uint) \ + F(cl_device_info, CL_DEVICE_PIPE_MAX_ACTIVE_RESERVATIONS, cl_uint) \ + F(cl_device_info, CL_DEVICE_PIPE_MAX_PACKET_SIZE, cl_uint) \ + F(cl_device_info, CL_DEVICE_SVM_CAPABILITIES, cl_device_svm_capabilities) \ + F(cl_device_info, CL_DEVICE_PREFERRED_PLATFORM_ATOMIC_ALIGNMENT, cl_uint) \ + F(cl_device_info, CL_DEVICE_PREFERRED_GLOBAL_ATOMIC_ALIGNMENT, cl_uint) \ + F(cl_device_info, CL_DEVICE_PREFERRED_LOCAL_ATOMIC_ALIGNMENT, cl_uint) \ + F(cl_device_info, CL_DEVICE_IMAGE_PITCH_ALIGNMENT, cl_uint) \ + F(cl_device_info, CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT, cl_uint) \ + F(cl_device_info, CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS, cl_uint ) \ + F(cl_device_info, CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE, size_type ) \ + F(cl_device_info, CL_DEVICE_GLOBAL_VARIABLE_PREFERRED_TOTAL_SIZE, size_type ) \ + F(cl_profiling_info, CL_PROFILING_COMMAND_COMPLETE, cl_ulong) \ + F(cl_kernel_exec_info, CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM, cl_bool) \ + F(cl_kernel_exec_info, CL_KERNEL_EXEC_INFO_SVM_PTRS, void**) \ + F(cl_command_queue_info, CL_QUEUE_SIZE, cl_uint) \ + F(cl_mem_info, CL_MEM_USES_SVM_POINTER, cl_bool) \ + F(cl_program_build_info, CL_PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZE, size_type) \ + F(cl_pipe_info, CL_PIPE_PACKET_SIZE, cl_uint) \ + F(cl_pipe_info, CL_PIPE_MAX_PACKETS, cl_uint) + +#define CL_HPP_PARAM_NAME_INFO_SUBGROUP_KHR_(F) \ + F(cl_kernel_sub_group_info, CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE_KHR, size_type) \ + F(cl_kernel_sub_group_info, CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE_KHR, size_type) + +#define CL_HPP_PARAM_NAME_INFO_IL_KHR_(F) \ + F(cl_device_info, CL_DEVICE_IL_VERSION_KHR, string) \ + F(cl_program_info, CL_PROGRAM_IL_KHR, cl::vector) + +#define CL_HPP_PARAM_NAME_INFO_2_1_(F) \ + F(cl_platform_info, CL_PLATFORM_HOST_TIMER_RESOLUTION, cl_ulong) \ + F(cl_program_info, CL_PROGRAM_IL, cl::vector) \ + F(cl_device_info, CL_DEVICE_MAX_NUM_SUB_GROUPS, cl_uint) \ + F(cl_device_info, CL_DEVICE_IL_VERSION, string) \ + F(cl_device_info, CL_DEVICE_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS, cl_bool) \ + F(cl_command_queue_info, CL_QUEUE_DEVICE_DEFAULT, cl::DeviceCommandQueue) \ + F(cl_kernel_sub_group_info, CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE, size_type) \ + F(cl_kernel_sub_group_info, CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE, size_type) \ + F(cl_kernel_sub_group_info, CL_KERNEL_LOCAL_SIZE_FOR_SUB_GROUP_COUNT, cl::detail::size_t_array) \ + F(cl_kernel_sub_group_info, CL_KERNEL_MAX_NUM_SUB_GROUPS, size_type) \ + F(cl_kernel_sub_group_info, CL_KERNEL_COMPILE_NUM_SUB_GROUPS, size_type) + +#define CL_HPP_PARAM_NAME_INFO_2_2_(F) \ + F(cl_program_info, CL_PROGRAM_SCOPE_GLOBAL_CTORS_PRESENT, cl_bool) \ + F(cl_program_info, CL_PROGRAM_SCOPE_GLOBAL_DTORS_PRESENT, cl_bool) + +#define CL_HPP_PARAM_NAME_DEVICE_FISSION_EXT_(F) \ + F(cl_device_info, CL_DEVICE_PARENT_DEVICE_EXT, cl::Device) \ + F(cl_device_info, CL_DEVICE_PARTITION_TYPES_EXT, cl::vector) \ + F(cl_device_info, CL_DEVICE_AFFINITY_DOMAINS_EXT, cl::vector) \ + F(cl_device_info, CL_DEVICE_REFERENCE_COUNT_EXT , cl_uint) \ + F(cl_device_info, CL_DEVICE_PARTITION_STYLE_EXT, cl::vector) + +#define CL_HPP_PARAM_NAME_CL_KHR_EXTENDED_VERSIONING_CL3_SHARED_(F) \ + F(cl_platform_info, CL_PLATFORM_NUMERIC_VERSION_KHR, cl_version_khr) \ + F(cl_platform_info, CL_PLATFORM_EXTENSIONS_WITH_VERSION_KHR, cl::vector) \ + \ + F(cl_device_info, CL_DEVICE_NUMERIC_VERSION_KHR, cl_version_khr) \ + F(cl_device_info, CL_DEVICE_EXTENSIONS_WITH_VERSION_KHR, cl::vector) \ + F(cl_device_info, CL_DEVICE_ILS_WITH_VERSION_KHR, cl::vector) \ + F(cl_device_info, CL_DEVICE_BUILT_IN_KERNELS_WITH_VERSION_KHR, cl::vector) + +#define CL_HPP_PARAM_NAME_CL_KHR_EXTENDED_VERSIONING_KHRONLY_(F) \ + F(cl_device_info, CL_DEVICE_OPENCL_C_NUMERIC_VERSION_KHR, cl_version_khr) + +#define CL_HPP_PARAM_NAME_CL_KHR_SEMAPHORE_(F) \ + F(cl_semaphore_info_khr, CL_SEMAPHORE_CONTEXT_KHR, cl::Context) \ + F(cl_semaphore_info_khr, CL_SEMAPHORE_REFERENCE_COUNT_KHR, cl_uint) \ + F(cl_semaphore_info_khr, CL_SEMAPHORE_PROPERTIES_KHR, cl::vector) \ + F(cl_semaphore_info_khr, CL_SEMAPHORE_TYPE_KHR, cl_semaphore_type_khr) \ + F(cl_semaphore_info_khr, CL_SEMAPHORE_PAYLOAD_KHR, cl_semaphore_payload_khr) \ + F(cl_semaphore_info_khr, CL_SEMAPHORE_DEVICE_HANDLE_LIST_KHR, cl::vector) \ + F(cl_platform_info, CL_PLATFORM_SEMAPHORE_TYPES_KHR, cl::vector) \ + F(cl_device_info, CL_DEVICE_SEMAPHORE_TYPES_KHR, cl::vector) \ + +#define CL_HPP_PARAM_NAME_CL_KHR_EXTERNAL_MEMORY_(F) \ + F(cl_device_info, CL_DEVICE_EXTERNAL_MEMORY_IMPORT_HANDLE_TYPES_KHR, cl::vector) \ + F(cl_platform_info, CL_PLATFORM_EXTERNAL_MEMORY_IMPORT_HANDLE_TYPES_KHR, cl::vector) + +#define CL_HPP_PARAM_NAME_CL_KHR_SEMAPHORE_EXT(F) \ + F(cl_platform_info, CL_PLATFORM_SEMAPHORE_IMPORT_HANDLE_TYPES_KHR, cl::vector) \ + F(cl_platform_info, CL_PLATFORM_SEMAPHORE_EXPORT_HANDLE_TYPES_KHR, cl::vector) \ + F(cl_device_info, CL_DEVICE_SEMAPHORE_IMPORT_HANDLE_TYPES_KHR, cl::vector) \ + F(cl_device_info, CL_DEVICE_SEMAPHORE_EXPORT_HANDLE_TYPES_KHR, cl::vector) \ + F(cl_semaphore_info_khr, CL_SEMAPHORE_EXPORT_HANDLE_TYPES_KHR, cl::vector) \ + +#define CL_HPP_PARAM_NAME_CL_KHR_EXTERNAL_SEMAPHORE_DX_FENCE_EXT(F) \ + F(cl_external_semaphore_handle_type_khr, CL_SEMAPHORE_HANDLE_D3D12_FENCE_KHR, void*) \ + +#define CL_HPP_PARAM_NAME_CL_KHR_EXTERNAL_SEMAPHORE_OPAQUE_FD_EXT(F) \ + F(cl_external_semaphore_handle_type_khr, CL_SEMAPHORE_HANDLE_OPAQUE_FD_KHR, int) \ + +#define CL_HPP_PARAM_NAME_CL_KHR_EXTERNAL_SEMAPHORE_SYNC_FD_EXT(F) \ + F(cl_external_semaphore_handle_type_khr, CL_SEMAPHORE_HANDLE_SYNC_FD_KHR, int) \ + +#define CL_HPP_PARAM_NAME_CL_KHR_EXTERNAL_SEMAPHORE_WIN32_EXT(F) \ + F(cl_external_semaphore_handle_type_khr, CL_SEMAPHORE_HANDLE_OPAQUE_WIN32_KHR, void*) \ + F(cl_external_semaphore_handle_type_khr, CL_SEMAPHORE_HANDLE_OPAQUE_WIN32_KMT_KHR, void*) \ + +#define CL_HPP_PARAM_NAME_INFO_3_0_(F) \ + F(cl_platform_info, CL_PLATFORM_NUMERIC_VERSION, cl_version) \ + F(cl_platform_info, CL_PLATFORM_EXTENSIONS_WITH_VERSION, cl::vector) \ + \ + F(cl_device_info, CL_DEVICE_NUMERIC_VERSION, cl_version) \ + F(cl_device_info, CL_DEVICE_EXTENSIONS_WITH_VERSION, cl::vector) \ + F(cl_device_info, CL_DEVICE_ILS_WITH_VERSION, cl::vector) \ + F(cl_device_info, CL_DEVICE_BUILT_IN_KERNELS_WITH_VERSION, cl::vector) \ + F(cl_device_info, CL_DEVICE_ATOMIC_MEMORY_CAPABILITIES, cl_device_atomic_capabilities) \ + F(cl_device_info, CL_DEVICE_ATOMIC_FENCE_CAPABILITIES, cl_device_atomic_capabilities) \ + F(cl_device_info, CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT, cl_bool) \ + F(cl_device_info, CL_DEVICE_OPENCL_C_ALL_VERSIONS, cl::vector) \ + F(cl_device_info, CL_DEVICE_PREFERRED_WORK_GROUP_SIZE_MULTIPLE, size_type) \ + F(cl_device_info, CL_DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT, cl_bool) \ + F(cl_device_info, CL_DEVICE_GENERIC_ADDRESS_SPACE_SUPPORT, cl_bool) \ + F(cl_device_info, CL_DEVICE_OPENCL_C_FEATURES, cl::vector) \ + F(cl_device_info, CL_DEVICE_DEVICE_ENQUEUE_CAPABILITIES, cl_device_device_enqueue_capabilities) \ + F(cl_device_info, CL_DEVICE_PIPE_SUPPORT, cl_bool) \ + F(cl_device_info, CL_DEVICE_LATEST_CONFORMANCE_VERSION_PASSED, string) \ + \ + F(cl_command_queue_info, CL_QUEUE_PROPERTIES_ARRAY, cl::vector) \ + F(cl_mem_info, CL_MEM_PROPERTIES, cl::vector) \ + F(cl_pipe_info, CL_PIPE_PROPERTIES, cl::vector) \ + F(cl_sampler_info, CL_SAMPLER_PROPERTIES, cl::vector) \ + +#define CL_HPP_PARAM_NAME_CL_IMAGE_REQUIREMENTS_EXT(F) \ + F(cl_image_requirements_info_ext, CL_IMAGE_REQUIREMENTS_ROW_PITCH_ALIGNMENT_EXT, size_type) \ + F(cl_image_requirements_info_ext, CL_IMAGE_REQUIREMENTS_BASE_ADDRESS_ALIGNMENT_EXT, size_type) \ + F(cl_image_requirements_info_ext, CL_IMAGE_REQUIREMENTS_SIZE_EXT, size_type) \ + F(cl_image_requirements_info_ext, CL_IMAGE_REQUIREMENTS_MAX_WIDTH_EXT, cl_uint) \ + F(cl_image_requirements_info_ext, CL_IMAGE_REQUIREMENTS_MAX_HEIGHT_EXT, cl_uint) \ + F(cl_image_requirements_info_ext, CL_IMAGE_REQUIREMENTS_MAX_DEPTH_EXT, cl_uint) \ + F(cl_image_requirements_info_ext, CL_IMAGE_REQUIREMENTS_MAX_ARRAY_SIZE_EXT, cl_uint) \ + +#define CL_HPP_PARAM_NAME_CL_IMAGE_REQUIREMENTS_SLICE_PITCH_ALIGNMENT_EXT(F) \ + F(cl_image_requirements_info_ext, CL_IMAGE_REQUIREMENTS_SLICE_PITCH_ALIGNMENT_EXT, size_type) \ + +template +struct param_traits {}; + +#define CL_HPP_DECLARE_PARAM_TRAITS_(token, param_name, T) \ +struct token; \ +template<> \ +struct param_traits \ +{ \ + enum { value = param_name }; \ + typedef T param_type; \ +}; + +CL_HPP_PARAM_NAME_INFO_1_0_(CL_HPP_DECLARE_PARAM_TRAITS_) +#if CL_HPP_TARGET_OPENCL_VERSION >= 110 +CL_HPP_PARAM_NAME_INFO_1_1_(CL_HPP_DECLARE_PARAM_TRAITS_) +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 110 +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 +CL_HPP_PARAM_NAME_INFO_1_2_(CL_HPP_DECLARE_PARAM_TRAITS_) +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 120 +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 +CL_HPP_PARAM_NAME_INFO_2_0_(CL_HPP_DECLARE_PARAM_TRAITS_) +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 200 +#if CL_HPP_TARGET_OPENCL_VERSION >= 210 +CL_HPP_PARAM_NAME_INFO_2_1_(CL_HPP_DECLARE_PARAM_TRAITS_) +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 210 +#if CL_HPP_TARGET_OPENCL_VERSION >= 220 +CL_HPP_PARAM_NAME_INFO_2_2_(CL_HPP_DECLARE_PARAM_TRAITS_) +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 220 +#if CL_HPP_TARGET_OPENCL_VERSION >= 300 +CL_HPP_PARAM_NAME_INFO_3_0_(CL_HPP_DECLARE_PARAM_TRAITS_) +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 300 + +#if defined(cl_khr_subgroups) && CL_HPP_TARGET_OPENCL_VERSION < 210 +CL_HPP_PARAM_NAME_INFO_SUBGROUP_KHR_(CL_HPP_DECLARE_PARAM_TRAITS_) +#endif // #if defined(cl_khr_subgroups) && CL_HPP_TARGET_OPENCL_VERSION < 210 + +#if defined(cl_khr_il_program) && CL_HPP_TARGET_OPENCL_VERSION < 210 +CL_HPP_PARAM_NAME_INFO_IL_KHR_(CL_HPP_DECLARE_PARAM_TRAITS_) +#endif // #if defined(cl_khr_il_program) && CL_HPP_TARGET_OPENCL_VERSION < 210 + + +// Flags deprecated in OpenCL 2.0 +#define CL_HPP_PARAM_NAME_INFO_1_0_DEPRECATED_IN_2_0_(F) \ + F(cl_device_info, CL_DEVICE_QUEUE_PROPERTIES, cl_command_queue_properties) + +#define CL_HPP_PARAM_NAME_INFO_1_1_DEPRECATED_IN_2_0_(F) \ + F(cl_device_info, CL_DEVICE_HOST_UNIFIED_MEMORY, cl_bool) + +#define CL_HPP_PARAM_NAME_INFO_1_2_DEPRECATED_IN_2_0_(F) \ + F(cl_image_info, CL_IMAGE_BUFFER, cl::Buffer) + +// Include deprecated query flags based on versions +// Only include deprecated 1.0 flags if 2.0 not active as there is an enum clash +#if CL_HPP_TARGET_OPENCL_VERSION > 100 && CL_HPP_MINIMUM_OPENCL_VERSION < 200 && CL_HPP_TARGET_OPENCL_VERSION < 200 +CL_HPP_PARAM_NAME_INFO_1_0_DEPRECATED_IN_2_0_(CL_HPP_DECLARE_PARAM_TRAITS_) +#endif // CL_HPP_MINIMUM_OPENCL_VERSION < 110 +#if CL_HPP_TARGET_OPENCL_VERSION > 110 && CL_HPP_MINIMUM_OPENCL_VERSION < 200 +CL_HPP_PARAM_NAME_INFO_1_1_DEPRECATED_IN_2_0_(CL_HPP_DECLARE_PARAM_TRAITS_) +#endif // CL_HPP_MINIMUM_OPENCL_VERSION < 120 +#if CL_HPP_TARGET_OPENCL_VERSION > 120 && CL_HPP_MINIMUM_OPENCL_VERSION < 200 +CL_HPP_PARAM_NAME_INFO_1_2_DEPRECATED_IN_2_0_(CL_HPP_DECLARE_PARAM_TRAITS_) +#endif // CL_HPP_MINIMUM_OPENCL_VERSION < 200 + +#if defined(cl_ext_device_fission) +CL_HPP_PARAM_NAME_DEVICE_FISSION_EXT_(CL_HPP_DECLARE_PARAM_TRAITS_) +#endif // cl_ext_device_fission + +#if defined(cl_khr_extended_versioning) +#if CL_HPP_TARGET_OPENCL_VERSION < 300 +CL_HPP_PARAM_NAME_CL_KHR_EXTENDED_VERSIONING_CL3_SHARED_(CL_HPP_DECLARE_PARAM_TRAITS_) +#endif // CL_HPP_TARGET_OPENCL_VERSION < 300 +CL_HPP_PARAM_NAME_CL_KHR_EXTENDED_VERSIONING_KHRONLY_(CL_HPP_DECLARE_PARAM_TRAITS_) +#endif // cl_khr_extended_versioning + +#if defined(cl_khr_semaphore) +CL_HPP_PARAM_NAME_CL_KHR_SEMAPHORE_(CL_HPP_DECLARE_PARAM_TRAITS_) +#endif // cl_khr_semaphore + +#ifdef cl_khr_external_memory +CL_HPP_PARAM_NAME_CL_KHR_EXTERNAL_MEMORY_(CL_HPP_DECLARE_PARAM_TRAITS_) +#endif // cl_khr_external_memory + +#if defined(cl_khr_external_semaphore) +CL_HPP_PARAM_NAME_CL_KHR_SEMAPHORE_EXT(CL_HPP_DECLARE_PARAM_TRAITS_) +#endif // cl_khr_external_semaphore + +#if defined(cl_khr_external_semaphore_dx_fence) +CL_HPP_PARAM_NAME_CL_KHR_EXTERNAL_SEMAPHORE_DX_FENCE_EXT(CL_HPP_DECLARE_PARAM_TRAITS_) +#endif // cl_khr_external_semaphore_dx_fence +#if defined(cl_khr_external_semaphore_opaque_fd) +CL_HPP_PARAM_NAME_CL_KHR_EXTERNAL_SEMAPHORE_OPAQUE_FD_EXT(CL_HPP_DECLARE_PARAM_TRAITS_) +#endif // cl_khr_external_semaphore_opaque_fd +#if defined(cl_khr_external_semaphore_sync_fd) +CL_HPP_PARAM_NAME_CL_KHR_EXTERNAL_SEMAPHORE_SYNC_FD_EXT(CL_HPP_DECLARE_PARAM_TRAITS_) +#endif // cl_khr_external_semaphore_sync_fd +#if defined(cl_khr_external_semaphore_win32) +CL_HPP_PARAM_NAME_CL_KHR_EXTERNAL_SEMAPHORE_WIN32_EXT(CL_HPP_DECLARE_PARAM_TRAITS_) +#endif // cl_khr_external_semaphore_win32 + +#if defined(cl_khr_device_uuid) +using uuid_array = array; +using luid_array = array; +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_UUID_KHR, uuid_array) +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DRIVER_UUID_KHR, uuid_array) +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_LUID_VALID_KHR, cl_bool) +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_LUID_KHR, luid_array) +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_NODE_MASK_KHR, cl_uint) +#endif + +#if defined(cl_khr_pci_bus_info) +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_PCI_BUS_INFO_KHR, cl_device_pci_bus_info_khr) +#endif + +// Note: some headers do not define cl_khr_image2d_from_buffer +#if CL_HPP_TARGET_OPENCL_VERSION < 200 +#if defined(CL_DEVICE_IMAGE_PITCH_ALIGNMENT_KHR) +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_IMAGE_PITCH_ALIGNMENT_KHR, cl_uint) +#endif +#if defined(CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT_KHR) +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT_KHR, cl_uint) +#endif +#endif // CL_HPP_TARGET_OPENCL_VERSION < 200 + +#if defined(cl_khr_integer_dot_product) +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_INTEGER_DOT_PRODUCT_CAPABILITIES_KHR, cl_device_integer_dot_product_capabilities_khr) +#if defined(CL_DEVICE_INTEGER_DOT_PRODUCT_ACCELERATION_PROPERTIES_8BIT_KHR) +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_INTEGER_DOT_PRODUCT_ACCELERATION_PROPERTIES_8BIT_KHR, cl_device_integer_dot_product_acceleration_properties_khr) +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_INTEGER_DOT_PRODUCT_ACCELERATION_PROPERTIES_4x8BIT_PACKED_KHR, cl_device_integer_dot_product_acceleration_properties_khr) +#endif // defined(CL_DEVICE_INTEGER_DOT_PRODUCT_ACCELERATION_PROPERTIES_8BIT_KHR) +#endif // defined(cl_khr_integer_dot_product) + +#if defined(cl_ext_image_requirements_info) +CL_HPP_PARAM_NAME_CL_IMAGE_REQUIREMENTS_EXT(CL_HPP_DECLARE_PARAM_TRAITS_) +#endif // cl_ext_image_requirements_info + +#if defined(cl_ext_image_from_buffer) +CL_HPP_PARAM_NAME_CL_IMAGE_REQUIREMENTS_SLICE_PITCH_ALIGNMENT_EXT(CL_HPP_DECLARE_PARAM_TRAITS_) +#endif // cl_ext_image_from_buffer + +#ifdef CL_PLATFORM_ICD_SUFFIX_KHR +CL_HPP_DECLARE_PARAM_TRAITS_(cl_platform_info, CL_PLATFORM_ICD_SUFFIX_KHR, string) +#endif + +#ifdef CL_DEVICE_PROFILING_TIMER_OFFSET_AMD +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_PROFILING_TIMER_OFFSET_AMD, cl_ulong) +#endif +#ifdef CL_DEVICE_GLOBAL_FREE_MEMORY_AMD +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_GLOBAL_FREE_MEMORY_AMD, vector) +#endif +#ifdef CL_DEVICE_SIMD_PER_COMPUTE_UNIT_AMD +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_SIMD_PER_COMPUTE_UNIT_AMD, cl_uint) +#endif +#ifdef CL_DEVICE_SIMD_WIDTH_AMD +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_SIMD_WIDTH_AMD, cl_uint) +#endif +#ifdef CL_DEVICE_SIMD_INSTRUCTION_WIDTH_AMD +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_SIMD_INSTRUCTION_WIDTH_AMD, cl_uint) +#endif +#ifdef CL_DEVICE_WAVEFRONT_WIDTH_AMD +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_WAVEFRONT_WIDTH_AMD, cl_uint) +#endif +#ifdef CL_DEVICE_GLOBAL_MEM_CHANNELS_AMD +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_GLOBAL_MEM_CHANNELS_AMD, cl_uint) +#endif +#ifdef CL_DEVICE_GLOBAL_MEM_CHANNEL_BANKS_AMD +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_GLOBAL_MEM_CHANNEL_BANKS_AMD, cl_uint) +#endif +#ifdef CL_DEVICE_GLOBAL_MEM_CHANNEL_BANK_WIDTH_AMD +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_GLOBAL_MEM_CHANNEL_BANK_WIDTH_AMD, cl_uint) +#endif +#ifdef CL_DEVICE_LOCAL_MEM_SIZE_PER_COMPUTE_UNIT_AMD +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_LOCAL_MEM_SIZE_PER_COMPUTE_UNIT_AMD, cl_uint) +#endif +#ifdef CL_DEVICE_LOCAL_MEM_BANKS_AMD +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_LOCAL_MEM_BANKS_AMD, cl_uint) +#endif +#ifdef CL_DEVICE_BOARD_NAME_AMD +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_BOARD_NAME_AMD, string) +#endif + +#ifdef CL_DEVICE_COMPUTE_UNITS_BITFIELD_ARM +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_COMPUTE_UNITS_BITFIELD_ARM, cl_ulong) +#endif +#ifdef CL_DEVICE_JOB_SLOTS_ARM +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_JOB_SLOTS_ARM, cl_uint) +#endif +#ifdef CL_DEVICE_SCHEDULING_CONTROLS_CAPABILITIES_ARM +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_SCHEDULING_CONTROLS_CAPABILITIES_ARM, cl_bitfield) +#endif +#ifdef CL_DEVICE_SUPPORTED_REGISTER_ALLOCATIONS_ARM +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_SUPPORTED_REGISTER_ALLOCATIONS_ARM, vector) +#endif +#ifdef CL_DEVICE_MAX_WARP_COUNT_ARM +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_MAX_WARP_COUNT_ARM, cl_uint) +#endif +#ifdef CL_KERNEL_MAX_WARP_COUNT_ARM +CL_HPP_DECLARE_PARAM_TRAITS_(cl_kernel_info, CL_KERNEL_MAX_WARP_COUNT_ARM, cl_uint) +#endif +#ifdef CL_KERNEL_EXEC_INFO_WORKGROUP_BATCH_SIZE_ARM +CL_HPP_DECLARE_PARAM_TRAITS_(cl_kernel_exec_info, CL_KERNEL_EXEC_INFO_WORKGROUP_BATCH_SIZE_ARM, cl_uint) +#endif +#ifdef CL_KERNEL_EXEC_INFO_WORKGROUP_BATCH_SIZE_MODIFIER_ARM +CL_HPP_DECLARE_PARAM_TRAITS_(cl_kernel_exec_info, CL_KERNEL_EXEC_INFO_WORKGROUP_BATCH_SIZE_MODIFIER_ARM, cl_int) +#endif +#ifdef CL_KERNEL_EXEC_INFO_WARP_COUNT_LIMIT_ARM +CL_HPP_DECLARE_PARAM_TRAITS_(cl_kernel_exec_info, CL_KERNEL_EXEC_INFO_WARP_COUNT_LIMIT_ARM, cl_uint) +#endif +#ifdef CL_KERNEL_EXEC_INFO_COMPUTE_UNIT_MAX_QUEUED_BATCHES_ARM +CL_HPP_DECLARE_PARAM_TRAITS_(cl_kernel_exec_info, CL_KERNEL_EXEC_INFO_COMPUTE_UNIT_MAX_QUEUED_BATCHES_ARM, cl_uint) +#endif + +#ifdef CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV, cl_uint) +#endif +#ifdef CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV, cl_uint) +#endif +#ifdef CL_DEVICE_REGISTERS_PER_BLOCK_NV +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_REGISTERS_PER_BLOCK_NV, cl_uint) +#endif +#ifdef CL_DEVICE_WARP_SIZE_NV +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_WARP_SIZE_NV, cl_uint) +#endif +#ifdef CL_DEVICE_GPU_OVERLAP_NV +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_GPU_OVERLAP_NV, cl_bool) +#endif +#ifdef CL_DEVICE_KERNEL_EXEC_TIMEOUT_NV +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_KERNEL_EXEC_TIMEOUT_NV, cl_bool) +#endif +#ifdef CL_DEVICE_INTEGRATED_MEMORY_NV +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_INTEGRATED_MEMORY_NV, cl_bool) +#endif + +#if defined(cl_khr_command_buffer) +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_COMMAND_BUFFER_CAPABILITIES_KHR, cl_device_command_buffer_capabilities_khr) +CL_HPP_DECLARE_PARAM_TRAITS_(cl_device_info, CL_DEVICE_COMMAND_BUFFER_REQUIRED_QUEUE_PROPERTIES_KHR, cl_command_buffer_properties_khr) +CL_HPP_DECLARE_PARAM_TRAITS_(cl_command_buffer_info_khr, CL_COMMAND_BUFFER_QUEUES_KHR, cl::vector) +CL_HPP_DECLARE_PARAM_TRAITS_(cl_command_buffer_info_khr, CL_COMMAND_BUFFER_NUM_QUEUES_KHR, cl_uint) +CL_HPP_DECLARE_PARAM_TRAITS_(cl_command_buffer_info_khr, CL_COMMAND_BUFFER_REFERENCE_COUNT_KHR, cl_uint) +CL_HPP_DECLARE_PARAM_TRAITS_(cl_command_buffer_info_khr, CL_COMMAND_BUFFER_STATE_KHR, cl_command_buffer_state_khr) +CL_HPP_DECLARE_PARAM_TRAITS_(cl_command_buffer_info_khr, CL_COMMAND_BUFFER_PROPERTIES_ARRAY_KHR, cl::vector) +#endif /* cl_khr_command_buffer */ + +#if defined(cl_khr_command_buffer_mutable_dispatch) +CL_HPP_DECLARE_PARAM_TRAITS_(cl_mutable_command_info_khr, CL_MUTABLE_COMMAND_COMMAND_QUEUE_KHR, CommandQueue) +CL_HPP_DECLARE_PARAM_TRAITS_(cl_mutable_command_info_khr, CL_MUTABLE_COMMAND_COMMAND_BUFFER_KHR, CommandBufferKhr) +CL_HPP_DECLARE_PARAM_TRAITS_(cl_mutable_command_info_khr, CL_MUTABLE_COMMAND_COMMAND_TYPE_KHR, cl_command_type) +CL_HPP_DECLARE_PARAM_TRAITS_(cl_mutable_command_info_khr, CL_MUTABLE_DISPATCH_PROPERTIES_ARRAY_KHR, cl::vector) +CL_HPP_DECLARE_PARAM_TRAITS_(cl_mutable_command_info_khr, CL_MUTABLE_DISPATCH_KERNEL_KHR, cl_kernel) +CL_HPP_DECLARE_PARAM_TRAITS_(cl_mutable_command_info_khr, CL_MUTABLE_DISPATCH_DIMENSIONS_KHR, cl_uint) +CL_HPP_DECLARE_PARAM_TRAITS_(cl_mutable_command_info_khr, CL_MUTABLE_DISPATCH_GLOBAL_WORK_OFFSET_KHR, cl::vector) +CL_HPP_DECLARE_PARAM_TRAITS_(cl_mutable_command_info_khr, CL_MUTABLE_DISPATCH_GLOBAL_WORK_SIZE_KHR, cl::vector) +CL_HPP_DECLARE_PARAM_TRAITS_(cl_mutable_command_info_khr, CL_MUTABLE_DISPATCH_LOCAL_WORK_SIZE_KHR, cl::vector) +#endif /* cl_khr_command_buffer_mutable_dispatch */ + +// Convenience functions + +template +inline cl_int +getInfo(Func f, cl_uint name, T* param) +{ + return getInfoHelper(f, name, param, 0); +} + +template +struct GetInfoFunctor0 +{ + Func f_; const Arg0& arg0_; + cl_int operator ()( + cl_uint param, size_type size, void* value, size_type* size_ret) + { return f_(arg0_, param, size, value, size_ret); } +}; + +template +struct GetInfoFunctor1 +{ + Func f_; const Arg0& arg0_; const Arg1& arg1_; + cl_int operator ()( + cl_uint param, size_type size, void* value, size_type* size_ret) + { return f_(arg0_, arg1_, param, size, value, size_ret); } +}; + +template +inline cl_int +getInfo(Func f, const Arg0& arg0, cl_uint name, T* param) +{ + GetInfoFunctor0 f0 = { f, arg0 }; + return getInfoHelper(f0, name, param, 0); +} + +template +inline cl_int +getInfo(Func f, const Arg0& arg0, const Arg1& arg1, cl_uint name, T* param) +{ + GetInfoFunctor1 f0 = { f, arg0, arg1 }; + return getInfoHelper(f0, name, param, 0); +} + + +template +struct ReferenceHandler +{ }; + +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 +/** + * OpenCL 1.2 devices do have retain/release. + */ +template <> +struct ReferenceHandler +{ + /** + * Retain the device. + * \param device A valid device created using createSubDevices + * \return + * CL_SUCCESS if the function executed successfully. + * CL_INVALID_DEVICE if device was not a valid subdevice + * CL_OUT_OF_RESOURCES + * CL_OUT_OF_HOST_MEMORY + */ + static cl_int retain(cl_device_id device) + { return ::clRetainDevice(device); } + /** + * Retain the device. + * \param device A valid device created using createSubDevices + * \return + * CL_SUCCESS if the function executed successfully. + * CL_INVALID_DEVICE if device was not a valid subdevice + * CL_OUT_OF_RESOURCES + * CL_OUT_OF_HOST_MEMORY + */ + static cl_int release(cl_device_id device) + { return ::clReleaseDevice(device); } +}; +#else // CL_HPP_TARGET_OPENCL_VERSION >= 120 +/** + * OpenCL 1.1 devices do not have retain/release. + */ +template <> +struct ReferenceHandler +{ + // cl_device_id does not have retain(). + static cl_int retain(cl_device_id) + { return CL_SUCCESS; } + // cl_device_id does not have release(). + static cl_int release(cl_device_id) + { return CL_SUCCESS; } +}; +#endif // ! (CL_HPP_TARGET_OPENCL_VERSION >= 120) + +template <> +struct ReferenceHandler +{ + // cl_platform_id does not have retain(). + static cl_int retain(cl_platform_id) + { return CL_SUCCESS; } + // cl_platform_id does not have release(). + static cl_int release(cl_platform_id) + { return CL_SUCCESS; } +}; + +template <> +struct ReferenceHandler +{ + static cl_int retain(cl_context context) + { return ::clRetainContext(context); } + static cl_int release(cl_context context) + { return ::clReleaseContext(context); } +}; + +template <> +struct ReferenceHandler +{ + static cl_int retain(cl_command_queue queue) + { return ::clRetainCommandQueue(queue); } + static cl_int release(cl_command_queue queue) + { return ::clReleaseCommandQueue(queue); } +}; + +template <> +struct ReferenceHandler +{ + static cl_int retain(cl_mem memory) + { return ::clRetainMemObject(memory); } + static cl_int release(cl_mem memory) + { return ::clReleaseMemObject(memory); } +}; + +template <> +struct ReferenceHandler +{ + static cl_int retain(cl_sampler sampler) + { return ::clRetainSampler(sampler); } + static cl_int release(cl_sampler sampler) + { return ::clReleaseSampler(sampler); } +}; + +template <> +struct ReferenceHandler +{ + static cl_int retain(cl_program program) + { return ::clRetainProgram(program); } + static cl_int release(cl_program program) + { return ::clReleaseProgram(program); } +}; + +template <> +struct ReferenceHandler +{ + static cl_int retain(cl_kernel kernel) + { return ::clRetainKernel(kernel); } + static cl_int release(cl_kernel kernel) + { return ::clReleaseKernel(kernel); } +}; + +template <> +struct ReferenceHandler +{ + static cl_int retain(cl_event event) + { return ::clRetainEvent(event); } + static cl_int release(cl_event event) + { return ::clReleaseEvent(event); } +}; + +#ifdef cl_khr_semaphore +template <> +struct ReferenceHandler +{ + static cl_int retain(cl_semaphore_khr semaphore) + { + if (pfn_clRetainSemaphoreKHR != nullptr) { + return pfn_clRetainSemaphoreKHR(semaphore); + } + + return CL_INVALID_OPERATION; + } + + static cl_int release(cl_semaphore_khr semaphore) + { + if (pfn_clReleaseSemaphoreKHR != nullptr) { + return pfn_clReleaseSemaphoreKHR(semaphore); + } + + return CL_INVALID_OPERATION; + } +}; +#endif // cl_khr_semaphore +#if defined(cl_khr_command_buffer) +template <> +struct ReferenceHandler +{ + static cl_int retain(cl_command_buffer_khr cmdBufferKhr) + { + if (pfn_clRetainCommandBufferKHR == nullptr) { + return detail::errHandler(CL_INVALID_OPERATION, __RETAIN_COMMAND_BUFFER_KHR_ERR); + } + return pfn_clRetainCommandBufferKHR(cmdBufferKhr); + } + + static cl_int release(cl_command_buffer_khr cmdBufferKhr) + { + if (pfn_clReleaseCommandBufferKHR == nullptr) { + return detail::errHandler(CL_INVALID_OPERATION, __RELEASE_COMMAND_BUFFER_KHR_ERR); + } + return pfn_clReleaseCommandBufferKHR(cmdBufferKhr); + } +}; + +template <> +struct ReferenceHandler +{ + // cl_mutable_command_khr does not have retain(). + static cl_int retain(cl_mutable_command_khr) + { return CL_SUCCESS; } + // cl_mutable_command_khr does not have release(). + static cl_int release(cl_mutable_command_khr) + { return CL_SUCCESS; } +}; +#endif // cl_khr_command_buffer + + +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 && CL_HPP_MINIMUM_OPENCL_VERSION < 120 +// Extracts version number with major in the upper 16 bits, minor in the lower 16 +static cl_uint getVersion(const vector &versionInfo) +{ + int highVersion = 0; + int lowVersion = 0; + int index = 7; + while(versionInfo[index] != '.' ) { + highVersion *= 10; + highVersion += versionInfo[index]-'0'; + ++index; + } + ++index; + while(versionInfo[index] != ' ' && versionInfo[index] != '\0') { + lowVersion *= 10; + lowVersion += versionInfo[index]-'0'; + ++index; + } + return (highVersion << 16) | lowVersion; +} + +static cl_uint getPlatformVersion(cl_platform_id platform) +{ + size_type size = 0; + clGetPlatformInfo(platform, CL_PLATFORM_VERSION, 0, nullptr, &size); + + vector versionInfo(size); + clGetPlatformInfo(platform, CL_PLATFORM_VERSION, size, versionInfo.data(), &size); + return getVersion(versionInfo); +} + +static cl_uint getDevicePlatformVersion(cl_device_id device) +{ + cl_platform_id platform; + clGetDeviceInfo(device, CL_DEVICE_PLATFORM, sizeof(platform), &platform, nullptr); + return getPlatformVersion(platform); +} + +static cl_uint getContextPlatformVersion(cl_context context) +{ + // The platform cannot be queried directly, so we first have to grab a + // device and obtain its context + size_type size = 0; + clGetContextInfo(context, CL_CONTEXT_DEVICES, 0, nullptr, &size); + if (size == 0) + return 0; + vector devices(size/sizeof(cl_device_id)); + clGetContextInfo(context, CL_CONTEXT_DEVICES, size, devices.data(), nullptr); + return getDevicePlatformVersion(devices[0]); +} +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 120 && CL_HPP_MINIMUM_OPENCL_VERSION < 120 + +template +class Wrapper +{ +public: + typedef T cl_type; + +protected: + cl_type object_; + +public: + Wrapper() : object_(nullptr) { } + + Wrapper(const cl_type &obj, bool retainObject) : object_(obj) + { + if (retainObject) { + detail::errHandler(retain(), __RETAIN_ERR); + } + } + + ~Wrapper() + { + if (object_ != nullptr) { release(); } + } + + Wrapper(const Wrapper& rhs) + { + object_ = rhs.object_; + detail::errHandler(retain(), __RETAIN_ERR); + } + + Wrapper(Wrapper&& rhs) noexcept + { + object_ = rhs.object_; + rhs.object_ = nullptr; + } + + Wrapper& operator = (const Wrapper& rhs) + { + if (this != &rhs) { + detail::errHandler(release(), __RELEASE_ERR); + object_ = rhs.object_; + detail::errHandler(retain(), __RETAIN_ERR); + } + return *this; + } + + Wrapper& operator = (Wrapper&& rhs) + { + if (this != &rhs) { + detail::errHandler(release(), __RELEASE_ERR); + object_ = rhs.object_; + rhs.object_ = nullptr; + } + return *this; + } + + Wrapper& operator = (const cl_type &rhs) + { + detail::errHandler(release(), __RELEASE_ERR); + object_ = rhs; + return *this; + } + + const cl_type& operator ()() const { return object_; } + + cl_type& operator ()() { return object_; } + + cl_type get() const { return object_; } + +protected: + template + friend inline cl_int getInfoHelper(Func, cl_uint, U*, int, typename U::cl_type); + + cl_int retain() const + { + if (object_ != nullptr) { + return ReferenceHandler::retain(object_); + } + else { + return CL_SUCCESS; + } + } + + cl_int release() const + { + if (object_ != nullptr) { + return ReferenceHandler::release(object_); + } + else { + return CL_SUCCESS; + } + } +}; + +template <> +class Wrapper +{ +public: + typedef cl_device_id cl_type; + +protected: + cl_type object_; + bool referenceCountable_; + + static bool isReferenceCountable(cl_device_id device) + { + bool retVal = false; +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 +#if CL_HPP_MINIMUM_OPENCL_VERSION < 120 + if (device != nullptr) { + int version = getDevicePlatformVersion(device); + if(version > ((1 << 16) + 1)) { + retVal = true; + } + } +#else // CL_HPP_MINIMUM_OPENCL_VERSION < 120 + retVal = true; +#endif // CL_HPP_MINIMUM_OPENCL_VERSION < 120 +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 120 + (void)device; + return retVal; + } + +public: + Wrapper() : object_(nullptr), referenceCountable_(false) + { + } + + Wrapper(const cl_type &obj, bool retainObject) : + object_(obj), + referenceCountable_(false) + { + referenceCountable_ = isReferenceCountable(obj); + + if (retainObject) { + detail::errHandler(retain(), __RETAIN_ERR); + } + } + + ~Wrapper() + { + release(); + } + + Wrapper(const Wrapper& rhs) + { + object_ = rhs.object_; + referenceCountable_ = isReferenceCountable(object_); + detail::errHandler(retain(), __RETAIN_ERR); + } + + Wrapper(Wrapper&& rhs) noexcept + { + object_ = rhs.object_; + referenceCountable_ = rhs.referenceCountable_; + rhs.object_ = nullptr; + rhs.referenceCountable_ = false; + } + + Wrapper& operator = (const Wrapper& rhs) + { + if (this != &rhs) { + detail::errHandler(release(), __RELEASE_ERR); + object_ = rhs.object_; + referenceCountable_ = rhs.referenceCountable_; + detail::errHandler(retain(), __RETAIN_ERR); + } + return *this; + } + + Wrapper& operator = (Wrapper&& rhs) + { + if (this != &rhs) { + detail::errHandler(release(), __RELEASE_ERR); + object_ = rhs.object_; + referenceCountable_ = rhs.referenceCountable_; + rhs.object_ = nullptr; + rhs.referenceCountable_ = false; + } + return *this; + } + + Wrapper& operator = (const cl_type &rhs) + { + detail::errHandler(release(), __RELEASE_ERR); + object_ = rhs; + referenceCountable_ = isReferenceCountable(object_); + return *this; + } + + const cl_type& operator ()() const { return object_; } + + cl_type& operator ()() { return object_; } + + cl_type get() const { return object_; } + +protected: + template + friend inline cl_int getInfoHelper(Func, cl_uint, U*, int, typename U::cl_type); + + template + friend inline cl_int getInfoHelper(Func, cl_uint, vector*, int, typename U::cl_type); + + cl_int retain() const + { + if( object_ != nullptr && referenceCountable_ ) { + return ReferenceHandler::retain(object_); + } + else { + return CL_SUCCESS; + } + } + + cl_int release() const + { + if (object_ != nullptr && referenceCountable_) { + return ReferenceHandler::release(object_); + } + else { + return CL_SUCCESS; + } + } +}; + +template +inline bool operator==(const Wrapper &lhs, const Wrapper &rhs) +{ + return lhs() == rhs(); +} + +template +inline bool operator!=(const Wrapper &lhs, const Wrapper &rhs) +{ + return !operator==(lhs, rhs); +} + +} // namespace detail +//! \endcond + + + + + +/*! \stuct ImageFormat + * \brief Adds constructors and member functions for cl_image_format. + * + * \see cl_image_format + */ +struct ImageFormat : public cl_image_format +{ + //! \brief Default constructor - performs no initialization. + ImageFormat(){} + + //! \brief Initializing constructor. + ImageFormat(cl_channel_order order, cl_channel_type type) + { + image_channel_order = order; + image_channel_data_type = type; + } + + //! \brief Copy constructor. + ImageFormat(const ImageFormat &other) { *this = other; } + + //! \brief Assignment operator. + ImageFormat& operator = (const ImageFormat& rhs) + { + if (this != &rhs) { + this->image_channel_data_type = rhs.image_channel_data_type; + this->image_channel_order = rhs.image_channel_order; + } + return *this; + } +}; + +/*! \brief Class interface for cl_device_id. + * + * \note Copies of these objects are inexpensive, since they don't 'own' + * any underlying resources or data structures. + * + * \see cl_device_id + */ +class Device : public detail::Wrapper +{ +private: + static std::once_flag default_initialized_; + static Device default_; + static cl_int default_error_; + + /*! \brief Create the default context. + * + * This sets @c default_ and @c default_error_. It does not throw + * @c cl::Error. + */ + static void makeDefault(); + + /*! \brief Create the default platform from a provided platform. + * + * This sets @c default_. It does not throw + * @c cl::Error. + */ + static void makeDefaultProvided(const Device &p) { + default_ = p; + } + +public: +#ifdef CL_HPP_UNIT_TEST_ENABLE + /*! \brief Reset the default. + * + * This sets @c default_ to an empty value to support cleanup in + * the unit test framework. + * This function is not thread safe. + */ + static void unitTestClearDefault() { + default_ = Device(); + } +#endif // #ifdef CL_HPP_UNIT_TEST_ENABLE + + //! \brief Default constructor - initializes to nullptr. + Device() : detail::Wrapper() { } + + /*! \brief Constructor from cl_device_id. + * + * This simply copies the device ID value, which is an inexpensive operation. + */ + explicit Device(const cl_device_id &device, bool retainObject = false) : + detail::Wrapper(device, retainObject) { } + + /*! \brief Returns the first device on the default context. + * + * \see Context::getDefault() + */ + static Device getDefault( + cl_int *errResult = nullptr) + { + std::call_once(default_initialized_, makeDefault); + detail::errHandler(default_error_); + if (errResult != nullptr) { + *errResult = default_error_; + } + return default_; + } + + /** + * Modify the default device to be used by + * subsequent operations. + * Will only set the default if no default was previously created. + * @return updated default device. + * Should be compared to the passed value to ensure that it was updated. + */ + static Device setDefault(const Device &default_device) + { + std::call_once(default_initialized_, makeDefaultProvided, std::cref(default_device)); + detail::errHandler(default_error_); + return default_; + } + + /*! \brief Assignment operator from cl_device_id. + * + * This simply copies the device ID value, which is an inexpensive operation. + */ + Device& operator = (const cl_device_id& rhs) + { + detail::Wrapper::operator=(rhs); + return *this; + } + + + //! \brief Wrapper for clGetDeviceInfo(). + template + cl_int getInfo(cl_device_info name, T* param) const + { + return detail::errHandler( + detail::getInfo(&::clGetDeviceInfo, object_, name, param), + __GET_DEVICE_INFO_ERR); + } + + //! \brief Wrapper for clGetDeviceInfo() that returns by value. + template typename + detail::param_traits::param_type + getInfo(cl_int* err = nullptr) const + { + typename detail::param_traits< + detail::cl_device_info, name>::param_type param; + cl_int result = getInfo(name, ¶m); + if (err != nullptr) { + *err = result; + } + return param; + } + +#if CL_HPP_TARGET_OPENCL_VERSION >= 210 + /** + * Return the current value of the host clock as seen by the device. + * The resolution of the device timer may be queried with the + * CL_DEVICE_PROFILING_TIMER_RESOLUTION query. + * @return The host timer value. + */ + cl_ulong getHostTimer(cl_int *error = nullptr) + { + cl_ulong retVal = 0; + cl_int err = + clGetHostTimer(this->get(), &retVal); + detail::errHandler( + err, + __GET_HOST_TIMER_ERR); + if (error) { + *error = err; + } + return retVal; + } + + /** + * Return a synchronized pair of host and device timestamps as seen by device. + * Use to correlate the clocks and get the host timer only using getHostTimer + * as a lower cost mechanism in between calls. + * The resolution of the host timer may be queried with the + * CL_PLATFORM_HOST_TIMER_RESOLUTION query. + * The resolution of the device timer may be queried with the + * CL_DEVICE_PROFILING_TIMER_RESOLUTION query. + * @return A pair of (device timer, host timer) timer values. + */ + std::pair getDeviceAndHostTimer(cl_int *error = nullptr) + { + std::pair retVal; + cl_int err = + clGetDeviceAndHostTimer(this->get(), &(retVal.first), &(retVal.second)); + detail::errHandler( + err, + __GET_DEVICE_AND_HOST_TIMER_ERR); + if (error) { + *error = err; + } + return retVal; + } +#endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 210 + +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 + //! \brief Wrapper for clCreateSubDevices(). + cl_int createSubDevices(const cl_device_partition_property* properties, + vector* devices); +#endif // defined (CL_HPP_TARGET_OPENCL_VERSION >= 120) + +#if defined(cl_ext_device_fission) + //! \brief Wrapper for clCreateSubDevices(). + cl_int createSubDevices(const cl_device_partition_property_ext* properties, + vector* devices); +#endif // defined(cl_ext_device_fission) +}; + +using BuildLogType = vector::param_type>>; +#if defined(CL_HPP_ENABLE_EXCEPTIONS) +/** +* Exception class for build errors to carry build info +*/ +class BuildError : public Error +{ +private: + BuildLogType buildLogs; +public: + BuildError(cl_int err, const char * errStr, const BuildLogType &vec) : Error(err, errStr), buildLogs(vec) + { + } + + BuildLogType getBuildLog() const + { + return buildLogs; + } +}; +namespace detail { + static inline cl_int buildErrHandler( + cl_int err, + const char * errStr, + const BuildLogType &buildLogs) + { + if (err != CL_SUCCESS) { + throw BuildError(err, errStr, buildLogs); + } + return err; + } +} // namespace detail + +#else +namespace detail { + static inline cl_int buildErrHandler( + cl_int err, + const char * errStr, + const BuildLogType &buildLogs) + { + (void)buildLogs; // suppress unused variable warning + (void)errStr; + return err; + } +} // namespace detail +#endif // #if defined(CL_HPP_ENABLE_EXCEPTIONS) + +CL_HPP_DEFINE_STATIC_MEMBER_ std::once_flag Device::default_initialized_; +CL_HPP_DEFINE_STATIC_MEMBER_ Device Device::default_; +CL_HPP_DEFINE_STATIC_MEMBER_ cl_int Device::default_error_ = CL_SUCCESS; + +/*! \brief Class interface for cl_platform_id. + * + * \note Copies of these objects are inexpensive, since they don't 'own' + * any underlying resources or data structures. + * + * \see cl_platform_id + */ +class Platform : public detail::Wrapper +{ +private: + static std::once_flag default_initialized_; + static Platform default_; + static cl_int default_error_; + + /*! \brief Create the default context. + * + * This sets @c default_ and @c default_error_. It does not throw + * @c cl::Error. + */ + static void makeDefault() { + /* Throwing an exception from a call_once invocation does not do + * what we wish, so we catch it and save the error. + */ +#if defined(CL_HPP_ENABLE_EXCEPTIONS) + try +#endif + { + // If default wasn't passed ,generate one + // Otherwise set it + cl_uint n = 0; + + cl_int err = ::clGetPlatformIDs(0, nullptr, &n); + if (err != CL_SUCCESS) { + default_error_ = err; + return; + } + if (n == 0) { + default_error_ = CL_INVALID_PLATFORM; + return; + } + + vector ids(n); + err = ::clGetPlatformIDs(n, ids.data(), nullptr); + if (err != CL_SUCCESS) { + default_error_ = err; + return; + } + + default_ = Platform(ids[0]); + } +#if defined(CL_HPP_ENABLE_EXCEPTIONS) + catch (cl::Error &e) { + default_error_ = e.err(); + } +#endif + } + + /*! \brief Create the default platform from a provided platform. + * + * This sets @c default_. It does not throw + * @c cl::Error. + */ + static void makeDefaultProvided(const Platform &p) { + default_ = p; + } + +public: +#ifdef CL_HPP_UNIT_TEST_ENABLE + /*! \brief Reset the default. + * + * This sets @c default_ to an empty value to support cleanup in + * the unit test framework. + * This function is not thread safe. + */ + static void unitTestClearDefault() { + default_ = Platform(); + } +#endif // #ifdef CL_HPP_UNIT_TEST_ENABLE + + //! \brief Default constructor - initializes to nullptr. + Platform() : detail::Wrapper() { } + + /*! \brief Constructor from cl_platform_id. + * + * \param retainObject will cause the constructor to retain its cl object. + * Defaults to false to maintain compatibility with + * earlier versions. + * This simply copies the platform ID value, which is an inexpensive operation. + */ + explicit Platform(const cl_platform_id &platform, bool retainObject = false) : + detail::Wrapper(platform, retainObject) { } + + /*! \brief Assignment operator from cl_platform_id. + * + * This simply copies the platform ID value, which is an inexpensive operation. + */ + Platform& operator = (const cl_platform_id& rhs) + { + detail::Wrapper::operator=(rhs); + return *this; + } + + static Platform getDefault( + cl_int *errResult = nullptr) + { + std::call_once(default_initialized_, makeDefault); + detail::errHandler(default_error_); + if (errResult != nullptr) { + *errResult = default_error_; + } + return default_; + } + + /** + * Modify the default platform to be used by + * subsequent operations. + * Will only set the default if no default was previously created. + * @return updated default platform. + * Should be compared to the passed value to ensure that it was updated. + */ + static Platform setDefault(const Platform &default_platform) + { + std::call_once(default_initialized_, makeDefaultProvided, std::cref(default_platform)); + detail::errHandler(default_error_); + return default_; + } + + //! \brief Wrapper for clGetPlatformInfo(). + template + cl_int getInfo(cl_platform_info name, T* param) const + { + return detail::errHandler( + detail::getInfo(&::clGetPlatformInfo, object_, name, param), + __GET_PLATFORM_INFO_ERR); + } + + //! \brief Wrapper for clGetPlatformInfo() that returns by value. + template typename + detail::param_traits::param_type + getInfo(cl_int* err = nullptr) const + { + typename detail::param_traits< + detail::cl_platform_info, name>::param_type param; + cl_int result = getInfo(name, ¶m); + if (err != nullptr) { + *err = result; + } + return param; + } + + /*! \brief Gets a list of devices for this platform. + * + * Wraps clGetDeviceIDs(). + */ + cl_int getDevices( + cl_device_type type, + vector* devices) const + { + cl_uint n = 0; + if( devices == nullptr ) { + return detail::errHandler(CL_INVALID_ARG_VALUE, __GET_DEVICE_IDS_ERR); + } + cl_int err = ::clGetDeviceIDs(object_, type, 0, nullptr, &n); + if (err != CL_SUCCESS && err != CL_DEVICE_NOT_FOUND) { + return detail::errHandler(err, __GET_DEVICE_IDS_ERR); + } + + vector ids(n); + if (n>0) { + err = ::clGetDeviceIDs(object_, type, n, ids.data(), nullptr); + if (err != CL_SUCCESS) { + return detail::errHandler(err, __GET_DEVICE_IDS_ERR); + } + } + + // Cannot trivially assign because we need to capture intermediates + // with safe construction + // We must retain things we obtain from the API to avoid releasing + // API-owned objects. + if (devices) { + devices->resize(ids.size()); + + // Assign to param, constructing with retain behaviour + // to correctly capture each underlying CL object + for (size_type i = 0; i < ids.size(); i++) { + (*devices)[i] = Device(ids[i], true); + } + } + return CL_SUCCESS; + } + +#if defined(CL_HPP_USE_DX_INTEROP) + /*! \brief Get the list of available D3D10 devices. + * + * \param d3d_device_source. + * + * \param d3d_object. + * + * \param d3d_device_set. + * + * \param devices returns a vector of OpenCL D3D10 devices found. The cl::Device + * values returned in devices can be used to identify a specific OpenCL + * device. If \a devices argument is nullptr, this argument is ignored. + * + * \return One of the following values: + * - CL_SUCCESS if the function is executed successfully. + * + * The application can query specific capabilities of the OpenCL device(s) + * returned by cl::getDevices. This can be used by the application to + * determine which device(s) to use. + * + * \note In the case that exceptions are enabled and a return value + * other than CL_SUCCESS is generated, then cl::Error exception is + * generated. + */ + cl_int getDevices( + cl_d3d10_device_source_khr d3d_device_source, + void * d3d_object, + cl_d3d10_device_set_khr d3d_device_set, + vector* devices) const + { + typedef CL_API_ENTRY cl_int (CL_API_CALL *PFN_clGetDeviceIDsFromD3D10KHR)( + cl_platform_id platform, + cl_d3d10_device_source_khr d3d_device_source, + void * d3d_object, + cl_d3d10_device_set_khr d3d_device_set, + cl_uint num_entries, + cl_device_id * devices, + cl_uint* num_devices); + + if( devices == nullptr ) { + return detail::errHandler(CL_INVALID_ARG_VALUE, __GET_DEVICE_IDS_ERR); + } + + static PFN_clGetDeviceIDsFromD3D10KHR pfn_clGetDeviceIDsFromD3D10KHR = nullptr; +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(object_, clGetDeviceIDsFromD3D10KHR); +#endif +#if CL_HPP_MINIMUM_OPENCL_VERSION < 120 + CL_HPP_INIT_CL_EXT_FCN_PTR_(clGetDeviceIDsFromD3D10KHR); +#endif + + cl_uint n = 0; + cl_int err = pfn_clGetDeviceIDsFromD3D10KHR( + object_, + d3d_device_source, + d3d_object, + d3d_device_set, + 0, + nullptr, + &n); + if (err != CL_SUCCESS) { + return detail::errHandler(err, __GET_DEVICE_IDS_ERR); + } + + vector ids(n); + err = pfn_clGetDeviceIDsFromD3D10KHR( + object_, + d3d_device_source, + d3d_object, + d3d_device_set, + n, + ids.data(), + nullptr); + if (err != CL_SUCCESS) { + return detail::errHandler(err, __GET_DEVICE_IDS_ERR); + } + + // Cannot trivially assign because we need to capture intermediates + // with safe construction + // We must retain things we obtain from the API to avoid releasing + // API-owned objects. + if (devices) { + devices->resize(ids.size()); + + // Assign to param, constructing with retain behaviour + // to correctly capture each underlying CL object + for (size_type i = 0; i < ids.size(); i++) { + (*devices)[i] = Device(ids[i], true); + } + } + return CL_SUCCESS; + } +#endif + + /*! \brief Gets a list of available platforms. + * + * Wraps clGetPlatformIDs(). + */ + static cl_int get( + vector* platforms) + { + cl_uint n = 0; + + if( platforms == nullptr ) { + return detail::errHandler(CL_INVALID_ARG_VALUE, __GET_PLATFORM_IDS_ERR); + } + + cl_int err = ::clGetPlatformIDs(0, nullptr, &n); + if (err != CL_SUCCESS) { + return detail::errHandler(err, __GET_PLATFORM_IDS_ERR); + } + + vector ids(n); + err = ::clGetPlatformIDs(n, ids.data(), nullptr); + if (err != CL_SUCCESS) { + return detail::errHandler(err, __GET_PLATFORM_IDS_ERR); + } + + if (platforms) { + platforms->resize(ids.size()); + + // Platforms don't reference count + for (size_type i = 0; i < ids.size(); i++) { + (*platforms)[i] = Platform(ids[i]); + } + } + return CL_SUCCESS; + } + + /*! \brief Gets the first available platform. + * + * Wraps clGetPlatformIDs(), returning the first result. + */ + static cl_int get( + Platform * platform) + { + cl_int err; + Platform default_platform = Platform::getDefault(&err); + if (platform) { + *platform = default_platform; + } + return err; + } + + /*! \brief Gets the first available platform, returning it by value. + * + * \return Returns a valid platform if one is available. + * If no platform is available will return a null platform. + * Throws an exception if no platforms are available + * or an error condition occurs. + * Wraps clGetPlatformIDs(), returning the first result. + */ + static Platform get( + cl_int * errResult = nullptr) + { + cl_int err; + Platform default_platform = Platform::getDefault(&err); + if (errResult) { + *errResult = err; + } + return default_platform; + } + +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 + //! \brief Wrapper for clUnloadCompiler(). + cl_int + unloadCompiler() + { + return ::clUnloadPlatformCompiler(object_); + } +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 120 +}; // class Platform + +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 + //! \brief Wrapper for clCreateSubDevices(). +inline cl_int Device::createSubDevices(const cl_device_partition_property* properties, + vector* devices) +{ + cl_uint n = 0; + cl_int err = clCreateSubDevices(object_, properties, 0, nullptr, &n); + if (err != CL_SUCCESS) + { + return detail::errHandler(err, __CREATE_SUB_DEVICES_ERR); + } + + vector ids(n); + err = clCreateSubDevices(object_, properties, n, ids.data(), nullptr); + if (err != CL_SUCCESS) + { + return detail::errHandler(err, __CREATE_SUB_DEVICES_ERR); + } + + // Cannot trivially assign because we need to capture intermediates + // with safe construction + if (devices) + { + devices->resize(ids.size()); + + // Assign to param, constructing with retain behaviour + // to correctly capture each underlying CL object + for (size_type i = 0; i < ids.size(); i++) + { + // We do not need to retain because this device is being created + // by the runtime + (*devices)[i] = Device(ids[i], false); + } + } + + return CL_SUCCESS; +} +#endif // defined (CL_HPP_TARGET_OPENCL_VERSION >= 120) + +#if defined(cl_ext_device_fission) + //! \brief Wrapper for clCreateSubDevices(). +inline cl_int Device::createSubDevices(const cl_device_partition_property_ext* properties, + vector* devices) +{ + typedef CL_API_ENTRY cl_int(CL_API_CALL * PFN_clCreateSubDevicesEXT)( + cl_device_id /*in_device*/, + const cl_device_partition_property_ext* /* properties */, + cl_uint /*num_entries*/, cl_device_id* /*out_devices*/, + cl_uint* /*num_devices*/) CL_API_SUFFIX__VERSION_1_1; + + static PFN_clCreateSubDevicesEXT pfn_clCreateSubDevicesEXT = nullptr; +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 + cl::Device device(object_); + cl_platform_id platform = device.getInfo()(); + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clCreateSubDevicesEXT); +#endif +#if CL_HPP_MINIMUM_OPENCL_VERSION < 120 + CL_HPP_INIT_CL_EXT_FCN_PTR_(clCreateSubDevicesEXT); +#endif + + cl_uint n = 0; + cl_int err = pfn_clCreateSubDevicesEXT(object_, properties, 0, nullptr, &n); + if (err != CL_SUCCESS) + { + return detail::errHandler(err, __CREATE_SUB_DEVICES_ERR); + } + + vector ids(n); + err = + pfn_clCreateSubDevicesEXT(object_, properties, n, ids.data(), nullptr); + if (err != CL_SUCCESS) + { + return detail::errHandler(err, __CREATE_SUB_DEVICES_ERR); + } + // Cannot trivially assign because we need to capture intermediates + // with safe construction + if (devices) + { + devices->resize(ids.size()); + + // Assign to param, constructing with retain behaviour + // to correctly capture each underlying CL object + for (size_type i = 0; i < ids.size(); i++) + { + // We do not need to retain because this device is being created + // by the runtime + (*devices)[i] = Device(ids[i], false); + } + } + + return CL_SUCCESS; +} +#endif // defined(cl_ext_device_fission) + +CL_HPP_DEFINE_STATIC_MEMBER_ std::once_flag Platform::default_initialized_; +CL_HPP_DEFINE_STATIC_MEMBER_ Platform Platform::default_; +CL_HPP_DEFINE_STATIC_MEMBER_ cl_int Platform::default_error_ = CL_SUCCESS; + + +/** + * Deprecated APIs for 1.2 + */ +#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) +/** + * Unload the OpenCL compiler. + * \note Deprecated for OpenCL 1.2. Use Platform::unloadCompiler instead. + */ +inline CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_int +UnloadCompiler() CL_API_SUFFIX__VERSION_1_1_DEPRECATED; +inline cl_int +UnloadCompiler() +{ + return ::clUnloadCompiler(); +} +#endif // #if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) + + +#if defined(cl_ext_image_requirements_info) +enum ImageRequirementsInfoExt : cl_image_requirements_info_ext +{ + RowPitchAlign = CL_IMAGE_REQUIREMENTS_ROW_PITCH_ALIGNMENT_EXT, + BaseAddAlign = CL_IMAGE_REQUIREMENTS_BASE_ADDRESS_ALIGNMENT_EXT, + Size = CL_IMAGE_REQUIREMENTS_SIZE_EXT, + MaxWidth = CL_IMAGE_REQUIREMENTS_MAX_WIDTH_EXT, + MaxHeight = CL_IMAGE_REQUIREMENTS_MAX_HEIGHT_EXT, + MaxDepth = CL_IMAGE_REQUIREMENTS_MAX_DEPTH_EXT, + MaxArraySize = CL_IMAGE_REQUIREMENTS_MAX_ARRAY_SIZE_EXT, +#if defined(cl_ext_image_from_buffer) + SlicePitchAlign = CL_IMAGE_REQUIREMENTS_SLICE_PITCH_ALIGNMENT_EXT, +#endif +}; + +#endif // cl_ext_image_requirements_info + + +/*! \brief Class interface for cl_context. + * + * \note Copies of these objects are shallow, meaning that the copy will refer + * to the same underlying cl_context as the original. For details, see + * clRetainContext() and clReleaseContext(). + * + * \see cl_context + */ +class Context + : public detail::Wrapper +{ +private: + static std::once_flag default_initialized_; + static Context default_; + static cl_int default_error_; + + /*! \brief Create the default context from the default device type in the default platform. + * + * This sets @c default_ and @c default_error_. It does not throw + * @c cl::Error. + */ + static void makeDefault() { + /* Throwing an exception from a call_once invocation does not do + * what we wish, so we catch it and save the error. + */ +#if defined(CL_HPP_ENABLE_EXCEPTIONS) + try +#endif + { +#if !defined(__APPLE__) && !defined(__MACOS) + const Platform &p = Platform::getDefault(); + cl_platform_id defaultPlatform = p(); + cl_context_properties properties[3] = { + CL_CONTEXT_PLATFORM, (cl_context_properties)defaultPlatform, 0 + }; +#else // #if !defined(__APPLE__) && !defined(__MACOS) + cl_context_properties *properties = nullptr; +#endif // #if !defined(__APPLE__) && !defined(__MACOS) + + default_ = Context( + CL_DEVICE_TYPE_DEFAULT, + properties, + nullptr, + nullptr, + &default_error_); + } +#if defined(CL_HPP_ENABLE_EXCEPTIONS) + catch (cl::Error &e) { + default_error_ = e.err(); + } +#endif + } + + + /*! \brief Create the default context from a provided Context. + * + * This sets @c default_. It does not throw + * @c cl::Error. + */ + static void makeDefaultProvided(const Context &c) { + default_ = c; + } + +#if defined(cl_ext_image_requirements_info) + struct ImageRequirementsInfo { + + ImageRequirementsInfo(cl_mem_flags f, const cl_mem_properties* properties, const ImageFormat* format, const cl_image_desc* desc) + { + flags = f; + properties = properties; + image_format = format; + image_desc = desc; + } + + cl_mem_flags flags = 0; + const cl_mem_properties* properties; + const ImageFormat* image_format; + const cl_image_desc* image_desc; + }; + + static cl_int getImageRequirementsInfoExtHelper(const Context &context, + const ImageRequirementsInfo &info, + cl_image_requirements_info_ext param_name, + size_type param_value_size, + void* param_value, + size_type* param_value_size_ret) + { + +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 + Device device = context.getInfo().at(0); + cl_platform_id platform = device.getInfo()(); + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clGetImageRequirementsInfoEXT); +#else + CL_HPP_INIT_CL_EXT_FCN_PTR_(clGetImageRequirementsInfoEXT); +#endif + + if (pfn_clGetImageRequirementsInfoEXT == nullptr) { + return detail::errHandler(CL_INVALID_OPERATION, __GET_IMAGE_REQUIREMENT_INFO_EXT_ERR); + } + + return detail::errHandler( + pfn_clGetImageRequirementsInfoEXT(context(), info.properties, + info.flags, info.image_format, info.image_desc, param_name, + param_value_size, param_value, param_value_size_ret), + __GET_IMAGE_REQUIREMENT_INFO_EXT_ERR); + } +#endif // cl_ext_image_requirements_info + +public: +#ifdef CL_HPP_UNIT_TEST_ENABLE + /*! \brief Reset the default. + * + * This sets @c default_ to an empty value to support cleanup in + * the unit test framework. + * This function is not thread safe. + */ + static void unitTestClearDefault() { + default_ = Context(); + } +#endif // #ifdef CL_HPP_UNIT_TEST_ENABLE + + /*! \brief Constructs a context including a list of specified devices. + * + * Wraps clCreateContext(). + */ + Context( + const vector& devices, + const cl_context_properties* properties = nullptr, + void (CL_CALLBACK * notifyFptr)( + const char *, + const void *, + size_type, + void *) = nullptr, + void* data = nullptr, + cl_int* err = nullptr) + { + cl_int error; + + size_type numDevices = devices.size(); + vector deviceIDs(numDevices); + + for( size_type deviceIndex = 0; deviceIndex < numDevices; ++deviceIndex ) { + deviceIDs[deviceIndex] = (devices[deviceIndex])(); + } + + object_ = ::clCreateContext( + properties, (cl_uint) numDevices, + deviceIDs.data(), + notifyFptr, data, &error); + + detail::errHandler(error, __CREATE_CONTEXT_ERR); + if (err != nullptr) { + *err = error; + } + } + + /*! \brief Constructs a context including a specific device. + * + * Wraps clCreateContext(). + */ + Context( + const Device& device, + const cl_context_properties* properties = nullptr, + void (CL_CALLBACK * notifyFptr)( + const char *, + const void *, + size_type, + void *) = nullptr, + void* data = nullptr, + cl_int* err = nullptr) + { + cl_int error; + + cl_device_id deviceID = device(); + + object_ = ::clCreateContext( + properties, 1, + &deviceID, + notifyFptr, data, &error); + + detail::errHandler(error, __CREATE_CONTEXT_ERR); + if (err != nullptr) { + *err = error; + } + } + + /*! \brief Constructs a context including all or a subset of devices of a specified type. + * + * Wraps clCreateContextFromType(). + */ + Context( + cl_device_type type, + const cl_context_properties* properties = nullptr, + void (CL_CALLBACK * notifyFptr)( + const char *, + const void *, + size_type, + void *) = nullptr, + void* data = nullptr, + cl_int* err = nullptr) + { + cl_int error; + +#if !defined(__APPLE__) && !defined(__MACOS) + cl_context_properties prop[4] = {CL_CONTEXT_PLATFORM, 0, 0, 0 }; + + if (properties == nullptr) { + // Get a valid platform ID as we cannot send in a blank one + vector platforms; + error = Platform::get(&platforms); + if (error != CL_SUCCESS) { + detail::errHandler(error, __CREATE_CONTEXT_FROM_TYPE_ERR); + if (err != nullptr) { + *err = error; + } + return; + } + + // Check the platforms we found for a device of our specified type + cl_context_properties platform_id = 0; + for (unsigned int i = 0; i < platforms.size(); i++) { + + vector devices; + +#if defined(CL_HPP_ENABLE_EXCEPTIONS) + try { +#endif + + error = platforms[i].getDevices(type, &devices); + +#if defined(CL_HPP_ENABLE_EXCEPTIONS) + } catch (cl::Error& e) { + error = e.err(); + } + // Catch if exceptions are enabled as we don't want to exit if first platform has no devices of type + // We do error checking next anyway, and can throw there if needed +#endif + + // Only squash CL_SUCCESS and CL_DEVICE_NOT_FOUND + if (error != CL_SUCCESS && error != CL_DEVICE_NOT_FOUND) { + detail::errHandler(error, __CREATE_CONTEXT_FROM_TYPE_ERR); + if (err != nullptr) { + *err = error; + } + } + + if (devices.size() > 0) { + platform_id = (cl_context_properties)platforms[i](); + break; + } + } + + if (platform_id == 0) { + detail::errHandler(CL_DEVICE_NOT_FOUND, __CREATE_CONTEXT_FROM_TYPE_ERR); + if (err != nullptr) { + *err = CL_DEVICE_NOT_FOUND; + } + return; + } + + prop[1] = platform_id; + properties = &prop[0]; + } +#endif + object_ = ::clCreateContextFromType( + properties, type, notifyFptr, data, &error); + + detail::errHandler(error, __CREATE_CONTEXT_FROM_TYPE_ERR); + if (err != nullptr) { + *err = error; + } + } + + + /*! \brief Returns a singleton context including all devices of CL_DEVICE_TYPE_DEFAULT. + * + * \note All calls to this function return the same cl_context as the first. + */ + static Context getDefault(cl_int * err = nullptr) + { + std::call_once(default_initialized_, makeDefault); + detail::errHandler(default_error_); + if (err != nullptr) { + *err = default_error_; + } + return default_; + } + + /** + * Modify the default context to be used by + * subsequent operations. + * Will only set the default if no default was previously created. + * @return updated default context. + * Should be compared to the passed value to ensure that it was updated. + */ + static Context setDefault(const Context &default_context) + { + std::call_once(default_initialized_, makeDefaultProvided, std::cref(default_context)); + detail::errHandler(default_error_); + return default_; + } + + //! \brief Default constructor - initializes to nullptr. + Context() : detail::Wrapper() { } + + /*! \brief Constructor from cl_context - takes ownership. + * + * This effectively transfers ownership of a refcount on the cl_context + * into the new Context object. + */ + explicit Context(const cl_context& context, bool retainObject = false) : + detail::Wrapper(context, retainObject) { } + + /*! \brief Assignment operator from cl_context - takes ownership. + * + * This effectively transfers ownership of a refcount on the rhs and calls + * clReleaseContext() on the value previously held by this instance. + */ + Context& operator = (const cl_context& rhs) + { + detail::Wrapper::operator=(rhs); + return *this; + } + + //! \brief Wrapper for clGetContextInfo(). + template + cl_int getInfo(cl_context_info name, T* param) const + { + return detail::errHandler( + detail::getInfo(&::clGetContextInfo, object_, name, param), + __GET_CONTEXT_INFO_ERR); + } + + //! \brief Wrapper for clGetContextInfo() that returns by value. + template typename + detail::param_traits::param_type + getInfo(cl_int* err = nullptr) const + { + typename detail::param_traits< + detail::cl_context_info, name>::param_type param; + cl_int result = getInfo(name, ¶m); + if (err != nullptr) { + *err = result; + } + return param; + } + + /*! \brief Gets a list of supported image formats. + * + * Wraps clGetSupportedImageFormats(). + */ + cl_int getSupportedImageFormats( + cl_mem_flags flags, + cl_mem_object_type type, + vector* formats) const + { + cl_uint numEntries; + + if (!formats) { + return CL_SUCCESS; + } + + cl_int err = ::clGetSupportedImageFormats( + object_, + flags, + type, + 0, + nullptr, + &numEntries); + if (err != CL_SUCCESS) { + return detail::errHandler(err, __GET_SUPPORTED_IMAGE_FORMATS_ERR); + } + + if (numEntries > 0) { + vector value(numEntries); + err = ::clGetSupportedImageFormats( + object_, + flags, + type, + numEntries, + (cl_image_format*)value.data(), + nullptr); + if (err != CL_SUCCESS) { + return detail::errHandler(err, __GET_SUPPORTED_IMAGE_FORMATS_ERR); + } + + formats->assign(value.begin(), value.end()); + } + else { + // If no values are being returned, ensure an empty vector comes back + formats->clear(); + } + + return CL_SUCCESS; + } + +#if defined(cl_ext_image_requirements_info) + template + cl_int getImageRequirementsInfoExt(cl_image_requirements_info_ext name, + T* param, + cl_mem_flags flags = 0, + const cl_mem_properties* properties = nullptr, + const ImageFormat* image_format = nullptr, + const cl_image_desc* image_desc = nullptr) const + { + ImageRequirementsInfo imageInfo = {flags, properties, image_format, image_desc}; + + return detail::errHandler( + detail::getInfo( + Context::getImageRequirementsInfoExtHelper, *this, imageInfo, name, param), + __GET_IMAGE_REQUIREMENT_INFO_EXT_ERR); + } + + template typename + detail::param_traits::param_type + getImageRequirementsInfoExt(cl_mem_flags flags = 0, + const cl_mem_properties* properties = nullptr, + const ImageFormat* image_format = nullptr, + const cl_image_desc* image_desc = nullptr, + cl_int* err = nullptr) const + { + typename detail::param_traits< + detail::cl_image_requirements_info_ext, type>::param_type param; + cl_int result = getImageRequirementsInfoExt(type, ¶m, flags, properties, image_format, image_desc); + if (err != nullptr) { + *err = result; + } + return param; + } +#endif // cl_ext_image_requirements_info + +#if CL_HPP_TARGET_OPENCL_VERSION >= 300 + /*! \brief Registers a destructor callback function with a context. + * + * Wraps clSetContextDestructorCallback(). + * + * Each call to this function registers the specified callback function on + * a destructor callback stack associated with context. The registered + * callback functions are called in the reverse order in which they were registered. + * If a context callback function was specified when context was created, + * it will not be called after any context destructor callback is called. + */ + cl_int setDestructorCallback( + void (CL_CALLBACK * pfn_notify)(cl_context, void *), + void * user_data = nullptr) + { + return detail::errHandler( + ::clSetContextDestructorCallback( + object_, + pfn_notify, + user_data), + __SET_CONTEXT_DESCTRUCTOR_CALLBACK_ERR); + } +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 300 +}; + +inline void Device::makeDefault() +{ + /* Throwing an exception from a call_once invocation does not do + * what we wish, so we catch it and save the error. + */ +#if defined(CL_HPP_ENABLE_EXCEPTIONS) + try +#endif + { + cl_int error = 0; + + Context context = Context::getDefault(&error); + detail::errHandler(error, __CREATE_CONTEXT_ERR); + + if (error != CL_SUCCESS) { + default_error_ = error; + } + else { + default_ = context.getInfo()[0]; + default_error_ = CL_SUCCESS; + } + } +#if defined(CL_HPP_ENABLE_EXCEPTIONS) + catch (cl::Error &e) { + default_error_ = e.err(); + } +#endif +} + +CL_HPP_DEFINE_STATIC_MEMBER_ std::once_flag Context::default_initialized_; +CL_HPP_DEFINE_STATIC_MEMBER_ Context Context::default_; +CL_HPP_DEFINE_STATIC_MEMBER_ cl_int Context::default_error_ = CL_SUCCESS; + +/*! \brief Class interface for cl_event. + * + * \note Copies of these objects are shallow, meaning that the copy will refer + * to the same underlying cl_event as the original. For details, see + * clRetainEvent() and clReleaseEvent(). + * + * \see cl_event + */ +class Event : public detail::Wrapper +{ +public: + //! \brief Default constructor - initializes to nullptr. + Event() : detail::Wrapper() { } + + /*! \brief Constructor from cl_event - takes ownership. + * + * \param retainObject will cause the constructor to retain its cl object. + * Defaults to false to maintain compatibility with + * earlier versions. + * This effectively transfers ownership of a refcount on the cl_event + * into the new Event object. + */ + explicit Event(const cl_event& event, bool retainObject = false) : + detail::Wrapper(event, retainObject) { } + + /*! \brief Assignment operator from cl_event - takes ownership. + * + * This effectively transfers ownership of a refcount on the rhs and calls + * clReleaseEvent() on the value previously held by this instance. + */ + Event& operator = (const cl_event& rhs) + { + detail::Wrapper::operator=(rhs); + return *this; + } + + //! \brief Wrapper for clGetEventInfo(). + template + cl_int getInfo(cl_event_info name, T* param) const + { + return detail::errHandler( + detail::getInfo(&::clGetEventInfo, object_, name, param), + __GET_EVENT_INFO_ERR); + } + + //! \brief Wrapper for clGetEventInfo() that returns by value. + template typename + detail::param_traits::param_type + getInfo(cl_int* err = nullptr) const + { + typename detail::param_traits< + detail::cl_event_info, name>::param_type param; + cl_int result = getInfo(name, ¶m); + if (err != nullptr) { + *err = result; + } + return param; + } + + //! \brief Wrapper for clGetEventProfilingInfo(). + template + cl_int getProfilingInfo(cl_profiling_info name, T* param) const + { + return detail::errHandler(detail::getInfo( + &::clGetEventProfilingInfo, object_, name, param), + __GET_EVENT_PROFILE_INFO_ERR); + } + + //! \brief Wrapper for clGetEventProfilingInfo() that returns by value. + template typename + detail::param_traits::param_type + getProfilingInfo(cl_int* err = nullptr) const + { + typename detail::param_traits< + detail::cl_profiling_info, name>::param_type param; + cl_int result = getProfilingInfo(name, ¶m); + if (err != nullptr) { + *err = result; + } + return param; + } + + /*! \brief Blocks the calling thread until this event completes. + * + * Wraps clWaitForEvents(). + */ + cl_int wait() const + { + return detail::errHandler( + ::clWaitForEvents(1, &object_), + __WAIT_FOR_EVENTS_ERR); + } + +#if CL_HPP_TARGET_OPENCL_VERSION >= 110 + /*! \brief Registers a user callback function for a specific command execution status. + * + * Wraps clSetEventCallback(). + */ + cl_int setCallback( + cl_int type, + void (CL_CALLBACK * pfn_notify)(cl_event, cl_int, void *), + void * user_data = nullptr) + { + return detail::errHandler( + ::clSetEventCallback( + object_, + type, + pfn_notify, + user_data), + __SET_EVENT_CALLBACK_ERR); + } +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 110 + + /*! \brief Blocks the calling thread until every event specified is complete. + * + * Wraps clWaitForEvents(). + */ + static cl_int + waitForEvents(const vector& events) + { + static_assert(sizeof(cl::Event) == sizeof(cl_event), + "Size of cl::Event must be equal to size of cl_event"); + + return detail::errHandler( + ::clWaitForEvents( + (cl_uint) events.size(), (events.size() > 0) ? (cl_event*)&events.front() : nullptr), + __WAIT_FOR_EVENTS_ERR); + } +}; + +#if CL_HPP_TARGET_OPENCL_VERSION >= 110 +/*! \brief Class interface for user events (a subset of cl_event's). + * + * See Event for details about copy semantics, etc. + */ +class UserEvent : public Event +{ +public: + /*! \brief Constructs a user event on a given context. + * + * Wraps clCreateUserEvent(). + */ + UserEvent( + const Context& context, + cl_int * err = nullptr) + { + cl_int error; + object_ = ::clCreateUserEvent( + context(), + &error); + + detail::errHandler(error, __CREATE_USER_EVENT_ERR); + if (err != nullptr) { + *err = error; + } + } + + //! \brief Default constructor - initializes to nullptr. + UserEvent() : Event() { } + + /*! \brief Sets the execution status of a user event object. + * + * Wraps clSetUserEventStatus(). + */ + cl_int setStatus(cl_int status) + { + return detail::errHandler( + ::clSetUserEventStatus(object_,status), + __SET_USER_EVENT_STATUS_ERR); + } +}; +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 110 + +/*! \brief Blocks the calling thread until every event specified is complete. + * + * Wraps clWaitForEvents(). + */ +inline static cl_int +WaitForEvents(const vector& events) +{ + return detail::errHandler( + ::clWaitForEvents( + (cl_uint) events.size(), (events.size() > 0) ? (cl_event*)&events.front() : nullptr), + __WAIT_FOR_EVENTS_ERR); +} + +/*! \brief Class interface for cl_mem. + * + * \note Copies of these objects are shallow, meaning that the copy will refer + * to the same underlying cl_mem as the original. For details, see + * clRetainMemObject() and clReleaseMemObject(). + * + * \see cl_mem + */ +class Memory : public detail::Wrapper +{ +public: + //! \brief Default constructor - initializes to nullptr. + Memory() : detail::Wrapper() { } + + /*! \brief Constructor from cl_mem - takes ownership. + * + * Optionally transfer ownership of a refcount on the cl_mem + * into the new Memory object. + * + * \param retainObject will cause the constructor to retain its cl object. + * Defaults to false to maintain compatibility with + * earlier versions. + * + * See Memory for further details. + */ + explicit Memory(const cl_mem& memory, bool retainObject) : + detail::Wrapper(memory, retainObject) { } + + /*! \brief Assignment operator from cl_mem - takes ownership. + * + * This effectively transfers ownership of a refcount on the rhs and calls + * clReleaseMemObject() on the value previously held by this instance. + */ + Memory& operator = (const cl_mem& rhs) + { + detail::Wrapper::operator=(rhs); + return *this; + } + + //! \brief Wrapper for clGetMemObjectInfo(). + template + cl_int getInfo(cl_mem_info name, T* param) const + { + return detail::errHandler( + detail::getInfo(&::clGetMemObjectInfo, object_, name, param), + __GET_MEM_OBJECT_INFO_ERR); + } + + //! \brief Wrapper for clGetMemObjectInfo() that returns by value. + template typename + detail::param_traits::param_type + getInfo(cl_int* err = nullptr) const + { + typename detail::param_traits< + detail::cl_mem_info, name>::param_type param; + cl_int result = getInfo(name, ¶m); + if (err != nullptr) { + *err = result; + } + return param; + } + +#if CL_HPP_TARGET_OPENCL_VERSION >= 110 + /*! \brief Registers a callback function to be called when the memory object + * is no longer needed. + * + * Wraps clSetMemObjectDestructorCallback(). + * + * Repeated calls to this function, for a given cl_mem value, will append + * to the list of functions called (in reverse order) when memory object's + * resources are freed and the memory object is deleted. + * + * \note + * The registered callbacks are associated with the underlying cl_mem + * value - not the Memory class instance. + */ + cl_int setDestructorCallback( + void (CL_CALLBACK * pfn_notify)(cl_mem, void *), + void * user_data = nullptr) + { + return detail::errHandler( + ::clSetMemObjectDestructorCallback( + object_, + pfn_notify, + user_data), + __SET_MEM_OBJECT_DESTRUCTOR_CALLBACK_ERR); + } +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 110 + +}; + +// Pre-declare copy functions +class Buffer; +template< typename IteratorType > +cl_int copy( IteratorType startIterator, IteratorType endIterator, cl::Buffer &buffer ); +template< typename IteratorType > +cl_int copy( const cl::Buffer &buffer, IteratorType startIterator, IteratorType endIterator ); +template< typename IteratorType > +cl_int copy( const CommandQueue &queue, IteratorType startIterator, IteratorType endIterator, cl::Buffer &buffer ); +template< typename IteratorType > +cl_int copy( const CommandQueue &queue, const cl::Buffer &buffer, IteratorType startIterator, IteratorType endIterator ); + + +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 +namespace detail +{ + class SVMTraitNull + { + public: + static cl_svm_mem_flags getSVMMemFlags() + { + return 0; + } + }; +} // namespace detail + +template +class SVMTraitReadWrite +{ +public: + static cl_svm_mem_flags getSVMMemFlags() + { + return CL_MEM_READ_WRITE | + Trait::getSVMMemFlags(); + } +}; + +template +class SVMTraitReadOnly +{ +public: + static cl_svm_mem_flags getSVMMemFlags() + { + return CL_MEM_READ_ONLY | + Trait::getSVMMemFlags(); + } +}; + +template +class SVMTraitWriteOnly +{ +public: + static cl_svm_mem_flags getSVMMemFlags() + { + return CL_MEM_WRITE_ONLY | + Trait::getSVMMemFlags(); + } +}; + +template> +class SVMTraitCoarse +{ +public: + static cl_svm_mem_flags getSVMMemFlags() + { + return Trait::getSVMMemFlags(); + } +}; + +template> +class SVMTraitFine +{ +public: + static cl_svm_mem_flags getSVMMemFlags() + { + return CL_MEM_SVM_FINE_GRAIN_BUFFER | + Trait::getSVMMemFlags(); + } +}; + +template> +class SVMTraitAtomic +{ +public: + static cl_svm_mem_flags getSVMMemFlags() + { + return + CL_MEM_SVM_FINE_GRAIN_BUFFER | + CL_MEM_SVM_ATOMICS | + Trait::getSVMMemFlags(); + } +}; + +// Pre-declare SVM map function +template +inline cl_int enqueueMapSVM( + T* ptr, + cl_bool blocking, + cl_map_flags flags, + size_type size, + const vector* events = nullptr, + Event* event = nullptr); + +/** + * STL-like allocator class for managing SVM objects provided for convenience. + * + * Note that while this behaves like an allocator for the purposes of constructing vectors and similar objects, + * care must be taken when using with smart pointers. + * The allocator should not be used to construct a unique_ptr if we are using coarse-grained SVM mode because + * the coarse-grained management behaviour would behave incorrectly with respect to reference counting. + * + * Instead the allocator embeds a Deleter which may be used with unique_ptr and is used + * with the allocate_shared and allocate_ptr supplied operations. + */ +template +class SVMAllocator { +private: + Context context_; + +public: + typedef T value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; + typedef std::size_t size_type; + typedef std::ptrdiff_t difference_type; + + template + struct rebind + { + typedef SVMAllocator other; + }; + + template + friend class SVMAllocator; + + SVMAllocator() : + context_(Context::getDefault()) + { + } + + explicit SVMAllocator(cl::Context context) : + context_(context) + { + } + + + SVMAllocator(const SVMAllocator &other) : + context_(other.context_) + { + } + + template + SVMAllocator(const SVMAllocator &other) : + context_(other.context_) + { + } + + ~SVMAllocator() + { + } + + pointer address(reference r) noexcept + { + return std::addressof(r); + } + + const_pointer address(const_reference r) noexcept + { + return std::addressof(r); + } + + /** + * Allocate an SVM pointer. + * + * If the allocator is coarse-grained, this will take ownership to allow + * containers to correctly construct data in place. + */ + pointer allocate( + size_type size, + typename cl::SVMAllocator::const_pointer = 0, + bool map = true) + { + // Allocate memory with default alignment matching the size of the type + void* voidPointer = + clSVMAlloc( + context_(), + SVMTrait::getSVMMemFlags(), + size*sizeof(T), + 0); + pointer retValue = reinterpret_cast( + voidPointer); +#if defined(CL_HPP_ENABLE_EXCEPTIONS) + if (!retValue) { + std::bad_alloc excep; + throw excep; + } +#endif // #if defined(CL_HPP_ENABLE_EXCEPTIONS) + + // If allocation was coarse-grained then map it + if (map && !(SVMTrait::getSVMMemFlags() & CL_MEM_SVM_FINE_GRAIN_BUFFER)) { + cl_int err = enqueueMapSVM(retValue, CL_TRUE, CL_MAP_READ | CL_MAP_WRITE, size*sizeof(T)); + if (err != CL_SUCCESS) { + clSVMFree(context_(), retValue); + retValue = nullptr; +#if defined(CL_HPP_ENABLE_EXCEPTIONS) + std::bad_alloc excep; + throw excep; +#endif + } + } + + // If exceptions disabled, return null pointer from allocator + return retValue; + } + + void deallocate(pointer p, size_type) + { + clSVMFree(context_(), p); + } + + /** + * Return the maximum possible allocation size. + * This is the minimum of the maximum sizes of all devices in the context. + */ + size_type max_size() const noexcept + { + size_type maxSize = std::numeric_limits::max() / sizeof(T); + + for (const Device &d : context_.getInfo()) { + maxSize = std::min( + maxSize, + static_cast(d.getInfo())); + } + + return maxSize; + } + + template< class U, class... Args > + void construct(U* p, Args&&... args) + { + new(p)T(args...); + } + + template< class U > + void destroy(U* p) + { + p->~U(); + } + + /** + * Returns true if the contexts match. + */ + inline bool operator==(SVMAllocator const& rhs) + { + return (context_==rhs.context_); + } + + inline bool operator!=(SVMAllocator const& a) + { + return !operator==(a); + } +}; // class SVMAllocator return cl::pointer(tmp, detail::Deleter{alloc, copies}); + + +template +class SVMAllocator { +public: + typedef void value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + + template + struct rebind + { + typedef SVMAllocator other; + }; + + template + friend class SVMAllocator; +}; + +#if !defined(CL_HPP_NO_STD_UNIQUE_PTR) +namespace detail +{ + template + class Deleter { + private: + Alloc alloc_; + size_type copies_; + + public: + typedef typename std::allocator_traits::pointer pointer; + + Deleter(const Alloc &alloc, size_type copies) : alloc_{ alloc }, copies_{ copies } + { + } + + void operator()(pointer ptr) const { + Alloc tmpAlloc{ alloc_ }; + std::allocator_traits::destroy(tmpAlloc, std::addressof(*ptr)); + std::allocator_traits::deallocate(tmpAlloc, ptr, copies_); + } + }; +} // namespace detail + +/** + * Allocation operation compatible with std::allocate_ptr. + * Creates a unique_ptr by default. + * This requirement is to ensure that the control block is not + * allocated in memory inaccessible to the host. + */ +template +cl::pointer> allocate_pointer(const Alloc &alloc_, Args&&... args) +{ + Alloc alloc(alloc_); + static const size_type copies = 1; + + // Ensure that creation of the management block and the + // object are dealt with separately such that we only provide a deleter + + T* tmp = std::allocator_traits::allocate(alloc, copies); + if (!tmp) { + std::bad_alloc excep; + throw excep; + } + try { + std::allocator_traits::construct( + alloc, + std::addressof(*tmp), + std::forward(args)...); + + return cl::pointer>(tmp, detail::Deleter{alloc, copies}); + } + catch (std::bad_alloc&) + { + std::allocator_traits::deallocate(alloc, tmp, copies); + throw; + } +} + +template< class T, class SVMTrait, class... Args > +cl::pointer>> allocate_svm(Args... args) +{ + SVMAllocator alloc; + return cl::allocate_pointer(alloc, args...); +} + +template< class T, class SVMTrait, class... Args > +cl::pointer>> allocate_svm(const cl::Context &c, Args... args) +{ + SVMAllocator alloc(c); + return cl::allocate_pointer(alloc, args...); +} +#endif // #if !defined(CL_HPP_NO_STD_UNIQUE_PTR) + +/*! \brief Vector alias to simplify contruction of coarse-grained SVM containers. + * + */ +template < class T > +using coarse_svm_vector = vector>>; + +/*! \brief Vector alias to simplify contruction of fine-grained SVM containers. +* +*/ +template < class T > +using fine_svm_vector = vector>>; + +/*! \brief Vector alias to simplify contruction of fine-grained SVM containers that support platform atomics. +* +*/ +template < class T > +using atomic_svm_vector = vector>>; + +#endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 200 + + +/*! \brief Class interface for Buffer Memory Objects. + * + * See Memory for details about copy semantics, etc. + * + * \see Memory + */ +class Buffer : public Memory +{ +public: + + /*! \brief Constructs a Buffer in a specified context. + * + * Wraps clCreateBuffer(). + * + * \param host_ptr Storage to be used if the CL_MEM_USE_HOST_PTR flag was + * specified. Note alignment & exclusivity requirements. + */ + Buffer( + const Context& context, + cl_mem_flags flags, + size_type size, + void* host_ptr = nullptr, + cl_int* err = nullptr) + { + cl_int error; + object_ = ::clCreateBuffer(context(), flags, size, host_ptr, &error); + + detail::errHandler(error, __CREATE_BUFFER_ERR); + if (err != nullptr) { + *err = error; + } + } + +#if CL_HPP_TARGET_OPENCL_VERSION >= 300 + /*! \brief Constructs a Buffer in a specified context and with specified properties. + * + * Wraps clCreateBufferWithProperties(). + * + * \param properties Optional list of properties for the buffer object and + * their corresponding values. The non-empty list must + * end with 0. + * \param host_ptr Storage to be used if the CL_MEM_USE_HOST_PTR flag was + * specified. Note alignment & exclusivity requirements. + */ + Buffer( + const Context& context, + const vector& properties, + cl_mem_flags flags, + size_type size, + void* host_ptr = nullptr, + cl_int* err = nullptr) + { + cl_int error; + + if (properties.empty()) { + object_ = ::clCreateBufferWithProperties(context(), nullptr, flags, + size, host_ptr, &error); + } + else { + object_ = ::clCreateBufferWithProperties( + context(), properties.data(), flags, size, host_ptr, &error); + } + + detail::errHandler(error, __CREATE_BUFFER_ERR); + if (err != nullptr) { + *err = error; + } + } +#endif + + /*! \brief Constructs a Buffer in the default context. + * + * Wraps clCreateBuffer(). + * + * \param host_ptr Storage to be used if the CL_MEM_USE_HOST_PTR flag was + * specified. Note alignment & exclusivity requirements. + * + * \see Context::getDefault() + */ + Buffer( + cl_mem_flags flags, + size_type size, + void* host_ptr = nullptr, + cl_int* err = nullptr) : Buffer(Context::getDefault(err), flags, size, host_ptr, err) { } + +#if CL_HPP_TARGET_OPENCL_VERSION >= 300 + /*! \brief Constructs a Buffer in the default context and with specified properties. + * + * Wraps clCreateBufferWithProperties(). + * + * \param properties Optional list of properties for the buffer object and + * their corresponding values. The non-empty list must + * end with 0. + * \param host_ptr Storage to be used if the CL_MEM_USE_HOST_PTR flag was + * specified. Note alignment & exclusivity requirements. + * + * \see Context::getDefault() + */ + Buffer( + const vector& properties, + cl_mem_flags flags, + size_type size, + void* host_ptr = nullptr, + cl_int* err = nullptr) : Buffer(Context::getDefault(err), properties, flags, size, host_ptr, err) { } +#endif + + /*! + * \brief Construct a Buffer from a host container via iterators. + * IteratorType must be random access. + * If useHostPtr is specified iterators must represent contiguous data. + */ + template< typename IteratorType > + Buffer( + IteratorType startIterator, + IteratorType endIterator, + bool readOnly, + bool useHostPtr = false, + cl_int* err = nullptr) + { + typedef typename std::iterator_traits::value_type DataType; + cl_int error; + + cl_mem_flags flags = 0; + if( readOnly ) { + flags |= CL_MEM_READ_ONLY; + } + else { + flags |= CL_MEM_READ_WRITE; + } + if( useHostPtr ) { + flags |= CL_MEM_USE_HOST_PTR; + } + + size_type size = sizeof(DataType)*(endIterator - startIterator); + + Context context = Context::getDefault(err); + + if( useHostPtr ) { + object_ = ::clCreateBuffer(context(), flags, size, const_cast(&*startIterator), &error); + } else { + object_ = ::clCreateBuffer(context(), flags, size, 0, &error); + } + + detail::errHandler(error, __CREATE_BUFFER_ERR); + if (err != nullptr) { + *err = error; + } + + if( !useHostPtr ) { + error = cl::copy(startIterator, endIterator, *this); + detail::errHandler(error, __CREATE_BUFFER_ERR); + if (err != nullptr) { + *err = error; + } + } + } + + /*! + * \brief Construct a Buffer from a host container via iterators using a specified context. + * IteratorType must be random access. + * If useHostPtr is specified iterators must represent contiguous data. + */ + template< typename IteratorType > + Buffer(const Context &context, IteratorType startIterator, IteratorType endIterator, + bool readOnly, bool useHostPtr = false, cl_int* err = nullptr); + + /*! + * \brief Construct a Buffer from a host container via iterators using a specified queue. + * If useHostPtr is specified iterators must be random access. + */ + template< typename IteratorType > + Buffer(const CommandQueue &queue, IteratorType startIterator, IteratorType endIterator, + bool readOnly, bool useHostPtr = false, cl_int* err = nullptr); + + //! \brief Default constructor - initializes to nullptr. + Buffer() : Memory() { } + + /*! \brief Constructor from cl_mem - takes ownership. + * + * \param retainObject will cause the constructor to retain its cl object. + * Defaults to false to maintain compatibility with earlier versions. + * + * See Memory for further details. + */ + explicit Buffer(const cl_mem& buffer, bool retainObject = false) : + Memory(buffer, retainObject) { } + + /*! \brief Assignment from cl_mem - performs shallow copy. + * + * See Memory for further details. + */ + Buffer& operator = (const cl_mem& rhs) + { + Memory::operator=(rhs); + return *this; + } + + +#if CL_HPP_TARGET_OPENCL_VERSION >= 110 + /*! \brief Creates a new buffer object from this. + * + * Wraps clCreateSubBuffer(). + */ + Buffer createSubBuffer( + cl_mem_flags flags, + cl_buffer_create_type buffer_create_type, + const void * buffer_create_info, + cl_int * err = nullptr) + { + Buffer result; + cl_int error; + result.object_ = ::clCreateSubBuffer( + object_, + flags, + buffer_create_type, + buffer_create_info, + &error); + + detail::errHandler(error, __CREATE_SUBBUFFER_ERR); + if (err != nullptr) { + *err = error; + } + + return result; + } +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 110 +}; + +#if defined (CL_HPP_USE_DX_INTEROP) +/*! \brief Class interface for creating OpenCL buffers from ID3D10Buffer's. + * + * This is provided to facilitate interoperability with Direct3D. + * + * See Memory for details about copy semantics, etc. + * + * \see Memory + */ +class BufferD3D10 : public Buffer +{ +public: + + + /*! \brief Constructs a BufferD3D10, in a specified context, from a + * given ID3D10Buffer. + * + * Wraps clCreateFromD3D10BufferKHR(). + */ + BufferD3D10( + const Context& context, + cl_mem_flags flags, + ID3D10Buffer* bufobj, + cl_int * err = nullptr) : pfn_clCreateFromD3D10BufferKHR(nullptr) + { + typedef CL_API_ENTRY cl_mem (CL_API_CALL *PFN_clCreateFromD3D10BufferKHR)( + cl_context context, cl_mem_flags flags, ID3D10Buffer* buffer, + cl_int* errcode_ret); + PFN_clCreateFromD3D10BufferKHR pfn_clCreateFromD3D10BufferKHR; +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 + vector props = context.getInfo(); + cl_platform platform = nullptr; + for( int i = 0; i < props.size(); ++i ) { + if( props[i] == CL_CONTEXT_PLATFORM ) { + platform = props[i+1]; + } + } + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clCreateFromD3D10BufferKHR); +#endif +#if CL_HPP_MINIMUM_OPENCL_VERSION < 120 + CL_HPP_INIT_CL_EXT_FCN_PTR_(clCreateFromD3D10BufferKHR); +#endif + + cl_int error; + object_ = pfn_clCreateFromD3D10BufferKHR( + context(), + flags, + bufobj, + &error); + + // TODO: This should really have a D3D10 rerror code! + detail::errHandler(error, __CREATE_GL_BUFFER_ERR); + if (err != nullptr) { + *err = error; + } + } + + //! \brief Default constructor - initializes to nullptr. + BufferD3D10() : Buffer() { } + + /*! \brief Constructor from cl_mem - takes ownership. + * + * \param retainObject will cause the constructor to retain its cl object. + * Defaults to false to maintain compatibility with + * earlier versions. + * See Memory for further details. + */ + explicit BufferD3D10(const cl_mem& buffer, bool retainObject = false) : + Buffer(buffer, retainObject) { } + + /*! \brief Assignment from cl_mem - performs shallow copy. + * + * See Memory for further details. + */ + BufferD3D10& operator = (const cl_mem& rhs) + { + Buffer::operator=(rhs); + return *this; + } +}; +#endif + +/*! \brief Class interface for GL Buffer Memory Objects. + * + * This is provided to facilitate interoperability with OpenGL. + * + * See Memory for details about copy semantics, etc. + * + * \see Memory + */ +class BufferGL : public Buffer +{ +public: + /*! \brief Constructs a BufferGL in a specified context, from a given + * GL buffer. + * + * Wraps clCreateFromGLBuffer(). + */ + BufferGL( + const Context& context, + cl_mem_flags flags, + cl_GLuint bufobj, + cl_int * err = nullptr) + { + cl_int error; + object_ = ::clCreateFromGLBuffer( + context(), + flags, + bufobj, + &error); + + detail::errHandler(error, __CREATE_GL_BUFFER_ERR); + if (err != nullptr) { + *err = error; + } + } + + //! \brief Default constructor - initializes to nullptr. + BufferGL() : Buffer() { } + + /*! \brief Constructor from cl_mem - takes ownership. + * + * \param retainObject will cause the constructor to retain its cl object. + * Defaults to false to maintain compatibility with + * earlier versions. + * See Memory for further details. + */ + explicit BufferGL(const cl_mem& buffer, bool retainObject = false) : + Buffer(buffer, retainObject) { } + + /*! \brief Assignment from cl_mem - performs shallow copy. + * + * See Memory for further details. + */ + BufferGL& operator = (const cl_mem& rhs) + { + Buffer::operator=(rhs); + return *this; + } + + + //! \brief Wrapper for clGetGLObjectInfo(). + cl_int getObjectInfo( + cl_gl_object_type *type, + cl_GLuint * gl_object_name) + { + return detail::errHandler( + ::clGetGLObjectInfo(object_,type,gl_object_name), + __GET_GL_OBJECT_INFO_ERR); + } +}; + +/*! \brief Class interface for GL Render Buffer Memory Objects. + * + * This is provided to facilitate interoperability with OpenGL. + * + * See Memory for details about copy semantics, etc. + * + * \see Memory + */ +class BufferRenderGL : public Buffer +{ +public: + /*! \brief Constructs a BufferRenderGL in a specified context, from a given + * GL Renderbuffer. + * + * Wraps clCreateFromGLRenderbuffer(). + */ + BufferRenderGL( + const Context& context, + cl_mem_flags flags, + cl_GLuint bufobj, + cl_int * err = nullptr) + { + cl_int error; + object_ = ::clCreateFromGLRenderbuffer( + context(), + flags, + bufobj, + &error); + + detail::errHandler(error, __CREATE_GL_RENDER_BUFFER_ERR); + if (err != nullptr) { + *err = error; + } + } + + //! \brief Default constructor - initializes to nullptr. + BufferRenderGL() : Buffer() { } + + /*! \brief Constructor from cl_mem - takes ownership. + * + * \param retainObject will cause the constructor to retain its cl object. + * Defaults to false to maintain compatibility with + * earlier versions. + * See Memory for further details. + */ + explicit BufferRenderGL(const cl_mem& buffer, bool retainObject = false) : + Buffer(buffer, retainObject) { } + + /*! \brief Assignment from cl_mem - performs shallow copy. + * + * See Memory for further details. + */ + BufferRenderGL& operator = (const cl_mem& rhs) + { + Buffer::operator=(rhs); + return *this; + } + + + //! \brief Wrapper for clGetGLObjectInfo(). + cl_int getObjectInfo( + cl_gl_object_type *type, + cl_GLuint * gl_object_name) + { + return detail::errHandler( + ::clGetGLObjectInfo(object_,type,gl_object_name), + __GET_GL_OBJECT_INFO_ERR); + } +}; + +/*! \brief C++ base class for Image Memory objects. + * + * See Memory for details about copy semantics, etc. + * + * \see Memory + */ +class Image : public Memory +{ +protected: + //! \brief Default constructor - initializes to nullptr. + Image() : Memory() { } + + /*! \brief Constructor from cl_mem - takes ownership. + * + * \param retainObject will cause the constructor to retain its cl object. + * Defaults to false to maintain compatibility with + * earlier versions. + * See Memory for further details. + */ + explicit Image(const cl_mem& image, bool retainObject = false) : + Memory(image, retainObject) { } + + /*! \brief Assignment from cl_mem - performs shallow copy. + * + * See Memory for further details. + */ + Image& operator = (const cl_mem& rhs) + { + Memory::operator=(rhs); + return *this; + } + + +public: + //! \brief Wrapper for clGetImageInfo(). + template + cl_int getImageInfo(cl_image_info name, T* param) const + { + return detail::errHandler( + detail::getInfo(&::clGetImageInfo, object_, name, param), + __GET_IMAGE_INFO_ERR); + } + + //! \brief Wrapper for clGetImageInfo() that returns by value. + template typename + detail::param_traits::param_type + getImageInfo(cl_int* err = nullptr) const + { + typename detail::param_traits< + detail::cl_image_info, name>::param_type param; + cl_int result = getImageInfo(name, ¶m); + if (err != nullptr) { + *err = result; + } + return param; + } +}; + +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 +/*! \brief Class interface for 1D Image Memory objects. + * + * See Memory for details about copy semantics, etc. + * + * \see Memory + */ +class Image1D : public Image +{ +public: + /*! \brief Constructs a 1D Image in a specified context. + * + * Wraps clCreateImage(). + */ + Image1D( + const Context& context, + cl_mem_flags flags, + ImageFormat format, + size_type width, + void* host_ptr = nullptr, + cl_int* err = nullptr) + { + cl_int error; + + cl_image_desc desc = {}; + desc.image_type = CL_MEM_OBJECT_IMAGE1D; + desc.image_width = width; + + object_ = ::clCreateImage( + context(), + flags, + &format, + &desc, + host_ptr, + &error); + + detail::errHandler(error, __CREATE_IMAGE_ERR); + if (err != nullptr) { + *err = error; + } + } + + //! \brief Default constructor - initializes to nullptr. + Image1D() { } + + /*! \brief Constructor from cl_mem - takes ownership. + * + * \param retainObject will cause the constructor to retain its cl object. + * Defaults to false to maintain compatibility with + * earlier versions. + * See Memory for further details. + */ + explicit Image1D(const cl_mem& image1D, bool retainObject = false) : + Image(image1D, retainObject) { } + + /*! \brief Assignment from cl_mem - performs shallow copy. + * + * See Memory for further details. + */ + Image1D& operator = (const cl_mem& rhs) + { + Image::operator=(rhs); + return *this; + } + + +}; + +/*! \class Image1DBuffer + * \brief Image interface for 1D buffer images. + */ +class Image1DBuffer : public Image +{ +public: + Image1DBuffer( + const Context& context, + cl_mem_flags flags, + ImageFormat format, + size_type width, + const Buffer &buffer, + cl_int* err = nullptr) + { + cl_int error; + + cl_image_desc desc = {}; + desc.image_type = CL_MEM_OBJECT_IMAGE1D_BUFFER; + desc.image_width = width; + desc.buffer = buffer(); + + object_ = ::clCreateImage( + context(), + flags, + &format, + &desc, + nullptr, + &error); + + detail::errHandler(error, __CREATE_IMAGE_ERR); + if (err != nullptr) { + *err = error; + } + } + + Image1DBuffer() { } + + /*! \brief Constructor from cl_mem - takes ownership. + * + * \param retainObject will cause the constructor to retain its cl object. + * Defaults to false to maintain compatibility with + * earlier versions. + * See Memory for further details. + */ + explicit Image1DBuffer(const cl_mem& image1D, bool retainObject = false) : + Image(image1D, retainObject) { } + + Image1DBuffer& operator = (const cl_mem& rhs) + { + Image::operator=(rhs); + return *this; + } + + + +}; + +/*! \class Image1DArray + * \brief Image interface for arrays of 1D images. + */ +class Image1DArray : public Image +{ +public: + Image1DArray( + const Context& context, + cl_mem_flags flags, + ImageFormat format, + size_type arraySize, + size_type width, + size_type rowPitch, + void* host_ptr = nullptr, + cl_int* err = nullptr) + { + cl_int error; + + cl_image_desc desc = {}; + desc.image_type = CL_MEM_OBJECT_IMAGE1D_ARRAY; + desc.image_width = width; + desc.image_array_size = arraySize; + desc.image_row_pitch = rowPitch; + + object_ = ::clCreateImage( + context(), + flags, + &format, + &desc, + host_ptr, + &error); + + detail::errHandler(error, __CREATE_IMAGE_ERR); + if (err != nullptr) { + *err = error; + } + } + + Image1DArray() { } + + /*! \brief Constructor from cl_mem - takes ownership. + * + * \param retainObject will cause the constructor to retain its cl object. + * Defaults to false to maintain compatibility with + * earlier versions. + * See Memory for further details. + */ + explicit Image1DArray(const cl_mem& imageArray, bool retainObject = false) : + Image(imageArray, retainObject) { } + + + Image1DArray& operator = (const cl_mem& rhs) + { + Image::operator=(rhs); + return *this; + } + + +}; +#endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 120 + + +/*! \brief Class interface for 2D Image Memory objects. + * + * See Memory for details about copy semantics, etc. + * + * \see Memory + */ +class Image2D : public Image +{ +public: + /*! \brief Constructs a 2D Image in a specified context. + * + * Wraps clCreateImage(). + */ + Image2D( + const Context& context, + cl_mem_flags flags, + ImageFormat format, + size_type width, + size_type height, + size_type row_pitch = 0, + void* host_ptr = nullptr, + cl_int* err = nullptr) + { + cl_int error; + bool useCreateImage; + +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 && CL_HPP_MINIMUM_OPENCL_VERSION < 120 + // Run-time decision based on the actual platform + { + cl_uint version = detail::getContextPlatformVersion(context()); + useCreateImage = (version >= 0x10002); // OpenCL 1.2 or above + } +#elif CL_HPP_TARGET_OPENCL_VERSION >= 120 + useCreateImage = true; +#else + useCreateImage = false; +#endif + +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 + if (useCreateImage) + { + cl_image_desc desc = {}; + desc.image_type = CL_MEM_OBJECT_IMAGE2D; + desc.image_width = width; + desc.image_height = height; + desc.image_row_pitch = row_pitch; + + object_ = ::clCreateImage( + context(), + flags, + &format, + &desc, + host_ptr, + &error); + + detail::errHandler(error, __CREATE_IMAGE_ERR); + if (err != nullptr) { + *err = error; + } + } +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 120 +#if CL_HPP_MINIMUM_OPENCL_VERSION < 120 + if (!useCreateImage) + { + object_ = ::clCreateImage2D( + context(), flags,&format, width, height, row_pitch, host_ptr, &error); + + detail::errHandler(error, __CREATE_IMAGE2D_ERR); + if (err != nullptr) { + *err = error; + } + } +#endif // CL_HPP_MINIMUM_OPENCL_VERSION < 120 + } + +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 + /*! \brief Constructs a 2D Image from a buffer. + * \note This will share storage with the underlying buffer. + * + * Requires OpenCL 2.0 or newer or OpenCL 1.2 and the + * cl_khr_image2d_from_buffer extension. + * + * Wraps clCreateImage(). + */ + Image2D( + const Context& context, + ImageFormat format, + const Buffer &sourceBuffer, + size_type width, + size_type height, + size_type row_pitch = 0, + cl_int* err = nullptr) + { + cl_int error; + + cl_image_desc desc = {}; + desc.image_type = CL_MEM_OBJECT_IMAGE2D; + desc.image_width = width; + desc.image_height = height; + desc.image_row_pitch = row_pitch; + desc.buffer = sourceBuffer(); + + object_ = ::clCreateImage( + context(), + 0, // flags inherited from buffer + &format, + &desc, + nullptr, + &error); + + detail::errHandler(error, __CREATE_IMAGE_ERR); + if (err != nullptr) { + *err = error; + } + } +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 120 + +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 + /*! \brief Constructs a 2D Image from an image. + * \note This will share storage with the underlying image but may + * reinterpret the channel order and type. + * + * The image will be created matching with a descriptor matching the source. + * + * \param order is the channel order to reinterpret the image data as. + * The channel order may differ as described in the OpenCL + * 2.0 API specification. + * + * Wraps clCreateImage(). + */ + Image2D( + const Context& context, + cl_channel_order order, + const Image &sourceImage, + cl_int* err = nullptr) + { + cl_int error; + + // Descriptor fields have to match source image + size_type sourceWidth = + sourceImage.getImageInfo(); + size_type sourceHeight = + sourceImage.getImageInfo(); + size_type sourceRowPitch = + sourceImage.getImageInfo(); + cl_uint sourceNumMIPLevels = + sourceImage.getImageInfo(); + cl_uint sourceNumSamples = + sourceImage.getImageInfo(); + cl_image_format sourceFormat = + sourceImage.getImageInfo(); + + // Update only the channel order. + // Channel format inherited from source. + sourceFormat.image_channel_order = order; + + cl_image_desc desc = {}; + desc.image_type = CL_MEM_OBJECT_IMAGE2D; + desc.image_width = sourceWidth; + desc.image_height = sourceHeight; + desc.image_row_pitch = sourceRowPitch; + desc.num_mip_levels = sourceNumMIPLevels; + desc.num_samples = sourceNumSamples; + desc.buffer = sourceImage(); + + object_ = ::clCreateImage( + context(), + 0, // flags should be inherited from mem_object + &sourceFormat, + &desc, + nullptr, + &error); + + detail::errHandler(error, __CREATE_IMAGE_ERR); + if (err != nullptr) { + *err = error; + } + } +#endif //#if CL_HPP_TARGET_OPENCL_VERSION >= 200 + + //! \brief Default constructor - initializes to nullptr. + Image2D() { } + + /*! \brief Constructor from cl_mem - takes ownership. + * + * \param retainObject will cause the constructor to retain its cl object. + * Defaults to false to maintain compatibility with + * earlier versions. + * See Memory for further details. + */ + explicit Image2D(const cl_mem& image2D, bool retainObject = false) : + Image(image2D, retainObject) { } + + /*! \brief Assignment from cl_mem - performs shallow copy. + * + * See Memory for further details. + */ + Image2D& operator = (const cl_mem& rhs) + { + Image::operator=(rhs); + return *this; + } + + + + +}; + + +#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) +/*! \brief Class interface for GL 2D Image Memory objects. + * + * This is provided to facilitate interoperability with OpenGL. + * + * See Memory for details about copy semantics, etc. + * + * \see Memory + * \note Deprecated for OpenCL 1.2. Please use ImageGL instead. + */ +class CL_API_PREFIX__VERSION_1_1_DEPRECATED Image2DGL : public Image2D +{ +public: + /*! \brief Constructs an Image2DGL in a specified context, from a given + * GL Texture. + * + * Wraps clCreateFromGLTexture2D(). + */ + Image2DGL( + const Context& context, + cl_mem_flags flags, + cl_GLenum target, + cl_GLint miplevel, + cl_GLuint texobj, + cl_int * err = nullptr) + { + cl_int error; + object_ = ::clCreateFromGLTexture2D( + context(), + flags, + target, + miplevel, + texobj, + &error); + + detail::errHandler(error, __CREATE_GL_TEXTURE_2D_ERR); + if (err != nullptr) { + *err = error; + } + + } + + //! \brief Default constructor - initializes to nullptr. + Image2DGL() : Image2D() { } + + /*! \brief Constructor from cl_mem - takes ownership. + * + * \param retainObject will cause the constructor to retain its cl object. + * Defaults to false to maintain compatibility with + * earlier versions. + * See Memory for further details. + */ + explicit Image2DGL(const cl_mem& image, bool retainObject = false) : + Image2D(image, retainObject) { } + + /*! \brief Assignment from cl_mem - performs shallow copy. + *c + * See Memory for further details. + */ + Image2DGL& operator = (const cl_mem& rhs) + { + Image2D::operator=(rhs); + return *this; + } + + + +} CL_API_SUFFIX__VERSION_1_1_DEPRECATED; +#endif // CL_USE_DEPRECATED_OPENCL_1_1_APIS + +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 +/*! \class Image2DArray + * \brief Image interface for arrays of 2D images. + */ +class Image2DArray : public Image +{ +public: + Image2DArray( + const Context& context, + cl_mem_flags flags, + ImageFormat format, + size_type arraySize, + size_type width, + size_type height, + size_type rowPitch, + size_type slicePitch, + void* host_ptr = nullptr, + cl_int* err = nullptr) + { + cl_int error; + + cl_image_desc desc = {}; + desc.image_type = CL_MEM_OBJECT_IMAGE2D_ARRAY; + desc.image_width = width; + desc.image_height = height; + desc.image_array_size = arraySize; + desc.image_row_pitch = rowPitch; + desc.image_slice_pitch = slicePitch; + + object_ = ::clCreateImage( + context(), + flags, + &format, + &desc, + host_ptr, + &error); + + detail::errHandler(error, __CREATE_IMAGE_ERR); + if (err != nullptr) { + *err = error; + } + } + + Image2DArray() { } + + /*! \brief Constructor from cl_mem - takes ownership. + * + * \param retainObject will cause the constructor to retain its cl object. + * Defaults to false to maintain compatibility with + * earlier versions. + * See Memory for further details. + */ + explicit Image2DArray(const cl_mem& imageArray, bool retainObject = false) : Image(imageArray, retainObject) { } + + Image2DArray& operator = (const cl_mem& rhs) + { + Image::operator=(rhs); + return *this; + } + +}; +#endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 120 + +/*! \brief Class interface for 3D Image Memory objects. + * + * See Memory for details about copy semantics, etc. + * + * \see Memory + */ +class Image3D : public Image +{ +public: + /*! \brief Constructs a 3D Image in a specified context. + * + * Wraps clCreateImage(). + */ + Image3D( + const Context& context, + cl_mem_flags flags, + ImageFormat format, + size_type width, + size_type height, + size_type depth, + size_type row_pitch = 0, + size_type slice_pitch = 0, + void* host_ptr = nullptr, + cl_int* err = nullptr) + { + cl_int error; + bool useCreateImage; + +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 && CL_HPP_MINIMUM_OPENCL_VERSION < 120 + // Run-time decision based on the actual platform + { + cl_uint version = detail::getContextPlatformVersion(context()); + useCreateImage = (version >= 0x10002); // OpenCL 1.2 or above + } +#elif CL_HPP_TARGET_OPENCL_VERSION >= 120 + useCreateImage = true; +#else + useCreateImage = false; +#endif + +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 + if (useCreateImage) + { + cl_image_desc desc = {}; + desc.image_type = CL_MEM_OBJECT_IMAGE3D; + desc.image_width = width; + desc.image_height = height; + desc.image_depth = depth; + desc.image_row_pitch = row_pitch; + desc.image_slice_pitch = slice_pitch; + + object_ = ::clCreateImage( + context(), + flags, + &format, + &desc, + host_ptr, + &error); + + detail::errHandler(error, __CREATE_IMAGE_ERR); + if (err != nullptr) { + *err = error; + } + } +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 120 +#if CL_HPP_MINIMUM_OPENCL_VERSION < 120 + if (!useCreateImage) + { + object_ = ::clCreateImage3D( + context(), flags, &format, width, height, depth, row_pitch, + slice_pitch, host_ptr, &error); + + detail::errHandler(error, __CREATE_IMAGE3D_ERR); + if (err != nullptr) { + *err = error; + } + } +#endif // CL_HPP_MINIMUM_OPENCL_VERSION < 120 + } + + //! \brief Default constructor - initializes to nullptr. + Image3D() : Image() { } + + /*! \brief Constructor from cl_mem - takes ownership. + * + * \param retainObject will cause the constructor to retain its cl object. + * Defaults to false to maintain compatibility with + * earlier versions. + * See Memory for further details. + */ + explicit Image3D(const cl_mem& image3D, bool retainObject = false) : + Image(image3D, retainObject) { } + + /*! \brief Assignment from cl_mem - performs shallow copy. + * + * See Memory for further details. + */ + Image3D& operator = (const cl_mem& rhs) + { + Image::operator=(rhs); + return *this; + } + +}; + +#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) +/*! \brief Class interface for GL 3D Image Memory objects. + * + * This is provided to facilitate interoperability with OpenGL. + * + * See Memory for details about copy semantics, etc. + * + * \see Memory + */ +class Image3DGL : public Image3D +{ +public: + /*! \brief Constructs an Image3DGL in a specified context, from a given + * GL Texture. + * + * Wraps clCreateFromGLTexture3D(). + */ + Image3DGL( + const Context& context, + cl_mem_flags flags, + cl_GLenum target, + cl_GLint miplevel, + cl_GLuint texobj, + cl_int * err = nullptr) + { + cl_int error; + object_ = ::clCreateFromGLTexture3D( + context(), + flags, + target, + miplevel, + texobj, + &error); + + detail::errHandler(error, __CREATE_GL_TEXTURE_3D_ERR); + if (err != nullptr) { + *err = error; + } + } + + //! \brief Default constructor - initializes to nullptr. + Image3DGL() : Image3D() { } + + /*! \brief Constructor from cl_mem - takes ownership. + * + * \param retainObject will cause the constructor to retain its cl object. + * Defaults to false to maintain compatibility with + * earlier versions. + * See Memory for further details. + */ + explicit Image3DGL(const cl_mem& image, bool retainObject = false) : + Image3D(image, retainObject) { } + + /*! \brief Assignment from cl_mem - performs shallow copy. + * + * See Memory for further details. + */ + Image3DGL& operator = (const cl_mem& rhs) + { + Image3D::operator=(rhs); + return *this; + } + +}; +#endif // CL_USE_DEPRECATED_OPENCL_1_1_APIS + +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 +/*! \class ImageGL + * \brief general image interface for GL interop. + * We abstract the 2D and 3D GL images into a single instance here + * that wraps all GL sourced images on the grounds that setup information + * was performed by OpenCL anyway. + */ +class ImageGL : public Image +{ +public: + ImageGL( + const Context& context, + cl_mem_flags flags, + cl_GLenum target, + cl_GLint miplevel, + cl_GLuint texobj, + cl_int * err = nullptr) + { + cl_int error; + object_ = ::clCreateFromGLTexture( + context(), + flags, + target, + miplevel, + texobj, + &error); + + detail::errHandler(error, __CREATE_GL_TEXTURE_ERR); + if (err != nullptr) { + *err = error; + } + } + + ImageGL() : Image() { } + + /*! \brief Constructor from cl_mem - takes ownership. + * + * \param retainObject will cause the constructor to retain its cl object. + * Defaults to false to maintain compatibility with + * earlier versions. + * See Memory for further details. + */ + explicit ImageGL(const cl_mem& image, bool retainObject = false) : + Image(image, retainObject) { } + + ImageGL& operator = (const cl_mem& rhs) + { + Image::operator=(rhs); + return *this; + } + +}; +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 120 + + + +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 +/*! \brief Class interface for Pipe Memory Objects. +* +* See Memory for details about copy semantics, etc. +* +* \see Memory +*/ +class Pipe : public Memory +{ +public: + + /*! \brief Constructs a Pipe in a specified context. + * + * Wraps clCreatePipe(). + * @param context Context in which to create the pipe. + * @param flags Bitfield. Only CL_MEM_READ_WRITE and CL_MEM_HOST_NO_ACCESS are valid. + * @param packet_size Size in bytes of a single packet of the pipe. + * @param max_packets Number of packets that may be stored in the pipe. + * + */ + Pipe( + const Context& context, + cl_uint packet_size, + cl_uint max_packets, + cl_int* err = nullptr) + { + cl_int error; + + cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_HOST_NO_ACCESS; + object_ = ::clCreatePipe(context(), flags, packet_size, max_packets, nullptr, &error); + + detail::errHandler(error, __CREATE_PIPE_ERR); + if (err != nullptr) { + *err = error; + } + } + + /*! \brief Constructs a Pipe in a the default context. + * + * Wraps clCreatePipe(). + * @param flags Bitfield. Only CL_MEM_READ_WRITE and CL_MEM_HOST_NO_ACCESS are valid. + * @param packet_size Size in bytes of a single packet of the pipe. + * @param max_packets Number of packets that may be stored in the pipe. + * + */ + Pipe( + cl_uint packet_size, + cl_uint max_packets, + cl_int* err = nullptr) + { + cl_int error; + + Context context = Context::getDefault(err); + + cl_mem_flags flags = CL_MEM_READ_WRITE | CL_MEM_HOST_NO_ACCESS; + object_ = ::clCreatePipe(context(), flags, packet_size, max_packets, nullptr, &error); + + detail::errHandler(error, __CREATE_PIPE_ERR); + if (err != nullptr) { + *err = error; + } + } + + //! \brief Default constructor - initializes to nullptr. + Pipe() : Memory() { } + + /*! \brief Constructor from cl_mem - takes ownership. + * + * \param retainObject will cause the constructor to retain its cl object. + * Defaults to false to maintain compatibility with earlier versions. + * + * See Memory for further details. + */ + explicit Pipe(const cl_mem& pipe, bool retainObject = false) : + Memory(pipe, retainObject) { } + + /*! \brief Assignment from cl_mem - performs shallow copy. + * + * See Memory for further details. + */ + Pipe& operator = (const cl_mem& rhs) + { + Memory::operator=(rhs); + return *this; + } + + + + //! \brief Wrapper for clGetMemObjectInfo(). + template + cl_int getInfo(cl_pipe_info name, T* param) const + { + return detail::errHandler( + detail::getInfo(&::clGetPipeInfo, object_, name, param), + __GET_PIPE_INFO_ERR); + } + + //! \brief Wrapper for clGetMemObjectInfo() that returns by value. + template typename + detail::param_traits::param_type + getInfo(cl_int* err = nullptr) const + { + typename detail::param_traits< + detail::cl_pipe_info, name>::param_type param; + cl_int result = getInfo(name, ¶m); + if (err != nullptr) { + *err = result; + } + return param; + } +}; // class Pipe +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 200 + + +/*! \brief Class interface for cl_sampler. + * + * \note Copies of these objects are shallow, meaning that the copy will refer + * to the same underlying cl_sampler as the original. For details, see + * clRetainSampler() and clReleaseSampler(). + * + * \see cl_sampler + */ +class Sampler : public detail::Wrapper +{ +public: + //! \brief Default constructor - initializes to nullptr. + Sampler() { } + + /*! \brief Constructs a Sampler in a specified context. + * + * Wraps clCreateSampler(). + */ + Sampler( + const Context& context, + cl_bool normalized_coords, + cl_addressing_mode addressing_mode, + cl_filter_mode filter_mode, + cl_int* err = nullptr) + { + cl_int error; + +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 + cl_sampler_properties sampler_properties[] = { + CL_SAMPLER_NORMALIZED_COORDS, normalized_coords, + CL_SAMPLER_ADDRESSING_MODE, addressing_mode, + CL_SAMPLER_FILTER_MODE, filter_mode, + 0 }; + object_ = ::clCreateSamplerWithProperties( + context(), + sampler_properties, + &error); + + detail::errHandler(error, __CREATE_SAMPLER_WITH_PROPERTIES_ERR); + if (err != nullptr) { + *err = error; + } +#else + object_ = ::clCreateSampler( + context(), + normalized_coords, + addressing_mode, + filter_mode, + &error); + + detail::errHandler(error, __CREATE_SAMPLER_ERR); + if (err != nullptr) { + *err = error; + } +#endif + } + + /*! \brief Constructor from cl_sampler - takes ownership. + * + * \param retainObject will cause the constructor to retain its cl object. + * Defaults to false to maintain compatibility with + * earlier versions. + * This effectively transfers ownership of a refcount on the cl_sampler + * into the new Sampler object. + */ + explicit Sampler(const cl_sampler& sampler, bool retainObject = false) : + detail::Wrapper(sampler, retainObject) { } + + /*! \brief Assignment operator from cl_sampler - takes ownership. + * + * This effectively transfers ownership of a refcount on the rhs and calls + * clReleaseSampler() on the value previously held by this instance. + */ + Sampler& operator = (const cl_sampler& rhs) + { + detail::Wrapper::operator=(rhs); + return *this; + } + + + + //! \brief Wrapper for clGetSamplerInfo(). + template + cl_int getInfo(cl_sampler_info name, T* param) const + { + return detail::errHandler( + detail::getInfo(&::clGetSamplerInfo, object_, name, param), + __GET_SAMPLER_INFO_ERR); + } + + //! \brief Wrapper for clGetSamplerInfo() that returns by value. + template typename + detail::param_traits::param_type + getInfo(cl_int* err = nullptr) const + { + typename detail::param_traits< + detail::cl_sampler_info, name>::param_type param; + cl_int result = getInfo(name, ¶m); + if (err != nullptr) { + *err = result; + } + return param; + } +}; + +class Program; +class CommandQueue; +class DeviceCommandQueue; +class Kernel; + +//! \brief Class interface for specifying NDRange values. +class NDRange +{ +private: + size_type sizes_[3]; + cl_uint dimensions_; + +public: + //! \brief Default constructor - resulting range has zero dimensions. + NDRange() + : dimensions_(0) + { + sizes_[0] = 0; + sizes_[1] = 0; + sizes_[2] = 0; + } + + //! \brief Constructs one-dimensional range. + NDRange(size_type size0) + : dimensions_(1) + { + sizes_[0] = size0; + sizes_[1] = 1; + sizes_[2] = 1; + } + + //! \brief Constructs two-dimensional range. + NDRange(size_type size0, size_type size1) + : dimensions_(2) + { + sizes_[0] = size0; + sizes_[1] = size1; + sizes_[2] = 1; + } + + //! \brief Constructs three-dimensional range. + NDRange(size_type size0, size_type size1, size_type size2) + : dimensions_(3) + { + sizes_[0] = size0; + sizes_[1] = size1; + sizes_[2] = size2; + } + + //! \brief Constructs one-dimensional range. + NDRange(array a) : NDRange(a[0]){} + + //! \brief Constructs two-dimensional range. + NDRange(array a) : NDRange(a[0], a[1]){} + + //! \brief Constructs three-dimensional range. + NDRange(array a) : NDRange(a[0], a[1], a[2]){} + + /*! \brief Conversion operator to const size_type *. + * + * \returns a pointer to the size of the first dimension. + */ + operator const size_type*() const { + return sizes_; + } + + //! \brief Queries the number of dimensions in the range. + size_type dimensions() const + { + return dimensions_; + } + + //! \brief Returns the size of the object in bytes based on the + // runtime number of dimensions + size_type size() const + { + return dimensions_*sizeof(size_type); + } + + size_type* get() + { + return sizes_; + } + + const size_type* get() const + { + return sizes_; + } +}; + +//! \brief A zero-dimensional range. +static const NDRange NullRange; + +//! \brief Local address wrapper for use with Kernel::setArg +struct LocalSpaceArg +{ + size_type size_; +}; + +namespace detail { + +template +struct KernelArgumentHandler; + +// Enable for objects that are not subclasses of memory +// Pointers, constants etc +template +struct KernelArgumentHandler::value>::type> +{ + static size_type size(const T&) { return sizeof(T); } + static const T* ptr(const T& value) { return &value; } +}; + +// Enable for subclasses of memory where we want to get a reference to the cl_mem out +// and pass that in for safety +template +struct KernelArgumentHandler::value>::type> +{ + static size_type size(const T&) { return sizeof(cl_mem); } + static const cl_mem* ptr(const T& value) { return &(value()); } +}; + +// Specialization for DeviceCommandQueue defined later + +template <> +struct KernelArgumentHandler +{ + static size_type size(const LocalSpaceArg& value) { return value.size_; } + static const void* ptr(const LocalSpaceArg&) { return nullptr; } +}; + +} +//! \endcond + +/*! Local + * \brief Helper function for generating LocalSpaceArg objects. + */ +inline LocalSpaceArg +Local(size_type size) +{ + LocalSpaceArg ret = { size }; + return ret; +} + +/*! \brief Class interface for cl_kernel. + * + * \note Copies of these objects are shallow, meaning that the copy will refer + * to the same underlying cl_kernel as the original. For details, see + * clRetainKernel() and clReleaseKernel(). + * + * \see cl_kernel + */ +class Kernel : public detail::Wrapper +{ +public: + inline Kernel(const Program& program, const char* name, cl_int* err = nullptr); + + //! \brief Default constructor - initializes to nullptr. + Kernel() { } + + /*! \brief Constructor from cl_kernel - takes ownership. + * + * \param retainObject will cause the constructor to retain its cl object. + * Defaults to false to maintain compatibility with + * earlier versions. + * This effectively transfers ownership of a refcount on the cl_kernel + * into the new Kernel object. + */ + explicit Kernel(const cl_kernel& kernel, bool retainObject = false) : + detail::Wrapper(kernel, retainObject) { } + + /*! \brief Assignment operator from cl_kernel - takes ownership. + * + * This effectively transfers ownership of a refcount on the rhs and calls + * clReleaseKernel() on the value previously held by this instance. + */ + Kernel& operator = (const cl_kernel& rhs) + { + detail::Wrapper::operator=(rhs); + return *this; + } + + + + + template + cl_int getInfo(cl_kernel_info name, T* param) const + { + return detail::errHandler( + detail::getInfo(&::clGetKernelInfo, object_, name, param), + __GET_KERNEL_INFO_ERR); + } + + template typename + detail::param_traits::param_type + getInfo(cl_int* err = nullptr) const + { + typename detail::param_traits< + detail::cl_kernel_info, name>::param_type param; + cl_int result = getInfo(name, ¶m); + if (err != nullptr) { + *err = result; + } + return param; + } + +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 + template + cl_int getArgInfo(cl_uint argIndex, cl_kernel_arg_info name, T* param) const + { + return detail::errHandler( + detail::getInfo(&::clGetKernelArgInfo, object_, argIndex, name, param), + __GET_KERNEL_ARG_INFO_ERR); + } + + template typename + detail::param_traits::param_type + getArgInfo(cl_uint argIndex, cl_int* err = nullptr) const + { + typename detail::param_traits< + detail::cl_kernel_arg_info, name>::param_type param; + cl_int result = getArgInfo(argIndex, name, ¶m); + if (err != nullptr) { + *err = result; + } + return param; + } +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 120 + + template + cl_int getWorkGroupInfo( + const Device& device, cl_kernel_work_group_info name, T* param) const + { + return detail::errHandler( + detail::getInfo( + &::clGetKernelWorkGroupInfo, object_, device(), name, param), + __GET_KERNEL_WORK_GROUP_INFO_ERR); + } + + template typename + detail::param_traits::param_type + getWorkGroupInfo(const Device& device, cl_int* err = nullptr) const + { + typename detail::param_traits< + detail::cl_kernel_work_group_info, name>::param_type param; + cl_int result = getWorkGroupInfo(device, name, ¶m); + if (err != nullptr) { + *err = result; + } + return param; + } + +#if defined(CL_HPP_USE_CL_SUB_GROUPS_KHR) || CL_HPP_TARGET_OPENCL_VERSION >= 210 + cl_int getSubGroupInfo(const cl::Device &dev, cl_kernel_sub_group_info name, const cl::NDRange &range, size_type* param) const + { +#if CL_HPP_TARGET_OPENCL_VERSION >= 210 + + return detail::errHandler( + clGetKernelSubGroupInfo(object_, dev(), name, range.size(), range.get(), sizeof(size_type), param, nullptr), + __GET_KERNEL_SUB_GROUP_INFO_ERR); + +#else // #if CL_HPP_TARGET_OPENCL_VERSION >= 210 + + typedef clGetKernelSubGroupInfoKHR_fn PFN_clGetKernelSubGroupInfoKHR; + static PFN_clGetKernelSubGroupInfoKHR pfn_clGetKernelSubGroupInfoKHR = nullptr; + CL_HPP_INIT_CL_EXT_FCN_PTR_(clGetKernelSubGroupInfoKHR); + + return detail::errHandler( + pfn_clGetKernelSubGroupInfoKHR(object_, dev(), name, range.size(), range.get(), sizeof(size_type), param, nullptr), + __GET_KERNEL_SUB_GROUP_INFO_ERR); + +#endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 210 + } + + template + size_type getSubGroupInfo(const cl::Device &dev, const cl::NDRange &range, cl_int* err = nullptr) const + { + size_type param; + cl_int result = getSubGroupInfo(dev, name, range, ¶m); + if (err != nullptr) { + *err = result; + } + return param; + } +#endif // defined(CL_HPP_USE_CL_SUB_GROUPS_KHR) || CL_HPP_TARGET_OPENCL_VERSION >= 210 + +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 + /*! \brief setArg overload taking a shared_ptr type + */ + template + cl_int setArg(cl_uint index, const cl::pointer &argPtr) + { + return detail::errHandler( + ::clSetKernelArgSVMPointer(object_, index, argPtr.get()), + __SET_KERNEL_ARGS_ERR); + } + + /*! \brief setArg overload taking a vector type. + */ + template + cl_int setArg(cl_uint index, const cl::vector &argPtr) + { + return detail::errHandler( + ::clSetKernelArgSVMPointer(object_, index, argPtr.data()), + __SET_KERNEL_ARGS_ERR); + } + + /*! \brief setArg overload taking a pointer type + */ + template + typename std::enable_if::value, cl_int>::type + setArg(cl_uint index, const T argPtr) + { + return detail::errHandler( + ::clSetKernelArgSVMPointer(object_, index, argPtr), + __SET_KERNEL_ARGS_ERR); + } +#endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 200 + + /*! \brief setArg overload taking a POD type + */ + template + typename std::enable_if::value, cl_int>::type + setArg(cl_uint index, const T &value) + { + return detail::errHandler( + ::clSetKernelArg( + object_, + index, + detail::KernelArgumentHandler::size(value), + detail::KernelArgumentHandler::ptr(value)), + __SET_KERNEL_ARGS_ERR); + } + + cl_int setArg(cl_uint index, size_type size, const void* argPtr) + { + return detail::errHandler( + ::clSetKernelArg(object_, index, size, argPtr), + __SET_KERNEL_ARGS_ERR); + } + +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 + /*! + * Specify a vector of SVM pointers that the kernel may access in + * addition to its arguments. + */ + cl_int setSVMPointers(const vector &pointerList) + { + return detail::errHandler( + ::clSetKernelExecInfo( + object_, + CL_KERNEL_EXEC_INFO_SVM_PTRS, + sizeof(void*)*pointerList.size(), + pointerList.data())); + } + + /*! + * Specify a std::array of SVM pointers that the kernel may access in + * addition to its arguments. + */ + template + cl_int setSVMPointers(const std::array &pointerList) + { + return detail::errHandler( + ::clSetKernelExecInfo( + object_, + CL_KERNEL_EXEC_INFO_SVM_PTRS, + sizeof(void*)*pointerList.size(), + pointerList.data())); + } + + /*! \brief Enable fine-grained system SVM. + * + * \note It is only possible to enable fine-grained system SVM if all devices + * in the context associated with kernel support it. + * + * \param svmEnabled True if fine-grained system SVM is requested. False otherwise. + * \return CL_SUCCESS if the function was executed succesfully. CL_INVALID_OPERATION + * if no devices in the context support fine-grained system SVM. + * + * \see clSetKernelExecInfo + */ + cl_int enableFineGrainedSystemSVM(bool svmEnabled) + { + cl_bool svmEnabled_ = svmEnabled ? CL_TRUE : CL_FALSE; + return detail::errHandler( + ::clSetKernelExecInfo( + object_, + CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM, + sizeof(cl_bool), + &svmEnabled_ + ) + ); + } + + template + void setSVMPointersHelper(std::array &pointerList, const pointer &t0, const pointer &t1, Ts & ... ts) + { + pointerList[index] = static_cast(t0.get()); + setSVMPointersHelper(pointerList, t1, ts...); + } + + template + typename std::enable_if::value, void>::type + setSVMPointersHelper(std::array &pointerList, T0 t0, T1 t1, Ts... ts) + { + pointerList[index] = static_cast(t0); + setSVMPointersHelper(pointerList, t1, ts...); + } + + template + void setSVMPointersHelper(std::array &pointerList, const pointer &t0) + { + pointerList[index] = static_cast(t0.get()); + } + + + template + typename std::enable_if::value, void>::type + setSVMPointersHelper(std::array &pointerList, T0 t0) + { + pointerList[index] = static_cast(t0); + } + + template + cl_int setSVMPointers(const T0 &t0, Ts & ... ts) + { + std::array pointerList; + + setSVMPointersHelper<0, 1 + sizeof...(Ts)>(pointerList, t0, ts...); + return detail::errHandler( + ::clSetKernelExecInfo( + object_, + CL_KERNEL_EXEC_INFO_SVM_PTRS, + sizeof(void*)*(1 + sizeof...(Ts)), + pointerList.data())); + } + + template + cl_int setExecInfo(cl_kernel_exec_info param_name, const T& val) + { + return detail::errHandler( + ::clSetKernelExecInfo( + object_, + param_name, + sizeof(T), + &val)); + } + + template + cl_int setExecInfo(typename detail::param_traits::param_type& val) + { + return setExecInfo(name, val); + } +#endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 200 + +#if CL_HPP_TARGET_OPENCL_VERSION >= 210 + /** + * Make a deep copy of the kernel object including its arguments. + * @return A new kernel object with internal state entirely separate from that + * of the original but with any arguments set on the original intact. + */ + Kernel clone() + { + cl_int error; + Kernel retValue(clCloneKernel(this->get(), &error)); + + detail::errHandler(error, __CLONE_KERNEL_ERR); + return retValue; + } +#endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 210 +}; + +/*! \class Program + * \brief Program interface that implements cl_program. + */ +class Program : public detail::Wrapper +{ +public: +#if !defined(CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY) + typedef vector> Binaries; + typedef vector Sources; +#else // #if !defined(CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY) + typedef vector > Binaries; + typedef vector > Sources; +#endif // #if !defined(CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY) + + Program( + const string& source, + bool build = false, + cl_int* err = nullptr) + { + cl_int error; + + const char * strings = source.c_str(); + const size_type length = source.size(); + + Context context = Context::getDefault(err); + + object_ = ::clCreateProgramWithSource( + context(), (cl_uint)1, &strings, &length, &error); + + detail::errHandler(error, __CREATE_PROGRAM_WITH_SOURCE_ERR); + + if (error == CL_SUCCESS && build) { + + error = ::clBuildProgram( + object_, + 0, + nullptr, +#if !defined(CL_HPP_CL_1_2_DEFAULT_BUILD) + "-cl-std=CL2.0", +#else + "", +#endif // #if !defined(CL_HPP_CL_1_2_DEFAULT_BUILD) + nullptr, + nullptr); + + detail::buildErrHandler(error, __BUILD_PROGRAM_ERR, getBuildInfo()); + } + + if (err != nullptr) { + *err = error; + } + } + + Program( + const Context& context, + const string& source, + bool build = false, + cl_int* err = nullptr) + { + cl_int error; + + const char * strings = source.c_str(); + const size_type length = source.size(); + + object_ = ::clCreateProgramWithSource( + context(), (cl_uint)1, &strings, &length, &error); + + detail::errHandler(error, __CREATE_PROGRAM_WITH_SOURCE_ERR); + + if (error == CL_SUCCESS && build) { + error = ::clBuildProgram( + object_, + 0, + nullptr, +#if !defined(CL_HPP_CL_1_2_DEFAULT_BUILD) + "-cl-std=CL2.0", +#else + "", +#endif // #if !defined(CL_HPP_CL_1_2_DEFAULT_BUILD) + nullptr, + nullptr); + + detail::buildErrHandler(error, __BUILD_PROGRAM_ERR, getBuildInfo()); + } + + if (err != nullptr) { + *err = error; + } + } + + /** + * Create a program from a vector of source strings and the default context. + * Does not compile or link the program. + */ + Program( + const Sources& sources, + cl_int* err = nullptr) + { + cl_int error; + Context context = Context::getDefault(err); + + const size_type n = (size_type)sources.size(); + + vector lengths(n); + vector strings(n); + + for (size_type i = 0; i < n; ++i) { +#if !defined(CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY) + strings[i] = sources[(int)i].data(); + lengths[i] = sources[(int)i].length(); +#else // #if !defined(CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY) + strings[i] = sources[(int)i].first; + lengths[i] = sources[(int)i].second; +#endif // #if !defined(CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY) + } + + object_ = ::clCreateProgramWithSource( + context(), (cl_uint)n, strings.data(), lengths.data(), &error); + + detail::errHandler(error, __CREATE_PROGRAM_WITH_SOURCE_ERR); + if (err != nullptr) { + *err = error; + } + } + + /** + * Create a program from a vector of source strings and a provided context. + * Does not compile or link the program. + */ + Program( + const Context& context, + const Sources& sources, + cl_int* err = nullptr) + { + cl_int error; + + const size_type n = (size_type)sources.size(); + + vector lengths(n); + vector strings(n); + + for (size_type i = 0; i < n; ++i) { +#if !defined(CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY) + strings[i] = sources[(int)i].data(); + lengths[i] = sources[(int)i].length(); +#else // #if !defined(CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY) + strings[i] = sources[(int)i].first; + lengths[i] = sources[(int)i].second; +#endif // #if !defined(CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY) + } + + object_ = ::clCreateProgramWithSource( + context(), (cl_uint)n, strings.data(), lengths.data(), &error); + + detail::errHandler(error, __CREATE_PROGRAM_WITH_SOURCE_ERR); + if (err != nullptr) { + *err = error; + } + } + + +#if defined(CL_HPP_USE_IL_KHR) || CL_HPP_TARGET_OPENCL_VERSION >= 210 + /** + * Program constructor to allow construction of program from SPIR-V or another IL. + * + * Requires OpenCL 2.1 or newer or the cl_khr_il_program extension. + */ + Program( + const vector& IL, + bool build = false, + cl_int* err = nullptr) + { + cl_int error; + + Context context = Context::getDefault(err); + +#if CL_HPP_TARGET_OPENCL_VERSION >= 210 + + object_ = ::clCreateProgramWithIL( + context(), static_cast(IL.data()), IL.size(), &error); + +#else // #if CL_HPP_TARGET_OPENCL_VERSION >= 210 + + typedef clCreateProgramWithILKHR_fn PFN_clCreateProgramWithILKHR; + static PFN_clCreateProgramWithILKHR pfn_clCreateProgramWithILKHR = nullptr; + CL_HPP_INIT_CL_EXT_FCN_PTR_(clCreateProgramWithILKHR); + + object_ = pfn_clCreateProgramWithILKHR( + context(), static_cast(IL.data()), IL.size(), &error); + +#endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 210 + + detail::errHandler(error, __CREATE_PROGRAM_WITH_IL_ERR); + + if (error == CL_SUCCESS && build) { + + error = ::clBuildProgram( + object_, + 0, + nullptr, +#if !defined(CL_HPP_CL_1_2_DEFAULT_BUILD) + "-cl-std=CL2.0", +#else + "", +#endif // #if !defined(CL_HPP_CL_1_2_DEFAULT_BUILD) + nullptr, + nullptr); + + detail::buildErrHandler(error, __BUILD_PROGRAM_ERR, getBuildInfo()); + } + + if (err != nullptr) { + *err = error; + } + } + + /** + * Program constructor to allow construction of program from SPIR-V or another IL + * for a specific context. + * + * Requires OpenCL 2.1 or newer or the cl_khr_il_program extension. + */ + Program( + const Context& context, + const vector& IL, + bool build = false, + cl_int* err = nullptr) + { + cl_int error; + +#if CL_HPP_TARGET_OPENCL_VERSION >= 210 + + object_ = ::clCreateProgramWithIL( + context(), static_cast(IL.data()), IL.size(), &error); + +#else // #if CL_HPP_TARGET_OPENCL_VERSION >= 210 + + typedef clCreateProgramWithILKHR_fn PFN_clCreateProgramWithILKHR; + static PFN_clCreateProgramWithILKHR pfn_clCreateProgramWithILKHR = nullptr; + CL_HPP_INIT_CL_EXT_FCN_PTR_(clCreateProgramWithILKHR); + + object_ = pfn_clCreateProgramWithILKHR( + context(), static_cast(IL.data()), IL.size(), &error); + +#endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 210 + + detail::errHandler(error, __CREATE_PROGRAM_WITH_IL_ERR); + + if (error == CL_SUCCESS && build) { + error = ::clBuildProgram( + object_, + 0, + nullptr, +#if !defined(CL_HPP_CL_1_2_DEFAULT_BUILD) + "-cl-std=CL2.0", +#else + "", +#endif // #if !defined(CL_HPP_CL_1_2_DEFAULT_BUILD) + nullptr, + nullptr); + + detail::buildErrHandler(error, __BUILD_PROGRAM_ERR, getBuildInfo()); + } + + if (err != nullptr) { + *err = error; + } + } +#endif // defined(CL_HPP_USE_IL_KHR) || CL_HPP_TARGET_OPENCL_VERSION >= 210 + + /** + * Construct a program object from a list of devices and a per-device list of binaries. + * \param context A valid OpenCL context in which to construct the program. + * \param devices A vector of OpenCL device objects for which the program will be created. + * \param binaries A vector of pairs of a pointer to a binary object and its length. + * \param binaryStatus An optional vector that on completion will be resized to + * match the size of binaries and filled with values to specify if each binary + * was successfully loaded. + * Set to CL_SUCCESS if the binary was successfully loaded. + * Set to CL_INVALID_VALUE if the length is 0 or the binary pointer is nullptr. + * Set to CL_INVALID_BINARY if the binary provided is not valid for the matching device. + * \param err if non-nullptr will be set to CL_SUCCESS on successful operation or one of the following errors: + * CL_INVALID_CONTEXT if context is not a valid context. + * CL_INVALID_VALUE if the length of devices is zero; or if the length of binaries does not match the length of devices; + * or if any entry in binaries is nullptr or has length 0. + * CL_INVALID_DEVICE if OpenCL devices listed in devices are not in the list of devices associated with context. + * CL_INVALID_BINARY if an invalid program binary was encountered for any device. binaryStatus will return specific status for each device. + * CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host. + */ + Program( + const Context& context, + const vector& devices, + const Binaries& binaries, + vector* binaryStatus = nullptr, + cl_int* err = nullptr) + { + cl_int error; + + const size_type numDevices = devices.size(); + + // Catch size mismatch early and return + if(binaries.size() != numDevices) { + error = CL_INVALID_VALUE; + detail::errHandler(error, __CREATE_PROGRAM_WITH_BINARY_ERR); + if (err != nullptr) { + *err = error; + } + return; + } + + + vector lengths(numDevices); + vector images(numDevices); +#if !defined(CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY) + for (size_type i = 0; i < numDevices; ++i) { + images[i] = binaries[i].data(); + lengths[i] = binaries[(int)i].size(); + } +#else // #if !defined(CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY) + for (size_type i = 0; i < numDevices; ++i) { + images[i] = (const unsigned char*)binaries[i].first; + lengths[i] = binaries[(int)i].second; + } +#endif // #if !defined(CL_HPP_ENABLE_PROGRAM_CONSTRUCTION_FROM_ARRAY_COMPATIBILITY) + + vector deviceIDs(numDevices); + for( size_type deviceIndex = 0; deviceIndex < numDevices; ++deviceIndex ) { + deviceIDs[deviceIndex] = (devices[deviceIndex])(); + } + + if(binaryStatus) { + binaryStatus->resize(numDevices); + } + + object_ = ::clCreateProgramWithBinary( + context(), (cl_uint) devices.size(), + deviceIDs.data(), + lengths.data(), images.data(), (binaryStatus != nullptr && numDevices > 0) + ? &binaryStatus->front() + : nullptr, &error); + + detail::errHandler(error, __CREATE_PROGRAM_WITH_BINARY_ERR); + if (err != nullptr) { + *err = error; + } + } + + +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 + /** + * Create program using builtin kernels. + * \param kernelNames Semi-colon separated list of builtin kernel names + */ + Program( + const Context& context, + const vector& devices, + const string& kernelNames, + cl_int* err = nullptr) + { + cl_int error; + + + size_type numDevices = devices.size(); + vector deviceIDs(numDevices); + for( size_type deviceIndex = 0; deviceIndex < numDevices; ++deviceIndex ) { + deviceIDs[deviceIndex] = (devices[deviceIndex])(); + } + + object_ = ::clCreateProgramWithBuiltInKernels( + context(), + (cl_uint) devices.size(), + deviceIDs.data(), + kernelNames.c_str(), + &error); + + detail::errHandler(error, __CREATE_PROGRAM_WITH_BUILT_IN_KERNELS_ERR); + if (err != nullptr) { + *err = error; + } + } +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 120 + + Program() { } + + + /*! \brief Constructor from cl_program - takes ownership. + * + * \param retainObject will cause the constructor to retain its cl object. + * Defaults to false to maintain compatibility with + * earlier versions. + */ + explicit Program(const cl_program& program, bool retainObject = false) : + detail::Wrapper(program, retainObject) { } + + Program& operator = (const cl_program& rhs) + { + detail::Wrapper::operator=(rhs); + return *this; + } + + + cl_int build( + const vector& devices, + const char* options = nullptr, + void (CL_CALLBACK * notifyFptr)(cl_program, void *) = nullptr, + void* data = nullptr) const + { + size_type numDevices = devices.size(); + vector deviceIDs(numDevices); + + for( size_type deviceIndex = 0; deviceIndex < numDevices; ++deviceIndex ) { + deviceIDs[deviceIndex] = (devices[deviceIndex])(); + } + + cl_int buildError = ::clBuildProgram( + object_, + (cl_uint) + devices.size(), + deviceIDs.data(), + options, + notifyFptr, + data); + + return detail::buildErrHandler(buildError, __BUILD_PROGRAM_ERR, getBuildInfo()); + } + + cl_int build( + const Device& device, + const char* options = nullptr, + void (CL_CALLBACK * notifyFptr)(cl_program, void *) = nullptr, + void* data = nullptr) const + { + cl_device_id deviceID = device(); + + cl_int buildError = ::clBuildProgram( + object_, + 1, + &deviceID, + options, + notifyFptr, + data); + + BuildLogType buildLog(0); + buildLog.push_back(std::make_pair(device, getBuildInfo(device))); + return detail::buildErrHandler(buildError, __BUILD_PROGRAM_ERR, buildLog); + } + + cl_int build( + const char* options = nullptr, + void (CL_CALLBACK * notifyFptr)(cl_program, void *) = nullptr, + void* data = nullptr) const + { + cl_int buildError = ::clBuildProgram( + object_, + 0, + nullptr, + options, + notifyFptr, + data); + + return detail::buildErrHandler(buildError, __BUILD_PROGRAM_ERR, getBuildInfo()); + } + +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 + cl_int compile( + const char* options = nullptr, + void (CL_CALLBACK * notifyFptr)(cl_program, void *) = nullptr, + void* data = nullptr) const + { + cl_int error = ::clCompileProgram( + object_, + 0, + nullptr, + options, + 0, + nullptr, + nullptr, + notifyFptr, + data); + return detail::buildErrHandler(error, __COMPILE_PROGRAM_ERR, getBuildInfo()); + } +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 120 + + template + cl_int getInfo(cl_program_info name, T* param) const + { + return detail::errHandler( + detail::getInfo(&::clGetProgramInfo, object_, name, param), + __GET_PROGRAM_INFO_ERR); + } + + template typename + detail::param_traits::param_type + getInfo(cl_int* err = nullptr) const + { + typename detail::param_traits< + detail::cl_program_info, name>::param_type param; + cl_int result = getInfo(name, ¶m); + if (err != nullptr) { + *err = result; + } + return param; + } + + template + cl_int getBuildInfo( + const Device& device, cl_program_build_info name, T* param) const + { + return detail::errHandler( + detail::getInfo( + &::clGetProgramBuildInfo, object_, device(), name, param), + __GET_PROGRAM_BUILD_INFO_ERR); + } + + template typename + detail::param_traits::param_type + getBuildInfo(const Device& device, cl_int* err = nullptr) const + { + typename detail::param_traits< + detail::cl_program_build_info, name>::param_type param; + cl_int result = getBuildInfo(device, name, ¶m); + if (err != nullptr) { + *err = result; + } + return param; + } + + /** + * Build info function that returns a vector of device/info pairs for the specified + * info type and for all devices in the program. + * On an error reading the info for any device, an empty vector of info will be returned. + */ + template + vector::param_type>> + getBuildInfo(cl_int *err = nullptr) const + { + cl_int result = CL_SUCCESS; + + auto devs = getInfo(&result); + vector::param_type>> + devInfo; + + // If there was an initial error from getInfo return the error + if (result != CL_SUCCESS) { + if (err != nullptr) { + *err = result; + } + return devInfo; + } + + for (const cl::Device &d : devs) { + typename detail::param_traits< + detail::cl_program_build_info, name>::param_type param; + result = getBuildInfo(d, name, ¶m); + devInfo.push_back( + std::pair::param_type> + (d, param)); + if (result != CL_SUCCESS) { + // On error, leave the loop and return the error code + break; + } + } + if (err != nullptr) { + *err = result; + } + if (result != CL_SUCCESS) { + devInfo.clear(); + } + return devInfo; + } + + cl_int createKernels(vector* kernels) + { + cl_uint numKernels; + cl_int err = ::clCreateKernelsInProgram(object_, 0, nullptr, &numKernels); + if (err != CL_SUCCESS) { + return detail::errHandler(err, __CREATE_KERNELS_IN_PROGRAM_ERR); + } + + vector value(numKernels); + + err = ::clCreateKernelsInProgram( + object_, numKernels, value.data(), nullptr); + if (err != CL_SUCCESS) { + return detail::errHandler(err, __CREATE_KERNELS_IN_PROGRAM_ERR); + } + + if (kernels) { + kernels->resize(value.size()); + + // Assign to param, constructing with retain behaviour + // to correctly capture each underlying CL object + for (size_type i = 0; i < value.size(); i++) { + // We do not need to retain because this kernel is being created + // by the runtime + (*kernels)[i] = Kernel(value[i], false); + } + } + return CL_SUCCESS; + } + +#if CL_HPP_TARGET_OPENCL_VERSION >= 220 +#if defined(CL_USE_DEPRECATED_OPENCL_2_2_APIS) + /*! \brief Registers a callback function to be called when destructors for + * program scope global variables are complete and before the + * program is released. + * + * Wraps clSetProgramReleaseCallback(). + * + * Each call to this function registers the specified user callback function + * on a callback stack associated with program. The registered user callback + * functions are called in the reverse order in which they were registered. + */ + CL_API_PREFIX__VERSION_2_2_DEPRECATED cl_int setReleaseCallback( + void (CL_CALLBACK * pfn_notify)(cl_program program, void * user_data), + void * user_data = nullptr) CL_API_SUFFIX__VERSION_2_2_DEPRECATED + { + return detail::errHandler( + ::clSetProgramReleaseCallback( + object_, + pfn_notify, + user_data), + __SET_PROGRAM_RELEASE_CALLBACK_ERR); + } +#endif // #if defined(CL_USE_DEPRECATED_OPENCL_2_2_APIS) + + /*! \brief Sets a SPIR-V specialization constant. + * + * Wraps clSetProgramSpecializationConstant(). + */ + template + typename std::enable_if::value, cl_int>::type + setSpecializationConstant(cl_uint index, const T &value) + { + return detail::errHandler( + ::clSetProgramSpecializationConstant( + object_, + index, + sizeof(value), + &value), + __SET_PROGRAM_SPECIALIZATION_CONSTANT_ERR); + } + + /*! \brief Sets a SPIR-V specialization constant. + * + * Wraps clSetProgramSpecializationConstant(). + */ + cl_int setSpecializationConstant(cl_uint index, size_type size, const void* value) + { + return detail::errHandler( + ::clSetProgramSpecializationConstant( + object_, + index, + size, + value), + __SET_PROGRAM_SPECIALIZATION_CONSTANT_ERR); + } +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 220 +}; + +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 +inline Program linkProgram( + const Program& input1, + const Program& input2, + const char* options = nullptr, + void (CL_CALLBACK * notifyFptr)(cl_program, void *) = nullptr, + void* data = nullptr, + cl_int* err = nullptr) +{ + cl_int error_local = CL_SUCCESS; + cl_program programs[2] = { input1(), input2() }; + + Context ctx = input1.getInfo(&error_local); + if(error_local!=CL_SUCCESS) { + detail::errHandler(error_local, __LINK_PROGRAM_ERR); + } + + cl_program prog = ::clLinkProgram( + ctx(), + 0, + nullptr, + options, + 2, + programs, + notifyFptr, + data, + &error_local); + + detail::errHandler(error_local,__COMPILE_PROGRAM_ERR); + if (err != nullptr) { + *err = error_local; + } + + return Program(prog); +} + +inline Program linkProgram( + const vector& inputPrograms, + const char* options = nullptr, + void (CL_CALLBACK * notifyFptr)(cl_program, void *) = nullptr, + void* data = nullptr, + cl_int* err = nullptr) +{ + cl_int error_local = CL_SUCCESS; + Context ctx; + + static_assert(sizeof(cl::Program) == sizeof(cl_program), + "Size of cl::Program must be equal to size of cl_program"); + + if(inputPrograms.size() > 0) { + ctx = inputPrograms[0].getInfo(&error_local); + if(error_local!=CL_SUCCESS) { + detail::errHandler(error_local, __LINK_PROGRAM_ERR); + } + } + + cl_program prog = ::clLinkProgram( + ctx(), + 0, + nullptr, + options, + static_cast(inputPrograms.size()), + reinterpret_cast(inputPrograms.data()), + notifyFptr, + data, + &error_local); + + detail::errHandler(error_local,__COMPILE_PROGRAM_ERR); + if (err != nullptr) { + *err = error_local; + } + + return Program(prog); +} +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 120 + +// Template specialization for CL_PROGRAM_BINARIES +template <> +inline cl_int cl::Program::getInfo(cl_program_info name, vector>* param) const +{ + if (name != CL_PROGRAM_BINARIES) { + return CL_INVALID_VALUE; + } + if (param) { + // Resize the parameter array appropriately for each allocation + // and pass down to the helper + + vector sizes = getInfo(); + size_type numBinaries = sizes.size(); + + // Resize the parameter array and constituent arrays + param->resize(numBinaries); + for (size_type i = 0; i < numBinaries; ++i) { + (*param)[i].resize(sizes[i]); + } + + return detail::errHandler( + detail::getInfo(&::clGetProgramInfo, object_, name, param), + __GET_PROGRAM_INFO_ERR); + } + + return CL_SUCCESS; +} + +template<> +inline vector> cl::Program::getInfo(cl_int* err) const +{ + vector> binariesVectors; + + cl_int result = getInfo(CL_PROGRAM_BINARIES, &binariesVectors); + if (err != nullptr) { + *err = result; + } + return binariesVectors; +} + +#if CL_HPP_TARGET_OPENCL_VERSION >= 220 +// Template specialization for clSetProgramSpecializationConstant +template <> +inline cl_int cl::Program::setSpecializationConstant(cl_uint index, const bool &value) +{ + cl_uchar ucValue = value ? CL_UCHAR_MAX : 0; + return detail::errHandler( + ::clSetProgramSpecializationConstant( + object_, + index, + sizeof(ucValue), + &ucValue), + __SET_PROGRAM_SPECIALIZATION_CONSTANT_ERR); +} +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 220 + +inline Kernel::Kernel(const Program& program, const char* name, cl_int* err) +{ + cl_int error; + + object_ = ::clCreateKernel(program(), name, &error); + detail::errHandler(error, __CREATE_KERNEL_ERR); + + if (err != nullptr) { + *err = error; + } + +} + +#ifdef cl_khr_external_memory +enum class ExternalMemoryType : cl_external_memory_handle_type_khr +{ + None = 0, + + OpaqueFd = CL_EXTERNAL_MEMORY_HANDLE_OPAQUE_FD_KHR, + OpaqueWin32 = CL_EXTERNAL_MEMORY_HANDLE_OPAQUE_WIN32_KHR, + OpaqueWin32Kmt = CL_EXTERNAL_MEMORY_HANDLE_OPAQUE_WIN32_KMT_KHR, + + D3D11Texture = CL_EXTERNAL_MEMORY_HANDLE_D3D11_TEXTURE_KHR, + D3D11TextureKmt = CL_EXTERNAL_MEMORY_HANDLE_D3D11_TEXTURE_KMT_KHR, + + D3D12Heap = CL_EXTERNAL_MEMORY_HANDLE_D3D12_HEAP_KHR, + D3D12Resource = CL_EXTERNAL_MEMORY_HANDLE_D3D12_RESOURCE_KHR, + + DmaBuf = CL_EXTERNAL_MEMORY_HANDLE_DMA_BUF_KHR, +}; +#endif + +enum class QueueProperties : cl_command_queue_properties +{ + None = 0, + Profiling = CL_QUEUE_PROFILING_ENABLE, + OutOfOrder = CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, +}; + +inline QueueProperties operator|(QueueProperties lhs, QueueProperties rhs) +{ + return static_cast(static_cast(lhs) | static_cast(rhs)); +} + +inline QueueProperties operator&(QueueProperties lhs, QueueProperties rhs) +{ + return static_cast(static_cast(lhs) & static_cast(rhs)); +} + +/*! \class CommandQueue + * \brief CommandQueue interface for cl_command_queue. + */ +class CommandQueue : public detail::Wrapper +{ +private: + static std::once_flag default_initialized_; + static CommandQueue default_; + static cl_int default_error_; + + /*! \brief Create the default command queue returned by @ref getDefault. + * + * It sets default_error_ to indicate success or failure. It does not throw + * @c cl::Error. + */ + static void makeDefault() + { + /* We don't want to throw an error from this function, so we have to + * catch and set the error flag. + */ +#if defined(CL_HPP_ENABLE_EXCEPTIONS) + try +#endif + { + int error; + Context context = Context::getDefault(&error); + + if (error != CL_SUCCESS) { + default_error_ = error; + } + else { + Device device = Device::getDefault(); + default_ = CommandQueue(context, device, 0, &default_error_); + } + } +#if defined(CL_HPP_ENABLE_EXCEPTIONS) + catch (cl::Error &e) { + default_error_ = e.err(); + } +#endif + } + + /*! \brief Create the default command queue. + * + * This sets @c default_. It does not throw + * @c cl::Error. + */ + static void makeDefaultProvided(const CommandQueue &c) { + default_ = c; + } + +#ifdef cl_khr_external_memory + static std::once_flag ext_memory_initialized_; + + static void initMemoryExtension(const cl::Device& device) + { + auto platform = device.getInfo()(); + + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clEnqueueAcquireExternalMemObjectsKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clEnqueueReleaseExternalMemObjectsKHR); + + if ((pfn_clEnqueueAcquireExternalMemObjectsKHR == nullptr) + && (pfn_clEnqueueReleaseExternalMemObjectsKHR == nullptr)) + { + detail::errHandler(CL_INVALID_VALUE, __ENQUEUE_ACQUIRE_EXTERNAL_MEMORY_ERR); + } + } +#endif // cl_khr_external_memory + +public: +#ifdef CL_HPP_UNIT_TEST_ENABLE + /*! \brief Reset the default. + * + * This sets @c default_ to an empty value to support cleanup in + * the unit test framework. + * This function is not thread safe. + */ + static void unitTestClearDefault() { + default_ = CommandQueue(); + } +#endif // #ifdef CL_HPP_UNIT_TEST_ENABLE + + + /*! + * \brief Constructs a CommandQueue based on passed properties. + * Will return an CL_INVALID_QUEUE_PROPERTIES error if CL_QUEUE_ON_DEVICE is specified. + */ + CommandQueue( + cl_command_queue_properties properties, + cl_int* err = nullptr) + { + cl_int error; + + Context context = Context::getDefault(&error); + detail::errHandler(error, __CREATE_CONTEXT_ERR); + + if (error != CL_SUCCESS) { + if (err != nullptr) { + *err = error; + } + } + else { + Device device = context.getInfo()[0]; + bool useWithProperties; + +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 && CL_HPP_MINIMUM_OPENCL_VERSION < 200 + // Run-time decision based on the actual platform + { + cl_uint version = detail::getContextPlatformVersion(context()); + useWithProperties = (version >= 0x20000); // OpenCL 2.0 or above + } +#elif CL_HPP_TARGET_OPENCL_VERSION >= 200 + useWithProperties = true; +#else + useWithProperties = false; +#endif + +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 + if (useWithProperties) { + cl_queue_properties queue_properties[] = { + CL_QUEUE_PROPERTIES, properties, 0 }; + if ((properties & CL_QUEUE_ON_DEVICE) == 0) { + object_ = ::clCreateCommandQueueWithProperties( + context(), device(), queue_properties, &error); + } + else { + error = CL_INVALID_QUEUE_PROPERTIES; + } + + detail::errHandler(error, __CREATE_COMMAND_QUEUE_WITH_PROPERTIES_ERR); + if (err != nullptr) { + *err = error; + } + } +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 200 +#if CL_HPP_MINIMUM_OPENCL_VERSION < 200 + if (!useWithProperties) { + object_ = ::clCreateCommandQueue( + context(), device(), properties, &error); + + detail::errHandler(error, __CREATE_COMMAND_QUEUE_ERR); + if (err != nullptr) { + *err = error; + } + } +#endif // CL_HPP_MINIMUM_OPENCL_VERSION < 200 + } + } + + /*! + * \brief Constructs a CommandQueue based on passed properties. + * Will return an CL_INVALID_QUEUE_PROPERTIES error if CL_QUEUE_ON_DEVICE is specified. + */ + CommandQueue( + QueueProperties properties, + cl_int* err = nullptr) + { + cl_int error; + + Context context = Context::getDefault(&error); + detail::errHandler(error, __CREATE_CONTEXT_ERR); + + if (error != CL_SUCCESS) { + if (err != nullptr) { + *err = error; + } + } + else { + Device device = context.getInfo()[0]; + bool useWithProperties; + +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 && CL_HPP_MINIMUM_OPENCL_VERSION < 200 + // Run-time decision based on the actual platform + { + cl_uint version = detail::getContextPlatformVersion(context()); + useWithProperties = (version >= 0x20000); // OpenCL 2.0 or above + } +#elif CL_HPP_TARGET_OPENCL_VERSION >= 200 + useWithProperties = true; +#else + useWithProperties = false; +#endif + +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 + if (useWithProperties) { + cl_queue_properties queue_properties[] = { + CL_QUEUE_PROPERTIES, static_cast(properties), 0 }; + + object_ = ::clCreateCommandQueueWithProperties( + context(), device(), queue_properties, &error); + + detail::errHandler(error, __CREATE_COMMAND_QUEUE_WITH_PROPERTIES_ERR); + if (err != nullptr) { + *err = error; + } + } +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 200 +#if CL_HPP_MINIMUM_OPENCL_VERSION < 200 + if (!useWithProperties) { + object_ = ::clCreateCommandQueue( + context(), device(), static_cast(properties), &error); + + detail::errHandler(error, __CREATE_COMMAND_QUEUE_ERR); + if (err != nullptr) { + *err = error; + } + } +#endif // CL_HPP_MINIMUM_OPENCL_VERSION < 200 + + } + } + + /*! + * \brief Constructs a CommandQueue for an implementation defined device in the given context + * Will return an CL_INVALID_QUEUE_PROPERTIES error if CL_QUEUE_ON_DEVICE is specified. + */ + explicit CommandQueue( + const Context& context, + cl_command_queue_properties properties = 0, + cl_int* err = nullptr) + { + cl_int error; + bool useWithProperties; + vector devices; + error = context.getInfo(CL_CONTEXT_DEVICES, &devices); + + detail::errHandler(error, __CREATE_CONTEXT_ERR); + + if (error != CL_SUCCESS) + { + if (err != nullptr) { + *err = error; + } + return; + } + +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 && CL_HPP_MINIMUM_OPENCL_VERSION < 200 + // Run-time decision based on the actual platform + { + cl_uint version = detail::getContextPlatformVersion(context()); + useWithProperties = (version >= 0x20000); // OpenCL 2.0 or above + } +#elif CL_HPP_TARGET_OPENCL_VERSION >= 200 + useWithProperties = true; +#else + useWithProperties = false; +#endif + +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 + if (useWithProperties) { + cl_queue_properties queue_properties[] = { + CL_QUEUE_PROPERTIES, properties, 0 }; + if ((properties & CL_QUEUE_ON_DEVICE) == 0) { + object_ = ::clCreateCommandQueueWithProperties( + context(), devices[0](), queue_properties, &error); + } + else { + error = CL_INVALID_QUEUE_PROPERTIES; + } + + detail::errHandler(error, __CREATE_COMMAND_QUEUE_WITH_PROPERTIES_ERR); + if (err != nullptr) { + *err = error; + } + } +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 200 +#if CL_HPP_MINIMUM_OPENCL_VERSION < 200 + if (!useWithProperties) { + object_ = ::clCreateCommandQueue( + context(), devices[0](), properties, &error); + + detail::errHandler(error, __CREATE_COMMAND_QUEUE_ERR); + if (err != nullptr) { + *err = error; + } + } +#endif // CL_HPP_MINIMUM_OPENCL_VERSION < 200 + } + + /*! + * \brief Constructs a CommandQueue for an implementation defined device in the given context + * Will return an CL_INVALID_QUEUE_PROPERTIES error if CL_QUEUE_ON_DEVICE is specified. + */ + explicit CommandQueue( + const Context& context, + QueueProperties properties, + cl_int* err = nullptr) + { + cl_int error; + bool useWithProperties; + vector devices; + error = context.getInfo(CL_CONTEXT_DEVICES, &devices); + + detail::errHandler(error, __CREATE_CONTEXT_ERR); + + if (error != CL_SUCCESS) + { + if (err != nullptr) { + *err = error; + } + return; + } + +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 && CL_HPP_MINIMUM_OPENCL_VERSION < 200 + // Run-time decision based on the actual platform + { + cl_uint version = detail::getContextPlatformVersion(context()); + useWithProperties = (version >= 0x20000); // OpenCL 2.0 or above + } +#elif CL_HPP_TARGET_OPENCL_VERSION >= 200 + useWithProperties = true; +#else + useWithProperties = false; +#endif + +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 + if (useWithProperties) { + cl_queue_properties queue_properties[] = { + CL_QUEUE_PROPERTIES, static_cast(properties), 0 }; + object_ = ::clCreateCommandQueueWithProperties( + context(), devices[0](), queue_properties, &error); + + detail::errHandler(error, __CREATE_COMMAND_QUEUE_WITH_PROPERTIES_ERR); + if (err != nullptr) { + *err = error; + } + } +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 200 +#if CL_HPP_MINIMUM_OPENCL_VERSION < 200 + if (!useWithProperties) { + object_ = ::clCreateCommandQueue( + context(), devices[0](), static_cast(properties), &error); + + detail::errHandler(error, __CREATE_COMMAND_QUEUE_ERR); + if (err != nullptr) { + *err = error; + } + } +#endif // CL_HPP_MINIMUM_OPENCL_VERSION < 200 + } + + /*! + * \brief Constructs a CommandQueue for a passed device and context + * Will return an CL_INVALID_QUEUE_PROPERTIES error if CL_QUEUE_ON_DEVICE is specified. + */ + CommandQueue( + const Context& context, + const Device& device, + cl_command_queue_properties properties = 0, + cl_int* err = nullptr) + { + cl_int error; + bool useWithProperties; + +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 && CL_HPP_MINIMUM_OPENCL_VERSION < 200 + // Run-time decision based on the actual platform + { + cl_uint version = detail::getContextPlatformVersion(context()); + useWithProperties = (version >= 0x20000); // OpenCL 2.0 or above + } +#elif CL_HPP_TARGET_OPENCL_VERSION >= 200 + useWithProperties = true; +#else + useWithProperties = false; +#endif + +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 + if (useWithProperties) { + cl_queue_properties queue_properties[] = { + CL_QUEUE_PROPERTIES, properties, 0 }; + object_ = ::clCreateCommandQueueWithProperties( + context(), device(), queue_properties, &error); + + detail::errHandler(error, __CREATE_COMMAND_QUEUE_WITH_PROPERTIES_ERR); + if (err != nullptr) { + *err = error; + } + } +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 200 +#if CL_HPP_MINIMUM_OPENCL_VERSION < 200 + if (!useWithProperties) { + object_ = ::clCreateCommandQueue( + context(), device(), properties, &error); + + detail::errHandler(error, __CREATE_COMMAND_QUEUE_ERR); + if (err != nullptr) { + *err = error; + } + } +#endif // CL_HPP_MINIMUM_OPENCL_VERSION < 200 + } + + /*! + * \brief Constructs a CommandQueue for a passed device and context + * Will return an CL_INVALID_QUEUE_PROPERTIES error if CL_QUEUE_ON_DEVICE is specified. + */ + CommandQueue( + const Context& context, + const Device& device, + QueueProperties properties, + cl_int* err = nullptr) + { + cl_int error; + bool useWithProperties; + +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 && CL_HPP_MINIMUM_OPENCL_VERSION < 200 + // Run-time decision based on the actual platform + { + cl_uint version = detail::getContextPlatformVersion(context()); + useWithProperties = (version >= 0x20000); // OpenCL 2.0 or above + } +#elif CL_HPP_TARGET_OPENCL_VERSION >= 200 + useWithProperties = true; +#else + useWithProperties = false; +#endif + +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 + if (useWithProperties) { + cl_queue_properties queue_properties[] = { + CL_QUEUE_PROPERTIES, static_cast(properties), 0 }; + object_ = ::clCreateCommandQueueWithProperties( + context(), device(), queue_properties, &error); + + detail::errHandler(error, __CREATE_COMMAND_QUEUE_WITH_PROPERTIES_ERR); + if (err != nullptr) { + *err = error; + } + } +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 200 +#if CL_HPP_MINIMUM_OPENCL_VERSION < 200 + if (!useWithProperties) { + object_ = ::clCreateCommandQueue( + context(), device(), static_cast(properties), &error); + + detail::errHandler(error, __CREATE_COMMAND_QUEUE_ERR); + if (err != nullptr) { + *err = error; + } + } +#endif // CL_HPP_MINIMUM_OPENCL_VERSION < 200 + } + + static CommandQueue getDefault(cl_int * err = nullptr) + { + std::call_once(default_initialized_, makeDefault); +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 + detail::errHandler(default_error_, __CREATE_COMMAND_QUEUE_WITH_PROPERTIES_ERR); +#else // CL_HPP_TARGET_OPENCL_VERSION >= 200 + detail::errHandler(default_error_, __CREATE_COMMAND_QUEUE_ERR); +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 200 + if (err != nullptr) { + *err = default_error_; + } + return default_; + } + + /** + * Modify the default command queue to be used by + * subsequent operations. + * Will only set the default if no default was previously created. + * @return updated default command queue. + * Should be compared to the passed value to ensure that it was updated. + */ + static CommandQueue setDefault(const CommandQueue &default_queue) + { + std::call_once(default_initialized_, makeDefaultProvided, std::cref(default_queue)); + detail::errHandler(default_error_); + return default_; + } + + CommandQueue() { } + + + /*! \brief Constructor from cl_command_queue - takes ownership. + * + * \param retainObject will cause the constructor to retain its cl object. + * Defaults to false to maintain compatibility with + * earlier versions. + */ + explicit CommandQueue(const cl_command_queue& commandQueue, bool retainObject = false) : + detail::Wrapper(commandQueue, retainObject) { } + + CommandQueue& operator = (const cl_command_queue& rhs) + { + detail::Wrapper::operator=(rhs); + return *this; + } + + template + cl_int getInfo(cl_command_queue_info name, T* param) const + { + return detail::errHandler( + detail::getInfo( + &::clGetCommandQueueInfo, object_, name, param), + __GET_COMMAND_QUEUE_INFO_ERR); + } + + template typename + detail::param_traits::param_type + getInfo(cl_int* err = nullptr) const + { + typename detail::param_traits< + detail::cl_command_queue_info, name>::param_type param; + cl_int result = getInfo(name, ¶m); + if (err != nullptr) { + *err = result; + } + return param; + } + + cl_int enqueueReadBuffer( + const Buffer& buffer, + cl_bool blocking, + size_type offset, + size_type size, + void* ptr, + const vector* events = nullptr, + Event* event = nullptr) const + { + cl_event tmp; + cl_int err = detail::errHandler( + ::clEnqueueReadBuffer( + object_, buffer(), blocking, offset, size, + ptr, + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_READ_BUFFER_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + + cl_int enqueueWriteBuffer( + const Buffer& buffer, + cl_bool blocking, + size_type offset, + size_type size, + const void* ptr, + const vector* events = nullptr, + Event* event = nullptr) const + { + cl_event tmp; + cl_int err = detail::errHandler( + ::clEnqueueWriteBuffer( + object_, buffer(), blocking, offset, size, + ptr, + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_WRITE_BUFFER_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + + cl_int enqueueCopyBuffer( + const Buffer& src, + const Buffer& dst, + size_type src_offset, + size_type dst_offset, + size_type size, + const vector* events = nullptr, + Event* event = nullptr) const + { + cl_event tmp; + cl_int err = detail::errHandler( + ::clEnqueueCopyBuffer( + object_, src(), dst(), src_offset, dst_offset, size, + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQEUE_COPY_BUFFER_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } +#if CL_HPP_TARGET_OPENCL_VERSION >= 110 + cl_int enqueueReadBufferRect( + const Buffer& buffer, + cl_bool blocking, + const array& buffer_offset, + const array& host_offset, + const array& region, + size_type buffer_row_pitch, + size_type buffer_slice_pitch, + size_type host_row_pitch, + size_type host_slice_pitch, + void *ptr, + const vector* events = nullptr, + Event* event = nullptr) const + { + cl_event tmp; + cl_int err = detail::errHandler( + ::clEnqueueReadBufferRect( + object_, + buffer(), + blocking, + buffer_offset.data(), + host_offset.data(), + region.data(), + buffer_row_pitch, + buffer_slice_pitch, + host_row_pitch, + host_slice_pitch, + ptr, + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_READ_BUFFER_RECT_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + + cl_int enqueueReadBufferRect( + const Buffer& buffer, + cl_bool blocking, + const array& buffer_offset, + const array& host_offset, + const array& region, + size_type buffer_row_pitch, + size_type buffer_slice_pitch, + size_type host_row_pitch, + size_type host_slice_pitch, + void* ptr, + const vector* events = nullptr, + Event* event = nullptr) const + { + return enqueueReadBufferRect( + buffer, + blocking, + { buffer_offset[0], buffer_offset[1], 0 }, + { host_offset[0], host_offset[1], 0 }, + { region[0], region[1], 1 }, + buffer_row_pitch, + buffer_slice_pitch, + host_row_pitch, + host_slice_pitch, + ptr, + events, + event); + } + + cl_int enqueueWriteBufferRect( + const Buffer& buffer, + cl_bool blocking, + const array& buffer_offset, + const array& host_offset, + const array& region, + size_type buffer_row_pitch, + size_type buffer_slice_pitch, + size_type host_row_pitch, + size_type host_slice_pitch, + const void *ptr, + const vector* events = nullptr, + Event* event = nullptr) const + { + cl_event tmp; + cl_int err = detail::errHandler( + ::clEnqueueWriteBufferRect( + object_, + buffer(), + blocking, + buffer_offset.data(), + host_offset.data(), + region.data(), + buffer_row_pitch, + buffer_slice_pitch, + host_row_pitch, + host_slice_pitch, + ptr, + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_WRITE_BUFFER_RECT_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + + cl_int enqueueWriteBufferRect( + const Buffer& buffer, + cl_bool blocking, + const array& buffer_offset, + const array& host_offset, + const array& region, + size_type buffer_row_pitch, + size_type buffer_slice_pitch, + size_type host_row_pitch, + size_type host_slice_pitch, + const void* ptr, + const vector* events = nullptr, + Event* event = nullptr) const + { + return enqueueWriteBufferRect( + buffer, + blocking, + { buffer_offset[0], buffer_offset[1], 0 }, + { host_offset[0], host_offset[1], 0 }, + { region[0], region[1], 1 }, + buffer_row_pitch, + buffer_slice_pitch, + host_row_pitch, + host_slice_pitch, + ptr, + events, + event); + } + + cl_int enqueueCopyBufferRect( + const Buffer& src, + const Buffer& dst, + const array& src_origin, + const array& dst_origin, + const array& region, + size_type src_row_pitch, + size_type src_slice_pitch, + size_type dst_row_pitch, + size_type dst_slice_pitch, + const vector* events = nullptr, + Event* event = nullptr) const + { + cl_event tmp; + cl_int err = detail::errHandler( + ::clEnqueueCopyBufferRect( + object_, + src(), + dst(), + src_origin.data(), + dst_origin.data(), + region.data(), + src_row_pitch, + src_slice_pitch, + dst_row_pitch, + dst_slice_pitch, + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQEUE_COPY_BUFFER_RECT_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + + cl_int enqueueCopyBufferRect( + const Buffer& src, + const Buffer& dst, + const array& src_origin, + const array& dst_origin, + const array& region, + size_type src_row_pitch, + size_type src_slice_pitch, + size_type dst_row_pitch, + size_type dst_slice_pitch, + const vector* events = nullptr, + Event* event = nullptr) const + { + return enqueueCopyBufferRect( + src, + dst, + { src_origin[0], src_origin[1], 0 }, + { dst_origin[0], dst_origin[1], 0 }, + { region[0], region[1], 1 }, + src_row_pitch, + src_slice_pitch, + dst_row_pitch, + dst_slice_pitch, + events, + event); + } + +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 110 +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 + /** + * Enqueue a command to fill a buffer object with a pattern + * of a given size. The pattern is specified as a vector type. + * \tparam PatternType The datatype of the pattern field. + * The pattern type must be an accepted OpenCL data type. + * \tparam offset Is the offset in bytes into the buffer at + * which to start filling. This must be a multiple of + * the pattern size. + * \tparam size Is the size in bytes of the region to fill. + * This must be a multiple of the pattern size. + */ + template + cl_int enqueueFillBuffer( + const Buffer& buffer, + PatternType pattern, + size_type offset, + size_type size, + const vector* events = nullptr, + Event* event = nullptr) const + { + cl_event tmp; + cl_int err = detail::errHandler( + ::clEnqueueFillBuffer( + object_, + buffer(), + static_cast(&pattern), + sizeof(PatternType), + offset, + size, + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_FILL_BUFFER_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 120 + + cl_int enqueueReadImage( + const Image& image, + cl_bool blocking, + const array& origin, + const array& region, + size_type row_pitch, + size_type slice_pitch, + void* ptr, + const vector* events = nullptr, + Event* event = nullptr) const + { + cl_event tmp; + cl_int err = detail::errHandler( + ::clEnqueueReadImage( + object_, + image(), + blocking, + origin.data(), + region.data(), + row_pitch, + slice_pitch, + ptr, + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_READ_IMAGE_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + + cl_int enqueueReadImage( + const Image& image, + cl_bool blocking, + const array& origin, + const array& region, + size_type row_pitch, + size_type slice_pitch, + void* ptr, + const vector* events = nullptr, + Event* event = nullptr) const + { + return enqueueReadImage( + image, + blocking, + { origin[0], origin[1], 0 }, + { region[0], region[1], 1 }, + row_pitch, + slice_pitch, + ptr, + events, + event); + } + + cl_int enqueueWriteImage( + const Image& image, + cl_bool blocking, + const array& origin, + const array& region, + size_type row_pitch, + size_type slice_pitch, + const void* ptr, + const vector* events = nullptr, + Event* event = nullptr) const + { + cl_event tmp; + cl_int err = detail::errHandler( + ::clEnqueueWriteImage( + object_, + image(), + blocking, + origin.data(), + region.data(), + row_pitch, + slice_pitch, + ptr, + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_WRITE_IMAGE_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + + cl_int enqueueWriteImage( + const Image& image, + cl_bool blocking, + const array& origin, + const array& region, + size_type row_pitch, + size_type slice_pitch, + const void* ptr, + const vector* events = nullptr, + Event* event = nullptr) const + { + return enqueueWriteImage( + image, + blocking, + { origin[0], origin[1], 0 }, + { region[0], region[1], 1 }, + row_pitch, + slice_pitch, + ptr, + events, + event); + } + + cl_int enqueueCopyImage( + const Image& src, + const Image& dst, + const array& src_origin, + const array& dst_origin, + const array& region, + const vector* events = nullptr, + Event* event = nullptr) const + { + cl_event tmp; + cl_int err = detail::errHandler( + ::clEnqueueCopyImage( + object_, + src(), + dst(), + src_origin.data(), + dst_origin.data(), + region.data(), + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_COPY_IMAGE_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + + cl_int enqueueCopyImage( + const Image& src, + const Image& dst, + const array& src_origin, + const array& dst_origin, + const array& region, + const vector* events = nullptr, + Event* event = nullptr) const + { + return enqueueCopyImage( + src, + dst, + { src_origin[0], src_origin[1], 0 }, + { dst_origin[0], dst_origin[1], 0 }, + { region[0], region[1], 1 }, + events, + event); + } + +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 + /** + * Enqueue a command to fill an image object with a specified color. + * \param fillColor is the color to use to fill the image. + * This is a four component RGBA floating-point, signed integer + * or unsigned integer color value if the image channel data + * type is an unnormalized signed integer type. + */ + template + typename std::enable_if::value || + std::is_same::value || + std::is_same::value, + cl_int>::type + enqueueFillImage( + const Image& image, + T fillColor, + const array& origin, + const array& region, + const vector* events = nullptr, + Event* event = nullptr) const + { + cl_event tmp; + cl_int err = detail::errHandler( + ::clEnqueueFillImage( + object_, + image(), + static_cast(&fillColor), + origin.data(), + region.data(), + (events != nullptr) ? (cl_uint)events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*)&events->front() : NULL, + (event != NULL) ? &tmp : nullptr), + __ENQUEUE_FILL_IMAGE_ERR); + + if (event != nullptr && err == CL_SUCCESS) *event = tmp; + + return err; + } + + /** + * Enqueue a command to fill an image object with a specified color. + * \param fillColor is the color to use to fill the image. + * This is a four component RGBA floating-point, signed integer + * or unsigned integer color value if the image channel data + * type is an unnormalized signed integer type. + */ + template + typename std::enable_if::value || + std::is_same::value || + std::is_same::value, cl_int>::type + enqueueFillImage( + const Image& image, + T fillColor, + const array& origin, + const array& region, + const vector* events = nullptr, + Event* event = nullptr) const + { + return enqueueFillImage( + image, + fillColor, + { origin[0], origin[1], 0 }, + { region[0], region[1], 1 }, + events, + event + ); + } +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 120 + + cl_int enqueueCopyImageToBuffer( + const Image& src, + const Buffer& dst, + const array& src_origin, + const array& region, + size_type dst_offset, + const vector* events = nullptr, + Event* event = nullptr) const + { + cl_event tmp; + cl_int err = detail::errHandler( + ::clEnqueueCopyImageToBuffer( + object_, + src(), + dst(), + src_origin.data(), + region.data(), + dst_offset, + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_COPY_IMAGE_TO_BUFFER_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + + cl_int enqueueCopyImageToBuffer( + const Image& src, + const Buffer& dst, + const array& src_origin, + const array& region, + size_type dst_offset, + const vector* events = nullptr, + Event* event = nullptr) const + { + return enqueueCopyImageToBuffer( + src, + dst, + { src_origin[0], src_origin[1], 0 }, + { region[0], region[1], 1 }, + dst_offset, + events, + event); + } + + cl_int enqueueCopyBufferToImage( + const Buffer& src, + const Image& dst, + size_type src_offset, + const array& dst_origin, + const array& region, + const vector* events = nullptr, + Event* event = nullptr) const + { + cl_event tmp; + cl_int err = detail::errHandler( + ::clEnqueueCopyBufferToImage( + object_, + src(), + dst(), + src_offset, + dst_origin.data(), + region.data(), + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_COPY_BUFFER_TO_IMAGE_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + + cl_int enqueueCopyBufferToImage( + const Buffer& src, + const Image& dst, + size_type src_offset, + const array& dst_origin, + const array& region, + const vector* events = nullptr, + Event* event = nullptr) const + { + return enqueueCopyBufferToImage( + src, + dst, + src_offset, + { dst_origin[0], dst_origin[1], 0 }, + { region[0], region[1], 1 }, + events, + event); + } + + void* enqueueMapBuffer( + const Buffer& buffer, + cl_bool blocking, + cl_map_flags flags, + size_type offset, + size_type size, + const vector* events = nullptr, + Event* event = nullptr, + cl_int* err = nullptr) const + { + cl_event tmp; + cl_int error; + void * result = ::clEnqueueMapBuffer( + object_, buffer(), blocking, flags, offset, size, + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr, + &error); + + detail::errHandler(error, __ENQUEUE_MAP_BUFFER_ERR); + if (err != nullptr) { + *err = error; + } + if (event != nullptr && error == CL_SUCCESS) + *event = tmp; + + return result; + } + + void* enqueueMapImage( + const Image& image, + cl_bool blocking, + cl_map_flags flags, + const array& origin, + const array& region, + size_type * row_pitch, + size_type * slice_pitch, + const vector* events = nullptr, + Event* event = nullptr, + cl_int* err = nullptr) const + { + cl_event tmp; + cl_int error; + void * result = ::clEnqueueMapImage( + object_, image(), blocking, flags, + origin.data(), + region.data(), + row_pitch, slice_pitch, + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr, + &error); + + detail::errHandler(error, __ENQUEUE_MAP_IMAGE_ERR); + if (err != nullptr) { + *err = error; + } + if (event != nullptr && error == CL_SUCCESS) + *event = tmp; + return result; + } + + void* enqueueMapImage( + const Image& image, + cl_bool blocking, + cl_map_flags flags, + const array& origin, + const array& region, + size_type* row_pitch, + size_type* slice_pitch, + const vector* events = nullptr, + Event* event = nullptr, + cl_int* err = nullptr) const + { + return enqueueMapImage(image, blocking, flags, + { origin[0], origin[1], 0 }, + { region[0], region[1], 1 }, row_pitch, + slice_pitch, events, event, err); + } + +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 + + /** + * Enqueues a command that copies a region of memory from the source pointer to the destination pointer. + * This function is specifically for transferring data between the host and a coarse-grained SVM buffer. + */ + template + cl_int enqueueMemcpySVM( + T *dst_ptr, + const T *src_ptr, + cl_bool blocking, + size_type size, + const vector *events = nullptr, + Event *event = nullptr) const { + cl_event tmp; + cl_int err = detail::errHandler(::clEnqueueSVMMemcpy( + object_, blocking, static_cast(dst_ptr), static_cast(src_ptr), size, + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event *) &events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), __ENQUEUE_COPY_SVM_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + + /** + *Enqueues a command that will copy data from one coarse-grained SVM buffer to another. + *This function takes two cl::pointer instances representing the destination and source buffers. + */ + template + cl_int enqueueMemcpySVM( + cl::pointer &dst_ptr, + const cl::pointer &src_ptr, + cl_bool blocking, + size_type size, + const vector *events = nullptr, + Event *event = nullptr) const { + cl_event tmp; + cl_int err = detail::errHandler(::clEnqueueSVMMemcpy( + object_, blocking, static_cast(dst_ptr.get()), static_cast(src_ptr.get()), + size, + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event *) &events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), __ENQUEUE_COPY_SVM_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + + /** + * Enqueues a command that will allow the host to update a region of a coarse-grained SVM buffer. + * This variant takes a cl::vector instance. + */ + template + cl_int enqueueMemcpySVM( + cl::vector &dst_container, + const cl::vector &src_container, + cl_bool blocking, + const vector *events = nullptr, + Event *event = nullptr) const { + cl_event tmp; + if(src_container.size() != dst_container.size()){ + return detail::errHandler(CL_INVALID_VALUE,__ENQUEUE_COPY_SVM_ERR); + } + cl_int err = detail::errHandler(::clEnqueueSVMMemcpy( + object_, blocking, static_cast(dst_container.data()), + static_cast(src_container.data()), + dst_container.size() * sizeof(T), + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event *) &events->front() : nullptr, + (event != NULL) ? &tmp : nullptr), __ENQUEUE_COPY_SVM_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + + /** + * Enqueues a command to fill a SVM buffer with a pattern. + * + */ + template + cl_int enqueueMemFillSVM( + T *ptr, + PatternType pattern, + size_type size, + const vector *events = nullptr, + Event *event = nullptr) const { + cl_event tmp; + cl_int err = detail::errHandler(::clEnqueueSVMMemFill( + object_, static_cast(ptr), static_cast(&pattern), + sizeof(PatternType), size, + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event *) &events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), __ENQUEUE_FILL_SVM_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + + /** + * Enqueues a command that fills a region of a coarse-grained SVM buffer with a specified pattern. + * This variant takes a cl::pointer instance. + */ + template + cl_int enqueueMemFillSVM( + cl::pointer &ptr, + PatternType pattern, + size_type size, + const vector *events = nullptr, + Event *event = nullptr) const { + cl_event tmp; + cl_int err = detail::errHandler(::clEnqueueSVMMemFill( + object_, static_cast(ptr.get()), static_cast(&pattern), + sizeof(PatternType), size, + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event *) &events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), __ENQUEUE_FILL_SVM_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + + /** + * Enqueues a command that will allow the host to fill a region of a coarse-grained SVM buffer with a specified pattern. + * This variant takes a cl::vector instance. + */ + template + cl_int enqueueMemFillSVM( + cl::vector &container, + PatternType pattern, + const vector *events = nullptr, + Event* event = nullptr) const + { + cl_event tmp; + cl_int err = detail::errHandler(::clEnqueueSVMMemFill( + object_, static_cast(container.data()), static_cast(&pattern), + sizeof(PatternType), container.size() * sizeof(T), + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event *) &events->front() : nullptr, + (event != nullptr) ? &tmp : NULL), __ENQUEUE_FILL_SVM_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + + /** + * Enqueues a command that will allow the host to update a region of a coarse-grained SVM buffer. + * This variant takes a raw SVM pointer. + */ + template + cl_int enqueueMapSVM( + T* ptr, + cl_bool blocking, + cl_map_flags flags, + size_type size, + const vector* events = nullptr, + Event* event = nullptr) const + { + cl_event tmp; + cl_int err = detail::errHandler(::clEnqueueSVMMap( + object_, blocking, flags, static_cast(ptr), size, + (events != nullptr) ? (cl_uint)events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*)&events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_MAP_SVM_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + + + /** + * Enqueues a command that will allow the host to update a region of a coarse-grained SVM buffer. + * This variant takes a cl::pointer instance. + */ + template + cl_int enqueueMapSVM( + cl::pointer &ptr, + cl_bool blocking, + cl_map_flags flags, + size_type size, + const vector* events = nullptr, + Event* event = nullptr) const + { + cl_event tmp; + cl_int err = detail::errHandler(::clEnqueueSVMMap( + object_, blocking, flags, static_cast(ptr.get()), size, + (events != nullptr) ? (cl_uint)events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*)&events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_MAP_SVM_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + + /** + * Enqueues a command that will allow the host to update a region of a coarse-grained SVM buffer. + * This variant takes a cl::vector instance. + */ + template + cl_int enqueueMapSVM( + cl::vector &container, + cl_bool blocking, + cl_map_flags flags, + const vector* events = nullptr, + Event* event = nullptr) const + { + cl_event tmp; + cl_int err = detail::errHandler(::clEnqueueSVMMap( + object_, blocking, flags, static_cast(container.data()), container.size()*sizeof(T), + (events != nullptr) ? (cl_uint)events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*)&events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_MAP_SVM_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } +#endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 200 + + cl_int enqueueUnmapMemObject( + const Memory& memory, + void* mapped_ptr, + const vector* events = nullptr, + Event* event = nullptr) const + { + cl_event tmp; + cl_int err = detail::errHandler( + ::clEnqueueUnmapMemObject( + object_, memory(), mapped_ptr, + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_UNMAP_MEM_OBJECT_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + + +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 + /** + * Enqueues a command that will release a coarse-grained SVM buffer back to the OpenCL runtime. + * This variant takes a raw SVM pointer. + */ + template + cl_int enqueueUnmapSVM( + T* ptr, + const vector* events = nullptr, + Event* event = nullptr) const + { + cl_event tmp; + cl_int err = detail::errHandler( + ::clEnqueueSVMUnmap( + object_, static_cast(ptr), + (events != nullptr) ? (cl_uint)events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*)&events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_UNMAP_SVM_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + + /** + * Enqueues a command that will release a coarse-grained SVM buffer back to the OpenCL runtime. + * This variant takes a cl::pointer instance. + */ + template + cl_int enqueueUnmapSVM( + cl::pointer &ptr, + const vector* events = nullptr, + Event* event = nullptr) const + { + cl_event tmp; + cl_int err = detail::errHandler( + ::clEnqueueSVMUnmap( + object_, static_cast(ptr.get()), + (events != nullptr) ? (cl_uint)events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*)&events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_UNMAP_SVM_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + + /** + * Enqueues a command that will release a coarse-grained SVM buffer back to the OpenCL runtime. + * This variant takes a cl::vector instance. + */ + template + cl_int enqueueUnmapSVM( + cl::vector &container, + const vector* events = nullptr, + Event* event = nullptr) const + { + cl_event tmp; + cl_int err = detail::errHandler( + ::clEnqueueSVMUnmap( + object_, static_cast(container.data()), + (events != nullptr) ? (cl_uint)events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*)&events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_UNMAP_SVM_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } +#endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 200 + +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 + /** + * Enqueues a marker command which waits for either a list of events to complete, + * or all previously enqueued commands to complete. + * + * Enqueues a marker command which waits for either a list of events to complete, + * or if the list is empty it waits for all commands previously enqueued in command_queue + * to complete before it completes. This command returns an event which can be waited on, + * i.e. this event can be waited on to insure that all events either in the event_wait_list + * or all previously enqueued commands, queued before this command to command_queue, + * have completed. + */ + cl_int enqueueMarkerWithWaitList( + const vector *events = nullptr, + Event *event = nullptr) const + { + cl_event tmp; + cl_int err = detail::errHandler( + ::clEnqueueMarkerWithWaitList( + object_, + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_MARKER_WAIT_LIST_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + + /** + * A synchronization point that enqueues a barrier operation. + * + * Enqueues a barrier command which waits for either a list of events to complete, + * or if the list is empty it waits for all commands previously enqueued in command_queue + * to complete before it completes. This command blocks command execution, that is, any + * following commands enqueued after it do not execute until it completes. This command + * returns an event which can be waited on, i.e. this event can be waited on to insure that + * all events either in the event_wait_list or all previously enqueued commands, queued + * before this command to command_queue, have completed. + */ + cl_int enqueueBarrierWithWaitList( + const vector *events = nullptr, + Event *event = nullptr) const + { + cl_event tmp; + cl_int err = detail::errHandler( + ::clEnqueueBarrierWithWaitList( + object_, + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_BARRIER_WAIT_LIST_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + + /** + * Enqueues a command to indicate with which device a set of memory objects + * should be associated. + */ + cl_int enqueueMigrateMemObjects( + const vector &memObjects, + cl_mem_migration_flags flags, + const vector* events = nullptr, + Event* event = nullptr + ) const + { + cl_event tmp; + + vector localMemObjects(memObjects.size()); + + for( int i = 0; i < (int)memObjects.size(); ++i ) { + localMemObjects[i] = memObjects[i](); + } + + cl_int err = detail::errHandler( + ::clEnqueueMigrateMemObjects( + object_, + (cl_uint)memObjects.size(), + localMemObjects.data(), + flags, + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_UNMAP_MEM_OBJECT_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 120 + + +#if CL_HPP_TARGET_OPENCL_VERSION >= 210 + /** + * Enqueues a command that will allow the host associate ranges within a set of + * SVM allocations with a device. + * @param sizes - The length from each pointer to migrate. + */ + template + cl_int enqueueMigrateSVM( + const cl::vector &svmRawPointers, + const cl::vector &sizes, + cl_mem_migration_flags flags = 0, + const vector* events = nullptr, + Event* event = nullptr) const + { + cl_event tmp; + cl_int err = detail::errHandler(::clEnqueueSVMMigrateMem( + object_, + svmRawPointers.size(), static_cast(svmRawPointers.data()), + sizes.data(), // array of sizes not passed + flags, + (events != nullptr) ? (cl_uint)events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*)&events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_MIGRATE_SVM_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + + /** + * Enqueues a command that will allow the host associate a set of SVM allocations with + * a device. + */ + template + cl_int enqueueMigrateSVM( + const cl::vector &svmRawPointers, + cl_mem_migration_flags flags = 0, + const vector* events = nullptr, + Event* event = nullptr) const + { + return enqueueMigrateSVM(svmRawPointers, cl::vector(svmRawPointers.size()), flags, events, event); + } + + + /** + * Enqueues a command that will allow the host associate ranges within a set of + * SVM allocations with a device. + * @param sizes - The length from each pointer to migrate. + */ + template + cl_int enqueueMigrateSVM( + const cl::vector> &svmPointers, + const cl::vector &sizes, + cl_mem_migration_flags flags = 0, + const vector* events = nullptr, + Event* event = nullptr) const + { + cl::vector svmRawPointers; + svmRawPointers.reserve(svmPointers.size()); + for (auto p : svmPointers) { + svmRawPointers.push_back(static_cast(p.get())); + } + + return enqueueMigrateSVM(svmRawPointers, sizes, flags, events, event); + } + + + /** + * Enqueues a command that will allow the host associate a set of SVM allocations with + * a device. + */ + template + cl_int enqueueMigrateSVM( + const cl::vector> &svmPointers, + cl_mem_migration_flags flags = 0, + const vector* events = nullptr, + Event* event = nullptr) const + { + return enqueueMigrateSVM(svmPointers, cl::vector(svmPointers.size()), flags, events, event); + } + + /** + * Enqueues a command that will allow the host associate ranges within a set of + * SVM allocations with a device. + * @param sizes - The length from the beginning of each container to migrate. + */ + template + cl_int enqueueMigrateSVM( + const cl::vector> &svmContainers, + const cl::vector &sizes, + cl_mem_migration_flags flags = 0, + const vector* events = nullptr, + Event* event = nullptr) const + { + cl::vector svmRawPointers; + svmRawPointers.reserve(svmContainers.size()); + for (auto p : svmContainers) { + svmRawPointers.push_back(static_cast(p.data())); + } + + return enqueueMigrateSVM(svmRawPointers, sizes, flags, events, event); + } + + /** + * Enqueues a command that will allow the host associate a set of SVM allocations with + * a device. + */ + template + cl_int enqueueMigrateSVM( + const cl::vector> &svmContainers, + cl_mem_migration_flags flags = 0, + const vector* events = nullptr, + Event* event = nullptr) const + { + return enqueueMigrateSVM(svmContainers, cl::vector(svmContainers.size()), flags, events, event); + } + +#endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 210 + + cl_int enqueueNDRangeKernel( + const Kernel& kernel, + const NDRange& offset, + const NDRange& global, + const NDRange& local = NullRange, + const vector* events = nullptr, + Event* event = nullptr) const + { + cl_event tmp; + cl_int err = detail::errHandler( + ::clEnqueueNDRangeKernel( + object_, kernel(), (cl_uint) global.dimensions(), + offset.dimensions() != 0 ? (const size_type*) offset : nullptr, + (const size_type*) global, + local.dimensions() != 0 ? (const size_type*) local : nullptr, + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_NDRANGE_KERNEL_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + +#if defined(CL_USE_DEPRECATED_OPENCL_1_2_APIS) + CL_API_PREFIX__VERSION_1_2_DEPRECATED cl_int enqueueTask( + const Kernel& kernel, + const vector* events = nullptr, + Event* event = nullptr) const CL_API_SUFFIX__VERSION_1_2_DEPRECATED + { + cl_event tmp; + cl_int err = detail::errHandler( + ::clEnqueueTask( + object_, kernel(), + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_TASK_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } +#endif // #if defined(CL_USE_DEPRECATED_OPENCL_1_2_APIS) + + cl_int enqueueNativeKernel( + void (CL_CALLBACK *userFptr)(void *), + std::pair args, + const vector* mem_objects = nullptr, + const vector* mem_locs = nullptr, + const vector* events = nullptr, + Event* event = nullptr) const + { + cl_event tmp; + cl_int err = detail::errHandler( + ::clEnqueueNativeKernel( + object_, userFptr, args.first, args.second, + (mem_objects != nullptr) ? (cl_uint) mem_objects->size() : 0, + (mem_objects->size() > 0 ) ? reinterpret_cast(mem_objects->data()) : nullptr, + (mem_locs != nullptr && mem_locs->size() > 0) ? (const void **) &mem_locs->front() : nullptr, + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_NATIVE_KERNEL); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + +/** + * Deprecated APIs for 1.2 + */ +#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) + CL_API_PREFIX__VERSION_1_1_DEPRECATED + cl_int enqueueMarker(Event* event = nullptr) const CL_API_SUFFIX__VERSION_1_1_DEPRECATED + { + cl_event tmp; + cl_int err = detail::errHandler( + ::clEnqueueMarker( + object_, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_MARKER_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + + CL_API_PREFIX__VERSION_1_1_DEPRECATED + cl_int enqueueWaitForEvents(const vector& events) const CL_API_SUFFIX__VERSION_1_1_DEPRECATED + { + return detail::errHandler( + ::clEnqueueWaitForEvents( + object_, + (cl_uint) events.size(), + events.size() > 0 ? (const cl_event*) &events.front() : nullptr), + __ENQUEUE_WAIT_FOR_EVENTS_ERR); + } +#endif // defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) + + cl_int enqueueAcquireGLObjects( + const vector* mem_objects = nullptr, + const vector* events = nullptr, + Event* event = nullptr) const + { + cl_event tmp; + cl_int err = detail::errHandler( + ::clEnqueueAcquireGLObjects( + object_, + (mem_objects != nullptr) ? (cl_uint) mem_objects->size() : 0, + (mem_objects != nullptr && mem_objects->size() > 0) ? (const cl_mem *) &mem_objects->front(): nullptr, + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_ACQUIRE_GL_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + + cl_int enqueueReleaseGLObjects( + const vector* mem_objects = nullptr, + const vector* events = nullptr, + Event* event = nullptr) const + { + cl_event tmp; + cl_int err = detail::errHandler( + ::clEnqueueReleaseGLObjects( + object_, + (mem_objects != nullptr) ? (cl_uint) mem_objects->size() : 0, + (mem_objects != nullptr && mem_objects->size() > 0) ? (const cl_mem *) &mem_objects->front(): nullptr, + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_RELEASE_GL_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + +#if defined (CL_HPP_USE_DX_INTEROP) +typedef CL_API_ENTRY cl_int (CL_API_CALL *PFN_clEnqueueAcquireD3D10ObjectsKHR)( + cl_command_queue command_queue, cl_uint num_objects, + const cl_mem* mem_objects, cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, cl_event* event); +typedef CL_API_ENTRY cl_int (CL_API_CALL *PFN_clEnqueueReleaseD3D10ObjectsKHR)( + cl_command_queue command_queue, cl_uint num_objects, + const cl_mem* mem_objects, cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, cl_event* event); + + cl_int enqueueAcquireD3D10Objects( + const vector* mem_objects = nullptr, + const vector* events = nullptr, + Event* event = nullptr) const + { + static PFN_clEnqueueAcquireD3D10ObjectsKHR pfn_clEnqueueAcquireD3D10ObjectsKHR = nullptr; +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 + cl_context context = getInfo(); + cl::Device device(getInfo()); + cl_platform_id platform = device.getInfo(); + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clEnqueueAcquireD3D10ObjectsKHR); +#endif +#if CL_HPP_MINIMUM_OPENCL_VERSION < 120 + CL_HPP_INIT_CL_EXT_FCN_PTR_(clEnqueueAcquireD3D10ObjectsKHR); +#endif + + cl_event tmp; + cl_int err = detail::errHandler( + pfn_clEnqueueAcquireD3D10ObjectsKHR( + object_, + (mem_objects != nullptr) ? (cl_uint) mem_objects->size() : 0, + (mem_objects != nullptr && mem_objects->size() > 0) ? (const cl_mem *) &mem_objects->front(): nullptr, + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr) ? (cl_event*) &events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_ACQUIRE_GL_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + + cl_int enqueueReleaseD3D10Objects( + const vector* mem_objects = nullptr, + const vector* events = nullptr, + Event* event = nullptr) const + { + static PFN_clEnqueueReleaseD3D10ObjectsKHR pfn_clEnqueueReleaseD3D10ObjectsKHR = nullptr; +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 + cl_context context = getInfo(); + cl::Device device(getInfo()); + cl_platform_id platform = device.getInfo(); + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clEnqueueReleaseD3D10ObjectsKHR); +#endif +#if CL_HPP_MINIMUM_OPENCL_VERSION < 120 + CL_HPP_INIT_CL_EXT_FCN_PTR_(clEnqueueReleaseD3D10ObjectsKHR); +#endif + + cl_event tmp; + cl_int err = detail::errHandler( + pfn_clEnqueueReleaseD3D10ObjectsKHR( + object_, + (mem_objects != nullptr) ? (cl_uint) mem_objects->size() : 0, + (mem_objects != nullptr && mem_objects->size() > 0) ? (const cl_mem *) &mem_objects->front(): nullptr, + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_RELEASE_GL_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } +#endif + +/** + * Deprecated APIs for 1.2 + */ +#if defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) + CL_API_PREFIX__VERSION_1_1_DEPRECATED + cl_int enqueueBarrier() const CL_API_SUFFIX__VERSION_1_1_DEPRECATED + { + return detail::errHandler( + ::clEnqueueBarrier(object_), + __ENQUEUE_BARRIER_ERR); + } +#endif // CL_USE_DEPRECATED_OPENCL_1_1_APIS + + cl_int flush() const + { + return detail::errHandler(::clFlush(object_), __FLUSH_ERR); + } + + cl_int finish() const + { + return detail::errHandler(::clFinish(object_), __FINISH_ERR); + } + +#ifdef cl_khr_external_memory + cl_int enqueueAcquireExternalMemObjects( + const vector& mem_objects, + const vector* events_wait = nullptr, + Event *event = nullptr) + { + cl_int err = CL_INVALID_OPERATION; + cl_event tmp; + + std::call_once(ext_memory_initialized_, initMemoryExtension, this->getInfo()); + + if (pfn_clEnqueueAcquireExternalMemObjectsKHR) + { + err = pfn_clEnqueueAcquireExternalMemObjectsKHR( + object_, + static_cast(mem_objects.size()), + (mem_objects.size() > 0) ? reinterpret_cast(mem_objects.data()) : nullptr, + (events_wait != nullptr) ? static_cast(events_wait->size()) : 0, + (events_wait != nullptr && events_wait->size() > 0) ? reinterpret_cast(events_wait->data()) : nullptr, + &tmp); + } + + detail::errHandler(err, __ENQUEUE_ACQUIRE_EXTERNAL_MEMORY_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } + + cl_int enqueueReleaseExternalMemObjects( + const vector& mem_objects, + const vector* events_wait = nullptr, + Event *event = nullptr) + { + cl_int err = CL_INVALID_OPERATION; + cl_event tmp; + + std::call_once(ext_memory_initialized_, initMemoryExtension, this->getInfo()); + + if (pfn_clEnqueueReleaseExternalMemObjectsKHR) + { + err = pfn_clEnqueueReleaseExternalMemObjectsKHR( + object_, + static_cast(mem_objects.size()), + (mem_objects.size() > 0) ? reinterpret_cast(mem_objects.data()) : nullptr, + (events_wait != nullptr) ? static_cast(events_wait->size()) : 0, + (events_wait != nullptr && events_wait->size() > 0) ? reinterpret_cast(events_wait->data()) : nullptr, + &tmp); + } + + detail::errHandler(err, __ENQUEUE_RELEASE_EXTERNAL_MEMORY_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; + } +#endif // cl_khr_external_memory && CL_HPP_TARGET_OPENCL_VERSION >= 300 + +#ifdef cl_khr_semaphore + cl_int enqueueWaitSemaphores( + const vector &sema_objects, + const vector &sema_payloads = {}, + const vector* events_wait_list = nullptr, + Event *event = nullptr) const; + + cl_int enqueueSignalSemaphores( + const vector &sema_objects, + const vector& sema_payloads = {}, + const vector* events_wait_list = nullptr, + Event* event = nullptr); +#endif // cl_khr_semaphore +}; // CommandQueue + +#ifdef cl_khr_external_memory +CL_HPP_DEFINE_STATIC_MEMBER_ std::once_flag CommandQueue::ext_memory_initialized_; +#endif + +CL_HPP_DEFINE_STATIC_MEMBER_ std::once_flag CommandQueue::default_initialized_; +CL_HPP_DEFINE_STATIC_MEMBER_ CommandQueue CommandQueue::default_; +CL_HPP_DEFINE_STATIC_MEMBER_ cl_int CommandQueue::default_error_ = CL_SUCCESS; + + +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 +enum class DeviceQueueProperties : cl_command_queue_properties +{ + None = 0, + Profiling = CL_QUEUE_PROFILING_ENABLE, +}; + +inline DeviceQueueProperties operator|(DeviceQueueProperties lhs, DeviceQueueProperties rhs) +{ + return static_cast(static_cast(lhs) | static_cast(rhs)); +} + +/*! \class DeviceCommandQueue + * \brief DeviceCommandQueue interface for device cl_command_queues. + */ +class DeviceCommandQueue : public detail::Wrapper +{ +public: + + /*! + * Trivial empty constructor to create a null queue. + */ + DeviceCommandQueue() { } + + /*! + * Default construct device command queue on default context and device + */ + DeviceCommandQueue(DeviceQueueProperties properties, cl_int* err = nullptr) + { + cl_int error; + cl::Context context = cl::Context::getDefault(); + cl::Device device = cl::Device::getDefault(); + + cl_command_queue_properties mergedProperties = + CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE | static_cast(properties); + + cl_queue_properties queue_properties[] = { + CL_QUEUE_PROPERTIES, mergedProperties, 0 }; + object_ = ::clCreateCommandQueueWithProperties( + context(), device(), queue_properties, &error); + + detail::errHandler(error, __CREATE_COMMAND_QUEUE_WITH_PROPERTIES_ERR); + if (err != nullptr) { + *err = error; + } + } + + /*! + * Create a device command queue for a specified device in the passed context. + */ + DeviceCommandQueue( + const Context& context, + const Device& device, + DeviceQueueProperties properties = DeviceQueueProperties::None, + cl_int* err = nullptr) + { + cl_int error; + + cl_command_queue_properties mergedProperties = + CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE | static_cast(properties); + cl_queue_properties queue_properties[] = { + CL_QUEUE_PROPERTIES, mergedProperties, 0 }; + object_ = ::clCreateCommandQueueWithProperties( + context(), device(), queue_properties, &error); + + detail::errHandler(error, __CREATE_COMMAND_QUEUE_WITH_PROPERTIES_ERR); + if (err != nullptr) { + *err = error; + } + } + + /*! + * Create a device command queue for a specified device in the passed context. + */ + DeviceCommandQueue( + const Context& context, + const Device& device, + cl_uint queueSize, + DeviceQueueProperties properties = DeviceQueueProperties::None, + cl_int* err = nullptr) + { + cl_int error; + + cl_command_queue_properties mergedProperties = + CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE | static_cast(properties); + cl_queue_properties queue_properties[] = { + CL_QUEUE_PROPERTIES, mergedProperties, + CL_QUEUE_SIZE, queueSize, + 0 }; + object_ = ::clCreateCommandQueueWithProperties( + context(), device(), queue_properties, &error); + + detail::errHandler(error, __CREATE_COMMAND_QUEUE_WITH_PROPERTIES_ERR); + if (err != nullptr) { + *err = error; + } + } + + /*! \brief Constructor from cl_command_queue - takes ownership. + * + * \param retainObject will cause the constructor to retain its cl object. + * Defaults to false to maintain compatibility with + * earlier versions. + */ + explicit DeviceCommandQueue(const cl_command_queue& commandQueue, bool retainObject = false) : + detail::Wrapper(commandQueue, retainObject) { } + + DeviceCommandQueue& operator = (const cl_command_queue& rhs) + { + detail::Wrapper::operator=(rhs); + return *this; + } + + template + cl_int getInfo(cl_command_queue_info name, T* param) const + { + return detail::errHandler( + detail::getInfo( + &::clGetCommandQueueInfo, object_, name, param), + __GET_COMMAND_QUEUE_INFO_ERR); + } + + template typename + detail::param_traits::param_type + getInfo(cl_int* err = nullptr) const + { + typename detail::param_traits< + detail::cl_command_queue_info, name>::param_type param; + cl_int result = getInfo(name, ¶m); + if (err != nullptr) { + *err = result; + } + return param; + } + + /*! + * Create a new default device command queue for the default device, + * in the default context and of the default size. + * If there is already a default queue for the specified device this + * function will return the pre-existing queue. + */ + static DeviceCommandQueue makeDefault( + cl_int *err = nullptr) + { + cl_int error; + cl::Context context = cl::Context::getDefault(); + cl::Device device = cl::Device::getDefault(); + + cl_command_queue_properties properties = + CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE | CL_QUEUE_ON_DEVICE_DEFAULT; + cl_queue_properties queue_properties[] = { + CL_QUEUE_PROPERTIES, properties, + 0 }; + DeviceCommandQueue deviceQueue( + ::clCreateCommandQueueWithProperties( + context(), device(), queue_properties, &error)); + + detail::errHandler(error, __CREATE_COMMAND_QUEUE_WITH_PROPERTIES_ERR); + if (err != nullptr) { + *err = error; + } + + return deviceQueue; + } + + /*! + * Create a new default device command queue for the specified device + * and of the default size. + * If there is already a default queue for the specified device this + * function will return the pre-existing queue. + */ + static DeviceCommandQueue makeDefault( + const Context &context, const Device &device, cl_int *err = nullptr) + { + cl_int error; + + cl_command_queue_properties properties = + CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE | CL_QUEUE_ON_DEVICE_DEFAULT; + cl_queue_properties queue_properties[] = { + CL_QUEUE_PROPERTIES, properties, + 0 }; + DeviceCommandQueue deviceQueue( + ::clCreateCommandQueueWithProperties( + context(), device(), queue_properties, &error)); + + detail::errHandler(error, __CREATE_COMMAND_QUEUE_WITH_PROPERTIES_ERR); + if (err != nullptr) { + *err = error; + } + + return deviceQueue; + } + + /*! + * Create a new default device command queue for the specified device + * and of the requested size in bytes. + * If there is already a default queue for the specified device this + * function will return the pre-existing queue. + */ + static DeviceCommandQueue makeDefault( + const Context &context, const Device &device, cl_uint queueSize, cl_int *err = nullptr) + { + cl_int error; + + cl_command_queue_properties properties = + CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_ON_DEVICE | CL_QUEUE_ON_DEVICE_DEFAULT; + cl_queue_properties queue_properties[] = { + CL_QUEUE_PROPERTIES, properties, + CL_QUEUE_SIZE, queueSize, + 0 }; + DeviceCommandQueue deviceQueue( + ::clCreateCommandQueueWithProperties( + context(), device(), queue_properties, &error)); + + detail::errHandler(error, __CREATE_COMMAND_QUEUE_WITH_PROPERTIES_ERR); + if (err != nullptr) { + *err = error; + } + + return deviceQueue; + } + + + +#if CL_HPP_TARGET_OPENCL_VERSION >= 210 + /*! + * Modify the default device command queue to be used for subsequent kernels. + * This can update the default command queue for a device repeatedly to account + * for kernels that rely on the default. + * @return updated default device command queue. + */ + static DeviceCommandQueue updateDefault(const Context &context, const Device &device, const DeviceCommandQueue &default_queue, cl_int *err = nullptr) + { + cl_int error; + error = clSetDefaultDeviceCommandQueue(context.get(), device.get(), default_queue.get()); + + detail::errHandler(error, __SET_DEFAULT_DEVICE_COMMAND_QUEUE_ERR); + if (err != nullptr) { + *err = error; + } + return default_queue; + } + + /*! + * Return the current default command queue for the specified command queue + */ + static DeviceCommandQueue getDefault(const CommandQueue &queue, cl_int * err = nullptr) + { + return queue.getInfo(err); + } + +#endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 210 +}; // DeviceCommandQueue + +namespace detail +{ + // Specialization for device command queue + template <> + struct KernelArgumentHandler + { + static size_type size(const cl::DeviceCommandQueue&) { return sizeof(cl_command_queue); } + static const cl_command_queue* ptr(const cl::DeviceCommandQueue& value) { return &(value()); } + }; +} // namespace detail + +#endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 200 + + +template< typename IteratorType > +Buffer::Buffer( + const Context &context, + IteratorType startIterator, + IteratorType endIterator, + bool readOnly, + bool useHostPtr, + cl_int* err) +{ + typedef typename std::iterator_traits::value_type DataType; + cl_int error; + + cl_mem_flags flags = 0; + if( readOnly ) { + flags |= CL_MEM_READ_ONLY; + } + else { + flags |= CL_MEM_READ_WRITE; + } + if( useHostPtr ) { + flags |= CL_MEM_USE_HOST_PTR; + } + + size_type size = sizeof(DataType)*(endIterator - startIterator); + + if( useHostPtr ) { + object_ = ::clCreateBuffer(context(), flags, size, const_cast(&*startIterator), &error); + } else { + object_ = ::clCreateBuffer(context(), flags, size, 0, &error); + } + + detail::errHandler(error, __CREATE_BUFFER_ERR); + if (err != nullptr) { + *err = error; + } + + if( !useHostPtr ) { + CommandQueue queue(context, 0, &error); + detail::errHandler(error, __CREATE_BUFFER_ERR); + if (err != nullptr) { + *err = error; + } + + error = cl::copy(queue, startIterator, endIterator, *this); + detail::errHandler(error, __CREATE_BUFFER_ERR); + if (err != nullptr) { + *err = error; + } + } +} + +template< typename IteratorType > +Buffer::Buffer( + const CommandQueue &queue, + IteratorType startIterator, + IteratorType endIterator, + bool readOnly, + bool useHostPtr, + cl_int* err) +{ + typedef typename std::iterator_traits::value_type DataType; + cl_int error; + + cl_mem_flags flags = 0; + if (readOnly) { + flags |= CL_MEM_READ_ONLY; + } + else { + flags |= CL_MEM_READ_WRITE; + } + if (useHostPtr) { + flags |= CL_MEM_USE_HOST_PTR; + } + + size_type size = sizeof(DataType)*(endIterator - startIterator); + + Context context = queue.getInfo(); + + if (useHostPtr) { + object_ = ::clCreateBuffer(context(), flags, size, const_cast(&*startIterator), &error); + } + else { + object_ = ::clCreateBuffer(context(), flags, size, 0, &error); + } + + detail::errHandler(error, __CREATE_BUFFER_ERR); + if (err != nullptr) { + *err = error; + } + + if (!useHostPtr) { + error = cl::copy(queue, startIterator, endIterator, *this); + detail::errHandler(error, __CREATE_BUFFER_ERR); + if (err != nullptr) { + *err = error; + } + } +} + +inline cl_int enqueueReadBuffer( + const Buffer& buffer, + cl_bool blocking, + size_type offset, + size_type size, + void* ptr, + const vector* events = nullptr, + Event* event = nullptr) +{ + cl_int error; + CommandQueue queue = CommandQueue::getDefault(&error); + + if (error != CL_SUCCESS) { + return error; + } + + return queue.enqueueReadBuffer(buffer, blocking, offset, size, ptr, events, event); +} + +inline cl_int enqueueWriteBuffer( + const Buffer& buffer, + cl_bool blocking, + size_type offset, + size_type size, + const void* ptr, + const vector* events = nullptr, + Event* event = nullptr) +{ + cl_int error; + CommandQueue queue = CommandQueue::getDefault(&error); + + if (error != CL_SUCCESS) { + return error; + } + + return queue.enqueueWriteBuffer(buffer, blocking, offset, size, ptr, events, event); +} + +inline void* enqueueMapBuffer( + const Buffer& buffer, + cl_bool blocking, + cl_map_flags flags, + size_type offset, + size_type size, + const vector* events = nullptr, + Event* event = nullptr, + cl_int* err = nullptr) +{ + cl_int error; + CommandQueue queue = CommandQueue::getDefault(&error); + detail::errHandler(error, __ENQUEUE_MAP_BUFFER_ERR); + if (err != nullptr) { + *err = error; + } + + void * result = ::clEnqueueMapBuffer( + queue(), buffer(), blocking, flags, offset, size, + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, + (cl_event*) event, + &error); + + detail::errHandler(error, __ENQUEUE_MAP_BUFFER_ERR); + if (err != nullptr) { + *err = error; + } + return result; +} + + +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 +/** + * Enqueues to the default queue a command that will allow the host to + * update a region of a coarse-grained SVM buffer. + * This variant takes a raw SVM pointer. + */ +template +inline cl_int enqueueMapSVM( + T* ptr, + cl_bool blocking, + cl_map_flags flags, + size_type size, + const vector* events, + Event* event) +{ + cl_int error; + CommandQueue queue = CommandQueue::getDefault(&error); + if (error != CL_SUCCESS) { + return detail::errHandler(error, __ENQUEUE_MAP_SVM_ERR); + } + + return queue.enqueueMapSVM( + ptr, blocking, flags, size, events, event); +} + +/** + * Enqueues to the default queue a command that will allow the host to + * update a region of a coarse-grained SVM buffer. + * This variant takes a cl::pointer instance. + */ +template +inline cl_int enqueueMapSVM( + cl::pointer &ptr, + cl_bool blocking, + cl_map_flags flags, + size_type size, + const vector* events = nullptr, + Event* event = nullptr) +{ + cl_int error; + CommandQueue queue = CommandQueue::getDefault(&error); + if (error != CL_SUCCESS) { + return detail::errHandler(error, __ENQUEUE_MAP_BUFFER_ERR); + } + + return queue.enqueueMapSVM( + ptr, blocking, flags, size, events, event); +} + +/** + * Enqueues to the default queue a command that will allow the host to + * update a region of a coarse-grained SVM buffer. + * This variant takes a cl::vector instance. + */ +template +inline cl_int enqueueMapSVM( + cl::vector &container, + cl_bool blocking, + cl_map_flags flags, + const vector* events = nullptr, + Event* event = nullptr) +{ + cl_int error; + CommandQueue queue = CommandQueue::getDefault(&error); + if (error != CL_SUCCESS) { + return detail::errHandler(error, __ENQUEUE_MAP_SVM_ERR); + } + + return queue.enqueueMapSVM( + container, blocking, flags, events, event); +} + +#endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 200 + +inline cl_int enqueueUnmapMemObject( + const Memory& memory, + void* mapped_ptr, + const vector* events = nullptr, + Event* event = nullptr) +{ + cl_int error; + CommandQueue queue = CommandQueue::getDefault(&error); + detail::errHandler(error, __ENQUEUE_MAP_BUFFER_ERR); + if (error != CL_SUCCESS) { + return error; + } + + cl_event tmp; + cl_int err = detail::errHandler( + ::clEnqueueUnmapMemObject( + queue(), memory(), mapped_ptr, + (events != nullptr) ? (cl_uint)events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*)&events->front() : nullptr, + (event != nullptr) ? &tmp : nullptr), + __ENQUEUE_UNMAP_MEM_OBJECT_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; +} + +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 +/** + * Enqueues to the default queue a command that will release a coarse-grained + * SVM buffer back to the OpenCL runtime. + * This variant takes a raw SVM pointer. + */ +template +inline cl_int enqueueUnmapSVM( + T* ptr, + const vector* events = nullptr, + Event* event = nullptr) +{ + cl_int error; + CommandQueue queue = CommandQueue::getDefault(&error); + if (error != CL_SUCCESS) { + return detail::errHandler(error, __ENQUEUE_UNMAP_SVM_ERR); + } + + return detail::errHandler(queue.enqueueUnmapSVM(ptr, events, event), + __ENQUEUE_UNMAP_SVM_ERR); + +} + +/** + * Enqueues to the default queue a command that will release a coarse-grained + * SVM buffer back to the OpenCL runtime. + * This variant takes a cl::pointer instance. + */ +template +inline cl_int enqueueUnmapSVM( + cl::pointer &ptr, + const vector* events = nullptr, + Event* event = nullptr) +{ + cl_int error; + CommandQueue queue = CommandQueue::getDefault(&error); + if (error != CL_SUCCESS) { + return detail::errHandler(error, __ENQUEUE_UNMAP_SVM_ERR); + } + + return detail::errHandler(queue.enqueueUnmapSVM(ptr, events, event), + __ENQUEUE_UNMAP_SVM_ERR); +} + +/** + * Enqueues to the default queue a command that will release a coarse-grained + * SVM buffer back to the OpenCL runtime. + * This variant takes a cl::vector instance. + */ +template +inline cl_int enqueueUnmapSVM( + cl::vector &container, + const vector* events = nullptr, + Event* event = nullptr) +{ + cl_int error; + CommandQueue queue = CommandQueue::getDefault(&error); + if (error != CL_SUCCESS) { + return detail::errHandler(error, __ENQUEUE_UNMAP_SVM_ERR); + } + + return detail::errHandler(queue.enqueueUnmapSVM(container, events, event), + __ENQUEUE_UNMAP_SVM_ERR); +} + +#endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 200 + +inline cl_int enqueueCopyBuffer( + const Buffer& src, + const Buffer& dst, + size_type src_offset, + size_type dst_offset, + size_type size, + const vector* events = nullptr, + Event* event = nullptr) +{ + cl_int error; + CommandQueue queue = CommandQueue::getDefault(&error); + + if (error != CL_SUCCESS) { + return error; + } + + return queue.enqueueCopyBuffer(src, dst, src_offset, dst_offset, size, events, event); +} + +/** + * Blocking copy operation between iterators and a buffer. + * Host to Device. + * Uses default command queue. + */ +template< typename IteratorType > +inline cl_int copy( IteratorType startIterator, IteratorType endIterator, cl::Buffer &buffer ) +{ + cl_int error; + CommandQueue queue = CommandQueue::getDefault(&error); + if (error != CL_SUCCESS) + return error; + + return cl::copy(queue, startIterator, endIterator, buffer); +} + +/** + * Blocking copy operation between iterators and a buffer. + * Device to Host. + * Uses default command queue. + */ +template< typename IteratorType > +inline cl_int copy( const cl::Buffer &buffer, IteratorType startIterator, IteratorType endIterator ) +{ + cl_int error; + CommandQueue queue = CommandQueue::getDefault(&error); + if (error != CL_SUCCESS) + return error; + + return cl::copy(queue, buffer, startIterator, endIterator); +} + +/** + * Blocking copy operation between iterators and a buffer. + * Host to Device. + * Uses specified queue. + */ +template< typename IteratorType > +inline cl_int copy( const CommandQueue &queue, IteratorType startIterator, IteratorType endIterator, cl::Buffer &buffer ) +{ + typedef typename std::iterator_traits::value_type DataType; + cl_int error; + + size_type length = endIterator-startIterator; + size_type byteLength = length*sizeof(DataType); + + DataType *pointer = + static_cast(queue.enqueueMapBuffer(buffer, CL_TRUE, CL_MAP_WRITE, 0, byteLength, 0, 0, &error)); + // if exceptions enabled, enqueueMapBuffer will throw + if( error != CL_SUCCESS ) { + return error; + } +#if defined(_MSC_VER) + std::copy( + startIterator, + endIterator, + stdext::checked_array_iterator( + pointer, length)); +#else + std::copy(startIterator, endIterator, pointer); +#endif + Event endEvent; + error = queue.enqueueUnmapMemObject(buffer, pointer, 0, &endEvent); + // if exceptions enabled, enqueueUnmapMemObject will throw + if( error != CL_SUCCESS ) { + return error; + } + endEvent.wait(); + return CL_SUCCESS; +} + +/** + * Blocking copy operation between iterators and a buffer. + * Device to Host. + * Uses specified queue. + */ +template< typename IteratorType > +inline cl_int copy( const CommandQueue &queue, const cl::Buffer &buffer, IteratorType startIterator, IteratorType endIterator ) +{ + typedef typename std::iterator_traits::value_type DataType; + cl_int error; + + size_type length = endIterator-startIterator; + size_type byteLength = length*sizeof(DataType); + + DataType *pointer = + static_cast(queue.enqueueMapBuffer(buffer, CL_TRUE, CL_MAP_READ, 0, byteLength, 0, 0, &error)); + // if exceptions enabled, enqueueMapBuffer will throw + if( error != CL_SUCCESS ) { + return error; + } + std::copy(pointer, pointer + length, startIterator); + Event endEvent; + error = queue.enqueueUnmapMemObject(buffer, pointer, 0, &endEvent); + // if exceptions enabled, enqueueUnmapMemObject will throw + if( error != CL_SUCCESS ) { + return error; + } + endEvent.wait(); + return CL_SUCCESS; +} + + +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 +/** + * Blocking SVM map operation - performs a blocking map underneath. + */ +template +inline cl_int mapSVM(cl::vector &container) +{ + return enqueueMapSVM(container, CL_TRUE, CL_MAP_READ | CL_MAP_WRITE); +} + +/** +* Blocking SVM map operation - performs a blocking map underneath. +*/ +template +inline cl_int unmapSVM(cl::vector &container) +{ + return enqueueUnmapSVM(container); +} + +#endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 200 + +#if CL_HPP_TARGET_OPENCL_VERSION >= 110 +inline cl_int enqueueReadBufferRect( + const Buffer& buffer, + cl_bool blocking, + const array& buffer_offset, + const array& host_offset, + const array& region, + size_type buffer_row_pitch, + size_type buffer_slice_pitch, + size_type host_row_pitch, + size_type host_slice_pitch, + void *ptr, + const vector* events = nullptr, + Event* event = nullptr) +{ + cl_int error; + CommandQueue queue = CommandQueue::getDefault(&error); + + if (error != CL_SUCCESS) { + return error; + } + + return queue.enqueueReadBufferRect( + buffer, + blocking, + buffer_offset, + host_offset, + region, + buffer_row_pitch, + buffer_slice_pitch, + host_row_pitch, + host_slice_pitch, + ptr, + events, + event); +} + +inline cl_int enqueueReadBufferRect( + const Buffer& buffer, + cl_bool blocking, + const array& buffer_offset, + const array& host_offset, + const array& region, + size_type buffer_row_pitch, + size_type buffer_slice_pitch, + size_type host_row_pitch, + size_type host_slice_pitch, + void* ptr, + const vector* events = nullptr, + Event* event = nullptr) +{ + return enqueueReadBufferRect( + buffer, + blocking, + { buffer_offset[0], buffer_offset[1], 0 }, + { host_offset[0], host_offset[1], 0 }, + { region[0], region[1], 1 }, + buffer_row_pitch, + buffer_slice_pitch, + host_row_pitch, + host_slice_pitch, + ptr, + events, + event); +} + +inline cl_int enqueueWriteBufferRect( + const Buffer& buffer, + cl_bool blocking, + const array& buffer_offset, + const array& host_offset, + const array& region, + size_type buffer_row_pitch, + size_type buffer_slice_pitch, + size_type host_row_pitch, + size_type host_slice_pitch, + const void *ptr, + const vector* events = nullptr, + Event* event = nullptr) +{ + cl_int error; + CommandQueue queue = CommandQueue::getDefault(&error); + + if (error != CL_SUCCESS) { + return error; + } + + return queue.enqueueWriteBufferRect( + buffer, + blocking, + buffer_offset, + host_offset, + region, + buffer_row_pitch, + buffer_slice_pitch, + host_row_pitch, + host_slice_pitch, + ptr, + events, + event); +} + +inline cl_int enqueueWriteBufferRect( + const Buffer& buffer, + cl_bool blocking, + const array& buffer_offset, + const array& host_offset, + const array& region, + size_type buffer_row_pitch, + size_type buffer_slice_pitch, + size_type host_row_pitch, + size_type host_slice_pitch, + const void* ptr, + const vector* events = nullptr, + Event* event = nullptr) +{ + return enqueueWriteBufferRect( + buffer, + blocking, + { buffer_offset[0], buffer_offset[1], 0 }, + { host_offset[0], host_offset[1], 0 }, + { region[0], region[1], 1 }, + buffer_row_pitch, + buffer_slice_pitch, + host_row_pitch, + host_slice_pitch, + ptr, + events, + event); +} + +inline cl_int enqueueCopyBufferRect( + const Buffer& src, + const Buffer& dst, + const array& src_origin, + const array& dst_origin, + const array& region, + size_type src_row_pitch, + size_type src_slice_pitch, + size_type dst_row_pitch, + size_type dst_slice_pitch, + const vector* events = nullptr, + Event* event = nullptr) +{ + cl_int error; + CommandQueue queue = CommandQueue::getDefault(&error); + + if (error != CL_SUCCESS) { + return error; + } + + return queue.enqueueCopyBufferRect( + src, + dst, + src_origin, + dst_origin, + region, + src_row_pitch, + src_slice_pitch, + dst_row_pitch, + dst_slice_pitch, + events, + event); +} + +inline cl_int enqueueCopyBufferRect( + const Buffer& src, + const Buffer& dst, + const array& src_origin, + const array& dst_origin, + const array& region, + size_type src_row_pitch, + size_type src_slice_pitch, + size_type dst_row_pitch, + size_type dst_slice_pitch, + const vector* events = nullptr, + Event* event = nullptr) +{ + return enqueueCopyBufferRect( + src, + dst, + { src_origin[0], src_origin[1], 0 }, + { dst_origin[0], dst_origin[1], 0 }, + { region[0], region[1], 1 }, + src_row_pitch, + src_slice_pitch, + dst_row_pitch, + dst_slice_pitch, + events, + event); +} +#endif // CL_HPP_TARGET_OPENCL_VERSION >= 110 + +inline cl_int enqueueReadImage( + const Image& image, + cl_bool blocking, + const array& origin, + const array& region, + size_type row_pitch, + size_type slice_pitch, + void* ptr, + const vector* events = nullptr, + Event* event = nullptr) +{ + cl_int error; + CommandQueue queue = CommandQueue::getDefault(&error); + + if (error != CL_SUCCESS) { + return error; + } + + return queue.enqueueReadImage( + image, + blocking, + origin, + region, + row_pitch, + slice_pitch, + ptr, + events, + event); +} + +inline cl_int enqueueReadImage( + const Image& image, + cl_bool blocking, + const array& origin, + const array& region, + size_type row_pitch, + size_type slice_pitch, + void* ptr, + const vector* events = nullptr, + Event* event = nullptr) +{ + return enqueueReadImage( + image, + blocking, + { origin[0], origin[1], 0 }, + { region[0], region[1], 1 }, + row_pitch, + slice_pitch, + ptr, + events, + event); +} + +inline cl_int enqueueWriteImage( + const Image& image, + cl_bool blocking, + const array& origin, + const array& region, + size_type row_pitch, + size_type slice_pitch, + const void* ptr, + const vector* events = nullptr, + Event* event = nullptr) +{ + cl_int error; + CommandQueue queue = CommandQueue::getDefault(&error); + + if (error != CL_SUCCESS) { + return error; + } + + return queue.enqueueWriteImage( + image, + blocking, + origin, + region, + row_pitch, + slice_pitch, + ptr, + events, + event); +} + +inline cl_int enqueueWriteImage( + const Image& image, + cl_bool blocking, + const array& origin, + const array& region, + size_type row_pitch, + size_type slice_pitch, + const void* ptr, + const vector* events = nullptr, + Event* event = nullptr) +{ + return enqueueWriteImage( + image, + blocking, + { origin[0], origin[1], 0 }, + { region[0], region[1], 1 }, + row_pitch, + slice_pitch, + ptr, + events, + event); +} + +inline cl_int enqueueCopyImage( + const Image& src, + const Image& dst, + const array& src_origin, + const array& dst_origin, + const array& region, + const vector* events = nullptr, + Event* event = nullptr) +{ + cl_int error; + CommandQueue queue = CommandQueue::getDefault(&error); + + if (error != CL_SUCCESS) { + return error; + } + + return queue.enqueueCopyImage( + src, + dst, + src_origin, + dst_origin, + region, + events, + event); +} + +inline cl_int enqueueCopyImage( + const Image& src, + const Image& dst, + const array& src_origin, + const array& dst_origin, + const array& region, + const vector* events = nullptr, + Event* event = nullptr) +{ + return enqueueCopyImage( + src, + dst, + { src_origin[0], src_origin[1], 0 }, + { dst_origin[0], dst_origin[1], 0 }, + { region[0], region[1], 1 }, + events, + event); +} + +inline cl_int enqueueCopyImageToBuffer( + const Image& src, + const Buffer& dst, + const array& src_origin, + const array& region, + size_type dst_offset, + const vector* events = nullptr, + Event* event = nullptr) +{ + cl_int error; + CommandQueue queue = CommandQueue::getDefault(&error); + + if (error != CL_SUCCESS) { + return error; + } + + return queue.enqueueCopyImageToBuffer( + src, + dst, + src_origin, + region, + dst_offset, + events, + event); +} + +inline cl_int enqueueCopyImageToBuffer( + const Image& src, + const Buffer& dst, + const array& src_origin, + const array& region, + size_type dst_offset, + const vector* events = nullptr, + Event* event = nullptr) +{ + return enqueueCopyImageToBuffer( + src, + dst, + { src_origin[0], src_origin[1], 0 }, + { region[0], region[1], 1 }, + dst_offset, + events, + event); +} + +inline cl_int enqueueCopyBufferToImage( + const Buffer& src, + const Image& dst, + size_type src_offset, + const array& dst_origin, + const array& region, + const vector* events = nullptr, + Event* event = nullptr) +{ + cl_int error; + CommandQueue queue = CommandQueue::getDefault(&error); + + if (error != CL_SUCCESS) { + return error; + } + + return queue.enqueueCopyBufferToImage( + src, + dst, + src_offset, + dst_origin, + region, + events, + event); +} + +inline cl_int enqueueCopyBufferToImage( + const Buffer& src, + const Image& dst, + size_type src_offset, + const array& dst_origin, + const array& region, + const vector* events = nullptr, + Event* event = nullptr) +{ + cl_int error; + CommandQueue queue = CommandQueue::getDefault(&error); + + if (error != CL_SUCCESS) { + return error; + } + + return enqueueCopyBufferToImage( + src, + dst, + src_offset, + { dst_origin[0], dst_origin[1], 0 }, + { region[0], region[1], 1 }, + events, + event); +} + +inline cl_int flush(void) +{ + cl_int error; + CommandQueue queue = CommandQueue::getDefault(&error); + + if (error != CL_SUCCESS) { + return error; + } + + return queue.flush(); +} + +inline cl_int finish(void) +{ + cl_int error; + CommandQueue queue = CommandQueue::getDefault(&error); + + if (error != CL_SUCCESS) { + return error; + } + + + return queue.finish(); +} + +class EnqueueArgs +{ +private: + CommandQueue queue_; + const NDRange offset_; + const NDRange global_; + const NDRange local_; + vector events_; + + template + friend class KernelFunctor; + +public: + EnqueueArgs(NDRange global) : + queue_(CommandQueue::getDefault()), + offset_(NullRange), + global_(global), + local_(NullRange) + { + + } + + EnqueueArgs(NDRange global, NDRange local) : + queue_(CommandQueue::getDefault()), + offset_(NullRange), + global_(global), + local_(local) + { + + } + + EnqueueArgs(NDRange offset, NDRange global, NDRange local) : + queue_(CommandQueue::getDefault()), + offset_(offset), + global_(global), + local_(local) + { + + } + + EnqueueArgs(Event e, NDRange global) : + queue_(CommandQueue::getDefault()), + offset_(NullRange), + global_(global), + local_(NullRange) + { + events_.push_back(e); + } + + EnqueueArgs(Event e, NDRange global, NDRange local) : + queue_(CommandQueue::getDefault()), + offset_(NullRange), + global_(global), + local_(local) + { + events_.push_back(e); + } + + EnqueueArgs(Event e, NDRange offset, NDRange global, NDRange local) : + queue_(CommandQueue::getDefault()), + offset_(offset), + global_(global), + local_(local) + { + events_.push_back(e); + } + + EnqueueArgs(const vector &events, NDRange global) : + queue_(CommandQueue::getDefault()), + offset_(NullRange), + global_(global), + local_(NullRange), + events_(events) + { + + } + + EnqueueArgs(const vector &events, NDRange global, NDRange local) : + queue_(CommandQueue::getDefault()), + offset_(NullRange), + global_(global), + local_(local), + events_(events) + { + + } + + EnqueueArgs(const vector &events, NDRange offset, NDRange global, NDRange local) : + queue_(CommandQueue::getDefault()), + offset_(offset), + global_(global), + local_(local), + events_(events) + { + + } + + EnqueueArgs(CommandQueue &queue, NDRange global) : + queue_(queue), + offset_(NullRange), + global_(global), + local_(NullRange) + { + + } + + EnqueueArgs(CommandQueue &queue, NDRange global, NDRange local) : + queue_(queue), + offset_(NullRange), + global_(global), + local_(local) + { + + } + + EnqueueArgs(CommandQueue &queue, NDRange offset, NDRange global, NDRange local) : + queue_(queue), + offset_(offset), + global_(global), + local_(local) + { + + } + + EnqueueArgs(CommandQueue &queue, Event e, NDRange global) : + queue_(queue), + offset_(NullRange), + global_(global), + local_(NullRange) + { + events_.push_back(e); + } + + EnqueueArgs(CommandQueue &queue, Event e, NDRange global, NDRange local) : + queue_(queue), + offset_(NullRange), + global_(global), + local_(local) + { + events_.push_back(e); + } + + EnqueueArgs(CommandQueue &queue, Event e, NDRange offset, NDRange global, NDRange local) : + queue_(queue), + offset_(offset), + global_(global), + local_(local) + { + events_.push_back(e); + } + + EnqueueArgs(CommandQueue &queue, const vector &events, NDRange global) : + queue_(queue), + offset_(NullRange), + global_(global), + local_(NullRange), + events_(events) + { + + } + + EnqueueArgs(CommandQueue &queue, const vector &events, NDRange global, NDRange local) : + queue_(queue), + offset_(NullRange), + global_(global), + local_(local), + events_(events) + { + + } + + EnqueueArgs(CommandQueue &queue, const vector &events, NDRange offset, NDRange global, NDRange local) : + queue_(queue), + offset_(offset), + global_(global), + local_(local), + events_(events) + { + + } +}; + + +//---------------------------------------------------------------------------------------------- + + +/** + * Type safe kernel functor. + * + */ +template +class KernelFunctor +{ +private: + Kernel kernel_; + + template + void setArgs(T0&& t0, T1s&&... t1s) + { + kernel_.setArg(index, t0); + setArgs(std::forward(t1s)...); + } + + template + void setArgs(T0&& t0) + { + kernel_.setArg(index, t0); + } + + template + void setArgs() + { + } + + +public: + KernelFunctor(Kernel kernel) : kernel_(kernel) + {} + + KernelFunctor( + const Program& program, + const string name, + cl_int * err = nullptr) : + kernel_(program, name.c_str(), err) + {} + + //! \brief Return type of the functor + typedef Event result_type; + + /** + * Enqueue kernel. + * @param args Launch parameters of the kernel. + * @param t0... List of kernel arguments based on the template type of the functor. + */ + Event operator() ( + const EnqueueArgs& args, + Ts... ts) + { + Event event; + setArgs<0>(std::forward(ts)...); + + args.queue_.enqueueNDRangeKernel( + kernel_, + args.offset_, + args.global_, + args.local_, + &args.events_, + &event); + + return event; + } + + /** + * Enqueue kernel with support for error code. + * @param args Launch parameters of the kernel. + * @param t0... List of kernel arguments based on the template type of the functor. + * @param error Out parameter returning the error code from the execution. + */ + Event operator() ( + const EnqueueArgs& args, + Ts... ts, + cl_int &error) + { + Event event; + setArgs<0>(std::forward(ts)...); + + error = args.queue_.enqueueNDRangeKernel( + kernel_, + args.offset_, + args.global_, + args.local_, + &args.events_, + &event); + + return event; + } + +#if CL_HPP_TARGET_OPENCL_VERSION >= 200 + cl_int setSVMPointers(const vector &pointerList) + { + return kernel_.setSVMPointers(pointerList); + } + + template + cl_int setSVMPointers(const T0 &t0, T1s &... ts) + { + return kernel_.setSVMPointers(t0, ts...); + } +#endif // #if CL_HPP_TARGET_OPENCL_VERSION >= 200 + + Kernel getKernel() + { + return kernel_; + } +}; + +namespace compatibility { + /** + * Backward compatibility class to ensure that cl.hpp code works with opencl.hpp. + * Please use KernelFunctor directly. + */ + template + struct make_kernel + { + typedef KernelFunctor FunctorType; + + FunctorType functor_; + + make_kernel( + const Program& program, + const string name, + cl_int * err = nullptr) : + functor_(FunctorType(program, name, err)) + {} + + make_kernel( + const Kernel kernel) : + functor_(FunctorType(kernel)) + {} + + //! \brief Return type of the functor + typedef Event result_type; + + //! \brief Function signature of kernel functor with no event dependency. + typedef Event type_( + const EnqueueArgs&, + Ts...); + + Event operator()( + const EnqueueArgs& enqueueArgs, + Ts... args) + { + return functor_( + enqueueArgs, args...); + } + }; +} // namespace compatibility + +#ifdef cl_khr_semaphore + +#ifdef cl_khr_external_semaphore +enum ExternalSemaphoreType : cl_external_semaphore_handle_type_khr +{ + None = 0, +#ifdef cl_khr_external_semaphore_dx_fence + D3D12Fence = CL_SEMAPHORE_HANDLE_D3D12_FENCE_KHR, +#endif +#ifdef cl_khr_external_semaphore_opaque_fd + OpaqueFd = CL_SEMAPHORE_HANDLE_OPAQUE_FD_KHR, +#endif +#ifdef cl_khr_external_semaphore_sync_fd + SyncFd = CL_SEMAPHORE_HANDLE_SYNC_FD_KHR, +#endif +#ifdef cl_khr_external_semaphore_win32 + OpaqueWin32 = CL_SEMAPHORE_HANDLE_OPAQUE_WIN32_KHR, + OpaqueWin32Kmt = CL_SEMAPHORE_HANDLE_OPAQUE_WIN32_KMT_KHR, +#endif // cl_khr_external_semaphore_win32 +}; +#endif // cl_khr_external_semaphore + +class Semaphore : public detail::Wrapper +{ +public: + Semaphore() : detail::Wrapper() {} + Semaphore( + const Context &context, + const vector& sema_props, + cl_int *err = nullptr) + { + /* initialization of addresses to extension functions (it is done only once) */ + std::call_once(ext_init_, initExtensions, context); + + cl_int error = CL_INVALID_OPERATION; + + if (pfn_clCreateSemaphoreWithPropertiesKHR) + { + object_ = pfn_clCreateSemaphoreWithPropertiesKHR( + context(), + sema_props.data(), + &error); + } + + detail::errHandler(error, __CREATE_SEMAPHORE_KHR_WITH_PROPERTIES_ERR); + + if (err != nullptr) { + *err = error; + } + } + Semaphore( + const vector& sema_props, + cl_int* err = nullptr):Semaphore(Context::getDefault(err), sema_props, err) {} + + explicit Semaphore(const cl_semaphore_khr& semaphore, bool retainObject = false) : + detail::Wrapper(semaphore, retainObject) {} + Semaphore& operator = (const cl_semaphore_khr& rhs) { + detail::Wrapper::operator=(rhs); + return *this; + } + template + cl_int getInfo(cl_semaphore_info_khr name, T* param) const + { + if (pfn_clGetSemaphoreInfoKHR == nullptr) { + return detail::errHandler(CL_INVALID_OPERATION, + __GET_SEMAPHORE_KHR_INFO_ERR); + } + + return detail::errHandler( + detail::getInfo(pfn_clGetSemaphoreInfoKHR, object_, name, param), + __GET_SEMAPHORE_KHR_INFO_ERR); + } + template typename + detail::param_traits::param_type + getInfo(cl_int* err = nullptr) const + { + typename detail::param_traits< + detail::cl_semaphore_info_khr, name>::param_type param; + cl_int result = getInfo(name, ¶m); + if (err != nullptr) { + *err = result; + } + return param; + } + +#ifdef cl_khr_external_semaphore + template + cl_int getHandleForTypeKHR( + const Device& device, cl_external_semaphore_handle_type_khr name, T* param) const + { + if (pfn_clGetSemaphoreHandleForTypeKHR == nullptr) { + return detail::errHandler(CL_INVALID_OPERATION, + __GET_SEMAPHORE_HANDLE_FOR_TYPE_KHR_ERR); + } + + return detail::errHandler( + detail::getInfo( + pfn_clGetSemaphoreHandleForTypeKHR, object_, device(), name, param), + __GET_SEMAPHORE_HANDLE_FOR_TYPE_KHR_ERR); + } + + template typename + detail::param_traits::param_type + getHandleForTypeKHR(const Device& device, cl_int* err = nullptr) const + { + typename detail::param_traits< + detail::cl_external_semaphore_handle_type_khr, type>::param_type param; + cl_int result = getHandleForTypeKHR(device, type, ¶m); + if (err != nullptr) { + *err = result; + } + return param; + } +#endif // cl_khr_external_semaphore + + cl_int retain() + { + if (pfn_clRetainSemaphoreKHR == nullptr) { + return detail::errHandler(CL_INVALID_OPERATION, + __RETAIN_SEMAPHORE_KHR_ERR); + } + return pfn_clRetainSemaphoreKHR(object_); + } + + cl_int release() + { + if (pfn_clReleaseSemaphoreKHR == nullptr) { + return detail::errHandler(CL_INVALID_OPERATION, + __RELEASE_SEMAPHORE_KHR_ERR); + } + return pfn_clReleaseSemaphoreKHR(object_); + } + +private: + static std::once_flag ext_init_; + + static void initExtensions(const Context& context) + { +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 + Device device = context.getInfo().at(0); + cl_platform_id platform = device.getInfo()(); + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clCreateSemaphoreWithPropertiesKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clReleaseSemaphoreKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clRetainSemaphoreKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clEnqueueWaitSemaphoresKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clEnqueueSignalSemaphoresKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clGetSemaphoreInfoKHR); +#ifdef cl_khr_external_semaphore + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clGetSemaphoreHandleForTypeKHR); +#endif // cl_khr_external_semaphore + +#else + CL_HPP_INIT_CL_EXT_FCN_PTR_(clCreateSemaphoreWithPropertiesKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_(clReleaseSemaphoreKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_(clRetainSemaphoreKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_(clEnqueueWaitSemaphoresKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_(clEnqueueSignalSemaphoresKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_(clGetSemaphoreInfoKHR); +#ifdef cl_khr_external_semaphore + CL_HPP_INIT_CL_EXT_FCN_PTR_(clGetSemaphoreHandleForTypeKHR); +#endif // cl_khr_external_semaphore + +#endif + if ((pfn_clCreateSemaphoreWithPropertiesKHR == nullptr) && + (pfn_clReleaseSemaphoreKHR == nullptr) && + (pfn_clRetainSemaphoreKHR == nullptr) && + (pfn_clEnqueueWaitSemaphoresKHR == nullptr) && + (pfn_clEnqueueSignalSemaphoresKHR == nullptr) && +#ifdef cl_khr_external_semaphore + (pfn_clGetSemaphoreHandleForTypeKHR == nullptr) && +#endif // cl_khr_external_semaphore + (pfn_clGetSemaphoreInfoKHR == nullptr)) + { + detail::errHandler(CL_INVALID_VALUE, __CREATE_SEMAPHORE_KHR_WITH_PROPERTIES_ERR); + } + } + +}; + +CL_HPP_DEFINE_STATIC_MEMBER_ std::once_flag Semaphore::ext_init_; + +inline cl_int CommandQueue::enqueueWaitSemaphores( + const vector &sema_objects, + const vector &sema_payloads, + const vector* events_wait_list, + Event *event) const +{ + cl_event tmp; + cl_int err = CL_INVALID_OPERATION; + + if (pfn_clEnqueueWaitSemaphoresKHR != nullptr) { + err = pfn_clEnqueueWaitSemaphoresKHR( + object_, + (cl_uint)sema_objects.size(), + (const cl_semaphore_khr *) &sema_objects.front(), + (sema_payloads.size() > 0) ? &sema_payloads.front() : nullptr, + (events_wait_list != nullptr) ? (cl_uint) events_wait_list->size() : 0, + (events_wait_list != nullptr && events_wait_list->size() > 0) ? (cl_event*) &events_wait_list->front() : nullptr, + (event != nullptr) ? &tmp : nullptr); + } + + detail::errHandler(err, __ENQUEUE_WAIT_SEMAPHORE_KHR_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; +} + +inline cl_int CommandQueue::enqueueSignalSemaphores( + const vector &sema_objects, + const vector& sema_payloads, + const vector* events_wait_list, + Event* event) +{ + cl_event tmp; + cl_int err = CL_INVALID_OPERATION; + + if (pfn_clEnqueueSignalSemaphoresKHR != nullptr) { + err = pfn_clEnqueueSignalSemaphoresKHR( + object_, + (cl_uint)sema_objects.size(), + (const cl_semaphore_khr*) &sema_objects.front(), + (sema_payloads.size() > 0) ? &sema_payloads.front() : nullptr, + (events_wait_list != nullptr) ? (cl_uint) events_wait_list->size() : 0, + (events_wait_list != nullptr && events_wait_list->size() > 0) ? (cl_event*) &events_wait_list->front() : nullptr, + (event != nullptr) ? &tmp : nullptr); + } + + detail::errHandler(err, __ENQUEUE_SIGNAL_SEMAPHORE_KHR_ERR); + + if (event != nullptr && err == CL_SUCCESS) + *event = tmp; + + return err; +} + +#endif // cl_khr_semaphore + +#if defined(cl_khr_command_buffer) +/*! \class CommandBufferKhr + * \brief CommandBufferKhr interface for cl_command_buffer_khr. + */ +class CommandBufferKhr : public detail::Wrapper +{ +public: + //! \brief Default constructor - initializes to nullptr. + CommandBufferKhr() : detail::Wrapper() { } + + explicit CommandBufferKhr(const vector &queues, + cl_command_buffer_properties_khr properties = 0, + cl_int* errcode_ret = nullptr) + { + cl_command_buffer_properties_khr command_buffer_properties[] = { + CL_COMMAND_BUFFER_FLAGS_KHR, properties, 0 + }; + + /* initialization of addresses to extension functions (it is done only once) */ + std::call_once(ext_init_, [&] { initExtensions(queues[0].getInfo()); }); + cl_int error = CL_INVALID_OPERATION; + + static_assert(sizeof(cl::CommandQueue) == sizeof(cl_command_queue), + "Size of cl::CommandQueue must be equal to size of cl_command_queue"); + + if (pfn_clCreateCommandBufferKHR) + { + object_ = pfn_clCreateCommandBufferKHR((cl_uint) queues.size(), + (cl_command_queue *) &queues.front(), + command_buffer_properties, + &error); + } + + detail::errHandler(error, __CREATE_COMMAND_BUFFER_KHR_ERR); + if (errcode_ret != nullptr) { + *errcode_ret = error; + } + } + + explicit CommandBufferKhr(const cl_command_buffer_khr& commandBufferKhr, bool retainObject = false) : + detail::Wrapper(commandBufferKhr, retainObject) { } + + CommandBufferKhr& operator=(const cl_command_buffer_khr& rhs) + { + detail::Wrapper::operator=(rhs); + return *this; + } + + template + cl_int getInfo(cl_command_buffer_info_khr name, T* param) const + { + if (pfn_clGetCommandBufferInfoKHR == nullptr) { + return detail::errHandler(CL_INVALID_OPERATION, + __GET_COMMAND_BUFFER_INFO_KHR_ERR); + } + return detail::errHandler( + detail::getInfo(pfn_clGetCommandBufferInfoKHR, object_, name, param), + __GET_COMMAND_BUFFER_INFO_KHR_ERR); + } + + template typename + detail::param_traits::param_type + getInfo(cl_int* err = nullptr) const + { + typename detail::param_traits< + detail::cl_command_buffer_info_khr, name>::param_type param; + cl_int result = getInfo(name, ¶m); + if (err != nullptr) { + *err = result; + } + return param; + } + + cl_int finalizeCommandBuffer() const + { + return detail::errHandler(::clFinalizeCommandBufferKHR(object_), __FINALIZE_COMMAND_BUFFER_KHR_ERR); + } + + cl_int enqueueCommandBuffer(vector &queues, + const vector* events = nullptr, + Event* event = nullptr) + { + if (pfn_clEnqueueCommandBufferKHR == nullptr) { + return detail::errHandler(CL_INVALID_OPERATION, + __ENQUEUE_COMMAND_BUFFER_KHR_ERR); + } + + static_assert(sizeof(cl::CommandQueue) == sizeof(cl_command_queue), + "Size of cl::CommandQueue must be equal to size of cl_command_queue"); + + return detail::errHandler(pfn_clEnqueueCommandBufferKHR((cl_uint) queues.size(), + (cl_command_queue *) &queues.front(), + object_, + (events != nullptr) ? (cl_uint) events->size() : 0, + (events != nullptr && events->size() > 0) ? (cl_event*) &events->front() : nullptr, + (cl_event*) event), + __ENQUEUE_COMMAND_BUFFER_KHR_ERR); + } + + cl_int commandBarrierWithWaitList(const vector* sync_points_vec = nullptr, + cl_sync_point_khr* sync_point = nullptr, + MutableCommandKhr* mutable_handle = nullptr, + const CommandQueue* command_queue = nullptr) + { + if (pfn_clCommandBarrierWithWaitListKHR == nullptr) { + return detail::errHandler(CL_INVALID_OPERATION, + __COMMAND_BARRIER_WITH_WAIT_LIST_KHR_ERR); + } + + cl_sync_point_khr tmp_sync_point; + cl_int error = detail::errHandler( + pfn_clCommandBarrierWithWaitListKHR(object_, + (command_queue != nullptr) ? (*command_queue)() : nullptr, + (sync_points_vec != nullptr) ? (cl_uint) sync_points_vec->size() : 0, + (sync_points_vec != nullptr && sync_points_vec->size() > 0) ? &sync_points_vec->front() : nullptr, + (sync_point != nullptr) ? &tmp_sync_point : nullptr, + (cl_mutable_command_khr*) mutable_handle), + __COMMAND_BARRIER_WITH_WAIT_LIST_KHR_ERR); + + if (sync_point != nullptr && error == CL_SUCCESS) + *sync_point = tmp_sync_point; + + return error; + } + + cl_int commandCopyBuffer(const Buffer& src, + const Buffer& dst, + size_type src_offset, + size_type dst_offset, + size_type size, + const vector* sync_points_vec = nullptr, + cl_sync_point_khr* sync_point = nullptr, + MutableCommandKhr* mutable_handle = nullptr, + const CommandQueue* command_queue = nullptr) + { + if (pfn_clCommandCopyBufferKHR == nullptr) { + return detail::errHandler(CL_INVALID_OPERATION, + __COMMAND_COPY_BUFFER_KHR_ERR); + } + + cl_sync_point_khr tmp_sync_point; + cl_int error = detail::errHandler( + pfn_clCommandCopyBufferKHR(object_, + (command_queue != nullptr) ? (*command_queue)() : nullptr, + src(), + dst(), + src_offset, + dst_offset, + size, + (sync_points_vec != nullptr) ? (cl_uint) sync_points_vec->size() : 0, + (sync_points_vec != nullptr && sync_points_vec->size() > 0) ? &sync_points_vec->front() : nullptr, + (sync_point != nullptr) ? &tmp_sync_point : nullptr, + (cl_mutable_command_khr*) mutable_handle), + __COMMAND_COPY_BUFFER_KHR_ERR); + + if (sync_point != nullptr && error == CL_SUCCESS) + *sync_point = tmp_sync_point; + + return error; + } + + cl_int commandCopyBufferRect(const Buffer& src, + const Buffer& dst, + const array& src_origin, + const array& dst_origin, + const array& region, + size_type src_row_pitch, + size_type src_slice_pitch, + size_type dst_row_pitch, + size_type dst_slice_pitch, + const vector* sync_points_vec = nullptr, + cl_sync_point_khr* sync_point = nullptr, + MutableCommandKhr* mutable_handle = nullptr, + const CommandQueue* command_queue = nullptr) + { + if (pfn_clCommandCopyBufferRectKHR == nullptr) { + return detail::errHandler(CL_INVALID_OPERATION, + __COMMAND_COPY_BUFFER_RECT_KHR_ERR); + } + + cl_sync_point_khr tmp_sync_point; + cl_int error = detail::errHandler( + pfn_clCommandCopyBufferRectKHR(object_, + (command_queue != nullptr) ? (*command_queue)() : nullptr, + src(), + dst(), + src_origin.data(), + dst_origin.data(), + region.data(), + src_row_pitch, + src_slice_pitch, + dst_row_pitch, + dst_slice_pitch, + (sync_points_vec != nullptr) ? (cl_uint) sync_points_vec->size() : 0, + (sync_points_vec != nullptr && sync_points_vec->size() > 0) ? &sync_points_vec->front() : nullptr, + (sync_point != nullptr) ? &tmp_sync_point : nullptr, + (cl_mutable_command_khr*) mutable_handle), + __COMMAND_COPY_BUFFER_RECT_KHR_ERR); + + if (sync_point != nullptr && error == CL_SUCCESS) + *sync_point = tmp_sync_point; + + return error; + } + + cl_int commandCopyBufferToImage(const Buffer& src, + const Image& dst, + size_type src_offset, + const array& dst_origin, + const array& region, + const vector* sync_points_vec = nullptr, + cl_sync_point_khr* sync_point = nullptr, + MutableCommandKhr* mutable_handle = nullptr, + const CommandQueue* command_queue = nullptr) + { + if (pfn_clCommandCopyBufferToImageKHR == nullptr) { + return detail::errHandler(CL_INVALID_OPERATION, + __COMMAND_COPY_BUFFER_TO_IMAGE_KHR_ERR); + } + + cl_sync_point_khr tmp_sync_point; + cl_int error = detail::errHandler( + pfn_clCommandCopyBufferToImageKHR(object_, + (command_queue != nullptr) ? (*command_queue)() : nullptr, + src(), + dst(), + src_offset, + dst_origin.data(), + region.data(), + (sync_points_vec != nullptr) ? (cl_uint) sync_points_vec->size() : 0, + (sync_points_vec != nullptr && sync_points_vec->size() > 0) ? &sync_points_vec->front() : nullptr, + (sync_point != nullptr) ? &tmp_sync_point : nullptr, + (cl_mutable_command_khr*) mutable_handle), + __COMMAND_COPY_BUFFER_TO_IMAGE_KHR_ERR); + + if (sync_point != nullptr && error == CL_SUCCESS) + *sync_point = tmp_sync_point; + + return error; + } + + cl_int commandCopyImage(const Image& src, + const Image& dst, + const array& src_origin, + const array& dst_origin, + const array& region, + const vector* sync_points_vec = nullptr, + cl_sync_point_khr* sync_point = nullptr, + MutableCommandKhr* mutable_handle = nullptr, + const CommandQueue* command_queue = nullptr) + { + if (pfn_clCommandCopyImageKHR == nullptr) { + return detail::errHandler(CL_INVALID_OPERATION, + __COMMAND_COPY_IMAGE_KHR_ERR); + } + + cl_sync_point_khr tmp_sync_point; + cl_int error = detail::errHandler( + pfn_clCommandCopyImageKHR(object_, + (command_queue != nullptr) ? (*command_queue)() : nullptr, + src(), + dst(), + src_origin.data(), + dst_origin.data(), + region.data(), + (sync_points_vec != nullptr) ? (cl_uint) sync_points_vec->size() : 0, + (sync_points_vec != nullptr && sync_points_vec->size() > 0) ? &sync_points_vec->front() : nullptr, + (sync_point != nullptr) ? &tmp_sync_point : nullptr, + (cl_mutable_command_khr*) mutable_handle), + __COMMAND_COPY_IMAGE_KHR_ERR); + + if (sync_point != nullptr && error == CL_SUCCESS) + *sync_point = tmp_sync_point; + + return error; + } + + cl_int commandCopyImageToBuffer(const Image& src, + const Buffer& dst, + const array& src_origin, + const array& region, + size_type dst_offset, + const vector* sync_points_vec = nullptr, + cl_sync_point_khr* sync_point = nullptr, + MutableCommandKhr* mutable_handle = nullptr, + const CommandQueue* command_queue = nullptr) + { + if (pfn_clCommandCopyImageToBufferKHR == nullptr) { + return detail::errHandler(CL_INVALID_OPERATION, + __COMMAND_COPY_IMAGE_TO_BUFFER_KHR_ERR); + } + + cl_sync_point_khr tmp_sync_point; + cl_int error = detail::errHandler( + pfn_clCommandCopyImageToBufferKHR(object_, + (command_queue != nullptr) ? (*command_queue)() : nullptr, + src(), + dst(), + src_origin.data(), + region.data(), + dst_offset, + (sync_points_vec != nullptr) ? (cl_uint) sync_points_vec->size() : 0, + (sync_points_vec != nullptr && sync_points_vec->size() > 0) ? &sync_points_vec->front() : nullptr, + (sync_point != nullptr) ? &tmp_sync_point : nullptr, + (cl_mutable_command_khr*) mutable_handle), + __COMMAND_COPY_IMAGE_TO_BUFFER_KHR_ERR); + + if (sync_point != nullptr && error == CL_SUCCESS) + *sync_point = tmp_sync_point; + + return error; + } + + template + cl_int commandFillBuffer(const Buffer& buffer, + PatternType pattern, + size_type offset, + size_type size, + const vector* sync_points_vec = nullptr, + cl_sync_point_khr* sync_point = nullptr, + MutableCommandKhr* mutable_handle = nullptr, + const CommandQueue* command_queue = nullptr) + { + if (pfn_clCommandFillBufferKHR == nullptr) { + return detail::errHandler(CL_INVALID_OPERATION, + __COMMAND_FILL_BUFFER_KHR_ERR); + } + + cl_sync_point_khr tmp_sync_point; + cl_int error = detail::errHandler( + pfn_clCommandFillBufferKHR(object_, + (command_queue != nullptr) ? (*command_queue)() : nullptr, + buffer(), + static_cast(&pattern), + sizeof(PatternType), + offset, + size, + (sync_points_vec != nullptr) ? (cl_uint) sync_points_vec->size() : 0, + (sync_points_vec != nullptr && sync_points_vec->size() > 0) ? &sync_points_vec->front() : nullptr, + (sync_point != nullptr) ? &tmp_sync_point : nullptr, + (cl_mutable_command_khr*) mutable_handle), + __COMMAND_FILL_BUFFER_KHR_ERR); + + if (sync_point != nullptr && error == CL_SUCCESS) + *sync_point = tmp_sync_point; + + return error; + } + + cl_int commandFillImage(const Image& image, + cl_float4 fillColor, + const array& origin, + const array& region, + const vector* sync_points_vec = nullptr, + cl_sync_point_khr* sync_point = nullptr, + MutableCommandKhr* mutable_handle = nullptr, + const CommandQueue* command_queue = nullptr) + { + if (pfn_clCommandFillImageKHR == nullptr) { + return detail::errHandler(CL_INVALID_OPERATION, + __COMMAND_FILL_IMAGE_KHR_ERR); + } + + cl_sync_point_khr tmp_sync_point; + cl_int error = detail::errHandler( + pfn_clCommandFillImageKHR(object_, + (command_queue != nullptr) ? (*command_queue)() : nullptr, + image(), + static_cast(&fillColor), + origin.data(), + region.data(), + (sync_points_vec != nullptr) ? (cl_uint) sync_points_vec->size() : 0, + (sync_points_vec != nullptr && sync_points_vec->size() > 0) ? &sync_points_vec->front() : nullptr, + (sync_point != nullptr) ? &tmp_sync_point : nullptr, + (cl_mutable_command_khr*) mutable_handle), + __COMMAND_FILL_IMAGE_KHR_ERR); + + if (sync_point != nullptr && error == CL_SUCCESS) + *sync_point = tmp_sync_point; + + return error; + } + + cl_int commandNDRangeKernel(const cl::vector &properties, + const Kernel& kernel, + const NDRange& offset, + const NDRange& global, + const NDRange& local = NullRange, + const vector* sync_points_vec = nullptr, + cl_sync_point_khr* sync_point = nullptr, + MutableCommandKhr* mutable_handle = nullptr, + const CommandQueue* command_queue = nullptr) + { + if (pfn_clCommandNDRangeKernelKHR == nullptr) { + return detail::errHandler(CL_INVALID_OPERATION, + __COMMAND_NDRANGE_KERNEL_KHR_ERR); + } + + cl_sync_point_khr tmp_sync_point; + cl_int error = detail::errHandler( + pfn_clCommandNDRangeKernelKHR(object_, + (command_queue != nullptr) ? (*command_queue)() : nullptr, + &properties[0], + kernel(), + (cl_uint) global.dimensions(), + offset.dimensions() != 0 ? (const size_type*) offset : nullptr, + (const size_type*) global, + local.dimensions() != 0 ? (const size_type*) local : nullptr, + (sync_points_vec != nullptr) ? (cl_uint) sync_points_vec->size() : 0, + (sync_points_vec != nullptr && sync_points_vec->size() > 0) ? &sync_points_vec->front() : nullptr, + (sync_point != nullptr) ? &tmp_sync_point : nullptr, + (cl_mutable_command_khr*) mutable_handle), + __COMMAND_NDRANGE_KERNEL_KHR_ERR); + + if (sync_point != nullptr && error == CL_SUCCESS) + *sync_point = tmp_sync_point; + + return error; + } + +#if defined(cl_khr_command_buffer_mutable_dispatch) + cl_int updateMutableCommands(const cl_mutable_base_config_khr* mutable_config) + { + if (pfn_clUpdateMutableCommandsKHR == nullptr) { + return detail::errHandler(CL_INVALID_OPERATION, + __UPDATE_MUTABLE_COMMANDS_KHR_ERR); + } + return detail::errHandler(pfn_clUpdateMutableCommandsKHR(object_, mutable_config), + __UPDATE_MUTABLE_COMMANDS_KHR_ERR); + } +#endif /* cl_khr_command_buffer_mutable_dispatch */ + +private: + static std::once_flag ext_init_; + + static void initExtensions(const cl::Device& device) + { +#if CL_HPP_TARGET_OPENCL_VERSION >= 120 + cl_platform_id platform = device.getInfo()(); + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clCreateCommandBufferKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clFinalizeCommandBufferKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clRetainCommandBufferKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clReleaseCommandBufferKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clGetCommandBufferInfoKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clEnqueueCommandBufferKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clCommandBarrierWithWaitListKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clCommandCopyBufferKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clCommandCopyBufferRectKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clCommandCopyBufferToImageKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clCommandCopyImageKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clCommandCopyImageToBufferKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clCommandFillBufferKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clCommandFillImageKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clCommandNDRangeKernelKHR); +#if defined(cl_khr_command_buffer_mutable_dispatch) + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clUpdateMutableCommandsKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clGetMutableCommandInfoKHR); +#endif /* cl_khr_command_buffer_mutable_dispatch */ +#elif CL_HPP_TARGET_OPENCL_VERSION >= 110 + CL_HPP_INIT_CL_EXT_FCN_PTR_(clCreateCommandBufferKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_(clFinalizeCommandBufferKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_(clRetainCommandBufferKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_(clReleaseCommandBufferKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_(clGetCommandBufferInfoKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_(clEnqueueCommandBufferKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_(clCommandBarrierWithWaitListKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_(clCommandCopyBufferKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_(clCommandCopyBufferRectKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_(clCommandCopyBufferToImageKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_(clCommandCopyImageKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_(clCommandCopyImageToBufferKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_(clCommandFillBufferKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_(clCommandFillImageKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_(clCommandNDRangeKernelKHR); +#if defined(cl_khr_command_buffer_mutable_dispatch) + CL_HPP_INIT_CL_EXT_FCN_PTR_(clUpdateMutableCommandsKHR); + CL_HPP_INIT_CL_EXT_FCN_PTR_(clGetMutableCommandInfoKHR); +#endif /* cl_khr_command_buffer_mutable_dispatch */ +#endif + if ((pfn_clCreateCommandBufferKHR == nullptr) && + (pfn_clFinalizeCommandBufferKHR == nullptr) && + (pfn_clRetainCommandBufferKHR == nullptr) && + (pfn_clReleaseCommandBufferKHR == nullptr) && + (pfn_clGetCommandBufferInfoKHR == nullptr) && + (pfn_clEnqueueCommandBufferKHR == nullptr) && + (pfn_clCommandBarrierWithWaitListKHR == nullptr) && + (pfn_clCommandCopyBufferKHR == nullptr) && + (pfn_clCommandCopyBufferRectKHR == nullptr) && + (pfn_clCommandCopyBufferToImageKHR == nullptr) && + (pfn_clCommandCopyImageKHR == nullptr) && + (pfn_clCommandCopyImageToBufferKHR == nullptr) && + (pfn_clCommandFillBufferKHR == nullptr) && + (pfn_clCommandFillImageKHR == nullptr) && + (pfn_clCommandNDRangeKernelKHR == nullptr) +#if defined(cl_khr_command_buffer_mutable_dispatch) + && (pfn_clUpdateMutableCommandsKHR == nullptr) + && (pfn_clGetMutableCommandInfoKHR == nullptr) +#endif /* cl_khr_command_buffer_mutable_dispatch */ + ) + { + detail::errHandler(CL_INVALID_VALUE, __CREATE_COMMAND_BUFFER_KHR_ERR); + } + } +}; // CommandBufferKhr + +CL_HPP_DEFINE_STATIC_MEMBER_ std::once_flag CommandBufferKhr::ext_init_; + +#if defined(cl_khr_command_buffer_mutable_dispatch) +/*! \class MutableCommandKhr + * \brief MutableCommandKhr interface for cl_mutable_command_khr. + */ +class MutableCommandKhr : public detail::Wrapper +{ +public: + //! \brief Default constructor - initializes to nullptr. + MutableCommandKhr() : detail::Wrapper() { } + + explicit MutableCommandKhr(const cl_mutable_command_khr& mutableCommandKhr, bool retainObject = false) : + detail::Wrapper(mutableCommandKhr, retainObject) { } + + MutableCommandKhr& operator=(const cl_mutable_command_khr& rhs) + { + detail::Wrapper::operator=(rhs); + return *this; + } + + template + cl_int getInfo(cl_mutable_command_info_khr name, T* param) const + { + if (pfn_clGetMutableCommandInfoKHR == nullptr) { + return detail::errHandler(CL_INVALID_OPERATION, + __GET_MUTABLE_COMMAND_INFO_KHR_ERR); + } + return detail::errHandler( + detail::getInfo(pfn_clGetMutableCommandInfoKHR, object_, name, param), + __GET_MUTABLE_COMMAND_INFO_KHR_ERR); + } + + template typename + detail::param_traits::param_type + getInfo(cl_int* err = nullptr) const + { + typename detail::param_traits< + detail::cl_mutable_command_info_khr, name>::param_type param; + cl_int result = getInfo(name, ¶m); + if (err != nullptr) { + *err = result; + } + return param; + } +}; // MutableCommandKhr +#endif /* cl_khr_command_buffer_mutable_dispatch */ + +#endif // cl_khr_command_buffer +//---------------------------------------------------------------------------------------------------------------------- + +#undef CL_HPP_ERR_STR_ +#if !defined(CL_HPP_USER_OVERRIDE_ERROR_STRINGS) +#undef __GET_DEVICE_INFO_ERR +#undef __GET_PLATFORM_INFO_ERR +#undef __GET_DEVICE_IDS_ERR +#undef __GET_PLATFORM_IDS_ERR +#undef __GET_CONTEXT_INFO_ERR +#undef __GET_EVENT_INFO_ERR +#undef __GET_EVENT_PROFILE_INFO_ERR +#undef __GET_MEM_OBJECT_INFO_ERR +#undef __GET_IMAGE_INFO_ERR +#undef __GET_SAMPLER_INFO_ERR +#undef __GET_KERNEL_INFO_ERR +#undef __GET_KERNEL_ARG_INFO_ERR +#undef __GET_KERNEL_SUB_GROUP_INFO_ERR +#undef __GET_KERNEL_WORK_GROUP_INFO_ERR +#undef __GET_PROGRAM_INFO_ERR +#undef __GET_PROGRAM_BUILD_INFO_ERR +#undef __GET_COMMAND_QUEUE_INFO_ERR +#undef __CREATE_CONTEXT_ERR +#undef __CREATE_CONTEXT_FROM_TYPE_ERR +#undef __CREATE_COMMAND_BUFFER_KHR_ERR +#undef __GET_COMMAND_BUFFER_INFO_KHR_ERR +#undef __FINALIZE_COMMAND_BUFFER_KHR_ERR +#undef __ENQUEUE_COMMAND_BUFFER_KHR_ERR +#undef __COMMAND_BARRIER_WITH_WAIT_LIST_KHR_ERR +#undef __COMMAND_COPY_BUFFER_KHR_ERR +#undef __COMMAND_COPY_BUFFER_RECT_KHR_ERR +#undef __COMMAND_COPY_BUFFER_TO_IMAGE_KHR_ERR +#undef __COMMAND_COPY_IMAGE_KHR_ERR +#undef __COMMAND_COPY_IMAGE_TO_BUFFER_KHR_ERR +#undef __COMMAND_FILL_BUFFER_KHR_ERR +#undef __COMMAND_FILL_IMAGE_KHR_ERR +#undef __COMMAND_NDRANGE_KERNEL_KHR_ERR +#undef __UPDATE_MUTABLE_COMMANDS_KHR_ERR +#undef __GET_MUTABLE_COMMAND_INFO_KHR_ERR +#undef __RETAIN_COMMAND_BUFFER_KHR_ERR +#undef __RELEASE_COMMAND_BUFFER_KHR_ERR +#undef __GET_SUPPORTED_IMAGE_FORMATS_ERR +#undef __SET_CONTEXT_DESCTRUCTOR_CALLBACK_ERR +#undef __CREATE_BUFFER_ERR +#undef __COPY_ERR +#undef __CREATE_SUBBUFFER_ERR +#undef __CREATE_GL_BUFFER_ERR +#undef __CREATE_GL_RENDER_BUFFER_ERR +#undef __GET_GL_OBJECT_INFO_ERR +#undef __CREATE_IMAGE_ERR +#undef __CREATE_GL_TEXTURE_ERR +#undef __IMAGE_DIMENSION_ERR +#undef __SET_MEM_OBJECT_DESTRUCTOR_CALLBACK_ERR +#undef __CREATE_USER_EVENT_ERR +#undef __SET_USER_EVENT_STATUS_ERR +#undef __SET_EVENT_CALLBACK_ERR +#undef __WAIT_FOR_EVENTS_ERR +#undef __CREATE_KERNEL_ERR +#undef __SET_KERNEL_ARGS_ERR +#undef __CREATE_PROGRAM_WITH_SOURCE_ERR +#undef __CREATE_PROGRAM_WITH_BINARY_ERR +#undef __CREATE_PROGRAM_WITH_IL_ERR +#undef __CREATE_PROGRAM_WITH_BUILT_IN_KERNELS_ERR +#undef __BUILD_PROGRAM_ERR +#undef __COMPILE_PROGRAM_ERR +#undef __LINK_PROGRAM_ERR +#undef __CREATE_KERNELS_IN_PROGRAM_ERR +#undef __CREATE_COMMAND_QUEUE_WITH_PROPERTIES_ERR +#undef __CREATE_SAMPLER_WITH_PROPERTIES_ERR +#undef __SET_COMMAND_QUEUE_PROPERTY_ERR +#undef __ENQUEUE_READ_BUFFER_ERR +#undef __ENQUEUE_READ_BUFFER_RECT_ERR +#undef __ENQUEUE_WRITE_BUFFER_ERR +#undef __ENQUEUE_WRITE_BUFFER_RECT_ERR +#undef __ENQEUE_COPY_BUFFER_ERR +#undef __ENQEUE_COPY_BUFFER_RECT_ERR +#undef __ENQUEUE_FILL_BUFFER_ERR +#undef __ENQUEUE_READ_IMAGE_ERR +#undef __ENQUEUE_WRITE_IMAGE_ERR +#undef __ENQUEUE_COPY_IMAGE_ERR +#undef __ENQUEUE_FILL_IMAGE_ERR +#undef __ENQUEUE_COPY_IMAGE_TO_BUFFER_ERR +#undef __ENQUEUE_COPY_BUFFER_TO_IMAGE_ERR +#undef __ENQUEUE_MAP_BUFFER_ERR +#undef __ENQUEUE_MAP_IMAGE_ERR +#undef __ENQUEUE_MAP_SVM_ERR +#undef __ENQUEUE_FILL_SVM_ERR +#undef __ENQUEUE_COPY_SVM_ERR +#undef __ENQUEUE_UNMAP_SVM_ERR +#undef __ENQUEUE_MAP_IMAGE_ERR +#undef __ENQUEUE_UNMAP_MEM_OBJECT_ERR +#undef __ENQUEUE_NDRANGE_KERNEL_ERR +#undef __ENQUEUE_NATIVE_KERNEL +#undef __ENQUEUE_MIGRATE_MEM_OBJECTS_ERR +#undef __ENQUEUE_MIGRATE_SVM_ERR +#undef __ENQUEUE_ACQUIRE_GL_ERR +#undef __ENQUEUE_RELEASE_GL_ERR +#undef __CREATE_PIPE_ERR +#undef __GET_PIPE_INFO_ERR +#undef __RETAIN_ERR +#undef __RELEASE_ERR +#undef __FLUSH_ERR +#undef __FINISH_ERR +#undef __VECTOR_CAPACITY_ERR +#undef __CREATE_SUB_DEVICES_ERR +#undef __ENQUEUE_ACQUIRE_EXTERNAL_MEMORY_ERR +#undef __ENQUEUE_RELEASE_EXTERNAL_MEMORY_ERR +#undef __ENQUEUE_MARKER_ERR +#undef __ENQUEUE_WAIT_FOR_EVENTS_ERR +#undef __ENQUEUE_BARRIER_ERR +#undef __UNLOAD_COMPILER_ERR +#undef __CREATE_GL_TEXTURE_2D_ERR +#undef __CREATE_GL_TEXTURE_3D_ERR +#undef __CREATE_IMAGE2D_ERR +#undef __CREATE_IMAGE3D_ERR +#undef __CREATE_COMMAND_QUEUE_ERR +#undef __ENQUEUE_TASK_ERR +#undef __CREATE_SAMPLER_ERR +#undef __ENQUEUE_MARKER_WAIT_LIST_ERR +#undef __ENQUEUE_BARRIER_WAIT_LIST_ERR +#undef __CLONE_KERNEL_ERR +#undef __GET_HOST_TIMER_ERR +#undef __GET_DEVICE_AND_HOST_TIMER_ERR +#undef __GET_SEMAPHORE_KHR_INFO_ERR +#undef __CREATE_SEMAPHORE_KHR_WITH_PROPERTIES_ERR +#undef __GET_IMAGE_REQUIREMENT_INFO_EXT_ERR +#undef __ENQUEUE_WAIT_SEMAPHORE_KHR_ERR +#undef __ENQUEUE_SIGNAL_SEMAPHORE_KHR_ERR +#undef __RETAIN_SEMAPHORE_KHR_ERR +#undef __RELEASE_SEMAPHORE_KHR_ERR +#undef __GET_SEMAPHORE_HANDLE_FOR_TYPE_KHR_ERR + +#endif //CL_HPP_USER_OVERRIDE_ERROR_STRINGS + +// Extensions +#undef CL_HPP_CREATE_CL_EXT_FCN_PTR_ALIAS_ +#undef CL_HPP_INIT_CL_EXT_FCN_PTR_ +#undef CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_ + +#undef CL_HPP_DEFINE_STATIC_MEMBER_ + +} // namespace cl + +#endif // CL_HPP_ diff --git a/cuda_toolkit/include/CL/cl_d3d10.h b/cuda_toolkit/include/CL/cl_d3d10.h new file mode 100644 index 0000000000000000000000000000000000000000..919de8b3f11aab72c4ec221f4329a03a1f5ae699 --- /dev/null +++ b/cuda_toolkit/include/CL/cl_d3d10.h @@ -0,0 +1,241 @@ +/******************************************************************************* + * Copyright (c) 2008-2023 The Khronos Group Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ + +#ifndef OPENCL_CL_D3D10_H_ +#define OPENCL_CL_D3D10_H_ + +/* +** This header is generated from the Khronos OpenCL XML API Registry. +*/ + +#if defined(_MSC_VER) +#if _MSC_VER >=1500 +#pragma warning( push ) +#pragma warning( disable : 4201 ) +#pragma warning( disable : 5105 ) +#endif +#endif +#include +#if defined(_MSC_VER) +#if _MSC_VER >=1500 +#pragma warning( pop ) +#endif +#endif + +#include + +/* CL_NO_PROTOTYPES implies CL_NO_EXTENSION_PROTOTYPES: */ +#if defined(CL_NO_PROTOTYPES) && !defined(CL_NO_EXTENSION_PROTOTYPES) +#define CL_NO_EXTENSION_PROTOTYPES +#endif + +/* CL_NO_EXTENSION_PROTOTYPES implies + CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES and + CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES: */ +#if defined(CL_NO_EXTENSION_PROTOTYPES) && \ + !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) +#define CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES +#endif +#if defined(CL_NO_EXTENSION_PROTOTYPES) && \ + !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) +#define CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/*************************************************************** +* cl_khr_d3d10_sharing +***************************************************************/ +#define cl_khr_d3d10_sharing 1 +#define CL_KHR_D3D10_SHARING_EXTENSION_NAME \ + "cl_khr_d3d10_sharing" + +typedef cl_uint cl_d3d10_device_source_khr; +typedef cl_uint cl_d3d10_device_set_khr; + +/* Error codes */ +#define CL_INVALID_D3D10_DEVICE_KHR -1002 +#define CL_INVALID_D3D10_RESOURCE_KHR -1003 +#define CL_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR -1004 +#define CL_D3D10_RESOURCE_NOT_ACQUIRED_KHR -1005 + +/* cl_d3d10_device_source_khr */ +#define CL_D3D10_DEVICE_KHR 0x4010 +#define CL_D3D10_DXGI_ADAPTER_KHR 0x4011 + +/* cl_d3d10_device_set_khr */ +#define CL_PREFERRED_DEVICES_FOR_D3D10_KHR 0x4012 +#define CL_ALL_DEVICES_FOR_D3D10_KHR 0x4013 + +/* cl_context_info */ +#define CL_CONTEXT_D3D10_DEVICE_KHR 0x4014 +#define CL_CONTEXT_D3D10_PREFER_SHARED_RESOURCES_KHR 0x402C + +/* cl_mem_info */ +#define CL_MEM_D3D10_RESOURCE_KHR 0x4015 + +/* cl_image_info */ +#define CL_IMAGE_D3D10_SUBRESOURCE_KHR 0x4016 + +/* cl_command_type */ +#define CL_COMMAND_ACQUIRE_D3D10_OBJECTS_KHR 0x4017 +#define CL_COMMAND_RELEASE_D3D10_OBJECTS_KHR 0x4018 + + +typedef cl_int (CL_API_CALL * +clGetDeviceIDsFromD3D10KHR_fn)( + cl_platform_id platform, + cl_d3d10_device_source_khr d3d_device_source, + void* d3d_object, + cl_d3d10_device_set_khr d3d_device_set, + cl_uint num_entries, + cl_device_id* devices, + cl_uint* num_devices) CL_API_SUFFIX__VERSION_1_0; + +typedef cl_mem (CL_API_CALL * +clCreateFromD3D10BufferKHR_fn)( + cl_context context, + cl_mem_flags flags, + ID3D10Buffer* resource, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +typedef cl_mem (CL_API_CALL * +clCreateFromD3D10Texture2DKHR_fn)( + cl_context context, + cl_mem_flags flags, + ID3D10Texture2D* resource, + UINT subresource, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +typedef cl_mem (CL_API_CALL * +clCreateFromD3D10Texture3DKHR_fn)( + cl_context context, + cl_mem_flags flags, + ID3D10Texture3D* resource, + UINT subresource, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +typedef cl_int (CL_API_CALL * +clEnqueueAcquireD3D10ObjectsKHR_fn)( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_0; + +typedef cl_int (CL_API_CALL * +clEnqueueReleaseD3D10ObjectsKHR_fn)( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_0; + +#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetDeviceIDsFromD3D10KHR( + cl_platform_id platform, + cl_d3d10_device_source_khr d3d_device_source, + void* d3d_object, + cl_d3d10_device_set_khr d3d_device_set, + cl_uint num_entries, + cl_device_id* devices, + cl_uint* num_devices) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateFromD3D10BufferKHR( + cl_context context, + cl_mem_flags flags, + ID3D10Buffer* resource, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateFromD3D10Texture2DKHR( + cl_context context, + cl_mem_flags flags, + ID3D10Texture2D* resource, + UINT subresource, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateFromD3D10Texture3DKHR( + cl_context context, + cl_mem_flags flags, + ID3D10Texture3D* resource, + UINT subresource, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueAcquireD3D10ObjectsKHR( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueReleaseD3D10ObjectsKHR( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_0; + +#endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_intel_sharing_format_query_d3d10 +***************************************************************/ +#define cl_intel_sharing_format_query_d3d10 1 +#define CL_INTEL_SHARING_FORMAT_QUERY_D3D10_EXTENSION_NAME \ + "cl_intel_sharing_format_query_d3d10" + +/* when cl_khr_d3d10_sharing is supported */ + +typedef cl_int (CL_API_CALL * +clGetSupportedD3D10TextureFormatsINTEL_fn)( + cl_context context, + cl_mem_flags flags, + cl_mem_object_type image_type, + cl_uint num_entries, + DXGI_FORMAT* d3d10_formats, + cl_uint* num_texture_formats) ; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetSupportedD3D10TextureFormatsINTEL( + cl_context context, + cl_mem_flags flags, + cl_mem_object_type image_type, + cl_uint num_entries, + DXGI_FORMAT* d3d10_formats, + cl_uint* num_texture_formats) ; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +#ifdef __cplusplus +} +#endif + +#endif /* OPENCL_CL_D3D10_H_ */ diff --git a/cuda_toolkit/include/CL/cl_d3d10_ext.h b/cuda_toolkit/include/CL/cl_d3d10_ext.h new file mode 100644 index 0000000000000000000000000000000000000000..4198be25db407bd7236611737e9065c901366d97 --- /dev/null +++ b/cuda_toolkit/include/CL/cl_d3d10_ext.h @@ -0,0 +1,122 @@ +/********************************************************************************** + * Copyright (c) 2008-2009 The Khronos Group Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and/or associated documentation files (the + * "Materials"), to deal in the Materials without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Materials, and to + * permit persons to whom the Materials are furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Materials. + * + * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + **********************************************************************************/ + +#ifndef __OPENCL_CL_D3D10_EXT_H +#define __OPENCL_CL_D3D10_EXT_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/****************************************************************************** + * cl_nv_d3d10_sharing */ + +typedef cl_uint cl_d3d10_device_source_nv; +typedef cl_uint cl_d3d10_device_set_nv; + +/******************************************************************************/ + +// Error Codes +#define CL_INVALID_D3D10_DEVICE_NV -1002 +#define CL_INVALID_D3D10_RESOURCE_NV -1003 +#define CL_D3D10_RESOURCE_ALREADY_ACQUIRED_NV -1004 +#define CL_D3D10_RESOURCE_NOT_ACQUIRED_NV -1005 + +// cl_d3d10_device_source_nv +#define CL_D3D10_DEVICE_NV 0x4010 +#define CL_D3D10_DXGI_ADAPTER_NV 0x4011 + +// cl_d3d10_device_set_nv +#define CL_PREFERRED_DEVICES_FOR_D3D10_NV 0x4012 +#define CL_ALL_DEVICES_FOR_D3D10_NV 0x4013 + +// cl_context_info +#define CL_CONTEXT_D3D10_DEVICE_NV 0x4014 + +// cl_mem_info +#define CL_MEM_D3D10_RESOURCE_NV 0x4015 + +// cl_image_info +#define CL_IMAGE_D3D10_SUBRESOURCE_NV 0x4016 + +// cl_command_type +#define CL_COMMAND_ACQUIRE_D3D10_OBJECTS_NV 0x4017 +#define CL_COMMAND_RELEASE_D3D10_OBJECTS_NV 0x4018 + +/******************************************************************************/ + +typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D10NV_fn)( + cl_platform_id platform, + cl_d3d10_device_source_nv d3d_device_source, + void * d3d_object, + cl_d3d10_device_set_nv d3d_device_set, + cl_uint num_entries, + cl_device_id * devices, + cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_0; + +typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10BufferNV_fn)( + cl_context context, + cl_mem_flags flags, + ID3D10Buffer * resource, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture2DNV_fn)( + cl_context context, + cl_mem_flags flags, + ID3D10Texture2D * resource, + UINT subresource, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture3DNV_fn)( + cl_context context, + cl_mem_flags flags, + ID3D10Texture3D * resource, + UINT subresource, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D10ObjectsNV_fn)( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem * mem_objects, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_0; + +typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D10ObjectsNV_fn)( + cl_command_queue command_queue, + cl_uint num_objects, + cl_mem * mem_objects, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_0; + +#ifdef __cplusplus +} +#endif + +#endif // __OPENCL_CL_D3D10_H + diff --git a/cuda_toolkit/include/CL/cl_d3d11.h b/cuda_toolkit/include/CL/cl_d3d11.h new file mode 100644 index 0000000000000000000000000000000000000000..0ceca53ff1c065ff81f3ca224baee4af05817854 --- /dev/null +++ b/cuda_toolkit/include/CL/cl_d3d11.h @@ -0,0 +1,243 @@ +/******************************************************************************* + * Copyright (c) 2008-2023 The Khronos Group Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ + +#ifndef OPENCL_CL_D3D11_H_ +#define OPENCL_CL_D3D11_H_ + +/* +** This header is generated from the Khronos OpenCL XML API Registry. +*/ + +#if defined(_MSC_VER) +#if _MSC_VER >=1500 +#pragma warning( push ) +#pragma warning( disable : 4201 ) +#pragma warning( disable : 5105 ) +#endif +#endif +#include +#if defined(_MSC_VER) +#if _MSC_VER >=1500 +#pragma warning( pop ) +#endif +#endif + +#include + +/* CL_NO_PROTOTYPES implies CL_NO_EXTENSION_PROTOTYPES: */ +#if defined(CL_NO_PROTOTYPES) && !defined(CL_NO_EXTENSION_PROTOTYPES) +#define CL_NO_EXTENSION_PROTOTYPES +#endif + +/* CL_NO_EXTENSION_PROTOTYPES implies + CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES and + CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES: */ +#if defined(CL_NO_EXTENSION_PROTOTYPES) && \ + !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) +#define CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES +#endif +#if defined(CL_NO_EXTENSION_PROTOTYPES) && \ + !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) +#define CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/*************************************************************** +* cl_khr_d3d11_sharing +***************************************************************/ +#define cl_khr_d3d11_sharing 1 +#define CL_KHR_D3D11_SHARING_EXTENSION_NAME \ + "cl_khr_d3d11_sharing" + +typedef cl_uint cl_d3d11_device_source_khr; +typedef cl_uint cl_d3d11_device_set_khr; + +/* Error codes */ +#define CL_INVALID_D3D11_DEVICE_KHR -1006 +#define CL_INVALID_D3D11_RESOURCE_KHR -1007 +#define CL_D3D11_RESOURCE_ALREADY_ACQUIRED_KHR -1008 +#define CL_D3D11_RESOURCE_NOT_ACQUIRED_KHR -1009 + +/* cl_d3d11_device_source_khr */ +#define CL_D3D11_DEVICE_KHR 0x4019 +#define CL_D3D11_DXGI_ADAPTER_KHR 0x401A + +/* cl_d3d11_device_set_khr */ +#define CL_PREFERRED_DEVICES_FOR_D3D11_KHR 0x401B +#define CL_ALL_DEVICES_FOR_D3D11_KHR 0x401C + +/* cl_context_info */ +#define CL_CONTEXT_D3D11_DEVICE_KHR 0x401D +#define CL_CONTEXT_D3D11_PREFER_SHARED_RESOURCES_KHR 0x402D + +/* cl_mem_info */ +#define CL_MEM_D3D11_RESOURCE_KHR 0x401E + +/* cl_image_info */ +#define CL_IMAGE_D3D11_SUBRESOURCE_KHR 0x401F + +/* cl_command_type */ +#define CL_COMMAND_ACQUIRE_D3D11_OBJECTS_KHR 0x4020 +#define CL_COMMAND_RELEASE_D3D11_OBJECTS_KHR 0x4021 + + +typedef cl_int (CL_API_CALL * +clGetDeviceIDsFromD3D11KHR_fn)( + cl_platform_id platform, + cl_d3d11_device_source_khr d3d_device_source, + void* d3d_object, + cl_d3d11_device_set_khr d3d_device_set, + cl_uint num_entries, + cl_device_id* devices, + cl_uint* num_devices) CL_API_SUFFIX__VERSION_1_2; + +typedef cl_mem (CL_API_CALL * +clCreateFromD3D11BufferKHR_fn)( + cl_context context, + cl_mem_flags flags, + ID3D11Buffer* resource, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; + +typedef cl_mem (CL_API_CALL * +clCreateFromD3D11Texture2DKHR_fn)( + cl_context context, + cl_mem_flags flags, + ID3D11Texture2D* resource, + UINT subresource, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; + +typedef cl_mem (CL_API_CALL * +clCreateFromD3D11Texture3DKHR_fn)( + cl_context context, + cl_mem_flags flags, + ID3D11Texture3D* resource, + UINT subresource, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; + +typedef cl_int (CL_API_CALL * +clEnqueueAcquireD3D11ObjectsKHR_fn)( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_2; + +typedef cl_int (CL_API_CALL * +clEnqueueReleaseD3D11ObjectsKHR_fn)( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_2; + +#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetDeviceIDsFromD3D11KHR( + cl_platform_id platform, + cl_d3d11_device_source_khr d3d_device_source, + void* d3d_object, + cl_d3d11_device_set_khr d3d_device_set, + cl_uint num_entries, + cl_device_id* devices, + cl_uint* num_devices) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateFromD3D11BufferKHR( + cl_context context, + cl_mem_flags flags, + ID3D11Buffer* resource, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateFromD3D11Texture2DKHR( + cl_context context, + cl_mem_flags flags, + ID3D11Texture2D* resource, + UINT subresource, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateFromD3D11Texture3DKHR( + cl_context context, + cl_mem_flags flags, + ID3D11Texture3D* resource, + UINT subresource, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueAcquireD3D11ObjectsKHR( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueReleaseD3D11ObjectsKHR( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_2; + +#endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_intel_sharing_format_query_d3d11 +***************************************************************/ +#define cl_intel_sharing_format_query_d3d11 1 +#define CL_INTEL_SHARING_FORMAT_QUERY_D3D11_EXTENSION_NAME \ + "cl_intel_sharing_format_query_d3d11" + +/* when cl_khr_d3d11_sharing is supported */ + +typedef cl_int (CL_API_CALL * +clGetSupportedD3D11TextureFormatsINTEL_fn)( + cl_context context, + cl_mem_flags flags, + cl_mem_object_type image_type, + cl_uint plane, + cl_uint num_entries, + DXGI_FORMAT* d3d11_formats, + cl_uint* num_texture_formats) ; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetSupportedD3D11TextureFormatsINTEL( + cl_context context, + cl_mem_flags flags, + cl_mem_object_type image_type, + cl_uint plane, + cl_uint num_entries, + DXGI_FORMAT* d3d11_formats, + cl_uint* num_texture_formats) ; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +#ifdef __cplusplus +} +#endif + +#endif /* OPENCL_CL_D3D11_H_ */ diff --git a/cuda_toolkit/include/CL/cl_d3d11_ext.h b/cuda_toolkit/include/CL/cl_d3d11_ext.h new file mode 100644 index 0000000000000000000000000000000000000000..96e9b28d327ba73ddac2cb5697a13926a02d8a55 --- /dev/null +++ b/cuda_toolkit/include/CL/cl_d3d11_ext.h @@ -0,0 +1,122 @@ +/********************************************************************************** + * Copyright (c) 2008-2009 The Khronos Group Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and/or associated documentation files (the + * "Materials"), to deal in the Materials without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Materials, and to + * permit persons to whom the Materials are furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Materials. + * + * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + **********************************************************************************/ + +#ifndef __OPENCL_CL_D3D11_EXT_H +#define __OPENCL_CL_D3D11_EXT_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/****************************************************************************** + * cl_nv_d3d11_sharing */ + +typedef cl_uint cl_d3d11_device_source_nv; +typedef cl_uint cl_d3d11_device_set_nv; + +/******************************************************************************/ + +// Error Codes +#define CL_INVALID_D3D11_DEVICE_NV -1006 +#define CL_INVALID_D3D11_RESOURCE_NV -1007 +#define CL_D3D11_RESOURCE_ALREADY_ACQUIRED_NV -1008 +#define CL_D3D11_RESOURCE_NOT_ACQUIRED_NV -1009 + +// cl_d3d11_device_source_nv +#define CL_D3D11_DEVICE_NV 0x4019 +#define CL_D3D11_DXGI_ADAPTER_NV 0x401A + +// cl_d3d11_device_set_nv +#define CL_PREFERRED_DEVICES_FOR_D3D11_NV 0x401B +#define CL_ALL_DEVICES_FOR_D3D11_NV 0x401C + +// cl_context_info +#define CL_CONTEXT_D3D11_DEVICE_NV 0x401D + +// cl_mem_info +#define CL_MEM_D3D11_RESOURCE_NV 0x401E + +// cl_image_info +#define CL_IMAGE_D3D11_SUBRESOURCE_NV 0x401F + +// cl_command_type +#define CL_COMMAND_ACQUIRE_D3D11_OBJECTS_NV 0x4020 +#define CL_COMMAND_RELEASE_D3D11_OBJECTS_NV 0x4021 + +/******************************************************************************/ + +typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D11NV_fn)( + cl_platform_id platform, + cl_d3d11_device_source_nv d3d_device_source, + void * d3d_object, + cl_d3d11_device_set_nv d3d_device_set, + cl_uint num_entries, + cl_device_id * devices, + cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_0; + +typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11BufferNV_fn)( + cl_context context, + cl_mem_flags flags, + ID3D11Buffer * resource, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11Texture2DNV_fn)( + cl_context context, + cl_mem_flags flags, + ID3D11Texture2D * resource, + UINT subresource, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D11Texture3DNV_fn)( + cl_context context, + cl_mem_flags flags, + ID3D11Texture3D * resource, + UINT subresource, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D11ObjectsNV_fn)( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem * mem_objects, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_0; + +typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D11ObjectsNV_fn)( + cl_command_queue command_queue, + cl_uint num_objects, + cl_mem * mem_objects, + cl_uint num_events_in_wait_list, + const cl_event * event_wait_list, + cl_event * event) CL_API_SUFFIX__VERSION_1_0; + +#ifdef __cplusplus +} +#endif + +#endif // __OPENCL_CL_D3D11_H + diff --git a/cuda_toolkit/include/CL/cl_d3d9_ext.h b/cuda_toolkit/include/CL/cl_d3d9_ext.h new file mode 100644 index 0000000000000000000000000000000000000000..4cbee65f9c9ba733436111558dc823041eb2f3ac --- /dev/null +++ b/cuda_toolkit/include/CL/cl_d3d9_ext.h @@ -0,0 +1,143 @@ +/********************************************************************************** + * Copyright (c) 2008-2009 The Khronos Group Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and/or associated documentation files (the + * "Materials"), to deal in the Materials without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Materials, and to + * permit persons to whom the Materials are furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Materials. + * + * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + **********************************************************************************/ + +#ifndef __OPENCL_CL_D3D9_EXT_H +#define __OPENCL_CL_D3D9_EXT_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/****************************************************************************** + * cl_nv_d3d9_sharing */ + +typedef cl_uint cl_d3d9_device_source_nv; +typedef cl_uint cl_d3d9_device_set_nv; + +/******************************************************************************/ + +// Error Codes +#define CL_INVALID_D3D9_DEVICE_NV -1010 +#define CL_INVALID_D3D9_RESOURCE_NV -1011 +#define CL_D3D9_RESOURCE_ALREADY_ACQUIRED_NV -1012 +#define CL_D3D9_RESOURCE_NOT_ACQUIRED_NV -1013 + +// cl_d3d9_device_source_nv +#define CL_D3D9_DEVICE_NV 0x4022 +#define CL_D3D9_ADAPTER_NAME_NV 0x4023 + +// cl_d3d9_device_set_nv +#define CL_PREFERRED_DEVICES_FOR_D3D9_NV 0x4024 +#define CL_ALL_DEVICES_FOR_D3D9_NV 0x4025 + +// cl_context_info +#define CL_CONTEXT_D3D9_DEVICE_NV 0x4026 + +// cl_mem_info +#define CL_MEM_D3D9_RESOURCE_NV 0x4027 + +// cl_image_info +#define CL_IMAGE_D3D9_FACE_NV 0x4028 +#define CL_IMAGE_D3D9_LEVEL_NV 0x4029 + +// cl_command_type +#define CL_COMMAND_ACQUIRE_D3D9_OBJECTS_NV 0x402A +#define CL_COMMAND_RELEASE_D3D9_OBJECTS_NV 0x402B + +/******************************************************************************/ + +typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D9NV_fn)( + cl_platform_id platform, + cl_d3d9_device_source_nv d3d_device_source, + void * d3d_object, + cl_d3d9_device_set_nv d3d_device_set, + cl_uint num_entries, + cl_device_id * devices, + cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_0; + +typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D9VertexBufferNV_fn)( + cl_context context, + cl_mem_flags flags, + IDirect3DVertexBuffer9 * resource, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D9IndexBufferNV_fn)( + cl_context context, + cl_mem_flags flags, + IDirect3DIndexBuffer9 * resource, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D9SurfaceNV_fn)( + cl_context context, + cl_mem_flags flags, + IDirect3DSurface9 * resource, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D9TextureNV_fn)( + cl_context context, + cl_mem_flags flags, + IDirect3DTexture9 *resource, + UINT miplevel, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D9CubeTextureNV_fn)( + cl_context context, + cl_mem_flags flags, + IDirect3DCubeTexture9 * resource, + D3DCUBEMAP_FACES facetype, + UINT miplevel, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D9VolumeTextureNV_fn)( + cl_context context, + cl_mem_flags flags, + IDirect3DVolumeTexture9 * resource, + UINT miplevel, + cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D9ObjectsNV_fn)( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem *mem_objects, + cl_uint num_events_in_wait_list, + const cl_event *event_wait_list, + cl_event *event) CL_API_SUFFIX__VERSION_1_0; + +typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueReleaseD3D9ObjectsNV_fn)( + cl_command_queue command_queue, + cl_uint num_objects, + cl_mem *mem_objects, + cl_uint num_events_in_wait_list, + const cl_event *event_wait_list, + cl_event *event) CL_API_SUFFIX__VERSION_1_0; + +#ifdef __cplusplus +} +#endif + +#endif // __OPENCL_CL_D3D9_H + diff --git a/cuda_toolkit/include/CL/cl_dx9_media_sharing.h b/cuda_toolkit/include/CL/cl_dx9_media_sharing.h new file mode 100644 index 0000000000000000000000000000000000000000..75dc1eb46e9b221cbd0b10ea90561ff6366b535a --- /dev/null +++ b/cuda_toolkit/include/CL/cl_dx9_media_sharing.h @@ -0,0 +1,350 @@ +/******************************************************************************* + * Copyright (c) 2008-2023 The Khronos Group Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ + +#ifndef OPENCL_CL_DX9_MEDIA_SHARING_H_ +#define OPENCL_CL_DX9_MEDIA_SHARING_H_ + +/* +** This header is generated from the Khronos OpenCL XML API Registry. +*/ + +#if defined(_WIN32) +#if defined(_MSC_VER) +#if _MSC_VER >=1500 +#pragma warning( push ) +#pragma warning( disable : 4201 ) +#pragma warning( disable : 5105 ) +#endif +#endif +#include +#if defined(_MSC_VER) +#if _MSC_VER >=1500 +#pragma warning( pop ) +#endif +#endif +#endif + +#include + +/* CL_NO_PROTOTYPES implies CL_NO_EXTENSION_PROTOTYPES: */ +#if defined(CL_NO_PROTOTYPES) && !defined(CL_NO_EXTENSION_PROTOTYPES) +#define CL_NO_EXTENSION_PROTOTYPES +#endif + +/* CL_NO_EXTENSION_PROTOTYPES implies + CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES and + CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES: */ +#if defined(CL_NO_EXTENSION_PROTOTYPES) && \ + !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) +#define CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES +#endif +#if defined(CL_NO_EXTENSION_PROTOTYPES) && \ + !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) +#define CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/*************************************************************** +* cl_khr_dx9_media_sharing +***************************************************************/ +#define cl_khr_dx9_media_sharing 1 +#define CL_KHR_DX9_MEDIA_SHARING_EXTENSION_NAME \ + "cl_khr_dx9_media_sharing" + +typedef cl_uint cl_dx9_media_adapter_type_khr; +typedef cl_uint cl_dx9_media_adapter_set_khr; + +#if defined(_WIN32) +typedef struct _cl_dx9_surface_info_khr { + IDirect3DSurface9* resource; + HANDLE shared_handle; +} cl_dx9_surface_info_khr; + +#endif /* defined(_WIN32) */ + +/* Error codes */ +#define CL_INVALID_DX9_MEDIA_ADAPTER_KHR -1010 +#define CL_INVALID_DX9_MEDIA_SURFACE_KHR -1011 +#define CL_DX9_MEDIA_SURFACE_ALREADY_ACQUIRED_KHR -1012 +#define CL_DX9_MEDIA_SURFACE_NOT_ACQUIRED_KHR -1013 + +/* cl_media_adapter_type_khr */ +#define CL_ADAPTER_D3D9_KHR 0x2020 +#define CL_ADAPTER_D3D9EX_KHR 0x2021 +#define CL_ADAPTER_DXVA_KHR 0x2022 + +/* cl_media_adapter_set_khr */ +#define CL_PREFERRED_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR 0x2023 +#define CL_ALL_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR 0x2024 + +/* cl_context_info */ +#define CL_CONTEXT_ADAPTER_D3D9_KHR 0x2025 +#define CL_CONTEXT_ADAPTER_D3D9EX_KHR 0x2026 +#define CL_CONTEXT_ADAPTER_DXVA_KHR 0x2027 + +/* cl_mem_info */ +#define CL_MEM_DX9_MEDIA_ADAPTER_TYPE_KHR 0x2028 +#define CL_MEM_DX9_MEDIA_SURFACE_INFO_KHR 0x2029 + +/* cl_image_info */ +#define CL_IMAGE_DX9_MEDIA_PLANE_KHR 0x202A + +/* cl_command_type */ +#define CL_COMMAND_ACQUIRE_DX9_MEDIA_SURFACES_KHR 0x202B +#define CL_COMMAND_RELEASE_DX9_MEDIA_SURFACES_KHR 0x202C + + +typedef cl_int (CL_API_CALL * +clGetDeviceIDsFromDX9MediaAdapterKHR_fn)( + cl_platform_id platform, + cl_uint num_media_adapters, + cl_dx9_media_adapter_type_khr* media_adapter_type, + void* media_adapters, + cl_dx9_media_adapter_set_khr media_adapter_set, + cl_uint num_entries, + cl_device_id* devices, + cl_uint* num_devices) CL_API_SUFFIX__VERSION_1_2; + +typedef cl_mem (CL_API_CALL * +clCreateFromDX9MediaSurfaceKHR_fn)( + cl_context context, + cl_mem_flags flags, + cl_dx9_media_adapter_type_khr adapter_type, + void* surface_info, + cl_uint plane, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; + +typedef cl_int (CL_API_CALL * +clEnqueueAcquireDX9MediaSurfacesKHR_fn)( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_2; + +typedef cl_int (CL_API_CALL * +clEnqueueReleaseDX9MediaSurfacesKHR_fn)( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_2; + +#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetDeviceIDsFromDX9MediaAdapterKHR( + cl_platform_id platform, + cl_uint num_media_adapters, + cl_dx9_media_adapter_type_khr* media_adapter_type, + void* media_adapters, + cl_dx9_media_adapter_set_khr media_adapter_set, + cl_uint num_entries, + cl_device_id* devices, + cl_uint* num_devices) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateFromDX9MediaSurfaceKHR( + cl_context context, + cl_mem_flags flags, + cl_dx9_media_adapter_type_khr adapter_type, + void* surface_info, + cl_uint plane, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueAcquireDX9MediaSurfacesKHR( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueReleaseDX9MediaSurfacesKHR( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_2; + +#endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_intel_dx9_media_sharing +***************************************************************/ +#define cl_intel_dx9_media_sharing 1 +#define CL_INTEL_DX9_MEDIA_SHARING_EXTENSION_NAME \ + "cl_intel_dx9_media_sharing" + +typedef cl_uint cl_dx9_device_source_intel; +typedef cl_uint cl_dx9_device_set_intel; + +/* Error codes */ +#define CL_INVALID_DX9_DEVICE_INTEL -1010 +#define CL_INVALID_DX9_RESOURCE_INTEL -1011 +#define CL_DX9_RESOURCE_ALREADY_ACQUIRED_INTEL -1012 +#define CL_DX9_RESOURCE_NOT_ACQUIRED_INTEL -1013 + +/* cl_dx9_device_source_intel */ +#define CL_D3D9_DEVICE_INTEL 0x4022 +#define CL_D3D9EX_DEVICE_INTEL 0x4070 +#define CL_DXVA_DEVICE_INTEL 0x4071 + +/* cl_dx9_device_set_intel */ +#define CL_PREFERRED_DEVICES_FOR_DX9_INTEL 0x4024 +#define CL_ALL_DEVICES_FOR_DX9_INTEL 0x4025 + +/* cl_context_info */ +#define CL_CONTEXT_D3D9_DEVICE_INTEL 0x4026 +#define CL_CONTEXT_D3D9EX_DEVICE_INTEL 0x4072 +#define CL_CONTEXT_DXVA_DEVICE_INTEL 0x4073 + +/* cl_mem_info */ +#define CL_MEM_DX9_RESOURCE_INTEL 0x4027 +#define CL_MEM_DX9_SHARED_HANDLE_INTEL 0x4074 + +/* cl_image_info */ +#define CL_IMAGE_DX9_PLANE_INTEL 0x4075 + +/* cl_command_type */ +#define CL_COMMAND_ACQUIRE_DX9_OBJECTS_INTEL 0x402A +#define CL_COMMAND_RELEASE_DX9_OBJECTS_INTEL 0x402B + + +typedef cl_int (CL_API_CALL * +clGetDeviceIDsFromDX9INTEL_fn)( + cl_platform_id platform, + cl_dx9_device_source_intel dx9_device_source, + void* dx9_object, + cl_dx9_device_set_intel dx9_device_set, + cl_uint num_entries, + cl_device_id* devices, + cl_uint* num_devices) CL_API_SUFFIX__VERSION_1_1; + +typedef cl_mem (CL_API_CALL * +clCreateFromDX9MediaSurfaceINTEL_fn)( + cl_context context, + cl_mem_flags flags, + IDirect3DSurface9* resource, + HANDLE sharedHandle, + UINT plane, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_1; + +typedef cl_int (CL_API_CALL * +clEnqueueAcquireDX9ObjectsINTEL_fn)( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_1; + +typedef cl_int (CL_API_CALL * +clEnqueueReleaseDX9ObjectsINTEL_fn)( + cl_command_queue command_queue, + cl_uint num_objects, + cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_1; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetDeviceIDsFromDX9INTEL( + cl_platform_id platform, + cl_dx9_device_source_intel dx9_device_source, + void* dx9_object, + cl_dx9_device_set_intel dx9_device_set, + cl_uint num_entries, + cl_device_id* devices, + cl_uint* num_devices) CL_API_SUFFIX__VERSION_1_1; + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateFromDX9MediaSurfaceINTEL( + cl_context context, + cl_mem_flags flags, + IDirect3DSurface9* resource, + HANDLE sharedHandle, + UINT plane, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_1; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueAcquireDX9ObjectsINTEL( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_1; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueReleaseDX9ObjectsINTEL( + cl_command_queue command_queue, + cl_uint num_objects, + cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_1; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_intel_sharing_format_query_dx9 +***************************************************************/ +#define cl_intel_sharing_format_query_dx9 1 +#define CL_INTEL_SHARING_FORMAT_QUERY_DX9_EXTENSION_NAME \ + "cl_intel_sharing_format_query_dx9" + +/* when cl_khr_dx9_media_sharing or cl_intel_dx9_media_sharing is supported */ + +typedef cl_int (CL_API_CALL * +clGetSupportedDX9MediaSurfaceFormatsINTEL_fn)( + cl_context context, + cl_mem_flags flags, + cl_mem_object_type image_type, + cl_uint plane, + cl_uint num_entries, + D3DFORMAT* dx9_formats, + cl_uint* num_surface_formats) ; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetSupportedDX9MediaSurfaceFormatsINTEL( + cl_context context, + cl_mem_flags flags, + cl_mem_object_type image_type, + cl_uint plane, + cl_uint num_entries, + D3DFORMAT* dx9_formats, + cl_uint* num_surface_formats) ; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +#ifdef __cplusplus +} +#endif + +#endif /* OPENCL_CL_DX9_MEDIA_SHARING_H_ */ diff --git a/cuda_toolkit/include/CL/cl_egl.h b/cuda_toolkit/include/CL/cl_egl.h new file mode 100644 index 0000000000000000000000000000000000000000..c9d064d3bfc120c6763c831bc43ed942276c4c19 --- /dev/null +++ b/cuda_toolkit/include/CL/cl_egl.h @@ -0,0 +1,167 @@ +/******************************************************************************* + * Copyright (c) 2008-2023 The Khronos Group Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ + +#ifndef OPENCL_CL_EGL_H_ +#define OPENCL_CL_EGL_H_ + +/* +** This header is generated from the Khronos OpenCL XML API Registry. +*/ + +#include + +/* CL_NO_PROTOTYPES implies CL_NO_EXTENSION_PROTOTYPES: */ +#if defined(CL_NO_PROTOTYPES) && !defined(CL_NO_EXTENSION_PROTOTYPES) +#define CL_NO_EXTENSION_PROTOTYPES +#endif + +/* CL_NO_EXTENSION_PROTOTYPES implies + CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES and + CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES: */ +#if defined(CL_NO_EXTENSION_PROTOTYPES) && \ + !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) +#define CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES +#endif +#if defined(CL_NO_EXTENSION_PROTOTYPES) && \ + !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) +#define CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/*************************************************************** +* cl_khr_egl_image +***************************************************************/ +#define cl_khr_egl_image 1 +#define CL_KHR_EGL_IMAGE_EXTENSION_NAME \ + "cl_khr_egl_image" + +/* Command type for events created with clEnqueueAcquireEGLObjectsKHR */ +#define CL_COMMAND_EGL_FENCE_SYNC_OBJECT_KHR 0x202F +#define CL_COMMAND_ACQUIRE_EGL_OBJECTS_KHR 0x202D +#define CL_COMMAND_RELEASE_EGL_OBJECTS_KHR 0x202E + +/* Error type for clCreateFromEGLImageKHR */ +#define CL_INVALID_EGL_OBJECT_KHR -1093 +#define CL_EGL_RESOURCE_NOT_ACQUIRED_KHR -1092 + +/* CLeglImageKHR is an opaque handle to an EGLImage */ +typedef void* CLeglImageKHR; + +/* CLeglDisplayKHR is an opaque handle to an EGLDisplay */ +typedef void* CLeglDisplayKHR; + +/* properties passed to clCreateFromEGLImageKHR */ +typedef intptr_t cl_egl_image_properties_khr; + + +typedef cl_mem (CL_API_CALL * +clCreateFromEGLImageKHR_fn)( + cl_context context, + CLeglDisplayKHR egldisplay, + CLeglImageKHR eglimage, + cl_mem_flags flags, + const cl_egl_image_properties_khr* properties, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +typedef cl_int (CL_API_CALL * +clEnqueueAcquireEGLObjectsKHR_fn)( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_0; + +typedef cl_int (CL_API_CALL * +clEnqueueReleaseEGLObjectsKHR_fn)( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_0; + +#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateFromEGLImageKHR( + cl_context context, + CLeglDisplayKHR egldisplay, + CLeglImageKHR eglimage, + cl_mem_flags flags, + const cl_egl_image_properties_khr* properties, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueAcquireEGLObjectsKHR( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueReleaseEGLObjectsKHR( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_0; + +#endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_khr_egl_event +***************************************************************/ +#define cl_khr_egl_event 1 +#define CL_KHR_EGL_EVENT_EXTENSION_NAME \ + "cl_khr_egl_event" + +/* CLeglDisplayKHR is an opaque handle to an EGLDisplay */ +/* type CLeglDisplayKHR */ + +/* CLeglSyncKHR is an opaque handle to an EGLSync object */ +typedef void* CLeglSyncKHR; + + +typedef cl_event (CL_API_CALL * +clCreateEventFromEGLSyncKHR_fn)( + cl_context context, + CLeglSyncKHR sync, + CLeglDisplayKHR display, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_event CL_API_CALL +clCreateEventFromEGLSyncKHR( + cl_context context, + CLeglSyncKHR sync, + CLeglDisplayKHR display, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +#endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +#ifdef __cplusplus +} +#endif + +#endif /* OPENCL_CL_EGL_H_ */ diff --git a/cuda_toolkit/include/CL/cl_ext.h b/cuda_toolkit/include/CL/cl_ext.h new file mode 100644 index 0000000000000000000000000000000000000000..f1ea161b7e261df541af38c9f7744740125dbc14 --- /dev/null +++ b/cuda_toolkit/include/CL/cl_ext.h @@ -0,0 +1,3322 @@ +/******************************************************************************* + * Copyright (c) 2008-2023 The Khronos Group Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ + +#ifndef OPENCL_CL_EXT_H_ +#define OPENCL_CL_EXT_H_ + +/* +** This header is generated from the Khronos OpenCL XML API Registry. +*/ + +#include + +/* CL_NO_PROTOTYPES implies CL_NO_EXTENSION_PROTOTYPES: */ +#if defined(CL_NO_PROTOTYPES) && !defined(CL_NO_EXTENSION_PROTOTYPES) +#define CL_NO_EXTENSION_PROTOTYPES +#endif + +/* CL_NO_EXTENSION_PROTOTYPES implies + CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES and + CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES: */ +#if defined(CL_NO_EXTENSION_PROTOTYPES) && \ + !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) +#define CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES +#endif +#if defined(CL_NO_EXTENSION_PROTOTYPES) && \ + !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) +#define CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/*************************************************************** +* cl_khr_command_buffer +***************************************************************/ +#define cl_khr_command_buffer 1 +#define CL_KHR_COMMAND_BUFFER_EXTENSION_NAME \ + "cl_khr_command_buffer" + +typedef cl_bitfield cl_device_command_buffer_capabilities_khr; +typedef struct _cl_command_buffer_khr* cl_command_buffer_khr; +typedef cl_uint cl_sync_point_khr; +typedef cl_uint cl_command_buffer_info_khr; +typedef cl_uint cl_command_buffer_state_khr; +typedef cl_properties cl_command_buffer_properties_khr; +typedef cl_bitfield cl_command_buffer_flags_khr; +typedef cl_properties cl_ndrange_kernel_command_properties_khr; +typedef struct _cl_mutable_command_khr* cl_mutable_command_khr; + +/* cl_device_info */ +#define CL_DEVICE_COMMAND_BUFFER_CAPABILITIES_KHR 0x12A9 +#define CL_DEVICE_COMMAND_BUFFER_REQUIRED_QUEUE_PROPERTIES_KHR 0x12AA + +/* cl_device_command_buffer_capabilities_khr - bitfield */ +#define CL_COMMAND_BUFFER_CAPABILITY_KERNEL_PRINTF_KHR (1 << 0) +#define CL_COMMAND_BUFFER_CAPABILITY_DEVICE_SIDE_ENQUEUE_KHR (1 << 1) +#define CL_COMMAND_BUFFER_CAPABILITY_SIMULTANEOUS_USE_KHR (1 << 2) +#define CL_COMMAND_BUFFER_CAPABILITY_OUT_OF_ORDER_KHR (1 << 3) + +/* cl_command_buffer_properties_khr */ +#define CL_COMMAND_BUFFER_FLAGS_KHR 0x1293 + +/* cl_command_buffer_flags_khr - bitfield */ +#define CL_COMMAND_BUFFER_SIMULTANEOUS_USE_KHR (1 << 0) + +/* Error codes */ +#define CL_INVALID_COMMAND_BUFFER_KHR -1138 +#define CL_INVALID_SYNC_POINT_WAIT_LIST_KHR -1139 +#define CL_INCOMPATIBLE_COMMAND_QUEUE_KHR -1140 + +/* cl_command_buffer_info_khr */ +#define CL_COMMAND_BUFFER_QUEUES_KHR 0x1294 +#define CL_COMMAND_BUFFER_NUM_QUEUES_KHR 0x1295 +#define CL_COMMAND_BUFFER_REFERENCE_COUNT_KHR 0x1296 +#define CL_COMMAND_BUFFER_STATE_KHR 0x1297 +#define CL_COMMAND_BUFFER_PROPERTIES_ARRAY_KHR 0x1298 +#define CL_COMMAND_BUFFER_CONTEXT_KHR 0x1299 + +/* cl_command_buffer_state_khr */ +#define CL_COMMAND_BUFFER_STATE_RECORDING_KHR 0 +#define CL_COMMAND_BUFFER_STATE_EXECUTABLE_KHR 1 +#define CL_COMMAND_BUFFER_STATE_PENDING_KHR 2 +#define CL_COMMAND_BUFFER_STATE_INVALID_KHR 3 + +/* cl_command_type */ +#define CL_COMMAND_COMMAND_BUFFER_KHR 0x12A8 + + +typedef cl_command_buffer_khr (CL_API_CALL * +clCreateCommandBufferKHR_fn)( + cl_uint num_queues, + const cl_command_queue* queues, + const cl_command_buffer_properties_khr* properties, + cl_int* errcode_ret) ; + +typedef cl_int (CL_API_CALL * +clFinalizeCommandBufferKHR_fn)( + cl_command_buffer_khr command_buffer) ; + +typedef cl_int (CL_API_CALL * +clRetainCommandBufferKHR_fn)( + cl_command_buffer_khr command_buffer) ; + +typedef cl_int (CL_API_CALL * +clReleaseCommandBufferKHR_fn)( + cl_command_buffer_khr command_buffer) ; + +typedef cl_int (CL_API_CALL * +clEnqueueCommandBufferKHR_fn)( + cl_uint num_queues, + cl_command_queue* queues, + cl_command_buffer_khr command_buffer, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) ; + +typedef cl_int (CL_API_CALL * +clCommandBarrierWithWaitListKHR_fn)( + cl_command_buffer_khr command_buffer, + cl_command_queue command_queue, + cl_uint num_sync_points_in_wait_list, + const cl_sync_point_khr* sync_point_wait_list, + cl_sync_point_khr* sync_point, + cl_mutable_command_khr* mutable_handle) ; + +typedef cl_int (CL_API_CALL * +clCommandCopyBufferKHR_fn)( + cl_command_buffer_khr command_buffer, + cl_command_queue command_queue, + cl_mem src_buffer, + cl_mem dst_buffer, + size_t src_offset, + size_t dst_offset, + size_t size, + cl_uint num_sync_points_in_wait_list, + const cl_sync_point_khr* sync_point_wait_list, + cl_sync_point_khr* sync_point, + cl_mutable_command_khr* mutable_handle) ; + +typedef cl_int (CL_API_CALL * +clCommandCopyBufferRectKHR_fn)( + cl_command_buffer_khr command_buffer, + cl_command_queue command_queue, + cl_mem src_buffer, + cl_mem dst_buffer, + const size_t* src_origin, + const size_t* dst_origin, + const size_t* region, + size_t src_row_pitch, + size_t src_slice_pitch, + size_t dst_row_pitch, + size_t dst_slice_pitch, + cl_uint num_sync_points_in_wait_list, + const cl_sync_point_khr* sync_point_wait_list, + cl_sync_point_khr* sync_point, + cl_mutable_command_khr* mutable_handle) ; + +typedef cl_int (CL_API_CALL * +clCommandCopyBufferToImageKHR_fn)( + cl_command_buffer_khr command_buffer, + cl_command_queue command_queue, + cl_mem src_buffer, + cl_mem dst_image, + size_t src_offset, + const size_t* dst_origin, + const size_t* region, + cl_uint num_sync_points_in_wait_list, + const cl_sync_point_khr* sync_point_wait_list, + cl_sync_point_khr* sync_point, + cl_mutable_command_khr* mutable_handle) ; + +typedef cl_int (CL_API_CALL * +clCommandCopyImageKHR_fn)( + cl_command_buffer_khr command_buffer, + cl_command_queue command_queue, + cl_mem src_image, + cl_mem dst_image, + const size_t* src_origin, + const size_t* dst_origin, + const size_t* region, + cl_uint num_sync_points_in_wait_list, + const cl_sync_point_khr* sync_point_wait_list, + cl_sync_point_khr* sync_point, + cl_mutable_command_khr* mutable_handle) ; + +typedef cl_int (CL_API_CALL * +clCommandCopyImageToBufferKHR_fn)( + cl_command_buffer_khr command_buffer, + cl_command_queue command_queue, + cl_mem src_image, + cl_mem dst_buffer, + const size_t* src_origin, + const size_t* region, + size_t dst_offset, + cl_uint num_sync_points_in_wait_list, + const cl_sync_point_khr* sync_point_wait_list, + cl_sync_point_khr* sync_point, + cl_mutable_command_khr* mutable_handle) ; + +typedef cl_int (CL_API_CALL * +clCommandFillBufferKHR_fn)( + cl_command_buffer_khr command_buffer, + cl_command_queue command_queue, + cl_mem buffer, + const void* pattern, + size_t pattern_size, + size_t offset, + size_t size, + cl_uint num_sync_points_in_wait_list, + const cl_sync_point_khr* sync_point_wait_list, + cl_sync_point_khr* sync_point, + cl_mutable_command_khr* mutable_handle) ; + +typedef cl_int (CL_API_CALL * +clCommandFillImageKHR_fn)( + cl_command_buffer_khr command_buffer, + cl_command_queue command_queue, + cl_mem image, + const void* fill_color, + const size_t* origin, + const size_t* region, + cl_uint num_sync_points_in_wait_list, + const cl_sync_point_khr* sync_point_wait_list, + cl_sync_point_khr* sync_point, + cl_mutable_command_khr* mutable_handle) ; + +typedef cl_int (CL_API_CALL * +clCommandNDRangeKernelKHR_fn)( + cl_command_buffer_khr command_buffer, + cl_command_queue command_queue, + const cl_ndrange_kernel_command_properties_khr* properties, + cl_kernel kernel, + cl_uint work_dim, + const size_t* global_work_offset, + const size_t* global_work_size, + const size_t* local_work_size, + cl_uint num_sync_points_in_wait_list, + const cl_sync_point_khr* sync_point_wait_list, + cl_sync_point_khr* sync_point, + cl_mutable_command_khr* mutable_handle) ; + +typedef cl_int (CL_API_CALL * +clGetCommandBufferInfoKHR_fn)( + cl_command_buffer_khr command_buffer, + cl_command_buffer_info_khr param_name, + size_t param_value_size, + void* param_value, + size_t* param_value_size_ret) ; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_command_buffer_khr CL_API_CALL +clCreateCommandBufferKHR( + cl_uint num_queues, + const cl_command_queue* queues, + const cl_command_buffer_properties_khr* properties, + cl_int* errcode_ret) ; + +extern CL_API_ENTRY cl_int CL_API_CALL +clFinalizeCommandBufferKHR( + cl_command_buffer_khr command_buffer) ; + +extern CL_API_ENTRY cl_int CL_API_CALL +clRetainCommandBufferKHR( + cl_command_buffer_khr command_buffer) ; + +extern CL_API_ENTRY cl_int CL_API_CALL +clReleaseCommandBufferKHR( + cl_command_buffer_khr command_buffer) ; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueCommandBufferKHR( + cl_uint num_queues, + cl_command_queue* queues, + cl_command_buffer_khr command_buffer, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) ; + +extern CL_API_ENTRY cl_int CL_API_CALL +clCommandBarrierWithWaitListKHR( + cl_command_buffer_khr command_buffer, + cl_command_queue command_queue, + cl_uint num_sync_points_in_wait_list, + const cl_sync_point_khr* sync_point_wait_list, + cl_sync_point_khr* sync_point, + cl_mutable_command_khr* mutable_handle) ; + +extern CL_API_ENTRY cl_int CL_API_CALL +clCommandCopyBufferKHR( + cl_command_buffer_khr command_buffer, + cl_command_queue command_queue, + cl_mem src_buffer, + cl_mem dst_buffer, + size_t src_offset, + size_t dst_offset, + size_t size, + cl_uint num_sync_points_in_wait_list, + const cl_sync_point_khr* sync_point_wait_list, + cl_sync_point_khr* sync_point, + cl_mutable_command_khr* mutable_handle) ; + +extern CL_API_ENTRY cl_int CL_API_CALL +clCommandCopyBufferRectKHR( + cl_command_buffer_khr command_buffer, + cl_command_queue command_queue, + cl_mem src_buffer, + cl_mem dst_buffer, + const size_t* src_origin, + const size_t* dst_origin, + const size_t* region, + size_t src_row_pitch, + size_t src_slice_pitch, + size_t dst_row_pitch, + size_t dst_slice_pitch, + cl_uint num_sync_points_in_wait_list, + const cl_sync_point_khr* sync_point_wait_list, + cl_sync_point_khr* sync_point, + cl_mutable_command_khr* mutable_handle) ; + +extern CL_API_ENTRY cl_int CL_API_CALL +clCommandCopyBufferToImageKHR( + cl_command_buffer_khr command_buffer, + cl_command_queue command_queue, + cl_mem src_buffer, + cl_mem dst_image, + size_t src_offset, + const size_t* dst_origin, + const size_t* region, + cl_uint num_sync_points_in_wait_list, + const cl_sync_point_khr* sync_point_wait_list, + cl_sync_point_khr* sync_point, + cl_mutable_command_khr* mutable_handle) ; + +extern CL_API_ENTRY cl_int CL_API_CALL +clCommandCopyImageKHR( + cl_command_buffer_khr command_buffer, + cl_command_queue command_queue, + cl_mem src_image, + cl_mem dst_image, + const size_t* src_origin, + const size_t* dst_origin, + const size_t* region, + cl_uint num_sync_points_in_wait_list, + const cl_sync_point_khr* sync_point_wait_list, + cl_sync_point_khr* sync_point, + cl_mutable_command_khr* mutable_handle) ; + +extern CL_API_ENTRY cl_int CL_API_CALL +clCommandCopyImageToBufferKHR( + cl_command_buffer_khr command_buffer, + cl_command_queue command_queue, + cl_mem src_image, + cl_mem dst_buffer, + const size_t* src_origin, + const size_t* region, + size_t dst_offset, + cl_uint num_sync_points_in_wait_list, + const cl_sync_point_khr* sync_point_wait_list, + cl_sync_point_khr* sync_point, + cl_mutable_command_khr* mutable_handle) ; + +extern CL_API_ENTRY cl_int CL_API_CALL +clCommandFillBufferKHR( + cl_command_buffer_khr command_buffer, + cl_command_queue command_queue, + cl_mem buffer, + const void* pattern, + size_t pattern_size, + size_t offset, + size_t size, + cl_uint num_sync_points_in_wait_list, + const cl_sync_point_khr* sync_point_wait_list, + cl_sync_point_khr* sync_point, + cl_mutable_command_khr* mutable_handle) ; + +extern CL_API_ENTRY cl_int CL_API_CALL +clCommandFillImageKHR( + cl_command_buffer_khr command_buffer, + cl_command_queue command_queue, + cl_mem image, + const void* fill_color, + const size_t* origin, + const size_t* region, + cl_uint num_sync_points_in_wait_list, + const cl_sync_point_khr* sync_point_wait_list, + cl_sync_point_khr* sync_point, + cl_mutable_command_khr* mutable_handle) ; + +extern CL_API_ENTRY cl_int CL_API_CALL +clCommandNDRangeKernelKHR( + cl_command_buffer_khr command_buffer, + cl_command_queue command_queue, + const cl_ndrange_kernel_command_properties_khr* properties, + cl_kernel kernel, + cl_uint work_dim, + const size_t* global_work_offset, + const size_t* global_work_size, + const size_t* local_work_size, + cl_uint num_sync_points_in_wait_list, + const cl_sync_point_khr* sync_point_wait_list, + cl_sync_point_khr* sync_point, + cl_mutable_command_khr* mutable_handle) ; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetCommandBufferInfoKHR( + cl_command_buffer_khr command_buffer, + cl_command_buffer_info_khr param_name, + size_t param_value_size, + void* param_value, + size_t* param_value_size_ret) ; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_khr_command_buffer_multi_device +***************************************************************/ +#define cl_khr_command_buffer_multi_device 1 +#define CL_KHR_COMMAND_BUFFER_MULTI_DEVICE_EXTENSION_NAME \ + "cl_khr_command_buffer_multi_device" + +typedef cl_bitfield cl_platform_command_buffer_capabilities_khr; + +/* cl_platform_info */ +#define CL_PLATFORM_COMMAND_BUFFER_CAPABILITIES_KHR 0x0908 + +/* cl_platform_command_buffer_capabilities_khr - bitfield */ +#define CL_COMMAND_BUFFER_PLATFORM_UNIVERSAL_SYNC_KHR (1 << 0) +#define CL_COMMAND_BUFFER_PLATFORM_REMAP_QUEUES_KHR (1 << 1) +#define CL_COMMAND_BUFFER_PLATFORM_AUTOMATIC_REMAP_KHR (1 << 2) + +/* cl_device_info */ +#define CL_DEVICE_COMMAND_BUFFER_NUM_SYNC_DEVICES_KHR 0x12AB +#define CL_DEVICE_COMMAND_BUFFER_SYNC_DEVICES_KHR 0x12AC + +/* cl_device_command_buffer_capabilities_khr - bitfield */ +#define CL_COMMAND_BUFFER_CAPABILITY_MULTIPLE_QUEUE_KHR (1 << 4) + +/* cl_command_buffer_flags_khr - bitfield */ +#define CL_COMMAND_BUFFER_DEVICE_SIDE_SYNC_KHR (1 << 2) + + +typedef cl_command_buffer_khr (CL_API_CALL * +clRemapCommandBufferKHR_fn)( + cl_command_buffer_khr command_buffer, + cl_bool automatic, + cl_uint num_queues, + const cl_command_queue* queues, + cl_uint num_handles, + const cl_mutable_command_khr* handles, + cl_mutable_command_khr* handles_ret, + cl_int* errcode_ret) ; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_command_buffer_khr CL_API_CALL +clRemapCommandBufferKHR( + cl_command_buffer_khr command_buffer, + cl_bool automatic, + cl_uint num_queues, + const cl_command_queue* queues, + cl_uint num_handles, + const cl_mutable_command_khr* handles, + cl_mutable_command_khr* handles_ret, + cl_int* errcode_ret) ; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_khr_command_buffer_mutable_dispatch +***************************************************************/ +#define cl_khr_command_buffer_mutable_dispatch 1 +#define CL_KHR_COMMAND_BUFFER_MUTABLE_DISPATCH_EXTENSION_NAME \ + "cl_khr_command_buffer_mutable_dispatch" + +typedef cl_uint cl_command_buffer_structure_type_khr; +typedef cl_bitfield cl_mutable_dispatch_fields_khr; +typedef cl_uint cl_mutable_command_info_khr; +typedef struct _cl_mutable_dispatch_arg_khr { + cl_uint arg_index; + size_t arg_size; + const void* arg_value; +} cl_mutable_dispatch_arg_khr; +typedef struct _cl_mutable_dispatch_exec_info_khr { + cl_uint param_name; + size_t param_value_size; + const void* param_value; +} cl_mutable_dispatch_exec_info_khr; +typedef struct _cl_mutable_dispatch_config_khr { + cl_command_buffer_structure_type_khr type; + const void* next; + cl_mutable_command_khr command; + cl_uint num_args; + cl_uint num_svm_args; + cl_uint num_exec_infos; + cl_uint work_dim; + const cl_mutable_dispatch_arg_khr* arg_list; + const cl_mutable_dispatch_arg_khr* arg_svm_list; + const cl_mutable_dispatch_exec_info_khr* exec_info_list; + const size_t* global_work_offset; + const size_t* global_work_size; + const size_t* local_work_size; +} cl_mutable_dispatch_config_khr; +typedef struct _cl_mutable_base_config_khr { + cl_command_buffer_structure_type_khr type; + const void* next; + cl_uint num_mutable_dispatch; + const cl_mutable_dispatch_config_khr* mutable_dispatch_list; +} cl_mutable_base_config_khr; + +/* cl_command_buffer_flags_khr - bitfield */ +#define CL_COMMAND_BUFFER_MUTABLE_KHR (1 << 1) + +/* Error codes */ +#define CL_INVALID_MUTABLE_COMMAND_KHR -1141 + +/* cl_device_info */ +#define CL_DEVICE_MUTABLE_DISPATCH_CAPABILITIES_KHR 0x12B0 + +/* cl_ndrange_kernel_command_properties_khr */ +#define CL_MUTABLE_DISPATCH_UPDATABLE_FIELDS_KHR 0x12B1 + +/* cl_mutable_dispatch_fields_khr - bitfield */ +#define CL_MUTABLE_DISPATCH_GLOBAL_OFFSET_KHR (1 << 0) +#define CL_MUTABLE_DISPATCH_GLOBAL_SIZE_KHR (1 << 1) +#define CL_MUTABLE_DISPATCH_LOCAL_SIZE_KHR (1 << 2) +#define CL_MUTABLE_DISPATCH_ARGUMENTS_KHR (1 << 3) +#define CL_MUTABLE_DISPATCH_EXEC_INFO_KHR (1 << 4) + +/* cl_mutable_command_info_khr */ +#define CL_MUTABLE_COMMAND_COMMAND_QUEUE_KHR 0x12A0 +#define CL_MUTABLE_COMMAND_COMMAND_BUFFER_KHR 0x12A1 +#define CL_MUTABLE_COMMAND_COMMAND_TYPE_KHR 0x12AD +#define CL_MUTABLE_DISPATCH_PROPERTIES_ARRAY_KHR 0x12A2 +#define CL_MUTABLE_DISPATCH_KERNEL_KHR 0x12A3 +#define CL_MUTABLE_DISPATCH_DIMENSIONS_KHR 0x12A4 +#define CL_MUTABLE_DISPATCH_GLOBAL_WORK_OFFSET_KHR 0x12A5 +#define CL_MUTABLE_DISPATCH_GLOBAL_WORK_SIZE_KHR 0x12A6 +#define CL_MUTABLE_DISPATCH_LOCAL_WORK_SIZE_KHR 0x12A7 + +/* cl_command_buffer_structure_type_khr */ +#define CL_STRUCTURE_TYPE_MUTABLE_BASE_CONFIG_KHR 0 +#define CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR 1 + + +typedef cl_int (CL_API_CALL * +clUpdateMutableCommandsKHR_fn)( + cl_command_buffer_khr command_buffer, + const cl_mutable_base_config_khr* mutable_config) ; + +typedef cl_int (CL_API_CALL * +clGetMutableCommandInfoKHR_fn)( + cl_mutable_command_khr command, + cl_mutable_command_info_khr param_name, + size_t param_value_size, + void* param_value, + size_t* param_value_size_ret) ; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_int CL_API_CALL +clUpdateMutableCommandsKHR( + cl_command_buffer_khr command_buffer, + const cl_mutable_base_config_khr* mutable_config) ; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetMutableCommandInfoKHR( + cl_mutable_command_khr command, + cl_mutable_command_info_khr param_name, + size_t param_value_size, + void* param_value, + size_t* param_value_size_ret) ; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_khr_fp64 +***************************************************************/ +#define cl_khr_fp64 1 +#define CL_KHR_FP64_EXTENSION_NAME \ + "cl_khr_fp64" + +#if !defined(CL_VERSION_1_2) +/* cl_device_info - defined in CL.h for OpenCL 1.2 and newer */ +#define CL_DEVICE_DOUBLE_FP_CONFIG 0x1032 + +#endif /* !defined(CL_VERSION_1_2) */ + +/*************************************************************** +* cl_khr_fp16 +***************************************************************/ +#define cl_khr_fp16 1 +#define CL_KHR_FP16_EXTENSION_NAME \ + "cl_khr_fp16" + +/* cl_device_info */ +#define CL_DEVICE_HALF_FP_CONFIG 0x1033 + +/*************************************************************** +* cl_APPLE_SetMemObjectDestructor +***************************************************************/ +#define cl_APPLE_SetMemObjectDestructor 1 +#define CL_APPLE_SETMEMOBJECTDESTRUCTOR_EXTENSION_NAME \ + "cl_APPLE_SetMemObjectDestructor" + + +typedef cl_int (CL_API_CALL * +clSetMemObjectDestructorAPPLE_fn)( + cl_mem memobj, + void (CL_CALLBACK* pfn_notify)(cl_mem memobj, void* user_data), + void* user_data) CL_API_SUFFIX__VERSION_1_0; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_int CL_API_CALL +clSetMemObjectDestructorAPPLE( + cl_mem memobj, + void (CL_CALLBACK* pfn_notify)(cl_mem memobj, void* user_data), + void* user_data) CL_API_SUFFIX__VERSION_1_0; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_APPLE_ContextLoggingFunctions +***************************************************************/ +#define cl_APPLE_ContextLoggingFunctions 1 +#define CL_APPLE_CONTEXTLOGGINGFUNCTIONS_EXTENSION_NAME \ + "cl_APPLE_ContextLoggingFunctions" + + +typedef void (CL_API_CALL * +clLogMessagesToSystemLogAPPLE_fn)( + const char* errstr, + const void* private_info, + size_t cb, + void* user_data) CL_API_SUFFIX__VERSION_1_0; + +typedef void (CL_API_CALL * +clLogMessagesToStdoutAPPLE_fn)( + const char* errstr, + const void* private_info, + size_t cb, + void* user_data) CL_API_SUFFIX__VERSION_1_0; + +typedef void (CL_API_CALL * +clLogMessagesToStderrAPPLE_fn)( + const char* errstr, + const void* private_info, + size_t cb, + void* user_data) CL_API_SUFFIX__VERSION_1_0; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY void CL_API_CALL +clLogMessagesToSystemLogAPPLE( + const char* errstr, + const void* private_info, + size_t cb, + void* user_data) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY void CL_API_CALL +clLogMessagesToStdoutAPPLE( + const char* errstr, + const void* private_info, + size_t cb, + void* user_data) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY void CL_API_CALL +clLogMessagesToStderrAPPLE( + const char* errstr, + const void* private_info, + size_t cb, + void* user_data) CL_API_SUFFIX__VERSION_1_0; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_khr_icd +***************************************************************/ +#define cl_khr_icd 1 +#define CL_KHR_ICD_EXTENSION_NAME \ + "cl_khr_icd" + +/* cl_platform_info */ +#define CL_PLATFORM_ICD_SUFFIX_KHR 0x0920 + +/* Error codes */ +#define CL_PLATFORM_NOT_FOUND_KHR -1001 + + +typedef cl_int (CL_API_CALL * +clIcdGetPlatformIDsKHR_fn)( + cl_uint num_entries, + cl_platform_id* platforms, + cl_uint* num_platforms) ; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_int CL_API_CALL +clIcdGetPlatformIDsKHR( + cl_uint num_entries, + cl_platform_id* platforms, + cl_uint* num_platforms) ; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_khr_il_program +***************************************************************/ +#define cl_khr_il_program 1 +#define CL_KHR_IL_PROGRAM_EXTENSION_NAME \ + "cl_khr_il_program" + +/* cl_device_info */ +#define CL_DEVICE_IL_VERSION_KHR 0x105B + +/* cl_program_info */ +#define CL_PROGRAM_IL_KHR 0x1169 + + +typedef cl_program (CL_API_CALL * +clCreateProgramWithILKHR_fn)( + cl_context context, + const void* il, + size_t length, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_program CL_API_CALL +clCreateProgramWithILKHR( + cl_context context, + const void* il, + size_t length, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_khr_image2d_from_buffer +***************************************************************/ +#define cl_khr_image2d_from_buffer 1 +#define CL_KHR_IMAGE2D_FROM_BUFFER_EXTENSION_NAME \ + "cl_khr_image2d_from_buffer" + +/* cl_device_info */ +#define CL_DEVICE_IMAGE_PITCH_ALIGNMENT_KHR 0x104A +#define CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT_KHR 0x104B + +/*************************************************************** +* cl_khr_initialize_memory +***************************************************************/ +#define cl_khr_initialize_memory 1 +#define CL_KHR_INITIALIZE_MEMORY_EXTENSION_NAME \ + "cl_khr_initialize_memory" + +/* Interop tokens */ +#define CL_CONTEXT_MEMORY_INITIALIZE_KHR 0x2030 + +/*************************************************************** +* cl_khr_terminate_context +***************************************************************/ +#define cl_khr_terminate_context 1 +#define CL_KHR_TERMINATE_CONTEXT_EXTENSION_NAME \ + "cl_khr_terminate_context" + +typedef cl_bitfield cl_device_terminate_capability_khr; + +/* cl_device_info */ +#define CL_DEVICE_TERMINATE_CAPABILITY_KHR 0x2031 + +/* cl_context_properties */ +#define CL_CONTEXT_TERMINATE_KHR 0x2032 + +/* cl_device_terminate_capability_khr */ +#define CL_DEVICE_TERMINATE_CAPABILITY_CONTEXT_KHR (1 << 0) + +/* Error codes */ +#define CL_CONTEXT_TERMINATED_KHR -1121 + + +typedef cl_int (CL_API_CALL * +clTerminateContextKHR_fn)( + cl_context context) CL_API_SUFFIX__VERSION_1_2; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_int CL_API_CALL +clTerminateContextKHR( + cl_context context) CL_API_SUFFIX__VERSION_1_2; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_khr_spir +***************************************************************/ +#define cl_khr_spir 1 +#define CL_KHR_SPIR_EXTENSION_NAME \ + "cl_khr_spir" + +/* cl_device_info */ +#define CL_DEVICE_SPIR_VERSIONS 0x40E0 + +/* cl_program_binary_type */ +#define CL_PROGRAM_BINARY_TYPE_INTERMEDIATE 0x40E1 + +/*************************************************************** +* cl_khr_create_command_queue +***************************************************************/ +#define cl_khr_create_command_queue 1 +#define CL_KHR_CREATE_COMMAND_QUEUE_EXTENSION_NAME \ + "cl_khr_create_command_queue" + +typedef cl_properties cl_queue_properties_khr; + + +typedef cl_command_queue (CL_API_CALL * +clCreateCommandQueueWithPropertiesKHR_fn)( + cl_context context, + cl_device_id device, + const cl_queue_properties_khr* properties, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_command_queue CL_API_CALL +clCreateCommandQueueWithPropertiesKHR( + cl_context context, + cl_device_id device, + const cl_queue_properties_khr* properties, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_nv_device_attribute_query +***************************************************************/ +#define cl_nv_device_attribute_query 1 +#define CL_NV_DEVICE_ATTRIBUTE_QUERY_EXTENSION_NAME \ + "cl_nv_device_attribute_query" + +/* cl_device_info */ +#define CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV 0x4000 +#define CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV 0x4001 +#define CL_DEVICE_REGISTERS_PER_BLOCK_NV 0x4002 +#define CL_DEVICE_WARP_SIZE_NV 0x4003 +#define CL_DEVICE_GPU_OVERLAP_NV 0x4004 +#define CL_DEVICE_KERNEL_EXEC_TIMEOUT_NV 0x4005 +#define CL_DEVICE_INTEGRATED_MEMORY_NV 0x4006 +#define CL_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT_NV 0x4007 +#define CL_DEVICE_PCI_BUS_ID_NV 0x4008 +#define CL_DEVICE_PCI_SLOT_ID_NV 0x4009 +#define CL_DEVICE_PCI_DOMAIN_ID_NV 0x400A +#define CL_DEVICE_MAX_LOCAL_MEMORY_PER_SM_NV 0x400B + +/****************************************** +* cl_nv_create_buffer extension * +******************************************/ + +typedef cl_bitfield cl_mem_flags_NV; +CL_API_ENTRY cl_mem CL_API_CALL +clCreateBufferNV(cl_context context, + cl_mem_flags flags, + cl_mem_flags_NV flags_NV, + size_t size, + void *host_ptr, + cl_int *errcode_ret); + +/****************************************** +* cl_kernel_attribute_nv extension * +*******************************************/ + +typedef enum kernel_attribute_enum { + CL_KERNEL_PREFERRED_LOCAL_MEMORY_SIZE_NV = 0, /* setting preferred shared memory size */ +} cl_kernel_attribute_nv; + +CL_API_ENTRY cl_int CL_API_CALL +clSetKernelAttributeNV(cl_kernel kernel, + cl_device_id device, + cl_kernel_attribute_nv k_attr, + size_t param_value_size, + const void *param_value); + +CL_API_ENTRY cl_int CL_API_CALL +clGetKernelAttributeNV(cl_kernel kernel, + cl_device_id device, + cl_kernel_attribute_nv k_attr, + size_t param_value_size, + void *param_value, + size_t *param_value_size_ret); + +#define CL_MEM_LOCATION_HOST_NV (1 << 0) +#define CL_MEM_PINNED_NV (1 << 1) + +/*************************************************************** +* cl_amd_device_attribute_query +***************************************************************/ +#define cl_amd_device_attribute_query 1 +#define CL_AMD_DEVICE_ATTRIBUTE_QUERY_EXTENSION_NAME \ + "cl_amd_device_attribute_query" + +/* cl_device_info */ +#define CL_DEVICE_PROFILING_TIMER_OFFSET_AMD 0x4036 +#define CL_DEVICE_TOPOLOGY_AMD 0x4037 +#define CL_DEVICE_BOARD_NAME_AMD 0x4038 +#define CL_DEVICE_GLOBAL_FREE_MEMORY_AMD 0x4039 +#define CL_DEVICE_SIMD_PER_COMPUTE_UNIT_AMD 0x4040 +#define CL_DEVICE_SIMD_WIDTH_AMD 0x4041 +#define CL_DEVICE_SIMD_INSTRUCTION_WIDTH_AMD 0x4042 +#define CL_DEVICE_WAVEFRONT_WIDTH_AMD 0x4043 +#define CL_DEVICE_GLOBAL_MEM_CHANNELS_AMD 0x4044 +#define CL_DEVICE_GLOBAL_MEM_CHANNEL_BANKS_AMD 0x4045 +#define CL_DEVICE_GLOBAL_MEM_CHANNEL_BANK_WIDTH_AMD 0x4046 +#define CL_DEVICE_LOCAL_MEM_SIZE_PER_COMPUTE_UNIT_AMD 0x4047 +#define CL_DEVICE_LOCAL_MEM_BANKS_AMD 0x4048 +#define CL_DEVICE_THREAD_TRACE_SUPPORTED_AMD 0x4049 +#define CL_DEVICE_GFXIP_MAJOR_AMD 0x404A +#define CL_DEVICE_GFXIP_MINOR_AMD 0x404B +#define CL_DEVICE_AVAILABLE_ASYNC_QUEUES_AMD 0x404C +#define CL_DEVICE_PREFERRED_WORK_GROUP_SIZE_AMD 0x4030 +#define CL_DEVICE_MAX_WORK_GROUP_SIZE_AMD 0x4031 +#define CL_DEVICE_PREFERRED_CONSTANT_BUFFER_SIZE_AMD 0x4033 +#define CL_DEVICE_PCIE_ID_AMD 0x4034 + +/*************************************************************** +* cl_arm_printf +***************************************************************/ +#define cl_arm_printf 1 +#define CL_ARM_PRINTF_EXTENSION_NAME \ + "cl_arm_printf" + +/* cl_context_properties */ +#define CL_PRINTF_CALLBACK_ARM 0x40B0 +#define CL_PRINTF_BUFFERSIZE_ARM 0x40B1 + +/*************************************************************** +* cl_ext_device_fission +***************************************************************/ +#define cl_ext_device_fission 1 +#define CL_EXT_DEVICE_FISSION_EXTENSION_NAME \ + "cl_ext_device_fission" + +typedef cl_ulong cl_device_partition_property_ext; + +/* Error codes */ +#define CL_DEVICE_PARTITION_FAILED_EXT -1057 +#define CL_INVALID_PARTITION_COUNT_EXT -1058 +#define CL_INVALID_PARTITION_NAME_EXT -1059 + +/* cl_device_info */ +#define CL_DEVICE_PARENT_DEVICE_EXT 0x4054 +#define CL_DEVICE_PARTITION_TYPES_EXT 0x4055 +#define CL_DEVICE_AFFINITY_DOMAINS_EXT 0x4056 +#define CL_DEVICE_REFERENCE_COUNT_EXT 0x4057 +#define CL_DEVICE_PARTITION_STYLE_EXT 0x4058 + +/* cl_device_partition_property_ext */ +#define CL_DEVICE_PARTITION_EQUALLY_EXT 0x4050 +#define CL_DEVICE_PARTITION_BY_COUNTS_EXT 0x4051 +#define CL_DEVICE_PARTITION_BY_NAMES_EXT 0x4052 +#define CL_DEVICE_PARTITION_BY_AFFINITY_DOMAIN_EXT 0x4053 + +/* cl_device_partition_property_ext - affinity domains */ +#define CL_AFFINITY_DOMAIN_L1_CACHE_EXT 0x1 +#define CL_AFFINITY_DOMAIN_L2_CACHE_EXT 0x2 +#define CL_AFFINITY_DOMAIN_L3_CACHE_EXT 0x3 +#define CL_AFFINITY_DOMAIN_L4_CACHE_EXT 0x4 +#define CL_AFFINITY_DOMAIN_NUMA_EXT 0x10 +#define CL_AFFINITY_DOMAIN_NEXT_FISSIONABLE_EXT 0x100 + +/* cl_device_partition_property_ext - list terminators */ +#define CL_PROPERTIES_LIST_END_EXT ((cl_device_partition_property_ext)0) +#define CL_PARTITION_BY_COUNTS_LIST_END_EXT ((cl_device_partition_property_ext)0) +#define CL_PARTITION_BY_NAMES_LIST_END_EXT ((cl_device_partition_property_ext)0 - 1) + + +typedef cl_int (CL_API_CALL * +clReleaseDeviceEXT_fn)( + cl_device_id device) CL_API_SUFFIX__VERSION_1_1; + +typedef cl_int (CL_API_CALL * +clRetainDeviceEXT_fn)( + cl_device_id device) CL_API_SUFFIX__VERSION_1_1; + +typedef cl_int (CL_API_CALL * +clCreateSubDevicesEXT_fn)( + cl_device_id in_device, + const cl_device_partition_property_ext* properties, + cl_uint num_entries, + cl_device_id* out_devices, + cl_uint* num_devices) CL_API_SUFFIX__VERSION_1_1; + +#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_int CL_API_CALL +clReleaseDeviceEXT( + cl_device_id device) CL_API_SUFFIX__VERSION_1_1; + +extern CL_API_ENTRY cl_int CL_API_CALL +clRetainDeviceEXT( + cl_device_id device) CL_API_SUFFIX__VERSION_1_1; + +extern CL_API_ENTRY cl_int CL_API_CALL +clCreateSubDevicesEXT( + cl_device_id in_device, + const cl_device_partition_property_ext* properties, + cl_uint num_entries, + cl_device_id* out_devices, + cl_uint* num_devices) CL_API_SUFFIX__VERSION_1_1; + +#endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_ext_migrate_memobject +***************************************************************/ +#define cl_ext_migrate_memobject 1 +#define CL_EXT_MIGRATE_MEMOBJECT_EXTENSION_NAME \ + "cl_ext_migrate_memobject" + +typedef cl_bitfield cl_mem_migration_flags_ext; + +/* cl_mem_migration_flags_ext */ +#define CL_MIGRATE_MEM_OBJECT_HOST_EXT (1 << 0) + +/* cl_command_type */ +#define CL_COMMAND_MIGRATE_MEM_OBJECT_EXT 0x4040 + + +typedef cl_int (CL_API_CALL * +clEnqueueMigrateMemObjectEXT_fn)( + cl_command_queue command_queue, + cl_uint num_mem_objects, + const cl_mem* mem_objects, + cl_mem_migration_flags_ext flags, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) ; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueMigrateMemObjectEXT( + cl_command_queue command_queue, + cl_uint num_mem_objects, + const cl_mem* mem_objects, + cl_mem_migration_flags_ext flags, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) ; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_ext_cxx_for_opencl +***************************************************************/ +#define cl_ext_cxx_for_opencl 1 +#define CL_EXT_CXX_FOR_OPENCL_EXTENSION_NAME \ + "cl_ext_cxx_for_opencl" + +/* cl_device_info */ +#define CL_DEVICE_CXX_FOR_OPENCL_NUMERIC_VERSION_EXT 0x4230 + +/*************************************************************** +* cl_qcom_ext_host_ptr +***************************************************************/ +#define cl_qcom_ext_host_ptr 1 +#define CL_QCOM_EXT_HOST_PTR_EXTENSION_NAME \ + "cl_qcom_ext_host_ptr" + +typedef cl_uint cl_image_pitch_info_qcom; +typedef struct _cl_mem_ext_host_ptr { + cl_uint allocation_type; + cl_uint host_cache_policy; +} cl_mem_ext_host_ptr; + +/* cl_mem_flags */ +#define CL_MEM_EXT_HOST_PTR_QCOM (1 << 29) + +/* cl_device_info */ +#define CL_DEVICE_EXT_MEM_PADDING_IN_BYTES_QCOM 0x40A0 +#define CL_DEVICE_PAGE_SIZE_QCOM 0x40A1 + +/* cl_image_pitch_info_qcom */ +#define CL_IMAGE_ROW_ALIGNMENT_QCOM 0x40A2 +#define CL_IMAGE_SLICE_ALIGNMENT_QCOM 0x40A3 + +/* cl_uint host_cache_policy */ +#define CL_MEM_HOST_UNCACHED_QCOM 0x40A4 +#define CL_MEM_HOST_WRITEBACK_QCOM 0x40A5 +#define CL_MEM_HOST_WRITETHROUGH_QCOM 0x40A6 +#define CL_MEM_HOST_WRITE_COMBINING_QCOM 0x40A7 + + +typedef cl_int (CL_API_CALL * +clGetDeviceImageInfoQCOM_fn)( + cl_device_id device, + size_t image_width, + size_t image_height, + const cl_image_format* image_format, + cl_image_pitch_info_qcom param_name, + size_t param_value_size, + void* param_value, + size_t* param_value_size_ret) ; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetDeviceImageInfoQCOM( + cl_device_id device, + size_t image_width, + size_t image_height, + const cl_image_format* image_format, + cl_image_pitch_info_qcom param_name, + size_t param_value_size, + void* param_value, + size_t* param_value_size_ret) ; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_qcom_ext_host_ptr_iocoherent +***************************************************************/ +#define cl_qcom_ext_host_ptr_iocoherent 1 +#define CL_QCOM_EXT_HOST_PTR_IOCOHERENT_EXTENSION_NAME \ + "cl_qcom_ext_host_ptr_iocoherent" + +/* cl_uint host_cache_policy */ +#define CL_MEM_HOST_IOCOHERENT_QCOM 0x40A9 + +/*************************************************************** +* cl_qcom_ion_host_ptr +***************************************************************/ +#define cl_qcom_ion_host_ptr 1 +#define CL_QCOM_ION_HOST_PTR_EXTENSION_NAME \ + "cl_qcom_ion_host_ptr" + +/* type cl_mem_ext_host_ptr */ +typedef struct _cl_mem_ion_host_ptr { + cl_mem_ext_host_ptr ext_host_ptr; + int ion_filedesc; + void* ion_hostptr; +} cl_mem_ion_host_ptr; + +/* cl_uint allocation_type */ +#define CL_MEM_ION_HOST_PTR_QCOM 0x40A8 + +/*************************************************************** +* cl_qcom_android_native_buffer_host_ptr +***************************************************************/ +#define cl_qcom_android_native_buffer_host_ptr 1 +#define CL_QCOM_ANDROID_NATIVE_BUFFER_HOST_PTR_EXTENSION_NAME \ + "cl_qcom_android_native_buffer_host_ptr" + +/* type cl_mem_ext_host_ptr */ +typedef struct _cl_mem_android_native_buffer_host_ptr { + cl_mem_ext_host_ptr ext_host_ptr; + void* anb_ptr; +} cl_mem_android_native_buffer_host_ptr; + +/* cl_uint allocation_type */ +#define CL_MEM_ANDROID_NATIVE_BUFFER_HOST_PTR_QCOM 0x40C6 + +/*************************************************************** +* cl_img_yuv_image +***************************************************************/ +#define cl_img_yuv_image 1 +#define CL_IMG_YUV_IMAGE_EXTENSION_NAME \ + "cl_img_yuv_image" + +/* cl_channel_order */ +#define CL_NV21_IMG 0x40D0 +#define CL_YV12_IMG 0x40D1 + +/*************************************************************** +* cl_img_cached_allocations +***************************************************************/ +#define cl_img_cached_allocations 1 +#define CL_IMG_CACHED_ALLOCATIONS_EXTENSION_NAME \ + "cl_img_cached_allocations" + +/* cl_mem_flags */ +#define CL_MEM_USE_UNCACHED_CPU_MEMORY_IMG (1 << 26) +#define CL_MEM_USE_CACHED_CPU_MEMORY_IMG (1 << 27) + +/*************************************************************** +* cl_img_use_gralloc_ptr +***************************************************************/ +#define cl_img_use_gralloc_ptr 1 +#define CL_IMG_USE_GRALLOC_PTR_EXTENSION_NAME \ + "cl_img_use_gralloc_ptr" + +/* Error codes */ +#define CL_GRALLOC_RESOURCE_NOT_ACQUIRED_IMG 0x40D4 +#define CL_INVALID_GRALLOC_OBJECT_IMG 0x40D5 + +/* cl_mem_flags */ +#define CL_MEM_USE_GRALLOC_PTR_IMG (1 << 28) + +/* cl_command_type */ +#define CL_COMMAND_ACQUIRE_GRALLOC_OBJECTS_IMG 0x40D2 +#define CL_COMMAND_RELEASE_GRALLOC_OBJECTS_IMG 0x40D3 + + +typedef cl_int (CL_API_CALL * +clEnqueueAcquireGrallocObjectsIMG_fn)( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_2; + +typedef cl_int (CL_API_CALL * +clEnqueueReleaseGrallocObjectsIMG_fn)( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_2; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueAcquireGrallocObjectsIMG( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueReleaseGrallocObjectsIMG( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_2; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_img_generate_mipmap +***************************************************************/ +#define cl_img_generate_mipmap 1 +#define CL_IMG_GENERATE_MIPMAP_EXTENSION_NAME \ + "cl_img_generate_mipmap" + +typedef cl_uint cl_mipmap_filter_mode_img; + +/* cl_mipmap_filter_mode_img */ +#define CL_MIPMAP_FILTER_ANY_IMG 0x0 +#define CL_MIPMAP_FILTER_BOX_IMG 0x1 + +/* cl_command_type */ +#define CL_COMMAND_GENERATE_MIPMAP_IMG 0x40D6 + + +typedef cl_int (CL_API_CALL * +clEnqueueGenerateMipmapIMG_fn)( + cl_command_queue command_queue, + cl_mem src_image, + cl_mem dst_image, + cl_mipmap_filter_mode_img mipmap_filter_mode, + const size_t* array_region, + const size_t* mip_region, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_2; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueGenerateMipmapIMG( + cl_command_queue command_queue, + cl_mem src_image, + cl_mem dst_image, + cl_mipmap_filter_mode_img mipmap_filter_mode, + const size_t* array_region, + const size_t* mip_region, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_2; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_img_mem_properties +***************************************************************/ +#define cl_img_mem_properties 1 +#define CL_IMG_MEM_PROPERTIES_EXTENSION_NAME \ + "cl_img_mem_properties" + +/* cl_mem_properties */ +#define CL_MEM_ALLOC_FLAGS_IMG 0x40D7 + +/* cl_mem_alloc_flags_img */ +#define CL_MEM_ALLOC_RELAX_REQUIREMENTS_IMG (1 << 0) + +/*************************************************************** +* cl_khr_subgroups +***************************************************************/ +#define cl_khr_subgroups 1 +#define CL_KHR_SUBGROUPS_EXTENSION_NAME \ + "cl_khr_subgroups" + +#if !defined(CL_VERSION_2_1) +/* defined in CL.h for OpenCL 2.1 and newer */ +typedef cl_uint cl_kernel_sub_group_info; + +#endif /* !defined(CL_VERSION_2_1) */ + +/* cl_kernel_sub_group_info */ +#define CL_KERNEL_MAX_SUB_GROUP_SIZE_FOR_NDRANGE_KHR 0x2033 +#define CL_KERNEL_SUB_GROUP_COUNT_FOR_NDRANGE_KHR 0x2034 + + +typedef cl_int (CL_API_CALL * +clGetKernelSubGroupInfoKHR_fn)( + cl_kernel in_kernel, + cl_device_id in_device, + cl_kernel_sub_group_info param_name, + size_t input_value_size, + const void* input_value, + size_t param_value_size, + void* param_value, + size_t* param_value_size_ret) CL_API_SUFFIX__VERSION_2_0_DEPRECATED; + +#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetKernelSubGroupInfoKHR( + cl_kernel in_kernel, + cl_device_id in_device, + cl_kernel_sub_group_info param_name, + size_t input_value_size, + const void* input_value, + size_t param_value_size, + void* param_value, + size_t* param_value_size_ret) CL_API_SUFFIX__VERSION_2_0_DEPRECATED; + +#endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_khr_mipmap_image +***************************************************************/ +#define cl_khr_mipmap_image 1 +#define CL_KHR_MIPMAP_IMAGE_EXTENSION_NAME \ + "cl_khr_mipmap_image" + +/* cl_sampler_properties */ +#define CL_SAMPLER_MIP_FILTER_MODE_KHR 0x1155 +#define CL_SAMPLER_LOD_MIN_KHR 0x1156 +#define CL_SAMPLER_LOD_MAX_KHR 0x1157 + +/*************************************************************** +* cl_khr_priority_hints +***************************************************************/ +#define cl_khr_priority_hints 1 +#define CL_KHR_PRIORITY_HINTS_EXTENSION_NAME \ + "cl_khr_priority_hints" + +/* To be used by clGetEventInfo */ +typedef cl_uint cl_queue_priority_khr; + +/* cl_queue_properties */ +#define CL_QUEUE_PRIORITY_KHR 0x1096 + +/* cl_queue_priority_khr */ +#define CL_QUEUE_PRIORITY_HIGH_KHR (1 << 0) +#define CL_QUEUE_PRIORITY_MED_KHR (1 << 1) +#define CL_QUEUE_PRIORITY_LOW_KHR (1 << 2) + +/*************************************************************** +* cl_khr_throttle_hints +***************************************************************/ +#define cl_khr_throttle_hints 1 +#define CL_KHR_THROTTLE_HINTS_EXTENSION_NAME \ + "cl_khr_throttle_hints" + +/* To be used by clGetEventInfo */ +typedef cl_uint cl_queue_throttle_khr; + +/* cl_queue_properties */ +#define CL_QUEUE_THROTTLE_KHR 0x1097 + +/* cl_queue_throttle_khr */ +#define CL_QUEUE_THROTTLE_HIGH_KHR (1 << 0) +#define CL_QUEUE_THROTTLE_MED_KHR (1 << 1) +#define CL_QUEUE_THROTTLE_LOW_KHR (1 << 2) + +/*************************************************************** +* cl_khr_subgroup_named_barrier +***************************************************************/ +#define cl_khr_subgroup_named_barrier 1 +#define CL_KHR_SUBGROUP_NAMED_BARRIER_EXTENSION_NAME \ + "cl_khr_subgroup_named_barrier" + +/* cl_device_info */ +#define CL_DEVICE_MAX_NAMED_BARRIER_COUNT_KHR 0x2035 + +/*************************************************************** +* cl_khr_extended_versioning +***************************************************************/ +#define cl_khr_extended_versioning 1 +#define CL_KHR_EXTENDED_VERSIONING_EXTENSION_NAME \ + "cl_khr_extended_versioning" + +#define CL_VERSION_MAJOR_BITS_KHR 10 +#define CL_VERSION_MINOR_BITS_KHR 10 +#define CL_VERSION_PATCH_BITS_KHR 12 + +#define CL_VERSION_MAJOR_MASK_KHR ((1 << CL_VERSION_MAJOR_BITS_KHR) - 1) +#define CL_VERSION_MINOR_MASK_KHR ((1 << CL_VERSION_MINOR_BITS_KHR) - 1) +#define CL_VERSION_PATCH_MASK_KHR ((1 << CL_VERSION_PATCH_BITS_KHR) - 1) + +#define CL_VERSION_MAJOR_KHR(version) ((version) >> (CL_VERSION_MINOR_BITS_KHR + CL_VERSION_PATCH_BITS_KHR)) +#define CL_VERSION_MINOR_KHR(version) (((version) >> CL_VERSION_PATCH_BITS_KHR) & CL_VERSION_MINOR_MASK_KHR) +#define CL_VERSION_PATCH_KHR(version) ((version) & CL_VERSION_PATCH_MASK_KHR) + +#define CL_MAKE_VERSION_KHR(major, minor, patch) \ + ((((major) & CL_VERSION_MAJOR_MASK_KHR) << (CL_VERSION_MINOR_BITS_KHR + CL_VERSION_PATCH_BITS_KHR)) | \ + (((minor) & CL_VERSION_MINOR_MASK_KHR) << CL_VERSION_PATCH_BITS_KHR) | \ + ((patch) & CL_VERSION_PATCH_MASK_KHR)) + +#define CL_NAME_VERSION_MAX_NAME_SIZE_KHR 64 + +typedef cl_uint cl_version_khr; +typedef struct _cl_name_version_khr { + cl_version_khr version; + char name[CL_NAME_VERSION_MAX_NAME_SIZE_KHR]; +} cl_name_version_khr; + +/* cl_platform_info */ +#define CL_PLATFORM_NUMERIC_VERSION_KHR 0x0906 +#define CL_PLATFORM_EXTENSIONS_WITH_VERSION_KHR 0x0907 + +/* cl_device_info */ +#define CL_DEVICE_NUMERIC_VERSION_KHR 0x105E +#define CL_DEVICE_OPENCL_C_NUMERIC_VERSION_KHR 0x105F +#define CL_DEVICE_EXTENSIONS_WITH_VERSION_KHR 0x1060 +#define CL_DEVICE_ILS_WITH_VERSION_KHR 0x1061 +#define CL_DEVICE_BUILT_IN_KERNELS_WITH_VERSION_KHR 0x1062 + +/*************************************************************** +* cl_khr_device_uuid +***************************************************************/ +#define cl_khr_device_uuid 1 +#define CL_KHR_DEVICE_UUID_EXTENSION_NAME \ + "cl_khr_device_uuid" + +/* Size Constants */ +#define CL_UUID_SIZE_KHR 16 +#define CL_LUID_SIZE_KHR 8 + +/* cl_device_info */ +#define CL_DEVICE_UUID_KHR 0x106A +#define CL_DRIVER_UUID_KHR 0x106B +#define CL_DEVICE_LUID_VALID_KHR 0x106C +#define CL_DEVICE_LUID_KHR 0x106D +#define CL_DEVICE_NODE_MASK_KHR 0x106E + +/*************************************************************** +* cl_khr_pci_bus_info +***************************************************************/ +#define cl_khr_pci_bus_info 1 +#define CL_KHR_PCI_BUS_INFO_EXTENSION_NAME \ + "cl_khr_pci_bus_info" + +typedef struct _cl_device_pci_bus_info_khr { + cl_uint pci_domain; + cl_uint pci_bus; + cl_uint pci_device; + cl_uint pci_function; +} cl_device_pci_bus_info_khr; + +/* cl_device_info */ +#define CL_DEVICE_PCI_BUS_INFO_KHR 0x410F + +/*************************************************************** +* cl_khr_suggested_local_work_size +***************************************************************/ +#define cl_khr_suggested_local_work_size 1 +#define CL_KHR_SUGGESTED_LOCAL_WORK_SIZE_EXTENSION_NAME \ + "cl_khr_suggested_local_work_size" + + +typedef cl_int (CL_API_CALL * +clGetKernelSuggestedLocalWorkSizeKHR_fn)( + cl_command_queue command_queue, + cl_kernel kernel, + cl_uint work_dim, + const size_t* global_work_offset, + const size_t* global_work_size, + size_t* suggested_local_work_size) CL_API_SUFFIX__VERSION_3_0; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetKernelSuggestedLocalWorkSizeKHR( + cl_command_queue command_queue, + cl_kernel kernel, + cl_uint work_dim, + const size_t* global_work_offset, + const size_t* global_work_size, + size_t* suggested_local_work_size) CL_API_SUFFIX__VERSION_3_0; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_khr_integer_dot_product +***************************************************************/ +#define cl_khr_integer_dot_product 1 +#define CL_KHR_INTEGER_DOT_PRODUCT_EXTENSION_NAME \ + "cl_khr_integer_dot_product" + +typedef cl_bitfield cl_device_integer_dot_product_capabilities_khr; +typedef struct _cl_device_integer_dot_product_acceleration_properties_khr { + cl_bool signed_accelerated; + cl_bool unsigned_accelerated; + cl_bool mixed_signedness_accelerated; + cl_bool accumulating_saturating_signed_accelerated; + cl_bool accumulating_saturating_unsigned_accelerated; + cl_bool accumulating_saturating_mixed_signedness_accelerated; +} cl_device_integer_dot_product_acceleration_properties_khr; + +/* cl_device_integer_dot_product_capabilities_khr */ +#define CL_DEVICE_INTEGER_DOT_PRODUCT_INPUT_4x8BIT_PACKED_KHR (1 << 0) +#define CL_DEVICE_INTEGER_DOT_PRODUCT_INPUT_4x8BIT_KHR (1 << 1) + +/* cl_device_info */ +#define CL_DEVICE_INTEGER_DOT_PRODUCT_CAPABILITIES_KHR 0x1073 +#define CL_DEVICE_INTEGER_DOT_PRODUCT_ACCELERATION_PROPERTIES_8BIT_KHR 0x1074 +#define CL_DEVICE_INTEGER_DOT_PRODUCT_ACCELERATION_PROPERTIES_4x8BIT_PACKED_KHR 0x1075 + +/*************************************************************** +* cl_khr_external_memory +***************************************************************/ +#define cl_khr_external_memory 1 +#define CL_KHR_EXTERNAL_MEMORY_EXTENSION_NAME \ + "cl_khr_external_memory" + +typedef cl_uint cl_external_memory_handle_type_khr; + +/* cl_platform_info */ +#define CL_PLATFORM_EXTERNAL_MEMORY_IMPORT_HANDLE_TYPES_KHR 0x2044 + +/* cl_device_info */ +#define CL_DEVICE_EXTERNAL_MEMORY_IMPORT_HANDLE_TYPES_KHR 0x204F +#define CL_DEVICE_EXTERNAL_MEMORY_IMPORT_ASSUME_LINEAR_IMAGES_HANDLE_TYPES_KHR 0x2052 + +/* cl_mem_properties */ +#define CL_MEM_DEVICE_HANDLE_LIST_KHR 0x2051 +#define CL_MEM_DEVICE_HANDLE_LIST_END_KHR 0 + +/* cl_command_type */ +#define CL_COMMAND_ACQUIRE_EXTERNAL_MEM_OBJECTS_KHR 0x2047 +#define CL_COMMAND_RELEASE_EXTERNAL_MEM_OBJECTS_KHR 0x2048 + + +typedef cl_int (CL_API_CALL * +clEnqueueAcquireExternalMemObjectsKHR_fn)( + cl_command_queue command_queue, + cl_uint num_mem_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_3_0; + +typedef cl_int (CL_API_CALL * +clEnqueueReleaseExternalMemObjectsKHR_fn)( + cl_command_queue command_queue, + cl_uint num_mem_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_3_0; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueAcquireExternalMemObjectsKHR( + cl_command_queue command_queue, + cl_uint num_mem_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_3_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueReleaseExternalMemObjectsKHR( + cl_command_queue command_queue, + cl_uint num_mem_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_3_0; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_khr_external_memory_dma_buf +***************************************************************/ +#define cl_khr_external_memory_dma_buf 1 +#define CL_KHR_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME \ + "cl_khr_external_memory_dma_buf" + +/* cl_external_memory_handle_type_khr */ +#define CL_EXTERNAL_MEMORY_HANDLE_DMA_BUF_KHR 0x2067 + +/*************************************************************** +* cl_khr_external_memory_dx +***************************************************************/ +#define cl_khr_external_memory_dx 1 +#define CL_KHR_EXTERNAL_MEMORY_DX_EXTENSION_NAME \ + "cl_khr_external_memory_dx" + +/* cl_external_memory_handle_type_khr */ +#define CL_EXTERNAL_MEMORY_HANDLE_D3D11_TEXTURE_KHR 0x2063 +#define CL_EXTERNAL_MEMORY_HANDLE_D3D11_TEXTURE_KMT_KHR 0x2064 +#define CL_EXTERNAL_MEMORY_HANDLE_D3D12_HEAP_KHR 0x2065 +#define CL_EXTERNAL_MEMORY_HANDLE_D3D12_RESOURCE_KHR 0x2066 + +/*************************************************************** +* cl_khr_external_memory_opaque_fd +***************************************************************/ +#define cl_khr_external_memory_opaque_fd 1 +#define CL_KHR_EXTERNAL_MEMORY_OPAQUE_FD_EXTENSION_NAME \ + "cl_khr_external_memory_opaque_fd" + +/* cl_external_memory_handle_type_khr */ +#define CL_EXTERNAL_MEMORY_HANDLE_OPAQUE_FD_KHR 0x2060 + +/*************************************************************** +* cl_khr_external_memory_win32 +***************************************************************/ +#define cl_khr_external_memory_win32 1 +#define CL_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME \ + "cl_khr_external_memory_win32" + +/* cl_external_memory_handle_type_khr */ +#define CL_EXTERNAL_MEMORY_HANDLE_OPAQUE_WIN32_KHR 0x2061 +#define CL_EXTERNAL_MEMORY_HANDLE_OPAQUE_WIN32_KMT_KHR 0x2062 + +/*************************************************************** +* cl_khr_external_semaphore +***************************************************************/ +#define cl_khr_external_semaphore 1 +#define CL_KHR_EXTERNAL_SEMAPHORE_EXTENSION_NAME \ + "cl_khr_external_semaphore" + +typedef struct _cl_semaphore_khr * cl_semaphore_khr; +typedef cl_uint cl_external_semaphore_handle_type_khr; + +/* cl_platform_info */ +#define CL_PLATFORM_SEMAPHORE_IMPORT_HANDLE_TYPES_KHR 0x2037 +#define CL_PLATFORM_SEMAPHORE_EXPORT_HANDLE_TYPES_KHR 0x2038 + +/* cl_device_info */ +#define CL_DEVICE_SEMAPHORE_IMPORT_HANDLE_TYPES_KHR 0x204D +#define CL_DEVICE_SEMAPHORE_EXPORT_HANDLE_TYPES_KHR 0x204E + +/* cl_semaphore_properties_khr */ +#define CL_SEMAPHORE_EXPORT_HANDLE_TYPES_KHR 0x203F +#define CL_SEMAPHORE_EXPORT_HANDLE_TYPES_LIST_END_KHR 0 + + +typedef cl_int (CL_API_CALL * +clGetSemaphoreHandleForTypeKHR_fn)( + cl_semaphore_khr sema_object, + cl_device_id device, + cl_external_semaphore_handle_type_khr handle_type, + size_t handle_size, + void* handle_ptr, + size_t* handle_size_ret) CL_API_SUFFIX__VERSION_1_2; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetSemaphoreHandleForTypeKHR( + cl_semaphore_khr sema_object, + cl_device_id device, + cl_external_semaphore_handle_type_khr handle_type, + size_t handle_size, + void* handle_ptr, + size_t* handle_size_ret) CL_API_SUFFIX__VERSION_1_2; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_khr_external_semaphore_dx_fence +***************************************************************/ +#define cl_khr_external_semaphore_dx_fence 1 +#define CL_KHR_EXTERNAL_SEMAPHORE_DX_FENCE_EXTENSION_NAME \ + "cl_khr_external_semaphore_dx_fence" + +/* cl_external_semaphore_handle_type_khr */ +#define CL_SEMAPHORE_HANDLE_D3D12_FENCE_KHR 0x2059 + +/*************************************************************** +* cl_khr_external_semaphore_opaque_fd +***************************************************************/ +#define cl_khr_external_semaphore_opaque_fd 1 +#define CL_KHR_EXTERNAL_SEMAPHORE_OPAQUE_FD_EXTENSION_NAME \ + "cl_khr_external_semaphore_opaque_fd" + +/* cl_external_semaphore_handle_type_khr */ +#define CL_SEMAPHORE_HANDLE_OPAQUE_FD_KHR 0x2055 + +/*************************************************************** +* cl_khr_external_semaphore_sync_fd +***************************************************************/ +#define cl_khr_external_semaphore_sync_fd 1 +#define CL_KHR_EXTERNAL_SEMAPHORE_SYNC_FD_EXTENSION_NAME \ + "cl_khr_external_semaphore_sync_fd" + +/* cl_external_semaphore_handle_type_khr */ +#define CL_SEMAPHORE_HANDLE_SYNC_FD_KHR 0x2058 + +/*************************************************************** +* cl_khr_external_semaphore_win32 +***************************************************************/ +#define cl_khr_external_semaphore_win32 1 +#define CL_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME \ + "cl_khr_external_semaphore_win32" + +/* cl_external_semaphore_handle_type_khr */ +#define CL_SEMAPHORE_HANDLE_OPAQUE_WIN32_KHR 0x2056 +#define CL_SEMAPHORE_HANDLE_OPAQUE_WIN32_KMT_KHR 0x2057 + +/*************************************************************** +* cl_khr_semaphore +***************************************************************/ +#define cl_khr_semaphore 1 +#define CL_KHR_SEMAPHORE_EXTENSION_NAME \ + "cl_khr_semaphore" + +/* type cl_semaphore_khr */ +typedef cl_properties cl_semaphore_properties_khr; +typedef cl_uint cl_semaphore_info_khr; +typedef cl_uint cl_semaphore_type_khr; +typedef cl_ulong cl_semaphore_payload_khr; + +/* cl_semaphore_type */ +#define CL_SEMAPHORE_TYPE_BINARY_KHR 1 + +/* cl_platform_info */ +#define CL_PLATFORM_SEMAPHORE_TYPES_KHR 0x2036 + +/* cl_device_info */ +#define CL_DEVICE_SEMAPHORE_TYPES_KHR 0x204C + +/* cl_semaphore_info_khr */ +#define CL_SEMAPHORE_CONTEXT_KHR 0x2039 +#define CL_SEMAPHORE_REFERENCE_COUNT_KHR 0x203A +#define CL_SEMAPHORE_PROPERTIES_KHR 0x203B +#define CL_SEMAPHORE_PAYLOAD_KHR 0x203C + +/* cl_semaphore_info_khr or cl_semaphore_properties_khr */ +#define CL_SEMAPHORE_TYPE_KHR 0x203D +#define CL_SEMAPHORE_DEVICE_HANDLE_LIST_KHR 0x2053 +#define CL_SEMAPHORE_DEVICE_HANDLE_LIST_END_KHR 0 + +/* cl_command_type */ +#define CL_COMMAND_SEMAPHORE_WAIT_KHR 0x2042 +#define CL_COMMAND_SEMAPHORE_SIGNAL_KHR 0x2043 + +/* Error codes */ +#define CL_INVALID_SEMAPHORE_KHR -1142 + + +typedef cl_semaphore_khr (CL_API_CALL * +clCreateSemaphoreWithPropertiesKHR_fn)( + cl_context context, + const cl_semaphore_properties_khr* sema_props, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; + +typedef cl_int (CL_API_CALL * +clEnqueueWaitSemaphoresKHR_fn)( + cl_command_queue command_queue, + cl_uint num_sema_objects, + const cl_semaphore_khr* sema_objects, + const cl_semaphore_payload_khr* sema_payload_list, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_2; + +typedef cl_int (CL_API_CALL * +clEnqueueSignalSemaphoresKHR_fn)( + cl_command_queue command_queue, + cl_uint num_sema_objects, + const cl_semaphore_khr* sema_objects, + const cl_semaphore_payload_khr* sema_payload_list, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_2; + +typedef cl_int (CL_API_CALL * +clGetSemaphoreInfoKHR_fn)( + cl_semaphore_khr sema_object, + cl_semaphore_info_khr param_name, + size_t param_value_size, + void* param_value, + size_t* param_value_size_ret) CL_API_SUFFIX__VERSION_1_2; + +typedef cl_int (CL_API_CALL * +clReleaseSemaphoreKHR_fn)( + cl_semaphore_khr sema_object) CL_API_SUFFIX__VERSION_1_2; + +typedef cl_int (CL_API_CALL * +clRetainSemaphoreKHR_fn)( + cl_semaphore_khr sema_object) CL_API_SUFFIX__VERSION_1_2; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_semaphore_khr CL_API_CALL +clCreateSemaphoreWithPropertiesKHR( + cl_context context, + const cl_semaphore_properties_khr* sema_props, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueWaitSemaphoresKHR( + cl_command_queue command_queue, + cl_uint num_sema_objects, + const cl_semaphore_khr* sema_objects, + const cl_semaphore_payload_khr* sema_payload_list, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueSignalSemaphoresKHR( + cl_command_queue command_queue, + cl_uint num_sema_objects, + const cl_semaphore_khr* sema_objects, + const cl_semaphore_payload_khr* sema_payload_list, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetSemaphoreInfoKHR( + cl_semaphore_khr sema_object, + cl_semaphore_info_khr param_name, + size_t param_value_size, + void* param_value, + size_t* param_value_size_ret) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clReleaseSemaphoreKHR( + cl_semaphore_khr sema_object) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clRetainSemaphoreKHR( + cl_semaphore_khr sema_object) CL_API_SUFFIX__VERSION_1_2; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_arm_import_memory +***************************************************************/ +#define cl_arm_import_memory 1 +#define CL_ARM_IMPORT_MEMORY_EXTENSION_NAME \ + "cl_arm_import_memory" + +typedef intptr_t cl_import_properties_arm; + +/* cl_import_properties_arm */ +#define CL_IMPORT_TYPE_ARM 0x40B2 +#define CL_IMPORT_TYPE_HOST_ARM 0x40B3 +#define CL_IMPORT_TYPE_DMA_BUF_ARM 0x40B4 +#define CL_IMPORT_TYPE_PROTECTED_ARM 0x40B5 +#define CL_IMPORT_TYPE_ANDROID_HARDWARE_BUFFER_ARM 0x41E2 +#define CL_IMPORT_DMA_BUF_DATA_CONSISTENCY_WITH_HOST_ARM 0x41E3 +#define CL_IMPORT_MEMORY_WHOLE_ALLOCATION_ARM SIZE_MAX +#define CL_IMPORT_ANDROID_HARDWARE_BUFFER_PLANE_INDEX_ARM 0x41EF +#define CL_IMPORT_ANDROID_HARDWARE_BUFFER_LAYER_INDEX_ARM 0x41F0 + + +typedef cl_mem (CL_API_CALL * +clImportMemoryARM_fn)( + cl_context context, + cl_mem_flags flags, + const cl_import_properties_arm* properties, + void* memory, + size_t size, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_mem CL_API_CALL +clImportMemoryARM( + cl_context context, + cl_mem_flags flags, + const cl_import_properties_arm* properties, + void* memory, + size_t size, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_arm_shared_virtual_memory +***************************************************************/ +#define cl_arm_shared_virtual_memory 1 +#define CL_ARM_SHARED_VIRTUAL_MEMORY_EXTENSION_NAME \ + "cl_arm_shared_virtual_memory" + +typedef cl_bitfield cl_svm_mem_flags_arm; +typedef cl_uint cl_kernel_exec_info_arm; +typedef cl_bitfield cl_device_svm_capabilities_arm; + +/* cl_device_info */ +#define CL_DEVICE_SVM_CAPABILITIES_ARM 0x40B6 + +/* cl_mem_info */ +#define CL_MEM_USES_SVM_POINTER_ARM 0x40B7 + +/* cl_kernel_exec_info_arm */ +#define CL_KERNEL_EXEC_INFO_SVM_PTRS_ARM 0x40B8 +#define CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM_ARM 0x40B9 + +/* cl_command_type */ +#define CL_COMMAND_SVM_FREE_ARM 0x40BA +#define CL_COMMAND_SVM_MEMCPY_ARM 0x40BB +#define CL_COMMAND_SVM_MEMFILL_ARM 0x40BC +#define CL_COMMAND_SVM_MAP_ARM 0x40BD +#define CL_COMMAND_SVM_UNMAP_ARM 0x40BE + +/* cl_device_svm_capabilities_arm */ +#define CL_DEVICE_SVM_COARSE_GRAIN_BUFFER_ARM (1 << 0) +#define CL_DEVICE_SVM_FINE_GRAIN_BUFFER_ARM (1 << 1) +#define CL_DEVICE_SVM_FINE_GRAIN_SYSTEM_ARM (1 << 2) +#define CL_DEVICE_SVM_ATOMICS_ARM (1 << 3) + +/* cl_svm_mem_flags_arm */ +#define CL_MEM_SVM_FINE_GRAIN_BUFFER_ARM (1 << 10) +#define CL_MEM_SVM_ATOMICS_ARM (1 << 11) + + +typedef void* (CL_API_CALL * +clSVMAllocARM_fn)( + cl_context context, + cl_svm_mem_flags_arm flags, + size_t size, + cl_uint alignment) CL_API_SUFFIX__VERSION_1_2; + +typedef void (CL_API_CALL * +clSVMFreeARM_fn)( + cl_context context, + void* svm_pointer) CL_API_SUFFIX__VERSION_1_2; + +typedef cl_int (CL_API_CALL * +clEnqueueSVMFreeARM_fn)( + cl_command_queue command_queue, + cl_uint num_svm_pointers, + void* svm_pointers[], + void (CL_CALLBACK* pfn_free_func)(cl_command_queue queue, cl_uint num_svm_pointers, void * svm_pointers[], void *user_data), + void* user_data, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_2; + +typedef cl_int (CL_API_CALL * +clEnqueueSVMMemcpyARM_fn)( + cl_command_queue command_queue, + cl_bool blocking_copy, + void* dst_ptr, + const void* src_ptr, + size_t size, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_2; + +typedef cl_int (CL_API_CALL * +clEnqueueSVMMemFillARM_fn)( + cl_command_queue command_queue, + void* svm_ptr, + const void* pattern, + size_t pattern_size, + size_t size, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_2; + +typedef cl_int (CL_API_CALL * +clEnqueueSVMMapARM_fn)( + cl_command_queue command_queue, + cl_bool blocking_map, + cl_map_flags flags, + void* svm_ptr, + size_t size, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_2; + +typedef cl_int (CL_API_CALL * +clEnqueueSVMUnmapARM_fn)( + cl_command_queue command_queue, + void* svm_ptr, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_2; + +typedef cl_int (CL_API_CALL * +clSetKernelArgSVMPointerARM_fn)( + cl_kernel kernel, + cl_uint arg_index, + const void* arg_value) CL_API_SUFFIX__VERSION_1_2; + +typedef cl_int (CL_API_CALL * +clSetKernelExecInfoARM_fn)( + cl_kernel kernel, + cl_kernel_exec_info_arm param_name, + size_t param_value_size, + const void* param_value) CL_API_SUFFIX__VERSION_1_2; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY void* CL_API_CALL +clSVMAllocARM( + cl_context context, + cl_svm_mem_flags_arm flags, + size_t size, + cl_uint alignment) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY void CL_API_CALL +clSVMFreeARM( + cl_context context, + void* svm_pointer) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueSVMFreeARM( + cl_command_queue command_queue, + cl_uint num_svm_pointers, + void* svm_pointers[], + void (CL_CALLBACK* pfn_free_func)(cl_command_queue queue, cl_uint num_svm_pointers, void * svm_pointers[], void *user_data), + void* user_data, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueSVMMemcpyARM( + cl_command_queue command_queue, + cl_bool blocking_copy, + void* dst_ptr, + const void* src_ptr, + size_t size, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueSVMMemFillARM( + cl_command_queue command_queue, + void* svm_ptr, + const void* pattern, + size_t pattern_size, + size_t size, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueSVMMapARM( + cl_command_queue command_queue, + cl_bool blocking_map, + cl_map_flags flags, + void* svm_ptr, + size_t size, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueSVMUnmapARM( + cl_command_queue command_queue, + void* svm_ptr, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clSetKernelArgSVMPointerARM( + cl_kernel kernel, + cl_uint arg_index, + const void* arg_value) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clSetKernelExecInfoARM( + cl_kernel kernel, + cl_kernel_exec_info_arm param_name, + size_t param_value_size, + const void* param_value) CL_API_SUFFIX__VERSION_1_2; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_arm_get_core_id +***************************************************************/ +#if defined(CL_VERSION_1_2) + +#define cl_arm_get_core_id 1 +#define CL_ARM_GET_CORE_ID_EXTENSION_NAME \ + "cl_arm_get_core_id" + +/* cl_device_info */ +#define CL_DEVICE_COMPUTE_UNITS_BITFIELD_ARM 0x40BF + +#endif /* defined(CL_VERSION_1_2) */ + +/*************************************************************** +* cl_arm_job_slot_selection +***************************************************************/ +#define cl_arm_job_slot_selection 1 +#define CL_ARM_JOB_SLOT_SELECTION_EXTENSION_NAME \ + "cl_arm_job_slot_selection" + +/* cl_device_info */ +#define CL_DEVICE_JOB_SLOTS_ARM 0x41E0 + +/* cl_queue_properties */ +#define CL_QUEUE_JOB_SLOT_ARM 0x41E1 + +/*************************************************************** +* cl_arm_scheduling_controls +***************************************************************/ +#define cl_arm_scheduling_controls 1 +#define CL_ARM_SCHEDULING_CONTROLS_EXTENSION_NAME \ + "cl_arm_scheduling_controls" + +/* Types */ +typedef cl_bitfield cl_device_scheduling_controls_capabilities_arm; + +/* cl_device_scheduling_controls_capabilities_arm */ +#define CL_DEVICE_SCHEDULING_KERNEL_BATCHING_ARM (1 << 0) +#define CL_DEVICE_SCHEDULING_WORKGROUP_BATCH_SIZE_ARM (1 << 1) +#define CL_DEVICE_SCHEDULING_WORKGROUP_BATCH_SIZE_MODIFIER_ARM (1 << 2) +#define CL_DEVICE_SCHEDULING_DEFERRED_FLUSH_ARM (1 << 3) +#define CL_DEVICE_SCHEDULING_REGISTER_ALLOCATION_ARM (1 << 4) +#define CL_DEVICE_SCHEDULING_WARP_THROTTLING_ARM (1 << 5) +#define CL_DEVICE_SCHEDULING_COMPUTE_UNIT_BATCH_QUEUE_SIZE_ARM (1 << 6) + +/* cl_device_info */ +#define CL_DEVICE_SCHEDULING_CONTROLS_CAPABILITIES_ARM 0x41E4 +#define CL_DEVICE_SUPPORTED_REGISTER_ALLOCATIONS_ARM 0x41EB +#define CL_DEVICE_MAX_WARP_COUNT_ARM 0x41EA + +/* cl_kernel_exec_info */ +#define CL_KERNEL_EXEC_INFO_WORKGROUP_BATCH_SIZE_ARM 0x41E5 +#define CL_KERNEL_EXEC_INFO_WORKGROUP_BATCH_SIZE_MODIFIER_ARM 0x41E6 +#define CL_KERNEL_EXEC_INFO_WARP_COUNT_LIMIT_ARM 0x41E8 +#define CL_KERNEL_EXEC_INFO_COMPUTE_UNIT_MAX_QUEUED_BATCHES_ARM 0x41F1 + +/* cl_kernel_info */ +#define CL_KERNEL_MAX_WARP_COUNT_ARM 0x41E9 + +/* cl_queue_properties */ +#define CL_QUEUE_KERNEL_BATCHING_ARM 0x41E7 +#define CL_QUEUE_DEFERRED_FLUSH_ARM 0x41EC + +/*************************************************************** +* cl_arm_controlled_kernel_termination +***************************************************************/ +#define cl_arm_controlled_kernel_termination 1 +#define CL_ARM_CONTROLLED_KERNEL_TERMINATION_EXTENSION_NAME \ + "cl_arm_controlled_kernel_termination" + +/* Types */ +typedef cl_bitfield cl_device_controlled_termination_capabilities_arm; + +/* Error codes */ +#define CL_COMMAND_TERMINATED_ITSELF_WITH_FAILURE_ARM -1108 + +/* cl_device_controlled_termination_capabilities_arm */ +#define CL_DEVICE_CONTROLLED_TERMINATION_SUCCESS_ARM (1 << 0) +#define CL_DEVICE_CONTROLLED_TERMINATION_FAILURE_ARM (1 << 1) +#define CL_DEVICE_CONTROLLED_TERMINATION_QUERY_ARM (1 << 2) + +/* cl_device_info */ +#define CL_DEVICE_CONTROLLED_TERMINATION_CAPABILITIES_ARM 0x41EE + +/* cl_event_info */ +#define CL_EVENT_COMMAND_TERMINATION_REASON_ARM 0x41ED + +/* cl_command_termination_reason_arm */ +#define CL_COMMAND_TERMINATION_COMPLETION_ARM 0 +#define CL_COMMAND_TERMINATION_CONTROLLED_SUCCESS_ARM 1 +#define CL_COMMAND_TERMINATION_CONTROLLED_FAILURE_ARM 2 +#define CL_COMMAND_TERMINATION_ERROR_ARM 3 + +/*************************************************************** +* cl_arm_protected_memory_allocation +***************************************************************/ +#define cl_arm_protected_memory_allocation 1 +#define CL_ARM_PROTECTED_MEMORY_ALLOCATION_EXTENSION_NAME \ + "cl_arm_protected_memory_allocation" + +#define CL_MEM_PROTECTED_ALLOC_ARM ((cl_bitfield)1 << 36) + +/*************************************************************** +* cl_intel_exec_by_local_thread +***************************************************************/ +#define cl_intel_exec_by_local_thread 1 +#define CL_INTEL_EXEC_BY_LOCAL_THREAD_EXTENSION_NAME \ + "cl_intel_exec_by_local_thread" + +/* cl_command_queue_properties - bitfield */ +#define CL_QUEUE_THREAD_LOCAL_EXEC_ENABLE_INTEL ((cl_bitfield)1 << 31) + +/*************************************************************** +* cl_intel_device_attribute_query +***************************************************************/ +#define cl_intel_device_attribute_query 1 +#define CL_INTEL_DEVICE_ATTRIBUTE_QUERY_EXTENSION_NAME \ + "cl_intel_device_attribute_query" + +typedef cl_bitfield cl_device_feature_capabilities_intel; + +/* cl_device_feature_capabilities_intel */ +#define CL_DEVICE_FEATURE_FLAG_DP4A_INTEL (1 << 0) +#define CL_DEVICE_FEATURE_FLAG_DPAS_INTEL (1 << 1) + +/* cl_device_info */ +#define CL_DEVICE_IP_VERSION_INTEL 0x4250 +#define CL_DEVICE_ID_INTEL 0x4251 +#define CL_DEVICE_NUM_SLICES_INTEL 0x4252 +#define CL_DEVICE_NUM_SUB_SLICES_PER_SLICE_INTEL 0x4253 +#define CL_DEVICE_NUM_EUS_PER_SUB_SLICE_INTEL 0x4254 +#define CL_DEVICE_NUM_THREADS_PER_EU_INTEL 0x4255 +#define CL_DEVICE_FEATURE_CAPABILITIES_INTEL 0x4256 + +/*************************************************************** +* cl_intel_device_partition_by_names +***************************************************************/ +#define cl_intel_device_partition_by_names 1 +#define CL_INTEL_DEVICE_PARTITION_BY_NAMES_EXTENSION_NAME \ + "cl_intel_device_partition_by_names" + +#define CL_DEVICE_PARTITION_BY_NAMES_INTEL 0x4052 +#define CL_PARTITION_BY_NAMES_LIST_END_INTEL -1 + +/*************************************************************** +* cl_intel_accelerator +***************************************************************/ +#define cl_intel_accelerator 1 +#define CL_INTEL_ACCELERATOR_EXTENSION_NAME \ + "cl_intel_accelerator" + +typedef struct _cl_accelerator_intel* cl_accelerator_intel; +typedef cl_uint cl_accelerator_type_intel; +typedef cl_uint cl_accelerator_info_intel; + +/* cl_accelerator_info_intel */ +#define CL_ACCELERATOR_DESCRIPTOR_INTEL 0x4090 +#define CL_ACCELERATOR_REFERENCE_COUNT_INTEL 0x4091 +#define CL_ACCELERATOR_CONTEXT_INTEL 0x4092 +#define CL_ACCELERATOR_TYPE_INTEL 0x4093 + +/* Error codes */ +#define CL_INVALID_ACCELERATOR_INTEL -1094 +#define CL_INVALID_ACCELERATOR_TYPE_INTEL -1095 +#define CL_INVALID_ACCELERATOR_DESCRIPTOR_INTEL -1096 +#define CL_ACCELERATOR_TYPE_NOT_SUPPORTED_INTEL -1097 + + +typedef cl_accelerator_intel (CL_API_CALL * +clCreateAcceleratorINTEL_fn)( + cl_context context, + cl_accelerator_type_intel accelerator_type, + size_t descriptor_size, + const void* descriptor, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; + +typedef cl_int (CL_API_CALL * +clGetAcceleratorInfoINTEL_fn)( + cl_accelerator_intel accelerator, + cl_accelerator_info_intel param_name, + size_t param_value_size, + void* param_value, + size_t* param_value_size_ret) CL_API_SUFFIX__VERSION_1_2; + +typedef cl_int (CL_API_CALL * +clRetainAcceleratorINTEL_fn)( + cl_accelerator_intel accelerator) CL_API_SUFFIX__VERSION_1_2; + +typedef cl_int (CL_API_CALL * +clReleaseAcceleratorINTEL_fn)( + cl_accelerator_intel accelerator) CL_API_SUFFIX__VERSION_1_2; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_accelerator_intel CL_API_CALL +clCreateAcceleratorINTEL( + cl_context context, + cl_accelerator_type_intel accelerator_type, + size_t descriptor_size, + const void* descriptor, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetAcceleratorInfoINTEL( + cl_accelerator_intel accelerator, + cl_accelerator_info_intel param_name, + size_t param_value_size, + void* param_value, + size_t* param_value_size_ret) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clRetainAcceleratorINTEL( + cl_accelerator_intel accelerator) CL_API_SUFFIX__VERSION_1_2; + +extern CL_API_ENTRY cl_int CL_API_CALL +clReleaseAcceleratorINTEL( + cl_accelerator_intel accelerator) CL_API_SUFFIX__VERSION_1_2; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_intel_motion_estimation +***************************************************************/ +#define cl_intel_motion_estimation 1 +#define CL_INTEL_MOTION_ESTIMATION_EXTENSION_NAME \ + "cl_intel_motion_estimation" + +typedef struct _cl_motion_estimation_desc_intel { + cl_uint mb_block_type; + cl_uint subpixel_mode; + cl_uint sad_adjust_mode; + cl_uint search_path_type; +} cl_motion_estimation_desc_intel; + +/* cl_accelerator_type_intel */ +#define CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL 0x0 + +/* cl_uint mb_block_type */ +#define CL_ME_MB_TYPE_16x16_INTEL 0x0 +#define CL_ME_MB_TYPE_8x8_INTEL 0x1 +#define CL_ME_MB_TYPE_4x4_INTEL 0x2 + +/* cl_uint subpixel_mode */ +#define CL_ME_SUBPIXEL_MODE_INTEGER_INTEL 0x0 +#define CL_ME_SUBPIXEL_MODE_HPEL_INTEL 0x1 +#define CL_ME_SUBPIXEL_MODE_QPEL_INTEL 0x2 + +/* cl_uint sad_adjust_mode */ +#define CL_ME_SAD_ADJUST_MODE_NONE_INTEL 0x0 +#define CL_ME_SAD_ADJUST_MODE_HAAR_INTEL 0x1 + +/* cl_uint search_path_type */ +#define CL_ME_SEARCH_PATH_RADIUS_2_2_INTEL 0x0 +#define CL_ME_SEARCH_PATH_RADIUS_4_4_INTEL 0x1 +#define CL_ME_SEARCH_PATH_RADIUS_16_12_INTEL 0x5 + +/*************************************************************** +* cl_intel_advanced_motion_estimation +***************************************************************/ +#define cl_intel_advanced_motion_estimation 1 +#define CL_INTEL_ADVANCED_MOTION_ESTIMATION_EXTENSION_NAME \ + "cl_intel_advanced_motion_estimation" + +/* cl_device_info */ +#define CL_DEVICE_ME_VERSION_INTEL 0x407E + +#define CL_ME_VERSION_LEGACY_INTEL 0x0 +#define CL_ME_VERSION_ADVANCED_VER_1_INTEL 0x1 +#define CL_ME_VERSION_ADVANCED_VER_2_INTEL 0x2 + +#define CL_ME_CHROMA_INTRA_PREDICT_ENABLED_INTEL 0x1 +#define CL_ME_LUMA_INTRA_PREDICT_ENABLED_INTEL 0x2 + +#define CL_ME_SKIP_BLOCK_TYPE_16x16_INTEL 0x0 +#define CL_ME_SKIP_BLOCK_TYPE_8x8_INTEL 0x1 + +#define CL_ME_COST_PENALTY_NONE_INTEL 0x0 +#define CL_ME_COST_PENALTY_LOW_INTEL 0x1 +#define CL_ME_COST_PENALTY_NORMAL_INTEL 0x2 +#define CL_ME_COST_PENALTY_HIGH_INTEL 0x3 + +#define CL_ME_COST_PRECISION_QPEL_INTEL 0x0 +#define CL_ME_COST_PRECISION_HPEL_INTEL 0x1 +#define CL_ME_COST_PRECISION_PEL_INTEL 0x2 +#define CL_ME_COST_PRECISION_DPEL_INTEL 0x3 + +#define CL_ME_LUMA_PREDICTOR_MODE_VERTICAL_INTEL 0x0 +#define CL_ME_LUMA_PREDICTOR_MODE_HORIZONTAL_INTEL 0x1 +#define CL_ME_LUMA_PREDICTOR_MODE_DC_INTEL 0x2 +#define CL_ME_LUMA_PREDICTOR_MODE_DIAGONAL_DOWN_LEFT_INTEL 0x3 +#define CL_ME_LUMA_PREDICTOR_MODE_DIAGONAL_DOWN_RIGHT_INTEL 0x4 +#define CL_ME_LUMA_PREDICTOR_MODE_PLANE_INTEL 0x4 +#define CL_ME_LUMA_PREDICTOR_MODE_VERTICAL_RIGHT_INTEL 0x5 +#define CL_ME_LUMA_PREDICTOR_MODE_HORIZONTAL_DOWN_INTEL 0x6 +#define CL_ME_LUMA_PREDICTOR_MODE_VERTICAL_LEFT_INTEL 0x7 +#define CL_ME_LUMA_PREDICTOR_MODE_HORIZONTAL_UP_INTEL 0x8 + +#define CL_ME_CHROMA_PREDICTOR_MODE_DC_INTEL 0x0 +#define CL_ME_CHROMA_PREDICTOR_MODE_HORIZONTAL_INTEL 0x1 +#define CL_ME_CHROMA_PREDICTOR_MODE_VERTICAL_INTEL 0x2 +#define CL_ME_CHROMA_PREDICTOR_MODE_PLANE_INTEL 0x3 + +#define CL_ME_FORWARD_INPUT_MODE_INTEL 0x1 +#define CL_ME_BACKWARD_INPUT_MODE_INTEL 0x2 +#define CL_ME_BIDIRECTION_INPUT_MODE_INTEL 0x3 + +#define CL_ME_BIDIR_WEIGHT_QUARTER_INTEL 16 +#define CL_ME_BIDIR_WEIGHT_THIRD_INTEL 21 +#define CL_ME_BIDIR_WEIGHT_HALF_INTEL 32 +#define CL_ME_BIDIR_WEIGHT_TWO_THIRD_INTEL 43 +#define CL_ME_BIDIR_WEIGHT_THREE_QUARTER_INTEL 48 + +/*************************************************************** +* cl_intel_simultaneous_sharing +***************************************************************/ +#define cl_intel_simultaneous_sharing 1 +#define CL_INTEL_SIMULTANEOUS_SHARING_EXTENSION_NAME \ + "cl_intel_simultaneous_sharing" + +/* cl_device_info */ +#define CL_DEVICE_SIMULTANEOUS_INTEROPS_INTEL 0x4104 +#define CL_DEVICE_NUM_SIMULTANEOUS_INTEROPS_INTEL 0x4105 + +/*************************************************************** +* cl_intel_egl_image_yuv +***************************************************************/ +#define cl_intel_egl_image_yuv 1 +#define CL_INTEL_EGL_IMAGE_YUV_EXTENSION_NAME \ + "cl_intel_egl_image_yuv" + +/* cl_egl_image_properties_khr */ +#define CL_EGL_YUV_PLANE_INTEL 0x4107 + +/*************************************************************** +* cl_intel_packed_yuv +***************************************************************/ +#define cl_intel_packed_yuv 1 +#define CL_INTEL_PACKED_YUV_EXTENSION_NAME \ + "cl_intel_packed_yuv" + +/* cl_channel_order */ +#define CL_YUYV_INTEL 0x4076 +#define CL_UYVY_INTEL 0x4077 +#define CL_YVYU_INTEL 0x4078 +#define CL_VYUY_INTEL 0x4079 + +/*************************************************************** +* cl_intel_required_subgroup_size +***************************************************************/ +#define cl_intel_required_subgroup_size 1 +#define CL_INTEL_REQUIRED_SUBGROUP_SIZE_EXTENSION_NAME \ + "cl_intel_required_subgroup_size" + +/* cl_device_info */ +#define CL_DEVICE_SUB_GROUP_SIZES_INTEL 0x4108 + +/* cl_kernel_work_group_info */ +#define CL_KERNEL_SPILL_MEM_SIZE_INTEL 0x4109 + +/* cl_kernel_sub_group_info */ +#define CL_KERNEL_COMPILE_SUB_GROUP_SIZE_INTEL 0x410A + +/*************************************************************** +* cl_intel_driver_diagnostics +***************************************************************/ +#define cl_intel_driver_diagnostics 1 +#define CL_INTEL_DRIVER_DIAGNOSTICS_EXTENSION_NAME \ + "cl_intel_driver_diagnostics" + +typedef cl_uint cl_diagnostics_verbose_level; + +/* cl_context_properties */ +#define CL_CONTEXT_SHOW_DIAGNOSTICS_INTEL 0x4106 +#define CL_CONTEXT_DIAGNOSTICS_LEVEL_ALL_INTEL 0xff +#define CL_CONTEXT_DIAGNOSTICS_LEVEL_GOOD_INTEL (1 << 0) +#define CL_CONTEXT_DIAGNOSTICS_LEVEL_BAD_INTEL (1 << 1) +#define CL_CONTEXT_DIAGNOSTICS_LEVEL_NEUTRAL_INTEL (1 << 2) + +/*************************************************************** +* cl_intel_planar_yuv +***************************************************************/ +#define cl_intel_planar_yuv 1 +#define CL_INTEL_PLANAR_YUV_EXTENSION_NAME \ + "cl_intel_planar_yuv" + +/* cl_channel_order */ +#define CL_NV12_INTEL 0x410E + +/* cl_mem_flags */ +#define CL_MEM_NO_ACCESS_INTEL (1 << 24) +#define CL_MEM_ACCESS_FLAGS_UNRESTRICTED_INTEL (1 << 25) + +/* cl_device_info */ +#define CL_DEVICE_PLANAR_YUV_MAX_WIDTH_INTEL 0x417E +#define CL_DEVICE_PLANAR_YUV_MAX_HEIGHT_INTEL 0x417F + +/*************************************************************** +* cl_intel_device_side_avc_motion_estimation +***************************************************************/ +#define cl_intel_device_side_avc_motion_estimation 1 +#define CL_INTEL_DEVICE_SIDE_AVC_MOTION_ESTIMATION_EXTENSION_NAME \ + "cl_intel_device_side_avc_motion_estimation" + +/* cl_device_info */ +#define CL_DEVICE_AVC_ME_VERSION_INTEL 0x410B +#define CL_DEVICE_AVC_ME_SUPPORTS_TEXTURE_SAMPLER_USE_INTEL 0x410C +#define CL_DEVICE_AVC_ME_SUPPORTS_PREEMPTION_INTEL 0x410D + +/* returned by CL_DEVICE_AVC_ME_VERSION_INTEL */ +#define CL_AVC_ME_VERSION_0_INTEL 0x0 +#define CL_AVC_ME_VERSION_1_INTEL 0x1 + +/* Inter macro-block major shape values */ +#define CL_AVC_ME_MAJOR_16x16_INTEL 0x0 +#define CL_AVC_ME_MAJOR_16x8_INTEL 0x1 +#define CL_AVC_ME_MAJOR_8x16_INTEL 0x2 +#define CL_AVC_ME_MAJOR_8x8_INTEL 0x3 + +/* Inter macro-block minor shape values */ +#define CL_AVC_ME_MINOR_8x8_INTEL 0x0 +#define CL_AVC_ME_MINOR_8x4_INTEL 0x1 +#define CL_AVC_ME_MINOR_4x8_INTEL 0x2 +#define CL_AVC_ME_MINOR_4x4_INTEL 0x3 + +/* Inter macro-block major direction values */ +#define CL_AVC_ME_MAJOR_FORWARD_INTEL 0x0 +#define CL_AVC_ME_MAJOR_BACKWARD_INTEL 0x1 +#define CL_AVC_ME_MAJOR_BIDIRECTIONAL_INTEL 0x2 + +/* Inter (IME) partition mask values */ +#define CL_AVC_ME_PARTITION_MASK_ALL_INTEL 0x0 +#define CL_AVC_ME_PARTITION_MASK_16x16_INTEL 0x7E +#define CL_AVC_ME_PARTITION_MASK_16x8_INTEL 0x7D +#define CL_AVC_ME_PARTITION_MASK_8x16_INTEL 0x7B +#define CL_AVC_ME_PARTITION_MASK_8x8_INTEL 0x77 +#define CL_AVC_ME_PARTITION_MASK_8x4_INTEL 0x6F +#define CL_AVC_ME_PARTITION_MASK_4x8_INTEL 0x5F +#define CL_AVC_ME_PARTITION_MASK_4x4_INTEL 0x3F + +/* Search window configuration */ +#define CL_AVC_ME_SEARCH_WINDOW_EXHAUSTIVE_INTEL 0x0 +#define CL_AVC_ME_SEARCH_WINDOW_SMALL_INTEL 0x1 +#define CL_AVC_ME_SEARCH_WINDOW_TINY_INTEL 0x2 +#define CL_AVC_ME_SEARCH_WINDOW_EXTRA_TINY_INTEL 0x3 +#define CL_AVC_ME_SEARCH_WINDOW_DIAMOND_INTEL 0x4 +#define CL_AVC_ME_SEARCH_WINDOW_LARGE_DIAMOND_INTEL 0x5 +#define CL_AVC_ME_SEARCH_WINDOW_RESERVED0_INTEL 0x6 +#define CL_AVC_ME_SEARCH_WINDOW_RESERVED1_INTEL 0x7 +#define CL_AVC_ME_SEARCH_WINDOW_CUSTOM_INTEL 0x8 +#define CL_AVC_ME_SEARCH_WINDOW_16x12_RADIUS_INTEL 0x9 +#define CL_AVC_ME_SEARCH_WINDOW_4x4_RADIUS_INTEL 0x2 +#define CL_AVC_ME_SEARCH_WINDOW_2x2_RADIUS_INTEL 0xa + +/* SAD adjustment mode */ +#define CL_AVC_ME_SAD_ADJUST_MODE_NONE_INTEL 0x0 +#define CL_AVC_ME_SAD_ADJUST_MODE_HAAR_INTEL 0x2 + +/* Pixel resolution */ +#define CL_AVC_ME_SUBPIXEL_MODE_INTEGER_INTEL 0x0 +#define CL_AVC_ME_SUBPIXEL_MODE_HPEL_INTEL 0x1 +#define CL_AVC_ME_SUBPIXEL_MODE_QPEL_INTEL 0x3 + +/* Cost precision values */ +#define CL_AVC_ME_COST_PRECISION_QPEL_INTEL 0x0 +#define CL_AVC_ME_COST_PRECISION_HPEL_INTEL 0x1 +#define CL_AVC_ME_COST_PRECISION_PEL_INTEL 0x2 +#define CL_AVC_ME_COST_PRECISION_DPEL_INTEL 0x3 + +/* Inter bidirectional weights */ +#define CL_AVC_ME_BIDIR_WEIGHT_QUARTER_INTEL 0x10 +#define CL_AVC_ME_BIDIR_WEIGHT_THIRD_INTEL 0x15 +#define CL_AVC_ME_BIDIR_WEIGHT_HALF_INTEL 0x20 +#define CL_AVC_ME_BIDIR_WEIGHT_TWO_THIRD_INTEL 0x2B +#define CL_AVC_ME_BIDIR_WEIGHT_THREE_QUARTER_INTEL 0x30 + +/* Inter border reached values */ +#define CL_AVC_ME_BORDER_REACHED_LEFT_INTEL 0x0 +#define CL_AVC_ME_BORDER_REACHED_RIGHT_INTEL 0x2 +#define CL_AVC_ME_BORDER_REACHED_TOP_INTEL 0x4 +#define CL_AVC_ME_BORDER_REACHED_BOTTOM_INTEL 0x8 + +/* Inter skip block partition type */ +#define CL_AVC_ME_SKIP_BLOCK_PARTITION_16x16_INTEL 0x0 +#define CL_AVC_ME_SKIP_BLOCK_PARTITION_8x8_INTEL 0x4000 + +/* Inter skip motion vector mask */ +#define CL_AVC_ME_SKIP_BLOCK_16x16_FORWARD_ENABLE_INTEL (0x1 << 24) +#define CL_AVC_ME_SKIP_BLOCK_16x16_BACKWARD_ENABLE_INTEL (0x2 << 24) +#define CL_AVC_ME_SKIP_BLOCK_16x16_DUAL_ENABLE_INTEL (0x3 << 24) +#define CL_AVC_ME_SKIP_BLOCK_8x8_FORWARD_ENABLE_INTEL (0x55 << 24) +#define CL_AVC_ME_SKIP_BLOCK_8x8_BACKWARD_ENABLE_INTEL (0xAA << 24) +#define CL_AVC_ME_SKIP_BLOCK_8x8_DUAL_ENABLE_INTEL (0xFF << 24) +#define CL_AVC_ME_SKIP_BLOCK_8x8_0_FORWARD_ENABLE_INTEL (0x1 << 24) +#define CL_AVC_ME_SKIP_BLOCK_8x8_0_BACKWARD_ENABLE_INTEL (0x2 << 24) +#define CL_AVC_ME_SKIP_BLOCK_8x8_1_FORWARD_ENABLE_INTEL (0x1 << 26) +#define CL_AVC_ME_SKIP_BLOCK_8x8_1_BACKWARD_ENABLE_INTEL (0x2 << 26) +#define CL_AVC_ME_SKIP_BLOCK_8x8_2_FORWARD_ENABLE_INTEL (0x1 << 28) +#define CL_AVC_ME_SKIP_BLOCK_8x8_2_BACKWARD_ENABLE_INTEL (0x2 << 28) +#define CL_AVC_ME_SKIP_BLOCK_8x8_3_FORWARD_ENABLE_INTEL (0x1 << 30) +#define CL_AVC_ME_SKIP_BLOCK_8x8_3_BACKWARD_ENABLE_INTEL (0x2 << 30) + +/* Block based skip type values */ +#define CL_AVC_ME_BLOCK_BASED_SKIP_4x4_INTEL 0x00 +#define CL_AVC_ME_BLOCK_BASED_SKIP_8x8_INTEL 0x80 + +/* cl_intel_device_side_avc_motion_estimation.?? */ +#define CL_AVC_ME_INTRA_16x16_INTEL 0x0 +#define CL_AVC_ME_INTRA_8x8_INTEL 0x1 +#define CL_AVC_ME_INTRA_4x4_INTEL 0x2 + +/* Luma intra partition mask values */ +#define CL_AVC_ME_INTRA_LUMA_PARTITION_MASK_16x16_INTEL 0x6 +#define CL_AVC_ME_INTRA_LUMA_PARTITION_MASK_8x8_INTEL 0x5 +#define CL_AVC_ME_INTRA_LUMA_PARTITION_MASK_4x4_INTEL 0x3 + +/* Intra neighbor availability mask values */ +#define CL_AVC_ME_INTRA_NEIGHBOR_LEFT_MASK_ENABLE_INTEL 0x60 +#define CL_AVC_ME_INTRA_NEIGHBOR_UPPER_MASK_ENABLE_INTEL 0x10 +#define CL_AVC_ME_INTRA_NEIGHBOR_UPPER_RIGHT_MASK_ENABLE_INTEL 0x8 +#define CL_AVC_ME_INTRA_NEIGHBOR_UPPER_LEFT_MASK_ENABLE_INTEL 0x4 + +/* Luma intra modes */ +#define CL_AVC_ME_LUMA_PREDICTOR_MODE_VERTICAL_INTEL 0x0 +#define CL_AVC_ME_LUMA_PREDICTOR_MODE_HORIZONTAL_INTEL 0x1 +#define CL_AVC_ME_LUMA_PREDICTOR_MODE_DC_INTEL 0x2 +#define CL_AVC_ME_LUMA_PREDICTOR_MODE_DIAGONAL_DOWN_LEFT_INTEL 0x3 +#define CL_AVC_ME_LUMA_PREDICTOR_MODE_DIAGONAL_DOWN_RIGHT_INTEL 0x4 +#define CL_AVC_ME_LUMA_PREDICTOR_MODE_PLANE_INTEL 0x4 +#define CL_AVC_ME_LUMA_PREDICTOR_MODE_VERTICAL_RIGHT_INTEL 0x5 +#define CL_AVC_ME_LUMA_PREDICTOR_MODE_HORIZONTAL_DOWN_INTEL 0x6 +#define CL_AVC_ME_LUMA_PREDICTOR_MODE_VERTICAL_LEFT_INTEL 0x7 +#define CL_AVC_ME_LUMA_PREDICTOR_MODE_HORIZONTAL_UP_INTEL 0x8 + +/* Chroma intra modes */ +#define CL_AVC_ME_CHROMA_PREDICTOR_MODE_DC_INTEL 0x0 +#define CL_AVC_ME_CHROMA_PREDICTOR_MODE_HORIZONTAL_INTEL 0x1 +#define CL_AVC_ME_CHROMA_PREDICTOR_MODE_VERTICAL_INTEL 0x2 +#define CL_AVC_ME_CHROMA_PREDICTOR_MODE_PLANE_INTEL 0x3 + +/* Reference image select values */ +#define CL_AVC_ME_FRAME_FORWARD_INTEL 0x1 +#define CL_AVC_ME_FRAME_BACKWARD_INTEL 0x2 +#define CL_AVC_ME_FRAME_DUAL_INTEL 0x3 + +/* Slice type values */ +#define CL_AVC_ME_SLICE_TYPE_PRED_INTEL 0x0 +#define CL_AVC_ME_SLICE_TYPE_BPRED_INTEL 0x1 +#define CL_AVC_ME_SLICE_TYPE_INTRA_INTEL 0x2 + +/* Interlaced image field polarity values */ +#define CL_AVC_ME_INTERLACED_SCAN_TOP_FIELD_INTEL 0x0 +#define CL_AVC_ME_INTERLACED_SCAN_BOTTOM_FIELD_INTEL 0x1 + +/*************************************************************** +* cl_intel_unified_shared_memory +***************************************************************/ +#define cl_intel_unified_shared_memory 1 +#define CL_INTEL_UNIFIED_SHARED_MEMORY_EXTENSION_NAME \ + "cl_intel_unified_shared_memory" + +typedef cl_bitfield cl_device_unified_shared_memory_capabilities_intel; +typedef cl_properties cl_mem_properties_intel; +typedef cl_bitfield cl_mem_alloc_flags_intel; +typedef cl_uint cl_mem_info_intel; +typedef cl_uint cl_unified_shared_memory_type_intel; +typedef cl_uint cl_mem_advice_intel; + +/* cl_device_info */ +#define CL_DEVICE_HOST_MEM_CAPABILITIES_INTEL 0x4190 +#define CL_DEVICE_DEVICE_MEM_CAPABILITIES_INTEL 0x4191 +#define CL_DEVICE_SINGLE_DEVICE_SHARED_MEM_CAPABILITIES_INTEL 0x4192 +#define CL_DEVICE_CROSS_DEVICE_SHARED_MEM_CAPABILITIES_INTEL 0x4193 +#define CL_DEVICE_SHARED_SYSTEM_MEM_CAPABILITIES_INTEL 0x4194 + +/* cl_unified_shared_memory_capabilities_intel - bitfield */ +#define CL_UNIFIED_SHARED_MEMORY_ACCESS_INTEL (1 << 0) +#define CL_UNIFIED_SHARED_MEMORY_ATOMIC_ACCESS_INTEL (1 << 1) +#define CL_UNIFIED_SHARED_MEMORY_CONCURRENT_ACCESS_INTEL (1 << 2) +#define CL_UNIFIED_SHARED_MEMORY_CONCURRENT_ATOMIC_ACCESS_INTEL (1 << 3) + +/* cl_mem_properties_intel */ +#define CL_MEM_ALLOC_FLAGS_INTEL 0x4195 + +/* cl_mem_alloc_flags_intel - bitfield */ +#define CL_MEM_ALLOC_WRITE_COMBINED_INTEL (1 << 0) +#define CL_MEM_ALLOC_INITIAL_PLACEMENT_DEVICE_INTEL (1 << 1) +#define CL_MEM_ALLOC_INITIAL_PLACEMENT_HOST_INTEL (1 << 2) + +/* cl_mem_alloc_info_intel */ +#define CL_MEM_ALLOC_TYPE_INTEL 0x419A +#define CL_MEM_ALLOC_BASE_PTR_INTEL 0x419B +#define CL_MEM_ALLOC_SIZE_INTEL 0x419C +#define CL_MEM_ALLOC_DEVICE_INTEL 0x419D + +/* cl_unified_shared_memory_type_intel */ +#define CL_MEM_TYPE_UNKNOWN_INTEL 0x4196 +#define CL_MEM_TYPE_HOST_INTEL 0x4197 +#define CL_MEM_TYPE_DEVICE_INTEL 0x4198 +#define CL_MEM_TYPE_SHARED_INTEL 0x4199 + +/* cl_kernel_exec_info */ +#define CL_KERNEL_EXEC_INFO_INDIRECT_HOST_ACCESS_INTEL 0x4200 +#define CL_KERNEL_EXEC_INFO_INDIRECT_DEVICE_ACCESS_INTEL 0x4201 +#define CL_KERNEL_EXEC_INFO_INDIRECT_SHARED_ACCESS_INTEL 0x4202 +#define CL_KERNEL_EXEC_INFO_USM_PTRS_INTEL 0x4203 + +/* cl_command_type */ +#define CL_COMMAND_MEMFILL_INTEL 0x4204 +#define CL_COMMAND_MEMCPY_INTEL 0x4205 +#define CL_COMMAND_MIGRATEMEM_INTEL 0x4206 +#define CL_COMMAND_MEMADVISE_INTEL 0x4207 + + +typedef void* (CL_API_CALL * +clHostMemAllocINTEL_fn)( + cl_context context, + const cl_mem_properties_intel* properties, + size_t size, + cl_uint alignment, + cl_int* errcode_ret) ; + +typedef void* (CL_API_CALL * +clDeviceMemAllocINTEL_fn)( + cl_context context, + cl_device_id device, + const cl_mem_properties_intel* properties, + size_t size, + cl_uint alignment, + cl_int* errcode_ret) ; + +typedef void* (CL_API_CALL * +clSharedMemAllocINTEL_fn)( + cl_context context, + cl_device_id device, + const cl_mem_properties_intel* properties, + size_t size, + cl_uint alignment, + cl_int* errcode_ret) ; + +typedef cl_int (CL_API_CALL * +clMemFreeINTEL_fn)( + cl_context context, + void* ptr) ; + +typedef cl_int (CL_API_CALL * +clMemBlockingFreeINTEL_fn)( + cl_context context, + void* ptr) ; + +typedef cl_int (CL_API_CALL * +clGetMemAllocInfoINTEL_fn)( + cl_context context, + const void* ptr, + cl_mem_info_intel param_name, + size_t param_value_size, + void* param_value, + size_t* param_value_size_ret) ; + +typedef cl_int (CL_API_CALL * +clSetKernelArgMemPointerINTEL_fn)( + cl_kernel kernel, + cl_uint arg_index, + const void* arg_value) ; + +typedef cl_int (CL_API_CALL * +clEnqueueMemFillINTEL_fn)( + cl_command_queue command_queue, + void* dst_ptr, + const void* pattern, + size_t pattern_size, + size_t size, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) ; + +typedef cl_int (CL_API_CALL * +clEnqueueMemcpyINTEL_fn)( + cl_command_queue command_queue, + cl_bool blocking, + void* dst_ptr, + const void* src_ptr, + size_t size, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) ; + +typedef cl_int (CL_API_CALL * +clEnqueueMemAdviseINTEL_fn)( + cl_command_queue command_queue, + const void* ptr, + size_t size, + cl_mem_advice_intel advice, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) ; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY void* CL_API_CALL +clHostMemAllocINTEL( + cl_context context, + const cl_mem_properties_intel* properties, + size_t size, + cl_uint alignment, + cl_int* errcode_ret) ; + +extern CL_API_ENTRY void* CL_API_CALL +clDeviceMemAllocINTEL( + cl_context context, + cl_device_id device, + const cl_mem_properties_intel* properties, + size_t size, + cl_uint alignment, + cl_int* errcode_ret) ; + +extern CL_API_ENTRY void* CL_API_CALL +clSharedMemAllocINTEL( + cl_context context, + cl_device_id device, + const cl_mem_properties_intel* properties, + size_t size, + cl_uint alignment, + cl_int* errcode_ret) ; + +extern CL_API_ENTRY cl_int CL_API_CALL +clMemFreeINTEL( + cl_context context, + void* ptr) ; + +extern CL_API_ENTRY cl_int CL_API_CALL +clMemBlockingFreeINTEL( + cl_context context, + void* ptr) ; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetMemAllocInfoINTEL( + cl_context context, + const void* ptr, + cl_mem_info_intel param_name, + size_t param_value_size, + void* param_value, + size_t* param_value_size_ret) ; + +extern CL_API_ENTRY cl_int CL_API_CALL +clSetKernelArgMemPointerINTEL( + cl_kernel kernel, + cl_uint arg_index, + const void* arg_value) ; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueMemFillINTEL( + cl_command_queue command_queue, + void* dst_ptr, + const void* pattern, + size_t pattern_size, + size_t size, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) ; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueMemcpyINTEL( + cl_command_queue command_queue, + cl_bool blocking, + void* dst_ptr, + const void* src_ptr, + size_t size, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) ; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueMemAdviseINTEL( + cl_command_queue command_queue, + const void* ptr, + size_t size, + cl_mem_advice_intel advice, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) ; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +#if defined(CL_VERSION_1_2) +/* Requires OpenCL 1.2 for cl_mem_migration_flags: */ + +typedef cl_int (CL_API_CALL * +clEnqueueMigrateMemINTEL_fn)( + cl_command_queue command_queue, + const void* ptr, + size_t size, + cl_mem_migration_flags flags, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) ; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueMigrateMemINTEL( + cl_command_queue command_queue, + const void* ptr, + size_t size, + cl_mem_migration_flags flags, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) ; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +#endif /* defined(CL_VERSION_1_2) */ + +/* deprecated, use clEnqueueMemFillINTEL instead */ + +typedef cl_int (CL_API_CALL * +clEnqueueMemsetINTEL_fn)( + cl_command_queue command_queue, + void* dst_ptr, + cl_int value, + size_t size, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) ; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueMemsetINTEL( + cl_command_queue command_queue, + void* dst_ptr, + cl_int value, + size_t size, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) ; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_intel_mem_alloc_buffer_location +***************************************************************/ +#define cl_intel_mem_alloc_buffer_location 1 +#define CL_INTEL_MEM_ALLOC_BUFFER_LOCATION_EXTENSION_NAME \ + "cl_intel_mem_alloc_buffer_location" + +/* cl_mem_properties_intel */ +#define CL_MEM_ALLOC_BUFFER_LOCATION_INTEL 0x419E + +/* cl_mem_alloc_info_intel */ +/* enum CL_MEM_ALLOC_BUFFER_LOCATION_INTEL */ + +/*************************************************************** +* cl_intel_create_buffer_with_properties +***************************************************************/ +#define cl_intel_create_buffer_with_properties 1 +#define CL_INTEL_CREATE_BUFFER_WITH_PROPERTIES_EXTENSION_NAME \ + "cl_intel_create_buffer_with_properties" + +/* type cl_mem_properties_intel */ + + +typedef cl_mem (CL_API_CALL * +clCreateBufferWithPropertiesINTEL_fn)( + cl_context context, + const cl_mem_properties_intel* properties, + cl_mem_flags flags, + size_t size, + void* host_ptr, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateBufferWithPropertiesINTEL( + cl_context context, + const cl_mem_properties_intel* properties, + cl_mem_flags flags, + size_t size, + void* host_ptr, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_intel_program_scope_host_pipe +***************************************************************/ +#define cl_intel_program_scope_host_pipe 1 +#define CL_INTEL_PROGRAM_SCOPE_HOST_PIPE_EXTENSION_NAME \ + "cl_intel_program_scope_host_pipe" + +/* clGetEventInfo response when param_name is CL_EVENT_COMMAND_TYPE */ +#define CL_COMMAND_READ_HOST_PIPE_INTEL 0x4214 +#define CL_COMMAND_WRITE_HOST_PIPE_INTEL 0x4215 + +/* clGetProgramInfo param_name */ +#define CL_PROGRAM_NUM_HOST_PIPES_INTEL 0x4216 +#define CL_PROGRAM_HOST_PIPE_NAMES_INTEL 0x4217 + + +typedef cl_int (CL_API_CALL * +clEnqueueReadHostPipeINTEL_fn)( + cl_command_queue command_queue, + cl_program program, + const char* pipe_symbol, + cl_bool blocking_read, + void* ptr, + size_t size, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_0; + +typedef cl_int (CL_API_CALL * +clEnqueueWriteHostPipeINTEL_fn)( + cl_command_queue command_queue, + cl_program program, + const char* pipe_symbol, + cl_bool blocking_write, + const void* ptr, + size_t size, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_0; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueReadHostPipeINTEL( + cl_command_queue command_queue, + cl_program program, + const char* pipe_symbol, + cl_bool blocking_read, + void* ptr, + size_t size, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueWriteHostPipeINTEL( + cl_command_queue command_queue, + cl_program program, + const char* pipe_symbol, + cl_bool blocking_write, + const void* ptr, + size_t size, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_0; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_intel_mem_channel_property +***************************************************************/ +#define cl_intel_mem_channel_property 1 +#define CL_INTEL_MEM_CHANNEL_PROPERTY_EXTENSION_NAME \ + "cl_intel_mem_channel_property" + +/* cl_mem_properties_intel */ +#define CL_MEM_CHANNEL_INTEL 0x4213 + +/*************************************************************** +* cl_intel_mem_force_host_memory +***************************************************************/ +#define cl_intel_mem_force_host_memory 1 +#define CL_INTEL_MEM_FORCE_HOST_MEMORY_EXTENSION_NAME \ + "cl_intel_mem_force_host_memory" + +/* cl_mem_flags */ +#define CL_MEM_FORCE_HOST_MEMORY_INTEL (1 << 20) + +/*************************************************************** +* cl_intel_command_queue_families +***************************************************************/ +#define cl_intel_command_queue_families 1 +#define CL_INTEL_COMMAND_QUEUE_FAMILIES_EXTENSION_NAME \ + "cl_intel_command_queue_families" + +typedef cl_bitfield cl_command_queue_capabilities_intel; + +#define CL_QUEUE_FAMILY_MAX_NAME_SIZE_INTEL 64 + +typedef struct _cl_queue_family_properties_intel { + cl_command_queue_properties properties; + cl_command_queue_capabilities_intel capabilities; + cl_uint count; + char name[CL_QUEUE_FAMILY_MAX_NAME_SIZE_INTEL]; +} cl_queue_family_properties_intel; + +/* cl_device_info */ +#define CL_DEVICE_QUEUE_FAMILY_PROPERTIES_INTEL 0x418B + +/* cl_queue_properties */ +#define CL_QUEUE_FAMILY_INTEL 0x418C +#define CL_QUEUE_INDEX_INTEL 0x418D + +/* cl_command_queue_capabilities_intel */ +#define CL_QUEUE_DEFAULT_CAPABILITIES_INTEL 0 +#define CL_QUEUE_CAPABILITY_CREATE_SINGLE_QUEUE_EVENTS_INTEL (1 << 0) +#define CL_QUEUE_CAPABILITY_CREATE_CROSS_QUEUE_EVENTS_INTEL (1 << 1) +#define CL_QUEUE_CAPABILITY_SINGLE_QUEUE_EVENT_WAIT_LIST_INTEL (1 << 2) +#define CL_QUEUE_CAPABILITY_CROSS_QUEUE_EVENT_WAIT_LIST_INTEL (1 << 3) +#define CL_QUEUE_CAPABILITY_TRANSFER_BUFFER_INTEL (1 << 8) +#define CL_QUEUE_CAPABILITY_TRANSFER_BUFFER_RECT_INTEL (1 << 9) +#define CL_QUEUE_CAPABILITY_MAP_BUFFER_INTEL (1 << 10) +#define CL_QUEUE_CAPABILITY_FILL_BUFFER_INTEL (1 << 11) +#define CL_QUEUE_CAPABILITY_TRANSFER_IMAGE_INTEL (1 << 12) +#define CL_QUEUE_CAPABILITY_MAP_IMAGE_INTEL (1 << 13) +#define CL_QUEUE_CAPABILITY_FILL_IMAGE_INTEL (1 << 14) +#define CL_QUEUE_CAPABILITY_TRANSFER_BUFFER_IMAGE_INTEL (1 << 15) +#define CL_QUEUE_CAPABILITY_TRANSFER_IMAGE_BUFFER_INTEL (1 << 16) +#define CL_QUEUE_CAPABILITY_MARKER_INTEL (1 << 24) +#define CL_QUEUE_CAPABILITY_BARRIER_INTEL (1 << 25) +#define CL_QUEUE_CAPABILITY_KERNEL_INTEL (1 << 26) + +/*************************************************************** +* cl_intel_queue_no_sync_operations +***************************************************************/ +#define cl_intel_queue_no_sync_operations 1 +#define CL_INTEL_QUEUE_NO_SYNC_OPERATIONS_EXTENSION_NAME \ + "cl_intel_queue_no_sync_operations" + +/* cl_command_queue_properties */ +#define CL_QUEUE_NO_SYNC_OPERATIONS_INTEL (1 << 29) + +/*************************************************************** +* cl_intel_sharing_format_query +***************************************************************/ +#define cl_intel_sharing_format_query 1 +#define CL_INTEL_SHARING_FORMAT_QUERY_EXTENSION_NAME \ + "cl_intel_sharing_format_query" + +/*************************************************************** +* cl_ext_image_requirements_info +***************************************************************/ +#if defined(CL_VERSION_3_0) + +#define cl_ext_image_requirements_info 1 +#define CL_EXT_IMAGE_REQUIREMENTS_INFO_EXTENSION_NAME \ + "cl_ext_image_requirements_info" + +/* Types */ +typedef cl_uint cl_image_requirements_info_ext; + +/* cl_image_requirements_info_ext */ +#define CL_IMAGE_REQUIREMENTS_BASE_ADDRESS_ALIGNMENT_EXT 0x1292 +#define CL_IMAGE_REQUIREMENTS_ROW_PITCH_ALIGNMENT_EXT 0x1290 +#define CL_IMAGE_REQUIREMENTS_SIZE_EXT 0x12B2 +#define CL_IMAGE_REQUIREMENTS_MAX_WIDTH_EXT 0x12B3 +#define CL_IMAGE_REQUIREMENTS_MAX_HEIGHT_EXT 0x12B4 +#define CL_IMAGE_REQUIREMENTS_MAX_DEPTH_EXT 0x12B5 +#define CL_IMAGE_REQUIREMENTS_MAX_ARRAY_SIZE_EXT 0x12B6 + +/* Enqueued Commands APIs */ + +typedef cl_int (CL_API_CALL * +clGetImageRequirementsInfoEXT_fn)( + cl_context context, + const cl_mem_properties* properties, + cl_mem_flags flags, + const cl_image_format* image_format, + const cl_image_desc* image_desc, + cl_image_requirements_info_ext param_name, + size_t param_value_size, + void* param_value, + size_t* param_value_size_ret) CL_API_SUFFIX__VERSION_3_0; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetImageRequirementsInfoEXT( + cl_context context, + const cl_mem_properties* properties, + cl_mem_flags flags, + const cl_image_format* image_format, + const cl_image_desc* image_desc, + cl_image_requirements_info_ext param_name, + size_t param_value_size, + void* param_value, + size_t* param_value_size_ret) CL_API_SUFFIX__VERSION_3_0; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +#endif /* defined(CL_VERSION_3_0) */ + +/*************************************************************** +* cl_ext_image_from_buffer +***************************************************************/ +#if defined(CL_VERSION_3_0) + +#define cl_ext_image_from_buffer 1 +#define CL_EXT_IMAGE_FROM_BUFFER_EXTENSION_NAME \ + "cl_ext_image_from_buffer" + +/* cl_image_requirements_info_ext */ +#define CL_IMAGE_REQUIREMENTS_SLICE_PITCH_ALIGNMENT_EXT 0x1291 + +#endif /* defined(CL_VERSION_3_0) */ + +/*************************************************************** +* cl_loader_info +***************************************************************/ +#define cl_loader_info 1 +#define CL_LOADER_INFO_EXTENSION_NAME \ + "cl_loader_info" + +typedef cl_uint cl_icdl_info; + +/* cl_icdl_info */ +#define CL_ICDL_OCL_VERSION 1 +#define CL_ICDL_VERSION 2 +#define CL_ICDL_NAME 3 +#define CL_ICDL_VENDOR 4 + + +typedef cl_int (CL_API_CALL * +clGetICDLoaderInfoOCLICD_fn)( + cl_icdl_info param_name, + size_t param_value_size, + void* param_value, + size_t* param_value_size_ret) ; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetICDLoaderInfoOCLICD( + cl_icdl_info param_name, + size_t param_value_size, + void* param_value, + size_t* param_value_size_ret) ; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_khr_depth_images +***************************************************************/ +#define cl_khr_depth_images 1 +#define CL_KHR_DEPTH_IMAGES_EXTENSION_NAME \ + "cl_khr_depth_images" + +#if !defined(CL_VERSION_1_2) +/* cl_channel_order - defined in CL.h for OpenCL 1.2 (?) and newer */ +#define CL_DEPTH 0x10BD + +#endif /* !defined(CL_VERSION_1_2) */ + +/*************************************************************** +* cl_ext_float_atomics +***************************************************************/ +#define cl_ext_float_atomics 1 +#define CL_EXT_FLOAT_ATOMICS_EXTENSION_NAME \ + "cl_ext_float_atomics" + +typedef cl_bitfield cl_device_fp_atomic_capabilities_ext; + +/* cl_device_fp_atomic_capabilities_ext */ +#define CL_DEVICE_GLOBAL_FP_ATOMIC_LOAD_STORE_EXT (1 << 0) +#define CL_DEVICE_GLOBAL_FP_ATOMIC_ADD_EXT (1 << 1) +#define CL_DEVICE_GLOBAL_FP_ATOMIC_MIN_MAX_EXT (1 << 2) +#define CL_DEVICE_LOCAL_FP_ATOMIC_LOAD_STORE_EXT (1 << 16) +#define CL_DEVICE_LOCAL_FP_ATOMIC_ADD_EXT (1 << 17) +#define CL_DEVICE_LOCAL_FP_ATOMIC_MIN_MAX_EXT (1 << 18) + +/* cl_device_info */ +#define CL_DEVICE_SINGLE_FP_ATOMIC_CAPABILITIES_EXT 0x4231 +#define CL_DEVICE_DOUBLE_FP_ATOMIC_CAPABILITIES_EXT 0x4232 +#define CL_DEVICE_HALF_FP_ATOMIC_CAPABILITIES_EXT 0x4233 + +/*************************************************************** +* cl_intel_create_mem_object_properties +***************************************************************/ +#define cl_intel_create_mem_object_properties 1 +#define CL_INTEL_CREATE_MEM_OBJECT_PROPERTIES_EXTENSION_NAME \ + "cl_intel_create_mem_object_properties" + +/* cl_mem_properties */ +#define CL_MEM_LOCALLY_UNCACHED_RESOURCE_INTEL 0x4218 +#define CL_MEM_DEVICE_ID_INTEL 0x4219 + +/*************************************************************** +* cl_pocl_content_size +***************************************************************/ +#define cl_pocl_content_size 1 +#define CL_POCL_CONTENT_SIZE_EXTENSION_NAME \ + "cl_pocl_content_size" + + +typedef cl_int (CL_API_CALL * +clSetContentSizeBufferPoCL_fn)( + cl_mem buffer, + cl_mem content_size_buffer) CL_API_SUFFIX__VERSION_1_0; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_int CL_API_CALL +clSetContentSizeBufferPoCL( + cl_mem buffer, + cl_mem content_size_buffer) CL_API_SUFFIX__VERSION_1_0; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +#ifdef __cplusplus +} +#endif + +#endif /* OPENCL_CL_EXT_H_ */ diff --git a/cuda_toolkit/include/CL/cl_gl.h b/cuda_toolkit/include/CL/cl_gl.h new file mode 100644 index 0000000000000000000000000000000000000000..516cf646e1827a18c71c7ba09e457140e9eae831 --- /dev/null +++ b/cuda_toolkit/include/CL/cl_gl.h @@ -0,0 +1,372 @@ +/******************************************************************************* + * Copyright (c) 2008-2023 The Khronos Group Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ + +#ifndef OPENCL_CL_GL_H_ +#define OPENCL_CL_GL_H_ + +/* +** This header is generated from the Khronos OpenCL XML API Registry. +*/ + +#include + +/* CL_NO_PROTOTYPES implies CL_NO_EXTENSION_PROTOTYPES: */ +#if defined(CL_NO_PROTOTYPES) && !defined(CL_NO_EXTENSION_PROTOTYPES) +#define CL_NO_EXTENSION_PROTOTYPES +#endif + +/* CL_NO_EXTENSION_PROTOTYPES implies + CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES and + CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES: */ +#if defined(CL_NO_EXTENSION_PROTOTYPES) && \ + !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) +#define CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES +#endif +#if defined(CL_NO_EXTENSION_PROTOTYPES) && \ + !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) +#define CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/*************************************************************** +* cl_khr_gl_sharing +***************************************************************/ +#define cl_khr_gl_sharing 1 +#define CL_KHR_GL_SHARING_EXTENSION_NAME \ + "cl_khr_gl_sharing" + +typedef cl_uint cl_gl_context_info; + +/* Error codes */ +#define CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR -1000 + +/* cl_gl_context_info */ +#define CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR 0x2006 +#define CL_DEVICES_FOR_GL_CONTEXT_KHR 0x2007 + +/* Additional cl_context_properties */ +#define CL_GL_CONTEXT_KHR 0x2008 +#define CL_EGL_DISPLAY_KHR 0x2009 +#define CL_GLX_DISPLAY_KHR 0x200A +#define CL_WGL_HDC_KHR 0x200B +#define CL_CGL_SHAREGROUP_KHR 0x200C + +typedef cl_uint cl_gl_object_type; +typedef cl_uint cl_gl_texture_info; +typedef cl_uint cl_gl_platform_info; + +/* cl_gl_object_type */ +#define CL_GL_OBJECT_BUFFER 0x2000 +#define CL_GL_OBJECT_TEXTURE2D 0x2001 +#define CL_GL_OBJECT_TEXTURE3D 0x2002 +#define CL_GL_OBJECT_RENDERBUFFER 0x2003 + +#if defined(CL_VERSION_1_2) +/* cl_gl_object_type */ +#define CL_GL_OBJECT_TEXTURE2D_ARRAY 0x200E +#define CL_GL_OBJECT_TEXTURE1D 0x200F +#define CL_GL_OBJECT_TEXTURE1D_ARRAY 0x2010 +#define CL_GL_OBJECT_TEXTURE_BUFFER 0x2011 + +#endif /* defined(CL_VERSION_1_2) */ + +/* cl_gl_texture_info */ +#define CL_GL_TEXTURE_TARGET 0x2004 +#define CL_GL_MIPMAP_LEVEL 0x2005 + + +typedef cl_int (CL_API_CALL * +clGetGLContextInfoKHR_fn)( + const cl_context_properties* properties, + cl_gl_context_info param_name, + size_t param_value_size, + void* param_value, + size_t* param_value_size_ret) CL_API_SUFFIX__VERSION_1_0; + +typedef cl_mem (CL_API_CALL * +clCreateFromGLBuffer_fn)( + cl_context context, + cl_mem_flags flags, + cl_GLuint bufobj, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetGLContextInfoKHR( + const cl_context_properties* properties, + cl_gl_context_info param_name, + size_t param_value_size, + void* param_value, + size_t* param_value_size_ret) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateFromGLBuffer( + cl_context context, + cl_mem_flags flags, + cl_GLuint bufobj, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +#endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +#if defined(CL_VERSION_1_2) + +typedef cl_mem (CL_API_CALL * +clCreateFromGLTexture_fn)( + cl_context context, + cl_mem_flags flags, + cl_GLenum target, + cl_GLint miplevel, + cl_GLuint texture, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; + +#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateFromGLTexture( + cl_context context, + cl_mem_flags flags, + cl_GLenum target, + cl_GLint miplevel, + cl_GLuint texture, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2; + +#endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +#endif /* defined(CL_VERSION_1_2) */ + + +typedef cl_mem (CL_API_CALL * +clCreateFromGLRenderbuffer_fn)( + cl_context context, + cl_mem_flags flags, + cl_GLuint renderbuffer, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +typedef cl_int (CL_API_CALL * +clGetGLObjectInfo_fn)( + cl_mem memobj, + cl_gl_object_type* gl_object_type, + cl_GLuint* gl_object_name) CL_API_SUFFIX__VERSION_1_0; + +typedef cl_int (CL_API_CALL * +clGetGLTextureInfo_fn)( + cl_mem memobj, + cl_gl_texture_info param_name, + size_t param_value_size, + void* param_value, + size_t* param_value_size_ret) CL_API_SUFFIX__VERSION_1_0; + +typedef cl_int (CL_API_CALL * +clEnqueueAcquireGLObjects_fn)( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_0; + +typedef cl_int (CL_API_CALL * +clEnqueueReleaseGLObjects_fn)( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_0; + +#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateFromGLRenderbuffer( + cl_context context, + cl_mem_flags flags, + cl_GLuint renderbuffer, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetGLObjectInfo( + cl_mem memobj, + cl_gl_object_type* gl_object_type, + cl_GLuint* gl_object_name) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetGLTextureInfo( + cl_mem memobj, + cl_gl_texture_info param_name, + size_t param_value_size, + void* param_value, + size_t* param_value_size_ret) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueAcquireGLObjects( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_0; + +extern CL_API_ENTRY cl_int CL_API_CALL +clEnqueueReleaseGLObjects( + cl_command_queue command_queue, + cl_uint num_objects, + const cl_mem* mem_objects, + cl_uint num_events_in_wait_list, + const cl_event* event_wait_list, + cl_event* event) CL_API_SUFFIX__VERSION_1_0; + +#endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/* OpenCL 1.0 APIs that were deprecated in OpenCL 1.2 */ + +typedef cl_mem (CL_API_CALL * +clCreateFromGLTexture2D_fn)( + cl_context context, + cl_mem_flags flags, + cl_GLenum target, + cl_GLint miplevel, + cl_GLuint texture, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_1_DEPRECATED; + +typedef cl_mem (CL_API_CALL * +clCreateFromGLTexture3D_fn)( + cl_context context, + cl_mem_flags flags, + cl_GLenum target, + cl_GLint miplevel, + cl_GLuint texture, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_1_DEPRECATED; + +#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateFromGLTexture2D( + cl_context context, + cl_mem_flags flags, + cl_GLenum target, + cl_GLint miplevel, + cl_GLuint texture, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_1_DEPRECATED; + +extern CL_API_ENTRY cl_mem CL_API_CALL +clCreateFromGLTexture3D( + cl_context context, + cl_mem_flags flags, + cl_GLenum target, + cl_GLint miplevel, + cl_GLuint texture, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_1_DEPRECATED; + +#endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_khr_gl_event +***************************************************************/ +#define cl_khr_gl_event 1 +#define CL_KHR_GL_EVENT_EXTENSION_NAME \ + "cl_khr_gl_event" + +typedef struct __GLsync * cl_GLsync; + +/* cl_command_type */ +#define CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR 0x200D + + +typedef cl_event (CL_API_CALL * +clCreateEventFromGLsyncKHR_fn)( + cl_context context, + cl_GLsync sync, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_1; + +#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_event CL_API_CALL +clCreateEventFromGLsyncKHR( + cl_context context, + cl_GLsync sync, + cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_1; + +#endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +/*************************************************************** +* cl_khr_gl_depth_images +***************************************************************/ +#define cl_khr_gl_depth_images 1 +#define CL_KHR_GL_DEPTH_IMAGES_EXTENSION_NAME \ + "cl_khr_gl_depth_images" + +#if !defined(CL_VERSION_1_2) +/* cl_channel_order - defined in CL.h for OpenCL 1.2 and newer */ +#define CL_DEPTH_STENCIL 0x10BE + +#endif /* !defined(CL_VERSION_1_2) */ + +#if !defined(CL_VERSION_1_2) +/* cl_channel_type - defined in CL.h for OpenCL 1.2 and newer */ +#define CL_UNORM_INT24 0x10DF + +#endif /* !defined(CL_VERSION_1_2) */ + +/*************************************************************** +* cl_khr_gl_msaa_sharing +***************************************************************/ +#define cl_khr_gl_msaa_sharing 1 +#define CL_KHR_GL_MSAA_SHARING_EXTENSION_NAME \ + "cl_khr_gl_msaa_sharing" + +/* cl_gl_texture_info */ +#define CL_GL_NUM_SAMPLES 0x2012 + +/*************************************************************** +* cl_intel_sharing_format_query_gl +***************************************************************/ +#define cl_intel_sharing_format_query_gl 1 +#define CL_INTEL_SHARING_FORMAT_QUERY_GL_EXTENSION_NAME \ + "cl_intel_sharing_format_query_gl" + +/* when cl_khr_gl_sharing is supported */ + +typedef cl_int (CL_API_CALL * +clGetSupportedGLTextureFormatsINTEL_fn)( + cl_context context, + cl_mem_flags flags, + cl_mem_object_type image_type, + cl_uint num_entries, + cl_GLenum* gl_formats, + cl_uint* num_texture_formats) ; + +#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) + +extern CL_API_ENTRY cl_int CL_API_CALL +clGetSupportedGLTextureFormatsINTEL( + cl_context context, + cl_mem_flags flags, + cl_mem_object_type image_type, + cl_uint num_entries, + cl_GLenum* gl_formats, + cl_uint* num_texture_formats) ; + +#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */ + +#ifdef __cplusplus +} +#endif + +#endif /* OPENCL_CL_GL_H_ */ diff --git a/cuda_toolkit/include/CL/cl_gl_ext.h b/cuda_toolkit/include/CL/cl_gl_ext.h new file mode 100644 index 0000000000000000000000000000000000000000..57a30114981183d7bf39ee1e734b641037b02d4d --- /dev/null +++ b/cuda_toolkit/include/CL/cl_gl_ext.h @@ -0,0 +1,18 @@ +/******************************************************************************* + * Copyright (c) 2008-2021 The Khronos Group Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ + +#include +#pragma message("The extensions in cl_gl_ext.h have been moved into cl_gl.h. Please include cl_gl.h directly.") diff --git a/cuda_toolkit/include/CL/cl_platform.h b/cuda_toolkit/include/CL/cl_platform.h new file mode 100644 index 0000000000000000000000000000000000000000..358b374c37cc65a59c1523550617c4c2cc9b4fce --- /dev/null +++ b/cuda_toolkit/include/CL/cl_platform.h @@ -0,0 +1,1478 @@ +/******************************************************************************* + * Copyright (c) 2008-2020 The Khronos Group Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ + +#ifndef __CL_PLATFORM_H +#define __CL_PLATFORM_H + + +#ifndef __CL_VERSION_H +#define __CL_VERSION_H + +/* Detect which version to target */ +#if !defined(CL_TARGET_OPENCL_VERSION) +#pragma message("cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 300 (OpenCL 3.0)") +#define CL_TARGET_OPENCL_VERSION 300 +#endif +#if CL_TARGET_OPENCL_VERSION != 100 && \ + CL_TARGET_OPENCL_VERSION != 110 && \ + CL_TARGET_OPENCL_VERSION != 120 && \ + CL_TARGET_OPENCL_VERSION != 200 && \ + CL_TARGET_OPENCL_VERSION != 210 && \ + CL_TARGET_OPENCL_VERSION != 220 && \ + CL_TARGET_OPENCL_VERSION != 300 +#pragma message("cl_version: CL_TARGET_OPENCL_VERSION is not a valid value (100, 110, 120, 200, 210, 220, 300). Defaulting to 300 (OpenCL 3.0)") +#undef CL_TARGET_OPENCL_VERSION +#define CL_TARGET_OPENCL_VERSION 300 +#endif + + +/* OpenCL Version */ +#if CL_TARGET_OPENCL_VERSION >= 300 && !defined(CL_VERSION_3_0) +#define CL_VERSION_3_0 1 +#endif +#if CL_TARGET_OPENCL_VERSION >= 220 && !defined(CL_VERSION_2_2) +#define CL_VERSION_2_2 1 +#endif +#if CL_TARGET_OPENCL_VERSION >= 210 && !defined(CL_VERSION_2_1) +#define CL_VERSION_2_1 1 +#endif +#if CL_TARGET_OPENCL_VERSION >= 200 && !defined(CL_VERSION_2_0) +#define CL_VERSION_2_0 1 +#endif +#if CL_TARGET_OPENCL_VERSION >= 120 && !defined(CL_VERSION_1_2) +#define CL_VERSION_1_2 1 +#endif +#if CL_TARGET_OPENCL_VERSION >= 110 && !defined(CL_VERSION_1_1) +#define CL_VERSION_1_1 1 +#endif +#if CL_TARGET_OPENCL_VERSION >= 100 && !defined(CL_VERSION_1_0) +#define CL_VERSION_1_0 1 +#endif + +/* Allow deprecated APIs for older OpenCL versions. */ +#if CL_TARGET_OPENCL_VERSION <= 220 && !defined(CL_USE_DEPRECATED_OPENCL_2_2_APIS) +#define CL_USE_DEPRECATED_OPENCL_2_2_APIS +#endif +#if CL_TARGET_OPENCL_VERSION <= 210 && !defined(CL_USE_DEPRECATED_OPENCL_2_1_APIS) +#define CL_USE_DEPRECATED_OPENCL_2_1_APIS +#endif +#if CL_TARGET_OPENCL_VERSION <= 200 && !defined(CL_USE_DEPRECATED_OPENCL_2_0_APIS) +#define CL_USE_DEPRECATED_OPENCL_2_0_APIS +#endif +#if CL_TARGET_OPENCL_VERSION <= 120 && !defined(CL_USE_DEPRECATED_OPENCL_1_2_APIS) +#define CL_USE_DEPRECATED_OPENCL_1_2_APIS +#endif +#if CL_TARGET_OPENCL_VERSION <= 110 && !defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) +#define CL_USE_DEPRECATED_OPENCL_1_1_APIS +#endif +#if CL_TARGET_OPENCL_VERSION <= 100 && !defined(CL_USE_DEPRECATED_OPENCL_1_0_APIS) +#define CL_USE_DEPRECATED_OPENCL_1_0_APIS +#endif + +#endif /* __CL_VERSION_H */ + + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(_WIN32) + #if !defined(CL_API_ENTRY) + #define CL_API_ENTRY + #endif + #if !defined(CL_API_CALL) + #define CL_API_CALL __stdcall + #endif + #if !defined(CL_CALLBACK) + #define CL_CALLBACK __stdcall + #endif +#else + #if !defined(CL_API_ENTRY) + #define CL_API_ENTRY + #endif + #if !defined(CL_API_CALL) + #define CL_API_CALL + #endif + #if !defined(CL_CALLBACK) + #define CL_CALLBACK + #endif +#endif + +/* + * Deprecation flags refer to the last version of the header in which the + * feature was not deprecated. + * + * E.g. VERSION_1_1_DEPRECATED means the feature is present in 1.1 without + * deprecation but is deprecated in versions later than 1.1. + */ + +#ifndef CL_API_SUFFIX_USER +#define CL_API_SUFFIX_USER +#endif + +#ifndef CL_API_PREFIX_USER +#define CL_API_PREFIX_USER +#endif + +#define CL_API_SUFFIX_COMMON CL_API_SUFFIX_USER +#define CL_API_PREFIX_COMMON CL_API_PREFIX_USER + +#define CL_API_SUFFIX__VERSION_1_0 CL_API_SUFFIX_COMMON +#define CL_API_SUFFIX__VERSION_1_1 CL_API_SUFFIX_COMMON +#define CL_API_SUFFIX__VERSION_1_2 CL_API_SUFFIX_COMMON +#define CL_API_SUFFIX__VERSION_2_0 CL_API_SUFFIX_COMMON +#define CL_API_SUFFIX__VERSION_2_1 CL_API_SUFFIX_COMMON +#define CL_API_SUFFIX__VERSION_2_2 CL_API_SUFFIX_COMMON +#define CL_API_SUFFIX__VERSION_3_0 CL_API_SUFFIX_COMMON +#define CL_API_SUFFIX__EXPERIMENTAL CL_API_SUFFIX_COMMON + + +#ifdef __GNUC__ + #define CL_API_SUFFIX_DEPRECATED __attribute__((deprecated)) + #define CL_API_PREFIX_DEPRECATED +#elif defined(_WIN32) + #define CL_API_SUFFIX_DEPRECATED + #define CL_API_PREFIX_DEPRECATED __declspec(deprecated) +#else + #define CL_API_SUFFIX_DEPRECATED + #define CL_API_PREFIX_DEPRECATED +#endif + +#ifdef CL_USE_DEPRECATED_OPENCL_1_0_APIS + #define CL_API_SUFFIX__VERSION_1_0_DEPRECATED CL_API_SUFFIX_COMMON + #define CL_API_PREFIX__VERSION_1_0_DEPRECATED CL_API_PREFIX_COMMON +#else + #define CL_API_SUFFIX__VERSION_1_0_DEPRECATED CL_API_SUFFIX_COMMON CL_API_SUFFIX_DEPRECATED + #define CL_API_PREFIX__VERSION_1_0_DEPRECATED CL_API_PREFIX_COMMON CL_API_PREFIX_DEPRECATED +#endif + +#ifdef CL_USE_DEPRECATED_OPENCL_1_1_APIS + #define CL_API_SUFFIX__VERSION_1_1_DEPRECATED CL_API_SUFFIX_COMMON + #define CL_API_PREFIX__VERSION_1_1_DEPRECATED CL_API_PREFIX_COMMON +#else + #define CL_API_SUFFIX__VERSION_1_1_DEPRECATED CL_API_SUFFIX_COMMON CL_API_SUFFIX_DEPRECATED + #define CL_API_PREFIX__VERSION_1_1_DEPRECATED CL_API_PREFIX_COMMON CL_API_PREFIX_DEPRECATED +#endif + +#ifdef CL_USE_DEPRECATED_OPENCL_1_2_APIS + #define CL_API_SUFFIX__VERSION_1_2_DEPRECATED CL_API_SUFFIX_COMMON + #define CL_API_PREFIX__VERSION_1_2_DEPRECATED CL_API_PREFIX_COMMON +#else + #define CL_API_SUFFIX__VERSION_1_2_DEPRECATED CL_API_SUFFIX_COMMON CL_API_SUFFIX_DEPRECATED + #define CL_API_PREFIX__VERSION_1_2_DEPRECATED CL_API_PREFIX_COMMON CL_API_PREFIX_DEPRECATED + #endif + +#ifdef CL_USE_DEPRECATED_OPENCL_2_0_APIS + #define CL_API_SUFFIX__VERSION_2_0_DEPRECATED CL_API_SUFFIX_COMMON + #define CL_API_PREFIX__VERSION_2_0_DEPRECATED CL_API_PREFIX_COMMON +#else + #define CL_API_SUFFIX__VERSION_2_0_DEPRECATED CL_API_SUFFIX_COMMON CL_API_SUFFIX_DEPRECATED + #define CL_API_PREFIX__VERSION_2_0_DEPRECATED CL_API_PREFIX_COMMON CL_API_PREFIX_DEPRECATED +#endif + +#ifdef CL_USE_DEPRECATED_OPENCL_2_1_APIS + #define CL_API_SUFFIX__VERSION_2_1_DEPRECATED CL_API_SUFFIX_COMMON + #define CL_API_PREFIX__VERSION_2_1_DEPRECATED CL_API_PREFIX_COMMON +#else + #define CL_API_SUFFIX__VERSION_2_1_DEPRECATED CL_API_SUFFIX_COMMON CL_API_SUFFIX_DEPRECATED + #define CL_API_PREFIX__VERSION_2_1_DEPRECATED CL_API_PREFIX_COMMON CL_API_PREFIX_DEPRECATED +#endif + +#ifdef CL_USE_DEPRECATED_OPENCL_2_2_APIS + #define CL_API_SUFFIX__VERSION_2_2_DEPRECATED CL_API_SUFFIX_COMMON + #define CL_API_PREFIX__VERSION_2_2_DEPRECATED CL_API_PREFIX_COMMON +#else + #define CL_API_SUFFIX__VERSION_2_2_DEPRECATED CL_API_SUFFIX_COMMON CL_API_SUFFIX_DEPRECATED + #define CL_API_PREFIX__VERSION_2_2_DEPRECATED CL_API_PREFIX_COMMON CL_API_PREFIX_DEPRECATED +#endif + +#if (defined (_WIN32) && defined(_MSC_VER)) + +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wlanguage-extension-token" +#endif + +/* intptr_t is used in cl.h and provided by stddef.h in Visual C++, but not in clang */ +/* stdint.h was missing before Visual Studio 2010, include it for later versions and for clang */ +#if defined(__clang__) || _MSC_VER >= 1600 + #include +#endif + +/* scalar types */ +typedef signed __int8 cl_char; +typedef unsigned __int8 cl_uchar; +typedef signed __int16 cl_short; +typedef unsigned __int16 cl_ushort; +typedef signed __int32 cl_int; +typedef unsigned __int32 cl_uint; +typedef signed __int64 cl_long; +typedef unsigned __int64 cl_ulong; + +typedef unsigned __int16 cl_half; +typedef float cl_float; +typedef double cl_double; + +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + +/* Macro names and corresponding values defined by OpenCL */ +#define CL_CHAR_BIT 8 +#define CL_SCHAR_MAX 127 +#define CL_SCHAR_MIN (-127-1) +#define CL_CHAR_MAX CL_SCHAR_MAX +#define CL_CHAR_MIN CL_SCHAR_MIN +#define CL_UCHAR_MAX 255 +#define CL_SHRT_MAX 32767 +#define CL_SHRT_MIN (-32767-1) +#define CL_USHRT_MAX 65535 +#define CL_INT_MAX 2147483647 +#define CL_INT_MIN (-2147483647-1) +#define CL_UINT_MAX 0xffffffffU +#define CL_LONG_MAX ((cl_long) 0x7FFFFFFFFFFFFFFFLL) +#define CL_LONG_MIN ((cl_long) -0x7FFFFFFFFFFFFFFFLL - 1LL) +#define CL_ULONG_MAX ((cl_ulong) 0xFFFFFFFFFFFFFFFFULL) + +#define CL_FLT_DIG 6 +#define CL_FLT_MANT_DIG 24 +#define CL_FLT_MAX_10_EXP +38 +#define CL_FLT_MAX_EXP +128 +#define CL_FLT_MIN_10_EXP -37 +#define CL_FLT_MIN_EXP -125 +#define CL_FLT_RADIX 2 +#define CL_FLT_MAX 340282346638528859811704183484516925440.0f +#define CL_FLT_MIN 1.175494350822287507969e-38f +#define CL_FLT_EPSILON 1.1920928955078125e-7f + +#define CL_HALF_DIG 3 +#define CL_HALF_MANT_DIG 11 +#define CL_HALF_MAX_10_EXP +4 +#define CL_HALF_MAX_EXP +16 +#define CL_HALF_MIN_10_EXP -4 +#define CL_HALF_MIN_EXP -13 +#define CL_HALF_RADIX 2 +#define CL_HALF_MAX 65504.0f +#define CL_HALF_MIN 6.103515625e-05f +#define CL_HALF_EPSILON 9.765625e-04f + +#define CL_DBL_DIG 15 +#define CL_DBL_MANT_DIG 53 +#define CL_DBL_MAX_10_EXP +308 +#define CL_DBL_MAX_EXP +1024 +#define CL_DBL_MIN_10_EXP -307 +#define CL_DBL_MIN_EXP -1021 +#define CL_DBL_RADIX 2 +#define CL_DBL_MAX 1.7976931348623158e+308 +#define CL_DBL_MIN 2.225073858507201383090e-308 +#define CL_DBL_EPSILON 2.220446049250313080847e-16 + +#define CL_M_E 2.7182818284590452354 +#define CL_M_LOG2E 1.4426950408889634074 +#define CL_M_LOG10E 0.43429448190325182765 +#define CL_M_LN2 0.69314718055994530942 +#define CL_M_LN10 2.30258509299404568402 +#define CL_M_PI 3.14159265358979323846 +#define CL_M_PI_2 1.57079632679489661923 +#define CL_M_PI_4 0.78539816339744830962 +#define CL_M_1_PI 0.31830988618379067154 +#define CL_M_2_PI 0.63661977236758134308 +#define CL_M_2_SQRTPI 1.12837916709551257390 +#define CL_M_SQRT2 1.41421356237309504880 +#define CL_M_SQRT1_2 0.70710678118654752440 + +#define CL_M_E_F 2.718281828f +#define CL_M_LOG2E_F 1.442695041f +#define CL_M_LOG10E_F 0.434294482f +#define CL_M_LN2_F 0.693147181f +#define CL_M_LN10_F 2.302585093f +#define CL_M_PI_F 3.141592654f +#define CL_M_PI_2_F 1.570796327f +#define CL_M_PI_4_F 0.785398163f +#define CL_M_1_PI_F 0.318309886f +#define CL_M_2_PI_F 0.636619772f +#define CL_M_2_SQRTPI_F 1.128379167f +#define CL_M_SQRT2_F 1.414213562f +#define CL_M_SQRT1_2_F 0.707106781f + +#define CL_NAN (CL_INFINITY - CL_INFINITY) +#define CL_HUGE_VALF ((cl_float) 1e50) +#define CL_HUGE_VAL ((cl_double) 1e500) +#define CL_MAXFLOAT CL_FLT_MAX +#define CL_INFINITY CL_HUGE_VALF + +#else + +#include + +/* scalar types */ +typedef int8_t cl_char; +typedef uint8_t cl_uchar; +typedef int16_t cl_short; +typedef uint16_t cl_ushort; +typedef int32_t cl_int; +typedef uint32_t cl_uint; +typedef int64_t cl_long; +typedef uint64_t cl_ulong; + +typedef uint16_t cl_half; +typedef float cl_float; +typedef double cl_double; + +/* Macro names and corresponding values defined by OpenCL */ +#define CL_CHAR_BIT 8 +#define CL_SCHAR_MAX 127 +#define CL_SCHAR_MIN (-127-1) +#define CL_CHAR_MAX CL_SCHAR_MAX +#define CL_CHAR_MIN CL_SCHAR_MIN +#define CL_UCHAR_MAX 255 +#define CL_SHRT_MAX 32767 +#define CL_SHRT_MIN (-32767-1) +#define CL_USHRT_MAX 65535 +#define CL_INT_MAX 2147483647 +#define CL_INT_MIN (-2147483647-1) +#define CL_UINT_MAX 0xffffffffU +#define CL_LONG_MAX ((cl_long) 0x7FFFFFFFFFFFFFFFLL) +#define CL_LONG_MIN ((cl_long) -0x7FFFFFFFFFFFFFFFLL - 1LL) +#define CL_ULONG_MAX ((cl_ulong) 0xFFFFFFFFFFFFFFFFULL) + +#define CL_FLT_DIG 6 +#define CL_FLT_MANT_DIG 24 +#define CL_FLT_MAX_10_EXP +38 +#define CL_FLT_MAX_EXP +128 +#define CL_FLT_MIN_10_EXP -37 +#define CL_FLT_MIN_EXP -125 +#define CL_FLT_RADIX 2 +#define CL_FLT_MAX 340282346638528859811704183484516925440.0f +#define CL_FLT_MIN 1.175494350822287507969e-38f +#define CL_FLT_EPSILON 1.1920928955078125e-7f + +#define CL_HALF_DIG 3 +#define CL_HALF_MANT_DIG 11 +#define CL_HALF_MAX_10_EXP +4 +#define CL_HALF_MAX_EXP +16 +#define CL_HALF_MIN_10_EXP -4 +#define CL_HALF_MIN_EXP -13 +#define CL_HALF_RADIX 2 +#define CL_HALF_MAX 65504.0f +#define CL_HALF_MIN 6.103515625e-05f +#define CL_HALF_EPSILON 9.765625e-04f + +#define CL_DBL_DIG 15 +#define CL_DBL_MANT_DIG 53 +#define CL_DBL_MAX_10_EXP +308 +#define CL_DBL_MAX_EXP +1024 +#define CL_DBL_MIN_10_EXP -307 +#define CL_DBL_MIN_EXP -1021 +#define CL_DBL_RADIX 2 +#define CL_DBL_MAX 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0 +#define CL_DBL_MIN 2.225073858507201383090e-308 +#define CL_DBL_EPSILON 2.220446049250313080847e-16 + +#define CL_M_E 2.7182818284590452354 +#define CL_M_LOG2E 1.4426950408889634074 +#define CL_M_LOG10E 0.43429448190325182765 +#define CL_M_LN2 0.69314718055994530942 +#define CL_M_LN10 2.30258509299404568402 +#define CL_M_PI 3.14159265358979323846 +#define CL_M_PI_2 1.57079632679489661923 +#define CL_M_PI_4 0.78539816339744830962 +#define CL_M_1_PI 0.31830988618379067154 +#define CL_M_2_PI 0.63661977236758134308 +#define CL_M_2_SQRTPI 1.12837916709551257390 +#define CL_M_SQRT2 1.41421356237309504880 +#define CL_M_SQRT1_2 0.70710678118654752440 + +#define CL_M_E_F 2.718281828f +#define CL_M_LOG2E_F 1.442695041f +#define CL_M_LOG10E_F 0.434294482f +#define CL_M_LN2_F 0.693147181f +#define CL_M_LN10_F 2.302585093f +#define CL_M_PI_F 3.141592654f +#define CL_M_PI_2_F 1.570796327f +#define CL_M_PI_4_F 0.785398163f +#define CL_M_1_PI_F 0.318309886f +#define CL_M_2_PI_F 0.636619772f +#define CL_M_2_SQRTPI_F 1.128379167f +#define CL_M_SQRT2_F 1.414213562f +#define CL_M_SQRT1_2_F 0.707106781f + +#if defined( __GNUC__ ) + #define CL_HUGE_VALF __builtin_huge_valf() + #define CL_HUGE_VAL __builtin_huge_val() + #define CL_NAN __builtin_nanf( "" ) +#else + #define CL_HUGE_VALF ((cl_float) 1e50) + #define CL_HUGE_VAL ((cl_double) 1e500) + float nanf( const char * ); + #define CL_NAN nanf( "" ) +#endif +#define CL_MAXFLOAT CL_FLT_MAX +#define CL_INFINITY CL_HUGE_VALF + +#endif + +#include + +/* Mirror types to GL types. Mirror types allow us to avoid deciding which 87s to load based on whether we are using GL or GLES here. */ +typedef unsigned int cl_GLuint; +typedef int cl_GLint; +typedef unsigned int cl_GLenum; + +/* + * Vector types + * + * Note: OpenCL requires that all types be naturally aligned. + * This means that vector types must be naturally aligned. + * For example, a vector of four floats must be aligned to + * a 16 byte boundary (calculated as 4 * the natural 4-byte + * alignment of the float). The alignment qualifiers here + * will only function properly if your compiler supports them + * and if you don't actively work to defeat them. For example, + * in order for a cl_float4 to be 16 byte aligned in a struct, + * the start of the struct must itself be 16-byte aligned. + * + * Maintaining proper alignment is the user's responsibility. + */ + +/* Define basic vector types */ +#if defined( __VEC__ ) + #if !defined(__clang__) + #include /* may be omitted depending on compiler. AltiVec spec provides no way to detect whether the header is required. */ + #endif + typedef __vector unsigned char __cl_uchar16; + typedef __vector signed char __cl_char16; + typedef __vector unsigned short __cl_ushort8; + typedef __vector signed short __cl_short8; + typedef __vector unsigned int __cl_uint4; + typedef __vector signed int __cl_int4; + typedef __vector float __cl_float4; + #define __CL_UCHAR16__ 1 + #define __CL_CHAR16__ 1 + #define __CL_USHORT8__ 1 + #define __CL_SHORT8__ 1 + #define __CL_UINT4__ 1 + #define __CL_INT4__ 1 + #define __CL_FLOAT4__ 1 +#endif + +#if defined( __SSE__ ) + #if defined( __MINGW64__ ) + #include + #else + #include + #endif + #if defined( __GNUC__ ) + typedef float __cl_float4 __attribute__((vector_size(16))); + #else + typedef __m128 __cl_float4; + #endif + #define __CL_FLOAT4__ 1 +#endif + +#if defined( __SSE2__ ) + #if defined( __MINGW64__ ) + #include + #else + #include + #endif + #if defined( __GNUC__ ) + typedef cl_uchar __cl_uchar16 __attribute__((vector_size(16))); + typedef cl_char __cl_char16 __attribute__((vector_size(16))); + typedef cl_ushort __cl_ushort8 __attribute__((vector_size(16))); + typedef cl_short __cl_short8 __attribute__((vector_size(16))); + typedef cl_uint __cl_uint4 __attribute__((vector_size(16))); + typedef cl_int __cl_int4 __attribute__((vector_size(16))); + typedef cl_ulong __cl_ulong2 __attribute__((vector_size(16))); + typedef cl_long __cl_long2 __attribute__((vector_size(16))); + typedef cl_double __cl_double2 __attribute__((vector_size(16))); + #else + typedef __m128i __cl_uchar16; + typedef __m128i __cl_char16; + typedef __m128i __cl_ushort8; + typedef __m128i __cl_short8; + typedef __m128i __cl_uint4; + typedef __m128i __cl_int4; + typedef __m128i __cl_ulong2; + typedef __m128i __cl_long2; + typedef __m128d __cl_double2; + #endif + #define __CL_UCHAR16__ 1 + #define __CL_CHAR16__ 1 + #define __CL_USHORT8__ 1 + #define __CL_SHORT8__ 1 + #define __CL_INT4__ 1 + #define __CL_UINT4__ 1 + #define __CL_ULONG2__ 1 + #define __CL_LONG2__ 1 + #define __CL_DOUBLE2__ 1 +#endif + +#if defined( __MMX__ ) + #include + #if defined( __GNUC__ ) + typedef cl_uchar __cl_uchar8 __attribute__((vector_size(8))); + typedef cl_char __cl_char8 __attribute__((vector_size(8))); + typedef cl_ushort __cl_ushort4 __attribute__((vector_size(8))); + typedef cl_short __cl_short4 __attribute__((vector_size(8))); + typedef cl_uint __cl_uint2 __attribute__((vector_size(8))); + typedef cl_int __cl_int2 __attribute__((vector_size(8))); + typedef cl_ulong __cl_ulong1 __attribute__((vector_size(8))); + typedef cl_long __cl_long1 __attribute__((vector_size(8))); + typedef cl_float __cl_float2 __attribute__((vector_size(8))); + #else + typedef __m64 __cl_uchar8; + typedef __m64 __cl_char8; + typedef __m64 __cl_ushort4; + typedef __m64 __cl_short4; + typedef __m64 __cl_uint2; + typedef __m64 __cl_int2; + typedef __m64 __cl_ulong1; + typedef __m64 __cl_long1; + typedef __m64 __cl_float2; + #endif + #define __CL_UCHAR8__ 1 + #define __CL_CHAR8__ 1 + #define __CL_USHORT4__ 1 + #define __CL_SHORT4__ 1 + #define __CL_INT2__ 1 + #define __CL_UINT2__ 1 + #define __CL_ULONG1__ 1 + #define __CL_LONG1__ 1 + #define __CL_FLOAT2__ 1 +#endif + +#if defined( __AVX__ ) + #if defined( __MINGW64__ ) + #include + #else + #include + #endif + #if defined( __GNUC__ ) + typedef cl_float __cl_float8 __attribute__((vector_size(32))); + typedef cl_double __cl_double4 __attribute__((vector_size(32))); + #else + typedef __m256 __cl_float8; + typedef __m256d __cl_double4; + #endif + #define __CL_FLOAT8__ 1 + #define __CL_DOUBLE4__ 1 +#endif + +/* Define capabilities for anonymous struct members. */ +#if !defined(__cplusplus) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L +#define __CL_HAS_ANON_STRUCT__ 1 +#define __CL_ANON_STRUCT__ +#elif defined(_WIN32) && defined(_MSC_VER) && !defined(__STDC__) +#define __CL_HAS_ANON_STRUCT__ 1 +#define __CL_ANON_STRUCT__ +#elif defined(__GNUC__) && ! defined(__STRICT_ANSI__) +#define __CL_HAS_ANON_STRUCT__ 1 +#define __CL_ANON_STRUCT__ __extension__ +#elif defined(__clang__) +#define __CL_HAS_ANON_STRUCT__ 1 +#define __CL_ANON_STRUCT__ __extension__ +#else +#define __CL_HAS_ANON_STRUCT__ 0 +#define __CL_ANON_STRUCT__ +#endif + +#if defined(_WIN32) && defined(_MSC_VER) && __CL_HAS_ANON_STRUCT__ + /* Disable warning C4201: nonstandard extension used : nameless struct/union */ + #pragma warning( push ) + #pragma warning( disable : 4201 ) +#endif + +/* Define alignment keys */ +#if defined( __GNUC__ ) || defined(__INTEGRITY) + #define CL_ALIGNED(_x) __attribute__ ((aligned(_x))) +#elif defined( _WIN32) && (_MSC_VER) + /* Alignment keys neutered on windows because MSVC can't swallow function arguments with alignment requirements */ + /* http://msdn.microsoft.com/en-us/library/373ak2y1%28VS.71%29.aspx */ + /* #include */ + /* #define CL_ALIGNED(_x) _CRT_ALIGN(_x) */ + #define CL_ALIGNED(_x) +#else + #warning Need to implement some method to align data here + #define CL_ALIGNED(_x) +#endif + +/* Indicate whether .xyzw, .s0123 and .hi.lo are supported */ +#if __CL_HAS_ANON_STRUCT__ + /* .xyzw and .s0123...{f|F} are supported */ + #define CL_HAS_NAMED_VECTOR_FIELDS 1 + /* .hi and .lo are supported */ + #define CL_HAS_HI_LO_VECTOR_FIELDS 1 +#endif + +/* Define cl_vector types */ + +/* ---- cl_charn ---- */ +typedef union +{ + cl_char CL_ALIGNED(2) s[2]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_char x, y; }; + __CL_ANON_STRUCT__ struct{ cl_char s0, s1; }; + __CL_ANON_STRUCT__ struct{ cl_char lo, hi; }; +#endif +#if defined( __CL_CHAR2__) + __cl_char2 v2; +#endif +}cl_char2; + +typedef union +{ + cl_char CL_ALIGNED(4) s[4]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_char x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_char s0, s1, s2, s3; }; + __CL_ANON_STRUCT__ struct{ cl_char2 lo, hi; }; +#endif +#if defined( __CL_CHAR2__) + __cl_char2 v2[2]; +#endif +#if defined( __CL_CHAR4__) + __cl_char4 v4; +#endif +}cl_char4; + +/* cl_char3 is identical in size, alignment and behavior to cl_char4. See section 6.1.5. */ +typedef cl_char4 cl_char3; + +typedef union +{ + cl_char CL_ALIGNED(8) s[8]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_char x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_char s0, s1, s2, s3, s4, s5, s6, s7; }; + __CL_ANON_STRUCT__ struct{ cl_char4 lo, hi; }; +#endif +#if defined( __CL_CHAR2__) + __cl_char2 v2[4]; +#endif +#if defined( __CL_CHAR4__) + __cl_char4 v4[2]; +#endif +#if defined( __CL_CHAR8__ ) + __cl_char8 v8; +#endif +}cl_char8; + +typedef union +{ + cl_char CL_ALIGNED(16) s[16]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_char x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; + __CL_ANON_STRUCT__ struct{ cl_char s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; + __CL_ANON_STRUCT__ struct{ cl_char8 lo, hi; }; +#endif +#if defined( __CL_CHAR2__) + __cl_char2 v2[8]; +#endif +#if defined( __CL_CHAR4__) + __cl_char4 v4[4]; +#endif +#if defined( __CL_CHAR8__ ) + __cl_char8 v8[2]; +#endif +#if defined( __CL_CHAR16__ ) + __cl_char16 v16; +#endif +}cl_char16; + + +/* ---- cl_ucharn ---- */ +typedef union +{ + cl_uchar CL_ALIGNED(2) s[2]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_uchar x, y; }; + __CL_ANON_STRUCT__ struct{ cl_uchar s0, s1; }; + __CL_ANON_STRUCT__ struct{ cl_uchar lo, hi; }; +#endif +#if defined( __cl_uchar2__) + __cl_uchar2 v2; +#endif +}cl_uchar2; + +typedef union +{ + cl_uchar CL_ALIGNED(4) s[4]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_uchar x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_uchar s0, s1, s2, s3; }; + __CL_ANON_STRUCT__ struct{ cl_uchar2 lo, hi; }; +#endif +#if defined( __CL_UCHAR2__) + __cl_uchar2 v2[2]; +#endif +#if defined( __CL_UCHAR4__) + __cl_uchar4 v4; +#endif +}cl_uchar4; + +/* cl_uchar3 is identical in size, alignment and behavior to cl_uchar4. See section 6.1.5. */ +typedef cl_uchar4 cl_uchar3; + +typedef union +{ + cl_uchar CL_ALIGNED(8) s[8]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_uchar x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_uchar s0, s1, s2, s3, s4, s5, s6, s7; }; + __CL_ANON_STRUCT__ struct{ cl_uchar4 lo, hi; }; +#endif +#if defined( __CL_UCHAR2__) + __cl_uchar2 v2[4]; +#endif +#if defined( __CL_UCHAR4__) + __cl_uchar4 v4[2]; +#endif +#if defined( __CL_UCHAR8__ ) + __cl_uchar8 v8; +#endif +}cl_uchar8; + +typedef union +{ + cl_uchar CL_ALIGNED(16) s[16]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_uchar x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; + __CL_ANON_STRUCT__ struct{ cl_uchar s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; + __CL_ANON_STRUCT__ struct{ cl_uchar8 lo, hi; }; +#endif +#if defined( __CL_UCHAR2__) + __cl_uchar2 v2[8]; +#endif +#if defined( __CL_UCHAR4__) + __cl_uchar4 v4[4]; +#endif +#if defined( __CL_UCHAR8__ ) + __cl_uchar8 v8[2]; +#endif +#if defined( __CL_UCHAR16__ ) + __cl_uchar16 v16; +#endif +}cl_uchar16; + + +/* ---- cl_shortn ---- */ +typedef union +{ + cl_short CL_ALIGNED(4) s[2]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_short x, y; }; + __CL_ANON_STRUCT__ struct{ cl_short s0, s1; }; + __CL_ANON_STRUCT__ struct{ cl_short lo, hi; }; +#endif +#if defined( __CL_SHORT2__) + __cl_short2 v2; +#endif +}cl_short2; + +typedef union +{ + cl_short CL_ALIGNED(8) s[4]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_short x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_short s0, s1, s2, s3; }; + __CL_ANON_STRUCT__ struct{ cl_short2 lo, hi; }; +#endif +#if defined( __CL_SHORT2__) + __cl_short2 v2[2]; +#endif +#if defined( __CL_SHORT4__) + __cl_short4 v4; +#endif +}cl_short4; + +/* cl_short3 is identical in size, alignment and behavior to cl_short4. See section 6.1.5. */ +typedef cl_short4 cl_short3; + +typedef union +{ + cl_short CL_ALIGNED(16) s[8]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_short x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_short s0, s1, s2, s3, s4, s5, s6, s7; }; + __CL_ANON_STRUCT__ struct{ cl_short4 lo, hi; }; +#endif +#if defined( __CL_SHORT2__) + __cl_short2 v2[4]; +#endif +#if defined( __CL_SHORT4__) + __cl_short4 v4[2]; +#endif +#if defined( __CL_SHORT8__ ) + __cl_short8 v8; +#endif +}cl_short8; + +typedef union +{ + cl_short CL_ALIGNED(32) s[16]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_short x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; + __CL_ANON_STRUCT__ struct{ cl_short s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; + __CL_ANON_STRUCT__ struct{ cl_short8 lo, hi; }; +#endif +#if defined( __CL_SHORT2__) + __cl_short2 v2[8]; +#endif +#if defined( __CL_SHORT4__) + __cl_short4 v4[4]; +#endif +#if defined( __CL_SHORT8__ ) + __cl_short8 v8[2]; +#endif +#if defined( __CL_SHORT16__ ) + __cl_short16 v16; +#endif +}cl_short16; + + +/* ---- cl_ushortn ---- */ +typedef union +{ + cl_ushort CL_ALIGNED(4) s[2]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_ushort x, y; }; + __CL_ANON_STRUCT__ struct{ cl_ushort s0, s1; }; + __CL_ANON_STRUCT__ struct{ cl_ushort lo, hi; }; +#endif +#if defined( __CL_USHORT2__) + __cl_ushort2 v2; +#endif +}cl_ushort2; + +typedef union +{ + cl_ushort CL_ALIGNED(8) s[4]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_ushort x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_ushort s0, s1, s2, s3; }; + __CL_ANON_STRUCT__ struct{ cl_ushort2 lo, hi; }; +#endif +#if defined( __CL_USHORT2__) + __cl_ushort2 v2[2]; +#endif +#if defined( __CL_USHORT4__) + __cl_ushort4 v4; +#endif +}cl_ushort4; + +/* cl_ushort3 is identical in size, alignment and behavior to cl_ushort4. See section 6.1.5. */ +typedef cl_ushort4 cl_ushort3; + +typedef union +{ + cl_ushort CL_ALIGNED(16) s[8]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_ushort x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_ushort s0, s1, s2, s3, s4, s5, s6, s7; }; + __CL_ANON_STRUCT__ struct{ cl_ushort4 lo, hi; }; +#endif +#if defined( __CL_USHORT2__) + __cl_ushort2 v2[4]; +#endif +#if defined( __CL_USHORT4__) + __cl_ushort4 v4[2]; +#endif +#if defined( __CL_USHORT8__ ) + __cl_ushort8 v8; +#endif +}cl_ushort8; + +typedef union +{ + cl_ushort CL_ALIGNED(32) s[16]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_ushort x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; + __CL_ANON_STRUCT__ struct{ cl_ushort s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; + __CL_ANON_STRUCT__ struct{ cl_ushort8 lo, hi; }; +#endif +#if defined( __CL_USHORT2__) + __cl_ushort2 v2[8]; +#endif +#if defined( __CL_USHORT4__) + __cl_ushort4 v4[4]; +#endif +#if defined( __CL_USHORT8__ ) + __cl_ushort8 v8[2]; +#endif +#if defined( __CL_USHORT16__ ) + __cl_ushort16 v16; +#endif +}cl_ushort16; + + +/* ---- cl_halfn ---- */ +typedef union +{ + cl_half CL_ALIGNED(4) s[2]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_half x, y; }; + __CL_ANON_STRUCT__ struct{ cl_half s0, s1; }; + __CL_ANON_STRUCT__ struct{ cl_half lo, hi; }; +#endif +#if defined( __CL_HALF2__) + __cl_half2 v2; +#endif +}cl_half2; + +typedef union +{ + cl_half CL_ALIGNED(8) s[4]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_half x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_half s0, s1, s2, s3; }; + __CL_ANON_STRUCT__ struct{ cl_half2 lo, hi; }; +#endif +#if defined( __CL_HALF2__) + __cl_half2 v2[2]; +#endif +#if defined( __CL_HALF4__) + __cl_half4 v4; +#endif +}cl_half4; + +/* cl_half3 is identical in size, alignment and behavior to cl_half4. See section 6.1.5. */ +typedef cl_half4 cl_half3; + +typedef union +{ + cl_half CL_ALIGNED(16) s[8]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_half x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_half s0, s1, s2, s3, s4, s5, s6, s7; }; + __CL_ANON_STRUCT__ struct{ cl_half4 lo, hi; }; +#endif +#if defined( __CL_HALF2__) + __cl_half2 v2[4]; +#endif +#if defined( __CL_HALF4__) + __cl_half4 v4[2]; +#endif +#if defined( __CL_HALF8__ ) + __cl_half8 v8; +#endif +}cl_half8; + +typedef union +{ + cl_half CL_ALIGNED(32) s[16]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_half x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; + __CL_ANON_STRUCT__ struct{ cl_half s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; + __CL_ANON_STRUCT__ struct{ cl_half8 lo, hi; }; +#endif +#if defined( __CL_HALF2__) + __cl_half2 v2[8]; +#endif +#if defined( __CL_HALF4__) + __cl_half4 v4[4]; +#endif +#if defined( __CL_HALF8__ ) + __cl_half8 v8[2]; +#endif +#if defined( __CL_HALF16__ ) + __cl_half16 v16; +#endif +}cl_half16; + +/* ---- cl_intn ---- */ +typedef union +{ + cl_int CL_ALIGNED(8) s[2]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_int x, y; }; + __CL_ANON_STRUCT__ struct{ cl_int s0, s1; }; + __CL_ANON_STRUCT__ struct{ cl_int lo, hi; }; +#endif +#if defined( __CL_INT2__) + __cl_int2 v2; +#endif +}cl_int2; + +typedef union +{ + cl_int CL_ALIGNED(16) s[4]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_int x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_int s0, s1, s2, s3; }; + __CL_ANON_STRUCT__ struct{ cl_int2 lo, hi; }; +#endif +#if defined( __CL_INT2__) + __cl_int2 v2[2]; +#endif +#if defined( __CL_INT4__) + __cl_int4 v4; +#endif +}cl_int4; + +/* cl_int3 is identical in size, alignment and behavior to cl_int4. See section 6.1.5. */ +typedef cl_int4 cl_int3; + +typedef union +{ + cl_int CL_ALIGNED(32) s[8]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_int x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_int s0, s1, s2, s3, s4, s5, s6, s7; }; + __CL_ANON_STRUCT__ struct{ cl_int4 lo, hi; }; +#endif +#if defined( __CL_INT2__) + __cl_int2 v2[4]; +#endif +#if defined( __CL_INT4__) + __cl_int4 v4[2]; +#endif +#if defined( __CL_INT8__ ) + __cl_int8 v8; +#endif +}cl_int8; + +typedef union +{ + cl_int CL_ALIGNED(64) s[16]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_int x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; + __CL_ANON_STRUCT__ struct{ cl_int s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; + __CL_ANON_STRUCT__ struct{ cl_int8 lo, hi; }; +#endif +#if defined( __CL_INT2__) + __cl_int2 v2[8]; +#endif +#if defined( __CL_INT4__) + __cl_int4 v4[4]; +#endif +#if defined( __CL_INT8__ ) + __cl_int8 v8[2]; +#endif +#if defined( __CL_INT16__ ) + __cl_int16 v16; +#endif +}cl_int16; + + +/* ---- cl_uintn ---- */ +typedef union +{ + cl_uint CL_ALIGNED(8) s[2]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_uint x, y; }; + __CL_ANON_STRUCT__ struct{ cl_uint s0, s1; }; + __CL_ANON_STRUCT__ struct{ cl_uint lo, hi; }; +#endif +#if defined( __CL_UINT2__) + __cl_uint2 v2; +#endif +}cl_uint2; + +typedef union +{ + cl_uint CL_ALIGNED(16) s[4]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_uint x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_uint s0, s1, s2, s3; }; + __CL_ANON_STRUCT__ struct{ cl_uint2 lo, hi; }; +#endif +#if defined( __CL_UINT2__) + __cl_uint2 v2[2]; +#endif +#if defined( __CL_UINT4__) + __cl_uint4 v4; +#endif +}cl_uint4; + +/* cl_uint3 is identical in size, alignment and behavior to cl_uint4. See section 6.1.5. */ +typedef cl_uint4 cl_uint3; + +typedef union +{ + cl_uint CL_ALIGNED(32) s[8]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_uint x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_uint s0, s1, s2, s3, s4, s5, s6, s7; }; + __CL_ANON_STRUCT__ struct{ cl_uint4 lo, hi; }; +#endif +#if defined( __CL_UINT2__) + __cl_uint2 v2[4]; +#endif +#if defined( __CL_UINT4__) + __cl_uint4 v4[2]; +#endif +#if defined( __CL_UINT8__ ) + __cl_uint8 v8; +#endif +}cl_uint8; + +typedef union +{ + cl_uint CL_ALIGNED(64) s[16]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_uint x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; + __CL_ANON_STRUCT__ struct{ cl_uint s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; + __CL_ANON_STRUCT__ struct{ cl_uint8 lo, hi; }; +#endif +#if defined( __CL_UINT2__) + __cl_uint2 v2[8]; +#endif +#if defined( __CL_UINT4__) + __cl_uint4 v4[4]; +#endif +#if defined( __CL_UINT8__ ) + __cl_uint8 v8[2]; +#endif +#if defined( __CL_UINT16__ ) + __cl_uint16 v16; +#endif +}cl_uint16; + +/* ---- cl_longn ---- */ +typedef union +{ + cl_long CL_ALIGNED(16) s[2]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_long x, y; }; + __CL_ANON_STRUCT__ struct{ cl_long s0, s1; }; + __CL_ANON_STRUCT__ struct{ cl_long lo, hi; }; +#endif +#if defined( __CL_LONG2__) + __cl_long2 v2; +#endif +}cl_long2; + +typedef union +{ + cl_long CL_ALIGNED(32) s[4]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_long x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_long s0, s1, s2, s3; }; + __CL_ANON_STRUCT__ struct{ cl_long2 lo, hi; }; +#endif +#if defined( __CL_LONG2__) + __cl_long2 v2[2]; +#endif +#if defined( __CL_LONG4__) + __cl_long4 v4; +#endif +}cl_long4; + +/* cl_long3 is identical in size, alignment and behavior to cl_long4. See section 6.1.5. */ +typedef cl_long4 cl_long3; + +typedef union +{ + cl_long CL_ALIGNED(64) s[8]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_long x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_long s0, s1, s2, s3, s4, s5, s6, s7; }; + __CL_ANON_STRUCT__ struct{ cl_long4 lo, hi; }; +#endif +#if defined( __CL_LONG2__) + __cl_long2 v2[4]; +#endif +#if defined( __CL_LONG4__) + __cl_long4 v4[2]; +#endif +#if defined( __CL_LONG8__ ) + __cl_long8 v8; +#endif +}cl_long8; + +typedef union +{ + cl_long CL_ALIGNED(128) s[16]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_long x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; + __CL_ANON_STRUCT__ struct{ cl_long s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; + __CL_ANON_STRUCT__ struct{ cl_long8 lo, hi; }; +#endif +#if defined( __CL_LONG2__) + __cl_long2 v2[8]; +#endif +#if defined( __CL_LONG4__) + __cl_long4 v4[4]; +#endif +#if defined( __CL_LONG8__ ) + __cl_long8 v8[2]; +#endif +#if defined( __CL_LONG16__ ) + __cl_long16 v16; +#endif +}cl_long16; + + +/* ---- cl_ulongn ---- */ +typedef union +{ + cl_ulong CL_ALIGNED(16) s[2]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_ulong x, y; }; + __CL_ANON_STRUCT__ struct{ cl_ulong s0, s1; }; + __CL_ANON_STRUCT__ struct{ cl_ulong lo, hi; }; +#endif +#if defined( __CL_ULONG2__) + __cl_ulong2 v2; +#endif +}cl_ulong2; + +typedef union +{ + cl_ulong CL_ALIGNED(32) s[4]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_ulong x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_ulong s0, s1, s2, s3; }; + __CL_ANON_STRUCT__ struct{ cl_ulong2 lo, hi; }; +#endif +#if defined( __CL_ULONG2__) + __cl_ulong2 v2[2]; +#endif +#if defined( __CL_ULONG4__) + __cl_ulong4 v4; +#endif +}cl_ulong4; + +/* cl_ulong3 is identical in size, alignment and behavior to cl_ulong4. See section 6.1.5. */ +typedef cl_ulong4 cl_ulong3; + +typedef union +{ + cl_ulong CL_ALIGNED(64) s[8]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_ulong x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_ulong s0, s1, s2, s3, s4, s5, s6, s7; }; + __CL_ANON_STRUCT__ struct{ cl_ulong4 lo, hi; }; +#endif +#if defined( __CL_ULONG2__) + __cl_ulong2 v2[4]; +#endif +#if defined( __CL_ULONG4__) + __cl_ulong4 v4[2]; +#endif +#if defined( __CL_ULONG8__ ) + __cl_ulong8 v8; +#endif +}cl_ulong8; + +typedef union +{ + cl_ulong CL_ALIGNED(128) s[16]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_ulong x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; + __CL_ANON_STRUCT__ struct{ cl_ulong s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; + __CL_ANON_STRUCT__ struct{ cl_ulong8 lo, hi; }; +#endif +#if defined( __CL_ULONG2__) + __cl_ulong2 v2[8]; +#endif +#if defined( __CL_ULONG4__) + __cl_ulong4 v4[4]; +#endif +#if defined( __CL_ULONG8__ ) + __cl_ulong8 v8[2]; +#endif +#if defined( __CL_ULONG16__ ) + __cl_ulong16 v16; +#endif +}cl_ulong16; + + +/* --- cl_floatn ---- */ + +typedef union +{ + cl_float CL_ALIGNED(8) s[2]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_float x, y; }; + __CL_ANON_STRUCT__ struct{ cl_float s0, s1; }; + __CL_ANON_STRUCT__ struct{ cl_float lo, hi; }; +#endif +#if defined( __CL_FLOAT2__) + __cl_float2 v2; +#endif +}cl_float2; + +typedef union +{ + cl_float CL_ALIGNED(16) s[4]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_float x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_float s0, s1, s2, s3; }; + __CL_ANON_STRUCT__ struct{ cl_float2 lo, hi; }; +#endif +#if defined( __CL_FLOAT2__) + __cl_float2 v2[2]; +#endif +#if defined( __CL_FLOAT4__) + __cl_float4 v4; +#endif +}cl_float4; + +/* cl_float3 is identical in size, alignment and behavior to cl_float4. See section 6.1.5. */ +typedef cl_float4 cl_float3; + +typedef union +{ + cl_float CL_ALIGNED(32) s[8]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_float x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_float s0, s1, s2, s3, s4, s5, s6, s7; }; + __CL_ANON_STRUCT__ struct{ cl_float4 lo, hi; }; +#endif +#if defined( __CL_FLOAT2__) + __cl_float2 v2[4]; +#endif +#if defined( __CL_FLOAT4__) + __cl_float4 v4[2]; +#endif +#if defined( __CL_FLOAT8__ ) + __cl_float8 v8; +#endif +}cl_float8; + +typedef union +{ + cl_float CL_ALIGNED(64) s[16]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_float x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; + __CL_ANON_STRUCT__ struct{ cl_float s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; + __CL_ANON_STRUCT__ struct{ cl_float8 lo, hi; }; +#endif +#if defined( __CL_FLOAT2__) + __cl_float2 v2[8]; +#endif +#if defined( __CL_FLOAT4__) + __cl_float4 v4[4]; +#endif +#if defined( __CL_FLOAT8__ ) + __cl_float8 v8[2]; +#endif +#if defined( __CL_FLOAT16__ ) + __cl_float16 v16; +#endif +}cl_float16; + +/* --- cl_doublen ---- */ + +typedef union +{ + cl_double CL_ALIGNED(16) s[2]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_double x, y; }; + __CL_ANON_STRUCT__ struct{ cl_double s0, s1; }; + __CL_ANON_STRUCT__ struct{ cl_double lo, hi; }; +#endif +#if defined( __CL_DOUBLE2__) + __cl_double2 v2; +#endif +}cl_double2; + +typedef union +{ + cl_double CL_ALIGNED(32) s[4]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_double x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_double s0, s1, s2, s3; }; + __CL_ANON_STRUCT__ struct{ cl_double2 lo, hi; }; +#endif +#if defined( __CL_DOUBLE2__) + __cl_double2 v2[2]; +#endif +#if defined( __CL_DOUBLE4__) + __cl_double4 v4; +#endif +}cl_double4; + +/* cl_double3 is identical in size, alignment and behavior to cl_double4. See section 6.1.5. */ +typedef cl_double4 cl_double3; + +typedef union +{ + cl_double CL_ALIGNED(64) s[8]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_double x, y, z, w; }; + __CL_ANON_STRUCT__ struct{ cl_double s0, s1, s2, s3, s4, s5, s6, s7; }; + __CL_ANON_STRUCT__ struct{ cl_double4 lo, hi; }; +#endif +#if defined( __CL_DOUBLE2__) + __cl_double2 v2[4]; +#endif +#if defined( __CL_DOUBLE4__) + __cl_double4 v4[2]; +#endif +#if defined( __CL_DOUBLE8__ ) + __cl_double8 v8; +#endif +}cl_double8; + +typedef union +{ + cl_double CL_ALIGNED(128) s[16]; +#if __CL_HAS_ANON_STRUCT__ + __CL_ANON_STRUCT__ struct{ cl_double x, y, z, w, __spacer4, __spacer5, __spacer6, __spacer7, __spacer8, __spacer9, sa, sb, sc, sd, se, sf; }; + __CL_ANON_STRUCT__ struct{ cl_double s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF; }; + __CL_ANON_STRUCT__ struct{ cl_double8 lo, hi; }; +#endif +#if defined( __CL_DOUBLE2__) + __cl_double2 v2[8]; +#endif +#if defined( __CL_DOUBLE4__) + __cl_double4 v4[4]; +#endif +#if defined( __CL_DOUBLE8__ ) + __cl_double8 v8[2]; +#endif +#if defined( __CL_DOUBLE16__ ) + __cl_double16 v16; +#endif +}cl_double16; + +/* Macro to facilitate debugging + * Usage: + * Place CL_PROGRAM_STRING_DEBUG_INFO on the line before the first line of your source. + * The first line ends with: CL_PROGRAM_STRING_DEBUG_INFO \" + * Each line thereafter of OpenCL C source must end with: \n\ + * The last line ends in "; + * + * Example: + * + * const char *my_program = CL_PROGRAM_STRING_DEBUG_INFO "\ + * kernel void foo( int a, float * b ) \n\ + * { \n\ + * // my comment \n\ + * *b[ get_global_id(0)] = a; \n\ + * } \n\ + * "; + * + * This should correctly set up the line, (column) and file information for your source + * string so you can do source level debugging. + */ +#define __CL_STRINGIFY( _x ) # _x +#define _CL_STRINGIFY( _x ) __CL_STRINGIFY( _x ) +#define CL_PROGRAM_STRING_DEBUG_INFO "#line " _CL_STRINGIFY(__LINE__) " \"" __FILE__ "\" \n\n" + +#ifdef __cplusplus +} +#endif + +#if defined(_WIN32) && defined(_MSC_VER) && __CL_HAS_ANON_STRUCT__ + #pragma warning( pop ) +#endif + +#endif /* __CL_PLATFORM_H */ diff --git a/cuda_toolkit/include/CL/cl_version.h b/cuda_toolkit/include/CL/cl_version.h new file mode 100644 index 0000000000000000000000000000000000000000..fcaa84efa39fd3283321186bdc5307112d52e5d3 --- /dev/null +++ b/cuda_toolkit/include/CL/cl_version.h @@ -0,0 +1,81 @@ +/******************************************************************************* + * Copyright (c) 2018-2020 The Khronos Group Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ + +#ifndef __CL_VERSION_H +#define __CL_VERSION_H + +/* Detect which version to target */ +#if !defined(CL_TARGET_OPENCL_VERSION) +#pragma message("cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 300 (OpenCL 3.0)") +#define CL_TARGET_OPENCL_VERSION 300 +#endif +#if CL_TARGET_OPENCL_VERSION != 100 && \ + CL_TARGET_OPENCL_VERSION != 110 && \ + CL_TARGET_OPENCL_VERSION != 120 && \ + CL_TARGET_OPENCL_VERSION != 200 && \ + CL_TARGET_OPENCL_VERSION != 210 && \ + CL_TARGET_OPENCL_VERSION != 220 && \ + CL_TARGET_OPENCL_VERSION != 300 +#pragma message("cl_version: CL_TARGET_OPENCL_VERSION is not a valid value (100, 110, 120, 200, 210, 220, 300). Defaulting to 300 (OpenCL 3.0)") +#undef CL_TARGET_OPENCL_VERSION +#define CL_TARGET_OPENCL_VERSION 300 +#endif + + +/* OpenCL Version */ +#if CL_TARGET_OPENCL_VERSION >= 300 && !defined(CL_VERSION_3_0) +#define CL_VERSION_3_0 1 +#endif +#if CL_TARGET_OPENCL_VERSION >= 220 && !defined(CL_VERSION_2_2) +#define CL_VERSION_2_2 1 +#endif +#if CL_TARGET_OPENCL_VERSION >= 210 && !defined(CL_VERSION_2_1) +#define CL_VERSION_2_1 1 +#endif +#if CL_TARGET_OPENCL_VERSION >= 200 && !defined(CL_VERSION_2_0) +#define CL_VERSION_2_0 1 +#endif +#if CL_TARGET_OPENCL_VERSION >= 120 && !defined(CL_VERSION_1_2) +#define CL_VERSION_1_2 1 +#endif +#if CL_TARGET_OPENCL_VERSION >= 110 && !defined(CL_VERSION_1_1) +#define CL_VERSION_1_1 1 +#endif +#if CL_TARGET_OPENCL_VERSION >= 100 && !defined(CL_VERSION_1_0) +#define CL_VERSION_1_0 1 +#endif + +/* Allow deprecated APIs for older OpenCL versions. */ +#if CL_TARGET_OPENCL_VERSION <= 220 && !defined(CL_USE_DEPRECATED_OPENCL_2_2_APIS) +#define CL_USE_DEPRECATED_OPENCL_2_2_APIS +#endif +#if CL_TARGET_OPENCL_VERSION <= 210 && !defined(CL_USE_DEPRECATED_OPENCL_2_1_APIS) +#define CL_USE_DEPRECATED_OPENCL_2_1_APIS +#endif +#if CL_TARGET_OPENCL_VERSION <= 200 && !defined(CL_USE_DEPRECATED_OPENCL_2_0_APIS) +#define CL_USE_DEPRECATED_OPENCL_2_0_APIS +#endif +#if CL_TARGET_OPENCL_VERSION <= 120 && !defined(CL_USE_DEPRECATED_OPENCL_1_2_APIS) +#define CL_USE_DEPRECATED_OPENCL_1_2_APIS +#endif +#if CL_TARGET_OPENCL_VERSION <= 110 && !defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS) +#define CL_USE_DEPRECATED_OPENCL_1_1_APIS +#endif +#if CL_TARGET_OPENCL_VERSION <= 100 && !defined(CL_USE_DEPRECATED_OPENCL_1_0_APIS) +#define CL_USE_DEPRECATED_OPENCL_1_0_APIS +#endif + +#endif /* __CL_VERSION_H */ diff --git a/cuda_toolkit/include/CL/opencl.h b/cuda_toolkit/include/CL/opencl.h new file mode 100644 index 0000000000000000000000000000000000000000..4d9419287fb2b9cb4e521905b1e589dce643d0e2 --- /dev/null +++ b/cuda_toolkit/include/CL/opencl.h @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright (c) 2008-2021 The Khronos Group Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ******************************************************************************/ + +#ifndef __OPENCL_H +#define __OPENCL_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +#ifdef __cplusplus +} +#endif + +#endif /* __OPENCL_H */ diff --git a/cuda_toolkit/include/cooperative_groups/memcpy_async.h b/cuda_toolkit/include/cooperative_groups/memcpy_async.h new file mode 100644 index 0000000000000000000000000000000000000000..91d428b25b8d1e92a5d86bbe8148fe659533a96c --- /dev/null +++ b/cuda_toolkit/include/cooperative_groups/memcpy_async.h @@ -0,0 +1,62 @@ + /* Copyright 1993-2016 NVIDIA Corporation. All rights reserved. + * + * NOTICE TO LICENSEE: + * + * The source code and/or documentation ("Licensed Deliverables") are + * subject to NVIDIA intellectual property rights under U.S. and + * international Copyright laws. + * + * The Licensed Deliverables contained herein are PROPRIETARY and + * CONFIDENTIAL to NVIDIA and are being provided under the terms and + * conditions of a form of NVIDIA software license agreement by and + * between NVIDIA and Licensee ("License Agreement") or electronically + * accepted by Licensee. Notwithstanding any terms or conditions to + * the contrary in the License Agreement, reproduction or disclosure + * of the Licensed Deliverables to any third party without the express + * written consent of NVIDIA is prohibited. + * + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE + * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. THEY ARE + * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. + * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED + * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, + * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY + * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THESE LICENSED DELIVERABLES. + * + * U.S. Government End Users. These Licensed Deliverables are a + * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT + * 1995), consisting of "commercial computer software" and "commercial + * computer software documentation" as such terms are used in 48 + * C.F.R. 12.212 (SEPT 1995) and are provided to the U.S. Government + * only as a commercial end item. Consistent with 48 C.F.R.12.212 and + * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all + * U.S. Government End Users acquire the Licensed Deliverables with + * only those rights set forth herein. + * + * Any use of the Licensed Deliverables in individual and commercial + * software must include, in the user documentation and internal + * comments to the code, the above Disclaimer and U.S. Government End + * Users Notice. + */ + +#ifndef _COOPERATIVE_GROUPS_MEMCPY_ASYNC +#define _COOPERATIVE_GROUPS_MEMCPY_ASYNC + +#include "../cooperative_groups.h" +#include "details/info.h" + +#ifdef _CG_CPP11_FEATURES +# include "details/async.h" +#else +# error This file requires compiler support for the ISO C++ 2011 standard. This support must be enabled with the \ + -std=c++11 compiler option. +#endif + +#endif // _COOPERATIVE_GROUPS_MEMCPY_ASYNC diff --git a/cuda_toolkit/include/cooperative_groups/reduce.h b/cuda_toolkit/include/cooperative_groups/reduce.h new file mode 100644 index 0000000000000000000000000000000000000000..68335edb92acc7b538866e6445cc6542410835bf --- /dev/null +++ b/cuda_toolkit/include/cooperative_groups/reduce.h @@ -0,0 +1,63 @@ + /* Copyright 1993-2016 NVIDIA Corporation. All rights reserved. + * + * NOTICE TO LICENSEE: + * + * The source code and/or documentation ("Licensed Deliverables") are + * subject to NVIDIA intellectual property rights under U.S. and + * international Copyright laws. + * + * The Licensed Deliverables contained herein are PROPRIETARY and + * CONFIDENTIAL to NVIDIA and are being provided under the terms and + * conditions of a form of NVIDIA software license agreement by and + * between NVIDIA and Licensee ("License Agreement") or electronically + * accepted by Licensee. Notwithstanding any terms or conditions to + * the contrary in the License Agreement, reproduction or disclosure + * of the Licensed Deliverables to any third party without the express + * written consent of NVIDIA is prohibited. + * + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE + * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. THEY ARE + * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. + * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED + * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, + * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY + * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THESE LICENSED DELIVERABLES. + * + * U.S. Government End Users. These Licensed Deliverables are a + * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT + * 1995), consisting of "commercial computer software" and "commercial + * computer software documentation" as such terms are used in 48 + * C.F.R. 12.212 (SEPT 1995) and are provided to the U.S. Government + * only as a commercial end item. Consistent with 48 C.F.R.12.212 and + * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all + * U.S. Government End Users acquire the Licensed Deliverables with + * only those rights set forth herein. + * + * Any use of the Licensed Deliverables in individual and commercial + * software must include, in the user documentation and internal + * comments to the code, the above Disclaimer and U.S. Government End + * Users Notice. + */ + +#ifndef _COOPERATIVE_GROUPS_REDUCE_H +#define _COOPERATIVE_GROUPS_REDUCE_H + +#include "../cooperative_groups.h" +#include "details/info.h" + +#ifdef _CG_CPP11_FEATURES +# include "details/reduce.h" +#else +# error This file requires compiler support for the ISO C++ 2011 standard. This support must be enabled with the \ + -std=c++11 compiler option. +#endif + + +#endif //_COOPERATIVE_GROUPS_REDUCE_H diff --git a/cuda_toolkit/include/cooperative_groups/scan.h b/cuda_toolkit/include/cooperative_groups/scan.h new file mode 100644 index 0000000000000000000000000000000000000000..8452963748b9c4f6d8be3488a0bc355300b85a4f --- /dev/null +++ b/cuda_toolkit/include/cooperative_groups/scan.h @@ -0,0 +1,63 @@ +/* Copyright 1993-2016 NVIDIA Corporation. All rights reserved. + * + * NOTICE TO LICENSEE: + * + * The source code and/or documentation ("Licensed Deliverables") are + * subject to NVIDIA intellectual property rights under U.S. and + * international Copyright laws. + * + * The Licensed Deliverables contained herein are PROPRIETARY and + * CONFIDENTIAL to NVIDIA and are being provided under the terms and + * conditions of a form of NVIDIA software license agreement by and + * between NVIDIA and Licensee ("License Agreement") or electronically + * accepted by Licensee. Notwithstanding any terms or conditions to + * the contrary in the License Agreement, reproduction or disclosure + * of the Licensed Deliverables to any third party without the express + * written consent of NVIDIA is prohibited. + * + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE + * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. THEY ARE + * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. + * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED + * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, + * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY + * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THESE LICENSED DELIVERABLES. + * + * U.S. Government End Users. These Licensed Deliverables are a + * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT + * 1995), consisting of "commercial computer software" and "commercial + * computer software documentation" as such terms are used in 48 + * C.F.R. 12.212 (SEPT 1995) and are provided to the U.S. Government + * only as a commercial end item. Consistent with 48 C.F.R.12.212 and + * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all + * U.S. Government End Users acquire the Licensed Deliverables with + * only those rights set forth herein. + * + * Any use of the Licensed Deliverables in individual and commercial + * software must include, in the user documentation and internal + * comments to the code, the above Disclaimer and U.S. Government End + * Users Notice. + */ + +#ifndef _COOPERATIVE_GROUPS_SCAN_H +#define _COOPERATIVE_GROUPS_SCAN_H + +#include "../cooperative_groups.h" +#include "details/info.h" + +#ifdef _CG_CPP11_FEATURES +# include "details/scan.h" +#else +# error This file requires compiler support for the ISO C++ 2011 standard. This support must be enabled with the \ + -std=c++11 compiler option. +#endif + + +#endif //_COOPERATIVE_GROUPS_SCAN_H diff --git a/cuda_toolkit/include/crt/common_functions.h b/cuda_toolkit/include/crt/common_functions.h new file mode 100644 index 0000000000000000000000000000000000000000..a919d9adf8fc24782fb43e22937e9450ad174f2b --- /dev/null +++ b/cuda_toolkit/include/crt/common_functions.h @@ -0,0 +1,310 @@ +/* + * Copyright 1993-2021 NVIDIA Corporation. All rights reserved. + * + * NOTICE TO LICENSEE: + * + * This source code and/or documentation ("Licensed Deliverables") are + * subject to NVIDIA intellectual property rights under U.S. and + * international Copyright laws. + * + * These Licensed Deliverables contained herein is PROPRIETARY and + * CONFIDENTIAL to NVIDIA and is being provided under the terms and + * conditions of a form of NVIDIA software license agreement by and + * between NVIDIA and Licensee ("License Agreement") or electronically + * accepted by Licensee. Notwithstanding any terms or conditions to + * the contrary in the License Agreement, reproduction or disclosure + * of the Licensed Deliverables to any third party without the express + * written consent of NVIDIA is prohibited. + * + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE + * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS + * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. + * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED + * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, + * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE. + * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE + * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY + * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THESE LICENSED DELIVERABLES. + * + * U.S. Government End Users. These Licensed Deliverables are a + * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT + * 1995), consisting of "commercial computer software" and "commercial + * computer software documentation" as such terms are used in 48 + * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government + * only as a commercial end item. Consistent with 48 C.F.R.12.212 and + * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all + * U.S. Government End Users acquire the Licensed Deliverables with + * only those rights set forth herein. + * + * Any use of the Licensed Deliverables in individual and commercial + * software must include, in the user documentation and internal + * comments to the code, the above Disclaimer and U.S. Government End + * Users Notice. + */ + +#if !defined(__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__) +#if defined(_MSC_VER) +#pragma message("crt/common_functions.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead.") +#else +#warning "crt/common_functions.h is an internal header file and must not be used directly. Please use cuda_runtime_api.h or cuda_runtime.h instead." +#endif +#define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#define __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_COMMON_FUNCTIONS_H__ +#endif + +#if !defined(__COMMON_FUNCTIONS_H__) +#define __COMMON_FUNCTIONS_H__ + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#if defined(__cplusplus) && defined(__CUDACC__) + +#include "builtin_types.h" +#include "host_defines.h" + +#define __CUDACC_VER__ "__CUDACC_VER__ is no longer supported. Use __CUDACC_VER_MAJOR__, __CUDACC_VER_MINOR__, and __CUDACC_VER_BUILD__ instead." + +#ifndef __CUDA_API_VER_MAJOR__ +#define __CUDA_API_VER_MAJOR__ __CUDACC_VER_MAJOR__ +#endif /* __CUDA_API_VER_MAJOR__ */ + +#ifndef __CUDA_API_VER_MINOR__ +#define __CUDA_API_VER_MINOR__ __CUDACC_VER_MINOR__ +#endif /* __CUDA_API_VER_MINOR__ */ + +#if !defined(__CUDACC_RTC__) +#include +#include + +extern "C" +{ +#endif /* !__CUDACC_RTC__ */ +extern _CRTIMP __host__ __device__ __device_builtin__ __cudart_builtin__ clock_t __cdecl clock(void) +#if defined(__QNX__) +asm("clock32") +#endif +__THROW; +extern __host__ __device__ __device_builtin__ __cudart_builtin__ void* __cdecl memset(void*, int, size_t) __THROW; +extern __host__ __device__ __device_builtin__ __cudart_builtin__ void* __cdecl memcpy(void*, const void*, size_t) __THROW; +#if !defined(__CUDACC_RTC__) +} +#endif /* !__CUDACC_RTC__ */ + +#if defined(__CUDA_ARCH__) + +#if defined(__CUDACC_RTC__) +inline __host__ __device__ void* operator new(size_t, void *p) { return p; } +inline __host__ __device__ void* operator new[](size_t, void *p) { return p; } +inline __host__ __device__ void operator delete(void*, void*) { } +inline __host__ __device__ void operator delete[](void*, void*) { } +#else /* !__CUDACC_RTC__ */ +#ifndef __CUDA_INTERNAL_SKIP_CPP_HEADERS__ +#include +#endif + +#if defined (__GNUC__) + +#define STD \ + std:: + +#else /* __GNUC__ */ + +#define STD + +#endif /* __GNUC__ */ + +extern __host__ __device__ __cudart_builtin__ void* __cdecl operator new(STD size_t, void*) throw(); +extern __host__ __device__ __cudart_builtin__ void* __cdecl operator new[](STD size_t, void*) throw(); +extern __host__ __device__ __cudart_builtin__ void __cdecl operator delete(void*, void*) throw(); +extern __host__ __device__ __cudart_builtin__ void __cdecl operator delete[](void*, void*) throw(); +# if __cplusplus >= 201402L || (defined(_MSC_VER) && _MSC_VER >= 1900) || defined(__CUDA_XLC_CPP14__) || defined(__CUDA_ICC_CPP14__) +extern __host__ __device__ __cudart_builtin__ void __cdecl operator delete(void*, STD size_t) throw(); +extern __host__ __device__ __cudart_builtin__ void __cdecl operator delete[](void*, STD size_t) throw(); +#endif /* __cplusplus >= 201402L || (defined(_MSC_VER) && _MSC_VER >= 1900) || defined(__CUDA_XLC_CPP14__) || defined(__CUDA_ICC_CPP14__) */ +#endif /* __CUDACC_RTC__ */ + +#if !defined(__CUDACC_RTC__) +#include +#include +#endif /* !__CUDACC_RTC__ */ + +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +namespace std { +#endif +extern "C" +{ +extern +#if !defined(_MSC_VER) || _MSC_VER < 1900 +_CRTIMP +#endif + +#if defined(__GLIBC__) && defined(__GLIBC_MINOR__) && ( (__GLIBC__ < 2) || ( (__GLIBC__ == 2) && (__GLIBC_MINOR__ < 3) ) ) +__host__ __device__ __device_builtin__ __cudart_builtin__ int __cdecl printf(const char*, ...) __THROW; +#else /* newer glibc */ +__host__ __device__ __device_builtin__ __cudart_builtin__ int __cdecl printf(const char*, ...); +#endif /* defined(__GLIBC__) && defined(__GLIBC_MINOR__) && ( (__GLIBC__ < 2) || ( (__GLIBC__ == 2) && (__GLIBC_MINOR__ < 3) ) ) */ + + +extern _CRTIMP __host__ __device__ __cudart_builtin__ void* __cdecl malloc(size_t) __THROW; +extern _CRTIMP __host__ __device__ __cudart_builtin__ void __cdecl free(void*) __THROW; + +#if defined(_MSC_VER) +extern __host__ __device__ __cudart_builtin__ void* __cdecl _alloca(size_t); +#endif + +#if defined(__QNX__) +#undef alloca +#define alloca(__S) __builtin_alloca(__S) +#endif +} +#if defined(__QNX__) && !defined(_LIBCPP_VERSION) +} /* std */ +#endif + +#if !defined(__CUDACC_RTC__) +#include +#endif /* !__CUDACC_RTC__ */ + +extern "C" +{ +#if defined(__CUDACC_RTC__) +extern __host__ __device__ void __assertfail(const char * __assertion, + const char *__file, + unsigned int __line, + const char *__function, + size_t charsize); +#elif defined(__APPLE__) +#define __builtin_expect(exp,c) (exp) +extern __host__ __device__ __cudart_builtin__ void __assert_rtn( + const char *, const char *, int, const char *); +#elif defined(__ANDROID__) +extern __host__ __device__ __cudart_builtin__ void __assert2( + const char *, int, const char *, const char *); +#elif defined(__QNX__) +#if !defined(_LIBCPP_VERSION) +namespace std { +#endif +extern __host__ __device__ __cudart_builtin__ void __assert( + const char *, const char *, unsigned int, const char *); +#if !defined(_LIBCPP_VERSION) +} +#endif +#elif defined(__HORIZON__) +extern __host__ __device__ __cudart_builtin__ void __assert_fail( + const char *, const char *, int, const char *); +#elif defined(__GNUC__) +extern __host__ __device__ __cudart_builtin__ void __assert_fail( + const char *, const char *, unsigned int, const char *) + __THROW; +#elif defined(_WIN32) +extern __host__ __device__ __cudart_builtin__ _CRTIMP void __cdecl _wassert( + const wchar_t *, const wchar_t *, unsigned); +#endif +} + +#if defined(__CUDACC_RTC__) +#ifdef NDEBUG +#define assert(e) (static_cast(0)) +#else /* !NDEBUG */ +#define __ASSERT_STR_HELPER(x) #x +#define assert(e) ((e) ? static_cast(0)\ + : __assertfail(__ASSERT_STR_HELPER(e), __FILE__,\ + __LINE__, __PRETTY_FUNCTION__,\ + sizeof(char))) +#endif /* NDEBUG */ +__host__ __device__ void* operator new(size_t); +__host__ __device__ void* operator new[](size_t); +__host__ __device__ void operator delete(void*); +__host__ __device__ void operator delete[](void*); +# if __cplusplus >= 201402L +__host__ __device__ void operator delete(void*, size_t); +__host__ __device__ void operator delete[](void*, size_t); +#endif /* __cplusplus >= 201402L */ + +#if __cplusplus >= 201703L +namespace std { enum class align_val_t : size_t {}; } +__host__ __device__ void* __cdecl operator new(size_t sz, std::align_val_t) noexcept; +__host__ __device__ void* __cdecl operator new[](size_t sz, std::align_val_t) noexcept; +__host__ __device__ void __cdecl operator delete(void* ptr, std::align_val_t) noexcept; +__host__ __device__ void __cdecl operator delete[](void* ptr, std::align_val_t) noexcept; +__host__ __device__ void __cdecl operator delete(void* ptr, size_t, std::align_val_t) noexcept; +__host__ __device__ void __cdecl operator delete[](void* ptr, size_t, std::align_val_t) noexcept; +#endif /* __cplusplus >= 201703L */ + +#else /* !__CUDACC_RTC__ */ +#if defined (__GNUC__) + +#define __NV_GLIBCXX_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) + +#if (__cplusplus >= 201103L) && ((!(defined(__QNX__) && defined(_LIBCPP_VERSION))) || (defined(__QNX__) && __NV_GLIBCXX_VERSION >= 80300)) +#define THROWBADALLOC +#else +#if defined(__ANDROID__) && !defined(_LIBCPP_VERSION) && (defined(__BIONIC__) || __NV_GLIBCXX_VERSION < 40900) +#define THROWBADALLOC +#else +#define THROWBADALLOC throw(STD bad_alloc) +#endif +#endif +#define __DELETE_THROW throw() + +#undef __NV_GLIBCXX_VERSION + +#else /* __GNUC__ */ + +#define THROWBADALLOC throw(...) + +#endif /* __GNUC__ */ + +extern __host__ __device__ __cudart_builtin__ void* __cdecl operator new(STD size_t) THROWBADALLOC; +extern __host__ __device__ __cudart_builtin__ void* __cdecl operator new[](STD size_t) THROWBADALLOC; +extern __host__ __device__ __cudart_builtin__ void __cdecl operator delete(void*) throw(); +extern __host__ __device__ __cudart_builtin__ void __cdecl operator delete[](void*) throw(); +# if __cplusplus >= 201402L || (defined(_MSC_VER) && _MSC_VER >= 1900) || defined(__CUDA_XLC_CPP14__) || defined(__CUDA_ICC_CPP14__) +extern __host__ __device__ __cudart_builtin__ void __cdecl operator delete(void*, STD size_t) throw(); +extern __host__ __device__ __cudart_builtin__ void __cdecl operator delete[](void*, STD size_t) throw(); +#endif /* __cplusplus >= 201402L || (defined(_MSC_VER) && _MSC_VER >= 1900) || defined(__CUDA_XLC_CPP14__) || defined(__CUDA_ICC_CPP14__) */ + +#if __cpp_aligned_new +extern __host__ __device__ __cudart_builtin__ void* __cdecl operator new(STD size_t, std::align_val_t); +extern __host__ __device__ __cudart_builtin__ void* __cdecl operator new[](STD size_t, std::align_val_t); +extern __host__ __device__ __cudart_builtin__ void __cdecl operator delete(void*, std::align_val_t) noexcept; +extern __host__ __device__ __cudart_builtin__ void __cdecl operator delete[](void*, std::align_val_t) noexcept; +extern __host__ __device__ __cudart_builtin__ void __cdecl operator delete(void*, STD size_t, std::align_val_t) noexcept; +extern __host__ __device__ __cudart_builtin__ void __cdecl operator delete[](void*, STD size_t, std::align_val_t) noexcept; +#endif /* __cpp_aligned_new */ + +#undef THROWBADALLOC +#undef STD +#endif /* __CUDACC_RTC__ */ + +#endif /* __CUDA_ARCH__ */ + +#endif /* __cplusplus && __CUDACC__ */ + +/******************************************************************************* +* * +* * +* * +*******************************************************************************/ + +#if defined(__CUDACC_RTC__) && (__CUDA_ARCH__ >= 350) +#include "cuda_device_runtime_api.h" +#endif + +#include "math_functions.h" + +#endif /* !__COMMON_FUNCTIONS_H__ */ + +#if defined(__UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_COMMON_FUNCTIONS_H__) +#undef __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__ +#undef __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_COMMON_FUNCTIONS_H__ +#endif diff --git a/cuda_toolkit/lib/x64/OpenCL.lib b/cuda_toolkit/lib/x64/OpenCL.lib new file mode 100644 index 0000000000000000000000000000000000000000..20ed60d9f2e07df188ab496f61c21f3f5e96862d Binary files /dev/null and b/cuda_toolkit/lib/x64/OpenCL.lib differ diff --git a/cuda_toolkit/lib/x64/cublasLt.lib b/cuda_toolkit/lib/x64/cublasLt.lib new file mode 100644 index 0000000000000000000000000000000000000000..e3ffcd10c9886c9973374516fcf0852776d5fe09 Binary files /dev/null and b/cuda_toolkit/lib/x64/cublasLt.lib differ diff --git a/cuda_toolkit/lib/x64/cufft.lib b/cuda_toolkit/lib/x64/cufft.lib new file mode 100644 index 0000000000000000000000000000000000000000..d6669e6cb634e04998e96f14aef21c28d4d34a25 Binary files /dev/null and b/cuda_toolkit/lib/x64/cufft.lib differ diff --git a/cuda_toolkit/lib/x64/cufftw.lib b/cuda_toolkit/lib/x64/cufftw.lib new file mode 100644 index 0000000000000000000000000000000000000000..77978b4783de828c9534def2ba8866868299c7cb Binary files /dev/null and b/cuda_toolkit/lib/x64/cufftw.lib differ diff --git a/cuda_toolkit/lib/x64/curand.lib b/cuda_toolkit/lib/x64/curand.lib new file mode 100644 index 0000000000000000000000000000000000000000..214966f14ad0171317c0ea1052dc7d00f4ea2849 Binary files /dev/null and b/cuda_toolkit/lib/x64/curand.lib differ diff --git a/cuda_toolkit/lib/x64/cusolverMg.lib b/cuda_toolkit/lib/x64/cusolverMg.lib new file mode 100644 index 0000000000000000000000000000000000000000..1a2465dddc9595ede8c961d811e80321b26bcdd8 Binary files /dev/null and b/cuda_toolkit/lib/x64/cusolverMg.lib differ diff --git a/cuda_toolkit/lib/x64/nppc.lib b/cuda_toolkit/lib/x64/nppc.lib new file mode 100644 index 0000000000000000000000000000000000000000..eb214db39c1424ec7e561b9734dbb6785c7f1856 Binary files /dev/null and b/cuda_toolkit/lib/x64/nppc.lib differ diff --git a/cuda_toolkit/lib/x64/nppim.lib b/cuda_toolkit/lib/x64/nppim.lib new file mode 100644 index 0000000000000000000000000000000000000000..74c1aa47e84953e68d9a5bf936237f9009961904 Binary files /dev/null and b/cuda_toolkit/lib/x64/nppim.lib differ diff --git a/cuda_toolkit/lib/x64/nppisu.lib b/cuda_toolkit/lib/x64/nppisu.lib new file mode 100644 index 0000000000000000000000000000000000000000..414a7aa26418fcd9b75364d2590ae6bc6df8ea9a Binary files /dev/null and b/cuda_toolkit/lib/x64/nppisu.lib differ diff --git a/cuda_toolkit/lib/x64/nvJitLink.lib b/cuda_toolkit/lib/x64/nvJitLink.lib new file mode 100644 index 0000000000000000000000000000000000000000..a0a7f2ba71ea1bad08350c5ac0154bd06996d3e0 Binary files /dev/null and b/cuda_toolkit/lib/x64/nvJitLink.lib differ diff --git a/cuda_toolkit/lib/x64/nvblas.lib b/cuda_toolkit/lib/x64/nvblas.lib new file mode 100644 index 0000000000000000000000000000000000000000..88fd76af2b41b5a9babff21bea41016eb5dc2d55 Binary files /dev/null and b/cuda_toolkit/lib/x64/nvblas.lib differ diff --git a/cuda_toolkit/lib/x64/nvfatbin.lib b/cuda_toolkit/lib/x64/nvfatbin.lib new file mode 100644 index 0000000000000000000000000000000000000000..359d0d4a819b22343641c2a015b41edfe8799ac7 Binary files /dev/null and b/cuda_toolkit/lib/x64/nvfatbin.lib differ diff --git a/cuda_toolkit/lib/x64/nvjpeg.lib b/cuda_toolkit/lib/x64/nvjpeg.lib new file mode 100644 index 0000000000000000000000000000000000000000..5120deb565ab81a5439f9b989b3578566167f06f Binary files /dev/null and b/cuda_toolkit/lib/x64/nvjpeg.lib differ diff --git a/cuda_toolkit/lib/x64/nvml.lib b/cuda_toolkit/lib/x64/nvml.lib new file mode 100644 index 0000000000000000000000000000000000000000..2d49df066d49f6abe420803035c41f77118b3599 Binary files /dev/null and b/cuda_toolkit/lib/x64/nvml.lib differ diff --git a/cuda_toolkit/lib/x64/nvrtc.lib b/cuda_toolkit/lib/x64/nvrtc.lib new file mode 100644 index 0000000000000000000000000000000000000000..07ab55c568c0d6faff28857c6f71cd996e25112c Binary files /dev/null and b/cuda_toolkit/lib/x64/nvrtc.lib differ diff --git a/cuda_toolkit/lib/x64/nvvm.lib b/cuda_toolkit/lib/x64/nvvm.lib new file mode 100644 index 0000000000000000000000000000000000000000..0d205f219e2e2e95f9af205f7b1db48ddf8b2dd9 Binary files /dev/null and b/cuda_toolkit/lib/x64/nvvm.lib differ diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/Archives/index.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/Archives/index.html new file mode 100644 index 0000000000000000000000000000000000000000..b563de4f801279f059398b86049b3d9bb4f8d733 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/Archives/index.html @@ -0,0 +1,194 @@ + + + + + + + + + Archives — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Archives
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Archives

+

Nsight Compute Archived Releases.

+

Find documentation for previous versions of NVIDIA Nsight Compute.

+
+

NVIDIA Nsight Compute Archives

+

Below, you can find the current and past release information for NVIDIA Nsight Compute.

+

Available Documentation

+ +

Notices

+

Notices

+

ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, “MATERIALS”) ARE BEING PROVIDED “AS IS.” NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.

+

Information furnished is believed to be accurate and reliable. However, NVIDIA Corporation assumes no responsibility for the consequences of use of such information or for any infringement of patents or other rights of third parties that may result from its use. No license is granted by implication of otherwise under any patent rights of NVIDIA Corporation. Specifications mentioned in this publication are subject to change without notice. This publication supersedes and replaces all other information previously supplied. NVIDIA Corporation products are not authorized as critical components in life support devices or systems without express written approval of NVIDIA Corporation.

+

Trademarks

+

NVIDIA and the NVIDIA logo are trademarks or registered trademarks of NVIDIA Corporation in the U.S. and other countries. Other company and product names may be trademarks of the respective companies with which they are associated.

+
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/CopyrightAndLicenses/index.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/CopyrightAndLicenses/index.html new file mode 100644 index 0000000000000000000000000000000000000000..971a480babe5973d4320acbc8e3c10d53c9960ae --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/CopyrightAndLicenses/index.html @@ -0,0 +1,1027 @@ + + + + + + + Copyright and Licenses — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Copyright and Licenses
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ + + + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/CustomizationGuide/index.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/CustomizationGuide/index.html new file mode 100644 index 0000000000000000000000000000000000000000..15b12b59f2f40b1985a0743ebd6974d26a984f26 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/CustomizationGuide/index.html @@ -0,0 +1,821 @@ + + + + + + + + + 1. Customization Guide — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • 1. Customization Guide
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

1. Customization Guide

+

Nsight Compute Customization Guide.

+

User manual on customizing NVIDIA Nsight Compute tools or integrating them with custom workflows. Information on writing section files, rules for automatic result analysis and scripting access to report files.

+
+

1.1. Introduction

+

The goal of NVIDIA Nsight Compute is to design a profiling tool that can be easily extended and customized by expert users. While we provide useful defaults, this allows adapting the reports to a specific use case or to design new ways to investigate collected data. All the following is data driven and does not require the tools to be recompiled.

+

While working with section files or rules files it is recommended to open the Metric Selection tool window from the Profile menu item. This tool window lists all sections and rules that were loaded. Rules are grouped as children of their associated section or grouped in the [Independent Rules] entry. For files that failed to load, the table shows the error message. Use the Reload button to reload rule files from disk.

+
+
+

1.2. Metric Sections

+

The Details page consists of sections that focus on a specific part of the kernel analysis each. Every section is defined by a corresponding section file that specifies the data to be collected as well as the visualization used in the UI or CLI output for this data. Simply modify a deployed section file to add or modify what is collected.

+
+

1.2.1. Section Files

+

The section files delivered with the tool are stored in the sections sub-folder of the NVIDIA Nsight Compute install directory. Each section is defined in a separate file with the .section file extension. At runtime, the installed stock sections (and rules) are deployed to a user-writable directory. This can be disabled with an environment variable. Section files from the deployment directory are loaded automatically at the time the UI connects to a target application or the command line profiler is launched. This way, any changes to section files become immediately available in the next profile run.

+

A section file is a text representation of a Google Protocol Buffer message. The full definition of all available fields of a section message is given in Section Definition. In short, each section consists of a unique Identifier (no spaces allowed), a Display Name, an optional Order value (for sorting the sections in the Details page), an optional Description providing guidance to the user, an optional header table, an optional list of metrics to be collected but not displayed, optional bodies with additional UI elements, and other elements. See ProfilerSection.proto for the exact list of available elements. A small example of a very simple section is:

+
Identifier: "SampleSection"
+DisplayName: "Sample Section"
+Description: "This sample section shows information on active warps and cycles."
+Header {
+  Metrics {
+    Label: "Active Warps"
+    Name: "smsp__active_warps_avg"
+  }
+  Metrics {
+    Label: "Active Cycles"
+    Name: "smsp__active_cycles_avg"
+  }
+}
+
+
+

On data collection, this section will cause the two PerfWorks metrics smsp__active_warps_avg and smsp__active_cycles_avg to be collected.

+
+../_images/section-files.png +
+

The section as shown on the Details page

+
+
+

By default, when not available, metrics specified in section files will only generate a warning during data collection, and would then show up as “N/A” in the UI or CLI. This is in contrast to metrics requested via --metrics which would cause an error when not available. How to specify metrics as required for data collection is described in Metric Options and Filters.

+

More advanced elements can be used in the body of a section. See the ProfilerSection.proto file for which elements are available. The following example shows how to use these in a slightly more complex example. The usage of regexes is allowed in tables and charts in the section Body only and follows the format regex: followed by the actual regex to match PerfWorks metric names.

+

The supported list of metrics that can be used in sections can be queried using the command line interface with the --query-metrics option. Each of these metrics can be used in any section and will be automatically collected if they appear in any enabled section. Note that even if a metric is used in multiple sections, it will only be collected once. Look at all the shipped sections to see how they are implemented.

+
Identifier: "SampleSection"
+DisplayName: "Sample Section"
+Description: "This sample section shows various metrics."
+Header {
+  Metrics {
+    Label: "Active Warps"
+    Name: "smsp__active_warps_avg"
+  }
+  Metrics {
+    Label: "Active Cycles"
+    Name: "smsp__active_cycles_avg"
+  }
+}
+Body {
+  Items {
+    Table {
+      Label: "Example Table"
+      Rows: 2
+      Columns: 1
+      Metrics {
+        Label: "Avg. Issued Instructions Per Scheduler"
+        Name: "smsp__inst_issued_avg"
+      }
+      Metrics {
+        Label: "Avg. Executed Instructions Per Scheduler"
+        Name: "smsp__inst_executed_avg"
+      }
+    }
+  }
+  Items {
+    Table {
+      Label: "Metrics Table"
+      Columns: 2
+      Order: ColumnMajor
+      Metrics {
+        Name: "regex:.*__elapsed_cycles_sum"
+      }
+    }
+  }
+  Items {
+    BarChart {
+      Label: "Metrics Chart"
+      CategoryAxis {
+        Label: "Units"
+      }
+      ValueAxis {
+        Label: "Cycles"
+      }
+      Metrics {
+        Name: "regex:.*__elapsed_cycles_sum"
+      }
+    }
+  }
+}
+
+
+../_images/section-files-2.png +

The output of this section would look similar to this screenshot in the UI

+
+
+

1.2.2. Section Definition

+

Protocol buffer definitions are in the NVIDIA Nsight Compute installation directory under extras/FileFormat. To understand section files, start with the definitions and documentation in ProfilerSection.proto.

+

To see the list of available PerfWorks metrics for any device or chip, use the --query-metrics option of the command line.

+
+
+

1.2.3. Metric Options and Filters

+

Sections allow the user to specify alternative options for metrics that have a different metric name on different GPU architectures. Metric options use a min-arch/max-arch range filter, replacing the base metric with the first metric option for which the current GPU architecture matches the filter. While not strictly enforced, options for a base metric are expected to share the same meaning and subsequently unit, etc., with the base metric.

+

In addition to its options, the base metric can be filtered by the same criteria. This is useful for metrics that are only available for certain architectures or in limited collection scopes. See ProfilerMetricOptions.proto for which filter options are available.

+

In the below example, the metric dram__cycles_elapsed.avg.per_second is collected on SM 7.0 and SM 7.5-8.6, but not on any in between. It uses the same metric name on these architectures.

+
Metrics {
+    Label: "DRAM Frequency"
+    Name: "dram__cycles_elapsed.avg.per_second"
+    Filter {
+      MaxArch: CC_70
+    }
+    Options {
+      Name: "dram__cycles_elapsed.avg.per_second"
+      Filter {
+        MinArch: CC_75
+        MaxArch: CC_86
+      }
+    }
+}
+
+
+

In the next example, the metric in the section header is only collected for launch-based collection scopes (i.e. kernel- and application replay for CUDA kernels or CUDA Graph nodes), but not in range-based scopes.

+
Header {
+  Metrics {
+    Label: "Theoretical Occupancy"
+    Name: "sm__maximum_warps_per_active_cycle_pct"
+    Filter {
+      CollectionFilter {
+        CollectionScopes: CollectionScope_Launch
+      }
+    }
+  }
+}
+
+
+

Similarly, CollectionFilters can be used to set the Importance of a metric, which specifies an expectation on its availability during data collection. Required metrics, for instance, are expected to be collectable and would generate an error in case they are not available, whereas Optional metrics would only generate a warning. Here is a minimal example, illustrating the functionality:

+
Metrics {
+  Label: "Compute (SM) Throughput"
+  Name: "sm__throughput.avg.pct_of_peak_sustained_elapsed"
+  Filter {
+    CollectionFilter {
+      Importance: Required
+    }
+  }
+}
+
+
+

Filters can be applied to an entire section instead of or in addition to being set for individual metrics. If both types of filters are specified, they are combined, such that Metrics-scope filters take precedence over section-scope filters.

+
+
+

1.2.4. Counter Domains

+

PM sampling metrics are composed of one or more raw counter dependencies internally. +Each counter is associated with a counter domain, which describes how and where in the hardware the counter is collected. +For metrics specified in section files, the automatic domain selection can be overwritten when needed to form more optimal PM sampling metric groups.

+
Metrics {
+  Label: "Short Scoreboard"
+  Name: "pmsampling:smsp__warps_issue_stalled_short_scoreboard.avg"
+  Groups: "sampling_ws4"
+  CtrDomains: "gpu_sm_c"
+}
+
+
+

Note that the CtrDomains field is currently only supported for the section Metrics field, but not for individual Options.

+
+
+

1.2.5. Missing Sections

+

If new or updated section files are not used by NVIDIA Nsight Compute, it is most commonly one of two reasons:

+

The file is not found: Section files must have the .section extension. They must also be on the section search path. The default search path is the sections directory within the installation directory. In NVIDIA Nsight Compute CLI, the search paths can be overwritten using the --section-folder and --section-folder-recursive options. In NVIDIA Nsight Compute, the search path can be configured in the Profile options.

+

Syntax errors: If the file is found but has syntax errors, it will not be available for metric collection. However, error messages are reported for easier debugging. In NVIDIA Nsight Compute CLI, use the --list-sections option to get a list of error messages, if any. In NVIDIA Nsight Compute, error messages are reported in the Metric Selection tool window.

+
+
+

1.2.6. Derived Metrics

+

Derived Metrics allow you to define new metrics composed of constants or existing metrics directly in a section file. The new metrics are computed at collection time and added permanently to the profile result in the report. They can then subsequently be used for any tables, charts, rules, etc.

+

NVIDIA Nsight Compute currently supports the following syntax for defining derived metrics in section files:

+
MetricDefinitions {
+  MetricDefinitions {
+    Name: "derived_metric_name"
+    Expression: "derived_metric_expr"
+  }
+  MetricDefinitions {
+    ...
+  }
+  ...
+}
+
+
+

The actual metric expression is defined as follows:

+
derived_metric_expr ::= operand operator operand
+operator            ::= + | - | * | /
+operand             ::= metric | constant
+metric              ::= (an existing metric name)
+constant            ::= double | uint64
+double              ::= (double-precision number of the form "N.(M)?", e.g. "5." or "0.3109")
+uint64              ::= (64-bit unsigned integer number of the form "N", e.g. "2029")
+
+
+

Operators are defined as follows:

+
For op in (+ | - | *): For each element in a metric it is applied to, the expression left-hand side op-combined with expression right-hand side.
+For op in (/): For each element in a metric it is applied to, the expression left-hand side op-combined with expression right-hand side. If the right-hand side operand is of integer-type, and 0, the result is the left-hand side value.
+
+
+

Since metrics can contain regular values and/or instanced values, elements are combined as below. Constants are treated as metrics with only a regular value.

+
1. Regular values are operator-combined.
+a + b
+
+2. If both metrics have no correlation ids, the first N values are operator-combined, where N is the minimum of the number of elements in both metrics.
+a1 + b1
+a2 + b2
+a3
+a4
+
+3. Else if both metrics have correlation ids, the sets of correlation ids from both metrics are joined and then operator-combined as applicable.
+a1 + b1
+a2
+b3
+a4 + b4
+b5
+
+4. Else if only the left-hand side metric has correlation ids, the right-hand side regular metric value is operator-combined with every element of the left-hand side metric.
+a1 + b
+a2 + b
+a3 + b
+
+5. Else if only the right-hand side metric has correlation ids, the right-hand side element values are operator-combined with the regular metric value of the left-hand side metric.
+a + b1 + b2 + b3
+
+
+

In all operations, the value kind of the left-hand side operand is used. If the right-hand side operand has a different value kind, it is converted. If the left-hand side operand is a string-kind, it is returned unchanged.

+

Examples for derived metrics are derived__avg_thread_executed, which provides a hint on the number of threads executed on average at each instruction, and derived__uncoalesced_l2_transactions_global, which indicates the ratio of actual L2 transactions vs. ideal L2 transactions at each applicable instruction.

+
MetricDefinitions {
+  MetricDefinitions {
+    Name: "derived__avg_thread_executed"
+    Expression: "thread_inst_executed_true / inst_executed"
+  }
+  MetricDefinitions {
+    Name: "derived__uncoalesced_l2_transactions_global"
+    Expression: "memory_l2_transactions_global / memory_ideal_l2_transactions_global"
+  }
+  MetricDefinitions {
+    Name: "sm__sass_thread_inst_executed_op_ffma_pred_on_x2"
+    Expression: "sm__sass_thread_inst_executed_op_ffma_pred_on.sum.peak_sustained * 2"
+  }
+}
+
+
+
+
+
+

1.3. Rule System

+

NVIDIA Nsight Compute features a new Python-based rule system. It is designed as the successor to the Expert System (un)guided analysis in NVIDIA Visual Profiler, but meant to be more flexible and more easily extensible to different use cases and APIs.

+
+

1.3.1. Writing Rules

+

To create a new rule, you need to create a new text file with the extension .py and place it at some location that is detectable by the tool (see Nsight Compute Integration on how to specify the search path for rules). At a minimum, the rule file must implement two functions, get_identifier and apply. See Rule File API for a description of all functions supported in rule files. See NvRules for details on the interface available in the rule’s apply function.

+
+
+

1.3.2. Integration

+

The rule system is integrated into NVIDIA Nsight Compute as part of the profile report view. When you profile a kernel, available rules will be shown in the report’s Details page. You can either select to apply all available rules at once by clicking Apply Rules at the top of the page, or apply rules individually. Once applied, the rule results will be added to the current report. By default, all rules are applied automatically.

+../_images/integration-1.png +

Section with a single Bottleneck rule available.

+../_images/integration-2.png +

The same section with the Bottleneck rule applied. It added a single message to the report.

+../_images/integration-3.png +

The section Rule has two associated rules, Basic Template Rule and Advanced Template Rule. The latter is not yet applied. Rules can add various UI elements, including warning and error messages as well as charts and tables.

+../_images/integration-4.png +

Some rules are applied independently from sections. They are shown under Independent Rules.

+
+
+

1.3.3. Rule System Architecture

+

The rule system consists of the Python interpreter, the NvRules C++ interface, the NvRules Python interface (NvRules.py) and a set of rule files. Each rule file is valid Python code that imports the NvRules.py module, adheres to certain standards defined by the Rule File API and is called to from the tool.

+

When applying a rule, a handle to the rule Context is provided to its apply function. This context captures most of the functionality that is available to rules as part of the NvRules API. In addition, some functionality is provided directly by the NvRules module, e.g. for global error reporting. Finally, since rules are valid Python code, they can use regular libraries and language functionality that ship with Python as well.

+

From the rule Context, multiple further objects can be accessed, e.g. the Frontend, Ranges and Actions. It should be noted that those are only interfaces, i.e. the actual implementation can vary from tool to tool that decides to implement this functionality.

+

Naming of these interfaces is chosen to be as API-independent as possible, i.e. not to imply CUDA-specific semantics. However, since many compute and graphics APIs map to similar concepts, it can easily be mapped to CUDA terminology, too. A Range refers to a CUDA stream, an Action refers to a single CUDA kernel instance. Each action references several Metrics that have been collected during profiling (e.g. instructions executed) or are statically available (e.g. the launch configuration). Metrics are accessed via their names from the Action.

+

Each CUDA stream can contain any number of kernel (or other device activity) instances and so each Range can reference one or more Actions. However, currently only a single Action per Range will be available, as only a single CUDA kernel can be profiled at once.

+

The Frontend provides an interface to manipulate the tool UI by adding messages, graphical elements such as line and bar charts or tables, as well as speedup estimations, focus metrics and source markers. The most common use case is for a rule to show at least one message, stating the result to the user, as illustrated in extras/RuleTemplates/BasicRuleTemplate.py This could be as simple as “No issues have been detected,” or contain direct hints as to how the user could improve the code, e.g. “Memory is more heavily utilized than Compute. Consider whether it is possible for the kernel to do more compute work.” For more advanced use cases, such as adding speedup estimates, key performance indicators (a.k.a. focus metrics) or source markers to annotate individual lines of code to your rule, see the templates in extras/RuleTemplates.

+
+
+

1.3.4. NvRules API

+

The NvRules API is defined as a C/C++ style interface, which is converted to the NvRules.py Python module to be consumable by the rules. As such, C++ class interfaces are directly converted to Python classes und functions. See the NvRules API documentation for the classes and functions available in this interface.

+
+
+

1.3.5. Rule File API

+

The Rule File API is the implicit contract between the rule Python file and the tool. It defines which functions (syntactically and semantically) the Python file must provide to properly work as a rule.

+

Mandatory Functions

+
    +
  • get_identifier(): Return the unique rule identifier string.

  • +
  • apply(handle): Apply this rule to the rule context provided by handle. Use NvRules.get_context(handle) to obtain the Context interface from handle.

  • +
  • get_name(): Return the user-consumable display name of this rule.

  • +
  • get_description(): Return the user-consumable description of this rule.

  • +
+

Optional Functions

+
    +
  • get_section_identifier(): Return the unique section identifier that maps this rule to a section. Section-mapped rules will only be available if the corresponding section was collected. They implicitly assume that the metrics requested by the section are collected when the rule is applied.

  • +
  • evaluate(handle):

    +

    Declare required metrics and rules that are necessary for this rule to be applied. Use NvRules.require_metrics(handle, [...]) to declare the list of metrics that must be collected prior to applying this rule.

    +

    Use e.g. NvRules.require_rules(handle, [...]) to declare the list of other rules that must be available before applying this rule. Those are the only rules that can be safely proposed by the Controller interface.

    +
  • +
+
+
+

1.3.6. Rule Examples

+

The following example rule determines on which major GPU architecture a kernel was running.

+
import NvRules
+
+def get_identifier():
+  return "GpuArch"
+
+def apply(handle):
+  ctx = NvRules.get_context(handle)
+  action = ctx.range_by_idx(0).action_by_idx(0)
+  ccMajor = action.metric_by_name("device__attribute_compute_capability_major").as_uint64()
+  ctx.frontend().message("Running on major compute capability " + str(ccMajor))
+
+
+
+
+
+

1.4. Python Report Interface

+

NVIDIA Nsight Compute features a Python-based interface to interact with exported report files.

+

The module is called ncu_report and works on any Python version from 3.4 1. It can be found in the extras/python directory of your NVIDIA Nsight Compute package.

+

In order to use the Python module, you need a report file generated by NVIDIA Nsight Compute. You can obtain such a file by saving it from the graphical interface or by using the --export flag of the command line tool.

+

The types and functions in the ncu_report module are a subset of the ones available in the NvRules API. The documentation in this section serves as a tutorial. For a more formal description of the exposed API, please refer to the the NvRules API documentation.

+
+
1
+

On Linux machines you will also need a GNU-compatible libc and libgcc_s.so.

+
+
+
+

1.4.1. Basic Usage

+

In order to be able to import ncu_report you will either have to navigate to the extras/python directory, or add its absolute path to the PYTHONPATH environment variable. Then, the module can be imported like any Python module:

+
>>> import ncu_report
+
+
+

Importing a report

+

Once the module is imported, you can load a report file by calling the load_report function with the path to the file. This function returns an object of type IContext which holds all the information concerning that report.

+
>>> my_context = ncu_report.load_report("my_report.ncu-rep")
+
+
+

Querying ranges

+

When working with the Python module, kernel profiling results are grouped into ranges which are represented by IRange objects. You can inspect the number of ranges contained in the loaded report by calling the num_ranges() member function of an IContext object and retrieve a range by its index using range_by_idx(index).

+
>>> my_context.num_ranges()
+1
+>>> my_range = my_context.range_by_idx(0)
+
+
+

Querying actions

+

Inside a range, kernel profiling results are called actions. You can query the number of actions contained in a given range by using the num_actions method of an IRange object.

+
>>> my_range.num_actions()
+2
+
+
+

In the same way ranges can be obtained from an IContext object by using the range_by_idx(index) method, individual actions can be obtained from IRange objects by using the action_by_idx(index) method. The resulting actions are represented by the IAction class.

+
>>> my_action = my_range.action_by_idx(0)
+
+
+

As mentioned previously, an action represents a single kernel profiling result. To query the kernel’s name you can use the name() member function of the IAction class.

+
>>> my_action.name()
+MyKernel
+
+
+

Querying metrics

+

To get a tuple of all metric names contained within an action you can use the metric_names() method. It is meant to be combined with the metric_by_name() method which returns an IMetric object. However, for the same task you may also use the [] operator, as explained in the High-Level Interface section below.

+

The metric names displayed here are the same as the ones you can use with the --metrics flag of NVIDIA Nsight Compute. Once you have extracted a metric from an action, you can obtain its value by using one of the following three methods:

+
    +
  • as_string() to obtain its value as a Python str

  • +
  • as_uint64() to obtain its value as a Python int

  • +
  • as_double() to obtain its value as a Python float

  • +
+

For example, to print the display name of the GPU on which the kernel was profiled you can query the device__attribute_display_name metric.

+
>>> display_name_metric = my_action.metric_by_name('device__attribute_display_name')
+>>> display_name_metric.as_string()
+'NVIDIA GeForce RTX 3060 Ti'
+
+
+

Note that accessing a metric with the wrong type can lead to unexpected (conversion) results.

+
>>> display_name_metric.as_double()
+0.0
+
+
+

Therefore, it is advisable to directly use the High-Level function value(), as explained below.

+
+
+

1.4.2. High-Level Interface

+

On top of the low-level NvRules API the Python Report Interface also implements part of the Python object model. By implementing special methods, the Python Report Interface’s exposed classes can be used with built-in Python mechanisms such as iteration, string formatting and length querying.

+

This allows you to access metrics objects via the self[key] instance method of the IAction class:

+
>>> display_name_metric = my_action["device__attribute_display_name"]
+
+
+

There is also a convenience method IMetric.value() which allows you to query the value of a metric object without knowledge of its type:

+
>>> display_name_metric.value()
+'NVIDIA GeForce RTX 3060 Ti'
+
+
+

All the available methods of a class, as well as their associated Python docstrings, can be looked up interactively via

+
>>> help(ncu_report.IMetric)
+
+
+

or similarly for other classes and methods. In your code, you can access the docstrings via the __doc__ attribute, i.e. ncu_report.IMetric.value.__doc__.

+
+
+

1.4.3. Metric attributes

+

Apart from the possibility to query the name() and value() of an IMetric object, you can also query the following additional metric attributes:

+
    +
  • metric_type()

  • +
  • metric_subtype()

  • +
  • rollup_operation()

  • +
  • unit()

  • +
  • description()

  • +
+

The first method metric_type() returns one out of three enum values (IMetric.MetricType_COUNTER, IMetric.MetricType_RATIO, IMetric.MetricType_THROUGHPUT) if the metric is a hardware metric, or IMetric.MetricType_OTHER otherwise (e.g. for launch or device attributes).

+

The method metric_subtype() returns an enum value representing the subtype of a metric (e.g. IMetric.MetricSubtype_PEAK_SUSTAINED, IMetric.MetricSubtype_PER_CYCLE_ACTIVE). In case a metric does not have a subtype, None is returned. All available values (without the necessary IMetric.MetricSubtype_ prefix) may be found in the NvRules API documentation, or may be looked up interactively by executing help(ncu_report.IMetric).

+

IMetric.rollup_operation() returns the operation which is used to accumulate different values of the same metric and can be one of IMetric.RollupOperation_AVG, IMetric.RollupOperation_MAX, IMetric.RollupOperation_MIN or IMetric.RollupOperation_SUM for averaging, maximum, minimum or summation, respectively. If the metric in question does not specify a rollup operation None will be returned.

+

Lastly, unit() and description() return a (possibly empty) string of the metric’s unit and a short textual description for hardware metrics, respectively.

+

The above methods can be combined to filter through all metrics of a report, given certain criteria:

+
for metric in metrics:
+    if metric.metric_type() == IMetric.MetricType_COUNTER and \
+       metric.metric_subtype() == IMetric.MetricSubtype_PER_SECOND and \
+       metric.rollup_operation() == IMetric.RollupOperation_AVG:
+        print(f"{metric.name()}: {metric.value()} {metric.unit()}")
+
+
+
+
+

1.4.4. NVTX Support

+

The ncu_report has support for the NVIDIA Tools Extension (NVTX). This comes through the INvtxState object which represents the NVTX state of a profiled kernel.

+

An INvtxState object can be obtained from an action by using its nvtx_state() method. It exposes the domains() method which returns a tuple of integers representing the domains this kernel has state in. These integers can be used with the domain_by_id(id) method to get an INvtxDomainInfo object which represents the state of a domain.

+

The INvtxDomainInfo can be used to obtain a tuple of Push-Pop, or Start-End ranges using the push_pop_ranges() and start_end_ranges() methods.

+

There is also a actions_by_nvtx member function in the IRange class which allows you to get a tuple of actions matching the NVTX state described in its parameter.

+

The parameters for the actions_by_nvtx function are two lists of strings representing the state for which we want to query the actions. The first parameter describes the NVTX states to include while the second one describes the NVTX states to exclude. These strings are in the same format as the ones used with the --nvtx-include and --nvtx-exclude options.

+
+
+

1.4.5. Sample Script

+

NVTX Push-Pop range filtering

+

This is a sample script which loads a report and prints the names of all the profiled kernels which were wrapped inside BottomRange and TopRangePush-Pop ranges of the default NVTX domain.

+
#!/usr/bin/env python3
+
+import sys
+
+import ncu_report
+
+if len(sys.argv) != 2:
+    print("usage: {} report_file".format(sys.argv[0]), file=sys.stderr)
+    sys.exit(1)
+
+report = ncu_report.load_report(sys.argv[1])
+
+for range_idx in range(report.num_ranges()):
+    current_range = report.range_by_idx(range_idx)
+    for action_idx in current_range.actions_by_nvtx(["BottomRange/*/TopRange"], []):
+        action = current_range.action_by_idx(action_idx)
+        print(action.name())
+
+
+
+
+
+

1.5. Source Counters

+

The Source page provides correlation of various metrics with CUDA-C, PTX and SASS source of the application, depending on availability.

+

Which Source Counter metrics are collected and the order in which they are displayed in this page is controlled using section files, specifically using the ProfilerSectionMetrics message type. Each ProfilerSectionMetrics defines one ordered group of metrics, and can be assigned an optional Order value. This value defines the ordering among those groups in the Source page. This allows, for example, you to define a group of memory-related source counters in one and a group of instruction-related counters in another section file.

+
Identifier: "SourceMetrics"
+DisplayName: "Custom Source Metrics"
+Metrics {
+  Order: 2
+  Metrics {
+    Label: "Instructions Executed"
+    Name: "inst_executed"
+  }
+  Metrics {
+    Label: ""
+    Name: "collected_but_not_shown"
+  }
+}
+
+
+

If a Source Counter metric is given an empty label attribute in the section file, it will be collected but not shown on the page.

+../_images/source-counters.png +
+
+

1.6. Report File Format

+

This section documents the internals of the profiler report files (reports in the following) as created by NVIDIA Nsight Compute. The file format is subject to change in future releases without prior notice.

+
+

1.6.1. Version 7 Format

+

Reports of version 7 are a combination of raw binary data and serialized Google Protocol Buffer version 2 messages (proto). All binary entries are stored as little endian. Protocol buffer definitions are in the NVIDIA Nsight Compute installation directory under extras/FileFormat.

+ + ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 1. Top-level report file format

Offset [bytes]

Entry

Type

Value

0

Magic Number

Binary

NVR\0

4

Integer

Binary

sizeof(File Header)

8

File Header

Proto

Report version

8 + sizeof(File Header)

Block 0

Mixed

CUDA CUBIN source, profile results, session information

8 + sizeof(File Header) + sizeof(Block 0)

Block 1

Mixed

CUDA CUBIN source, profile results, session information

+ + ++++++ + + + + + + + + + + + + + + + + + + + + + + + + +
Table 2. Per-Block report file format

Offset [bytes]

Entry

Type

Value

0

Integer

Binary

sizeof(Block Header)

4

Block Header

Proto

Number of entries per payload type, payload size

4 + sizeof(Block Header)

Block Payload

Mixed

Payload (CUDA CUBIN sources, profile results, session information, string table)

+ + ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 3. Block payload report file format

Offset [bytes]

Entry

Type

Value

0

Integer

Binary

sizeof(Payload type 1, entry 1)

4

Payload type 1, entry 1

Proto

4 + sizeof(Payload type 1, entry 1)

Integer

Binary

sizeof(Payload type 1, entry 2)

8 + sizeof(Payload type 1, entry 1)

Payload type 1, entry 2

Proto

Integer

Binary

sizeof(Payload type 2, entry 1)

Payload type 2, entry 1

Proto

+

Notices

+

Notices

+

ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, “MATERIALS”) ARE BEING PROVIDED “AS IS.” NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.

+

Information furnished is believed to be accurate and reliable. However, NVIDIA Corporation assumes no responsibility for the consequences of use of such information or for any infringement of patents or other rights of third parties that may result from its use. No license is granted by implication of otherwise under any patent rights of NVIDIA Corporation. Specifications mentioned in this publication are subject to change without notice. This publication supersedes and replaces all other information previously supplied. NVIDIA Corporation products are not authorized as critical components in life support devices or systems without express written approval of NVIDIA Corporation.

+

Trademarks

+

NVIDIA and the NVIDIA logo are trademarks or registered trademarks of NVIDIA Corporation in the U.S. and other countries. Other company and product names may be trademarks of the respective companies with which they are associated.

+
+
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/Notices/notices.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/Notices/notices.html new file mode 100644 index 0000000000000000000000000000000000000000..fe09386e189059128be138e60136d325e24977b3 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/Notices/notices.html @@ -0,0 +1,154 @@ + + + + + + + <no title> — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • <no title>
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +

Notices

+

Notices

+

ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, “MATERIALS”) ARE BEING PROVIDED “AS IS.” NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.

+

Information furnished is believed to be accurate and reliable. However, NVIDIA Corporation assumes no responsibility for the consequences of use of such information or for any infringement of patents or other rights of third parties that may result from its use. No license is granted by implication of otherwise under any patent rights of NVIDIA Corporation. Specifications mentioned in this publication are subject to change without notice. This publication supersedes and replaces all other information previously supplied. NVIDIA Corporation products are not authorized as critical components in life support devices or systems without express written approval of NVIDIA Corporation.

+

Trademarks

+

NVIDIA and the NVIDIA logo are trademarks or registered trademarks of NVIDIA Corporation in the U.S. and other countries. Other company and product names may be trademarks of the respective companies with which they are associated.

+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/NsightCompute/index.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/NsightCompute/index.html new file mode 100644 index 0000000000000000000000000000000000000000..3e82d625cb60efcae5d12b039c80e0c126f7ff78 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/NsightCompute/index.html @@ -0,0 +1,2202 @@ + + + + + + + + + 3. Nsight Compute — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • 3. Nsight Compute
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

3. Nsight Compute

+

The User Guide for Nsight Compute.

+
+

3.1. Introduction

+

For users migrating from Visual Profiler to NVIDIA Nsight Compute, please see the Visual Profiler Transition Guide for comparison of features and workflows.

+
+

3.1.1. Overview

+

This document is a user guide to the next-generation NVIDIA Nsight Compute profiling tools. NVIDIA Nsight Compute is an interactive kernel profiler for CUDA applications. It provides detailed performance metrics and API debugging via a user interface and command line tool. In addition, its baseline feature allows users to compare results within the tool. NVIDIA Nsight Compute provides a customizable and data-driven user interface and metric collection and can be extended with analysis scripts for post-processing results.

+

Important Features

+
    +
  • Interactive kernel profiler and API debugger

  • +
  • Graphical profile report

  • +
  • Result comparison across one or multiple reports within the tool

  • +
  • Fast Data Collection

  • +
  • UI and Command Line interface

  • +
  • Fully customizable reports and analysis rules

  • +
+
+
+
+

3.2. Quickstart

+

The following sections provide brief step-by-step guides of how to setup and run NVIDIA Nsight Compute to collect profile information. All directories are relative to the base directory of NVIDIA Nsight Compute, unless specified otherwise.

+

The UI executable is called ncu-ui. A shortcut with this name is located in the base directory of the NVIDIA Nsight Compute installation. The actual executable is located in the folder host\windows-desktop-win7-x64 on Windows or host/linux-desktop-glibc_2_11_3-x64 on Linux. By default, when installing from a Linux .run file, NVIDIA Nsight Compute is located in /usr/local/cuda-<cuda-version>/nsight-compute-<version>. When installing from a .deb or .rpm package, it is located in /opt/nvidia/nsight-compute/<version> to be consistent with Nsight Systems. In Windows, the default path is C:\Program Files\NVIDIA Corporation\Nsight Compute <version>.

+

After starting NVIDIA Nsight Compute, by default the Welcome Page is opened. The Start section allows the user to start a new activity, open an existing report, create a new project or load an existing project. The Continue section provides links to recently opened reports and projects. The Explore section provides information about what is new in the latest release, as well as links to additional training. See Environment on how to change the start-up action.

+
+../_images/welcome-page.png +
+

Welcome Page

+
+
+
+

3.2.1. Interactive Profile Activity

+
    +
  1. Launch the target application from NVIDIA Nsight Compute

    +

    When starting NVIDIA Nsight Compute, the Welcome Page will appear. Click on Quick Launch to open the Connection dialog. If the Connection dialog doesn’t appear, you can open it using the Connect button from the main toolbar, as long as you are not currently connected. Select your target platform on the left-hand side and your connection target (machine) from the Connection drop down. If you have your local target platform selected, localhost will become available as a connection. Use the + button to add a new connection target. Then, continue by filling in the details in the Launch tab. In the Activity panel, select the Interactive Profile activity to initiate a session that allows controlling the execution of the target application and selecting the kernels of interest interactively. Press Launch to start the session.

    +
    +../_images/quick-start-interactive-profiling-connect.png +
  2. +
  3. Launch the target application with tools instrumentation from the command line

    +

    The ncu can act as a simple wrapper that forces the target application to load the necessary libraries for tools instrumentation. The parameter --mode=launch specifies that the target application should be launched and suspended before the first instrumented API call. That way the application waits until we connect with the UI. +.. code:: text

    +
    +

    $ ncu –mode=launch CuVectorAddDrv.exe

    +
    +
  4. +
  5. Launch NVIDIA Nsight Compute and connect to target application

    +
    +../_images/quick-start-interactive-profiling-attach.png +
    +

    Select the target machine at the top of the dialog to connect and update the list of attachable applications. By default, localhost is pre-selected if the target matches your current local platform. Select the Attach tab and the target application of interest and press Attach. Once connected, the layout of NVIDIA Nsight Compute changes into stepping mode that allows you to control the execution of any calls into the instrumented API. When connected, the API Stream window indicates that the target application waits before the very first API call.

    +
    +../_images/quick-start-interactive-profiling-connected.png +
  6. +
  7. Control application execution

    +

    Use the API Stream window to step the calls into the instrumented API. The dropdown at the top allows switching between different CPU threads of the application. Step In (F11), Step Over (F10), and Step Out (Shift + F11) are available from the Debug menu or the corresponding toolbar buttons. While stepping, function return values and function parameters are captured.

    +
    +../_images/quick-start-interactive-profiling-api-stream.png +
    +

    Use Resume (F5) and Pause to allow the program to run freely. Freeze control is available to define the behavior of threads currently not in focus, i.e. selected in the thread drop down. By default, the API Stream stops on any API call that returns an error code. This can be toggled in the Debug menu by Break On API Error.

    +
  8. +
  9. Isolate a kernel launch

    +

    To quickly isolate a kernel launch for profiling, use the Run to Next Kernel button in the toolbar of the API Stream window to jump to the next kernel launch. The execution will stop before the kernel launch is executed.

    +
    +../_images/quick-start-interactive-profiling-next-launch.png +
  10. +
  11. Profile a kernel launch

    +

    Once the execution of the target application is suspended at a kernel launch, additional actions become available in the UI. These actions are either available from the menu or from the toolbar. Please note that the actions are disabled, if the API stream is not at a qualifying state (not at a kernel launch or launching on an unsupported GPU). To profile, press Profile Kernel and wait until the result is shown in the Profiler Report. Profiling progress is reported in the lower right corner status bar.

    +

    Instead of manually selecting Profile, it is also possible to enable Auto Profile from the Profile menu. If enabled, each kernel matching the current kernel filter (if any) will be profiled using the current section configuration. This is especially useful if an application is to be profiled unattended, or the number of kernel launches to be profiled is very large. Sections can be enabled or disabled using the Metric Selection tool window.

    +

    Profile Series allows to configure the collection of a set of profile results at once. Each result in the set is profiled with varying parameters. Series are useful to investigate the behavior of a kernel across a large set of parameters without the need to recompile and rerun the application many times.

    +
  12. +
+

For a detailed description of the options available in this activity, see Interactive Profile Activity.

+
+
+

3.2.2. Non-Interactive Profile Activity

+
    +
  1. Launch the target application from NVIDIA Nsight Compute

    +

    When starting NVIDIA Nsight Compute, the Welcome Page will appear. Click on Quick Launch to open the Connection dialog. If the Connection dialog doesn’t appear, you can open it using the Connect button from the main toolbar, as long as you are not currently connected. Select your target platform on the left-hand side and your localhost from the Connection drop down. Then, fill in the launch details. In the Activity panel, select the Profile activity to initiate a session that pre-configures the profile session and launches the command line profiler to collect the data. Provide the Output File name to enable starting the session with the Launch button.

    +
    +../_images/quick-start-profiling-connect.png +
    +
  2. +
  3. Additional Launch Options

    +

    For more details on these options, see Command Line Options. The options are grouped into tabs: The Filter tab exposes the options to specify which kernels should be profiled. Options include the kernel regex filter, the number of launches to skip, and the total number of launches to profile. The Sections tab allows you to select which sections should be collected for each kernel launch. Hover over a section to see its description as a tool-tip. To change the sections that are enabled by default, use the Metric Selection tool window. The Sampling tab allows you to configure sampling options for each kernel launch. The Other tab includes the option to collect NVTX information or custom metrics via the --metrics option.

    +
    +../_images/quick-start-profiling-options-sections.png +
    +
  4. +
+

For a detailed description of the options available in this activity, see Profile Activity.

+
+
+

3.2.3. System Trace Activity

+
    +
  1. Launch the target application from NVIDIA Nsight Compute

    +

    When starting NVIDIA Nsight Compute, the Welcome Page will appear. Click on Quick Launch to open the Connection dialog. If the Connection dialog doesn’t appear, you can open it using the Connect button from the main toolbar, as long as you are not currently connected. Select your local target platform on the left-hand side and your localhost from the Connection drop down. Then, fill in the launch details. In the Activity panel, select the System Trace activity to initiate a session with pre-configured settings. Press Launch to start the session.

    +
    +../_images/quick-start-system-trace-connect.png +
    +
  2. +
  3. Additional Launch Options

    +

    For more details on these options, see System-Wide Profiling Options.

    +
    +../_images/quick-start-system-trace-options.png +
    +
  4. +
  5. Once the session is completed, the Nsight Systems report is opened in a new document. By default, the timeline view is shown. It provides detailed information of the activity of the CPU and GPUs and helps understanding the overall behavior and performance of application. Once a CUDA kernel is identified to be on the critical path and not meeting the performance expectations, right click on the kernel launch on timeline and select Profile Kernel from the context menu. A new Connection Dialog opens up that is already preconfigured to profile the selected kernel launch. Proceed with optimizing the selected kernel using Non-Interactive Profile Activity

    +
    +../_images/quick-start-system-trace-timeline.png +
    +
  6. +
+
+ +
+
+

3.3. Connection Dialog

+

Use the Connection Dialog to launch and attach to applications on your local and remote platforms. Start by selecting the Target Platform for profiling. By default (and if supported) your local platform will be selected. Select the platform on which you would like to start the target application or connect to a running process.

+
+../_images/connection-dialog.png +
+

When using a remote platform, you will be asked to select or create a Connection in the top drop down. To create a new connection, select + and enter your connection details. When using the local platform, localhost will be selected as the default and no further connection settings are required. You can still create or select a remote connection, if profiling will be on a remote system of the same platform.

+

Depending on your target platform, select either Launch or Remote Launch to launch an application for profiling on the target. Note that Remote Launch will only be available if supported on the target platform.

+

Fill in the following launch details for the application:

+
    +
  • Application Executable: Specifies the root application to launch. Note that this may not be the final application that you wish to profile. It can be a script or launcher that creates other processes.

  • +
  • Working Directory: The directory in which the application will be launched.

  • +
  • Command Line Arguments: Specify the arguments to pass to the application executable.

  • +
  • Environment: The environment variables to set for the launched application.

  • +
+

Select Attach to attach the profiler to an application already running on the target platform. This application must have been started using another NVIDIA Nsight Compute CLI instance. The list will show all application processes running on the target system which can be attached. Select the refresh button to re-create this list.

+

Finally, select the Activity to be run on the target for the launched or attached application. Note that not all activities are necessarily compatible with all targets and connection options. Currently, the following activities exist:

+ +
+

3.3.1. Remote Connections

+

Remote devices that support SSH can also be configured as a target in the Connection Dialog. To configure a remote device, ensure an SSH-capable Target Platform is selected, then press the + button. The following configuration dialog will be presented.

+
+../_images/add-remote-connection.png +
+

NVIDIA Nsight Compute supports both password and private key authentication methods. In this dialog, select the authentication method and enter the following information:

+
    +
  • Password

    +
      +
    • IP/Host Name: The IP address or host name of the target device.

    • +
    • User Name: The user name to be used for the SSH connection.

    • +
    • Password: The user password to be used for the SSH connection.

    • +
    • Port: The port to be used for the SSH connection. (The default value is 22)

    • +
    • Deployment Directory: The directory to use on the target device to deploy supporting files. The specified user must have write permissions to this location.

    • +
    • Connection Name: The name of the remote connection that will show up in the Connection Dialog. If not set, it will default to <User>@<Host>:<Port>.

    • +
    +
  • +
  • Private Key

    +
    +../_images/add-remote-connection-private-key.png +
    +
      +
    • IP/Host Name: The IP address or host name of the target device.

    • +
    • User Name: The user name to be used for the SSH connection.

    • +
    • SSH Private Key: The private key that is used to authenticate to SSH server.

    • +
    • SSH Key Passphrase: The passphrase for your private key.

    • +
    • Port: The port to be used for the SSH connection. (The default value is 22)

    • +
    • Deployment Directory: The directory to use on the target device to deploy supporting files. The specified user must have write permissions to this location.

    • +
    • Connection Name: The name of the remote connection that will show up in the Connection Dialog. If not set, it will default to <User>@<Host>:<Port>.

    • +
    +
  • +
+

In addition to keyfiles specified by path and plain password authentication, NVIDIA Nsight Compute supports keyboard-interactive authentication, standard keyfile path searching and SSH agents.

+

When all information is entered, click the Add button to make use of this new connection.

+

When a remote connection is selected in the Connection Dialog, the Application Executable file browser will browse the remote file system using the configured SSH connection, allowing the user to select the target application on the remote device.

+

When an activity is launched on a remote device, the following steps are taken:

+
    +
  1. The command line profiler and supporting files are copied into the Deployment Directory on the the remote device. (Only files that do not exist or are out of date are copied.)

  2. +
  3. Communication channels are opened to prepare for the traffic between the UI and the Application Executable.

    +
      +
    • For Interactive Profile activities, a SOCKS proxy is started on the host machine.

    • +
    • For Non-Interactive Profile activities, a remote forwarding channel is opened on the target machine to tunnel profiling information back to the host.

    • +
    +
  4. +
  5. The Application Executable is executed on the remote device.

    +
      +
    • For Interactive Profile activities, a connection is established to the remote application and the profiling session begins.

    • +
    • For Non-Interactive Profile activities, the remote application is executed under the command line profiler and the specified report file is generated.

    • +
    +
  6. +
  7. For non-interactive profiling activities, the generated report file is copied back to the host, and opened.

  8. +
+

The progress of each of these steps is presented in the Progress Log.

+
+../_images/progress-log.png +
+

Progress Log

+
+
+

Note that once either activity type has been launched remotely, the tools necessary for further profiling sessions can be found in the Deployment Directory on the remote device.

+

On Linux and Mac host platforms, NVIDIA Nsight Compute supports SSH remote profiling on target machines which are not directly addressable from the machine the UI is running on through the ProxyJump and ProxyCommand SSH options.

+

These options can be used to specify intermediate hosts to connect to or actual commands to run to obtain a socket connected to the SSH server on the target host and can be added to your SSH configuration file.

+

Note that for both options, NVIDIA Nsight Compute runs external commands and does not implement any mechanism to authenticate to the intermediate hosts using the credentials entered in the Connection Dialog. These credentials will only be used to authenticate to the final target in the chain of machines.

+

When using the ProxyJump option NVIDIA Nsight Compute uses the OpenSSH client to establish the connection to the intermediate hosts. This means that in order to use ProxyJump or ProxyCommand, a version of OpenSSH supporting these options must be installed on the host machine.

+

A common way to authenticate to the intermediate hosts in this case is to use a SSH agent and have it hold the private keys used for authentication.

+

Since the OpenSSH SSH client is used, you can also use the SSH askpass mechanism to handle these authentications in an interactive manner.

+

It might happen on slow networks that connections used for remote profiling through SSH time out. If this is the case, the ConnectTimeout option can be used to set the desired timeout value.

+

A known limitation of the remote profiling through SSH is that problems may arise if NVIDIA Nsight Compute tries to do remote profiling through SSH by connecting to the same machine it is running on. In this case, the workaround is to do local profiling through localhost.

+

For more information about available options for the OpenSSH client and the ecosystem of tools it can be used with for authentication refer to the official manual pages.

+
+
+

3.3.2. Interactive Profile Activity

+

The Interactive Profile activity allows you to initiate a session that controls the execution of the target application, similar to a debugger. You can step API calls and workloads (CUDA kernels), pause and resume, and interactively select the kernels of interest and which metrics to collect.

+

This activity does currently not support profiling or attaching to child processes.

+
    +
  • Enable CPU Call Stack

    +

    Collect the CPU-sided Call Stack at the location of each profiled kernel launch.

    +
  • +
  • Enable NVTX Support

    +

    Collect NVTX information provided by the application or its libraries. Required to support stepping to specific NVTX contexts.

    +
  • +
  • Disable Profiling Start/Stop

    +

    Ignore calls to cu(da)ProfilerStart or cu(da)ProfilerStop made by the application.

    +
  • +
  • Enable Profiling From Start

    +

    Enables profiling from the application start. Disabling this is useful if the application calls cu(da)ProfilerStart and kernels before the first call to this API should not be profiled. Note that disabling this does not prevent you from manually profiling kernels.

    +
  • +
  • Cache Control

    +

    Control the behavior of the GPU caches during profiling. Allowed values: For Flush All, all GPU caches are flushed before each kernel replay iteration during profiling. While metric values in the execution environment of the application might be slightly different without invalidating the caches, this mode offers the most reproducible metric results across the replay passes and also across multiple runs of the target application.

    +

    For Flush None, no GPU caches are flushed during profiling. This can improve performance and better replicates the application behavior if only a single kernel replay pass is necessary for metric collection. However, some metric results will vary depending on prior GPU work, and between replay iterations. This can lead to inconsistent and out-of-bounds metric values.

    +
  • +
  • Clock Control

    +

    Control the behavior of the GPU clocks during profiling. Allowed values: For Base, GPC and memory clocks are locked to their respective base frequency during profiling. This has no impact on thermal throttling. For None, no GPC or memory frequencies are changed during profiling.

    +
  • +
  • Import Source

    +

    Enables permanently importing available source files into the report. Missing source files are searched in Source Lookup folders. Source information must be embedded in the executable, e.g. via the -lineinfo compiler option. Imported files are used in the CUDA-C view on the Source Page.

    +
  • +
+
    +
  • Graph Profiling

    +

    Set if CUDA graphs should be stepped and profiled as individual Nodes or as complete Graphs. See the Kernel Profiling Guide for more information on this mode.

    +
  • +
+
+
+

3.3.3. Profile Activity

+

The Profile activity provides a traditional, pre-configurable profiler. After configuring which kernels to profile, which metrics to collect, etc, the application is run under the profiler without interactive control. The activity completes once the application terminates. For applications that normally do not terminate on their own, e.g. interactive user interfaces, you can cancel the activity once all expected kernels are profiled.

+

This activity does not support attaching to processes previously launched via NVIDIA Nsight Compute. These processes will be shown grayed out in the Attach tab.

+
    +
  • Output File

    +

    Path to report file where the collected profile should be stored. If not present, the report extension .ncu-rep is added automatically. The placeholder %i is supported for the filename component. It is replaced by a sequentially increasing number to create a unique filename. This maps to the --export command line option.

    +
  • +
  • Force Overwrite

    +

    If set, existing report file are overwritten. This maps to the --force-overwrite command line option.

    +
  • +
  • Target Processes

    +

    Select the processes you want to profile. In mode Application Only, only the root application process is profiled. In mode all, the root application process and all its child processes are profiled. This maps to the --target-processes command line option.

    +
  • +
  • Replay Mode

    +

    Select the method for replaying kernel launches multiple times. In mode Kernel, individual kernel launches are replayed transparently during the single execution of the target application. In mode Application, the entire target application is relaunched multiple times. In each iteration, additional data for the target kernel launches is collected. Application replay requires the program execution to be deterministic. This maps to the --replay-mode command line option. See the Kernel Profiling Guide for more details on the replay modes.

    +
  • +
+
    +
  • Graph Profiling

    +

    Set if CUDA graphs should be profiled as individual Nodes or as complete Graphs.

    +
  • +
+
    +
  • Additional Options

    +

    All remaining options map to their command line profiler equivalents. See the Command Line Options for details.

    +
  • +
+
+
+

3.3.4. Reset

+

Entries in the connection dialog are saved as part of the current project. When working in a custom project, simply close the project to reset the dialog.

+

When not working in a custom project, entries are stored as part of the default project. You can delete all information from the default project by closing NVIDIA Nsight Compute and then deleting the project file from disk.

+
+
+ +
+

3.5. Tool Windows

+
+

3.5.1. API Statistics

+

The API Statistics window is available when NVIDIA Nsight Compute is connected to a target application. It opens by default as soon as the connection is established. It can be re-opened using Debug > API Statistics from the main menu.

+
+../_images/tool-window-api-statistics.png +
+

Whenever the target application is suspended, it shows a summary of tracked API calls with some statistical information, such as the number of calls, their total, average, minimum and maximum duration. Note that this view cannot be used as a replacement for Nsight Systems when trying to optimize CPU performance of your application.

+

The Reset button deletes all statistics collected to the current point and starts a new collection. Use the Export to CSV button to export the current statistics to a CSV file.

+
+
+

3.5.2. API Stream

+

The API Stream window is available when NVIDIA Nsight Compute is connected to a target application. It opens by default as soon as the connection is established. It can be re-opened using Debug > API Stream from the main menu.

+
+../_images/tool-window-api-stream.png +
+

Whenever the target application is suspended, the window shows the history of API calls and traced kernel launches. The currently suspended API call or kernel launch (activity) is marked with a yellow arrow. If the suspension is at a subcall, the parent call is marked with a green arrow. The API call or kernel is suspended before being executed.

+

For each activity, further information is shown such as the kernel name or the function parameters (Func Parameters) and return value (Func Return). Note that the function return value will only become available once you step out or over the API call.

+

Use the Current Thread dropdown to switch between the active threads. The dropdown shows the thread ID followed by the current API name. One of several options can be chosen in the trigger dropdown, which are executed by the adjacent >> button. Run to Next Kernel resumes execution until the next kernel launch is found in any enabled thread. Run to Next API Call resumes execution until the next API call matching Next Trigger is found in any enabled thread. Run to Next Range Start resumes execution until the next start of an active profiler range is found. Profiler ranges are defined by using the cu(da)ProfilerStart/Stop API calls. Run to Next Range Stop resumes execution until the next stop of an active profiler range is found. The API Level dropdown changes which API levels are shown in the stream. The Export to CSV button exports the currently visible stream to a CSV file.

+
+
+

3.5.3. Baselines

+

The Baselines tool window can be opened by clicking the Baselines entry in the Profile menu. It provides a centralized place from which to manage configured baselines. (Refer to Baselines, for information on how to create baselines from profile results.)

+
+../_images/tool-window-baselines.png +
+

The baseline visibility can be controlled by clicking on the check box in a table row. When the check box is checked, the baseline will be visible in the summary header as well as all graphs in all sections. When unchecked the baseline will be hidden and will not contribute to metric difference calculations.

+

The baseline color can be changed by double-clicking on the color swatch in the table row. The color dialog which is opened provides the ability to choose an arbitrary color as well as offers a palette of predefined colors associated with the stock baseline color rotation.

+

The baseline name can be changed by double-clicking on the Name column in the table row. The name must not be empty and must be less than the Maximum Baseline Name Length as specified in the options dialog.

+

The z-order of a selected baseline can be changed by clicking the Move Baseline Up and Move Baseline Down buttons in the tool bar. When a baseline is moved up or down its new position will be reflected in the report header as well as in each graph. Currently, only one baseline may be moved at a time.

+

The selected baselines may be removed by clicking on the Clear Selected Baselines button in the tool bar. All baselines can be removed at once by clicking on the Clear All Baselines button, from either the global tool bar or the tool window tool bar.

+

The configured baselines can be saved to a file by clicking on the Save Baselines button in the tool bar. By default baseline files use the .ncu-bln extension. Baseline files can be opened locally and/or shared with other users.

+

Baseline information can be loaded by clicking on the Load Baselines button in the tool bar. When a baseline file is loaded, currently configured baselines will be replaced. A dialog will be presented to the user to confirm this operation when necessary.

+

Differences between the current result and the baselines can be visualized with graphical bars for metrics in Details page section headers. Use the Difference Bars drop down to select the visualization mode. Bars are extending from left to right and have a fixed maximum.

+
+
+

3.5.4. Metric Details

+

The Metric Details tool window can be opened using the Metric Details entry in the Profile menu or the respective tool bar button. When a report and the tool window are open, a metric can be selected in the report to display additional information in the tool window. It also contains a search bar to look up metrics in the focused report.

+
+../_images/tool-window-metric-details.png +
+

Report metrics can be selected in the Details Page or the Raw Page. The window will show basic information (name, unit and raw value of the metric) as well as additional information, such as its extended description.

+

The search bar can be used to open metrics in the focused report. It shows available matches as you type. The entered string must match from the start of the metric name.

+

By default, selecting or searching for a new metric updates the current Default Tab. You can click the Pin Tab button to create a copy of the default tab, unless the same metric is already pinned. This makes it possible to save multiple tabs and quickly switch between them to compare values.

+

Some metrics contain Instance Values. When available, they are listed in the tool window. Instance values can have a Correlation ID that allows correlating the individual value with its associated entity, e.g. a function address or instruction name.

+

For metrics collected with PM sampling, the correlation ID is the GPU timestamp in nanoseconds. It is shown as an absolute value and relative to the first timestamp for this metric.

+
+
+

3.5.5. Launch Details

+

The Launch Details tool window can be opened using the Launch Details entry +in the Profile menu or the respective tool bar button. When a result +containing multiple sub-launches is selected and this tool window is open, it +will display information about each sub-launch contained in the result.

+
+../_images/tool-window-launch-details.png +
+

This tool window is split into two sections:

+
    +
  • a header displaying information applying to the result as a whole

  • +
  • a body displaying information specific to the viewed sub-launch

  • +
+ +
+

Body

+

The body of this tool window displays a table with sub-launch-specific metrics. +This table has four columns:

+
    +
  • Metric Name: the name of the metric

  • +
  • Metric Unit: the unit for metric values

  • +
  • Instance Value: the value of this metric for the selected sub-launch

  • +
  • Aggregate Value: the aggregate value for this metric over all sub-launches +in the selected result

  • +
+
+
+
+

3.5.6. NVTX

+

The NVTX window is available when NVIDIA Nsight Compute is connected to a target application. If closed, it can be re-opened using Debug > NVTX from the main menu. Whenever the target application is suspended, the window shows the state of all active NVTX domains and ranges in the currently selected thread. Note that NVTX information is only tracked if the launching command line profiler instance was started with --nvtx or NVTX was enabled in the NVIDIA Nsight Compute launch dialog.

+
+../_images/tool-window-nvtx.png +
+

Use the Current Thread dropdown in the API Stream window to change the currently selected thread. NVIDIA Nsight Compute supports NVTX named resources, such as threads, CUDA devices, CUDA contexts, etc. If a resource is named using NVTX, the appropriate UI elements will be updated.

+
+../_images/tool-window-nvtx-resources.png +
+
+
+

3.5.7. Resources

+

The Resources window is available when NVIDIA Nsight Compute is connected to a target application. It shows information about the currently known resources, such as CUDA devices, CUDA streams or kernels. The window is updated every time the target application is suspended. If closed, it can be re-opened using Debug > Resources from the main menu.

+
+../_images/tool-window-resources.png +
+

Using the dropdown on the top, different views can be selected, where each view is specific to one kind of resource (context, stream, kernel, …). The Filter edit allows you to create filter expressions using the column headers of the currently selected resource.

+

The resource table shows all information for each resource instance. Each instance has a unique ID, the API Call ID when this resource was created, its handle, associated handles, and further parameters. When a resource is destroyed, it is removed from its table.

+
+

Memory Allocations

+

When using the asynchronous malloc/free APIs, the resource view for Memory Allocation will also include the memory objects created in this manner. These memory objects have a non-zero memory pool handle. The Mode column will indicate which code path was taken during the allocation of the corresponding object. The modes are:

+
    +
  • REUSE_STREAM_SUBPOOL: The memory object was allocated in memory that was previously freed. The memory was backed by the memory pool set as current for the stream on which the allocation was made.

  • +
  • USE_EXISTING_POOL_MEMORY: The memory object was allocated in memory that was previously freed. The memory is backed by the default memory pool of the stream on which the allocation was made.

  • +
  • REUSE_EVENT_DEPENDENCIES: The memory object was allocated in memory that was previously freed in another stream of the same context. A stream ordering dependency of the allocating stream on the free action existed. Cuda events and null stream interactions can create the required stream ordered dependencies.

  • +
  • REUSE_OPPORTUNISTIC: The memory object was allocated in memory that was previously freed in another stream of the same context. However, no dependency between the free and allocation existed. This mode requires that the free be already committed at the time the allocation is requested. Changes in execution behavior might result in different modes for multiple runs of the application.

  • +
  • REUSE_INTERNAL_DEPENDENCIES: The memory object was allocated in memory that was previously freed in another stream of the same context. New internal stream dependencies may have been added in order to establish the stream ordering required to reuse a piece of memory previously released.

  • +
  • REQUEST_NEW_ALLOCATION: New memory had to be allocated for this memory object as no viable reusable pool memory was found. The allocation performance is comparable to using the non-asynchronous malloc/free APIs.

  • +
+
+
+

Graphviz DOT and SVG exports

+

Some of the shown Resources can also be exported to GraphViz DOT or SVG* files using the Export to GraphViz or Export to SVG buttons.

+

When exporting OptiX traversable handles, the traversable graph node types will be encoded using shapes and colors as described in the following table.

+ + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 2. OptiX Traversable Graph Node Types

Node Type

Shape

Color

IAS

Hexagon

#8DD3C7

+ + +

Triangle GAS

Box

#FFFFB3

+ + +

AABB GAS

Box

#FCCDE5

+ + +

Curve GAS

Box

#CCEBC5

+ + +

Sphere GAS

Box

#BEBADA

+ + +

Static Transform

Diamond

#FB8072

+ + +

SRT Transform

Diamond

#FDB462

+ + +

Matrix Motion Transform

Diamond

#80B1D3

+ + +

Error

Paralellogram

#D9D9D9

+ + +
+
+
+
+

3.5.8. Metric Selection

+

The Metric Selection window can be opened from the main menu using Profile > Metric Selection. It tracks all metric sets, sections and rules currently loaded in NVIDIA Nsight Compute, independent from a specific connection or report. The directory to load those files from can be configured in the Profile options dialog. It is used to inspect available sets, sections and rules, as well as to configure which should be collected, and which rules should be applied. You can also specify a comma separated list of individual metrics, that should be collected. The window has two views, which can be selected using the dropdown in its header.

+

The Metric Sets view shows all available metric sets. Each set is associated with a number of metrics sections. You can choose a set appropriate to the level of detail for which you want to collect performance metrics. Sets which collect more detailed information normally incur higher runtime overhead during profiling.

+
+../_images/tool-window-section-sets.png +
+

When enabling a set in this view, the associated metric sections are enabled in the Metric Sections/Rules view. When disabling a set in this view, the associated sections in the Metric Sections/Rules view are disabled. If no set is enabled, or if sections are manually enabled/disabled in the Metric Sections/Rules view, the <custom> entry is marked active to represent that no section set is currently enabled. Note that the basic set is enabled by default.

+

Whenever a kernel is profiled manually, or when auto-profiling is enabled, only sections enabled in the Metric Sections/Rules view and individual metrics specified in input box are collected. Similarly, whenever rules are applied, only rules enabled in this view are active.

+
+../_images/tool-window-sections.png +
+

The enabled states of sections and rules are persisted across NVIDIA Nsight Compute launches. The Reload button reloads all sections and rules from disk again. If a new section or rule is found, it will be enabled if possible. If any errors occur while loading a rule, they will be listed in an extra entry with a warning icon and a description of the error.

+

Use the Enable All and Disable All checkboxes to enable or disable all sections and rules at once. The Filter text box can be used to filter what is currently shown in the view. It does not alter activation of any entry.

+

The table shows sections and rules with their activation status, their relationship and further parameters, such as associated metrics or the original file on disk. Rules associated with a section are shown as children of their section entry. Rules independent of any section are shown under an additional Independent Rules entry.

+

Double-clicking an entry in the table’s Filename column opens this file as a document. It can be edited and saved directly in NVIDIA Nsight Compute. After editing the file, Reload must be selected to apply those changes.

+

When a section or rule file is modified, the entry in the State column will show User Modified to reflect that it has been modified from its default state. When a User Modified row is selected, the Restore button will be enabled. Clicking the Restore button will restore the entry to its default state and automatically Reload the sections and rules.

+

Similarly, when a stock section or rule file is removed from the configured Sections Directory (specified in the Profile options dialog), the State column will show User Deleted. User Deleted files can also be restored using the Restore button.

+

Section and rule files that are created by the user (and not shipped with NVIDIA Nsight Compute) will show up as User Created in the state column.

+

See the Sections and Rules for the list of default sections for NVIDIA Nsight Compute.

+
+
+
+

3.6. Profiler Report

+

The profiler report contains all the information collected during profiling for each kernel launch. In the user interface, it consists of a header with general information, as well as controls to switch between report pages or individual collected launches.

+
+

3.6.1. Header

+

The Page dropdown can be used to switch between the available report pages, which are explained in detail in the next section.

+
+../_images/profiler-report-header.png +
+

The Result dropdown can be used to switch between all collected kernel launches. The information displayed in each page commonly represents the selected launch instance. On some pages (e.g. Raw), information for all launches is shown and the selected instance is highlighted. You can type in this dropdown to quickly filter and find a kernel launch.

+

The Apply Filters button opens the filter dialog. You can use more than one filter to narrow down your results. On the filter dialog, enter your filter parameters and press OK button. The Launch dropdown, Summary Page table, and Raw Page table will be filtered accordingly. Select the arrow dropdown to access the Clear Filters button, which removes all filters.

+
+../_images/profiler-report-header-filter-dialog.png +
+

Filter Dialog

+
+
+

The Add Baseline button promotes the current result in focus to become the baseline of all other results from this report and any other report opened in the same instance of NVIDIA Nsight Compute. Select the arrow dropdown to access the Clear Baselines button, which removes all currently active baselines.

+

The Apply Rules button applies all rules available for this report. If rules had been applied previously, those results will be replaced. By default, rules are applied immediately once the kernel launch has been profiled. This can be changed in the options under Tools > Options > Profile > Report UI > Apply Applicable Rules Automatically.

+

The Occupancy Calculator button navigates to the Occupancy Calculator which is opened in a new document.

+

The Source Comparison button navigates to the Source Comparison document in case at least two profile results are available for comparison.

+

A button on the right-hand side offers multiple operations that may be performed on the page. Available operations include:

+
    +
  • Copy as Image - Copies the contents of the page to the clipboard as an image.

  • +
  • Save as Image - Saves the contents of the page to a file as an image.

  • +
  • Save as PDF - Saves the contents of the page to a file as a PDF.

  • +
  • Export to CSV - Exports the contents of page to CSV format.

  • +
  • Reset to Default - Resets the page to a default state by removing any persisted settings.

  • +
+

Note that not all functions are available on all pages.

+

Below the buttons described above, a table is shown with information about the selected profile result (as Current) and potentially additional baselines. +For many values in this table tooltips provide additional information or data, e.g., the tooltip of the column Attributes provides +additional information about the context type and resources used for the launch.

+

The [+] and [-] buttons can be used to show or hide the section body content. The visibility of the output of the rules can be toggled with the R button. The info toggle button i changes the section description’s visibility.

+
+
+

3.6.2. Report Pages

+

Use the Page dropdown in the header to switch between the report pages.

+

By default, when opening a report with a single profile result, the Details Page is shown. When opening a report with multiple results, the Summary Page is selected instead. You can change the default report page in the Profile options.

+
+

Session Page

+

This Session page contains basic information about the report and the machine, as well as device attributes of all devices for which launches were profiled. When switching between launch instances, the respective device attributes are highlighted.

+
+
+

Summary Page

+

The Summary page shows a table of all collected results in the report, as well as a list of the most important rule outputs (Prioritized Rules) which are ordered by the estimated speedup that could potential be obtained by following their guidance. Prioritized Rules are shown by default and can be toggled with the [R] button on the upper right of the page.

+
+../_images/profiler-report-pages-summary.png +
+

Summary page with Summary Table and Prioritized Rules.

+
+
+

The Summary Table gives you a quick comparison overview across all profiled workloads. It contains a number of important, pre-selected metrics which can be customized as explained below. Its columns can be sorted by clicking the column header. You can transpose the table with the Transpose button. Aggregate of all results per each counter metric is shown in the table header along with the column name. You can change the aggregated values by selecting the desired results for multiple metrics simultaneously. When selecting any entry by single-click, a list of its Prioritized Rules will be shown below the table. Double-click any entry to make the result the currently active one and switch to the Details Page page to inspect its performance data.

+
+../_images/profiler-report-pages-summary-table.png +
+

You can configure the list of metrics included in this table in the Profile options dialog. If a metric has multiple instance values, the number of instances is shown after its standard value. A metric with ten instance values could for example look like this: 35.48 {10}. In the Profile options dialog, you can select that all instance values should be shown individually. You can also inspect the instances values of a metric result in the Metric Details tool window.

+

In addition to metrics, you can also configure the table to include any of the following properties:

+
+

Properties

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Properties

property__api_call_id

ID of the API call associated with this profile result.

property__block_size

Block Size.

property__creation_time

Local collection time.

property__demangled_name

Kernel demangled name.

property__device_name

GPU device name.

property__estimated_speedup

Maximal relative speedup achievable for this profile result as estimated by the guided analysis rules.

property__function_name

Kernel function name or range name.

property__grid_dimensions

Grid Dimensions.

property__grid_offset

Grid Offset.

property__grid_size

Grid Size.

property__issues_detected

Number of issues detected by guided analysis rules for this profile result.

property__kernel_id

Kernel ID.

property__mangled_name

Kernel mangled name.

property__process_name

Process name.

property__runtime_improvement

Runtime improvement corresponding to the estimated speedup.

property__series_id

ID of the profile series.

property__series_parameters

Profile series parameters.

property__thread_id

CPU thread ID.

+
+

For Range Replay reports, a smaller set of columns is shown by default, as not all apply to such results.

+

For the currently selected metric result the Prioritized Rules show the most impactful rule results with respect to the estimated potential speedup. Clicking on any of the rule names on the left allows you to easily navigate to the containing section on the details page. With the downward-facing arrow on the right a table with the relevant key performance indicators can be toggled. This table contains the metrics which should be tracked when optimizing performance according to the rule guidance.

+
+../_images/profiler-report-pages-summary-rules.png +
+

Prioritized Rules with key performance indicators table.

+
+
+
+
+

Details Page

+

Overview

+

The Details page is the main page for all metric data collected during a kernel launch. The page is split into individual sections. Each section consists of a header table and an optional body that can be expanded. The sections are completely user defined and can be changed easily by updating their respective files. For more information on customizing sections, see the Customization Guide. For a list of sections shipped with NVIDIA Nsight Compute, see Sections and Rules.

+

By default, once a new profile result is collected, all applicable rules are applied. Any rule results will be shown as Recommendations on this page. Most rule results will contain an optimization advice along with an estimate of the improvement that could be achieved when successfully implementing this advice. Other rule results will be purely informative or have a warning icon to indicate a problem that occurred during execution (e.g., an optional metric that could not be collected). Results with error icons typically indicate an error while applying the rule.

+

Estimates of potential improvement are shown below the rule result’s name and exist in two types. Global estimates (“Est. Speedup”) are an approximation of the decrease in workload runtime, whereas local estimates (“Est. Local Speedup”) are an approximation of the increase in efficiency of the hardware utilization of the particular performance problem the rule addresses.

+
+../_images/profiler-report-pages-section-with-rule.png +
+

Rule results often point out performance problems and guide through the analysis process.

+
+
+

If a rule result references another report section, it will appear as a link in the recommendation. Select the link to scroll to the respective section. If the section was not collected in the same profile result, enable it in the Metric Selection tool window.

+

You can add or edit comments in each section of the Details view by clicking on the comment button (speech bubble). The comment icon will be highlighted in sections that contain a comment. Comments are persisted in the report and are summarized in the Comments Page.

+
+../_images/profiler-report-pages-details-comments.png +
+

Use the Comments button to annotate sections.

+
+
+

Besides their header, sections typically have one or more bodies with additional charts or tables. Click the triangle Expander icon in the top-left corner of each section to show or hide those. If a section has multiple bodies, a dropdown in their top-right corner allows you to switch between them.

+
+../_images/profiler-report-pages-section-bodies.png +
+

Sections with multiple bodies have a dropdown to switch between them.

+
+
+

Memory

+

If enabled, the Memory Workload Analysis section contains a Memory chart that visualizes data transfers, cache hit rates, instructions and memory requests. More information on how to use and read this chart can be found in the Kernel Profiling Guide.

+

Occupancy

+

You can open the Occupancy Calculator by clicking on the calculator button in the report header or in the header of the Occupancy Section.

+

Range Replay

+

Note that for Range Replay results some UI elements, analysis rules, metrics or section body items such as charts or tables might not be available, as they only apply to kernel launch-based results. The filters can be checked in the corresponding section files.

+

Rooflines

+

If enabled, the GPU Speed Of Light Roofline Chart section contains a Roofline chart that is particularly helpful for visualizing kernel performance at a glance. (To enable roofline charts in the report, ensure that the section is enabled when profiling.) More information on how to use and read this chart can be found in Roofline Charts. NVIDIA Nsight Compute ships with several different definitions for roofline charts, including hierarchical rooflines. These additional rooflines are defined in different section files. While not part of the full section set, a new section set called roofline was added to collect and show all rooflines in one report. The idea of hierarchical rooflines is that they define multiple ceilings that represent the limiters of a hardware hierarchy. For example, a hierarchical roofline focusing on the memory hierarchy could have ceilings for the throughputs of the L1 cache, L2 cache and device memory. If the achieved performance of a kernel is limited by one of the ceilings of a hierarchical roofline, it can indicate that the corresponding unit of the hierarchy is a potential bottleneck.

+
+../_images/profiler-report-pages-section-rooflines.png +
+

Sample roofline chart.

+
+
+

The roofline chart can be zoomed and panned for more effective data analysis, using the controls in the table below.

+ + ++++++ + + + + + + + + + + + + + + +
Table 3. Roofline Chart Zoom and Pan Controls

Zoom In

Zoom Out

Zoom Reset

Pan

    +
  • Click the Zoom In button in the top right corner of the chart.

  • +
  • Click the left mouse button and drag to create a rectangle that bounds the area of interest.

  • +
  • Press the plus (+) key.

  • +
  • Use Ctrl + MouseWheel (Windows and Linux only)

  • +
+
    +
  • Click the Zoom Out button in the top right corner of the chart.

  • +
  • Click the right mouse button.

  • +
  • Press the minus (-) key.

  • +
  • Use Ctrl + MouseWheel (Windows and Linux only)

  • +
+
    +
  • Click the Zoom Reset button in the top right corner of the chart.

  • +
  • Press the Escape (Esc) key.

  • +
+
    +
  • Use Ctrl (Command on Mac) + LeftMouseButton to grab the chart, then move the mouse.

  • +
  • Use the cursor keys.

  • +
+
+

Source

+

Sections such as Source Counters can contain source hot spot tables. These tables indicate the N highest or lowest values of one or more metrics in your kernel source code. Select the location links to navigate directly to this location in the Source Page. Hover the mouse over a value to see which metrics contribute to it.

+
+../_images/profiler-report-pages-details-source-table.png +
+

Hot spot tables point out performance problems in your source.

+
+
+

Timelines

+

When collecting metrics with PM sampling, they can be viewed in a timeline. The timeline shows metrics selected in the respective section file or on the command line with their labels/names and their values over time.

+

Different metrics may be collected in different passes (replays) of the workload, as only a limited number of them can be sampled in the same pass. Context switch trace is used to filter the collected data to only include samples from the profiled contexts and to align it in the timeline.

+

You can hover the mouse over a metric row label to see further information on the metrics in the row. Hovering over a sample on the timeline shows the metric values at that timestamp within the current row. With the Metric Details tool window open, click to select a value on the timeline and show the metric and all its raw timestamps (absolute and relative) correlated values in the tool window.

+

You can also use the Metric Details tool window to inspect profiler metrics generated during PM sampling. These provide information about the used sampling intervals, buffer sizes, dropped samples and other properties for each collection pass. A detailed list can be found in the metrics reference.

+

The timeline has a context menu for further actions regarding copying content and zooming. +In addition, the Enable/Disable Context Switch Filter option can be used to enable or disable the filtering of the timeline data with context switch information, if it is available. +When the context switch filter is enabled (the default), samples from each pass group are only shown for the active contexts. +When the context switch filter is disabled, the raw collected sampling data is shown along with a separate row for each pass group’s context switch trace.

+

When the context menu option is not available, the report does not include context switch trace data. +In this case, the option Enable/Disable Trim Filter is shown instead, which, when enabled, tries to align based on the first non-zero value in any sampling metric in this pass group. +However, this fallback does not take into account actual context switches.

+
+
+

Source Page

+

The Source page correlates assembly (SASS) with high-level code such as CUDA-C or PTX. In addition, it displays instruction-correlated metrics to help pinpoint performance problems in your code.

+
+../_images/profiler-report-pages-source.png +
+

The page can be switched between different Views to focus on a specific source layer or see two layers side-by-side. This includes SASS, PTX and Source (CUDA-C, Fortran, Python, …), as well as their combinations. Which options are available depends on the source information embedded into the executable.

+

The high-level Source (CUDA-C) view is available if the application was built with the -lineinfo or --generate-line-info nvcc flag to correlate SASS and source. When using separate linking at the ELF level, there is no PTX available in the ELF that would correspond to the final SASS. As such, NVIDIA Nsight Compute does not show any PTX even though it would be available statically in the executable and could be shown with cuobjdump -all -lptx. However, this is a pre-linked version of the PTX and cannot be reliably used for correlation.

+

The code in the different Views can also contain warnings, errors or just notifications that are displayed as Source Markers in the left header, as shown below. These can be generated from multiple systems, but as of now only NvRules are supported.

+
+../_images/profiler-report-pages-source-markers.png +
+ +
+
Metrics
+

Metrics Correlation

+

The page is most useful when inspecting performance information and metrics correlated with your code. Metrics are shown in columns, which can be enabled or disabled using the Column Chooser accessible using the column header right click menu.

+
+../_images/profiler-report-pages-source-column-chooser.png +
+

To not move out of view when scrolling horizontally, columns can be fixed. By default, the Source column is fixed to the left, enabling easy inspection of all metrics correlated to a source line. To change fixing of columns, right click the column header and select Freeze or Unfreeze, respectively.

+
+../_images/profiler-report-pages-fix-column.png +
+

The heatmap on the right-hand side of each view can be used to quickly identify locations with high metric values of the currently selected metric in the dropdown. The heatmap uses a black-body radiation color scale where black denotes the lowest mapped value and white the highest, respectively. The current scale is shown when clicking and holding the heatmap with the right mouse button.

+
+../_images/profiler-report-pages-source-heatmap.png +
+

By default, applicable metrics are shown as percentage values relative to their sum across the launch. A bar is filling from left to right to indicate the value at a specific source location relative to this metric’s maximum within the launch. The [%] and [+-] buttons can be used to switch the display from relative to absolute and from abbreviated absolute to full-precision absolute, respectively. For relative values and bars, the [circle/pie] button can be used to switch the display between relative to global (launch) and relative to local (function/file) scope. This button is disabled when the view is collapsed, as percentages are always relative to the global launch scope in this case.

+
+../_images/profiler-report-pages-source-rel-abs.png +
+

Pre-Defined Source Metrics

+
    +
  • Live Registers

    +

    Number of registers that need to be kept valid by the compiler. A high value indicates that many registers are required at this code location, potentially increasing the register pressure and the maximum number of register required by the kernel.

    +

    The total number of registers reported as launch__registers_per_thread may be significantly higher than the maximum live registers. The compiler may need to allocate specific registers that can creates holes in the allocation, thereby affecting launch__registers_per_thread, even if the maximum live registers is smaller. This may happen due to ABI restrictions, or restrictions enforced by particular hardware instructions. The compiler may not have a complete picture of which registers may be used in either callee or caller and has to obey ABI conventions, thereby allocating different registers even if some register could have theoretically been re-used.

    +
  • +
  • Warp Stall Sampling (All Samples)1

    +

    The number of samples from the Statistical Sampler at this program location.

    +
  • +
  • Warp Stall Sampling (Not-issued Samples)2

    +

    The number of samples from the Statistical Sampler at this program location on cycles the warp scheduler issued no instructions. Note that (Not Issued) samples may be taken on a different profiling pass than (All) samples mentioned above, so their values do not strictly correlate.

    +

    This metric is only available on devices with compute capability 7.0 or higher.

    +
  • +
  • Instructions Executed

    +

    Number of times the source (instruction) was executed per individual warp, independent of the number of participating threads within each warp.

    +
  • +
  • Thread Instructions Executed

    +

    Number of times the source (instruction) was executed by any thread, regardless of predicate presence or evaluation.

    +
  • +
  • Predicated-On Thread Instructions Executed

    +

    Number of times the source (instruction) was executed by any active, predicated-on thread. For instructions that are executed unconditionally (i.e. without predicate), this is the number of active threads in the warp, multiplied with the respective Instructions Executed value.

    +
  • +
  • Avg. Threads Executed

    +

    Average number of thread-level executed instructions per warp, regardless of their predicate.

    +
  • +
  • Avg. Predicated-On Threads Executed

    +

    Average number of predicated-on thread-level executed instructions per warp.

    +
  • +
  • Divergent Branches

    +

    Number of divergent branch targets, including fallthrough. Incremented only when there are two or more active threads with divergent targets. Divergent branches can lead to warp stalls due to resolving the branch or instruction cache misses.

    +
  • +
  • Information on Memory Operations

    + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Label

    Name

    Description

    Address Space

    memory_type

    The accessed address space (global/local/shared).

    Access Operation

    memory_access_type

    The type of memory access (e.g. load or store).

    Access Size

    memory_access_size_type

    The size of the memory access, in bits.

    L1 Tag Requests Global

    memory_l1_tag_requests_global

    Number of L1 tag requests generated by global memory instructions.

    L1 Conflicts Shared N-Way

    derived__memory_l1_conflicts_shared_nway

    Average N-way conflict in L1 per shared memory instruction. A 1-way access has no conflicts and resolves in a single pass. Note: This is a derived metric which can not be collected directly.

    L1 Wavefronts Shared Excessive

    derived__memory_l1_wavefronts_shared_excessive

    Excessive number of wavefronts in L1 from shared memory instructions, because not all not predicated-off threads performed the operation. Note: This is a derived metric which can not be collected directly.

    L1 Wavefronts Shared

    memory_l1_wavefronts_shared

    Number of wavefronts in L1 from shared memory instructions.

    L1 Wavefronts Shared Ideal

    memory_l1_wavefronts_shared_ideal

    Ideal number of wavefronts in L1 from shared memory instructions, assuming each not predicated-off thread performed the operation.

    L2 Theoretical Sectors Global Excessive

    derived__memory_l2_theoretical_sectors_global_excessive

    Excessive theoretical number of sectors requested in L2 from global memory instructions, because not all not predicated-off threads performed the operation. Note: This is a derived metric which can not be collected directly.

    L2 Theoretical Sectors Global

    memory_l2_theoretical_sectors_global

    Theoretical number of sectors requested in L2 from global memory instructions.

    L2 Theoretical Sectors Global Ideal

    memory_l2_theoretical_sectors_global_ideal

    Ideal number of sectors requested in L2 from global memory instructions, assuming each not predicated-off thread performed the operation.

    L2 Theoretical Sectors Local

    memory_l2_theoretical_sectors_local

    Theoretical number of sectors requested in L2 from local memory instructions.

    +

    All L1/L2 Sectors/Wavefronts/Requests metrics give the number of achieved (actually required), ideal, and excessive (achieved - ideal) sectors/wavefronts/requests. Ideal metrics indicate the number that would needed, given each not predicated-off thread performed the operation of given width. Excessive metrics indicate the required surplus over the ideal case. Reducing divergence between threads can reduce the excess amount and result in less work for the respective HW units.

    +
  • +
+

Several of the above metrics on memory operations were renamed in version 2021.2 as follows:

+ ++++ + + + + + + + + + + + + + + + + + + + + + + + +

Old name

New name

memory_l2_sectors_global

memory_l2_theoretical_sectors_global

memory_l2_sectors_global_ideal

memory_l2_theoretical_sectors_global_ideal

memory_l2_sectors_local

memory_l2_theoretical_sectors_local

memory_l1_sectors_global

memory_l1_tag_requests_global

memory_l1_sectors_shared

memory_l1_wavefronts_shared

memory_l1_sectors_shared_ideal

memory_l1_wavefronts_shared_ideal

+
    +
  • L2 Explicit Evict Policy Metrics

    +

    Starting with the NVIDIA Ampere architecture the eviction policy of the L2 cache can be tuned to match the kernel’s access pattern. The eviction policy can be either set implicitly for a memory window (for more details see CUaccessProperty) or set explicitly per executed memory instruction. If set explicitly, the desired eviction behavior for the cases of an L2 cache hit or miss are passed as input to the instruction. For more details refer to CUDA’s Cache Eviction Priority Hints.

    + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Label

    Name

    Description

    L2 Explicit Evict Policies

    smsp__inst_executed_memdesc_explicit_evict_type

    Comma separated list of configured explicit eviction policies. As the policies can be set dynamically at runtime, this list includes all policies that were part of any executed instruction.

    L2 Explicit Hit Policy Evict First

    smsp__inst_executed_memdesc_explicit_hitprop_evict_first

    Number of times a memory instruction was executed by any warp which had the evict_first policy set in case the access leads to a cache hit in L2. Data cached with this policy will be first in the eviction priority order and will likely be evicted when cache eviction is required. This policy is suitable for streaming data.

    L2 Explicit Hit Policy Evict Last

    smsp__inst_executed_memdesc_explicit_hitprop_evict_last

    Number of times a memory instruction was executed by any warp which had the evict_last policy set in case the access leads to a cache hit in L2. Data cached with this policy will be last in the eviction priority order and will likely be evicted only after other data with evict_normal or evict_first eviction policy is already evicted. This policy is suitable for data that should remain persistent in cache.

    L2 Explicit Hit Policy Evict Normal

    smsp__inst_executed_memdesc_explicit_hitprop_evict_normal

    Number of times a memory instruction was executed by any warp which had the evict_normal (default) policy set in case the access leads to a cache hit in L2.

    L2 Explicit Hit Policy Evict Normal Demote

    smsp__inst_executed_memdesc_explicit_hitprop_evict_normal_demote

    Number of times a memory instruction was executed by any warp which had the evict_normal_demote policy set in case the access leads to a cache hit in L2.

    L2 Explicit Miss Policy Evict First

    smsp__inst_executed_memdesc_explicit_missprop_evict_first

    Number of times a memory instruction was executed by any warp which had the evict_first policy set in case the access leads to a cache miss in L2. Data cached with this policy will be first in the eviction priority order and will likely be evicted cache eviction is required. This policy is suitable for streaming data.

    L2 Explicit Miss Policy Evict Normal

    smsp__inst_executed_memdesc_explicit_missprop_evict_normal

    Number of times a memory instruction was executed by any warp which had the evict_normal (default) policy set in case the access leads to a cache miss in L2.

    +
  • +
  • Individual Warp Stall Sampling Metrics

    +

    All stall_* metrics show the information combined in Warp Stall Sampling individually. See Statistical Sampler for their descriptions.

    +
  • +
  • See the Customization Guide on how to add additional metrics for this view and the Metrics Reference for further information on available metrics.

  • +
+

Register Dependencies

+

Dependencies between registers are displayed in the SASS view. When a register is read, all the potential addresses where it could have been written are found. The links between these lines are drawn in the view. All dependencies for registers, predicates, uniform registers and uniform predicates are shown in their respective columns.

+
+../_images/profiler-report-pages-source-register-dependencies.png +
+

The picture above shows some dependencies for a simple CUDA kernel. On the first row, which is line 9 of the SASS code, we can see writes on registers R2 and R3, represented by filled triangles pointing to the left. These registers are then read on lines 17, 20 and 23, and this is represented by regular triangles pointing to the right. There are also some lines where both types of triangles are on the same line, which means that a read and a write occured for the same register.

+

Dependencies across source files and functions are not tracked.

+

The Register Dependencies Tracking feature is enabled by default, but can be disabled completely in Tools > Options > Profile > Report Source Page > Enable Register Dependencies.

+
+
1
+

This metric was previously called Sampling Data (All).

+
+
2
+

This metric was previously called Sampling Data (Not Issued).

+
+
+
+
+
Profiles
+

The icon next to the View dropdown can be used to manage Source View Profiles.

+
+../_images/profiler-report-pages-source-profiles-button.png +
+

This button opens a dialog that shows you the list of saved source view profiles. Such profiles can be created using the Create button in the dialog. Profiles let you store the column properties of all views in the report to a file. Such properties include column visibility, freeze state, width, order and the selected navigation metric. A saved profile can be applied to any opened report using the Apply button. This updates the column properties mentioned above from the selected profile in all views.

+
+../_images/profiler-report-pages-source-profiles.png +
+

Profiles are useful for configuring views to your preferences, or for a certain use case. Start by choosing metric columns from the Column Chooser. Next, configure other properties like freezing column, changing width or order and setting a heatmap metric in the Navigation dropdown before creating the profile. Once a profile is created, you can always use this profile on any opened report to hide all non-required columns or to restore your configured properties. Simply select the profile from the source view profiles dialog and click the Apply button.

+

Note that the column properties are stored separately for each View in the profile and when applied, only those views will be updated which are present in the selected profile. You will not see the metric columns that are not available in your report even if those were configured to be visible in the source profile you have applied.

+
+
+
Limitations
+

Range Replay

+

When using Range Replay mode, instruction-level source metrics are not available.

+

Graph Profiling

+

When profiling complete CUDA graphs, instruction-level source metrics are not available.

+
+
+
+

Comments Page

+

The Comments page aggregates all section comments in a single view and allows the user to edit those comments on any launch instance or section, as well as on the overall report. Comments are persisted with the report. If a section comment is added, the comment icon of the respective section in the Details Page will be highlighted.

+
+
+

Call Stack / NVTX Page

+

The CPU Call Stack section of this report page shows the CPU call stack for the executing CPU thread at the time the kernel was launched. For this information to show up in the profiler report, the option to collect CPU call stacks had to be enabled in the Connection Dialog or using the corresponding NVIDIA Nsight Compute CLI command line parameter.

+
+../_images/profiler-report-pages-callstack.png +
+

The NVTX State section of this report page shows the NVTX context when the kernel was launched. All thread-specific information is with respect to the thread of the kernel’s launch API call. Note that NVTX information is only collected if the profiler is started with NVTX support enabled, either in the Connection Dialog or using the NVIDIA Nsight Compute CLI command line parameter.

+
+../_images/profiler-report-pages-nvtx.png +
+
+
+

Raw Page

+

The Raw page shows a list of all collected metrics with their units per profiled kernel launch. It can be exported, for example, to CSV format for further analysis. The page features a filter edit to quickly find specific metrics. You can transpose the table of kernels and metrics by using the Transpose button.

+

If a metric has multiple instance values, the number of instances is shown after the standard value. This metric for example has ten instance values: 35.48 {10}. You can select in the Profile options dialog that all instance values should be shown individually or inspect the metric result in the Metric Details tool window.

+
+
+
+

3.6.3. Metrics and Units

+

Numeric metric values are shown in various places in the report, including the header and tables and charts on most pages. NVIDIA Nsight Compute supports various ways to display those metrics and their values.

+

When available and applicable to the UI component, metrics are shown along with their unit. This is to make it apparent if a metric represents cycles, threads, bytes/s, and so on. The unit will normally be shown in rectangular brackets, e.g. Metric Name [bytes] 128.

+

By default, units are scaled automatically so that metric values are shown with a reasonable order of magnitude. Units are scaled using their SI-factors, i.e. byte-based units are scaled using a factor of 1000 and the prefixes K, M, G, etc. Time-based units are also scaled using a factor of 1000, with the prefixes n, u and m. This scaling can be disabled in the Profile options.

+

Metrics which could not be collected are shown as n/a and assigned a warning icon. If the metric floating point value is out of the regular range (i.e. nan (Not a number) or inf (infinite)), they are also assigned a warning icon. The exception are metrics for which these values are expected and which are allow-listed internally.

+
+
+
+

3.7. Baselines

+

NVIDIA Nsight Compute supports diffing collected results across one or multiple reports using Baselines. Each result in any report can be promoted to a baseline. This causes metric values from all results in all reports to show the difference to the baseline. If multiple baselines are selected simultaneously, metric values are compared to the average across all current baselines. Baselines are not stored with a report and are only available as long as the same NVIDIA Nsight Compute instance is open, unless they are saved to a ncu-bln file from the Baselines tool window.

+
+../_images/baselines.png +
+

Profiler report with one baseline

+
+
+

Select Add Baseline to promote the current result in focus to become a baseline. If a baseline is set, most metrics on the Details Page, Raw Page and Summary Page show two values: the current value of the result in focus, and the corresponding value of the baseline or the percentage of change from the corresponding baseline value. (Note that an infinite percentage gain, inf%, may be displayed when the baseline value for the metric is zero, while the focus value is not.)

+

If multiple baselines are selected, each metric will show the following notation:

+
<focus value> (<difference to baselines average [%]>, z=<standard score>@<number of values>)
+
+
+

The standard score is the difference between the current value and the average across all baselines, normalized by the standard deviation. If the number of metric values contributing to the standard score equals the number of results (current and all baselines), the @<number of values> notation is omitted.

+
+../_images/baselines-multiple.png +
+

Profiler report with multiple baselines

+
+
+

Double-clicking on a baseline name allows the user to edit the displayed name. Edits are committed by pressing Enter/Return or upon loss of focus, and abandoned by pressing Esc. Hovering over the baseline color icon allows the user to remove this specific baseline from the list.

+

Use the Clear Baselines entry from the dropdown button, the Profile menu, or the corresponding toolbar button to remove all baselines.

+

Baseline changes can also be made in the Baselines tool window.

+
+
+

3.8. Standalone Source Viewer

+

NVIDIA Nsight Compute includes a standalone source viewer for cubin files. This view is identical to the Source Page, except that it won’t include any performance metrics.

+

Cubin files can be opened from the File > Open main menu command. The SM Selection dialog will be shown before opening the standalone source view. If available, the SM version present in the file name is pre-selected. For example, if your file name is mergeSort.sm_80.cubin then SM 8.0 will be pre-selected in the dialog. Choose the appropriate SM version from the drop down menu if it’s not included in the file name.

+
+../_images/sm-selection-dialog.png +
+

SM Selection Dialog

+
+
+

Click Ok button to open Standalone Source Viewer.

+
+../_images/cubin-viewer.png +
+

Standalone Source Viewer

+
+
+
+
+

3.9. Source Comparison

+

Source comparison provides a way to see the source files of two profile results side by side. It enables to quickly identify source differences and understand changes in metric values.

+

To compare two results side by side add one result as a baseline, navigate to the other result, and then click the Source Comparison button located in the report header.

+

For example, if you want to compare kernel XYZ from report R1 with kernel XYZ from report R2, first open report R1, add the profile result for kernel XYZ as baseline, open report R2, choose kernel XYZ, and then click the Source Comparison button.

+

Source comparison will be shown only with first added baseline result.

+
+../_images/source-comparison-from-header.png +
+

Source Comparison Button

+
+
+
+../_images/source-comparison-document.png +
+

Source Comparison

+
+
+

Currently only high-level Source (CUDA-C) view and SASS view are supported for comparison.

+

Navigation to the previous or next difference is supported using the navigation buttons or the keyboard shortcuts Ctrl + 1 and Ctrl + 2.

+
+../_images/source-comparison-navigation-buttons.png +
+

Source Comparison Navigation Buttons

+
+
+
+
+

3.10. Occupancy Calculator

+

NVIDIA Nsight Compute provides an Occupancy Calculator that allows you to compute the multiprocessor occupancy of a GPU for a given CUDA kernel. It offers feature parity to the CUDA Occupancy Calculator spreadsheet.

+

The Occupancy Calculator can be opened directly from a profile report or as a new activity. The occupancy calculator data can be saved to a file using File > Save. By default, the file uses the .ncu-occ extension. The occupancy calculator file can be opened using File > Open File

+
    +
  1. Launching from the Connection Dialog

    +

    Select the Occupancy Calculator activity from the connection dialog. You can optionally specify an occupancy calculator data file, which is used to initialize the calculator with the data from the saved file. Click the Launch button to open the Occupancy Calculator.

    +
    +../_images/occupancy-calculator-activity.png +
    +
  2. +
  3. Launching from the Profiler Report

    +

    The Occupancy Calculator can be opened from the Profiler Report using the calculator button located in the report header or in the header of the Occupancy section on the Detail Page.

    +
    +../_images/occupancy-calculator-from-header.png +
    +

    Details page header

    +
    +
    +
    +../_images/occupancy-calculator-from-section.png +
    +

    Occupancy section header

    +
    +
    +
  4. +
+

The user interface consists of an input section as well as tables and graphs that display information about GPU occupancy. To use the calculator, change the input values in the input section, click the Apply button and examine the tables and graphs.

+
+

3.10.1. Tables

+

The tables show the occupancy, as well as the number of active threads, warps, and thread blocks per multiprocessor, and the maximum number of active blocks on the GPU.

+
+../_images/occupancy-calculator-tables.png +
+

Tables

+
+
+
+
+

3.10.2. Graphs

+

The graphs show the occupancy for your chosen block size as a blue circle, and for all other possible block sizes as a line graph.

+
+../_images/occupancy-calculator-graphs.png +
+

Graphs

+
+
+
+
+

3.10.3. GPU Data

+

The GPU Data shows the properties of all supported devices.

+
+../_images/occupancy-calculator-gpu-data.png +
+

GPU Data

+
+
+
+
+
+

3.11. Acceleration Structure Viewer

+

The Acceleration Structure Viewer allows inspection of acceleration structures built using the OptiX API. In modern ray tracing APIs like OptiX, acceleration structures are data structures describing the rendered scene’s geometries that will be intersected when performing ray tracing operations. More information concerning acceleration structures can be found in the OptiX programming guide.

+

It is the responsibility of the user to set these up and pass them to the OptiX API which translates them to internal data structures that perform well on modern GPUs. The description created by the user can be very error-prone and it is sometimes hard to understand why the rendered result is not as expected. The Acceleration Structure Viewer is a component allowing OptiX users to inspect the acceleration structures they build before launching a ray tracing pipeline.

+

The Acceleration Structure Viewer is opened through a button in the Resources window. The button will only be available when the currently viewed resource is OptiX: TraversableHandles. It opens the currently selected handle.

+
+../_images/as-viewer-open-button.png +
+

The viewer is multi-paned: it shows a hierarchical view of the acceleration structure on the left, a graphical view of the acceleration structure in the middle, and controls and options on the right. In the hierarchical tree view on the left of the viewer the instance acceleration structures (IAS), geometry acceleration structures (GAS), child instances and child geometries are shown. In addition to this, some general properties for each of them is shown such as their primitive count, surface area and size on the device.

+
+../_images/as-viewer.png +
+

In the hierarchical view on the left of the Acceleration Structure Viewer, the following information is displayed where applicable.

+ + ++++ + + + + + + + + + + + + + + + + + + + +
Table 4. Acceleration Structure Hierarchical Columns

Column

Description

Name

An identifier for each row in the hierarchy. Click on the check box next to the name to show or hide the selected geometry or hierarchy. Double-click on this entry to jump to the item in the rendering view.

# Prims

The number of primitives that make up this acceleration structure.

Surface Area

A calculation of the total surface area for the AABB that bounds the particular entry.

Size

The size of the output buffer on the device holding this acceleration structure.

+

Performance analysis tools are accessible in the bottom left corner on the main view. These tools help identify potential performance problems that are outlined in the RTX Ray Tracing Best Practices Guide. These analysis tools aim to give a broad picture of acceleration structures that may exhibit sub-optimal performance. To find the most optimal solution, profiling and experimentation is recommended but these tools may paint a better picture as to why one structure performs poorly compared to another.

+ + ++++ + + + + + + + + + + + + + +
Table 5. Acceleration Structure Analysis Tools

Action

Description

Instance Overlaps

Identifies instance AABBs that overlap with other instances in 3D. Consider merging GASes when instance world-space AABBs overlap significantly to potentially increase performance.

Instance Heatmap

This allows you to set the threshold used by the AABB heatmap rendered in the visualizer.

+
+

3.11.1. Navigation

+

The Acceleration Structure Viewer supports multiple navigation modes. The navigation mode can be changed using the combo box in the camera controls pane, to the right of the rendering pane. The keyboard and mouse bindings for each mode are as follows:

+ + ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 6. Acceleration Structure Key Bindings

Binding

Fly Camera

Dolly Camera

Orbit Camera

WASD/Arrow Keys

Move forward, backward, left, right

Move forward, backward, left, right

Track (Move up, down, left, right)

E/Q

Move up/down

Move up/down

n/a

Z/C

Increase/decrease field of view

Increase/decrease field of view

Increase/decrease field of view

Shift/Ctrl

Move faster/slower

Move faster/slower

Move faster/slower

Mousewheel

Zoom in/out

Zoom in/out

Zoom in/out

LMB + Drag

Rotate in place

Rotate left/right, move forward/backward

Rotate around the geometry

RMB + Drag

Zoom in/out

Rotate in place

Zoom in/out

MMB + Drag

Track (Move up, down, left, right)

Track (Move up, down, left, right)

Track (Move up, down, left, right)

Alt

Temporarily switch to Orbit Camera

Temporarily switch to Orbit Camera

n/a

F/Double Click

Focus on the selected geometry

Focus on the selected geometry

Focus on the selected geometry

+

Based on the coordinate system of the input geometry, you may need to change the Up Direction setting to Z-Axis or the Coordinates setting to RHS. To reset the camera to its original location, click Reset Camera.

+

There are also a selection of Camera Controls for fast and precise navigation. To save a position, use the bookmarks controls. Each node within the acceleration structure hierarchy can also be double-clicked to quickly navigate to that location.

+
+../_images/as-viewer-cam.png +
+
+
+

3.11.2. Filtering and Highlighting

+

The acceleration structure view supports acceleration structure filtering as well as highlighting of data matching particular characteristics. The checkboxes next to each geometry allow users to toggle the rendering of each traversable.

+

Geometry instances can also be selected by clicking on them in the main graphical view. Additionally, right clicking in the main graphical view gives options to hide or show all geometry, hide the selected geometry, or hide all but the selected geometry.

+
+../_images/as-viewer-display-filter.png +
+

Beyond filtering, the view also supports highlight-based identification of geometry specified with particular flags. Checking each highlight option will identify those resources matching that flag, colorizing for easy identification. Clicking an entry in this section will dim all geometry that does not meet the filter criteria allowing items that match the filter to standout. Selecting multiple filters requires the passing geometry to meet all selected filters (e.g., AND logic). Additionally, the heading text will be updated to reflect the number of items that meet this filter criteria.

+
+../_images/as-viewer-property-filter.png +
+
+
+

3.11.3. Rendering Options

+

Under the highlight controls, additional rendering options are available. These include methods to control the geometry colors and the ability to toggle the drawing of wireframes for meshes and AABBs.

+
+../_images/as-viewer-rendering-options.png +
+
+
+

3.11.4. Exporting

+

The data displayed in the acceleration structure viewer document can be saved to file. Exporting an Acceleration Structure Viewer document allows for persisting the data you have collected beyond the immediate analysis session. This capability is particularly valuable for comparing different revisions of your geometry or sharing with others. Bookmarks are persisted as well.

+
+
+
+

3.12. Options

+

NVIDIA Nsight Compute options can be accessed via the main menu under Tools > Options. All options are persisted on disk and available the next time NVIDIA Nsight Compute is launched. When an option is changed from its default setting, its label will become bold. You can use the Restore Defaults button to restore all options to their default values.

+
+../_images/options-profile.png +
+

Profile options

+
+
+
+

3.12.1. Profile

+ + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 7. NVIDIA Nsight Compute Profile Options

Name

Description

Values

Sections Directory

Directory from which to import section files and rules. Relative paths are with respect to the NVIDIA Nsight Compute installation directory.

Include Sub-Directories

Recursively include section files and rules from sub-directories.

Yes (Default)/No

Apply Applicable Rules Automatically

Automatically apply active and applicable rules.

Yes (Default)/No

Reload Rules Before Applying

Force a rule reload before applying the rule to ensure changes in the rule script are recognized.

Yes/No (Default)

Default Report Page

The report page to show when a report is generated or opened. Auto lets the tool decide the best page to show when opening a report.

    +
  • Session

  • +
  • Summary

  • +
  • Details

  • +
  • Source

  • +
  • Comments

  • +
  • Call Stack/NVTX

  • +
  • Raw

  • +
  • Auto (default)

  • +
+

Function Name Mode

Determines how function/kernel names are shown.

    +
  • Auto (default): each component uses its preferred mode

  • +
  • Demangled: kernel names are shown demangled with all parameters

  • +
  • Function: kernel names are shown with their demangled function name without parameters

  • +
  • Mangled: kernel names are shown with their mangled name, if applicable

  • +
+

NVTX Rename Mode

Determines how NVTX information is used for renaming. Range replay results are always renamed when possible.

    +
  • None: no renaming

  • +
  • Kernel: kernel names are renamed using the most recent enclosing push/pop range

  • +
  • Resources (default): resources like CPU threads or CUDA contexts and streams are renamed

  • +
  • All: Kernel and Resources

  • +
+

Maximum Baseline Name Length

The maximum length of baseline names.

1..N (Default: 40)

Number of Full Baselines to Display

Number of baselines to display in the report header with all details in addition to the current result.

0..N (Default: 2)

Auto-Convert Metric Units

Auto-adjust displayed metric units and values (e.g. Bytes to KBytes).

Yes (Default)/No

Show Instanced Metric Values

Show the individual values of instanced metrics in tables.

Yes/No (Default)

Show Metrics As Floating Point

Show all numeric metrics as floating-point numbers.

Yes/No (Default)

Show Knowledge Base Information

Show information from the knowledge base in (metric) tooltips to explain terminology. Note: Nsight Compute needs to be restarted for this option to take effect.

Yes (Default)/No

Metrics/Properties

List of metrics and properties to show on the summary page. Comma-separated list of metric entries. Each entry has the format {Label:MetricName}.

Delay Load ‘Source’ Page

Delays loading the content of the report page until the page becomes visible. Avoids processing costs and memory overhead until the report page is opened.

Yes/No (Default)

Show Single File For Multi-File Sources

Shows a single file in each Source page view, even for multi-file sources.

Yes/No (Default)

Show Only Executed Functions

Shows only executed functions in the source page views. Disabling this can impact performance.

Yes (Default)/No

Auto-Resolve Remote Source Files

Automatically try to resolve remote source files on the source page (e.g. via SSH) if the connection is still registered.

Yes/No (Default)

Enable Register Dependencies

Track dependencies between SASS registers/predicates and display them in the SASS view.

Yes (Default)/No

Kernel Analysis Size Threshold (KB)

Enable SASS flow graph analysis for functions below this threshold. SASS analysis is required for Live Register and Register Dependency information. Set to -1 to enable analysis for all functions.

-1..N (Default: 1024)

Enable ELF Verification

Enable ELF (cubin) verification to run every time before SASS analysis. This should only be enabled when working with applications compiled before CUDA 11.0 or when encountering source page issues.

Yes/No (Default)

API Call History

Number of recent API calls shown in API Stream View.

1..N (Default: 100)

+
+
+

3.12.2. Environment

+ + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 8. NVIDIA Nsight Compute Environment Options

Name

Description

Values

Color Theme

The currently selected UI color theme.

    +
  • Dark (Default)

  • +
  • Light

  • +
+

Mixed DPI Scaling

Disable Mixed DPI Scaling if unwanted artifacts are detected when using monitors with different DPIs.

    +
  • Auto (Default)

  • +
  • Off

  • +
+

Default Document Folder

Directory where documents unassociated with a project will be saved.

At Startup

What to do when NVIDIA Nsight Compute is launched.

    +
  • Show welcome page (Default)

  • +
  • Show quick launch dialog

  • +
  • Load last project

  • +
  • Show empty environment

  • +
+

Show version update notifications

Show notifications when a new version of this product is available.

    +
  • Yes (Default)

  • +
  • No

  • +
+
+
+
+

3.12.3. Connection

+

Connection properties are grouped into Target Connection Options and Host Connection Properties.

+
+

Target Connection Properties

+

The Target Connection Properties determine how the host connects to the target application during an Interactive Profile Activity. This connection is used to transfer profile information to the host during the profile session.

+ + +++++ + + + + + + + + + + + + + + + + +
Table 9. NVIDIA Nsight Compute Target Connection Properties

Name

Description

Values

Base Port

Base port used to establish a connection from the host to the target application during an Interactive Profile activity (both local and remote).

1-65535 (Default: 49152)

Maximum Ports

Maximum number of ports to try (starting from Base Port) when attempting to connect to the target application.

2-65534 (Default: 64)

+
+
+

Host Connection Properties

+

The Host Connection Properties determine how the command line profiler will connect to the host application during a Profile Activity. This connection is used to transfer profile information to the host during the profile session.

+ + +++++ + + + + + + + + + + + + + + + + +
Table 10. NVIDIA Nsight Compute Host Connection Options

Name

Description

Values

Base Port

Base port used to establish a connection from the command line profiler to the host application during a Profile activity (both local and remote).

1-65535 (Default: 50152)

Maximum Ports

Maximum number of ports to try (starting from Base Port) when attempting to connect to the host application.

1-100 (Default: 10)

+
+
+
+

3.12.4. Source Lookup

+ + +++++ + + + + + + + + + + + + + + + + +
Table 11. NVIDIA Nsight Compute Source Lookup Options

Name

Description

Values

Program Source Locations

Set program source search paths. These paths are used to resolve CUDA-C source files on the Source page if the respective file cannot be found in its original location. Files which cannot be found are marked with a File Not Found error. See the Ignore File Properties option for files that are found but don’t match.

Ignore File Properties

Ignore file properties (e.g. timestamp, size) for source resolution. If this is disabled, all file properties like modification timestamp and file size are checked against the information stored by the compiler in the application during compilation. If a file with the same name exists on a source lookup path, but not all properties match, it won’t be used for resolution (and a File Mismatch error will be shown).

Yes/No (Default)

+
+
+

3.12.5. Send Feedback

+ + +++++ + + + + + + + + + + + + +
Table 12. NVIDIA Nsight Compute Send Feedback Options

Name

Description

Values

Collect Usage and Platform Data

Choose whether or not you wish to allow NVIDIA Nsight Compute to collect usage and platform data.

    +
  • Yes

  • +
  • No (Default)

  • +
+
+
+
+
+

3.13. Projects

+

NVIDIA Nsight Compute uses Project Files to group and organize profiling reports. At any given time, only one project can be open in NVIDIA Nsight Compute. Collected reports are automatically assigned to the current project. Reports stored on disk can be assigned to a project at any time. In addition to profiling reports, related files such as notes or source code can be associated with the project for future reference.

+

Note that only references to reports or other files are saved in the project file. Those references can become invalid, for example when associated files are deleted, removed or not available on the current system, in case the project file was moved itself.

+

NVIDIA Nsight Compute uses the ncu-proj file extension for project files.

+

When no custom project is current, a default project is used to store e.g. the current Connection Dialog entries. To remove all information from the default project, you must close NVIDIA Nsight Compute and then delete the file from disk.

+
    +
  • On Windows, the file is located at <USER>\AppData\Local\NVIDIA Corporation\NVIDIA Nsight Compute\

  • +
  • On Linux, the file is located at <USER>/.local/share/NVIDIA Corporation/NVIDIA Nsight Compute/

  • +
  • On MacOSX, the file is located at <USER>/Library/Application Support/NVIDIA Corporation/NVIDIA Nsight Compute/

  • +
+
+

3.13.1. Project Dialogs

+

New Project

+

Creates a new project. The project must be given a name, which will also be used for the project file. You can select the location where the project file should be saved on disk. Select whether a new directory with the project name should be created in that location.

+
+
+

3.13.2. Project Explorer

+

The Project Explorer window allows you to inspect and manage the current project. It shows the project name as well as all Items (profile reports and other files) associated with it. Right-click on any entry to see further actions, such as adding, removing or grouping items. Type in the Search project toolbar at the top to filter the currently shown entries.

+
+../_images/projects-explorer.png +
+

Project Explorer

+
+
+
+
+
+

3.14. Visual Profiler Transition Guide

+

This guide provides tips for moving from Visual Profiler to NVIDIA Nsight Compute. NVIDIA Nsight Compute tries to provide as much parity as possible with Visual Profiler’s kernel profiling features, but some functionality is now covered by different tools.

+
+

3.14.1. Trace

+

NVIDIA Nsight Compute does not support tracing GPU or API activities on an accurate timeline. This functionality is covered by NVIDIA Nsight Systems. In the Interactive Profile Activity, the API Stream tool window provides a stream of recent API calls on each thread. However, since all tracked API calls are serialized by default, it does not collect accurate timestamps.

+
+
+

3.14.2. Sessions

+

Instead of sessions, NVIDIA Nsight Compute uses Projects to launch and gather connection details and collected reports.

+
    +
  • Executable and Import Sessions

    +

    Use the Project Explorer or the Main Menu to create a new project. Reports collected from the command line, i.e. using NVIDIA Nsight Compute CLI, can be opened directly using the main menu. In addition, you can use the Project Explorer to associate existing reports as well as any other artifacts such as executables, notes, etc., with the project. Note that those associations are only references; in other words, moving or deleting the project file on disk will not update its artifacts.

    +

    nvprof or command-line profiler output files, as well as Visual Profiler sessions, cannot be imported into NVIDIA Nsight Compute.

    +
  • +
+
+
+

3.14.3. Timeline

+

Since trace analysis is now covered by Nsight Systems, NVIDIA Nsight Compute does not provide views of the application timeline. The API Stream tool window does show a per-thread stream of the last captured CUDA API calls. However, those are serialized and do not maintain runtime concurrency or provide accurate timing information.

+
+
+

3.14.4. Analysis

+
    +
  • Guided Analysis

    +

    All trace-based analysis is now covered by NVIDIA Nsight Systems. This means that NVIDIA Nsight Compute does not include analysis regarding concurrent CUDA streams or (for example) UVM events. For per-kernel analysis, NVIDIA Nsight Compute provides recommendations based on collected performance data on the Details Page. These rules currently require you to collect the required metrics via their sections up front, and do not support partial on-demand profiling.

    +

    To use the rule-based recommendations, enable the respective rules in the Metric Selection. Before profiling, enable Apply Rules in the Profile Options, or click the Apply Rules button in the report afterward.

    +
  • +
  • Unguided Analysis

    +

    All trace-based analysis is now covered by Nsight Systems. For per-kernel analysis, Python-based rules provide analysis and recommendations. See Guided Analysis above for more details.

    +
  • +
  • PC Sampling View

    +

    Source-correlated PC sampling information can now be viewed in the Source Page. Aggregated warp states are shown on the Details Page in the Warp State Statistics section.

    +
  • +
  • Memory Statistics

    +

    Memory Statistics are located on the Details Page. Enable the Memory Workload Analysis sections to collect the respective information.

    +
  • +
  • NVLink View

    +

    NVLink topology diagram and NVLink property table are located on the Details Page. Enable the NVLink Topology and NVLink Table sections to collect the respective information.

    +

    Refer to the Known Issues section for the limitations related to NVLink.

    +
  • +
  • Source-Disassembly View

    +

    Source correlated with PTX and SASS disassembly is shown on the Source Page. Which information is available depends on your application’s compilation/JIT flags.

    +
  • +
  • GPU Details View

    +

    NVIDIA Nsight Compute does not automatically collect data for each executed kernel, and it does not collect any data for device-side memory copies. Summary information for all profiled kernel launches is shown on the Summary Page. Comprehensive information on all collected metrics for all profiled kernel launches is shown on the Raw Page.

    +
  • +
  • CPU Details View

    +

    CPU callstack sampling is now covered by NVIDIA Nsight Systems.

    +
  • +
  • OpenACC Details View

    +

    OpenACC performance analysis with NVIDIA Nsight Compute is available to limited extent. OpenACC parallel regions are not explicitly recognized, but CUDA kernels generated by the OpenACC compiler can be profiled as regular CUDA kernels. See the NVIDIA Nsight Systems release notes to check its latest support status.

    +
  • +
  • OpenMP Details View

    +

    OpenMP performance analysis is not supported by NVIDIA Nsight Compute. See the NVIDIA Nsight Systems release notes to check its latest support status.

    +
  • +
  • Properties View

    +

    NVIDIA Nsight Compute does not collect CUDA API and GPU activities and their properties. Performance data for profiled kernel launches is reported (for example) on the Details Page.

    +
  • +
  • Console View

    +

    NVIDIA Nsight Compute does not currently collect stdout/stderr application output.

    +
  • +
  • Settings View

    +

    Application launch settings are specified in the Connection Dialog. For reports collected from the UI, launch settings can be inspected on the Session Page after profiling.

    +
  • +
  • CPU Source View

    +

    Source for CPU-only APIs is not available. Source for profiled GPU kernel launches is shown on the Source Page.

    +
  • +
+
+
+

3.14.5. Command Line Arguments

+

Please execute ncu-ui with the -h parameter within a shell window to see the currently supported command line arguments for the NVIDIA Nsight Compute UI.

+

To open a collected profile report with ncu-ui, simply pass the path to the report file as a parameter to the shell command.

+
+
+
+

3.15. Visual Studio Integration Guide

+

This guide provides information on using NVIDIA Nsight Compute within Microsoft Visual Studio, using the NVIDIA Nsight Integration Visual Studio extension, allowing for a seamless development workflow.

+
+

3.15.1. Visual Studio Integration Overview

+

NVIDIA Nsight Integration is a Visual Studio extension that allows you to access the power of NVIDIA Nsight Compute from within Visual Studio.

+

When NVIDIA Nsight Compute is installed along with NVIDIA Nsight Integration, NVIDIA Nsight Compute activities will appear under the NVIDIA ‘Nsight’ menu in the Visual Studio menu bar. These activities launch NVIDIA Nsight Compute with the current project settings and executable.

+

For more information about using NVIDIA Nsight Compute from within Visual Studio, please visit

+ +

Notices

+

Notices

+

ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, “MATERIALS”) ARE BEING PROVIDED “AS IS.” NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.

+

Information furnished is believed to be accurate and reliable. However, NVIDIA Corporation assumes no responsibility for the consequences of use of such information or for any infringement of patents or other rights of third parties that may result from its use. No license is granted by implication of otherwise under any patent rights of NVIDIA Corporation. Specifications mentioned in this publication are subject to change without notice. This publication supersedes and replaces all other information previously supplied. NVIDIA Corporation products are not authorized as critical components in life support devices or systems without express written approval of NVIDIA Corporation.

+

Trademarks

+

NVIDIA and the NVIDIA logo are trademarks or registered trademarks of NVIDIA Corporation in the U.S. and other countries. Other company and product names may be trademarks of the respective companies with which they are associated.

+
+
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/NsightComputeCli/index.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/NsightComputeCli/index.html new file mode 100644 index 0000000000000000000000000000000000000000..789b0a0b75c658c895765e1a09f052a26cf63665 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/NsightComputeCli/index.html @@ -0,0 +1,2306 @@ + + + + + + + + + 4. Nsight Compute CLI — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • 4. Nsight Compute CLI
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

4. Nsight Compute CLI

+

The User Guide for Nsight Compute CLI.

+
+

4.1. Introduction

+

NVIDIA Nsight Compute CLI (ncu) provides a non-interactive way to profile applications from the command line. It can print the results directly on the command line or store them in a report file. It can also be used to simply launch the target application (see General for details) and later attach with NVIDIA Nsight Compute or another ncu instance.

+

For users migrating from nvprof to NVIDIA Nsight Compute, please additionally see the Nvprof Transition Guide for comparison of features and workflows.

+
+
+

4.2. Quickstart

+
    +
  1. Launch the target application with the command line profiler

    +

    The command line profiler launches the target application, instruments the target API, and collects profile results for the specified kernels. The CLI executable is called ncu. A shortcut with this name is located in the base directory of the NVIDIA Nsight Compute installation. The actual executable is located in the folder target\windows-desktop-win7-x64 on Windows or target/linux-desktop-glibc_2_11_3-x64 on Linux. By default, NVIDIA Nsight Compute is installed in /usr/local/cuda-<cuda-version>/NsightCompute-<version> on Linux and in C:\Program Files\NVIDIA Corporation\Nsight Compute <version> on Windows.

    +

    To collect the basic set for all kernel launches in the target application, launch:

    +
    $ ncu -o profile CuVectorAddMulti.exe
    +
    +
    +

    The application runs in instrumented mode and for each kernel launch, a profile result is created. The results are written by default to profile.nsight-cuprof. Each output from the compute profiler starts with ==PROF== The other lines are output from the application itself. For each profiled kernel, the name of the kernel function and the progress of data collection is shown. To collect all requested profile information, it may be required to replay the kernels multiple times. The total number of replay passes per kernel is shown after profiling has completed.

    +
    [Vector addition of 1144477 elements]
    +==PROF== Connected to process 5268
    +Copy input data from the host memory to the CUDA device
    +CUDA kernel launch A with 4471 blocks of 256 threads
    +==PROF== Profiling "vectorAdd_A" - 0: 0%....50%....100% - 46 passes
    +CUDA kernel launch B with 4471 blocks of 256 threads
    +==PROF== Profiling "vectorAdd_B" - 1: 0%....50%....100% - 46 passes
    +Copy output data from the CUDA device to the host memory
    +Done
    +==PROF== Disconnected from process 5268
    +==PROF== Report: profile.ncu-rep
    +
    +
    +
  2. +
  3. Customizing data collection

    +

    Options are available to specify for which kernels data should be collected. -c limits the number of kernel launches collected. -s skips the given number of kernels before data collection starts. -k allows you to filter the kernels by a regex match of their names. --kernel-id allows you to filter kernels by context, stream, name and invocation, similar to nvprof.

    +

    To limit what should be collected for each kernel launch, specify the exact *.section (files) by their identifier using --section. Each section file defines a set of metrics to be collected, grouped logically to solve a specific performance question. By default, the sections associated with the basic set are collected. Use --list-sets to see the list of currently available sets. Use --list-sections to see the list of currently available sections. The default search directory and location of pre-defined section files is also called sections/. See the Profiling Guide for more details.

    +

    Alternatively, you can collect a set of individual metrics using --metrics. The available metrics can be queried using --query-metrics. For an explanation of the naming conventions and structuring of metrics, see Metrics Structure.

    +

    Most metrics in NVIDIA Nsight Compute are named using a base name and various suffixes, e.g. sm__throughput.avg.pct_of_peak_sustained_elapsed. The base name is sm__throughput and the suffix is avg.pct_of_peak_sustained_elapsed. This is because most metrics follow the same structure and have the same set of suffixes. You need to pass the base or full name to NVIDIA Nsight Compute when selecting a metric for profiling. Use --query-metrics-mode suffix --metrics <metrics list> to see the full names for the chosen metrics.

    +

    Some additional metrics do not follow this structured naming. They are documented in the Metrics Reference.

    +
  4. +
  5. Changing command line output

    +

    By default, a temporary file is used to store profiling results, and data is printed to the command line. To permanently store the profiler report, use -o to specify the output filename.

    +

    Besides storing results in a report file, the command line profiler can print results using different pages. Those pages correspond to the respective pages in the UI’s report. By default, the Details page is printed, if no explicit output file is specified. To select a different page or print in addition to storing in an explicit file, use the --page=<Page> command. Currently, the following pages are supported: details, raw, source.

    +

    Use --csv to make any output comma separated and easier to process further. See Console Output for further options, e.g. summary views.

    +
  6. +
  7. Open the report in the UI

    +

    The UI executable is called ncu-ui. A shortcut with this name is located in the base directory of the NVIDIA Nsight Compute installation. The actual executable is located in the folder host\windows-desktop-win7-x64 on Windows or host/linux-desktop-glibc_2_11_3-x64 on Linux. In the UI window, close the Connection dialog and open the report file through File > Open, by dragging the report file into NVIDIA Nsight Compute.

    +

    You can also specify the report file as a command line parameter to the executable, i.e. as ncu-ui <MyReport.ncu-rep>. Alternatively, when using NVIDIA Nsight Compute CLI on a platform with host support, --open-in-ui can be used directly with ncu to open a collected report in the user interface.

    +

    The report opens in a new document window. For more information about the report, see the Profiler Report for collecting profile information through NVIDIA Nsight Compute.

    +
  8. +
+
+
+

4.3. Usage

+
+

4.3.1. Modes

+

Modes change the fundamental behavior of the command line profiler. Depending on which mode is chosen, different Command Line Options become available. For example, Launch is invalid if the Attach mode is selected.

+
    +
  • Launch-and-attach: The target application is launched on the local system with the tool’s injection libraries. Depending on which profiling options are chosen, selected kernels in the application are profiled and the results printed to the console or stored in a report file. The tool exits once the target application finishes or crashes, and once all results are processed.

    +

    This is the default, and the only mode that supports profiling of child processes on selected platforms.

    +
  • +
  • Launch: The target application is launched on the local system with the tool’s injection libraries. As soon as the first intercepted API call is reached (commonly cuInit()), all application threads are suspended. The application now expects a tool to attach for profiling. You can attach using NVIDIA Nsight Compute or using the command line profiler’s Attach mode.

  • +
  • Attach: The tool tries to connect to a target application previously launched using NVIDIA Nsight Compute or using the command line profiler’s Launch mode. The tool can attach to a target on the local system or using a remote connection.

  • +
+
+
+

4.3.2. Multi-Process Support

+

NVIDIA Nsight Compute CLI supports profiling multi-process applications on the following platforms: x86_64 Windows, x86_64 Linux, DRIVE OS Linux, DRIVE OS QNX, PowerPC. See the Launch options on how to enable this feature.

+

On x86_64 Windows, NVIDIA Nsight Compute CLI supports profiling 64-bit processes launched from 32-bit applications by default . On x86_64 Linux, launching from 32-bit applications requires you to enable the support-32bit option, and the required 32-bit libraries must be installed on your system. On DRIVE OS Linux, DRIVE OS QNX and PowerPC, tracking of 32-bit applications is not supported. Profiling of 32-bit processes is not supported on any platform.

+
+
Profiling MPI applications is a special case of multi-process profiling.
+
+

NVIDIA Nsight Compute CLI can be used to profile applications launched with the mpirun command.

+
    +
  • To profile all ranks on a node and store all the profiling data in a single report file:

    +
    ncu --target-processes all -o <report-name> mpirun [mpi arguments] <app> [app arguments]
    +
    +
    +
  • +
  • To profile multi-node submissions, one instance of NVIDIA Nsight Compute CLI can be used per node. Ensure that you specify unique report files per rank.

    +
    mpirun [mpi arguments] ncu -o report_%q{OMPI_COMM_WORLD_RANK} <app> [app arguments]
    +
    +
    +
  • +
  • To profile a single rank one can use a wrapper script. The following script (called “wrap.sh”) profiles rank 0 only:

    +
    #!/bin/bash
    +if [[ $OMPI_COMM_WORLD_RANK == 0 ]]; then
    +   ncu -o report_${OMPI_COMM_WORLD_RANK}  --target-processes all "$@"
    +else
    +   "$@"
    +fi
    +
    +
    +

    and then execute:

    +
    mpirun [mpi arguments] ./wrap.sh <app> [app arguments]
    +
    +
    +
  • +
+
+
+

4.3.3. Output Pages

+

The command line profiler supports printing results to the console using various pages. Each page has an equivalent in NVIDIA Nsight Compute’s Profiler Report. In the command line profiler, they are slightly adapted to fit console output. To select a page, use the --page option. By default, the details page is used. Note that if --page is not used but --export is, no results will be printed to the console.

+
    +
  • Details: This page represents NVIDIA Nsight Compute’s Details page. For every profiled kernel launch, each collected is printed as section as a three-column table, followed by any rule results applied to this section. Rule results not associated with any section are printed after the kernel’s sections.

    +

    The first section table column shows the metric name. If the metric was given a label in the section, it is used instead. The second column shows the metric unit, if available. The third column shows the unit value. Both metric unit and value are automatically adjusted to the most fitting order of magnitude. By default, only metrics defined in section headers are shown. This can be changed by passing the --details-all option on the command line.

    +

    Some metrics will show multiple values, separated by “;”, e.g. memory_l2_transactions_global Kbytes 240; 240; 240; 240; 240. Those are instanced metrics, which have one value per represented instance. An instance can be a streaming multiprocessor, an assembly source line, etc.

    +
  • +
  • Raw: This page represents NVIDIA Nsight Compute’s Raw page. For every profiled kernel launch, each collected metric is printed as a three-column table. Besides metrics from sections, this includes automatically collected metrics such as device attributes and kernel launch information.

    +

    The first column shows the metric name. The second and third columns show the metric unit and value, respectively. Both metric unit and value are automatically adjusted to the most fitting order of magnitude. No unresolved regex:, group:, or breakdown: metrics are included.

    +
  • +
+
+
+

4.3.4. Profile Import

+

Using the --import option, saved reports can be imported into the command line profiler. When using this flag, most other options are not available, except for certain result filterting options. They are marked as such in the Profile options table.

+
+
+

4.3.5. Metrics and Units

+

When available and applicable, metrics are shown along with their unit. This is to make it apparent if a metric represents cycles, threads, bytes/s, and so on.

+

By default, units are scaled automatically so that metric values are shown with a reasonable order of magnitude. Units are scaled using their SI-factors, i.e. byte-based units are scaled using a factor of 1000 and the prefixes K, M, G, etc. Time-based units are also scaled using a factor of 1000, with the prefixes n, u and m. This scaling can be changed using a command line option, see Console Output options for details.

+
+
+

4.3.6. NVTX Filtering

+
+
--nvtx-include <configuration> --nvtx-exclude <configuration>
+
These options are used to profile only those kernels which satisfy the conditions mentioned in the configuration. Through these options, you can choose which kernel falls into a specific range or collection of ranges.
+
+

You can use both options multiple times, mentioning all the --nvtx-include configurations followed by all --nvtx-exclude configurations. NVTX filtering requires --nvtx option.

+

NVTX ranges are of two types: NvtxRangeStart/End and NvtxRangePush/Pop. The configuration syntax for both the types are briefly described below. +Both range and domain names can contain whitespace. Note that “Domain” and “range” in below example are for illustration purposes only and are not required to mark domain or range names.

+
    +
  • Push-Pop Ranges

    + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Quantifier

    Description

    Example

    /

    Delimiter between range names. When only a single range name is +given, the delimiter must be appended to indicate that this +refers to a push/pop range.

    A_range/

    +

    A_range/B range

    +

    A_range/\*/B range

    +

    [

    Range is at the bottom of the stack

    [A_range

    +

    [A_range/+/Range Z

    +

    ]

    Range is at the top of the stack

    Range Z]

    +

    Range C/\*/Range Z]

    +
      +
    • +
    +

    Only one B rangeetween the two other ranges

    B range/+/Range D

    *

    Zero or more range(s) between the two other ranges

    B range/\*/Range Z

    @

    Specify domain name. If not mentioned, assuming <default domain>

    Domain-A@A_range

    +

    Domain B@A_range/\*/Range Z]

    +
    +

    Include kernels wrapped inside push/pop range ‘A_range’ of ‘<default-domain>’:

    +
    ncu --nvtx --nvtx-include "A_range/" CuNvtx.exe
    +
    +
    +

    Include kernels wrapped inside push/pop range ‘A_range’ of ‘Domain-A’:

    +
    ncu --nvtx --nvtx-include "Domain-A@A_range/" CuNvtx.exe
    +
    +
    +

    Include kernels wrapped inside push/pop range ‘A_range’ of ‘<default domain>’, where ‘A_range’ is at the bottom of the stack:

    +
    ncu --nvtx --nvtx-include "[A_range" CuNvtx.exe
    +
    +
    +

    Include kernels wrapped inside push/pop ranges ‘A_range’ and ‘B range’ of ‘<default domain>’, with zero or many ranges between them:

    +
    ncu --nvtx --nvtx-include "A_range/*/B range" CuNvtx.exe
    +
    +
    +

    Exclude kernels wrapped inside push/pop ranges ‘A_range’ and ‘B range’ of ‘<default domain>’, with zero or many ranges between them:

    +
    ncu --nvtx --nvtx-exclude "A_range/*/B range" CuNvtx.exe
    +
    +
    +

    Include kernels wrapped inside only push/pop range ‘A_range’ of ‘<default domain>’ but not inside ‘B range’ at the top of the stack:

    +
    ncu --nvtx --nvtx-include "A_range/" --nvtx-exclude "B range]" CuNvtx.exe
    +
    +
    +
  • +
  • Start-End Ranges

    + +++++ + + + + + + + + + + + + + + + + +

    Quantifier

    Description

    Example

    ,

    Delimiter between range names

    A_range,B range

    +

    B range,A_range,Range C

    +

    @

    Specify domain name. If not mentioned, assuming <default domain>

    Domain-A@A_range

    +

    Domain B@B range,Range Z

    +
    +

    Include kernels wrapped inside start/end range ‘A_range’ of ‘Domain-A’:

    +
    ncu --nvtx --nvtx-include "Domain-A@A_range" CuNvtx.exe
    +
    +
    +

    Include kernels wrapped inside both start/end ranges, ‘A_range’ and ‘B range’ of ‘<default domain>’:

    +
    ncu --nvtx --nvtx-include "A_range,B range" CuNvtx.exe
    +
    +
    +

    Include kernels wrapped inside start/end ranges, ‘A_range’ or ‘B range’ of ‘<default domain>’:

    +
    ncu --nvtx --nvtx-include "A_range" --nvtx-include "B range" CuNvtx.exe
    +
    +
    +

    Include all kernels, except those which are wrapped inside start/end range ‘A_range’ of ‘<default domain>’:

    +
    ncu --nvtx --nvtx-exclude "A_range" CuNvtx.exe
    +
    +
    +

    Include kernels wrapped inside only start/end ‘B range’ and not ‘A_range’ of ‘<default domain>’:

    +
    ncu --nvtx --nvtx-include "B range"--nvtx-exclude "A_range" CuNvtx.exe
    +
    +
    +
  • +
  • Regular Expression Support

    +

    The configuration syntax for both the types NvtxRangeStart/End and NvtxRangePush/Pop is the same. Additionally, to use regular expressions, follow the following syntax.

    +
      +
    • Provide prefix ‘regex:’ to treat nvtx config as regular expression.

      +
      ncu --nvtx --nvtx-include "regex:Domain[A-Z]@Range[0-9]/" CuNvtx.exe
      +
      +
      +
      +
      The kernels wrapped inside push/pop range with matching regex ‘Range[0-9]’ of domain with matching regex ‘Domain[A-Z]’ are profiled.
      +
      +
    • +
    • Provide ‘/’ as a prefix to “[” or “]” only for the range part of the config if “[” or “]” is at the start or at the end of the range part, respectively. This is needed so that NCU can distinguish if “[” or “]” is part of the regex or represents the top/bottom of the stack.

      +
      ncu --nvtx --nvtx-include "regex:[0-9]domainA@/[0-9]rangeA,RangeC[0-9/]" CuNvtx.exe
      +
      +
      +
      +
      The kernels wrapped inside start/end ranges with matching regex ‘[0-9]rangeA’ and ‘RangeC[0-9]’ of domain with matching regex ‘[0-9]domainA’ are profiled.
      +
      +
    • +
    • If any quantifier is part of the domain/range name, you need to use ‘\\’ or ‘\’ as a prefix. For the “$” quantifier, only the ‘\\’ prefix is valid.

    • +
    +
  • +
  • Additional Information

    +
    --nvtx-include DomainA@RangeA,DomainB@RangeB //Not a valid config
    +
    +
    +

    In a single NVTX configuration, multiple ranges with regard to a single domain can be specified. Mentioning ranges from different domains inside a single NVTX config is not supported.

    +
    --nvtx-include "A_range\[i\]"
    +
    +
    +

    Quantifiers ‘@’ ‘,’ ‘[’ ‘]’ ‘/’ ‘*’ ‘+’ can be used in range names using prefix ‘\’. The kernels wrapped inside ‘A_range[i]’ of ‘<default domain>’ in the application are profiled.

    +
    --nvtx-include "A_range"  //Start/End configuration
    +--nvtx-inlcude "A_range/" //Push/Pop configuration
    +--nvtx-inlcude "A_range]" //Push/Pop configuration
    +
    +
    +

    If the domain/range name contains ‘\’, you need to provide ‘\\\\’ in the config.

    +

    Do not use ‘\\\\’ before any quantifier.

    +

    Including/Excluding only single range for Push/Pop configuration without specifying stack frame position ‘[’ or ‘]’, use ‘/’ quantifier at the end.

    +
    --nvtx-include "A_range/*/B range"
    +
    +
    +

    The order in which you mention Push/Pop configurations is important. In the above example, ‘A_range’ should be below ‘B range’ in the stack of ranges so that the kernel is profiled.

    +

    NVTX filtering honors cudaProfilerStart() and cudaProfilerStop(). There is no support for ranges with no name.

    +
  • +
+
+
+

4.3.7. Config File

+
+
Using the --config-file on/off option, parsing parameters from config file can be enabled or disabled.
+
Using the --config-file-path <path> option, default path and name of config file can be overwritten.
+
By default, config-file with name config.ncu-cfg is searched in the current working directory, $HOME/.config/NVIDIA Corporation on Linux and %APPDATA%\NVIDIA Corporation\ on Windows. If a valid config file is found, ncu parses the file and initializes any command line parameters to the values set in the file. If the same command line parameter is also set explicitly during the current invocation, the latter takes precedence.
+
+

Parameters can be set under various general modes and ncu command line parameters are used to determine which general-mode needs to be parsed from the config file. See the table below for more details.

+ ++++ + + + + + + + + + + + + + + + + + + + + + + + + + +

Command line parameters

General Mode

ncu –mode launch-and-attach CuVectorAddMulti.exe

Launch-and-attach

ncu –mode launch CuVectorAddMulti.exe

Launch

ncu –mode attach

Attach

ncu –list-sets, ncu –list-sections, ncu –list-rules and ncu –list-metrics

List

ncu –query-metrics

Query

ncu -i <MyReport.ncu-rep>

Import

+

These general modes should be defined in the config file using INI-like syntax as:

+
[<general-mode>]
+<parameter>=<value>
+;<comments>
+
+
+

Sample usage

+
[Launch-and-attach]
+-c = 1
+--section = LaunchStats, Occupancy
+[Import]
+--open-in-ui
+-c = 1
+--section = LaunchStats, Occupancy
+
+
+

From this configuration, ncu will parse parameters set under [Launch-and-attach] block whenever an application is profiled in launch-and-attach mode. In the same manner, parameters set under [Import] block will be parsed whenever a report is imported. Different modes can be clubbed together if there exists a set of parameters which is common to each mode. Sample shown above can be rewritten after clubbing both modes as:

+
[Launch-and-attach, import]
+-c = 1
+--section = LaunchStats, Occupancy
+[Import]
+--open-in-ui
+
+
+

Additional points

+
    +
  • Options like --open-in-ui do not expect any value to be set. These options should not be passed any value.

  • +
  • Options like --section can be passed multiple times in the command line. These options should be written only once under a general-mode with all required values seperated by comma as shown below. Explicitly setting values for these options will not overwrite the config file values. Instead, all values will be composed together and set to the option.

    +
    [<general-mode>]
    +<parameter>=<value1>,<value2>,...
    +
    +
    +
  • +
+
+
+
+

4.4. Command Line Options

+

For long command line options, passing a unique initial substring can be sufficient.

+
+

4.4.1. General

+ + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 1. General Command Line Options

Option

Description

Default

h,help

Show help message

v,version

Show version information

mode

Select the mode of interaction with the target application

+
    +
  • launch-and-attach: Launch the target application and immediately attach for profiling.

  • +
  • launch: Launch the target application and suspend in the first intercepted API call, wait for tool to attach.

  • +
  • attach: Attach to a previously launched application to which no other tool is attached.

  • +
+

launch-and-attach

p,port

Base port used for connecting to target applications for --mode launch/attach

49152

max-connections

Maximum number of ports for connecting to target applications

64

config-file

Use config.ncu-cfg config file to set parameters. Searches in the current working directory, in “$HOME/.config/NVIDIA Corporation” on Linux and in “%APPDATA%\NVIDIA Corporation\” on Windows.

on

config-file-path

Override the default path for config file.

+
+
+

4.4.2. Launch

+ + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 2. Launch Command Line Options

Option

Description

Default

check-exit-code

Check the application exit code and print an error if it is different than 0. If set, --replay-mode application will stop after the first pass if the exit code is not 0.

yes

injection-path-64

Override the default path for the injection libraries. The injection libraries are used by the tools to intercept relevant APIs (like CUDA or NVTX).

preload-library

Prepend a shared library to be loaded by the application before the injection libraries. This option can be given multiple times and the libraries will be loaded in the order they were specified.

call-stack

Enable CPU Call Stack collection.

false

nvtx

Enable NVTX support for tools.

false

target-processes

Select the processes you want to profile. Available modes are:

+
    +
  • application-only Profile only the root application process.

  • +
  • all Profile the application and all its child processes.

  • +
+

all

target-processes-filter

Set the comma separated expressions to filter which processes are profiled.

+
    +
  • <process name> Set the exact process name to include for profiling.

  • +
  • regex:<expression> Set the regex to filter matching process name profiling. On shells that recognize regular expression symbols as special characters (e.g. Linux bash), +the expression needs to be escaped with quotes, e.g. --target-processes-filter regex:".*Process".

    +

    When using regex:, the expression must not include any commas.

    +
  • +
  • exclude:<process name> Set the exact process name to exclude for profiling.

  • +
  • exclude-tree:<process name> Set the exact process name to exclude for profiling and further process tracking. None of its child processes will be profiled, even if they match a positive filter. +This option is not available on Windows.

  • +
+

The executable name part of the process will be considered in the match. Processing of filters stops at the first match. +If any positive filter is specified, no process that is not matching a positive filter is profiled.

+

Examples

+

--target-processes-filter MatrixMul Filter all processes having executable name exactly as “MatrixMul”.

+

--target-processes-filter regex:MatrixFilter all processes that include the string “Matrix” in their executable name, e.g. “MatrixMul” and “MatrixAdd”.

+

--target-processes-filter MatrixMul,MatrixAddFilter all processes having executable name exactly as “MatrixMul” or “MatrixAdd”.

+

--target-processes-filter exclude:MatrixMul.exe Exclude only “MatrixMul.exe”.

+

--target-processes-filter exclude-tree:ChildLauncher,ParentProcess Exclude “ChildLauncher” and all its sub-processes. +Include (only) “ParentProcess”, but not if it’s a child of “ChildLauncher”.

+

support-32bit

Support profiling processes launched from 32-bit applications. This option is only available on x86_64 Linux. On Windows, tracking 32-bit applications is enabled by default.

no

null-stdin

Launch the application with ‘/dev/null’ as its standard input. This avoids applications reading from standard input being stopped by SIGTTIN signals and hanging when running as backgrounded processes.

false

+
+
+

4.4.3. Attach

+ + +++++ + + + + + + + + + + + + +
Table 3. Attach Command Line Options

Option

Description

Default

hostname

Set the hostname or IP address for connecting to the machine on which the target application is running. When attaching to a local target application, use 127.0.0.1.

127.0.0.1

+
+
+

4.4.4. Profile

+ + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 4. Profile Command Line Options

Option

Description

Default/Examples

devices

List the GPU devices to enable profiling on, separated by comma. 1

All devices

+

Examples

+

--devices 0,2

+

filter-mode

Set the filtering mode for kernel launches. Available modes:

+
    +
  • global: Apply provided launch filters on kernel launches collectively.

  • +
  • per-gpu: Apply provided launch filters on kernel launches separately on each device. Effective launch filters for this mode are --launch-count and --launch-skip

  • +
  • per-launch-config: Apply kernel filters and launch filters on kernel launches separately for each GPU launch parameter i.e. Grid Size, Block Size and Shared Memory.

  • +
+

global

kernel-id

Set the identifier to use for matching kernels. If the kernel does not match the identifier, it will be ignored for profiling.

+

The identifier must be of the following format: context-id:stream-id:[name-operator:]kernel-name:invocation-nr

+
    +
  • context-id is the CUDA context ID or regular expression to match the NVTX name.

  • +
  • stream-id is the CUDA stream ID or regular expression to match the NVTX name.

  • +
  • name-operator is an optional operator to kernel-name. Currently, regex is the only supported operator.

  • +
  • kernel-name is the expression to match the kernel name. By default, this is a full, literal match to what is specified by --kernel-name-base. When specifying the optional regex name operator, this is a partial regular expression match to what is specified by --kernel-name-base.

  • +
  • invocation-nr is the N’th invocation of this kernel function. Multiple invocations can also be specified using regular expressions.

  • +
+

If the context/stream ID is a positive number, it will be strictly matched against the CUDA context/stream ID. Otherwise it will be treated as a regular expression and matched against the context/stream name specified using the NVTX library. 1

+

Examples

+

--kernel-id ::foo:2 For kernel “foo”, match the second invocation.

+

--kernel-id :::".*5|3" For all kernels, match the third invocation, and all for which the invocation number ends in “5”.

+

--kernel-id ::regex:^.*foo$: Match all kernels ending in “foo”.

+

--kernel-id ::regex:^(?!foo): Match all kernels except those starting with “foo”. Note that depending on your OS and shell, ` +you might need to quote the expression, e.g. using single quotes in Linux bash: --kernel-id ::regex:'^(?!foo)':

+

--kernel-id 1:2::7 Match all seventh kernel invocations on context 1, stream 2.

+

k,kernel-name

Set the expression to use when matching kernel names.

+
    +
  • <kernel name> Set the kernel name for an exact match.

  • +
  • regex:<expression> Set the regex to use for matching the kernel name. On shells that recognize regular expression symbols as special characters (e.g. Linux bash), the expression needs to be escaped with quotes, e.g. --kernel-name regex:".*Foo".

  • +
+

If the kernel name or the provided expression do not match, it will be ignored for profiling. 1

+

Examples

+

-k foo Match all kernels named exactly “foo”.

+

-k regex:foo Match all kernels that include the string “foo”, e.g. “foo” and “fooBar”.

+

-k regex:"foo|bar" Match all kernels including the strings “foo” or “bar”, e.g. “foo”, “foobar”, “_bar2”.

+

kernel-name-base

Set the basis for --kernel-name, and --kernel-id kernel-name. 1 Options are:

+
    +
  • function: Function name without parameters, templates etc. e.g. dmatrixmul

  • +
  • demangled: Demangled function name, including parameters, templates, etc. e.g. dmatrixmul(float*,int,int)

  • +
  • mangled: Mangled function name. e.g. _Z10dmatrixmulPfiiS_iiS_

  • +
+

function

c,launch-count

Limit the number of profiled kernel launches. The count is only incremented for launches that match the kernel filters.1

s,launch-skip

Set the number of kernel launches to skip before starting to profile kernels. The number takes into account only launches that match the kernel filters. 1

0

launch-skip-before-match

Set the number of kernel launches to skip before starting to profile. The count is incremented for all launches, regardless of the kernel filters. 1

0

range-filter

Filter to profile specified instance(s) of matching NVTX ranges or start/stop ranges created through cu(da)ProfilerStart/Stop APIs.

+

Specify in format [yes/no/on/off]:[start/stop range instance(s)]:[NVTX range instance(s)]

+
    +
  • [yes/no/on/off] : default is ‘no/off’. If set to ‘yes/on’ then NVTX range numbering starts from 1 inside every start/stop range.

  • +
  • provide numbers in regex form e.g, [2-4] or 2|3|4 to profile 2nd, 3rd and 4th instance of the matching range.

  • +
  • NVTX range numbers will be counted for matching range provided using –nvtx-include.

  • +
+

Examples

+

--range-filter :2:3 --nvtx-include A/ Match 2nd start/stop range and also 3rd NVTX push/pop range A in the app.

+

--range-filter yes:2:3 --nvtx-include A/ Match 3rd NVTX push/pop range A from 2nd start/stop range.

+

kill

Terminate the target application when the requested –launch-count was profiled. Allowed values:

+
    +
  • on/off

  • +
  • yes/no

  • +
+

no

replay-mode

Mechanism used for replaying a kernel launch multiple times to collect all requested profiling data:

+
    +
  • kernel: Replay individual kernel launches “transparently” during the execution of the application. See Kernel Replay for more details.

  • +
  • application: Relaunch the entire application multiple times. Requires deterministic program execution. See Application Replay for more details.

  • +
  • range: Replay ranges of CUDA API calls and kernel launches “transparently” during the execution of the application. Ranges must be defined using cu(da)ProfilerStart/Stop API pairs or NVTX expressions. See Range Replay for more details.

  • +
  • app-range: Profile ranges without API capture by relaunching the entire application multiple times. Requires deterministic program execution. Ranges must be defined using ``cu(da)ProfilerStart/Stop`` API pairs or `NVTX expressions <index.html#nvtx-filtering>`__. See `Application Range Replay <../ProfilingGuide/index.html#application-range-replay>`__ for more details.

  • +
+

kernel

app-replay-buffer

Application replay buffer location.

+
    +
  • file: Replay pass data is buffered in a temporary file. The report is created after profiling completed. This mode is more scalable, as the amount of required memory does not scale with the number of profiled kernels.

  • +
  • memory: Replay pass data is buffered in memory, and the report is created while profiling. This mode can result in better performance if the filesystem is slow, but the amount of required memory scales with the number of profiled kernels.

  • +
+

file

app-replay-match

Application replay kernel matching strategy. For all options, kernels are matched on a per-process and per-device (GPU) basis. Below options are used to configure the applied strategy in more detail.

+
    +
  • name: Kernels are matched in the following order: 1. (mangled) name, 2. order of execution

  • +
  • grid: Kernels are matched in the following order: 1. (mangled) name, 2. CUDA grid/block size, 3. order of execution

  • +
  • all: Kernels are matched in the following order: 1. (mangled) name, 2. CUDA grid/block size, 3. CUDA context ID, 4. CUDA stream ID, 5. order of execution

  • +
+

grid

app-replay-mode

Application replay kernel matching mode:

+
    +
  • strict: Requires all kernels to match across all replay passes.

  • +
  • relaxed: Produces results only for kernels that could be matched across replay passes.

  • +
+

strict

range-replay-options

Range replay options, separated by comma. Below options are supported:

+
    +
  • enable-greedy-sync

    +

    Insert ctx sync for applicable deferred APIs during capture.

    +
  • +
  • disable-host-restore

    +

    Disable restoring device-written host allocations.

    +
  • +
+

none

graph-profiling

CUDA graph profiling mode:

+
    +
  • node

    +

    Profile individual kernel nodes as regular CUDA kernels.

    +
  • +
  • graph

    +

    Profile entire graphs as one workload (but disable profiling of individual graph kernel nodes). See the Kernel Profiling Guide for more information on this mode.

    +
  • +
+

node

list-sections

List all sections found in the searched section folders and exit.

section

Add a section identifier to collect in one of the following ways:

+
    +
  • <section identifier> Set the section identifier for an exact match.

  • +
  • regex:<expression> Regular expression allows matching full section identifier. For example, .*Stats, matches all sections ending with ‘Stats’. On shells that recognize regular expression symbols as special characters (e.g. Linux bash), the expression needs to be escaped with quotes, e.g. --section "regex:.*Stats".

  • +
+

This option is ignored when used with --import and --page raw or --page source. 1

+

If no --section options are given, the sections associated with the basic set are collected. If no sets are found, all sections are collected.

section-folder

Add a non-recursive search path for .section files. Section files in this folder will be made available to the --section option.

If no --section-folder options are given, the sections folder is added by default.

section-folder-recursive

Add a recursive search path for .section files. Section files in this folder and all folders below will be made available to the --section option.

If no --section-folder options are given, the sections folder is added by default.

list-rules

List all rules found in the searched section folders and exit.

apply-rules

Apply active and applicable rules to each profiling result. Use --rule to limit which rules to apply. Allowed values:

+
    +
  • on/off

  • +
  • yes/no

  • +
+

yes

rule

Add a rule identifier to apply. Implies --apply-rules yes.

If no --rule options are given, all applicable rules in the sections folder are applied.

import-source

If available from -lineinfo, correlated CUDA source files are permanently imported into the report. Allowed values:

+
    +
  • on/off

  • +
  • yes/no

  • +
+

Use --source-folders option to provide missing source files.

+

no

source-folders

Add comma separated recursive search paths for missing CUDA source files to import into the report.

list-metrics

List all metrics collected from active sections. If the list of active sections is restricted using the --section option, only metrics from those sections will be listed.

query-metrics

Query available metrics for the devices on system. Use --devices and --chips to filter which devices to query. Note that by default, listed metric names need to be appended a valid suffix in order for them to become valid metrics. See --query-metrics-mode for how to get the list of valid suffixes, or check the Kernel Profiling Guide.

query-metrics-mode

Set the mode for querying metrics. Implies --query-metrics. Available modes:

+
    +
  • base: Only the base names of the metrics.

  • +
  • suffix: Suffix names for the base metrics. This gives the list of all metrics derived from the base metrics. Use --metrics to specify the base metrics to query.

  • +
  • all: Full names for all metrics. This gives the list of all base metrics and their suffix metrics.

  • +
+

base

query-metrics-collection

Set which metric collection kind to query. Implies --query-metrics. Available collections:

+
    +
  • profiling: Query metrics available for profiling.

  • +
  • pmsampling: Query metrics available for PM sampling.

  • +
+

profiling

metrics

Specify all metrics to be profiled, separated by comma. If no --section options are given, only the temporary section containing all metrics listed using this option is collected. If --section options are given in addition to --metrics, all metrics from those sections and from --metrics are collected.

+

Names passed to this option support the following prefixes:

+
    +
  • regex:<expression> expands to all metrics that partially match the expression. Enclose the regular expression in ^…$ to force a full match.

  • +
  • group:<name> lists all metrics of the metric group with that name. See section files for valid group names.

  • +
  • breakdown:<metric> expands to the input metrics of the high-level throughput metric.

  • +
  • pmsampling:<metric> collects the metric using PM sampling. Only single-pass metrics that don’t require SASS-patching (_sass_) are supported. Using this prefix adds a timeline element to the report’s details page.

  • +
+

Combining multiple prefixes is not supported.

+

If a metric requires a suffix to be valid, and neither regex: nor group: are used, this option automatically expands the name to all available first-level sub-metrics.

+

When importing a report, :group and :breakdown are not supported.

+

When using regex:, the expression must not include any commas. 1

+

disable-extra-suffixes

Disable the collection of extra suffixes (avg, min, max, sum) for all metrics. Only collect what is explicity specified.

list-chips

List all supported chips that can be used with --chips.

chips

Specify the chips for querying metrics, separated by comma.

Examples

+

--chips gv100,tu102

+

profile-from-start

Set if application should be profiled from its start. Allowed values:

+
    +
  • on/off

  • +
  • yes/no

  • +
+

yes

disable-profiler-start-stop

Disable profiler start/stop. When enabled, cu(da)ProfilerStart/Stop API calls are ignored.

quiet

Suppress all profiling output.

verbose

Make profiler output more verbose.

cache-control

Control the behavior of the GPU caches during profiling. Allowed values:

+
    +
  • all: All GPU caches are flushed before each kernel replay iteration during profiling. While metric values in the execution environment of the application might be slightly different without invalidating the caches, this mode offers the most reproducible metric results across the replay passes and also across multiple runs of the target application.

  • +
  • none: No GPU caches are flushed during profiling. This can improve performance and better replicates the application behavior if only a single kernel replay pass is necessary for metric collection. However, some metric results will vary depending on prior GPU work, and between replay iterations. This can lead to inconsistent and out-of-bounds metric values.

  • +
+

all

clock-control

Control the behavior of the GPU clocks during profiling. Allowed values:

+
    +
  • base: GPC and memory clocks are locked to their respective base frequency during profiling. This has no impact on thermal throttling. Note that actual clocks might still vary, depending on the level of driver support for this feature. As an alternative, use nvidia-smi to lock the clocks externally and set this option to none.

  • +
  • none: No GPC or memory frequencies are changed during profiling.

  • +
  • reset: Reset GPC and memory clocks for all or the selected devices and exit. Use if a previous, killed execution of ncu left the GPU clocks in a locked state.

  • +
+

base

nvtx-include

Adds an include statement to the NVTX filter, which allows selecting kernels to profile based on NVTX ranges. 1

nvtx-exclude

Adds an exclude statement to the NVTX filter, which allows selecting kernels to profile based on NVTX ranges. 1

+
+
1(1,2,3,4,5,6,7,8,9,10,11)
+

This filtering option is available when using --import.

+
+
+
+
+

4.4.5. PM Sampling

+

These options apply to PM sampling. See here for options used in warp state sampling.

+ + +++++ + + + + + + + + + + + + + + + + + + + + +
Table 5. PM Sampling Command Line Options

Option

Description

Default

pm-sampling-interval

Set the PM sampling interval in cycles or ns (depending on the architecture), or determine dynamically when 0.

0 (auto)

pm-sampling-buffer-size

Set the size of the device-sided allocation for PM sampling in bytes, or determine dynamically when 0.

0 (auto)

pm-sampling-max-passes

Set the maximum number of passes used for PM sampling, or determine dynamically when 0.

0 (auto)

+
+
+

4.4.6. Warp Sampling

+ + +++++ + + + + + + + + + + + + + + + + + + + + +
Table 6. Warp Sampling Command Line Options

Option

Description

Default

warp-sampling-interval

Set the sampling period in the range of [0..31]. The actual frequency is 2 ^ (5 + value) cycles. If set to ‘auto’, the profiler tries to automatically determine a high sampling frequency without skipping samples or overflowing the output buffer.

auto

warp-sampling-max-passes

Set maximum number of passes used for sampling (see the Kernel Profiling Guide for more details on profiling overhead).

5

warp-sampling-buffer-size

Set the size of the device-sided allocation for samples in bytes.

32*1024*1024

+
+
+

4.4.7. File

+ + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 7. File Command Line Options

Option

Description

Default

log-file

Send all tool output to the specified file, or one of the standard channels. The file will be overwritten. If the file doesn’t exist, a new one will be created.”stdout” as the whole file name indicates standard output channel (stdout). “stderr” as the whole file name indicates standard error channel (stderr).”

If --log-file is not set , profile results will be printed on the console.

o,export

Set the output file for writing the profile report. If not set, a temporary file will be used which is removed afterwards. The specified name supports macro expansion. See File Macros for more details.

If --export is set and no --page option is given, no profile results will be printed on the console.

f,force-overwrite

Force overwriting all output files.

By default, the profiler won’t overwrite existing output files and show an error instead.

i,import

Set the input file for reading the profile results.

open-in-ui

Open report in UI instead of showing result on terminal. (Only available on host platforms)

section-folder-restore

Restores stock files to the default section folder or the folder specified by an accompanying –section-folder option. If the operation will overwrite modified files then the –force-overwrite option is required.

+
+
+

4.4.8. Console Output

+ + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 8. Console Output Command Line Options

Option

Description

Default

csv

Use comma-separated values as console output. Implies –print-units base by default.

page

Select the report page to print console output for. Available pages are:

+
    +
  • details Show results grouped as sections, include rule results. Some metrics that are collected by default (e.g. device attributes) are omitted if not specified explicitly in any section or using --metrics.

  • +
  • raw Show all collected metrics by kernel launch.

  • +
  • source Show source. See --print-source to select the source view.

  • +
  • session Show launch settings, session info, process info and device attributes.

  • +
+

details. If no --page option is given and --export is set, no results are printed to the console output.

print-source

Select the source view:

+
    +
  • sass Show SASS (assembly) instructions for each kernel launch.

  • +
  • ptx Show PTX source of every cubin whose at least one kernel is profiled.

  • +
  • cuda Show entire CUDA-C source file which has kernel code as per kernel launch. CLI shows CUDA source only if file exists on the host machine.

  • +
  • cuda,sass Show SASS CUDA-C source correlation for each kernel launch. CLI shows CUDA source only if file exists on the host machine.

  • +
+

Metric correlation with source is available in sass, and cuda,sass source view. Metrics specified with --metrics and specified section file with --section are correlated. Consider restricting the number of selected metrics such that values fit into a single output row.

+

sass

resolve-source-file

Resolve CUDA source file in the --page source output. Provide comma separated files full path.

print-details

Select which part of a section should be shown in the details page output:

+
    +
  • header Show all metrics from header of the section.

  • +
  • body Show all metrics from body of the section.

  • +
  • all Show all metrics from the section.

  • +
+

Replaces deprecated option --details-all.

+

header

print-metric-name

Select one of the option to show it in the Metric Name column:

+
    +
  • label Show metric label.

  • +
  • name Show metric name.

  • +
  • label-name Show both metric label and metric name.

  • +
+

label

print-units

Select the mode for scaling of metric units. Available modes are:

+
    +
  • auto Show all metrics automatically scaled to the most fitting order of magnitude.

  • +
  • base Show all metrics in their base unit.

  • +
+

auto

print-fp

Show all numeric metrics in the console output as floating point numbers.

false

print-kernel-base

Set the basis for kernel name output. See --kernel-regex-base for options.

demangled

print-metric-instances

Set output mode for metrics with instance values:

+
    +
  • none Only show GPU aggregate value.

  • +
  • values Show GPU aggregate followed by all instance values.

  • +
+

none

print-nvtx-rename

Select how NVTX should be used for renaming:

+
    +
  • none Don’t use NVTX for renaming.

  • +
  • kernel Rename kernels with the most recent enclosing NVTX push/pop range.

  • +
+

none

print-rule-details

Print additional details for rule results, such as the triggering metrics. Currently has no effect in CSV mode.

false

print-summary

Select the summary output mode. Available modes are:

+
    +
  • none No summary.

  • +
  • per-gpu Summary for each GPU.

  • +
  • per-kernel Summary for each kernel type.

  • +
  • per-nvtx Summary for each NVTX context.

  • +
+

none

+
+
+

4.4.9. Response File

+

Response files can be specified by adding @FileName to the command line. The file name must immediately follow the @ character. The content of each response file is inserted in place of the corresponding response file option.

+
+
+

4.4.10. File Macros

+

The file name specified with option -o or --export supports the following macro expansions. Occurrences of these macros in the report file name are replaced by the corresponding character sequence. If not specified otherwise, the macros cannot be used as part of the file path.

+ + ++++ + + + + + + + + + + + + + + + + + + + + + + +
Table 9. Macro Expansions

Macro

Description

%h

Expands to the host name of the machine on which the command line profiler is running.

%q{ENV_NAME}

Expands to the content of the variable with the given name ENV_NAME from the environment of the command line profiler.

%p

Expands to the process ID of the command line profiler.

%i

Expands to the lowest unused positive integer number that guarantees the resulting file name is not yet used. This macro can only be used once in the output file name.

%%

Expands to a single % character in the output file name. This macro can be used in the file path and the file name.

+
+
+
+

4.5. Environment Variables

+

The following environment variables can be set before launching NVIDIA Nsight Compute CLI, or the UI, respectively.

+ + +++++ + + + + + + + + + + + + + + + + + + + + +
Table 10. Environment Variables

Name

Description

Default/Values

NV_COMPUTE_PROFILER_DISABLE_STOCK_FILE_DEPLOYMENT

Disable file deployment to the versioned Sections directory, using section and rule files from the stock directory within the installation instead.

+

By default, the versioned directory from the user’s documents folder is used to ensure that any potential user updates are taken into account.

+

Only supported in the NVIDIA Nsight Compute CLI.

+

Default: unset

+

Set to “1” to disable deployment.

+

NV_COMPUTE_PROFILER_LOCAL_CONNECTION_OVERRIDE

Override the default local connection mechanism between frontend and profiled target processes. The default mechanism is platform-dependent. This should only be used if there are connection problems between frontend and target processes in a local launch.

Default: unset (use default mechanism)

+

Set to “uds” to use Unix Domain Socket connections (available on Posix platforms, only). Set to “tcp” to use TCP (available on all platforms). Set to “named-pipes” to use Windows Named Pipes (available on Windows, only).

+

NV_COMPUTE_PROFILER_DISABLE_SW_PRE_PASS

Disable the instruction-level software (SW) metric pre-pass. When collecting SW-patched metrics, such as inst_executed, the pre-pass is used to determine which functions are executed as part of the kernel and should be patched. This requires a separate replay pass, and if only instruction-level SW metrics are to be collected, prevents single-pass data collection. Disabling the pre-pass can improve performance if memory save-and-restore is undesirable and application replay is not possible.

Default: unset (use pre-pass when applicable)

+

Set to “1” to disable pre-pass.

+
+
+
+

4.6. Nvprof Transition Guide

+

This guide provides tips for moving from nvprof to NVIDIA Nsight Compute CLI. NVIDIA Nsight Compute CLI tries to provide as much feature and usage parity as possible with nvprof, but some features are now covered by different tools and some command line options have changed their name or meaning.

+
+

4.6.1. Trace

+
    +
  • GPU and API trace

    +

    NVIDIA Nsight Compute CLI does not support any form of tracing GPU or API activities. This functionality is covered by NVIDIA Nsight Systems.

    +
  • +
+
+
+

4.6.2. Metric Collection

+
    +
  • Finding available metrics

    +

    For nvprof, you can use --query-metrics to see the list of metrics available for the current devices on your machine. You can also use --devices to filter which local devices to query. For NVIDIA Nsight Compute CLI, this functionality is the same. However, in addition, you can combine --query-metrics with --chip [chipname] to query the available metrics for any chip, not only the ones in your present CUDA devices.

    +

    Note that metric names have changed between nvprof and NVIDIA Nsight Compute CLI and metric names also differ between chips after (and including) GV100 and those before. See Metric Comparison for a comparison of nvprof and NVIDIA Nsight Compute metric names.

    +

    On Volta and newer GPUs, most metrics are named using a base name and various suffixes, e.g. sm__throughput.avg.pct_of_peak_sustained_elapsed. The base name is sm__throughput and the suffix is avg.pct_of_peak_sustained_elapsed. This is because most metrics follow the same structure and have the same set of suffixes. You need to pass the full name to NVIDIA Nsight Compute when selecting a metric for profiling.

    +

    To reduce the number of metrics shown for Volta and newer GPUs when using --query-metrics, by default only the base names are shown. Use --query-metrics-mode suffix --metrics <metrics list> to see the full names for the chosen metrics. Use --query-metrics-mode all to see all metrics with their full name directly.

    +
  • +
  • Selecting which metrics to collect

    +

    In both nvprof and NVIDIA Nsight Compute CLI, you can specify a comma-separated list of metric names to the --metrics option. While nvprof would allow you to collect either a list or all metrics, in NVIDIA Nsight Compute CLI you can use regular expressions to select a more fine-granular subset of all available metrics. For example, you can use --metrics "regex:.*" to collect all metrics, or --metrics "regex:smsp__cycles_elapsed" to collect all “smsp__cycles_elapsed” metrics.

    +
  • +
  • Selecting which events to collect

    +

    You cannot collect any events in NVIDIA Nsight Compute CLI.

    +
  • +
  • Selecting which section to collect

    +

    In nvprof, you can either collect individual metrics or events, or a pre-configured set (all, analysis-metrics). NVIDIA Nsight Compute CLI adds the concept of a section. A section is a file that describes which metrics to collect for which GPU architecture, or architecture range. Furthermore, it defines how those metrics will be shown in both the command line output or the user interface. This includes structuring in tables, charts, histograms etc.

    +

    NVIDIA Nsight Compute CLI comes with a set of pre-defined sections, located in the sections directory. You can inspect, modify or extend those, as well as add new ones, e.g. to easily collect recurring metric sets. Each section specifies a unique section identifier, and there must not be two sections with the same identifier in the search path.

    +

    By default, the sections associated with the basic section set are collected. You can select one or more individual sections using the --section [section identifier] option one or more times. If no --section option is given, but --metrics is used, no sections will be collected.

    +
  • +
  • Selecting which section set to collect

    +

    In nvprof, you can either collect individual metrics or events, or a pre-configured set (all, analysis-metrics). NVIDIA Nsight Compute CLI adds the concept of section sets. A section set defines a group of sections to collect together, in order to achieve different profiling overheads, depending on the required analysis level of detail.

    +

    If no other options are selected, the basic section set is collected. You can select one or more sets using the --set [set identifier] option one or more times. If no --set option is given, but --section or --metrics is used, no sets will be collected.

    +
  • +
+
+
+

4.6.3. Metric Comparison

+

NVIDIA Nsight Compute uses two groups of metrics, depending on which GPU architecture is profiled. For nvprof metrics, the following table lists the equivalent metrics in NVIDIA Nsight Compute, if available. For a detailed explanation of the structuring of PerfWorks metrics, see Metrics Structure.

+

Metrics starting with sm__& are collected per-SM. Metrics starting with *smsp__ are collected per-SM subpartition. However, all corresponding nvprof events are collected per-SM, only. Check the Metrics Guide for more details on these terms.

+ + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 11. Metrics Mapping Table from CUPTI to PerfWorks

nvprof Metric

PerfWorks Metric or Formula (>= SM 7.0)

achieved_occupancy

sm__warps_active.avg.pct_of_peak_sustained_active

atomic_transactions

l1tex__t_set_accesses_pipe_lsu_mem_global_op_atom.sum + l1tex__t_set_accesses_pipe_lsu_mem_global_op_red.sum

atomic_transactions_per_request

(l1tex__t_sectors_pipe_lsu_mem_global_op_atom.sum + l1tex__t_sectors_pipe_lsu_mem_global_op_red.sum) / (l1tex__t_requests_pipe_lsu_mem_global_op_atom.sum + l1tex__t_requests_pipe_lsu_mem_global_op_red.sum)

branch_efficiency

smsp__sass_average_branch_targets_threads_uniform.pct

cf_executed

smsp__inst_executed_pipe_cbu.sum + smsp__inst_executed_pipe_adu.sum

cf_fu_utilization

n/a

cf_issued

n/a

double_precision_fu_utilization

smsp__inst_executed_pipe_fp64.avg.pct_of_peak_sustained_active

dram_read_bytes

dram__bytes_read.sum

dram_read_throughput

dram__bytes_read.sum.per_second

dram_read_transactions

dram__sectors_read.sum

dram_utilization

dram__throughput.avg.pct_of_peak_sustained_elapsed

dram_write_bytes

dram__bytes_write.sum

dram_write_throughput

dram__bytes_write.sum.per_second

dram_write_transactions

dram__sectors_write.sum

eligible_warps_per_cycle

smsp__warps_eligible.sum.per_cycle_active

flop_count_dp

smsp__sass_thread_inst_executed_op_dadd_pred_on.sum + smsp__sass_thread_inst_executed_op_dmul_pred_on.sum + smsp__sass_thread_inst_executed_op_dfma_pred_on.sum * 2

flop_count_dp_add

smsp__sass_thread_inst_executed_op_dadd_pred_on.sum

flop_count_dp_fma

smsp__sass_thread_inst_executed_op_dfma_pred_on.sum

flop_count_dp_mul

smsp__sass_thread_inst_executed_op_dmul_pred_on.sum

flop_count_hp

smsp__sass_thread_inst_executed_op_hadd_pred_on.sum + smsp__sass_thread_inst_executed_op_hmul_pred_on.sum + smsp__sass_thread_inst_executed_op_hfma_pred_on.sum * 2

flop_count_hp_add

smsp__sass_thread_inst_executed_op_hadd_pred_on.sum

flop_count_hp_fma

smsp__sass_thread_inst_executed_op_hfma_pred_on.sum

flop_count_hp_mul

smsp__sass_thread_inst_executed_op_hmul_pred_on.sum

flop_count_sp

smsp__sass_thread_inst_executed_op_fadd_pred_on.sum + smsp__sass_thread_inst_executed_op_fmul_pred_on.sum + smsp__sass_thread_inst_executed_op_ffma_pred_on.sum * 2

flop_count_sp_add

smsp__sass_thread_inst_executed_op_fadd_pred_on.sum

flop_count_sp_fma

smsp__sass_thread_inst_executed_op_ffma_pred_on.sum

flop_count_sp_mul

smsp__sass_thread_inst_executed_op_fmul_pred_on.sum

flop_count_sp_special

n/a

flop_dp_efficiency

smsp__sass_thread_inst_executed_ops_dadd_dmul_dfma_pred_on.avg.pct_of_peak_sustained_elapsed

flop_hp_efficiency

smsp__sass_thread_inst_executed_ops_hadd_hmul_hfma_pred_on.avg.pct_of_peak_sustained_elapsed

flop_sp_efficiency

smsp__sass_thread_inst_executed_ops_fadd_fmul_ffma_pred_on.avg.pct_of_peak_sustained_elapsed

gld_efficiency

smsp__sass_average_data_bytes_per_sector_mem_global_op_ld.pct

gld_requested_throughput

n/a

gld_throughput

l1tex__t_bytes_pipe_lsu_mem_global_op_ld.sum.per_second

gld_transactions

l1tex__t_sectors_pipe_lsu_mem_global_op_ld.sum

gld_transactions_per_request

l1tex__average_t_sectors_per_request_pipe_lsu_mem_global_op_ld.ratio

global_atomic_requests

l1tex__t_requests_pipe_lsu_mem_global_op_atom.sum

global_hit_rate

(l1tex__t_sectors_pipe_lsu_mem_global_op_ld_lookup_hit.sum + l1tex__t_sectors_pipe_lsu_mem_global_op_st_lookup_hit.sum + l1tex__t_sectors_pipe_lsu_mem_global_op_red_lookup_hit.sum + l1tex__t_sectors_pipe_lsu_mem_global_op_atom_lookup_hit.sum) / (l1tex__t_sectors_pipe_lsu_mem_global_op_ld.sum + l1tex__t_sectors_pipe_lsu_mem_global_op_st.sum + l1tex__t_sectors_pipe_lsu_mem_global_op_red.sum + l1tex__t_sectors_pipe_lsu_mem_global_op_atom.sum)

global_load_requests

l1tex__t_requests_pipe_lsu_mem_global_op_ld.sum

global_reduction_requests

l1tex__t_requests_pipe_lsu_mem_global_op_red.sum

global_store_requests

l1tex__t_requests_pipe_lsu_mem_global_op_st.sum

gst_efficiency

smsp__sass_average_data_bytes_per_sector_mem_global_op_st.pct

gst_requested_throughput

n/a

gst_throughput

l1tex__t_bytes_pipe_lsu_mem_global_op_st.sum.per_second

gst_transactions

l1tex__t_sectors_pipe_lsu_mem_global_op_st.sum

gst_transactions_per_request

l1tex__average_t_sectors_per_request_pipe_lsu_mem_global_op_st.ratio

half_precision_fu_utilization

smsp__inst_executed_pipe_fp16.avg.pct_of_peak_sustained_active

inst_bit_convert

smsp__sass_thread_inst_executed_op_conversion_pred_on.sum

inst_compute_ld_st

smsp__sass_thread_inst_executed_op_memory_pred_on.sum

inst_control

smsp__sass_thread_inst_executed_op_control_pred_on.sum

inst_executed

smsp__inst_executed.sum

inst_executed_global_atomics

smsp__sass_inst_executed_op_global_atom.sum

inst_executed_global_loads

smsp__inst_executed_op_global_ld.sum

inst_executed_global_reductions

smsp__inst_executed_op_global_red.sum

inst_executed_global_stores

smsp__inst_executed_op_global_st.sum

inst_executed_local_loads

smsp__inst_executed_op_local_ld.sum

inst_executed_local_stores

smsp__inst_executed_op_local_st.sum

inst_executed_shared_atomics

smsp__inst_executed_op_shared_atom.sum + smsp__inst_executed_op_shared_atom_dot_alu.sum + smsp__inst_executed_op_shared_atom_dot_cas.sum

inst_executed_shared_loads

smsp__inst_executed_op_shared_ld.sum

inst_executed_shared_stores

smsp__inst_executed_op_shared_st.sum

inst_executed_surface_atomics

smsp__inst_executed_op_surface_atom.sum

inst_executed_surface_loads

smsp__inst_executed_op_surface_ld.sum + smsp__inst_executed_op_shared_atom_dot_alu.sum + smsp__inst_executed_op_shared_atom_dot_cas.sum

inst_executed_surface_reductions

smsp__inst_executed_op_surface_red.sum

inst_executed_surface_stores

smsp__inst_executed_op_surface_st.sum

inst_executed_tex_ops

smsp__inst_executed_op_texture.sum

inst_fp_16

smsp__sass_thread_inst_executed_op_fp16_pred_on.sum

inst_fp_32

smsp__sass_thread_inst_executed_op_fp32_pred_on.sum

inst_fp_64

smsp__sass_thread_inst_executed_op_fp64_pred_on.sum

inst_integer

smsp__sass_thread_inst_executed_op_integer_pred_on.sum

inst_inter_thread_communication

smsp__sass_thread_inst_executed_op_inter_thread_communication_pred_on.sum

inst_issued

smsp__inst_issued.sum

inst_misc

smsp__sass_thread_inst_executed_op_misc_pred_on.sum

inst_per_warp

smsp__average_inst_executed_per_warp.ratio

inst_replay_overhead

n/a

ipc

smsp__inst_executed.avg.per_cycle_active

issue_slot_utilization

smsp__issue_active.avg.pct_of_peak_sustained_active

issue_slots

smsp__inst_issued.sum

issued_ipc

smsp__inst_issued.avg.per_cycle_active

l2_atomic_throughput

2 * ( lts__t_sectors_op_atom.sum.per_second + lts__t_sectors_op_red.sum.per_second )

l2_atomic_transactions

2 * ( lts__t_sectors_op_atom.sum + lts__t_sectors_op_red.sum )

l2_global_atomic_store_bytes

lts__t_bytes_equiv_l1sectormiss_pipe_lsu_mem_global_op_atom.sum

l2_global_load_bytes

lts__t_bytes_equiv_l1sectormiss_pipe_lsu_mem_global_op_ld.sum

l2_local_global_store_bytes

lts__t_bytes_equiv_l1sectormiss_pipe_lsu_mem_local_op_st.sum + lts__t_bytes_equiv_l1sectormiss_pipe_lsu_mem_global_op_st.sum

l2_local_load_bytes

lts__t_bytes_equiv_l1sectormiss_pipe_lsu_mem_local_op_ld.sum

l2_read_throughput

lts__t_sectors_op_read.sum.per_second + lts__t_sectors_op_atom.sum.per_second + lts__t_sectors_op_red.sum.per_second 2

l2_read_transactions

lts__t_sectors_op_read.sum + lts__t_sectors_op_atom.sum + lts__t_sectors_op_red.sum 2

l2_surface_load_bytes

lts__t_bytes_equiv_l1sectormiss_pipe_tex_mem_surface_op_ld.sum

l2_surface_store_bytes

lts__t_bytes_equiv_l1sectormiss_pipe_tex_mem_surface_op_st.sum

l2_tex_hit_rate

lts__t_sector_hit_rate.pct

l2_tex_read_hit_rate

lts__t_sector_op_read_hit_rate.pct

l2_tex_read_throughput

lts__t_sectors_srcunit_tex_op_read.sum.per_second

l2_tex_read_transactions

lts__t_sectors_srcunit_tex_op_read.sum

l2_tex_write_hit_rate

lts__t_sector_op_write_hit_rate.pct

l2_tex_write_throughput

lts__t_sectors_srcunit_tex_op_write.sum.per_second

l2_tex_write_transactions

lts__t_sectors_srcunit_tex_op_write.sum

l2_utilization

lts__t_sectors.avg.pct_of_peak_sustained_elapsed

l2_write_throughput

lts__t_sectors_op_write.sum.per_second + lts__t_sectors_op_atom.sum.per_second + lts__t_sectors_op_red.sum.per_second

l2_write_transactions

lts__t_sectors_op_write.sum + lts__t_sectors_op_atom.sum + lts__t_sectors_op_red.sum

ldst_executed

n/a

ldst_fu_utilization

smsp__inst_executed_pipe_lsu.avg.pct_of_peak_sustained_active

ldst_issued

n/a

local_hit_rate

n/a

local_load_requests

l1tex__t_requests_pipe_lsu_mem_local_op_ld.sum

local_load_throughput

l1tex__t_bytes_pipe_lsu_mem_local_op_ld.sum.per_second

local_load_transactions

l1tex__t_sectors_pipe_lsu_mem_local_op_ld.sum

local_load_transactions_per_request

l1tex__average_t_sectors_per_request_pipe_lsu_mem_local_op_ld.ratio

local_memory_overhead

n/a

local_store_requests

l1tex__t_requests_pipe_lsu_mem_local_op_st.sum

local_store_throughput

l1tex__t_sectors_pipe_lsu_mem_local_op_st.sum.per_second

local_store_transactions

l1tex__t_sectors_pipe_lsu_mem_local_op_st.sum

local_store_transactions_per_request

l1tex__average_t_sectors_per_request_pipe_lsu_mem_local_op_st.ratio

nvlink_data_receive_efficiency

n/a

nvlink_data_transmission_efficiency

n/a

nvlink_overhead_data_received

(nvlrx__bytes_data_protocol.sum / nvlrx__bytes.sum) * 100

nvlink_overhead_data_transmitted

(nvltx__bytes_data_protocol.sum / nvltx__bytes.sum) * 100

nvlink_receive_throughput

nvlrx__bytes.sum.per_second

nvlink_total_data_received

nvlrx__bytes.sum

nvlink_total_data_transmitted

nvltx__bytes.sum

nvlink_total_nratom_data_transmitted

n/a

nvlink_total_ratom_data_transmitted

n/a

nvlink_total_response_data_received

n/a

nvlink_total_write_data_transmitted

n/a

nvlink_transmit_throughput

nvltx__bytes.sum.per_second

nvlink_user_data_received

nvlrx__bytes_data_user.sum

nvlink_user_data_transmitted

nvltx__bytes_data_user.sum

nvlink_user_nratom_data_transmitted

n/a

nvlink_user_ratom_data_transmitted

n/a

nvlink_user_response_data_received

n/a

nvlink_user_write_data_transmitted

n/a

pcie_total_data_received

pcie__read_bytes.sum

pcie_total_data_transmitted

pcie__write_bytes.sum

shared_efficiency

smsp__sass_average_data_bytes_per_wavefront_mem_shared.pct

shared_load_throughput

l1tex__data_pipe_lsu_wavefronts_mem_shared_op_ld.sum.per_second

shared_load_transactions

l1tex__data_pipe_lsu_wavefronts_mem_shared_op_ld.sum

shared_load_transactions_per_request

n/a

shared_store_throughput

l1tex__data_pipe_lsu_wavefronts_mem_shared_op_st.sum.per_second

shared_store_transactions

l1tex__data_pipe_lsu_wavefronts_mem_shared_op_st.sum

shared_store_transactions_per_request

n/a

shared_utilization

l1tex__data_pipe_lsu_wavefronts_mem_shared.avg.pct_of_peak_sustained_elapsed

single_precision_fu_utilization

smsp__pipe_fma_cycles_active.avg.pct_of_peak_sustained_active

sm_efficiency

smsp__cycles_active.avg.pct_of_peak_sustained_elapsed

sm_tex_utilization

l1tex__texin_sm2tex_req_cycles_active.avg.pct_of_peak_sustained_elapsed

special_fu_utilization

smsp__inst_executed_pipe_xu.avg.pct_of_peak_sustained_active

stall_constant_memory_dependency

smsp__warp_issue_stalled_imc_miss_per_warp_active.pct

stall_exec_dependency

smsp__warp_issue_stalled_short_scoreboard_per_warp_active.pct + smsp__warp_issue_stalled_wait_per_warp_active.pct

stall_inst_fetch

smsp__warp_issue_stalled_no_instruction_per_warp_active.pct

stall_memory_dependency

smsp__warp_issue_stalled_long_scoreboard_per_warp_active.pct

stall_memory_throttle

smsp__warp_issue_stalled_drain_per_warp_active.pct + smsp__warp_issue_stalled_lg_throttle_per_warp_active.pct

stall_not_selected

smsp__warp_issue_stalled_not_selected_per_warp_active.pct

stall_other

smsp__warp_issue_stalled_dispatch_stall_per_warp_active.pct + smsp__warp_issue_stalled_misc_per_warp_active.pct

stall_pipe_busy

smsp__warp_issue_stalled_math_pipe_throttle_per_warp_active.pct + smsp__warp_issue_stalled_mio_throttle_per_warp_active.pct

stall_sleeping

smsp__warp_issue_stalled_sleeping_per_warp_active.pct

stall_sync

smsp__warp_issue_stalled_barrier_per_warp_active.pct + smsp__warp_issue_stalled_membar_per_warp_active.pct

stall_texture

smsp__warp_issue_stalled_tex_throttle_per_warp_active.pct

surface_atomic_requests

l1tex__t_requests_pipe_tex_mem_surface_op_atom.sum

surface_load_requests

l1tex__t_requests_pipe_tex_mem_surface_op_ld.sum

surface_reduction_requests

l1tex__t_requests_pipe_tex_mem_surface_op_red.sum

surface_store_requests

l1tex__t_requests_pipe_tex_mem_surface_op_st.sum

sysmem_read_bytes

lts__t_sectors_aperture_sysmem_op_read * 32

sysmem_read_throughput

lts__t_sectors_aperture_sysmem_op_read.sum.per_second

sysmem_read_transactions

lts__t_sectors_aperture_sysmem_op_read.sum

sysmem_read_utilization

n/a

sysmem_utilization

n/a

sysmem_write_bytes

lts__t_sectors_aperture_sysmem_op_write * 32

sysmem_write_throughput

lts__t_sectors_aperture_sysmem_op_write.sum.per_second

sysmem_write_transactions

lts__t_sectors_aperture_sysmem_op_write.sum

sysmem_write_utilization

n/a

tensor_precision_fu_utilization

sm__pipe_tensor_op_hmma_cycles_active.avg.pct_of_peak_sustained_active

tensor_precision_int_utilization

sm__pipe_tensor_op_imma_cycles_active.avg.pct_of_peak_sustained_active (SM 7.2+)

tex_cache_hit_rate

l1tex__t_sector_hit_rate.pct

tex_cache_throughput

n/a

tex_cache_transactions

l1tex__lsu_writeback_active.avg.pct_of_peak_sustained_active + l1tex__tex_writeback_active.avg.pct_of_peak_sustained_active

tex_fu_utilization

smsp__inst_executed_pipe_tex.avg.pct_of_peak_sustained_active

tex_sm_tex_utilization

l1tex__f_tex2sm_cycles_active.avg.pct_of_peak_sustained_elapsed

tex_sm_utilization

sm__mio2rf_writeback_active.avg.pct_of_peak_sustained_elapsed

tex_utilization

n/a

texture_load_requests

l1tex__t_requests_pipe_tex_mem_texture.sum

warp_execution_efficiency

smsp__thread_inst_executed_per_inst_executed.ratio

warp_nonpred_execution_efficiency

smsp__thread_inst_executed_per_inst_executed.pct

+
+
2(1,2)
+

Sector reads from reductions are added here only for compatibility to the current definition of the metric in nvprof. Reductions do not cause data to be communicated from L2 back to L1.

+
+
+
+
+

4.6.4. Event Comparison

+

For nvprof events, the following table lists the equivalent metrics in NVIDIA Nsight Compute, if available. For a detailed explanation of the structuring of PerfWorks metrics, see Metrics Structure.

+

Metrics starting with sm__ are collected per-SM. Metrics starting with smsp__ are collected per-SM subpartition. However, all corresponding nvprof events are collected per-SM, only. Check the Metrics Guide for more details on these terms.

+ + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 12. Events Mapping Table from CUPTI Events to PerfWorks Metrics for Compute Capability >= 7.0

nvprof Event

PerfWorks Metric or Formula (>= SM 7.0)

active_cycles

sm__cycles_active.sum

active_cycles_pm

sm__cycles_active.sum

active_cycles_sys

sys__cycles_active.sum

active_warps

sm__warps_active.sum

active_warps_pm

sm__warps_active.sum

atom_count

smsp__inst_executed_op_generic_atom_dot_alu.sum

elapsed_cycles_pm

sm__cycles_elapsed.sum

elapsed_cycles_sm

sm__cycles_elapsed.sum

elapsed_cycles_sys

sys__cycles_elapsed.sum

fb_subp0_read_sectors

dram__sectors_read.sum

fb_subp1_read_sectors

dram__sectors_read.sum

fb_subp0_write_sectors

dram__sectors_write.sum

fb_subp1_write_sectors

dram__sectors_write.sum

global_atom_cas

smsp__inst_executed_op_generic_atom_dot_cas.sum

gred_count

smsp__inst_executed_op_global_red.sum

inst_executed

sm__inst_executed.sum

inst_executed_fma_pipe_s0

smsp__inst_executed_pipe_fma.sum

inst_executed_fma_pipe_s1

smsp__inst_executed_pipe_fma.sum

inst_executed_fma_pipe_s2

smsp__inst_executed_pipe_fma.sum

inst_executed_fma_pipe_s3

smsp__inst_executed_pipe_fma.sum

inst_executed_fp16_pipe_s0

smsp__inst_executed_pipe_fp16.sum

inst_executed_fp16_pipe_s1

smsp__inst_executed_pipe_fp16.sum

inst_executed_fp16_pipe_s2

smsp__inst_executed_pipe_fp16.sum

inst_executed_fp16_pipe_s3

smsp__inst_executed_pipe_fp16.sum

inst_executed_fp64_pipe_s0

smsp__inst_executed_pipe_fp64.sum

inst_executed_fp64_pipe_s1

smsp__inst_executed_pipe_fp64.sum

inst_executed_fp64_pipe_s2

smsp__inst_executed_pipe_fp64.sum

inst_executed_fp64_pipe_s3

smsp__inst_executed_pipe_fp64.sum

inst_issued1

sm__inst_issued.sum

l2_subp0_read_sector_misses

lts__t_sectors_op_read_lookup_miss.sum

l2_subp1_read_sector_misses

lts__t_sectors_op_read_lookup_miss.sum

l2_subp0_read_sysmem_sector_queries

lts__t_sectors_aperture_sysmem_op_read.sum

l2_subp1_read_sysmem_sector_queries

lts__t_sectors_aperture_sysmem_op_read.sum

l2_subp0_read_tex_hit_sectors

lts__t_sectors_srcunit_tex_op_read_lookup_hit.sum

l2_subp1_read_tex_hit_sectors

lts__t_sectors_srcunit_tex_op_read_lookup_hit.sum

l2_subp0_read_tex_sector_queries

lts__t_sectors_srcunit_tex_op_read.sum

l2_subp1_read_tex_sector_queries

lts__t_sectors_srcunit_tex_op_read.sum

l2_subp0_total_read_sector_queries

lts__t_sectors_op_read.sum + lts__t_sectors_op_atom.sum + lts__t_sectors_op_red.sum

l2_subp1_total_read_sector_queries

lts__t_sectors_op_read.sum + lts__t_sectors_op_atom.sum + lts__t_sectors_op_red.sum

l2_subp0_total_write_sector_queries

lts__t_sectors_op_write.sum + lts__t_sectors_op_atom.sum + lts__t_sectors_op_red.sum

l2_subp1_total_write_sector_queries

lts__t_sectors_op_write.sum + lts__t_sectors_op_atom.sum + lts__t_sectors_op_red.sum

l2_subp0_write_sector_misses

lts__t_sectors_op_write_lookup_miss.sum

l2_subp1_write_sector_misses

lts__t_sectors_op_write_lookup_miss.sum

l2_subp0_write_sysmem_sector_queries

lts__t_sectors_aperture_sysmem_op_write.sum

l2_subp1_write_sysmem_sector_queries

lts__t_sectors_aperture_sysmem_op_write.sum

l2_subp0_write_tex_hit_sectors

lts__t_sectors_srcunit_tex_op_write_lookup_hit.sum

l2_subp1_write_tex_hit_sectors

lts__t_sectors_srcunit_tex_op_write_lookup_hit.sum

l2_subp0_write_tex_sector_queries

lts__t_sectors_srcunit_tex_op_write.sum

l2_subp1_write_tex_sector_queries

lts__t_sectors_srcunit_tex_op_write.sum

not_predicated_off_thread_inst_executed

smsp__thread_inst_executed_pred_on.sum

pcie_rx_active_pulse

n/a

pcie_tx_active_pulse

n/a

prof_trigger_00

n/a

prof_trigger_01

n/a

prof_trigger_02

n/a

prof_trigger_03

n/a

prof_trigger_04

n/a

prof_trigger_05

n/a

prof_trigger_06

n/a

prof_trigger_07

n/a

inst_issued0

smsp__issue_inst0.sum

sm_cta_launched

sm__ctas_launched.sum

shared_load

smsp__inst_executed_op_shared_ld.sum

shared_store

smsp__inst_executed_op_shared_st.sum

generic_load

smsp__inst_executed_op_generic_ld.sum

generic_store

smsp__inst_executed_op_generic_st.sum

global_load

smsp__inst_executed_op_global_ld.sum

global_store

smsp__inst_executed_op_global_st.sum

local_load

smsp__inst_executed_op_local_ld.sum

local_store

smsp__inst_executed_op_local_st.sum

shared_atom

smsp__inst_executed_op_shared_atom.sum

shared_atom_cas

smsp__inst_executed_op_shared_atom_dot_cas.sum

shared_ld_bank_conflict

l1tex__data_bank_conflicts_pipe_lsu_mem_shared_op_ld.sum

shared_st_bank_conflict

l1tex__data_bank_conflicts_pipe_lsu_mem_shared_op_st.sum

shared_ld_transactions

l1tex__data_pipe_lsu_wavefronts_mem_shared_op_ld.sum

shared_st_transactions

l1tex__data_pipe_lsu_wavefronts_mem_shared_op_st.sum

tensor_pipe_active_cycles_s0

smsp__pipe_tensor_cycles_active.sum

tensor_pipe_active_cycles_s1

smsp__pipe_tensor_cycles_active.sum

tensor_pipe_active_cycles_s2

smsp__pipe_tensor_cycles_active.sum

tensor_pipe_active_cycles_s3

smsp__pipe_tensor_cycles_active.sum

thread_inst_executed

smsp__thread_inst_executed.sum

warps_launched

smsp__warps_launched.sum

+
+
+

4.6.5. Filtering

+
    +
  • Filtering by kernel name

    +

    Both nvprof and NVIDIA Nsight Compute CLI support filtering which kernels’ data should be collected. In nvprof, the option is --kernels and applies to following metric collection options. In NVIDIA Nsight Compute CLI, the option is named --kernel-regex and applies to the complete application execution. In other words, NVIDIA Nsight Compute CLI does not currently support collecting different metrics for different kernels, unless they execute on different GPU architectures.

    +
  • +
  • Filtering by kernel ID

    +

    Nvprof allows users to specify which kernels to profile using a kernel ID description, using the same --kernels option. In NVIDIA Nsight Compute CLI, the syntax for this kernel ID is identical, but the option is named --kernel-id.

    +
  • +
  • Filtering by device

    +

    Both nvprof and NVIDIA Nsight Compute CLI use --devices to filter the devices which to profile. In contrast to nvprof, in NVIDIA Nsight Compute CLI the option applies globally, not only to following options.

    +
  • +
+
+
+

4.6.6. Output

+
    +
  • API trace and summary

    +

    NVIDIA Nsight Compute CLI does not support any form of API-usage related output. No API data is captured during profiling.

    +
  • +
  • Dependency analysis

    +

    NVIDIA Nsight Compute CLI does not support any dependency analysis. No API data is captured during profiling.

    +
  • +
  • GPU trace

    +

    NVIDIA Nsight Compute CLI does not support any GPU trace output. Due to kernel replay during profiling, kernel executions are serialized, and start and end timestamps do not necessarily match those during application execution. In addition, no records for memory activities are recorded.

    +
  • +
  • Print summary

    +

    While nvprof has several command line options to specify which summary information to print, NVIDIA Nsight Compute CLI uses further arguments to the --print-summary options. Profiling data can be summarized per-gpu, per-kernel or per-nvtx context.

    +
  • +
  • Kernel name demangling

    +

    Nvprof allows users to decide between name demangling on or off using the --demangling options. NVIDIA Nsight Compute CLI currently always demangles kernel names in the output. In addition, the option --kernel-regex-base can be used to decide which name format should be used when matching kernel names during filtering.

    +
  • +
  • Pages

    +

    Nvprof has no concept of output pages, all data is shown as a list or summarized. NVIDIA Nsight Compute CLI uses pages to define how data should be structured and printed. Those correspond to the report pages used in the GUI variant. The option --page can be used to select which page to show, and details is selected by default. All pages also support printing in CSV format for easier post-processing, using the --csv option.

    +
  • +
+
+
+

4.6.7. Launch and Attach

+
    +
  • Launching a process for profiling

    +

    In nvprof, the application to profile is passed to the tool as a command line argument. The application must be a local executable. Alternatively, you can choose to use the tool in a daemon mode and profile all applicable processes on the local machine (nvprof option --profile-all-processes). In nvprof, the decision to profile the complete process tree or only the root process is done via the --profile-child-processes flag. In NVIDIA Nsight Compute CLI, the --target-processes option is used for this.

    +

    NVIDIA Nsight Compute CLI has several modes to determine which application to collect data for. By default, the executable passed via the command line to the tool is started, connected to, and profiled. This mode is called launch-and-attach.

    +
  • +
  • Launching a process for attach

    +

    In contrast to nvprof, you can choose to only launch a local executable. In this mode (--mode launch), the process is started, connected to, but then suspended at the first CUDA API call. Subsequently, there is a third mode (--mode attach) to attach to any process launched using the aforementioned mode. In this case, all profiling and output options would be passed to the attaching instance of NVIDIA Nsight Compute CLI.

    +
  • +
  • Remote profiling

    +

    Finally, using launch and attach, you can connect to a launched process on a remote machine, which could even run a different operating system than the local host. Use --hostname to select which remote host to connect to.

    +
  • +
+

Notices

+

Notices

+

ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, “MATERIALS”) ARE BEING PROVIDED “AS IS.” NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.

+

Information furnished is believed to be accurate and reliable. However, NVIDIA Corporation assumes no responsibility for the consequences of use of such information or for any infringement of patents or other rights of third parties that may result from its use. No license is granted by implication of otherwise under any patent rights of NVIDIA Corporation. Specifications mentioned in this publication are subject to change without notice. This publication supersedes and replaces all other information previously supplied. NVIDIA Corporation products are not authorized as critical components in life support devices or systems without express written approval of NVIDIA Corporation.

+

Trademarks

+

NVIDIA and the NVIDIA logo are trademarks or registered trademarks of NVIDIA Corporation in the U.S. and other countries. Other company and product names may be trademarks of the respective companies with which they are associated.

+
+
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/NvRulesAPI/index.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/NvRulesAPI/index.html new file mode 100644 index 0000000000000000000000000000000000000000..629919a22ec17dba5bf3a64fd080b82a5996a0c7 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/NvRulesAPI/index.html @@ -0,0 +1,169 @@ + + + + + + + 2. NvRules API — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • 2. NvRules API
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

2. NvRules API

+

Modules

+

Data Structures

+

Namespaces

+
+
+

Notices

+

Notices

+

ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, “MATERIALS”) ARE BEING PROVIDED “AS IS.” NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.

+

Information furnished is believed to be accurate and reliable. However, NVIDIA Corporation assumes no responsibility for the consequences of use of such information or for any infringement of patents or other rights of third parties that may result from its use. No license is granted by implication of otherwise under any patent rights of NVIDIA Corporation. Specifications mentioned in this publication are subject to change without notice. This publication supersedes and replaces all other information previously supplied. NVIDIA Corporation products are not authorized as critical components in life support devices or systems without express written approval of NVIDIA Corporation.

+

Trademarks

+

NVIDIA and the NVIDIA logo are trademarks or registered trademarks of NVIDIA Corporation in the U.S. and other countries. Other company and product names may be trademarks of the respective companies with which they are associated.

+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ProfilingGuide/index.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ProfilingGuide/index.html new file mode 100644 index 0000000000000000000000000000000000000000..e0dd99240b9e16edd8219c57b7dadb7881d3e203 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ProfilingGuide/index.html @@ -0,0 +1,2542 @@ + + + + + + + + + 2. Kernel Profiling Guide — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • 2. Kernel Profiling Guide
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

2. Kernel Profiling Guide

+

Nsight Compute profiling guide.

+

Kernel Profiling Guide with metric types and meaning, data collection modes and FAQ for common problems.

+
+

2.1. Introduction

+

This guide describes various profiling topics related to NVIDIA Nsight Compute and NVIDIA Nsight Compute CLI. Most of these apply to both the UI and the CLI version of the tool.

+

To use the tools effectively, it is recommended to read this guide, as well as at least the following chapters of the CUDA Programming Guide:

+ +

Afterwards, it should be enough to read the Quickstart chapter of the NVIDIA Nsight Compute or NVIDIA Nsight Compute CLI documentation, respectively, to start using the tools.

+
+

2.1.1. Profiling Applications

+

During regular execution, a CUDA application process will be launched by the user. It communicates directly with the CUDA user-mode driver, and potentially with the CUDA runtime library.

+
+../_images/regular-application-process.png +
+

Regular Application Execution

+
+
+

When profiling an application with NVIDIA Nsight Compute, the behavior is different. The user launches the NVIDIA Nsight Compute frontend (either the UI or the CLI) on the host system, which in turn starts the actual application as a new process on the target system. While host and target are often the same machine, the target can also be a remote system with a potentially different operating system.

+

The tool inserts its measurement libraries into the application process, which allow the profiler to intercept communication with the CUDA user-mode driver. In addition, when a kernel launch is detected, the libraries can collect the requested performance metrics from the GPU. The results are then transferred back to the frontend.

+
+../_images/profiled-process.png +
+

Profiled Application Execution

+
+
+
+
+
+

2.2. Metric Collection

+

Collection of performance metrics is the key feature of NVIDIA Nsight Compute. Since there is a huge list of metrics available, it is often easier to use some of the tool’s pre-defined sets or sections to collect a commonly used subset. Users are free to adjust which metrics are collected for which kernels as needed, but it is important to keep in mind the Overhead associated with data collection.

+
+

2.2.1. Sets and Sections

+

NVIDIA Nsight Compute uses Section Sets (short sets) to decide, on a very high level, the amount of metrics to be collected. Each set includes one or more Sections, with each section specifying several logically associated metrics. For example, one section might include only high-level SM and memory utilization metrics, while another could include metrics associated with the memory units, or the HW scheduler.

+

The number and type of metrics specified by a section has significant impact on the overhead during profiling. To allow you to quickly choose between a fast, less detailed profile and a slower, more comprehensive analysis, you can select the respective section set. See Overhead for more information on profiling overhead.

+

By default, a relatively small number of metrics is collected. Those mostly include high-level utilization information as well as static launch and occupancy data. The latter two are regularly available without replaying the kernel launch. The basic set is collected when no --set, --section and no --metrics options are passed on the command line. The full set of sections can be collected with --set full.

+

Use --list-sets to see the list of currently available sets. Use --list-sections to see the list of currently available sections. The default search directory and the location of pre-defined section files are also called sections/. All related command line options can be found in the NVIDIA Nsight Compute CLI documentation.

+
+
+

2.2.2. Sections and Rules

+ + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 1. Available Sections

Identifier and Filename

Description

ComputeWorkloadAnalysis (Compute Workload Analysis)

Detailed analysis of the compute resources of the streaming multiprocessors (SM), including the achieved instructions per clock (IPC) and the utilization of each available pipeline. Pipelines with very high utilization might limit the overall performance.

InstructionStats (Instruction Statistics)

Statistics of the executed low-level assembly instructions (SASS). The instruction mix provides insight into the types and frequency of the executed instructions. A narrow mix of instruction types implies a dependency on few instruction pipelines, while others remain unused. Using multiple pipelines allows hiding latencies and enables parallel execution.

LaunchStats (Launch Statistics)

Summary of the configuration used to launch the kernel. The launch configuration defines the size of the kernel grid, the division of the grid into blocks, and the GPU resources needed to execute the kernel. Choosing an efficient launch configuration maximizes device utilization.

MemoryWorkloadAnalysis (Memory Workload Analysis)

Detailed analysis of the memory resources of the GPU. Memory can become a limiting factor for the overall kernel performance when fully utilizing the involved hardware units (Mem Busy), exhausting the available communication bandwidth between those units (Max Bandwidth), or by reaching the maximum throughput of issuing memory instructions (Mem Pipes Busy). +Depending on the limiting factor, the memory chart and tables allow to identify the exact bottleneck in the memory system.

NUMA Affinity (NumaAffinity)

Non-uniform memory access (NUMA) affinities based on compute and memory distances for all GPUs.

Nvlink (Nvlink)

High-level summary of NVLink utilization. It shows the total received and transmitted (sent) memory, as well as the overall link peak utilization.

Nvlink_Tables (Nvlink_Tables)

Detailed tables with properties for each NVLink.

Nvlink_Topology (Nvlink_Topology)

NVLink Topology diagram shows logical NVLink connections with transmit/receive throughput.

Occupancy (Occupancy)

Occupancy is the ratio of the number of active warps per multiprocessor to the maximum number of possible active warps. Another way to view occupancy is the percentage of the hardware’s ability to process warps that is actively in use. +Higher occupancy does not always result in higher performance, however, low occupancy always reduces the ability to hide latencies, resulting in overall performance degradation. Large discrepancies between the theoretical and the achieved occupancy during execution typically indicates highly imbalanced workloads.

PM Sampling (PmSampling)

Timeline view of metrics sampled periodically over the workload duration. Data is collected across multiple passes. Use this section to understand how workload behavior changes over its runtime.

PM Sampling: Warp States (PmSampling_WarpStates)

Warp states sampled periodically over the workload duration. Metrics in different groups come from different passes.

SchedulerStats (Scheduler Statistics)

Summary of the activity of the schedulers issuing instructions. Each scheduler maintains a pool of warps that it can issue instructions for. The upper bound of warps in the pool (Theoretical Warps) is limited by the launch configuration. On every cycle each scheduler checks the state of the allocated warps in the pool (Active Warps). +Active warps that are not stalled (Eligible Warps) are ready to issue their next instruction. From the set of eligible warps, the scheduler selects a single warp from which to issue one or more instructions (Issued Warp). On cycles with no eligible warps, the issue slot is skipped and no instruction is issued. Having many skipped issue slots indicates poor latency hiding.

SourceCounters (Source Counters)

Source metrics, including branch efficiency and sampled warp stall reasons. Warp Stall Sampling metrics are periodically sampled over the kernel runtime. They indicate when warps were stalled and couldn’t be scheduled. See the documentation for a description of all stall reasons. Only focus on stalls if the schedulers fail to issue every cycle.

SpeedOfLight (GPU Speed Of Light Throughput)

High-level overview of the throughput for compute and memory resources of the GPU. For each unit, the throughput reports the achieved percentage of utilization with respect to the theoretical maximum. Breakdowns show the throughput for each individual sub-metric of Compute and Memory to clearly identify the highest contributor.

WarpStateStats (Warp State Statistics)

Analysis of the states in which all warps spent cycles during the kernel execution. The warp states describe a warp’s readiness or inability to issue its next instruction. The warp cycles per instruction define the latency between two consecutive instructions. The higher the value, the more warp parallelism is required to hide this latency. +For each warp state, the chart shows the average number of cycles spent in that state per issued instruction. Stalls are not always impacting the overall performance nor are they completely avoidable. Only focus on stall reasons if the schedulers fail to issue every cycle.

+
+
+

2.2.3. Replay

+

Depending on which metrics are to be collected, kernels might need to be replayed one or more times, since not all metrics can be collected in a single pass. For example, the number of metrics originating from hardware (HW) performance counters that the GPU can collect at the same time is limited. In addition, patch-based software (SW) performance counters can have a high impact on kernel runtime and would skew results for HW counters.

+
+

Kernel Replay

+

In Kernel Replay, all metrics requested for a specific kernel instance in NVIDIA Nsight Compute are grouped into one or more passes. For the first pass, all GPU memory that can be accessed by the kernel is saved. After the first pass, the subset of memory that is written by the kernel is determined. Before each pass (except the first one), this subset is restored in its original location to have the kernel access the same memory contents in each replay pass.

+

NVIDIA Nsight Compute attempts to use the fastest available storage location for this save-and-restore strategy. For example, if data is allocated in device memory, and there is still enough device memory available, it is stored there directly. If it runs out of device memory, the data is transferred to the CPU host memory. Likewise, if an allocation originates from CPU host memory, the tool first attempts to save it into the same memory location, if possible.

+

As explained in Overhead, the time needed for this increases the more memory is accessed, especially written, by a kernel. If NVIDIA Nsight Compute determines that only a single replay pass is necessary to collect the requested metrics, no save-and-restore is performed at all to reduce overhead.

+
+../_images/replay-regular-execution.png +
+

Regular Application Execution

+
+
+
+../_images/replay-kernel.png +
+

Execution with Kernel Replay. All memory is saved, and memory written by the kernel is restored in-between replay passes.

+
+
+
+
+

Application Replay

+

In Application Replay, all metrics requested for a specific kernel launch in NVIDIA Nsight Compute are grouped into one or more passes. In contrast to Kernel Replay, the complete application is run multiple times, so that in each run one of those passes can be collected per kernel.

+

For correctly identifying and combining performance counters collected from multiple application replay passes of a single kernel launch into one result, the application needs to be deterministic with respect to its kernel activities and their assignment to GPUs, contexts, streams, and potentially NVTX ranges. Normally, this also implies that the application needs to be deterministic with respect to its overall execution.

+

Application replay has the benefit that memory accessed by the kernel does not need to be saved and restored via the tool, as each kernel launch executes only once during the lifetime of the application process. Besides avoiding memory save-and-restore overhead, application replay also allows to disable Cache Control. This is especially useful if other GPU activities preceding a specific kernel launch are used by the application to set caches to some expected state.

+

In addition, application replay can support profiling kernels that have interdependencies to the host during execution. With kernel replay, this class of kernels typically hangs when being profiled, because the necessary responses from the host are missing in all but the first pass. In contrast, application replay ensures the correct behavior of the program execution in each pass.

+

In contrast to kernel replay, multiple passes collected via application replay imply that all host-side activities of the application are duplicated, too. If the application requires significant time for e.g. setup or file-system access, the overhead will increase accordingly.

+
+../_images/replay-regular-execution.png +
+

Regular Application Execution

+
+
+
+../_images/replay-application.png +
+

Execution with Application Replay. No memory is saved or restored, but the cost of running the application itself is duplicated.

+
+
+

Across application replay passes, NVIDIA Nsight Compute matches metric data for the individual, selected kernel launches. The matching strategy can be selected using the --app-replay-match option. For matching, only kernels within the same process and running on the same device are considered. By default, the grid strategy is used, which matches launches according to their kernel name and grid size. When multiple launches have the same attributes (e.g. name and grid size), they are matched in execution order.

+
+../_images/replay-application-kernel-matching.png +
+

Kernel matching during application replay using the grid strategy.

+
+
+
+
+

Range Replay

+

In Range Replay, all requested metrics in NVIDIA Nsight Compute are grouped into one or more passes. In contrast to Kernel Replay and Application Replay, Range Replay captures and replays complete ranges of CUDA API calls and kernel launches within the profiled application. Metrics are then not associated with individual kernels but with the entire range. This allows the tool to execute kernels without serialization and thereby supports profiling kernels that should be run concurrently for correctness or performance reasons.

+
+../_images/replay-range.png +
+

Execution with Range Replay. An entire range of API calls and kernel launches is captured and replayed. Host and device memory is saved and restored as necessary.

+
+
+
+
Defining Ranges
+

Range replay requires you to specify the range for profiling in the application. A range is defined by a start and an end marker and includes all CUDA API calls and kernels launched between these markers from any CPU thread. The application is responsible for inserting appropriate synchronization between threads to ensure that the anticipated set of API calls is captured. Range markers can be set using one of the following options:

+
    +
  • Profiler Start/Stop API

    +

    Set the start marker using cu(da)ProfilerStart and the end marker using cu(da)ProfilerStop. Note: The CUDA driver API variants of this API require to include cudaProfiler.h. The CUDA runtime variants require to include cuda_profiler_api.h.

    +

    This is the default for NVIDIA Nsight Compute.

    +
  • +
  • NVTX Ranges

    +

    Define the range using an NVTX Include expression. The range capture starts with the first CUDA API call and ends at the last API call for which the expression is matched, respectively. If multiple expressions are specified, a range is defined as soon as any of them matches. Hence, multiple expressions can be used to conveniently capture and profile multiple ranges for the same application execution.

    +

    The application must have been instrumented with the NVTX API for any expressions to match.

    +

    This mode is enabled by passing --nvtx --nvtx-include <expression> [--nvtx-include <expression>] to the NVIDIA Nsight Compute CLI.

    +
  • +
+

Ranges must fulfill several requirements:

+
    +
  • It must be possible to synchronize all active CUDA contexts at the start of the range.

  • +
  • Ranges must not include unsupported CUDA API calls. See Supported APIs for the list of currently supported APIs.

  • +
+

In addition, there are several recommendations that ranges should comply with to guarantee a correct capture and replay:

+
    +
  • Set ranges as narrow as possible for capturing a specific set of CUDA kernel lanuches. The more API calls are included, the higher the potentially created overhead from capturing and replaying these API calls.

  • +
  • Avoid freeing host allocations written by device memory during the range. This includes both heap as well as stack allocations. NVIDIA Nsight Compute does not intercept creation or destruction of generic host (CPU)-based allocations. However, to guarantee correct program execution after any replay of the range, the tool attempts to restore host allocations that were written from device memory during the capture. If these host addresses are invalid or re-assigned, the program behavior is undefined and potentially unstable. In cases where avoiding freeing such allocations is not possible, you should limit profiling to one range using --launch-count 1, set the disable-host-restore range replay option and optionally use --kill yes to terminate the process after this range.

  • +
  • When defining the range markers using cu(da)ProfilerStart/Stop, prefer the CUDA driver API calls cuProfilerStart/Stop. Internally, NVIDIA Nsight Compute only intercepts the CUDA driver API variants and the CUDA runtime API may not trigger these if no CUDA context is active on the calling thread.

  • +
+
+
+
Supported APIs
+

Range replay supports a subset of the CUDA API for capture and replay. This page lists the supported functions as well as any further, API-specific limitations that may apply. If an unsupported API call is detected in the captured range, an error is reported and the range cannot be profiled. The groups listed below match the ones found in the CUDA Driver API documentation.

+

Generally, range replay only captures and replay CUDA Driver API calls. CUDA Runtime APIs calls can be captured when they generate only supported CUDA Driver API calls internally. Deprecated APIs are not supported.

+

Error Handling

+

All supported.

+

Initialization

+

Not supported.

+

Version Management

+

All supported.

+

Device Management

+

All supported, except:

+
    +
  • cuDeviceSetMemPool

  • +
+

Primary Context Management

+
    +
  • cuDevicePrimaryCtxGetState

  • +
+

Context Management

+

All supported, except:

+
    +
  • cuCtxSetCacheConfig

  • +
  • cuCtxSetSharedMemConfig

  • +
+

Module Management

+
    +
  • cuModuleGetFunction

  • +
  • cuModuleGetGlobal

  • +
  • cuModuleGetSurfRef

  • +
  • cuModuleGetTexRef

  • +
  • cuModuleLoad

  • +
  • cuModuleLoadData

  • +
  • cuModuleLoadDataEx

  • +
  • cuModuleLoadFatBinary

  • +
  • cuModuleUnload

  • +
+

Library Management

+

All supported, except:

+
    +
  • cuKernelSetAttribute

  • +
  • cuKernelSetCacheConfig

  • +
+

Memory Management

+
    +
  • cuArray*

  • +
  • cuDeviceGetByPCIBusId

  • +
  • cuDeviceGetPCIBusId

  • +
  • cuMemAlloc

  • +
  • cuMemAllocHost

  • +
  • cuMemAllocPitch

  • +
  • cuMemcpy*

  • +
  • cuMemFree

  • +
  • cuMemFreeHost

  • +
  • cuMemGetAddressRange

  • +
  • cuMemGetInfo

  • +
  • cuMemHostAlloc

  • +
  • cuMemHostGetDevicePointer

  • +
  • cuMemHostGetFlags

  • +
  • cuMemHostRegister

  • +
  • cuMemHostUnregister

  • +
  • cuMemset*

  • +
  • cuMipmapped*

  • +
+

Virtual Memory Management

+

Not supported.

+

Stream Ordered Memory Allocator

+

Not supported.

+

Unified Addressing

+

Not supported.

+

Stream Management

+
    +
  • cuStreamCreate*

  • +
  • cuStreamDestroy

  • +
  • cuStreamGet*

  • +
  • cuStreamQuery

  • +
  • cuStreamSetAttribute

  • +
  • cuStreamSynchronize

  • +
  • cuStreamWaitEvent

  • +
+

Event Management

+

All supported.

+

External Resource interoperability

+

Not supported.

+

Stream Memory Operations

+

Not supported.

+

Execution Control

+
    +
  • cuFuncGetAttribute

  • +
  • cuFuncGetModule

  • +
  • cuFuncSetAttribute

  • +
  • cuFuncSetCacheConfig

  • +
  • cuLaunchCooperativeKernel

  • +
  • cuLaunchHostFunc

  • +
  • cuLaunchKernel

  • +
+

Graph Management

+

Not supported.

+

Occupancy

+

All supported.

+

Texture/Surface Reference Management

+

Not supported.

+

Texture Object Management

+

All supported.

+

Surface Object Management

+

All supported.

+

Peer Context Memory Access

+

Not supported.

+

Graphics Interoperability

+

Not supported.

+

Driver Entry Point Access

+

All supported.

+

Surface Object Management

+

All supported.

+

OpenGL Interoperability

+

Not supported.

+

VDPAU Interoperability

+

Not supported.

+

EGL Interoperability

+

Not supported.

+

Green Contexts

+
    +
  • cuCtxFromGreenCtx

  • +
  • cuGreenCtxCreate

  • +
  • cuGreenCtxDestroy

  • +
  • cuGreenCtxRecordEvent

  • +
  • cuGreenCtxWaitEvent

  • +
  • cuStreamGetGreenCtx

  • +
+
+
+
+

Application Range Replay

+

In Application Range Replay, all requested metrics in NVIDIA Nsight Compute are grouped into one or more passes. Similar to Range Replay, metrics are not associated with individual kernels but with the entire selected range. This allows the tool to execute workloads (kernels, CUDA graphs, …) without serialization and thereby supports profiling workloads that must be run concurrently for correctness or performance reasons.

+

In contrast to Range Replay, the range is not explicitly captured and executed directly for each pass, but instead the entire application is re-run multiple times, with one pass collected for each range in every application execution. This has the benefit that no application state must be observed and captured for each range and API calls within the range do not need to be supported explicitly, as correct execution of the range is handled by the application itself.

+

Defining ranges to profile is identical to Range Replay. The CUDA context for which the range should be profiled must be current to the thread defining the start of the range and must be active for the entire range.

+
+../_images/replay-application-range.png +
+

Execution with Application Range Replay. An range of workloads is replayed by re-running the entire application without modifying interactions or saving and restoring memory.

+
+
+
+
+

Graph Profiling

+

In multiple replay modes, NVIDIA Nsight Compute can profile CUDA graphs as single workload entities, rather than profile individual kernel nodes. The behavior can be toggled in the respective command line or UI options.

+

The primary use cases for enabling this mode are:

+
    +
  • Profile graphs that include mandatory concurrent kernel nodes.

  • +
  • Profile graphs that include device-sided graph launches.

  • +
  • Profile graph behavior more accurately across multiple kernel node launches, as caches are not purged in between nodes.

  • +
+

Note that when graph profiling is enabled, certain metrics such as instruction-level source metrics are not available. This then also applies to kernels profiled outside of graphs.

+
+
+
+

2.2.4. Compatibility

+

The set of available replay modes and metrics depends on the type of GPU workload to profile.

+ + ++++++++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 2. Replay modes and metric compatibility per workload type

Workload Type

Replay Mode

Metric Groups

Kernel

Application

Range

Application-Range

Hardware Counters / SMSP

Unit-Level Source

Instruction-Level Source

Launch

PM Sampling

Kernel

Yes

Yes

Yes 2

Yes 2

Yes

Yes

Yes

Yes

Yes

Range

No

No

Yes

Yes

Yes

No

No

Some

Yes

Cmdlist

Yes

No

No

Yes 2

Yes

Yes

Yes

Some

Yes

Graph 1

Yes

No

No

Yes 2

Yes

No

No

Some

Yes

+

Footnotes

+
+
1
+

Limitations also apply to kernels profiled outside of graphs.

+
+
2(1,2,3,4)
+

Workload type is supported as part of the profiled range, but not separated in the result. Metric support matches that of Range workloads.

+
+
+
+
+

2.2.5. Profile Series

+

The performance of a kernel is highly dependent on the used launch parameters. Small changes to the launch parameters can have a significant effect on the runtime behavior of the kernel. However, identifying the best parameter set for a kernel by manually testing a lot of combinations can be a tedious process.

+

To make this workflow faster and more convenient, Profile Series provide the ability to automatically profile a single kernel multiple times with changing parameters. The parameters to be modified and values to be tested can be independently enabled and configured. For each combination of selected parameter values a unique profile result is collected. And the modified parameter values are tracked in the description of the results of a series. By comparing the results of a profile series, the kernel’s behavior on the changing parameters can be seen and the most optimal parameter set can be identified quickly.

+
+../_images/profile-series-action.png +
+

Profile Series action.

+
+
+
+../_images/profile-series-dialog.png +
+

Profile Series dialog.

+
+
+
+
+

2.2.6. Overhead

+

As with most measurements, collecting performance data using NVIDIA Nsight Compute CLI incurs some runtime overhead on the application. The overhead does depend on a number of different factors:

+
    +
  • Number and type of collected metrics

    +

    Depending on the selected metric, data is collected either through a hardware performance monitor on the GPU, through software patching of the kernel instructions or via a launch or device attribute. The overhead between these mechanisms varies greatly, with launch and device attributes being “statically” available and requiring no kernel runtime overhead.

    +

    Furthermore, only a limited number of metrics can be collected in a single pass of the kernel execution. If more metrics are requested, the kernel launch is replayed multiple times, with its accessible memory being saved and restored between subsequent passes to guarantee deterministic execution. Therefore, collecting more metrics can significantly increase overhead by requiring more replay passes and increasing the total amount of memory that needs to be restored during replay.

    +
  • +
  • The collected section set

    +

    Since each set specifies a group of sections to be collected, choosing a less comprehensive set can reduce profiling overhead. See the --set command in the NVIDIA Nsight Compute CLI documentation.

    +
  • +
  • Number of collected sections

    +

    Since each section specifies a number of metrics to be collected, selecting fewer sections can reduce profiling overhead. See the --section command in the NVIDIA Nsight Compute CLI documentation.

    +
  • +
  • Number of profiled kernels

    +

    By default, all selected metrics are collected for all launched kernels. To reduce the impact on the application, you can try to limit performance data collection to as few kernel functions and instances as makes sense for your analysis. See the filtering commands in the NVIDIA Nsight Compute CLI documentation.

    +

    There is a relatively high one-time overhead for the first profiled kernel in each context to generate the metric configuration. This overhead does not occur for subsequent kernels in the same context, if the list of collected metrics remains unchanged.

    +
  • +
  • GPU Architecture

    +

    For some metrics, the overhead can vary depending on the exact chip they are collected on, e.g. due to varying number of units on the chip. Similarly, the overhead for resetting the L2 cache in-between kernel replay passes depends on the size of that cache.

    +
  • +
+
+
+
+

2.3. Metrics Guide

+
+

2.3.1. Hardware Model

+

Compute Model

+

All NVIDIA GPUs are designed to support a general purpose heterogeneous parallel programming model, commonly known as Compute. This model decouples the GPU from the traditional graphics pipeline and exposes it as a general purpose parallel multi-processor. A heterogeneous computing model implies the existence of a host and a device, which in this case are the CPU and GPU, respectively. At a high level view, the host (CPU) manages resources between itself and the device and will send work off to the device to be executed in parallel.

+

Central to the compute model is the Grid, Block, Thread hierarchy, which defines how compute work is organized on the GPU. The hierarchy from top to bottom is as follows:

+
    +
  • A Grid is a 1D, 2D or 3D array of thread blocks.

  • +
  • A Block is a 1D, 2D or 3D array of threads, also known as a Cooperative Thread Array (CTA).

  • +
  • A Thread is a single thread which runs on one of the GPU’s SM units.

  • +
+

The purpose of the Grid, Block, Thread hierarchy is to expose a notion of locality amongst a group of threads, i.e. a Cooperative Thread Array (CTA). In CUDA, CTAs are referred to as Thread Blocks. The architecture can exploit this locality by providing fast shared memory and barriers between the threads within a single CTA. When a Grid is launched, the architecture guarantees that all threads within a CTA will run concurrently on the same SM. Information on the grids and blocks can be found in the Launch Statistics section.

+

The number of CTAs that fit on each SM depends on the physical resources required by the CTA. These resource limiters include the number of threads and registers, shared memory utilization, and hardware barriers. The number CTAs per SM is referred to as the CTA occupancy, and these physical resources limit this occupancy. Details on the kernel’s occupancy are collected by the Occupancy section.

+

Each CTA can be scheduled on any of the available SMs, where there is no guarantee in the order of execution. As such, CTAs must be entirely independent, which means it is not possible for one CTA to wait on the result of another CTA. As CTAs are independent, the host (CPU) can launch a large Grid that will not fit on the hardware all at once, however any GPU will still be able to run it and produce the correct results.

+

CTAs are further divided into groups of 32 threads called Warps. If the number of threads in a CTA is not dividable by 32, the last warp will contain the remaining number of threads.

+

The total number of CTAs that can run concurrently on a given GPU is referred to as Wave. Consequently, the size of a Wave scales with the number of available SMs of a GPU, but also with the occupancy of the kernel.

+

Streaming Multiprocessor

+

The Streaming Multiprocessor (SM) is the core processing unit in the GPU. The SM is optimized for a wide diversity of workloads, including general-purpose computations, deep learning, ray tracing, as well as lighting and shading. The SM is designed to simultaneously execute multiple CTAs. CTAs can be from different grid launches.

+

The SM implements an execution model called Single Instruction Multiple Threads (SIMT), which allows individual threads to have unique control flow while still executing as part of a warp. The Turing SM inherits the Volta SM’s independent thread scheduling model. The SM maintains execution state per thread, including a program counter (PC) and call stack. The independent thread scheduling allows the GPU to yield execution of any thread, either to make better use of execution resources or to allow a thread to wait for data produced by another thread possibly in the same warp. Collecting the Source Counters section allows you to inspect instruction execution and predication details on the Source Page, along with Sampling information.

+

Each SM is partitioned into four processing blocks, called SM sub partitions. The SM sub partitions are the primary processing elements on the SM. Each sub partition contains the following units:

+
    +
  • Warp Scheduler

  • +
  • Register File

  • +
  • Execution Units/Pipelines/Cores

    +
      +
    • Integer Execution units

    • +
    • Floating Point Execution units

    • +
    • Memory Load/Store units

    • +
    • Special Function unit

    • +
    • Tensor Cores

    • +
    +
  • +
+

Shared within an SM across the four SM partitions are:

+
    +
  • Unified L1 Data Cache / Shared Memory

  • +
  • Texture units

  • +
  • RT Cores, if available

  • +
+

A warp is allocated to a sub partition and resides on the sub partition from launch to completion. A warp is referred to as active or resident when it is mapped to a sub partition. A sub partition manages a fixed size pool of warps. On Volta architectures, the size of the pool is 16 warps. On Turing architectures the size of the pool is 8 warps. Active warps can be in eligible state if the warp is ready to issue an instruction. This requires the warp to have a decoded instruction, all input dependencies resolved, and for the function unit to be available. Statistics on active, eligible and issuing warps can be collected with the Scheduler Statistics section.

+

A warp is stalled when the warp is waiting on

+
    +
  • an instruction fetch,

  • +
  • a memory dependency (result of memory instruction),

  • +
  • an execution dependency (result of previous instruction), or

  • +
  • a synchronization barrier.

  • +
+

See Warp Scheduler States for the list of stall reasons that can be profiled and the Warp State Statistics section for a summary of warp states found in the kernel execution.

+

The most important resource under the compiler’s control is the number of registers used by a kernel. Each sub partition has a set of 32-bit registers, which are allocated by the HW in fixed-size chunks. The Launch Statistics section shows the kernel’s register usage.

+

Memory

+

Global memory is a 49-bit virtual address space that is mapped to physical memory on the device, pinned system memory, or peer memory. Global memory is visible to all threads in the GPU. Global memory is accessed through the SM L1 and GPU L2.

+

Local memory is private storage for an executing thread and is not visible outside of that thread. It is intended for thread-local data like thread stacks and register spills. Local memory addresses are translated to global virtual addresses by the the AGU unit. Local memory has the same latency as global memory. One difference between global and local memory is that local memory is arranged such that consecutive 32-bit words are accessed by consecutive thread IDs. Accesses are therefore fully coalesced as long as all threads in a warp access the same relative address (e.g., same index in an array variable, same member in a structure variable, etc.).

+

Shared memory is located on chip, so it has much higher bandwidth and much lower latency than either local or global memory. Shared memory can be shared across a compute CTA. Compute CTAs attempting to share data across threads via shared memory must use synchronization operations (such as __syncthreads()) between stores and loads to ensure data written by any one thread is visible to other threads in the CTA. Similarly, threads that need to share data via global memory must use a more heavyweight global memory barrier.

+

Shared memory has 32 banks that are organized such that successive 32-bit words map to successive banks that can be accessed simultaneously. Any 32-bit memory read or write request made of 32 addresses that fall in 32 distinct memory banks can therefore be serviced simultaneously, yielding an overall bandwidth that is 32 times as high as the bandwidth of a single request. However, if two addresses of a memory request fall in the same memory bank, there is a bank conflict and the access has to be serialized.

+

A shared memory request for a warp does not generate a bank conflict between two threads that access any address within the same 32-bit word (even though the two addresses fall in the same bank). When multiple threads make the same read access, one thread receives the data and then broadcasts it to the other threads. When multiple threads write to the same location, only one thread succeeds in the write; which thread that succeeds is undefined.

+

Detailed memory metrics are collected by the Memory Workload Analysis section.

+

Caches

+

All GPU units communicate to main memory through the Level 2 cache, also known as the L2. The L2 cache sits between on-chip memory clients and the framebuffer. L2 works in physical-address space. In addition to providing caching functionality, L2 also includes hardware to perform compression and global atomics.

+
+../_images/hw-model-lts.png +
+

Model of the L2 cache.

+
+
+

The Level 1 Data Cache, or L1, plays a key role in handling global, local, shared, texture, and surface memory reads and writes, as well as reduction and atomic operations. On Volta and Turing architectures there are , there are two L1 caches per TPC, one for each SM. For more information on how L1 fits into the texturing pipeline, see the TEX unit description. Also note that while this section often uses the name “L1”, it should be understood that the L1 data cache, shared data, and the Texture data cache are one and the same.

+

L1 receives requests from two units: the SM and TEX. L1 receives global and local memory requests from the SM and receives texture and surface requests from TEX. These operations access memory in the global memory space, which L1 sends through a secondary cache, the L2.

+

Cache hit and miss rates as well as data transfers are reported in the Memory Workload Analysis section.

+
+../_images/hw-model-l1tex.png +
+

Model of Load/Store and Texture pipelines for the L1TEX cache.

+
+
+

Texture/Surface

+

The TEX unit performs texture fetching and filtering. Beyond plain texture memory access, TEX is responsible for the addressing, LOD, wrap, filter, and format conversion operations necessary to convert a texture read request into a result.

+

TEX receives two general categories of requests from the SM via its input interface: texture requests and surface load/store operations. Texture and surface memory space resides in device memory and are cached in L1. Texture and surface memory are allocated as block-linear surfaces (e.g. 2D, 2D Array, 3D). Such surfaces provide a cache-friendly layout of data such that neighboring points on a 2D surface are also located close to each other in memory, which improves access locality. Surface accesses are bounds-checked by the TEX unit prior to accessing memory, which can be used for implementing different texture wrapping modes.

+

The L1 cache is optimized for 2D spatial locality, so threads of the same warp that read texture or surface addresses that are close together in 2D space will achieve optimal performance. The L1 cache is also designed for streaming fetches with constant latency; a cache hit reduces DRAM bandwidth demand but not fetch latency. Reading device memory through texture or surface memory presents some benefits that can make it an advantageous alternative to reading memory from global or constant memory.

+

Information on texture and surface memory can be found in the Memory Workload Analysis section.

+
+
+

2.3.2. Metrics Structure

+

Metrics Overview

+

NVIDIA Nsight Compute uses an advanced metrics calculation system, designed to help you determine what happened (counters and metrics), and how close the program reached to peak GPU performance (throughputs as a percentage). Every counter has associated peak rates in the database, to allow computing its throughput as a percentage.

+

Throughput metrics return the maximum percentage value of their constituent counters. These constituents have been carefully selected to represent the sections of the GPU pipeline that govern peak performance. While all counters can be converted to a %-of-peak, not all counters are suitable for peak-performance analysis; examples of unsuitable counters include qualified subsets of activity, and workload residency counters. Using throughput metrics ensures meaningful and actionable analysis.

+

Two types of peak rates are available for every counter: burst and sustained. Burst rate is the maximum rate reportable in a single clock cycle. Sustained rate is the maximum rate achievable over an infinitely long measurement period, for “typical” operations. For many counters, burst equals sustained. Since the burst rate cannot be exceeded, percentages of burst rate will always be less than 100%. Percentages of sustained rate can occasionally exceed 100% in edge cases.

+

Metrics Entities

+

While in NVIDIA Nsight Compute, all performance counters are named metrics, they can be split further into groups with specific properties. For metrics collected via the PerfWorks measurement library, the following entities exist:

+

Counters may be either a raw counter from the GPU, or a calculated counter value. Every counter has four sub-metrics under it, which are also called roll-ups:

+ ++++ + + + + + + + + + + + + + + +

.sum

The sum of counter values across all unit instances.

.avg

The average counter value across all unit instances.

.min

The minimum counter value across all unit instances.

.max

The maximum counter value across all unit instances.

+

Counter roll-ups have the following calculated quantities as built-in sub-metrics:

+ ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

.peak_sustained

the peak sustained rate

.peak_sustained_active

the peak sustained rate during unit active cycles

.peak_sustained_active.per_second

the peak sustained rate during unit active cycles, per second *

.peak_sustained_elapsed

the peak sustained rate during unit elapsed cycles

.peak_sustained_elapsed.per_second

the peak sustained rate during unit elapsed cycles, per second *

.per_second

the number of operations per second

.per_cycle_active

the number of operations per unit active cycle

.per_cycle_elapsed

the number of operations per unit elapsed cycle

.pct_of_peak_sustained_active

% of peak sustained rate achieved during unit active cycles

.pct_of_peak_sustained_elapsed

% of peak sustained rate achieved during unit elapsed cycles

+

* sub-metrics added in NVIDIA Nsight Compute 2022.2.0.

+

Example: ncu --query-metrics-mode suffix --metrics sm__inst_executed --chip ga100

+

Ratios have three sub-metrics:

+ ++++ + + + + + + + + + + + +

.pct

The value expressed as a percentage.

.ratio

The value expressed as a ratio.

.max_rate

The ratio’s maximum value.

+

Example: ncu --query-metrics-mode suffix --metrics smsp__average_warp_latency --chip ga100

+

Throughputs indicate how close a portion of the GPU reached to peak rate. Every throughput has the following sub-metrics:

+ ++++ + + + + + + + + +

.pct_of_peak_sustained_active

% of peak sustained rate achieved during unit active cycles

.pct_of_peak_sustained_elapsed

% of peak sustained rate achieved during unit elapsed cycles

+

Example: ncu --query-metrics-mode suffix --metrics sm__throughput --chip ga100

+

Throughputs have a breakdown of underlying metrics from which the throughput value is computed. You can collect breakdown:<throughput-metric> to collect a throughput’s breakdown metrics.

+

Deprecated counter sub-metrics: The following sub-metrics were removed, due to not being useful for performance optimization:

+ ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

.peak_burst

the peak burst rate

.pct_of_peak_burst_active

% of peak burst rate achieved during unit active cycles

.pct_of_peak_burst_elapsed

% of peak burst rate achieved during unit elapsed cycles

.pct_of_peak_burst_region

% of peak burst rate achieved over a user-specified “range”

.pct_of_peak_burst_frame

% of peak burst rate achieved over a user-specified “frame”

.pct_of_peak_sustained_region

% of peak sustained rate achieved over a user-specified “range” time

.pct_of_peak_sustained_frame

% of peak sustained rate achieved over a user-specified “frame” time

.per_cycle_in_region

the number of operations per user-specified “range” cycle

.per_cycle_in_frame

the number of operations per user-specified “frame” cycle

.peak_sustained_region

the peak sustained rate over a user-specified “range”

.peak_sustained_region.per_second

the peak sustained rate over a user-specified “range”, per second *

.peak_sustained_frame

the peak sustained rate over a user-specified “frame”

.peak_sustained_frame.per_second

the peak sustained rate over a user-specified “frame”, per second *

+

Deprecated throughput sub-metrics: The following sub-metrics were removed, due to not being useful for performance optimization:

+ ++++ + + + + + + + + + + + + + + + + + + + + +

.pct_of_peak_burst_active

% of peak burst rate achieved during unit active cycles

.pct_of_peak_burst_elapsed

% of peak burst rate achieved during unit elapsed cycles

.pct_of_peak_burst_region

% of peak burst rate achieved over a user-specified “range” time

.pct_of_peak_burst_frame

% of peak burst rate achieved over a user-specified “frame” time

.pct_of_peak_sustained_region

% of peak sustained rate achieved over a user-specified “range”

.pct_of_peak_sustained_frame

% of peak sustained rate achieved over a user-specified “frame”

+

In addition to PerfWorks metrics, NVIDIA Nsight Compute uses several other measurement providers that each generate their own metrics. These are explained in the Metrics Reference.

+

Metrics Examples

+
## non-metric names -- *not* directly evaluable
+sm__inst_executed                   # counter
+smsp__average_warp_latency          # ratio
+sm__throughput                      # throughput
+
+## a counter's four first-level sub-metrics -- all evaluable
+sm__inst_executed.sum
+sm__inst_executed.avg
+sm__inst_executed.min
+sm__inst_executed.max
+
+## all names below are metrics -- all evaluable
+l1tex__data_bank_conflicts_pipe_lsu.sum
+l1tex__data_bank_conflicts_pipe_lsu.sum.peak_sustained
+l1tex__data_bank_conflicts_pipe_lsu.sum.peak_sustained_active
+l1tex__data_bank_conflicts_pipe_lsu.sum.peak_sustained_active.per_second
+l1tex__data_bank_conflicts_pipe_lsu.sum.peak_sustained_elapsed
+l1tex__data_bank_conflicts_pipe_lsu.sum.peak_sustained_elapsed.per_second
+l1tex__data_bank_conflicts_pipe_lsu.sum.per_cycle_active
+l1tex__data_bank_conflicts_pipe_lsu.sum.per_cycle_elapsed
+l1tex__data_bank_conflicts_pipe_lsu.sum.per_second
+l1tex__data_bank_conflicts_pipe_lsu.sum.pct_of_peak_sustained_active
+l1tex__data_bank_conflicts_pipe_lsu.sum.pct_of_peak_sustained_elapsed
+...
+
+
+

Metrics Naming Conventions

+

Counters and metrics _generally_ obey the naming scheme:

+
    +
  • Unit-Level Counter : unit__(subunit?)_(pipestage?)_quantity_(qualifiers?)

  • +
  • Interface Counter : unit__(subunit?)_(pipestage?)_(interface)_quantity_(qualifiers?)

  • +
  • Unit Metric : (counter_name).(rollup_metric)

  • +
  • Sub-Metric : (counter_name).(rollup_metric).(submetric)

  • +
+

where

+
    +
  • unit: A logical or physical unit of the GPU

  • +
  • subunit: The subunit within the unit where the counter was measured. Sometimes this is a pipeline mode instead.

  • +
  • pipestage: The pipeline stage within the subunit where the counter was measured.

  • +
  • quantity: What is being measured. Generally matches the dimensional units.

  • +
  • qualifiers: Any additional predicates or filters applied to the counter. Often, an unqualified counter can be broken down into several qualified sub-components.

  • +
  • interface: Of the form sender2receiver, where sender is the source-unit and receiver is the destination-unit.

  • +
  • rollup_metric: One of sum, avg, min, max.

  • +
  • submetric: refer to section Metrics Entities

  • +
+

Components are not always present. Most top-level counters have no qualifiers. Subunit and pipestage may be absent where irrelevant, or there may be many subunit specifiers for detailed counters.

+

Cycle Metrics

+

Counters using the term cycles in the name report the number of cycles in the unit’s clock domain. Unit-level cycle metrics include:

+
    +
  • unit__cycles_elapsed : The number of cycles within a range. The cycles’ DimUnits are specific to the unit’s clock domain.

  • +
  • unit__cycles_active : The number of cycles where the unit was processing data.

  • +
  • unit__cycles_stalled : The number of cycles where the unit was unable to process new data because its output interface was blocked.

  • +
  • unit__cycles_idle : The number of cycles where the unit was idle.

  • +
+

Interface-level cycle counters are often (not always) available in the following variations:

+
    +
  • unit__(interface)_active : Cycles where data was transferred from source-unit to destination-unit.

  • +
  • unit__(interface)_stalled : Cycles where the source-unit had data, but the destination-unit was unable to accept data.

  • +
+

Instanced Metrics

+

Metrics collected with NVIDIA Nsight Compute can have a single (aggregate) value, multiple instance values, or both. Instances allow the metric to have multiple sub-values, e.g. representing the value of an source metric at each instruction offset. If a metric has instance values, it often also has a correlation ID for each instance. Correlation IDs and values form a mapping that allows the tool to correlate the values within a context. For source metrics, that context is commonly the address ranges of the functions executed as part of the workload.

+

You can find which metrics have instance values in the Metrics Reference. In the UI, the Metric Details tool window can be used to conveniently view correlation IDs and instance values for each metric. Also, both the UI and the command line interface provide options to show instance values in addition to a metric aggregate where applicable.

+
+
+

2.3.3. Metrics Decoder

+

The following explains terms found in NVIDIA Nsight Compute metric names, as introduced in Metrics Structure.

+
+

Units

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Units

dram

Device (main) memory, where the GPUs global and local memory resides.

fbpa

The FrameBuffer Partition is a memory controller which sits between the level 2 cache (LTC) and the DRAM. The number of FBPAs varies across GPUs.

fe

The Frontend unit is responsible for the overall flow of workloads sent by the driver. FE also facilitates a number of synchronization operations.

gpc

The General Processing Cluster contains SM, Texture and L1 in the form of TPC(s). It is replicated several times across a chip.

gpu

The entire Graphics Processing Unit.

gr

Graphics Engine is responsible for all 2D and 3D graphics, compute work, and synchronous graphics copying work.

idc

The InDexed Constant Cache is a subunit of the SM responsible for caching constants that are indexed with a register.

l1tex

The Level 1 (L1)/Texture Cache is located within the GPC. It can be used as directed-mapped shared memory and/or store global, local and texture data in its cache portion. l1tex__t refers to its Tag stage. l1tex__m refers to its Miss stage. l1tex__d refers to its Data stage.

ltc

The Level 2 cache.

ltcfabric

The LTC fabric is the communication fabric for the L2 cache partitions.

lts

A Level 2 (L2) Cache Slice is a sub-partition of the Level 2 cache. lts__t refers to its Tag stage. lts__m refers to its Miss stage. lts__d refers to its Data stage.

mcc

Memory controller channel of MSS. The Memory Subsystem (MSS) provides access to local DRAM, SysRAM, and provides a SyncPoint Interface for interprocessor signaling. MCC includes the row sorter/arbiter and DRAM controllers.

pm

Performance monitor.

sm

The Streaming Multiprocessor handles execution of a kernel as groups of 32 threads, called warps. Warps are further grouped into cooperative thread arrays (CTA), called blocks in CUDA. All warps of a CTA execute on the same SM. CTAs share various resources across their threads, e.g. the shared memory.

smsp

Each SM is partitioned into four processing blocks, called SM sub partitions. The SM sub partitions are the primary processing elements on the SM. A sub partition manages a fixed size pool of warps.

sys

Logical grouping of several units.

tpc

Thread Processing Clusters are units in the GPC. They contain one or more SM, Texture and L1 units, the Instruction Cache (ICC) and the Indexed Constant Cache (IDC).

+

Subunits

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Subunits

aperture_device

Memory interface to local device memory (dram)

aperture_peer

Memory interface to remote device memory

aperture_sysmem

Memory interface to system memory

global

Global memory is a 49-bit virtual address space that is mapped to physical memory on the device, pinned system memory, or peer memory. Global memory is visible to all threads in the GPU. Global memory is accessed through the SM L1 and GPU L2.

lg

Local/Global memory

local

Local memory is private storage for an executing thread and is not visible outside of that thread. It is intended for thread-local data like thread stacks and register spills. Local memory has the same latency as global memory.

lsu

Load/Store unit

lsuin

Load/Store input

mio

Memory input/output

mioc

Memory input/output control

shared

Shared memory is located on chip, so it has much higher bandwidth and much lower latency than either local or global memory. Shared memory can be shared across a compute CTA.

surface

Surface memory

texin

TEXIN

texture

Texture memory

xbar

The Crossbar (XBAR) is responsible for carrying packets from a given source unit to a specific destination unit.

+

Pipelines

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Pipelines

adu

Address Divergence Unit. The ADU is responsible for address divergence handling for branches/jumps. It also provides support for constant loads and block-level barrier instructions.

alu

Arithmetic Logic Unit. The ALU is responsible for execution of most bit manipulation and logic instructions. It also executes integer instructions, excluding IMAD and IMUL. On NVIDIA Ampere architecture chips, the ALU pipeline performs fast FP32-to-FP16 conversion.

cbu

Convergence Barrier Unit. The CBU is responsible for warp-level convergence, barrier, and branch instructions.

fma

Fused Multiply Add/Accumulate. The FMA pipeline processes most FP32 arithmetic (FADD, FMUL, FMAD). It also performs integer multiplication operations (IMUL, IMAD), as well as integer dot products. On GA10x, FMA is a logical pipeline that indicates peak FP32 and FP16x2 performance. It is composed of the FMAHeavy and FMALite physical pipelines.

fmaheavy

Fused Multiply Add/Accumulate Heavy. FMAHeavy performs FP32 arithmetic (FADD, FMUL, FMAD), FP16 arithmetic (HADD2, HMUL2, HFMA2), integer multiplication operations (IMUL, IMAD), and integer dot products.

fmalite

Fused Multiply Add/Accumulate Lite. FMALite performs FP32 arithmetic (FADD, FMUL, FMA) and FP16 arithmetic (HADD2, HMUL2, HFMA2).

fp16

Half-precision floating-point. On Volta, Turing and NVIDIA GA100, the FP16 pipeline performs paired FP16 instructions (FP16x2). It also contains a fast FP32-to-FP16 and FP16-to-FP32 converter. Starting with GA10x chips, this functionality is part of the FMA pipeline.

fp64

Double-precision floating-point. The implementation of FP64 varies greatly per chip.

lsu

Load Store Unit. The LSU pipeline issues load, store, atomic, and reduction instructions to the L1TEX unit for global, local, and shared memory. It also issues special register reads (S2R), shuffles, and CTA-level arrive/wait barrier instructions to the L1TEX unit.

tex

Texture Unit. The SM texture pipeline forwards texture and surface instructions to the L1TEX unit’s TEXIN stage. On GPUs where FP64 or Tensor pipelines are decoupled, the texture pipeline forwards those types of instructions, too.

tma

Tensor Memory Access Unit. Provides efficient data transfer mechanisms between global and shared memories with the ability to understand and traverse multidimensional data layouts.

uniform

Uniform Data Path. This scalar unit executes instructions where all threads use the same input and generate the same output.

xu

Transcendental and Data Type Conversion Unit. The XU pipeline is responsible for special functions such as sin, cos, and reciprocal square root. It is also responsible for int-to-float, and float-to-int type conversions.

+

Quantities

+ + + + + + + + + + + + + + + + + + + +
Quantities

instruction

An assembly (SASS) instruction. Each executed instruction may generate zero or more requests.

request

A command into a HW unit to perform some action, e.g. load data from some memory location. Each request accesses one or more sectors.

sector

Aligned 32 byte-chunk of memory in a cache line or device memory. An L1 or L2 cache line is four sectors, i.e. 128 bytes. Sector accesses are classified as hits if the tag is present and the sector-data is present within the cache line. Tag-misses and tag-hit-data-misses are all classified as misses.

tag

Unique key to a cache line. A request may look up multiple tags, if the thread addresses do not all fall within a single cache line-aligned region. The L1 and L2 both have 128 byte cache lines. Tag accesses may be classified as hits or misses.

wavefront

Unique “work package” generated at the end of the processing stage for requests. All work items of a wavefront are processed in parallel, while work items of different wavefronts are serialized and processed on different cycles. At least one wavefront is generated for each request.

+
+

A simplified model for the processing in L1TEX for Volta and newer architectures can be described as follows: When an SM executes a global or local memory instruction for a warp, a single request is sent to L1TEX. This request communicates the information for all participating threads of this warp (up to 32). For local and global memory, based on the access pattern and the participating threads, the request requires to access a number of cache lines, and sectors within these cache lines. The L1TEX unit has internally multiple processing stages operating in a pipeline.

+

A wavefront is the maximum unit that can pass through that pipeline stage per cycle. If not all cache lines or sectors can be accessed in a single wavefront, multiple wavefronts are created and sent for processing one by one, i.e. in a serialized manner. Limitations of the work within a wavefront may include the need for a consistent memory space, a maximum number of cache lines that can be accessed, as well as various other reasons. Each wavefront then flows through the L1TEX pipeline and fetches the sectors handled in that wavefront. The given relationships of the three key values in this model are requests:sectors is 1:N, wavefronts:sectors 1:N, and requests:wavefronts is 1:N.

+

A wavefront is described as a (work) package that can be processed at once, i.e. there is a notion of processing one wavefront per cycle in L1TEX. Wavefronts therefore represent the number of cycles required to process the requests, while the number of sectors per request is a property of the access pattern of the memory instruction for all participating threads. For example, it is possible to have a memory instruction that requires 4 sectors per request in 1 wavefront. However, you can also have a memory instruction having 4 sectors per request, but requiring 2 or more wavefronts.

+
+
+

2.3.4. Range and Precision

+

Overview

+

In general, measurement values that lie outside the expected logical range of a metric can be attributed to one or more of the below root-causes. If values are exceeding such range, they are not clamped by the tool to their expected value on purpose to ensure that the rest of the profiler report remains self-consistent.

+

Asynchronous GPU activity

+

GPU engines other than the one measured by a metric (display, copy engine, video encoder, video decoder, etc.) potentially access shared resources during profiling. Such chip-global shared resources include L2, DRAM, PCIe, and NVLINK. If the kernel launch is small, the other engine(s) can cause significant confusion in e.g. the DRAM results, since it is not possible to isolate the DRAM traffic of the SM. To reduce the impact of such asynchronous units, consider profiling on a GPU without active display and without other processes that can access the GPU at the time.

+

Multi-pass data collection

+

Out-of-range metrics often occur when the profiler replays the kernel launch to collect metrics, and work distribution is significantly different across replay passes. A metric such as hit rate (hits / queries) can have significant error if hits and queries are collected on different passes and the kernel does not saturate the GPU to reach a steady state (generally > 20 µs). Similarly, it can show unexpected values when the workload is inherently variable, as e.g. in the case of spin loops.

+

To mitigate the issue, when applicable try to increase the measured workload to allow the GPU to reach a steady state for each launch. Reducing the number of metrics collected at the same time can also improve precision by increasing the likelihood that counters contributing to one metric are collected in a single pass.

+

Tool issue

+

If you still observe metric issues after following the guidelines above, please reach out to us and describe your issue.

+
+
+
+

2.4. Metrics Reference

+

Overview

+

Most metrics in NVIDIA Nsight Compute can be queried using the ncu command line interface’s –query-metrics option.

+

The following metrics can be collected explicitly, but are not listed by --query-metrics, and do not follow the naming scheme explained in Metrics Structure. They should be used as-is instead.

+

launch__* metrics are collected per kernel launch, and do not require an additional replay pass. They are available as part of the kernel launch parameters (such as grid size, block size, …) or are computed using the CUDA Occupancy Calculator.

+
+

Launch Metrics

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Launch Metrics

launch__block_dim_x

Number of threads for the kernel launch in X dimension.

launch__block_dim_y

Number of threads for the kernel launch in Y dimension.

launch__block_dim_z

Number of threads for the kernel launch in Z dimension.

launch__block_size

Total number of threads per block for the kernel launch.

launch__cluster_dim_x

Number of clusters for the kernel launch in X dimension.

launch__cluster_dim_y

Number of clusters for the kernel launch in Y dimension.

launch__cluster_dim_z

Number of clusters for the kernel launch in Z dimension.

launch__cluster_max_active

Maximum number of clusters that can co-exist on the target device. The runtime environment may affect how the hardware schedules the clusters, so the calculated occupancy is not guaranteed to be achievable.

launch__cluster_max_potential_size

Largest valid cluster size for the kernel function and launch configuration.

launch__cluster_scheduling_policy

Cluster scheduling policy.

launch__context_id

CUDA context id for the kernel launch (id of the primary context if launch was on a green context).

launch__device_id

CUDA device id for the kernel launch.

launch__func_cache_config

On devices where the L1 cache and shared memory use the same hardware resources, this is the preferred cache configuration for the CUDA function. The runtime will use the requested configuration if possible, but it is free to choose a different configuration if required.

launch__function_pcs

Kernel function entry PCs.

launch__graph_contains_device_launch

Set to 1 if any node in the profiled graph can launch a CUDA device graph.

launch__graph_is_device_launchable

Set to 1 if the profiled graph was device-launchable.

launch__green_context_id

CUDA context id of the green context for the kernel launch (if applicable).

launch__grid_dim_x

Number of blocks for the kernel launch in X dimension.

launch__grid_dim_y

Number of blocks for the kernel launch in Y dimension.

launch__grid_dim_z

Number of blocks for the kernel launch in Z dimension.

launch__grid_size

Total number of blocks for the kernel launch.

launch__occupancy_cluster_gpu_pct

Overall GPU occupancy due to clusters.

launch__occupancy_cluster_pct

The ratio of active blocks to the max possible active blocks due to clusters.

launch__occupancy_limit_blocks

Occupancy limit due to maximum number of blocks managable per SM.

launch__occupancy_limit_registers

Occupancy limit due to register usage.

launch__occupancy_limit_shared_mem

Occupancy limit due to shared memory usage.

launch__occupancy_limit_warps

Occupancy limit due to block size.

launch__occupancy_per_block_size

Number of active warps for given block size.

+

Instance values map from number of warps (uint64) to value (uint64).

+

launch__occupancy_per_cluster_size

Number of active clusters for given cluster size.

+

Instance values map from number of clusters (uint64) to value (uint64).

+

launch__occupancy_per_register_count

Number of active warps for given register count.

+

Instance values map from number of warps (uint64) to value (uint64).

+

launch__occupancy_per_shared_mem_size

Number of active warps for given shared memory size.

+

Instance values map from number of warps (uint64) to value (uint64).

+

launch__registers_per_thread

Number of registers allocated per thread.

launch__registers_per_thread_allocated

Number of registers allocated per thread.

launch__shared_mem_config_size

Shared memory size configured for the kernel launch. The size depends on the static, dynamic, and driver shared memory requirements as well as the specified or platform-determined configuration size.

launch__shared_mem_per_block_allocated

Allocated shared memory size per block.

launch__shared_mem_per_block_driver

Shared memory size per block, allocated for the CUDA driver.

launch__shared_mem_per_block_dynamic

Dynamic shared memory size per block, allocated for the kernel.

launch__shared_mem_per_block_static

Static shared memory size per block, allocated for the kernel.

launch__sm_count

Number of SMs utilized in the launch.

launch__stream_id

CUDA stream id for the kernel launch.

launch__sub_launch_name

Name of each sub-launch for range-like results.

launch__thread_count

Total number of threads across all blocks for the kernel launch.

launch__uses_cdp

Set to 1 if any function object in the launched workload can use CUDA dynamic parallelism.

launch__uses_green_context

Set to 1 if launch was on a green context.

launch__waves_per_multiprocessor

Number of waves per SM. Partial waves can lead to tail effects where some SMs become idle while others still have pending work to complete.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NVLink Topology Metrics

nvlink__bandwidth

Link bandwidth in bytes/s.

+

Instance values map from logical nvlink ID (uint64) to value (double).

+

nvlink__count_logical

Total number of logical NVLinks.

nvlink__count_physical

Total number of physical links.

+

Instance values map from physical nvlink device ID (uint64) to value (uint64).

+

nvlink__destination_ports

Destination port numbers (as strings).

+

Instance values map from logical nvlink ID (uint64) to comma-separated list of port numbers (string).

+

nvlink__dev0Id

ID of the first connected device.

+

Instance values map from logical nvlink ID (uint64) to value (uint64).

+

nvlink__dev0type

Type of the first connected device.

+

Instance values map from logical nvlink ID (uint64) to values [1=GPU, 2=CPU] (uint64).

+

nvlink__dev1Id

ID of the second connected device.

+

Instance values map from logical nvlink ID (uint64) to value (uint64).

+

nvlink__dev1type

Type of the second connected device.

+

Instance values map from logical nvlink ID (uint64) to values [1=GPU, 2=CPU] (uint64).

+

nvlink__dev_display_name_all

Device display name.

+

Instance values map from logical nvlink device ID (uint64) to value (string).

+

nvlink__enabled_mask

NVLink enablement mask, per device.

+

Instance values map from physical nvlink device ID (uint64) to value (uint64).

+

nvlink__is_direct_link

Indicates, per NVLink, if the link is direct.

+

Instance values map from logical nvlink ID (uint64) to value (uint64).

+

nvlink__is_nvswitch_connected

Indicates if NVSwitch is connected.

nvlink__max_count

Maximum number of NVLinks.

+

Instance values map from physical nvlink device ID (uint64) to value (uint64).

+

nvlink__peer_access

Indicates if peer access is supported.

+

Instance values map from logical nvlink ID (uint64) to value (uint64).

+

nvlink__peer_atomic

Indicates if peer atomics are supported.

+

Instance values map from logical nvlink ID (uint64) to value (uint64).

+

nvlink__source_ports

Source port numbers (as strings).

+

Instance values map from logical nvlink ID (uint64) to comma-separated list of port numbers (string).

+

nvlink__system_access

Indicates if system access is supported.

+

Instance values map from logical nvlink ID (uint64) to value (uint64).

+

nvlink__system_atomic

Indicates if system atomics are supported.

+

Instance values map from logical nvlink ID (uint64) to value (uint64).

+
+

NUMA Topology Metrics

+ + + + + + + + + + + + + + + + +
NUMA Topology Metrics

numa__cpu_affinity

CPU affinity for each device.

+

Instance values map from device ID (uint64) to comma-separated values (string).

+

numa__dev_display_name_all

Device display names for all devices.

+

Instance values map from device ID (uint64) to comma-separated values (string).

+

numa__id_cpu

NUMA ID of the nearest CPU for each device.

+

Instance values map from device ID (uint64) to comma-separated values (string).

+

numa__id_memory

NUMA ID of the nearest memory for each device.

+

Instance values map from device ID (uint64) to comma-separated values (string).

+
+
+

Device Attributes

+

device__attribute_* metrics represent CUDA device attributes. Collecting them does not require an additional kernel replay pass, as their value is available from the CUDA driver for each CUDA device.

+

See below for custom device__attribute_* metrics.

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

device__attribute_architecture

Chip architecture of the CUDA device.

device__attribute_confidential_computing_mode

Confidential computing mode.

device__attribute_device_index

Device index.

device__attribute_display_name

Product name of the CUDA device.

device__attribute_fb_bus_width

Frame buffer bus width.

device__attribute_fbp_count

Total number of frame buffer partitions.

device__attribute_implementation

Chip implementation of the CUDA device.

device__attribute_l2s_count

Total number of Level 2 cache slices.

device__attribute_limits_max_cta_per_sm

Maximum number of CTA per SM.

device__attribute_max_gpu_frequency_khz

Maximum GPU frequency in kilohertz.

device__attribute_max_ipc_per_multiprocessor

Maximum number of instructions per clock per multiprocessor.

device__attribute_max_ipc_per_scheduler

Maximum number of instructions per clock per scheduler.

device__attribute_max_mem_frequency_khz

Peak memory frequency in kilohertz.

device__attribute_max_registers_per_thread

Maximum number of registers available per thread.

device__attribute_max_warps_per_multiprocessor

Maximum number of warps per multiprocessor.

device__attribute_max_warps_per_scheduler

Maximum number of warps per scheduler.

device__attribute_num_l2s_per_fbp

Number of Level 2 cache slices per frame buffer partition.

device__attribute_num_schedulers_per_multiprocessor

Number of schedulers per multiprocessor.

device__attribute_num_tex_per_multiprocessor

Number of TEX unit per multiprocessor.

device__attribute_sass_level

SASS level.

+

Warp Stall Reasons

+
+

Collected using warp scheduler state sampling. They are incremented regardless if the scheduler issued an instruction in the same cycle or not. These metrics have instance values mapping from the function address (uint64) to the number of samples (uint64).

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Warp Stall Reasons

smsp__pcsamp_warps_issue_stalled_barrier

Warp was stalled waiting for sibling warps at a CTA barrier. A high number of warps waiting at a barrier is commonly caused by diverging code paths before a barrier. This causes some warps to wait a long time until other warps reach the synchronization point. Whenever possible, try to divide up the work into blocks of uniform workloads. If the block size is 512 threads or greater, consider splitting it into smaller groups. This can increase eligible warps without affecting occupancy, unless shared memory becomes a new occupancy limiter. Also, try to identify which barrier instruction causes the most stalls, and optimize the code executed before that synchronization point first.

smsp__pcsamp_warps_issue_stalled_branch_resolving

Warp was stalled waiting for a branch target to be computed, and the warp program counter to be updated. To reduce the number of stalled cycles, consider using fewer jump/branch operations and reduce control flow divergence, e.g. by reducing or coalescing conditionals in your code. See also the related No Instructions state.

smsp__pcsamp_warps_issue_stalled_dispatch_stall

Warp was stalled waiting on a dispatch stall. A warp stalled during dispatch has an instruction ready to issue, but the dispatcher holds back issuing the warp due to other conflicts or events.

smsp__pcsamp_warps_issue_stalled_drain

Warp was stalled after EXIT waiting for all outstanding memory operations to complete so that warp’s resources can be freed. A high number of stalls due to draining warps typically occurs when a lot of data is written to memory towards the end of a kernel. Make sure the memory access patterns of these store operations are optimal for the target architecture and consider parallelized data reduction, if applicable.

smsp__pcsamp_warps_issue_stalled_imc_miss

Warp was stalled waiting for an immediate constant cache (IMC) miss. A read from constant memory costs one memory read from device memory only on a cache miss; otherwise, it just costs one read from the constant cache. Immediate constants are encoded into the SASS instruction as ‘c[bank][offset]’. Accesses to different addresses by threads within a warp are serialized, thus the cost scales linearly with the number of unique addresses read by all threads within a warp. As such, the constant cache is best when threads in the same warp access only a few distinct locations. If all threads of a warp access the same location, then constant memory can be as fast as a register access.

smsp__pcsamp_warps_issue_stalled_lg_throttle

Warp was stalled waiting for the L1 instruction queue for local and global (LG) memory operations to be not full. Typically, this stall occurs only when executing local or global memory instructions extremely frequently. Avoid redundant global memory accesses. Try to avoid using thread-local memory by checking if dynamically indexed arrays are declared in local scope, of if the kernel has excessive register pressure causing by spills. If applicable, consider combining multiple lower-width memory operations into fewer wider memory operations and try interleaving memory operations and math instructions.

smsp__pcsamp_warps_issue_stalled_long_scoreboard

Warp was stalled waiting for a scoreboard dependency on a L1TEX (local, global, surface, texture) operation. Find the instruction producing the data being waited upon to identify the culprit. To reduce the number of cycles waiting on L1TEX data accesses verify the memory access patterns are optimal for the target architecture, attempt to increase cache hit rates by increasing data locality (coalescing), or by changing the cache configuration. Consider moving frequently used data to shared memory.

smsp__pcsamp_warps_issue_stalled_math_pipe_throttle

Warp was stalled waiting for the execution pipe to be available. This stall occurs when all active warps execute their next instruction on a specific, oversubscribed math pipeline. Try to increase the number of active warps to hide the existent latency or try changing the instruction mix to utilize all available pipelines in a more balanced way.

smsp__pcsamp_warps_issue_stalled_membar

Warp was stalled waiting on a memory barrier. Avoid executing any unnecessary memory barriers and assure that any outstanding memory operations are fully optimized for the target architecture.

smsp__pcsamp_warps_issue_stalled_mio_throttle

Warp was stalled waiting for the MIO (memory input/output) instruction queue to be not full. This stall reason is high in cases of extreme utilization of the MIO pipelines, which include special math instructions, dynamic branches, as well as shared memory instructions. When caused by shared memory accesses, trying to use fewer but wider loads can reduce pipeline pressure.

smsp__pcsamp_warps_issue_stalled_misc

Warp was stalled for a miscellaneous hardware reason.

smsp__pcsamp_warps_issue_stalled_no_instructions

Warp was stalled waiting to be selected to fetch an instruction or waiting on an instruction cache miss. A high number of warps not having an instruction fetched is typical for very short kernels with less than one full wave of work in the grid. Excessively jumping across large blocks of assembly code can also lead to more warps stalled for this reason, if this causes misses in the instruction cache. See also the related Branch Resolving state.

smsp__pcsamp_warps_issue_stalled_not_selected

Warp was stalled waiting for the micro scheduler to select the warp to issue. Not selected warps are eligible warps that were not picked by the scheduler to issue that cycle as another warp was selected. A high number of not selected warps typically means you have sufficient warps to cover warp latencies and you may consider reducing the number of active warps to possibly increase cache coherence and data locality.

smsp__pcsamp_warps_issue_stalled_selected

Warp was selected by the micro scheduler and issued an instruction.

smsp__pcsamp_warps_issue_stalled_short_scoreboard

Warp was stalled waiting for a scoreboard dependency on a MIO (memory input/output) operation (not to L1TEX). The primary reason for a high number of stalls due to short scoreboards is typically memory operations to shared memory. Other reasons include frequent execution of special math instructions (e.g. MUFU) or dynamic branching (e.g. BRX, JMX). Consult the Memory Workload Analysis section to verify if there are shared memory operations and reduce bank conflicts, if reported. Assigning frequently accessed values to variables can assist the compiler in using low-latency registers instead of direct memory accesses.

smsp__pcsamp_warps_issue_stalled_sleeping

Warp was stalled due to all threads in the warp being in the blocked, yielded, or sleep state. Reduce the number of executed NANOSLEEP instructions, lower the specified time delay, and attempt to group threads in a way that multiple threads in a warp sleep at the same time.

smsp__pcsamp_warps_issue_stalled_tex_throttle

Warp was stalled waiting for the L1 instruction queue for texture operations to be not full. This stall reason is high in cases of extreme utilization of the L1TEX pipeline. Try issuing fewer texture fetches, surface loads, surface stores, or decoupled math operations. If applicable, consider combining multiple lower-width memory operations into fewer wider memory operations and try interleaving memory operations and math instructions. Consider converting texture lookups or surface loads into global memory lookups. Texture can accept four threads’ requests per cycle, whereas global accepts 32 threads.

smsp__pcsamp_warps_issue_stalled_wait

Warp was stalled waiting on a fixed latency execution dependency. Typically, this stall reason should be very low and only shows up as a top contributor in already highly optimized kernels. Try to hide the corresponding instruction latencies by increasing the number of active warps, restructuring the code or unrolling loops. Furthermore, consider switching to lower-latency instructions, e.g. by making use of fast math compiler options.

+

Warp Stall Reasons (Not Issued)

+
+

Collected using warp scheduler state sampling. They are incremented only on cycles in which the warp scheduler issued no instruction. These metrics have instance values mapping from the function address (uint64) to the number of samples (uint64).

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Warp Stall Reasons (Not Issued)

smsp__pcsamp_warps_issue_stalled_barrier_not_issued

Warp was stalled waiting for sibling warps at a CTA barrier. A high number of warps waiting at a barrier is commonly caused by diverging code paths before a barrier. This causes some warps to wait a long time until other warps reach the synchronization point. Whenever possible, try to divide up the work into blocks of uniform workloads. If the block size is 512 threads or greater, consider splitting it into smaller groups. This can increase eligible warps without affecting occupancy, unless shared memory becomes a new occupancy limiter. Also, try to identify which barrier instruction causes the most stalls, and optimize the code executed before that synchronization point first.

smsp__pcsamp_warps_issue_stalled_branch_resolving_not_issued

Warp was stalled waiting for a branch target to be computed, and the warp program counter to be updated. To reduce the number of stalled cycles, consider using fewer jump/branch operations and reduce control flow divergence, e.g. by reducing or coalescing conditionals in your code. See also the related No Instructions state.

smsp__pcsamp_warps_issue_stalled_dispatch_stall_not_issued

Warp was stalled waiting on a dispatch stall. A warp stalled during dispatch has an instruction ready to issue, but the dispatcher holds back issuing the warp due to other conflicts or events.

smsp__pcsamp_warps_issue_stalled_drain_not_issued

Warp was stalled after EXIT waiting for all memory operations to complete so that warp resources can be freed. A high number of stalls due to draining warps typically occurs when a lot of data is written to memory towards the end of a kernel. Make sure the memory access patterns of these store operations are optimal for the target architecture and consider parallelized data reduction, if applicable.

smsp__pcsamp_warps_issue_stalled_imc_miss_not_issued

Warp was stalled waiting for an immediate constant cache (IMC) miss. A read from constant memory costs one memory read from device memory only on a cache miss; otherwise, it just costs one read from the constant cache. Accesses to different addresses by threads within a warp are serialized, thus the cost scales linearly with the number of unique addresses read by all threads within a warp. As such, the constant cache is best when threads in the same warp access only a few distinct locations. If all threads of a warp access the same location, then constant memory can be as fast as a register access.

smsp__pcsamp_warps_issue_stalled_lg_throttle_not_issued

Warp was stalled waiting for the L1 instruction queue for local and global (LG) memory operations to be not full. Typically, this stall occurs only when executing local or global memory instructions extremely frequently. Avoid redundant global memory accesses. Try to avoid using thread-local memory by checking if dynamically indexed arrays are declared in local scope, of if the kernel has excessive register pressure causing by spills. If applicable, consider combining multiple lower-width memory operations into fewer wider memory operations and try interleaving memory operations and math instructions.

smsp__pcsamp_warps_issue_stalled_long_scoreboard_not_issued

Warp was stalled waiting for a scoreboard dependency on a L1TEX (local, global, surface, texture) operation. Find the instruction producing the data being waited upon to identify the culprit. To reduce the number of cycles waiting on L1TEX data accesses verify the memory access patterns are optimal for the target architecture, attempt to increase cache hit rates by increasing data locality (coalescing), or by changing the cache configuration. Consider moving frequently used data to shared memory.

smsp__pcsamp_warps_issue_stalled_math_pipe_throttle_not_issued

Warp was stalled waiting for the execution pipe to be available. This stall occurs when all active warps execute their next instruction on a specific, oversubscribed math pipeline. Try to increase the number of active warps to hide the existent latency or try changing the instruction mix to utilize all available pipelines in a more balanced way.

smsp__pcsamp_warps_issue_stalled_membar_not_issued

Warp was stalled waiting on a memory barrier. Avoid executing any unnecessary memory barriers and assure that any outstanding memory operations are fully optimized for the target architecture.

smsp__pcsamp_warps_issue_stalled_mio_throttle_not_issued

Warp was stalled waiting for the MIO (memory input/output) instruction queue to be not full. This stall reason is high in cases of extreme utilization of the MIO pipelines, which include special math instructions, dynamic branches, as well as shared memory instructions. When caused by shared memory accesses, trying to use fewer but wider loads can reduce pipeline pressure.

smsp__pcsamp_warps_issue_stalled_misc_not_issued

Warp was stalled for a miscellaneous hardware reason.

smsp__pcsamp_warps_issue_stalled_no_instructions_not_issued

Warp was stalled waiting to be selected to fetch an instruction or waiting on an instruction cache miss. A high number of warps not having an instruction fetched is typical for very short kernels with less than one full wave of work in the grid. Excessively jumping across large blocks of assembly code can also lead to more warps stalled for this reason, if this causes misses in the instruction cache. See also the related Branch Resolving state.

smsp__pcsamp_warps_issue_stalled_not_selected_not_issued

Warp was stalled waiting for the micro scheduler to select the warp to issue. Not selected warps are eligible warps that were not picked by the scheduler to issue that cycle as another warp was selected. A high number of not selected warps typically means you have sufficient warps to cover warp latencies and you may consider reducing the number of active warps to possibly increase cache coherence and data locality.

smsp__pcsamp_warps_issue_stalled_selected_not_issued

Warp was selected by the micro scheduler and issued an instruction.

smsp__pcsamp_warps_issue_stalled_short_scoreboard_not_issued

Warp was stalled waiting for a scoreboard dependency on a MIO (memory input/output) operation (not to L1TEX). The primary reason for a high number of stalls due to short scoreboards is typically memory operations to shared memory. Other reasons include frequent execution of special math instructions (e.g. MUFU) or dynamic branching (e.g. BRX, JMX). Consult the Memory Workload Analysis section to verify if there are shared memory operations and reduce bank conflicts, if reported. Assigning frequently accessed values to variables can assist the compiler in using low-latency registers instead of direct memory accesses.

smsp__pcsamp_warps_issue_stalled_sleeping_not_issued

Warp was stalled due to all threads in the warp being in the blocked, yielded, or sleep state. Reduce the number of executed NANOSLEEP instructions, lower the specified time delay, and attempt to group threads in a way that multiple threads in a warp sleep at the same time.

smsp__pcsamp_warps_issue_stalled_tex_throttle_not_issued

Warp was stalled waiting for the L1 instruction queue for texture operations to be not full. This stall reason is high in cases of extreme utilization of the L1TEX pipeline. Try issuing fewer texture fetches, surface loads, surface stores, or decoupled math operations. If applicable, consider combining multiple lower-width memory operations into fewer wider memory operations and try interleaving memory operations and math instructions. Consider converting texture lookups or surface loads into global memory lookups. Texture can accept four threads’ requests per cycle, whereas global accepts 32 threads.

smsp__pcsamp_warps_issue_stalled_wait_not_issued

Warp was stalled waiting on a fixed latency execution dependency. Typically, this stall reason should be very low and only shows up as a top contributor in already highly optimized kernels. Try to hide the corresponding instruction latencies by increasing the number of active warps, restructuring the code or unrolling loops. Furthermore, consider switching to lower-latency instructions, e.g. by making use of fast math compiler options.

+

Source Metrics

+
+

Most are collected using SASS-patching. These metrics have instance values mapping from function address (uint64) to associated values (uint64). Metrics memory_[access_]type map to string values.

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Source Metrics

branch_inst_executed

Number of unique branch targets assigned to the instruction, including both divergent and uniform branches.

derived__avg_thread_executed

Average number of thread-level executed instructions per warp (regardless of their predicate). Computed as: thread_inst_executed / inst_executed

derived__avg_thread_executed_true

Average number of predicated-on thread-level executed instructions per warp. Computed as: thread_inst_executed_true / inst_executed

derived__memory_l1_conflicts_shared_nway

Average N-way conflict in L1 per shared memory instruction. A 1-way access has no conflicts and resolves in a single pass. Computed as: memory_l1_wavefronts_shared / inst_executed

derived__memory_l1_wavefronts_shared_excessive

Excessive number of wavefronts in L1 from shared memory instructions, because not all not predicated-off threads performed the operation.

derived__memory_l2_theoretical_sectors_global_excessive

Excessive theoretical number of sectors requested in L2 from global memory instructions, because not all not predicated-off threads performed the operation.

inst_executed

Number of warp-level executed instructions, ignoring instruction predicates. Warp-level means the values increased by one per individual warp executing the instruction, independent of the number of participating threads within each warp.

memory_access_size_type

The size of the memory access, in bits.

memory_access_type

The type of memory access (e.g. load or store).

memory_l1_tag_requests_global

Number of L1 tag requests generated by global memory instructions.

memory_l1_wavefronts_shared

Number of wavefronts in L1 from shared memory instructions.

memory_l1_wavefronts_shared_ideal

Ideal number of wavefronts in L1 from shared memory instructions, assuming each not predicated-off thread performed the operation.

memory_l2_theoretical_sectors_global

Theoretical number of sectors requested in L2 from global memory instructions.

memory_l2_theoretical_sectors_global_ideal

Ideal number of sectors requested in L2 from global memory instructions, assuming each not predicated-off thread performed the operation.

memory_l2_theoretical_sectors_local

Theoretical number of sectors requested in L2 from local memory instructions.

memory_type

The accessed address space (global/local/shared).

smsp__branch_targets_threads_divergent

Number of divergent branch targets, including fallthrough. Incremented only when there are two or more active threads with divergent targets.

smsp__branch_targets_threads_uniform

Number of uniform branch execution, including fallthrough, where all active threads selected the same branch target.

smsp__pcsamp_sample_count

Number of collected warp state samples per program counter. This metric is collected using warp sampling.

thread_inst_executed

Number of thread-level executed instructions, regardless of predicate presence or evaluation.

thread_inst_executed_true

Number of thread-level executed instructions, where the instruction predicate evaluated to true, or no predicate was given.

+

L2 Cache Eviction Metrics

+ + + + + + + + + + + + + + + + + + + + + + + + + +
L2 Cache Eviction Metrics

smsp__sass_inst_executed_memdesc_explicit_evict_type

L2 cache eviction policy types.

smsp__sass_inst_executed_memdesc_explicit_hitprop_evict_first

Number of warp-level executed instructions with L2 cache eviction hit property ‘first’.

smsp__sass_inst_executed_memdesc_explicit_hitprop_evict_last

Number of warp-level executed instructions with L2 cache eviction hit property ‘last’.

smsp__sass_inst_executed_memdesc_explicit_hitprop_evict_normal

Number of warp-level executed instructions with L2 cache eviction hit property ‘normal’.

smsp__sass_inst_executed_memdesc_explicit_hitprop_evict_normal_demote

Number of warp-level executed instructions with L2 cache eviction hit property ‘normal demote’.

smsp__sass_inst_executed_memdesc_explicit_missprop_evict_first

Number of warp-level executed instructions with L2 cache eviction miss property ‘first’.

smsp__sass_inst_executed_memdesc_explicit_missprop_evict_normal

Number of warp-level executed instructions with L2 cache eviction miss property ‘normal’.

+

Instructions Per Opcode Metrics

+
+

Collected using SASS-patching. These metrics have instance values mapping from the SASS opcode (string) to the number of executions (uint64).

+
+
+ + + + + + + + + + + + + + + + + + + + + +
Instructions Per Opcode Metrics

sass__inst_executed_per_opcode

Number of warp-level executed instructions, instanced by basic SASS opcode.

sass__inst_executed_per_opcode_with_modifier_all

Number of warp-level executed instructions, instanced by all SASS opcode modifiers.

sass__inst_executed_per_opcode_with_modifier_selective

Number of warp-level executed instructions, instanced by selective SASS opcode modifiers.

sass__thread_inst_executed_true_per_opcode

Number of thread-level executed instructions, instanced by basic SASS opcode.

sass__thread_inst_executed_true_per_opcode_with_modifier_all

Number of thread-level executed instructions, instanced by all SASS opcode modifiers.

sass__thread_inst_executed_true_per_opcode_with_modifier_selective

Number of thread-level executed instructions, instanced by selective SASS opcode modifiers.

+

Metric Groups

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Metric Groups

group:memory__chart

Group of metrics for the workload analysis chart.

group:memory__dram_table

Group of metrics for the device memory workload analysis table.

group:memory__first_level_cache_table

Group of metrics for the L1/TEX cache workload analysis table.

group:memory__l2_cache_evict_policy_table

Group of metrics for the L2 cache eviction policies table.

group:memory__l2_cache_table

Group of metrics for the L2 cache workload analysis table.

group:memory__shared_table

Group of metrics for the shared memory workload analysis table.

group:smsp__pcsamp_warp_stall_reasons

Group of metrics for the number of samples from the warp sampler per program location.

group:smsp__pcsamp_warp_stall_reasons_not_issued

Group of metrics for the number of samples from the warp sampler per program location on cycles the warp scheduler issued no instructions.

+

Profiler Metrics

+
+

Metrics generated by the tool itself to inform about statistics or problems during profiling.

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Profiler Metrics

profiler__perfworks_session_reuse

Indicates if the PerfWorks session was reused between results.

profiler__pmsampler_buffer_size_bytes

Buffer size in bytes per pass group used for PM sampling.

+

Instance values map from pass group to bytes.

+

profiler__pmsampler_ctxsw_*

GPU context switch states over time during PM sampling for a specific pass group.

+

Instance values map from timestamp to context state (1 - enabled, 0 - disabled).

+

profiler__pmsampler_dropped_samples

Number of samples dropped per pass group during PM sampling due to insufficient buffer size.

+

Instance values map from pass group to samples.

+

profiler__pmsampler_interval_cycles

Sampling interval in cycles per pass group used for PM sampling, or zero if time-based interval was used.

+

Instance values map from pass group to cycles.

+

profiler__pmsampler_interval_time

Sampling interval in nanoseconds per pass group used for PM sampling, or zero if cycle-based interval was used.

+

Instance values map from pass group to nanoseconds.

+

profiler__pmsampler_merged_samples

Number of samples merged per pass group during PM sampling due to HW back pressure while streaming results.

+

Instance values map from pass group to samples.

+

profiler__pmsampler_pass_groups

Number of pass groups used for PM sampling.

+

Instance values map from pass group to comma-separated list of metrics collected in this pass.

+

profiler__replayer_passes

Number of passes the result was replayed for profiling across all experiments.

profiler__replayer_passes_type_warmup

Number of passes the result was replayed to warmup the GPU for profiling.

smsp__pcsamp_aggregated_passes

Number of passes required for statistical warp stall sampling.

smsp__pcsamp_buffer_size_bytes

Buffer size in bytes for statistical warp stall sampling.

smsp__pcsamp_dropped_bytes

Bytes dropped during statistical warp stall sampling due to insufficient buffer size.

smsp__pcsamp_interval

Interval number for warp stall sampling.

smsp__pcsamp_interval_cycles

Interval cycles for statistical warp stall sampling.

+
+
+
+

2.5. Sampling

+

NVIDIA Nsight Compute can collect certain performance data via sampling at fixed intervals.

+
+

2.5.1. PM Sampling

+

NVIDIA Nsight Compute supports collecting many metrics by sampling the GPU’s performance monitors (PM) periodically at fixed intervals. The resulting metrics are instanced, with each sample being composed of its value and the (GPU) timestamp when it was collected. This allows the tool to visualize the data on a timeline that helps you understand how the behavior of the profiled workload changes during its runtime.

+

Metrics collected with PM sampling have instance values mapping from their sample timestamp (in ns) to their sample value. When logically possible, the non-instanced value of the metric represents the aggregate across all instances. The aggregation operation (e.g. sum, average) depends on the metric structure.

+

A metric is collected using PM sampling in the following cases:

+
    +
  • The metric name has the pmsampling: prefix.

  • +
  • The metric name includes a valid Triage group.

  • +
  • The metric is requested in a section’s Timeline field. Prefixing the metric with pmsampling: is still recommended in this case to avoid conflicts with profiler metrics of the same name collected e.g. by other sections.

  • +
+ + +++++ + + + + + + + + + + + + + + + + + + + + +
Supported Architectures for PM Sampling

Architecture

Support

Sampling Intervals

Volta and earlier

Not supported

n/a

TU10x-GA100

Supported

>= 20000 cycles

GA10x and later

Supported

>= 1000 ns

+

PM sampling is supported on all platforms except vGPU. See below for further limitations that apply to context switch trace. +You can query the list of metrics available to PM sampling using the --query-metrics-collection pmsampling option. +Note though that while all listed metrics are available to the PM sampler, only those requiring a single pass can be collected.

+

Context Switch Trace

+

Since this data collection samples across the entire GPU device, the tool concurrently collects a context switch trace. The trace is stored as a separate, instanced metric. It tracks when the context of interest was active and can be used to filter the sampling metric to only relevant instances and to better align metrics from multiple passes on the timeline. While it’s generally preferable to have this trace collected, it can be disabled using an environment variable.

+

Note that context switch trace is not supported on Windows Subsystem for Linux (WSL), Multi-Instance GPU (MIG), within containers or on mobile platforms.

+

Counter Domains

+

PM sampling metrics are composed of one or more raw counter dependencies internally. If metrics in the same pass share such a dependency, it is only collected once. +Each counter is associated with a counter domain, which describes how and where in the hardware the counter is collected. +There is a limited number of counters in each domain that can be collected concurrently in the same pass, and the number may vary, depending on the selected counters.

+

Selecting counters from different domains has the possibility that more metric dependencies can be fit into the same pass. +Furthermore, some counters can be collected through different domains, and the domain may be chosen by the tool or the user.

+

When querying the PM sampling metric collection, the required and optional domains for a metric’s counter dependencies are shown. +E.g., for l1tex__throughput gpu_sm_a,[gpu_sm_b,gpu_sm_c], the domain gpu_sm_a is required and one of the optional domains [gpu_sm_b,gpu_sm_c] must be chosen for this metric to be collectable. +Counter domains can only be selected explicitly in section files, using one or more instances of the CtrDomains: "<domain>" field for PM sampling metrics.

+

Note that most users should be able to rely on the tool’s automatic selection of counter domains, or the pre-configured domains in section files.

+
+
+

2.5.2. Warp Sampling

+

NVIDIA Nsight Compute supports periodic sampling of the warp program counter and warp scheduler state. At a fixed interval of cycles, the sampler in each streaming multiprocessor selects an active warp and outputs the program counter and the warp scheduler state. The tool selects the minimum interval for the device. On small devices, this can be every 32 cycles. On larger chips with more multiprocessors, this may be 2048 cycles. The sampler selects a random active warp. On the same cycle the scheduler may select a different warp to issue.

+

The resulting metrics are correlated with the individual executed instructions but don’t have any time resolution.

+

See the Warp Stall Reasons tables in the Metrics Reference for a description of the individual warp scheduler states.

+
+
+
+

2.6. Reproducibility

+

In order to provide actionable and deterministic results across application runs, NVIDIA Nsight Compute applies various methods to adjust how metrics are collected. This includes serializing kernel launches, purging GPU caches before each kernel replay or adjusting GPU clocks.

+
+

2.6.1. Serialization

+

NVIDIA Nsight Compute serializes kernel launches within the profiled application, potentially across multiple processes profiled by one or more instances of the tool at the same time.

+

Serialization across processes is necessary since for the collection of HW performance metrics, some GPU and driver objects can only be acquired by a single process at a time. To achieve this, the lock file TMPDIR/nsight-compute-lock is used. On Windows, TMPDIR is the path returned by the Windows GetTempPath API function. On other platforms, it is the path supplied by the first environment variable in the list TMPDIR, TMP, TEMP, TEMPDIR. If none of these is found, it’s /var/nvidia on QNX and /tmp otherwise.

+

Serialization within the process is required for most metrics to be mapped to the proper kernel. In addition, without serialization, performance metric values might vary widely if kernel execute concurrently on the same device.

+

It is currently not possible to disable this tool behavior. Refer to the FAQ entry on possible workarounds.

+
+
+

2.6.2. Clock Control

+

For many metrics, their value is directly influenced by the current GPU SM and memory clock frequencies. For example, if a kernel instance is profiled that has prior kernel executions in the application, the GPU might already be in a higher clocked state and the measured kernel duration, along with other metrics, will be affected. Likewise, if a kernel instance is the first kernel to be launched in the application, GPU clocks will regularly be lower. In addition, due to kernel replay, the metric value might depend on which replay pass it is collected in, as later passes would result in higher clock states.

+

To mitigate this non-determinism, NVIDIA Nsight Compute attempts to limit GPU clock frequencies to their base value. As a result, metric values are less impacted by the location of the kernel in the application, or by the number of the specific replay pass.

+

However, this behavior might be undesirable for analysis of the kernel, e.g. in cases where an external tool is used to fix clock frequencies, or where the behavior of the kernel within the application is analyzed. To solve this, users can adjust the --clock-control option to specify if any clock frequencies should be fixed by the tool.

+

Factors affecting Clock Control:

+
    +
  • Note that thermal throttling directed by the driver cannot be controlled by the tool and always overrides any selected options.

  • +
  • On mobile targets, e.g. L4T or QNX, there may be variations in profiling results due the inability for the tool to lock clocks. Using Nsight Compute’s --clock-control to set the GPU clocks will fail or will be silently ignored when profiling on a GPU partition.

    +
      +
    • On L4T, you can use the jetson_clocks script to lock the clocks at their maximums during profiling.

    • +
    +
  • +
  • See the Special Configurations section for MIG and vGPU clock control.

  • +
+
+
+

2.6.3. Cache Control

+

As explained in Kernel Replay, the kernel might need to be replayed multiple times to collect all requested metrics. While NVIDIA Nsight Compute can save and restore the contents of GPU device memory accessed by the kernel for each pass, it cannot do the same for the contents of HW caches, such as e.g. the L1 and L2 cache.

+

This can have the effect that later replay passes might have better or worse performance than e.g. the first pass, as the caches could already be primed with the data last accessed by the kernel. Similarly, the values of HW performance counters collected by the first pass might depend on which kernels, if any, were executed prior to the measured kernel launch.

+

In order to make HW performance counter value more deterministic, NVIDIA Nsight Compute by default flushes all GPU caches before each replay pass. As a result, in each pass, the kernel will access a clean cache and the behavior will be as if the kernel was executed in complete isolation.

+

This behavior might be undesirable for performance analysis, especially if the measurement focuses on a kernel within a larger application execution, and if the collected data targets cache-centric metrics. In this case, you can use --cache-control none to disable flushing of any HW cache by the tool.

+
+
+

2.6.4. Persistence Mode

+

The NVIDIA kernel mode driver must be running and connected to a target GPU device before any user interactions with that device can take place. The driver behavior differs depending on the OS. Generally, on Linux, if the kernel mode driver is not already running or connected to a target GPU, the invocation of any program that attempts to interact with that GPU will transparently cause the driver to load and/or initialize the GPU. When all GPU clients terminate the driver will then deinitialize the GPU.

+

If persistence mode is not enabled (as part of the OS, or by the user), applications triggering GPU initialization may incur a short startup cost. In addition, on some configurations, there may also be a shutdown cost when the GPU is de-initialized at the end of the application.

+

It is recommended to enable persistence mode on applicable operating systems before profiling with NVIDIA Nsight Compute for more consistent application behavior.

+
+
+
+

2.7. Special Configurations

+
+

2.7.1. Multi Instance GPU

+

Multi-Instance GPU (MIG) is a feature that allows a GPU to be partitioned into multiple CUDA devices. The partitioning is carried out on two levels: First, a GPU can be split into one or multiple GPU Instances. Each GPU Instance claims ownership of one or more streaming multiprocessors (SM), a subset of the overall GPU memory, and possibly other GPU resources, such as the video encoders/decoders. Second, each GPU Instance can be further partitioned into one or more Compute Instances. Each Compute Instance has exclusive ownership of its assigned SMs of the GPU Instance. However, all Compute Instances within a GPU Instance share the GPU Instance’s memory and memory bandwidth. Every Compute Instance acts and operates as a CUDA device with a unique device ID. See the driver release notes as well as the documentation for the nvidia-smi CLI tool for more information on how to configure MIG instances.

+

For profiling, a Compute Instance can be of one of two types: isolated or shared.

+

An isolated Compute Instance owns all of its assigned resources and does not share any GPU unit with another Compute Instance. In other words, the Compute Instance is the same size as its parent GPU Instance and consequently does not have any other sibling Compute Instances. Profiling works as usual for isolated Compute Instances.

+

A shared Compute Instance uses GPU resources that can potentially also be accessed by other Compute Instances in the same GPU Instance. Due to this resource sharing, collecting profiling data from those shared units is not permitted. Attempts to collect metrics from a shared unit fail with an error message of ==ERROR== Failed to access the following metrics. When profiling on a MIG instance, it is not possible to collect metrics from GPU units that are shared with other MIG instances followed by the list of failing metrics. Collecting only metrics from GPU units that are exclusively owned by a shared Compute Instance is still possible.

+

Locking Clocks

+

NVIDIA Nsight Compute is not able to set the clock frequency on any Compute Instance for profiling. You can continue analyzing kernels without fixed clock frequencies (using --clock-control none; see here for more details). If you have sufficient permissions, nvidia-smi can be used to configure a fixed frequency for the whole GPU by calling nvidia-smi --lock-gpu-clocks=tdp,tdp. This sets the GPU clocks to the base TDP frequency until you reset the clocks by calling nvidia-smi --reset-gpu-clocks.

+

MIG on Baremetal (non-vGPU)

+

All Compute Instances on a GPU share the same clock frequencies.

+

MIG on NVIDIA vGPU

+

Enabling profiling for a VM gives the VM access to the GPU’s global performance counters, which may include activity from other VMs executing on the same GPU. Enabling profiling for a VM also allows the VM to lock clocks on the GPU, which impacts all other VMs executing on the same GPU, including MIG Compute Instances.

+
+
+
+

2.8. Roofline Charts

+

Roofline charts provide a very helpful way to visualize achieved performance on complex processing units, like GPUs. This section introduces the Roofline charts that are presented within a profile report.

+
+

2.8.1. Overview

+

Kernel performance is not only dependent on the operational speed of the GPU. Since a kernel requires data to work on, performance is also dependent on the rate at which the GPU can feed data to the kernel. A typical roofline chart combines the peak performance and memory bandwidth of the GPU, with a metric called Arithmetic Intensity (a ratio between Work and Memory Traffic), into a single chart, to more realistically represent the achieved performance of the profiled kernel. A simple roofline chart might look like the following:

+
+../_images/roofline-overview.png +
+

Roofline overview.

+
+
+

This chart actually shows two different rooflines. However, the following components can be identified for each:

+
    +
  • Vertical Axis - The vertical axis represents Floating Point Operations per Second (FLOPS). For GPUs this number can get quite large and so the numbers on this axis can be scaled for easier reading (as shown here). In order to better accommodate the range, this axis is rendered using a logarithmic scale.

  • +
  • Horizontal Axis - The horizontal axis represents Arithmetic Intensity, which is the ratio between Work (expressed in floating point operations per second), and Memory Traffic (expressed in bytes per second). The resulting unit is in floating point operations per byte. This axis is also shown using a logarithmic scale.

  • +
  • Memory Bandwidth Boundary - The memory bandwidth boundary is the sloped part of the roofline. By default, this slope is determined entirely by the memory transfer rate of the GPU but can be customized inside the SpeedOfLight_RooflineChart.section file if desired.

  • +
  • Peak Performance Boundary - The peak performance boundary is the flat part of the roofline By default, this value is determined entirely by the peak performance of the GPU but can be customized inside the SpeedOfLight_RooflineChart.section file if desired.

  • +
  • Ridge Point - The ridge point is the point at which the memory bandwidth boundary meets the peak performance boundary. This point is a useful reference when analyzing kernel performance.

  • +
  • Achieved Value - The achieved value represents the performance of the profiled kernel. If baselines are being used, the roofline chart will also contain an achieved value for each baseline. The outline color of the plotted achieved value point can be used to determine from which baseline the point came.

  • +
+
+
+

2.8.2. Analysis

+

The roofline chart can be very helpful in guiding performance optimization efforts for a particular kernel.

+
+../_images/roofline-analysis.png +
+

Roofline anaysis.

+
+
+

As shown here, the ridge point partitions the roofline chart into two regions. The area shaded in blue under the sloped Memory Bandwidth Boundary is the Memory Bound region, while the area shaded in green under the Peak Performance Boundary is the Compute Bound region. The region in which the achieved value falls, determines the current limiting factor of kernel performance.

+

The distance from the achieved value to the respective roofline boundary (shown in this figure as a dotted white line), represents the opportunity for performance improvement. The closer the achieved value is to the roofline boundary, the more optimal is its performance. An achieved value that lies on the Memory Bandwidth Boundary but is not yet at the height of the ridge point would indicate that any further improvements in overall FLOP/s are only possible if the Arithmetic Intensity is increased at the same time.

+

Using the baseline feature in combination with roofline charts, is a good way to track optimization progress over a number of kernel executions.

+
+
+
+

2.9. Memory Chart

+

The Memory Chart shows a graphical, logical representation of performance data for memory subunits on and off the GPU. Performance data includes transfer sizes, hit rates, number of instructions or requests, etc.

+
+

2.9.1. Overview

+
+../_images/memory-chart-a100.png +
+

Memory chart for an NVIDIA A100 GPU

+
+
+

Logical Units (green)

+

Logical units are shown in green color.

+
    +
  • Kernel: The CUDA kernel executing on the GPU’s Streaming Multiprocessors

  • +
  • Global: CUDA global memory

  • +
  • Local: CUDA local memory

  • +
  • Texture: CUDA texture memory

  • +
  • Surface: CUDA surface memory

  • +
  • Shared: CUDA shared memory

  • +
  • Load Global Store Shared: Instructions loading directly from global into shared memory without intermediate register file access

  • +
+

Physical Units (blue)

+

Physical units are shown in blue color.

+
    +
  • L1/TEX Cache: The L1/Texture cache. The underlying physical memory is split between this cache and the user-managed Shared Memory.

  • +
  • Shared Memory: CUDA’s user-managed shared memory. The underlying physical memory is split between this and the L1/TEX Cache.

  • +
  • L2 Cache: The L2 cache

  • +
  • L2 Compression: The memory compression unit of the L2 Cache

  • +
  • System Memory: Off-chip system (CPU) memory

  • +
  • Device Memory: On-chip device (GPU) memory of the CUDA device that executes the kernel

  • +
  • Peer Memory: On-chip device (GPU) memory of other CUDA devices

  • +
+

Depending on the exact GPU architecture, the exact set of shown units can vary, as not all GPUs have all units.

+ +

Links between Kernel and other logical units represent the number of executed instructions (Inst) targeting the respective unit. For example, the link between Kernel and Global represents the instructions loading from or storing to the global memory space. Instructions using the NVIDIA A100’s Load Global Store Shared paradigm are shown separately, as their register or cache access behavior can be different from regular global loads or shared stores.

+

Links between logical units and blue, physical units represent the number of requests (Req) issued as a result of their respective instructions. For example, the link going from L1/TEX Cache to Global shows the number of requests generated due to global load instructions.

+

The color of each link represents the percentage of peak utilization of the corresponding communication path. The color legend to the right of the chart shows the applied color gradient from unused (0%) to operating at peak performance (100%). Triangle markers to the left of the legend correspond to the links in the chart. The markers offer a more accurate value estimate for the achieved peak performances than the color gradient alone.

+

A unit often shares a common data port for incoming and outgoing traffic. While the links sharing a port might operate well below their individual peak performances, the unit’s data port may have already reached its peak. Port utilization is shown in the chart by colored rectangles inside the units located at the incoming and outgoing links. Ports use the same color gradient as the data links and have also a corresponding marker to the left of the legend.

+

An example of the correlation between the peak values reported in the memory tables and the ports in the memory chart is shown below.

+
+../_images/memory-peak-mapping.png +
+

Mapping of peak values between memory tables and memory chart

+
+
+

Metrics

+

Metrics from this chart can be collected on the command line using --set full, --section MemoryWorkloadAnalysis_Chart or --metrics group:memory__chart.

+
+
+
+

2.10. Memory Tables

+

The Memory Tables show detailed metrics for the various memory HW units, such as shared memory, the caches, and device memory. For most table entries, you can hover over it to see the underlying metric name and description. Some entries are generated as derivatives from other cells, and do not show a metric name on their own, but the respective calculation. If a certain metric does not contribute to the generic derivative calculation, it is shown as UNUSED in the tooltip. You can hover over row or column headers to see a description of this part of the table.

+
+

2.10.1. Shared Memory

+
+../_images/memory-tables-smem.png +
+

Example Shared Memory table, collected on an RTX 2080 Ti

+
+
+

Columns

+ ++++ + + + + + + + + + + + + + + + + + +

Instructions

For each access type, the total number of all actually executed assembly (SASS) instructions per warp. Predicated-off instructions are not included.

+

E.g., the instruction STS would be counted towards Shared Store.

+

Requests

The total number of all requests to shared memory. On SM 7.0 (Volta) and newer architectures, each shared memory instruction generates exactly one request.

Wavefronts

Number of wavefronts required to service the requested shared memory data. Wavefronts are serialized and processed on different cycles.

% Peak

Percentage of peak utilization. Higher values imply a higher utilization of the unit and can show potential bottlenecks, as it does not necessarily indicate efficient usage.

Bank Conflicts

If multiple threads’ requested addresses map to different offsets in the same memory bank, the accesses are serialized. The hardware splits a conflicting memory request into as many separate conflict-free requests as necessary, decreasing the effective bandwidth by a factor equal to the number of colliding memory requests.

+

Rows

+ ++++ + + + + + + + + +

(Access Types)

Shared memory access operations.

Total

The aggregate for all access types in the same column.

+

Metrics

+

Metrics from this table can be collected on the command line using --set full, --section MemoryWorkloadAnalysis_Tables or --metrics group:memory__shared_table.

+
+
+

2.10.2. L1/TEX Cache

+
+../_images/memory-tables-l1.png +
+

Example L1/TEX Cache memory table, collected on an RTX 2080 Ti

+
+
+
+../_images/hw-model-l1tex-ga100-global.png +
+

Model of the Global Load Pipeline for the L1TEX cache on GA100, mapped to the memory table.

+
+
+

Columns

+ ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Instructions

For each access type, the total number of all actually executed assembly (SASS) instructions per warp. Predicated-off instructions are not included.

+

E.g., the instruction LDG would be counted towards Global Loads.

+

Requests

The total number of all requests to L1, generated for each instruction type. On SM 7.0 (Volta) and newer architectures, each instruction generates exactly one request for LSU traffic (global, local, …). For texture (TEX) traffic, more than one request may be generated.

+

In the example, each of the 65536 global load instructions generates exactly one request.

+

Wavefronts

Number of wavefronts required to service the requested memory operation. Wavefronts are serialized and processed on different cycles.

Wavefront % Peak

Percentage of peak utilization for the units processing wavefronts. High numbers can imply that the processing pipelines are saturated and can become a bottleneck.

Sectors

The total number of all L1 sectors accesses sent to L1. Each load or store request accesses one or more sectors in the L1 cache. Atomics and reductions are passed through to the L2 cache.

Sectors/Req

The average ratio of sectors to requests for the L1 cache. For the same number of active threads in a warp, smaller numbers imply a more efficient memory access pattern. For warps with 32 active threads, the optimal ratios per access size are: 32-bit: 4, 64-bit: 8, 128-bit: 16. Smaller ratios indicate some degree of uniformity or overlapped loads within a cache line. Higher numbers can imply uncoalesced memory accesses and will result in increased memory traffic.

+

In the example, the average ratio for global loads is 32 sectors per request, which implies that each thread needs to access a different sector. Ideally, for warps with 32 active threads, with each thread accessing a single, aligned 32-bit value, the ratio would be 4, as every 8 consecutive threads access the same sector.

+

Hit Rate

Sector hit rate (percentage of requested sectors that do not miss) in the L1 cache. Sectors that miss need to be requested from L2, thereby contributing to Sector Misses to L2. Higher hit rates imply better performance due to lower access latencies, as the request can be served by L1 instead of a later stage. Not to be confused with Tag Hit Rate (not shown).

Bytes

Total number of bytes requested from L1. This is identical to the number of sectors multiplied by 32 byte, since the minimum access size in L1 is one sector.

Sector Misses to L2

Total number of sectors that miss in L1 and generate subsequent requests in the L2 Cache.

+

In this example, the 262144 sector misses for global and local loads can be computed as the miss-rate of 12.5%, multiplied by the number of 2097152 sectors.

+

% Peak to L2

Percentage of peak utilization of the L1-to-XBAR interface, used to send L2 cache requests. If this number is high, the workload is likely dominated by scattered {writes, atomics, reductions}, which can increase the latency and cause warp stalls.

Returns to SM

Number of return packets sent from the L1 cache back to the SM. Larger request access sizes result in higher number of returned packets.

% Peak to SM

Percentage of peak utilization of the XBAR-to-L1 return path (compare Returns to SM). If this number is high, the workload is likely dominated by scattered reads, thereby causing warp stalls. Improving read-coalescing or the L1 hit rate could reduce this utilization.

+

Rows

+ ++++ + + + + + + + + + + + + + + +

(Access Types)

The various access types, e.g. loads from global memory or reduction operations on surface memory.

Loads

The aggregate of all load access types in the same column.

Stores

The aggregate of all store access types in the same column.

Total

The aggregate of all load and store access types in the same column.

+

Metrics

+

Metrics from this table can be collected on the command line using --set full, --section MemoryWorkloadAnalysis_Tables or --metrics group:memory__first_level_cache_table.

+
+
+

2.10.3. L2 Cache

+
+../_images/memory-tables-l2.png +
+

Example L2 Cache memory table, collected on an RTX 2080 Ti

+
+
+
+../_images/hw-model-lts-ga100.png +
+

Model of the L2 cache on GA100, mapped to the memory table.

+
+
+

Columns

+ ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Requests

For each access type, the total number of requests made to the L2 cache. This correlates with the Sector Misses to L2 for the L1 cache. Each request accesses up to four sectors from a single 128 byte cache line.

Sectors

For each access type, the total number of sectors requested from the L2 cache. Each request accesses between one and four sectors.

Sectors/Req

The average ratio of sectors to requests for the L2 cache. For the same number of active threads in a warp, smaller numbers imply a more efficient memory access pattern. Smaller ratios indicate some degree of uniformity or overlapped loads within a cache line. Higher numbers can imply uncoalesced memory accesses and will result in increased memory traffic.

% Peak

Percentage of peak sustained number of sectors. The “work package” in the L2 cache is a sector. Higher values imply a higher utilization of the unit and can show potential bottlenecks, as it does not necessarily indicate efficient usage.

Hit Rate

Hit rate (percentage of requested sectors that do not miss) in the L2 cache. Sectors that miss need to be requested from a later stage, thereby contributing to one of Sector Misses to Device, Sector Misses to System, or Sector Misses to Peer. Higher hit rates imply better performance due to lower access latencies, as the request can be served by L2 instead of a later stage.

Bytes

Total number of bytes requested from L2. This is identical to the number of sectors multiplied by 32 byte, since the minimum access size in L2 is one sector.

Throughput

Achieved L2 cache throughput in bytes per second. High values indicate high utilization of the unit.

Sector Misses to Device

Total number of sectors that miss in L2 and generate subsequent requests in device memory.

Sector Misses to System

Total number of sectors that miss in L2 and generate subsequent requests in system memory.

Sector Misses to Peer

Total number of sectors that miss in L2 and generate subsequent requests in peer memory.

+

Rows

+ ++++ + + + + + + + + + + + + + + + + + +

(Access Types)

The various access types, e.g. loads or reductions originating from L1 cache.

L1/TEX Total

Total for all operations originating from the L1 cache.

ECC Total

Total for all operations caused by ECC (Error Correction Code). If ECC is enabled, L2 write requests that partially modify a sector cause a corresponding sector load from DRAM. These additional load operations increase the sector misses of L2.

L2 Fabric Total

Total for all operations across the L2 fabric connecting the two L2 partitions. This row is only shown for kernel launches on CUDA devices with L2 fabric.

GPU Total

Total for all operations across all clients of the L2 cache. Independent of having them split out separately in this table.

+

Metrics

+

Metrics from this table can be collected on the command line using --set full, --section MemoryWorkloadAnalysis_Tables or --metrics group:memory__l2_cache_table.

+
+
+

2.10.4. L2 Cache Eviction Policies

+
+../_images/memory-tables-l2-evict-policy.png +
+

Example L2 Cache Eviction Policies memory table, collected on an A100 GPU

+
+
+

Columns

+ ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +

First

Number of sectors accessed in the L2 cache using the evict_first policy. Data cached with this policy will be first in the eviction priority order and will likely be evicted when cache eviction is required. This policy is suitable for streaming data.

Hit Rate

Cache hit rate for sector accesses in the L2 cache using the evict_first policy.

Last

Number of sectors accessed in the L2 cache using the evict_last policy. Data cached with this policy will be last in the eviction priority order and will likely be evicted only after other data with evict_normal or evict_first eviction policy is already evicted. This policy is suitable for data that should remain persistent in cache.

Hit Rate

Cache hit rate for sector accesses in the L2 cache using the evict_last policy.

Normal

Number of sectors accessed in the L2 cache using the evict_normal policy. This is the default policy.

Hit Rate

Cache hit rate for sector accesses in the L2 cache using the evict_normal policy.

Normal Demote

Number of sectors accessed in the L2 cache using the evict_normal_demote policy.

Hit Rate

Cache hit rate for sector accesses in the L2 cache using the evict_normal_demote policy.

+

Rows

+ ++++ + + + + + + + + + + + + + + +

(Access Types)

The various access types, e.g. loads or reductions, originating from L1 cache.

L1/TEX Total

Total for all operations originating from the L1 cache.

L2 Fabric Total

Total for all operations across the L2 fabric connecting the two L2 partitions. This row is only shown for kernel launches on CUDA devices with L2 fabric.

GPU Total

Total for all operations across all clients of the L2 cache. Independent of having them split out separately in this table.

+

Metrics

+

Metrics from this table can be collected on the command line using --set full, --section MemoryWorkloadAnalysis_Tables or --metrics group:memory__l2_cache_evict_policy_table. Note that this table is only available on GPUs with GA100 or newer.

+
+
+

2.10.5. Device Memory

+
+../_images/memory-tables-dram.png +
+

Example Device Memory table, collected on an RTX 2080 Ti

+
+
+

Columns

+ ++++ + + + + + + + + + + + + + + +

Sectors

For each access type, the total number of sectors requested from device memory.

% Peak

Percentage of peak device memory utilization. Higher values imply a higher utilization of the unit and can show potential bottlenecks, as it does not necessarily indicate efficient usage.

Bytes

Total number of bytes transferred between L2 Cache and device memory.

Throughput

Achieved device memory throughput in bytes per second. High values indicate high utilization of the unit.

+

Rows

+ ++++ + + + + + + + + +

(Access Types)

Device memory loads and stores.

Total

The aggregate for all access types in the same column.

+

Metrics

+

Metrics from this table can be collected on the command line using --set full, --section MemoryWorkloadAnalysis_Tables or --metrics group:memory__dram_table.

+
+
+
+

2.11. FAQ

+
    +
  • n/a metric values

    +

    n/a means that the metric value is “not available”. The most common reason is that the requested metric does not exist. This can either be the result of a typo, or a missing suffix. Verify the metric name against the output of of the --query-metricsNVIDIA Nsight Compute CLI option.

    +

    If the metric name was copied (e.g. from an old version of this documentation), make sure that it does not contain zero-width unicode characters.

    +

    Finally, the metric might simply not exist for the targeted GPU architecture. For example, the IMMA pipeline metric sm__inst_executed_pipe_tensor_op_imma.avg.pct_of_peak_sustained_active is not available on GV100 chips.

    +
  • +
  • Metric values outside the expected logical range

    +

    This includes e.g. percentages exceeding 100% or metrics reporting negative values. For further details, see Range and Precision.

    +
  • +
  • ERR_NVGPUCTRPERM - The user does not have permission to access NVIDIA GPU Performance Counters on the target device.

    +

    By default, NVIDIA drivers require elevated permissions to access GPU performance counters. On mobile platforms, profile as root/using sudo. On other platforms, you can either start profiling as root/using sudo, or by enabling non-admin profiling. For further details, see https://developer.nvidia.com/ERR_NVGPUCTRPERM.

    +

    On Windows Subsystem for Linux (WSL), access to NVIDIA GPU Performance Counters must be enabled in the NVIDIA Control Panel of the Windows host.

    +
  • +
  • Unsupported GPU

    +

    This indicates that the GPU, on which the current kernel is launched, is not supported. See the Release Notes for a list of devices supported by your version of NVIDIA Nsight Compute. It can also indicate that the current GPU configuration is not supported. For example, NVIDIA Nsight Compute might not be able to profile GPUs in SLI configuration.

    +
  • +
  • Connection error detected communicating with target application.

    +

    The inter-process connection to the profiled application unexpectedly dropped. This happens if the application is killed or signals an exception (e.g. segmentation fault).

    +
  • +
  • Failed to connect. The target process may have exited.

    +

    This occurs if

    +
      +
    • the application does not call any CUDA API calls before it exits.

    • +
    • the application terminates early because it was started from the wrong working directory, or with the wrong arguments. In this case, check the details in the Connection Dialog.

    • +
    • the application crashes before calling any CUDA API calls.

    • +
    • the application launches child processes which use the CUDA. In this case, launch with the --target-processes all option.

    • +
    +
  • +
  • The profiler returned an error code: (number)

    +

    For the non-interactive Profile activity, the NVIDIA Nsight Compute CLI is started to generate the report. If either the application exited with a non-zero return code, or the NVIDIA Nsight Compute CLI encountered an error itself, the resulting return code will be shown in this message.

    +

    For example, if the application hit a segmentation fault (SIGSEGV) on Linux, it will likely return error code 11. All non-zero return codes are considered errors, so the message is also shown if the application exits with return code 1 during regular execution.

    +

    To debug this issue, it can help to run the data collection directly from the command line using ncu in order to observe the application’s and the profiler’s command line output, e.g. ==ERROR== The application returned an error code (11)

    +
  • +
  • Failed to open/create lock file (path). Please check that this process has write permissions on this file.

    +

    NVIDIA Nsight Compute failed to create or open the file (path) with write permissions. This file is used for inter-process serialization. NVIDIA Nsight Compute does not remove this file after profiling by design. The error occurs if the file was created by a profiling process with permissions that prevent the current process from writing to this file, or if the current user can’t acquire this file for other reasons (e.g. certain Linux kernel security settings).

    +

    The file is in the current temporary directory, i.e. TMPDIR/nsight-compute-lock. On Windows, TMPDIR is the path returned by the Windows GetTempPath API function. On other platforms, it is the path supplied by the first environment variable in the list TMPDIR, TMP, TEMP, TEMPDIR. If none of these is found, it’s /var/nvidia on QNX and /tmp otherwise.

    +

    Older versions of NVIDIA Nsight Compute did not set write permissions for all users on this file by default. As a result, running the tool on the same system with a different user might cause this error. This has been resolved since version 2020.2.1.

    +

    The following workarounds can be used to solve this problem:

    +
      +
    • If it is otherwise ensured that no concurrent NVIDIA Nsight Compute instances are active on the same system, set TMPDIR to a different directory for which the current user has write permissions.

    • +
    • Ask the user owning the file, or a system administrator, to remove it or add write permissions for all potential users.

    • +
    • On Linux systems setting fs.protected_regular=1, root or other users may not be able to access this file, even though the owner can, if the sticky bit is set on the temporary directory. Either disable this setting using sudo sysctl fs.protected_regular=0, use a different temporary directory (see above), or enable access to hardware performance counters for non-root users and profile as the same user who owns the file (see https://developer.nvidia.com/ERR_NVGPUCTRPERM on how to change this setting).

    • +
    +
  • +
  • Profiling failed because a driver resource was unavailable.

    +

    The error indicates that a required CUDA driver resource was unavailable during profiling. Most commonly, this means that NVIDIA Nsight Compute could not reserve the driver’s performance monitor, which is necessary for collecting most metrics.

    +

    This can happen if another application has a concurrent reservation on this resource. Such applications can be e.g. DCGM, a client of CUPTI’s Profiling API, Nsight Graphics, or another instance of NVIDIA Nsight Compute without access to the same file system (see serialization for how this is prevented within the same file system).

    +

    If you expect the problem to be caused by DCGM, consider using dcgmi profile --pause to stop its monitoring while profiling with NVIDIA Nsight Compute.

    +
  • +
  • Could not deploy stock * files to *

    +

    Could not determine user home directory for section deployment.

    +

    An error occurred while trying to deploy stock section or rule files. By default, NVIDIA Nsight Compute tries to deploy these to a versioned directory in the user’s home directory (as identified by the HOME environment variable on Linux), e.g. /home/user/Documents/NVIDIA Nsight Compute/<version>/Sections.

    +

    If the directory cannot be determined (e.g. because this environment variable is not pointing to a valid directory), or if there is an error while deploying the files (e.g. because the current process does not have write permissions on it), warning messages are shown and NVIDIA Nsight Compute falls back to using stock sections and rules from the installation directory.

    +

    If you are in an environment where you consistently don’t have write access to the user’s home directory, consider populating this directory upfront using ncu --section-folder-restore, or by making /home/user/Documents/NVIDIA Nsight Compute/<version> a symlink to a writable directory.

    +
  • +
  • ProxyJump SSH option is not working

    +

    NVIDIA Nsight Compute does not manage authentication or interactive prompts with the OpenSSH client launched when using the ProxyJump option. Therefore, to connect through an intermediate host for the first time, you will not be able to accept the intermediate host’s key. A simple way to pinpoint the cause of failures in this case is to open a terminal and use the OpenSSH client to connect to the remote target. Once that connection succeeds, NVIDIA Nsight Compute should be able to connect to the target, too.

    +
  • +
  • SSH connection fails without trying to connect

    +

    If the connection fails without trying to connect, there may be a problem with the settings you entered into the connection dialog. Please make sure that the IP/Host Name, User Name and Port fields are correctly set.

    +
  • +
  • SSH connections are still not working

    +

    The problem might come from NVIDIA Nsight Compute’s SSH client not finding a suitable host key algorithm to use which is supported by the remote server. You can force NVIDIA Nsight Compute to use a specific set of host key algorithms by setting the HostKeyAlgorithms option for the problematic host in your SSH configuration file. To list the supported host key algorithms for a remote target, you can use the ssh-keyscan utility which comes with the OpenSSH client.

    +
  • +
  • Removing host keys from known hosts files

    +

    When connecting to a target machine, NVIDIA Nsight Compute tries to verify the target’s host key against the same local database as the OpenSSH client. If NVIDIA Nsight Compute find the host key is incorrect, it will inform you through a failure dialog. If you trust the key hash shown in the dialog, you can remove the previously saved key for that host by manually editing your known hosts database or using the ssh-keygen -R <host> command.

    +
  • +
  • Qt initialization failed

    +

    Failed to load Qt platform plugin

    +

    See System Requirements for Linux.

    +
  • +
+

Notices

+

Notices

+

ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, “MATERIALS”) ARE BEING PROVIDED “AS IS.” NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.

+

Information furnished is believed to be accurate and reliable. However, NVIDIA Corporation assumes no responsibility for the consequences of use of such information or for any infringement of patents or other rights of third parties that may result from its use. No license is granted by implication of otherwise under any patent rights of NVIDIA Corporation. Specifications mentioned in this publication are subject to change without notice. This publication supersedes and replaces all other information previously supplied. NVIDIA Corporation products are not authorized as critical components in life support devices or systems without express written approval of NVIDIA Corporation.

+

Trademarks

+

NVIDIA and the NVIDIA logo are trademarks or registered trademarks of NVIDIA Corporation in the U.S. and other countries. Other company and product names may be trademarks of the respective companies with which they are associated.

+
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/index.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/index.html new file mode 100644 index 0000000000000000000000000000000000000000..02f7eda913757d556c690515ac804dcc9d091b36 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/index.html @@ -0,0 +1,1636 @@ + + + + + + + + + 1. Release Notes — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • 1. Release Notes
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

1. Release Notes

+

Nsight Compute Release Notes.

+

Release notes, including new features and important bug fixes. Supported platforms and GPUs. List of known issues for the current release.

+
+

1.1. Release Notes

+
+

1.1.1. Updates in 2024.1.1

+

General

+
    +
  • Added clarification that for profiling a range with multiple, active CUDA Green Contexts, counter values that are not attributable to SMs will be aggregated over all these Green Contexts.

  • +
+

Resolved Issues

+
    +
  • Changed the way the PerfWorks library is loaded into the target application’s process space. This addresses possible connection errors in case the library search path includes other directories with PerfWorks libraries.

  • +
  • Fixed an issue that caused PM sampling data to be missing from the results of a Profile Series.

  • +
  • Fixed the incorrect calculation of the percentage values in the Inline Function table.

  • +
  • Fixed a potential crash of the NVIDIA Nsight Compute UI when PM sampling data was requested, but no sample was collected.

  • +
+
+
+

1.1.2. Updates in 2024.1

+

General

+
    +
  • Switched to using OpenSSL version 3.0.10.

  • +
  • Added new metrics available when profiling on CUDA Green Contexts.

  • +
  • Reduced the number of passes required for collecting PM sampling sections.

  • +
  • Counter domains can now be specified for PM sampling metrics in section files.

  • +
  • PM sampling metrics can now be queried in the command line and Metric Details window by specifying the respective collection option.

  • +
  • Added a new optional PmSampling_WarpStates section for understanding warp stall reasons over the workload duration.

  • +
  • Added a new rule for detecting load imbalances.

  • +
  • Improved the performance of graph-level profiling on new drivers.

  • +
  • Updated the metrics compatibility table for OptiX cmdlists and instruction-level SASS metrics.

  • +
+

NVIDIA Nsight Compute

+
    +
  • Added SASS view and Source Markers support in Source Comparison.

  • +
  • Improved Source Comparison diff visualization by adding empty lines on other side of inserted/deleted lines.

  • +
  • The Source page column chooser can now be opened directly from the Navigation drop down.

  • +
  • Added a Launch Details tool window for showing information about individual launches within larger workloads like OptiX command lists.

  • +
  • Added support for CUDA Green Contexts in the Resources tool window, the Launch Statistics section and the report header.

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Improved documentation on NVTX expressions and command line output when a potentially incorrect expression led to no workloads being profiled.

  • +
  • Improved checking for invalid expressions when using the --target-processes-filer option.

  • +
+

Resolved Issues

+
    +
  • Fixed that the L1 cache achieved roofline value was missing when profiling on GH100.

  • +
  • Fixed several “Launch Failed” errors when collecting instruction-level SASS metrics.

  • +
  • Fixed that Live Register values would be too high for some workloads.

  • +
  • Fixed a scrolling issue on the Source page when collapsing a multi-file view.

  • +
  • Fixed an issue that no PM sampling data would be shown in the timeline when context switch trace was not available.

  • +
  • Fixed a display issue in the memory chart when adding baselines.

  • +
  • Fixed a crash when adding baselines.

  • +
  • Fixed a crash in timeline views when not all configured data was available.

  • +
  • Fixed that the application history was not always deleted when selecting Reset Application Data.

  • +
  • Fixed an error in the metric compatibility documentation.

  • +
+
+
+

1.1.3. Updates in 2023.3.1

+

General

+
    +
  • Switched to using OpenSSL version 1.1.1w.

  • +
  • Improved the speedup estimates for rule IssueSlotUtilization as well as its child rules.

  • +
  • Updated report files and documentation for the samples located at extras/samples/.

  • +
+

Resolved Issues

+
    +
  • Fixed collection of context switch data during PM Sampling when using Range Replay.

  • +
  • Fixed potential crash of NVIDIA Nsight Compute when an invalid regular expression was provided as requested metric.

  • +
  • Improved the performance of NVIDIA Nsight Compute in cases where only a single process is being profiled and --target-processes all was specified.

  • +
  • Fixed an issue of reporting too high register counts on the Source Page.

  • +
  • Fixed a bug that could cause a GPU fault while collecting SW counters through PerfWorks.

  • +
  • Fixed showing incorrect baseline values for the Runtime Improvement values on the Summary Page.

  • +
+
+
+

1.1.4. Updates in 2023.3

+

General

+
    +
  • NVIDIA Nsight Compute now supports collecting many metrics by sampling the GPU’s performance monitors (PM) periodically at fixed intervals. The results can be visualized on a timeline.

  • +
  • Added WSL profiling support on Windows 10 WSL with OS build version 19044 and greater. WSL profiling is not supported on Windows 10 WSL for systems that exceed 1 TB of system memory.

  • +
  • Rule outputs are prioritized to improve the accuracy of estimated speedups. The Summary page now shows the most actionable optimization advices when a result row is selected.

  • +
  • Improved the handling and reporting for unavailable metrics during collection and when applying rules.

  • +
  • Added instructionMix sample CUDA application and document to show how to use NVIDIA Nsight Compute to analyze and identify the performance bottleneck due to an imbalanced instruction mix. Refer to the README.TXT file, sample code, and document under extras/samples/instructionMix.

  • +
+

NVIDIA Nsight Compute

+
    +
  • Added support to see the source files of two profile results side by side using Source Comparison. This allows you to quickly identify source differences and understand changes in metric values.

  • +
  • The Summary page is now the default page when a report is opened. Previous behavior can be enabled in the options dialog.

  • +
  • On the Summary and Raw pages, values from all/selected rows are automatically aggregated in the column header for applicable metrics. Selected individual cells are aggregated in the bottom status bar.

  • +
  • Added Launch Name and Device options in the filter dialog launched by Apply Filters button in the report header.

  • +
  • Added support for source view profiles that persist the Source page configuration and allow you to re-apply it to other reports.

  • +
  • The Metric Details tool window now supports querying metrics beyond the current report by using the chip:<chipname> tag in the search.

  • +
  • Added support for CUDA Graph Edge Data (such as port and dependency type) and CUDA Graph Conditional Handles in the Resources tool window.

  • +
  • The Acceleration Structure Viewer and Resources tool window now support OptiX Opacity Micromaps.

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Tracking and profiling all child processes (--target-processes all) is now the default for ncu.

  • +
  • Improved reporting of requested but unavailable metrics. Metrics requested in section files are by default considered optional and only cause a warning to be shown.

  • +
+

Resolved Issues

+
    +
  • Support for tracking child processes launched with system() is available on Linux ppc64le.

  • +
  • Improved the behavior of following SASS navigation links on the Source page.

  • +
  • Fixed issues with profiling CUDA graphs in graph-profiling mode when nodes are associated with a non-current CUDA context.

  • +
  • Fixed an issue in L2 bandwidth calculations in the hierarchical roofline sections.

  • +
+
+
+

1.1.5. Updates in 2023.2.2

+

Resolved Issues

+
    +
  • Fixed possible crash when profiling CUDA graphs on multiple GPUs.

  • +
  • Fixed the detection mechanism of the C2C interface, i.e. metric c2clink__present. The fix requires the display driver shipping with this release or any newer driver.

  • +
+
+
+

1.1.6. Updates in 2023.2.1

+

Resolved Issues

+
    +
  • Fixed a crash during application replay while having the temporary directory located on a network file system (NFS).

  • +
  • Improved detection mechanism for C2C interface. Added caching of the detected configuration to reduce overhead.

  • +
+
+
+

1.1.7. Updates in 2023.2

+

General

+
    +
  • Extended the rules system to show estimates of the potential speedup that can be achieved by addressing the corresponding performance bottleneck. These speedups allow prioritizing applicable rules and help focusing first on optimization strategies with the highest potential performance gain.

  • +
  • Added support for rules to highlight individual source lines. Lines with global/local memory access with high excessive sector counts and shared accesses with many bank conflicts are automatically detected and highlighted.

  • +
  • Added the ability to query metric attributes in NvRules API.

  • +
  • Added support for creating instanced metrics through the NvRules API.

  • +
  • For Orin+ mobile chips on the Linux aarch64 platform, added metrics (mcc__*) support for memory controller channel (MC Channel) unit which connects to the DRAM.

  • +
+

NVIDIA Nsight Compute

+
    +
  • Added hyperlinks to the SASS View of the Source Page for instructions that reference others by address or offset. This enables to quickly jump to the target instruction of a branch.

  • +
  • Improved the search bar in the Metric Details tool window. The search string now matches any part of the metric names, and the matching results are shown in a sorted order.

  • +
  • Added a visual indication of scale of the metric value changes when the baselines are used. The background bars in the table cells of the Details Page allow to quickly identify which metrics values increased or decreased the most. The color scheme can be configured in the Baselines tool window.

  • +
  • Added support for rules toggle button on the Summary Page. Allows to hide the bottom pane with the rules output for the selected kernel launch.

  • +
  • Added support for allowing users to configure properties on Summary Page using Metrics/Properties profile option.

  • +
  • Added percentage bars on Summary Page.

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Added support for tracking child processes launched with posix_spawn(p) when using --target-processes all.

  • +
  • Added support for tracking child processes launched with system() on Windows and Linux (aarch64, x86_64) when using --target-processes all.

  • +
+

Resolved Issues

+
    +
  • Fixed table alignment in the output of the NVIDIA Nsight Compute CLI on Windows when printing Unicode characters.

  • +
  • Fixed view corruption in the Source Page after switching from the collapsed view to the expanded view.

  • +
  • Fixed missing tooltip descriptions for some SASS instructions.

  • +
  • Fixed potential crash when copying from the Resources tool window using CTRL+C.

  • +
  • Fixed possible crash when restoring sections in the Sections tool window.

  • +
+
+
+

1.1.8. Updates in 2023.1.1

+

NVIDIA Nsight Compute

+
    +
  • Added new configuration options to set the default view mode and precision for the Source page.

  • +
+

Resolved Issues

+
    +
  • Added support for the DT_RUNPATH attribute when intercepting calls to dlopen. Fixed issue for applications or libraries relying on DT_RUNPATH not finding all dynamic libraries when launched by NVIDIA Nsight Compute.

  • +
  • Improved interaction between custom additional metrics and the selected metric set. Adding custom metrics no longer forces switching to the custom metric set.

  • +
  • Added ability to gracefully skip folders with insufficient access permissions while importing source code.

  • +
  • Fixed the calculation of the peak values for the L1 and L2 cache bandwidths in the hierarchical roofline charts.

  • +
  • Fixed issue that prevented modules loaded with function optixModuleCreateFromPTX showing up in the Optix: Modules table of the Resources tool window.

  • +
  • Fixed handling of deprecated functions when querying function pointers from the OptiX interception library.

  • +
  • Fixed that sometimes sections or rules couldn’t be easily selected in the tool window.

  • +
  • Fixed issue with Reset Application Data that prevented some setting from correctly resetting.

  • +
  • Fixed potential crash of NVIDIA Nsight Compute when Reset Application Data was executed multiple times in a row.

  • +
  • Fixed a crash when saving or loading baselines for non-kernel results.

  • +
  • Fixed that memory written while executing a CUDA graph was not properly restored in single-pass graph profiling.

  • +
  • Fixed potential memory leak while collecting SW counters for modules with unpatched kernel functions.

  • +
+
+
+

1.1.9. Updates in 2023.1

+

General

+
    +
  • Added support for the CUDA toolkit 12.1.

  • +
  • Added a new app-range replay mode to profile ranges without API capture by relaunching the entire application multiple times.

  • +
  • Added sharedBankConflicts sample CUDA application and document to show how NVIDIA Nsight Compute can be used to analyze and identify the shared memory bank conflicts which result in inefficient shared memory accesses. Refer to the README.TXT file, sample code and document under extras/samples/sharedBankConflicts.

  • +
  • Jupyter notebook samples are available in the Nsight training github repository.

  • +
  • The equivalent of the high-level Python report interface is now available in rule files.

  • +
+

NVIDIA Nsight Compute

+
    +
  • Added support for profiling individual metrics in Interactive Profile activity. A new input field for metrics was added in the Metric Selection tool window.

  • +
  • Files on remote systems can be opened directly from the menu.

  • +
  • Metric- and section-related entries in the menu, Profile activity and Metric Selection tool window were renamed to make them more clear.

  • +
  • CPU and GPU NUMA topology metrics can be collected on applicable systems. Topology information is shown in a new NUMA Affinity section.

  • +
  • Added content-aware suggestions to the Details page to provide suggestions based on the selected profiling options.

  • +
  • Added support for re-resolving source files on the Source page.

  • +
  • Not-issued warp stall reasons are removed from the Source Counters section tables and hidden by default on the Source page. Users should focus on regular warp stall reasons by default and only inspect not-issued samples if this distinction is needed.

  • +
  • Added support to search missing CUDA source files to permanently import into the report using Source Lookup options in the Interactive Profile activity.

  • +
  • The source page now shows metric values as percentages by default. New buttons are added to support switching between different value modes.

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Added support for config files in the current working or user directory to set default ncu parameters. See the General options for more details.

  • +
  • Added --range-filtercommand line option which allows to select subset of enabled profile ranges.

  • +
  • Added new --source-folderscommand line option that allows to recursively search for missing CUDA source files to permanently import into the report.

  • +
+

Resolved Issues

+
    +
  • Fixed performance issues on the Summary and Raw pages for large reports.

  • +
  • Improved support for non-ASCII characters in filenames.

  • +
  • Fixed an issue with delayed updates of assembly analysis information on the Source page’s Source and PTX views.

  • +
  • Fixed potential crashes when using the Python report interface.

  • +
+
+
+

1.1.10. Updates in 2022.4.1

+

General

+
    +
  • Improved the documentation for the NvRules API.

  • +
  • The python report interface links libstdc++ statically.

  • +
+

Resolved Issues

+
    +
  • Fixed an issue that enabled profiling on CUDA Graph uploads.

  • +
  • Fixed formatting issues during unit conversion of metric instances.

  • +
  • Fixed an issue that could lead to a crash during application replay.

  • +
  • Fixed an issue that could lead to a crash in the python report interface.

  • +
  • Fixed typos in the metrics reference documentation and descriptions.

  • +
+
+
+

1.1.11. Updates in 2022.4

+

General

+
    +
  • Added support for the CUDA toolkit 12.0.

  • +
+
    +
  • Added support for profiling CUDA graphs as complete workloads instead of as single kernel nodes. Enable this using the Graph Profiling option in the activities. Similarly to range replay results, selected metrics are not available when profiling graphs.

  • +
+
    +
  • Added support for profiling on Windows Subsystem for Linux (WSL2). See the System Requirements for more details.

  • +
  • Deprecated nv-nsight-cu and nv-nsight-cu-cli aliases are removed in favor of ncu-ui and ncu.

  • +
+

NVIDIA Nsight Compute

+
    +
  • The Source page now loads disassembly and static analysis results asynchronously in the background.

  • +
  • Added a new Metric Details tool window to inspect metric information such as raw value, unit, description or instance values. Open the tool window and select a metric on the Details or Raw page or lookup any metric in the focused report directly in the tool window’s search bar.

  • +
  • In the Source page PTX view, the source name will be shown as a list of comma-separated files.

  • +
  • Added flexibility with NVTX based filtering in the Next Trigger filter, similar to the command line. Filters can now use nvtx-include and nvtx-exclude expressions by adding the nvtx-include: or nvtx-exclude: prefix.

  • +
  • NVTX views now show the payload type.

  • +
  • Simplified the command line generated by the Profile activity.

  • +
  • Reduced the number of steps required to re-run the Profile activity.

  • +
  • The way to rename Baselines in-place has been improved.

  • +
  • The Resources tool window now shows the CUDA Dynamic Parallelism state for CUDA functions and modules.

  • +
  • OptiX traversable handles can now be exported as Graphviz DOT or SVG files for visualization from the Resources tool window.

  • +
  • All OptiX build, instance and geometry flags can be viewed in the Acceleration Structure Viewer.

  • +
  • Added OptiX-specific highlight filters to the Acceleration Structure Viewer.

  • +
  • Added support for user-specified index strides to the Acceleration Structure Viewer.

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Added new option --graph-profiling graph to enable profiling of complete CUDA graphs as single workloads.

  • +
+
    +
  • Added new option --filter-mode per-launch-config to enable filtering of kernel launches for each GPU launch parameter separately.

  • +
  • Added support to print section body item metrics on the details page with the new --print-detailscommand line option.

  • +
  • Added support to select what to show in Metric Name column on the details page with the new --print-metric-namecommand line option.

  • +
  • Removed deprecated options: --units, --fp, --summary and --kernel-base

  • +
  • Added support to print launch, session, process and device attributes on session page with the new --page session option.

  • +
  • Added --kill yes support for application replay mode.

  • +
+

Resolved Issues

+
    +
  • Fixed an issue that NVIDIA Nsight Compute could crash when continuing profiling after transposing the Raw page table.

  • +
  • Fixed an issue that caused closing a report document to be delayed by pending source analysis.

  • +
  • Fixed support for profiling applications with older OptiX versions.

  • +
  • Fixed display of OptiX module inputs for IR and built-in modules.

  • +
+
+
+

1.1.12. Updates in 2021.2.9

+

NVIDIA Nsight Compute

+
    +
  • Clarify when not all metrics for the roofline chart could be collected on the current chip.

  • +
+
+
+

1.1.13. Older Versions

+
+

Updates in 2022.3

+

General

+
    +
  • Added support for the CUDA toolkit 11.8.

  • +
  • Added support for the Ada GPU architecture.

  • +
  • Added support for the Hopper GPU architecture.

  • +
  • Added support for OptiX 7.6.

  • +
  • Added uncoalescedGlobalAccesses sample CUDA application and document to show how the NVIDIA Nsight Compute profiler can be used to analyze and identify the memory accesses which are uncoalesced and result in inefficient DRAM accesses. Refer to the README, sample code and document under extras/samples/uncoalescedGlobalAccesses.

  • +
  • Added Metrics Reference in the documentation that lists metrics not available through --query-metrics.

  • +
  • Reduced the overhead of collecting SASS-patching based metrics.

  • +
  • On Multi-Instance GPU (MIG) configurations, NVIDIA Nsight Compute cannot lock clocks anymore. Users are expected to lock clocks externally using nvidia-smi.

  • +
+

NVIDIA Nsight Compute

+
    +
  • Wrapper script nv-nsight-cu is deprecated in favor of ncu-ui and will be removed in a future release.

  • +
  • Source page supports range replay results.

  • +
  • Added a second chart on the Compute Workload Analysis section to avoid mixing metrics with different meaning.

  • +
  • NVIDIA Nsight Compute now tracks traversable handles created with optixAccelRelocate.

  • +
  • NVIDIA Nsight Compute now tracks traversable handles created as updates from others.

  • +
  • The Acceleration Structure viewer now reports unsupported inputs.

  • +
  • The Acceleration Structure viewer now supports opening multiple traversable handles.

  • +
  • The Acceleration Structure viewer now uses OptiX naming for displayed elements.

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Wrapper script nv-nsight-cu-cli is deprecated in favor of ncu and will be removed in a future release.

  • +
  • Added new option --filter-mode per-gpu to enable filtering of kernel launches on each GPU separately.

  • +
  • Added new option --app-replay-mode relaxed to produce profiling results for valid kernels even if the number of kernel launches is inconsistent across application replay passes.

  • +
  • Added a documentation section on supported environment variables.

  • +
  • Improved the performance when loading existing reports on the command line.

  • +
+

Resolved Issues

+
    +
  • Fixed an issue when resolving files on the Source page.

  • +
  • Fixed an issue when profiling OptiX applications.

  • +
  • Fixed an issue in the OptiX traversable handle management caused by clashing handle values.

  • +
  • Fixed an issue in the Acceleration Structure viewer causing the display of invalid memory when viewing AABB buffers.

  • +
+
+
+

Updates in 2022.2.1

+

Resolved Issues

+
    +
  • Fixed an issue that caused some tootips to not show up for the charts on the Details page.

  • +
  • Fixed the incorrect reporting of the accessed bytes for LDGSTS (access) traffic in the L1TEX memory table.

  • +
  • Fixed an issue that resulted in an empty view on the Source page after resolving multiple source files at once.

  • +
  • Fixed a failure to connect to remote machines over SSH due to a mismatch in the configuration of data compression.

  • +
  • Fixed a potential failure to profile kernels on multiple devices of the same type of chip. The failure occurred on the attempt to profile on the second device.

  • +
+
+
+

Updates in 2022.2

+

General

+
    +
  • Added support for the CUDA toolkit 11.7.

  • +
  • Improved performance for profiling and metric query.

  • +
  • Added Linux (aarch64 sbsa) as a supported host platform.

  • +
  • The NVIDIA Nsight Compute CLI stores the command line arguments, which can be viewed in the Session report page.

  • +
  • Added an API to query the version of the Python Report and NvRules interfaces.

  • +
  • Added an API to query the PTX in the Python Report and NvRules interfaces.

  • +
+

NVIDIA Nsight Compute

+
    +
  • The Acceleration Structure Viewer allows inspection of acceleration structures built using the OptiX API for debugging and performance optimization.

  • +
  • The Source page column chooser now supports to enable or disable groups of metrics. Note that not all metrics are enabled anymore by default to make the view easier to use.

  • +
  • The Resources tool window now links to the exact target resource instances for CUDA resource types.

  • +
  • The Resources tool window now shows the instanced nodes for CUDA graphs.

  • +
  • The Resources tool window now shows the loading state and number of loaded functions for CUDA Modules.

  • +
  • The Resources tool window now shows the graph node enablement state for applicable instanced graph nodes.

  • +
  • The Resources tool window now shows the graph node priorities for instanced kernel graph nodes.

  • +
  • Added regex support in the Next Trigger filter for NVTX based filtering. The Next Trigger filter now considers the NVTX config as a regular expression if the regex: prefix is specified.

  • +
  • Added regex support in the report’s Filter Results dialog.

  • +
  • Added keyboard shortcuts to navigate between the pages in a report.

  • +
  • The behavior for selecting sets and sections is now consistent between the Sections/Rules Info window and the non-interactive profile activity.

  • +
  • Reports can now be opened directly from the welcome dialog.

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Added support for collecting sampling-based warp stalls in range replay mode.

  • +
  • Added regex support in NVTX filtering.

  • +
  • The metric type is shown when querying metrics.

  • +
+

Resolved Issues

+
    +
  • Reduced overhead of connecting to the host UI for non-interactive remote profiling sessions.

  • +
  • Fixed issues with persisting the Source page state when collapsing or switching between results.

  • +
  • Fixed an issue that locked GPU clocks were not reset when terminating the NVIDIA Nsight Compute CLI while profiling a kernel.

  • +
  • Fixed issues with selecting and copying text from the Details page tables.

  • +
  • Fixed an issue with opening report files in the UI on MacOSX.

  • +
  • Fixed an issue with the Freeze API option.

  • +
+
+
+

Updates in 2022.1.1

+

General

+
    +
  • Filtering kernel launches or profile results based on NVTX domains/ranges now takes registered strings in the payload field into account, if the range name is empty.

  • +
  • Added support for the suffix .max_rate for ratio metrics.

  • +
+

Resolved Issues

+
    +
  • Fixed a crash during the disassembly of the kernel’s SASS code for the Source page.

  • +
  • Fixed a crash on exit of the NVIDIA Nsight Compute UI.

  • +
  • Fixed a hang during profiling when CPU call stack collection is enabled.

  • +
  • Fixed missing to flush UVM buffers before taking memory checkpoints during Range Replay.

  • +
  • Fixed tracking of memory during Range Replay, if the CUDA context has any device mapped memory allocations.

  • +
  • Fixed the maximum available shared memory sizes in the Occupancy Calculator for NVIDIA Ampere GPUs.

  • +
  • Fixed that the shared memory usage of the kernel is incorrectly initialized when opening the Occupancy Calculator from a profile report.

  • +
+
+
+

Updates in 2022.1

+

General

+
    +
  • Added support for the CUDA toolkit 11.6.

  • +
+
    +
  • Added support for GA103 chips.

  • +
+
    +
  • Added a new Range Replay mode to profile ranges of multiple, concurrent kernels. Range replay is available in the NVIDIA Nsight Compute CLI and the non-interactive Profile activity.

  • +
  • Added a new rule to detect non-fused floating-point instructions.

  • +
  • The Uncoalesced Memory access rules now show results in a dynamic table.

  • +
  • Unix Domain Sockets and Windows Named Pipes are used for local connection between the host and target processes on x86_64 Linux and Windows, respectively.

  • +
  • The NvRules API now supports querying action names using different function name bases (e.g. demangled).

  • +
+

NVIDIA Nsight Compute

+
    +
  • The default report page is now chosen automatically when opening a report.

  • +
  • Added coverage for ECC (Error Correction Code) operations in the L2 Cache table of the Memory Analysis section.

  • +
  • Added a new L2 Evict Policies table to the Memory Analysis section.

  • +
  • The Occupancy Calculator now updates automatically when the input changes.

  • +
  • Added new metric Thread Instructions Executed to the Source page.

  • +
  • Added tooltips to the Register Dependency columns in the Source page to identify the associated register more conveniently.

  • +
  • Improved the selection of Sections and Sets in the Profile activity connection dialog.

  • +
  • NVLink utilization is shown in the NVLink Tables section.

  • +
  • NVLink links are colored according to the measured throughput.

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • --kernel-regex and --kernel-regex-base options are no longer supported. Alternate options are --kernel-name and --kernel-name-base respectively, added in 2021.1.0.

  • +
  • Added support to resolve CUDA source files in the --page source output with the new --resolve-source-filecommand line option.

  • +
  • Added new option --target-processes-filter to filter the processes being profiled by name.

  • +
  • The CPU Stack Trace is shown in the NVIDIA Nsight Compute CLI output.

  • +
+

Resolved Issues

+
    +
  • Fixed the calculation of aggregated average instruction execution metrics in non-SASS views on the Source page.

  • +
  • Fixed that atomic instructions are counted as both loads and stores in the Memory Analysis tables.

  • +
+
+
+

Updates in 2021.3.1

+

Resolved Issues

+
    +
  • Fixed that kernels with the same name and launch configuration were in some scenarios associated with the wrong profiling results during application replay.

  • +
  • Fixed an issue with binary forward compatibility of the report format.

  • +
  • Fixed an issue with applications calling into the CUDA API during process teardown.

  • +
  • Fixed an issue profiling application using pre-CUDA API 3.1 contexts.

  • +
  • Fixed a crash when resolving files on the Source page.

  • +
  • Fixed that opening reports with large embedded CUBINs would hang the UI.

  • +
  • Fixed an issue with remote profiling on a target where the UI is already launched.

  • +
+
+
+

Updates in 2021.3

+

General

+
    +
  • Added support for the CUDA toolkit 11.5.

  • +
  • Added a new rule for detecting inefficient memory access patterns in the L1TEX cache and L2 cache.

  • +
  • Added a new rule for detecting high usage of system or peer memory.

  • +
  • Added new IAction::sass_by_pc function to the the NvRules API.

  • +
  • The Python-based report interface is now available for Windows and MacOS hosts, too.

  • +
  • Added Hierarchical Roofline section files in a new “roofline” section set.

  • +
  • Added support for collecting CPU call stack information.

  • +
+

NVIDIA Nsight Compute

+
    +
  • Added support for new remote profiling SSH connection and authentication options as well as local SSH configuration files.

  • +
  • Added an Occupancy Calculator which can be opened directly from a profile report or as a new activity. It offers feature parity to the CUDA Occupancy Calculator spreadsheet.

  • +
  • Added new Baselines tool window to manage (hide, update, re-order, save/load) baseline selections.

  • +
  • The Source page views now support multi-line/cell selection and copy/paste. Different colors are used for highlighting selections and correlated lines.

  • +
  • The search edit on the Source page now supports Shift+Enter to search in reverse direction.

  • +
  • The Memory Workload Analysis Chart can be configured to show throughput values instead of transferred bytes.

  • +
  • The Profile activity now supports the --devices option.

  • +
  • The NVLink Topology diagram displays per NVLink metrics.

  • +
  • Added a new tool window showing the CPU call stack at the location where the current thread was suspended during interactive profiling activities.

  • +
  • If enabled, the Call Stack / NVTX page of the profile report shows the captured CPU call stack for the selected kernel launch.

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Added support for printing source/metric content with the new --page source and --print-sourcecommand line options.

  • +
  • Added new option --call-stack to enable collecting the CPU call stack for every profiled kernel launch.

  • +
+

Resolved Issues

+
    +
  • Fixed that memory_* metrics could not be collected with the --metrics option.

  • +
  • Fixed that selection and copy/paste was not supported for section header tables on the Details page.

  • +
  • Fixed issues with the Source page when collapsing the content.

  • +
  • Fixed that the UI could crash when applying rules to a new profile result.

  • +
  • Fixed that PC Sampling metrics were not available for Profile Series.

  • +
  • Fixed that local profiling did not work if no non-loopback address was configured for the system.

  • +
  • Fixed termination of remote-launched applications. On QNX, terminating an application profiled via Remote Launch is now supported. Canceling remote-launched Profile activities is now supported.

  • +
+
+
+

Updates in 2021.2.8

+

General

+
    +
  • Updated Python libraries to version 3.10.5.

  • +
+
+
+

Updates in 2021.2.7

+

General

+
    +
  • Enabled stack canaries with random canary values for L4T builds.

  • +
+
+
+

Updates in 2021.2.6

+

Resolved Issues

+
    +
  • Fixed an issue causing a hang on QNX after pressing ctrl+c while profiling a multi-process application.

  • +
+
+
+

Updates in 2021.2.5

+

Resolved Issues

+
    +
  • Improve the handling of the performance monitor reservation on mobile target GPUs.

  • +
+
+
+

Updates in 2021.2.4

+

Resolved Issues

+
    +
  • Fixed an issue that prevented remote interactive profiling of kernels on NVIDIA GA10b chips.

  • +
+
+
+

Updates in 2021.2.3

+

General

+
    +
  • Added support for the NVIDIA GA10b chip.

  • +
+

Resolved Issues

+
    +
  • Improved error message on QNX for failure to deploy stock section and rules files.

  • +
+
+
+

Updates in 2021.2.2

+

General

+
    +
  • Changes for profiling support on NVIDIA virtual GPUs (vGPUs) for an upcoming GRID/vGPU release.

  • +
+

Resolved Issues

+
    +
  • Fixed hang issue on QNX when using the --target-processes all option while profiling shell scripts.

  • +
+
+
+

Updates in 2021.2.1

+

General

+ +

Resolved Issues

+
    +
  • Fixed that links in the Memory Allocations Resource view were not working correctly.

  • +
  • Fixed that NVTX state might not be correctly reset between interactive profiling activities.

  • +
  • Fixed that the UI could crash when opening baselines from different GPU architectures.

  • +
+
+
+

Updates in 2021.2

+

General

+
    +
  • Added support for the CUDA toolkit 11.4.

  • +
  • Added support for OptiX version 7.3.

  • +
  • Added support for profiling on NVIDIA virtual GPUs (vGPUs) on an upcoming GRID/vGPU release.

  • +
  • Added a new Python-based report interface for interacting with report files from Python scripts.

  • +
  • Added a new rule to warn users when sampling metrics were selected, but no sampling data was collected.

  • +
  • Renamed SOL to Throughput in the Speed of Light section.

  • +
  • Renamed several memory_* metrics used on the Source page, to better reflect the measured value. See the Source page documentation for more details.

  • +
+

NVIDIA Nsight Compute

+
    +
  • Added support for opening cubin files in a Standalone Source Viewer without profiling the application.

  • +
  • Moved the output of all rules so that it is visible even if a section’s body is collapsed. Visibility of the rules’ output can be toggled by a new button in the report header.

  • +
  • The profiler report header now shows the report name for each baseline when ambiguous.

  • +
  • Rules can define Focused Metrics that were most important for triggering their result output. Metrics are provided per result message which additional information, such as the underlying conditions and thresholds.

  • +
  • Memory tables show tooltips for cells with derived metric calculations.

  • +
  • Added a knowledge base service to show more comprehensive background information on metric names and descriptions in their tooltips.

  • +
  • Following a link in the Source Counters hot spot tables automatically selects the corresponding metric in the Source page.

  • +
  • Added new columns for visualizing register dependencies in the SASS view of the Source page.

  • +
  • Functions in the SASS view are now sorted by name.

  • +
  • Added support for OptiX 7.x resource tracking in the interactive profile activity. The Resources tool window will show information on instantiated optixDeviceContexts, optixModules, optixProgramGroups, optixPipelines and optixDenoiser objects.

  • +
  • Added support for new CUDA graph memory allocation APIs.

  • +
  • Improved consistency between command line parameters and the Next Trigger filter in the API Stream window for handling of regex inputs. The Next Trigger filter now considers kernel/API name as a regular expression only if string has regex: as prefix.

  • +
  • Added ability to select font settings in the options dialog.

  • +
  • Added ability to configure the metrics shown on the summary page via the options dialog.

  • +
  • The selected heatmap color scale now also applies to the Memory chart.

  • +
  • The ncu-ui script now checks for missing library dependencies, such as OpenGL or Qt.

  • +
+

NVIDIA Nsight Compute CLI

+ +

Resolved Issues

+
    +
  • Fixed a performance issue in the NVIDIA Nsight Compute CLI when using --page raw --csv --units auto.

  • +
  • Fixed that the SSH passphase key is no longer persisted in the project file.

  • +
  • Fixed state of restore button in connection dialog. The button now supports restoring the default settings, if current setting differ from the default.

  • +
  • Fixed that the complete GPU name can be shown in the NVLINK topology diagram on MacOS.

  • +
  • Fixed that collapsing the Source view reset the selected metrics.

  • +
  • Fixed that correlated lines could differ between filtered and unfiltered views of the executed functions.

  • +
  • Fixed that two application icons were shown in the MacOS dock.

  • +
  • Improved HiDPI awareness.

  • +
+
+
+

Updates in 2021.1.1

+

General

+
    +
  • Updated OpenSSL library to version 1.1.1k.

  • +
+

NVIDIA Nsight Compute

+
    +
  • Remote source resolution can now use the IP address, in addition to the hostname, to find the necessary SSH target.

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Added support for the existing command line options for kernel filtering while importing data from an existing report file using --import.

  • +
  • Option -k is not considered as deprecated option --kernel-regex anymore.

  • +
+

Resolved Issues

+
    +
  • Fixed failure to profile kernels from applications that use the CUDA graphics interop APIs to share semaphores.

  • +
  • Fixed wavefront metric in the L1TEX table for writes to shared memory on GA10x chips.

  • +
  • Fixed an issue resulting in incomplete data collection for the interactive profile activity after switching from single-pass mode to collecting multiple passes in the same session.

  • +
  • Fixed values shown in the mimimap of the Source page when all functions are collapsed.

  • +
  • Fixed an issue causing names set by the NVTX naming APIs of one application to be applied to all subsequent sessions of the same instance of NVIDIA Nsight Compute.

  • +
  • Fixed behavior of horizontal scroll bars when clicking in the source views on the Source page.

  • +
  • Fixed appearance of multi-line entries in column chooser on the Source page.

  • +
  • Fixed enablement state of the reset button on the Connection dialog.

  • +
  • Fixed potential crash of NVIDIA Nsight Compute when windows size becomes small while being on the Source page.

  • +
  • Fixed potential crash of NVIDIA Nsight Compute when relative paths for section/rules files could not be found.

  • +
  • Fixed potential crash of NVIDIA Nsight Compute after removing baselines.

  • +
+
+
+

Updates in 2021.1

+

General

+
    +
  • Added support for the CUDA toolkit 11.3.

  • +
  • Added support for the OptiX 7 API.

  • +
  • GpuArch enumeration values used for filtering in section files were renamed from architecture names to compute capabilities.

  • +
  • NVTX states can now be accessed via the NvRules API.

  • +
  • Added a rule for the Occupancy section.

  • +
+

NVIDIA Nsight Compute

+
    +
  • Added support for new CUDA asynchronous allocator attributes in the Memory Pools resources view.

  • +
  • Added a topology chart and link properties table in the NVLink section.

  • +
  • The selected metric column is scrolled into view on the Source page when a new metric is selected.

  • +
  • Users can choose the Source heatmap color scale in the Options dialog.

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Added file-based application replay as the new default application replay mode. File-based replay uses a temporary file for keeping replay data, instead of allocating them in memory. This keeps the required memory footprint close to constant, independent of the number of profiled kernels. Users can switch between buffer modes using the --app-replay-buffer option.

  • +
  • CLI output now shows NVTX color and message information.

  • +
  • --kernel-regex and --kernel-regex-base> options are deprecated and replaced by --kernel-name and --kernel-regex-base, respectively.

  • +
  • All options which support regex need to provide regex: as a prefix before an argument to match per the regex, e.g <option> <regex:expression>

  • +
+

Resolved Issues

+
    +
  • Fixed that baselines were not updated properly on the Comments page.

  • +
  • Fixed that NVTX ranges named using their payloads can be used in NVTX filtering expressions.

  • +
  • Fixed crashes in MacOSX hosts when terminating the target application.

  • +
  • The NVLINK(nvl*) metrics are now added back.

  • +
+
+
+

Updates in 2020.3.1

+

General

+
    +
  • Added support for LDSM instruction-level metrics.

  • +
+

NVIDIA Nsight Compute

+
    +
  • LDSM instruction-level metrics are shown in the Source page and memory tables.

  • +
  • Improved reporting and documentation for collecting Profile Series.

  • +
  • Frozen columns in the Source page are automatically scrolled into view.

  • +
+

Resolved Issues

+
    +
  • Fixed an issue when profiling multi-threaded applications.

  • +
  • Fixed an issue that NVIDIA Nsight Compute would not automatically restart when using Reset Application Data.

  • +
  • Fixed issues with target applications using libstdc++.

  • +
  • Fixed an issue when collecting single-pass metrics in multiple Nsight Compute instances.

  • +
  • Fixed an issue when using Kernel ID and setting Launch Capture Count as non-zero in the UI’s Profile activity.

  • +
  • Fixed an issue that prevented different users on the same Linux system to use NVIDIA Nsight Compute in shared instance mode.

  • +
  • Fixed an issue that prevented resources from being properly renamed using NVTX information in the UI.

  • +
+
+
+

Updates in 2020.3

+

General

+
    +
  • Added support for derived metrics in section files. Derived metrics can be used to create new metrics based on existing metrics and constants. See the Customization Guide for details.

  • +
  • Added a new Import Source (--import-source) option to the UI and command line to permanently import source files into the report, when available.

  • +
  • Added a new section that shows selected NVLink metrics on supported systems.

  • +
  • Added a new launch__func_cache_config metric to the Launch Statistics section.

  • +
  • Added new branch efficiency metrics to the Source Counters section, including smsp__sass_average_branch_targets_threads_uniform.pct to replace nvprof’s branch_efficiency, as well as instruction-level metrics smsp__branch_targets_threads_divergent, smsp__branch_targets_threads_uniform and branch_inst_executed.

  • +
  • A warning is shown if kernel replay starts staging GPU memory to CPU memory or the file system.

  • +
  • Section and rule files are deployed to a versioned directory in the user’s home directory to allow easier editing of those files, and to prevent modifying the base installation.

  • +
  • Removed support for NVLINK(nvl*) metrics due to a potential application hang during data collection. The metrics will be added back in a future version of the driver/tool.

  • +
+

NVIDIA Nsight Compute

+
    +
  • Added support for Profile Series. Series allow you to profile a kernel with a range of configurable parameters to analyze the performance of each combination.

  • +
  • Added a new Allocations view to the Resources tool window which shows the state of all current memory allocations.

  • +
  • Added a new Memory Pools view to the Resources tool window which shows the state of all current memory pools.

  • +
  • Added coverage of peer memory to the Memory Chart.

  • +
  • The Source page now shows the number of excessive sectors requested from L1 or L2, e.g. due to uncoalesced memory accesses.

  • +
  • The Source column on the Source page can now be scrolled horizontally.

  • +
  • The kernel duration gpu__time_duration.sum was added as column on the Summary page.

  • +
  • Improved the performance of application replay when not all kernels in the application are profiled.

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Added a new --app-replay-match option to select the mechanism used for matching kernel instances across application replay passes.

  • +
  • An error is shown if --nvtx-include/exclude are used without --nvtx.

  • +
+

Resolved Issues

+
    +
  • The Grid Size column on the Raw page now shows the CUDA grid size like the Launch Statistics section, rather than the combined grid and block sizes.

  • +
  • The Branch Resolving wap stall reason was added to the PC sampling metric groups and the Warp State Statistics section.

  • +
  • The API Stream tool window shows kernel names according to the selected Function Name Mode.

  • +
  • Fixed that an incorrect line could be shown after a heatmap selection on the Source page.

  • +
  • Fixed incorrect metric usage for system memory in the Memory Chart. Previously, all requested memory of L2 from system memory was reported instead of only the portion that missed in L2.

  • +
+
+
+

Updates in 2020.2.1

+

Resolved Issues

+
    +
  • Fixed several issues related to auto-profiling in the UI.

  • +
  • Fixed a metric collection issue when profiling kernels on different GPU architectures with application replay.

  • +
  • Fixed a performance problem related to profiling large process trees.

  • +
  • Fixed that occupancy charts would not render correctly when comparing against baselines.

  • +
  • Fixed that no memory metrics were shown on the Source page for LDGSTS instructions.

  • +
  • Fixed the automatic sorting on the Summary and Raw pages.

  • +
  • Fixed an issue that would cause the NVIDIA Nsight Compute CLI to consume too much memory when importing or printing reports.

  • +
  • Long kernel names are now elided in the Details page source hot spot tables.

  • +
  • Fixed that function names in the Resources tool window were demangled differently.

  • +
+
+
+

Updates in 2020.2

+

General

+
    +
  • Added support for the NVIDIA Ampere GPUs with compute capability 8.6 and CUDA toolkit 11.1.

  • +
  • Added support for application replay to collect metric results across multiple application runs, instead of replaying individual kernels.

  • +
  • Added new launch__device_id metric.

  • +
  • Added support for NVLink (nvl*) metrics for GPUs with compute capabilities 7.0, 7.5 and 8.0

  • +
  • Added documentation for memory charts and tables in the Profiling Guide.

  • +
+

NVIDIA Nsight Compute

+
    +
  • Updated menu and toolbar layout.

  • +
  • Added support for zoom and pan on roofline charts.

  • +
  • The Resources tool window shows the current CUDA stream attributes.

  • +
  • The memory chart shows a heatmap for link and port utilization.

  • +
  • The hot-spot tables in the Source Counters section now show values as percentages, too.

  • +
  • On-demand resolve of remote CUDA-C source is now available for MacOS hosts.

  • +
  • Metric columns in the Summary and Raw pages are now sortable.

  • +
  • Added a new option to set the number of recent API calls shown in the API Stream tool window.

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • CLI output now shows NVTX payload information.

  • +
  • CSV output now shows NVTX states.

  • +
  • Added a new --replay-mode option to select the mechanism used for replaying a kernel launch multiple times.

  • +
  • Added a new --kill option to terminate the application once all requested kernels were profiled.

  • +
  • Added a new --log-file option to decide the output stream for printing tool output.

  • +
  • Added a new --check-exit-code option to decide if the child application exit code should be checked.

  • +
+

Resolved Issues

+
    +
  • The profiling progress dialog is not dismissed automatically anymore after an error.

  • +
  • The inter-process lock is now automatically given write permissions for all users.

  • +
  • All project extensions are enabled in the default dialog filter.

  • +
  • Fixed handling of targets using tcsh during remote profiling.

  • +
  • Fixed handling of quoted application arguments on Windows.

  • +
+
+
+

Updates in 2020.1.2

+

General

+
    +
  • The NVIDIA Nsight Compute installer for Mac is now code-signed and notarized.

  • +
  • Disabled the creation of the Python cache when executing rules to avoid permission issues and signing conflicts.

  • +
+

Resolved Issues

+
    +
  • Fixed the launcher script of the NVIDIA Nsight Compute CLI to no longer fail if uname -p is not available.

  • +
  • Fixed the API parameter capture for function cuDeviceGetLuid.

  • +
+
+
+

Updates in 2020.1.1

+

General

+
    +
  • Added support for the NVIDIA GA100/SM 8.x GPU architecture

  • +
+
    +
  • Metrics passed to --metrics on the NVIDIA Nsight Compute CLI or in the respective Profile activity option are automatically expanded to all first-level sub-metrics if required. See the documentation on --metrics for more details.

  • +
  • Added new rules for detecting inefficiencies of using the sparse data compression on the NVIDIA Ampere architecture.

  • +
  • The version of the NVIDIA Nsight Compute target collecting the results is shown in the Session page.

  • +
  • Added new launch__grid_dim_[x,y,z] and launch__block_dim_[x,y,z] metrics.

  • +
+

NVIDIA Nsight Compute

+
    +
  • The Break on API Error functionality has been improved when auto profiling.

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • The full path to the report output file is printed after profiling.

  • +
  • Added and corrected metrics in the nvprof Metric Comparison table.

  • +
+

Resolved Issues

+
    +
  • Documented the breakdown: metrics prefix.

  • +
  • Fixed handling of escaped domain delimiters in NVTX filter expressions.

  • +
  • Fixed issues with the occupancy charts for small block sizes.

  • +
  • Fixed an issue when choosing a default report page in the options dialog.

  • +
  • Fixed that the scroll bar could overlap the content when exporting the report page as an image.

  • +
+
+
+

Updates in 2020.1

+

General

+
    +
  • Added support for the NVIDIA GA100/SM 8.x GPU architecture

  • +
  • Removed support for the Pascal SM 6.x GPU architecture

  • +
  • Windows 7 is not a supported host or target platform anymore

  • +
  • Added a rule for reporting uncoalesced memory accesses as part of the Source Counters section

  • +
  • Added support for report name placeholders %p, %q, %i and %h

  • +
  • The Kernel Profiling Guide was added to the documentation

  • +
+

NVIDIA Nsight Compute

+
    +
  • The UI command was renamed from nv-nsight-cu to ncu-ui. Old names remain for backwards compatibility.

  • +
  • Added support for roofline analysis charts

  • +
  • Added linked hot spot tables in section bodies to indicate performance problems in the source code

  • +
  • Added section navigation links in rule results to quickly jump to the referenced section

  • +
  • Added a new option to select how kernel names are shown in the UI

  • +
  • Added new memory tables for the L1/TEX cache and the L2 cache. The old tables are still available for backwards compatibility and moved to a new section containing deprecated UI elements.

  • +
  • Memory tables now show the metric name as a tooltip

  • +
  • Source resolution now takes into account file properties when selecting a file from disk

  • +
  • Results in the profile report can now be filtered by NVTX range

  • +
  • The Source page now supports collapsing views even for single files

  • +
  • The UI shows profiler error messages as dismissible banners for increased visibility

  • +
  • Improved the baseline name control in the profiler report header

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • The CLI command was renamed from nv-nsight-cu-cli to ncu. Old names remain for backwards compatibility.

  • +
  • Queried metrics on GV100 and newer chips are sorted alphabetically

  • +
  • Multiple instances of NVIDIA Nsight Compute CLI can now run concurrently on the same system, e.g. for profiling individual MPI ranks. Profiled kernels are serialized across all processes using a system-wide file lock.

  • +
+

Resolved Issues

+
    +
  • More C++ kernel names can be properly demangled

  • +
  • Fixed a free(): invalid pointer error when profiling applications using pytorch > 19.07

  • +
  • Fixed profiling IBM Spectrum MPI applications that require PAMI GPU hooks (--smpiargs="-gpu")

  • +
  • Fixed that the first kernel instruction was missed when computing sass__inst_executed_per_opcode

  • +
  • Reduced surplus DRAM write traffic created from flushing caches during kernel replay

  • +
  • The Compute Workload Analysis section shows the IMMA pipeline on GV11b GPUs

  • +
  • Profile reports now scroll properly on MacOS when using a trackpad

  • +
  • Relative output filenames for the Profile activity now use the document directory, instead of the current working directory

  • +
  • Fixed path expansion of ~ on Windows

  • +
  • Memory access information is now shown properly for RED assembly instructions on the Source page

  • +
  • Fixed that user PYTHONHOME and PYTHONPATH environment variables would be picked up by NVIDIA Nsight Compute, resulting in locale encoding issues.

  • +
+
+
+

Updates in 2019.5.3

+

General

+
    +
  • More C++ kernel names can be properly demangled

  • +
+
+
+

Updates in 2019.5.2

+

General

+
    +
  • Bug fixes

  • +
+
+
+

Updates in 2019.5.1

+

General

+
    +
  • Added support for Nsight Compute Visual Studio Integration

  • +
+
+
+

Updates in 2019.5

+

General

+
    +
  • Added section sets to reduce the default overhead and make it easier to configure metric sets for profiling

  • +
  • Reduced the size of the installation

  • +
  • Added support for CUDA Graphs Recapture API

  • +
  • The NvRules API now supports accessing correlation IDs for instanced metrics

  • +
  • Added breakdown tables for SOL SM and SOL Memory in the Speed Of Light section for Volta+ GPUs

  • +
+

NVIDIA Nsight Compute

+
    +
  • Added a snap-select feature to the Source page heatmap help navigate large files

  • +
  • Added support for loading remote CUDA-C source files via SSH on demand for Linux x86_64 targets

  • +
  • Charts on the Details page provide better help in tool tips when hovering metric names

  • +
  • Improved the performance of the Source page when scrolling or collapsing

  • +
  • The charts for Warp States and Compute pipelines are now sorted by value

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Added support for GPU cache control, see --cache-control

  • +
  • Added support for setting the kernel name base in command line output, see --kernel-base

  • +
  • Added support for listing the available names for --chips, see --list-chips

  • +
  • Improved the stability on Windows when using --target-processes all

  • +
  • Reduced the profiling overhead for small metric sets in applications with many kernels

  • +
+

Resolved Issues

+
    +
  • Reduced the overhead caused by demangling kernel names multiple times

  • +
  • Fixed an issue that kernel names were not demangled in CUDA Graph Nodes resources window

  • +
  • The connection dialog better disables unsupported combinations or warns of invalid entries

  • +
  • Fixed metric thread_inst_executed_true to derive from smsp_not_predicated_off_thread_inst_executed on Volta+ GPUs

  • +
  • Fixed an issue with computing the theoretical occupancy on GV100

  • +
  • Selecting an entry on the Source page heatmap no longer selects the respective source line, to avoid losing the current selection

  • +
  • Fixed the current view indicator of the Source page heatmap to be line-accurate

  • +
  • Fixed an issue when comparing metrics from Pascal and later architectures on the Summary page

  • +
  • Fixed an issue that metrics representing constant values on Volta+ couldn’t be collected without non-constant metrics

  • +
+
+
+

Updates in 2019.4

+

General

+
    +
  • Added support for the Linux PowerPC target platform

  • +
  • Reduced the profiling overhead, especially if no source metrics are collected

  • +
  • Reduced the overhead for non-profiled kernels

  • +
  • Improved the deployment performance during remote launches

  • +
  • Trying to profile on an unsupported GPU now shows an “Unsupported GPU” error message

  • +
  • Added support for the %i sequential number placeholder to generate unique report file names

  • +
  • Added support for smsp__sass_* metrics on Volta and newer GPUs

  • +
  • The launch__occupancy_limit_shared_mem now reports the device block limit if no shared memory is used by the kernel

  • +
+

NVIDIA Nsight Compute

+
    +
  • The Profile activity shows the command line used to launch ncu

  • +
  • The heatmap on the Source page now shows the represented metric in its tooltip

  • +
  • The Memory Workload Analysis Chart on the Details page now supports baselines

  • +
  • When applying rules, a message displaying the number of new rule results is shown in the status bar

  • +
  • The Visual Profiler Transition Guide was added to the documentation

  • +
  • Connection dialog activity options were added to the documentation

  • +
  • A warning dialog is shown if the application is resumed without Auto-Profile enabled

  • +
  • Pausing the application now has immediate feedback in the toolbar controls

  • +
  • Added a Close All command to the File menu

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • The --query-metrics option now shows only metric base names for faster metric query. The new option --query-metrics-mode can be used to display the valid suffixes for each base metric.

  • +
  • Added support for passing response files using the @ operator to specify command line options through a file

  • +
+

Resolved Issues

+
    +
  • Fixed an issue that reported the wrong executable name in the Session page when attaching

  • +
  • Fixed issues that chart labels were shown elided on the Details page

  • +
  • Fixed an issue that caused the cache hitrates to be shown incorrectly when baselines were added

  • +
  • Fixed an illegal memory access when collecting sass__*_histogram metrics for applications using PyTorch on Pascal GPUs

  • +
  • Fixed an issue when attempting to collect all smsp__* metrics on Volta and newer GPUs

  • +
  • Fixed an issue when profiling multi-context applications

  • +
  • Fixed that profiling start/stop settings from the connection dialog weren’t properly passed to the interactive profile activity

  • +
  • Fixed that certain smsp__warp_cycles_per_issue_stall* metrics returned negative values on Pascal GPUs

  • +
  • Fixed that metric names were truncated in the --page details non-CSV command line output

  • +
  • Fixed that the target application could crash if a connection port was used by another application with higher privileges

  • +
+
+
+

Updates in 2019.3.1

+

NVIDIA Nsight Compute

+
    +
  • Added ability to send bug reports and suggestions for features using Send Feedback in the Help menu

  • +
+

Resolved Issues

+
    +
  • Fixed calculation of theoretical occupancy for grids with blocks that are not a multiple of 32 threads

  • +
  • Fixed intercepting child processes launched through Python’s subprocess.Popen class

  • +
  • Fixed issue of NVTX push/pop ranges not showing up for child threads in NVIDIA Nsight Compute CLI

  • +
  • Fixed performance regression for metric lookups on the Source page

  • +
  • Fixed description in rule covering the IMC stall reason

  • +
  • Fixed cases were baseline values were not correctly calculated in the Memory tables when comparing reports of different architectures

  • +
  • Fixed incorrect calculation of baseline values in the Executed Instruction Mix chart

  • +
  • Fixed accessing instanced metrics in the NvRules API

  • +
  • Fixed a bug that could cause the collection of unnecessary metrics in the Interactive Profile activity

  • +
  • Fixed potential crash on exit of the profiled target application

  • +
  • Switched underlying metric for SOL FB in the GPU Speed Of Light section to be driven by dram__throughput.avg.pct_of_peak_sustained_elapsed instead of fbpa__throughput.avg.pct_of_peak_sustained_elapsed

  • +
+
+
+

Updates in 2019.3

+

General

+
    +
  • Improved performance

  • +
  • Bug fixes

  • +
  • Kernel launch context and stream are reported as metrics

  • +
  • PC sampling configuration options are reported as metrics

  • +
  • The default base port for connections to the target changed

  • +
  • Section files support multiple, named Body fields

  • +
  • NvRules allows users to query metrics using any convertible data type

  • +
+

NVIDIA Nsight Compute

+
    +
  • Support for filtering kernel launches using their NVTX context

  • +
  • Support for new options to select the connection port range

  • +
  • The Profile activity supports configuring PC sampling parameters

  • +
  • Sections on the Details page support selecting individual bodies

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Support for stepping to kernel launches from specific NVTX contexts

  • +
  • Support for new --port and --max-connections options

  • +
  • Support for new --sampling-* options to configure PC sampling parameters

  • +
  • Section file errors are reported with --list-sections

  • +
  • A warning is shown if some section files could not be loaded

  • +
+

Resolved Issues

+
    +
  • Using the –summary option works for reports that include invalid metrics

  • +
  • The full process executable filename is reported for QNX targets

  • +
  • The project system now properly stores the state of opened reports

  • +
  • Fixed PTX syntax highlighting

  • +
  • Fixed an issue when switching between manual and auto profiling in NVIDIA Nsight Compute

  • +
  • The source page in NVIDIA Nsight Compute now works with results from multiple processes

  • +
  • Charts on the NVIDIA Nsight Compute details page uses proper localization for numbers

  • +
  • NVIDIA Nsight Compute no longer requires the system locale to be set to English

  • +
+
+
+

Updates in 2019.2

+

General

+
    +
  • Improved performance

  • +
  • Bug fixes

  • +
  • Kernel launch context and stream are reported as metrics

  • +
  • PC sampling configuration options are reported as metrics

  • +
  • The default base port for connections to the target changed

  • +
  • Section files support multiple, named Body fields

  • +
  • NvRules allows users to query metrics using any convertible data type

  • +
+

NVIDIA Nsight Compute

+
    +
  • Support for filtering kernel launches using their NVTX context

  • +
  • Support for new options to select the connection port range

  • +
  • The Profile activity supports configuring PC sampling parameters

  • +
  • Sections on the Details page support selecting individual bodies

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Support for stepping to kernel launches from specific NVTX contexts

  • +
  • Support for new --port and --max-connections options

  • +
  • Support for new --sampling-* options to configure PC sampling parameters

  • +
  • Section file errors are reported with --list-sections

  • +
  • A warning is shown if some section files could not be loaded

  • +
+

Resolved Issues

+
    +
  • Using the –summary option works for reports that include invalid metrics

  • +
  • The full process executable filename is reported for QNX targets

  • +
  • The project system now properly stores the state of opened reports

  • +
  • Fixed PTX syntax highlighting

  • +
  • Fixed an issue when switching between manual and auto profiling in NVIDIA Nsight Compute

  • +
  • The source page in NVIDIA Nsight Compute now works with results from multiple processes

  • +
  • Charts on the NVIDIA Nsight Compute details page uses proper localization for numbers

  • +
  • NVIDIA Nsight Compute no longer requires the system locale to be set to English

  • +
+
+
+

Updates in 2019.1

+

General

+
    +
  • Support for CUDA 10.1

  • +
  • Improved performance

  • +
  • Bug fixes

  • +
  • Profiling on Volta GPUs now uses the same metric names as on Turing GPUs

  • +
  • Section files support descriptions

  • +
  • The default sections and rules directory has been renamed to sections

  • +
+

NVIDIA Nsight Compute

+
    +
  • Added new profiling options to the options dialog

  • +
  • Details page shows rule result icons in the section headers

  • +
  • Section descriptions are shown in the details page and in the sections tool window

  • +
  • Source page supports collapsing multiple source files or functions to show aggregated results

  • +
  • Source page heatmap color scale has changed

  • +
  • Invalid metric results are highlighted in the profiler report

  • +
  • Loaded section and rule files can be opened from the sections tool window

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Support for profiling child processes on Linux and Windows x86_64 targets

  • +
  • NVIDIA Nsight Compute CLI uses a temporary file if no output file is specified

  • +
  • Support for new --quiet option

  • +
  • Support for setting the GPU clock control mode using new --clock-control option

  • +
  • Details page output shows the NVTX context when --nvtx is enabled

  • +
  • Support for filtering kernel launches for profiling based on their NVTX context using new --nvtx-include and --nvtx-exclude options

  • +
  • Added new --summary options for aggregating profiling results

  • +
  • Added option --open-in-ui to open reports collected with NVIDIA Nsight Compute CLI directly in NVIDIA Nsight Compute

  • +
+

Resolved Issues

+
    +
  • Installation directory scripts use absolute paths

  • +
  • OpenACC kernel names are correctly demangled

  • +
  • Profile activity report file supports a relative path

  • +
  • Source view can resolve all applicable files at once

  • +
  • UI font colors are improved

  • +
  • Details page layout and label elision issues are resolved

  • +
  • Turing metrics are properly reported on the Summary page

  • +
  • All byte-based metrics use a factor of 1000 when scaling units to follow SI standards

  • +
  • CSV exports properly align columns with empty entries

  • +
+
    +
  • Fixed the metric computation for double_precision_fu_utilization on GV11b

  • +
+
    +
  • Fixed incorrect ‘selected’ PC sampling counter values

  • +
  • The SpeedOfLight section uses ‘max’ instead of ‘avg’ cycles metrics for Elapsed Cycles

  • +
+
+
+
+
+

1.2. Known Issues

+

Installation

+
    +
  • The installer might not show all patch-level version numbers during installation.

  • +
  • Some command line options listed in the help of a .run installer of NVIDIA Nsight Compute are affecting only the archive extraction, but not the installation stage. To pass command line options to the embedded installer script, specify those options after -- in the form of -- -<option>. The available options for the installer script are:

    +
    -help               : Print help message
    +-targetpath=<PATH>  : Specify install path
    +-noprompt           : No prompts. Implies acceptance of the EULA
    +
    +
    +

    For example, specifying only option --quiet extracts the installer archive without any output to the console, but still prompts for user interaction during the installation. To install NVIDIA Nsight Compute without any console output nor any user interaction, please specify --quiet -- -noprompt.

    +
  • +
  • After using the SDK Manager to install the NVIDIA Nsight Compute tools, their binary path needs to be manually added to your PATH environment variable.

  • +
  • See also the System Requirements for more installation instructions.

  • +
+

Launch and Connection

+
    +
  • Launching applications on remote targets/platforms is not supported for several combinations. See Platform Support for details. Manually launch the application using command line ncu --mode=launch on the remote system and connect using the UI or CLI afterwards.

  • +
  • In the NVIDIA Nsight Compute connection dialog, a remote system can only be specified for one target platform. Remove a connection from its current target platform in order to be able to add it to another.

  • +
  • Loading of CUDA sources via SSH requires that the remote connection is configured, and that the hostname/IP address of the connection matches the target (as seen in the report session details). For example, prefer my-machine.my-domain.com, instead of my-machine, even though the latter resolves to the same.

  • +
  • Other issues concerning remote connections are discussed in the documentation for remote connections.

  • +
  • Local connections between NVIDIA Nsight Compute and the launched target application might not work on some ppc64le or aarch64 (sbsa) systems configured to only support IPv6. On these platforms, the NV_COMPUTE_PROFILER_LOCAL_CONNECTION_OVERRIDE=uds environment variable can be set to use Unix Domain Sockets instead of TCP for local connections to workaround the problem. On x86_64 Linux, Unix Domain Sockets are used by default, but local TCP connections can be forced using NV_COMPUTE_PROFILER_LOCAL_CONNECTION_OVERRIDE=tcp.

  • +
+

Profiling and Metrics

+
    +
  • Profiling of 32-bit processes is not supported.

  • +
  • Profiling kernels executed on a device that is part of an SLI group is not supported. An “Unsupported GPU” error is shown in this case.

  • +
  • Profiling a kernel while other contexts are active on the same device (e.g. X server, or secondary CUDA or graphics application) can result in varying metric values for L2/FB (Device Memory) related metrics. Specifically, L2/FB traffic from non-profiled contexts cannot be excluded from the metric results. To completely avoid this issue, profile the application on a GPU without secondary contexts accessing the same device (e.g. no X server on Linux).

  • +
  • In the current release, profiling a kernel while any other GPU work is executing on the same MIG compute instance can result in varying metric values for all units. NVIDIA Nsight Compute enforces serialization of the CUDA launches within the target application to ensure those kernels do not influence each other. See Serialization for more details. However, GPU work issued through other APIs in the target process or workloads created by non-target processes running simultaneously in the same MIG compute instance will influence the collected metrics. Note that it is acceptable to run CUDA processes in other MIG compute instances as they will not influence the profiled MIG compute instance.

  • +
  • On Linux kernels settings fs.protected_regular=1 (e.g. some Ubuntu 20.04 cloud service provider instances), root users may not be able to access the inter-process lock file. See the FAQ for workarounds.

  • +
  • Profiling only supports up to 32 device instances, including instances of MIG partitions. Profiling the 33rd or higher device instance will result in indeterminate data.

  • +
  • Enabling certain metrics can cause GPU kernels to run longer than the driver’s watchdog time-out limit. In these cases the driver will terminate the GPU kernel resulting in an application error and profiling data will not be available. Please disable the driver watchdog time out before profiling such long running CUDA kernels.

    + +
  • +
  • Collecting device-level metrics, such as the NVLink metrics (nvl*), is not supported on NVIDIA virtual GPUs (vGPUs).

  • +
  • As of CUDA 11.4 and R470 TRD1 driver release, NVIDIA Nsight Compute is supported in a vGPU environment which requires a vGPU license. If the license is not obtained after 20 minutes, the reported performance metrics data from the GPU will be inaccurate. This is because of a feature in vGPU environment which reduces performance but retains functionality as specified here.

  • +
  • Profiling on NVIDIA live-migrated virtual machines is not supported and can result in undefined behavior.

  • +
  • Profiling with enabled multi-process service (MPS) can result in undefined behavior.

  • +
  • When Profiling using Range Replay or Application Range Replay with multiple CUDA Green Contexts active which belong to the same device context, the range result will contain counter values aggregated on all Green Contexts

  • +
  • The NVLink Topology section is not supported for a configuration using NVSwitch.

  • +
  • NVIDIA Nsight Compute does not support per-NVLink metrics.

  • +
  • NVIDIA Nsight Compute does not support the Logical NVLink Throughput table.

  • +
  • Setting a reduced NvLink Bandwidth mode does not impact the reported peak values for NvLink metrics. All peak values and corresponding percentages are calculated off the non-reduced NvLink bandwidth. Reconfiguring the NvLink Bandwidth mode using nvidia-smi` while profiling may lead to undefined tools’ behavior.

  • +
+
    +
  • Profiling CUDA graph kernel nodes that can launch device graphs or are part of device-launchable graphs is not supported. Use Graph Profiling mode instead.

  • +
  • Profiling in Graph Profiling mode is performed on the context that is specified by the stream handle for the graph launch. Consequently, only memory allocated on this context is saved off and restored during graph replay and only kernel nodes executed on this context are profiled.

  • +
+
    +
  • On CUDA drivers older than 530.x, profiling on Windows Subsystem for Linux (WSL) is not supported if the system has multiple physical NVIDIA GPUs. This is not affected by setting CUDA_VISIBLE_DEVICES.

  • +
  • Collecting software counters through PerfWorks currently forces all functions in the module of the profiled kernel to be loaded. This increases the host and device memory footprint of the target application for the remainder of the process lifetime.

  • +
  • PM Sampling is not supported when collecting a Profile Series.

  • +
+

Compatibility

+
    +
  • Applications calling blocking functions on std input/output streams can result in the profiler to stop, until the blocking function call is resolved.

  • +
  • NVIDIA Nsight Compute can hang on applications using RAPIDS in versions 0.6 and 0.7, due to an issue in cuDF.

  • +
  • Profiling child processes launched via clone() is not supported.

  • +
  • Profiling child processes launched from Python using os.system() is not supported on ppc64le.

  • +
  • Profiling of Cooperative Groups kernels launched with cuLaunchCooperativeKernelMultiDevice is not yet supported.

  • +
  • On Linux systems, when profiling bsd-csh scripts, the original application output will not be printed. As a workaround, use a different C-shell, e.g. tcsh.

  • +
  • Attempting to use the --clock-control option to set the GPU clocks will fail when profiling on a GPU partition. Please use nvidia-smi (installed with NVIDIA display driver) to control the clocks for the entire GPU. This will require administrative privileges when the GPU is partitioned.

  • +
  • On Linux aarch64, NVIDIA Nsight Compute does not work if the HOME environment variable is not set.

  • +
  • NVIDIA Nsight Compute versions 2020.1.0 to 2020.2.1 are not compatible with CUDA driver version 460+ if the application launches Cooperative Groups kernels. Profiling will fail with error “UnknownError”.

  • +
  • Collecting CPU call stack information on Windows Server 2016 can hang NVIDIA Nsight Compute in some cases. Currently, the only workaround is to skip CPU call stack collection on such systems by not specifying the option --call-stack.

  • +
  • When profiling a script, --target-processes all may target utility executables such as xargs, uname or ls. To avoid profiling these, use the --target-processes-filter option accordingly.

  • +
  • On mobile platforms, --kill option is not supported with application replay mode.

  • +
  • NVIDIA Nsight Compute might show invalid characters for Unicode names and paths on Windows 10. As a workaround, use a third-party terminal emulator, e.g. Git bash.

  • +
+

User Interface

+
    +
  • The API Statistics filter in NVIDIA Nsight Compute does not support units.

  • +
  • File size is the only property considered when resolving source files. Timestamps are currently ignored.

  • +
  • Terminating or disconnecting an application in the Interactive Profiling activity while the API Stream View is updated can lead to a crash.

  • +
  • See the OptiX library support section for limitations concerning the Acceleration Structure Viewer.

  • +
  • After updating from a previous version of NVIDIA Nsight Compute on Linux, the file load dialog may not allow column resizing and sorting. As a workaround, the ~/.config/QtProject.conf file can be edited to remove the treeViewHeader entry from the [FileDialog] section.

  • +
+
+
+

1.3. Support

+

Information on supported platforms and GPUs.

+
+

1.3.1. Platform Support

+

Host denotes the UI can run on that platform. Target means that we can instrument applications on that platform for data collection. Applications launched with instrumentation on a target system can be connected to from most host platforms. The reports collected on one system can be opened on any other system.

+ + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 1. Platforms supported by NVIDIA Nsight Compute

Host

Targets

Windows

Yes

Windows*, Linux (x86_64)

Windows Subsystem for Linux (WSL2)

Yes

Windows Subsystem for Linux (WSL2) as part of the Linux (x86_64) package.

Linux (x86_64)

Yes

Windows*, Linux (x86_64), Linux (ppc64le), Linux (aarch64 sbsa)

Linux (ppc64le)

No

Linux (ppc64le)

Linux (aarch64 sbsa)

Yes

Linux (aarch64 sbsa)

Linux (x86_64) (Drive SDK)

Yes

Windows*, Linux (x86_64), Linux (aarch64), QNX

MacOSX 11+

Yes

Windows*, Linux (x86_64), Linux (ppc64le)

Linux (aarch64)

No

Linux (aarch64)

QNX

No

QNX

+

Target platforms marked with * do not support remote launch from the respective host. Remote launch means that the application can be launched on the target system from the host UI. Instead, the application must be launched from the target system.

+

Profiling of 32-bit processes is not supported.

+
+
+

1.3.2. GPU Support

+ + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 2. GPU architectures supported by NVIDIA Nsight Compute

Architecture

Support

Kepler

No

Maxwell

No

Pascal

No

Volta GV100

Yes

Volta GV11b

Yes

Turing TU1xx

Yes

NVIDIA GA100

Yes

NVIDIA GA10x

Yes

NVIDIA GA10b

Yes

NVIDIA GH100

Yes

+

Most metrics used in NVIDIA Nsight Compute are identical to those of the PerfWorks Metrics API and follow the documented Metrics Structure. A comparison between the metrics used in nvprof and their equivalent in NVIDIA Nsight Compute can be found in the NVIDIA Nsight Compute CLI User Manual.

+
+
+

1.3.3. Library Support

+

NVIDIA Nsight Compute can be used to profile CUDA applications, as well as applications that use CUDA via NVIDIA or third-party libraries. For most such libraries, the behavior is expected to be identical to applications using CUDA directly. However, for certain libraries, NVIDIA Nsight Compute has certain restrictions, alternate behavior, or requires non-default setup steps prior to profiling.

+
+

OptiX

+

NVIDIA Nsight Compute supports profiling of OptiX applications, but with certain restrictions.

+
    +
  • Internal Kernels

    +

    Kernels launched by OptiX that contain no user-defined code are given the generic name NVIDIA internal. These kernels show up on the API Stream in the NVIDIA Nsight Compute UI, and can be profiled in both the UI as well as the NVIDIA Nsight Compute CLI. However, no CUDA-C source, PTX or SASS is available for them.

    +
  • +
  • User Kernels

    +

    Kernels launched by OptiX can contain user-defined code. OptiX identifies these kernels in the API Stream with a custom name. This name starts with raygen__ (for “ray generation”). These kernels show up on the API Stream and can be profiled in the UI as well as the NVIDIA Nsight Compute CLI. The Source page displays CUDA-C source, PTX and SASS defined by the user. Certain parts of the kernel, including device functions that contain OptiX-internal code, will not be available in the Source page.

    +
  • +
  • SASS

    +

    When SASS information is available in the profile report, certain instructions might not be available in the Source page and shown as N/A.

    +
  • +
+

The Acceleration Structure Viewer for OptiX traversable handles currently has the following limitations:

+
    +
  • The Acceleration Structure Viewer is not supported on MacOSX.

  • +
  • Viewing instance acceleration structures using multi-level instancing is not supported.

  • +
  • Applying motion traversables to acceleration structures is not supported.

  • +
+

The following feature set is supported per OptiX API version:

+ ++++++ + + + + + + + + + + + + + + + + + +

OptiX API Version

Kernel Profiling

API Interception

Resource Tracking

6.x

Yes

No

No

7.0 - 8.0

Yes

Yes

Yes

+
+
+
+

1.3.4. System Requirements

+

Linux and WSL

+

On all Linux platforms, NVIDIA Nsight Compute CLI requires GLIBC version 2.15 or higher. On x86_64, the NVIDIA Nsight Compute UI requires GLIBC version 2.17 or higher. On Linux (aarch64 sbsa), the NVIDIA Nsight Compute UI requires GLIBC version 2.26 or higher.

+

The NVIDIA Nsight Compute UI requires several packages to be installed to enable Qt. Please refer to the Qt for X11 Requirements. When executing ncu-ui with missing dependencies, an error message with information on the missing packages is shown. Note that only one package will be shown at a time, even though multiple may be missing from your system. For selected operating systems, the following commands install needed packages for NVIDIA Nsight Compute on X11:

+
    +
  • Ubuntu 18.04

    +

    apt install libopengl0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xkb1 libxkbcommon-x11-0

    +
  • +
  • Ubuntu 20.04

    +

    apt install libopengl0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 libxcb-xkb1 libxkbcommon-x11-0

    +
  • +
  • RHEL 8.6

    +

    yum install libglvnd-opengl libxcb libxkbcommon-x11

    +
  • +
+

Profiling on Windows Subsystem for Linux (WSL) is only supported with WSL version 2. +Profiling is supported on Windows 10 WSL with OS build version 19044 and greater, and NVIDIA display driver version 545 or higher. +It is not supported on Windows 10 WSL for systems that exceed 1 TB of system memory. +Profiling is supported on Windows 11 WSL with NVIDIA display driver version 525 or higher.

+

The Linux (x86_64) NVIDIA Nsight Compute package can be used and should be installed directly within WSL2. +Remote profiling to and from WSL2 works equivalently to regular Linux (x86_64) hosts and targets, as long as it’s accessible via SSH. +Access to NVIDIA GPU Performance Counters must be enabled in the NVIDIA Control Panel of the Windows host. +See also the CUDA on WSL User Guide.

+

Windows

+

Only Windows 10 and 11 are supported as host and target.

+

The Visual Studio 2017 redistributable is not automatically installed by the NVIDIA Nsight Compute installer. The workaround is to install the x64 version of the ‘Microsoft Visual C++ Redistributable for Visual Studio 2017’ manually. The installer is linked on the main download page for Visual Studio at https://www.visualstudio.com/downloads/ or download directly from https://go.microsoft.com/fwlink/?LinkId=746572.

+

Notices

+

Notices

+

ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, “MATERIALS”) ARE BEING PROVIDED “AS IS.” NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.

+

Information furnished is believed to be accurate and reliable. However, NVIDIA Corporation assumes no responsibility for the consequences of use of such information or for any infringement of patents or other rights of third parties that may result from its use. No license is granted by implication of otherwise under any patent rights of NVIDIA Corporation. Specifications mentioned in this publication are subject to change without notice. This publication supersedes and replaces all other information previously supplied. NVIDIA Corporation products are not authorized as critical components in life support devices or systems without express written approval of NVIDIA Corporation.

+

Trademarks

+

NVIDIA and the NVIDIA logo are trademarks or registered trademarks of NVIDIA Corporation in the U.S. and other countries. Other company and product names may be trademarks of the respective companies with which they are associated.

+
+
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/gpu-support.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/gpu-support.html new file mode 100644 index 0000000000000000000000000000000000000000..1caae7b1a1f9677ebecff6c28be071e3f567223a --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/gpu-support.html @@ -0,0 +1,196 @@ + + + + + + + GPU Support — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • GPU Support
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

GPU Support

+ + ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 2. GPU architectures supported by NVIDIA Nsight Compute

Architecture

Support

Kepler

No

Maxwell

No

Pascal

No

Volta GV100

Yes

Volta GV11b

Yes

Turing TU1xx

Yes

NVIDIA GA100

Yes

NVIDIA GA10x

Yes

NVIDIA GA10b

Yes

NVIDIA GH100

Yes

+

Most metrics used in NVIDIA Nsight Compute are identical to those of the PerfWorks Metrics API and follow the documented Metrics Structure. A comparison between the metrics used in nvprof and their equivalent in NVIDIA Nsight Compute can be found in the NVIDIA Nsight Compute CLI User Manual.

+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/known-issues.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/known-issues.html new file mode 100644 index 0000000000000000000000000000000000000000..eadfd894628eed210333262eeba3ec439a7fbb8c --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/known-issues.html @@ -0,0 +1,230 @@ + + + + + + + Known Issues — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Known Issues
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Known Issues

+

Installation

+
    +
  • The installer might not show all patch-level version numbers during installation.

  • +
  • Some command line options listed in the help of a .run installer of NVIDIA Nsight Compute are affecting only the archive extraction, but not the installation stage. To pass command line options to the embedded installer script, specify those options after -- in the form of -- -<option>. The available options for the installer script are:

    +
    -help               : Print help message
    +-targetpath=<PATH>  : Specify install path
    +-noprompt           : No prompts. Implies acceptance of the EULA
    +
    +
    +

    For example, specifying only option --quiet extracts the installer archive without any output to the console, but still prompts for user interaction during the installation. To install NVIDIA Nsight Compute without any console output nor any user interaction, please specify --quiet -- -noprompt.

    +
  • +
  • After using the SDK Manager to install the NVIDIA Nsight Compute tools, their binary path needs to be manually added to your PATH environment variable.

  • +
  • See also the System Requirements for more installation instructions.

  • +
+

Launch and Connection

+
    +
  • Launching applications on remote targets/platforms is not supported for several combinations. See Platform Support for details. Manually launch the application using command line ncu --mode=launch on the remote system and connect using the UI or CLI afterwards.

  • +
  • In the NVIDIA Nsight Compute connection dialog, a remote system can only be specified for one target platform. Remove a connection from its current target platform in order to be able to add it to another.

  • +
  • Loading of CUDA sources via SSH requires that the remote connection is configured, and that the hostname/IP address of the connection matches the target (as seen in the report session details). For example, prefer my-machine.my-domain.com, instead of my-machine, even though the latter resolves to the same.

  • +
  • Other issues concerning remote connections are discussed in the documentation for remote connections.

  • +
  • Local connections between NVIDIA Nsight Compute and the launched target application might not work on some ppc64le or aarch64 (sbsa) systems configured to only support IPv6. On these platforms, the NV_COMPUTE_PROFILER_LOCAL_CONNECTION_OVERRIDE=uds environment variable can be set to use Unix Domain Sockets instead of TCP for local connections to workaround the problem. On x86_64 Linux, Unix Domain Sockets are used by default, but local TCP connections can be forced using NV_COMPUTE_PROFILER_LOCAL_CONNECTION_OVERRIDE=tcp.

  • +
+

Profiling and Metrics

+
    +
  • Profiling of 32-bit processes is not supported.

  • +
  • Profiling kernels executed on a device that is part of an SLI group is not supported. An “Unsupported GPU” error is shown in this case.

  • +
  • Profiling a kernel while other contexts are active on the same device (e.g. X server, or secondary CUDA or graphics application) can result in varying metric values for L2/FB (Device Memory) related metrics. Specifically, L2/FB traffic from non-profiled contexts cannot be excluded from the metric results. To completely avoid this issue, profile the application on a GPU without secondary contexts accessing the same device (e.g. no X server on Linux).

  • +
  • In the current release, profiling a kernel while any other GPU work is executing on the same MIG compute instance can result in varying metric values for all units. NVIDIA Nsight Compute enforces serialization of the CUDA launches within the target application to ensure those kernels do not influence each other. See Serialization for more details. However, GPU work issued through other APIs in the target process or workloads created by non-target processes running simultaneously in the same MIG compute instance will influence the collected metrics. Note that it is acceptable to run CUDA processes in other MIG compute instances as they will not influence the profiled MIG compute instance.

  • +
  • On Linux kernels settings fs.protected_regular=1 (e.g. some Ubuntu 20.04 cloud service provider instances), root users may not be able to access the inter-process lock file. See the FAQ for workarounds.

  • +
  • Profiling only supports up to 32 device instances, including instances of MIG partitions. Profiling the 33rd or higher device instance will result in indeterminate data.

  • +
  • Enabling certain metrics can cause GPU kernels to run longer than the driver’s watchdog time-out limit. In these cases the driver will terminate the GPU kernel resulting in an application error and profiling data will not be available. Please disable the driver watchdog time out before profiling such long running CUDA kernels.

    + +
  • +
  • Collecting device-level metrics, such as the NVLink metrics (nvl*), is not supported on NVIDIA virtual GPUs (vGPUs).

  • +
  • As of CUDA 11.4 and R470 TRD1 driver release, NVIDIA Nsight Compute is supported in a vGPU environment which requires a vGPU license. If the license is not obtained after 20 minutes, the reported performance metrics data from the GPU will be inaccurate. This is because of a feature in vGPU environment which reduces performance but retains functionality as specified here.

  • +
  • Profiling on NVIDIA live-migrated virtual machines is not supported and can result in undefined behavior.

  • +
  • Profiling with enabled multi-process service (MPS) can result in undefined behavior.

  • +
  • When Profiling using Range Replay or Application Range Replay with multiple CUDA Green Contexts active which belong to the same device context, the range result will contain counter values aggregated on all Green Contexts

  • +
  • The NVLink Topology section is not supported for a configuration using NVSwitch.

  • +
  • NVIDIA Nsight Compute does not support per-NVLink metrics.

  • +
  • NVIDIA Nsight Compute does not support the Logical NVLink Throughput table.

  • +
  • Setting a reduced NvLink Bandwidth mode does not impact the reported peak values for NvLink metrics. All peak values and corresponding percentages are calculated off the non-reduced NvLink bandwidth. Reconfiguring the NvLink Bandwidth mode using nvidia-smi` while profiling may lead to undefined tools’ behavior.

  • +
+
    +
  • Profiling CUDA graph kernel nodes that can launch device graphs or are part of device-launchable graphs is not supported. Use Graph Profiling mode instead.

  • +
  • Profiling in Graph Profiling mode is performed on the context that is specified by the stream handle for the graph launch. Consequently, only memory allocated on this context is saved off and restored during graph replay and only kernel nodes executed on this context are profiled.

  • +
+
    +
  • On CUDA drivers older than 530.x, profiling on Windows Subsystem for Linux (WSL) is not supported if the system has multiple physical NVIDIA GPUs. This is not affected by setting CUDA_VISIBLE_DEVICES.

  • +
  • Collecting software counters through PerfWorks currently forces all functions in the module of the profiled kernel to be loaded. This increases the host and device memory footprint of the target application for the remainder of the process lifetime.

  • +
  • PM Sampling is not supported when collecting a Profile Series.

  • +
+

Compatibility

+
    +
  • Applications calling blocking functions on std input/output streams can result in the profiler to stop, until the blocking function call is resolved.

  • +
  • NVIDIA Nsight Compute can hang on applications using RAPIDS in versions 0.6 and 0.7, due to an issue in cuDF.

  • +
  • Profiling child processes launched via clone() is not supported.

  • +
  • Profiling child processes launched from Python using os.system() is not supported on ppc64le.

  • +
  • Profiling of Cooperative Groups kernels launched with cuLaunchCooperativeKernelMultiDevice is not yet supported.

  • +
  • On Linux systems, when profiling bsd-csh scripts, the original application output will not be printed. As a workaround, use a different C-shell, e.g. tcsh.

  • +
  • Attempting to use the --clock-control option to set the GPU clocks will fail when profiling on a GPU partition. Please use nvidia-smi (installed with NVIDIA display driver) to control the clocks for the entire GPU. This will require administrative privileges when the GPU is partitioned.

  • +
  • On Linux aarch64, NVIDIA Nsight Compute does not work if the HOME environment variable is not set.

  • +
  • NVIDIA Nsight Compute versions 2020.1.0 to 2020.2.1 are not compatible with CUDA driver version 460+ if the application launches Cooperative Groups kernels. Profiling will fail with error “UnknownError”.

  • +
  • Collecting CPU call stack information on Windows Server 2016 can hang NVIDIA Nsight Compute in some cases. Currently, the only workaround is to skip CPU call stack collection on such systems by not specifying the option --call-stack.

  • +
  • When profiling a script, --target-processes all may target utility executables such as xargs, uname or ls. To avoid profiling these, use the --target-processes-filter option accordingly.

  • +
  • On mobile platforms, --kill option is not supported with application replay mode.

  • +
  • NVIDIA Nsight Compute might show invalid characters for Unicode names and paths on Windows 10. As a workaround, use a third-party terminal emulator, e.g. Git bash.

  • +
+

User Interface

+
    +
  • The API Statistics filter in NVIDIA Nsight Compute does not support units.

  • +
  • File size is the only property considered when resolving source files. Timestamps are currently ignored.

  • +
  • Terminating or disconnecting an application in the Interactive Profiling activity while the API Stream View is updated can lead to a crash.

  • +
  • See the OptiX library support section for limitations concerning the Acceleration Structure Viewer.

  • +
  • After updating from a previous version of NVIDIA Nsight Compute on Linux, the file load dialog may not allow column resizing and sorting. As a workaround, the ~/.config/QtProject.conf file can be edited to remove the treeViewHeader entry from the [FileDialog] section.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/library-support-optix.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/library-support-optix.html new file mode 100644 index 0000000000000000000000000000000000000000..ecef729cb32377d016caa78c972755fc68020b03 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/library-support-optix.html @@ -0,0 +1,195 @@ + + + + + + + OptiX — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • OptiX
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

OptiX

+

NVIDIA Nsight Compute supports profiling of OptiX applications, but with certain restrictions.

+
    +
  • Internal Kernels

    +

    Kernels launched by OptiX that contain no user-defined code are given the generic name NVIDIA internal. These kernels show up on the API Stream in the NVIDIA Nsight Compute UI, and can be profiled in both the UI as well as the NVIDIA Nsight Compute CLI. However, no CUDA-C source, PTX or SASS is available for them.

    +
  • +
  • User Kernels

    +

    Kernels launched by OptiX can contain user-defined code. OptiX identifies these kernels in the API Stream with a custom name. This name starts with raygen__ (for “ray generation”). These kernels show up on the API Stream and can be profiled in the UI as well as the NVIDIA Nsight Compute CLI. The Source page displays CUDA-C source, PTX and SASS defined by the user. Certain parts of the kernel, including device functions that contain OptiX-internal code, will not be available in the Source page.

    +
  • +
  • SASS

    +

    When SASS information is available in the profile report, certain instructions might not be available in the Source page and shown as N/A.

    +
  • +
+

The Acceleration Structure Viewer for OptiX traversable handles currently has the following limitations:

+
    +
  • The Acceleration Structure Viewer is not supported on MacOSX.

  • +
  • Viewing instance acceleration structures using multi-level instancing is not supported.

  • +
  • Applying motion traversables to acceleration structures is not supported.

  • +
+

The following feature set is supported per OptiX API version:

+ ++++++ + + + + + + + + + + + + + + + + + +

OptiX API Version

Kernel Profiling

API Interception

Resource Tracking

6.x

Yes

No

No

7.0 - 8.0

Yes

Yes

Yes

+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/library-support.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/library-support.html new file mode 100644 index 0000000000000000000000000000000000000000..5049898cf5057b5c3699040f2b8b1f5fadea99d5 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/library-support.html @@ -0,0 +1,152 @@ + + + + + + + Library Support — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Library Support
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Library Support

+

NVIDIA Nsight Compute can be used to profile CUDA applications, as well as applications that use CUDA via NVIDIA or third-party libraries. For most such libraries, the behavior is expected to be identical to applications using CUDA directly. However, for certain libraries, NVIDIA Nsight Compute has certain restrictions, alternate behavior, or requires non-default setup steps prior to profiling.

+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/platform-support.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/platform-support.html new file mode 100644 index 0000000000000000000000000000000000000000..5547f320236bbb49b4842c0dbcedd29b4020283d --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/platform-support.html @@ -0,0 +1,206 @@ + + + + + + + Platform Support — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Platform Support
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Platform Support

+

Host denotes the UI can run on that platform. Target means that we can instrument applications on that platform for data collection. Applications launched with instrumentation on a target system can be connected to from most host platforms. The reports collected on one system can be opened on any other system.

+ + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 1. Platforms supported by NVIDIA Nsight Compute

Host

Targets

Windows

Yes

Windows*, Linux (x86_64)

Windows Subsystem for Linux (WSL2)

Yes

Windows Subsystem for Linux (WSL2) as part of the Linux (x86_64) package.

Linux (x86_64)

Yes

Windows*, Linux (x86_64), Linux (ppc64le), Linux (aarch64 sbsa)

Linux (ppc64le)

No

Linux (ppc64le)

Linux (aarch64 sbsa)

Yes

Linux (aarch64 sbsa)

Linux (x86_64) (Drive SDK)

Yes

Windows*, Linux (x86_64), Linux (aarch64), QNX

MacOSX 11+

Yes

Windows*, Linux (x86_64), Linux (ppc64le)

Linux (aarch64)

No

Linux (aarch64)

QNX

No

QNX

+

Target platforms marked with * do not support remote launch from the respective host. Remote launch means that the application can be launched on the target system from the host UI. Instead, the application must be launched from the target system.

+

Profiling of 32-bit processes is not supported.

+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/release-notes-older-versions.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/release-notes-older-versions.html new file mode 100644 index 0000000000000000000000000000000000000000..6a4c4573ad7f62a3c14dd4e122c107c072a47f5d --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/release-notes-older-versions.html @@ -0,0 +1,151 @@ + + + + + + + Older Versions — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Older Versions
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Older Versions

+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/release-notes.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/release-notes.html new file mode 100644 index 0000000000000000000000000000000000000000..87da9a40b76e0bd5cddbdce4a9ffa4428791425d --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/release-notes.html @@ -0,0 +1,151 @@ + + + + + + + Release Notes — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Release Notes
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Release Notes

+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/support.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/support.html new file mode 100644 index 0000000000000000000000000000000000000000..485a067d5741e2e7c49633b053d552a17baef51a --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/support.html @@ -0,0 +1,152 @@ + + + + + + + Support — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Support
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Support

+

Information on supported platforms and GPUs.

+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/system-requirements.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/system-requirements.html new file mode 100644 index 0000000000000000000000000000000000000000..93c53347312b61217f330975e00ee2999ff06365 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/system-requirements.html @@ -0,0 +1,176 @@ + + + + + + + System Requirements — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • System Requirements
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

System Requirements

+

Linux and WSL

+

On all Linux platforms, NVIDIA Nsight Compute CLI requires GLIBC version 2.15 or higher. On x86_64, the NVIDIA Nsight Compute UI requires GLIBC version 2.17 or higher. On Linux (aarch64 sbsa), the NVIDIA Nsight Compute UI requires GLIBC version 2.26 or higher.

+

The NVIDIA Nsight Compute UI requires several packages to be installed to enable Qt. Please refer to the Qt for X11 Requirements. When executing ncu-ui with missing dependencies, an error message with information on the missing packages is shown. Note that only one package will be shown at a time, even though multiple may be missing from your system. For selected operating systems, the following commands install needed packages for NVIDIA Nsight Compute on X11:

+
    +
  • Ubuntu 18.04

    +

    apt install libopengl0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xkb1 libxkbcommon-x11-0

    +
  • +
  • Ubuntu 20.04

    +

    apt install libopengl0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 libxcb-xkb1 libxkbcommon-x11-0

    +
  • +
  • RHEL 8.6

    +

    yum install libglvnd-opengl libxcb libxkbcommon-x11

    +
  • +
+

Profiling on Windows Subsystem for Linux (WSL) is only supported with WSL version 2. +Profiling is supported on Windows 10 WSL with OS build version 19044 and greater, and NVIDIA display driver version 545 or higher. +It is not supported on Windows 10 WSL for systems that exceed 1 TB of system memory. +Profiling is supported on Windows 11 WSL with NVIDIA display driver version 525 or higher.

+

The Linux (x86_64) NVIDIA Nsight Compute package can be used and should be installed directly within WSL2. +Remote profiling to and from WSL2 works equivalently to regular Linux (x86_64) hosts and targets, as long as it’s accessible via SSH. +Access to NVIDIA GPU Performance Counters must be enabled in the NVIDIA Control Panel of the Windows host. +See also the CUDA on WSL User Guide.

+

Windows

+

Only Windows 10 and 11 are supported as host and target.

+

The Visual Studio 2017 redistributable is not automatically installed by the NVIDIA Nsight Compute installer. The workaround is to install the x64 version of the ‘Microsoft Visual C++ Redistributable for Visual Studio 2017’ manually. The installer is linked on the main download page for Visual Studio at https://www.visualstudio.com/downloads/ or download directly from https://go.microsoft.com/fwlink/?LinkId=746572.

+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2019-1.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2019-1.html new file mode 100644 index 0000000000000000000000000000000000000000..2177d625d2a005f9181d148d647f88d89bc17d68 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2019-1.html @@ -0,0 +1,200 @@ + + + + + + + Updates in 2019.1 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2019.1
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2019.1

+

General

+
    +
  • Support for CUDA 10.1

  • +
  • Improved performance

  • +
  • Bug fixes

  • +
  • Profiling on Volta GPUs now uses the same metric names as on Turing GPUs

  • +
  • Section files support descriptions

  • +
  • The default sections and rules directory has been renamed to sections

  • +
+

NVIDIA Nsight Compute

+
    +
  • Added new profiling options to the options dialog

  • +
  • Details page shows rule result icons in the section headers

  • +
  • Section descriptions are shown in the details page and in the sections tool window

  • +
  • Source page supports collapsing multiple source files or functions to show aggregated results

  • +
  • Source page heatmap color scale has changed

  • +
  • Invalid metric results are highlighted in the profiler report

  • +
  • Loaded section and rule files can be opened from the sections tool window

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Support for profiling child processes on Linux and Windows x86_64 targets

  • +
  • NVIDIA Nsight Compute CLI uses a temporary file if no output file is specified

  • +
  • Support for new --quiet option

  • +
  • Support for setting the GPU clock control mode using new --clock-control option

  • +
  • Details page output shows the NVTX context when --nvtx is enabled

  • +
  • Support for filtering kernel launches for profiling based on their NVTX context using new --nvtx-include and --nvtx-exclude options

  • +
  • Added new --summary options for aggregating profiling results

  • +
  • Added option --open-in-ui to open reports collected with NVIDIA Nsight Compute CLI directly in NVIDIA Nsight Compute

  • +
+

Resolved Issues

+
    +
  • Installation directory scripts use absolute paths

  • +
  • OpenACC kernel names are correctly demangled

  • +
  • Profile activity report file supports a relative path

  • +
  • Source view can resolve all applicable files at once

  • +
  • UI font colors are improved

  • +
  • Details page layout and label elision issues are resolved

  • +
  • Turing metrics are properly reported on the Summary page

  • +
  • All byte-based metrics use a factor of 1000 when scaling units to follow SI standards

  • +
  • CSV exports properly align columns with empty entries

  • +
+
    +
  • Fixed the metric computation for double_precision_fu_utilization on GV11b

  • +
+
    +
  • Fixed incorrect ‘selected’ PC sampling counter values

  • +
  • The SpeedOfLight section uses ‘max’ instead of ‘avg’ cycles metrics for Elapsed Cycles

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2019-2.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2019-2.html new file mode 100644 index 0000000000000000000000000000000000000000..d54018210c7204d03f25ddb4861be912c9464277 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2019-2.html @@ -0,0 +1,187 @@ + + + + + + + Updates in 2019.2 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2019.2
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2019.2

+

General

+
    +
  • Improved performance

  • +
  • Bug fixes

  • +
  • Kernel launch context and stream are reported as metrics

  • +
  • PC sampling configuration options are reported as metrics

  • +
  • The default base port for connections to the target changed

  • +
  • Section files support multiple, named Body fields

  • +
  • NvRules allows users to query metrics using any convertible data type

  • +
+

NVIDIA Nsight Compute

+
    +
  • Support for filtering kernel launches using their NVTX context

  • +
  • Support for new options to select the connection port range

  • +
  • The Profile activity supports configuring PC sampling parameters

  • +
  • Sections on the Details page support selecting individual bodies

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Support for stepping to kernel launches from specific NVTX contexts

  • +
  • Support for new --port and --max-connections options

  • +
  • Support for new --sampling-* options to configure PC sampling parameters

  • +
  • Section file errors are reported with --list-sections

  • +
  • A warning is shown if some section files could not be loaded

  • +
+

Resolved Issues

+
    +
  • Using the –summary option works for reports that include invalid metrics

  • +
  • The full process executable filename is reported for QNX targets

  • +
  • The project system now properly stores the state of opened reports

  • +
  • Fixed PTX syntax highlighting

  • +
  • Fixed an issue when switching between manual and auto profiling in NVIDIA Nsight Compute

  • +
  • The source page in NVIDIA Nsight Compute now works with results from multiple processes

  • +
  • Charts on the NVIDIA Nsight Compute details page uses proper localization for numbers

  • +
  • NVIDIA Nsight Compute no longer requires the system locale to be set to English

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2019-3-1.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2019-3-1.html new file mode 100644 index 0000000000000000000000000000000000000000..b6d0fc009cb5198ebf4c0ed961175b73fd3c460f --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2019-3-1.html @@ -0,0 +1,169 @@ + + + + + + + Updates in 2019.3.1 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2019.3.1
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2019.3.1

+

NVIDIA Nsight Compute

+
    +
  • Added ability to send bug reports and suggestions for features using Send Feedback in the Help menu

  • +
+

Resolved Issues

+
    +
  • Fixed calculation of theoretical occupancy for grids with blocks that are not a multiple of 32 threads

  • +
  • Fixed intercepting child processes launched through Python’s subprocess.Popen class

  • +
  • Fixed issue of NVTX push/pop ranges not showing up for child threads in NVIDIA Nsight Compute CLI

  • +
  • Fixed performance regression for metric lookups on the Source page

  • +
  • Fixed description in rule covering the IMC stall reason

  • +
  • Fixed cases were baseline values were not correctly calculated in the Memory tables when comparing reports of different architectures

  • +
  • Fixed incorrect calculation of baseline values in the Executed Instruction Mix chart

  • +
  • Fixed accessing instanced metrics in the NvRules API

  • +
  • Fixed a bug that could cause the collection of unnecessary metrics in the Interactive Profile activity

  • +
  • Fixed potential crash on exit of the profiled target application

  • +
  • Switched underlying metric for SOL FB in the GPU Speed Of Light section to be driven by dram__throughput.avg.pct_of_peak_sustained_elapsed instead of fbpa__throughput.avg.pct_of_peak_sustained_elapsed

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2019-3.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2019-3.html new file mode 100644 index 0000000000000000000000000000000000000000..9da4bb7fd3631c561e07a89d3fb3a2ab517f35b7 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2019-3.html @@ -0,0 +1,187 @@ + + + + + + + Updates in 2019.3 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2019.3
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2019.3

+

General

+
    +
  • Improved performance

  • +
  • Bug fixes

  • +
  • Kernel launch context and stream are reported as metrics

  • +
  • PC sampling configuration options are reported as metrics

  • +
  • The default base port for connections to the target changed

  • +
  • Section files support multiple, named Body fields

  • +
  • NvRules allows users to query metrics using any convertible data type

  • +
+

NVIDIA Nsight Compute

+
    +
  • Support for filtering kernel launches using their NVTX context

  • +
  • Support for new options to select the connection port range

  • +
  • The Profile activity supports configuring PC sampling parameters

  • +
  • Sections on the Details page support selecting individual bodies

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Support for stepping to kernel launches from specific NVTX contexts

  • +
  • Support for new --port and --max-connections options

  • +
  • Support for new --sampling-* options to configure PC sampling parameters

  • +
  • Section file errors are reported with --list-sections

  • +
  • A warning is shown if some section files could not be loaded

  • +
+

Resolved Issues

+
    +
  • Using the –summary option works for reports that include invalid metrics

  • +
  • The full process executable filename is reported for QNX targets

  • +
  • The project system now properly stores the state of opened reports

  • +
  • Fixed PTX syntax highlighting

  • +
  • Fixed an issue when switching between manual and auto profiling in NVIDIA Nsight Compute

  • +
  • The source page in NVIDIA Nsight Compute now works with results from multiple processes

  • +
  • Charts on the NVIDIA Nsight Compute details page uses proper localization for numbers

  • +
  • NVIDIA Nsight Compute no longer requires the system locale to be set to English

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2019-4.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2019-4.html new file mode 100644 index 0000000000000000000000000000000000000000..6567d8240e9814473d09f096f6fe731a0b6b46b5 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2019-4.html @@ -0,0 +1,192 @@ + + + + + + + Updates in 2019.4 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2019.4
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2019.4

+

General

+
    +
  • Added support for the Linux PowerPC target platform

  • +
  • Reduced the profiling overhead, especially if no source metrics are collected

  • +
  • Reduced the overhead for non-profiled kernels

  • +
  • Improved the deployment performance during remote launches

  • +
  • Trying to profile on an unsupported GPU now shows an “Unsupported GPU” error message

  • +
  • Added support for the %i sequential number placeholder to generate unique report file names

  • +
  • Added support for smsp__sass_* metrics on Volta and newer GPUs

  • +
  • The launch__occupancy_limit_shared_mem now reports the device block limit if no shared memory is used by the kernel

  • +
+

NVIDIA Nsight Compute

+
    +
  • The Profile activity shows the command line used to launch ncu

  • +
  • The heatmap on the Source page now shows the represented metric in its tooltip

  • +
  • The Memory Workload Analysis Chart on the Details page now supports baselines

  • +
  • When applying rules, a message displaying the number of new rule results is shown in the status bar

  • +
  • The Visual Profiler Transition Guide was added to the documentation

  • +
  • Connection dialog activity options were added to the documentation

  • +
  • A warning dialog is shown if the application is resumed without Auto-Profile enabled

  • +
  • Pausing the application now has immediate feedback in the toolbar controls

  • +
  • Added a Close All command to the File menu

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • The --query-metrics option now shows only metric base names for faster metric query. The new option --query-metrics-mode can be used to display the valid suffixes for each base metric.

  • +
  • Added support for passing response files using the @ operator to specify command line options through a file

  • +
+

Resolved Issues

+
    +
  • Fixed an issue that reported the wrong executable name in the Session page when attaching

  • +
  • Fixed issues that chart labels were shown elided on the Details page

  • +
  • Fixed an issue that caused the cache hitrates to be shown incorrectly when baselines were added

  • +
  • Fixed an illegal memory access when collecting sass__*_histogram metrics for applications using PyTorch on Pascal GPUs

  • +
  • Fixed an issue when attempting to collect all smsp__* metrics on Volta and newer GPUs

  • +
  • Fixed an issue when profiling multi-context applications

  • +
  • Fixed that profiling start/stop settings from the connection dialog weren’t properly passed to the interactive profile activity

  • +
  • Fixed that certain smsp__warp_cycles_per_issue_stall* metrics returned negative values on Pascal GPUs

  • +
  • Fixed that metric names were truncated in the --page details non-CSV command line output

  • +
  • Fixed that the target application could crash if a connection port was used by another application with higher privileges

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2019-5-1.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2019-5-1.html new file mode 100644 index 0000000000000000000000000000000000000000..a5ffd7b595caebd8b5e1039608457d0c2ed602b7 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2019-5-1.html @@ -0,0 +1,155 @@ + + + + + + + Updates in 2019.5.1 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2019.5.1
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2019.5.1

+

General

+
    +
  • Added support for Nsight Compute Visual Studio Integration

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2019-5-2.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2019-5-2.html new file mode 100644 index 0000000000000000000000000000000000000000..18bcd66f0e8b5057ca7373a48e66f89d13d882f1 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2019-5-2.html @@ -0,0 +1,155 @@ + + + + + + + Updates in 2019.5.2 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2019.5.2
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2019.5.2

+

General

+
    +
  • Bug fixes

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2019-5-3.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2019-5-3.html new file mode 100644 index 0000000000000000000000000000000000000000..08bf840666063542c4cda02b5d8a2ab3abe728e0 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2019-5-3.html @@ -0,0 +1,155 @@ + + + + + + + Updates in 2019.5.3 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2019.5.3
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2019.5.3

+

General

+
    +
  • More C++ kernel names can be properly demangled

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2019-5.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2019-5.html new file mode 100644 index 0000000000000000000000000000000000000000..d1df8fae962b0f78b4c16c705924801e211d26af --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2019-5.html @@ -0,0 +1,187 @@ + + + + + + + Updates in 2019.5 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2019.5
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2019.5

+

General

+
    +
  • Added section sets to reduce the default overhead and make it easier to configure metric sets for profiling

  • +
  • Reduced the size of the installation

  • +
  • Added support for CUDA Graphs Recapture API

  • +
  • The NvRules API now supports accessing correlation IDs for instanced metrics

  • +
  • Added breakdown tables for SOL SM and SOL Memory in the Speed Of Light section for Volta+ GPUs

  • +
+

NVIDIA Nsight Compute

+
    +
  • Added a snap-select feature to the Source page heatmap help navigate large files

  • +
  • Added support for loading remote CUDA-C source files via SSH on demand for Linux x86_64 targets

  • +
  • Charts on the Details page provide better help in tool tips when hovering metric names

  • +
  • Improved the performance of the Source page when scrolling or collapsing

  • +
  • The charts for Warp States and Compute pipelines are now sorted by value

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Added support for GPU cache control, see --cache-control

  • +
  • Added support for setting the kernel name base in command line output, see --kernel-base

  • +
  • Added support for listing the available names for --chips, see --list-chips

  • +
  • Improved the stability on Windows when using --target-processes all

  • +
  • Reduced the profiling overhead for small metric sets in applications with many kernels

  • +
+

Resolved Issues

+
    +
  • Reduced the overhead caused by demangling kernel names multiple times

  • +
  • Fixed an issue that kernel names were not demangled in CUDA Graph Nodes resources window

  • +
  • The connection dialog better disables unsupported combinations or warns of invalid entries

  • +
  • Fixed metric thread_inst_executed_true to derive from smsp_not_predicated_off_thread_inst_executed on Volta+ GPUs

  • +
  • Fixed an issue with computing the theoretical occupancy on GV100

  • +
  • Selecting an entry on the Source page heatmap no longer selects the respective source line, to avoid losing the current selection

  • +
  • Fixed the current view indicator of the Source page heatmap to be line-accurate

  • +
  • Fixed an issue when comparing metrics from Pascal and later architectures on the Summary page

  • +
  • Fixed an issue that metrics representing constant values on Volta+ couldn’t be collected without non-constant metrics

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2020-1-1.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2020-1-1.html new file mode 100644 index 0000000000000000000000000000000000000000..7bfb1a3505cc14b89c454c044cd435de9c1f0e5c --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2020-1-1.html @@ -0,0 +1,178 @@ + + + + + + + Updates in 2020.1.1 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2020.1.1
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2020.1.1

+

General

+
    +
  • Added support for the NVIDIA GA100/SM 8.x GPU architecture

  • +
+
    +
  • Metrics passed to --metrics on the NVIDIA Nsight Compute CLI or in the respective Profile activity option are automatically expanded to all first-level sub-metrics if required. See the documentation on --metrics for more details.

  • +
  • Added new rules for detecting inefficiencies of using the sparse data compression on the NVIDIA Ampere architecture.

  • +
  • The version of the NVIDIA Nsight Compute target collecting the results is shown in the Session page.

  • +
  • Added new launch__grid_dim_[x,y,z] and launch__block_dim_[x,y,z] metrics.

  • +
+

NVIDIA Nsight Compute

+
    +
  • The Break on API Error functionality has been improved when auto profiling.

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • The full path to the report output file is printed after profiling.

  • +
  • Added and corrected metrics in the nvprof Metric Comparison table.

  • +
+

Resolved Issues

+
    +
  • Documented the breakdown: metrics prefix.

  • +
  • Fixed handling of escaped domain delimiters in NVTX filter expressions.

  • +
  • Fixed issues with the occupancy charts for small block sizes.

  • +
  • Fixed an issue when choosing a default report page in the options dialog.

  • +
  • Fixed that the scroll bar could overlap the content when exporting the report page as an image.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2020-1-2.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2020-1-2.html new file mode 100644 index 0000000000000000000000000000000000000000..b47aaf285c9a44725ee449b986ce05100fd7e0ae --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2020-1-2.html @@ -0,0 +1,161 @@ + + + + + + + Updates in 2020.1.2 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2020.1.2
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2020.1.2

+

General

+
    +
  • The NVIDIA Nsight Compute installer for Mac is now code-signed and notarized.

  • +
  • Disabled the creation of the Python cache when executing rules to avoid permission issues and signing conflicts.

  • +
+

Resolved Issues

+
    +
  • Fixed the launcher script of the NVIDIA Nsight Compute CLI to no longer fail if uname -p is not available.

  • +
  • Fixed the API parameter capture for function cuDeviceGetLuid.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2020-1.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2020-1.html new file mode 100644 index 0000000000000000000000000000000000000000..ad66e3bd280b04d47090623d9bf800d4bc123acf --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2020-1.html @@ -0,0 +1,195 @@ + + + + + + + Updates in 2020.1 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2020.1
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2020.1

+

General

+
    +
  • Added support for the NVIDIA GA100/SM 8.x GPU architecture

  • +
  • Removed support for the Pascal SM 6.x GPU architecture

  • +
  • Windows 7 is not a supported host or target platform anymore

  • +
  • Added a rule for reporting uncoalesced memory accesses as part of the Source Counters section

  • +
  • Added support for report name placeholders %p, %q, %i and %h

  • +
  • The Kernel Profiling Guide was added to the documentation

  • +
+

NVIDIA Nsight Compute

+
    +
  • The UI command was renamed from nv-nsight-cu to ncu-ui. Old names remain for backwards compatibility.

  • +
  • Added support for roofline analysis charts

  • +
  • Added linked hot spot tables in section bodies to indicate performance problems in the source code

  • +
  • Added section navigation links in rule results to quickly jump to the referenced section

  • +
  • Added a new option to select how kernel names are shown in the UI

  • +
  • Added new memory tables for the L1/TEX cache and the L2 cache. The old tables are still available for backwards compatibility and moved to a new section containing deprecated UI elements.

  • +
  • Memory tables now show the metric name as a tooltip

  • +
  • Source resolution now takes into account file properties when selecting a file from disk

  • +
  • Results in the profile report can now be filtered by NVTX range

  • +
  • The Source page now supports collapsing views even for single files

  • +
  • The UI shows profiler error messages as dismissible banners for increased visibility

  • +
  • Improved the baseline name control in the profiler report header

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • The CLI command was renamed from nv-nsight-cu-cli to ncu. Old names remain for backwards compatibility.

  • +
  • Queried metrics on GV100 and newer chips are sorted alphabetically

  • +
  • Multiple instances of NVIDIA Nsight Compute CLI can now run concurrently on the same system, e.g. for profiling individual MPI ranks. Profiled kernels are serialized across all processes using a system-wide file lock.

  • +
+

Resolved Issues

+
    +
  • More C++ kernel names can be properly demangled

  • +
  • Fixed a free(): invalid pointer error when profiling applications using pytorch > 19.07

  • +
  • Fixed profiling IBM Spectrum MPI applications that require PAMI GPU hooks (--smpiargs="-gpu")

  • +
  • Fixed that the first kernel instruction was missed when computing sass__inst_executed_per_opcode

  • +
  • Reduced surplus DRAM write traffic created from flushing caches during kernel replay

  • +
  • The Compute Workload Analysis section shows the IMMA pipeline on GV11b GPUs

  • +
  • Profile reports now scroll properly on MacOS when using a trackpad

  • +
  • Relative output filenames for the Profile activity now use the document directory, instead of the current working directory

  • +
  • Fixed path expansion of ~ on Windows

  • +
  • Memory access information is now shown properly for RED assembly instructions on the Source page

  • +
  • Fixed that user PYTHONHOME and PYTHONPATH environment variables would be picked up by NVIDIA Nsight Compute, resulting in locale encoding issues.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2020-2-1.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2020-2-1.html new file mode 100644 index 0000000000000000000000000000000000000000..c6f9bb891a47b730d5131f35416fcb4f9ef1b058 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2020-2-1.html @@ -0,0 +1,163 @@ + + + + + + + Updates in 2020.2.1 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2020.2.1
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2020.2.1

+

Resolved Issues

+
    +
  • Fixed several issues related to auto-profiling in the UI.

  • +
  • Fixed a metric collection issue when profiling kernels on different GPU architectures with application replay.

  • +
  • Fixed a performance problem related to profiling large process trees.

  • +
  • Fixed that occupancy charts would not render correctly when comparing against baselines.

  • +
  • Fixed that no memory metrics were shown on the Source page for LDGSTS instructions.

  • +
  • Fixed the automatic sorting on the Summary and Raw pages.

  • +
  • Fixed an issue that would cause the NVIDIA Nsight Compute CLI to consume too much memory when importing or printing reports.

  • +
  • Long kernel names are now elided in the Details page source hot spot tables.

  • +
  • Fixed that function names in the Resources tool window were demangled differently.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2020-2.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2020-2.html new file mode 100644 index 0000000000000000000000000000000000000000..65777b5a1944d0fa9cc0407942bee54410d9c5b3 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2020-2.html @@ -0,0 +1,187 @@ + + + + + + + Updates in 2020.2 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2020.2
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2020.2

+

General

+
    +
  • Added support for the NVIDIA Ampere GPUs with compute capability 8.6 and CUDA toolkit 11.1.

  • +
  • Added support for application replay to collect metric results across multiple application runs, instead of replaying individual kernels.

  • +
  • Added new launch__device_id metric.

  • +
  • Added support for NVLink (nvl*) metrics for GPUs with compute capabilities 7.0, 7.5 and 8.0

  • +
  • Added documentation for memory charts and tables in the Profiling Guide.

  • +
+

NVIDIA Nsight Compute

+
    +
  • Updated menu and toolbar layout.

  • +
  • Added support for zoom and pan on roofline charts.

  • +
  • The Resources tool window shows the current CUDA stream attributes.

  • +
  • The memory chart shows a heatmap for link and port utilization.

  • +
  • The hot-spot tables in the Source Counters section now show values as percentages, too.

  • +
  • On-demand resolve of remote CUDA-C source is now available for MacOS hosts.

  • +
  • Metric columns in the Summary and Raw pages are now sortable.

  • +
  • Added a new option to set the number of recent API calls shown in the API Stream tool window.

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • CLI output now shows NVTX payload information.

  • +
  • CSV output now shows NVTX states.

  • +
  • Added a new --replay-mode option to select the mechanism used for replaying a kernel launch multiple times.

  • +
  • Added a new --kill option to terminate the application once all requested kernels were profiled.

  • +
  • Added a new --log-file option to decide the output stream for printing tool output.

  • +
  • Added a new --check-exit-code option to decide if the child application exit code should be checked.

  • +
+

Resolved Issues

+
    +
  • The profiling progress dialog is not dismissed automatically anymore after an error.

  • +
  • The inter-process lock is now automatically given write permissions for all users.

  • +
  • All project extensions are enabled in the default dialog filter.

  • +
  • Fixed handling of targets using tcsh during remote profiling.

  • +
  • Fixed handling of quoted application arguments on Windows.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2020-3-1.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2020-3-1.html new file mode 100644 index 0000000000000000000000000000000000000000..3fed225c36ae83b6b8fb2745473c2b868fe9e4a8 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2020-3-1.html @@ -0,0 +1,171 @@ + + + + + + + Updates in 2020.3.1 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2020.3.1
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2020.3.1

+

General

+
    +
  • Added support for LDSM instruction-level metrics.

  • +
+

NVIDIA Nsight Compute

+
    +
  • LDSM instruction-level metrics are shown in the Source page and memory tables.

  • +
  • Improved reporting and documentation for collecting Profile Series.

  • +
  • Frozen columns in the Source page are automatically scrolled into view.

  • +
+

Resolved Issues

+
    +
  • Fixed an issue when profiling multi-threaded applications.

  • +
  • Fixed an issue that NVIDIA Nsight Compute would not automatically restart when using Reset Application Data.

  • +
  • Fixed issues with target applications using libstdc++.

  • +
  • Fixed an issue when collecting single-pass metrics in multiple Nsight Compute instances.

  • +
  • Fixed an issue when using Kernel ID and setting Launch Capture Count as non-zero in the UI’s Profile activity.

  • +
  • Fixed an issue that prevented different users on the same Linux system to use NVIDIA Nsight Compute in shared instance mode.

  • +
  • Fixed an issue that prevented resources from being properly renamed using NVTX information in the UI.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2020-3.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2020-3.html new file mode 100644 index 0000000000000000000000000000000000000000..5d31639cd37f0ac88e24572984b774cb246c7eb8 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2020-3.html @@ -0,0 +1,186 @@ + + + + + + + Updates in 2020.3 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2020.3
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2020.3

+

General

+
    +
  • Added support for derived metrics in section files. Derived metrics can be used to create new metrics based on existing metrics and constants. See the Customization Guide for details.

  • +
  • Added a new Import Source (--import-source) option to the UI and command line to permanently import source files into the report, when available.

  • +
  • Added a new section that shows selected NVLink metrics on supported systems.

  • +
  • Added a new launch__func_cache_config metric to the Launch Statistics section.

  • +
  • Added new branch efficiency metrics to the Source Counters section, including smsp__sass_average_branch_targets_threads_uniform.pct to replace nvprof’s branch_efficiency, as well as instruction-level metrics smsp__branch_targets_threads_divergent, smsp__branch_targets_threads_uniform and branch_inst_executed.

  • +
  • A warning is shown if kernel replay starts staging GPU memory to CPU memory or the file system.

  • +
  • Section and rule files are deployed to a versioned directory in the user’s home directory to allow easier editing of those files, and to prevent modifying the base installation.

  • +
  • Removed support for NVLINK(nvl*) metrics due to a potential application hang during data collection. The metrics will be added back in a future version of the driver/tool.

  • +
+

NVIDIA Nsight Compute

+
    +
  • Added support for Profile Series. Series allow you to profile a kernel with a range of configurable parameters to analyze the performance of each combination.

  • +
  • Added a new Allocations view to the Resources tool window which shows the state of all current memory allocations.

  • +
  • Added a new Memory Pools view to the Resources tool window which shows the state of all current memory pools.

  • +
  • Added coverage of peer memory to the Memory Chart.

  • +
  • The Source page now shows the number of excessive sectors requested from L1 or L2, e.g. due to uncoalesced memory accesses.

  • +
  • The Source column on the Source page can now be scrolled horizontally.

  • +
  • The kernel duration gpu__time_duration.sum was added as column on the Summary page.

  • +
  • Improved the performance of application replay when not all kernels in the application are profiled.

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Added a new --app-replay-match option to select the mechanism used for matching kernel instances across application replay passes.

  • +
  • An error is shown if --nvtx-include/exclude are used without --nvtx.

  • +
+

Resolved Issues

+
    +
  • The Grid Size column on the Raw page now shows the CUDA grid size like the Launch Statistics section, rather than the combined grid and block sizes.

  • +
  • The Branch Resolving wap stall reason was added to the PC sampling metric groups and the Warp State Statistics section.

  • +
  • The API Stream tool window shows kernel names according to the selected Function Name Mode.

  • +
  • Fixed that an incorrect line could be shown after a heatmap selection on the Source page.

  • +
  • Fixed incorrect metric usage for system memory in the Memory Chart. Previously, all requested memory of L2 from system memory was reported instead of only the portion that missed in L2.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-1-1.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-1-1.html new file mode 100644 index 0000000000000000000000000000000000000000..c458ea02f1e49898b2916aeb8e339d348d9e082e --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-1-1.html @@ -0,0 +1,178 @@ + + + + + + + Updates in 2021.1.1 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2021.1.1
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2021.1.1

+

General

+
    +
  • Updated OpenSSL library to version 1.1.1k.

  • +
+

NVIDIA Nsight Compute

+
    +
  • Remote source resolution can now use the IP address, in addition to the hostname, to find the necessary SSH target.

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Added support for the existing command line options for kernel filtering while importing data from an existing report file using --import.

  • +
  • Option -k is not considered as deprecated option --kernel-regex anymore.

  • +
+

Resolved Issues

+
    +
  • Fixed failure to profile kernels from applications that use the CUDA graphics interop APIs to share semaphores.

  • +
  • Fixed wavefront metric in the L1TEX table for writes to shared memory on GA10x chips.

  • +
  • Fixed an issue resulting in incomplete data collection for the interactive profile activity after switching from single-pass mode to collecting multiple passes in the same session.

  • +
  • Fixed values shown in the mimimap of the Source page when all functions are collapsed.

  • +
  • Fixed an issue causing names set by the NVTX naming APIs of one application to be applied to all subsequent sessions of the same instance of NVIDIA Nsight Compute.

  • +
  • Fixed behavior of horizontal scroll bars when clicking in the source views on the Source page.

  • +
  • Fixed appearance of multi-line entries in column chooser on the Source page.

  • +
  • Fixed enablement state of the reset button on the Connection dialog.

  • +
  • Fixed potential crash of NVIDIA Nsight Compute when windows size becomes small while being on the Source page.

  • +
  • Fixed potential crash of NVIDIA Nsight Compute when relative paths for section/rules files could not be found.

  • +
  • Fixed potential crash of NVIDIA Nsight Compute after removing baselines.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-1.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-1.html new file mode 100644 index 0000000000000000000000000000000000000000..e96f86ad552ce38b6548b07ea9f5c4a7720e76f6 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-1.html @@ -0,0 +1,180 @@ + + + + + + + Updates in 2021.1 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2021.1
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2021.1

+

General

+
    +
  • Added support for the CUDA toolkit 11.3.

  • +
  • Added support for the OptiX 7 API.

  • +
  • GpuArch enumeration values used for filtering in section files were renamed from architecture names to compute capabilities.

  • +
  • NVTX states can now be accessed via the NvRules API.

  • +
  • Added a rule for the Occupancy section.

  • +
+

NVIDIA Nsight Compute

+
    +
  • Added support for new CUDA asynchronous allocator attributes in the Memory Pools resources view.

  • +
  • Added a topology chart and link properties table in the NVLink section.

  • +
  • The selected metric column is scrolled into view on the Source page when a new metric is selected.

  • +
  • Users can choose the Source heatmap color scale in the Options dialog.

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Added file-based application replay as the new default application replay mode. File-based replay uses a temporary file for keeping replay data, instead of allocating them in memory. This keeps the required memory footprint close to constant, independent of the number of profiled kernels. Users can switch between buffer modes using the --app-replay-buffer option.

  • +
  • CLI output now shows NVTX color and message information.

  • +
  • --kernel-regex and --kernel-regex-base> options are deprecated and replaced by --kernel-name and --kernel-regex-base, respectively.

  • +
  • All options which support regex need to provide regex: as a prefix before an argument to match per the regex, e.g <option> <regex:expression>

  • +
+

Resolved Issues

+
    +
  • Fixed that baselines were not updated properly on the Comments page.

  • +
  • Fixed that NVTX ranges named using their payloads can be used in NVTX filtering expressions.

  • +
  • Fixed crashes in MacOSX hosts when terminating the target application.

  • +
  • The NVLINK(nvl*) metrics are now added back.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2-1.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2-1.html new file mode 100644 index 0000000000000000000000000000000000000000..6f639f548621bee107e3446a51a414223bafaa29 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2-1.html @@ -0,0 +1,161 @@ + + + + + + + Updates in 2021.2.1 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2021.2.1
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2021.2.1

+

General

+ +

Resolved Issues

+
    +
  • Fixed that links in the Memory Allocations Resource view were not working correctly.

  • +
  • Fixed that NVTX state might not be correctly reset between interactive profiling activities.

  • +
  • Fixed that the UI could crash when opening baselines from different GPU architectures.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2-2.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2-2.html new file mode 100644 index 0000000000000000000000000000000000000000..8a5320b339e559de3e40cb8d747ef6a601090999 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2-2.html @@ -0,0 +1,159 @@ + + + + + + + Updates in 2021.2.2 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2021.2.2
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2021.2.2

+

General

+
    +
  • Changes for profiling support on NVIDIA virtual GPUs (vGPUs) for an upcoming GRID/vGPU release.

  • +
+

Resolved Issues

+
    +
  • Fixed hang issue on QNX when using the --target-processes all option while profiling shell scripts.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2-3.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2-3.html new file mode 100644 index 0000000000000000000000000000000000000000..a0978cd8e95ff825ea10729c3c5a0382843fa49b --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2-3.html @@ -0,0 +1,159 @@ + + + + + + + Updates in 2021.2.3 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2021.2.3
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2021.2.3

+

General

+
    +
  • Added support for the NVIDIA GA10b chip.

  • +
+

Resolved Issues

+
    +
  • Improved error message on QNX for failure to deploy stock section and rules files.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2-4.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2-4.html new file mode 100644 index 0000000000000000000000000000000000000000..9ed92824a4cf05f68b3e0ea19b8579a92ec89a02 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2-4.html @@ -0,0 +1,155 @@ + + + + + + + Updates in 2021.2.4 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2021.2.4
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2021.2.4

+

Resolved Issues

+
    +
  • Fixed an issue that prevented remote interactive profiling of kernels on NVIDIA GA10b chips.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2-5.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2-5.html new file mode 100644 index 0000000000000000000000000000000000000000..19fecbae229ae321b0340a61d64e67a8b4786c58 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2-5.html @@ -0,0 +1,155 @@ + + + + + + + Updates in 2021.2.5 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2021.2.5
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2021.2.5

+

Resolved Issues

+
    +
  • Improve the handling of the performance monitor reservation on mobile target GPUs.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2-6.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2-6.html new file mode 100644 index 0000000000000000000000000000000000000000..e45be590ac7abca43dc41f3ff3ba1ee4eb88697e --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2-6.html @@ -0,0 +1,155 @@ + + + + + + + Updates in 2021.2.6 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2021.2.6
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2021.2.6

+

Resolved Issues

+
    +
  • Fixed an issue causing a hang on QNX after pressing ctrl+c while profiling a multi-process application.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2-7.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2-7.html new file mode 100644 index 0000000000000000000000000000000000000000..31aa255f60a27ee9e3a07dfc22688eb607a23072 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2-7.html @@ -0,0 +1,155 @@ + + + + + + + Updates in 2021.2.7 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2021.2.7
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2021.2.7

+

General

+
    +
  • Enabled stack canaries with random canary values for L4T builds.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2-8.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2-8.html new file mode 100644 index 0000000000000000000000000000000000000000..8a16837de4d95cae11610201ff26f11344c9ecae --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2-8.html @@ -0,0 +1,155 @@ + + + + + + + Updates in 2021.2.8 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2021.2.8
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2021.2.8

+

General

+
    +
  • Updated Python libraries to version 3.10.5.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2-9.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2-9.html new file mode 100644 index 0000000000000000000000000000000000000000..668e6501b3fe5b80d20e2994b8429ef776ddd182 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2-9.html @@ -0,0 +1,155 @@ + + + + + + + Updates in 2021.2.9 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2021.2.9
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2021.2.9

+

NVIDIA Nsight Compute

+
    +
  • Clarify when not all metrics for the roofline chart could be collected on the current chip.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2.html new file mode 100644 index 0000000000000000000000000000000000000000..3471b31e02fadeb10ad83f3cb3b8526b4d05c1ba --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-2.html @@ -0,0 +1,195 @@ + + + + + + + Updates in 2021.2 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2021.2
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2021.2

+

General

+
    +
  • Added support for the CUDA toolkit 11.4.

  • +
  • Added support for OptiX version 7.3.

  • +
  • Added support for profiling on NVIDIA virtual GPUs (vGPUs) on an upcoming GRID/vGPU release.

  • +
  • Added a new Python-based report interface for interacting with report files from Python scripts.

  • +
  • Added a new rule to warn users when sampling metrics were selected, but no sampling data was collected.

  • +
  • Renamed SOL to Throughput in the Speed of Light section.

  • +
  • Renamed several memory_* metrics used on the Source page, to better reflect the measured value. See the Source page documentation for more details.

  • +
+

NVIDIA Nsight Compute

+
    +
  • Added support for opening cubin files in a Standalone Source Viewer without profiling the application.

  • +
  • Moved the output of all rules so that it is visible even if a section’s body is collapsed. Visibility of the rules’ output can be toggled by a new button in the report header.

  • +
  • The profiler report header now shows the report name for each baseline when ambiguous.

  • +
  • Rules can define Focused Metrics that were most important for triggering their result output. Metrics are provided per result message which additional information, such as the underlying conditions and thresholds.

  • +
  • Memory tables show tooltips for cells with derived metric calculations.

  • +
  • Added a knowledge base service to show more comprehensive background information on metric names and descriptions in their tooltips.

  • +
  • Following a link in the Source Counters hot spot tables automatically selects the corresponding metric in the Source page.

  • +
  • Added new columns for visualizing register dependencies in the SASS view of the Source page.

  • +
  • Functions in the SASS view are now sorted by name.

  • +
  • Added support for OptiX 7.x resource tracking in the interactive profile activity. The Resources tool window will show information on instantiated optixDeviceContexts, optixModules, optixProgramGroups, optixPipelines and optixDenoiser objects.

  • +
  • Added support for new CUDA graph memory allocation APIs.

  • +
  • Improved consistency between command line parameters and the Next Trigger filter in the API Stream window for handling of regex inputs. The Next Trigger filter now considers kernel/API name as a regular expression only if string has regex: as prefix.

  • +
  • Added ability to select font settings in the options dialog.

  • +
  • Added ability to configure the metrics shown on the summary page via the options dialog.

  • +
  • The selected heatmap color scale now also applies to the Memory chart.

  • +
  • The ncu-ui script now checks for missing library dependencies, such as OpenGL or Qt.

  • +
+

NVIDIA Nsight Compute CLI

+ +

Resolved Issues

+
    +
  • Fixed a performance issue in the NVIDIA Nsight Compute CLI when using --page raw --csv --units auto.

  • +
  • Fixed that the SSH passphase key is no longer persisted in the project file.

  • +
  • Fixed state of restore button in connection dialog. The button now supports restoring the default settings, if current setting differ from the default.

  • +
  • Fixed that the complete GPU name can be shown in the NVLINK topology diagram on MacOS.

  • +
  • Fixed that collapsing the Source view reset the selected metrics.

  • +
  • Fixed that correlated lines could differ between filtered and unfiltered views of the executed functions.

  • +
  • Fixed that two application icons were shown in the MacOS dock.

  • +
  • Improved HiDPI awareness.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-3-1.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-3-1.html new file mode 100644 index 0000000000000000000000000000000000000000..1d09e2804ef1536e098e6e5708746fda2333d261 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-3-1.html @@ -0,0 +1,161 @@ + + + + + + + Updates in 2021.3.1 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2021.3.1
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2021.3.1

+

Resolved Issues

+
    +
  • Fixed that kernels with the same name and launch configuration were in some scenarios associated with the wrong profiling results during application replay.

  • +
  • Fixed an issue with binary forward compatibility of the report format.

  • +
  • Fixed an issue with applications calling into the CUDA API during process teardown.

  • +
  • Fixed an issue profiling application using pre-CUDA API 3.1 contexts.

  • +
  • Fixed a crash when resolving files on the Source page.

  • +
  • Fixed that opening reports with large embedded CUBINs would hang the UI.

  • +
  • Fixed an issue with remote profiling on a target where the UI is already launched.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-3.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-3.html new file mode 100644 index 0000000000000000000000000000000000000000..9cd33de6ff0bc00cd2645442dca4bd99c01b0371 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2021-3.html @@ -0,0 +1,189 @@ + + + + + + + Updates in 2021.3 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2021.3
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2021.3

+

General

+
    +
  • Added support for the CUDA toolkit 11.5.

  • +
  • Added a new rule for detecting inefficient memory access patterns in the L1TEX cache and L2 cache.

  • +
  • Added a new rule for detecting high usage of system or peer memory.

  • +
  • Added new IAction::sass_by_pc function to the the NvRules API.

  • +
  • The Python-based report interface is now available for Windows and MacOS hosts, too.

  • +
  • Added Hierarchical Roofline section files in a new “roofline” section set.

  • +
  • Added support for collecting CPU call stack information.

  • +
+

NVIDIA Nsight Compute

+
    +
  • Added support for new remote profiling SSH connection and authentication options as well as local SSH configuration files.

  • +
  • Added an Occupancy Calculator which can be opened directly from a profile report or as a new activity. It offers feature parity to the CUDA Occupancy Calculator spreadsheet.

  • +
  • Added new Baselines tool window to manage (hide, update, re-order, save/load) baseline selections.

  • +
  • The Source page views now support multi-line/cell selection and copy/paste. Different colors are used for highlighting selections and correlated lines.

  • +
  • The search edit on the Source page now supports Shift+Enter to search in reverse direction.

  • +
  • The Memory Workload Analysis Chart can be configured to show throughput values instead of transferred bytes.

  • +
  • The Profile activity now supports the --devices option.

  • +
  • The NVLink Topology diagram displays per NVLink metrics.

  • +
  • Added a new tool window showing the CPU call stack at the location where the current thread was suspended during interactive profiling activities.

  • +
  • If enabled, the Call Stack / NVTX page of the profile report shows the captured CPU call stack for the selected kernel launch.

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Added support for printing source/metric content with the new --page source and --print-sourcecommand line options.

  • +
  • Added new option --call-stack to enable collecting the CPU call stack for every profiled kernel launch.

  • +
+

Resolved Issues

+
    +
  • Fixed that memory_* metrics could not be collected with the --metrics option.

  • +
  • Fixed that selection and copy/paste was not supported for section header tables on the Details page.

  • +
  • Fixed issues with the Source page when collapsing the content.

  • +
  • Fixed that the UI could crash when applying rules to a new profile result.

  • +
  • Fixed that PC Sampling metrics were not available for Profile Series.

  • +
  • Fixed that local profiling did not work if no non-loopback address was configured for the system.

  • +
  • Fixed termination of remote-launched applications. On QNX, terminating an application profiled via Remote Launch is now supported. Canceling remote-launched Profile activities is now supported.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2022-1-1.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2022-1-1.html new file mode 100644 index 0000000000000000000000000000000000000000..d99dc9837ce30c08c49b9007b96ae85a54e51253 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2022-1-1.html @@ -0,0 +1,166 @@ + + + + + + + Updates in 2022.1.1 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2022.1.1
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2022.1.1

+

General

+
    +
  • Filtering kernel launches or profile results based on NVTX domains/ranges now takes registered strings in the payload field into account, if the range name is empty.

  • +
  • Added support for the suffix .max_rate for ratio metrics.

  • +
+

Resolved Issues

+
    +
  • Fixed a crash during the disassembly of the kernel’s SASS code for the Source page.

  • +
  • Fixed a crash on exit of the NVIDIA Nsight Compute UI.

  • +
  • Fixed a hang during profiling when CPU call stack collection is enabled.

  • +
  • Fixed missing to flush UVM buffers before taking memory checkpoints during Range Replay.

  • +
  • Fixed tracking of memory during Range Replay, if the CUDA context has any device mapped memory allocations.

  • +
  • Fixed the maximum available shared memory sizes in the Occupancy Calculator for NVIDIA Ampere GPUs.

  • +
  • Fixed that the shared memory usage of the kernel is incorrectly initialized when opening the Occupancy Calculator from a profile report.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2022-1.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2022-1.html new file mode 100644 index 0000000000000000000000000000000000000000..58c56a4763ded3a4a939bd6b3fbaa8fbb6dce761 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2022-1.html @@ -0,0 +1,189 @@ + + + + + + + Updates in 2022.1 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2022.1
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2022.1

+

General

+
    +
  • Added support for the CUDA toolkit 11.6.

  • +
+
    +
  • Added support for GA103 chips.

  • +
+
    +
  • Added a new Range Replay mode to profile ranges of multiple, concurrent kernels. Range replay is available in the NVIDIA Nsight Compute CLI and the non-interactive Profile activity.

  • +
  • Added a new rule to detect non-fused floating-point instructions.

  • +
  • The Uncoalesced Memory access rules now show results in a dynamic table.

  • +
  • Unix Domain Sockets and Windows Named Pipes are used for local connection between the host and target processes on x86_64 Linux and Windows, respectively.

  • +
  • The NvRules API now supports querying action names using different function name bases (e.g. demangled).

  • +
+

NVIDIA Nsight Compute

+
    +
  • The default report page is now chosen automatically when opening a report.

  • +
  • Added coverage for ECC (Error Correction Code) operations in the L2 Cache table of the Memory Analysis section.

  • +
  • Added a new L2 Evict Policies table to the Memory Analysis section.

  • +
  • The Occupancy Calculator now updates automatically when the input changes.

  • +
  • Added new metric Thread Instructions Executed to the Source page.

  • +
  • Added tooltips to the Register Dependency columns in the Source page to identify the associated register more conveniently.

  • +
  • Improved the selection of Sections and Sets in the Profile activity connection dialog.

  • +
  • NVLink utilization is shown in the NVLink Tables section.

  • +
  • NVLink links are colored according to the measured throughput.

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • --kernel-regex and --kernel-regex-base options are no longer supported. Alternate options are --kernel-name and --kernel-name-base respectively, added in 2021.1.0.

  • +
  • Added support to resolve CUDA source files in the --page source output with the new --resolve-source-filecommand line option.

  • +
  • Added new option --target-processes-filter to filter the processes being profiled by name.

  • +
  • The CPU Stack Trace is shown in the NVIDIA Nsight Compute CLI output.

  • +
+

Resolved Issues

+
    +
  • Fixed the calculation of aggregated average instruction execution metrics in non-SASS views on the Source page.

  • +
  • Fixed that atomic instructions are counted as both loads and stores in the Memory Analysis tables.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2022-2-1.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2022-2-1.html new file mode 100644 index 0000000000000000000000000000000000000000..5f0cbcd47e39a36e9c592d5cfd9f4f260f4e0289 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2022-2-1.html @@ -0,0 +1,159 @@ + + + + + + + Updates in 2022.2.1 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2022.2.1
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2022.2.1

+

Resolved Issues

+
    +
  • Fixed an issue that caused some tootips to not show up for the charts on the Details page.

  • +
  • Fixed the incorrect reporting of the accessed bytes for LDGSTS (access) traffic in the L1TEX memory table.

  • +
  • Fixed an issue that resulted in an empty view on the Source page after resolving multiple source files at once.

  • +
  • Fixed a failure to connect to remote machines over SSH due to a mismatch in the configuration of data compression.

  • +
  • Fixed a potential failure to profile kernels on multiple devices of the same type of chip. The failure occurred on the attempt to profile on the second device.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2022-2.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2022-2.html new file mode 100644 index 0000000000000000000000000000000000000000..8fefd5aad874223f4de1e3c8ca5745aaab6d9ee4 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2022-2.html @@ -0,0 +1,190 @@ + + + + + + + Updates in 2022.2 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2022.2
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2022.2

+

General

+
    +
  • Added support for the CUDA toolkit 11.7.

  • +
  • Improved performance for profiling and metric query.

  • +
  • Added Linux (aarch64 sbsa) as a supported host platform.

  • +
  • The NVIDIA Nsight Compute CLI stores the command line arguments, which can be viewed in the Session report page.

  • +
  • Added an API to query the version of the Python Report and NvRules interfaces.

  • +
  • Added an API to query the PTX in the Python Report and NvRules interfaces.

  • +
+

NVIDIA Nsight Compute

+
    +
  • The Acceleration Structure Viewer allows inspection of acceleration structures built using the OptiX API for debugging and performance optimization.

  • +
  • The Source page column chooser now supports to enable or disable groups of metrics. Note that not all metrics are enabled anymore by default to make the view easier to use.

  • +
  • The Resources tool window now links to the exact target resource instances for CUDA resource types.

  • +
  • The Resources tool window now shows the instanced nodes for CUDA graphs.

  • +
  • The Resources tool window now shows the loading state and number of loaded functions for CUDA Modules.

  • +
  • The Resources tool window now shows the graph node enablement state for applicable instanced graph nodes.

  • +
  • The Resources tool window now shows the graph node priorities for instanced kernel graph nodes.

  • +
  • Added regex support in the Next Trigger filter for NVTX based filtering. The Next Trigger filter now considers the NVTX config as a regular expression if the regex: prefix is specified.

  • +
  • Added regex support in the report’s Filter Results dialog.

  • +
  • Added keyboard shortcuts to navigate between the pages in a report.

  • +
  • The behavior for selecting sets and sections is now consistent between the Sections/Rules Info window and the non-interactive profile activity.

  • +
  • Reports can now be opened directly from the welcome dialog.

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Added support for collecting sampling-based warp stalls in range replay mode.

  • +
  • Added regex support in NVTX filtering.

  • +
  • The metric type is shown when querying metrics.

  • +
+

Resolved Issues

+
    +
  • Reduced overhead of connecting to the host UI for non-interactive remote profiling sessions.

  • +
  • Fixed issues with persisting the Source page state when collapsing or switching between results.

  • +
  • Fixed an issue that locked GPU clocks were not reset when terminating the NVIDIA Nsight Compute CLI while profiling a kernel.

  • +
  • Fixed issues with selecting and copying text from the Details page tables.

  • +
  • Fixed an issue with opening report files in the UI on MacOSX.

  • +
  • Fixed an issue with the Freeze API option.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2022-3.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2022-3.html new file mode 100644 index 0000000000000000000000000000000000000000..9b3a39ef62c41a5e6cc67907d4e908cf2f29dfc9 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2022-3.html @@ -0,0 +1,188 @@ + + + + + + + Updates in 2022.3 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2022.3
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2022.3

+

General

+
    +
  • Added support for the CUDA toolkit 11.8.

  • +
  • Added support for the Ada GPU architecture.

  • +
  • Added support for the Hopper GPU architecture.

  • +
  • Added support for OptiX 7.6.

  • +
  • Added uncoalescedGlobalAccesses sample CUDA application and document to show how the NVIDIA Nsight Compute profiler can be used to analyze and identify the memory accesses which are uncoalesced and result in inefficient DRAM accesses. Refer to the README, sample code and document under extras/samples/uncoalescedGlobalAccesses.

  • +
  • Added Metrics Reference in the documentation that lists metrics not available through --query-metrics.

  • +
  • Reduced the overhead of collecting SASS-patching based metrics.

  • +
  • On Multi-Instance GPU (MIG) configurations, NVIDIA Nsight Compute cannot lock clocks anymore. Users are expected to lock clocks externally using nvidia-smi.

  • +
+

NVIDIA Nsight Compute

+
    +
  • Wrapper script nv-nsight-cu is deprecated in favor of ncu-ui and will be removed in a future release.

  • +
  • Source page supports range replay results.

  • +
  • Added a second chart on the Compute Workload Analysis section to avoid mixing metrics with different meaning.

  • +
  • NVIDIA Nsight Compute now tracks traversable handles created with optixAccelRelocate.

  • +
  • NVIDIA Nsight Compute now tracks traversable handles created as updates from others.

  • +
  • The Acceleration Structure viewer now reports unsupported inputs.

  • +
  • The Acceleration Structure viewer now supports opening multiple traversable handles.

  • +
  • The Acceleration Structure viewer now uses OptiX naming for displayed elements.

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Wrapper script nv-nsight-cu-cli is deprecated in favor of ncu and will be removed in a future release.

  • +
  • Added new option --filter-mode per-gpu to enable filtering of kernel launches on each GPU separately.

  • +
  • Added new option --app-replay-mode relaxed to produce profiling results for valid kernels even if the number of kernel launches is inconsistent across application replay passes.

  • +
  • Added a documentation section on supported environment variables.

  • +
  • Improved the performance when loading existing reports on the command line.

  • +
+

Resolved Issues

+
    +
  • Fixed an issue when resolving files on the Source page.

  • +
  • Fixed an issue when profiling OptiX applications.

  • +
  • Fixed an issue in the OptiX traversable handle management caused by clashing handle values.

  • +
  • Fixed an issue in the Acceleration Structure viewer causing the display of invalid memory when viewing AABB buffers.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2022-4-1.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2022-4-1.html new file mode 100644 index 0000000000000000000000000000000000000000..d8f9f7b001b6c0e4f6a3dc8e314a3f7ae8dfacd5 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2022-4-1.html @@ -0,0 +1,164 @@ + + + + + + + Updates in 2022.4.1 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2022.4.1
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2022.4.1

+

General

+
    +
  • Improved the documentation for the NvRules API.

  • +
  • The python report interface links libstdc++ statically.

  • +
+

Resolved Issues

+
    +
  • Fixed an issue that enabled profiling on CUDA Graph uploads.

  • +
  • Fixed formatting issues during unit conversion of metric instances.

  • +
  • Fixed an issue that could lead to a crash during application replay.

  • +
  • Fixed an issue that could lead to a crash in the python report interface.

  • +
  • Fixed typos in the metrics reference documentation and descriptions.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2022-4.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2022-4.html new file mode 100644 index 0000000000000000000000000000000000000000..f944604982c250e6775d7638bea8a9152f7d6ca6 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2022-4.html @@ -0,0 +1,197 @@ + + + + + + + Updates in 2022.4 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2022.4
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2022.4

+

General

+
    +
  • Added support for the CUDA toolkit 12.0.

  • +
+
    +
  • Added support for profiling CUDA graphs as complete workloads instead of as single kernel nodes. Enable this using the Graph Profiling option in the activities. Similarly to range replay results, selected metrics are not available when profiling graphs.

  • +
+
    +
  • Added support for profiling on Windows Subsystem for Linux (WSL2). See the System Requirements for more details.

  • +
  • Deprecated nv-nsight-cu and nv-nsight-cu-cli aliases are removed in favor of ncu-ui and ncu.

  • +
+

NVIDIA Nsight Compute

+
    +
  • The Source page now loads disassembly and static analysis results asynchronously in the background.

  • +
  • Added a new Metric Details tool window to inspect metric information such as raw value, unit, description or instance values. Open the tool window and select a metric on the Details or Raw page or lookup any metric in the focused report directly in the tool window’s search bar.

  • +
  • In the Source page PTX view, the source name will be shown as a list of comma-separated files.

  • +
  • Added flexibility with NVTX based filtering in the Next Trigger filter, similar to the command line. Filters can now use nvtx-include and nvtx-exclude expressions by adding the nvtx-include: or nvtx-exclude: prefix.

  • +
  • NVTX views now show the payload type.

  • +
  • Simplified the command line generated by the Profile activity.

  • +
  • Reduced the number of steps required to re-run the Profile activity.

  • +
  • The way to rename Baselines in-place has been improved.

  • +
  • The Resources tool window now shows the CUDA Dynamic Parallelism state for CUDA functions and modules.

  • +
  • OptiX traversable handles can now be exported as Graphviz DOT or SVG files for visualization from the Resources tool window.

  • +
  • All OptiX build, instance and geometry flags can be viewed in the Acceleration Structure Viewer.

  • +
  • Added OptiX-specific highlight filters to the Acceleration Structure Viewer.

  • +
  • Added support for user-specified index strides to the Acceleration Structure Viewer.

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Added new option --graph-profiling graph to enable profiling of complete CUDA graphs as single workloads.

  • +
+
    +
  • Added new option --filter-mode per-launch-config to enable filtering of kernel launches for each GPU launch parameter separately.

  • +
  • Added support to print section body item metrics on the details page with the new --print-detailscommand line option.

  • +
  • Added support to select what to show in Metric Name column on the details page with the new --print-metric-namecommand line option.

  • +
  • Removed deprecated options: --units, --fp, --summary and --kernel-base

  • +
  • Added support to print launch, session, process and device attributes on session page with the new --page session option.

  • +
  • Added --kill yes support for application replay mode.

  • +
+

Resolved Issues

+
    +
  • Fixed an issue that NVIDIA Nsight Compute could crash when continuing profiling after transposing the Raw page table.

  • +
  • Fixed an issue that caused closing a report document to be delayed by pending source analysis.

  • +
  • Fixed support for profiling applications with older OptiX versions.

  • +
  • Fixed display of OptiX module inputs for IR and built-in modules.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2023-1-1.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2023-1-1.html new file mode 100644 index 0000000000000000000000000000000000000000..5eb781a86e1399e3d5c41591f2eaca220e835a0a --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2023-1-1.html @@ -0,0 +1,170 @@ + + + + + + + Updates in 2023.1.1 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2023.1.1
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2023.1.1

+

NVIDIA Nsight Compute

+
    +
  • Added new configuration options to set the default view mode and precision for the Source page.

  • +
+

Resolved Issues

+
    +
  • Added support for the DT_RUNPATH attribute when intercepting calls to dlopen. Fixed issue for applications or libraries relying on DT_RUNPATH not finding all dynamic libraries when launched by NVIDIA Nsight Compute.

  • +
  • Improved interaction between custom additional metrics and the selected metric set. Adding custom metrics no longer forces switching to the custom metric set.

  • +
  • Added ability to gracefully skip folders with insufficient access permissions while importing source code.

  • +
  • Fixed the calculation of the peak values for the L1 and L2 cache bandwidths in the hierarchical roofline charts.

  • +
  • Fixed issue that prevented modules loaded with function optixModuleCreateFromPTX showing up in the Optix: Modules table of the Resources tool window.

  • +
  • Fixed handling of deprecated functions when querying function pointers from the OptiX interception library.

  • +
  • Fixed that sometimes sections or rules couldn’t be easily selected in the tool window.

  • +
  • Fixed issue with Reset Application Data that prevented some setting from correctly resetting.

  • +
  • Fixed potential crash of NVIDIA Nsight Compute when Reset Application Data was executed multiple times in a row.

  • +
  • Fixed a crash when saving or loading baselines for non-kernel results.

  • +
  • Fixed that memory written while executing a CUDA graph was not properly restored in single-pass graph profiling.

  • +
  • Fixed potential memory leak while collecting SW counters for modules with unpatched kernel functions.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2023-1.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2023-1.html new file mode 100644 index 0000000000000000000000000000000000000000..fe09d3e72932bdd69089f9eee3e619e515732105 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2023-1.html @@ -0,0 +1,184 @@ + + + + + + + Updates in 2023.1 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2023.1
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2023.1

+

General

+
    +
  • Added support for the CUDA toolkit 12.1.

  • +
  • Added a new app-range replay mode to profile ranges without API capture by relaunching the entire application multiple times.

  • +
  • Added sharedBankConflicts sample CUDA application and document to show how NVIDIA Nsight Compute can be used to analyze and identify the shared memory bank conflicts which result in inefficient shared memory accesses. Refer to the README.TXT file, sample code and document under extras/samples/sharedBankConflicts.

  • +
  • Jupyter notebook samples are available in the Nsight training github repository.

  • +
  • The equivalent of the high-level Python report interface is now available in rule files.

  • +
+

NVIDIA Nsight Compute

+
    +
  • Added support for profiling individual metrics in Interactive Profile activity. A new input field for metrics was added in the Metric Selection tool window.

  • +
  • Files on remote systems can be opened directly from the menu.

  • +
  • Metric- and section-related entries in the menu, Profile activity and Metric Selection tool window were renamed to make them more clear.

  • +
  • CPU and GPU NUMA topology metrics can be collected on applicable systems. Topology information is shown in a new NUMA Affinity section.

  • +
  • Added content-aware suggestions to the Details page to provide suggestions based on the selected profiling options.

  • +
  • Added support for re-resolving source files on the Source page.

  • +
  • Not-issued warp stall reasons are removed from the Source Counters section tables and hidden by default on the Source page. Users should focus on regular warp stall reasons by default and only inspect not-issued samples if this distinction is needed.

  • +
  • Added support to search missing CUDA source files to permanently import into the report using Source Lookup options in the Interactive Profile activity.

  • +
  • The source page now shows metric values as percentages by default. New buttons are added to support switching between different value modes.

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Added support for config files in the current working or user directory to set default ncu parameters. See the General options for more details.

  • +
  • Added --range-filtercommand line option which allows to select subset of enabled profile ranges.

  • +
  • Added new --source-folderscommand line option that allows to recursively search for missing CUDA source files to permanently import into the report.

  • +
+

Resolved Issues

+
    +
  • Fixed performance issues on the Summary and Raw pages for large reports.

  • +
  • Improved support for non-ASCII characters in filenames.

  • +
  • Fixed an issue with delayed updates of assembly analysis information on the Source page’s Source and PTX views.

  • +
  • Fixed potential crashes when using the Python report interface.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2023-2-1.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2023-2-1.html new file mode 100644 index 0000000000000000000000000000000000000000..cedc97aa5d9eb6b6d7eca185a5a334c733a68dab --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2023-2-1.html @@ -0,0 +1,156 @@ + + + + + + + Updates in 2023.2.1 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2023.2.1
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2023.2.1

+

Resolved Issues

+
    +
  • Fixed a crash during application replay while having the temporary directory located on a network file system (NFS).

  • +
  • Improved detection mechanism for C2C interface. Added caching of the detected configuration to reduce overhead.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2023-2-2.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2023-2-2.html new file mode 100644 index 0000000000000000000000000000000000000000..8cb504ddaab6bd6575e55bb5a5d2854df704b9cf --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2023-2-2.html @@ -0,0 +1,156 @@ + + + + + + + Updates in 2023.2.2 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2023.2.2
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2023.2.2

+

Resolved Issues

+
    +
  • Fixed possible crash when profiling CUDA graphs on multiple GPUs.

  • +
  • Fixed the detection mechanism of the C2C interface, i.e. metric c2clink__present. The fix requires the display driver shipping with this release or any newer driver.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2023-2.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2023-2.html new file mode 100644 index 0000000000000000000000000000000000000000..40336fefec33b4354013834de67c2bc23d938249 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2023-2.html @@ -0,0 +1,181 @@ + + + + + + + Updates in 2023.2 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2023.2
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2023.2

+

General

+
    +
  • Extended the rules system to show estimates of the potential speedup that can be achieved by addressing the corresponding performance bottleneck. These speedups allow prioritizing applicable rules and help focusing first on optimization strategies with the highest potential performance gain.

  • +
  • Added support for rules to highlight individual source lines. Lines with global/local memory access with high excessive sector counts and shared accesses with many bank conflicts are automatically detected and highlighted.

  • +
  • Added the ability to query metric attributes in NvRules API.

  • +
  • Added support for creating instanced metrics through the NvRules API.

  • +
  • For Orin+ mobile chips on the Linux aarch64 platform, added metrics (mcc__*) support for memory controller channel (MC Channel) unit which connects to the DRAM.

  • +
+

NVIDIA Nsight Compute

+
    +
  • Added hyperlinks to the SASS View of the Source Page for instructions that reference others by address or offset. This enables to quickly jump to the target instruction of a branch.

  • +
  • Improved the search bar in the Metric Details tool window. The search string now matches any part of the metric names, and the matching results are shown in a sorted order.

  • +
  • Added a visual indication of scale of the metric value changes when the baselines are used. The background bars in the table cells of the Details Page allow to quickly identify which metrics values increased or decreased the most. The color scheme can be configured in the Baselines tool window.

  • +
  • Added support for rules toggle button on the Summary Page. Allows to hide the bottom pane with the rules output for the selected kernel launch.

  • +
  • Added support for allowing users to configure properties on Summary Page using Metrics/Properties profile option.

  • +
  • Added percentage bars on Summary Page.

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Added support for tracking child processes launched with posix_spawn(p) when using --target-processes all.

  • +
  • Added support for tracking child processes launched with system() on Windows and Linux (aarch64, x86_64) when using --target-processes all.

  • +
+

Resolved Issues

+
    +
  • Fixed table alignment in the output of the NVIDIA Nsight Compute CLI on Windows when printing Unicode characters.

  • +
  • Fixed view corruption in the Source Page after switching from the collapsed view to the expanded view.

  • +
  • Fixed missing tooltip descriptions for some SASS instructions.

  • +
  • Fixed potential crash when copying from the Resources tool window using CTRL+C.

  • +
  • Fixed possible crash when restoring sections in the Sections tool window.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2023-3-1.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2023-3-1.html new file mode 100644 index 0000000000000000000000000000000000000000..0de5ae396a6396e03fa07463b4712372552130d0 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2023-3-1.html @@ -0,0 +1,166 @@ + + + + + + + Updates in 2023.3.1 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2023.3.1
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2023.3.1

+

General

+
    +
  • Switched to using OpenSSL version 1.1.1w.

  • +
  • Improved the speedup estimates for rule IssueSlotUtilization as well as its child rules.

  • +
  • Updated report files and documentation for the samples located at extras/samples/.

  • +
+

Resolved Issues

+
    +
  • Fixed collection of context switch data during PM Sampling when using Range Replay.

  • +
  • Fixed potential crash of NVIDIA Nsight Compute when an invalid regular expression was provided as requested metric.

  • +
  • Improved the performance of NVIDIA Nsight Compute in cases where only a single process is being profiled and --target-processes all was specified.

  • +
  • Fixed an issue of reporting too high register counts on the Source Page.

  • +
  • Fixed a bug that could cause a GPU fault while collecting SW counters through PerfWorks.

  • +
  • Fixed showing incorrect baseline values for the Runtime Improvement values on the Summary Page.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2023-3.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2023-3.html new file mode 100644 index 0000000000000000000000000000000000000000..89396fcb9b21e7bf00f10cb4869dd5b28499afee --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2023-3.html @@ -0,0 +1,182 @@ + + + + + + + Updates in 2023.3 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2023.3
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2023.3

+

General

+
    +
  • NVIDIA Nsight Compute now supports collecting many metrics by sampling the GPU’s performance monitors (PM) periodically at fixed intervals. The results can be visualized on a timeline.

  • +
  • Added WSL profiling support on Windows 10 WSL with OS build version 19044 and greater. WSL profiling is not supported on Windows 10 WSL for systems that exceed 1 TB of system memory.

  • +
  • Rule outputs are prioritized to improve the accuracy of estimated speedups. The Summary page now shows the most actionable optimization advices when a result row is selected.

  • +
  • Improved the handling and reporting for unavailable metrics during collection and when applying rules.

  • +
  • Added instructionMix sample CUDA application and document to show how to use NVIDIA Nsight Compute to analyze and identify the performance bottleneck due to an imbalanced instruction mix. Refer to the README.TXT file, sample code, and document under extras/samples/instructionMix.

  • +
+

NVIDIA Nsight Compute

+
    +
  • Added support to see the source files of two profile results side by side using Source Comparison. This allows you to quickly identify source differences and understand changes in metric values.

  • +
  • The Summary page is now the default page when a report is opened. Previous behavior can be enabled in the options dialog.

  • +
  • On the Summary and Raw pages, values from all/selected rows are automatically aggregated in the column header for applicable metrics. Selected individual cells are aggregated in the bottom status bar.

  • +
  • Added Launch Name and Device options in the filter dialog launched by Apply Filters button in the report header.

  • +
  • Added support for source view profiles that persist the Source page configuration and allow you to re-apply it to other reports.

  • +
  • The Metric Details tool window now supports querying metrics beyond the current report by using the chip:<chipname> tag in the search.

  • +
  • Added support for CUDA Graph Edge Data (such as port and dependency type) and CUDA Graph Conditional Handles in the Resources tool window.

  • +
  • The Acceleration Structure Viewer and Resources tool window now support OptiX Opacity Micromaps.

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Tracking and profiling all child processes (--target-processes all) is now the default for ncu.

  • +
  • Improved reporting of requested but unavailable metrics. Metrics requested in section files are by default considered optional and only cause a warning to be shown.

  • +
+

Resolved Issues

+
    +
  • Support for tracking child processes launched with system() is available on Linux ppc64le.

  • +
  • Improved the behavior of following SASS navigation links on the Source page.

  • +
  • Fixed issues with profiling CUDA graphs in graph-profiling mode when nodes are associated with a non-current CUDA context.

  • +
  • Fixed an issue in L2 bandwidth calculations in the hierarchical roofline sections.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2024-1-1.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2024-1-1.html new file mode 100644 index 0000000000000000000000000000000000000000..c30202313cfa098d1ab035aa6627b07383ce7a79 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2024-1-1.html @@ -0,0 +1,162 @@ + + + + + + + Updates in 2024.1.1 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2024.1.1
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2024.1.1

+

General

+
    +
  • Added clarification that for profiling a range with multiple, active CUDA Green Contexts, counter values that are not attributable to SMs will be aggregated over all these Green Contexts.

  • +
+

Resolved Issues

+
    +
  • Changed the way the PerfWorks library is loaded into the target application’s process space. This addresses possible connection errors in case the library search path includes other directories with PerfWorks libraries.

  • +
  • Fixed an issue that caused PM sampling data to be missing from the results of a Profile Series.

  • +
  • Fixed the incorrect calculation of the percentage values in the Inline Function table.

  • +
  • Fixed a potential crash of the NVIDIA Nsight Compute UI when PM sampling data was requested, but no sample was collected.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2024-1.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2024-1.html new file mode 100644 index 0000000000000000000000000000000000000000..04a0b13ede988219794c95c82b144579754e6f0b --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/ReleaseNotes/topics/updates-2024-1.html @@ -0,0 +1,189 @@ + + + + + + + Updates in 2024.1 — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Updates in 2024.1
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Updates in 2024.1

+

General

+
    +
  • Switched to using OpenSSL version 3.0.10.

  • +
  • Added new metrics available when profiling on CUDA Green Contexts.

  • +
  • Reduced the number of passes required for collecting PM sampling sections.

  • +
  • Counter domains can now be specified for PM sampling metrics in section files.

  • +
  • PM sampling metrics can now be queried in the command line and Metric Details window by specifying the respective collection option.

  • +
  • Added a new optional PmSampling_WarpStates section for understanding warp stall reasons over the workload duration.

  • +
  • Added a new rule for detecting load imbalances.

  • +
  • Improved the performance of graph-level profiling on new drivers.

  • +
  • Updated the metrics compatibility table for OptiX cmdlists and instruction-level SASS metrics.

  • +
+

NVIDIA Nsight Compute

+
    +
  • Added SASS view and Source Markers support in Source Comparison.

  • +
  • Improved Source Comparison diff visualization by adding empty lines on other side of inserted/deleted lines.

  • +
  • The Source page column chooser can now be opened directly from the Navigation drop down.

  • +
  • Added a Launch Details tool window for showing information about individual launches within larger workloads like OptiX command lists.

  • +
  • Added support for CUDA Green Contexts in the Resources tool window, the Launch Statistics section and the report header.

  • +
+

NVIDIA Nsight Compute CLI

+
    +
  • Improved documentation on NVTX expressions and command line output when a potentially incorrect expression led to no workloads being profiled.

  • +
  • Improved checking for invalid expressions when using the --target-processes-filer option.

  • +
+

Resolved Issues

+
    +
  • Fixed that the L1 cache achieved roofline value was missing when profiling on GH100.

  • +
  • Fixed several “Launch Failed” errors when collecting instruction-level SASS metrics.

  • +
  • Fixed that Live Register values would be too high for some workloads.

  • +
  • Fixed a scrolling issue on the Source page when collapsing a multi-file view.

  • +
  • Fixed an issue that no PM sampling data would be shown in the timeline when context switch trace was not available.

  • +
  • Fixed a display issue in the memory chart when adding baselines.

  • +
  • Fixed a crash when adding baselines.

  • +
  • Fixed a crash in timeline views when not all configured data was available.

  • +
  • Fixed that the application history was not always deleted when selecting Reset Application Data.

  • +
  • Fixed an error in the metric compatibility documentation.

  • +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/Training/index.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/Training/index.html new file mode 100644 index 0000000000000000000000000000000000000000..1eb571e25877ab6324bf7e6a4455ce0ac7f7ee5b --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/Training/index.html @@ -0,0 +1,288 @@ + + + + + + + + + Training — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Training
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Training

+

Nsight Compute training content.

+

NVIDIA Nsight Compute Training resources.

+
+

External Resources

+

Forum

+ +

Blogs

+ +

Videos

+ +

Code Examples

+
    +
  • Have a look at our coding examples on GitHub

  • +
+
+
+

Usage Examples

+
+

Filter Options

+

Note that examples will use the term workload to refer to either kernels, graphs, ranges or cmdlists unless stated otherwise.

+
    +
  1. Profile first two workloads

    +

    --launch-count 2

    +
  2. +
  3. Profile first two workloads launched on device with device ID 1

    +
    +../_images/filter-example-2.png +
    +

    --device 1 --launch-count 2

    +
  4. +
  5. Profile 2nd workload on each gpu

    +
    +../_images/filter-example-3.png +
    +

    --launch-skip 1 --launch-count 1 --filter-mode per-gpu

    +
  6. +
  7. Skip first 2 workloads of each launch configuration before profiling

    +

    --launch-skip 2 --filter-mode per-launch-config

    +
  8. +
  9. Profile “Bar” kernel

    +
    +../_images/filter-example-5.png +
    +

    --kernel-name Bar

    +
  10. +
  11. Profile kernels which have “Bar” in function name

    +
    +../_images/filter-example-6.png +
    +

    --kernel-name regex:Bar

    +
  12. +
  13. Profile only 2nd invocation of kernel “Foo”

    +
    +../_images/filter-example-7.png +
    +

    --kernel-id ::Foo:2

    +
  14. +
  15. Profile only 2nd invocation of all kernels which have “Bar” in name

    +
    +../_images/filter-example-8.png +
    +

    --kernel-id ::regex:Bar:2

    +
  16. +
  17. Skip first 2 workloads before matching “Foo” or “Bar” in kernel names

    +
    +../_images/filter-example-9.png +
    +

    --launch-skip-before-match 2 --kernel-name regex:“Foo|Bar”

    +
  18. +
  19. Profile all 7th kernel invocations with mangled name “_FooBar” on CUDA context ID 1 and stream ID 2

    +

    --kernel-id 1:2:_Foobar:7 --kernel-name-base mangled

    +
  20. +
  21. Profile all workloads launched in first 3 cu(da)ProfilerStart/Stop APIs created ranges

    +
    +../_images/filter-example-11.png +
    +

    --range-filter :[1-3]:

    +
  22. +
  23. Profile all workloads launched in 2nd NVTX Push/Pop range A

    +
    +../_images/filter-example-12.png +
    +

    --range-filters ::2 --nvtx --nvtx-include A/

    +
  24. +
  25. Profile all workloads launched in NVTX Push/Pop range A except the ones in NVTX Push/Pop range B

    +
    +../_images/filter-example-13.png +
    +

    --nvtx --nvtx-include A/ --nvtx-exclude B/

    +
  26. +
  27. Profile all “Foo” kernels except those launched in NVTX Push/Pop range B

    +
    +../_images/filter-example-14.png +
    +

    --nvtx --nvtx-exclude B/ --kernel-name Foo

    +
  28. +
  29. Profile all workloads launched in 2nd NVTX Start/End range A inside 2nd cu(da)ProfilerStart/Stop APIs created range

    +
    +../_images/filter-example-15.png +
    +

    --range-filter yes:2:2 --nvtx --nvtx-include A

    +
  30. +
  31. Profile all workloads launched in 1st NVTX Push/Pop range A inside both 1st and 2nd cu(da)ProfilerStart/Stop APIs created range

    +
    +../_images/filter-example-16.png +
    +

    --range-filter yes:[1-2]:1 --nvtx --nvtx-include A/

    +
  32. +
  33. Profile all workloads launched in 1st cu(da)ProfilerStart/Stop APIs created range with 2nd NVTX push/pop range A and domain D

    +

    --range-filter no:1:2 --nvtx --nvtx-include D@A/

    +
  34. +
+

Notices

+

Notices

+

ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, “MATERIALS”) ARE BEING PROVIDED “AS IS.” NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.

+

Information furnished is believed to be accurate and reliable. However, NVIDIA Corporation assumes no responsibility for the consequences of use of such information or for any infringement of patents or other rights of third parties that may result from its use. No license is granted by implication of otherwise under any patent rights of NVIDIA Corporation. Specifications mentioned in this publication are subject to change without notice. This publication supersedes and replaces all other information previously supplied. NVIDIA Corporation products are not authorized as critical components in life support devices or systems without express written approval of NVIDIA Corporation.

+

Trademarks

+

NVIDIA and the NVIDIA logo are trademarks or registered trademarks of NVIDIA Corporation in the U.S. and other countries. Other company and product names may be trademarks of the respective companies with which they are associated.

+
+
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/VERSION b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/VERSION new file mode 100644 index 0000000000000000000000000000000000000000..800fd35ee866e69274f7e1ea55442b16b8e740ae --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/VERSION @@ -0,0 +1 @@ +12.4 diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_sphinx_design_static/design-style.b7bb847fb20b106c3d81b95245e65545.min.css b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_sphinx_design_static/design-style.b7bb847fb20b106c3d81b95245e65545.min.css new file mode 100644 index 0000000000000000000000000000000000000000..704c42eeb8bfdecfdd0467e4c1f43a1c1a907e73 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_sphinx_design_static/design-style.b7bb847fb20b106c3d81b95245e65545.min.css @@ -0,0 +1 @@ +.sd-bg-primary{background-color:var(--sd-color-primary) !important}.sd-bg-text-primary{color:var(--sd-color-primary-text) !important}button.sd-bg-primary:focus,button.sd-bg-primary:hover{background-color:var(--sd-color-primary-highlight) !important}a.sd-bg-primary:focus,a.sd-bg-primary:hover{background-color:var(--sd-color-primary-highlight) !important}.sd-bg-secondary{background-color:var(--sd-color-secondary) !important}.sd-bg-text-secondary{color:var(--sd-color-secondary-text) !important}button.sd-bg-secondary:focus,button.sd-bg-secondary:hover{background-color:var(--sd-color-secondary-highlight) !important}a.sd-bg-secondary:focus,a.sd-bg-secondary:hover{background-color:var(--sd-color-secondary-highlight) !important}.sd-bg-success{background-color:var(--sd-color-success) !important}.sd-bg-text-success{color:var(--sd-color-success-text) !important}button.sd-bg-success:focus,button.sd-bg-success:hover{background-color:var(--sd-color-success-highlight) !important}a.sd-bg-success:focus,a.sd-bg-success:hover{background-color:var(--sd-color-success-highlight) !important}.sd-bg-info{background-color:var(--sd-color-info) !important}.sd-bg-text-info{color:var(--sd-color-info-text) !important}button.sd-bg-info:focus,button.sd-bg-info:hover{background-color:var(--sd-color-info-highlight) !important}a.sd-bg-info:focus,a.sd-bg-info:hover{background-color:var(--sd-color-info-highlight) !important}.sd-bg-warning{background-color:var(--sd-color-warning) !important}.sd-bg-text-warning{color:var(--sd-color-warning-text) !important}button.sd-bg-warning:focus,button.sd-bg-warning:hover{background-color:var(--sd-color-warning-highlight) !important}a.sd-bg-warning:focus,a.sd-bg-warning:hover{background-color:var(--sd-color-warning-highlight) !important}.sd-bg-danger{background-color:var(--sd-color-danger) !important}.sd-bg-text-danger{color:var(--sd-color-danger-text) !important}button.sd-bg-danger:focus,button.sd-bg-danger:hover{background-color:var(--sd-color-danger-highlight) !important}a.sd-bg-danger:focus,a.sd-bg-danger:hover{background-color:var(--sd-color-danger-highlight) !important}.sd-bg-light{background-color:var(--sd-color-light) !important}.sd-bg-text-light{color:var(--sd-color-light-text) !important}button.sd-bg-light:focus,button.sd-bg-light:hover{background-color:var(--sd-color-light-highlight) !important}a.sd-bg-light:focus,a.sd-bg-light:hover{background-color:var(--sd-color-light-highlight) !important}.sd-bg-muted{background-color:var(--sd-color-muted) !important}.sd-bg-text-muted{color:var(--sd-color-muted-text) !important}button.sd-bg-muted:focus,button.sd-bg-muted:hover{background-color:var(--sd-color-muted-highlight) !important}a.sd-bg-muted:focus,a.sd-bg-muted:hover{background-color:var(--sd-color-muted-highlight) !important}.sd-bg-dark{background-color:var(--sd-color-dark) !important}.sd-bg-text-dark{color:var(--sd-color-dark-text) !important}button.sd-bg-dark:focus,button.sd-bg-dark:hover{background-color:var(--sd-color-dark-highlight) !important}a.sd-bg-dark:focus,a.sd-bg-dark:hover{background-color:var(--sd-color-dark-highlight) !important}.sd-bg-black{background-color:var(--sd-color-black) !important}.sd-bg-text-black{color:var(--sd-color-black-text) !important}button.sd-bg-black:focus,button.sd-bg-black:hover{background-color:var(--sd-color-black-highlight) !important}a.sd-bg-black:focus,a.sd-bg-black:hover{background-color:var(--sd-color-black-highlight) !important}.sd-bg-white{background-color:var(--sd-color-white) !important}.sd-bg-text-white{color:var(--sd-color-white-text) !important}button.sd-bg-white:focus,button.sd-bg-white:hover{background-color:var(--sd-color-white-highlight) !important}a.sd-bg-white:focus,a.sd-bg-white:hover{background-color:var(--sd-color-white-highlight) !important}.sd-text-primary,.sd-text-primary>p{color:var(--sd-color-primary) !important}a.sd-text-primary:focus,a.sd-text-primary:hover{color:var(--sd-color-primary-highlight) !important}.sd-text-secondary,.sd-text-secondary>p{color:var(--sd-color-secondary) !important}a.sd-text-secondary:focus,a.sd-text-secondary:hover{color:var(--sd-color-secondary-highlight) !important}.sd-text-success,.sd-text-success>p{color:var(--sd-color-success) !important}a.sd-text-success:focus,a.sd-text-success:hover{color:var(--sd-color-success-highlight) !important}.sd-text-info,.sd-text-info>p{color:var(--sd-color-info) !important}a.sd-text-info:focus,a.sd-text-info:hover{color:var(--sd-color-info-highlight) !important}.sd-text-warning,.sd-text-warning>p{color:var(--sd-color-warning) !important}a.sd-text-warning:focus,a.sd-text-warning:hover{color:var(--sd-color-warning-highlight) !important}.sd-text-danger,.sd-text-danger>p{color:var(--sd-color-danger) !important}a.sd-text-danger:focus,a.sd-text-danger:hover{color:var(--sd-color-danger-highlight) !important}.sd-text-light,.sd-text-light>p{color:var(--sd-color-light) !important}a.sd-text-light:focus,a.sd-text-light:hover{color:var(--sd-color-light-highlight) !important}.sd-text-muted,.sd-text-muted>p{color:var(--sd-color-muted) !important}a.sd-text-muted:focus,a.sd-text-muted:hover{color:var(--sd-color-muted-highlight) !important}.sd-text-dark,.sd-text-dark>p{color:var(--sd-color-dark) !important}a.sd-text-dark:focus,a.sd-text-dark:hover{color:var(--sd-color-dark-highlight) !important}.sd-text-black,.sd-text-black>p{color:var(--sd-color-black) !important}a.sd-text-black:focus,a.sd-text-black:hover{color:var(--sd-color-black-highlight) !important}.sd-text-white,.sd-text-white>p{color:var(--sd-color-white) !important}a.sd-text-white:focus,a.sd-text-white:hover{color:var(--sd-color-white-highlight) !important}.sd-outline-primary{border-color:var(--sd-color-primary) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-primary:focus,a.sd-outline-primary:hover{border-color:var(--sd-color-primary-highlight) !important}.sd-outline-secondary{border-color:var(--sd-color-secondary) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-secondary:focus,a.sd-outline-secondary:hover{border-color:var(--sd-color-secondary-highlight) !important}.sd-outline-success{border-color:var(--sd-color-success) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-success:focus,a.sd-outline-success:hover{border-color:var(--sd-color-success-highlight) !important}.sd-outline-info{border-color:var(--sd-color-info) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-info:focus,a.sd-outline-info:hover{border-color:var(--sd-color-info-highlight) !important}.sd-outline-warning{border-color:var(--sd-color-warning) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-warning:focus,a.sd-outline-warning:hover{border-color:var(--sd-color-warning-highlight) !important}.sd-outline-danger{border-color:var(--sd-color-danger) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-danger:focus,a.sd-outline-danger:hover{border-color:var(--sd-color-danger-highlight) !important}.sd-outline-light{border-color:var(--sd-color-light) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-light:focus,a.sd-outline-light:hover{border-color:var(--sd-color-light-highlight) !important}.sd-outline-muted{border-color:var(--sd-color-muted) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-muted:focus,a.sd-outline-muted:hover{border-color:var(--sd-color-muted-highlight) !important}.sd-outline-dark{border-color:var(--sd-color-dark) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-dark:focus,a.sd-outline-dark:hover{border-color:var(--sd-color-dark-highlight) !important}.sd-outline-black{border-color:var(--sd-color-black) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-black:focus,a.sd-outline-black:hover{border-color:var(--sd-color-black-highlight) !important}.sd-outline-white{border-color:var(--sd-color-white) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-white:focus,a.sd-outline-white:hover{border-color:var(--sd-color-white-highlight) !important}.sd-bg-transparent{background-color:transparent !important}.sd-outline-transparent{border-color:transparent !important}.sd-text-transparent{color:transparent !important}.sd-p-0{padding:0 !important}.sd-pt-0,.sd-py-0{padding-top:0 !important}.sd-pr-0,.sd-px-0{padding-right:0 !important}.sd-pb-0,.sd-py-0{padding-bottom:0 !important}.sd-pl-0,.sd-px-0{padding-left:0 !important}.sd-p-1{padding:.25rem !important}.sd-pt-1,.sd-py-1{padding-top:.25rem !important}.sd-pr-1,.sd-px-1{padding-right:.25rem !important}.sd-pb-1,.sd-py-1{padding-bottom:.25rem !important}.sd-pl-1,.sd-px-1{padding-left:.25rem !important}.sd-p-2{padding:.5rem !important}.sd-pt-2,.sd-py-2{padding-top:.5rem !important}.sd-pr-2,.sd-px-2{padding-right:.5rem !important}.sd-pb-2,.sd-py-2{padding-bottom:.5rem !important}.sd-pl-2,.sd-px-2{padding-left:.5rem !important}.sd-p-3{padding:1rem !important}.sd-pt-3,.sd-py-3{padding-top:1rem !important}.sd-pr-3,.sd-px-3{padding-right:1rem !important}.sd-pb-3,.sd-py-3{padding-bottom:1rem !important}.sd-pl-3,.sd-px-3{padding-left:1rem !important}.sd-p-4{padding:1.5rem !important}.sd-pt-4,.sd-py-4{padding-top:1.5rem !important}.sd-pr-4,.sd-px-4{padding-right:1.5rem !important}.sd-pb-4,.sd-py-4{padding-bottom:1.5rem !important}.sd-pl-4,.sd-px-4{padding-left:1.5rem !important}.sd-p-5{padding:3rem !important}.sd-pt-5,.sd-py-5{padding-top:3rem !important}.sd-pr-5,.sd-px-5{padding-right:3rem !important}.sd-pb-5,.sd-py-5{padding-bottom:3rem !important}.sd-pl-5,.sd-px-5{padding-left:3rem !important}.sd-m-auto{margin:auto !important}.sd-mt-auto,.sd-my-auto{margin-top:auto !important}.sd-mr-auto,.sd-mx-auto{margin-right:auto !important}.sd-mb-auto,.sd-my-auto{margin-bottom:auto !important}.sd-ml-auto,.sd-mx-auto{margin-left:auto !important}.sd-m-0{margin:0 !important}.sd-mt-0,.sd-my-0{margin-top:0 !important}.sd-mr-0,.sd-mx-0{margin-right:0 !important}.sd-mb-0,.sd-my-0{margin-bottom:0 !important}.sd-ml-0,.sd-mx-0{margin-left:0 !important}.sd-m-1{margin:.25rem !important}.sd-mt-1,.sd-my-1{margin-top:.25rem !important}.sd-mr-1,.sd-mx-1{margin-right:.25rem !important}.sd-mb-1,.sd-my-1{margin-bottom:.25rem !important}.sd-ml-1,.sd-mx-1{margin-left:.25rem !important}.sd-m-2{margin:.5rem !important}.sd-mt-2,.sd-my-2{margin-top:.5rem !important}.sd-mr-2,.sd-mx-2{margin-right:.5rem !important}.sd-mb-2,.sd-my-2{margin-bottom:.5rem !important}.sd-ml-2,.sd-mx-2{margin-left:.5rem !important}.sd-m-3{margin:1rem !important}.sd-mt-3,.sd-my-3{margin-top:1rem !important}.sd-mr-3,.sd-mx-3{margin-right:1rem !important}.sd-mb-3,.sd-my-3{margin-bottom:1rem !important}.sd-ml-3,.sd-mx-3{margin-left:1rem !important}.sd-m-4{margin:1.5rem !important}.sd-mt-4,.sd-my-4{margin-top:1.5rem !important}.sd-mr-4,.sd-mx-4{margin-right:1.5rem !important}.sd-mb-4,.sd-my-4{margin-bottom:1.5rem !important}.sd-ml-4,.sd-mx-4{margin-left:1.5rem !important}.sd-m-5{margin:3rem !important}.sd-mt-5,.sd-my-5{margin-top:3rem !important}.sd-mr-5,.sd-mx-5{margin-right:3rem !important}.sd-mb-5,.sd-my-5{margin-bottom:3rem !important}.sd-ml-5,.sd-mx-5{margin-left:3rem !important}.sd-w-25{width:25% !important}.sd-w-50{width:50% !important}.sd-w-75{width:75% !important}.sd-w-100{width:100% !important}.sd-w-auto{width:auto !important}.sd-h-25{height:25% !important}.sd-h-50{height:50% !important}.sd-h-75{height:75% !important}.sd-h-100{height:100% !important}.sd-h-auto{height:auto !important}.sd-d-none{display:none !important}.sd-d-inline{display:inline !important}.sd-d-inline-block{display:inline-block !important}.sd-d-block{display:block !important}.sd-d-grid{display:grid !important}.sd-d-flex-row{display:-ms-flexbox !important;display:flex !important;flex-direction:row !important}.sd-d-flex-column{display:-ms-flexbox !important;display:flex !important;flex-direction:column !important}.sd-d-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}@media(min-width: 576px){.sd-d-sm-none{display:none !important}.sd-d-sm-inline{display:inline !important}.sd-d-sm-inline-block{display:inline-block !important}.sd-d-sm-block{display:block !important}.sd-d-sm-grid{display:grid !important}.sd-d-sm-flex{display:-ms-flexbox !important;display:flex !important}.sd-d-sm-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}}@media(min-width: 768px){.sd-d-md-none{display:none !important}.sd-d-md-inline{display:inline !important}.sd-d-md-inline-block{display:inline-block !important}.sd-d-md-block{display:block !important}.sd-d-md-grid{display:grid !important}.sd-d-md-flex{display:-ms-flexbox !important;display:flex !important}.sd-d-md-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}}@media(min-width: 992px){.sd-d-lg-none{display:none !important}.sd-d-lg-inline{display:inline !important}.sd-d-lg-inline-block{display:inline-block !important}.sd-d-lg-block{display:block !important}.sd-d-lg-grid{display:grid !important}.sd-d-lg-flex{display:-ms-flexbox !important;display:flex !important}.sd-d-lg-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}}@media(min-width: 1200px){.sd-d-xl-none{display:none !important}.sd-d-xl-inline{display:inline !important}.sd-d-xl-inline-block{display:inline-block !important}.sd-d-xl-block{display:block !important}.sd-d-xl-grid{display:grid !important}.sd-d-xl-flex{display:-ms-flexbox !important;display:flex !important}.sd-d-xl-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}}.sd-align-major-start{justify-content:flex-start !important}.sd-align-major-end{justify-content:flex-end !important}.sd-align-major-center{justify-content:center !important}.sd-align-major-justify{justify-content:space-between !important}.sd-align-major-spaced{justify-content:space-evenly !important}.sd-align-minor-start{align-items:flex-start !important}.sd-align-minor-end{align-items:flex-end !important}.sd-align-minor-center{align-items:center !important}.sd-align-minor-stretch{align-items:stretch !important}.sd-text-justify{text-align:justify !important}.sd-text-left{text-align:left !important}.sd-text-right{text-align:right !important}.sd-text-center{text-align:center !important}.sd-font-weight-light{font-weight:300 !important}.sd-font-weight-lighter{font-weight:lighter !important}.sd-font-weight-normal{font-weight:400 !important}.sd-font-weight-bold{font-weight:700 !important}.sd-font-weight-bolder{font-weight:bolder !important}.sd-font-italic{font-style:italic !important}.sd-text-decoration-none{text-decoration:none !important}.sd-text-lowercase{text-transform:lowercase !important}.sd-text-uppercase{text-transform:uppercase !important}.sd-text-capitalize{text-transform:capitalize !important}.sd-text-wrap{white-space:normal !important}.sd-text-nowrap{white-space:nowrap !important}.sd-text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sd-fs-1,.sd-fs-1>p{font-size:calc(1.375rem + 1.5vw) !important;line-height:unset !important}.sd-fs-2,.sd-fs-2>p{font-size:calc(1.325rem + 0.9vw) !important;line-height:unset !important}.sd-fs-3,.sd-fs-3>p{font-size:calc(1.3rem + 0.6vw) !important;line-height:unset !important}.sd-fs-4,.sd-fs-4>p{font-size:calc(1.275rem + 0.3vw) !important;line-height:unset !important}.sd-fs-5,.sd-fs-5>p{font-size:1.25rem !important;line-height:unset !important}.sd-fs-6,.sd-fs-6>p{font-size:1rem !important;line-height:unset !important}.sd-border-0{border:0 solid !important}.sd-border-top-0{border-top:0 solid !important}.sd-border-bottom-0{border-bottom:0 solid !important}.sd-border-right-0{border-right:0 solid !important}.sd-border-left-0{border-left:0 solid !important}.sd-border-1{border:1px solid !important}.sd-border-top-1{border-top:1px solid !important}.sd-border-bottom-1{border-bottom:1px solid !important}.sd-border-right-1{border-right:1px solid !important}.sd-border-left-1{border-left:1px solid !important}.sd-border-2{border:2px solid !important}.sd-border-top-2{border-top:2px solid !important}.sd-border-bottom-2{border-bottom:2px solid !important}.sd-border-right-2{border-right:2px solid !important}.sd-border-left-2{border-left:2px solid !important}.sd-border-3{border:3px solid !important}.sd-border-top-3{border-top:3px solid !important}.sd-border-bottom-3{border-bottom:3px solid !important}.sd-border-right-3{border-right:3px solid !important}.sd-border-left-3{border-left:3px solid !important}.sd-border-4{border:4px solid !important}.sd-border-top-4{border-top:4px solid !important}.sd-border-bottom-4{border-bottom:4px solid !important}.sd-border-right-4{border-right:4px solid !important}.sd-border-left-4{border-left:4px solid !important}.sd-border-5{border:5px solid !important}.sd-border-top-5{border-top:5px solid !important}.sd-border-bottom-5{border-bottom:5px solid !important}.sd-border-right-5{border-right:5px solid !important}.sd-border-left-5{border-left:5px solid !important}.sd-rounded-0{border-radius:0 !important}.sd-rounded-1{border-radius:.2rem !important}.sd-rounded-2{border-radius:.3rem !important}.sd-rounded-3{border-radius:.5rem !important}.sd-rounded-pill{border-radius:50rem !important}.sd-rounded-circle{border-radius:50% !important}.shadow-none{box-shadow:none !important}.sd-shadow-sm{box-shadow:0 .125rem .25rem var(--sd-color-shadow) !important}.sd-shadow-md{box-shadow:0 .5rem 1rem var(--sd-color-shadow) !important}.sd-shadow-lg{box-shadow:0 1rem 3rem var(--sd-color-shadow) !important}@keyframes sd-slide-from-left{0%{transform:translateX(-100%)}100%{transform:translateX(0)}}@keyframes sd-slide-from-right{0%{transform:translateX(200%)}100%{transform:translateX(0)}}@keyframes sd-grow100{0%{transform:scale(0);opacity:.5}100%{transform:scale(1);opacity:1}}@keyframes sd-grow50{0%{transform:scale(0.5);opacity:.5}100%{transform:scale(1);opacity:1}}@keyframes sd-grow50-rot20{0%{transform:scale(0.5) rotateZ(-20deg);opacity:.5}75%{transform:scale(1) rotateZ(5deg);opacity:1}95%{transform:scale(1) rotateZ(-1deg);opacity:1}100%{transform:scale(1) rotateZ(0);opacity:1}}.sd-animate-slide-from-left{animation:1s ease-out 0s 1 normal none running sd-slide-from-left}.sd-animate-slide-from-right{animation:1s ease-out 0s 1 normal none running sd-slide-from-right}.sd-animate-grow100{animation:1s ease-out 0s 1 normal none running sd-grow100}.sd-animate-grow50{animation:1s ease-out 0s 1 normal none running sd-grow50}.sd-animate-grow50-rot20{animation:1s ease-out 0s 1 normal none running sd-grow50-rot20}.sd-badge{display:inline-block;padding:.35em .65em;font-size:.75em;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem}.sd-badge:empty{display:none}a.sd-badge{text-decoration:none}.sd-btn .sd-badge{position:relative;top:-1px}.sd-btn{background-color:transparent;border:1px solid transparent;border-radius:.25rem;cursor:pointer;display:inline-block;font-weight:400;font-size:1rem;line-height:1.5;padding:.375rem .75rem;text-align:center;text-decoration:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;vertical-align:middle;user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none}.sd-btn:hover{text-decoration:none}@media(prefers-reduced-motion: reduce){.sd-btn{transition:none}}.sd-btn-primary,.sd-btn-outline-primary:hover,.sd-btn-outline-primary:focus{color:var(--sd-color-primary-text) !important;background-color:var(--sd-color-primary) !important;border-color:var(--sd-color-primary) !important;border-width:1px !important;border-style:solid !important}.sd-btn-primary:hover,.sd-btn-primary:focus{color:var(--sd-color-primary-text) !important;background-color:var(--sd-color-primary-highlight) !important;border-color:var(--sd-color-primary-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-primary{color:var(--sd-color-primary) !important;border-color:var(--sd-color-primary) !important;border-width:1px !important;border-style:solid !important}.sd-btn-secondary,.sd-btn-outline-secondary:hover,.sd-btn-outline-secondary:focus{color:var(--sd-color-secondary-text) !important;background-color:var(--sd-color-secondary) !important;border-color:var(--sd-color-secondary) !important;border-width:1px !important;border-style:solid !important}.sd-btn-secondary:hover,.sd-btn-secondary:focus{color:var(--sd-color-secondary-text) !important;background-color:var(--sd-color-secondary-highlight) !important;border-color:var(--sd-color-secondary-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-secondary{color:var(--sd-color-secondary) !important;border-color:var(--sd-color-secondary) !important;border-width:1px !important;border-style:solid !important}.sd-btn-success,.sd-btn-outline-success:hover,.sd-btn-outline-success:focus{color:var(--sd-color-success-text) !important;background-color:var(--sd-color-success) !important;border-color:var(--sd-color-success) !important;border-width:1px !important;border-style:solid !important}.sd-btn-success:hover,.sd-btn-success:focus{color:var(--sd-color-success-text) !important;background-color:var(--sd-color-success-highlight) !important;border-color:var(--sd-color-success-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-success{color:var(--sd-color-success) !important;border-color:var(--sd-color-success) !important;border-width:1px !important;border-style:solid !important}.sd-btn-info,.sd-btn-outline-info:hover,.sd-btn-outline-info:focus{color:var(--sd-color-info-text) !important;background-color:var(--sd-color-info) !important;border-color:var(--sd-color-info) !important;border-width:1px !important;border-style:solid !important}.sd-btn-info:hover,.sd-btn-info:focus{color:var(--sd-color-info-text) !important;background-color:var(--sd-color-info-highlight) !important;border-color:var(--sd-color-info-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-info{color:var(--sd-color-info) !important;border-color:var(--sd-color-info) !important;border-width:1px !important;border-style:solid !important}.sd-btn-warning,.sd-btn-outline-warning:hover,.sd-btn-outline-warning:focus{color:var(--sd-color-warning-text) !important;background-color:var(--sd-color-warning) !important;border-color:var(--sd-color-warning) !important;border-width:1px !important;border-style:solid !important}.sd-btn-warning:hover,.sd-btn-warning:focus{color:var(--sd-color-warning-text) !important;background-color:var(--sd-color-warning-highlight) !important;border-color:var(--sd-color-warning-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-warning{color:var(--sd-color-warning) !important;border-color:var(--sd-color-warning) !important;border-width:1px !important;border-style:solid !important}.sd-btn-danger,.sd-btn-outline-danger:hover,.sd-btn-outline-danger:focus{color:var(--sd-color-danger-text) !important;background-color:var(--sd-color-danger) !important;border-color:var(--sd-color-danger) !important;border-width:1px !important;border-style:solid !important}.sd-btn-danger:hover,.sd-btn-danger:focus{color:var(--sd-color-danger-text) !important;background-color:var(--sd-color-danger-highlight) !important;border-color:var(--sd-color-danger-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-danger{color:var(--sd-color-danger) !important;border-color:var(--sd-color-danger) !important;border-width:1px !important;border-style:solid !important}.sd-btn-light,.sd-btn-outline-light:hover,.sd-btn-outline-light:focus{color:var(--sd-color-light-text) !important;background-color:var(--sd-color-light) !important;border-color:var(--sd-color-light) !important;border-width:1px !important;border-style:solid !important}.sd-btn-light:hover,.sd-btn-light:focus{color:var(--sd-color-light-text) !important;background-color:var(--sd-color-light-highlight) !important;border-color:var(--sd-color-light-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-light{color:var(--sd-color-light) !important;border-color:var(--sd-color-light) !important;border-width:1px !important;border-style:solid !important}.sd-btn-muted,.sd-btn-outline-muted:hover,.sd-btn-outline-muted:focus{color:var(--sd-color-muted-text) !important;background-color:var(--sd-color-muted) !important;border-color:var(--sd-color-muted) !important;border-width:1px !important;border-style:solid !important}.sd-btn-muted:hover,.sd-btn-muted:focus{color:var(--sd-color-muted-text) !important;background-color:var(--sd-color-muted-highlight) !important;border-color:var(--sd-color-muted-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-muted{color:var(--sd-color-muted) !important;border-color:var(--sd-color-muted) !important;border-width:1px !important;border-style:solid !important}.sd-btn-dark,.sd-btn-outline-dark:hover,.sd-btn-outline-dark:focus{color:var(--sd-color-dark-text) !important;background-color:var(--sd-color-dark) !important;border-color:var(--sd-color-dark) !important;border-width:1px !important;border-style:solid !important}.sd-btn-dark:hover,.sd-btn-dark:focus{color:var(--sd-color-dark-text) !important;background-color:var(--sd-color-dark-highlight) !important;border-color:var(--sd-color-dark-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-dark{color:var(--sd-color-dark) !important;border-color:var(--sd-color-dark) !important;border-width:1px !important;border-style:solid !important}.sd-btn-black,.sd-btn-outline-black:hover,.sd-btn-outline-black:focus{color:var(--sd-color-black-text) !important;background-color:var(--sd-color-black) !important;border-color:var(--sd-color-black) !important;border-width:1px !important;border-style:solid !important}.sd-btn-black:hover,.sd-btn-black:focus{color:var(--sd-color-black-text) !important;background-color:var(--sd-color-black-highlight) !important;border-color:var(--sd-color-black-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-black{color:var(--sd-color-black) !important;border-color:var(--sd-color-black) !important;border-width:1px !important;border-style:solid !important}.sd-btn-white,.sd-btn-outline-white:hover,.sd-btn-outline-white:focus{color:var(--sd-color-white-text) !important;background-color:var(--sd-color-white) !important;border-color:var(--sd-color-white) !important;border-width:1px !important;border-style:solid !important}.sd-btn-white:hover,.sd-btn-white:focus{color:var(--sd-color-white-text) !important;background-color:var(--sd-color-white-highlight) !important;border-color:var(--sd-color-white-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-white{color:var(--sd-color-white) !important;border-color:var(--sd-color-white) !important;border-width:1px !important;border-style:solid !important}.sd-stretched-link::after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;content:""}.sd-octicon,.sd-material-icon{display:inline-block;fill:currentColor;vertical-align:middle}.sd-avatar-xs{border-radius:50%;object-fit:cover;object-position:center;width:1rem;height:1rem}.sd-avatar-sm{border-radius:50%;object-fit:cover;object-position:center;width:3rem;height:3rem}.sd-avatar-md{border-radius:50%;object-fit:cover;object-position:center;width:5rem;height:5rem}.sd-avatar-lg{border-radius:50%;object-fit:cover;object-position:center;width:7rem;height:7rem}.sd-avatar-xl{border-radius:50%;object-fit:cover;object-position:center;width:10rem;height:10rem}.sd-avatar-inherit{border-radius:50%;object-fit:cover;object-position:center;width:inherit;height:inherit}.sd-avatar-initial{border-radius:50%;object-fit:cover;object-position:center;width:initial;height:initial}.sd-card{background-clip:border-box;background-color:var(--sd-color-card-background);border:1px solid var(--sd-color-card-border);border-radius:.25rem;color:var(--sd-color-card-text);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-width:0;position:relative;word-wrap:break-word}.sd-card>hr{margin-left:0;margin-right:0}.sd-card-hover:hover{border-color:var(--sd-color-card-border-hover);transform:scale(1.01)}.sd-card-body{-ms-flex:1 1 auto;flex:1 1 auto;padding:1rem 1rem}.sd-card-title{margin-bottom:.5rem}.sd-card-subtitle{margin-top:-0.25rem;margin-bottom:0}.sd-card-text:last-child{margin-bottom:0}.sd-card-link:hover{text-decoration:none}.sd-card-link+.card-link{margin-left:1rem}.sd-card-header{padding:.5rem 1rem;margin-bottom:0;background-color:var(--sd-color-card-header);border-bottom:1px solid var(--sd-color-card-border)}.sd-card-header:first-child{border-radius:calc(0.25rem - 1px) calc(0.25rem - 1px) 0 0}.sd-card-footer{padding:.5rem 1rem;background-color:var(--sd-color-card-footer);border-top:1px solid var(--sd-color-card-border)}.sd-card-footer:last-child{border-radius:0 0 calc(0.25rem - 1px) calc(0.25rem - 1px)}.sd-card-header-tabs{margin-right:-0.5rem;margin-bottom:-0.5rem;margin-left:-0.5rem;border-bottom:0}.sd-card-header-pills{margin-right:-0.5rem;margin-left:-0.5rem}.sd-card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1rem;border-radius:calc(0.25rem - 1px)}.sd-card-img,.sd-card-img-bottom,.sd-card-img-top{width:100%}.sd-card-img,.sd-card-img-top{border-top-left-radius:calc(0.25rem - 1px);border-top-right-radius:calc(0.25rem - 1px)}.sd-card-img,.sd-card-img-bottom{border-bottom-left-radius:calc(0.25rem - 1px);border-bottom-right-radius:calc(0.25rem - 1px)}.sd-cards-carousel{width:100%;display:flex;flex-wrap:nowrap;-ms-flex-direction:row;flex-direction:row;overflow-x:hidden;scroll-snap-type:x mandatory}.sd-cards-carousel.sd-show-scrollbar{overflow-x:auto}.sd-cards-carousel:hover,.sd-cards-carousel:focus{overflow-x:auto}.sd-cards-carousel>.sd-card{flex-shrink:0;scroll-snap-align:start}.sd-cards-carousel>.sd-card:not(:last-child){margin-right:3px}.sd-card-cols-1>.sd-card{width:90%}.sd-card-cols-2>.sd-card{width:45%}.sd-card-cols-3>.sd-card{width:30%}.sd-card-cols-4>.sd-card{width:22.5%}.sd-card-cols-5>.sd-card{width:18%}.sd-card-cols-6>.sd-card{width:15%}.sd-card-cols-7>.sd-card{width:12.8571428571%}.sd-card-cols-8>.sd-card{width:11.25%}.sd-card-cols-9>.sd-card{width:10%}.sd-card-cols-10>.sd-card{width:9%}.sd-card-cols-11>.sd-card{width:8.1818181818%}.sd-card-cols-12>.sd-card{width:7.5%}.sd-container,.sd-container-fluid,.sd-container-lg,.sd-container-md,.sd-container-sm,.sd-container-xl{margin-left:auto;margin-right:auto;padding-left:var(--sd-gutter-x, 0.75rem);padding-right:var(--sd-gutter-x, 0.75rem);width:100%}@media(min-width: 576px){.sd-container-sm,.sd-container{max-width:540px}}@media(min-width: 768px){.sd-container-md,.sd-container-sm,.sd-container{max-width:720px}}@media(min-width: 992px){.sd-container-lg,.sd-container-md,.sd-container-sm,.sd-container{max-width:960px}}@media(min-width: 1200px){.sd-container-xl,.sd-container-lg,.sd-container-md,.sd-container-sm,.sd-container{max-width:1140px}}.sd-row{--sd-gutter-x: 1.5rem;--sd-gutter-y: 0;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-top:calc(var(--sd-gutter-y) * -1);margin-right:calc(var(--sd-gutter-x) * -0.5);margin-left:calc(var(--sd-gutter-x) * -0.5)}.sd-row>*{box-sizing:border-box;flex-shrink:0;width:100%;max-width:100%;padding-right:calc(var(--sd-gutter-x) * 0.5);padding-left:calc(var(--sd-gutter-x) * 0.5);margin-top:var(--sd-gutter-y)}.sd-col{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-auto>*{flex:0 0 auto;width:auto}.sd-row-cols-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}@media(min-width: 576px){.sd-col-sm{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-sm-auto{flex:1 0 auto;-ms-flex:1 0 auto;width:100%}.sd-row-cols-sm-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-sm-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-sm-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-sm-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-sm-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-sm-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-sm-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-sm-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-sm-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-sm-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-sm-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-sm-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}}@media(min-width: 768px){.sd-col-md{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-md-auto{flex:1 0 auto;-ms-flex:1 0 auto;width:100%}.sd-row-cols-md-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-md-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-md-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-md-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-md-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-md-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-md-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-md-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-md-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-md-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-md-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-md-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}}@media(min-width: 992px){.sd-col-lg{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-lg-auto{flex:1 0 auto;-ms-flex:1 0 auto;width:100%}.sd-row-cols-lg-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-lg-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-lg-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-lg-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-lg-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-lg-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-lg-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-lg-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-lg-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-lg-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-lg-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-lg-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}}@media(min-width: 1200px){.sd-col-xl{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-xl-auto{flex:1 0 auto;-ms-flex:1 0 auto;width:100%}.sd-row-cols-xl-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-xl-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-xl-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-xl-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-xl-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-xl-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-xl-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-xl-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-xl-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-xl-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-xl-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-xl-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}}.sd-col-auto{flex:0 0 auto;-ms-flex:0 0 auto;width:auto}.sd-col-1{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}.sd-col-2{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-col-3{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-col-4{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-col-5{flex:0 0 auto;-ms-flex:0 0 auto;width:41.6666666667%}.sd-col-6{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-col-7{flex:0 0 auto;-ms-flex:0 0 auto;width:58.3333333333%}.sd-col-8{flex:0 0 auto;-ms-flex:0 0 auto;width:66.6666666667%}.sd-col-9{flex:0 0 auto;-ms-flex:0 0 auto;width:75%}.sd-col-10{flex:0 0 auto;-ms-flex:0 0 auto;width:83.3333333333%}.sd-col-11{flex:0 0 auto;-ms-flex:0 0 auto;width:91.6666666667%}.sd-col-12{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-g-0,.sd-gy-0{--sd-gutter-y: 0}.sd-g-0,.sd-gx-0{--sd-gutter-x: 0}.sd-g-1,.sd-gy-1{--sd-gutter-y: 0.25rem}.sd-g-1,.sd-gx-1{--sd-gutter-x: 0.25rem}.sd-g-2,.sd-gy-2{--sd-gutter-y: 0.5rem}.sd-g-2,.sd-gx-2{--sd-gutter-x: 0.5rem}.sd-g-3,.sd-gy-3{--sd-gutter-y: 1rem}.sd-g-3,.sd-gx-3{--sd-gutter-x: 1rem}.sd-g-4,.sd-gy-4{--sd-gutter-y: 1.5rem}.sd-g-4,.sd-gx-4{--sd-gutter-x: 1.5rem}.sd-g-5,.sd-gy-5{--sd-gutter-y: 3rem}.sd-g-5,.sd-gx-5{--sd-gutter-x: 3rem}@media(min-width: 576px){.sd-col-sm-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.sd-col-sm-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.3333333333%}.sd-col-sm-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.6666666667%}.sd-col-sm-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.sd-col-sm-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.3333333333%}.sd-col-sm-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.6666666667%}.sd-col-sm-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.sd-col-sm-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.3333333333%}.sd-col-sm-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.6666666667%}.sd-col-sm-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.sd-col-sm-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.3333333333%}.sd-col-sm-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.6666666667%}.sd-col-sm-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.sd-g-sm-0,.sd-gy-sm-0{--sd-gutter-y: 0}.sd-g-sm-0,.sd-gx-sm-0{--sd-gutter-x: 0}.sd-g-sm-1,.sd-gy-sm-1{--sd-gutter-y: 0.25rem}.sd-g-sm-1,.sd-gx-sm-1{--sd-gutter-x: 0.25rem}.sd-g-sm-2,.sd-gy-sm-2{--sd-gutter-y: 0.5rem}.sd-g-sm-2,.sd-gx-sm-2{--sd-gutter-x: 0.5rem}.sd-g-sm-3,.sd-gy-sm-3{--sd-gutter-y: 1rem}.sd-g-sm-3,.sd-gx-sm-3{--sd-gutter-x: 1rem}.sd-g-sm-4,.sd-gy-sm-4{--sd-gutter-y: 1.5rem}.sd-g-sm-4,.sd-gx-sm-4{--sd-gutter-x: 1.5rem}.sd-g-sm-5,.sd-gy-sm-5{--sd-gutter-y: 3rem}.sd-g-sm-5,.sd-gx-sm-5{--sd-gutter-x: 3rem}}@media(min-width: 768px){.sd-col-md-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.sd-col-md-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.3333333333%}.sd-col-md-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.6666666667%}.sd-col-md-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.sd-col-md-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.3333333333%}.sd-col-md-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.6666666667%}.sd-col-md-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.sd-col-md-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.3333333333%}.sd-col-md-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.6666666667%}.sd-col-md-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.sd-col-md-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.3333333333%}.sd-col-md-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.6666666667%}.sd-col-md-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.sd-g-md-0,.sd-gy-md-0{--sd-gutter-y: 0}.sd-g-md-0,.sd-gx-md-0{--sd-gutter-x: 0}.sd-g-md-1,.sd-gy-md-1{--sd-gutter-y: 0.25rem}.sd-g-md-1,.sd-gx-md-1{--sd-gutter-x: 0.25rem}.sd-g-md-2,.sd-gy-md-2{--sd-gutter-y: 0.5rem}.sd-g-md-2,.sd-gx-md-2{--sd-gutter-x: 0.5rem}.sd-g-md-3,.sd-gy-md-3{--sd-gutter-y: 1rem}.sd-g-md-3,.sd-gx-md-3{--sd-gutter-x: 1rem}.sd-g-md-4,.sd-gy-md-4{--sd-gutter-y: 1.5rem}.sd-g-md-4,.sd-gx-md-4{--sd-gutter-x: 1.5rem}.sd-g-md-5,.sd-gy-md-5{--sd-gutter-y: 3rem}.sd-g-md-5,.sd-gx-md-5{--sd-gutter-x: 3rem}}@media(min-width: 992px){.sd-col-lg-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.sd-col-lg-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.3333333333%}.sd-col-lg-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.6666666667%}.sd-col-lg-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.sd-col-lg-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.3333333333%}.sd-col-lg-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.6666666667%}.sd-col-lg-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.sd-col-lg-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.3333333333%}.sd-col-lg-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.6666666667%}.sd-col-lg-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.sd-col-lg-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.3333333333%}.sd-col-lg-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.6666666667%}.sd-col-lg-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.sd-g-lg-0,.sd-gy-lg-0{--sd-gutter-y: 0}.sd-g-lg-0,.sd-gx-lg-0{--sd-gutter-x: 0}.sd-g-lg-1,.sd-gy-lg-1{--sd-gutter-y: 0.25rem}.sd-g-lg-1,.sd-gx-lg-1{--sd-gutter-x: 0.25rem}.sd-g-lg-2,.sd-gy-lg-2{--sd-gutter-y: 0.5rem}.sd-g-lg-2,.sd-gx-lg-2{--sd-gutter-x: 0.5rem}.sd-g-lg-3,.sd-gy-lg-3{--sd-gutter-y: 1rem}.sd-g-lg-3,.sd-gx-lg-3{--sd-gutter-x: 1rem}.sd-g-lg-4,.sd-gy-lg-4{--sd-gutter-y: 1.5rem}.sd-g-lg-4,.sd-gx-lg-4{--sd-gutter-x: 1.5rem}.sd-g-lg-5,.sd-gy-lg-5{--sd-gutter-y: 3rem}.sd-g-lg-5,.sd-gx-lg-5{--sd-gutter-x: 3rem}}@media(min-width: 1200px){.sd-col-xl-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.sd-col-xl-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.3333333333%}.sd-col-xl-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.6666666667%}.sd-col-xl-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.sd-col-xl-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.3333333333%}.sd-col-xl-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.6666666667%}.sd-col-xl-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.sd-col-xl-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.3333333333%}.sd-col-xl-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.6666666667%}.sd-col-xl-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.sd-col-xl-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.3333333333%}.sd-col-xl-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.6666666667%}.sd-col-xl-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.sd-g-xl-0,.sd-gy-xl-0{--sd-gutter-y: 0}.sd-g-xl-0,.sd-gx-xl-0{--sd-gutter-x: 0}.sd-g-xl-1,.sd-gy-xl-1{--sd-gutter-y: 0.25rem}.sd-g-xl-1,.sd-gx-xl-1{--sd-gutter-x: 0.25rem}.sd-g-xl-2,.sd-gy-xl-2{--sd-gutter-y: 0.5rem}.sd-g-xl-2,.sd-gx-xl-2{--sd-gutter-x: 0.5rem}.sd-g-xl-3,.sd-gy-xl-3{--sd-gutter-y: 1rem}.sd-g-xl-3,.sd-gx-xl-3{--sd-gutter-x: 1rem}.sd-g-xl-4,.sd-gy-xl-4{--sd-gutter-y: 1.5rem}.sd-g-xl-4,.sd-gx-xl-4{--sd-gutter-x: 1.5rem}.sd-g-xl-5,.sd-gy-xl-5{--sd-gutter-y: 3rem}.sd-g-xl-5,.sd-gx-xl-5{--sd-gutter-x: 3rem}}.sd-flex-row-reverse{flex-direction:row-reverse !important}details.sd-dropdown{position:relative}details.sd-dropdown .sd-summary-title{font-weight:700;padding-right:3em !important;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none}details.sd-dropdown:hover{cursor:pointer}details.sd-dropdown .sd-summary-content{cursor:default}details.sd-dropdown summary{list-style:none;padding:1em}details.sd-dropdown summary .sd-octicon.no-title{vertical-align:middle}details.sd-dropdown[open] summary .sd-octicon.no-title{visibility:hidden}details.sd-dropdown summary::-webkit-details-marker{display:none}details.sd-dropdown summary:focus{outline:none}details.sd-dropdown .sd-summary-icon{margin-right:.5em}details.sd-dropdown .sd-summary-icon svg{opacity:.8}details.sd-dropdown summary:hover .sd-summary-up svg,details.sd-dropdown summary:hover .sd-summary-down svg{opacity:1;transform:scale(1.1)}details.sd-dropdown .sd-summary-up svg,details.sd-dropdown .sd-summary-down svg{display:block;opacity:.6}details.sd-dropdown .sd-summary-up,details.sd-dropdown .sd-summary-down{pointer-events:none;position:absolute;right:1em;top:1em}details.sd-dropdown[open]>.sd-summary-title .sd-summary-down{visibility:hidden}details.sd-dropdown:not([open])>.sd-summary-title .sd-summary-up{visibility:hidden}details.sd-dropdown:not([open]).sd-card{border:none}details.sd-dropdown:not([open])>.sd-card-header{border:1px solid var(--sd-color-card-border);border-radius:.25rem}details.sd-dropdown.sd-fade-in[open] summary~*{-moz-animation:sd-fade-in .5s ease-in-out;-webkit-animation:sd-fade-in .5s ease-in-out;animation:sd-fade-in .5s ease-in-out}details.sd-dropdown.sd-fade-in-slide-down[open] summary~*{-moz-animation:sd-fade-in .5s ease-in-out,sd-slide-down .5s ease-in-out;-webkit-animation:sd-fade-in .5s ease-in-out,sd-slide-down .5s ease-in-out;animation:sd-fade-in .5s ease-in-out,sd-slide-down .5s ease-in-out}.sd-col>.sd-dropdown{width:100%}.sd-summary-content>.sd-tab-set:first-child{margin-top:0}@keyframes sd-fade-in{0%{opacity:0}100%{opacity:1}}@keyframes sd-slide-down{0%{transform:translate(0, -10px)}100%{transform:translate(0, 0)}}.sd-tab-set{border-radius:.125rem;display:flex;flex-wrap:wrap;margin:1em 0;position:relative}.sd-tab-set>input{opacity:0;position:absolute}.sd-tab-set>input:checked+label{border-color:var(--sd-color-tabs-underline-active);color:var(--sd-color-tabs-label-active)}.sd-tab-set>input:checked+label+.sd-tab-content{display:block}.sd-tab-set>input:not(:checked)+label:hover{color:var(--sd-color-tabs-label-hover);border-color:var(--sd-color-tabs-underline-hover)}.sd-tab-set>input:focus+label{outline-style:auto}.sd-tab-set>input:not(.focus-visible)+label{outline:none;-webkit-tap-highlight-color:transparent}.sd-tab-set>label{border-bottom:.125rem solid transparent;margin-bottom:0;color:var(--sd-color-tabs-label-inactive);border-color:var(--sd-color-tabs-underline-inactive);cursor:pointer;font-size:var(--sd-fontsize-tabs-label);font-weight:700;padding:1em 1.25em .5em;transition:color 250ms;width:auto;z-index:1}html .sd-tab-set>label:hover{color:var(--sd-color-tabs-label-active)}.sd-col>.sd-tab-set{width:100%}.sd-tab-content{box-shadow:0 -0.0625rem var(--sd-color-tabs-overline),0 .0625rem var(--sd-color-tabs-underline);display:none;order:99;padding-bottom:.75rem;padding-top:.75rem;width:100%}.sd-tab-content>:first-child{margin-top:0 !important}.sd-tab-content>:last-child{margin-bottom:0 !important}.sd-tab-content>.sd-tab-set{margin:0}.sd-sphinx-override,.sd-sphinx-override *{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.sd-sphinx-override p{margin-top:0}:root{--sd-color-primary: #007bff;--sd-color-secondary: #6c757d;--sd-color-success: #28a745;--sd-color-info: #17a2b8;--sd-color-warning: #f0b37e;--sd-color-danger: #dc3545;--sd-color-light: #f8f9fa;--sd-color-muted: #6c757d;--sd-color-dark: #212529;--sd-color-black: black;--sd-color-white: white;--sd-color-primary-highlight: #0069d9;--sd-color-secondary-highlight: #5c636a;--sd-color-success-highlight: #228e3b;--sd-color-info-highlight: #148a9c;--sd-color-warning-highlight: #cc986b;--sd-color-danger-highlight: #bb2d3b;--sd-color-light-highlight: #d3d4d5;--sd-color-muted-highlight: #5c636a;--sd-color-dark-highlight: #1c1f23;--sd-color-black-highlight: black;--sd-color-white-highlight: #d9d9d9;--sd-color-primary-text: #fff;--sd-color-secondary-text: #fff;--sd-color-success-text: #fff;--sd-color-info-text: #fff;--sd-color-warning-text: #212529;--sd-color-danger-text: #fff;--sd-color-light-text: #212529;--sd-color-muted-text: #fff;--sd-color-dark-text: #fff;--sd-color-black-text: #fff;--sd-color-white-text: #212529;--sd-color-shadow: rgba(0, 0, 0, 0.15);--sd-color-card-border: rgba(0, 0, 0, 0.125);--sd-color-card-border-hover: hsla(231, 99%, 66%, 1);--sd-color-card-background: transparent;--sd-color-card-text: inherit;--sd-color-card-header: transparent;--sd-color-card-footer: transparent;--sd-color-tabs-label-active: hsla(231, 99%, 66%, 1);--sd-color-tabs-label-hover: hsla(231, 99%, 66%, 1);--sd-color-tabs-label-inactive: hsl(0, 0%, 66%);--sd-color-tabs-underline-active: hsla(231, 99%, 66%, 1);--sd-color-tabs-underline-hover: rgba(178, 206, 245, 0.62);--sd-color-tabs-underline-inactive: transparent;--sd-color-tabs-overline: rgb(222, 222, 222);--sd-color-tabs-underline: rgb(222, 222, 222);--sd-fontsize-tabs-label: 1rem} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_sphinx_design_static/design-tabs.js b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_sphinx_design_static/design-tabs.js new file mode 100644 index 0000000000000000000000000000000000000000..36b38cf0d911247b119633267121aee3e6c8c8e9 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_sphinx_design_static/design-tabs.js @@ -0,0 +1,27 @@ +var sd_labels_by_text = {}; + +function ready() { + const li = document.getElementsByClassName("sd-tab-label"); + for (const label of li) { + syncId = label.getAttribute("data-sync-id"); + if (syncId) { + label.onclick = onLabelClick; + if (!sd_labels_by_text[syncId]) { + sd_labels_by_text[syncId] = []; + } + sd_labels_by_text[syncId].push(label); + } + } +} + +function onLabelClick() { + // Activate other inputs with the same sync id. + syncId = this.getAttribute("data-sync-id"); + for (label of sd_labels_by_text[syncId]) { + if (label === this) continue; + label.previousElementSibling.checked = true; + } + window.localStorage.setItem("sphinx-design-last-tab", syncId); +} + +document.addEventListener("DOMContentLoaded", ready, false); diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/NVIDIA-LogoBlack.svg b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/NVIDIA-LogoBlack.svg new file mode 100644 index 0000000000000000000000000000000000000000..c612396c71a8d36bb258b996033f5d4ad711b4fa --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/NVIDIA-LogoBlack.svg @@ -0,0 +1 @@ +NVIDIA-LogoBlack \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/NVIDIA-LogoWhite.svg b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/NVIDIA-LogoWhite.svg new file mode 100644 index 0000000000000000000000000000000000000000..942ca3b2a043105fc4a0b24b97136f46e7707f3b --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/NVIDIA-LogoWhite.svg @@ -0,0 +1,58 @@ + + + + + + + NVIDIA-LogoBlack + + + + + diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/api-styles-dark.css b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/api-styles-dark.css new file mode 100644 index 0000000000000000000000000000000000000000..73d5dc878c3ec9a8bd991241c26b0a9b2e9050cb --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/api-styles-dark.css @@ -0,0 +1,40 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: LicenseRef-NvidiaProprietary + * + * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual + * property and proprietary rights in and to this material, related + * documentation and any modifications thereto. Any use, reproduction, + * disclosure or distribution of this material and related documentation + * without an express license agreement from NVIDIA CORPORATION or + * its affiliates is strictly prohibited. + */ + + +/** + * CSS variables for API signature styling. + * + * These define styles in a way that function signatures produced by Sphinx will apply similar results for Python, C++, + * or any other language supported by Sphinx. + */ +html[data-theme='dark'] +{ + --api-signature-font-style-light: 300; + --api-signature-parameter-name-color: #FCFCFC; + --api-signature-parameter-name-font-style: normal; + --api-signature-parameter-symbol-color: var(--sd-color-tabs-label-inactive); + --api-signature-parameter-default-value-color: var(--sd-color-tabs-label-inactive); +} + +/** + * Python function parameter name. + */ +/* +div > dl.py > dt > em.sig-param > span.n > span.pre, +div > dl.py > dt > span.pre +*/ +html[data-theme='dark'] dl.py em.sig-param > span.n > span.pre +{ + color: var(--api-signature-parameter-name-color); + font-style: var(--api-signature-parameter-name-font-style); +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/api-styles.css b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/api-styles.css new file mode 100644 index 0000000000000000000000000000000000000000..6f19d8e055c5f9d380f6872867a1efee7aea2c56 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/api-styles.css @@ -0,0 +1,84 @@ +/* + * SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: LicenseRef-NvidiaProprietary + * + * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual + * property and proprietary rights in and to this material, related + * documentation and any modifications thereto. Any use, reproduction, + * disclosure or distribution of this material and related documentation + * without an express license agreement from NVIDIA CORPORATION or + * its affiliates is strictly prohibited. + */ + + +/** + * CSS variables for API signature styling. + * + * These define styles in a way that function signatures produced by Sphinx will apply similar results for Python, C++, + * or any other language supported by Sphinx. + */ +:root { + --api-signature-font-style-light: 300; + --api-signature-parameter-name-color: var(--sd-color-secondary); + --api-signature-parameter-name-font-style: normal; + --api-signature-parameter-symbol-color: var(--sd-color-tabs-label-inactive); + --api-signature-parameter-default-value-color: var(--sd-color-tabs-label-inactive); +} + + +/** + * Python module name. + */ +dl.py code.sig-prename.descclassname > span.pre { + font-weight: var(--api-signature-font-style-light); +} + +/** + * Python function parenthesis. + */ +dl.py span.sig-paren { + font-weight: var(--api-signature-font-style-light); +} + +/** + * Python function parameter name. + */ +/*dl.py em.sig-param > span.n > span.pre*/ +div > dl.py > dt > em.sig-param > span.n > span.pre, +div > dl.py > dt > span.pre +{ + color: var(--api-signature-parameter-name-color); + font-style: var(--api-signature-parameter-name-font-style); +} + +/** + * Python function parameter typehint reference. + */ +dl.py em.sig-param > span.n > a +{ + font-style: normal; +} + +/** + * Python function parameter operator (i.e. `=`). + */ +dl.py em.sig-param > span.o > span.pre { + color: var(--api-signature-parameter-symbol-color); + font-weight: var(--api-signature-font-style-light); +} + +/** + * Python function parameter default value. + */ +dl.py em.sig-param > span.default_value > span.pre { + color: var(--api-signature-parameter-default-value-color); + font-weight: var(--api-signature-font-style-light); +} + +/** + * Python return typehint + */ +dl.py span.sig-return-typehint > span.pre { + color: var(--api-signature-parameter-name-color); + font-weight: var(--api-signature-font-style-light); +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/basic.css b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/basic.css new file mode 100644 index 0000000000000000000000000000000000000000..bf18350b65c61f31b2f9f717c03e02f17c0ab4f1 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/basic.css @@ -0,0 +1,906 @@ +/* + * basic.css + * ~~~~~~~~~ + * + * Sphinx stylesheet -- basic theme. + * + * :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/* -- main layout ----------------------------------------------------------- */ + +div.clearer { + clear: both; +} + +div.section::after { + display: block; + content: ''; + clear: left; +} + +/* -- relbar ---------------------------------------------------------------- */ + +div.related { + width: 100%; + font-size: 90%; +} + +div.related h3 { + display: none; +} + +div.related ul { + margin: 0; + padding: 0 0 0 10px; + list-style: none; +} + +div.related li { + display: inline; +} + +div.related li.right { + float: right; + margin-right: 5px; +} + +/* -- sidebar --------------------------------------------------------------- */ + +div.sphinxsidebarwrapper { + padding: 10px 5px 0 10px; +} + +div.sphinxsidebar { + float: left; + width: 230px; + margin-left: -100%; + font-size: 90%; + word-wrap: break-word; + overflow-wrap : break-word; +} + +div.sphinxsidebar ul { + list-style: none; +} + +div.sphinxsidebar ul ul, +div.sphinxsidebar ul.want-points { + margin-left: 20px; + list-style: square; +} + +div.sphinxsidebar ul ul { + margin-top: 0; + margin-bottom: 0; +} + +div.sphinxsidebar form { + margin-top: 10px; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +div.sphinxsidebar #searchbox form.search { + overflow: hidden; +} + +div.sphinxsidebar #searchbox input[type="text"] { + float: left; + width: 80%; + padding: 0.25em; + box-sizing: border-box; +} + +div.sphinxsidebar #searchbox input[type="submit"] { + float: left; + width: 20%; + border-left: none; + padding: 0.25em; + box-sizing: border-box; +} + + +img { + border: 0; + max-width: 100%; +} + +/* -- search page ----------------------------------------------------------- */ + +ul.search { + margin: 10px 0 0 20px; + padding: 0; +} + +ul.search li { + padding: 5px 0 5px 20px; + background-image: url(file.png); + background-repeat: no-repeat; + background-position: 0 7px; +} + +ul.search li a { + font-weight: bold; +} + +ul.search li p.context { + color: #888; + margin: 2px 0 0 30px; + text-align: left; +} + +ul.keywordmatches li.goodmatch a { + font-weight: bold; +} + +/* -- index page ------------------------------------------------------------ */ + +table.contentstable { + width: 90%; + margin-left: auto; + margin-right: auto; +} + +table.contentstable p.biglink { + line-height: 150%; +} + +a.biglink { + font-size: 1.3em; +} + +span.linkdescr { + font-style: italic; + padding-top: 5px; + font-size: 90%; +} + +/* -- general index --------------------------------------------------------- */ + +table.indextable { + width: 100%; +} + +table.indextable td { + text-align: left; + vertical-align: top; +} + +table.indextable ul { + margin-top: 0; + margin-bottom: 0; + list-style-type: none; +} + +table.indextable > tbody > tr > td > ul { + padding-left: 0em; +} + +table.indextable tr.pcap { + height: 10px; +} + +table.indextable tr.cap { + margin-top: 10px; + background-color: #f2f2f2; +} + +img.toggler { + margin-right: 3px; + margin-top: 3px; + cursor: pointer; +} + +div.modindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +div.genindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +/* -- domain module index --------------------------------------------------- */ + +table.modindextable td { + padding: 2px; + border-collapse: collapse; +} + +/* -- general body styles --------------------------------------------------- */ + +div.body { + min-width: 450px; + max-width: 800px; +} + +div.body p, div.body dd, div.body li, div.body blockquote { + -moz-hyphens: auto; + -ms-hyphens: auto; + -webkit-hyphens: auto; + hyphens: auto; +} + +a.headerlink { + visibility: hidden; +} + +a.brackets:before, +span.brackets > a:before{ + content: "["; +} + +a.brackets:after, +span.brackets > a:after { + content: "]"; +} + +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink, +caption:hover > a.headerlink, +p.caption:hover > a.headerlink, +div.code-block-caption:hover > a.headerlink { + visibility: visible; +} + +div.body p.caption { + text-align: inherit; +} + +div.body td { + text-align: left; +} + +.first { + margin-top: 0 !important; +} + +p.rubric { + margin-top: 30px; + font-weight: bold; +} + +img.align-left, figure.align-left, .figure.align-left, object.align-left { + clear: left; + float: left; + margin-right: 1em; +} + +img.align-right, figure.align-right, .figure.align-right, object.align-right { + clear: right; + float: right; + margin-left: 1em; +} + +img.align-center, figure.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +img.align-default, figure.align-default, .figure.align-default { + display: block; + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left; +} + +.align-center { + text-align: center; +} + +.align-default { + text-align: center; +} + +.align-right { + text-align: right; +} + +/* -- sidebars -------------------------------------------------------------- */ + +div.sidebar, +aside.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px; + background-color: #ffe; + width: 40%; + float: right; + clear: right; + overflow-x: auto; +} + +p.sidebar-title { + font-weight: bold; +} + +div.admonition, div.topic, blockquote { + clear: left; +} + +/* -- topics ---------------------------------------------------------------- */ + +div.topic { + border: 1px solid #ccc; + padding: 7px; + margin: 10px 0 10px 0; +} + +p.topic-title { + font-size: 1.1em; + font-weight: bold; + margin-top: 10px; +} + +/* -- admonitions ----------------------------------------------------------- */ + +div.admonition { + margin-top: 10px; + margin-bottom: 10px; + padding: 7px; +} + +div.admonition dt { + font-weight: bold; +} + +p.admonition-title { + margin: 0px 10px 5px 0px; + font-weight: bold; +} + +div.body p.centered { + text-align: center; + margin-top: 25px; +} + +/* -- content of sidebars/topics/admonitions -------------------------------- */ + +div.sidebar > :last-child, +aside.sidebar > :last-child, +div.topic > :last-child, +div.admonition > :last-child { + margin-bottom: 0; +} + +div.sidebar::after, +aside.sidebar::after, +div.topic::after, +div.admonition::after, +blockquote::after { + display: block; + content: ''; + clear: both; +} + +/* -- tables ---------------------------------------------------------------- */ + +table.docutils { + margin-top: 10px; + margin-bottom: 10px; + border: 0; + border-collapse: collapse; +} + +table.align-center { + margin-left: auto; + margin-right: auto; +} + +table.align-default { + margin-left: auto; + margin-right: auto; +} + +table caption span.caption-number { + font-style: italic; +} + +table caption span.caption-text { +} + +table.docutils td, table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px solid #aaa; +} + +table.footnote td, table.footnote th { + border: 0 !important; +} + +th { + text-align: left; + padding-right: 5px; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + +th > :first-child, +td > :first-child { + margin-top: 0px; +} + +th > :last-child, +td > :last-child { + margin-bottom: 0px; +} + +/* -- figures --------------------------------------------------------------- */ + +div.figure, figure { + margin: 0.5em; + padding: 0.5em; +} + +div.figure p.caption, figcaption { + padding: 0.3em; +} + +div.figure p.caption span.caption-number, +figcaption span.caption-number { + font-style: italic; +} + +div.figure p.caption span.caption-text, +figcaption span.caption-text { +} + +/* -- field list styles ----------------------------------------------------- */ + +table.field-list td, table.field-list th { + border: 0 !important; +} + +.field-list ul { + margin: 0; + padding-left: 1em; +} + +.field-list p { + margin: 0; +} + +.field-name { + -moz-hyphens: manual; + -ms-hyphens: manual; + -webkit-hyphens: manual; + hyphens: manual; +} + +/* -- hlist styles ---------------------------------------------------------- */ + +table.hlist { + margin: 1em 0; +} + +table.hlist td { + vertical-align: top; +} + +/* -- object description styles --------------------------------------------- */ + +.sig { + font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; +} + +.sig-name, code.descname { + background-color: transparent; + font-weight: bold; +} + +.sig-name { + font-size: 1.1em; +} + +code.descname { + font-size: 1.2em; +} + +.sig-prename, code.descclassname { + background-color: transparent; +} + +.optional { + font-size: 1.3em; +} + +.sig-paren { + font-size: larger; +} + +.sig-param.n { + font-style: italic; +} + +/* C++ specific styling */ + +.sig-inline.c-texpr, +.sig-inline.cpp-texpr { + font-family: unset; +} + +.sig.c .k, .sig.c .kt, +.sig.cpp .k, .sig.cpp .kt { + color: #0033B3; +} + +.sig.c .m, +.sig.cpp .m { + color: #1750EB; +} + +.sig.c .s, .sig.c .sc, +.sig.cpp .s, .sig.cpp .sc { + color: #067D17; +} + + +/* -- other body styles ----------------------------------------------------- */ + +ol.arabic { + list-style: decimal; +} + +ol.loweralpha { + list-style: lower-alpha; +} + +ol.upperalpha { + list-style: upper-alpha; +} + +ol.lowerroman { + list-style: lower-roman; +} + +ol.upperroman { + list-style: upper-roman; +} + +:not(li) > ol > li:first-child > :first-child, +:not(li) > ul > li:first-child > :first-child { + margin-top: 0px; +} + +:not(li) > ol > li:last-child > :last-child, +:not(li) > ul > li:last-child > :last-child { + margin-bottom: 0px; +} + +ol.simple ol p, +ol.simple ul p, +ul.simple ol p, +ul.simple ul p { + margin-top: 0; +} + +ol.simple > li:not(:first-child) > p, +ul.simple > li:not(:first-child) > p { + margin-top: 0; +} + +ol.simple p, +ul.simple p { + margin-bottom: 0; +} + +dl.footnote > dt, +dl.citation > dt { + float: left; + margin-right: 0.5em; +} + +dl.footnote > dd, +dl.citation > dd { + margin-bottom: 0em; +} + +dl.footnote > dd:after, +dl.citation > dd:after { + content: ""; + clear: both; +} + +dl.field-list { + display: grid; + grid-template-columns: fit-content(30%) auto; +} + +dl.field-list > dt { + font-weight: bold; + word-break: break-word; + padding-left: 0.5em; + padding-right: 5px; +} + +dl.field-list > dt:after { + content: ":"; +} + +dl.field-list > dd { + padding-left: 0.5em; + margin-top: 0em; + margin-left: 0em; + margin-bottom: 0em; +} + +dl { + margin-bottom: 15px; +} + +dd > :first-child { + margin-top: 0px; +} + +dd ul, dd table { + margin-bottom: 10px; +} + +dd { + margin-top: 3px; + margin-bottom: 10px; + margin-left: 30px; +} + +dl > dd:last-child, +dl > dd:last-child > :last-child { + margin-bottom: 0; +} + +dt:target, span.highlighted { + background-color: #fbe54e; +} + +rect.highlighted { + fill: #fbe54e; +} + +dl.glossary dt { + font-weight: bold; + font-size: 1.1em; +} + +.versionmodified { + font-style: italic; +} + +.system-message { + background-color: #fda; + padding: 5px; + border: 3px solid red; +} + +.footnote:target { + background-color: #ffa; +} + +.line-block { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} + +.line-block .line-block { + margin-top: 0; + margin-bottom: 0; + margin-left: 1.5em; +} + +.guilabel, .menuselection { + font-family: sans-serif; +} + +.accelerator { + text-decoration: underline; +} + +.classifier { + font-style: oblique; +} + +.classifier:before { + font-style: normal; + margin: 0 0.5em; + content: ":"; + display: inline-block; +} + +abbr, acronym { + border-bottom: dotted 1px; + cursor: help; +} + +/* -- code displays --------------------------------------------------------- */ + +pre { + overflow: auto; + overflow-y: hidden; /* fixes display issues on Chrome browsers */ +} + +pre, div[class*="highlight-"] { + clear: both; +} + +span.pre { + -moz-hyphens: none; + -ms-hyphens: none; + -webkit-hyphens: none; + hyphens: none; + white-space: nowrap; +} + +div[class*="highlight-"] { + margin: 1em 0; +} + +td.linenos pre { + border: 0; + background-color: transparent; + color: #aaa; +} + +table.highlighttable { + display: block; +} + +table.highlighttable tbody { + display: block; +} + +table.highlighttable tr { + display: flex; +} + +table.highlighttable td { + margin: 0; + padding: 0; +} + +table.highlighttable td.linenos { + padding-right: 0.5em; +} + +table.highlighttable td.code { + flex: 1; + overflow: hidden; +} + +.highlight .hll { + display: block; +} + +div.highlight pre, +table.highlighttable pre { + margin: 0; +} + +div.code-block-caption + div { + margin-top: 0; +} + +div.code-block-caption { + margin-top: 1em; + padding: 2px 5px; + font-size: small; +} + +div.code-block-caption code { + background-color: transparent; +} + +table.highlighttable td.linenos, +span.linenos, +div.highlight span.gp { /* gp: Generic.Prompt */ + user-select: none; + -webkit-user-select: text; /* Safari fallback only */ + -webkit-user-select: none; /* Chrome/Safari */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* IE10+ */ +} + +div.code-block-caption span.caption-number { + padding: 0.1em 0.3em; + font-style: italic; +} + +div.code-block-caption span.caption-text { +} + +div.literal-block-wrapper { + margin: 1em 0; +} + +code.xref, a code { + background-color: transparent; + font-weight: bold; +} + +h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { + background-color: transparent; +} + +.viewcode-link { + float: right; +} + +.viewcode-back { + float: right; + font-family: sans-serif; +} + +div.viewcode-block:target { + margin: -1px -10px; + padding: 0 10px; +} + +/* -- math display ---------------------------------------------------------- */ + +img.math { + vertical-align: middle; +} + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} + +span.eqno a.headerlink { + position: absolute; + z-index: 1; +} + +div.math:hover a.headerlink { + visibility: visible; +} + +/* -- printout stylesheet --------------------------------------------------- */ + +@media print { + div.document, + div.documentwrapper, + div.bodywrapper { + margin: 0 !important; + width: 100%; + } + + div.sphinxsidebar, + div.related, + div.footer, + #top-link { + display: none; + } +} \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/css/badge_only.css b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/css/badge_only.css new file mode 100644 index 0000000000000000000000000000000000000000..e380325bc6e273d9142c2369883d2a4b2a069cf1 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/css/badge_only.css @@ -0,0 +1 @@ +.fa:before{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-style:normal;font-weight:400;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix) format("embedded-opentype"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format("woff2"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format("woff"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format("truetype"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#FontAwesome) format("svg")}.fa:before{font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1}.fa:before,a .fa{text-decoration:inherit}.fa:before,a .fa,li .fa{display:inline-block}li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-.8em}ul.fas li .fa{width:.8em}ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before,.icon-book:before{content:"\f02d"}.fa-caret-down:before,.icon-caret-down:before{content:"\f0d7"}.fa-caret-up:before,.icon-caret-up:before{content:"\f0d8"}.fa-caret-left:before,.icon-caret-left:before{content:"\f0d9"}.fa-caret-right:before,.icon-caret-right:before{content:"\f0da"}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60}.rst-versions .rst-current-version:after{clear:both;content:"";display:block}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}} \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/css/fonts/Roboto-Slab-Bold.woff b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/css/fonts/Roboto-Slab-Bold.woff new file mode 100644 index 0000000000000000000000000000000000000000..6cb60000181dbd348963953ac8ac54afb46c63d5 Binary files /dev/null and b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/css/fonts/Roboto-Slab-Bold.woff differ diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/css/fonts/Roboto-Slab-Bold.woff2 b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/css/fonts/Roboto-Slab-Bold.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..7059e23142aae3d8bad6067fc734a6cffec779c9 Binary files /dev/null and b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/css/fonts/Roboto-Slab-Bold.woff2 differ diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/css/fonts/Roboto-Slab-Regular.woff b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/css/fonts/Roboto-Slab-Regular.woff new file mode 100644 index 0000000000000000000000000000000000000000..f815f63f99da80ad2be69e4021023ec2981eaea0 Binary files /dev/null and b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/css/fonts/Roboto-Slab-Regular.woff differ diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/css/fonts/Roboto-Slab-Regular.woff2 b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/css/fonts/Roboto-Slab-Regular.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..f2c76e5bda18a9842e24cd60d8787257da215ca7 Binary files /dev/null and b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/css/fonts/Roboto-Slab-Regular.woff2 differ diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/css/fonts/fontawesome-webfont.svg b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/css/fonts/fontawesome-webfont.svg new file mode 100644 index 0000000000000000000000000000000000000000..855c845e538b65548118279537a04eab2ec6ef0d --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/css/fonts/fontawesome-webfont.svg @@ -0,0 +1,2671 @@ + + + + +Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016 + By ,,, +Copyright Dave Gandy 2016. All rights reserved. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/css/fonts/fontawesome-webfont.woff b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/css/fonts/fontawesome-webfont.woff new file mode 100644 index 0000000000000000000000000000000000000000..400014a4b06eee3d0c0d54402a47ab2601b2862b Binary files /dev/null and b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/css/fonts/fontawesome-webfont.woff differ diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/css/fonts/fontawesome-webfont.woff2 b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/css/fonts/fontawesome-webfont.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..4d13fc60404b91e398a37200c4a77b645cfd9586 Binary files /dev/null and b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/css/fonts/fontawesome-webfont.woff2 differ diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/css/theme.css b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/css/theme.css new file mode 100644 index 0000000000000000000000000000000000000000..0d9ae7e1a45b82198c53548383a570d924993371 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/css/theme.css @@ -0,0 +1,4 @@ +html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden],audio:not([controls]){display:none}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}blockquote{margin:0}dfn{font-style:italic}ins{background:#ff9;text-decoration:none}ins,mark{color:#000}mark{background:#ff0;font-style:italic;font-weight:700}.rst-content code,.rst-content tt,code,kbd,pre,samp{font-family:monospace,serif;_font-family:courier new,monospace;font-size:1em}pre{white-space:pre}q{quotes:none}q:after,q:before{content:"";content:none}small{font-size:85%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}dl,ol,ul{margin:0;padding:0;list-style:none;list-style-image:none}li{list-style:none}dd{margin:0}img{border:0;-ms-interpolation-mode:bicubic;vertical-align:middle;max-width:100%}svg:not(:root){overflow:hidden}figure,form{margin:0}label{cursor:pointer}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,input[type=button],input[type=reset],input[type=submit]{cursor:pointer;-webkit-appearance:button;*overflow:visible}button[disabled],input[disabled]{cursor:default}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}textarea{resize:vertical}table{border-collapse:collapse;border-spacing:0}td{vertical-align:top}.chromeframe{margin:.2em 0;background:#ccc;color:#000;padding:.2em 0}.ir{display:block;border:0;text-indent:-999em;overflow:hidden;background-color:transparent;background-repeat:no-repeat;text-align:left;direction:ltr;*line-height:0}.ir br{display:none}.hidden{display:none!important;visibility:hidden}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.invisible{visibility:hidden}.relative{position:relative}big,small{font-size:100%}@media print{body,html,section{background:none!important}*{box-shadow:none!important;text-shadow:none!important;filter:none!important;-ms-filter:none!important}a,a:visited{text-decoration:underline}.ir a:after,a[href^="#"]:after,a[href^="javascript:"]:after{content:""}blockquote,pre{page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}.rst-content .toctree-wrapper>p.caption,h2,h3,p{orphans:3;widows:3}.rst-content .toctree-wrapper>p.caption,h2,h3{page-break-after:avoid}}.btn,.fa:before,.icon:before,.rst-content .admonition,.rst-content .admonition-title:before,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .code-block-caption .headerlink:before,.rst-content .danger,.rst-content .eqno .headerlink:before,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning,.rst-content code.download span:first-child:before,.rst-content dl dt .headerlink:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content p .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content tt.download span:first-child:before,.wy-alert,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-menu-vertical li.current>a,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a,.wy-menu-vertical li.on a button.toctree-expand:before,.wy-menu-vertical li button.toctree-expand:before,.wy-nav-top a,.wy-side-nav-search .wy-dropdown>a,.wy-side-nav-search>a,input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week],select,textarea{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:""}.clearfix:after{clear:both}/*! + * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */@font-face{font-family:FontAwesome;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713);src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix&v=4.7.0) format("embedded-opentype"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format("woff2"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format("woff"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format("truetype"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#fontawesomeregular) format("svg");font-weight:400;font-style:normal}.fa,.icon,.rst-content .admonition-title,.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content code.download span:first-child,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink,.rst-content tt.download span:first-child,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li button.toctree-expand{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14286em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14286em;width:2.14286em;top:.14286em;text-align:center}.fa-li.fa-lg{left:-1.85714em}.fa-border{padding:.2em .25em .15em;border:.08em solid #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa-pull-left.icon,.fa.fa-pull-left,.rst-content .code-block-caption .fa-pull-left.headerlink,.rst-content .eqno .fa-pull-left.headerlink,.rst-content .fa-pull-left.admonition-title,.rst-content code.download span.fa-pull-left:first-child,.rst-content dl dt .fa-pull-left.headerlink,.rst-content h1 .fa-pull-left.headerlink,.rst-content h2 .fa-pull-left.headerlink,.rst-content h3 .fa-pull-left.headerlink,.rst-content h4 .fa-pull-left.headerlink,.rst-content h5 .fa-pull-left.headerlink,.rst-content h6 .fa-pull-left.headerlink,.rst-content p .fa-pull-left.headerlink,.rst-content table>caption .fa-pull-left.headerlink,.rst-content tt.download span.fa-pull-left:first-child,.wy-menu-vertical li.current>a button.fa-pull-left.toctree-expand,.wy-menu-vertical li.on a button.fa-pull-left.toctree-expand,.wy-menu-vertical li button.fa-pull-left.toctree-expand{margin-right:.3em}.fa-pull-right.icon,.fa.fa-pull-right,.rst-content .code-block-caption .fa-pull-right.headerlink,.rst-content .eqno .fa-pull-right.headerlink,.rst-content .fa-pull-right.admonition-title,.rst-content code.download span.fa-pull-right:first-child,.rst-content dl dt .fa-pull-right.headerlink,.rst-content h1 .fa-pull-right.headerlink,.rst-content h2 .fa-pull-right.headerlink,.rst-content h3 .fa-pull-right.headerlink,.rst-content h4 .fa-pull-right.headerlink,.rst-content h5 .fa-pull-right.headerlink,.rst-content h6 .fa-pull-right.headerlink,.rst-content p .fa-pull-right.headerlink,.rst-content table>caption .fa-pull-right.headerlink,.rst-content tt.download span.fa-pull-right:first-child,.wy-menu-vertical li.current>a button.fa-pull-right.toctree-expand,.wy-menu-vertical li.on a button.fa-pull-right.toctree-expand,.wy-menu-vertical li button.fa-pull-right.toctree-expand{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left,.pull-left.icon,.rst-content .code-block-caption .pull-left.headerlink,.rst-content .eqno .pull-left.headerlink,.rst-content .pull-left.admonition-title,.rst-content code.download span.pull-left:first-child,.rst-content dl dt .pull-left.headerlink,.rst-content h1 .pull-left.headerlink,.rst-content h2 .pull-left.headerlink,.rst-content h3 .pull-left.headerlink,.rst-content h4 .pull-left.headerlink,.rst-content h5 .pull-left.headerlink,.rst-content h6 .pull-left.headerlink,.rst-content p .pull-left.headerlink,.rst-content table>caption .pull-left.headerlink,.rst-content tt.download span.pull-left:first-child,.wy-menu-vertical li.current>a button.pull-left.toctree-expand,.wy-menu-vertical li.on a button.pull-left.toctree-expand,.wy-menu-vertical li button.pull-left.toctree-expand{margin-right:.3em}.fa.pull-right,.pull-right.icon,.rst-content .code-block-caption .pull-right.headerlink,.rst-content .eqno .pull-right.headerlink,.rst-content .pull-right.admonition-title,.rst-content code.download span.pull-right:first-child,.rst-content dl dt .pull-right.headerlink,.rst-content h1 .pull-right.headerlink,.rst-content h2 .pull-right.headerlink,.rst-content h3 .pull-right.headerlink,.rst-content h4 .pull-right.headerlink,.rst-content h5 .pull-right.headerlink,.rst-content h6 .pull-right.headerlink,.rst-content p .pull-right.headerlink,.rst-content table>caption .pull-right.headerlink,.rst-content tt.download span.pull-right:first-child,.wy-menu-vertical li.current>a button.pull-right.toctree-expand,.wy-menu-vertical li.on a button.pull-right.toctree-expand,.wy-menu-vertical li button.pull-right.toctree-expand{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s linear infinite;animation:fa-spin 2s linear infinite}.fa-pulse{-webkit-animation:fa-spin 1s steps(8) infinite;animation:fa-spin 1s steps(8) infinite}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scaleX(-1);-ms-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scaleY(-1);-ms-transform:scaleY(-1);transform:scaleY(-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:""}.fa-music:before{content:""}.fa-search:before,.icon-search:before{content:""}.fa-envelope-o:before{content:""}.fa-heart:before{content:""}.fa-star:before{content:""}.fa-star-o:before{content:""}.fa-user:before{content:""}.fa-film:before{content:""}.fa-th-large:before{content:""}.fa-th:before{content:""}.fa-th-list:before{content:""}.fa-check:before{content:""}.fa-close:before,.fa-remove:before,.fa-times:before{content:""}.fa-search-plus:before{content:""}.fa-search-minus:before{content:""}.fa-power-off:before{content:""}.fa-signal:before{content:""}.fa-cog:before,.fa-gear:before{content:""}.fa-trash-o:before{content:""}.fa-home:before,.icon-home:before{content:""}.fa-file-o:before{content:""}.fa-clock-o:before{content:""}.fa-road:before{content:""}.fa-download:before,.rst-content code.download span:first-child:before,.rst-content tt.download span:first-child:before{content:""}.fa-arrow-circle-o-down:before{content:""}.fa-arrow-circle-o-up:before{content:""}.fa-inbox:before{content:""}.fa-play-circle-o:before{content:""}.fa-repeat:before,.fa-rotate-right:before{content:""}.fa-refresh:before{content:""}.fa-list-alt:before{content:""}.fa-lock:before{content:""}.fa-flag:before{content:""}.fa-headphones:before{content:""}.fa-volume-off:before{content:""}.fa-volume-down:before{content:""}.fa-volume-up:before{content:""}.fa-qrcode:before{content:""}.fa-barcode:before{content:""}.fa-tag:before{content:""}.fa-tags:before{content:""}.fa-book:before,.icon-book:before{content:""}.fa-bookmark:before{content:""}.fa-print:before{content:""}.fa-camera:before{content:""}.fa-font:before{content:""}.fa-bold:before{content:""}.fa-italic:before{content:""}.fa-text-height:before{content:""}.fa-text-width:before{content:""}.fa-align-left:before{content:""}.fa-align-center:before{content:""}.fa-align-right:before{content:""}.fa-align-justify:before{content:""}.fa-list:before{content:""}.fa-dedent:before,.fa-outdent:before{content:""}.fa-indent:before{content:""}.fa-video-camera:before{content:""}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:""}.fa-pencil:before{content:""}.fa-map-marker:before{content:""}.fa-adjust:before{content:""}.fa-tint:before{content:""}.fa-edit:before,.fa-pencil-square-o:before{content:""}.fa-share-square-o:before{content:""}.fa-check-square-o:before{content:""}.fa-arrows:before{content:""}.fa-step-backward:before{content:""}.fa-fast-backward:before{content:""}.fa-backward:before{content:""}.fa-play:before{content:""}.fa-pause:before{content:""}.fa-stop:before{content:""}.fa-forward:before{content:""}.fa-fast-forward:before{content:""}.fa-step-forward:before{content:""}.fa-eject:before{content:""}.fa-chevron-left:before{content:""}.fa-chevron-right:before{content:""}.fa-plus-circle:before{content:""}.fa-minus-circle:before{content:""}.fa-times-circle:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before{content:""}.fa-check-circle:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before{content:""}.fa-question-circle:before{content:""}.fa-info-circle:before{content:""}.fa-crosshairs:before{content:""}.fa-times-circle-o:before{content:""}.fa-check-circle-o:before{content:""}.fa-ban:before{content:""}.fa-arrow-left:before{content:""}.fa-arrow-right:before{content:""}.fa-arrow-up:before{content:""}.fa-arrow-down:before{content:""}.fa-mail-forward:before,.fa-share:before{content:""}.fa-expand:before{content:""}.fa-compress:before{content:""}.fa-plus:before{content:""}.fa-minus:before{content:""}.fa-asterisk:before{content:""}.fa-exclamation-circle:before,.rst-content .admonition-title:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before{content:""}.fa-gift:before{content:""}.fa-leaf:before{content:""}.fa-fire:before,.icon-fire:before{content:""}.fa-eye:before{content:""}.fa-eye-slash:before{content:""}.fa-exclamation-triangle:before,.fa-warning:before{content:""}.fa-plane:before{content:""}.fa-calendar:before{content:""}.fa-random:before{content:""}.fa-comment:before{content:""}.fa-magnet:before{content:""}.fa-chevron-up:before{content:""}.fa-chevron-down:before{content:""}.fa-retweet:before{content:""}.fa-shopping-cart:before{content:""}.fa-folder:before{content:""}.fa-folder-open:before{content:""}.fa-arrows-v:before{content:""}.fa-arrows-h:before{content:""}.fa-bar-chart-o:before,.fa-bar-chart:before{content:""}.fa-twitter-square:before{content:""}.fa-facebook-square:before{content:""}.fa-camera-retro:before{content:""}.fa-key:before{content:""}.fa-cogs:before,.fa-gears:before{content:""}.fa-comments:before{content:""}.fa-thumbs-o-up:before{content:""}.fa-thumbs-o-down:before{content:""}.fa-star-half:before{content:""}.fa-heart-o:before{content:""}.fa-sign-out:before{content:""}.fa-linkedin-square:before{content:""}.fa-thumb-tack:before{content:""}.fa-external-link:before{content:""}.fa-sign-in:before{content:""}.fa-trophy:before{content:""}.fa-github-square:before{content:""}.fa-upload:before{content:""}.fa-lemon-o:before{content:""}.fa-phone:before{content:""}.fa-square-o:before{content:""}.fa-bookmark-o:before{content:""}.fa-phone-square:before{content:""}.fa-twitter:before{content:""}.fa-facebook-f:before,.fa-facebook:before{content:""}.fa-github:before,.icon-github:before{content:""}.fa-unlock:before{content:""}.fa-credit-card:before{content:""}.fa-feed:before,.fa-rss:before{content:""}.fa-hdd-o:before{content:""}.fa-bullhorn:before{content:""}.fa-bell:before{content:""}.fa-certificate:before{content:""}.fa-hand-o-right:before{content:""}.fa-hand-o-left:before{content:""}.fa-hand-o-up:before{content:""}.fa-hand-o-down:before{content:""}.fa-arrow-circle-left:before,.icon-circle-arrow-left:before{content:""}.fa-arrow-circle-right:before,.icon-circle-arrow-right:before{content:""}.fa-arrow-circle-up:before{content:""}.fa-arrow-circle-down:before{content:""}.fa-globe:before{content:""}.fa-wrench:before{content:""}.fa-tasks:before{content:""}.fa-filter:before{content:""}.fa-briefcase:before{content:""}.fa-arrows-alt:before{content:""}.fa-group:before,.fa-users:before{content:""}.fa-chain:before,.fa-link:before,.icon-link:before{content:""}.fa-cloud:before{content:""}.fa-flask:before{content:""}.fa-cut:before,.fa-scissors:before{content:""}.fa-copy:before,.fa-files-o:before{content:""}.fa-paperclip:before{content:""}.fa-floppy-o:before,.fa-save:before{content:""}.fa-square:before{content:""}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:""}.fa-list-ul:before{content:""}.fa-list-ol:before{content:""}.fa-strikethrough:before{content:""}.fa-underline:before{content:""}.fa-table:before{content:""}.fa-magic:before{content:""}.fa-truck:before{content:""}.fa-pinterest:before{content:""}.fa-pinterest-square:before{content:""}.fa-google-plus-square:before{content:""}.fa-google-plus:before{content:""}.fa-money:before{content:""}.fa-caret-down:before,.icon-caret-down:before,.wy-dropdown .caret:before{content:""}.fa-caret-up:before{content:""}.fa-caret-left:before{content:""}.fa-caret-right:before{content:""}.fa-columns:before{content:""}.fa-sort:before,.fa-unsorted:before{content:""}.fa-sort-desc:before,.fa-sort-down:before{content:""}.fa-sort-asc:before,.fa-sort-up:before{content:""}.fa-envelope:before{content:""}.fa-linkedin:before{content:""}.fa-rotate-left:before,.fa-undo:before{content:""}.fa-gavel:before,.fa-legal:before{content:""}.fa-dashboard:before,.fa-tachometer:before{content:""}.fa-comment-o:before{content:""}.fa-comments-o:before{content:""}.fa-bolt:before,.fa-flash:before{content:""}.fa-sitemap:before{content:""}.fa-umbrella:before{content:""}.fa-clipboard:before,.fa-paste:before{content:""}.fa-lightbulb-o:before{content:""}.fa-exchange:before{content:""}.fa-cloud-download:before{content:""}.fa-cloud-upload:before{content:""}.fa-user-md:before{content:""}.fa-stethoscope:before{content:""}.fa-suitcase:before{content:""}.fa-bell-o:before{content:""}.fa-coffee:before{content:""}.fa-cutlery:before{content:""}.fa-file-text-o:before{content:""}.fa-building-o:before{content:""}.fa-hospital-o:before{content:""}.fa-ambulance:before{content:""}.fa-medkit:before{content:""}.fa-fighter-jet:before{content:""}.fa-beer:before{content:""}.fa-h-square:before{content:""}.fa-plus-square:before{content:""}.fa-angle-double-left:before{content:""}.fa-angle-double-right:before{content:""}.fa-angle-double-up:before{content:""}.fa-angle-double-down:before{content:""}.fa-angle-left:before{content:""}.fa-angle-right:before{content:""}.fa-angle-up:before{content:""}.fa-angle-down:before{content:""}.fa-desktop:before{content:""}.fa-laptop:before{content:""}.fa-tablet:before{content:""}.fa-mobile-phone:before,.fa-mobile:before{content:""}.fa-circle-o:before{content:""}.fa-quote-left:before{content:""}.fa-quote-right:before{content:""}.fa-spinner:before{content:""}.fa-circle:before{content:""}.fa-mail-reply:before,.fa-reply:before{content:""}.fa-github-alt:before{content:""}.fa-folder-o:before{content:""}.fa-folder-open-o:before{content:""}.fa-smile-o:before{content:""}.fa-frown-o:before{content:""}.fa-meh-o:before{content:""}.fa-gamepad:before{content:""}.fa-keyboard-o:before{content:""}.fa-flag-o:before{content:""}.fa-flag-checkered:before{content:""}.fa-terminal:before{content:""}.fa-code:before{content:""}.fa-mail-reply-all:before,.fa-reply-all:before{content:""}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:""}.fa-location-arrow:before{content:""}.fa-crop:before{content:""}.fa-code-fork:before{content:""}.fa-chain-broken:before,.fa-unlink:before{content:""}.fa-question:before{content:""}.fa-info:before{content:""}.fa-exclamation:before{content:""}.fa-superscript:before{content:""}.fa-subscript:before{content:""}.fa-eraser:before{content:""}.fa-puzzle-piece:before{content:""}.fa-microphone:before{content:""}.fa-microphone-slash:before{content:""}.fa-shield:before{content:""}.fa-calendar-o:before{content:""}.fa-fire-extinguisher:before{content:""}.fa-rocket:before{content:""}.fa-maxcdn:before{content:""}.fa-chevron-circle-left:before{content:""}.fa-chevron-circle-right:before{content:""}.fa-chevron-circle-up:before{content:""}.fa-chevron-circle-down:before{content:""}.fa-html5:before{content:""}.fa-css3:before{content:""}.fa-anchor:before{content:""}.fa-unlock-alt:before{content:""}.fa-bullseye:before{content:""}.fa-ellipsis-h:before{content:""}.fa-ellipsis-v:before{content:""}.fa-rss-square:before{content:""}.fa-play-circle:before{content:""}.fa-ticket:before{content:""}.fa-minus-square:before{content:""}.fa-minus-square-o:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before{content:""}.fa-level-up:before{content:""}.fa-level-down:before{content:""}.fa-check-square:before{content:""}.fa-pencil-square:before{content:""}.fa-external-link-square:before{content:""}.fa-share-square:before{content:""}.fa-compass:before{content:""}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:""}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:""}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:""}.fa-eur:before,.fa-euro:before{content:""}.fa-gbp:before{content:""}.fa-dollar:before,.fa-usd:before{content:""}.fa-inr:before,.fa-rupee:before{content:""}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:""}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:""}.fa-krw:before,.fa-won:before{content:""}.fa-bitcoin:before,.fa-btc:before{content:""}.fa-file:before{content:""}.fa-file-text:before{content:""}.fa-sort-alpha-asc:before{content:""}.fa-sort-alpha-desc:before{content:""}.fa-sort-amount-asc:before{content:""}.fa-sort-amount-desc:before{content:""}.fa-sort-numeric-asc:before{content:""}.fa-sort-numeric-desc:before{content:""}.fa-thumbs-up:before{content:""}.fa-thumbs-down:before{content:""}.fa-youtube-square:before{content:""}.fa-youtube:before{content:""}.fa-xing:before{content:""}.fa-xing-square:before{content:""}.fa-youtube-play:before{content:""}.fa-dropbox:before{content:""}.fa-stack-overflow:before{content:""}.fa-instagram:before{content:""}.fa-flickr:before{content:""}.fa-adn:before{content:""}.fa-bitbucket:before,.icon-bitbucket:before{content:""}.fa-bitbucket-square:before{content:""}.fa-tumblr:before{content:""}.fa-tumblr-square:before{content:""}.fa-long-arrow-down:before{content:""}.fa-long-arrow-up:before{content:""}.fa-long-arrow-left:before{content:""}.fa-long-arrow-right:before{content:""}.fa-apple:before{content:""}.fa-windows:before{content:""}.fa-android:before{content:""}.fa-linux:before{content:""}.fa-dribbble:before{content:""}.fa-skype:before{content:""}.fa-foursquare:before{content:""}.fa-trello:before{content:""}.fa-female:before{content:""}.fa-male:before{content:""}.fa-gittip:before,.fa-gratipay:before{content:""}.fa-sun-o:before{content:""}.fa-moon-o:before{content:""}.fa-archive:before{content:""}.fa-bug:before{content:""}.fa-vk:before{content:""}.fa-weibo:before{content:""}.fa-renren:before{content:""}.fa-pagelines:before{content:""}.fa-stack-exchange:before{content:""}.fa-arrow-circle-o-right:before{content:""}.fa-arrow-circle-o-left:before{content:""}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:""}.fa-dot-circle-o:before{content:""}.fa-wheelchair:before{content:""}.fa-vimeo-square:before{content:""}.fa-try:before,.fa-turkish-lira:before{content:""}.fa-plus-square-o:before,.wy-menu-vertical li button.toctree-expand:before{content:""}.fa-space-shuttle:before{content:""}.fa-slack:before{content:""}.fa-envelope-square:before{content:""}.fa-wordpress:before{content:""}.fa-openid:before{content:""}.fa-bank:before,.fa-institution:before,.fa-university:before{content:""}.fa-graduation-cap:before,.fa-mortar-board:before{content:""}.fa-yahoo:before{content:""}.fa-google:before{content:""}.fa-reddit:before{content:""}.fa-reddit-square:before{content:""}.fa-stumbleupon-circle:before{content:""}.fa-stumbleupon:before{content:""}.fa-delicious:before{content:""}.fa-digg:before{content:""}.fa-pied-piper-pp:before{content:""}.fa-pied-piper-alt:before{content:""}.fa-drupal:before{content:""}.fa-joomla:before{content:""}.fa-language:before{content:""}.fa-fax:before{content:""}.fa-building:before{content:""}.fa-child:before{content:""}.fa-paw:before{content:""}.fa-spoon:before{content:""}.fa-cube:before{content:""}.fa-cubes:before{content:""}.fa-behance:before{content:""}.fa-behance-square:before{content:""}.fa-steam:before{content:""}.fa-steam-square:before{content:""}.fa-recycle:before{content:""}.fa-automobile:before,.fa-car:before{content:""}.fa-cab:before,.fa-taxi:before{content:""}.fa-tree:before{content:""}.fa-spotify:before{content:""}.fa-deviantart:before{content:""}.fa-soundcloud:before{content:""}.fa-database:before{content:""}.fa-file-pdf-o:before{content:""}.fa-file-word-o:before{content:""}.fa-file-excel-o:before{content:""}.fa-file-powerpoint-o:before{content:""}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:""}.fa-file-archive-o:before,.fa-file-zip-o:before{content:""}.fa-file-audio-o:before,.fa-file-sound-o:before{content:""}.fa-file-movie-o:before,.fa-file-video-o:before{content:""}.fa-file-code-o:before{content:""}.fa-vine:before{content:""}.fa-codepen:before{content:""}.fa-jsfiddle:before{content:""}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:""}.fa-circle-o-notch:before{content:""}.fa-ra:before,.fa-rebel:before,.fa-resistance:before{content:""}.fa-empire:before,.fa-ge:before{content:""}.fa-git-square:before{content:""}.fa-git:before{content:""}.fa-hacker-news:before,.fa-y-combinator-square:before,.fa-yc-square:before{content:""}.fa-tencent-weibo:before{content:""}.fa-qq:before{content:""}.fa-wechat:before,.fa-weixin:before{content:""}.fa-paper-plane:before,.fa-send:before{content:""}.fa-paper-plane-o:before,.fa-send-o:before{content:""}.fa-history:before{content:""}.fa-circle-thin:before{content:""}.fa-header:before{content:""}.fa-paragraph:before{content:""}.fa-sliders:before{content:""}.fa-share-alt:before{content:""}.fa-share-alt-square:before{content:""}.fa-bomb:before{content:""}.fa-futbol-o:before,.fa-soccer-ball-o:before{content:""}.fa-tty:before{content:""}.fa-binoculars:before{content:""}.fa-plug:before{content:""}.fa-slideshare:before{content:""}.fa-twitch:before{content:""}.fa-yelp:before{content:""}.fa-newspaper-o:before{content:""}.fa-wifi:before{content:""}.fa-calculator:before{content:""}.fa-paypal:before{content:""}.fa-google-wallet:before{content:""}.fa-cc-visa:before{content:""}.fa-cc-mastercard:before{content:""}.fa-cc-discover:before{content:""}.fa-cc-amex:before{content:""}.fa-cc-paypal:before{content:""}.fa-cc-stripe:before{content:""}.fa-bell-slash:before{content:""}.fa-bell-slash-o:before{content:""}.fa-trash:before{content:""}.fa-copyright:before{content:""}.fa-at:before{content:""}.fa-eyedropper:before{content:""}.fa-paint-brush:before{content:""}.fa-birthday-cake:before{content:""}.fa-area-chart:before{content:""}.fa-pie-chart:before{content:""}.fa-line-chart:before{content:""}.fa-lastfm:before{content:""}.fa-lastfm-square:before{content:""}.fa-toggle-off:before{content:""}.fa-toggle-on:before{content:""}.fa-bicycle:before{content:""}.fa-bus:before{content:""}.fa-ioxhost:before{content:""}.fa-angellist:before{content:""}.fa-cc:before{content:""}.fa-ils:before,.fa-shekel:before,.fa-sheqel:before{content:""}.fa-meanpath:before{content:""}.fa-buysellads:before{content:""}.fa-connectdevelop:before{content:""}.fa-dashcube:before{content:""}.fa-forumbee:before{content:""}.fa-leanpub:before{content:""}.fa-sellsy:before{content:""}.fa-shirtsinbulk:before{content:""}.fa-simplybuilt:before{content:""}.fa-skyatlas:before{content:""}.fa-cart-plus:before{content:""}.fa-cart-arrow-down:before{content:""}.fa-diamond:before{content:""}.fa-ship:before{content:""}.fa-user-secret:before{content:""}.fa-motorcycle:before{content:""}.fa-street-view:before{content:""}.fa-heartbeat:before{content:""}.fa-venus:before{content:""}.fa-mars:before{content:""}.fa-mercury:before{content:""}.fa-intersex:before,.fa-transgender:before{content:""}.fa-transgender-alt:before{content:""}.fa-venus-double:before{content:""}.fa-mars-double:before{content:""}.fa-venus-mars:before{content:""}.fa-mars-stroke:before{content:""}.fa-mars-stroke-v:before{content:""}.fa-mars-stroke-h:before{content:""}.fa-neuter:before{content:""}.fa-genderless:before{content:""}.fa-facebook-official:before{content:""}.fa-pinterest-p:before{content:""}.fa-whatsapp:before{content:""}.fa-server:before{content:""}.fa-user-plus:before{content:""}.fa-user-times:before{content:""}.fa-bed:before,.fa-hotel:before{content:""}.fa-viacoin:before{content:""}.fa-train:before{content:""}.fa-subway:before{content:""}.fa-medium:before{content:""}.fa-y-combinator:before,.fa-yc:before{content:""}.fa-optin-monster:before{content:""}.fa-opencart:before{content:""}.fa-expeditedssl:before{content:""}.fa-battery-4:before,.fa-battery-full:before,.fa-battery:before{content:""}.fa-battery-3:before,.fa-battery-three-quarters:before{content:""}.fa-battery-2:before,.fa-battery-half:before{content:""}.fa-battery-1:before,.fa-battery-quarter:before{content:""}.fa-battery-0:before,.fa-battery-empty:before{content:""}.fa-mouse-pointer:before{content:""}.fa-i-cursor:before{content:""}.fa-object-group:before{content:""}.fa-object-ungroup:before{content:""}.fa-sticky-note:before{content:""}.fa-sticky-note-o:before{content:""}.fa-cc-jcb:before{content:""}.fa-cc-diners-club:before{content:""}.fa-clone:before{content:""}.fa-balance-scale:before{content:""}.fa-hourglass-o:before{content:""}.fa-hourglass-1:before,.fa-hourglass-start:before{content:""}.fa-hourglass-2:before,.fa-hourglass-half:before{content:""}.fa-hourglass-3:before,.fa-hourglass-end:before{content:""}.fa-hourglass:before{content:""}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:""}.fa-hand-paper-o:before,.fa-hand-stop-o:before{content:""}.fa-hand-scissors-o:before{content:""}.fa-hand-lizard-o:before{content:""}.fa-hand-spock-o:before{content:""}.fa-hand-pointer-o:before{content:""}.fa-hand-peace-o:before{content:""}.fa-trademark:before{content:""}.fa-registered:before{content:""}.fa-creative-commons:before{content:""}.fa-gg:before{content:""}.fa-gg-circle:before{content:""}.fa-tripadvisor:before{content:""}.fa-odnoklassniki:before{content:""}.fa-odnoklassniki-square:before{content:""}.fa-get-pocket:before{content:""}.fa-wikipedia-w:before{content:""}.fa-safari:before{content:""}.fa-chrome:before{content:""}.fa-firefox:before{content:""}.fa-opera:before{content:""}.fa-internet-explorer:before{content:""}.fa-television:before,.fa-tv:before{content:""}.fa-contao:before{content:""}.fa-500px:before{content:""}.fa-amazon:before{content:""}.fa-calendar-plus-o:before{content:""}.fa-calendar-minus-o:before{content:""}.fa-calendar-times-o:before{content:""}.fa-calendar-check-o:before{content:""}.fa-industry:before{content:""}.fa-map-pin:before{content:""}.fa-map-signs:before{content:""}.fa-map-o:before{content:""}.fa-map:before{content:""}.fa-commenting:before{content:""}.fa-commenting-o:before{content:""}.fa-houzz:before{content:""}.fa-vimeo:before{content:""}.fa-black-tie:before{content:""}.fa-fonticons:before{content:""}.fa-reddit-alien:before{content:""}.fa-edge:before{content:""}.fa-credit-card-alt:before{content:""}.fa-codiepie:before{content:""}.fa-modx:before{content:""}.fa-fort-awesome:before{content:""}.fa-usb:before{content:""}.fa-product-hunt:before{content:""}.fa-mixcloud:before{content:""}.fa-scribd:before{content:""}.fa-pause-circle:before{content:""}.fa-pause-circle-o:before{content:""}.fa-stop-circle:before{content:""}.fa-stop-circle-o:before{content:""}.fa-shopping-bag:before{content:""}.fa-shopping-basket:before{content:""}.fa-hashtag:before{content:""}.fa-bluetooth:before{content:""}.fa-bluetooth-b:before{content:""}.fa-percent:before{content:""}.fa-gitlab:before,.icon-gitlab:before{content:""}.fa-wpbeginner:before{content:""}.fa-wpforms:before{content:""}.fa-envira:before{content:""}.fa-universal-access:before{content:""}.fa-wheelchair-alt:before{content:""}.fa-question-circle-o:before{content:""}.fa-blind:before{content:""}.fa-audio-description:before{content:""}.fa-volume-control-phone:before{content:""}.fa-braille:before{content:""}.fa-assistive-listening-systems:before{content:""}.fa-american-sign-language-interpreting:before,.fa-asl-interpreting:before{content:""}.fa-deaf:before,.fa-deafness:before,.fa-hard-of-hearing:before{content:""}.fa-glide:before{content:""}.fa-glide-g:before{content:""}.fa-sign-language:before,.fa-signing:before{content:""}.fa-low-vision:before{content:""}.fa-viadeo:before{content:""}.fa-viadeo-square:before{content:""}.fa-snapchat:before{content:""}.fa-snapchat-ghost:before{content:""}.fa-snapchat-square:before{content:""}.fa-pied-piper:before{content:""}.fa-first-order:before{content:""}.fa-yoast:before{content:""}.fa-themeisle:before{content:""}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:""}.fa-fa:before,.fa-font-awesome:before{content:""}.fa-handshake-o:before{content:""}.fa-envelope-open:before{content:""}.fa-envelope-open-o:before{content:""}.fa-linode:before{content:""}.fa-address-book:before{content:""}.fa-address-book-o:before{content:""}.fa-address-card:before,.fa-vcard:before{content:""}.fa-address-card-o:before,.fa-vcard-o:before{content:""}.fa-user-circle:before{content:""}.fa-user-circle-o:before{content:""}.fa-user-o:before{content:""}.fa-id-badge:before{content:""}.fa-drivers-license:before,.fa-id-card:before{content:""}.fa-drivers-license-o:before,.fa-id-card-o:before{content:""}.fa-quora:before{content:""}.fa-free-code-camp:before{content:""}.fa-telegram:before{content:""}.fa-thermometer-4:before,.fa-thermometer-full:before,.fa-thermometer:before{content:""}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:""}.fa-thermometer-2:before,.fa-thermometer-half:before{content:""}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:""}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:""}.fa-shower:before{content:""}.fa-bath:before,.fa-bathtub:before,.fa-s15:before{content:""}.fa-podcast:before{content:""}.fa-window-maximize:before{content:""}.fa-window-minimize:before{content:""}.fa-window-restore:before{content:""}.fa-times-rectangle:before,.fa-window-close:before{content:""}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:""}.fa-bandcamp:before{content:""}.fa-grav:before{content:""}.fa-etsy:before{content:""}.fa-imdb:before{content:""}.fa-ravelry:before{content:""}.fa-eercast:before{content:""}.fa-microchip:before{content:""}.fa-snowflake-o:before{content:""}.fa-superpowers:before{content:""}.fa-wpexplorer:before{content:""}.fa-meetup:before{content:""}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.fa,.icon,.rst-content .admonition-title,.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content code.download span:first-child,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink,.rst-content tt.download span:first-child,.wy-dropdown .caret,.wy-inline-validate.wy-inline-validate-danger .wy-input-context,.wy-inline-validate.wy-inline-validate-info .wy-input-context,.wy-inline-validate.wy-inline-validate-success .wy-input-context,.wy-inline-validate.wy-inline-validate-warning .wy-input-context,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li button.toctree-expand{font-family:inherit}.fa:before,.icon:before,.rst-content .admonition-title:before,.rst-content .code-block-caption .headerlink:before,.rst-content .eqno .headerlink:before,.rst-content code.download span:first-child:before,.rst-content dl dt .headerlink:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content p .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content tt.download span:first-child:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before,.wy-menu-vertical li button.toctree-expand:before{font-family:FontAwesome;display:inline-block;font-style:normal;font-weight:400;line-height:1;text-decoration:inherit}.rst-content .code-block-caption a .headerlink,.rst-content .eqno a .headerlink,.rst-content a .admonition-title,.rst-content code.download a span:first-child,.rst-content dl dt a .headerlink,.rst-content h1 a .headerlink,.rst-content h2 a .headerlink,.rst-content h3 a .headerlink,.rst-content h4 a .headerlink,.rst-content h5 a .headerlink,.rst-content h6 a .headerlink,.rst-content p.caption a .headerlink,.rst-content p a .headerlink,.rst-content table>caption a .headerlink,.rst-content tt.download a span:first-child,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li a button.toctree-expand,a .fa,a .icon,a .rst-content .admonition-title,a .rst-content .code-block-caption .headerlink,a .rst-content .eqno .headerlink,a .rst-content code.download span:first-child,a .rst-content dl dt .headerlink,a .rst-content h1 .headerlink,a .rst-content h2 .headerlink,a .rst-content h3 .headerlink,a .rst-content h4 .headerlink,a .rst-content h5 .headerlink,a .rst-content h6 .headerlink,a .rst-content p.caption .headerlink,a .rst-content p .headerlink,a .rst-content table>caption .headerlink,a .rst-content tt.download span:first-child,a .wy-menu-vertical li button.toctree-expand{display:inline-block;text-decoration:inherit}.btn .fa,.btn .icon,.btn .rst-content .admonition-title,.btn .rst-content .code-block-caption .headerlink,.btn .rst-content .eqno .headerlink,.btn .rst-content code.download span:first-child,.btn .rst-content dl dt .headerlink,.btn .rst-content h1 .headerlink,.btn .rst-content h2 .headerlink,.btn .rst-content h3 .headerlink,.btn .rst-content h4 .headerlink,.btn .rst-content h5 .headerlink,.btn .rst-content h6 .headerlink,.btn .rst-content p .headerlink,.btn .rst-content table>caption .headerlink,.btn .rst-content tt.download span:first-child,.btn .wy-menu-vertical li.current>a button.toctree-expand,.btn .wy-menu-vertical li.on a button.toctree-expand,.btn .wy-menu-vertical li button.toctree-expand,.nav .fa,.nav .icon,.nav .rst-content .admonition-title,.nav .rst-content .code-block-caption .headerlink,.nav .rst-content .eqno .headerlink,.nav .rst-content code.download span:first-child,.nav .rst-content dl dt .headerlink,.nav .rst-content h1 .headerlink,.nav .rst-content h2 .headerlink,.nav .rst-content h3 .headerlink,.nav .rst-content h4 .headerlink,.nav .rst-content h5 .headerlink,.nav .rst-content h6 .headerlink,.nav .rst-content p .headerlink,.nav .rst-content table>caption .headerlink,.nav .rst-content tt.download span:first-child,.nav .wy-menu-vertical li.current>a button.toctree-expand,.nav .wy-menu-vertical li.on a button.toctree-expand,.nav .wy-menu-vertical li button.toctree-expand,.rst-content .btn .admonition-title,.rst-content .code-block-caption .btn .headerlink,.rst-content .code-block-caption .nav .headerlink,.rst-content .eqno .btn .headerlink,.rst-content .eqno .nav .headerlink,.rst-content .nav .admonition-title,.rst-content code.download .btn span:first-child,.rst-content code.download .nav span:first-child,.rst-content dl dt .btn .headerlink,.rst-content dl dt .nav .headerlink,.rst-content h1 .btn .headerlink,.rst-content h1 .nav .headerlink,.rst-content h2 .btn .headerlink,.rst-content h2 .nav .headerlink,.rst-content h3 .btn .headerlink,.rst-content h3 .nav .headerlink,.rst-content h4 .btn .headerlink,.rst-content h4 .nav .headerlink,.rst-content h5 .btn .headerlink,.rst-content h5 .nav .headerlink,.rst-content h6 .btn .headerlink,.rst-content h6 .nav .headerlink,.rst-content p .btn .headerlink,.rst-content p .nav .headerlink,.rst-content table>caption .btn .headerlink,.rst-content table>caption .nav .headerlink,.rst-content tt.download .btn span:first-child,.rst-content tt.download .nav span:first-child,.wy-menu-vertical li .btn button.toctree-expand,.wy-menu-vertical li.current>a .btn button.toctree-expand,.wy-menu-vertical li.current>a .nav button.toctree-expand,.wy-menu-vertical li .nav button.toctree-expand,.wy-menu-vertical li.on a .btn button.toctree-expand,.wy-menu-vertical li.on a .nav button.toctree-expand{display:inline}.btn .fa-large.icon,.btn .fa.fa-large,.btn .rst-content .code-block-caption .fa-large.headerlink,.btn .rst-content .eqno .fa-large.headerlink,.btn .rst-content .fa-large.admonition-title,.btn .rst-content code.download span.fa-large:first-child,.btn .rst-content dl dt .fa-large.headerlink,.btn .rst-content h1 .fa-large.headerlink,.btn .rst-content h2 .fa-large.headerlink,.btn .rst-content h3 .fa-large.headerlink,.btn .rst-content h4 .fa-large.headerlink,.btn .rst-content h5 .fa-large.headerlink,.btn .rst-content h6 .fa-large.headerlink,.btn .rst-content p .fa-large.headerlink,.btn .rst-content table>caption .fa-large.headerlink,.btn .rst-content tt.download span.fa-large:first-child,.btn .wy-menu-vertical li button.fa-large.toctree-expand,.nav .fa-large.icon,.nav .fa.fa-large,.nav .rst-content .code-block-caption .fa-large.headerlink,.nav .rst-content .eqno .fa-large.headerlink,.nav .rst-content .fa-large.admonition-title,.nav .rst-content code.download span.fa-large:first-child,.nav .rst-content dl dt .fa-large.headerlink,.nav .rst-content h1 .fa-large.headerlink,.nav .rst-content h2 .fa-large.headerlink,.nav .rst-content h3 .fa-large.headerlink,.nav .rst-content h4 .fa-large.headerlink,.nav .rst-content h5 .fa-large.headerlink,.nav .rst-content h6 .fa-large.headerlink,.nav .rst-content p .fa-large.headerlink,.nav .rst-content table>caption .fa-large.headerlink,.nav .rst-content tt.download span.fa-large:first-child,.nav .wy-menu-vertical li button.fa-large.toctree-expand,.rst-content .btn .fa-large.admonition-title,.rst-content .code-block-caption .btn .fa-large.headerlink,.rst-content .code-block-caption .nav .fa-large.headerlink,.rst-content .eqno .btn .fa-large.headerlink,.rst-content .eqno .nav .fa-large.headerlink,.rst-content .nav .fa-large.admonition-title,.rst-content code.download .btn span.fa-large:first-child,.rst-content code.download .nav span.fa-large:first-child,.rst-content dl dt .btn .fa-large.headerlink,.rst-content dl dt .nav .fa-large.headerlink,.rst-content h1 .btn .fa-large.headerlink,.rst-content h1 .nav .fa-large.headerlink,.rst-content h2 .btn .fa-large.headerlink,.rst-content h2 .nav .fa-large.headerlink,.rst-content h3 .btn .fa-large.headerlink,.rst-content h3 .nav .fa-large.headerlink,.rst-content h4 .btn .fa-large.headerlink,.rst-content h4 .nav .fa-large.headerlink,.rst-content h5 .btn .fa-large.headerlink,.rst-content h5 .nav .fa-large.headerlink,.rst-content h6 .btn .fa-large.headerlink,.rst-content h6 .nav .fa-large.headerlink,.rst-content p .btn .fa-large.headerlink,.rst-content p .nav .fa-large.headerlink,.rst-content table>caption .btn .fa-large.headerlink,.rst-content table>caption .nav .fa-large.headerlink,.rst-content tt.download .btn span.fa-large:first-child,.rst-content tt.download .nav span.fa-large:first-child,.wy-menu-vertical li .btn button.fa-large.toctree-expand,.wy-menu-vertical li .nav button.fa-large.toctree-expand{line-height:.9em}.btn .fa-spin.icon,.btn .fa.fa-spin,.btn .rst-content .code-block-caption .fa-spin.headerlink,.btn .rst-content .eqno .fa-spin.headerlink,.btn .rst-content .fa-spin.admonition-title,.btn .rst-content code.download span.fa-spin:first-child,.btn .rst-content dl dt .fa-spin.headerlink,.btn .rst-content h1 .fa-spin.headerlink,.btn .rst-content h2 .fa-spin.headerlink,.btn .rst-content h3 .fa-spin.headerlink,.btn .rst-content h4 .fa-spin.headerlink,.btn .rst-content h5 .fa-spin.headerlink,.btn .rst-content h6 .fa-spin.headerlink,.btn .rst-content p .fa-spin.headerlink,.btn .rst-content table>caption .fa-spin.headerlink,.btn .rst-content tt.download span.fa-spin:first-child,.btn .wy-menu-vertical li button.fa-spin.toctree-expand,.nav .fa-spin.icon,.nav .fa.fa-spin,.nav .rst-content .code-block-caption .fa-spin.headerlink,.nav .rst-content .eqno .fa-spin.headerlink,.nav .rst-content .fa-spin.admonition-title,.nav .rst-content code.download span.fa-spin:first-child,.nav .rst-content dl dt .fa-spin.headerlink,.nav .rst-content h1 .fa-spin.headerlink,.nav .rst-content h2 .fa-spin.headerlink,.nav .rst-content h3 .fa-spin.headerlink,.nav .rst-content h4 .fa-spin.headerlink,.nav .rst-content h5 .fa-spin.headerlink,.nav .rst-content h6 .fa-spin.headerlink,.nav .rst-content p .fa-spin.headerlink,.nav .rst-content table>caption .fa-spin.headerlink,.nav .rst-content tt.download span.fa-spin:first-child,.nav .wy-menu-vertical li button.fa-spin.toctree-expand,.rst-content .btn .fa-spin.admonition-title,.rst-content .code-block-caption .btn .fa-spin.headerlink,.rst-content .code-block-caption .nav .fa-spin.headerlink,.rst-content .eqno .btn .fa-spin.headerlink,.rst-content .eqno .nav .fa-spin.headerlink,.rst-content .nav .fa-spin.admonition-title,.rst-content code.download .btn span.fa-spin:first-child,.rst-content code.download .nav span.fa-spin:first-child,.rst-content dl dt .btn .fa-spin.headerlink,.rst-content dl dt .nav .fa-spin.headerlink,.rst-content h1 .btn .fa-spin.headerlink,.rst-content h1 .nav .fa-spin.headerlink,.rst-content h2 .btn .fa-spin.headerlink,.rst-content h2 .nav .fa-spin.headerlink,.rst-content h3 .btn .fa-spin.headerlink,.rst-content h3 .nav .fa-spin.headerlink,.rst-content h4 .btn .fa-spin.headerlink,.rst-content h4 .nav .fa-spin.headerlink,.rst-content h5 .btn .fa-spin.headerlink,.rst-content h5 .nav .fa-spin.headerlink,.rst-content h6 .btn .fa-spin.headerlink,.rst-content h6 .nav .fa-spin.headerlink,.rst-content p .btn .fa-spin.headerlink,.rst-content p .nav .fa-spin.headerlink,.rst-content table>caption .btn .fa-spin.headerlink,.rst-content table>caption .nav .fa-spin.headerlink,.rst-content tt.download .btn span.fa-spin:first-child,.rst-content tt.download .nav span.fa-spin:first-child,.wy-menu-vertical li .btn button.fa-spin.toctree-expand,.wy-menu-vertical li .nav button.fa-spin.toctree-expand{display:inline-block}.btn.fa:before,.btn.icon:before,.rst-content .btn.admonition-title:before,.rst-content .code-block-caption .btn.headerlink:before,.rst-content .eqno .btn.headerlink:before,.rst-content code.download span.btn:first-child:before,.rst-content dl dt .btn.headerlink:before,.rst-content h1 .btn.headerlink:before,.rst-content h2 .btn.headerlink:before,.rst-content h3 .btn.headerlink:before,.rst-content h4 .btn.headerlink:before,.rst-content h5 .btn.headerlink:before,.rst-content h6 .btn.headerlink:before,.rst-content p .btn.headerlink:before,.rst-content table>caption .btn.headerlink:before,.rst-content tt.download span.btn:first-child:before,.wy-menu-vertical li button.btn.toctree-expand:before{opacity:.5;-webkit-transition:opacity .05s ease-in;-moz-transition:opacity .05s ease-in;transition:opacity .05s ease-in}.btn.fa:hover:before,.btn.icon:hover:before,.rst-content .btn.admonition-title:hover:before,.rst-content .code-block-caption .btn.headerlink:hover:before,.rst-content .eqno .btn.headerlink:hover:before,.rst-content code.download span.btn:first-child:hover:before,.rst-content dl dt .btn.headerlink:hover:before,.rst-content h1 .btn.headerlink:hover:before,.rst-content h2 .btn.headerlink:hover:before,.rst-content h3 .btn.headerlink:hover:before,.rst-content h4 .btn.headerlink:hover:before,.rst-content h5 .btn.headerlink:hover:before,.rst-content h6 .btn.headerlink:hover:before,.rst-content p .btn.headerlink:hover:before,.rst-content table>caption .btn.headerlink:hover:before,.rst-content tt.download span.btn:first-child:hover:before,.wy-menu-vertical li button.btn.toctree-expand:hover:before{opacity:1}.btn-mini .fa:before,.btn-mini .icon:before,.btn-mini .rst-content .admonition-title:before,.btn-mini .rst-content .code-block-caption .headerlink:before,.btn-mini .rst-content .eqno .headerlink:before,.btn-mini .rst-content code.download span:first-child:before,.btn-mini .rst-content dl dt .headerlink:before,.btn-mini .rst-content h1 .headerlink:before,.btn-mini .rst-content h2 .headerlink:before,.btn-mini .rst-content h3 .headerlink:before,.btn-mini .rst-content h4 .headerlink:before,.btn-mini .rst-content h5 .headerlink:before,.btn-mini .rst-content h6 .headerlink:before,.btn-mini .rst-content p .headerlink:before,.btn-mini .rst-content table>caption .headerlink:before,.btn-mini .rst-content tt.download span:first-child:before,.btn-mini .wy-menu-vertical li button.toctree-expand:before,.rst-content .btn-mini .admonition-title:before,.rst-content .code-block-caption .btn-mini .headerlink:before,.rst-content .eqno .btn-mini .headerlink:before,.rst-content code.download .btn-mini span:first-child:before,.rst-content dl dt .btn-mini .headerlink:before,.rst-content h1 .btn-mini .headerlink:before,.rst-content h2 .btn-mini .headerlink:before,.rst-content h3 .btn-mini .headerlink:before,.rst-content h4 .btn-mini .headerlink:before,.rst-content h5 .btn-mini .headerlink:before,.rst-content h6 .btn-mini .headerlink:before,.rst-content p .btn-mini .headerlink:before,.rst-content table>caption .btn-mini .headerlink:before,.rst-content tt.download .btn-mini span:first-child:before,.wy-menu-vertical li .btn-mini button.toctree-expand:before{font-size:14px;vertical-align:-15%}.rst-content .admonition,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning,.wy-alert{padding:12px;line-height:24px;margin-bottom:24px;background:#e7f2fa}.rst-content .admonition-title,.wy-alert-title{font-weight:700;display:block;color:#fff;background:#6ab0de;padding:6px 12px;margin:-12px -12px 12px}.rst-content .danger,.rst-content .error,.rst-content .wy-alert-danger.admonition,.rst-content .wy-alert-danger.admonition-todo,.rst-content .wy-alert-danger.attention,.rst-content .wy-alert-danger.caution,.rst-content .wy-alert-danger.hint,.rst-content .wy-alert-danger.important,.rst-content .wy-alert-danger.note,.rst-content .wy-alert-danger.seealso,.rst-content .wy-alert-danger.tip,.rst-content .wy-alert-danger.warning,.wy-alert.wy-alert-danger{background:#fdf3f2}.rst-content .danger .admonition-title,.rst-content .danger .wy-alert-title,.rst-content .error .admonition-title,.rst-content .error .wy-alert-title,.rst-content .wy-alert-danger.admonition-todo .admonition-title,.rst-content .wy-alert-danger.admonition-todo .wy-alert-title,.rst-content .wy-alert-danger.admonition .admonition-title,.rst-content .wy-alert-danger.admonition .wy-alert-title,.rst-content .wy-alert-danger.attention .admonition-title,.rst-content .wy-alert-danger.attention .wy-alert-title,.rst-content .wy-alert-danger.caution .admonition-title,.rst-content .wy-alert-danger.caution .wy-alert-title,.rst-content .wy-alert-danger.hint .admonition-title,.rst-content .wy-alert-danger.hint .wy-alert-title,.rst-content .wy-alert-danger.important .admonition-title,.rst-content .wy-alert-danger.important .wy-alert-title,.rst-content .wy-alert-danger.note .admonition-title,.rst-content .wy-alert-danger.note .wy-alert-title,.rst-content .wy-alert-danger.seealso .admonition-title,.rst-content .wy-alert-danger.seealso .wy-alert-title,.rst-content .wy-alert-danger.tip .admonition-title,.rst-content .wy-alert-danger.tip .wy-alert-title,.rst-content .wy-alert-danger.warning .admonition-title,.rst-content .wy-alert-danger.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-danger .admonition-title,.wy-alert.wy-alert-danger .rst-content .admonition-title,.wy-alert.wy-alert-danger .wy-alert-title{background:#f29f97}.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .warning,.rst-content .wy-alert-warning.admonition,.rst-content .wy-alert-warning.danger,.rst-content .wy-alert-warning.error,.rst-content .wy-alert-warning.hint,.rst-content .wy-alert-warning.important,.rst-content .wy-alert-warning.note,.rst-content .wy-alert-warning.seealso,.rst-content .wy-alert-warning.tip,.wy-alert.wy-alert-warning{background:#ffedcc}.rst-content .admonition-todo .admonition-title,.rst-content .admonition-todo .wy-alert-title,.rst-content .attention .admonition-title,.rst-content .attention .wy-alert-title,.rst-content .caution .admonition-title,.rst-content .caution .wy-alert-title,.rst-content .warning .admonition-title,.rst-content .warning .wy-alert-title,.rst-content .wy-alert-warning.admonition .admonition-title,.rst-content .wy-alert-warning.admonition .wy-alert-title,.rst-content .wy-alert-warning.danger .admonition-title,.rst-content .wy-alert-warning.danger .wy-alert-title,.rst-content .wy-alert-warning.error .admonition-title,.rst-content .wy-alert-warning.error .wy-alert-title,.rst-content .wy-alert-warning.hint .admonition-title,.rst-content .wy-alert-warning.hint .wy-alert-title,.rst-content .wy-alert-warning.important .admonition-title,.rst-content .wy-alert-warning.important .wy-alert-title,.rst-content .wy-alert-warning.note .admonition-title,.rst-content .wy-alert-warning.note .wy-alert-title,.rst-content .wy-alert-warning.seealso .admonition-title,.rst-content .wy-alert-warning.seealso .wy-alert-title,.rst-content .wy-alert-warning.tip .admonition-title,.rst-content .wy-alert-warning.tip .wy-alert-title,.rst-content .wy-alert.wy-alert-warning .admonition-title,.wy-alert.wy-alert-warning .rst-content .admonition-title,.wy-alert.wy-alert-warning .wy-alert-title{background:#f0b37e}.rst-content .note,.rst-content .seealso,.rst-content .wy-alert-info.admonition,.rst-content .wy-alert-info.admonition-todo,.rst-content .wy-alert-info.attention,.rst-content .wy-alert-info.caution,.rst-content .wy-alert-info.danger,.rst-content .wy-alert-info.error,.rst-content .wy-alert-info.hint,.rst-content .wy-alert-info.important,.rst-content .wy-alert-info.tip,.rst-content .wy-alert-info.warning,.wy-alert.wy-alert-info{background:#e7f2fa}.rst-content .note .admonition-title,.rst-content .note .wy-alert-title,.rst-content .seealso .admonition-title,.rst-content .seealso .wy-alert-title,.rst-content .wy-alert-info.admonition-todo .admonition-title,.rst-content .wy-alert-info.admonition-todo .wy-alert-title,.rst-content .wy-alert-info.admonition .admonition-title,.rst-content .wy-alert-info.admonition .wy-alert-title,.rst-content .wy-alert-info.attention .admonition-title,.rst-content .wy-alert-info.attention .wy-alert-title,.rst-content .wy-alert-info.caution .admonition-title,.rst-content .wy-alert-info.caution .wy-alert-title,.rst-content .wy-alert-info.danger .admonition-title,.rst-content .wy-alert-info.danger .wy-alert-title,.rst-content .wy-alert-info.error .admonition-title,.rst-content .wy-alert-info.error .wy-alert-title,.rst-content .wy-alert-info.hint .admonition-title,.rst-content .wy-alert-info.hint .wy-alert-title,.rst-content .wy-alert-info.important .admonition-title,.rst-content .wy-alert-info.important .wy-alert-title,.rst-content .wy-alert-info.tip .admonition-title,.rst-content .wy-alert-info.tip .wy-alert-title,.rst-content .wy-alert-info.warning .admonition-title,.rst-content .wy-alert-info.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-info .admonition-title,.wy-alert.wy-alert-info .rst-content .admonition-title,.wy-alert.wy-alert-info .wy-alert-title{background:#6ab0de}.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .wy-alert-success.admonition,.rst-content .wy-alert-success.admonition-todo,.rst-content .wy-alert-success.attention,.rst-content .wy-alert-success.caution,.rst-content .wy-alert-success.danger,.rst-content .wy-alert-success.error,.rst-content .wy-alert-success.note,.rst-content .wy-alert-success.seealso,.rst-content .wy-alert-success.warning,.wy-alert.wy-alert-success{background:#dbfaf4}.rst-content .hint .admonition-title,.rst-content .hint .wy-alert-title,.rst-content .important .admonition-title,.rst-content .important .wy-alert-title,.rst-content .tip .admonition-title,.rst-content .tip .wy-alert-title,.rst-content .wy-alert-success.admonition-todo .admonition-title,.rst-content .wy-alert-success.admonition-todo .wy-alert-title,.rst-content .wy-alert-success.admonition .admonition-title,.rst-content .wy-alert-success.admonition .wy-alert-title,.rst-content .wy-alert-success.attention .admonition-title,.rst-content .wy-alert-success.attention .wy-alert-title,.rst-content .wy-alert-success.caution .admonition-title,.rst-content .wy-alert-success.caution .wy-alert-title,.rst-content .wy-alert-success.danger .admonition-title,.rst-content .wy-alert-success.danger .wy-alert-title,.rst-content .wy-alert-success.error .admonition-title,.rst-content .wy-alert-success.error .wy-alert-title,.rst-content .wy-alert-success.note .admonition-title,.rst-content .wy-alert-success.note .wy-alert-title,.rst-content .wy-alert-success.seealso .admonition-title,.rst-content .wy-alert-success.seealso .wy-alert-title,.rst-content .wy-alert-success.warning .admonition-title,.rst-content .wy-alert-success.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-success .admonition-title,.wy-alert.wy-alert-success .rst-content .admonition-title,.wy-alert.wy-alert-success .wy-alert-title{background:#1abc9c}.rst-content .wy-alert-neutral.admonition,.rst-content .wy-alert-neutral.admonition-todo,.rst-content .wy-alert-neutral.attention,.rst-content .wy-alert-neutral.caution,.rst-content .wy-alert-neutral.danger,.rst-content .wy-alert-neutral.error,.rst-content .wy-alert-neutral.hint,.rst-content .wy-alert-neutral.important,.rst-content .wy-alert-neutral.note,.rst-content .wy-alert-neutral.seealso,.rst-content .wy-alert-neutral.tip,.rst-content .wy-alert-neutral.warning,.wy-alert.wy-alert-neutral{background:#f3f6f6}.rst-content .wy-alert-neutral.admonition-todo .admonition-title,.rst-content .wy-alert-neutral.admonition-todo .wy-alert-title,.rst-content .wy-alert-neutral.admonition .admonition-title,.rst-content .wy-alert-neutral.admonition .wy-alert-title,.rst-content .wy-alert-neutral.attention .admonition-title,.rst-content .wy-alert-neutral.attention .wy-alert-title,.rst-content .wy-alert-neutral.caution .admonition-title,.rst-content .wy-alert-neutral.caution .wy-alert-title,.rst-content .wy-alert-neutral.danger .admonition-title,.rst-content .wy-alert-neutral.danger .wy-alert-title,.rst-content .wy-alert-neutral.error .admonition-title,.rst-content .wy-alert-neutral.error .wy-alert-title,.rst-content .wy-alert-neutral.hint .admonition-title,.rst-content .wy-alert-neutral.hint .wy-alert-title,.rst-content .wy-alert-neutral.important .admonition-title,.rst-content .wy-alert-neutral.important .wy-alert-title,.rst-content .wy-alert-neutral.note .admonition-title,.rst-content .wy-alert-neutral.note .wy-alert-title,.rst-content .wy-alert-neutral.seealso .admonition-title,.rst-content .wy-alert-neutral.seealso .wy-alert-title,.rst-content .wy-alert-neutral.tip .admonition-title,.rst-content .wy-alert-neutral.tip .wy-alert-title,.rst-content .wy-alert-neutral.warning .admonition-title,.rst-content .wy-alert-neutral.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-neutral .admonition-title,.wy-alert.wy-alert-neutral .rst-content .admonition-title,.wy-alert.wy-alert-neutral .wy-alert-title{color:#404040;background:#e1e4e5}.rst-content .wy-alert-neutral.admonition-todo a,.rst-content .wy-alert-neutral.admonition a,.rst-content .wy-alert-neutral.attention a,.rst-content .wy-alert-neutral.caution a,.rst-content .wy-alert-neutral.danger a,.rst-content .wy-alert-neutral.error a,.rst-content .wy-alert-neutral.hint a,.rst-content .wy-alert-neutral.important a,.rst-content .wy-alert-neutral.note a,.rst-content .wy-alert-neutral.seealso a,.rst-content .wy-alert-neutral.tip a,.rst-content .wy-alert-neutral.warning a,.wy-alert.wy-alert-neutral a{color:#2980b9}.rst-content .admonition-todo p:last-child,.rst-content .admonition p:last-child,.rst-content .attention p:last-child,.rst-content .caution p:last-child,.rst-content .danger p:last-child,.rst-content .error p:last-child,.rst-content .hint p:last-child,.rst-content .important p:last-child,.rst-content .note p:last-child,.rst-content .seealso p:last-child,.rst-content .tip p:last-child,.rst-content .warning p:last-child,.wy-alert p:last-child{margin-bottom:0}.wy-tray-container{position:fixed;bottom:0;left:0;z-index:600}.wy-tray-container li{display:block;width:300px;background:transparent;color:#fff;text-align:center;box-shadow:0 5px 5px 0 rgba(0,0,0,.1);padding:0 24px;min-width:20%;opacity:0;height:0;line-height:56px;overflow:hidden;-webkit-transition:all .3s ease-in;-moz-transition:all .3s ease-in;transition:all .3s ease-in}.wy-tray-container li.wy-tray-item-success{background:#27ae60}.wy-tray-container li.wy-tray-item-info{background:#2980b9}.wy-tray-container li.wy-tray-item-warning{background:#e67e22}.wy-tray-container li.wy-tray-item-danger{background:#e74c3c}.wy-tray-container li.on{opacity:1;height:56px}@media screen and (max-width:768px){.wy-tray-container{bottom:auto;top:0;width:100%}.wy-tray-container li{width:100%}}button{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;cursor:pointer;line-height:normal;-webkit-appearance:button;*overflow:visible}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}button[disabled]{cursor:default}.btn{display:inline-block;border-radius:2px;line-height:normal;white-space:nowrap;text-align:center;cursor:pointer;font-size:100%;padding:6px 12px 8px;color:#fff;border:1px solid rgba(0,0,0,.1);background-color:#27ae60;text-decoration:none;font-weight:400;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;box-shadow:inset 0 1px 2px -1px hsla(0,0%,100%,.5),inset 0 -2px 0 0 rgba(0,0,0,.1);outline-none:false;vertical-align:middle;*display:inline;zoom:1;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all .1s linear;-moz-transition:all .1s linear;transition:all .1s linear}.btn-hover{background:#2e8ece;color:#fff}.btn:hover{background:#2cc36b;color:#fff}.btn:focus{background:#2cc36b;outline:0}.btn:active{box-shadow:inset 0 -1px 0 0 rgba(0,0,0,.05),inset 0 2px 0 0 rgba(0,0,0,.1);padding:8px 12px 6px}.btn:visited{color:#fff}.btn-disabled,.btn-disabled:active,.btn-disabled:focus,.btn-disabled:hover,.btn:disabled{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:.4;cursor:not-allowed;box-shadow:none}.btn::-moz-focus-inner{padding:0;border:0}.btn-small{font-size:80%}.btn-info{background-color:#2980b9!important}.btn-info:hover{background-color:#2e8ece!important}.btn-neutral{background-color:#f3f6f6!important;color:#404040!important}.btn-neutral:hover{background-color:#e5ebeb!important;color:#404040}.btn-neutral:visited{color:#404040!important}.btn-success{background-color:#27ae60!important}.btn-success:hover{background-color:#295!important}.btn-danger{background-color:#e74c3c!important}.btn-danger:hover{background-color:#ea6153!important}.btn-warning{background-color:#e67e22!important}.btn-warning:hover{background-color:#e98b39!important}.btn-invert{background-color:#222}.btn-invert:hover{background-color:#2f2f2f!important}.btn-link{background-color:transparent!important;color:#2980b9;box-shadow:none;border-color:transparent!important}.btn-link:active,.btn-link:hover{background-color:transparent!important;color:#409ad5!important;box-shadow:none}.btn-link:visited{color:#9b59b6}.wy-btn-group .btn,.wy-control .btn{vertical-align:middle}.wy-btn-group{margin-bottom:24px;*zoom:1}.wy-btn-group:after,.wy-btn-group:before{display:table;content:""}.wy-btn-group:after{clear:both}.wy-dropdown{position:relative;display:inline-block}.wy-dropdown-active .wy-dropdown-menu{display:block}.wy-dropdown-menu{position:absolute;left:0;display:none;float:left;top:100%;min-width:100%;background:#fcfcfc;z-index:100;border:1px solid #cfd7dd;box-shadow:0 2px 2px 0 rgba(0,0,0,.1);padding:12px}.wy-dropdown-menu>dd>a{display:block;clear:both;color:#404040;white-space:nowrap;font-size:90%;padding:0 12px;cursor:pointer}.wy-dropdown-menu>dd>a:hover{background:#2980b9;color:#fff}.wy-dropdown-menu>dd.divider{border-top:1px solid #cfd7dd;margin:6px 0}.wy-dropdown-menu>dd.search{padding-bottom:12px}.wy-dropdown-menu>dd.search input[type=search]{width:100%}.wy-dropdown-menu>dd.call-to-action{background:#e3e3e3;text-transform:uppercase;font-weight:500;font-size:80%}.wy-dropdown-menu>dd.call-to-action:hover{background:#e3e3e3}.wy-dropdown-menu>dd.call-to-action .btn{color:#fff}.wy-dropdown.wy-dropdown-up .wy-dropdown-menu{bottom:100%;top:auto;left:auto;right:0}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu{background:#fcfcfc;margin-top:2px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a{padding:6px 12px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a:hover{background:#2980b9;color:#fff}.wy-dropdown.wy-dropdown-left .wy-dropdown-menu{right:0;left:auto;text-align:right}.wy-dropdown-arrow:before{content:" ";border-bottom:5px solid #f5f5f5;border-left:5px solid transparent;border-right:5px solid transparent;position:absolute;display:block;top:-4px;left:50%;margin-left:-3px}.wy-dropdown-arrow.wy-dropdown-arrow-left:before{left:11px}.wy-form-stacked select{display:block}.wy-form-aligned .wy-help-inline,.wy-form-aligned input,.wy-form-aligned label,.wy-form-aligned select,.wy-form-aligned textarea{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-form-aligned .wy-control-group>label{display:inline-block;vertical-align:middle;width:10em;margin:6px 12px 0 0;float:left}.wy-form-aligned .wy-control{float:left}.wy-form-aligned .wy-control label{display:block}.wy-form-aligned .wy-control select{margin-top:6px}fieldset{margin:0}fieldset,legend{border:0;padding:0}legend{width:100%;white-space:normal;margin-bottom:24px;font-size:150%;*margin-left:-7px}label,legend{display:block}label{margin:0 0 .3125em;color:#333;font-size:90%}input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}.wy-control-group{margin-bottom:24px;max-width:1200px;margin-left:auto;margin-right:auto;*zoom:1}.wy-control-group:after,.wy-control-group:before{display:table;content:""}.wy-control-group:after{clear:both}.wy-control-group.wy-control-group-required>label:after{content:" *";color:#e74c3c}.wy-control-group .wy-form-full,.wy-control-group .wy-form-halves,.wy-control-group .wy-form-thirds{padding-bottom:12px}.wy-control-group .wy-form-full input[type=color],.wy-control-group .wy-form-full input[type=date],.wy-control-group .wy-form-full input[type=datetime-local],.wy-control-group .wy-form-full input[type=datetime],.wy-control-group .wy-form-full input[type=email],.wy-control-group .wy-form-full input[type=month],.wy-control-group .wy-form-full input[type=number],.wy-control-group .wy-form-full input[type=password],.wy-control-group .wy-form-full input[type=search],.wy-control-group .wy-form-full input[type=tel],.wy-control-group .wy-form-full input[type=text],.wy-control-group .wy-form-full input[type=time],.wy-control-group .wy-form-full input[type=url],.wy-control-group .wy-form-full input[type=week],.wy-control-group .wy-form-full select,.wy-control-group .wy-form-halves input[type=color],.wy-control-group .wy-form-halves input[type=date],.wy-control-group .wy-form-halves input[type=datetime-local],.wy-control-group .wy-form-halves input[type=datetime],.wy-control-group .wy-form-halves input[type=email],.wy-control-group .wy-form-halves input[type=month],.wy-control-group .wy-form-halves input[type=number],.wy-control-group .wy-form-halves input[type=password],.wy-control-group .wy-form-halves input[type=search],.wy-control-group .wy-form-halves input[type=tel],.wy-control-group .wy-form-halves input[type=text],.wy-control-group .wy-form-halves input[type=time],.wy-control-group .wy-form-halves input[type=url],.wy-control-group .wy-form-halves input[type=week],.wy-control-group .wy-form-halves select,.wy-control-group .wy-form-thirds input[type=color],.wy-control-group .wy-form-thirds input[type=date],.wy-control-group .wy-form-thirds input[type=datetime-local],.wy-control-group .wy-form-thirds input[type=datetime],.wy-control-group .wy-form-thirds input[type=email],.wy-control-group .wy-form-thirds input[type=month],.wy-control-group .wy-form-thirds input[type=number],.wy-control-group .wy-form-thirds input[type=password],.wy-control-group .wy-form-thirds input[type=search],.wy-control-group .wy-form-thirds input[type=tel],.wy-control-group .wy-form-thirds input[type=text],.wy-control-group .wy-form-thirds input[type=time],.wy-control-group .wy-form-thirds input[type=url],.wy-control-group .wy-form-thirds input[type=week],.wy-control-group .wy-form-thirds select{width:100%}.wy-control-group .wy-form-full{float:left;display:block;width:100%;margin-right:0}.wy-control-group .wy-form-full:last-child{margin-right:0}.wy-control-group .wy-form-halves{float:left;display:block;margin-right:2.35765%;width:48.82117%}.wy-control-group .wy-form-halves:last-child,.wy-control-group .wy-form-halves:nth-of-type(2n){margin-right:0}.wy-control-group .wy-form-halves:nth-of-type(odd){clear:left}.wy-control-group .wy-form-thirds{float:left;display:block;margin-right:2.35765%;width:31.76157%}.wy-control-group .wy-form-thirds:last-child,.wy-control-group .wy-form-thirds:nth-of-type(3n){margin-right:0}.wy-control-group .wy-form-thirds:nth-of-type(3n+1){clear:left}.wy-control-group.wy-control-group-no-input .wy-control,.wy-control-no-input{margin:6px 0 0;font-size:90%}.wy-control-no-input{display:inline-block}.wy-control-group.fluid-input input[type=color],.wy-control-group.fluid-input input[type=date],.wy-control-group.fluid-input input[type=datetime-local],.wy-control-group.fluid-input input[type=datetime],.wy-control-group.fluid-input input[type=email],.wy-control-group.fluid-input input[type=month],.wy-control-group.fluid-input input[type=number],.wy-control-group.fluid-input input[type=password],.wy-control-group.fluid-input input[type=search],.wy-control-group.fluid-input input[type=tel],.wy-control-group.fluid-input input[type=text],.wy-control-group.fluid-input input[type=time],.wy-control-group.fluid-input input[type=url],.wy-control-group.fluid-input input[type=week]{width:100%}.wy-form-message-inline{padding-left:.3em;color:#666;font-size:90%}.wy-form-message{display:block;color:#999;font-size:70%;margin-top:.3125em;font-style:italic}.wy-form-message p{font-size:inherit;font-style:italic;margin-bottom:6px}.wy-form-message p:last-child{margin-bottom:0}input{line-height:normal}input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;*overflow:visible}input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week]{-webkit-appearance:none;padding:6px;display:inline-block;border:1px solid #ccc;font-size:80%;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;box-shadow:inset 0 1px 3px #ddd;border-radius:0;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}input[type=datetime-local]{padding:.34375em .625em}input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{padding:0;margin-right:.3125em;*height:13px;*width:13px}input[type=checkbox],input[type=radio],input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}input[type=color]:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=datetime]:focus,input[type=email]:focus,input[type=month]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=time]:focus,input[type=url]:focus,input[type=week]:focus{outline:0;outline:thin dotted\9;border-color:#333}input.no-focus:focus{border-color:#ccc!important}input[type=checkbox]:focus,input[type=file]:focus,input[type=radio]:focus{outline:thin dotted #333;outline:1px auto #129fea}input[type=color][disabled],input[type=date][disabled],input[type=datetime-local][disabled],input[type=datetime][disabled],input[type=email][disabled],input[type=month][disabled],input[type=number][disabled],input[type=password][disabled],input[type=search][disabled],input[type=tel][disabled],input[type=text][disabled],input[type=time][disabled],input[type=url][disabled],input[type=week][disabled]{cursor:not-allowed;background-color:#fafafa}input:focus:invalid,select:focus:invalid,textarea:focus:invalid{color:#e74c3c;border:1px solid #e74c3c}input:focus:invalid:focus,select:focus:invalid:focus,textarea:focus:invalid:focus{border-color:#e74c3c}input[type=checkbox]:focus:invalid:focus,input[type=file]:focus:invalid:focus,input[type=radio]:focus:invalid:focus{outline-color:#e74c3c}input.wy-input-large{padding:12px;font-size:100%}textarea{overflow:auto;vertical-align:top;width:100%;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif}select,textarea{padding:.5em .625em;display:inline-block;border:1px solid #ccc;font-size:80%;box-shadow:inset 0 1px 3px #ddd;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}select{border:1px solid #ccc;background-color:#fff}select[multiple]{height:auto}select:focus,textarea:focus{outline:0}input[readonly],select[disabled],select[readonly],textarea[disabled],textarea[readonly]{cursor:not-allowed;background-color:#fafafa}input[type=checkbox][disabled],input[type=radio][disabled]{cursor:not-allowed}.wy-checkbox,.wy-radio{margin:6px 0;color:#404040;display:block}.wy-checkbox input,.wy-radio input{vertical-align:baseline}.wy-form-message-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-input-prefix,.wy-input-suffix{white-space:nowrap;padding:6px}.wy-input-prefix .wy-input-context,.wy-input-suffix .wy-input-context{line-height:27px;padding:0 8px;display:inline-block;font-size:80%;background-color:#f3f6f6;border:1px solid #ccc;color:#999}.wy-input-suffix .wy-input-context{border-left:0}.wy-input-prefix .wy-input-context{border-right:0}.wy-switch{position:relative;display:block;height:24px;margin-top:12px;cursor:pointer}.wy-switch:before{left:0;top:0;width:36px;height:12px;background:#ccc}.wy-switch:after,.wy-switch:before{position:absolute;content:"";display:block;border-radius:4px;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.wy-switch:after{width:18px;height:18px;background:#999;left:-3px;top:-3px}.wy-switch span{position:absolute;left:48px;display:block;font-size:12px;color:#ccc;line-height:1}.wy-switch.active:before{background:#1e8449}.wy-switch.active:after{left:24px;background:#27ae60}.wy-switch.disabled{cursor:not-allowed;opacity:.8}.wy-control-group.wy-control-group-error .wy-form-message,.wy-control-group.wy-control-group-error>label{color:#e74c3c}.wy-control-group.wy-control-group-error input[type=color],.wy-control-group.wy-control-group-error input[type=date],.wy-control-group.wy-control-group-error input[type=datetime-local],.wy-control-group.wy-control-group-error input[type=datetime],.wy-control-group.wy-control-group-error input[type=email],.wy-control-group.wy-control-group-error input[type=month],.wy-control-group.wy-control-group-error input[type=number],.wy-control-group.wy-control-group-error input[type=password],.wy-control-group.wy-control-group-error input[type=search],.wy-control-group.wy-control-group-error input[type=tel],.wy-control-group.wy-control-group-error input[type=text],.wy-control-group.wy-control-group-error input[type=time],.wy-control-group.wy-control-group-error input[type=url],.wy-control-group.wy-control-group-error input[type=week],.wy-control-group.wy-control-group-error textarea{border:1px solid #e74c3c}.wy-inline-validate{white-space:nowrap}.wy-inline-validate .wy-input-context{padding:.5em .625em;display:inline-block;font-size:80%}.wy-inline-validate.wy-inline-validate-success .wy-input-context{color:#27ae60}.wy-inline-validate.wy-inline-validate-danger .wy-input-context{color:#e74c3c}.wy-inline-validate.wy-inline-validate-warning .wy-input-context{color:#e67e22}.wy-inline-validate.wy-inline-validate-info .wy-input-context{color:#2980b9}.rotate-90{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.rotate-180{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.rotate-270{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.mirror{-webkit-transform:scaleX(-1);-moz-transform:scaleX(-1);-ms-transform:scaleX(-1);-o-transform:scaleX(-1);transform:scaleX(-1)}.mirror.rotate-90{-webkit-transform:scaleX(-1) rotate(90deg);-moz-transform:scaleX(-1) rotate(90deg);-ms-transform:scaleX(-1) rotate(90deg);-o-transform:scaleX(-1) rotate(90deg);transform:scaleX(-1) rotate(90deg)}.mirror.rotate-180{-webkit-transform:scaleX(-1) rotate(180deg);-moz-transform:scaleX(-1) rotate(180deg);-ms-transform:scaleX(-1) rotate(180deg);-o-transform:scaleX(-1) rotate(180deg);transform:scaleX(-1) rotate(180deg)}.mirror.rotate-270{-webkit-transform:scaleX(-1) rotate(270deg);-moz-transform:scaleX(-1) rotate(270deg);-ms-transform:scaleX(-1) rotate(270deg);-o-transform:scaleX(-1) rotate(270deg);transform:scaleX(-1) rotate(270deg)}@media only screen and (max-width:480px){.wy-form button[type=submit]{margin:.7em 0 0}.wy-form input[type=color],.wy-form input[type=date],.wy-form input[type=datetime-local],.wy-form input[type=datetime],.wy-form input[type=email],.wy-form input[type=month],.wy-form input[type=number],.wy-form input[type=password],.wy-form input[type=search],.wy-form input[type=tel],.wy-form input[type=text],.wy-form input[type=time],.wy-form input[type=url],.wy-form input[type=week],.wy-form label{margin-bottom:.3em;display:block}.wy-form input[type=color],.wy-form input[type=date],.wy-form input[type=datetime-local],.wy-form input[type=datetime],.wy-form input[type=email],.wy-form input[type=month],.wy-form input[type=number],.wy-form input[type=password],.wy-form input[type=search],.wy-form input[type=tel],.wy-form input[type=time],.wy-form input[type=url],.wy-form input[type=week]{margin-bottom:0}.wy-form-aligned .wy-control-group label{margin-bottom:.3em;text-align:left;display:block;width:100%}.wy-form-aligned .wy-control{margin:1.5em 0 0}.wy-form-message,.wy-form-message-inline,.wy-form .wy-help-inline{display:block;font-size:80%;padding:6px 0}}@media screen and (max-width:768px){.tablet-hide{display:none}}@media screen and (max-width:480px){.mobile-hide{display:none}}.float-left{float:left}.float-right{float:right}.full-width{width:100%}.rst-content table.docutils,.rst-content table.field-list,.wy-table{border-collapse:collapse;border-spacing:0;empty-cells:show;margin-bottom:24px}.rst-content table.docutils caption,.rst-content table.field-list caption,.wy-table caption{color:#000;font:italic 85%/1 arial,sans-serif;padding:1em 0;text-align:center}.rst-content table.docutils td,.rst-content table.docutils th,.rst-content table.field-list td,.rst-content table.field-list th,.wy-table td,.wy-table th{font-size:90%;margin:0;overflow:visible;padding:8px 16px}.rst-content table.docutils td:first-child,.rst-content table.docutils th:first-child,.rst-content table.field-list td:first-child,.rst-content table.field-list th:first-child,.wy-table td:first-child,.wy-table th:first-child{border-left-width:0}.rst-content table.docutils thead,.rst-content table.field-list thead,.wy-table thead{color:#000;text-align:left;vertical-align:bottom;white-space:nowrap}.rst-content table.docutils thead th,.rst-content table.field-list thead th,.wy-table thead th{font-weight:700;border-bottom:2px solid #e1e4e5}.rst-content table.docutils td,.rst-content table.field-list td,.wy-table td{background-color:transparent;vertical-align:middle}.rst-content table.docutils td p,.rst-content table.field-list td p,.wy-table td p{line-height:18px}.rst-content table.docutils td p:last-child,.rst-content table.field-list td p:last-child,.wy-table td p:last-child{margin-bottom:0}.rst-content table.docutils .wy-table-cell-min,.rst-content table.field-list .wy-table-cell-min,.wy-table .wy-table-cell-min{width:1%;padding-right:0}.rst-content table.docutils .wy-table-cell-min input[type=checkbox],.rst-content table.field-list .wy-table-cell-min input[type=checkbox],.wy-table .wy-table-cell-min input[type=checkbox]{margin:0}.wy-table-secondary{color:grey;font-size:90%}.wy-table-tertiary{color:grey;font-size:80%}.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td,.wy-table-backed,.wy-table-odd td,.wy-table-striped tr:nth-child(2n-1) td{background-color:#f3f6f6}.rst-content table.docutils,.wy-table-bordered-all{border:1px solid #e1e4e5}.rst-content table.docutils td,.wy-table-bordered-all td{border-bottom:1px solid #e1e4e5;border-left:1px solid #e1e4e5}.rst-content table.docutils tbody>tr:last-child td,.wy-table-bordered-all tbody>tr:last-child td{border-bottom-width:0}.wy-table-bordered{border:1px solid #e1e4e5}.wy-table-bordered-rows td{border-bottom:1px solid #e1e4e5}.wy-table-bordered-rows tbody>tr:last-child td{border-bottom-width:0}.wy-table-horizontal td,.wy-table-horizontal th{border-width:0 0 1px;border-bottom:1px solid #e1e4e5}.wy-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.wy-table-responsive{margin-bottom:24px;max-width:100%;overflow:auto}.wy-table-responsive table{margin-bottom:0!important}.wy-table-responsive table td,.wy-table-responsive table th{white-space:nowrap}a{color:#2980b9;text-decoration:none;cursor:pointer}a:hover{color:#3091d1}a:visited{color:#9b59b6}html{height:100%}body,html{overflow-x:hidden}body{font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;font-weight:400;color:#404040;min-height:100%;background:#edf0f2}.wy-text-left{text-align:left}.wy-text-center{text-align:center}.wy-text-right{text-align:right}.wy-text-large{font-size:120%}.wy-text-normal{font-size:100%}.wy-text-small,small{font-size:80%}.wy-text-strike{text-decoration:line-through}.wy-text-warning{color:#e67e22!important}a.wy-text-warning:hover{color:#eb9950!important}.wy-text-info{color:#2980b9!important}a.wy-text-info:hover{color:#409ad5!important}.wy-text-success{color:#27ae60!important}a.wy-text-success:hover{color:#36d278!important}.wy-text-danger{color:#e74c3c!important}a.wy-text-danger:hover{color:#ed7669!important}.wy-text-neutral{color:#404040!important}a.wy-text-neutral:hover{color:#595959!important}.rst-content .toctree-wrapper>p.caption,h1,h2,h3,h4,h5,h6,legend{margin-top:0;font-weight:700;font-family:Roboto Slab,ff-tisa-web-pro,Georgia,Arial,sans-serif}p{line-height:24px;font-size:16px;margin:0 0 24px}h1{font-size:175%}.rst-content .toctree-wrapper>p.caption,h2{font-size:150%}h3{font-size:125%}h4{font-size:115%}h5{font-size:110%}h6{font-size:100%}hr{display:block;height:1px;border:0;border-top:1px solid #e1e4e5;margin:24px 0;padding:0}.rst-content code,.rst-content tt,code{white-space:nowrap;max-width:100%;background:#fff;border:1px solid #e1e4e5;font-size:75%;padding:0 5px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;color:#e74c3c;overflow-x:auto}.rst-content tt.code-large,code.code-large{font-size:90%}.rst-content .section ul,.rst-content .toctree-wrapper ul,.rst-content section ul,.wy-plain-list-disc,article ul{list-style:disc;line-height:24px;margin-bottom:24px}.rst-content .section ul li,.rst-content .toctree-wrapper ul li,.rst-content section ul li,.wy-plain-list-disc li,article ul li{list-style:disc;margin-left:24px}.rst-content .section ul li p:last-child,.rst-content .section ul li ul,.rst-content .toctree-wrapper ul li p:last-child,.rst-content .toctree-wrapper ul li ul,.rst-content section ul li p:last-child,.rst-content section ul li ul,.wy-plain-list-disc li p:last-child,.wy-plain-list-disc li ul,article ul li p:last-child,article ul li ul{margin-bottom:0}.rst-content .section ul li li,.rst-content .toctree-wrapper ul li li,.rst-content section ul li li,.wy-plain-list-disc li li,article ul li li{list-style:circle}.rst-content .section ul li li li,.rst-content .toctree-wrapper ul li li li,.rst-content section ul li li li,.wy-plain-list-disc li li li,article ul li li li{list-style:square}.rst-content .section ul li ol li,.rst-content .toctree-wrapper ul li ol li,.rst-content section ul li ol li,.wy-plain-list-disc li ol li,article ul li ol li{list-style:decimal}.rst-content .section ol,.rst-content .section ol.arabic,.rst-content .toctree-wrapper ol,.rst-content .toctree-wrapper ol.arabic,.rst-content section ol,.rst-content section ol.arabic,.wy-plain-list-decimal,article ol{list-style:decimal;line-height:24px;margin-bottom:24px}.rst-content .section ol.arabic li,.rst-content .section ol li,.rst-content .toctree-wrapper ol.arabic li,.rst-content .toctree-wrapper ol li,.rst-content section ol.arabic li,.rst-content section ol li,.wy-plain-list-decimal li,article ol li{list-style:decimal;margin-left:24px}.rst-content .section ol.arabic li ul,.rst-content .section ol li p:last-child,.rst-content .section ol li ul,.rst-content .toctree-wrapper ol.arabic li ul,.rst-content .toctree-wrapper ol li p:last-child,.rst-content .toctree-wrapper ol li ul,.rst-content section ol.arabic li ul,.rst-content section ol li p:last-child,.rst-content section ol li ul,.wy-plain-list-decimal li p:last-child,.wy-plain-list-decimal li ul,article ol li p:last-child,article ol li ul{margin-bottom:0}.rst-content .section ol.arabic li ul li,.rst-content .section ol li ul li,.rst-content .toctree-wrapper ol.arabic li ul li,.rst-content .toctree-wrapper ol li ul li,.rst-content section ol.arabic li ul li,.rst-content section ol li ul li,.wy-plain-list-decimal li ul li,article ol li ul li{list-style:disc}.wy-breadcrumbs{*zoom:1}.wy-breadcrumbs:after,.wy-breadcrumbs:before{display:table;content:""}.wy-breadcrumbs:after{clear:both}.wy-breadcrumbs li{display:inline-block}.wy-breadcrumbs li.wy-breadcrumbs-aside{float:right}.wy-breadcrumbs li a{display:inline-block;padding:5px}.wy-breadcrumbs li a:first-child{padding-left:0}.rst-content .wy-breadcrumbs li tt,.wy-breadcrumbs li .rst-content tt,.wy-breadcrumbs li code{padding:5px;border:none;background:none}.rst-content .wy-breadcrumbs li tt.literal,.wy-breadcrumbs li .rst-content tt.literal,.wy-breadcrumbs li code.literal{color:#404040}.wy-breadcrumbs-extra{margin-bottom:0;color:#b3b3b3;font-size:80%;display:inline-block}@media screen and (max-width:480px){.wy-breadcrumbs-extra,.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}@media print{.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}html{font-size:16px}.wy-affix{position:fixed;top:1.618em}.wy-menu a:hover{text-decoration:none}.wy-menu-horiz{*zoom:1}.wy-menu-horiz:after,.wy-menu-horiz:before{display:table;content:""}.wy-menu-horiz:after{clear:both}.wy-menu-horiz li,.wy-menu-horiz ul{display:inline-block}.wy-menu-horiz li:hover{background:hsla(0,0%,100%,.1)}.wy-menu-horiz li.divide-left{border-left:1px solid #404040}.wy-menu-horiz li.divide-right{border-right:1px solid #404040}.wy-menu-horiz a{height:32px;display:inline-block;line-height:32px;padding:0 16px}.wy-menu-vertical{width:300px}.wy-menu-vertical header,.wy-menu-vertical p.caption{color:#55a5d9;height:32px;line-height:32px;padding:0 1.618em;margin:12px 0 0;display:block;font-weight:700;text-transform:uppercase;font-size:85%;white-space:nowrap}.wy-menu-vertical ul{margin-bottom:0}.wy-menu-vertical li.divide-top{border-top:1px solid #404040}.wy-menu-vertical li.divide-bottom{border-bottom:1px solid #404040}.wy-menu-vertical li.current{background:#e3e3e3}.wy-menu-vertical li.current a{color:grey;border-right:1px solid #c9c9c9;padding:.4045em 2.427em}.wy-menu-vertical li.current a:hover{background:#d6d6d6}.rst-content .wy-menu-vertical li tt,.wy-menu-vertical li .rst-content tt,.wy-menu-vertical li code{border:none;background:inherit;color:inherit;padding-left:0;padding-right:0}.wy-menu-vertical li button.toctree-expand{display:block;float:left;margin-left:-1.2em;line-height:18px;color:#4d4d4d;border:none;background:none;padding:0}.wy-menu-vertical li.current>a,.wy-menu-vertical li.on a{color:#404040;font-weight:700;position:relative;background:#fcfcfc;border:none;padding:.4045em 1.618em}.wy-menu-vertical li.current>a:hover,.wy-menu-vertical li.on a:hover{background:#fcfcfc}.wy-menu-vertical li.current>a:hover button.toctree-expand,.wy-menu-vertical li.on a:hover button.toctree-expand{color:grey}.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand{display:block;line-height:18px;color:#333}.wy-menu-vertical li.toctree-l1.current>a{border-bottom:1px solid #c9c9c9;border-top:1px solid #c9c9c9}.wy-menu-vertical .toctree-l1.current .toctree-l2>ul,.wy-menu-vertical .toctree-l2.current .toctree-l3>ul,.wy-menu-vertical .toctree-l3.current .toctree-l4>ul,.wy-menu-vertical .toctree-l4.current .toctree-l5>ul,.wy-menu-vertical .toctree-l5.current .toctree-l6>ul,.wy-menu-vertical .toctree-l6.current .toctree-l7>ul,.wy-menu-vertical .toctree-l7.current .toctree-l8>ul,.wy-menu-vertical .toctree-l8.current .toctree-l9>ul,.wy-menu-vertical .toctree-l9.current .toctree-l10>ul,.wy-menu-vertical .toctree-l10.current .toctree-l11>ul{display:none}.wy-menu-vertical .toctree-l1.current .current.toctree-l2>ul,.wy-menu-vertical .toctree-l2.current .current.toctree-l3>ul,.wy-menu-vertical .toctree-l3.current .current.toctree-l4>ul,.wy-menu-vertical .toctree-l4.current .current.toctree-l5>ul,.wy-menu-vertical .toctree-l5.current .current.toctree-l6>ul,.wy-menu-vertical .toctree-l6.current .current.toctree-l7>ul,.wy-menu-vertical .toctree-l7.current .current.toctree-l8>ul,.wy-menu-vertical .toctree-l8.current .current.toctree-l9>ul,.wy-menu-vertical .toctree-l9.current .current.toctree-l10>ul,.wy-menu-vertical .toctree-l10.current .current.toctree-l11>ul{display:block}.wy-menu-vertical li.toctree-l3,.wy-menu-vertical li.toctree-l4{font-size:.9em}.wy-menu-vertical li.toctree-l2 a,.wy-menu-vertical li.toctree-l3 a,.wy-menu-vertical li.toctree-l4 a,.wy-menu-vertical li.toctree-l5 a,.wy-menu-vertical li.toctree-l6 a,.wy-menu-vertical li.toctree-l7 a,.wy-menu-vertical li.toctree-l8 a,.wy-menu-vertical li.toctree-l9 a,.wy-menu-vertical li.toctree-l10 a{color:#404040}.wy-menu-vertical li.toctree-l2 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l3 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l4 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l5 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l6 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l7 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l8 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l9 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l10 a:hover button.toctree-expand{color:grey}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a,.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a,.wy-menu-vertical li.toctree-l4.current li.toctree-l5>a,.wy-menu-vertical li.toctree-l5.current li.toctree-l6>a,.wy-menu-vertical li.toctree-l6.current li.toctree-l7>a,.wy-menu-vertical li.toctree-l7.current li.toctree-l8>a,.wy-menu-vertical li.toctree-l8.current li.toctree-l9>a,.wy-menu-vertical li.toctree-l9.current li.toctree-l10>a,.wy-menu-vertical li.toctree-l10.current li.toctree-l11>a{display:block}.wy-menu-vertical li.toctree-l2.current>a{padding:.4045em 2.427em}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{padding:.4045em 1.618em .4045em 4.045em}.wy-menu-vertical li.toctree-l3.current>a{padding:.4045em 4.045em}.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{padding:.4045em 1.618em .4045em 5.663em}.wy-menu-vertical li.toctree-l4.current>a{padding:.4045em 5.663em}.wy-menu-vertical li.toctree-l4.current li.toctree-l5>a{padding:.4045em 1.618em .4045em 7.281em}.wy-menu-vertical li.toctree-l5.current>a{padding:.4045em 7.281em}.wy-menu-vertical li.toctree-l5.current li.toctree-l6>a{padding:.4045em 1.618em .4045em 8.899em}.wy-menu-vertical li.toctree-l6.current>a{padding:.4045em 8.899em}.wy-menu-vertical li.toctree-l6.current li.toctree-l7>a{padding:.4045em 1.618em .4045em 10.517em}.wy-menu-vertical li.toctree-l7.current>a{padding:.4045em 10.517em}.wy-menu-vertical li.toctree-l7.current li.toctree-l8>a{padding:.4045em 1.618em .4045em 12.135em}.wy-menu-vertical li.toctree-l8.current>a{padding:.4045em 12.135em}.wy-menu-vertical li.toctree-l8.current li.toctree-l9>a{padding:.4045em 1.618em .4045em 13.753em}.wy-menu-vertical li.toctree-l9.current>a{padding:.4045em 13.753em}.wy-menu-vertical li.toctree-l9.current li.toctree-l10>a{padding:.4045em 1.618em .4045em 15.371em}.wy-menu-vertical li.toctree-l10.current>a{padding:.4045em 15.371em}.wy-menu-vertical li.toctree-l10.current li.toctree-l11>a{padding:.4045em 1.618em .4045em 16.989em}.wy-menu-vertical li.toctree-l2.current>a,.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{background:#c9c9c9}.wy-menu-vertical li.toctree-l2 button.toctree-expand{color:#a3a3a3}.wy-menu-vertical li.toctree-l3.current>a,.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{background:#bdbdbd}.wy-menu-vertical li.toctree-l3 button.toctree-expand{color:#969696}.wy-menu-vertical li.current ul{display:block}.wy-menu-vertical li ul{margin-bottom:0;display:none}.wy-menu-vertical li ul li a{margin-bottom:0;color:#d9d9d9;font-weight:400}.wy-menu-vertical a{line-height:18px;padding:.4045em 1.618em;display:block;position:relative;font-size:90%;color:#d9d9d9}.wy-menu-vertical a:hover{background-color:#4e4a4a;cursor:pointer}.wy-menu-vertical a:hover button.toctree-expand{color:#d9d9d9}.wy-menu-vertical a:active{background-color:#2980b9;cursor:pointer;color:#fff}.wy-menu-vertical a:active button.toctree-expand{color:#fff}.wy-side-nav-search{display:block;width:300px;padding:.809em;margin-bottom:.809em;z-index:200;background-color:#2980b9;text-align:center;color:#fcfcfc}.wy-side-nav-search input[type=text]{width:100%;border-radius:50px;padding:6px 12px;border-color:#2472a4}.wy-side-nav-search img{display:block;margin:auto auto .809em;height:45px;width:45px;background-color:#2980b9;padding:5px;border-radius:100%}.wy-side-nav-search .wy-dropdown>a,.wy-side-nav-search>a{color:#fcfcfc;font-size:100%;font-weight:700;display:inline-block;padding:4px 6px;margin-bottom:.809em;max-width:100%}.wy-side-nav-search .wy-dropdown>a:hover,.wy-side-nav-search>a:hover{background:hsla(0,0%,100%,.1)}.wy-side-nav-search .wy-dropdown>a img.logo,.wy-side-nav-search>a img.logo{display:block;margin:0 auto;height:auto;width:auto;border-radius:0;max-width:100%;background:transparent}.wy-side-nav-search .wy-dropdown>a.icon img.logo,.wy-side-nav-search>a.icon img.logo{margin-top:.85em}.wy-side-nav-search>div.version{margin-top:-.4045em;margin-bottom:.809em;font-weight:400;color:hsla(0,0%,100%,.3)}.wy-nav .wy-menu-vertical header{color:#2980b9}.wy-nav .wy-menu-vertical a{color:#b3b3b3}.wy-nav .wy-menu-vertical a:hover{background-color:#2980b9;color:#fff}[data-menu-wrap]{-webkit-transition:all .2s ease-in;-moz-transition:all .2s ease-in;transition:all .2s ease-in;position:absolute;opacity:1;width:100%;opacity:0}[data-menu-wrap].move-center{left:0;right:auto;opacity:1}[data-menu-wrap].move-left{right:auto;left:-100%;opacity:0}[data-menu-wrap].move-right{right:-100%;left:auto;opacity:0}.wy-body-for-nav{background:#fcfcfc}.wy-grid-for-nav{position:absolute;width:100%;height:100%}.wy-nav-side{position:fixed;top:0;bottom:0;left:0;padding-bottom:2em;width:300px;overflow-x:hidden;overflow-y:hidden;min-height:100%;color:#9b9b9b;background:#343131;z-index:200}.wy-side-scroll{width:320px;position:relative;overflow-x:hidden;overflow-y:scroll;height:100%}.wy-nav-top{display:none;background:#2980b9;color:#fff;padding:.4045em .809em;position:relative;line-height:50px;text-align:center;font-size:100%;*zoom:1}.wy-nav-top:after,.wy-nav-top:before{display:table;content:""}.wy-nav-top:after{clear:both}.wy-nav-top a{color:#fff;font-weight:700}.wy-nav-top img{margin-right:12px;height:45px;width:45px;background-color:#2980b9;padding:5px;border-radius:100%}.wy-nav-top i{font-size:30px;float:left;cursor:pointer;padding-top:inherit}.wy-nav-content-wrap{margin-left:300px;background:#fcfcfc;min-height:100%}.wy-nav-content{padding:1.618em 3.236em;height:100%;max-width:800px;margin:auto}.wy-body-mask{position:fixed;width:100%;height:100%;background:rgba(0,0,0,.2);display:none;z-index:499}.wy-body-mask.on{display:block}footer{color:grey}footer p{margin-bottom:12px}.rst-content footer span.commit tt,footer span.commit .rst-content tt,footer span.commit code{padding:0;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;font-size:1em;background:none;border:none;color:grey}.rst-footer-buttons{*zoom:1}.rst-footer-buttons:after,.rst-footer-buttons:before{width:100%;display:table;content:""}.rst-footer-buttons:after{clear:both}.rst-breadcrumbs-buttons{margin-top:12px;*zoom:1}.rst-breadcrumbs-buttons:after,.rst-breadcrumbs-buttons:before{display:table;content:""}.rst-breadcrumbs-buttons:after{clear:both}#search-results .search li{margin-bottom:24px;border-bottom:1px solid #e1e4e5;padding-bottom:24px}#search-results .search li:first-child{border-top:1px solid #e1e4e5;padding-top:24px}#search-results .search li a{font-size:120%;margin-bottom:12px;display:inline-block}#search-results .context{color:grey;font-size:90%}.genindextable li>ul{margin-left:24px}@media screen and (max-width:768px){.wy-body-for-nav{background:#fcfcfc}.wy-nav-top{display:block}.wy-nav-side{left:-300px}.wy-nav-side.shift{width:85%;left:0}.wy-menu.wy-menu-vertical,.wy-side-nav-search,.wy-side-scroll{width:auto}.wy-nav-content-wrap{margin-left:0}.wy-nav-content-wrap .wy-nav-content{padding:1.618em}.wy-nav-content-wrap.shift{position:fixed;min-width:100%;left:85%;top:0;height:100%;overflow:hidden}}@media screen and (min-width:1100px){.wy-nav-content-wrap{background:rgba(0,0,0,.05)}.wy-nav-content{margin:0;background:#fcfcfc}}@media print{.rst-versions,.wy-nav-side,footer{display:none}.wy-nav-content-wrap{margin-left:0}}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60;*zoom:1}.rst-versions .rst-current-version:after,.rst-versions .rst-current-version:before{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-content .code-block-caption .rst-versions .rst-current-version .headerlink,.rst-content .eqno .rst-versions .rst-current-version .headerlink,.rst-content .rst-versions .rst-current-version .admonition-title,.rst-content code.download .rst-versions .rst-current-version span:first-child,.rst-content dl dt .rst-versions .rst-current-version .headerlink,.rst-content h1 .rst-versions .rst-current-version .headerlink,.rst-content h2 .rst-versions .rst-current-version .headerlink,.rst-content h3 .rst-versions .rst-current-version .headerlink,.rst-content h4 .rst-versions .rst-current-version .headerlink,.rst-content h5 .rst-versions .rst-current-version .headerlink,.rst-content h6 .rst-versions .rst-current-version .headerlink,.rst-content p .rst-versions .rst-current-version .headerlink,.rst-content table>caption .rst-versions .rst-current-version .headerlink,.rst-content tt.download .rst-versions .rst-current-version span:first-child,.rst-versions .rst-current-version .fa,.rst-versions .rst-current-version .icon,.rst-versions .rst-current-version .rst-content .admonition-title,.rst-versions .rst-current-version .rst-content .code-block-caption .headerlink,.rst-versions .rst-current-version .rst-content .eqno .headerlink,.rst-versions .rst-current-version .rst-content code.download span:first-child,.rst-versions .rst-current-version .rst-content dl dt .headerlink,.rst-versions .rst-current-version .rst-content h1 .headerlink,.rst-versions .rst-current-version .rst-content h2 .headerlink,.rst-versions .rst-current-version .rst-content h3 .headerlink,.rst-versions .rst-current-version .rst-content h4 .headerlink,.rst-versions .rst-current-version .rst-content h5 .headerlink,.rst-versions .rst-current-version .rst-content h6 .headerlink,.rst-versions .rst-current-version .rst-content p .headerlink,.rst-versions .rst-current-version .rst-content table>caption .headerlink,.rst-versions .rst-current-version .rst-content tt.download span:first-child,.rst-versions .rst-current-version .wy-menu-vertical li button.toctree-expand,.wy-menu-vertical li .rst-versions .rst-current-version button.toctree-expand{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}}.rst-content .toctree-wrapper>p.caption,.rst-content h1,.rst-content h2,.rst-content h3,.rst-content h4,.rst-content h5,.rst-content h6{margin-bottom:24px}.rst-content img{max-width:100%;height:auto}.rst-content div.figure,.rst-content figure{margin-bottom:24px}.rst-content div.figure .caption-text,.rst-content figure .caption-text{font-style:italic}.rst-content div.figure p:last-child.caption,.rst-content figure p:last-child.caption{margin-bottom:0}.rst-content div.figure.align-center,.rst-content figure.align-center{text-align:center}.rst-content .section>a>img,.rst-content .section>img,.rst-content section>a>img,.rst-content section>img{margin-bottom:24px}.rst-content abbr[title]{text-decoration:none}.rst-content.style-external-links a.reference.external:after{font-family:FontAwesome;content:"\f08e";color:#b3b3b3;vertical-align:super;font-size:60%;margin:0 .2em}.rst-content blockquote{margin-left:24px;line-height:24px;margin-bottom:24px}.rst-content pre.literal-block{white-space:pre;margin:0;padding:12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;display:block;overflow:auto}.rst-content div[class^=highlight],.rst-content pre.literal-block{border:1px solid #e1e4e5;overflow-x:auto;margin:1px 0 24px}.rst-content div[class^=highlight] div[class^=highlight],.rst-content pre.literal-block div[class^=highlight]{padding:0;border:none;margin:0}.rst-content div[class^=highlight] td.code{width:100%}.rst-content .linenodiv pre{border-right:1px solid #e6e9ea;margin:0;padding:12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;user-select:none;pointer-events:none}.rst-content div[class^=highlight] pre{white-space:pre;margin:0;padding:12px;display:block;overflow:auto}.rst-content div[class^=highlight] pre .hll{display:block;margin:0 -12px;padding:0 12px}.rst-content .linenodiv pre,.rst-content div[class^=highlight] pre,.rst-content pre.literal-block{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;font-size:12px;line-height:1.4}.rst-content div.highlight .gp,.rst-content div.highlight span.linenos{user-select:none;pointer-events:none}.rst-content div.highlight span.linenos{display:inline-block;padding-left:0;padding-right:12px;margin-right:12px;border-right:1px solid #e6e9ea}.rst-content .code-block-caption{font-style:italic;font-size:85%;line-height:1;padding:1em 0;text-align:center}@media print{.rst-content .codeblock,.rst-content div[class^=highlight],.rst-content div[class^=highlight] pre{white-space:pre-wrap}}.rst-content .admonition,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning{clear:both}.rst-content .admonition-todo .last,.rst-content .admonition-todo>:last-child,.rst-content .admonition .last,.rst-content .admonition>:last-child,.rst-content .attention .last,.rst-content .attention>:last-child,.rst-content .caution .last,.rst-content .caution>:last-child,.rst-content .danger .last,.rst-content .danger>:last-child,.rst-content .error .last,.rst-content .error>:last-child,.rst-content .hint .last,.rst-content .hint>:last-child,.rst-content .important .last,.rst-content .important>:last-child,.rst-content .note .last,.rst-content .note>:last-child,.rst-content .seealso .last,.rst-content .seealso>:last-child,.rst-content .tip .last,.rst-content .tip>:last-child,.rst-content .warning .last,.rst-content .warning>:last-child{margin-bottom:0}.rst-content .admonition-title:before{margin-right:4px}.rst-content .admonition table{border-color:rgba(0,0,0,.1)}.rst-content .admonition table td,.rst-content .admonition table th{background:transparent!important;border-color:rgba(0,0,0,.1)!important}.rst-content .section ol.loweralpha,.rst-content .section ol.loweralpha>li,.rst-content .toctree-wrapper ol.loweralpha,.rst-content .toctree-wrapper ol.loweralpha>li,.rst-content section ol.loweralpha,.rst-content section ol.loweralpha>li{list-style:lower-alpha}.rst-content .section ol.upperalpha,.rst-content .section ol.upperalpha>li,.rst-content .toctree-wrapper ol.upperalpha,.rst-content .toctree-wrapper ol.upperalpha>li,.rst-content section ol.upperalpha,.rst-content section ol.upperalpha>li{list-style:upper-alpha}.rst-content .section ol li>*,.rst-content .section ul li>*,.rst-content .toctree-wrapper ol li>*,.rst-content .toctree-wrapper ul li>*,.rst-content section ol li>*,.rst-content section ul li>*{margin-top:12px;margin-bottom:12px}.rst-content .section ol li>:first-child,.rst-content .section ul li>:first-child,.rst-content .toctree-wrapper ol li>:first-child,.rst-content .toctree-wrapper ul li>:first-child,.rst-content section ol li>:first-child,.rst-content section ul li>:first-child{margin-top:0}.rst-content .section ol li>p,.rst-content .section ol li>p:last-child,.rst-content .section ul li>p,.rst-content .section ul li>p:last-child,.rst-content .toctree-wrapper ol li>p,.rst-content .toctree-wrapper ol li>p:last-child,.rst-content .toctree-wrapper ul li>p,.rst-content .toctree-wrapper ul li>p:last-child,.rst-content section ol li>p,.rst-content section ol li>p:last-child,.rst-content section ul li>p,.rst-content section ul li>p:last-child{margin-bottom:12px}.rst-content .section ol li>p:only-child,.rst-content .section ol li>p:only-child:last-child,.rst-content .section ul li>p:only-child,.rst-content .section ul li>p:only-child:last-child,.rst-content .toctree-wrapper ol li>p:only-child,.rst-content .toctree-wrapper ol li>p:only-child:last-child,.rst-content .toctree-wrapper ul li>p:only-child,.rst-content .toctree-wrapper ul li>p:only-child:last-child,.rst-content section ol li>p:only-child,.rst-content section ol li>p:only-child:last-child,.rst-content section ul li>p:only-child,.rst-content section ul li>p:only-child:last-child{margin-bottom:0}.rst-content .section ol li>ol,.rst-content .section ol li>ul,.rst-content .section ul li>ol,.rst-content .section ul li>ul,.rst-content .toctree-wrapper ol li>ol,.rst-content .toctree-wrapper ol li>ul,.rst-content .toctree-wrapper ul li>ol,.rst-content .toctree-wrapper ul li>ul,.rst-content section ol li>ol,.rst-content section ol li>ul,.rst-content section ul li>ol,.rst-content section ul li>ul{margin-bottom:12px}.rst-content .section ol.simple li>*,.rst-content .section ol.simple li ol,.rst-content .section ol.simple li ul,.rst-content .section ul.simple li>*,.rst-content .section ul.simple li ol,.rst-content .section ul.simple li ul,.rst-content .toctree-wrapper ol.simple li>*,.rst-content .toctree-wrapper ol.simple li ol,.rst-content .toctree-wrapper ol.simple li ul,.rst-content .toctree-wrapper ul.simple li>*,.rst-content .toctree-wrapper ul.simple li ol,.rst-content .toctree-wrapper ul.simple li ul,.rst-content section ol.simple li>*,.rst-content section ol.simple li ol,.rst-content section ol.simple li ul,.rst-content section ul.simple li>*,.rst-content section ul.simple li ol,.rst-content section ul.simple li ul{margin-top:0;margin-bottom:0}.rst-content .line-block{margin-left:0;margin-bottom:24px;line-height:24px}.rst-content .line-block .line-block{margin-left:24px;margin-bottom:0}.rst-content .topic-title{font-weight:700;margin-bottom:12px}.rst-content .toc-backref{color:#404040}.rst-content .align-right{float:right;margin:0 0 24px 24px}.rst-content .align-left{float:left;margin:0 24px 24px 0}.rst-content .align-center{margin:auto}.rst-content .align-center:not(table){display:block}.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content .toctree-wrapper>p.caption .headerlink,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink{opacity:0;font-size:14px;font-family:FontAwesome;margin-left:.5em}.rst-content .code-block-caption .headerlink:focus,.rst-content .code-block-caption:hover .headerlink,.rst-content .eqno .headerlink:focus,.rst-content .eqno:hover .headerlink,.rst-content .toctree-wrapper>p.caption .headerlink:focus,.rst-content .toctree-wrapper>p.caption:hover .headerlink,.rst-content dl dt .headerlink:focus,.rst-content dl dt:hover .headerlink,.rst-content h1 .headerlink:focus,.rst-content h1:hover .headerlink,.rst-content h2 .headerlink:focus,.rst-content h2:hover .headerlink,.rst-content h3 .headerlink:focus,.rst-content h3:hover .headerlink,.rst-content h4 .headerlink:focus,.rst-content h4:hover .headerlink,.rst-content h5 .headerlink:focus,.rst-content h5:hover .headerlink,.rst-content h6 .headerlink:focus,.rst-content h6:hover .headerlink,.rst-content p.caption .headerlink:focus,.rst-content p.caption:hover .headerlink,.rst-content p .headerlink:focus,.rst-content p:hover .headerlink,.rst-content table>caption .headerlink:focus,.rst-content table>caption:hover .headerlink{opacity:1}.rst-content .btn:focus{outline:2px solid}.rst-content table>caption .headerlink:after{font-size:12px}.rst-content .centered{text-align:center}.rst-content .sidebar{float:right;width:40%;display:block;margin:0 0 24px 24px;padding:24px;background:#f3f6f6;border:1px solid #e1e4e5}.rst-content .sidebar dl,.rst-content .sidebar p,.rst-content .sidebar ul{font-size:90%}.rst-content .sidebar .last,.rst-content .sidebar>:last-child{margin-bottom:0}.rst-content .sidebar .sidebar-title{display:block;font-family:Roboto Slab,ff-tisa-web-pro,Georgia,Arial,sans-serif;font-weight:700;background:#e1e4e5;padding:6px 12px;margin:-24px -24px 24px;font-size:100%}.rst-content .highlighted{background:#f1c40f;box-shadow:0 0 0 2px #f1c40f;display:inline;font-weight:700}.rst-content .citation-reference,.rst-content .footnote-reference{vertical-align:baseline;position:relative;top:-.4em;line-height:0;font-size:90%}.rst-content .hlist{width:100%}.rst-content dl dt span.classifier:before{content:" : "}.rst-content dl dt span.classifier-delimiter{display:none!important}html.writer-html4 .rst-content table.docutils.citation,html.writer-html4 .rst-content table.docutils.footnote{background:none;border:none}html.writer-html4 .rst-content table.docutils.citation td,html.writer-html4 .rst-content table.docutils.citation tr,html.writer-html4 .rst-content table.docutils.footnote td,html.writer-html4 .rst-content table.docutils.footnote tr{border:none;background-color:transparent!important;white-space:normal}html.writer-html4 .rst-content table.docutils.citation td.label,html.writer-html4 .rst-content table.docutils.footnote td.label{padding-left:0;padding-right:0;vertical-align:top}html.writer-html5 .rst-content dl.field-list,html.writer-html5 .rst-content dl.footnote{display:grid;grid-template-columns:max-content auto}html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dt{padding-left:1rem}html.writer-html5 .rst-content dl.field-list>dt:after,html.writer-html5 .rst-content dl.footnote>dt:after{content:":"}html.writer-html5 .rst-content dl.field-list>dd,html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dd,html.writer-html5 .rst-content dl.footnote>dt{margin-bottom:0}html.writer-html5 .rst-content dl.footnote{font-size:.9rem}html.writer-html5 .rst-content dl.footnote>dt{margin:0 .5rem .5rem 0;line-height:1.2rem;word-break:break-all;font-weight:400}html.writer-html5 .rst-content dl.footnote>dt>span.brackets{margin-right:.5rem}html.writer-html5 .rst-content dl.footnote>dt>span.brackets:before{content:"["}html.writer-html5 .rst-content dl.footnote>dt>span.brackets:after{content:"]"}html.writer-html5 .rst-content dl.footnote>dt>span.fn-backref{font-style:italic}html.writer-html5 .rst-content dl.footnote>dd{margin:0 0 .5rem;line-height:1.2rem}html.writer-html5 .rst-content dl.footnote>dd p,html.writer-html5 .rst-content dl.option-list kbd{font-size:.9rem}.rst-content table.docutils.footnote,html.writer-html4 .rst-content table.docutils.citation,html.writer-html5 .rst-content dl.footnote{color:grey}.rst-content table.docutils.footnote code,.rst-content table.docutils.footnote tt,html.writer-html4 .rst-content table.docutils.citation code,html.writer-html4 .rst-content table.docutils.citation tt,html.writer-html5 .rst-content dl.footnote code,html.writer-html5 .rst-content dl.footnote tt{color:#555}.rst-content .wy-table-responsive.citation,.rst-content .wy-table-responsive.footnote{margin-bottom:0}.rst-content .wy-table-responsive.citation+:not(.citation),.rst-content .wy-table-responsive.footnote+:not(.footnote){margin-top:24px}.rst-content .wy-table-responsive.citation:last-child,.rst-content .wy-table-responsive.footnote:last-child{margin-bottom:24px}.rst-content table.docutils th{border-color:#e1e4e5}html.writer-html5 .rst-content table.docutils th{border:1px solid #e1e4e5}html.writer-html5 .rst-content table.docutils td>p,html.writer-html5 .rst-content table.docutils th>p{line-height:1rem;margin-bottom:0;font-size:.9rem}.rst-content table.docutils td .last,.rst-content table.docutils td .last>:last-child{margin-bottom:0}.rst-content table.field-list,.rst-content table.field-list td{border:none}.rst-content table.field-list td p{font-size:inherit;line-height:inherit}.rst-content table.field-list td>strong{display:inline-block}.rst-content table.field-list .field-name{padding-right:10px;text-align:left;white-space:nowrap}.rst-content table.field-list .field-body{text-align:left}.rst-content code,.rst-content tt{color:#000;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;padding:2px 5px}.rst-content code big,.rst-content code em,.rst-content tt big,.rst-content tt em{font-size:100%!important;line-height:normal}.rst-content code.literal,.rst-content tt.literal{color:#e74c3c;white-space:normal}.rst-content code.xref,.rst-content tt.xref,a .rst-content code,a .rst-content tt{font-weight:700;color:#404040}.rst-content kbd,.rst-content pre,.rst-content samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace}.rst-content a code,.rst-content a tt{color:#2980b9}.rst-content dl{margin-bottom:24px}.rst-content dl dt{font-weight:700;margin-bottom:12px}.rst-content dl ol,.rst-content dl p,.rst-content dl table,.rst-content dl ul{margin-bottom:12px}.rst-content dl dd{margin:0 0 12px 24px;line-height:24px}html.writer-html4 .rst-content dl:not(.docutils),html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple){margin-bottom:24px}html.writer-html4 .rst-content dl:not(.docutils)>dt,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)>dt{display:table;margin:6px 0;font-size:90%;line-height:normal;background:#e7f2fa;color:#2980b9;border-top:3px solid #6ab0de;padding:6px;position:relative}html.writer-html4 .rst-content dl:not(.docutils)>dt:before,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)>dt:before{color:#6ab0de}html.writer-html4 .rst-content dl:not(.docutils)>dt .headerlink,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)>dt .headerlink{color:#404040;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils) dl:not(.field-list)>dt,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dl:not(.field-list)>dt{margin-bottom:6px;border:none;border-left:3px solid #ccc;background:#f0f0f0;color:#555}html.writer-html4 .rst-content dl:not(.docutils) dl:not(.field-list)>dt .headerlink,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dl:not(.field-list)>dt .headerlink{color:#404040;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils)>dt:first-child,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)>dt:first-child{margin-top:0}html.writer-html4 .rst-content dl:not(.docutils) code.descclassname,html.writer-html4 .rst-content dl:not(.docutils) code.descname,html.writer-html4 .rst-content dl:not(.docutils) tt.descclassname,html.writer-html4 .rst-content dl:not(.docutils) tt.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) code.descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) code.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) tt.descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) tt.descname{background-color:transparent;border:none;padding:0;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils) code.descname,html.writer-html4 .rst-content dl:not(.docutils) tt.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) code.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) tt.descname{font-weight:700}html.writer-html4 .rst-content dl:not(.docutils) .optional,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .optional{display:inline-block;padding:0 4px;color:#000;font-weight:700}html.writer-html4 .rst-content dl:not(.docutils) .property,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .property{display:inline-block;padding-right:8px;max-width:100%}html.writer-html4 .rst-content dl:not(.docutils) .k,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .k{font-style:italic}html.writer-html4 .rst-content dl:not(.docutils) .descclassname,html.writer-html4 .rst-content dl:not(.docutils) .descname,html.writer-html4 .rst-content dl:not(.docutils) .sig-name,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .sig-name{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;color:#000}.rst-content .viewcode-back,.rst-content .viewcode-link{display:inline-block;color:#27ae60;font-size:80%;padding-left:24px}.rst-content .viewcode-back{display:block;float:right}.rst-content p.rubric{margin-bottom:12px;font-weight:700}.rst-content code.download,.rst-content tt.download{background:inherit;padding:inherit;font-weight:400;font-family:inherit;font-size:inherit;color:inherit;border:inherit;white-space:inherit}.rst-content code.download span:first-child,.rst-content tt.download span:first-child{-webkit-font-smoothing:subpixel-antialiased}.rst-content code.download span:first-child:before,.rst-content tt.download span:first-child:before{margin-right:4px}.rst-content .guilabel{border:1px solid #7fbbe3;background:#e7f2fa;font-size:80%;font-weight:700;border-radius:4px;padding:2.4px 6px;margin:auto 2px}.rst-content .versionmodified{font-style:italic}@media screen and (max-width:480px){.rst-content .sidebar{width:100%}}span[id*=MathJax-Span]{color:#404040}.math{text-align:center}@font-face{font-family:Lato;src:url(fonts/lato-normal.woff2?bd03a2cc277bbbc338d464e679fe9942) format("woff2"),url(fonts/lato-normal.woff?27bd77b9162d388cb8d4c4217c7c5e2a) format("woff");font-weight:400;font-style:normal;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-bold.woff2?cccb897485813c7c256901dbca54ecf2) format("woff2"),url(fonts/lato-bold.woff?d878b6c29b10beca227e9eef4246111b) format("woff");font-weight:700;font-style:normal;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-bold-italic.woff2?0b6bb6725576b072c5d0b02ecdd1900d) format("woff2"),url(fonts/lato-bold-italic.woff?9c7e4e9eb485b4a121c760e61bc3707c) format("woff");font-weight:700;font-style:italic;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-normal-italic.woff2?4eb103b4d12be57cb1d040ed5e162e9d) format("woff2"),url(fonts/lato-normal-italic.woff?f28f2d6482446544ef1ea1ccc6dd5892) format("woff");font-weight:400;font-style:italic;font-display:block}@font-face{font-family:Roboto Slab;font-style:normal;font-weight:400;src:url(fonts/Roboto-Slab-Regular.woff2?7abf5b8d04d26a2cafea937019bca958) format("woff2"),url(fonts/Roboto-Slab-Regular.woff?c1be9284088d487c5e3ff0a10a92e58c) format("woff");font-display:block}@font-face{font-family:Roboto Slab;font-style:normal;font-weight:700;src:url(fonts/Roboto-Slab-Bold.woff2?9984f4a9bda09be08e83f2506954adbe) format("woff2"),url(fonts/Roboto-Slab-Bold.woff?bed5564a116b05148e3b3bea6fb1162a) format("woff");font-display:block} \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/design-style.b7bb847fb20b106c3d81b95245e65545.min.css b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/design-style.b7bb847fb20b106c3d81b95245e65545.min.css new file mode 100644 index 0000000000000000000000000000000000000000..704c42eeb8bfdecfdd0467e4c1f43a1c1a907e73 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/design-style.b7bb847fb20b106c3d81b95245e65545.min.css @@ -0,0 +1 @@ +.sd-bg-primary{background-color:var(--sd-color-primary) !important}.sd-bg-text-primary{color:var(--sd-color-primary-text) !important}button.sd-bg-primary:focus,button.sd-bg-primary:hover{background-color:var(--sd-color-primary-highlight) !important}a.sd-bg-primary:focus,a.sd-bg-primary:hover{background-color:var(--sd-color-primary-highlight) !important}.sd-bg-secondary{background-color:var(--sd-color-secondary) !important}.sd-bg-text-secondary{color:var(--sd-color-secondary-text) !important}button.sd-bg-secondary:focus,button.sd-bg-secondary:hover{background-color:var(--sd-color-secondary-highlight) !important}a.sd-bg-secondary:focus,a.sd-bg-secondary:hover{background-color:var(--sd-color-secondary-highlight) !important}.sd-bg-success{background-color:var(--sd-color-success) !important}.sd-bg-text-success{color:var(--sd-color-success-text) !important}button.sd-bg-success:focus,button.sd-bg-success:hover{background-color:var(--sd-color-success-highlight) !important}a.sd-bg-success:focus,a.sd-bg-success:hover{background-color:var(--sd-color-success-highlight) !important}.sd-bg-info{background-color:var(--sd-color-info) !important}.sd-bg-text-info{color:var(--sd-color-info-text) !important}button.sd-bg-info:focus,button.sd-bg-info:hover{background-color:var(--sd-color-info-highlight) !important}a.sd-bg-info:focus,a.sd-bg-info:hover{background-color:var(--sd-color-info-highlight) !important}.sd-bg-warning{background-color:var(--sd-color-warning) !important}.sd-bg-text-warning{color:var(--sd-color-warning-text) !important}button.sd-bg-warning:focus,button.sd-bg-warning:hover{background-color:var(--sd-color-warning-highlight) !important}a.sd-bg-warning:focus,a.sd-bg-warning:hover{background-color:var(--sd-color-warning-highlight) !important}.sd-bg-danger{background-color:var(--sd-color-danger) !important}.sd-bg-text-danger{color:var(--sd-color-danger-text) !important}button.sd-bg-danger:focus,button.sd-bg-danger:hover{background-color:var(--sd-color-danger-highlight) !important}a.sd-bg-danger:focus,a.sd-bg-danger:hover{background-color:var(--sd-color-danger-highlight) !important}.sd-bg-light{background-color:var(--sd-color-light) !important}.sd-bg-text-light{color:var(--sd-color-light-text) !important}button.sd-bg-light:focus,button.sd-bg-light:hover{background-color:var(--sd-color-light-highlight) !important}a.sd-bg-light:focus,a.sd-bg-light:hover{background-color:var(--sd-color-light-highlight) !important}.sd-bg-muted{background-color:var(--sd-color-muted) !important}.sd-bg-text-muted{color:var(--sd-color-muted-text) !important}button.sd-bg-muted:focus,button.sd-bg-muted:hover{background-color:var(--sd-color-muted-highlight) !important}a.sd-bg-muted:focus,a.sd-bg-muted:hover{background-color:var(--sd-color-muted-highlight) !important}.sd-bg-dark{background-color:var(--sd-color-dark) !important}.sd-bg-text-dark{color:var(--sd-color-dark-text) !important}button.sd-bg-dark:focus,button.sd-bg-dark:hover{background-color:var(--sd-color-dark-highlight) !important}a.sd-bg-dark:focus,a.sd-bg-dark:hover{background-color:var(--sd-color-dark-highlight) !important}.sd-bg-black{background-color:var(--sd-color-black) !important}.sd-bg-text-black{color:var(--sd-color-black-text) !important}button.sd-bg-black:focus,button.sd-bg-black:hover{background-color:var(--sd-color-black-highlight) !important}a.sd-bg-black:focus,a.sd-bg-black:hover{background-color:var(--sd-color-black-highlight) !important}.sd-bg-white{background-color:var(--sd-color-white) !important}.sd-bg-text-white{color:var(--sd-color-white-text) !important}button.sd-bg-white:focus,button.sd-bg-white:hover{background-color:var(--sd-color-white-highlight) !important}a.sd-bg-white:focus,a.sd-bg-white:hover{background-color:var(--sd-color-white-highlight) !important}.sd-text-primary,.sd-text-primary>p{color:var(--sd-color-primary) !important}a.sd-text-primary:focus,a.sd-text-primary:hover{color:var(--sd-color-primary-highlight) !important}.sd-text-secondary,.sd-text-secondary>p{color:var(--sd-color-secondary) !important}a.sd-text-secondary:focus,a.sd-text-secondary:hover{color:var(--sd-color-secondary-highlight) !important}.sd-text-success,.sd-text-success>p{color:var(--sd-color-success) !important}a.sd-text-success:focus,a.sd-text-success:hover{color:var(--sd-color-success-highlight) !important}.sd-text-info,.sd-text-info>p{color:var(--sd-color-info) !important}a.sd-text-info:focus,a.sd-text-info:hover{color:var(--sd-color-info-highlight) !important}.sd-text-warning,.sd-text-warning>p{color:var(--sd-color-warning) !important}a.sd-text-warning:focus,a.sd-text-warning:hover{color:var(--sd-color-warning-highlight) !important}.sd-text-danger,.sd-text-danger>p{color:var(--sd-color-danger) !important}a.sd-text-danger:focus,a.sd-text-danger:hover{color:var(--sd-color-danger-highlight) !important}.sd-text-light,.sd-text-light>p{color:var(--sd-color-light) !important}a.sd-text-light:focus,a.sd-text-light:hover{color:var(--sd-color-light-highlight) !important}.sd-text-muted,.sd-text-muted>p{color:var(--sd-color-muted) !important}a.sd-text-muted:focus,a.sd-text-muted:hover{color:var(--sd-color-muted-highlight) !important}.sd-text-dark,.sd-text-dark>p{color:var(--sd-color-dark) !important}a.sd-text-dark:focus,a.sd-text-dark:hover{color:var(--sd-color-dark-highlight) !important}.sd-text-black,.sd-text-black>p{color:var(--sd-color-black) !important}a.sd-text-black:focus,a.sd-text-black:hover{color:var(--sd-color-black-highlight) !important}.sd-text-white,.sd-text-white>p{color:var(--sd-color-white) !important}a.sd-text-white:focus,a.sd-text-white:hover{color:var(--sd-color-white-highlight) !important}.sd-outline-primary{border-color:var(--sd-color-primary) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-primary:focus,a.sd-outline-primary:hover{border-color:var(--sd-color-primary-highlight) !important}.sd-outline-secondary{border-color:var(--sd-color-secondary) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-secondary:focus,a.sd-outline-secondary:hover{border-color:var(--sd-color-secondary-highlight) !important}.sd-outline-success{border-color:var(--sd-color-success) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-success:focus,a.sd-outline-success:hover{border-color:var(--sd-color-success-highlight) !important}.sd-outline-info{border-color:var(--sd-color-info) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-info:focus,a.sd-outline-info:hover{border-color:var(--sd-color-info-highlight) !important}.sd-outline-warning{border-color:var(--sd-color-warning) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-warning:focus,a.sd-outline-warning:hover{border-color:var(--sd-color-warning-highlight) !important}.sd-outline-danger{border-color:var(--sd-color-danger) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-danger:focus,a.sd-outline-danger:hover{border-color:var(--sd-color-danger-highlight) !important}.sd-outline-light{border-color:var(--sd-color-light) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-light:focus,a.sd-outline-light:hover{border-color:var(--sd-color-light-highlight) !important}.sd-outline-muted{border-color:var(--sd-color-muted) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-muted:focus,a.sd-outline-muted:hover{border-color:var(--sd-color-muted-highlight) !important}.sd-outline-dark{border-color:var(--sd-color-dark) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-dark:focus,a.sd-outline-dark:hover{border-color:var(--sd-color-dark-highlight) !important}.sd-outline-black{border-color:var(--sd-color-black) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-black:focus,a.sd-outline-black:hover{border-color:var(--sd-color-black-highlight) !important}.sd-outline-white{border-color:var(--sd-color-white) !important;border-style:solid !important;border-width:1px !important}a.sd-outline-white:focus,a.sd-outline-white:hover{border-color:var(--sd-color-white-highlight) !important}.sd-bg-transparent{background-color:transparent !important}.sd-outline-transparent{border-color:transparent !important}.sd-text-transparent{color:transparent !important}.sd-p-0{padding:0 !important}.sd-pt-0,.sd-py-0{padding-top:0 !important}.sd-pr-0,.sd-px-0{padding-right:0 !important}.sd-pb-0,.sd-py-0{padding-bottom:0 !important}.sd-pl-0,.sd-px-0{padding-left:0 !important}.sd-p-1{padding:.25rem !important}.sd-pt-1,.sd-py-1{padding-top:.25rem !important}.sd-pr-1,.sd-px-1{padding-right:.25rem !important}.sd-pb-1,.sd-py-1{padding-bottom:.25rem !important}.sd-pl-1,.sd-px-1{padding-left:.25rem !important}.sd-p-2{padding:.5rem !important}.sd-pt-2,.sd-py-2{padding-top:.5rem !important}.sd-pr-2,.sd-px-2{padding-right:.5rem !important}.sd-pb-2,.sd-py-2{padding-bottom:.5rem !important}.sd-pl-2,.sd-px-2{padding-left:.5rem !important}.sd-p-3{padding:1rem !important}.sd-pt-3,.sd-py-3{padding-top:1rem !important}.sd-pr-3,.sd-px-3{padding-right:1rem !important}.sd-pb-3,.sd-py-3{padding-bottom:1rem !important}.sd-pl-3,.sd-px-3{padding-left:1rem !important}.sd-p-4{padding:1.5rem !important}.sd-pt-4,.sd-py-4{padding-top:1.5rem !important}.sd-pr-4,.sd-px-4{padding-right:1.5rem !important}.sd-pb-4,.sd-py-4{padding-bottom:1.5rem !important}.sd-pl-4,.sd-px-4{padding-left:1.5rem !important}.sd-p-5{padding:3rem !important}.sd-pt-5,.sd-py-5{padding-top:3rem !important}.sd-pr-5,.sd-px-5{padding-right:3rem !important}.sd-pb-5,.sd-py-5{padding-bottom:3rem !important}.sd-pl-5,.sd-px-5{padding-left:3rem !important}.sd-m-auto{margin:auto !important}.sd-mt-auto,.sd-my-auto{margin-top:auto !important}.sd-mr-auto,.sd-mx-auto{margin-right:auto !important}.sd-mb-auto,.sd-my-auto{margin-bottom:auto !important}.sd-ml-auto,.sd-mx-auto{margin-left:auto !important}.sd-m-0{margin:0 !important}.sd-mt-0,.sd-my-0{margin-top:0 !important}.sd-mr-0,.sd-mx-0{margin-right:0 !important}.sd-mb-0,.sd-my-0{margin-bottom:0 !important}.sd-ml-0,.sd-mx-0{margin-left:0 !important}.sd-m-1{margin:.25rem !important}.sd-mt-1,.sd-my-1{margin-top:.25rem !important}.sd-mr-1,.sd-mx-1{margin-right:.25rem !important}.sd-mb-1,.sd-my-1{margin-bottom:.25rem !important}.sd-ml-1,.sd-mx-1{margin-left:.25rem !important}.sd-m-2{margin:.5rem !important}.sd-mt-2,.sd-my-2{margin-top:.5rem !important}.sd-mr-2,.sd-mx-2{margin-right:.5rem !important}.sd-mb-2,.sd-my-2{margin-bottom:.5rem !important}.sd-ml-2,.sd-mx-2{margin-left:.5rem !important}.sd-m-3{margin:1rem !important}.sd-mt-3,.sd-my-3{margin-top:1rem !important}.sd-mr-3,.sd-mx-3{margin-right:1rem !important}.sd-mb-3,.sd-my-3{margin-bottom:1rem !important}.sd-ml-3,.sd-mx-3{margin-left:1rem !important}.sd-m-4{margin:1.5rem !important}.sd-mt-4,.sd-my-4{margin-top:1.5rem !important}.sd-mr-4,.sd-mx-4{margin-right:1.5rem !important}.sd-mb-4,.sd-my-4{margin-bottom:1.5rem !important}.sd-ml-4,.sd-mx-4{margin-left:1.5rem !important}.sd-m-5{margin:3rem !important}.sd-mt-5,.sd-my-5{margin-top:3rem !important}.sd-mr-5,.sd-mx-5{margin-right:3rem !important}.sd-mb-5,.sd-my-5{margin-bottom:3rem !important}.sd-ml-5,.sd-mx-5{margin-left:3rem !important}.sd-w-25{width:25% !important}.sd-w-50{width:50% !important}.sd-w-75{width:75% !important}.sd-w-100{width:100% !important}.sd-w-auto{width:auto !important}.sd-h-25{height:25% !important}.sd-h-50{height:50% !important}.sd-h-75{height:75% !important}.sd-h-100{height:100% !important}.sd-h-auto{height:auto !important}.sd-d-none{display:none !important}.sd-d-inline{display:inline !important}.sd-d-inline-block{display:inline-block !important}.sd-d-block{display:block !important}.sd-d-grid{display:grid !important}.sd-d-flex-row{display:-ms-flexbox !important;display:flex !important;flex-direction:row !important}.sd-d-flex-column{display:-ms-flexbox !important;display:flex !important;flex-direction:column !important}.sd-d-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}@media(min-width: 576px){.sd-d-sm-none{display:none !important}.sd-d-sm-inline{display:inline !important}.sd-d-sm-inline-block{display:inline-block !important}.sd-d-sm-block{display:block !important}.sd-d-sm-grid{display:grid !important}.sd-d-sm-flex{display:-ms-flexbox !important;display:flex !important}.sd-d-sm-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}}@media(min-width: 768px){.sd-d-md-none{display:none !important}.sd-d-md-inline{display:inline !important}.sd-d-md-inline-block{display:inline-block !important}.sd-d-md-block{display:block !important}.sd-d-md-grid{display:grid !important}.sd-d-md-flex{display:-ms-flexbox !important;display:flex !important}.sd-d-md-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}}@media(min-width: 992px){.sd-d-lg-none{display:none !important}.sd-d-lg-inline{display:inline !important}.sd-d-lg-inline-block{display:inline-block !important}.sd-d-lg-block{display:block !important}.sd-d-lg-grid{display:grid !important}.sd-d-lg-flex{display:-ms-flexbox !important;display:flex !important}.sd-d-lg-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}}@media(min-width: 1200px){.sd-d-xl-none{display:none !important}.sd-d-xl-inline{display:inline !important}.sd-d-xl-inline-block{display:inline-block !important}.sd-d-xl-block{display:block !important}.sd-d-xl-grid{display:grid !important}.sd-d-xl-flex{display:-ms-flexbox !important;display:flex !important}.sd-d-xl-inline-flex{display:-ms-inline-flexbox !important;display:inline-flex !important}}.sd-align-major-start{justify-content:flex-start !important}.sd-align-major-end{justify-content:flex-end !important}.sd-align-major-center{justify-content:center !important}.sd-align-major-justify{justify-content:space-between !important}.sd-align-major-spaced{justify-content:space-evenly !important}.sd-align-minor-start{align-items:flex-start !important}.sd-align-minor-end{align-items:flex-end !important}.sd-align-minor-center{align-items:center !important}.sd-align-minor-stretch{align-items:stretch !important}.sd-text-justify{text-align:justify !important}.sd-text-left{text-align:left !important}.sd-text-right{text-align:right !important}.sd-text-center{text-align:center !important}.sd-font-weight-light{font-weight:300 !important}.sd-font-weight-lighter{font-weight:lighter !important}.sd-font-weight-normal{font-weight:400 !important}.sd-font-weight-bold{font-weight:700 !important}.sd-font-weight-bolder{font-weight:bolder !important}.sd-font-italic{font-style:italic !important}.sd-text-decoration-none{text-decoration:none !important}.sd-text-lowercase{text-transform:lowercase !important}.sd-text-uppercase{text-transform:uppercase !important}.sd-text-capitalize{text-transform:capitalize !important}.sd-text-wrap{white-space:normal !important}.sd-text-nowrap{white-space:nowrap !important}.sd-text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sd-fs-1,.sd-fs-1>p{font-size:calc(1.375rem + 1.5vw) !important;line-height:unset !important}.sd-fs-2,.sd-fs-2>p{font-size:calc(1.325rem + 0.9vw) !important;line-height:unset !important}.sd-fs-3,.sd-fs-3>p{font-size:calc(1.3rem + 0.6vw) !important;line-height:unset !important}.sd-fs-4,.sd-fs-4>p{font-size:calc(1.275rem + 0.3vw) !important;line-height:unset !important}.sd-fs-5,.sd-fs-5>p{font-size:1.25rem !important;line-height:unset !important}.sd-fs-6,.sd-fs-6>p{font-size:1rem !important;line-height:unset !important}.sd-border-0{border:0 solid !important}.sd-border-top-0{border-top:0 solid !important}.sd-border-bottom-0{border-bottom:0 solid !important}.sd-border-right-0{border-right:0 solid !important}.sd-border-left-0{border-left:0 solid !important}.sd-border-1{border:1px solid !important}.sd-border-top-1{border-top:1px solid !important}.sd-border-bottom-1{border-bottom:1px solid !important}.sd-border-right-1{border-right:1px solid !important}.sd-border-left-1{border-left:1px solid !important}.sd-border-2{border:2px solid !important}.sd-border-top-2{border-top:2px solid !important}.sd-border-bottom-2{border-bottom:2px solid !important}.sd-border-right-2{border-right:2px solid !important}.sd-border-left-2{border-left:2px solid !important}.sd-border-3{border:3px solid !important}.sd-border-top-3{border-top:3px solid !important}.sd-border-bottom-3{border-bottom:3px solid !important}.sd-border-right-3{border-right:3px solid !important}.sd-border-left-3{border-left:3px solid !important}.sd-border-4{border:4px solid !important}.sd-border-top-4{border-top:4px solid !important}.sd-border-bottom-4{border-bottom:4px solid !important}.sd-border-right-4{border-right:4px solid !important}.sd-border-left-4{border-left:4px solid !important}.sd-border-5{border:5px solid !important}.sd-border-top-5{border-top:5px solid !important}.sd-border-bottom-5{border-bottom:5px solid !important}.sd-border-right-5{border-right:5px solid !important}.sd-border-left-5{border-left:5px solid !important}.sd-rounded-0{border-radius:0 !important}.sd-rounded-1{border-radius:.2rem !important}.sd-rounded-2{border-radius:.3rem !important}.sd-rounded-3{border-radius:.5rem !important}.sd-rounded-pill{border-radius:50rem !important}.sd-rounded-circle{border-radius:50% !important}.shadow-none{box-shadow:none !important}.sd-shadow-sm{box-shadow:0 .125rem .25rem var(--sd-color-shadow) !important}.sd-shadow-md{box-shadow:0 .5rem 1rem var(--sd-color-shadow) !important}.sd-shadow-lg{box-shadow:0 1rem 3rem var(--sd-color-shadow) !important}@keyframes sd-slide-from-left{0%{transform:translateX(-100%)}100%{transform:translateX(0)}}@keyframes sd-slide-from-right{0%{transform:translateX(200%)}100%{transform:translateX(0)}}@keyframes sd-grow100{0%{transform:scale(0);opacity:.5}100%{transform:scale(1);opacity:1}}@keyframes sd-grow50{0%{transform:scale(0.5);opacity:.5}100%{transform:scale(1);opacity:1}}@keyframes sd-grow50-rot20{0%{transform:scale(0.5) rotateZ(-20deg);opacity:.5}75%{transform:scale(1) rotateZ(5deg);opacity:1}95%{transform:scale(1) rotateZ(-1deg);opacity:1}100%{transform:scale(1) rotateZ(0);opacity:1}}.sd-animate-slide-from-left{animation:1s ease-out 0s 1 normal none running sd-slide-from-left}.sd-animate-slide-from-right{animation:1s ease-out 0s 1 normal none running sd-slide-from-right}.sd-animate-grow100{animation:1s ease-out 0s 1 normal none running sd-grow100}.sd-animate-grow50{animation:1s ease-out 0s 1 normal none running sd-grow50}.sd-animate-grow50-rot20{animation:1s ease-out 0s 1 normal none running sd-grow50-rot20}.sd-badge{display:inline-block;padding:.35em .65em;font-size:.75em;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem}.sd-badge:empty{display:none}a.sd-badge{text-decoration:none}.sd-btn .sd-badge{position:relative;top:-1px}.sd-btn{background-color:transparent;border:1px solid transparent;border-radius:.25rem;cursor:pointer;display:inline-block;font-weight:400;font-size:1rem;line-height:1.5;padding:.375rem .75rem;text-align:center;text-decoration:none;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;vertical-align:middle;user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none}.sd-btn:hover{text-decoration:none}@media(prefers-reduced-motion: reduce){.sd-btn{transition:none}}.sd-btn-primary,.sd-btn-outline-primary:hover,.sd-btn-outline-primary:focus{color:var(--sd-color-primary-text) !important;background-color:var(--sd-color-primary) !important;border-color:var(--sd-color-primary) !important;border-width:1px !important;border-style:solid !important}.sd-btn-primary:hover,.sd-btn-primary:focus{color:var(--sd-color-primary-text) !important;background-color:var(--sd-color-primary-highlight) !important;border-color:var(--sd-color-primary-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-primary{color:var(--sd-color-primary) !important;border-color:var(--sd-color-primary) !important;border-width:1px !important;border-style:solid !important}.sd-btn-secondary,.sd-btn-outline-secondary:hover,.sd-btn-outline-secondary:focus{color:var(--sd-color-secondary-text) !important;background-color:var(--sd-color-secondary) !important;border-color:var(--sd-color-secondary) !important;border-width:1px !important;border-style:solid !important}.sd-btn-secondary:hover,.sd-btn-secondary:focus{color:var(--sd-color-secondary-text) !important;background-color:var(--sd-color-secondary-highlight) !important;border-color:var(--sd-color-secondary-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-secondary{color:var(--sd-color-secondary) !important;border-color:var(--sd-color-secondary) !important;border-width:1px !important;border-style:solid !important}.sd-btn-success,.sd-btn-outline-success:hover,.sd-btn-outline-success:focus{color:var(--sd-color-success-text) !important;background-color:var(--sd-color-success) !important;border-color:var(--sd-color-success) !important;border-width:1px !important;border-style:solid !important}.sd-btn-success:hover,.sd-btn-success:focus{color:var(--sd-color-success-text) !important;background-color:var(--sd-color-success-highlight) !important;border-color:var(--sd-color-success-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-success{color:var(--sd-color-success) !important;border-color:var(--sd-color-success) !important;border-width:1px !important;border-style:solid !important}.sd-btn-info,.sd-btn-outline-info:hover,.sd-btn-outline-info:focus{color:var(--sd-color-info-text) !important;background-color:var(--sd-color-info) !important;border-color:var(--sd-color-info) !important;border-width:1px !important;border-style:solid !important}.sd-btn-info:hover,.sd-btn-info:focus{color:var(--sd-color-info-text) !important;background-color:var(--sd-color-info-highlight) !important;border-color:var(--sd-color-info-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-info{color:var(--sd-color-info) !important;border-color:var(--sd-color-info) !important;border-width:1px !important;border-style:solid !important}.sd-btn-warning,.sd-btn-outline-warning:hover,.sd-btn-outline-warning:focus{color:var(--sd-color-warning-text) !important;background-color:var(--sd-color-warning) !important;border-color:var(--sd-color-warning) !important;border-width:1px !important;border-style:solid !important}.sd-btn-warning:hover,.sd-btn-warning:focus{color:var(--sd-color-warning-text) !important;background-color:var(--sd-color-warning-highlight) !important;border-color:var(--sd-color-warning-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-warning{color:var(--sd-color-warning) !important;border-color:var(--sd-color-warning) !important;border-width:1px !important;border-style:solid !important}.sd-btn-danger,.sd-btn-outline-danger:hover,.sd-btn-outline-danger:focus{color:var(--sd-color-danger-text) !important;background-color:var(--sd-color-danger) !important;border-color:var(--sd-color-danger) !important;border-width:1px !important;border-style:solid !important}.sd-btn-danger:hover,.sd-btn-danger:focus{color:var(--sd-color-danger-text) !important;background-color:var(--sd-color-danger-highlight) !important;border-color:var(--sd-color-danger-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-danger{color:var(--sd-color-danger) !important;border-color:var(--sd-color-danger) !important;border-width:1px !important;border-style:solid !important}.sd-btn-light,.sd-btn-outline-light:hover,.sd-btn-outline-light:focus{color:var(--sd-color-light-text) !important;background-color:var(--sd-color-light) !important;border-color:var(--sd-color-light) !important;border-width:1px !important;border-style:solid !important}.sd-btn-light:hover,.sd-btn-light:focus{color:var(--sd-color-light-text) !important;background-color:var(--sd-color-light-highlight) !important;border-color:var(--sd-color-light-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-light{color:var(--sd-color-light) !important;border-color:var(--sd-color-light) !important;border-width:1px !important;border-style:solid !important}.sd-btn-muted,.sd-btn-outline-muted:hover,.sd-btn-outline-muted:focus{color:var(--sd-color-muted-text) !important;background-color:var(--sd-color-muted) !important;border-color:var(--sd-color-muted) !important;border-width:1px !important;border-style:solid !important}.sd-btn-muted:hover,.sd-btn-muted:focus{color:var(--sd-color-muted-text) !important;background-color:var(--sd-color-muted-highlight) !important;border-color:var(--sd-color-muted-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-muted{color:var(--sd-color-muted) !important;border-color:var(--sd-color-muted) !important;border-width:1px !important;border-style:solid !important}.sd-btn-dark,.sd-btn-outline-dark:hover,.sd-btn-outline-dark:focus{color:var(--sd-color-dark-text) !important;background-color:var(--sd-color-dark) !important;border-color:var(--sd-color-dark) !important;border-width:1px !important;border-style:solid !important}.sd-btn-dark:hover,.sd-btn-dark:focus{color:var(--sd-color-dark-text) !important;background-color:var(--sd-color-dark-highlight) !important;border-color:var(--sd-color-dark-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-dark{color:var(--sd-color-dark) !important;border-color:var(--sd-color-dark) !important;border-width:1px !important;border-style:solid !important}.sd-btn-black,.sd-btn-outline-black:hover,.sd-btn-outline-black:focus{color:var(--sd-color-black-text) !important;background-color:var(--sd-color-black) !important;border-color:var(--sd-color-black) !important;border-width:1px !important;border-style:solid !important}.sd-btn-black:hover,.sd-btn-black:focus{color:var(--sd-color-black-text) !important;background-color:var(--sd-color-black-highlight) !important;border-color:var(--sd-color-black-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-black{color:var(--sd-color-black) !important;border-color:var(--sd-color-black) !important;border-width:1px !important;border-style:solid !important}.sd-btn-white,.sd-btn-outline-white:hover,.sd-btn-outline-white:focus{color:var(--sd-color-white-text) !important;background-color:var(--sd-color-white) !important;border-color:var(--sd-color-white) !important;border-width:1px !important;border-style:solid !important}.sd-btn-white:hover,.sd-btn-white:focus{color:var(--sd-color-white-text) !important;background-color:var(--sd-color-white-highlight) !important;border-color:var(--sd-color-white-highlight) !important;border-width:1px !important;border-style:solid !important}.sd-btn-outline-white{color:var(--sd-color-white) !important;border-color:var(--sd-color-white) !important;border-width:1px !important;border-style:solid !important}.sd-stretched-link::after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;content:""}.sd-octicon,.sd-material-icon{display:inline-block;fill:currentColor;vertical-align:middle}.sd-avatar-xs{border-radius:50%;object-fit:cover;object-position:center;width:1rem;height:1rem}.sd-avatar-sm{border-radius:50%;object-fit:cover;object-position:center;width:3rem;height:3rem}.sd-avatar-md{border-radius:50%;object-fit:cover;object-position:center;width:5rem;height:5rem}.sd-avatar-lg{border-radius:50%;object-fit:cover;object-position:center;width:7rem;height:7rem}.sd-avatar-xl{border-radius:50%;object-fit:cover;object-position:center;width:10rem;height:10rem}.sd-avatar-inherit{border-radius:50%;object-fit:cover;object-position:center;width:inherit;height:inherit}.sd-avatar-initial{border-radius:50%;object-fit:cover;object-position:center;width:initial;height:initial}.sd-card{background-clip:border-box;background-color:var(--sd-color-card-background);border:1px solid var(--sd-color-card-border);border-radius:.25rem;color:var(--sd-color-card-text);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-width:0;position:relative;word-wrap:break-word}.sd-card>hr{margin-left:0;margin-right:0}.sd-card-hover:hover{border-color:var(--sd-color-card-border-hover);transform:scale(1.01)}.sd-card-body{-ms-flex:1 1 auto;flex:1 1 auto;padding:1rem 1rem}.sd-card-title{margin-bottom:.5rem}.sd-card-subtitle{margin-top:-0.25rem;margin-bottom:0}.sd-card-text:last-child{margin-bottom:0}.sd-card-link:hover{text-decoration:none}.sd-card-link+.card-link{margin-left:1rem}.sd-card-header{padding:.5rem 1rem;margin-bottom:0;background-color:var(--sd-color-card-header);border-bottom:1px solid var(--sd-color-card-border)}.sd-card-header:first-child{border-radius:calc(0.25rem - 1px) calc(0.25rem - 1px) 0 0}.sd-card-footer{padding:.5rem 1rem;background-color:var(--sd-color-card-footer);border-top:1px solid var(--sd-color-card-border)}.sd-card-footer:last-child{border-radius:0 0 calc(0.25rem - 1px) calc(0.25rem - 1px)}.sd-card-header-tabs{margin-right:-0.5rem;margin-bottom:-0.5rem;margin-left:-0.5rem;border-bottom:0}.sd-card-header-pills{margin-right:-0.5rem;margin-left:-0.5rem}.sd-card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1rem;border-radius:calc(0.25rem - 1px)}.sd-card-img,.sd-card-img-bottom,.sd-card-img-top{width:100%}.sd-card-img,.sd-card-img-top{border-top-left-radius:calc(0.25rem - 1px);border-top-right-radius:calc(0.25rem - 1px)}.sd-card-img,.sd-card-img-bottom{border-bottom-left-radius:calc(0.25rem - 1px);border-bottom-right-radius:calc(0.25rem - 1px)}.sd-cards-carousel{width:100%;display:flex;flex-wrap:nowrap;-ms-flex-direction:row;flex-direction:row;overflow-x:hidden;scroll-snap-type:x mandatory}.sd-cards-carousel.sd-show-scrollbar{overflow-x:auto}.sd-cards-carousel:hover,.sd-cards-carousel:focus{overflow-x:auto}.sd-cards-carousel>.sd-card{flex-shrink:0;scroll-snap-align:start}.sd-cards-carousel>.sd-card:not(:last-child){margin-right:3px}.sd-card-cols-1>.sd-card{width:90%}.sd-card-cols-2>.sd-card{width:45%}.sd-card-cols-3>.sd-card{width:30%}.sd-card-cols-4>.sd-card{width:22.5%}.sd-card-cols-5>.sd-card{width:18%}.sd-card-cols-6>.sd-card{width:15%}.sd-card-cols-7>.sd-card{width:12.8571428571%}.sd-card-cols-8>.sd-card{width:11.25%}.sd-card-cols-9>.sd-card{width:10%}.sd-card-cols-10>.sd-card{width:9%}.sd-card-cols-11>.sd-card{width:8.1818181818%}.sd-card-cols-12>.sd-card{width:7.5%}.sd-container,.sd-container-fluid,.sd-container-lg,.sd-container-md,.sd-container-sm,.sd-container-xl{margin-left:auto;margin-right:auto;padding-left:var(--sd-gutter-x, 0.75rem);padding-right:var(--sd-gutter-x, 0.75rem);width:100%}@media(min-width: 576px){.sd-container-sm,.sd-container{max-width:540px}}@media(min-width: 768px){.sd-container-md,.sd-container-sm,.sd-container{max-width:720px}}@media(min-width: 992px){.sd-container-lg,.sd-container-md,.sd-container-sm,.sd-container{max-width:960px}}@media(min-width: 1200px){.sd-container-xl,.sd-container-lg,.sd-container-md,.sd-container-sm,.sd-container{max-width:1140px}}.sd-row{--sd-gutter-x: 1.5rem;--sd-gutter-y: 0;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-top:calc(var(--sd-gutter-y) * -1);margin-right:calc(var(--sd-gutter-x) * -0.5);margin-left:calc(var(--sd-gutter-x) * -0.5)}.sd-row>*{box-sizing:border-box;flex-shrink:0;width:100%;max-width:100%;padding-right:calc(var(--sd-gutter-x) * 0.5);padding-left:calc(var(--sd-gutter-x) * 0.5);margin-top:var(--sd-gutter-y)}.sd-col{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-auto>*{flex:0 0 auto;width:auto}.sd-row-cols-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}@media(min-width: 576px){.sd-col-sm{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-sm-auto{flex:1 0 auto;-ms-flex:1 0 auto;width:100%}.sd-row-cols-sm-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-sm-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-sm-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-sm-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-sm-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-sm-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-sm-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-sm-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-sm-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-sm-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-sm-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-sm-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}}@media(min-width: 768px){.sd-col-md{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-md-auto{flex:1 0 auto;-ms-flex:1 0 auto;width:100%}.sd-row-cols-md-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-md-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-md-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-md-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-md-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-md-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-md-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-md-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-md-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-md-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-md-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-md-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}}@media(min-width: 992px){.sd-col-lg{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-lg-auto{flex:1 0 auto;-ms-flex:1 0 auto;width:100%}.sd-row-cols-lg-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-lg-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-lg-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-lg-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-lg-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-lg-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-lg-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-lg-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-lg-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-lg-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-lg-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-lg-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}}@media(min-width: 1200px){.sd-col-xl{flex:1 0 0%;-ms-flex:1 0 0%}.sd-row-cols-xl-auto{flex:1 0 auto;-ms-flex:1 0 auto;width:100%}.sd-row-cols-xl-1>*{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-row-cols-xl-2>*{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-row-cols-xl-3>*{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-row-cols-xl-4>*{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-row-cols-xl-5>*{flex:0 0 auto;-ms-flex:0 0 auto;width:20%}.sd-row-cols-xl-6>*{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-row-cols-xl-7>*{flex:0 0 auto;-ms-flex:0 0 auto;width:14.2857142857%}.sd-row-cols-xl-8>*{flex:0 0 auto;-ms-flex:0 0 auto;width:12.5%}.sd-row-cols-xl-9>*{flex:0 0 auto;-ms-flex:0 0 auto;width:11.1111111111%}.sd-row-cols-xl-10>*{flex:0 0 auto;-ms-flex:0 0 auto;width:10%}.sd-row-cols-xl-11>*{flex:0 0 auto;-ms-flex:0 0 auto;width:9.0909090909%}.sd-row-cols-xl-12>*{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}}.sd-col-auto{flex:0 0 auto;-ms-flex:0 0 auto;width:auto}.sd-col-1{flex:0 0 auto;-ms-flex:0 0 auto;width:8.3333333333%}.sd-col-2{flex:0 0 auto;-ms-flex:0 0 auto;width:16.6666666667%}.sd-col-3{flex:0 0 auto;-ms-flex:0 0 auto;width:25%}.sd-col-4{flex:0 0 auto;-ms-flex:0 0 auto;width:33.3333333333%}.sd-col-5{flex:0 0 auto;-ms-flex:0 0 auto;width:41.6666666667%}.sd-col-6{flex:0 0 auto;-ms-flex:0 0 auto;width:50%}.sd-col-7{flex:0 0 auto;-ms-flex:0 0 auto;width:58.3333333333%}.sd-col-8{flex:0 0 auto;-ms-flex:0 0 auto;width:66.6666666667%}.sd-col-9{flex:0 0 auto;-ms-flex:0 0 auto;width:75%}.sd-col-10{flex:0 0 auto;-ms-flex:0 0 auto;width:83.3333333333%}.sd-col-11{flex:0 0 auto;-ms-flex:0 0 auto;width:91.6666666667%}.sd-col-12{flex:0 0 auto;-ms-flex:0 0 auto;width:100%}.sd-g-0,.sd-gy-0{--sd-gutter-y: 0}.sd-g-0,.sd-gx-0{--sd-gutter-x: 0}.sd-g-1,.sd-gy-1{--sd-gutter-y: 0.25rem}.sd-g-1,.sd-gx-1{--sd-gutter-x: 0.25rem}.sd-g-2,.sd-gy-2{--sd-gutter-y: 0.5rem}.sd-g-2,.sd-gx-2{--sd-gutter-x: 0.5rem}.sd-g-3,.sd-gy-3{--sd-gutter-y: 1rem}.sd-g-3,.sd-gx-3{--sd-gutter-x: 1rem}.sd-g-4,.sd-gy-4{--sd-gutter-y: 1.5rem}.sd-g-4,.sd-gx-4{--sd-gutter-x: 1.5rem}.sd-g-5,.sd-gy-5{--sd-gutter-y: 3rem}.sd-g-5,.sd-gx-5{--sd-gutter-x: 3rem}@media(min-width: 576px){.sd-col-sm-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.sd-col-sm-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.3333333333%}.sd-col-sm-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.6666666667%}.sd-col-sm-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.sd-col-sm-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.3333333333%}.sd-col-sm-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.6666666667%}.sd-col-sm-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.sd-col-sm-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.3333333333%}.sd-col-sm-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.6666666667%}.sd-col-sm-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.sd-col-sm-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.3333333333%}.sd-col-sm-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.6666666667%}.sd-col-sm-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.sd-g-sm-0,.sd-gy-sm-0{--sd-gutter-y: 0}.sd-g-sm-0,.sd-gx-sm-0{--sd-gutter-x: 0}.sd-g-sm-1,.sd-gy-sm-1{--sd-gutter-y: 0.25rem}.sd-g-sm-1,.sd-gx-sm-1{--sd-gutter-x: 0.25rem}.sd-g-sm-2,.sd-gy-sm-2{--sd-gutter-y: 0.5rem}.sd-g-sm-2,.sd-gx-sm-2{--sd-gutter-x: 0.5rem}.sd-g-sm-3,.sd-gy-sm-3{--sd-gutter-y: 1rem}.sd-g-sm-3,.sd-gx-sm-3{--sd-gutter-x: 1rem}.sd-g-sm-4,.sd-gy-sm-4{--sd-gutter-y: 1.5rem}.sd-g-sm-4,.sd-gx-sm-4{--sd-gutter-x: 1.5rem}.sd-g-sm-5,.sd-gy-sm-5{--sd-gutter-y: 3rem}.sd-g-sm-5,.sd-gx-sm-5{--sd-gutter-x: 3rem}}@media(min-width: 768px){.sd-col-md-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.sd-col-md-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.3333333333%}.sd-col-md-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.6666666667%}.sd-col-md-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.sd-col-md-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.3333333333%}.sd-col-md-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.6666666667%}.sd-col-md-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.sd-col-md-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.3333333333%}.sd-col-md-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.6666666667%}.sd-col-md-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.sd-col-md-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.3333333333%}.sd-col-md-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.6666666667%}.sd-col-md-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.sd-g-md-0,.sd-gy-md-0{--sd-gutter-y: 0}.sd-g-md-0,.sd-gx-md-0{--sd-gutter-x: 0}.sd-g-md-1,.sd-gy-md-1{--sd-gutter-y: 0.25rem}.sd-g-md-1,.sd-gx-md-1{--sd-gutter-x: 0.25rem}.sd-g-md-2,.sd-gy-md-2{--sd-gutter-y: 0.5rem}.sd-g-md-2,.sd-gx-md-2{--sd-gutter-x: 0.5rem}.sd-g-md-3,.sd-gy-md-3{--sd-gutter-y: 1rem}.sd-g-md-3,.sd-gx-md-3{--sd-gutter-x: 1rem}.sd-g-md-4,.sd-gy-md-4{--sd-gutter-y: 1.5rem}.sd-g-md-4,.sd-gx-md-4{--sd-gutter-x: 1.5rem}.sd-g-md-5,.sd-gy-md-5{--sd-gutter-y: 3rem}.sd-g-md-5,.sd-gx-md-5{--sd-gutter-x: 3rem}}@media(min-width: 992px){.sd-col-lg-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.sd-col-lg-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.3333333333%}.sd-col-lg-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.6666666667%}.sd-col-lg-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.sd-col-lg-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.3333333333%}.sd-col-lg-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.6666666667%}.sd-col-lg-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.sd-col-lg-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.3333333333%}.sd-col-lg-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.6666666667%}.sd-col-lg-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.sd-col-lg-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.3333333333%}.sd-col-lg-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.6666666667%}.sd-col-lg-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.sd-g-lg-0,.sd-gy-lg-0{--sd-gutter-y: 0}.sd-g-lg-0,.sd-gx-lg-0{--sd-gutter-x: 0}.sd-g-lg-1,.sd-gy-lg-1{--sd-gutter-y: 0.25rem}.sd-g-lg-1,.sd-gx-lg-1{--sd-gutter-x: 0.25rem}.sd-g-lg-2,.sd-gy-lg-2{--sd-gutter-y: 0.5rem}.sd-g-lg-2,.sd-gx-lg-2{--sd-gutter-x: 0.5rem}.sd-g-lg-3,.sd-gy-lg-3{--sd-gutter-y: 1rem}.sd-g-lg-3,.sd-gx-lg-3{--sd-gutter-x: 1rem}.sd-g-lg-4,.sd-gy-lg-4{--sd-gutter-y: 1.5rem}.sd-g-lg-4,.sd-gx-lg-4{--sd-gutter-x: 1.5rem}.sd-g-lg-5,.sd-gy-lg-5{--sd-gutter-y: 3rem}.sd-g-lg-5,.sd-gx-lg-5{--sd-gutter-x: 3rem}}@media(min-width: 1200px){.sd-col-xl-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.sd-col-xl-1{-ms-flex:0 0 auto;flex:0 0 auto;width:8.3333333333%}.sd-col-xl-2{-ms-flex:0 0 auto;flex:0 0 auto;width:16.6666666667%}.sd-col-xl-3{-ms-flex:0 0 auto;flex:0 0 auto;width:25%}.sd-col-xl-4{-ms-flex:0 0 auto;flex:0 0 auto;width:33.3333333333%}.sd-col-xl-5{-ms-flex:0 0 auto;flex:0 0 auto;width:41.6666666667%}.sd-col-xl-6{-ms-flex:0 0 auto;flex:0 0 auto;width:50%}.sd-col-xl-7{-ms-flex:0 0 auto;flex:0 0 auto;width:58.3333333333%}.sd-col-xl-8{-ms-flex:0 0 auto;flex:0 0 auto;width:66.6666666667%}.sd-col-xl-9{-ms-flex:0 0 auto;flex:0 0 auto;width:75%}.sd-col-xl-10{-ms-flex:0 0 auto;flex:0 0 auto;width:83.3333333333%}.sd-col-xl-11{-ms-flex:0 0 auto;flex:0 0 auto;width:91.6666666667%}.sd-col-xl-12{-ms-flex:0 0 auto;flex:0 0 auto;width:100%}.sd-g-xl-0,.sd-gy-xl-0{--sd-gutter-y: 0}.sd-g-xl-0,.sd-gx-xl-0{--sd-gutter-x: 0}.sd-g-xl-1,.sd-gy-xl-1{--sd-gutter-y: 0.25rem}.sd-g-xl-1,.sd-gx-xl-1{--sd-gutter-x: 0.25rem}.sd-g-xl-2,.sd-gy-xl-2{--sd-gutter-y: 0.5rem}.sd-g-xl-2,.sd-gx-xl-2{--sd-gutter-x: 0.5rem}.sd-g-xl-3,.sd-gy-xl-3{--sd-gutter-y: 1rem}.sd-g-xl-3,.sd-gx-xl-3{--sd-gutter-x: 1rem}.sd-g-xl-4,.sd-gy-xl-4{--sd-gutter-y: 1.5rem}.sd-g-xl-4,.sd-gx-xl-4{--sd-gutter-x: 1.5rem}.sd-g-xl-5,.sd-gy-xl-5{--sd-gutter-y: 3rem}.sd-g-xl-5,.sd-gx-xl-5{--sd-gutter-x: 3rem}}.sd-flex-row-reverse{flex-direction:row-reverse !important}details.sd-dropdown{position:relative}details.sd-dropdown .sd-summary-title{font-weight:700;padding-right:3em !important;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none}details.sd-dropdown:hover{cursor:pointer}details.sd-dropdown .sd-summary-content{cursor:default}details.sd-dropdown summary{list-style:none;padding:1em}details.sd-dropdown summary .sd-octicon.no-title{vertical-align:middle}details.sd-dropdown[open] summary .sd-octicon.no-title{visibility:hidden}details.sd-dropdown summary::-webkit-details-marker{display:none}details.sd-dropdown summary:focus{outline:none}details.sd-dropdown .sd-summary-icon{margin-right:.5em}details.sd-dropdown .sd-summary-icon svg{opacity:.8}details.sd-dropdown summary:hover .sd-summary-up svg,details.sd-dropdown summary:hover .sd-summary-down svg{opacity:1;transform:scale(1.1)}details.sd-dropdown .sd-summary-up svg,details.sd-dropdown .sd-summary-down svg{display:block;opacity:.6}details.sd-dropdown .sd-summary-up,details.sd-dropdown .sd-summary-down{pointer-events:none;position:absolute;right:1em;top:1em}details.sd-dropdown[open]>.sd-summary-title .sd-summary-down{visibility:hidden}details.sd-dropdown:not([open])>.sd-summary-title .sd-summary-up{visibility:hidden}details.sd-dropdown:not([open]).sd-card{border:none}details.sd-dropdown:not([open])>.sd-card-header{border:1px solid var(--sd-color-card-border);border-radius:.25rem}details.sd-dropdown.sd-fade-in[open] summary~*{-moz-animation:sd-fade-in .5s ease-in-out;-webkit-animation:sd-fade-in .5s ease-in-out;animation:sd-fade-in .5s ease-in-out}details.sd-dropdown.sd-fade-in-slide-down[open] summary~*{-moz-animation:sd-fade-in .5s ease-in-out,sd-slide-down .5s ease-in-out;-webkit-animation:sd-fade-in .5s ease-in-out,sd-slide-down .5s ease-in-out;animation:sd-fade-in .5s ease-in-out,sd-slide-down .5s ease-in-out}.sd-col>.sd-dropdown{width:100%}.sd-summary-content>.sd-tab-set:first-child{margin-top:0}@keyframes sd-fade-in{0%{opacity:0}100%{opacity:1}}@keyframes sd-slide-down{0%{transform:translate(0, -10px)}100%{transform:translate(0, 0)}}.sd-tab-set{border-radius:.125rem;display:flex;flex-wrap:wrap;margin:1em 0;position:relative}.sd-tab-set>input{opacity:0;position:absolute}.sd-tab-set>input:checked+label{border-color:var(--sd-color-tabs-underline-active);color:var(--sd-color-tabs-label-active)}.sd-tab-set>input:checked+label+.sd-tab-content{display:block}.sd-tab-set>input:not(:checked)+label:hover{color:var(--sd-color-tabs-label-hover);border-color:var(--sd-color-tabs-underline-hover)}.sd-tab-set>input:focus+label{outline-style:auto}.sd-tab-set>input:not(.focus-visible)+label{outline:none;-webkit-tap-highlight-color:transparent}.sd-tab-set>label{border-bottom:.125rem solid transparent;margin-bottom:0;color:var(--sd-color-tabs-label-inactive);border-color:var(--sd-color-tabs-underline-inactive);cursor:pointer;font-size:var(--sd-fontsize-tabs-label);font-weight:700;padding:1em 1.25em .5em;transition:color 250ms;width:auto;z-index:1}html .sd-tab-set>label:hover{color:var(--sd-color-tabs-label-active)}.sd-col>.sd-tab-set{width:100%}.sd-tab-content{box-shadow:0 -0.0625rem var(--sd-color-tabs-overline),0 .0625rem var(--sd-color-tabs-underline);display:none;order:99;padding-bottom:.75rem;padding-top:.75rem;width:100%}.sd-tab-content>:first-child{margin-top:0 !important}.sd-tab-content>:last-child{margin-bottom:0 !important}.sd-tab-content>.sd-tab-set{margin:0}.sd-sphinx-override,.sd-sphinx-override *{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.sd-sphinx-override p{margin-top:0}:root{--sd-color-primary: #007bff;--sd-color-secondary: #6c757d;--sd-color-success: #28a745;--sd-color-info: #17a2b8;--sd-color-warning: #f0b37e;--sd-color-danger: #dc3545;--sd-color-light: #f8f9fa;--sd-color-muted: #6c757d;--sd-color-dark: #212529;--sd-color-black: black;--sd-color-white: white;--sd-color-primary-highlight: #0069d9;--sd-color-secondary-highlight: #5c636a;--sd-color-success-highlight: #228e3b;--sd-color-info-highlight: #148a9c;--sd-color-warning-highlight: #cc986b;--sd-color-danger-highlight: #bb2d3b;--sd-color-light-highlight: #d3d4d5;--sd-color-muted-highlight: #5c636a;--sd-color-dark-highlight: #1c1f23;--sd-color-black-highlight: black;--sd-color-white-highlight: #d9d9d9;--sd-color-primary-text: #fff;--sd-color-secondary-text: #fff;--sd-color-success-text: #fff;--sd-color-info-text: #fff;--sd-color-warning-text: #212529;--sd-color-danger-text: #fff;--sd-color-light-text: #212529;--sd-color-muted-text: #fff;--sd-color-dark-text: #fff;--sd-color-black-text: #fff;--sd-color-white-text: #212529;--sd-color-shadow: rgba(0, 0, 0, 0.15);--sd-color-card-border: rgba(0, 0, 0, 0.125);--sd-color-card-border-hover: hsla(231, 99%, 66%, 1);--sd-color-card-background: transparent;--sd-color-card-text: inherit;--sd-color-card-header: transparent;--sd-color-card-footer: transparent;--sd-color-tabs-label-active: hsla(231, 99%, 66%, 1);--sd-color-tabs-label-hover: hsla(231, 99%, 66%, 1);--sd-color-tabs-label-inactive: hsl(0, 0%, 66%);--sd-color-tabs-underline-active: hsla(231, 99%, 66%, 1);--sd-color-tabs-underline-hover: rgba(178, 206, 245, 0.62);--sd-color-tabs-underline-inactive: transparent;--sd-color-tabs-overline: rgb(222, 222, 222);--sd-color-tabs-underline: rgb(222, 222, 222);--sd-fontsize-tabs-label: 1rem} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/design-tabs.js b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/design-tabs.js new file mode 100644 index 0000000000000000000000000000000000000000..36b38cf0d911247b119633267121aee3e6c8c8e9 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/design-tabs.js @@ -0,0 +1,27 @@ +var sd_labels_by_text = {}; + +function ready() { + const li = document.getElementsByClassName("sd-tab-label"); + for (const label of li) { + syncId = label.getAttribute("data-sync-id"); + if (syncId) { + label.onclick = onLabelClick; + if (!sd_labels_by_text[syncId]) { + sd_labels_by_text[syncId] = []; + } + sd_labels_by_text[syncId].push(label); + } + } +} + +function onLabelClick() { + // Activate other inputs with the same sync id. + syncId = this.getAttribute("data-sync-id"); + for (label of sd_labels_by_text[syncId]) { + if (label === this) continue; + label.previousElementSibling.checked = true; + } + window.localStorage.setItem("sphinx-design-last-tab", syncId); +} + +document.addEventListener("DOMContentLoaded", ready, false); diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/doctools.js b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/doctools.js new file mode 100644 index 0000000000000000000000000000000000000000..e1bfd708b7f424846261e634ec53b0be89a4f604 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/doctools.js @@ -0,0 +1,358 @@ +/* + * doctools.js + * ~~~~~~~~~~~ + * + * Sphinx JavaScript utilities for all documentation. + * + * :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/** + * select a different prefix for underscore + */ +$u = _.noConflict(); + +/** + * make the code below compatible with browsers without + * an installed firebug like debugger +if (!window.console || !console.firebug) { + var names = ["log", "debug", "info", "warn", "error", "assert", "dir", + "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", + "profile", "profileEnd"]; + window.console = {}; + for (var i = 0; i < names.length; ++i) + window.console[names[i]] = function() {}; +} + */ + +/** + * small helper function to urldecode strings + * + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL + */ +jQuery.urldecode = function(x) { + if (!x) { + return x + } + return decodeURIComponent(x.replace(/\+/g, ' ')); +}; + +/** + * small helper function to urlencode strings + */ +jQuery.urlencode = encodeURIComponent; + +/** + * This function returns the parsed url parameters of the + * current request. Multiple values per key are supported, + * it will always return arrays of strings for the value parts. + */ +jQuery.getQueryParameters = function(s) { + if (typeof s === 'undefined') + s = document.location.search; + var parts = s.substr(s.indexOf('?') + 1).split('&'); + var result = {}; + for (var i = 0; i < parts.length; i++) { + var tmp = parts[i].split('=', 2); + var key = jQuery.urldecode(tmp[0]); + var value = jQuery.urldecode(tmp[1]); + if (key in result) + result[key].push(value); + else + result[key] = [value]; + } + return result; +}; + +/** + * highlight a given string on a jquery object by wrapping it in + * span elements with the given class name. + */ +jQuery.fn.highlightText = function(text, className) { + function highlight(node, addItems) { + if (node.nodeType === 3) { + var val = node.nodeValue; + var pos = val.toLowerCase().indexOf(text); + if (pos >= 0 && + !jQuery(node.parentNode).hasClass(className) && + !jQuery(node.parentNode).hasClass("nohighlight")) { + var span; + var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); + if (isInSVG) { + span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + } else { + span = document.createElement("span"); + span.className = className; + } + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + node.parentNode.insertBefore(span, node.parentNode.insertBefore( + document.createTextNode(val.substr(pos + text.length)), + node.nextSibling)); + node.nodeValue = val.substr(0, pos); + if (isInSVG) { + var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); + var bbox = node.parentElement.getBBox(); + rect.x.baseVal.value = bbox.x; + rect.y.baseVal.value = bbox.y; + rect.width.baseVal.value = bbox.width; + rect.height.baseVal.value = bbox.height; + rect.setAttribute('class', className); + addItems.push({ + "parent": node.parentNode, + "target": rect}); + } + } + } + else if (!jQuery(node).is("button, select, textarea")) { + jQuery.each(node.childNodes, function() { + highlight(this, addItems); + }); + } + } + var addItems = []; + var result = this.each(function() { + highlight(this, addItems); + }); + for (var i = 0; i < addItems.length; ++i) { + jQuery(addItems[i].parent).before(addItems[i].target); + } + return result; +}; + +/* + * backward compatibility for jQuery.browser + * This will be supported until firefox bug is fixed. + */ +if (!jQuery.browser) { + jQuery.uaMatch = function(ua) { + ua = ua.toLowerCase(); + + var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || + /(webkit)[ \/]([\w.]+)/.exec(ua) || + /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || + /(msie) ([\w.]+)/.exec(ua) || + ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || + []; + + return { + browser: match[ 1 ] || "", + version: match[ 2 ] || "0" + }; + }; + jQuery.browser = {}; + jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; +} + +/** + * Small JavaScript module for the documentation. + */ +var Documentation = { + + init : function() { + this.fixFirefoxAnchorBug(); + this.highlightSearchWords(); + this.initIndexTable(); + this.initOnKeyListeners(); + }, + + /** + * i18n support + */ + TRANSLATIONS : {}, + PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; }, + LOCALE : 'unknown', + + // gettext and ngettext don't access this so that the functions + // can safely bound to a different name (_ = Documentation.gettext) + gettext : function(string) { + var translated = Documentation.TRANSLATIONS[string]; + if (typeof translated === 'undefined') + return string; + return (typeof translated === 'string') ? translated : translated[0]; + }, + + ngettext : function(singular, plural, n) { + var translated = Documentation.TRANSLATIONS[singular]; + if (typeof translated === 'undefined') + return (n == 1) ? singular : plural; + return translated[Documentation.PLURALEXPR(n)]; + }, + + addTranslations : function(catalog) { + for (var key in catalog.messages) + this.TRANSLATIONS[key] = catalog.messages[key]; + this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); + this.LOCALE = catalog.locale; + }, + + /** + * add context elements like header anchor links + */ + addContextElements : function() { + $('div[id] > :header:first').each(function() { + $('\u00B6'). + attr('href', '#' + this.id). + attr('title', _('Permalink to this headline')). + appendTo(this); + }); + $('dt[id]').each(function() { + $('\u00B6'). + attr('href', '#' + this.id). + attr('title', _('Permalink to this definition')). + appendTo(this); + }); + }, + + /** + * workaround a firefox stupidity + * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 + */ + fixFirefoxAnchorBug : function() { + if (document.location.hash && $.browser.mozilla) + window.setTimeout(function() { + document.location.href += ''; + }, 10); + }, + + /** + * highlight the search words provided in the url in the text + */ + highlightSearchWords : function() { + var params = $.getQueryParameters(); + var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; + if (terms.length) { + var body = $('div.body'); + if (!body.length) { + body = $('body'); + } + window.setTimeout(function() { + $.each(terms, function() { + body.highlightText(this.toLowerCase(), 'highlighted'); + }); + }, 10); + $('') + .appendTo($('#searchbox')); + } + }, + + /** + * init the domain index toggle buttons + */ + initIndexTable : function() { + var togglers = $('img.toggler').click(function() { + var src = $(this).attr('src'); + var idnum = $(this).attr('id').substr(7); + $('tr.cg-' + idnum).toggle(); + if (src.substr(-9) === 'minus.png') + $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); + else + $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); + }).css('display', ''); + if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { + togglers.click(); + } + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords : function() { + $('#searchbox .highlight-link').fadeOut(300); + $('span.highlighted').removeClass('highlighted'); + var url = new URL(window.location); + url.searchParams.delete('highlight'); + window.history.replaceState({}, '', url); + }, + + /** + * helper function to focus on search bar + */ + focusSearchBar : function() { + $('input[name=q]').first().focus(); + }, + + /** + * make the url absolute + */ + makeURL : function(relativeURL) { + return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; + }, + + /** + * get the current relative url + */ + getCurrentURL : function() { + var path = document.location.pathname; + var parts = path.split(/\//); + $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { + if (this === '..') + parts.pop(); + }); + var url = parts.join('/'); + return path.substring(url.lastIndexOf('/') + 1, path.length - 1); + }, + + initOnKeyListeners: function() { + // only install a listener if it is really needed + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS && + !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) + return; + + $(document).keydown(function(event) { + var activeElementType = document.activeElement.tagName; + // don't navigate when in search box, textarea, dropdown or button + if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT' + && activeElementType !== 'BUTTON') { + if (event.altKey || event.ctrlKey || event.metaKey) + return; + + if (!event.shiftKey) { + switch (event.key) { + case 'ArrowLeft': + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) + break; + var prevHref = $('link[rel="prev"]').prop('href'); + if (prevHref) { + window.location.href = prevHref; + return false; + } + break; + case 'ArrowRight': + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) + break; + var nextHref = $('link[rel="next"]').prop('href'); + if (nextHref) { + window.location.href = nextHref; + return false; + } + break; + case 'Escape': + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) + break; + Documentation.hideSearchWords(); + return false; + } + } + + // some keyboard layouts may need Shift to get / + switch (event.key) { + case '/': + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) + break; + Documentation.focusSearchBar(); + return false; + } + } + }); + } +}; + +// quick alias for translations +_ = Documentation.gettext; + +$(document).ready(function() { + Documentation.init(); +}); diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/documentation_options.js b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/documentation_options.js new file mode 100644 index 0000000000000000000000000000000000000000..0b4cd5dcd7920fa0f9daa302f317c8b7e374a0b9 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/documentation_options.js @@ -0,0 +1,14 @@ +var DOCUMENTATION_OPTIONS = { + URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), + VERSION: '12.4', + LANGUAGE: 'None', + COLLAPSE_INDEX: false, + BUILDER: 'html', + FILE_SUFFIX: '.html', + LINK_SUFFIX: '.html', + HAS_SOURCE: false, + SOURCELINK_SUFFIX: '.txt', + NAVIGATION_WITH_KEYS: false, + SHOW_SEARCH_SUMMARY: true, + ENABLE_SEARCH_SHORTCUTS: true, +}; \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/favicon.ico b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..94768b48331f35620bce1a1b53e6648e587cdfe8 Binary files /dev/null and b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/favicon.ico differ diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/jquery-3.5.1.js b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/jquery-3.5.1.js new file mode 100644 index 0000000000000000000000000000000000000000..50937333b99a5e168ac9e8292b22edd7e96c3e6a --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/_static/jquery-3.5.1.js @@ -0,0 +1,10872 @@ +/*! + * jQuery JavaScript Library v3.5.1 + * https://jquery.com/ + * + * Includes Sizzle.js + * https://sizzlejs.com/ + * + * Copyright JS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: 2020-05-04T22:49Z + */ +( function( global, factory ) { + + "use strict"; + + if ( typeof module === "object" && typeof module.exports === "object" ) { + + // For CommonJS and CommonJS-like environments where a proper `window` + // is present, execute the factory and get jQuery. + // For environments that do not have a `window` with a `document` + // (such as Node.js), expose a factory as module.exports. + // This accentuates the need for the creation of a real `window`. + // e.g. var jQuery = require("jquery")(window); + // See ticket #14549 for more info. + module.exports = global.document ? + factory( global, true ) : + function( w ) { + if ( !w.document ) { + throw new Error( "jQuery requires a window with a document" ); + } + return factory( w ); + }; + } else { + factory( global ); + } + +// Pass this if window is not defined yet +} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { + +// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 +// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode +// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common +// enough that all such attempts are guarded in a try block. +"use strict"; + +var arr = []; + +var getProto = Object.getPrototypeOf; + +var slice = arr.slice; + +var flat = arr.flat ? function( array ) { + return arr.flat.call( array ); +} : function( array ) { + return arr.concat.apply( [], array ); +}; + + +var push = arr.push; + +var indexOf = arr.indexOf; + +var class2type = {}; + +var toString = class2type.toString; + +var hasOwn = class2type.hasOwnProperty; + +var fnToString = hasOwn.toString; + +var ObjectFunctionString = fnToString.call( Object ); + +var support = {}; + +var isFunction = function isFunction( obj ) { + + // Support: Chrome <=57, Firefox <=52 + // In some browsers, typeof returns "function" for HTML elements + // (i.e., `typeof document.createElement( "object" ) === "function"`). + // We don't want to classify *any* DOM node as a function. + return typeof obj === "function" && typeof obj.nodeType !== "number"; + }; + + +var isWindow = function isWindow( obj ) { + return obj != null && obj === obj.window; + }; + + +var document = window.document; + + + + var preservedScriptAttributes = { + type: true, + src: true, + nonce: true, + noModule: true + }; + + function DOMEval( code, node, doc ) { + doc = doc || document; + + var i, val, + script = doc.createElement( "script" ); + + script.text = code; + if ( node ) { + for ( i in preservedScriptAttributes ) { + + // Support: Firefox 64+, Edge 18+ + // Some browsers don't support the "nonce" property on scripts. + // On the other hand, just using `getAttribute` is not enough as + // the `nonce` attribute is reset to an empty string whenever it + // becomes browsing-context connected. + // See https://github.com/whatwg/html/issues/2369 + // See https://html.spec.whatwg.org/#nonce-attributes + // The `node.getAttribute` check was added for the sake of + // `jQuery.globalEval` so that it can fake a nonce-containing node + // via an object. + val = node[ i ] || node.getAttribute && node.getAttribute( i ); + if ( val ) { + script.setAttribute( i, val ); + } + } + } + doc.head.appendChild( script ).parentNode.removeChild( script ); + } + + +function toType( obj ) { + if ( obj == null ) { + return obj + ""; + } + + // Support: Android <=2.3 only (functionish RegExp) + return typeof obj === "object" || typeof obj === "function" ? + class2type[ toString.call( obj ) ] || "object" : + typeof obj; +} +/* global Symbol */ +// Defining this global in .eslintrc.json would create a danger of using the global +// unguarded in another place, it seems safer to define global only for this module + + + +var + version = "3.5.1", + + // Define a local copy of jQuery + jQuery = function( selector, context ) { + + // The jQuery object is actually just the init constructor 'enhanced' + // Need init if jQuery is called (just allow error to be thrown if not included) + return new jQuery.fn.init( selector, context ); + }; + +jQuery.fn = jQuery.prototype = { + + // The current version of jQuery being used + jquery: version, + + constructor: jQuery, + + // The default length of a jQuery object is 0 + length: 0, + + toArray: function() { + return slice.call( this ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + + // Return all the elements in a clean array + if ( num == null ) { + return slice.call( this ); + } + + // Return just the one element from the set + return num < 0 ? this[ num + this.length ] : this[ num ]; + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems ) { + + // Build a new jQuery matched element set + var ret = jQuery.merge( this.constructor(), elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + each: function( callback ) { + return jQuery.each( this, callback ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map( this, function( elem, i ) { + return callback.call( elem, i, elem ); + } ) ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ) ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + even: function() { + return this.pushStack( jQuery.grep( this, function( _elem, i ) { + return ( i + 1 ) % 2; + } ) ); + }, + + odd: function() { + return this.pushStack( jQuery.grep( this, function( _elem, i ) { + return i % 2; + } ) ); + }, + + eq: function( i ) { + var len = this.length, + j = +i + ( i < 0 ? len : 0 ); + return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); + }, + + end: function() { + return this.prevObject || this.constructor(); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: arr.sort, + splice: arr.splice +}; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[ 0 ] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + + // Skip the boolean and the target + target = arguments[ i ] || {}; + i++; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !isFunction( target ) ) { + target = {}; + } + + // Extend jQuery itself if only one argument is passed + if ( i === length ) { + target = this; + i--; + } + + for ( ; i < length; i++ ) { + + // Only deal with non-null/undefined values + if ( ( options = arguments[ i ] ) != null ) { + + // Extend the base object + for ( name in options ) { + copy = options[ name ]; + + // Prevent Object.prototype pollution + // Prevent never-ending loop + if ( name === "__proto__" || target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject( copy ) || + ( copyIsArray = Array.isArray( copy ) ) ) ) { + src = target[ name ]; + + // Ensure proper type for the source value + if ( copyIsArray && !Array.isArray( src ) ) { + clone = []; + } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { + clone = {}; + } else { + clone = src; + } + copyIsArray = false; + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend( { + + // Unique for each copy of jQuery on the page + expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), + + // Assume jQuery is ready without the ready module + isReady: true, + + error: function( msg ) { + throw new Error( msg ); + }, + + noop: function() {}, + + isPlainObject: function( obj ) { + var proto, Ctor; + + // Detect obvious negatives + // Use toString instead of jQuery.type to catch host objects + if ( !obj || toString.call( obj ) !== "[object Object]" ) { + return false; + } + + proto = getProto( obj ); + + // Objects with no prototype (e.g., `Object.create( null )`) are plain + if ( !proto ) { + return true; + } + + // Objects with prototype are plain iff they were constructed by a global Object function + Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; + return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; + }, + + isEmptyObject: function( obj ) { + var name; + + for ( name in obj ) { + return false; + } + return true; + }, + + // Evaluates a script in a provided context; falls back to the global one + // if not specified. + globalEval: function( code, options, doc ) { + DOMEval( code, { nonce: options && options.nonce }, doc ); + }, + + each: function( obj, callback ) { + var length, i = 0; + + if ( isArrayLike( obj ) ) { + length = obj.length; + for ( ; i < length; i++ ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } else { + for ( i in obj ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } + + return obj; + }, + + // results is for internal usage only + makeArray: function( arr, results ) { + var ret = results || []; + + if ( arr != null ) { + if ( isArrayLike( Object( arr ) ) ) { + jQuery.merge( ret, + typeof arr === "string" ? + [ arr ] : arr + ); + } else { + push.call( ret, arr ); + } + } + + return ret; + }, + + inArray: function( elem, arr, i ) { + return arr == null ? -1 : indexOf.call( arr, elem, i ); + }, + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + merge: function( first, second ) { + var len = +second.length, + j = 0, + i = first.length; + + for ( ; j < len; j++ ) { + first[ i++ ] = second[ j ]; + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, invert ) { + var callbackInverse, + matches = [], + i = 0, + length = elems.length, + callbackExpect = !invert; + + // Go through the array, only saving the items + // that pass the validator function + for ( ; i < length; i++ ) { + callbackInverse = !callback( elems[ i ], i ); + if ( callbackInverse !== callbackExpect ) { + matches.push( elems[ i ] ); + } + } + + return matches; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var length, value, + i = 0, + ret = []; + + // Go through the array, translating each of the items to their new values + if ( isArrayLike( elems ) ) { + length = elems.length; + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + + // Go through every key on the object, + } else { + for ( i in elems ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + } + + // Flatten any nested arrays + return flat( ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // jQuery.support is not used in Core but other projects attach their + // properties to it so it needs to exist. + support: support +} ); + +if ( typeof Symbol === "function" ) { + jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; +} + +// Populate the class2type map +jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), +function( _i, name ) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +} ); + +function isArrayLike( obj ) { + + // Support: real iOS 8.2 only (not reproducible in simulator) + // `in` check used to prevent JIT error (gh-2145) + // hasOwn isn't used here due to false negatives + // regarding Nodelist length in IE + var length = !!obj && "length" in obj && obj.length, + type = toType( obj ); + + if ( isFunction( obj ) || isWindow( obj ) ) { + return false; + } + + return type === "array" || length === 0 || + typeof length === "number" && length > 0 && ( length - 1 ) in obj; +} +var Sizzle = +/*! + * Sizzle CSS Selector Engine v2.3.5 + * https://sizzlejs.com/ + * + * Copyright JS Foundation and other contributors + * Released under the MIT license + * https://js.foundation/ + * + * Date: 2020-03-14 + */ +( function( window ) { +var i, + support, + Expr, + getText, + isXML, + tokenize, + compile, + select, + outermostContext, + sortInput, + hasDuplicate, + + // Local document vars + setDocument, + document, + docElem, + documentIsHTML, + rbuggyQSA, + rbuggyMatches, + matches, + contains, + + // Instance-specific data + expando = "sizzle" + 1 * new Date(), + preferredDoc = window.document, + dirruns = 0, + done = 0, + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + nonnativeSelectorCache = createCache(), + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + } + return 0; + }, + + // Instance methods + hasOwn = ( {} ).hasOwnProperty, + arr = [], + pop = arr.pop, + pushNative = arr.push, + push = arr.push, + slice = arr.slice, + + // Use a stripped-down indexOf as it's faster than native + // https://jsperf.com/thor-indexof-vs-for/5 + indexOf = function( list, elem ) { + var i = 0, + len = list.length; + for ( ; i < len; i++ ) { + if ( list[ i ] === elem ) { + return i; + } + } + return -1; + }, + + booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" + + "ismap|loop|multiple|open|readonly|required|scoped", + + // Regular expressions + + // http://www.w3.org/TR/css3-selectors/#whitespace + whitespace = "[\\x20\\t\\r\\n\\f]", + + // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram + identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + + "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", + + // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors + attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + + + // Operator (capture 2) + "*([*^$|!~]?=)" + whitespace + + + // "Attribute values must be CSS identifiers [capture 5] + // or strings [capture 3 or capture 4]" + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + + whitespace + "*\\]", + + pseudos = ":(" + identifier + ")(?:\\((" + + + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: + // 1. quoted (capture 3; capture 4 or capture 5) + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + + + // 2. simple (capture 6) + "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + + + // 3. anything else (capture 2) + ".*" + + ")\\)|)", + + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rwhitespace = new RegExp( whitespace + "+", "g" ), + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + + whitespace + "+$", "g" ), + + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), + rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + + "*" ), + rdescend = new RegExp( whitespace + "|>" ), + + rpseudo = new RegExp( pseudos ), + ridentifier = new RegExp( "^" + identifier + "$" ), + + matchExpr = { + "ID": new RegExp( "^#(" + identifier + ")" ), + "CLASS": new RegExp( "^\\.(" + identifier + ")" ), + "TAG": new RegExp( "^(" + identifier + "|[*])" ), + "ATTR": new RegExp( "^" + attributes ), + "PSEUDO": new RegExp( "^" + pseudos ), + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), + + // For use in libraries implementing .is() + // We use this for POS matching in `select` + "needsContext": new RegExp( "^" + whitespace + + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) + }, + + rhtml = /HTML$/i, + rinputs = /^(?:input|select|textarea|button)$/i, + rheader = /^h\d$/i, + + rnative = /^[^{]+\{\s*\[native \w/, + + // Easily-parseable/retrievable ID or TAG or CLASS selectors + rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, + + rsibling = /[+~]/, + + // CSS escapes + // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters + runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ), + funescape = function( escape, nonHex ) { + var high = "0x" + escape.slice( 1 ) - 0x10000; + + return nonHex ? + + // Strip the backslash prefix from a non-hex escape sequence + nonHex : + + // Replace a hexadecimal escape sequence with the encoded Unicode code point + // Support: IE <=11+ + // For values outside the Basic Multilingual Plane (BMP), manually construct a + // surrogate pair + high < 0 ? + String.fromCharCode( high + 0x10000 ) : + String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); + }, + + // CSS string/identifier serialization + // https://drafts.csswg.org/cssom/#common-serializing-idioms + rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, + fcssescape = function( ch, asCodePoint ) { + if ( asCodePoint ) { + + // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER + if ( ch === "\0" ) { + return "\uFFFD"; + } + + // Control characters and (dependent upon position) numbers get escaped as code points + return ch.slice( 0, -1 ) + "\\" + + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; + } + + // Other potentially-special ASCII characters get backslash-escaped + return "\\" + ch; + }, + + // Used for iframes + // See setDocument() + // Removing the function wrapper causes a "Permission Denied" + // error in IE + unloadHandler = function() { + setDocument(); + }, + + inDisabledFieldset = addCombinator( + function( elem ) { + return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset"; + }, + { dir: "parentNode", next: "legend" } + ); + +// Optimize for push.apply( _, NodeList ) +try { + push.apply( + ( arr = slice.call( preferredDoc.childNodes ) ), + preferredDoc.childNodes + ); + + // Support: Android<4.0 + // Detect silently failing push.apply + // eslint-disable-next-line no-unused-expressions + arr[ preferredDoc.childNodes.length ].nodeType; +} catch ( e ) { + push = { apply: arr.length ? + + // Leverage slice if possible + function( target, els ) { + pushNative.apply( target, slice.call( els ) ); + } : + + // Support: IE<9 + // Otherwise append directly + function( target, els ) { + var j = target.length, + i = 0; + + // Can't trust NodeList.length + while ( ( target[ j++ ] = els[ i++ ] ) ) {} + target.length = j - 1; + } + }; +} + +function Sizzle( selector, context, results, seed ) { + var m, i, elem, nid, match, groups, newSelector, + newContext = context && context.ownerDocument, + + // nodeType defaults to 9, since context defaults to document + nodeType = context ? context.nodeType : 9; + + results = results || []; + + // Return early from calls with invalid selector or context + if ( typeof selector !== "string" || !selector || + nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { + + return results; + } + + // Try to shortcut find operations (as opposed to filters) in HTML documents + if ( !seed ) { + setDocument( context ); + context = context || document; + + if ( documentIsHTML ) { + + // If the selector is sufficiently simple, try using a "get*By*" DOM method + // (excepting DocumentFragment context, where the methods don't exist) + if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { + + // ID selector + if ( ( m = match[ 1 ] ) ) { + + // Document context + if ( nodeType === 9 ) { + if ( ( elem = context.getElementById( m ) ) ) { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { + return results; + } + + // Element context + } else { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( newContext && ( elem = newContext.getElementById( m ) ) && + contains( context, elem ) && + elem.id === m ) { + + results.push( elem ); + return results; + } + } + + // Type selector + } else if ( match[ 2 ] ) { + push.apply( results, context.getElementsByTagName( selector ) ); + return results; + + // Class selector + } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName && + context.getElementsByClassName ) { + + push.apply( results, context.getElementsByClassName( m ) ); + return results; + } + } + + // Take advantage of querySelectorAll + if ( support.qsa && + !nonnativeSelectorCache[ selector + " " ] && + ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) && + + // Support: IE 8 only + // Exclude object elements + ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) { + + newSelector = selector; + newContext = context; + + // qSA considers elements outside a scoping root when evaluating child or + // descendant combinators, which is not what we want. + // In such cases, we work around the behavior by prefixing every selector in the + // list with an ID selector referencing the scope context. + // The technique has to be used as well when a leading combinator is used + // as such selectors are not recognized by querySelectorAll. + // Thanks to Andrew Dupont for this technique. + if ( nodeType === 1 && + ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) { + + // Expand context for sibling selectors + newContext = rsibling.test( selector ) && testContext( context.parentNode ) || + context; + + // We can use :scope instead of the ID hack if the browser + // supports it & if we're not changing the context. + if ( newContext !== context || !support.scope ) { + + // Capture the context ID, setting it first if necessary + if ( ( nid = context.getAttribute( "id" ) ) ) { + nid = nid.replace( rcssescape, fcssescape ); + } else { + context.setAttribute( "id", ( nid = expando ) ); + } + } + + // Prefix every selector in the list + groups = tokenize( selector ); + i = groups.length; + while ( i-- ) { + groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + + toSelector( groups[ i ] ); + } + newSelector = groups.join( "," ); + } + + try { + push.apply( results, + newContext.querySelectorAll( newSelector ) + ); + return results; + } catch ( qsaError ) { + nonnativeSelectorCache( selector, true ); + } finally { + if ( nid === expando ) { + context.removeAttribute( "id" ); + } + } + } + } + } + + // All others + return select( selector.replace( rtrim, "$1" ), context, results, seed ); +} + +/** + * Create key-value caches of limited size + * @returns {function(string, object)} Returns the Object data after storing it on itself with + * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) + * deleting the oldest entry + */ +function createCache() { + var keys = []; + + function cache( key, value ) { + + // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) + if ( keys.push( key + " " ) > Expr.cacheLength ) { + + // Only keep the most recent entries + delete cache[ keys.shift() ]; + } + return ( cache[ key + " " ] = value ); + } + return cache; +} + +/** + * Mark a function for special use by Sizzle + * @param {Function} fn The function to mark + */ +function markFunction( fn ) { + fn[ expando ] = true; + return fn; +} + +/** + * Support testing using an element + * @param {Function} fn Passed the created element and returns a boolean result + */ +function assert( fn ) { + var el = document.createElement( "fieldset" ); + + try { + return !!fn( el ); + } catch ( e ) { + return false; + } finally { + + // Remove from its parent by default + if ( el.parentNode ) { + el.parentNode.removeChild( el ); + } + + // release memory in IE + el = null; + } +} + +/** + * Adds the same handler for all of the specified attrs + * @param {String} attrs Pipe-separated list of attributes + * @param {Function} handler The method that will be applied + */ +function addHandle( attrs, handler ) { + var arr = attrs.split( "|" ), + i = arr.length; + + while ( i-- ) { + Expr.attrHandle[ arr[ i ] ] = handler; + } +} + +/** + * Checks document order of two siblings + * @param {Element} a + * @param {Element} b + * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b + */ +function siblingCheck( a, b ) { + var cur = b && a, + diff = cur && a.nodeType === 1 && b.nodeType === 1 && + a.sourceIndex - b.sourceIndex; + + // Use IE sourceIndex if available on both nodes + if ( diff ) { + return diff; + } + + // Check if b follows a + if ( cur ) { + while ( ( cur = cur.nextSibling ) ) { + if ( cur === b ) { + return -1; + } + } + } + + return a ? 1 : -1; +} + +/** + * Returns a function to use in pseudos for input types + * @param {String} type + */ +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for buttons + * @param {String} type + */ +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return ( name === "input" || name === "button" ) && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for :enabled/:disabled + * @param {Boolean} disabled true for :disabled; false for :enabled + */ +function createDisabledPseudo( disabled ) { + + // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable + return function( elem ) { + + // Only certain elements can match :enabled or :disabled + // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled + // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled + if ( "form" in elem ) { + + // Check for inherited disabledness on relevant non-disabled elements: + // * listed form-associated elements in a disabled fieldset + // https://html.spec.whatwg.org/multipage/forms.html#category-listed + // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled + // * option elements in a disabled optgroup + // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled + // All such elements have a "form" property. + if ( elem.parentNode && elem.disabled === false ) { + + // Option elements defer to a parent optgroup if present + if ( "label" in elem ) { + if ( "label" in elem.parentNode ) { + return elem.parentNode.disabled === disabled; + } else { + return elem.disabled === disabled; + } + } + + // Support: IE 6 - 11 + // Use the isDisabled shortcut property to check for disabled fieldset ancestors + return elem.isDisabled === disabled || + + // Where there is no isDisabled, check manually + /* jshint -W018 */ + elem.isDisabled !== !disabled && + inDisabledFieldset( elem ) === disabled; + } + + return elem.disabled === disabled; + + // Try to winnow out elements that can't be disabled before trusting the disabled property. + // Some victims get caught in our net (label, legend, menu, track), but it shouldn't + // even exist on them, let alone have a boolean value. + } else if ( "label" in elem ) { + return elem.disabled === disabled; + } + + // Remaining elements are neither :enabled nor :disabled + return false; + }; +} + +/** + * Returns a function to use in pseudos for positionals + * @param {Function} fn + */ +function createPositionalPseudo( fn ) { + return markFunction( function( argument ) { + argument = +argument; + return markFunction( function( seed, matches ) { + var j, + matchIndexes = fn( [], seed.length, argument ), + i = matchIndexes.length; + + // Match elements found at the specified indexes + while ( i-- ) { + if ( seed[ ( j = matchIndexes[ i ] ) ] ) { + seed[ j ] = !( matches[ j ] = seed[ j ] ); + } + } + } ); + } ); +} + +/** + * Checks a node for validity as a Sizzle context + * @param {Element|Object=} context + * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value + */ +function testContext( context ) { + return context && typeof context.getElementsByTagName !== "undefined" && context; +} + +// Expose support vars for convenience +support = Sizzle.support = {}; + +/** + * Detects XML nodes + * @param {Element|Object} elem An element or a document + * @returns {Boolean} True iff elem is a non-HTML XML node + */ +isXML = Sizzle.isXML = function( elem ) { + var namespace = elem.namespaceURI, + docElem = ( elem.ownerDocument || elem ).documentElement; + + // Support: IE <=8 + // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes + // https://bugs.jquery.com/ticket/4833 + return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" ); +}; + +/** + * Sets document-related variables once based on the current document + * @param {Element|Object} [doc] An element or document object to use to set the document + * @returns {Object} Returns the current document + */ +setDocument = Sizzle.setDocument = function( node ) { + var hasCompare, subWindow, + doc = node ? node.ownerDocument || node : preferredDoc; + + // Return early if doc is invalid or already selected + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { + return document; + } + + // Update global variables + document = doc; + docElem = document.documentElement; + documentIsHTML = !isXML( document ); + + // Support: IE 9 - 11+, Edge 12 - 18+ + // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( preferredDoc != document && + ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { + + // Support: IE 11, Edge + if ( subWindow.addEventListener ) { + subWindow.addEventListener( "unload", unloadHandler, false ); + + // Support: IE 9 - 10 only + } else if ( subWindow.attachEvent ) { + subWindow.attachEvent( "onunload", unloadHandler ); + } + } + + // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only, + // Safari 4 - 5 only, Opera <=11.6 - 12.x only + // IE/Edge & older browsers don't support the :scope pseudo-class. + // Support: Safari 6.0 only + // Safari 6.0 supports :scope but it's an alias of :root there. + support.scope = assert( function( el ) { + docElem.appendChild( el ).appendChild( document.createElement( "div" ) ); + return typeof el.querySelectorAll !== "undefined" && + !el.querySelectorAll( ":scope fieldset div" ).length; + } ); + + /* Attributes + ---------------------------------------------------------------------- */ + + // Support: IE<8 + // Verify that getAttribute really returns attributes and not properties + // (excepting IE8 booleans) + support.attributes = assert( function( el ) { + el.className = "i"; + return !el.getAttribute( "className" ); + } ); + + /* getElement(s)By* + ---------------------------------------------------------------------- */ + + // Check if getElementsByTagName("*") returns only elements + support.getElementsByTagName = assert( function( el ) { + el.appendChild( document.createComment( "" ) ); + return !el.getElementsByTagName( "*" ).length; + } ); + + // Support: IE<9 + support.getElementsByClassName = rnative.test( document.getElementsByClassName ); + + // Support: IE<10 + // Check if getElementById returns elements by name + // The broken getElementById methods don't pick up programmatically-set names, + // so use a roundabout getElementsByName test + support.getById = assert( function( el ) { + docElem.appendChild( el ).id = expando; + return !document.getElementsByName || !document.getElementsByName( expando ).length; + } ); + + // ID filter and find + if ( support.getById ) { + Expr.filter[ "ID" ] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + return elem.getAttribute( "id" ) === attrId; + }; + }; + Expr.find[ "ID" ] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var elem = context.getElementById( id ); + return elem ? [ elem ] : []; + } + }; + } else { + Expr.filter[ "ID" ] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + var node = typeof elem.getAttributeNode !== "undefined" && + elem.getAttributeNode( "id" ); + return node && node.value === attrId; + }; + }; + + // Support: IE 6 - 7 only + // getElementById is not reliable as a find shortcut + Expr.find[ "ID" ] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var node, i, elems, + elem = context.getElementById( id ); + + if ( elem ) { + + // Verify the id attribute + node = elem.getAttributeNode( "id" ); + if ( node && node.value === id ) { + return [ elem ]; + } + + // Fall back on getElementsByName + elems = context.getElementsByName( id ); + i = 0; + while ( ( elem = elems[ i++ ] ) ) { + node = elem.getAttributeNode( "id" ); + if ( node && node.value === id ) { + return [ elem ]; + } + } + } + + return []; + } + }; + } + + // Tag + Expr.find[ "TAG" ] = support.getElementsByTagName ? + function( tag, context ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { + return context.getElementsByTagName( tag ); + + // DocumentFragment nodes don't have gEBTN + } else if ( support.qsa ) { + return context.querySelectorAll( tag ); + } + } : + + function( tag, context ) { + var elem, + tmp = [], + i = 0, + + // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too + results = context.getElementsByTagName( tag ); + + // Filter out possible comments + if ( tag === "*" ) { + while ( ( elem = results[ i++ ] ) ) { + if ( elem.nodeType === 1 ) { + tmp.push( elem ); + } + } + + return tmp; + } + return results; + }; + + // Class + Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) { + if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { + return context.getElementsByClassName( className ); + } + }; + + /* QSA/matchesSelector + ---------------------------------------------------------------------- */ + + // QSA and matchesSelector support + + // matchesSelector(:active) reports false when true (IE9/Opera 11.5) + rbuggyMatches = []; + + // qSa(:focus) reports false when true (Chrome 21) + // We allow this because of a bug in IE8/9 that throws an error + // whenever `document.activeElement` is accessed on an iframe + // So, we allow :focus to pass through QSA all the time to avoid the IE error + // See https://bugs.jquery.com/ticket/13378 + rbuggyQSA = []; + + if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) { + + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert( function( el ) { + + var input; + + // Select is set to empty string on purpose + // This is to test IE's treatment of not explicitly + // setting a boolean content attribute, + // since its presence should be enough + // https://bugs.jquery.com/ticket/12359 + docElem.appendChild( el ).innerHTML = "" + + ""; + + // Support: IE8, Opera 11-12.16 + // Nothing should be selected when empty strings follow ^= or $= or *= + // The test attribute must be unknown in Opera but "safe" for WinRT + // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section + if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) { + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); + } + + // Support: IE8 + // Boolean attributes and "value" are not treated correctly + if ( !el.querySelectorAll( "[selected]" ).length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); + } + + // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ + if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { + rbuggyQSA.push( "~=" ); + } + + // Support: IE 11+, Edge 15 - 18+ + // IE 11/Edge don't find elements on a `[name='']` query in some cases. + // Adding a temporary attribute to the document before the selection works + // around the issue. + // Interestingly, IE 10 & older don't seem to have the issue. + input = document.createElement( "input" ); + input.setAttribute( "name", "" ); + el.appendChild( input ); + if ( !el.querySelectorAll( "[name='']" ).length ) { + rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + + whitespace + "*(?:''|\"\")" ); + } + + // Webkit/Opera - :checked should return selected option elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // IE8 throws error here and will not see later tests + if ( !el.querySelectorAll( ":checked" ).length ) { + rbuggyQSA.push( ":checked" ); + } + + // Support: Safari 8+, iOS 8+ + // https://bugs.webkit.org/show_bug.cgi?id=136851 + // In-page `selector#id sibling-combinator selector` fails + if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { + rbuggyQSA.push( ".#.+[+~]" ); + } + + // Support: Firefox <=3.6 - 5 only + // Old Firefox doesn't throw on a badly-escaped identifier. + el.querySelectorAll( "\\\f" ); + rbuggyQSA.push( "[\\r\\n\\f]" ); + } ); + + assert( function( el ) { + el.innerHTML = "" + + ""; + + // Support: Windows 8 Native Apps + // The type and name attributes are restricted during .innerHTML assignment + var input = document.createElement( "input" ); + input.setAttribute( "type", "hidden" ); + el.appendChild( input ).setAttribute( "name", "D" ); + + // Support: IE8 + // Enforce case-sensitivity of name attribute + if ( el.querySelectorAll( "[name=d]" ).length ) { + rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); + } + + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) + // IE8 throws error here and will not see later tests + if ( el.querySelectorAll( ":enabled" ).length !== 2 ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Support: IE9-11+ + // IE's :disabled selector does not pick up the children of disabled fieldsets + docElem.appendChild( el ).disabled = true; + if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Support: Opera 10 - 11 only + // Opera 10-11 does not throw on post-comma invalid pseudos + el.querySelectorAll( "*,:x" ); + rbuggyQSA.push( ",.*:" ); + } ); + } + + if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches || + docElem.webkitMatchesSelector || + docElem.mozMatchesSelector || + docElem.oMatchesSelector || + docElem.msMatchesSelector ) ) ) ) { + + assert( function( el ) { + + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9) + support.disconnectedMatch = matches.call( el, "*" ); + + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( el, "[s!='']:x" ); + rbuggyMatches.push( "!=", pseudos ); + } ); + } + + rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); + rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) ); + + /* Contains + ---------------------------------------------------------------------- */ + hasCompare = rnative.test( docElem.compareDocumentPosition ); + + // Element contains another + // Purposefully self-exclusive + // As in, an element does not contain itself + contains = hasCompare || rnative.test( docElem.contains ) ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && ( + adown.contains ? + adown.contains( bup ) : + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 + ) ); + } : + function( a, b ) { + if ( b ) { + while ( ( b = b.parentNode ) ) { + if ( b === a ) { + return true; + } + } + } + return false; + }; + + /* Sorting + ---------------------------------------------------------------------- */ + + // Document order sorting + sortOrder = hasCompare ? + function( a, b ) { + + // Flag for duplicate removal + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + // Sort on method existence if only one input has compareDocumentPosition + var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; + if ( compare ) { + return compare; + } + + // Calculate position if both inputs belong to the same document + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? + a.compareDocumentPosition( b ) : + + // Otherwise we know they are disconnected + 1; + + // Disconnected nodes + if ( compare & 1 || + ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { + + // Choose the first element that is related to our preferred document + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( a == document || a.ownerDocument == preferredDoc && + contains( preferredDoc, a ) ) { + return -1; + } + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( b == document || b.ownerDocument == preferredDoc && + contains( preferredDoc, b ) ) { + return 1; + } + + // Maintain original order + return sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + } + + return compare & 4 ? -1 : 1; + } : + function( a, b ) { + + // Exit early if the nodes are identical + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + var cur, + i = 0, + aup = a.parentNode, + bup = b.parentNode, + ap = [ a ], + bp = [ b ]; + + // Parentless nodes are either documents or disconnected + if ( !aup || !bup ) { + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + /* eslint-disable eqeqeq */ + return a == document ? -1 : + b == document ? 1 : + /* eslint-enable eqeqeq */ + aup ? -1 : + bup ? 1 : + sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + + // If the nodes are siblings, we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + } + + // Otherwise we need full lists of their ancestors for comparison + cur = a; + while ( ( cur = cur.parentNode ) ) { + ap.unshift( cur ); + } + cur = b; + while ( ( cur = cur.parentNode ) ) { + bp.unshift( cur ); + } + + // Walk down the tree looking for a discrepancy + while ( ap[ i ] === bp[ i ] ) { + i++; + } + + return i ? + + // Do a sibling check if the nodes have a common ancestor + siblingCheck( ap[ i ], bp[ i ] ) : + + // Otherwise nodes in our document sort first + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + /* eslint-disable eqeqeq */ + ap[ i ] == preferredDoc ? -1 : + bp[ i ] == preferredDoc ? 1 : + /* eslint-enable eqeqeq */ + 0; + }; + + return document; +}; + +Sizzle.matches = function( expr, elements ) { + return Sizzle( expr, null, null, elements ); +}; + +Sizzle.matchesSelector = function( elem, expr ) { + setDocument( elem ); + + if ( support.matchesSelector && documentIsHTML && + !nonnativeSelectorCache[ expr + " " ] && + ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && + ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { + + try { + var ret = matches.call( elem, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || support.disconnectedMatch || + + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { + return ret; + } + } catch ( e ) { + nonnativeSelectorCache( expr, true ); + } + } + + return Sizzle( expr, document, null, [ elem ] ).length > 0; +}; + +Sizzle.contains = function( context, elem ) { + + // Set document vars if needed + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( ( context.ownerDocument || context ) != document ) { + setDocument( context ); + } + return contains( context, elem ); +}; + +Sizzle.attr = function( elem, name ) { + + // Set document vars if needed + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( ( elem.ownerDocument || elem ) != document ) { + setDocument( elem ); + } + + var fn = Expr.attrHandle[ name.toLowerCase() ], + + // Don't get fooled by Object.prototype properties (jQuery #13807) + val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? + fn( elem, name, !documentIsHTML ) : + undefined; + + return val !== undefined ? + val : + support.attributes || !documentIsHTML ? + elem.getAttribute( name ) : + ( val = elem.getAttributeNode( name ) ) && val.specified ? + val.value : + null; +}; + +Sizzle.escape = function( sel ) { + return ( sel + "" ).replace( rcssescape, fcssescape ); +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +/** + * Document sorting and removing duplicates + * @param {ArrayLike} results + */ +Sizzle.uniqueSort = function( results ) { + var elem, + duplicates = [], + j = 0, + i = 0; + + // Unless we *know* we can detect duplicates, assume their presence + hasDuplicate = !support.detectDuplicates; + sortInput = !support.sortStable && results.slice( 0 ); + results.sort( sortOrder ); + + if ( hasDuplicate ) { + while ( ( elem = results[ i++ ] ) ) { + if ( elem === results[ i ] ) { + j = duplicates.push( i ); + } + } + while ( j-- ) { + results.splice( duplicates[ j ], 1 ); + } + } + + // Clear input after sorting to release objects + // See https://github.com/jquery/sizzle/pull/225 + sortInput = null; + + return results; +}; + +/** + * Utility function for retrieving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +getText = Sizzle.getText = function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( !nodeType ) { + + // If no nodeType, this is expected to be an array + while ( ( node = elem[ i++ ] ) ) { + + // Do not traverse comment nodes + ret += getText( node ); + } + } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + + // Use textContent for elements + // innerText usage removed for consistency of new lines (jQuery #11153) + if ( typeof elem.textContent === "string" ) { + return elem.textContent; + } else { + + // Traverse its children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + + // Do not include comment or processing instruction nodes + + return ret; +}; + +Expr = Sizzle.selectors = { + + // Can be adjusted by the user + cacheLength: 50, + + createPseudo: markFunction, + + match: matchExpr, + + attrHandle: {}, + + find: {}, + + relative: { + ">": { dir: "parentNode", first: true }, + " ": { dir: "parentNode" }, + "+": { dir: "previousSibling", first: true }, + "~": { dir: "previousSibling" } + }, + + preFilter: { + "ATTR": function( match ) { + match[ 1 ] = match[ 1 ].replace( runescape, funescape ); + + // Move the given value to match[3] whether quoted or unquoted + match[ 3 ] = ( match[ 3 ] || match[ 4 ] || + match[ 5 ] || "" ).replace( runescape, funescape ); + + if ( match[ 2 ] === "~=" ) { + match[ 3 ] = " " + match[ 3 ] + " "; + } + + return match.slice( 0, 4 ); + }, + + "CHILD": function( match ) { + + /* matches from matchExpr["CHILD"] + 1 type (only|nth|...) + 2 what (child|of-type) + 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) + 4 xn-component of xn+y argument ([+-]?\d*n|) + 5 sign of xn-component + 6 x of xn-component + 7 sign of y-component + 8 y of y-component + */ + match[ 1 ] = match[ 1 ].toLowerCase(); + + if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { + + // nth-* requires argument + if ( !match[ 3 ] ) { + Sizzle.error( match[ 0 ] ); + } + + // numeric x and y parameters for Expr.filter.CHILD + // remember that false/true cast respectively to 0/1 + match[ 4 ] = +( match[ 4 ] ? + match[ 5 ] + ( match[ 6 ] || 1 ) : + 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) ); + match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); + + // other types prohibit arguments + } else if ( match[ 3 ] ) { + Sizzle.error( match[ 0 ] ); + } + + return match; + }, + + "PSEUDO": function( match ) { + var excess, + unquoted = !match[ 6 ] && match[ 2 ]; + + if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) { + return null; + } + + // Accept quoted arguments as-is + if ( match[ 3 ] ) { + match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; + + // Strip excess characters from unquoted arguments + } else if ( unquoted && rpseudo.test( unquoted ) && + + // Get excess from tokenize (recursively) + ( excess = tokenize( unquoted, true ) ) && + + // advance to the next closing parenthesis + ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { + + // excess is a negative index + match[ 0 ] = match[ 0 ].slice( 0, excess ); + match[ 2 ] = unquoted.slice( 0, excess ); + } + + // Return only captures needed by the pseudo filter method (type and argument) + return match.slice( 0, 3 ); + } + }, + + filter: { + + "TAG": function( nodeNameSelector ) { + var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); + return nodeNameSelector === "*" ? + function() { + return true; + } : + function( elem ) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + + "CLASS": function( className ) { + var pattern = classCache[ className + " " ]; + + return pattern || + ( pattern = new RegExp( "(^|" + whitespace + + ")" + className + "(" + whitespace + "|$)" ) ) && classCache( + className, function( elem ) { + return pattern.test( + typeof elem.className === "string" && elem.className || + typeof elem.getAttribute !== "undefined" && + elem.getAttribute( "class" ) || + "" + ); + } ); + }, + + "ATTR": function( name, operator, check ) { + return function( elem ) { + var result = Sizzle.attr( elem, name ); + + if ( result == null ) { + return operator === "!="; + } + if ( !operator ) { + return true; + } + + result += ""; + + /* eslint-disable max-len */ + + return operator === "=" ? result === check : + operator === "!=" ? result !== check : + operator === "^=" ? check && result.indexOf( check ) === 0 : + operator === "*=" ? check && result.indexOf( check ) > -1 : + operator === "$=" ? check && result.slice( -check.length ) === check : + operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : + operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : + false; + /* eslint-enable max-len */ + + }; + }, + + "CHILD": function( type, what, _argument, first, last ) { + var simple = type.slice( 0, 3 ) !== "nth", + forward = type.slice( -4 ) !== "last", + ofType = what === "of-type"; + + return first === 1 && last === 0 ? + + // Shortcut for :nth-*(n) + function( elem ) { + return !!elem.parentNode; + } : + + function( elem, _context, xml ) { + var cache, uniqueCache, outerCache, node, nodeIndex, start, + dir = simple !== forward ? "nextSibling" : "previousSibling", + parent = elem.parentNode, + name = ofType && elem.nodeName.toLowerCase(), + useCache = !xml && !ofType, + diff = false; + + if ( parent ) { + + // :(first|last|only)-(child|of-type) + if ( simple ) { + while ( dir ) { + node = elem; + while ( ( node = node[ dir ] ) ) { + if ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) { + + return false; + } + } + + // Reverse direction for :only-* (if we haven't yet done so) + start = dir = type === "only" && !start && "nextSibling"; + } + return true; + } + + start = [ forward ? parent.firstChild : parent.lastChild ]; + + // non-xml :nth-child(...) stores cache data on `parent` + if ( forward && useCache ) { + + // Seek `elem` from a previously-cached index + + // ...in a gzip-friendly way + node = parent; + outerCache = node[ expando ] || ( node[ expando ] = {} ); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + ( outerCache[ node.uniqueID ] = {} ); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex && cache[ 2 ]; + node = nodeIndex && parent.childNodes[ nodeIndex ]; + + while ( ( node = ++nodeIndex && node && node[ dir ] || + + // Fallback to seeking `elem` from the start + ( diff = nodeIndex = 0 ) || start.pop() ) ) { + + // When found, cache indexes on `parent` and break + if ( node.nodeType === 1 && ++diff && node === elem ) { + uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; + break; + } + } + + } else { + + // Use previously-cached element index if available + if ( useCache ) { + + // ...in a gzip-friendly way + node = elem; + outerCache = node[ expando ] || ( node[ expando ] = {} ); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + ( outerCache[ node.uniqueID ] = {} ); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex; + } + + // xml :nth-child(...) + // or :nth-last-child(...) or :nth(-last)?-of-type(...) + if ( diff === false ) { + + // Use the same loop as above to seek `elem` from the start + while ( ( node = ++nodeIndex && node && node[ dir ] || + ( diff = nodeIndex = 0 ) || start.pop() ) ) { + + if ( ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) && + ++diff ) { + + // Cache the index of each encountered element + if ( useCache ) { + outerCache = node[ expando ] || + ( node[ expando ] = {} ); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + ( outerCache[ node.uniqueID ] = {} ); + + uniqueCache[ type ] = [ dirruns, diff ]; + } + + if ( node === elem ) { + break; + } + } + } + } + } + + // Incorporate the offset, then check against cycle size + diff -= last; + return diff === first || ( diff % first === 0 && diff / first >= 0 ); + } + }; + }, + + "PSEUDO": function( pseudo, argument ) { + + // pseudo-class names are case-insensitive + // http://www.w3.org/TR/selectors/#pseudo-classes + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters + // Remember that setFilters inherits from pseudos + var args, + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || + Sizzle.error( "unsupported pseudo: " + pseudo ); + + // The user may use createPseudo to indicate that + // arguments are needed to create the filter function + // just as Sizzle does + if ( fn[ expando ] ) { + return fn( argument ); + } + + // But maintain support for old signatures + if ( fn.length > 1 ) { + args = [ pseudo, pseudo, "", argument ]; + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? + markFunction( function( seed, matches ) { + var idx, + matched = fn( seed, argument ), + i = matched.length; + while ( i-- ) { + idx = indexOf( seed, matched[ i ] ); + seed[ idx ] = !( matches[ idx ] = matched[ i ] ); + } + } ) : + function( elem ) { + return fn( elem, 0, args ); + }; + } + + return fn; + } + }, + + pseudos: { + + // Potentially complex pseudos + "not": markFunction( function( selector ) { + + // Trim the selector passed to compile + // to avoid treating leading and trailing + // spaces as combinators + var input = [], + results = [], + matcher = compile( selector.replace( rtrim, "$1" ) ); + + return matcher[ expando ] ? + markFunction( function( seed, matches, _context, xml ) { + var elem, + unmatched = matcher( seed, null, xml, [] ), + i = seed.length; + + // Match elements unmatched by `matcher` + while ( i-- ) { + if ( ( elem = unmatched[ i ] ) ) { + seed[ i ] = !( matches[ i ] = elem ); + } + } + } ) : + function( elem, _context, xml ) { + input[ 0 ] = elem; + matcher( input, null, xml, results ); + + // Don't keep the element (issue #299) + input[ 0 ] = null; + return !results.pop(); + }; + } ), + + "has": markFunction( function( selector ) { + return function( elem ) { + return Sizzle( selector, elem ).length > 0; + }; + } ), + + "contains": markFunction( function( text ) { + text = text.replace( runescape, funescape ); + return function( elem ) { + return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1; + }; + } ), + + // "Whether an element is represented by a :lang() selector + // is based solely on the element's language value + // being equal to the identifier C, + // or beginning with the identifier C immediately followed by "-". + // The matching of C against the element's language value is performed case-insensitively. + // The identifier C does not have to be a valid language name." + // http://www.w3.org/TR/selectors/#lang-pseudo + "lang": markFunction( function( lang ) { + + // lang value must be a valid identifier + if ( !ridentifier.test( lang || "" ) ) { + Sizzle.error( "unsupported lang: " + lang ); + } + lang = lang.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + var elemLang; + do { + if ( ( elemLang = documentIsHTML ? + elem.lang : + elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { + + elemLang = elemLang.toLowerCase(); + return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; + } + } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); + return false; + }; + } ), + + // Miscellaneous + "target": function( elem ) { + var hash = window.location && window.location.hash; + return hash && hash.slice( 1 ) === elem.id; + }, + + "root": function( elem ) { + return elem === docElem; + }, + + "focus": function( elem ) { + return elem === document.activeElement && + ( !document.hasFocus || document.hasFocus() ) && + !!( elem.type || elem.href || ~elem.tabIndex ); + }, + + // Boolean properties + "enabled": createDisabledPseudo( false ), + "disabled": createDisabledPseudo( true ), + + "checked": function( elem ) { + + // In CSS3, :checked should return both checked and selected elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + var nodeName = elem.nodeName.toLowerCase(); + return ( nodeName === "input" && !!elem.checked ) || + ( nodeName === "option" && !!elem.selected ); + }, + + "selected": function( elem ) { + + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + // eslint-disable-next-line no-unused-expressions + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + // Contents + "empty": function( elem ) { + + // http://www.w3.org/TR/selectors/#empty-pseudo + // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), + // but not by others (comment: 8; processing instruction: 7; etc.) + // nodeType < 6 works because attributes (2) do not appear as children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + if ( elem.nodeType < 6 ) { + return false; + } + } + return true; + }, + + "parent": function( elem ) { + return !Expr.pseudos[ "empty" ]( elem ); + }, + + // Element/input types + "header": function( elem ) { + return rheader.test( elem.nodeName ); + }, + + "input": function( elem ) { + return rinputs.test( elem.nodeName ); + }, + + "button": function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === "button" || name === "button"; + }, + + "text": function( elem ) { + var attr; + return elem.nodeName.toLowerCase() === "input" && + elem.type === "text" && + + // Support: IE<8 + // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" + ( ( attr = elem.getAttribute( "type" ) ) == null || + attr.toLowerCase() === "text" ); + }, + + // Position-in-collection + "first": createPositionalPseudo( function() { + return [ 0 ]; + } ), + + "last": createPositionalPseudo( function( _matchIndexes, length ) { + return [ length - 1 ]; + } ), + + "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) { + return [ argument < 0 ? argument + length : argument ]; + } ), + + "even": createPositionalPseudo( function( matchIndexes, length ) { + var i = 0; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + } ), + + "odd": createPositionalPseudo( function( matchIndexes, length ) { + var i = 1; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + } ), + + "lt": createPositionalPseudo( function( matchIndexes, length, argument ) { + var i = argument < 0 ? + argument + length : + argument > length ? + length : + argument; + for ( ; --i >= 0; ) { + matchIndexes.push( i ); + } + return matchIndexes; + } ), + + "gt": createPositionalPseudo( function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; ++i < length; ) { + matchIndexes.push( i ); + } + return matchIndexes; + } ) + } +}; + +Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ]; + +// Add button/input type pseudos +for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { + Expr.pseudos[ i ] = createInputPseudo( i ); +} +for ( i in { submit: true, reset: true } ) { + Expr.pseudos[ i ] = createButtonPseudo( i ); +} + +// Easy API for creating new setFilters +function setFilters() {} +setFilters.prototype = Expr.filters = Expr.pseudos; +Expr.setFilters = new setFilters(); + +tokenize = Sizzle.tokenize = function( selector, parseOnly ) { + var matched, match, tokens, type, + soFar, groups, preFilters, + cached = tokenCache[ selector + " " ]; + + if ( cached ) { + return parseOnly ? 0 : cached.slice( 0 ); + } + + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + + while ( soFar ) { + + // Comma and first run + if ( !matched || ( match = rcomma.exec( soFar ) ) ) { + if ( match ) { + + // Don't consume trailing commas as valid + soFar = soFar.slice( match[ 0 ].length ) || soFar; + } + groups.push( ( tokens = [] ) ); + } + + matched = false; + + // Combinators + if ( ( match = rcombinators.exec( soFar ) ) ) { + matched = match.shift(); + tokens.push( { + value: matched, + + // Cast descendant combinators to space + type: match[ 0 ].replace( rtrim, " " ) + } ); + soFar = soFar.slice( matched.length ); + } + + // Filters + for ( type in Expr.filter ) { + if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || + ( match = preFilters[ type ]( match ) ) ) ) { + matched = match.shift(); + tokens.push( { + value: matched, + type: type, + matches: match + } ); + soFar = soFar.slice( matched.length ); + } + } + + if ( !matched ) { + break; + } + } + + // Return the length of the invalid excess + // if we're just parsing + // Otherwise, throw an error or return tokens + return parseOnly ? + soFar.length : + soFar ? + Sizzle.error( selector ) : + + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +}; + +function toSelector( tokens ) { + var i = 0, + len = tokens.length, + selector = ""; + for ( ; i < len; i++ ) { + selector += tokens[ i ].value; + } + return selector; +} + +function addCombinator( matcher, combinator, base ) { + var dir = combinator.dir, + skip = combinator.next, + key = skip || dir, + checkNonElements = base && key === "parentNode", + doneName = done++; + + return combinator.first ? + + // Check against closest ancestor/preceding element + function( elem, context, xml ) { + while ( ( elem = elem[ dir ] ) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + return matcher( elem, context, xml ); + } + } + return false; + } : + + // Check against all ancestor/preceding elements + function( elem, context, xml ) { + var oldCache, uniqueCache, outerCache, + newCache = [ dirruns, doneName ]; + + // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching + if ( xml ) { + while ( ( elem = elem[ dir ] ) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + if ( matcher( elem, context, xml ) ) { + return true; + } + } + } + } else { + while ( ( elem = elem[ dir ] ) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + outerCache = elem[ expando ] || ( elem[ expando ] = {} ); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ elem.uniqueID ] || + ( outerCache[ elem.uniqueID ] = {} ); + + if ( skip && skip === elem.nodeName.toLowerCase() ) { + elem = elem[ dir ] || elem; + } else if ( ( oldCache = uniqueCache[ key ] ) && + oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { + + // Assign to newCache so results back-propagate to previous elements + return ( newCache[ 2 ] = oldCache[ 2 ] ); + } else { + + // Reuse newcache so results back-propagate to previous elements + uniqueCache[ key ] = newCache; + + // A match means we're done; a fail means we have to keep checking + if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { + return true; + } + } + } + } + } + return false; + }; +} + +function elementMatcher( matchers ) { + return matchers.length > 1 ? + function( elem, context, xml ) { + var i = matchers.length; + while ( i-- ) { + if ( !matchers[ i ]( elem, context, xml ) ) { + return false; + } + } + return true; + } : + matchers[ 0 ]; +} + +function multipleContexts( selector, contexts, results ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[ i ], results ); + } + return results; +} + +function condense( unmatched, map, filter, context, xml ) { + var elem, + newUnmatched = [], + i = 0, + len = unmatched.length, + mapped = map != null; + + for ( ; i < len; i++ ) { + if ( ( elem = unmatched[ i ] ) ) { + if ( !filter || filter( elem, context, xml ) ) { + newUnmatched.push( elem ); + if ( mapped ) { + map.push( i ); + } + } + } + } + + return newUnmatched; +} + +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { + if ( postFilter && !postFilter[ expando ] ) { + postFilter = setMatcher( postFilter ); + } + if ( postFinder && !postFinder[ expando ] ) { + postFinder = setMatcher( postFinder, postSelector ); + } + return markFunction( function( seed, results, context, xml ) { + var temp, i, elem, + preMap = [], + postMap = [], + preexisting = results.length, + + // Get initial elements from seed or context + elems = seed || multipleContexts( + selector || "*", + context.nodeType ? [ context ] : context, + [] + ), + + // Prefilter to get matcher input, preserving a map for seed-results synchronization + matcherIn = preFilter && ( seed || !selector ) ? + condense( elems, preMap, preFilter, context, xml ) : + elems, + + matcherOut = matcher ? + + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, + postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results : + matcherIn; + + // Find primary matches + if ( matcher ) { + matcher( matcherIn, matcherOut, context, xml ); + } + + // Apply postFilter + if ( postFilter ) { + temp = condense( matcherOut, postMap ); + postFilter( temp, [], context, xml ); + + // Un-match failing elements by moving them back to matcherIn + i = temp.length; + while ( i-- ) { + if ( ( elem = temp[ i ] ) ) { + matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); + } + } + } + + if ( seed ) { + if ( postFinder || preFilter ) { + if ( postFinder ) { + + // Get the final matcherOut by condensing this intermediate into postFinder contexts + temp = []; + i = matcherOut.length; + while ( i-- ) { + if ( ( elem = matcherOut[ i ] ) ) { + + // Restore matcherIn since elem is not yet a final match + temp.push( ( matcherIn[ i ] = elem ) ); + } + } + postFinder( null, ( matcherOut = [] ), temp, xml ); + } + + // Move matched elements from seed to results to keep them synchronized + i = matcherOut.length; + while ( i-- ) { + if ( ( elem = matcherOut[ i ] ) && + ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) { + + seed[ temp ] = !( results[ temp ] = elem ); + } + } + } + + // Add elements to results, through postFinder if defined + } else { + matcherOut = condense( + matcherOut === results ? + matcherOut.splice( preexisting, matcherOut.length ) : + matcherOut + ); + if ( postFinder ) { + postFinder( null, results, matcherOut, xml ); + } else { + push.apply( results, matcherOut ); + } + } + } ); +} + +function matcherFromTokens( tokens ) { + var checkContext, matcher, j, + len = tokens.length, + leadingRelative = Expr.relative[ tokens[ 0 ].type ], + implicitRelative = leadingRelative || Expr.relative[ " " ], + i = leadingRelative ? 1 : 0, + + // The foundational matcher ensures that elements are reachable from top-level context(s) + matchContext = addCombinator( function( elem ) { + return elem === checkContext; + }, implicitRelative, true ), + matchAnyContext = addCombinator( function( elem ) { + return indexOf( checkContext, elem ) > -1; + }, implicitRelative, true ), + matchers = [ function( elem, context, xml ) { + var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + ( checkContext = context ).nodeType ? + matchContext( elem, context, xml ) : + matchAnyContext( elem, context, xml ) ); + + // Avoid hanging onto element (issue #299) + checkContext = null; + return ret; + } ]; + + for ( ; i < len; i++ ) { + if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { + matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; + } else { + matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); + + // Return special upon seeing a positional matcher + if ( matcher[ expando ] ) { + + // Find the next relative operator (if any) for proper handling + j = ++i; + for ( ; j < len; j++ ) { + if ( Expr.relative[ tokens[ j ].type ] ) { + break; + } + } + return setMatcher( + i > 1 && elementMatcher( matchers ), + i > 1 && toSelector( + + // If the preceding token was a descendant combinator, insert an implicit any-element `*` + tokens + .slice( 0, i - 1 ) + .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) + ).replace( rtrim, "$1" ), + matcher, + i < j && matcherFromTokens( tokens.slice( i, j ) ), + j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), + j < len && toSelector( tokens ) + ); + } + matchers.push( matcher ); + } + } + + return elementMatcher( matchers ); +} + +function matcherFromGroupMatchers( elementMatchers, setMatchers ) { + var bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function( seed, context, xml, results, outermost ) { + var elem, j, matcher, + matchedCount = 0, + i = "0", + unmatched = seed && [], + setMatched = [], + contextBackup = outermostContext, + + // We must always have either seed elements or outermost context + elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ), + + // Use integer dirruns iff this is the outermost matcher + dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), + len = elems.length; + + if ( outermost ) { + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + outermostContext = context == document || context || outermost; + } + + // Add elements passing elementMatchers directly to results + // Support: IE<9, Safari + // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id + for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { + if ( byElement && elem ) { + j = 0; + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( !context && elem.ownerDocument != document ) { + setDocument( elem ); + xml = !documentIsHTML; + } + while ( ( matcher = elementMatchers[ j++ ] ) ) { + if ( matcher( elem, context || document, xml ) ) { + results.push( elem ); + break; + } + } + if ( outermost ) { + dirruns = dirrunsUnique; + } + } + + // Track unmatched elements for set filters + if ( bySet ) { + + // They will have gone through all possible matchers + if ( ( elem = !matcher && elem ) ) { + matchedCount--; + } + + // Lengthen the array for every element, matched or not + if ( seed ) { + unmatched.push( elem ); + } + } + } + + // `i` is now the count of elements visited above, and adding it to `matchedCount` + // makes the latter nonnegative. + matchedCount += i; + + // Apply set filters to unmatched elements + // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` + // equals `i`), unless we didn't visit _any_ elements in the above loop because we have + // no element matchers and no seed. + // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that + // case, which will result in a "00" `matchedCount` that differs from `i` but is also + // numerically zero. + if ( bySet && i !== matchedCount ) { + j = 0; + while ( ( matcher = setMatchers[ j++ ] ) ) { + matcher( unmatched, setMatched, context, xml ); + } + + if ( seed ) { + + // Reintegrate element matches to eliminate the need for sorting + if ( matchedCount > 0 ) { + while ( i-- ) { + if ( !( unmatched[ i ] || setMatched[ i ] ) ) { + setMatched[ i ] = pop.call( results ); + } + } + } + + // Discard index placeholder values to get only actual matches + setMatched = condense( setMatched ); + } + + // Add matches to results + push.apply( results, setMatched ); + + // Seedless set matches succeeding multiple successful matchers stipulate sorting + if ( outermost && !seed && setMatched.length > 0 && + ( matchedCount + setMatchers.length ) > 1 ) { + + Sizzle.uniqueSort( results ); + } + } + + // Override manipulation of globals by nested matchers + if ( outermost ) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + + return unmatched; + }; + + return bySet ? + markFunction( superMatcher ) : + superMatcher; +} + +compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[ selector + " " ]; + + if ( !cached ) { + + // Generate a function of recursive functions that can be used to check each element + if ( !match ) { + match = tokenize( selector ); + } + i = match.length; + while ( i-- ) { + cached = matcherFromTokens( match[ i ] ); + if ( cached[ expando ] ) { + setMatchers.push( cached ); + } else { + elementMatchers.push( cached ); + } + } + + // Cache the compiled function + cached = compilerCache( + selector, + matcherFromGroupMatchers( elementMatchers, setMatchers ) + ); + + // Save selector and tokenization + cached.selector = selector; + } + return cached; +}; + +/** + * A low-level selection function that works with Sizzle's compiled + * selector functions + * @param {String|Function} selector A selector or a pre-compiled + * selector function built with Sizzle.compile + * @param {Element} context + * @param {Array} [results] + * @param {Array} [seed] A set of elements to match against + */ +select = Sizzle.select = function( selector, context, results, seed ) { + var i, tokens, token, type, find, + compiled = typeof selector === "function" && selector, + match = !seed && tokenize( ( selector = compiled.selector || selector ) ); + + results = results || []; + + // Try to minimize operations if there is only one selector in the list and no seed + // (the latter of which guarantees us context) + if ( match.length === 1 ) { + + // Reduce context if the leading compound selector is an ID + tokens = match[ 0 ] = match[ 0 ].slice( 0 ); + if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && + context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { + + context = ( Expr.find[ "ID" ]( token.matches[ 0 ] + .replace( runescape, funescape ), context ) || [] )[ 0 ]; + if ( !context ) { + return results; + + // Precompiled matchers will still verify ancestry, so step up a level + } else if ( compiled ) { + context = context.parentNode; + } + + selector = selector.slice( tokens.shift().value.length ); + } + + // Fetch a seed set for right-to-left matching + i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length; + while ( i-- ) { + token = tokens[ i ]; + + // Abort if we hit a combinator + if ( Expr.relative[ ( type = token.type ) ] ) { + break; + } + if ( ( find = Expr.find[ type ] ) ) { + + // Search, expanding context for leading sibling combinators + if ( ( seed = find( + token.matches[ 0 ].replace( runescape, funescape ), + rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) || + context + ) ) ) { + + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && toSelector( tokens ); + if ( !selector ) { + push.apply( results, seed ); + return results; + } + + break; + } + } + } + } + + // Compile and execute a filtering function if one is not provided + // Provide `match` to avoid retokenization if we modified the selector above + ( compiled || compile( selector, match ) )( + seed, + context, + !documentIsHTML, + results, + !context || rsibling.test( selector ) && testContext( context.parentNode ) || context + ); + return results; +}; + +// One-time assignments + +// Sort stability +support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; + +// Support: Chrome 14-35+ +// Always assume duplicates if they aren't passed to the comparison function +support.detectDuplicates = !!hasDuplicate; + +// Initialize against the default document +setDocument(); + +// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) +// Detached nodes confoundingly follow *each other* +support.sortDetached = assert( function( el ) { + + // Should return 1, but returns 4 (following) + return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; +} ); + +// Support: IE<8 +// Prevent attribute/property "interpolation" +// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx +if ( !assert( function( el ) { + el.innerHTML = ""; + return el.firstChild.getAttribute( "href" ) === "#"; +} ) ) { + addHandle( "type|href|height|width", function( elem, name, isXML ) { + if ( !isXML ) { + return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); + } + } ); +} + +// Support: IE<9 +// Use defaultValue in place of getAttribute("value") +if ( !support.attributes || !assert( function( el ) { + el.innerHTML = ""; + el.firstChild.setAttribute( "value", "" ); + return el.firstChild.getAttribute( "value" ) === ""; +} ) ) { + addHandle( "value", function( elem, _name, isXML ) { + if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { + return elem.defaultValue; + } + } ); +} + +// Support: IE<9 +// Use getAttributeNode to fetch booleans when getAttribute lies +if ( !assert( function( el ) { + return el.getAttribute( "disabled" ) == null; +} ) ) { + addHandle( booleans, function( elem, name, isXML ) { + var val; + if ( !isXML ) { + return elem[ name ] === true ? name.toLowerCase() : + ( val = elem.getAttributeNode( name ) ) && val.specified ? + val.value : + null; + } + } ); +} + +return Sizzle; + +} )( window ); + + + +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; + +// Deprecated +jQuery.expr[ ":" ] = jQuery.expr.pseudos; +jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; +jQuery.escapeSelector = Sizzle.escape; + + + + +var dir = function( elem, dir, until ) { + var matched = [], + truncate = until !== undefined; + + while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { + if ( elem.nodeType === 1 ) { + if ( truncate && jQuery( elem ).is( until ) ) { + break; + } + matched.push( elem ); + } + } + return matched; +}; + + +var siblings = function( n, elem ) { + var matched = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + matched.push( n ); + } + } + + return matched; +}; + + +var rneedsContext = jQuery.expr.match.needsContext; + + + +function nodeName( elem, name ) { + + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + +}; +var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); + + + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, not ) { + if ( isFunction( qualifier ) ) { + return jQuery.grep( elements, function( elem, i ) { + return !!qualifier.call( elem, i, elem ) !== not; + } ); + } + + // Single element + if ( qualifier.nodeType ) { + return jQuery.grep( elements, function( elem ) { + return ( elem === qualifier ) !== not; + } ); + } + + // Arraylike of elements (jQuery, arguments, Array) + if ( typeof qualifier !== "string" ) { + return jQuery.grep( elements, function( elem ) { + return ( indexOf.call( qualifier, elem ) > -1 ) !== not; + } ); + } + + // Filtered directly for both simple and complex selectors + return jQuery.filter( qualifier, elements, not ); +} + +jQuery.filter = function( expr, elems, not ) { + var elem = elems[ 0 ]; + + if ( not ) { + expr = ":not(" + expr + ")"; + } + + if ( elems.length === 1 && elem.nodeType === 1 ) { + return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; + } + + return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { + return elem.nodeType === 1; + } ) ); +}; + +jQuery.fn.extend( { + find: function( selector ) { + var i, ret, + len = this.length, + self = this; + + if ( typeof selector !== "string" ) { + return this.pushStack( jQuery( selector ).filter( function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + } ) ); + } + + ret = this.pushStack( [] ); + + for ( i = 0; i < len; i++ ) { + jQuery.find( selector, self[ i ], ret ); + } + + return len > 1 ? jQuery.uniqueSort( ret ) : ret; + }, + filter: function( selector ) { + return this.pushStack( winnow( this, selector || [], false ) ); + }, + not: function( selector ) { + return this.pushStack( winnow( this, selector || [], true ) ); + }, + is: function( selector ) { + return !!winnow( + this, + + // If this is a positional/relative selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + typeof selector === "string" && rneedsContext.test( selector ) ? + jQuery( selector ) : + selector || [], + false + ).length; + } +} ); + + +// Initialize a jQuery object + + +// A central reference to the root jQuery(document) +var rootjQuery, + + // A simple way to check for HTML strings + // Prioritize #id over to avoid XSS via location.hash (#9521) + // Strict HTML recognition (#11290: must start with <) + // Shortcut simple #id case for speed + rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, + + init = jQuery.fn.init = function( selector, context, root ) { + var match, elem; + + // HANDLE: $(""), $(null), $(undefined), $(false) + if ( !selector ) { + return this; + } + + // Method init() accepts an alternate rootjQuery + // so migrate can support jQuery.sub (gh-2101) + root = root || rootjQuery; + + // Handle HTML strings + if ( typeof selector === "string" ) { + if ( selector[ 0 ] === "<" && + selector[ selector.length - 1 ] === ">" && + selector.length >= 3 ) { + + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = rquickExpr.exec( selector ); + } + + // Match html or make sure no context is specified for #id + if ( match && ( match[ 1 ] || !context ) ) { + + // HANDLE: $(html) -> $(array) + if ( match[ 1 ] ) { + context = context instanceof jQuery ? context[ 0 ] : context; + + // Option to run scripts is true for back-compat + // Intentionally let the error be thrown if parseHTML is not present + jQuery.merge( this, jQuery.parseHTML( + match[ 1 ], + context && context.nodeType ? context.ownerDocument || context : document, + true + ) ); + + // HANDLE: $(html, props) + if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { + for ( match in context ) { + + // Properties of context are called as methods if possible + if ( isFunction( this[ match ] ) ) { + this[ match ]( context[ match ] ); + + // ...and otherwise set as attributes + } else { + this.attr( match, context[ match ] ); + } + } + } + + return this; + + // HANDLE: $(#id) + } else { + elem = document.getElementById( match[ 2 ] ); + + if ( elem ) { + + // Inject the element directly into the jQuery object + this[ 0 ] = elem; + this.length = 1; + } + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return ( context || root ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(DOMElement) + } else if ( selector.nodeType ) { + this[ 0 ] = selector; + this.length = 1; + return this; + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( isFunction( selector ) ) { + return root.ready !== undefined ? + root.ready( selector ) : + + // Execute immediately if ready is not present + selector( jQuery ); + } + + return jQuery.makeArray( selector, this ); + }; + +// Give the init function the jQuery prototype for later instantiation +init.prototype = jQuery.fn; + +// Initialize central reference +rootjQuery = jQuery( document ); + + +var rparentsprev = /^(?:parents|prev(?:Until|All))/, + + // Methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend( { + has: function( target ) { + var targets = jQuery( target, this ), + l = targets.length; + + return this.filter( function() { + var i = 0; + for ( ; i < l; i++ ) { + if ( jQuery.contains( this, targets[ i ] ) ) { + return true; + } + } + } ); + }, + + closest: function( selectors, context ) { + var cur, + i = 0, + l = this.length, + matched = [], + targets = typeof selectors !== "string" && jQuery( selectors ); + + // Positional selectors never match, since there's no _selection_ context + if ( !rneedsContext.test( selectors ) ) { + for ( ; i < l; i++ ) { + for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { + + // Always skip document fragments + if ( cur.nodeType < 11 && ( targets ? + targets.index( cur ) > -1 : + + // Don't pass non-elements to Sizzle + cur.nodeType === 1 && + jQuery.find.matchesSelector( cur, selectors ) ) ) { + + matched.push( cur ); + break; + } + } + } + } + + return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); + }, + + // Determine the position of an element within the set + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; + } + + // Index in selector + if ( typeof elem === "string" ) { + return indexOf.call( jQuery( elem ), this[ 0 ] ); + } + + // Locate the position of the desired element + return indexOf.call( this, + + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[ 0 ] : elem + ); + }, + + add: function( selector, context ) { + return this.pushStack( + jQuery.uniqueSort( + jQuery.merge( this.get(), jQuery( selector, context ) ) + ) + ); + }, + + addBack: function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter( selector ) + ); + } +} ); + +function sibling( cur, dir ) { + while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} + return cur; +} + +jQuery.each( { + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, _i, until ) { + return dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return sibling( elem, "nextSibling" ); + }, + prev: function( elem ) { + return sibling( elem, "previousSibling" ); + }, + nextAll: function( elem ) { + return dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, _i, until ) { + return dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, _i, until ) { + return dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return siblings( ( elem.parentNode || {} ).firstChild, elem ); + }, + children: function( elem ) { + return siblings( elem.firstChild ); + }, + contents: function( elem ) { + if ( elem.contentDocument != null && + + // Support: IE 11+ + // elements with no `data` attribute has an object + // `contentDocument` with a `null` prototype. + getProto( elem.contentDocument ) ) { + + return elem.contentDocument; + } + + // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only + // Treat the template element as a regular one in browsers that + // don't support it. + if ( nodeName( elem, "template" ) ) { + elem = elem.content || elem; + } + + return jQuery.merge( [], elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var matched = jQuery.map( this, fn, until ); + + if ( name.slice( -5 ) !== "Until" ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + matched = jQuery.filter( selector, matched ); + } + + if ( this.length > 1 ) { + + // Remove duplicates + if ( !guaranteedUnique[ name ] ) { + jQuery.uniqueSort( matched ); + } + + // Reverse order for parents* and prev-derivatives + if ( rparentsprev.test( name ) ) { + matched.reverse(); + } + } + + return this.pushStack( matched ); + }; +} ); +var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); + + + +// Convert String-formatted options into Object-formatted ones +function createOptions( options ) { + var object = {}; + jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { + object[ flag ] = true; + } ); + return object; +} + +/* + * Create a callback list using the following parameters: + * + * options: an optional list of space-separated options that will change how + * the callback list behaves or a more traditional option object + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible options: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +jQuery.Callbacks = function( options ) { + + // Convert options from String-formatted to Object-formatted if needed + // (we check in cache first) + options = typeof options === "string" ? + createOptions( options ) : + jQuery.extend( {}, options ); + + var // Flag to know if list is currently firing + firing, + + // Last fire value for non-forgettable lists + memory, + + // Flag to know if list was already fired + fired, + + // Flag to prevent firing + locked, + + // Actual callback list + list = [], + + // Queue of execution data for repeatable lists + queue = [], + + // Index of currently firing callback (modified by add/remove as needed) + firingIndex = -1, + + // Fire callbacks + fire = function() { + + // Enforce single-firing + locked = locked || options.once; + + // Execute callbacks for all pending executions, + // respecting firingIndex overrides and runtime changes + fired = firing = true; + for ( ; queue.length; firingIndex = -1 ) { + memory = queue.shift(); + while ( ++firingIndex < list.length ) { + + // Run callback and check for early termination + if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && + options.stopOnFalse ) { + + // Jump to end and forget the data so .add doesn't re-fire + firingIndex = list.length; + memory = false; + } + } + } + + // Forget the data if we're done with it + if ( !options.memory ) { + memory = false; + } + + firing = false; + + // Clean up if we're done firing for good + if ( locked ) { + + // Keep an empty list if we have data for future add calls + if ( memory ) { + list = []; + + // Otherwise, this object is spent + } else { + list = ""; + } + } + }, + + // Actual Callbacks object + self = { + + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + + // If we have memory from a past run, we should fire after adding + if ( memory && !firing ) { + firingIndex = list.length - 1; + queue.push( memory ); + } + + ( function add( args ) { + jQuery.each( args, function( _, arg ) { + if ( isFunction( arg ) ) { + if ( !options.unique || !self.has( arg ) ) { + list.push( arg ); + } + } else if ( arg && arg.length && toType( arg ) !== "string" ) { + + // Inspect recursively + add( arg ); + } + } ); + } )( arguments ); + + if ( memory && !firing ) { + fire(); + } + } + return this; + }, + + // Remove a callback from the list + remove: function() { + jQuery.each( arguments, function( _, arg ) { + var index; + while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + + // Handle firing indexes + if ( index <= firingIndex ) { + firingIndex--; + } + } + } ); + return this; + }, + + // Check if a given callback is in the list. + // If no argument is given, return whether or not list has callbacks attached. + has: function( fn ) { + return fn ? + jQuery.inArray( fn, list ) > -1 : + list.length > 0; + }, + + // Remove all callbacks from the list + empty: function() { + if ( list ) { + list = []; + } + return this; + }, + + // Disable .fire and .add + // Abort any current/pending executions + // Clear all callbacks and values + disable: function() { + locked = queue = []; + list = memory = ""; + return this; + }, + disabled: function() { + return !list; + }, + + // Disable .fire + // Also disable .add unless we have memory (since it would have no effect) + // Abort any pending executions + lock: function() { + locked = queue = []; + if ( !memory && !firing ) { + list = memory = ""; + } + return this; + }, + locked: function() { + return !!locked; + }, + + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + if ( !locked ) { + args = args || []; + args = [ context, args.slice ? args.slice() : args ]; + queue.push( args ); + if ( !firing ) { + fire(); + } + } + return this; + }, + + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + + // To know if the callbacks have already been called at least once + fired: function() { + return !!fired; + } + }; + + return self; +}; + + +function Identity( v ) { + return v; +} +function Thrower( ex ) { + throw ex; +} + +function adoptValue( value, resolve, reject, noValue ) { + var method; + + try { + + // Check for promise aspect first to privilege synchronous behavior + if ( value && isFunction( ( method = value.promise ) ) ) { + method.call( value ).done( resolve ).fail( reject ); + + // Other thenables + } else if ( value && isFunction( ( method = value.then ) ) ) { + method.call( value, resolve, reject ); + + // Other non-thenables + } else { + + // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: + // * false: [ value ].slice( 0 ) => resolve( value ) + // * true: [ value ].slice( 1 ) => resolve() + resolve.apply( undefined, [ value ].slice( noValue ) ); + } + + // For Promises/A+, convert exceptions into rejections + // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in + // Deferred#then to conditionally suppress rejection. + } catch ( value ) { + + // Support: Android 4.0 only + // Strict mode functions invoked without .call/.apply get global-object context + reject.apply( undefined, [ value ] ); + } +} + +jQuery.extend( { + + Deferred: function( func ) { + var tuples = [ + + // action, add listener, callbacks, + // ... .then handlers, argument index, [final state] + [ "notify", "progress", jQuery.Callbacks( "memory" ), + jQuery.Callbacks( "memory" ), 2 ], + [ "resolve", "done", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 0, "resolved" ], + [ "reject", "fail", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 1, "rejected" ] + ], + state = "pending", + promise = { + state: function() { + return state; + }, + always: function() { + deferred.done( arguments ).fail( arguments ); + return this; + }, + "catch": function( fn ) { + return promise.then( null, fn ); + }, + + // Keep pipe for back-compat + pipe: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; + + return jQuery.Deferred( function( newDefer ) { + jQuery.each( tuples, function( _i, tuple ) { + + // Map tuples (progress, done, fail) to arguments (done, fail, progress) + var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; + + // deferred.progress(function() { bind to newDefer or newDefer.notify }) + // deferred.done(function() { bind to newDefer or newDefer.resolve }) + // deferred.fail(function() { bind to newDefer or newDefer.reject }) + deferred[ tuple[ 1 ] ]( function() { + var returned = fn && fn.apply( this, arguments ); + if ( returned && isFunction( returned.promise ) ) { + returned.promise() + .progress( newDefer.notify ) + .done( newDefer.resolve ) + .fail( newDefer.reject ); + } else { + newDefer[ tuple[ 0 ] + "With" ]( + this, + fn ? [ returned ] : arguments + ); + } + } ); + } ); + fns = null; + } ).promise(); + }, + then: function( onFulfilled, onRejected, onProgress ) { + var maxDepth = 0; + function resolve( depth, deferred, handler, special ) { + return function() { + var that = this, + args = arguments, + mightThrow = function() { + var returned, then; + + // Support: Promises/A+ section 2.3.3.3.3 + // https://promisesaplus.com/#point-59 + // Ignore double-resolution attempts + if ( depth < maxDepth ) { + return; + } + + returned = handler.apply( that, args ); + + // Support: Promises/A+ section 2.3.1 + // https://promisesaplus.com/#point-48 + if ( returned === deferred.promise() ) { + throw new TypeError( "Thenable self-resolution" ); + } + + // Support: Promises/A+ sections 2.3.3.1, 3.5 + // https://promisesaplus.com/#point-54 + // https://promisesaplus.com/#point-75 + // Retrieve `then` only once + then = returned && + + // Support: Promises/A+ section 2.3.4 + // https://promisesaplus.com/#point-64 + // Only check objects and functions for thenability + ( typeof returned === "object" || + typeof returned === "function" ) && + returned.then; + + // Handle a returned thenable + if ( isFunction( then ) ) { + + // Special processors (notify) just wait for resolution + if ( special ) { + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ) + ); + + // Normal processors (resolve) also hook into progress + } else { + + // ...and disregard older resolution values + maxDepth++; + + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ), + resolve( maxDepth, deferred, Identity, + deferred.notifyWith ) + ); + } + + // Handle all other returned values + } else { + + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Identity ) { + that = undefined; + args = [ returned ]; + } + + // Process the value(s) + // Default process is resolve + ( special || deferred.resolveWith )( that, args ); + } + }, + + // Only normal processors (resolve) catch and reject exceptions + process = special ? + mightThrow : + function() { + try { + mightThrow(); + } catch ( e ) { + + if ( jQuery.Deferred.exceptionHook ) { + jQuery.Deferred.exceptionHook( e, + process.stackTrace ); + } + + // Support: Promises/A+ section 2.3.3.3.4.1 + // https://promisesaplus.com/#point-61 + // Ignore post-resolution exceptions + if ( depth + 1 >= maxDepth ) { + + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Thrower ) { + that = undefined; + args = [ e ]; + } + + deferred.rejectWith( that, args ); + } + } + }; + + // Support: Promises/A+ section 2.3.3.3.1 + // https://promisesaplus.com/#point-57 + // Re-resolve promises immediately to dodge false rejection from + // subsequent errors + if ( depth ) { + process(); + } else { + + // Call an optional hook to record the stack, in case of exception + // since it's otherwise lost when execution goes async + if ( jQuery.Deferred.getStackHook ) { + process.stackTrace = jQuery.Deferred.getStackHook(); + } + window.setTimeout( process ); + } + }; + } + + return jQuery.Deferred( function( newDefer ) { + + // progress_handlers.add( ... ) + tuples[ 0 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onProgress ) ? + onProgress : + Identity, + newDefer.notifyWith + ) + ); + + // fulfilled_handlers.add( ... ) + tuples[ 1 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onFulfilled ) ? + onFulfilled : + Identity + ) + ); + + // rejected_handlers.add( ... ) + tuples[ 2 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onRejected ) ? + onRejected : + Thrower + ) + ); + } ).promise(); + }, + + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + return obj != null ? jQuery.extend( obj, promise ) : promise; + } + }, + deferred = {}; + + // Add list-specific methods + jQuery.each( tuples, function( i, tuple ) { + var list = tuple[ 2 ], + stateString = tuple[ 5 ]; + + // promise.progress = list.add + // promise.done = list.add + // promise.fail = list.add + promise[ tuple[ 1 ] ] = list.add; + + // Handle state + if ( stateString ) { + list.add( + function() { + + // state = "resolved" (i.e., fulfilled) + // state = "rejected" + state = stateString; + }, + + // rejected_callbacks.disable + // fulfilled_callbacks.disable + tuples[ 3 - i ][ 2 ].disable, + + // rejected_handlers.disable + // fulfilled_handlers.disable + tuples[ 3 - i ][ 3 ].disable, + + // progress_callbacks.lock + tuples[ 0 ][ 2 ].lock, + + // progress_handlers.lock + tuples[ 0 ][ 3 ].lock + ); + } + + // progress_handlers.fire + // fulfilled_handlers.fire + // rejected_handlers.fire + list.add( tuple[ 3 ].fire ); + + // deferred.notify = function() { deferred.notifyWith(...) } + // deferred.resolve = function() { deferred.resolveWith(...) } + // deferred.reject = function() { deferred.rejectWith(...) } + deferred[ tuple[ 0 ] ] = function() { + deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); + return this; + }; + + // deferred.notifyWith = list.fireWith + // deferred.resolveWith = list.fireWith + // deferred.rejectWith = list.fireWith + deferred[ tuple[ 0 ] + "With" ] = list.fireWith; + } ); + + // Make the deferred a promise + promise.promise( deferred ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( singleValue ) { + var + + // count of uncompleted subordinates + remaining = arguments.length, + + // count of unprocessed arguments + i = remaining, + + // subordinate fulfillment data + resolveContexts = Array( i ), + resolveValues = slice.call( arguments ), + + // the master Deferred + master = jQuery.Deferred(), + + // subordinate callback factory + updateFunc = function( i ) { + return function( value ) { + resolveContexts[ i ] = this; + resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; + if ( !( --remaining ) ) { + master.resolveWith( resolveContexts, resolveValues ); + } + }; + }; + + // Single- and empty arguments are adopted like Promise.resolve + if ( remaining <= 1 ) { + adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject, + !remaining ); + + // Use .then() to unwrap secondary thenables (cf. gh-3000) + if ( master.state() === "pending" || + isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { + + return master.then(); + } + } + + // Multiple arguments are aggregated like Promise.all array elements + while ( i-- ) { + adoptValue( resolveValues[ i ], updateFunc( i ), master.reject ); + } + + return master.promise(); + } +} ); + + +// These usually indicate a programmer mistake during development, +// warn about them ASAP rather than swallowing them by default. +var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; + +jQuery.Deferred.exceptionHook = function( error, stack ) { + + // Support: IE 8 - 9 only + // Console exists when dev tools are open, which can happen at any time + if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { + window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); + } +}; + + + + +jQuery.readyException = function( error ) { + window.setTimeout( function() { + throw error; + } ); +}; + + + + +// The deferred used on DOM ready +var readyList = jQuery.Deferred(); + +jQuery.fn.ready = function( fn ) { + + readyList + .then( fn ) + + // Wrap jQuery.readyException in a function so that the lookup + // happens at the time of error handling instead of callback + // registration. + .catch( function( error ) { + jQuery.readyException( error ); + } ); + + return this; +}; + +jQuery.extend( { + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Handle when the DOM is ready + ready: function( wait ) { + + // Abort if there are pending holds or we're already ready + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { + return; + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + } +} ); + +jQuery.ready.then = readyList.then; + +// The ready event handler and self cleanup method +function completed() { + document.removeEventListener( "DOMContentLoaded", completed ); + window.removeEventListener( "load", completed ); + jQuery.ready(); +} + +// Catch cases where $(document).ready() is called +// after the browser event has already occurred. +// Support: IE <=9 - 10 only +// Older IE sometimes signals "interactive" too soon +if ( document.readyState === "complete" || + ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { + + // Handle it asynchronously to allow scripts the opportunity to delay ready + window.setTimeout( jQuery.ready ); + +} else { + + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", completed ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", completed ); +} + + + + +// Multifunctional method to get and set values of a collection +// The value/s can optionally be executed if it's a function +var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { + var i = 0, + len = elems.length, + bulk = key == null; + + // Sets many values + if ( toType( key ) === "object" ) { + chainable = true; + for ( i in key ) { + access( elems, fn, i, key[ i ], true, emptyGet, raw ); + } + + // Sets one value + } else if ( value !== undefined ) { + chainable = true; + + if ( !isFunction( value ) ) { + raw = true; + } + + if ( bulk ) { + + // Bulk operations run against the entire set + if ( raw ) { + fn.call( elems, value ); + fn = null; + + // ...except when executing function values + } else { + bulk = fn; + fn = function( elem, _key, value ) { + return bulk.call( jQuery( elem ), value ); + }; + } + } + + if ( fn ) { + for ( ; i < len; i++ ) { + fn( + elems[ i ], key, raw ? + value : + value.call( elems[ i ], i, fn( elems[ i ], key ) ) + ); + } + } + } + + if ( chainable ) { + return elems; + } + + // Gets + if ( bulk ) { + return fn.call( elems ); + } + + return len ? fn( elems[ 0 ], key ) : emptyGet; +}; + + +// Matches dashed string for camelizing +var rmsPrefix = /^-ms-/, + rdashAlpha = /-([a-z])/g; + +// Used by camelCase as callback to replace() +function fcamelCase( _all, letter ) { + return letter.toUpperCase(); +} + +// Convert dashed to camelCase; used by the css and data modules +// Support: IE <=9 - 11, Edge 12 - 15 +// Microsoft forgot to hump their vendor prefix (#9572) +function camelCase( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); +} +var acceptData = function( owner ) { + + // Accepts only: + // - Node + // - Node.ELEMENT_NODE + // - Node.DOCUMENT_NODE + // - Object + // - Any + return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); +}; + + + + +function Data() { + this.expando = jQuery.expando + Data.uid++; +} + +Data.uid = 1; + +Data.prototype = { + + cache: function( owner ) { + + // Check if the owner object already has a cache + var value = owner[ this.expando ]; + + // If not, create one + if ( !value ) { + value = {}; + + // We can accept data for non-element nodes in modern browsers, + // but we should not, see #8335. + // Always return an empty object. + if ( acceptData( owner ) ) { + + // If it is a node unlikely to be stringify-ed or looped over + // use plain assignment + if ( owner.nodeType ) { + owner[ this.expando ] = value; + + // Otherwise secure it in a non-enumerable property + // configurable must be true to allow the property to be + // deleted when data is removed + } else { + Object.defineProperty( owner, this.expando, { + value: value, + configurable: true + } ); + } + } + } + + return value; + }, + set: function( owner, data, value ) { + var prop, + cache = this.cache( owner ); + + // Handle: [ owner, key, value ] args + // Always use camelCase key (gh-2257) + if ( typeof data === "string" ) { + cache[ camelCase( data ) ] = value; + + // Handle: [ owner, { properties } ] args + } else { + + // Copy the properties one-by-one to the cache object + for ( prop in data ) { + cache[ camelCase( prop ) ] = data[ prop ]; + } + } + return cache; + }, + get: function( owner, key ) { + return key === undefined ? + this.cache( owner ) : + + // Always use camelCase key (gh-2257) + owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; + }, + access: function( owner, key, value ) { + + // In cases where either: + // + // 1. No key was specified + // 2. A string key was specified, but no value provided + // + // Take the "read" path and allow the get method to determine + // which value to return, respectively either: + // + // 1. The entire cache object + // 2. The data stored at the key + // + if ( key === undefined || + ( ( key && typeof key === "string" ) && value === undefined ) ) { + + return this.get( owner, key ); + } + + // When the key is not a string, or both a key and value + // are specified, set or extend (existing objects) with either: + // + // 1. An object of properties + // 2. A key and value + // + this.set( owner, key, value ); + + // Since the "set" path can have two possible entry points + // return the expected data based on which path was taken[*] + return value !== undefined ? value : key; + }, + remove: function( owner, key ) { + var i, + cache = owner[ this.expando ]; + + if ( cache === undefined ) { + return; + } + + if ( key !== undefined ) { + + // Support array or space separated string of keys + if ( Array.isArray( key ) ) { + + // If key is an array of keys... + // We always set camelCase keys, so remove that. + key = key.map( camelCase ); + } else { + key = camelCase( key ); + + // If a key with the spaces exists, use it. + // Otherwise, create an array by matching non-whitespace + key = key in cache ? + [ key ] : + ( key.match( rnothtmlwhite ) || [] ); + } + + i = key.length; + + while ( i-- ) { + delete cache[ key[ i ] ]; + } + } + + // Remove the expando if there's no more data + if ( key === undefined || jQuery.isEmptyObject( cache ) ) { + + // Support: Chrome <=35 - 45 + // Webkit & Blink performance suffers when deleting properties + // from DOM nodes, so set to undefined instead + // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) + if ( owner.nodeType ) { + owner[ this.expando ] = undefined; + } else { + delete owner[ this.expando ]; + } + } + }, + hasData: function( owner ) { + var cache = owner[ this.expando ]; + return cache !== undefined && !jQuery.isEmptyObject( cache ); + } +}; +var dataPriv = new Data(); + +var dataUser = new Data(); + + + +// Implementation Summary +// +// 1. Enforce API surface and semantic compatibility with 1.9.x branch +// 2. Improve the module's maintainability by reducing the storage +// paths to a single mechanism. +// 3. Use the same single mechanism to support "private" and "user" data. +// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) +// 5. Avoid exposing implementation details on user objects (eg. expando properties) +// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 + +var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, + rmultiDash = /[A-Z]/g; + +function getData( data ) { + if ( data === "true" ) { + return true; + } + + if ( data === "false" ) { + return false; + } + + if ( data === "null" ) { + return null; + } + + // Only convert to a number if it doesn't change the string + if ( data === +data + "" ) { + return +data; + } + + if ( rbrace.test( data ) ) { + return JSON.parse( data ); + } + + return data; +} + +function dataAttr( elem, key, data ) { + var name; + + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = getData( data ); + } catch ( e ) {} + + // Make sure we set the data so it isn't changed later + dataUser.set( elem, key, data ); + } else { + data = undefined; + } + } + return data; +} + +jQuery.extend( { + hasData: function( elem ) { + return dataUser.hasData( elem ) || dataPriv.hasData( elem ); + }, + + data: function( elem, name, data ) { + return dataUser.access( elem, name, data ); + }, + + removeData: function( elem, name ) { + dataUser.remove( elem, name ); + }, + + // TODO: Now that all calls to _data and _removeData have been replaced + // with direct calls to dataPriv methods, these can be deprecated. + _data: function( elem, name, data ) { + return dataPriv.access( elem, name, data ); + }, + + _removeData: function( elem, name ) { + dataPriv.remove( elem, name ); + } +} ); + +jQuery.fn.extend( { + data: function( key, value ) { + var i, name, data, + elem = this[ 0 ], + attrs = elem && elem.attributes; + + // Gets all values + if ( key === undefined ) { + if ( this.length ) { + data = dataUser.get( elem ); + + if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { + i = attrs.length; + while ( i-- ) { + + // Support: IE 11 only + // The attrs elements can be null (#14894) + if ( attrs[ i ] ) { + name = attrs[ i ].name; + if ( name.indexOf( "data-" ) === 0 ) { + name = camelCase( name.slice( 5 ) ); + dataAttr( elem, name, data[ name ] ); + } + } + } + dataPriv.set( elem, "hasDataAttrs", true ); + } + } + + return data; + } + + // Sets multiple values + if ( typeof key === "object" ) { + return this.each( function() { + dataUser.set( this, key ); + } ); + } + + return access( this, function( value ) { + var data; + + // The calling jQuery object (element matches) is not empty + // (and therefore has an element appears at this[ 0 ]) and the + // `value` parameter was not undefined. An empty jQuery object + // will result in `undefined` for elem = this[ 0 ] which will + // throw an exception if an attempt to read a data cache is made. + if ( elem && value === undefined ) { + + // Attempt to get data from the cache + // The key will always be camelCased in Data + data = dataUser.get( elem, key ); + if ( data !== undefined ) { + return data; + } + + // Attempt to "discover" the data in + // HTML5 custom data-* attrs + data = dataAttr( elem, key ); + if ( data !== undefined ) { + return data; + } + + // We tried really hard, but the data doesn't exist. + return; + } + + // Set the data... + this.each( function() { + + // We always store the camelCased key + dataUser.set( this, key, value ); + } ); + }, null, value, arguments.length > 1, null, true ); + }, + + removeData: function( key ) { + return this.each( function() { + dataUser.remove( this, key ); + } ); + } +} ); + + +jQuery.extend( { + queue: function( elem, type, data ) { + var queue; + + if ( elem ) { + type = ( type || "fx" ) + "queue"; + queue = dataPriv.get( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !queue || Array.isArray( data ) ) { + queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); + } else { + queue.push( data ); + } + } + return queue || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + startLength = queue.length, + fn = queue.shift(), + hooks = jQuery._queueHooks( elem, type ), + next = function() { + jQuery.dequeue( elem, type ); + }; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + startLength--; + } + + if ( fn ) { + + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + // Clear up the last queue stop function + delete hooks.stop; + fn.call( elem, next, hooks ); + } + + if ( !startLength && hooks ) { + hooks.empty.fire(); + } + }, + + // Not public - generate a queueHooks object, or return the current one + _queueHooks: function( elem, type ) { + var key = type + "queueHooks"; + return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { + empty: jQuery.Callbacks( "once memory" ).add( function() { + dataPriv.remove( elem, [ type + "queue", key ] ); + } ) + } ); + } +} ); + +jQuery.fn.extend( { + queue: function( type, data ) { + var setter = 2; + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + setter--; + } + + if ( arguments.length < setter ) { + return jQuery.queue( this[ 0 ], type ); + } + + return data === undefined ? + this : + this.each( function() { + var queue = jQuery.queue( this, type, data ); + + // Ensure a hooks for this queue + jQuery._queueHooks( this, type ); + + if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + } ); + }, + dequeue: function( type ) { + return this.each( function() { + jQuery.dequeue( this, type ); + } ); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, obj ) { + var tmp, + count = 1, + defer = jQuery.Deferred(), + elements = this, + i = this.length, + resolve = function() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + }; + + if ( typeof type !== "string" ) { + obj = type; + type = undefined; + } + type = type || "fx"; + + while ( i-- ) { + tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); + if ( tmp && tmp.empty ) { + count++; + tmp.empty.add( resolve ); + } + } + resolve(); + return defer.promise( obj ); + } +} ); +var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; + +var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); + + +var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; + +var documentElement = document.documentElement; + + + + var isAttached = function( elem ) { + return jQuery.contains( elem.ownerDocument, elem ); + }, + composed = { composed: true }; + + // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only + // Check attachment across shadow DOM boundaries when possible (gh-3504) + // Support: iOS 10.0-10.2 only + // Early iOS 10 versions support `attachShadow` but not `getRootNode`, + // leading to errors. We need to check for `getRootNode`. + if ( documentElement.getRootNode ) { + isAttached = function( elem ) { + return jQuery.contains( elem.ownerDocument, elem ) || + elem.getRootNode( composed ) === elem.ownerDocument; + }; + } +var isHiddenWithinTree = function( elem, el ) { + + // isHiddenWithinTree might be called from jQuery#filter function; + // in that case, element will be second argument + elem = el || elem; + + // Inline style trumps all + return elem.style.display === "none" || + elem.style.display === "" && + + // Otherwise, check computed style + // Support: Firefox <=43 - 45 + // Disconnected elements can have computed display: none, so first confirm that elem is + // in the document. + isAttached( elem ) && + + jQuery.css( elem, "display" ) === "none"; + }; + + + +function adjustCSS( elem, prop, valueParts, tween ) { + var adjusted, scale, + maxIterations = 20, + currentValue = tween ? + function() { + return tween.cur(); + } : + function() { + return jQuery.css( elem, prop, "" ); + }, + initial = currentValue(), + unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), + + // Starting value computation is required for potential unit mismatches + initialInUnit = elem.nodeType && + ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && + rcssNum.exec( jQuery.css( elem, prop ) ); + + if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { + + // Support: Firefox <=54 + // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) + initial = initial / 2; + + // Trust units reported by jQuery.css + unit = unit || initialInUnit[ 3 ]; + + // Iteratively approximate from a nonzero starting point + initialInUnit = +initial || 1; + + while ( maxIterations-- ) { + + // Evaluate and update our best guess (doubling guesses that zero out). + // Finish if the scale equals or crosses 1 (making the old*new product non-positive). + jQuery.style( elem, prop, initialInUnit + unit ); + if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { + maxIterations = 0; + } + initialInUnit = initialInUnit / scale; + + } + + initialInUnit = initialInUnit * 2; + jQuery.style( elem, prop, initialInUnit + unit ); + + // Make sure we update the tween properties later on + valueParts = valueParts || []; + } + + if ( valueParts ) { + initialInUnit = +initialInUnit || +initial || 0; + + // Apply relative offset (+=/-=) if specified + adjusted = valueParts[ 1 ] ? + initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : + +valueParts[ 2 ]; + if ( tween ) { + tween.unit = unit; + tween.start = initialInUnit; + tween.end = adjusted; + } + } + return adjusted; +} + + +var defaultDisplayMap = {}; + +function getDefaultDisplay( elem ) { + var temp, + doc = elem.ownerDocument, + nodeName = elem.nodeName, + display = defaultDisplayMap[ nodeName ]; + + if ( display ) { + return display; + } + + temp = doc.body.appendChild( doc.createElement( nodeName ) ); + display = jQuery.css( temp, "display" ); + + temp.parentNode.removeChild( temp ); + + if ( display === "none" ) { + display = "block"; + } + defaultDisplayMap[ nodeName ] = display; + + return display; +} + +function showHide( elements, show ) { + var display, elem, + values = [], + index = 0, + length = elements.length; + + // Determine new display value for elements that need to change + for ( ; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + + display = elem.style.display; + if ( show ) { + + // Since we force visibility upon cascade-hidden elements, an immediate (and slow) + // check is required in this first loop unless we have a nonempty display value (either + // inline or about-to-be-restored) + if ( display === "none" ) { + values[ index ] = dataPriv.get( elem, "display" ) || null; + if ( !values[ index ] ) { + elem.style.display = ""; + } + } + if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { + values[ index ] = getDefaultDisplay( elem ); + } + } else { + if ( display !== "none" ) { + values[ index ] = "none"; + + // Remember what we're overwriting + dataPriv.set( elem, "display", display ); + } + } + } + + // Set the display of the elements in a second loop to avoid constant reflow + for ( index = 0; index < length; index++ ) { + if ( values[ index ] != null ) { + elements[ index ].style.display = values[ index ]; + } + } + + return elements; +} + +jQuery.fn.extend( { + show: function() { + return showHide( this, true ); + }, + hide: function() { + return showHide( this ); + }, + toggle: function( state ) { + if ( typeof state === "boolean" ) { + return state ? this.show() : this.hide(); + } + + return this.each( function() { + if ( isHiddenWithinTree( this ) ) { + jQuery( this ).show(); + } else { + jQuery( this ).hide(); + } + } ); + } +} ); +var rcheckableType = ( /^(?:checkbox|radio)$/i ); + +var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); + +var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); + + + +( function() { + var fragment = document.createDocumentFragment(), + div = fragment.appendChild( document.createElement( "div" ) ), + input = document.createElement( "input" ); + + // Support: Android 4.0 - 4.3 only + // Check state lost if the name is set (#11217) + // Support: Windows Web Apps (WWA) + // `name` and `type` must use .setAttribute for WWA (#14901) + input.setAttribute( "type", "radio" ); + input.setAttribute( "checked", "checked" ); + input.setAttribute( "name", "t" ); + + div.appendChild( input ); + + // Support: Android <=4.1 only + // Older WebKit doesn't clone checked state correctly in fragments + support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Support: IE <=11 only + // Make sure textarea (and checkbox) defaultValue is properly cloned + div.innerHTML = ""; + support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; + + // Support: IE <=9 only + // IE <=9 replaces "; + support.option = !!div.lastChild; +} )(); + + +// We have to close these tags to support XHTML (#13200) +var wrapMap = { + + // XHTML parsers do not magically insert elements in the + // same way that tag soup parsers do. So we cannot shorten + // this by omitting or other required elements. + thead: [ 1, "", "
" ], + col: [ 2, "", "
" ], + tr: [ 2, "", "
" ], + td: [ 3, "", "
" ], + + _default: [ 0, "", "" ] +}; + +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +// Support: IE <=9 only +if ( !support.option ) { + wrapMap.optgroup = wrapMap.option = [ 1, "" ]; +} + + +function getAll( context, tag ) { + + // Support: IE <=9 - 11 only + // Use typeof to avoid zero-argument method invocation on host objects (#15151) + var ret; + + if ( typeof context.getElementsByTagName !== "undefined" ) { + ret = context.getElementsByTagName( tag || "*" ); + + } else if ( typeof context.querySelectorAll !== "undefined" ) { + ret = context.querySelectorAll( tag || "*" ); + + } else { + ret = []; + } + + if ( tag === undefined || tag && nodeName( context, tag ) ) { + return jQuery.merge( [ context ], ret ); + } + + return ret; +} + + +// Mark scripts as having already been evaluated +function setGlobalEval( elems, refElements ) { + var i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + dataPriv.set( + elems[ i ], + "globalEval", + !refElements || dataPriv.get( refElements[ i ], "globalEval" ) + ); + } +} + + +var rhtml = /<|&#?\w+;/; + +function buildFragment( elems, context, scripts, selection, ignored ) { + var elem, tmp, tag, wrap, attached, j, + fragment = context.createDocumentFragment(), + nodes = [], + i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + elem = elems[ i ]; + + if ( elem || elem === 0 ) { + + // Add nodes directly + if ( toType( elem ) === "object" ) { + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); + + // Convert non-html into a text node + } else if ( !rhtml.test( elem ) ) { + nodes.push( context.createTextNode( elem ) ); + + // Convert html into DOM nodes + } else { + tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); + + // Deserialize a standard representation + tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); + wrap = wrapMap[ tag ] || wrapMap._default; + tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; + + // Descend through wrappers to the right content + j = wrap[ 0 ]; + while ( j-- ) { + tmp = tmp.lastChild; + } + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, tmp.childNodes ); + + // Remember the top-level container + tmp = fragment.firstChild; + + // Ensure the created nodes are orphaned (#12392) + tmp.textContent = ""; + } + } + } + + // Remove wrapper from fragment + fragment.textContent = ""; + + i = 0; + while ( ( elem = nodes[ i++ ] ) ) { + + // Skip elements already in the context collection (trac-4087) + if ( selection && jQuery.inArray( elem, selection ) > -1 ) { + if ( ignored ) { + ignored.push( elem ); + } + continue; + } + + attached = isAttached( elem ); + + // Append to fragment + tmp = getAll( fragment.appendChild( elem ), "script" ); + + // Preserve script evaluation history + if ( attached ) { + setGlobalEval( tmp ); + } + + // Capture executables + if ( scripts ) { + j = 0; + while ( ( elem = tmp[ j++ ] ) ) { + if ( rscriptType.test( elem.type || "" ) ) { + scripts.push( elem ); + } + } + } + } + + return fragment; +} + + +var + rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, + rtypenamespace = /^([^.]*)(?:\.(.+)|)/; + +function returnTrue() { + return true; +} + +function returnFalse() { + return false; +} + +// Support: IE <=9 - 11+ +// focus() and blur() are asynchronous, except when they are no-op. +// So expect focus to be synchronous when the element is already active, +// and blur to be synchronous when the element is not already active. +// (focus and blur are always synchronous in other supported browsers, +// this just defines when we can count on it). +function expectSync( elem, type ) { + return ( elem === safeActiveElement() ) === ( type === "focus" ); +} + +// Support: IE <=9 only +// Accessing document.activeElement can throw unexpectedly +// https://bugs.jquery.com/ticket/13393 +function safeActiveElement() { + try { + return document.activeElement; + } catch ( err ) { } +} + +function on( elem, types, selector, data, fn, one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + on( elem, type, selector, data, types[ type ], one ); + } + return elem; + } + + if ( data == null && fn == null ) { + + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return elem; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return elem.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + } ); +} + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + global: {}, + + add: function( elem, types, handler, data, selector ) { + + var handleObjIn, eventHandle, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.get( elem ); + + // Only attach events to objects that accept data + if ( !acceptData( elem ) ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } + + // Ensure that invalid selectors throw exceptions at attach time + // Evaluate against documentElement in case elem is a non-element node (e.g., document) + if ( selector ) { + jQuery.find.matchesSelector( documentElement, selector ); + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + if ( !( events = elemData.events ) ) { + events = elemData.events = Object.create( null ); + } + if ( !( eventHandle = elemData.handle ) ) { + eventHandle = elemData.handle = function( e ) { + + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? + jQuery.event.dispatch.apply( elem, arguments ) : undefined; + }; + } + + // Handle multiple events separated by a space + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // There *must* be a type, no attaching namespace-only handlers + if ( !type ) { + continue; + } + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend( { + type: type, + origType: origType, + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + needsContext: selector && jQuery.expr.match.needsContext.test( selector ), + namespace: namespaces.join( "." ) + }, handleObjIn ); + + // Init the event handler queue if we're the first + if ( !( handlers = events[ type ] ) ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener if the special events handler returns false + if ( !special.setup || + special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + }, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + + var j, origCount, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); + + if ( !elemData || !( events = elemData.events ) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector ? special.delegateType : special.bindType ) || type; + handlers = events[ type ] || []; + tmp = tmp[ 2 ] && + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); + + // Remove matching events + origCount = j = handlers.length; + while ( j-- ) { + handleObj = handlers[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !tmp || tmp.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || + selector === "**" && handleObj.selector ) ) { + handlers.splice( j, 1 ); + + if ( handleObj.selector ) { + handlers.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( origCount && !handlers.length ) { + if ( !special.teardown || + special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove data and the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + dataPriv.remove( elem, "handle events" ); + } + }, + + dispatch: function( nativeEvent ) { + + var i, j, ret, matched, handleObj, handlerQueue, + args = new Array( arguments.length ), + + // Make a writable jQuery.Event from the native event object + event = jQuery.event.fix( nativeEvent ), + + handlers = ( + dataPriv.get( this, "events" ) || Object.create( null ) + )[ event.type ] || [], + special = jQuery.event.special[ event.type ] || {}; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[ 0 ] = event; + + for ( i = 1; i < arguments.length; i++ ) { + args[ i ] = arguments[ i ]; + } + + event.delegateTarget = this; + + // Call the preDispatch hook for the mapped type, and let it bail if desired + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { + return; + } + + // Determine handlers + handlerQueue = jQuery.event.handlers.call( this, event, handlers ); + + // Run delegates first; they may want to stop propagation beneath us + i = 0; + while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { + event.currentTarget = matched.elem; + + j = 0; + while ( ( handleObj = matched.handlers[ j++ ] ) && + !event.isImmediatePropagationStopped() ) { + + // If the event is namespaced, then each handler is only invoked if it is + // specially universal or its namespaces are a superset of the event's. + if ( !event.rnamespace || handleObj.namespace === false || + event.rnamespace.test( handleObj.namespace ) ) { + + event.handleObj = handleObj; + event.data = handleObj.data; + + ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || + handleObj.handler ).apply( matched.elem, args ); + + if ( ret !== undefined ) { + if ( ( event.result = ret ) === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + // Call the postDispatch hook for the mapped type + if ( special.postDispatch ) { + special.postDispatch.call( this, event ); + } + + return event.result; + }, + + handlers: function( event, handlers ) { + var i, handleObj, sel, matchedHandlers, matchedSelectors, + handlerQueue = [], + delegateCount = handlers.delegateCount, + cur = event.target; + + // Find delegate handlers + if ( delegateCount && + + // Support: IE <=9 + // Black-hole SVG instance trees (trac-13180) + cur.nodeType && + + // Support: Firefox <=42 + // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) + // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click + // Support: IE 11 only + // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) + !( event.type === "click" && event.button >= 1 ) ) { + + for ( ; cur !== this; cur = cur.parentNode || this ) { + + // Don't check non-elements (#13208) + // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) + if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { + matchedHandlers = []; + matchedSelectors = {}; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + + // Don't conflict with Object.prototype properties (#13203) + sel = handleObj.selector + " "; + + if ( matchedSelectors[ sel ] === undefined ) { + matchedSelectors[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) > -1 : + jQuery.find( sel, this, null, [ cur ] ).length; + } + if ( matchedSelectors[ sel ] ) { + matchedHandlers.push( handleObj ); + } + } + if ( matchedHandlers.length ) { + handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); + } + } + } + } + + // Add the remaining (directly-bound) handlers + cur = this; + if ( delegateCount < handlers.length ) { + handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); + } + + return handlerQueue; + }, + + addProp: function( name, hook ) { + Object.defineProperty( jQuery.Event.prototype, name, { + enumerable: true, + configurable: true, + + get: isFunction( hook ) ? + function() { + if ( this.originalEvent ) { + return hook( this.originalEvent ); + } + } : + function() { + if ( this.originalEvent ) { + return this.originalEvent[ name ]; + } + }, + + set: function( value ) { + Object.defineProperty( this, name, { + enumerable: true, + configurable: true, + writable: true, + value: value + } ); + } + } ); + }, + + fix: function( originalEvent ) { + return originalEvent[ jQuery.expando ] ? + originalEvent : + new jQuery.Event( originalEvent ); + }, + + special: { + load: { + + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + click: { + + // Utilize native event to ensure correct state for checkable inputs + setup: function( data ) { + + // For mutual compressibility with _default, replace `this` access with a local var. + // `|| data` is dead code meant only to preserve the variable through minification. + var el = this || data; + + // Claim the first handler + if ( rcheckableType.test( el.type ) && + el.click && nodeName( el, "input" ) ) { + + // dataPriv.set( el, "click", ... ) + leverageNative( el, "click", returnTrue ); + } + + // Return false to allow normal processing in the caller + return false; + }, + trigger: function( data ) { + + // For mutual compressibility with _default, replace `this` access with a local var. + // `|| data` is dead code meant only to preserve the variable through minification. + var el = this || data; + + // Force setup before triggering a click + if ( rcheckableType.test( el.type ) && + el.click && nodeName( el, "input" ) ) { + + leverageNative( el, "click" ); + } + + // Return non-false to allow normal event-path propagation + return true; + }, + + // For cross-browser consistency, suppress native .click() on links + // Also prevent it if we're currently inside a leveraged native-event stack + _default: function( event ) { + var target = event.target; + return rcheckableType.test( target.type ) && + target.click && nodeName( target, "input" ) && + dataPriv.get( target, "click" ) || + nodeName( target, "a" ); + } + }, + + beforeunload: { + postDispatch: function( event ) { + + // Support: Firefox 20+ + // Firefox doesn't alert if the returnValue field is not set. + if ( event.result !== undefined && event.originalEvent ) { + event.originalEvent.returnValue = event.result; + } + } + } + } +}; + +// Ensure the presence of an event listener that handles manually-triggered +// synthetic events by interrupting progress until reinvoked in response to +// *native* events that it fires directly, ensuring that state changes have +// already occurred before other listeners are invoked. +function leverageNative( el, type, expectSync ) { + + // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add + if ( !expectSync ) { + if ( dataPriv.get( el, type ) === undefined ) { + jQuery.event.add( el, type, returnTrue ); + } + return; + } + + // Register the controller as a special universal handler for all event namespaces + dataPriv.set( el, type, false ); + jQuery.event.add( el, type, { + namespace: false, + handler: function( event ) { + var notAsync, result, + saved = dataPriv.get( this, type ); + + if ( ( event.isTrigger & 1 ) && this[ type ] ) { + + // Interrupt processing of the outer synthetic .trigger()ed event + // Saved data should be false in such cases, but might be a leftover capture object + // from an async native handler (gh-4350) + if ( !saved.length ) { + + // Store arguments for use when handling the inner native event + // There will always be at least one argument (an event object), so this array + // will not be confused with a leftover capture object. + saved = slice.call( arguments ); + dataPriv.set( this, type, saved ); + + // Trigger the native event and capture its result + // Support: IE <=9 - 11+ + // focus() and blur() are asynchronous + notAsync = expectSync( this, type ); + this[ type ](); + result = dataPriv.get( this, type ); + if ( saved !== result || notAsync ) { + dataPriv.set( this, type, false ); + } else { + result = {}; + } + if ( saved !== result ) { + + // Cancel the outer synthetic event + event.stopImmediatePropagation(); + event.preventDefault(); + return result.value; + } + + // If this is an inner synthetic event for an event with a bubbling surrogate + // (focus or blur), assume that the surrogate already propagated from triggering the + // native event and prevent that from happening again here. + // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the + // bubbling surrogate propagates *after* the non-bubbling base), but that seems + // less bad than duplication. + } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { + event.stopPropagation(); + } + + // If this is a native event triggered above, everything is now in order + // Fire an inner synthetic event with the original arguments + } else if ( saved.length ) { + + // ...and capture the result + dataPriv.set( this, type, { + value: jQuery.event.trigger( + + // Support: IE <=9 - 11+ + // Extend with the prototype to reset the above stopImmediatePropagation() + jQuery.extend( saved[ 0 ], jQuery.Event.prototype ), + saved.slice( 1 ), + this + ) + } ); + + // Abort handling of the native event + event.stopImmediatePropagation(); + } + } + } ); +} + +jQuery.removeEvent = function( elem, type, handle ) { + + // This "if" is needed for plain objects + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle ); + } +}; + +jQuery.Event = function( src, props ) { + + // Allow instantiation without the 'new' keyword + if ( !( this instanceof jQuery.Event ) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = src.defaultPrevented || + src.defaultPrevented === undefined && + + // Support: Android <=2.3 only + src.returnValue === false ? + returnTrue : + returnFalse; + + // Create target properties + // Support: Safari <=6 - 7 only + // Target should not be a text node (#504, #13143) + this.target = ( src.target && src.target.nodeType === 3 ) ? + src.target.parentNode : + src.target; + + this.currentTarget = src.currentTarget; + this.relatedTarget = src.relatedTarget; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || Date.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + constructor: jQuery.Event, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse, + isSimulated: false, + + preventDefault: function() { + var e = this.originalEvent; + + this.isDefaultPrevented = returnTrue; + + if ( e && !this.isSimulated ) { + e.preventDefault(); + } + }, + stopPropagation: function() { + var e = this.originalEvent; + + this.isPropagationStopped = returnTrue; + + if ( e && !this.isSimulated ) { + e.stopPropagation(); + } + }, + stopImmediatePropagation: function() { + var e = this.originalEvent; + + this.isImmediatePropagationStopped = returnTrue; + + if ( e && !this.isSimulated ) { + e.stopImmediatePropagation(); + } + + this.stopPropagation(); + } +}; + +// Includes all common event props including KeyEvent and MouseEvent specific props +jQuery.each( { + altKey: true, + bubbles: true, + cancelable: true, + changedTouches: true, + ctrlKey: true, + detail: true, + eventPhase: true, + metaKey: true, + pageX: true, + pageY: true, + shiftKey: true, + view: true, + "char": true, + code: true, + charCode: true, + key: true, + keyCode: true, + button: true, + buttons: true, + clientX: true, + clientY: true, + offsetX: true, + offsetY: true, + pointerId: true, + pointerType: true, + screenX: true, + screenY: true, + targetTouches: true, + toElement: true, + touches: true, + + which: function( event ) { + var button = event.button; + + // Add which for key events + if ( event.which == null && rkeyEvent.test( event.type ) ) { + return event.charCode != null ? event.charCode : event.keyCode; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) { + if ( button & 1 ) { + return 1; + } + + if ( button & 2 ) { + return 3; + } + + if ( button & 4 ) { + return 2; + } + + return 0; + } + + return event.which; + } +}, jQuery.event.addProp ); + +jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { + jQuery.event.special[ type ] = { + + // Utilize native event if possible so blur/focus sequence is correct + setup: function() { + + // Claim the first handler + // dataPriv.set( this, "focus", ... ) + // dataPriv.set( this, "blur", ... ) + leverageNative( this, type, expectSync ); + + // Return false to allow normal processing in the caller + return false; + }, + trigger: function() { + + // Force setup before trigger + leverageNative( this, type ); + + // Return non-false to allow normal event-path propagation + return true; + }, + + delegateType: delegateType + }; +} ); + +// Create mouseenter/leave events using mouseover/out and event-time checks +// so that event delegation works in jQuery. +// Do the same for pointerenter/pointerleave and pointerover/pointerout +// +// Support: Safari 7 only +// Safari sends mouseenter too often; see: +// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 +// for the description of the bug (it existed in older Chrome versions as well). +jQuery.each( { + mouseenter: "mouseover", + mouseleave: "mouseout", + pointerenter: "pointerover", + pointerleave: "pointerout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var ret, + target = this, + related = event.relatedTarget, + handleObj = event.handleObj; + + // For mouseenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +} ); + +jQuery.fn.extend( { + + on: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn ); + }, + one: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + var handleObj, type; + if ( types && types.preventDefault && types.handleObj ) { + + // ( event ) dispatched jQuery.Event + handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace ? + handleObj.origType + "." + handleObj.namespace : + handleObj.origType, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + + // ( types-object [, selector] ) + for ( type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each( function() { + jQuery.event.remove( this, types, fn, selector ); + } ); + } +} ); + + +var + + // Support: IE <=10 - 11, Edge 12 - 13 only + // In IE/Edge using regex groups here causes severe slowdowns. + // See https://connect.microsoft.com/IE/feedback/details/1736512/ + rnoInnerhtml = /\s*$/g; + +// Prefer a tbody over its parent table for containing new rows +function manipulationTarget( elem, content ) { + if ( nodeName( elem, "table" ) && + nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { + + return jQuery( elem ).children( "tbody" )[ 0 ] || elem; + } + + return elem; +} + +// Replace/restore the type attribute of script elements for safe DOM manipulation +function disableScript( elem ) { + elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; + return elem; +} +function restoreScript( elem ) { + if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { + elem.type = elem.type.slice( 5 ); + } else { + elem.removeAttribute( "type" ); + } + + return elem; +} + +function cloneCopyEvent( src, dest ) { + var i, l, type, pdataOld, udataOld, udataCur, events; + + if ( dest.nodeType !== 1 ) { + return; + } + + // 1. Copy private data: events, handlers, etc. + if ( dataPriv.hasData( src ) ) { + pdataOld = dataPriv.get( src ); + events = pdataOld.events; + + if ( events ) { + dataPriv.remove( dest, "handle events" ); + + for ( type in events ) { + for ( i = 0, l = events[ type ].length; i < l; i++ ) { + jQuery.event.add( dest, type, events[ type ][ i ] ); + } + } + } + } + + // 2. Copy user data + if ( dataUser.hasData( src ) ) { + udataOld = dataUser.access( src ); + udataCur = jQuery.extend( {}, udataOld ); + + dataUser.set( dest, udataCur ); + } +} + +// Fix IE bugs, see support tests +function fixInput( src, dest ) { + var nodeName = dest.nodeName.toLowerCase(); + + // Fails to persist the checked state of a cloned checkbox or radio button. + if ( nodeName === "input" && rcheckableType.test( src.type ) ) { + dest.checked = src.checked; + + // Fails to return the selected option to the default selected state when cloning options + } else if ( nodeName === "input" || nodeName === "textarea" ) { + dest.defaultValue = src.defaultValue; + } +} + +function domManip( collection, args, callback, ignored ) { + + // Flatten any nested arrays + args = flat( args ); + + var fragment, first, scripts, hasScripts, node, doc, + i = 0, + l = collection.length, + iNoClone = l - 1, + value = args[ 0 ], + valueIsFunction = isFunction( value ); + + // We can't cloneNode fragments that contain checked, in WebKit + if ( valueIsFunction || + ( l > 1 && typeof value === "string" && + !support.checkClone && rchecked.test( value ) ) ) { + return collection.each( function( index ) { + var self = collection.eq( index ); + if ( valueIsFunction ) { + args[ 0 ] = value.call( this, index, self.html() ); + } + domManip( self, args, callback, ignored ); + } ); + } + + if ( l ) { + fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); + first = fragment.firstChild; + + if ( fragment.childNodes.length === 1 ) { + fragment = first; + } + + // Require either new content or an interest in ignored elements to invoke the callback + if ( first || ignored ) { + scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); + hasScripts = scripts.length; + + // Use the original fragment for the last item + // instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + for ( ; i < l; i++ ) { + node = fragment; + + if ( i !== iNoClone ) { + node = jQuery.clone( node, true, true ); + + // Keep references to cloned scripts for later restoration + if ( hasScripts ) { + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( scripts, getAll( node, "script" ) ); + } + } + + callback.call( collection[ i ], node, i ); + } + + if ( hasScripts ) { + doc = scripts[ scripts.length - 1 ].ownerDocument; + + // Reenable scripts + jQuery.map( scripts, restoreScript ); + + // Evaluate executable scripts on first document insertion + for ( i = 0; i < hasScripts; i++ ) { + node = scripts[ i ]; + if ( rscriptType.test( node.type || "" ) && + !dataPriv.access( node, "globalEval" ) && + jQuery.contains( doc, node ) ) { + + if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { + + // Optional AJAX dependency, but won't run scripts if not present + if ( jQuery._evalUrl && !node.noModule ) { + jQuery._evalUrl( node.src, { + nonce: node.nonce || node.getAttribute( "nonce" ) + }, doc ); + } + } else { + DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); + } + } + } + } + } + } + + return collection; +} + +function remove( elem, selector, keepData ) { + var node, + nodes = selector ? jQuery.filter( selector, elem ) : elem, + i = 0; + + for ( ; ( node = nodes[ i ] ) != null; i++ ) { + if ( !keepData && node.nodeType === 1 ) { + jQuery.cleanData( getAll( node ) ); + } + + if ( node.parentNode ) { + if ( keepData && isAttached( node ) ) { + setGlobalEval( getAll( node, "script" ) ); + } + node.parentNode.removeChild( node ); + } + } + + return elem; +} + +jQuery.extend( { + htmlPrefilter: function( html ) { + return html; + }, + + clone: function( elem, dataAndEvents, deepDataAndEvents ) { + var i, l, srcElements, destElements, + clone = elem.cloneNode( true ), + inPage = isAttached( elem ); + + // Fix IE cloning issues + if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && + !jQuery.isXMLDoc( elem ) ) { + + // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 + destElements = getAll( clone ); + srcElements = getAll( elem ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + fixInput( srcElements[ i ], destElements[ i ] ); + } + } + + // Copy the events from the original to the clone + if ( dataAndEvents ) { + if ( deepDataAndEvents ) { + srcElements = srcElements || getAll( elem ); + destElements = destElements || getAll( clone ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + cloneCopyEvent( srcElements[ i ], destElements[ i ] ); + } + } else { + cloneCopyEvent( elem, clone ); + } + } + + // Preserve script evaluation history + destElements = getAll( clone, "script" ); + if ( destElements.length > 0 ) { + setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); + } + + // Return the cloned set + return clone; + }, + + cleanData: function( elems ) { + var data, elem, type, + special = jQuery.event.special, + i = 0; + + for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { + if ( acceptData( elem ) ) { + if ( ( data = elem[ dataPriv.expando ] ) ) { + if ( data.events ) { + for ( type in data.events ) { + if ( special[ type ] ) { + jQuery.event.remove( elem, type ); + + // This is a shortcut to avoid jQuery.event.remove's overhead + } else { + jQuery.removeEvent( elem, type, data.handle ); + } + } + } + + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataPriv.expando ] = undefined; + } + if ( elem[ dataUser.expando ] ) { + + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataUser.expando ] = undefined; + } + } + } + } +} ); + +jQuery.fn.extend( { + detach: function( selector ) { + return remove( this, selector, true ); + }, + + remove: function( selector ) { + return remove( this, selector ); + }, + + text: function( value ) { + return access( this, function( value ) { + return value === undefined ? + jQuery.text( this ) : + this.empty().each( function() { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + this.textContent = value; + } + } ); + }, null, value, arguments.length ); + }, + + append: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.appendChild( elem ); + } + } ); + }, + + prepend: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.insertBefore( elem, target.firstChild ); + } + } ); + }, + + before: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this ); + } + } ); + }, + + after: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this.nextSibling ); + } + } ); + }, + + empty: function() { + var elem, + i = 0; + + for ( ; ( elem = this[ i ] ) != null; i++ ) { + if ( elem.nodeType === 1 ) { + + // Prevent memory leaks + jQuery.cleanData( getAll( elem, false ) ); + + // Remove any remaining nodes + elem.textContent = ""; + } + } + + return this; + }, + + clone: function( dataAndEvents, deepDataAndEvents ) { + dataAndEvents = dataAndEvents == null ? false : dataAndEvents; + deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; + + return this.map( function() { + return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); + } ); + }, + + html: function( value ) { + return access( this, function( value ) { + var elem = this[ 0 ] || {}, + i = 0, + l = this.length; + + if ( value === undefined && elem.nodeType === 1 ) { + return elem.innerHTML; + } + + // See if we can take a shortcut and just use innerHTML + if ( typeof value === "string" && !rnoInnerhtml.test( value ) && + !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { + + value = jQuery.htmlPrefilter( value ); + + try { + for ( ; i < l; i++ ) { + elem = this[ i ] || {}; + + // Remove element nodes and prevent memory leaks + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + elem.innerHTML = value; + } + } + + elem = 0; + + // If using innerHTML throws an exception, use the fallback method + } catch ( e ) {} + } + + if ( elem ) { + this.empty().append( value ); + } + }, null, value, arguments.length ); + }, + + replaceWith: function() { + var ignored = []; + + // Make the changes, replacing each non-ignored context element with the new content + return domManip( this, arguments, function( elem ) { + var parent = this.parentNode; + + if ( jQuery.inArray( this, ignored ) < 0 ) { + jQuery.cleanData( getAll( this ) ); + if ( parent ) { + parent.replaceChild( elem, this ); + } + } + + // Force callback invocation + }, ignored ); + } +} ); + +jQuery.each( { + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" +}, function( name, original ) { + jQuery.fn[ name ] = function( selector ) { + var elems, + ret = [], + insert = jQuery( selector ), + last = insert.length - 1, + i = 0; + + for ( ; i <= last; i++ ) { + elems = i === last ? this : this.clone( true ); + jQuery( insert[ i ] )[ original ]( elems ); + + // Support: Android <=4.0 only, PhantomJS 1 only + // .get() because push.apply(_, arraylike) throws on ancient WebKit + push.apply( ret, elems.get() ); + } + + return this.pushStack( ret ); + }; +} ); +var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); + +var getStyles = function( elem ) { + + // Support: IE <=11 only, Firefox <=30 (#15098, #14150) + // IE throws on elements created in popups + // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" + var view = elem.ownerDocument.defaultView; + + if ( !view || !view.opener ) { + view = window; + } + + return view.getComputedStyle( elem ); + }; + +var swap = function( elem, options, callback ) { + var ret, name, + old = {}; + + // Remember the old values, and insert the new ones + for ( name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + ret = callback.call( elem ); + + // Revert the old values + for ( name in options ) { + elem.style[ name ] = old[ name ]; + } + + return ret; +}; + + +var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); + + + +( function() { + + // Executing both pixelPosition & boxSizingReliable tests require only one layout + // so they're executed at the same time to save the second computation. + function computeStyleTests() { + + // This is a singleton, we need to execute it only once + if ( !div ) { + return; + } + + container.style.cssText = "position:absolute;left:-11111px;width:60px;" + + "margin-top:1px;padding:0;border:0"; + div.style.cssText = + "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + + "margin:auto;border:1px;padding:1px;" + + "width:60%;top:1%"; + documentElement.appendChild( container ).appendChild( div ); + + var divStyle = window.getComputedStyle( div ); + pixelPositionVal = divStyle.top !== "1%"; + + // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 + reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; + + // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 + // Some styles come back with percentage values, even though they shouldn't + div.style.right = "60%"; + pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; + + // Support: IE 9 - 11 only + // Detect misreporting of content dimensions for box-sizing:border-box elements + boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; + + // Support: IE 9 only + // Detect overflow:scroll screwiness (gh-3699) + // Support: Chrome <=64 + // Don't get tricked when zoom affects offsetWidth (gh-4029) + div.style.position = "absolute"; + scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; + + documentElement.removeChild( container ); + + // Nullify the div so it wouldn't be stored in the memory and + // it will also be a sign that checks already performed + div = null; + } + + function roundPixelMeasures( measure ) { + return Math.round( parseFloat( measure ) ); + } + + var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, + reliableTrDimensionsVal, reliableMarginLeftVal, + container = document.createElement( "div" ), + div = document.createElement( "div" ); + + // Finish early in limited (non-browser) environments + if ( !div.style ) { + return; + } + + // Support: IE <=9 - 11 only + // Style of cloned element affects source element cloned (#8908) + div.style.backgroundClip = "content-box"; + div.cloneNode( true ).style.backgroundClip = ""; + support.clearCloneStyle = div.style.backgroundClip === "content-box"; + + jQuery.extend( support, { + boxSizingReliable: function() { + computeStyleTests(); + return boxSizingReliableVal; + }, + pixelBoxStyles: function() { + computeStyleTests(); + return pixelBoxStylesVal; + }, + pixelPosition: function() { + computeStyleTests(); + return pixelPositionVal; + }, + reliableMarginLeft: function() { + computeStyleTests(); + return reliableMarginLeftVal; + }, + scrollboxSize: function() { + computeStyleTests(); + return scrollboxSizeVal; + }, + + // Support: IE 9 - 11+, Edge 15 - 18+ + // IE/Edge misreport `getComputedStyle` of table rows with width/height + // set in CSS while `offset*` properties report correct values. + // Behavior in IE 9 is more subtle than in newer versions & it passes + // some versions of this test; make sure not to make it pass there! + reliableTrDimensions: function() { + var table, tr, trChild, trStyle; + if ( reliableTrDimensionsVal == null ) { + table = document.createElement( "table" ); + tr = document.createElement( "tr" ); + trChild = document.createElement( "div" ); + + table.style.cssText = "position:absolute;left:-11111px"; + tr.style.height = "1px"; + trChild.style.height = "9px"; + + documentElement + .appendChild( table ) + .appendChild( tr ) + .appendChild( trChild ); + + trStyle = window.getComputedStyle( tr ); + reliableTrDimensionsVal = parseInt( trStyle.height ) > 3; + + documentElement.removeChild( table ); + } + return reliableTrDimensionsVal; + } + } ); +} )(); + + +function curCSS( elem, name, computed ) { + var width, minWidth, maxWidth, ret, + + // Support: Firefox 51+ + // Retrieving style before computed somehow + // fixes an issue with getting wrong values + // on detached elements + style = elem.style; + + computed = computed || getStyles( elem ); + + // getPropertyValue is needed for: + // .css('filter') (IE 9 only, #12537) + // .css('--customProperty) (#3144) + if ( computed ) { + ret = computed.getPropertyValue( name ) || computed[ name ]; + + if ( ret === "" && !isAttached( elem ) ) { + ret = jQuery.style( elem, name ); + } + + // A tribute to the "awesome hack by Dean Edwards" + // Android Browser returns percentage for some values, + // but width seems to be reliably pixels. + // This is against the CSSOM draft spec: + // https://drafts.csswg.org/cssom/#resolved-values + if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { + + // Remember the original values + width = style.width; + minWidth = style.minWidth; + maxWidth = style.maxWidth; + + // Put in the new values to get a computed value out + style.minWidth = style.maxWidth = style.width = ret; + ret = computed.width; + + // Revert the changed values + style.width = width; + style.minWidth = minWidth; + style.maxWidth = maxWidth; + } + } + + return ret !== undefined ? + + // Support: IE <=9 - 11 only + // IE returns zIndex value as an integer. + ret + "" : + ret; +} + + +function addGetHookIf( conditionFn, hookFn ) { + + // Define the hook, we'll check on the first run if it's really needed. + return { + get: function() { + if ( conditionFn() ) { + + // Hook not needed (or it's not possible to use it due + // to missing dependency), remove it. + delete this.get; + return; + } + + // Hook needed; redefine it so that the support test is not executed again. + return ( this.get = hookFn ).apply( this, arguments ); + } + }; +} + + +var cssPrefixes = [ "Webkit", "Moz", "ms" ], + emptyStyle = document.createElement( "div" ).style, + vendorProps = {}; + +// Return a vendor-prefixed property or undefined +function vendorPropName( name ) { + + // Check for vendor prefixed names + var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), + i = cssPrefixes.length; + + while ( i-- ) { + name = cssPrefixes[ i ] + capName; + if ( name in emptyStyle ) { + return name; + } + } +} + +// Return a potentially-mapped jQuery.cssProps or vendor prefixed property +function finalPropName( name ) { + var final = jQuery.cssProps[ name ] || vendorProps[ name ]; + + if ( final ) { + return final; + } + if ( name in emptyStyle ) { + return name; + } + return vendorProps[ name ] = vendorPropName( name ) || name; +} + + +var + + // Swappable if display is none or starts with table + // except "table", "table-cell", or "table-caption" + // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display + rdisplayswap = /^(none|table(?!-c[ea]).+)/, + rcustomProp = /^--/, + cssShow = { position: "absolute", visibility: "hidden", display: "block" }, + cssNormalTransform = { + letterSpacing: "0", + fontWeight: "400" + }; + +function setPositiveNumber( _elem, value, subtract ) { + + // Any relative (+/-) values have already been + // normalized at this point + var matches = rcssNum.exec( value ); + return matches ? + + // Guard against undefined "subtract", e.g., when used as in cssHooks + Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : + value; +} + +function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { + var i = dimension === "width" ? 1 : 0, + extra = 0, + delta = 0; + + // Adjustment may not be necessary + if ( box === ( isBorderBox ? "border" : "content" ) ) { + return 0; + } + + for ( ; i < 4; i += 2 ) { + + // Both box models exclude margin + if ( box === "margin" ) { + delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); + } + + // If we get here with a content-box, we're seeking "padding" or "border" or "margin" + if ( !isBorderBox ) { + + // Add padding + delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + + // For "border" or "margin", add border + if ( box !== "padding" ) { + delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + + // But still keep track of it otherwise + } else { + extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + + // If we get here with a border-box (content + padding + border), we're seeking "content" or + // "padding" or "margin" + } else { + + // For "content", subtract padding + if ( box === "content" ) { + delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + } + + // For "content" or "padding", subtract border + if ( box !== "margin" ) { + delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + } + } + + // Account for positive content-box scroll gutter when requested by providing computedVal + if ( !isBorderBox && computedVal >= 0 ) { + + // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border + // Assuming integer scroll gutter, subtract the rest and round down + delta += Math.max( 0, Math.ceil( + elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - + computedVal - + delta - + extra - + 0.5 + + // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter + // Use an explicit zero to avoid NaN (gh-3964) + ) ) || 0; + } + + return delta; +} + +function getWidthOrHeight( elem, dimension, extra ) { + + // Start with computed style + var styles = getStyles( elem ), + + // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). + // Fake content-box until we know it's needed to know the true value. + boxSizingNeeded = !support.boxSizingReliable() || extra, + isBorderBox = boxSizingNeeded && + jQuery.css( elem, "boxSizing", false, styles ) === "border-box", + valueIsBorderBox = isBorderBox, + + val = curCSS( elem, dimension, styles ), + offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); + + // Support: Firefox <=54 + // Return a confounding non-pixel value or feign ignorance, as appropriate. + if ( rnumnonpx.test( val ) ) { + if ( !extra ) { + return val; + } + val = "auto"; + } + + + // Support: IE 9 - 11 only + // Use offsetWidth/offsetHeight for when box sizing is unreliable. + // In those cases, the computed value can be trusted to be border-box. + if ( ( !support.boxSizingReliable() && isBorderBox || + + // Support: IE 10 - 11+, Edge 15 - 18+ + // IE/Edge misreport `getComputedStyle` of table rows with width/height + // set in CSS while `offset*` properties report correct values. + // Interestingly, in some cases IE 9 doesn't suffer from this issue. + !support.reliableTrDimensions() && nodeName( elem, "tr" ) || + + // Fall back to offsetWidth/offsetHeight when value is "auto" + // This happens for inline elements with no explicit setting (gh-3571) + val === "auto" || + + // Support: Android <=4.1 - 4.3 only + // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) + !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && + + // Make sure the element is visible & connected + elem.getClientRects().length ) { + + isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; + + // Where available, offsetWidth/offsetHeight approximate border box dimensions. + // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the + // retrieved value as a content box dimension. + valueIsBorderBox = offsetProp in elem; + if ( valueIsBorderBox ) { + val = elem[ offsetProp ]; + } + } + + // Normalize "" and auto + val = parseFloat( val ) || 0; + + // Adjust for the element's box model + return ( val + + boxModelAdjustment( + elem, + dimension, + extra || ( isBorderBox ? "border" : "content" ), + valueIsBorderBox, + styles, + + // Provide the current computed size to request scroll gutter calculation (gh-3589) + val + ) + ) + "px"; +} + +jQuery.extend( { + + // Add in style property hooks for overriding the default + // behavior of getting and setting a style property + cssHooks: { + opacity: { + get: function( elem, computed ) { + if ( computed ) { + + // We should always get a number back from opacity + var ret = curCSS( elem, "opacity" ); + return ret === "" ? "1" : ret; + } + } + } + }, + + // Don't automatically add "px" to these possibly-unitless properties + cssNumber: { + "animationIterationCount": true, + "columnCount": true, + "fillOpacity": true, + "flexGrow": true, + "flexShrink": true, + "fontWeight": true, + "gridArea": true, + "gridColumn": true, + "gridColumnEnd": true, + "gridColumnStart": true, + "gridRow": true, + "gridRowEnd": true, + "gridRowStart": true, + "lineHeight": true, + "opacity": true, + "order": true, + "orphans": true, + "widows": true, + "zIndex": true, + "zoom": true + }, + + // Add in properties whose names you wish to fix before + // setting or getting the value + cssProps: {}, + + // Get and set the style property on a DOM Node + style: function( elem, name, value, extra ) { + + // Don't set styles on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { + return; + } + + // Make sure that we're working with the right name + var ret, type, hooks, + origName = camelCase( name ), + isCustomProp = rcustomProp.test( name ), + style = elem.style; + + // Make sure that we're working with the right name. We don't + // want to query the value if it is a CSS custom property + // since they are user-defined. + if ( !isCustomProp ) { + name = finalPropName( origName ); + } + + // Gets hook for the prefixed version, then unprefixed version + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // Check if we're setting a value + if ( value !== undefined ) { + type = typeof value; + + // Convert "+=" or "-=" to relative numbers (#7345) + if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { + value = adjustCSS( elem, name, ret ); + + // Fixes bug #9237 + type = "number"; + } + + // Make sure that null and NaN values aren't set (#7116) + if ( value == null || value !== value ) { + return; + } + + // If a number was passed in, add the unit (except for certain CSS properties) + // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append + // "px" to a few hardcoded values. + if ( type === "number" && !isCustomProp ) { + value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); + } + + // background-* props affect original clone's values + if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { + style[ name ] = "inherit"; + } + + // If a hook was provided, use that value, otherwise just set the specified value + if ( !hooks || !( "set" in hooks ) || + ( value = hooks.set( elem, value, extra ) ) !== undefined ) { + + if ( isCustomProp ) { + style.setProperty( name, value ); + } else { + style[ name ] = value; + } + } + + } else { + + // If a hook was provided get the non-computed value from there + if ( hooks && "get" in hooks && + ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { + + return ret; + } + + // Otherwise just get the value from the style object + return style[ name ]; + } + }, + + css: function( elem, name, extra, styles ) { + var val, num, hooks, + origName = camelCase( name ), + isCustomProp = rcustomProp.test( name ); + + // Make sure that we're working with the right name. We don't + // want to modify the value if it is a CSS custom property + // since they are user-defined. + if ( !isCustomProp ) { + name = finalPropName( origName ); + } + + // Try prefixed name followed by the unprefixed name + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // If a hook was provided get the computed value from there + if ( hooks && "get" in hooks ) { + val = hooks.get( elem, true, extra ); + } + + // Otherwise, if a way to get the computed value exists, use that + if ( val === undefined ) { + val = curCSS( elem, name, styles ); + } + + // Convert "normal" to computed value + if ( val === "normal" && name in cssNormalTransform ) { + val = cssNormalTransform[ name ]; + } + + // Make numeric if forced or a qualifier was provided and val looks numeric + if ( extra === "" || extra ) { + num = parseFloat( val ); + return extra === true || isFinite( num ) ? num || 0 : val; + } + + return val; + } +} ); + +jQuery.each( [ "height", "width" ], function( _i, dimension ) { + jQuery.cssHooks[ dimension ] = { + get: function( elem, computed, extra ) { + if ( computed ) { + + // Certain elements can have dimension info if we invisibly show them + // but it must have a current display style that would benefit + return rdisplayswap.test( jQuery.css( elem, "display" ) ) && + + // Support: Safari 8+ + // Table columns in Safari have non-zero offsetWidth & zero + // getBoundingClientRect().width unless display is changed. + // Support: IE <=11 only + // Running getBoundingClientRect on a disconnected node + // in IE throws an error. + ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? + swap( elem, cssShow, function() { + return getWidthOrHeight( elem, dimension, extra ); + } ) : + getWidthOrHeight( elem, dimension, extra ); + } + }, + + set: function( elem, value, extra ) { + var matches, + styles = getStyles( elem ), + + // Only read styles.position if the test has a chance to fail + // to avoid forcing a reflow. + scrollboxSizeBuggy = !support.scrollboxSize() && + styles.position === "absolute", + + // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) + boxSizingNeeded = scrollboxSizeBuggy || extra, + isBorderBox = boxSizingNeeded && + jQuery.css( elem, "boxSizing", false, styles ) === "border-box", + subtract = extra ? + boxModelAdjustment( + elem, + dimension, + extra, + isBorderBox, + styles + ) : + 0; + + // Account for unreliable border-box dimensions by comparing offset* to computed and + // faking a content-box to get border and padding (gh-3699) + if ( isBorderBox && scrollboxSizeBuggy ) { + subtract -= Math.ceil( + elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - + parseFloat( styles[ dimension ] ) - + boxModelAdjustment( elem, dimension, "border", false, styles ) - + 0.5 + ); + } + + // Convert to pixels if value adjustment is needed + if ( subtract && ( matches = rcssNum.exec( value ) ) && + ( matches[ 3 ] || "px" ) !== "px" ) { + + elem.style[ dimension ] = value; + value = jQuery.css( elem, dimension ); + } + + return setPositiveNumber( elem, value, subtract ); + } + }; +} ); + +jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, + function( elem, computed ) { + if ( computed ) { + return ( parseFloat( curCSS( elem, "marginLeft" ) ) || + elem.getBoundingClientRect().left - + swap( elem, { marginLeft: 0 }, function() { + return elem.getBoundingClientRect().left; + } ) + ) + "px"; + } + } +); + +// These hooks are used by animate to expand properties +jQuery.each( { + margin: "", + padding: "", + border: "Width" +}, function( prefix, suffix ) { + jQuery.cssHooks[ prefix + suffix ] = { + expand: function( value ) { + var i = 0, + expanded = {}, + + // Assumes a single number if not a string + parts = typeof value === "string" ? value.split( " " ) : [ value ]; + + for ( ; i < 4; i++ ) { + expanded[ prefix + cssExpand[ i ] + suffix ] = + parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; + } + + return expanded; + } + }; + + if ( prefix !== "margin" ) { + jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; + } +} ); + +jQuery.fn.extend( { + css: function( name, value ) { + return access( this, function( elem, name, value ) { + var styles, len, + map = {}, + i = 0; + + if ( Array.isArray( name ) ) { + styles = getStyles( elem ); + len = name.length; + + for ( ; i < len; i++ ) { + map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); + } + + return map; + } + + return value !== undefined ? + jQuery.style( elem, name, value ) : + jQuery.css( elem, name ); + }, name, value, arguments.length > 1 ); + } +} ); + + +function Tween( elem, options, prop, end, easing ) { + return new Tween.prototype.init( elem, options, prop, end, easing ); +} +jQuery.Tween = Tween; + +Tween.prototype = { + constructor: Tween, + init: function( elem, options, prop, end, easing, unit ) { + this.elem = elem; + this.prop = prop; + this.easing = easing || jQuery.easing._default; + this.options = options; + this.start = this.now = this.cur(); + this.end = end; + this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); + }, + cur: function() { + var hooks = Tween.propHooks[ this.prop ]; + + return hooks && hooks.get ? + hooks.get( this ) : + Tween.propHooks._default.get( this ); + }, + run: function( percent ) { + var eased, + hooks = Tween.propHooks[ this.prop ]; + + if ( this.options.duration ) { + this.pos = eased = jQuery.easing[ this.easing ]( + percent, this.options.duration * percent, 0, 1, this.options.duration + ); + } else { + this.pos = eased = percent; + } + this.now = ( this.end - this.start ) * eased + this.start; + + if ( this.options.step ) { + this.options.step.call( this.elem, this.now, this ); + } + + if ( hooks && hooks.set ) { + hooks.set( this ); + } else { + Tween.propHooks._default.set( this ); + } + return this; + } +}; + +Tween.prototype.init.prototype = Tween.prototype; + +Tween.propHooks = { + _default: { + get: function( tween ) { + var result; + + // Use a property on the element directly when it is not a DOM element, + // or when there is no matching style property that exists. + if ( tween.elem.nodeType !== 1 || + tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { + return tween.elem[ tween.prop ]; + } + + // Passing an empty string as a 3rd parameter to .css will automatically + // attempt a parseFloat and fallback to a string if the parse fails. + // Simple values such as "10px" are parsed to Float; + // complex values such as "rotate(1rad)" are returned as-is. + result = jQuery.css( tween.elem, tween.prop, "" ); + + // Empty strings, null, undefined and "auto" are converted to 0. + return !result || result === "auto" ? 0 : result; + }, + set: function( tween ) { + + // Use step hook for back compat. + // Use cssHook if its there. + // Use .style if available and use plain properties where available. + if ( jQuery.fx.step[ tween.prop ] ) { + jQuery.fx.step[ tween.prop ]( tween ); + } else if ( tween.elem.nodeType === 1 && ( + jQuery.cssHooks[ tween.prop ] || + tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { + jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); + } else { + tween.elem[ tween.prop ] = tween.now; + } + } + } +}; + +// Support: IE <=9 only +// Panic based approach to setting things on disconnected nodes +Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { + set: function( tween ) { + if ( tween.elem.nodeType && tween.elem.parentNode ) { + tween.elem[ tween.prop ] = tween.now; + } + } +}; + +jQuery.easing = { + linear: function( p ) { + return p; + }, + swing: function( p ) { + return 0.5 - Math.cos( p * Math.PI ) / 2; + }, + _default: "swing" +}; + +jQuery.fx = Tween.prototype.init; + +// Back compat <1.8 extension point +jQuery.fx.step = {}; + + + + +var + fxNow, inProgress, + rfxtypes = /^(?:toggle|show|hide)$/, + rrun = /queueHooks$/; + +function schedule() { + if ( inProgress ) { + if ( document.hidden === false && window.requestAnimationFrame ) { + window.requestAnimationFrame( schedule ); + } else { + window.setTimeout( schedule, jQuery.fx.interval ); + } + + jQuery.fx.tick(); + } +} + +// Animations created synchronously will run synchronously +function createFxNow() { + window.setTimeout( function() { + fxNow = undefined; + } ); + return ( fxNow = Date.now() ); +} + +// Generate parameters to create a standard animation +function genFx( type, includeWidth ) { + var which, + i = 0, + attrs = { height: type }; + + // If we include width, step value is 1 to do all cssExpand values, + // otherwise step value is 2 to skip over Left and Right + includeWidth = includeWidth ? 1 : 0; + for ( ; i < 4; i += 2 - includeWidth ) { + which = cssExpand[ i ]; + attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; + } + + if ( includeWidth ) { + attrs.opacity = attrs.width = type; + } + + return attrs; +} + +function createTween( value, prop, animation ) { + var tween, + collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), + index = 0, + length = collection.length; + for ( ; index < length; index++ ) { + if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { + + // We're done with this property + return tween; + } + } +} + +function defaultPrefilter( elem, props, opts ) { + var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, + isBox = "width" in props || "height" in props, + anim = this, + orig = {}, + style = elem.style, + hidden = elem.nodeType && isHiddenWithinTree( elem ), + dataShow = dataPriv.get( elem, "fxshow" ); + + // Queue-skipping animations hijack the fx hooks + if ( !opts.queue ) { + hooks = jQuery._queueHooks( elem, "fx" ); + if ( hooks.unqueued == null ) { + hooks.unqueued = 0; + oldfire = hooks.empty.fire; + hooks.empty.fire = function() { + if ( !hooks.unqueued ) { + oldfire(); + } + }; + } + hooks.unqueued++; + + anim.always( function() { + + // Ensure the complete handler is called before this completes + anim.always( function() { + hooks.unqueued--; + if ( !jQuery.queue( elem, "fx" ).length ) { + hooks.empty.fire(); + } + } ); + } ); + } + + // Detect show/hide animations + for ( prop in props ) { + value = props[ prop ]; + if ( rfxtypes.test( value ) ) { + delete props[ prop ]; + toggle = toggle || value === "toggle"; + if ( value === ( hidden ? "hide" : "show" ) ) { + + // Pretend to be hidden if this is a "show" and + // there is still data from a stopped show/hide + if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { + hidden = true; + + // Ignore all other no-op show/hide data + } else { + continue; + } + } + orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); + } + } + + // Bail out if this is a no-op like .hide().hide() + propTween = !jQuery.isEmptyObject( props ); + if ( !propTween && jQuery.isEmptyObject( orig ) ) { + return; + } + + // Restrict "overflow" and "display" styles during box animations + if ( isBox && elem.nodeType === 1 ) { + + // Support: IE <=9 - 11, Edge 12 - 15 + // Record all 3 overflow attributes because IE does not infer the shorthand + // from identically-valued overflowX and overflowY and Edge just mirrors + // the overflowX value there. + opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; + + // Identify a display type, preferring old show/hide data over the CSS cascade + restoreDisplay = dataShow && dataShow.display; + if ( restoreDisplay == null ) { + restoreDisplay = dataPriv.get( elem, "display" ); + } + display = jQuery.css( elem, "display" ); + if ( display === "none" ) { + if ( restoreDisplay ) { + display = restoreDisplay; + } else { + + // Get nonempty value(s) by temporarily forcing visibility + showHide( [ elem ], true ); + restoreDisplay = elem.style.display || restoreDisplay; + display = jQuery.css( elem, "display" ); + showHide( [ elem ] ); + } + } + + // Animate inline elements as inline-block + if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { + if ( jQuery.css( elem, "float" ) === "none" ) { + + // Restore the original display value at the end of pure show/hide animations + if ( !propTween ) { + anim.done( function() { + style.display = restoreDisplay; + } ); + if ( restoreDisplay == null ) { + display = style.display; + restoreDisplay = display === "none" ? "" : display; + } + } + style.display = "inline-block"; + } + } + } + + if ( opts.overflow ) { + style.overflow = "hidden"; + anim.always( function() { + style.overflow = opts.overflow[ 0 ]; + style.overflowX = opts.overflow[ 1 ]; + style.overflowY = opts.overflow[ 2 ]; + } ); + } + + // Implement show/hide animations + propTween = false; + for ( prop in orig ) { + + // General show/hide setup for this element animation + if ( !propTween ) { + if ( dataShow ) { + if ( "hidden" in dataShow ) { + hidden = dataShow.hidden; + } + } else { + dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); + } + + // Store hidden/visible for toggle so `.stop().toggle()` "reverses" + if ( toggle ) { + dataShow.hidden = !hidden; + } + + // Show elements before animating them + if ( hidden ) { + showHide( [ elem ], true ); + } + + /* eslint-disable no-loop-func */ + + anim.done( function() { + + /* eslint-enable no-loop-func */ + + // The final step of a "hide" animation is actually hiding the element + if ( !hidden ) { + showHide( [ elem ] ); + } + dataPriv.remove( elem, "fxshow" ); + for ( prop in orig ) { + jQuery.style( elem, prop, orig[ prop ] ); + } + } ); + } + + // Per-property setup + propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); + if ( !( prop in dataShow ) ) { + dataShow[ prop ] = propTween.start; + if ( hidden ) { + propTween.end = propTween.start; + propTween.start = 0; + } + } + } +} + +function propFilter( props, specialEasing ) { + var index, name, easing, value, hooks; + + // camelCase, specialEasing and expand cssHook pass + for ( index in props ) { + name = camelCase( index ); + easing = specialEasing[ name ]; + value = props[ index ]; + if ( Array.isArray( value ) ) { + easing = value[ 1 ]; + value = props[ index ] = value[ 0 ]; + } + + if ( index !== name ) { + props[ name ] = value; + delete props[ index ]; + } + + hooks = jQuery.cssHooks[ name ]; + if ( hooks && "expand" in hooks ) { + value = hooks.expand( value ); + delete props[ name ]; + + // Not quite $.extend, this won't overwrite existing keys. + // Reusing 'index' because we have the correct "name" + for ( index in value ) { + if ( !( index in props ) ) { + props[ index ] = value[ index ]; + specialEasing[ index ] = easing; + } + } + } else { + specialEasing[ name ] = easing; + } + } +} + +function Animation( elem, properties, options ) { + var result, + stopped, + index = 0, + length = Animation.prefilters.length, + deferred = jQuery.Deferred().always( function() { + + // Don't match elem in the :animated selector + delete tick.elem; + } ), + tick = function() { + if ( stopped ) { + return false; + } + var currentTime = fxNow || createFxNow(), + remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), + + // Support: Android 2.3 only + // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) + temp = remaining / animation.duration || 0, + percent = 1 - temp, + index = 0, + length = animation.tweens.length; + + for ( ; index < length; index++ ) { + animation.tweens[ index ].run( percent ); + } + + deferred.notifyWith( elem, [ animation, percent, remaining ] ); + + // If there's more to do, yield + if ( percent < 1 && length ) { + return remaining; + } + + // If this was an empty animation, synthesize a final progress notification + if ( !length ) { + deferred.notifyWith( elem, [ animation, 1, 0 ] ); + } + + // Resolve the animation and report its conclusion + deferred.resolveWith( elem, [ animation ] ); + return false; + }, + animation = deferred.promise( { + elem: elem, + props: jQuery.extend( {}, properties ), + opts: jQuery.extend( true, { + specialEasing: {}, + easing: jQuery.easing._default + }, options ), + originalProperties: properties, + originalOptions: options, + startTime: fxNow || createFxNow(), + duration: options.duration, + tweens: [], + createTween: function( prop, end ) { + var tween = jQuery.Tween( elem, animation.opts, prop, end, + animation.opts.specialEasing[ prop ] || animation.opts.easing ); + animation.tweens.push( tween ); + return tween; + }, + stop: function( gotoEnd ) { + var index = 0, + + // If we are going to the end, we want to run all the tweens + // otherwise we skip this part + length = gotoEnd ? animation.tweens.length : 0; + if ( stopped ) { + return this; + } + stopped = true; + for ( ; index < length; index++ ) { + animation.tweens[ index ].run( 1 ); + } + + // Resolve when we played the last frame; otherwise, reject + if ( gotoEnd ) { + deferred.notifyWith( elem, [ animation, 1, 0 ] ); + deferred.resolveWith( elem, [ animation, gotoEnd ] ); + } else { + deferred.rejectWith( elem, [ animation, gotoEnd ] ); + } + return this; + } + } ), + props = animation.props; + + propFilter( props, animation.opts.specialEasing ); + + for ( ; index < length; index++ ) { + result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); + if ( result ) { + if ( isFunction( result.stop ) ) { + jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = + result.stop.bind( result ); + } + return result; + } + } + + jQuery.map( props, createTween, animation ); + + if ( isFunction( animation.opts.start ) ) { + animation.opts.start.call( elem, animation ); + } + + // Attach callbacks from options + animation + .progress( animation.opts.progress ) + .done( animation.opts.done, animation.opts.complete ) + .fail( animation.opts.fail ) + .always( animation.opts.always ); + + jQuery.fx.timer( + jQuery.extend( tick, { + elem: elem, + anim: animation, + queue: animation.opts.queue + } ) + ); + + return animation; +} + +jQuery.Animation = jQuery.extend( Animation, { + + tweeners: { + "*": [ function( prop, value ) { + var tween = this.createTween( prop, value ); + adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); + return tween; + } ] + }, + + tweener: function( props, callback ) { + if ( isFunction( props ) ) { + callback = props; + props = [ "*" ]; + } else { + props = props.match( rnothtmlwhite ); + } + + var prop, + index = 0, + length = props.length; + + for ( ; index < length; index++ ) { + prop = props[ index ]; + Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; + Animation.tweeners[ prop ].unshift( callback ); + } + }, + + prefilters: [ defaultPrefilter ], + + prefilter: function( callback, prepend ) { + if ( prepend ) { + Animation.prefilters.unshift( callback ); + } else { + Animation.prefilters.push( callback ); + } + } +} ); + +jQuery.speed = function( speed, easing, fn ) { + var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { + complete: fn || !fn && easing || + isFunction( speed ) && speed, + duration: speed, + easing: fn && easing || easing && !isFunction( easing ) && easing + }; + + // Go to the end state if fx are off + if ( jQuery.fx.off ) { + opt.duration = 0; + + } else { + if ( typeof opt.duration !== "number" ) { + if ( opt.duration in jQuery.fx.speeds ) { + opt.duration = jQuery.fx.speeds[ opt.duration ]; + + } else { + opt.duration = jQuery.fx.speeds._default; + } + } + } + + // Normalize opt.queue - true/undefined/null -> "fx" + if ( opt.queue == null || opt.queue === true ) { + opt.queue = "fx"; + } + + // Queueing + opt.old = opt.complete; + + opt.complete = function() { + if ( isFunction( opt.old ) ) { + opt.old.call( this ); + } + + if ( opt.queue ) { + jQuery.dequeue( this, opt.queue ); + } + }; + + return opt; +}; + +jQuery.fn.extend( { + fadeTo: function( speed, to, easing, callback ) { + + // Show any hidden elements after setting opacity to 0 + return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() + + // Animate to the value specified + .end().animate( { opacity: to }, speed, easing, callback ); + }, + animate: function( prop, speed, easing, callback ) { + var empty = jQuery.isEmptyObject( prop ), + optall = jQuery.speed( speed, easing, callback ), + doAnimation = function() { + + // Operate on a copy of prop so per-property easing won't be lost + var anim = Animation( this, jQuery.extend( {}, prop ), optall ); + + // Empty animations, or finishing resolves immediately + if ( empty || dataPriv.get( this, "finish" ) ) { + anim.stop( true ); + } + }; + doAnimation.finish = doAnimation; + + return empty || optall.queue === false ? + this.each( doAnimation ) : + this.queue( optall.queue, doAnimation ); + }, + stop: function( type, clearQueue, gotoEnd ) { + var stopQueue = function( hooks ) { + var stop = hooks.stop; + delete hooks.stop; + stop( gotoEnd ); + }; + + if ( typeof type !== "string" ) { + gotoEnd = clearQueue; + clearQueue = type; + type = undefined; + } + if ( clearQueue ) { + this.queue( type || "fx", [] ); + } + + return this.each( function() { + var dequeue = true, + index = type != null && type + "queueHooks", + timers = jQuery.timers, + data = dataPriv.get( this ); + + if ( index ) { + if ( data[ index ] && data[ index ].stop ) { + stopQueue( data[ index ] ); + } + } else { + for ( index in data ) { + if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { + stopQueue( data[ index ] ); + } + } + } + + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && + ( type == null || timers[ index ].queue === type ) ) { + + timers[ index ].anim.stop( gotoEnd ); + dequeue = false; + timers.splice( index, 1 ); + } + } + + // Start the next in the queue if the last step wasn't forced. + // Timers currently will call their complete callbacks, which + // will dequeue but only if they were gotoEnd. + if ( dequeue || !gotoEnd ) { + jQuery.dequeue( this, type ); + } + } ); + }, + finish: function( type ) { + if ( type !== false ) { + type = type || "fx"; + } + return this.each( function() { + var index, + data = dataPriv.get( this ), + queue = data[ type + "queue" ], + hooks = data[ type + "queueHooks" ], + timers = jQuery.timers, + length = queue ? queue.length : 0; + + // Enable finishing flag on private data + data.finish = true; + + // Empty the queue first + jQuery.queue( this, type, [] ); + + if ( hooks && hooks.stop ) { + hooks.stop.call( this, true ); + } + + // Look for any active animations, and finish them + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && timers[ index ].queue === type ) { + timers[ index ].anim.stop( true ); + timers.splice( index, 1 ); + } + } + + // Look for any animations in the old queue and finish them + for ( index = 0; index < length; index++ ) { + if ( queue[ index ] && queue[ index ].finish ) { + queue[ index ].finish.call( this ); + } + } + + // Turn off finishing flag + delete data.finish; + } ); + } +} ); + +jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { + var cssFn = jQuery.fn[ name ]; + jQuery.fn[ name ] = function( speed, easing, callback ) { + return speed == null || typeof speed === "boolean" ? + cssFn.apply( this, arguments ) : + this.animate( genFx( name, true ), speed, easing, callback ); + }; +} ); + +// Generate shortcuts for custom animations +jQuery.each( { + slideDown: genFx( "show" ), + slideUp: genFx( "hide" ), + slideToggle: genFx( "toggle" ), + fadeIn: { opacity: "show" }, + fadeOut: { opacity: "hide" }, + fadeToggle: { opacity: "toggle" } +}, function( name, props ) { + jQuery.fn[ name ] = function( speed, easing, callback ) { + return this.animate( props, speed, easing, callback ); + }; +} ); + +jQuery.timers = []; +jQuery.fx.tick = function() { + var timer, + i = 0, + timers = jQuery.timers; + + fxNow = Date.now(); + + for ( ; i < timers.length; i++ ) { + timer = timers[ i ]; + + // Run the timer and safely remove it when done (allowing for external removal) + if ( !timer() && timers[ i ] === timer ) { + timers.splice( i--, 1 ); + } + } + + if ( !timers.length ) { + jQuery.fx.stop(); + } + fxNow = undefined; +}; + +jQuery.fx.timer = function( timer ) { + jQuery.timers.push( timer ); + jQuery.fx.start(); +}; + +jQuery.fx.interval = 13; +jQuery.fx.start = function() { + if ( inProgress ) { + return; + } + + inProgress = true; + schedule(); +}; + +jQuery.fx.stop = function() { + inProgress = null; +}; + +jQuery.fx.speeds = { + slow: 600, + fast: 200, + + // Default speed + _default: 400 +}; + + +// Based off of the plugin by Clint Helfers, with permission. +// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ +jQuery.fn.delay = function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; + type = type || "fx"; + + return this.queue( type, function( next, hooks ) { + var timeout = window.setTimeout( next, time ); + hooks.stop = function() { + window.clearTimeout( timeout ); + }; + } ); +}; + + +( function() { + var input = document.createElement( "input" ), + select = document.createElement( "select" ), + opt = select.appendChild( document.createElement( "option" ) ); + + input.type = "checkbox"; + + // Support: Android <=4.3 only + // Default value for a checkbox should be "on" + support.checkOn = input.value !== ""; + + // Support: IE <=11 only + // Must access selectedIndex to make default options select + support.optSelected = opt.selected; + + // Support: IE <=11 only + // An input loses its value after becoming a radio + input = document.createElement( "input" ); + input.value = "t"; + input.type = "radio"; + support.radioValue = input.value === "t"; +} )(); + + +var boolHook, + attrHandle = jQuery.expr.attrHandle; + +jQuery.fn.extend( { + attr: function( name, value ) { + return access( this, jQuery.attr, name, value, arguments.length > 1 ); + }, + + removeAttr: function( name ) { + return this.each( function() { + jQuery.removeAttr( this, name ); + } ); + } +} ); + +jQuery.extend( { + attr: function( elem, name, value ) { + var ret, hooks, + nType = elem.nodeType; + + // Don't get/set attributes on text, comment and attribute nodes + if ( nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + // Fallback to prop when attributes are not supported + if ( typeof elem.getAttribute === "undefined" ) { + return jQuery.prop( elem, name, value ); + } + + // Attribute hooks are determined by the lowercase version + // Grab necessary hook if one is defined + if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { + hooks = jQuery.attrHooks[ name.toLowerCase() ] || + ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); + } + + if ( value !== undefined ) { + if ( value === null ) { + jQuery.removeAttr( elem, name ); + return; + } + + if ( hooks && "set" in hooks && + ( ret = hooks.set( elem, value, name ) ) !== undefined ) { + return ret; + } + + elem.setAttribute( name, value + "" ); + return value; + } + + if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { + return ret; + } + + ret = jQuery.find.attr( elem, name ); + + // Non-existent attributes return null, we normalize to undefined + return ret == null ? undefined : ret; + }, + + attrHooks: { + type: { + set: function( elem, value ) { + if ( !support.radioValue && value === "radio" && + nodeName( elem, "input" ) ) { + var val = elem.value; + elem.setAttribute( "type", value ); + if ( val ) { + elem.value = val; + } + return value; + } + } + } + }, + + removeAttr: function( elem, value ) { + var name, + i = 0, + + // Attribute names can contain non-HTML whitespace characters + // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 + attrNames = value && value.match( rnothtmlwhite ); + + if ( attrNames && elem.nodeType === 1 ) { + while ( ( name = attrNames[ i++ ] ) ) { + elem.removeAttribute( name ); + } + } + } +} ); + +// Hooks for boolean attributes +boolHook = { + set: function( elem, value, name ) { + if ( value === false ) { + + // Remove boolean attributes when set to false + jQuery.removeAttr( elem, name ); + } else { + elem.setAttribute( name, name ); + } + return name; + } +}; + +jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { + var getter = attrHandle[ name ] || jQuery.find.attr; + + attrHandle[ name ] = function( elem, name, isXML ) { + var ret, handle, + lowercaseName = name.toLowerCase(); + + if ( !isXML ) { + + // Avoid an infinite loop by temporarily removing this function from the getter + handle = attrHandle[ lowercaseName ]; + attrHandle[ lowercaseName ] = ret; + ret = getter( elem, name, isXML ) != null ? + lowercaseName : + null; + attrHandle[ lowercaseName ] = handle; + } + return ret; + }; +} ); + + + + +var rfocusable = /^(?:input|select|textarea|button)$/i, + rclickable = /^(?:a|area)$/i; + +jQuery.fn.extend( { + prop: function( name, value ) { + return access( this, jQuery.prop, name, value, arguments.length > 1 ); + }, + + removeProp: function( name ) { + return this.each( function() { + delete this[ jQuery.propFix[ name ] || name ]; + } ); + } +} ); + +jQuery.extend( { + prop: function( elem, name, value ) { + var ret, hooks, + nType = elem.nodeType; + + // Don't get/set properties on text, comment and attribute nodes + if ( nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { + + // Fix name and attach hooks + name = jQuery.propFix[ name ] || name; + hooks = jQuery.propHooks[ name ]; + } + + if ( value !== undefined ) { + if ( hooks && "set" in hooks && + ( ret = hooks.set( elem, value, name ) ) !== undefined ) { + return ret; + } + + return ( elem[ name ] = value ); + } + + if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { + return ret; + } + + return elem[ name ]; + }, + + propHooks: { + tabIndex: { + get: function( elem ) { + + // Support: IE <=9 - 11 only + // elem.tabIndex doesn't always return the + // correct value when it hasn't been explicitly set + // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + // Use proper attribute retrieval(#12072) + var tabindex = jQuery.find.attr( elem, "tabindex" ); + + if ( tabindex ) { + return parseInt( tabindex, 10 ); + } + + if ( + rfocusable.test( elem.nodeName ) || + rclickable.test( elem.nodeName ) && + elem.href + ) { + return 0; + } + + return -1; + } + } + }, + + propFix: { + "for": "htmlFor", + "class": "className" + } +} ); + +// Support: IE <=11 only +// Accessing the selectedIndex property +// forces the browser to respect setting selected +// on the option +// The getter ensures a default option is selected +// when in an optgroup +// eslint rule "no-unused-expressions" is disabled for this code +// since it considers such accessions noop +if ( !support.optSelected ) { + jQuery.propHooks.selected = { + get: function( elem ) { + + /* eslint no-unused-expressions: "off" */ + + var parent = elem.parentNode; + if ( parent && parent.parentNode ) { + parent.parentNode.selectedIndex; + } + return null; + }, + set: function( elem ) { + + /* eslint no-unused-expressions: "off" */ + + var parent = elem.parentNode; + if ( parent ) { + parent.selectedIndex; + + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + } + }; +} + +jQuery.each( [ + "tabIndex", + "readOnly", + "maxLength", + "cellSpacing", + "cellPadding", + "rowSpan", + "colSpan", + "useMap", + "frameBorder", + "contentEditable" +], function() { + jQuery.propFix[ this.toLowerCase() ] = this; +} ); + + + + + // Strip and collapse whitespace according to HTML spec + // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace + function stripAndCollapse( value ) { + var tokens = value.match( rnothtmlwhite ) || []; + return tokens.join( " " ); + } + + +function getClass( elem ) { + return elem.getAttribute && elem.getAttribute( "class" ) || ""; +} + +function classesToArray( value ) { + if ( Array.isArray( value ) ) { + return value; + } + if ( typeof value === "string" ) { + return value.match( rnothtmlwhite ) || []; + } + return []; +} + +jQuery.fn.extend( { + addClass: function( value ) { + var classes, elem, cur, curValue, clazz, j, finalValue, + i = 0; + + if ( isFunction( value ) ) { + return this.each( function( j ) { + jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); + } ); + } + + classes = classesToArray( value ); + + if ( classes.length ) { + while ( ( elem = this[ i++ ] ) ) { + curValue = getClass( elem ); + cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); + + if ( cur ) { + j = 0; + while ( ( clazz = classes[ j++ ] ) ) { + if ( cur.indexOf( " " + clazz + " " ) < 0 ) { + cur += clazz + " "; + } + } + + // Only assign if different to avoid unneeded rendering. + finalValue = stripAndCollapse( cur ); + if ( curValue !== finalValue ) { + elem.setAttribute( "class", finalValue ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + var classes, elem, cur, curValue, clazz, j, finalValue, + i = 0; + + if ( isFunction( value ) ) { + return this.each( function( j ) { + jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); + } ); + } + + if ( !arguments.length ) { + return this.attr( "class", "" ); + } + + classes = classesToArray( value ); + + if ( classes.length ) { + while ( ( elem = this[ i++ ] ) ) { + curValue = getClass( elem ); + + // This expression is here for better compressibility (see addClass) + cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); + + if ( cur ) { + j = 0; + while ( ( clazz = classes[ j++ ] ) ) { + + // Remove *all* instances + while ( cur.indexOf( " " + clazz + " " ) > -1 ) { + cur = cur.replace( " " + clazz + " ", " " ); + } + } + + // Only assign if different to avoid unneeded rendering. + finalValue = stripAndCollapse( cur ); + if ( curValue !== finalValue ) { + elem.setAttribute( "class", finalValue ); + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value, + isValidValue = type === "string" || Array.isArray( value ); + + if ( typeof stateVal === "boolean" && isValidValue ) { + return stateVal ? this.addClass( value ) : this.removeClass( value ); + } + + if ( isFunction( value ) ) { + return this.each( function( i ) { + jQuery( this ).toggleClass( + value.call( this, i, getClass( this ), stateVal ), + stateVal + ); + } ); + } + + return this.each( function() { + var className, i, self, classNames; + + if ( isValidValue ) { + + // Toggle individual class names + i = 0; + self = jQuery( this ); + classNames = classesToArray( value ); + + while ( ( className = classNames[ i++ ] ) ) { + + // Check each className given, space separated list + if ( self.hasClass( className ) ) { + self.removeClass( className ); + } else { + self.addClass( className ); + } + } + + // Toggle whole class name + } else if ( value === undefined || type === "boolean" ) { + className = getClass( this ); + if ( className ) { + + // Store className if set + dataPriv.set( this, "__className__", className ); + } + + // If the element has a class name or if we're passed `false`, + // then remove the whole classname (if there was one, the above saved it). + // Otherwise bring back whatever was previously saved (if anything), + // falling back to the empty string if nothing was stored. + if ( this.setAttribute ) { + this.setAttribute( "class", + className || value === false ? + "" : + dataPriv.get( this, "__className__" ) || "" + ); + } + } + } ); + }, + + hasClass: function( selector ) { + var className, elem, + i = 0; + + className = " " + selector + " "; + while ( ( elem = this[ i++ ] ) ) { + if ( elem.nodeType === 1 && + ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { + return true; + } + } + + return false; + } +} ); + + + + +var rreturn = /\r/g; + +jQuery.fn.extend( { + val: function( value ) { + var hooks, ret, valueIsFunction, + elem = this[ 0 ]; + + if ( !arguments.length ) { + if ( elem ) { + hooks = jQuery.valHooks[ elem.type ] || + jQuery.valHooks[ elem.nodeName.toLowerCase() ]; + + if ( hooks && + "get" in hooks && + ( ret = hooks.get( elem, "value" ) ) !== undefined + ) { + return ret; + } + + ret = elem.value; + + // Handle most common string cases + if ( typeof ret === "string" ) { + return ret.replace( rreturn, "" ); + } + + // Handle cases where value is null/undef or number + return ret == null ? "" : ret; + } + + return; + } + + valueIsFunction = isFunction( value ); + + return this.each( function( i ) { + var val; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( valueIsFunction ) { + val = value.call( this, i, jQuery( this ).val() ); + } else { + val = value; + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + + } else if ( typeof val === "number" ) { + val += ""; + + } else if ( Array.isArray( val ) ) { + val = jQuery.map( val, function( value ) { + return value == null ? "" : value + ""; + } ); + } + + hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; + + // If set returns undefined, fall back to normal setting + if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { + this.value = val; + } + } ); + } +} ); + +jQuery.extend( { + valHooks: { + option: { + get: function( elem ) { + + var val = jQuery.find.attr( elem, "value" ); + return val != null ? + val : + + // Support: IE <=10 - 11 only + // option.text throws exceptions (#14686, #14858) + // Strip and collapse whitespace + // https://html.spec.whatwg.org/#strip-and-collapse-whitespace + stripAndCollapse( jQuery.text( elem ) ); + } + }, + select: { + get: function( elem ) { + var value, option, i, + options = elem.options, + index = elem.selectedIndex, + one = elem.type === "select-one", + values = one ? null : [], + max = one ? index + 1 : options.length; + + if ( index < 0 ) { + i = max; + + } else { + i = one ? index : 0; + } + + // Loop through all the selected options + for ( ; i < max; i++ ) { + option = options[ i ]; + + // Support: IE <=9 only + // IE8-9 doesn't update selected after form reset (#2551) + if ( ( option.selected || i === index ) && + + // Don't return options that are disabled or in a disabled optgroup + !option.disabled && + ( !option.parentNode.disabled || + !nodeName( option.parentNode, "optgroup" ) ) ) { + + // Get the specific value for the option + value = jQuery( option ).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + }, + + set: function( elem, value ) { + var optionSet, option, + options = elem.options, + values = jQuery.makeArray( value ), + i = options.length; + + while ( i-- ) { + option = options[ i ]; + + /* eslint-disable no-cond-assign */ + + if ( option.selected = + jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 + ) { + optionSet = true; + } + + /* eslint-enable no-cond-assign */ + } + + // Force browsers to behave consistently when non-matching value is set + if ( !optionSet ) { + elem.selectedIndex = -1; + } + return values; + } + } + } +} ); + +// Radios and checkboxes getter/setter +jQuery.each( [ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = { + set: function( elem, value ) { + if ( Array.isArray( value ) ) { + return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); + } + } + }; + if ( !support.checkOn ) { + jQuery.valHooks[ this ].get = function( elem ) { + return elem.getAttribute( "value" ) === null ? "on" : elem.value; + }; + } +} ); + + + + +// Return jQuery for attributes-only inclusion + + +support.focusin = "onfocusin" in window; + + +var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, + stopPropagationCallback = function( e ) { + e.stopPropagation(); + }; + +jQuery.extend( jQuery.event, { + + trigger: function( event, data, elem, onlyHandlers ) { + + var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, + eventPath = [ elem || document ], + type = hasOwn.call( event, "type" ) ? event.type : event, + namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; + + cur = lastElement = tmp = elem = elem || document; + + // Don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // focus/blur morphs to focusin/out; ensure we're not firing them right now + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { + return; + } + + if ( type.indexOf( "." ) > -1 ) { + + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split( "." ); + type = namespaces.shift(); + namespaces.sort(); + } + ontype = type.indexOf( ":" ) < 0 && "on" + type; + + // Caller can pass in a jQuery.Event object, Object, or just an event type string + event = event[ jQuery.expando ] ? + event : + new jQuery.Event( type, typeof event === "object" && event ); + + // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) + event.isTrigger = onlyHandlers ? 2 : 3; + event.namespace = namespaces.join( "." ); + event.rnamespace = event.namespace ? + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : + null; + + // Clean up the event in case it is being reused + event.result = undefined; + if ( !event.target ) { + event.target = elem; + } + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data == null ? + [ event ] : + jQuery.makeArray( data, [ event ] ); + + // Allow special events to draw outside the lines + special = jQuery.event.special[ type ] || {}; + if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { + return; + } + + // Determine event propagation path in advance, per W3C events spec (#9951) + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) + if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { + + bubbleType = special.delegateType || type; + if ( !rfocusMorph.test( bubbleType + type ) ) { + cur = cur.parentNode; + } + for ( ; cur; cur = cur.parentNode ) { + eventPath.push( cur ); + tmp = cur; + } + + // Only add window if we got to document (e.g., not plain obj or detached DOM) + if ( tmp === ( elem.ownerDocument || document ) ) { + eventPath.push( tmp.defaultView || tmp.parentWindow || window ); + } + } + + // Fire handlers on the event path + i = 0; + while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { + lastElement = cur; + event.type = i > 1 ? + bubbleType : + special.bindType || type; + + // jQuery handler + handle = ( + dataPriv.get( cur, "events" ) || Object.create( null ) + )[ event.type ] && + dataPriv.get( cur, "handle" ); + if ( handle ) { + handle.apply( cur, data ); + } + + // Native handler + handle = ontype && cur[ ontype ]; + if ( handle && handle.apply && acceptData( cur ) ) { + event.result = handle.apply( cur, data ); + if ( event.result === false ) { + event.preventDefault(); + } + } + } + event.type = type; + + // If nobody prevented the default action, do it now + if ( !onlyHandlers && !event.isDefaultPrevented() ) { + + if ( ( !special._default || + special._default.apply( eventPath.pop(), data ) === false ) && + acceptData( elem ) ) { + + // Call a native DOM method on the target with the same name as the event. + // Don't do default actions on window, that's where global variables be (#6170) + if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { + + // Don't re-trigger an onFOO event when we call its FOO() method + tmp = elem[ ontype ]; + + if ( tmp ) { + elem[ ontype ] = null; + } + + // Prevent re-triggering of the same event, since we already bubbled it above + jQuery.event.triggered = type; + + if ( event.isPropagationStopped() ) { + lastElement.addEventListener( type, stopPropagationCallback ); + } + + elem[ type ](); + + if ( event.isPropagationStopped() ) { + lastElement.removeEventListener( type, stopPropagationCallback ); + } + + jQuery.event.triggered = undefined; + + if ( tmp ) { + elem[ ontype ] = tmp; + } + } + } + } + + return event.result; + }, + + // Piggyback on a donor event to simulate a different one + // Used only for `focus(in | out)` events + simulate: function( type, elem, event ) { + var e = jQuery.extend( + new jQuery.Event(), + event, + { + type: type, + isSimulated: true + } + ); + + jQuery.event.trigger( e, null, elem ); + } + +} ); + +jQuery.fn.extend( { + + trigger: function( type, data ) { + return this.each( function() { + jQuery.event.trigger( type, data, this ); + } ); + }, + triggerHandler: function( type, data ) { + var elem = this[ 0 ]; + if ( elem ) { + return jQuery.event.trigger( type, data, elem, true ); + } + } +} ); + + +// Support: Firefox <=44 +// Firefox doesn't have focus(in | out) events +// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 +// +// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 +// focus(in | out) events fire after focus & blur events, +// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order +// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 +if ( !support.focusin ) { + jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler on the document while someone wants focusin/focusout + var handler = function( event ) { + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); + }; + + jQuery.event.special[ fix ] = { + setup: function() { + + // Handle: regular nodes (via `this.ownerDocument`), window + // (via `this.document`) & document (via `this`). + var doc = this.ownerDocument || this.document || this, + attaches = dataPriv.access( doc, fix ); + + if ( !attaches ) { + doc.addEventListener( orig, handler, true ); + } + dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); + }, + teardown: function() { + var doc = this.ownerDocument || this.document || this, + attaches = dataPriv.access( doc, fix ) - 1; + + if ( !attaches ) { + doc.removeEventListener( orig, handler, true ); + dataPriv.remove( doc, fix ); + + } else { + dataPriv.access( doc, fix, attaches ); + } + } + }; + } ); +} +var location = window.location; + +var nonce = { guid: Date.now() }; + +var rquery = ( /\?/ ); + + + +// Cross-browser xml parsing +jQuery.parseXML = function( data ) { + var xml; + if ( !data || typeof data !== "string" ) { + return null; + } + + // Support: IE 9 - 11 only + // IE throws on parseFromString with invalid input. + try { + xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); + } catch ( e ) { + xml = undefined; + } + + if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { + jQuery.error( "Invalid XML: " + data ); + } + return xml; +}; + + +var + rbracket = /\[\]$/, + rCRLF = /\r?\n/g, + rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, + rsubmittable = /^(?:input|select|textarea|keygen)/i; + +function buildParams( prefix, obj, traditional, add ) { + var name; + + if ( Array.isArray( obj ) ) { + + // Serialize array item. + jQuery.each( obj, function( i, v ) { + if ( traditional || rbracket.test( prefix ) ) { + + // Treat each array item as a scalar. + add( prefix, v ); + + } else { + + // Item is non-scalar (array or object), encode its numeric index. + buildParams( + prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", + v, + traditional, + add + ); + } + } ); + + } else if ( !traditional && toType( obj ) === "object" ) { + + // Serialize object item. + for ( name in obj ) { + buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); + } + + } else { + + // Serialize scalar item. + add( prefix, obj ); + } +} + +// Serialize an array of form elements or a set of +// key/values into a query string +jQuery.param = function( a, traditional ) { + var prefix, + s = [], + add = function( key, valueOrFunction ) { + + // If value is a function, invoke it and use its return value + var value = isFunction( valueOrFunction ) ? + valueOrFunction() : + valueOrFunction; + + s[ s.length ] = encodeURIComponent( key ) + "=" + + encodeURIComponent( value == null ? "" : value ); + }; + + if ( a == null ) { + return ""; + } + + // If an array was passed in, assume that it is an array of form elements. + if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { + + // Serialize the form elements + jQuery.each( a, function() { + add( this.name, this.value ); + } ); + + } else { + + // If traditional, encode the "old" way (the way 1.3.2 or older + // did it), otherwise encode params recursively. + for ( prefix in a ) { + buildParams( prefix, a[ prefix ], traditional, add ); + } + } + + // Return the resulting serialization + return s.join( "&" ); +}; + +jQuery.fn.extend( { + serialize: function() { + return jQuery.param( this.serializeArray() ); + }, + serializeArray: function() { + return this.map( function() { + + // Can add propHook for "elements" to filter or add form elements + var elements = jQuery.prop( this, "elements" ); + return elements ? jQuery.makeArray( elements ) : this; + } ) + .filter( function() { + var type = this.type; + + // Use .is( ":disabled" ) so that fieldset[disabled] works + return this.name && !jQuery( this ).is( ":disabled" ) && + rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && + ( this.checked || !rcheckableType.test( type ) ); + } ) + .map( function( _i, elem ) { + var val = jQuery( this ).val(); + + if ( val == null ) { + return null; + } + + if ( Array.isArray( val ) ) { + return jQuery.map( val, function( val ) { + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + } ); + } + + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + } ).get(); + } +} ); + + +var + r20 = /%20/g, + rhash = /#.*$/, + rantiCache = /([?&])_=[^&]*/, + rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, + + // #7653, #8125, #8152: local protocol detection + rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, + rnoContent = /^(?:GET|HEAD)$/, + rprotocol = /^\/\//, + + /* Prefilters + * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) + * 2) These are called: + * - BEFORE asking for a transport + * - AFTER param serialization (s.data is a string if s.processData is true) + * 3) key is the dataType + * 4) the catchall symbol "*" can be used + * 5) execution will start with transport dataType and THEN continue down to "*" if needed + */ + prefilters = {}, + + /* Transports bindings + * 1) key is the dataType + * 2) the catchall symbol "*" can be used + * 3) selection will start with transport dataType and THEN go to "*" if needed + */ + transports = {}, + + // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression + allTypes = "*/".concat( "*" ), + + // Anchor tag for parsing the document origin + originAnchor = document.createElement( "a" ); + originAnchor.href = location.href; + +// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport +function addToPrefiltersOrTransports( structure ) { + + // dataTypeExpression is optional and defaults to "*" + return function( dataTypeExpression, func ) { + + if ( typeof dataTypeExpression !== "string" ) { + func = dataTypeExpression; + dataTypeExpression = "*"; + } + + var dataType, + i = 0, + dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; + + if ( isFunction( func ) ) { + + // For each dataType in the dataTypeExpression + while ( ( dataType = dataTypes[ i++ ] ) ) { + + // Prepend if requested + if ( dataType[ 0 ] === "+" ) { + dataType = dataType.slice( 1 ) || "*"; + ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); + + // Otherwise append + } else { + ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); + } + } + } + }; +} + +// Base inspection function for prefilters and transports +function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { + + var inspected = {}, + seekingTransport = ( structure === transports ); + + function inspect( dataType ) { + var selected; + inspected[ dataType ] = true; + jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { + var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); + if ( typeof dataTypeOrTransport === "string" && + !seekingTransport && !inspected[ dataTypeOrTransport ] ) { + + options.dataTypes.unshift( dataTypeOrTransport ); + inspect( dataTypeOrTransport ); + return false; + } else if ( seekingTransport ) { + return !( selected = dataTypeOrTransport ); + } + } ); + return selected; + } + + return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); +} + +// A special extend for ajax options +// that takes "flat" options (not to be deep extended) +// Fixes #9887 +function ajaxExtend( target, src ) { + var key, deep, + flatOptions = jQuery.ajaxSettings.flatOptions || {}; + + for ( key in src ) { + if ( src[ key ] !== undefined ) { + ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; + } + } + if ( deep ) { + jQuery.extend( true, target, deep ); + } + + return target; +} + +/* Handles responses to an ajax request: + * - finds the right dataType (mediates between content-type and expected dataType) + * - returns the corresponding response + */ +function ajaxHandleResponses( s, jqXHR, responses ) { + + var ct, type, finalDataType, firstDataType, + contents = s.contents, + dataTypes = s.dataTypes; + + // Remove auto dataType and get content-type in the process + while ( dataTypes[ 0 ] === "*" ) { + dataTypes.shift(); + if ( ct === undefined ) { + ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); + } + } + + // Check if we're dealing with a known content-type + if ( ct ) { + for ( type in contents ) { + if ( contents[ type ] && contents[ type ].test( ct ) ) { + dataTypes.unshift( type ); + break; + } + } + } + + // Check to see if we have a response for the expected dataType + if ( dataTypes[ 0 ] in responses ) { + finalDataType = dataTypes[ 0 ]; + } else { + + // Try convertible dataTypes + for ( type in responses ) { + if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { + finalDataType = type; + break; + } + if ( !firstDataType ) { + firstDataType = type; + } + } + + // Or just use first one + finalDataType = finalDataType || firstDataType; + } + + // If we found a dataType + // We add the dataType to the list if needed + // and return the corresponding response + if ( finalDataType ) { + if ( finalDataType !== dataTypes[ 0 ] ) { + dataTypes.unshift( finalDataType ); + } + return responses[ finalDataType ]; + } +} + +/* Chain conversions given the request and the original response + * Also sets the responseXXX fields on the jqXHR instance + */ +function ajaxConvert( s, response, jqXHR, isSuccess ) { + var conv2, current, conv, tmp, prev, + converters = {}, + + // Work with a copy of dataTypes in case we need to modify it for conversion + dataTypes = s.dataTypes.slice(); + + // Create converters map with lowercased keys + if ( dataTypes[ 1 ] ) { + for ( conv in s.converters ) { + converters[ conv.toLowerCase() ] = s.converters[ conv ]; + } + } + + current = dataTypes.shift(); + + // Convert to each sequential dataType + while ( current ) { + + if ( s.responseFields[ current ] ) { + jqXHR[ s.responseFields[ current ] ] = response; + } + + // Apply the dataFilter if provided + if ( !prev && isSuccess && s.dataFilter ) { + response = s.dataFilter( response, s.dataType ); + } + + prev = current; + current = dataTypes.shift(); + + if ( current ) { + + // There's only work to do if current dataType is non-auto + if ( current === "*" ) { + + current = prev; + + // Convert response if prev dataType is non-auto and differs from current + } else if ( prev !== "*" && prev !== current ) { + + // Seek a direct converter + conv = converters[ prev + " " + current ] || converters[ "* " + current ]; + + // If none found, seek a pair + if ( !conv ) { + for ( conv2 in converters ) { + + // If conv2 outputs current + tmp = conv2.split( " " ); + if ( tmp[ 1 ] === current ) { + + // If prev can be converted to accepted input + conv = converters[ prev + " " + tmp[ 0 ] ] || + converters[ "* " + tmp[ 0 ] ]; + if ( conv ) { + + // Condense equivalence converters + if ( conv === true ) { + conv = converters[ conv2 ]; + + // Otherwise, insert the intermediate dataType + } else if ( converters[ conv2 ] !== true ) { + current = tmp[ 0 ]; + dataTypes.unshift( tmp[ 1 ] ); + } + break; + } + } + } + } + + // Apply converter (if not an equivalence) + if ( conv !== true ) { + + // Unless errors are allowed to bubble, catch and return them + if ( conv && s.throws ) { + response = conv( response ); + } else { + try { + response = conv( response ); + } catch ( e ) { + return { + state: "parsererror", + error: conv ? e : "No conversion from " + prev + " to " + current + }; + } + } + } + } + } + } + + return { state: "success", data: response }; +} + +jQuery.extend( { + + // Counter for holding the number of active queries + active: 0, + + // Last-Modified header cache for next request + lastModified: {}, + etag: {}, + + ajaxSettings: { + url: location.href, + type: "GET", + isLocal: rlocalProtocol.test( location.protocol ), + global: true, + processData: true, + async: true, + contentType: "application/x-www-form-urlencoded; charset=UTF-8", + + /* + timeout: 0, + data: null, + dataType: null, + username: null, + password: null, + cache: null, + throws: false, + traditional: false, + headers: {}, + */ + + accepts: { + "*": allTypes, + text: "text/plain", + html: "text/html", + xml: "application/xml, text/xml", + json: "application/json, text/javascript" + }, + + contents: { + xml: /\bxml\b/, + html: /\bhtml/, + json: /\bjson\b/ + }, + + responseFields: { + xml: "responseXML", + text: "responseText", + json: "responseJSON" + }, + + // Data converters + // Keys separate source (or catchall "*") and destination types with a single space + converters: { + + // Convert anything to text + "* text": String, + + // Text to html (true = no transformation) + "text html": true, + + // Evaluate text as a json expression + "text json": JSON.parse, + + // Parse text as xml + "text xml": jQuery.parseXML + }, + + // For options that shouldn't be deep extended: + // you can add your own custom options here if + // and when you create one that shouldn't be + // deep extended (see ajaxExtend) + flatOptions: { + url: true, + context: true + } + }, + + // Creates a full fledged settings object into target + // with both ajaxSettings and settings fields. + // If target is omitted, writes into ajaxSettings. + ajaxSetup: function( target, settings ) { + return settings ? + + // Building a settings object + ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : + + // Extending ajaxSettings + ajaxExtend( jQuery.ajaxSettings, target ); + }, + + ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), + ajaxTransport: addToPrefiltersOrTransports( transports ), + + // Main method + ajax: function( url, options ) { + + // If url is an object, simulate pre-1.5 signature + if ( typeof url === "object" ) { + options = url; + url = undefined; + } + + // Force options to be an object + options = options || {}; + + var transport, + + // URL without anti-cache param + cacheURL, + + // Response headers + responseHeadersString, + responseHeaders, + + // timeout handle + timeoutTimer, + + // Url cleanup var + urlAnchor, + + // Request state (becomes false upon send and true upon completion) + completed, + + // To know if global events are to be dispatched + fireGlobals, + + // Loop variable + i, + + // uncached part of the url + uncached, + + // Create the final options object + s = jQuery.ajaxSetup( {}, options ), + + // Callbacks context + callbackContext = s.context || s, + + // Context for global events is callbackContext if it is a DOM node or jQuery collection + globalEventContext = s.context && + ( callbackContext.nodeType || callbackContext.jquery ) ? + jQuery( callbackContext ) : + jQuery.event, + + // Deferreds + deferred = jQuery.Deferred(), + completeDeferred = jQuery.Callbacks( "once memory" ), + + // Status-dependent callbacks + statusCode = s.statusCode || {}, + + // Headers (they are sent all at once) + requestHeaders = {}, + requestHeadersNames = {}, + + // Default abort message + strAbort = "canceled", + + // Fake xhr + jqXHR = { + readyState: 0, + + // Builds headers hashtable if needed + getResponseHeader: function( key ) { + var match; + if ( completed ) { + if ( !responseHeaders ) { + responseHeaders = {}; + while ( ( match = rheaders.exec( responseHeadersString ) ) ) { + responseHeaders[ match[ 1 ].toLowerCase() + " " ] = + ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) + .concat( match[ 2 ] ); + } + } + match = responseHeaders[ key.toLowerCase() + " " ]; + } + return match == null ? null : match.join( ", " ); + }, + + // Raw string + getAllResponseHeaders: function() { + return completed ? responseHeadersString : null; + }, + + // Caches the header + setRequestHeader: function( name, value ) { + if ( completed == null ) { + name = requestHeadersNames[ name.toLowerCase() ] = + requestHeadersNames[ name.toLowerCase() ] || name; + requestHeaders[ name ] = value; + } + return this; + }, + + // Overrides response content-type header + overrideMimeType: function( type ) { + if ( completed == null ) { + s.mimeType = type; + } + return this; + }, + + // Status-dependent callbacks + statusCode: function( map ) { + var code; + if ( map ) { + if ( completed ) { + + // Execute the appropriate callbacks + jqXHR.always( map[ jqXHR.status ] ); + } else { + + // Lazy-add the new callbacks in a way that preserves old ones + for ( code in map ) { + statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; + } + } + } + return this; + }, + + // Cancel the request + abort: function( statusText ) { + var finalText = statusText || strAbort; + if ( transport ) { + transport.abort( finalText ); + } + done( 0, finalText ); + return this; + } + }; + + // Attach deferreds + deferred.promise( jqXHR ); + + // Add protocol if not provided (prefilters might expect it) + // Handle falsy url in the settings object (#10093: consistency with old signature) + // We also use the url parameter if available + s.url = ( ( url || s.url || location.href ) + "" ) + .replace( rprotocol, location.protocol + "//" ); + + // Alias method option to type as per ticket #12004 + s.type = options.method || options.type || s.method || s.type; + + // Extract dataTypes list + s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; + + // A cross-domain request is in order when the origin doesn't match the current origin. + if ( s.crossDomain == null ) { + urlAnchor = document.createElement( "a" ); + + // Support: IE <=8 - 11, Edge 12 - 15 + // IE throws exception on accessing the href property if url is malformed, + // e.g. http://example.com:80x/ + try { + urlAnchor.href = s.url; + + // Support: IE <=8 - 11 only + // Anchor's host property isn't correctly set when s.url is relative + urlAnchor.href = urlAnchor.href; + s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== + urlAnchor.protocol + "//" + urlAnchor.host; + } catch ( e ) { + + // If there is an error parsing the URL, assume it is crossDomain, + // it can be rejected by the transport if it is invalid + s.crossDomain = true; + } + } + + // Convert data if not already a string + if ( s.data && s.processData && typeof s.data !== "string" ) { + s.data = jQuery.param( s.data, s.traditional ); + } + + // Apply prefilters + inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); + + // If request was aborted inside a prefilter, stop there + if ( completed ) { + return jqXHR; + } + + // We can fire global events as of now if asked to + // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) + fireGlobals = jQuery.event && s.global; + + // Watch for a new set of requests + if ( fireGlobals && jQuery.active++ === 0 ) { + jQuery.event.trigger( "ajaxStart" ); + } + + // Uppercase the type + s.type = s.type.toUpperCase(); + + // Determine if request has content + s.hasContent = !rnoContent.test( s.type ); + + // Save the URL in case we're toying with the If-Modified-Since + // and/or If-None-Match header later on + // Remove hash to simplify url manipulation + cacheURL = s.url.replace( rhash, "" ); + + // More options handling for requests with no content + if ( !s.hasContent ) { + + // Remember the hash so we can put it back + uncached = s.url.slice( cacheURL.length ); + + // If data is available and should be processed, append data to url + if ( s.data && ( s.processData || typeof s.data === "string" ) ) { + cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; + + // #9682: remove data so that it's not used in an eventual retry + delete s.data; + } + + // Add or update anti-cache param if needed + if ( s.cache === false ) { + cacheURL = cacheURL.replace( rantiCache, "$1" ); + uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + + uncached; + } + + // Put hash and anti-cache on the URL that will be requested (gh-1732) + s.url = cacheURL + uncached; + + // Change '%20' to '+' if this is encoded form body content (gh-2658) + } else if ( s.data && s.processData && + ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { + s.data = s.data.replace( r20, "+" ); + } + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + if ( jQuery.lastModified[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); + } + if ( jQuery.etag[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); + } + } + + // Set the correct header, if data is being sent + if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { + jqXHR.setRequestHeader( "Content-Type", s.contentType ); + } + + // Set the Accepts header for the server, depending on the dataType + jqXHR.setRequestHeader( + "Accept", + s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? + s.accepts[ s.dataTypes[ 0 ] ] + + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : + s.accepts[ "*" ] + ); + + // Check for headers option + for ( i in s.headers ) { + jqXHR.setRequestHeader( i, s.headers[ i ] ); + } + + // Allow custom headers/mimetypes and early abort + if ( s.beforeSend && + ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { + + // Abort if not done already and return + return jqXHR.abort(); + } + + // Aborting is no longer a cancellation + strAbort = "abort"; + + // Install callbacks on deferreds + completeDeferred.add( s.complete ); + jqXHR.done( s.success ); + jqXHR.fail( s.error ); + + // Get transport + transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); + + // If no transport, we auto-abort + if ( !transport ) { + done( -1, "No Transport" ); + } else { + jqXHR.readyState = 1; + + // Send global event + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); + } + + // If request was aborted inside ajaxSend, stop there + if ( completed ) { + return jqXHR; + } + + // Timeout + if ( s.async && s.timeout > 0 ) { + timeoutTimer = window.setTimeout( function() { + jqXHR.abort( "timeout" ); + }, s.timeout ); + } + + try { + completed = false; + transport.send( requestHeaders, done ); + } catch ( e ) { + + // Rethrow post-completion exceptions + if ( completed ) { + throw e; + } + + // Propagate others as results + done( -1, e ); + } + } + + // Callback for when everything is done + function done( status, nativeStatusText, responses, headers ) { + var isSuccess, success, error, response, modified, + statusText = nativeStatusText; + + // Ignore repeat invocations + if ( completed ) { + return; + } + + completed = true; + + // Clear timeout if it exists + if ( timeoutTimer ) { + window.clearTimeout( timeoutTimer ); + } + + // Dereference transport for early garbage collection + // (no matter how long the jqXHR object will be used) + transport = undefined; + + // Cache response headers + responseHeadersString = headers || ""; + + // Set readyState + jqXHR.readyState = status > 0 ? 4 : 0; + + // Determine if successful + isSuccess = status >= 200 && status < 300 || status === 304; + + // Get response data + if ( responses ) { + response = ajaxHandleResponses( s, jqXHR, responses ); + } + + // Use a noop converter for missing script + if ( !isSuccess && jQuery.inArray( "script", s.dataTypes ) > -1 ) { + s.converters[ "text script" ] = function() {}; + } + + // Convert no matter what (that way responseXXX fields are always set) + response = ajaxConvert( s, response, jqXHR, isSuccess ); + + // If successful, handle type chaining + if ( isSuccess ) { + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + modified = jqXHR.getResponseHeader( "Last-Modified" ); + if ( modified ) { + jQuery.lastModified[ cacheURL ] = modified; + } + modified = jqXHR.getResponseHeader( "etag" ); + if ( modified ) { + jQuery.etag[ cacheURL ] = modified; + } + } + + // if no content + if ( status === 204 || s.type === "HEAD" ) { + statusText = "nocontent"; + + // if not modified + } else if ( status === 304 ) { + statusText = "notmodified"; + + // If we have data, let's convert it + } else { + statusText = response.state; + success = response.data; + error = response.error; + isSuccess = !error; + } + } else { + + // Extract error from statusText and normalize for non-aborts + error = statusText; + if ( status || !statusText ) { + statusText = "error"; + if ( status < 0 ) { + status = 0; + } + } + } + + // Set data for the fake xhr object + jqXHR.status = status; + jqXHR.statusText = ( nativeStatusText || statusText ) + ""; + + // Success/Error + if ( isSuccess ) { + deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); + } else { + deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); + } + + // Status-dependent callbacks + jqXHR.statusCode( statusCode ); + statusCode = undefined; + + if ( fireGlobals ) { + globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", + [ jqXHR, s, isSuccess ? success : error ] ); + } + + // Complete + completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); + + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); + + // Handle the global AJAX counter + if ( !( --jQuery.active ) ) { + jQuery.event.trigger( "ajaxStop" ); + } + } + } + + return jqXHR; + }, + + getJSON: function( url, data, callback ) { + return jQuery.get( url, data, callback, "json" ); + }, + + getScript: function( url, callback ) { + return jQuery.get( url, undefined, callback, "script" ); + } +} ); + +jQuery.each( [ "get", "post" ], function( _i, method ) { + jQuery[ method ] = function( url, data, callback, type ) { + + // Shift arguments if data argument was omitted + if ( isFunction( data ) ) { + type = type || callback; + callback = data; + data = undefined; + } + + // The url can be an options object (which then must have .url) + return jQuery.ajax( jQuery.extend( { + url: url, + type: method, + dataType: type, + data: data, + success: callback + }, jQuery.isPlainObject( url ) && url ) ); + }; +} ); + +jQuery.ajaxPrefilter( function( s ) { + var i; + for ( i in s.headers ) { + if ( i.toLowerCase() === "content-type" ) { + s.contentType = s.headers[ i ] || ""; + } + } +} ); + + +jQuery._evalUrl = function( url, options, doc ) { + return jQuery.ajax( { + url: url, + + // Make this explicit, since user can override this through ajaxSetup (#11264) + type: "GET", + dataType: "script", + cache: true, + async: false, + global: false, + + // Only evaluate the response if it is successful (gh-4126) + // dataFilter is not invoked for failure responses, so using it instead + // of the default converter is kludgy but it works. + converters: { + "text script": function() {} + }, + dataFilter: function( response ) { + jQuery.globalEval( response, options, doc ); + } + } ); +}; + + +jQuery.fn.extend( { + wrapAll: function( html ) { + var wrap; + + if ( this[ 0 ] ) { + if ( isFunction( html ) ) { + html = html.call( this[ 0 ] ); + } + + // The elements to wrap the target around + wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); + + if ( this[ 0 ].parentNode ) { + wrap.insertBefore( this[ 0 ] ); + } + + wrap.map( function() { + var elem = this; + + while ( elem.firstElementChild ) { + elem = elem.firstElementChild; + } + + return elem; + } ).append( this ); + } + + return this; + }, + + wrapInner: function( html ) { + if ( isFunction( html ) ) { + return this.each( function( i ) { + jQuery( this ).wrapInner( html.call( this, i ) ); + } ); + } + + return this.each( function() { + var self = jQuery( this ), + contents = self.contents(); + + if ( contents.length ) { + contents.wrapAll( html ); + + } else { + self.append( html ); + } + } ); + }, + + wrap: function( html ) { + var htmlIsFunction = isFunction( html ); + + return this.each( function( i ) { + jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); + } ); + }, + + unwrap: function( selector ) { + this.parent( selector ).not( "body" ).each( function() { + jQuery( this ).replaceWith( this.childNodes ); + } ); + return this; + } +} ); + + +jQuery.expr.pseudos.hidden = function( elem ) { + return !jQuery.expr.pseudos.visible( elem ); +}; +jQuery.expr.pseudos.visible = function( elem ) { + return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); +}; + + + + +jQuery.ajaxSettings.xhr = function() { + try { + return new window.XMLHttpRequest(); + } catch ( e ) {} +}; + +var xhrSuccessStatus = { + + // File protocol always yields status code 0, assume 200 + 0: 200, + + // Support: IE <=9 only + // #1450: sometimes IE returns 1223 when it should be 204 + 1223: 204 + }, + xhrSupported = jQuery.ajaxSettings.xhr(); + +support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); +support.ajax = xhrSupported = !!xhrSupported; + +jQuery.ajaxTransport( function( options ) { + var callback, errorCallback; + + // Cross domain only allowed if supported through XMLHttpRequest + if ( support.cors || xhrSupported && !options.crossDomain ) { + return { + send: function( headers, complete ) { + var i, + xhr = options.xhr(); + + xhr.open( + options.type, + options.url, + options.async, + options.username, + options.password + ); + + // Apply custom fields if provided + if ( options.xhrFields ) { + for ( i in options.xhrFields ) { + xhr[ i ] = options.xhrFields[ i ]; + } + } + + // Override mime type if needed + if ( options.mimeType && xhr.overrideMimeType ) { + xhr.overrideMimeType( options.mimeType ); + } + + // X-Requested-With header + // For cross-domain requests, seeing as conditions for a preflight are + // akin to a jigsaw puzzle, we simply never set it to be sure. + // (it can always be set on a per-request basis or even using ajaxSetup) + // For same-domain requests, won't change header if already provided. + if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { + headers[ "X-Requested-With" ] = "XMLHttpRequest"; + } + + // Set headers + for ( i in headers ) { + xhr.setRequestHeader( i, headers[ i ] ); + } + + // Callback + callback = function( type ) { + return function() { + if ( callback ) { + callback = errorCallback = xhr.onload = + xhr.onerror = xhr.onabort = xhr.ontimeout = + xhr.onreadystatechange = null; + + if ( type === "abort" ) { + xhr.abort(); + } else if ( type === "error" ) { + + // Support: IE <=9 only + // On a manual native abort, IE9 throws + // errors on any property access that is not readyState + if ( typeof xhr.status !== "number" ) { + complete( 0, "error" ); + } else { + complete( + + // File: protocol always yields status 0; see #8605, #14207 + xhr.status, + xhr.statusText + ); + } + } else { + complete( + xhrSuccessStatus[ xhr.status ] || xhr.status, + xhr.statusText, + + // Support: IE <=9 only + // IE9 has no XHR2 but throws on binary (trac-11426) + // For XHR2 non-text, let the caller handle it (gh-2498) + ( xhr.responseType || "text" ) !== "text" || + typeof xhr.responseText !== "string" ? + { binary: xhr.response } : + { text: xhr.responseText }, + xhr.getAllResponseHeaders() + ); + } + } + }; + }; + + // Listen to events + xhr.onload = callback(); + errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); + + // Support: IE 9 only + // Use onreadystatechange to replace onabort + // to handle uncaught aborts + if ( xhr.onabort !== undefined ) { + xhr.onabort = errorCallback; + } else { + xhr.onreadystatechange = function() { + + // Check readyState before timeout as it changes + if ( xhr.readyState === 4 ) { + + // Allow onerror to be called first, + // but that will not handle a native abort + // Also, save errorCallback to a variable + // as xhr.onerror cannot be accessed + window.setTimeout( function() { + if ( callback ) { + errorCallback(); + } + } ); + } + }; + } + + // Create the abort callback + callback = callback( "abort" ); + + try { + + // Do send the request (this may raise an exception) + xhr.send( options.hasContent && options.data || null ); + } catch ( e ) { + + // #14683: Only rethrow if this hasn't been notified as an error yet + if ( callback ) { + throw e; + } + } + }, + + abort: function() { + if ( callback ) { + callback(); + } + } + }; + } +} ); + + + + +// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) +jQuery.ajaxPrefilter( function( s ) { + if ( s.crossDomain ) { + s.contents.script = false; + } +} ); + +// Install script dataType +jQuery.ajaxSetup( { + accepts: { + script: "text/javascript, application/javascript, " + + "application/ecmascript, application/x-ecmascript" + }, + contents: { + script: /\b(?:java|ecma)script\b/ + }, + converters: { + "text script": function( text ) { + jQuery.globalEval( text ); + return text; + } + } +} ); + +// Handle cache's special case and crossDomain +jQuery.ajaxPrefilter( "script", function( s ) { + if ( s.cache === undefined ) { + s.cache = false; + } + if ( s.crossDomain ) { + s.type = "GET"; + } +} ); + +// Bind script tag hack transport +jQuery.ajaxTransport( "script", function( s ) { + + // This transport only deals with cross domain or forced-by-attrs requests + if ( s.crossDomain || s.scriptAttrs ) { + var script, callback; + return { + send: function( _, complete ) { + script = jQuery( " + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

NV::Rules::IAction

+
+
+class IAction
+

Action interface.

+

Represents an activity such as a CUDA kernel on a single range, for which zero or more metrics were collected

+
+

Public Types

+
+
+enum class NameBase
+

Basis for action names.

+

The basis determines how the action name is represented when calling name. FUNCTION is the minimal base name without parameters or return value. DEMANGLED is the demangled name, including parameters and return value. MANGLED is the mangled name, including parameters and return value.

+

Values:

+
+
+enumerator FUNCTION
+
+ +
+
+enumerator DEMANGLED
+
+ +
+
+enumerator MANGLED
+
+ +
+ +
+
+

Public Functions

+
+
+virtual IMetric *add_double_metric(const char *value_name, IMetric::ValueKind value_kind, double value) = 0
+

Add a single floating point metric to this action.

+

+Add a single floating point metric with name value_name and kind value_kind to this action

+
+
Returns
+

the new IMetric

+
+
+
+ +
+
+virtual IMetric *add_integer_metric(const char *value_name, IMetric::ValueKind value_kind, uint64_t value) = 0
+

Add a single integer metric to this action.

+

+Add a single integer metric to with name value_name and kind value_kind this action.

+
+
Returns
+

the new IMetric

+
+
+
+ +
+
+virtual IMutableMetric *add_metric(const char *value_name) = 0
+

Add a single mutable metric to this action.

+

+Add a single, mutable metric with name value_name to this action. The metric is not initialized with any kind or value and needs to be assigned proper values and/or instances afterwards. IMutableMetric provides the following interface:

+

void set_double(IMetric::ValueKind value_kind, double value)

+

Return true if the value was set, false otherwise. Assign the metric a floating-point value of value_kind Acceptable kinds are FLOAT, DOUBLE or ANY (for which the implementation chooses the kind internally)

+

bool set_double(size_t instance, IMetric::ValueKind value_kind, double value)

+

Return true if the instance value was set, false otherwise. Assign the metric an instance floating-point value of value_kind Acceptable kinds are FLOAT, DOUBLE or ANY (for which the implementation chooses the kind internally)

+

void set_uint64(IMetric::ValueKind value_kind, uint64_t value)

+

Return true if the value was set, false otherwise. Assign the metric an integer value of value_kind Acceptable kinds are UINT32, UINT64 or ANY (for which the implementation chooses the kind internally)

+

bool set_uint64(size_t instance, IMetric::ValueKind value_kind, uint64_t value)

+

Return true if the instance value was set, false otherwise. Assign the metric an instance integer value of value_kind Acceptable kinds are UINT32, UINT64 or ANY (for which the implementation chooses the kind internally)

+

void set_string(IMetric::ValueKind value_kind, const char* value)

+

Return true if the value was set, false otherwise. Assign the metric a string value of value_kind Acceptable kinds are STRING or ANY (for which the implementation chooses the kind internally)

+

bool set_string(size_t instance, IMetric::ValueKind value_kind, const char* value)

+

Return true if the instance value was set, false otherwise. Assign the metric an instance string value of value_kind Acceptable kinds are STRING or ANY (for which the implementation chooses the kind internally)

+

IMutableMetric *mutable_correlation_ids()

+

Returns a new, mutable metric object representing the correlation IDs for the metric’s instance values. Correlation IDs are used to associate instance values with the “instance” their value represents. In the returned new metric object, the correlation IDs are that object’s instance values.

+
+
Returns
+

the new IMutableMetric

+
+
+
+ +
+
+virtual IMetric *add_string_metric(const char *value_name, IMetric::ValueKind value_kind, const char *value) = 0
+

Add a single string metric to this action.

+

+Add a single string metric with name value_name and kind value_kind to this action

+
+
Returns
+

the new IMetric

+
+
+
+ +
+
+virtual IMetric *metric_by_name(const char *metric_name) = 0
+

Get a single metric by name.

+

Get a single IMetric by metric_name

+
+ +
+
+virtual std::set<std::string> metric_names() = 0
+

Get the set of metric names.

+

Get the set of metrics available for this action

+
+ +
+
+virtual const char *name(NameBase base = NameBase::FUNCTION) = 0
+

Get the action name.

+

Get the action name

+
+ +
+
+virtual INvtxState *nvtx_state() = 0
+

Get the NVTX state associated with this action.

+
+
Returns
+

a new INvtxState object if any NVTX state is available for this action.

+
+
+
+ +
+
+virtual std::string ptx_by_pc(uint64_t address) = 0
+

Get the PTX for a function address within this action.

+

+Get the PTX for a function address within this action. The address is expected to be absolute, i.e. as obtained from the correlation IDs of source-correlated metrics.

+
+
Returns
+

PTX string. An empty string is returned if no PTX is associated with this address

+
+
+
+ +
+
+virtual std::string sass_by_pc(uint64_t address) = 0
+

Get the disassembled SASS for a function address within this action.

+

+Get the disassembled SASS for a function address within this action. The address is expected to be absolute, i.e. as obtained from the correlation IDs of source-correlated metrics. The SASS may include formatting whitespace as generated by the disassembler.

+
+
Returns
+

SASS string. An empty string is returned if no SASS is associated with this address

+
+
+
+ +
+
+virtual std::map<std::string, std::string> source_files() = 0
+

Get the source files associated with an action.

+

+Get the map of source files associated with this action, along with their content. If content is not available for a file (e.g. because it hadn’t been imported into the report), the file name will map to an empty string.

+
+
Returns
+

a map from file name to file content

+
+
+
+ +
+
+virtual ISourceInfo *source_info(uint64_t address) = 0
+

Get the source info for a function address within this action.

+

+Get the source info for address within this action. Addresses are commonly obtained as correlation ids of source-correlated metrics.

+
+
Returns
+

a new ISourceInfo object if it is available

+
+
+
+ +
+
+inline virtual ~IAction()
+
+ +
+
+ +
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1IBaseContext.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1IBaseContext.html new file mode 100644 index 0000000000000000000000000000000000000000..183dfcee72ff5784e02ad4567246c5f8a0c27daa --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1IBaseContext.html @@ -0,0 +1,212 @@ + + + + + + + NV::Rules::IBaseContext — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

NV::Rules::IBaseContext

+
+
+class IBaseContext
+

Subclassed by NV::Rules::IContext, NV::Rules::IEvaluator

+
+

Public Functions

+
+
+virtual std::string get_version() = 0
+

Get version number of this interface.

+

Returns the version number of this interface as a string of the form <year>.<major>.<minor> It matches the Nsight Compute version this interface originates from.

+
+ +
+
+virtual bool handle_exception(const char *msg) = 0
+

Context exception handler.

+

Should return true if a python exception should be set, false otherwise

+
+ +
+
+inline virtual ~IBaseContext()
+
+ +
+
+ +
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1IContext.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1IContext.html new file mode 100644 index 0000000000000000000000000000000000000000..ffd284340db3c8515dbf160196ca4c3273f6e183 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1IContext.html @@ -0,0 +1,241 @@ + + + + + + + NV::Rules::IContext — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

NV::Rules::IContext

+
+
+class IContext : public NV::Rules::IBaseContext
+

Context interface.

+

The rule context provides the rule with access to all collected data, properties and means to relay results back to the caller.

+
+

Public Functions

+
+
+virtual IController *controller() = 0
+

Get the controller object.

+

Get the IController object

+
+ +
+
+virtual IFrontend *frontend() = 0
+

Get the frontend object.

+

Get the IFrontend object

+
+ +
+
+virtual std::string get_version() = 0
+

Get version number of this interface.

+

Returns the version number of this interface as a string of the form <year>.<major>.<minor> It matches the Nsight Compute version this interface originates from.

+
+ +
+
+virtual bool handle_exception(const char *msg) = 0
+

Context exception handler.

+

Should return true if a python exception should be set, false otherwise

+
+ +
+
+virtual size_t num_ranges() = 0
+

Get the number of available ranges.

+

Get the number of available ranges

+
+ +
+
+virtual IRange *range_by_idx(size_t idx) = 0
+

Get a single range by index.

+

Get a single IRange by index

+
+ +
+
+inline virtual ~IContext()
+
+ +
+
+ +
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1IController.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1IController.html new file mode 100644 index 0000000000000000000000000000000000000000..a25a82c597fdc3ecadeca90465d211de6d36e60f --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1IController.html @@ -0,0 +1,211 @@ + + + + + + + NV::Rules::IController — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

NV::Rules::IController

+
+
+class IController
+

Controller interface.

+

The controller can be used to interact with the tool runtime, e.g. to signal the tools to propose a follow-up rule.

+
+

Public Functions

+
+
+virtual std::shared_ptr<IMessageVault> get_message_vault() = 0
+

Get an IMessageVault object that can be used for message passing between rules.

+
+ +
+
+virtual void propose_rule(const char *rule) = 0
+

Propose the specified rule in the current context.

+
+ +
+
+inline virtual ~IController()
+
+ +
+
+ +
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1IEvaluator.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1IEvaluator.html new file mode 100644 index 0000000000000000000000000000000000000000..e02e27a1285cc0827ce8946d5f37601af1ca60d1 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1IEvaluator.html @@ -0,0 +1,225 @@ + + + + + + + NV::Rules::IEvaluator — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

NV::Rules::IEvaluator

+
+
+class IEvaluator : public NV::Rules::IBaseContext
+

Evaluator interface.

+

The evaluator is used during rule setup to pass information about rule dependencies to the tool. For most cases, its Python wrapper functions can be used instead for convenience.

+
+

Public Functions

+
+
+virtual std::string get_version() = 0
+

Get version number of this interface.

+

Returns the version number of this interface as a string of the form <year>.<major>.<minor> It matches the Nsight Compute version this interface originates from.

+
+ +
+
+virtual bool handle_exception(const char *msg) = 0
+

Context exception handler.

+

Should return true if a python exception should be set, false otherwise

+
+ +
+
+virtual void require_metric(const char *metric) = 0
+

Define that the specified metric must have been collected in order for the calling rule to be applied.

+
+ +
+
+virtual void require_rule(const char *rule) = 0
+

Define that the specified rule must be available and ready to be applied in order for the calling rule to be applied itself.

+
+ +
+
+inline virtual ~IEvaluator()
+
+ +
+
+ +
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1IFrontend.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1IFrontend.html new file mode 100644 index 0000000000000000000000000000000000000000..49f770a9cc32b5a6525f782a29e1a4a43696d70f --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1IFrontend.html @@ -0,0 +1,366 @@ + + + + + + + NV::Rules::IFrontend — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

NV::Rules::IFrontend

+
+
+class IFrontend
+

Frontend interface.

+

The frontend is responsible for relaying messages and results to the caller via user interfaces, logs or output files.

+
+

Public Types

+
+
+using Dict = std::map<std::string, double>
+
+ +
+
+enum class MarkerKind
+

Marker Kind.

+

The kind of marker that is created in the Source Page with source_marker. SASS The marker will be associated with a SASS instruction. SOURCE The marker will be associated with a Source line.

+

Values:

+
+
+enumerator SASS
+
+ +
+
+enumerator SOURCE
+
+ +
+ +
+
+enum class MsgType
+

Message type.

+

The type a message to the frontend represents when calling message. MSG_NONE No specific type for this message. MSG_OK The message is informative. MSG_OPTIMIZATION The message represents a suggestion for performance optimization. MSG_WARNING The message represents a warning or fixable issue. MSG_ERROR The message represents an error, potentially in executing the rule.

+

Values:

+
+
+enumerator MSG_NONE
+
+ +
+
+enumerator MSG_OK
+
+ +
+
+enumerator MSG_OPTIMIZATION
+
+ +
+
+enumerator MSG_WARNING
+
+ +
+
+enumerator MSG_ERROR
+
+ +
+ +
+
+using RuleId = std::string
+
+ +
+
+enum class Severity
+

Focus metric severity.

+

The severity a focus metric represents when calling focus_metric. The severity can be used by the rule system client when processing the focus metric. SEVERITY_DEFAULT The default severity. SEVERITY_LOW Severity if low. SEVERITY_HIGH Severity if high.

+

Values:

+
+
+enumerator SEVERITY_DEFAULT
+
+ +
+
+enumerator SEVERITY_LOW
+
+ +
+
+enumerator SEVERITY_HIGH
+
+ +
+ +
+
+enum class SpeedupType
+

Speedup estimation type.

+

The type of speedup estimation used when calling speedup. LOCAL The proportional increase in efficiency of the hardware usage when viewing the performance problem in isolation. GLOBAL The proportional reduction in runtime of the entire workload.

+

Values:

+
+
+enumerator LOCAL
+
+ +
+
+enumerator GLOBAL
+
+ +
+ +
+
+

Public Functions

+
+
+virtual bool focus_metric(int message_id, const char *metric_name, double metric_value, Severity severity, const char *info) = 0
+

Rule focus metric message.

+

Issues a focus metric message to the frontend, e.g. to indicate a key metric that triggered the rule output. Can be associated with a prior message using its message_id . The severity can be used to indicate this metric’s impact/severity on the result. The info field can be set to a descriptive string for further information, e.g. the calculation leading to this metric being focused. Returns whether the focus_metric could be set successfully for the message_id .

+
+ +
+
+virtual void load_chart_from_file(const char *filename) = 0
+

Load a ProfilerSection google protcol buffer chart from filename.

+
+ +
+
+virtual int message(const char *str, const char *name = nullptr) = 0
+

Rule result message.

+

Issues a message str to the frontend with the default MsgType and optional name name . Returns a message ID that is unique in this rule invocation.

+
+ +
+
+virtual int message(MsgType type, const char *str, const char *name = nullptr) = 0
+

Rule result message.

+

Issues a message str with a specific message type and optional name name to the frontend. Returns a message ID that is unique in this rule invocation.

+
+ +
+
+virtual Dict receive_dict_from_parent(const RuleId &parent_id) = 0
+

Receive a dictionary from parent rule parent_id.

+

Receive a dictionary of type dict[str,float] sent using send_dict_to_children . In case parent_id does not represent a pre-specified parent rule of this rule, or in case the parent rule has not been executed, an empty dict will be returned.

+
+ +
+
+virtual void send_dict_to_children(const Dict &dict) = 0
+

Send a dictionary dict to all child rules.

+

Sends a Python dictionary of type dict[str,float] to all rules that specify this rule as a parent rule. Child rules can retrieve the message using receive_dict_from_parent . In case this function is called repeatedly, the dict is updated accordingly, thereby adding new key-value pairs, and overwriting values of pre-existing keys.

+
+ +
+
+virtual void source_marker(const char *str, uint64_t address_or_line, MarkerKind kind, const char *file_name, MsgType type = MsgType::MSG_NONE) = 0
+

Rule source marker.

+

Creates a source marker with a message str at the source location address_or_line in the appropriate kind of source. This function supports multi-file programs, which means a file_name has to be specified. The type denotes the urgency associated with this marker and is optional.

+
+ +
+
+virtual void source_marker(const char *str, uint64_t address_or_line, MarkerKind kind, MsgType type = MsgType::MSG_NONE) = 0
+

Rule source marker.

+

Creates a source marker with a message str at the source location address_or_line in the appropriate kind of source. The type denotes the urgency associated with this marker and is optional.

+
+ +
+
+virtual bool speedup(int message_id, SpeedupType type, double estimated_speedup) = 0
+

Rule estimated speedup message.

+

Issues an estimated speedup to the frontend associated to the message with ID message_id . When type is SpeedupType::GLOBAL, it indicates what proportional decrease in workload runtime could potentially be achieved, when following the guidelines of the rule. When type is SpeedupType::LOCAL, it indicates what increase in the efficiency of the hardware usage within the context of the performance problem could be achieved. Returns whether the speedup could be set successfully for the message_id .

+
+ +
+
+inline virtual ~IFrontend()
+
+ +
+
+ +
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1IMessageVault.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1IMessageVault.html new file mode 100644 index 0000000000000000000000000000000000000000..87a5159856bc4fc116158bf87f04a53f5b6d52b2 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1IMessageVault.html @@ -0,0 +1,224 @@ + + + + + + + NV::Rules::IMessageVault — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

NV::Rules::IMessageVault

+
+
+class IMessageVault
+
+

Public Types

+
+
+using Dict = IFrontend::Dict
+
+ +
+
+using RuleId = IFrontend::RuleId
+
+ +
+
+

Public Functions

+
+
+virtual Dict Get(const RuleId &ruleId) const = 0
+

Retrieve the message associated with ruleId from the vault.

+

In case ruleId is unknown, an empty message is returned.

+
+ +
+
+virtual void Put(const RuleId &ruleId, const Dict &message) = 0
+

Commit a message message associated with ruleId to the vault.

+

In case multiple messages associated with the same ruleId are commited, the messages are merged, in such a way that new key-value pairs are added, and values of pre-existing keys are updated.

+
+ +
+
+virtual ~IMessageVault() = default
+
+ +
+
+ +
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1IMetric.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1IMetric.html new file mode 100644 index 0000000000000000000000000000000000000000..3f89fa4274736fc869f5fc48858cccf20a9c9e0c --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1IMetric.html @@ -0,0 +1,567 @@ + + + + + + + NV::Rules::IMetric — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

NV::Rules::IMetric

+
+
+class IMetric
+

Metric interface.

+

Represents a single, named metric. A metric can carry one value or multiple, if it is an instanced metric.

+
+

Public Types

+
+
+using Description = std::string
+
+ +
+
+enum class MetricSubtype
+

Metric subtype.

+

Indicates the subtype of the metric. Subtypes only apply to hardware metrics. Other metric types have subtype None in Python.

+

Values:

+
+
+enumerator NONE
+
+ +
+
+enumerator PEAK_SUSTAINED
+
+ +
+
+enumerator PEAK_SUSTAINED_ACTIVE
+
+ +
+
+enumerator PEAK_SUSTAINED_ACTIVE_PER_SECOND
+
+ +
+
+enumerator PEAK_SUSTAINED_ELAPSED
+
+ +
+
+enumerator PEAK_SUSTAINED_ELAPSED_PER_SECOND
+
+ +
+
+enumerator PEAK_SUSTAINED_FRAME
+
+ +
+
+enumerator PEAK_SUSTAINED_FRAME_PER_SECOND
+
+ +
+
+enumerator PEAK_SUSTAINED_REGION
+
+ +
+
+enumerator PEAK_SUSTAINED_REGION_PER_SECOND
+
+ +
+
+enumerator PER_CYCLE_ACTIVE
+
+ +
+
+enumerator PER_CYCLE_ELAPSED
+
+ +
+
+enumerator PER_CYCLE_IN_FRAME
+
+ +
+
+enumerator PER_CYCLE_IN_REGION
+
+ +
+
+enumerator PER_SECOND
+
+ +
+
+enumerator PCT_OF_PEAK_SUSTAINED_ACTIVE
+
+ +
+
+enumerator PCT_OF_PEAK_SUSTAINED_ELAPSED
+
+ +
+
+enumerator PCT_OF_PEAK_SUSTAINED_FRAME
+
+ +
+
+enumerator PCT_OF_PEAK_SUSTAINED_REGION
+
+ +
+
+enumerator MAX_RATE
+
+ +
+
+enumerator PCT
+
+ +
+
+enumerator RATIO
+
+ +
+ +
+
+enum class MetricType
+

Metric type.

+

Indicates the type of the metric. May take values COUNTER, RATIO or THROUGHPUT for hardware metrics, and OTHER for all other types (e.g. launch metrics, device attributes).

+

Values:

+
+
+enumerator OTHER
+
+ +
+
+enumerator COUNTER
+
+ +
+
+enumerator RATIO
+
+ +
+
+enumerator THROUGHPUT
+
+ +
+ +
+
+enum class RollupOperation
+

Rollup Operation.

+

Indicates the type of operation that is used to accumulate multiple values of a given metric. May take values AVG, MAX, MIN and SUM, as well as None, if no such operation is specified.

+

Values:

+
+
+enumerator NONE
+
+ +
+
+enumerator AVG
+
+ +
+
+enumerator MAX
+
+ +
+
+enumerator MIN
+
+ +
+
+enumerator SUM
+
+ +
+ +
+
+using Unit = std::string
+
+ +
+
+enum class ValueKind
+

Metric value kind.

+

Indicates the kind (or type) of a metric value, metric instance value or correlation ID.

+

Values:

+
+
+enumerator UNKNOWN
+
+ +
+
+enumerator ANY
+
+ +
+
+enumerator STRING
+
+ +
+
+enumerator FLOAT
+
+ +
+
+enumerator DOUBLE
+
+ +
+
+enumerator UINT32
+
+ +
+
+enumerator UINT64
+
+ +
+ +
+
+

Public Functions

+
+
+virtual double as_double() = 0
+

Get the metric value as double.

+

Get the metric value as double

+
+ +
+
+virtual double as_double(size_t instance) = 0
+

Get a value from the metric instances as double.

+

Get the value of metric instance instance as double

+
+ +
+
+virtual const char *as_string() = 0
+

Get the metric value as string.

+

Get the metric value as string

+
+ +
+
+virtual const char *as_string(size_t instance) = 0
+

Get a value from the metric instances as string.

+

Get the value of metric instance instance as string

+
+ +
+
+virtual uint64_t as_uint64() = 0
+

Get the metric value as 64bit integer.

+

Get the metric value as 64bit integer

+
+ +
+
+virtual uint64_t as_uint64(size_t instance) = 0
+

Get a value from the metric instances as 64bit integer.

+

Get the value of metric instance instance as 64bit integer

+
+ +
+
+virtual IMetric *correlation_ids() = 0
+

Get a metric object for this metric’s instance value’s correlation IDs.

+

Returns a new metric object representing the correlation IDs for the metric’s instance values. Use has_correlation_ids to check if this metric has correlation IDs for its instance values. Correlation IDs are used to associate instance values with the “instance” their value represents. In the returned new metric object, the correlation IDs are that object’s instance values.

+
+ +
+
+virtual Description description() const = 0
+

Get the metric description.

+

Get a textual description of the metric

+
+ +
+
+virtual bool has_correlation_ids() = 0
+

Check if the metric has correlation IDs.

+

If true, the metric has correlation IDs matching its instance values, which can be accessed using correlation_ids .

+
+ +
+
+virtual bool has_value() = 0
+

Check if the metric has a non-instanced value.

+

Check if the metric has a non-instanced value. If true, the metric may still have instance values, too.

+
+ +
+
+virtual bool has_value(ValueKind value_kind) = 0
+

Check if the metric has a non-instanced value of a specific kind.

+

Check if the metric has a value of a specific value_kind . If true, the metric may still have instance values, too.

+
+ +
+
+virtual ValueKind kind() = 0
+

Get the metric value kind.

+

Get the metric value kind

+
+ +
+
+virtual ValueKind kind(size_t instance) = 0
+

Get the metric value kind for an instance value.

+

Get the metric value kind for its instance value instance . num_instances can be used to check the total number of instance values.

+
+ +
+
+virtual MetricSubtype metric_subtype() const = 0
+

Get the metric subtype.

+

Get the metric subtype

+
+ +
+
+virtual MetricType metric_type() const = 0
+

Get the metric type.

+

Get the metric type

+
+ +
+
+virtual const char *name() = 0
+

Get the metric name.

+

Get the metric name

+
+ +
+
+virtual size_t num_instances() = 0
+

Get the number of instance values for this metric.

+

Get the number of instance values for this metric. Not all metrics have instance values. If a metric has instance values, it may also have correlation_ids matching these instance values.

+
+ +
+
+virtual RollupOperation rollup_operation() const = 0
+

Get the type of rollup operation.

+

Get the type of rollup operation

+
+ +
+
+virtual Unit unit() const = 0
+

Get the metric unit.

+

Get the metric unit

+
+ +
+
+inline virtual ~IMetric()
+
+ +
+
+ +
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1INvtxDomainInfo.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1INvtxDomainInfo.html new file mode 100644 index 0000000000000000000000000000000000000000..5d3154111a9b7d5020ed5bf25ce2f7933e334e2d --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1INvtxDomainInfo.html @@ -0,0 +1,234 @@ + + + + + + + NV::Rules::INvtxDomainInfo — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

NV::Rules::INvtxDomainInfo

+
+
+class INvtxDomainInfo
+

NvtxDomainInfo interface.

+

Represents a single NVTX domain of the NVTX state, including all ranges associated with this domain.

+
+

Public Functions

+
+
+virtual std::string name() = 0
+

Get the domain name.

+

Get the name of this domain

+
+ +
+
+virtual INvtxRange *push_pop_range(size_t idx) = 0
+

Get a push/pop range object.

+

Get a push/pop INvtxRange object by it’s running index \idx. The index is identical to the range’s order on the call stack.

+
+ +
+
+virtual std::vector<std::string> push_pop_ranges() = 0
+

Get the list of push/pop range names.

+

Get the sorted list of stacked push/pop range names in this domain, associated with the current INvtxState.

+
+ +
+
+virtual INvtxRange *start_end_range(size_t idx) = 0
+

Get a start/end range object.

+

Get a start/end INvtxRange object by it’s running index \idx.

+
+ +
+
+virtual std::vector<std::string> start_end_ranges() = 0
+

Get the list of start/end range names.

+

Get the list of start/end range names in this domain, associated with the current INvtxState.

+
+ +
+
+inline virtual ~INvtxDomainInfo()
+
+ +
+
+ +
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1INvtxRange.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1INvtxRange.html new file mode 100644 index 0000000000000000000000000000000000000000..42fac2af14fbf2e5514fa51291a67f97e06e51e7 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1INvtxRange.html @@ -0,0 +1,313 @@ + + + + + + + NV::Rules::INvtxRange — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

NV::Rules::INvtxRange

+
+
+class INvtxRange
+

NvtxRange interface.

+

Represents a single NVTX Push/Pop or Start/End range.

+
+

Public Types

+
+
+enum class PayloadType
+

NVTX payload type.

+

Type of an NVTX payload. This can be used to choose the appropriate payload_as_* function.

+

Values:

+
+
+enumerator PAYLOAD_UNKNOWN
+
+ +
+
+enumerator PAYLOAD_UINT64
+
+ +
+
+enumerator PAYLOAD_INT64
+
+ +
+
+enumerator PAYLOAD_DOUBLE
+
+ +
+
+enumerator PAYLOAD_UINT32
+
+ +
+
+enumerator PAYLOAD_INT32
+
+ +
+
+enumerator PAYLOAD_FLOAT
+
+ +
+
+enumerator PAYLOAD_JSON
+
+ +
+ +
+
+

Public Functions

+
+
+virtual uint32_t category() const = 0
+

Get the category attribute value.

+

Get the category attribute value. If INvtxRange::has_attributes returns false, the returned value is undefined.

+
+ +
+
+virtual uint32_t color() const = 0
+

Get the color attribute value.

+

Get the color attribute value. If INvtxRange::has_attributes returns false, the returned value is undefined.

+
+ +
+
+virtual bool has_attributes() const = 0
+

Check if the range has event attributes.

+

Check if the range has event attributes, such as INvtxRange::color, INvtxRange::category, or INvtxRange::message.

+
+ +
+
+virtual std::string message() const = 0
+

Get the message attribute value.

+

Get the message attribute value. If INvtxRange::has_attributes returns false, the returned value is undefined.

+
+ +
+
+virtual std::string name() const = 0
+

Get the range name.

+

Get the name of this range

+
+ +
+
+virtual double payload_as_double() const = 0
+

Get the payload attribute value as double (64-bit floating point)

+

Get the payload attribute value as a double (64-bit floating point). If the INvtxRange::payload_type cannot be casted to double, the returned value is undefined. If INvtxRange::has_attributes returns false, the returned value is undefined.

+
+ +
+
+virtual std::string payload_as_string() const = 0
+

Get the payload attribute value as a string.

+

Get the payload attribute value as a string. If the INvtxRange::payload_type cannot be casted to a string, the returned value is undefined. If INvtxRange::has_attributes returns false, the returned value is undefined.

+
+ +
+
+virtual uint64_t payload_as_uint64() const = 0
+

Get the payload attribute value as uint64.

+

Get the payload attribute value as a uint64. If the INvtxRange::payload_type cannot be casted to uint64, the returned value is undefined. If INvtxRange::has_attributes returns false, the returned value is undefined.

+
+ +
+
+virtual PayloadType payload_type() const = 0
+

Get the payload attribute type.

+

Get the payload attribute type. If INvtxRange::has_attributes returns false, the returned type is undefined.

+
+ +
+
+inline virtual ~INvtxRange()
+
+ +
+
+ +
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1INvtxState.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1INvtxState.html new file mode 100644 index 0000000000000000000000000000000000000000..7054ac78fac635ee11a5378afd201cf1bf85e657 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1INvtxState.html @@ -0,0 +1,213 @@ + + + + + + + NV::Rules::INvtxState — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

NV::Rules::INvtxState

+
+
+class INvtxState
+

NvtxState interface.

+

Represents the NVTX (Nvidia Tools Extensions) state associated with a single action.

+
+

Public Functions

+
+
+virtual INvtxDomainInfo *domain_by_id(long long unsigned id) = 0
+

Get a domain by ID.

+

Get a single domain info object by its ID. Use INvtxState::domains to retrieve the list of valid domain IDs.

+
+ +
+
+virtual std::vector<long long unsigned> domains() = 0
+

Get the domain IDs.

+

Get the list of domain IDs in this state

+
+ +
+
+inline virtual ~INvtxState()
+
+ +
+
+ +
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1IRange.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1IRange.html new file mode 100644 index 0000000000000000000000000000000000000000..fcdc74a2dd27604c1e6e279fe097ad1eea55857f --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1IRange.html @@ -0,0 +1,220 @@ + + + + + + + NV::Rules::IRange — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

NV::Rules::IRange

+
+
+class IRange
+

Range interface.

+

Represents a serial, ordered stream of execution, such as a CUDA stream. It holds one or more actions that were logically executing in this range

+
+

Public Functions

+
+
+virtual IAction *action_by_idx(size_t idx) = 0
+

Get a single action by index.

+

Get a single IAction by index idx.

+
+ +
+
+virtual std::set<long long unsigned> actions_by_nvtx(const std::vector<std::string> &includes, const std::vector<std::string> &excludes) = 0
+

Get a set of actions by their NVTX state.

+

Get a set of indizes to IAction objects by their NVTX state. The state is defined using a series of includes and excludes .

+
+ +
+
+virtual size_t num_actions() = 0
+

Get the number of actions.

+

Get the number of available actions in this range

+
+ +
+
+inline virtual ~IRange()
+
+ +
+
+ +
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1ISourceInfo.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1ISourceInfo.html new file mode 100644 index 0000000000000000000000000000000000000000..7b2ac677683b794927aff2519b0ab29297a80fc9 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/classNV_1_1Rules_1_1ISourceInfo.html @@ -0,0 +1,213 @@ + + + + + + + NV::Rules::ISourceInfo — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

NV::Rules::ISourceInfo

+
+
+class ISourceInfo
+

SourceInfo interface.

+

Represents the source correlation info for a specific function address within an action

+
+

Public Functions

+
+
+virtual const char *file_name() = 0
+

Get the file name.

+

Get the file name, as embedded in the correlation info

+
+ +
+
+virtual uint32_t line() = 0
+

Get the file line.

+

Get the line within file_name

+
+ +
+
+inline virtual ~ISourceInfo()
+
+ +
+
+ +
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/data-structures.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/data-structures.html new file mode 100644 index 0000000000000000000000000000000000000000..78cd4fd36f0a1bf804202871f376a27d44adc45a --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/data-structures.html @@ -0,0 +1,174 @@ + + + + + + + 2.2. Data Structures — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • 2. NvRules API »
  • +
  • 2.2. Data Structures
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

2.2. Data Structures

+ +
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/group__NVRULES__HW.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/group__NVRULES__HW.html new file mode 100644 index 0000000000000000000000000000000000000000..b26d161a8b869f47dd11847cebb1fce452e035d5 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/group__NVRULES__HW.html @@ -0,0 +1,175 @@ + + + + + + + 2.1.2. NvRules Tool lifetime-managed classes. — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

2.1.2. NvRules Tool lifetime-managed classes.

+

Objects of heavyweight classes are lifetime-managed by the tool.

+

Data Structures

+ +
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/group__NVRULES__LW.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/group__NVRULES__LW.html new file mode 100644 index 0000000000000000000000000000000000000000..27051700e354976b63dccfc8849cce61265ed9b0 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/group__NVRULES__LW.html @@ -0,0 +1,176 @@ + + + + + + + 2.1.1. NvRules Python garbage-collected classes. — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

2.1.1. NvRules Python garbage-collected classes.

+

Objects of lightweight classes are garbage-collected by the python runtime.

+

Data Structures

+ +
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/group__NVRULES__NM.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/group__NVRULES__NM.html new file mode 100644 index 0000000000000000000000000000000000000000..9e1ef51ebb097c19bb5234740b1b171c235aa8da --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/group__NVRULES__NM.html @@ -0,0 +1,220 @@ + + + + + + + 2.1.3. NvRules non-member functions. — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

2.1.3. NvRules non-member functions.

+

Non-member utility functions.

+

Functions

+ +

Typedefs

+ +
+

Functions

+
+
+IContext *NV::Rules::get_context(ContextHandle h)
+

Converts the context handle.

+

Converts the context handle h to an IContext object

+
+ +
+
+IEvaluator *NV::Rules::get_evaluator(ContextHandle h)
+

Returns the evaluator object.

+

Return the IEvaluator object from the context handle h

+
+ +
+
+std::string NV::Rules::get_version(ContextHandle h)
+

Get version number of this interface.

+

Returns the version number of this interface as a string of the form <year>.<major>.<minor> It matches the Nsight Compute version this interface originates from.

+
+ +
+
+void NV::Rules::raise_exception(ContextHandle h, const char *msg)
+

Raises a python exception.

+

Raise a python exception with msg. This will terminate the script execution, if the context does not chose to mask the exception

+
+ +
+
+

Typedefs

+
+
+typedef unsigned long long NV::Rules::ContextHandle
+
+ +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/modules.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/modules.html new file mode 100644 index 0000000000000000000000000000000000000000..4afe8d9a64181ae6721ba726dabb36b1199a4b75 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/modules.html @@ -0,0 +1,171 @@ + + + + + + + 2.1. Modules — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

2.1. Modules

+
+
+ +
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/namespaceNV.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/namespaceNV.html new file mode 100644 index 0000000000000000000000000000000000000000..c87a72bf78edd6773d1ec336d979295b2db4d302 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/namespaceNV.html @@ -0,0 +1,177 @@ + + + + + + + 2.3.1. NV — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

2.3.1. NV

+
+
+namespace NV
+
+ +
+
+

Namespaces

+ +
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/namespaceNV_1_1Rules.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/namespaceNV_1_1Rules.html new file mode 100644 index 0000000000000000000000000000000000000000..8cd516dacd0f86a7c949a81b21f46d332aaf1cb7 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/namespaceNV_1_1Rules.html @@ -0,0 +1,242 @@ + + + + + + + NV::Rules — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

NV::Rules

+
+
+namespace Rules
+
+ +
+
+

Data Structures

+ +

Enumerations

+ +

Functions

+ +

Typedefs

+ +
+

Enumerations

+
+
+enum class NV::Rules::RuleKind
+

Rule kind.

+

Reserved for future use.

+

Values:

+
+
+enumerator DEFAULT
+
+ +
+
+enumerator GUIDED
+
+ +
+ +
+
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/namespaces.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/namespaces.html new file mode 100644 index 0000000000000000000000000000000000000000..975eb9195b377404864a177f7aef1bc0fb376f8e --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/api/namespaces.html @@ -0,0 +1,168 @@ + + + + + + + 2.3. Namespaces — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

2.3. Namespaces

+
+
+ +
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/genindex.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/genindex.html new file mode 100644 index 0000000000000000000000000000000000000000..d0c7940ac3f5a7f27b5b0a17367f1e67e086af2e --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/genindex.html @@ -0,0 +1,528 @@ + + + + + + Index — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Index
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ + +

Index

+ +
+ N + +
+

N

+ + + +
+ + + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/index.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/index.html new file mode 100644 index 0000000000000000000000000000000000000000..c88aa67872c31849ea803626475c466f7e104f3f --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/index.html @@ -0,0 +1,206 @@ + + + + + + + Nsight Compute Documentation — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Nsight Compute Documentation
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ +
+

Nsight Compute Documentation

+
+

Nsight Compute

+
+
Release Notes

Release notes, including new features and important bug fixes. Supported platforms and GPUs. List of known issues for the current release.

+
+
Kernel Profiling Guide

Kernel Profiling Guide with metric types and meaning, data collection modes and FAQ for common problems.

+
+
Nsight Compute

NVIDIA Nsight Compute User Interface (UI) manual. Information on all views, controls and workflows within the tool UI. Transitions guide for Visual Profiler.

+
+
Nsight Compute CLI

NVIDIA Nsight Compute Command Line Interface (CLI) manual. Information on workflows and options for the command line, including multi-process profiling and NVTX filtering. Transitions guide for Nvprof.

+
+
+
+
+
+

Developer Interfaces

+
+
Customization Guide

User manual on customizing NVIDIA Nsight Compute tools or integrating them with custom workflows. Information on writing section files, rules for automatic result analysis and scripting access to report files.

+
+
+
+
+
+

Training

+
+
Training

NVIDIA Nsight Compute Training resources.

+
+
+
+
+
+

Release Information

+
+
Archives

Find documentation for previous versions of NVIDIA Nsight Compute.

+
+
+
+ +
+ + +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/objects.inv b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/objects.inv new file mode 100644 index 0000000000000000000000000000000000000000..4095871723a6c380393793c326cfa4f83b90ab63 Binary files /dev/null and b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/objects.inv differ diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/project.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/project.json new file mode 100644 index 0000000000000000000000000000000000000000..16cfebf3e7dc2a80c7fa20870b8150b1bd1f7011 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/project.json @@ -0,0 +1 @@ +{"name": "NsightCompute", "version": "12.4"} \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/search.html b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/search.html new file mode 100644 index 0000000000000000000000000000000000000000..235ba110b02497a37ab7ce8ab87b0444f2da6424 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/search.html @@ -0,0 +1,165 @@ + + + + + + Search — NsightCompute 12.4 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    + + +
  • »
  • +
  • Search
  • + +
  • +
  • +
  • + + + v2024.1.1 | + + + + Archive + + +   +
  • + +
+
+
+
+
+ + + + +
+ +
+ +
+
+
+ +
+ +
+

© Copyright 2018-2024, NVIDIA Corporation & Affiliates. All rights reserved. + Last updated on Mar 06, 2024. +

+
+ + + +
+
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/searchindex.js b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/searchindex.js new file mode 100644 index 0000000000000000000000000000000000000000..132b9be1388ccb41b8504fe6843d53dbf68e719e --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/docs/searchindex.js @@ -0,0 +1 @@ +const searchData = {"envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 5, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.intersphinx": 1, "repo_docs.ext.toctree": 2, "repo_docs.ext.mermaid": 1, "repo_docs.ext.enhanced_search": 2, "sphinx": 56}, "data": [{"id": 0, "doc_id": 1, "filename": "Archives/index.html", "domain_name": "page", "name": "Archives/index#nvidia-nsight-compute-archives", "display_name": "NVIDIA Nsight Compute Archives", "type": "section", "display_type": "Page section", "docname": "Archives/index", "anchor": "nvidia-nsight-compute-archives", "priority": -1, "content": "Below, you can find the current and past release information for NVIDIA Nsight Compute. Available Documentation Latest version of NVIDIA Nsight Compute NVIDIA Nsight Compute 2023.4 NVIDIA Nsight Compute 2023.3 NVIDIA Nsight Compute 2023.2 NVIDIA Nsight Compute 2023.1 NVIDIA Nsight Compute 2022.4 NVIDIA Nsight Compute 2022.3 NVIDIA Nsight Compute 2022.2 NVIDIA Nsight Compute 2022.1 NVIDIA Nsight Compute 2021.3 NVIDIA Nsight Compute 2021.2 NVIDIA Nsight Compute 2021.1 NVIDIA Nsight Compute 2020.3 NVIDIA Nsight Compute 2020.2 NVIDIA Nsight Compute 2020.1.2 NVIDIA Nsight Compute 2020.1 NVIDIA Nsight Compute 2019.5.1 NVIDIA Nsight Compute 2019.5 NVIDIA Nsight Compute 2019.4 NVIDIA Nsight Compute 2019.3 NVIDIA Nsight Compute 2019.1 Notices Notices ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, \u201cMATERIALS\u201d) ARE BEING PROVIDED \u201cAS IS.\u201d NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. Information furnished is believed to be accurate and reliable. However, NVIDIA Corporation assumes no responsibility for the consequences of use of such information or for any infringement of patents or other rights of third parties that may result from its use. No license is granted by implication of otherwise under any patent rights of NVIDIA Corporation. Specifications mentioned in this publication are subject to change without notice. This publication supersedes and replaces all other information previously supplied. NVIDIA Corporation products are not authorized as critical components in life support devices or systems without express written approval of NVIDIA Corporation. Trademarks NVIDIA and the NVIDIA logo are trademarks or registered trademarks of NVIDIA Corporation in the U.S. and other countries. Other company and product names may be trademarks of the respective companies with which they are associated.", "keywords": []}, {"id": 1, "doc_id": 1, "filename": "Archives/index.html", "domain_name": "std", "name": "Archives/index", "display_name": "Archives", "type": "doc", "display_type": "Page", "docname": "Archives/index", "anchor": "", "priority": -1, "content": "Nsight Compute Archived Releases. Find documentation for previous versions of NVIDIA Nsight Compute.", "keywords": []}, {"id": 2, "doc_id": 18, "filename": "CopyrightAndLicenses/index.html", "domain_name": "page", "name": "CopyrightAndLicenses/index#boost", "display_name": "Boost", "type": "section", "display_type": "Page section", "docname": "CopyrightAndLicenses/index", "anchor": "boost", "priority": -1, "content": "Boost Software License - Version 1.0 - August 17th, 2003 Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the \u201cSoftware\u201d) to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following: The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor. THE SOFTWARE IS PROVIDED \u201cAS IS\u201d, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", "keywords": []}, {"id": 3, "doc_id": 18, "filename": "CopyrightAndLicenses/index.html", "domain_name": "page", "name": "CopyrightAndLicenses/index#breakpad", "display_name": "Breakpad", "type": "section", "display_type": "Page section", "docname": "CopyrightAndLicenses/index", "anchor": "breakpad", "priority": -1, "content": "Copyright \u00a9 2006, Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \u201cAS IS\u201d AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.", "keywords": []}, {"id": 4, "doc_id": 18, "filename": "CopyrightAndLicenses/index.html", "domain_name": "page", "name": "CopyrightAndLicenses/index#flatbuffers", "display_name": "Flatbuffers", "type": "section", "display_type": "Page section", "docname": "CopyrightAndLicenses/index", "anchor": "flatbuffers", "priority": -1, "content": "http://google.github.io/flatbuffers Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION Definitions. \u201cLicense\u201d shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. \u201cLicensor\u201d shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. \u201cLegal Entity\u201d shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \u201ccontrol\u201d means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. \u201cYou\u201d (or \u201cYour\u201d) shall mean an individual or Legal Entity exercising permissions granted by this License. \u201cSource\u201d form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. \u201cObject\u201d form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. \u201cWork\u201d shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). \u201cDerivative Works\u201d shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. \u201cContribution\u201d shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \u201csubmitted\u201d means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \u201cNot a Contribution.\u201d \u201cContributor\u201d shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: You must give any other recipients of the Work or Derivative Works a copy of this License; and You must cause any modified files to carry prominent notices stating that You changed the files; and You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and If the Work includes a \u201cNOTICE\u201d text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \u201cAS IS\u201d BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \u201c[]\u201d replaced with your own identifying information. (Don\u2019t include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \u201cprinted page\u201d as the copyright notice for easier identification within third-party archives. Copyright \u00a9 2014 Google Inc. Licensed under the Apache License, Version 2.0 (the \u201cLicense\u201d); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0", "keywords": []}, {"id": 5, "doc_id": 18, "filename": "CopyrightAndLicenses/index.html", "domain_name": "page", "name": "CopyrightAndLicenses/index#font-cascadia-mono", "display_name": "Font - Cascadia Mono", "type": "section", "display_type": "Page section", "docname": "CopyrightAndLicenses/index", "anchor": "font-cascadia-mono", "priority": -1, "content": "( https://github.com/microsoft/cascadia-code ) Copyright (c) 2019 - Present, Microsoft Corporation, with Reserved Font Name Cascadia Code. This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 PREAMBLE The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others. The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives. DEFINITIONS \u201cFont Software\u201d refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation. \u201cReserved Font Name\u201d refers to any names specified as such after the copyright statement(s). \u201cOriginal Version\u201d refers to the collection of Font Software components as distributed by the Copyright Holder(s). \u201cModified Version\u201d refers to any derivative made by adding to, deleting, or substituting \u2013 in part or in whole \u2013 any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment. \u201cAuthor\u201d refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software. PERMISSION & CONDITIONS Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions: Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself. Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user. No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users. The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission. The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software. TERMINATION This license becomes null and void if any of the above conditions are not met. DISCLAIMER THE FONT SOFTWARE IS PROVIDED \u201cAS IS\u201d, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.", "keywords": []}, {"id": 6, "doc_id": 18, "filename": "CopyrightAndLicenses/index.html", "domain_name": "page", "name": "CopyrightAndLicenses/index#font-open-sans", "display_name": "Font - Open Sans", "type": "section", "display_type": "Page section", "docname": "CopyrightAndLicenses/index", "anchor": "font-open-sans", "priority": -1, "content": "( https://fonts.google.com/specimen/Open+Sans ) Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION Definitions. \u201cLicense\u201d shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. \u201cLicensor\u201d shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. \u201cLegal Entity\u201d shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \u201ccontrol\u201d means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. \u201cYou\u201d (or \u201cYour\u201d) shall mean an individual or Legal Entity exercising permissions granted by this License. \u201cSource\u201d form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. \u201cObject\u201d form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. \u201cWork\u201d shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). \u201cDerivative Works\u201d shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. \u201cContribution\u201d shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \u201csubmitted\u201d means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \u201cNot a Contribution.\u201d \u201cContributor\u201d shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: You must give any other recipients of the Work or Derivative Works a copy of this License; and You must cause any modified files to carry prominent notices stating that You changed the files; and You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and If the Work includes a \u201cNOTICE\u201d text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \u201cAS IS\u201d BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \u201c[]\u201d replaced with your own identifying information. (Don\u2019t include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \u201cprinted page\u201d as the copyright notice for easier identification within third-party archives. Copyright \u00a9 2014 Google Inc. Licensed under the Apache License, Version 2.0 (the \u201cLicense\u201d); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0", "keywords": []}, {"id": 7, "doc_id": 18, "filename": "CopyrightAndLicenses/index.html", "domain_name": "page", "name": "CopyrightAndLicenses/index#font-roboto", "display_name": "Font - Roboto", "type": "section", "display_type": "Page section", "docname": "CopyrightAndLicenses/index", "anchor": "font-roboto", "priority": -1, "content": "( https://fonts.google.com/specimen/Roboto ) Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION Definitions. \u201cLicense\u201d shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. \u201cLicensor\u201d shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. \u201cLegal Entity\u201d shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \u201ccontrol\u201d means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. \u201cYou\u201d (or \u201cYour\u201d) shall mean an individual or Legal Entity exercising permissions granted by this License. \u201cSource\u201d form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. \u201cObject\u201d form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. \u201cWork\u201d shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). \u201cDerivative Works\u201d shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. \u201cContribution\u201d shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \u201csubmitted\u201d means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \u201cNot a Contribution.\u201d \u201cContributor\u201d shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: You must give any other recipients of the Work or Derivative Works a copy of this License; and You must cause any modified files to carry prominent notices stating that You changed the files; and You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and If the Work includes a \u201cNOTICE\u201d text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \u201cAS IS\u201d BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \u201c[]\u201d replaced with your own identifying information. (Don\u2019t include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \u201cprinted page\u201d as the copyright notice for easier identification within third-party archives. Copyright \u00a9 2014 Google Inc. Licensed under the Apache License, Version 2.0 (the \u201cLicense\u201d); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0", "keywords": []}, {"id": 8, "doc_id": 18, "filename": "CopyrightAndLicenses/index.html", "domain_name": "page", "name": "CopyrightAndLicenses/index#json-for-modern-c", "display_name": "JSON for Modern C++", "type": "section", "display_type": "Page section", "docname": "CopyrightAndLicenses/index", "anchor": "json-for-modern-c", "priority": -1, "content": "( https://nlohmann.github.io/json/ ) MIT License Copyright (c) 2013-2019 Niels Lohmann Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \u201cSoftware\u201d), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \u201cAS IS\u201d, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", "keywords": []}, {"id": 9, "doc_id": 18, "filename": "CopyrightAndLicenses/index.html", "domain_name": "page", "name": "CopyrightAndLicenses/index#libbacktrace", "display_name": "libbacktrace", "type": "section", "display_type": "Page section", "docname": "CopyrightAndLicenses/index", "anchor": "libbacktrace", "priority": -1, "content": "Copyright (C) 2012-2016 Free Software Foundation, Inc. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS\u2019\u2019 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.", "keywords": []}, {"id": 10, "doc_id": 18, "filename": "CopyrightAndLicenses/index.html", "domain_name": "page", "name": "CopyrightAndLicenses/index#libssh", "display_name": "LIBSSH", "type": "section", "display_type": "Page section", "docname": "CopyrightAndLicenses/index", "anchor": "libssh", "priority": -1, "content": "Copyright \u00a9 2020 The libssh project. GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Linking with OpenSSL 17. In addition, as a special exception, we give permission to link the code of its release of libssh with the OpenSSL project's "OpenSSL" library (or with modified versions of it that use the same license as the "OpenSSL" library), and distribute the linked executables. You must obey the GNU Lesser General Public License in all respects for all of the code used other than "OpenSSL". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. END OF TERMS AND CONDITIONS Copies of libssh source will be made available upon request in accordance with LPGL requirements.", "keywords": []}, {"id": 11, "doc_id": 18, "filename": "CopyrightAndLicenses/index.html", "domain_name": "page", "name": "CopyrightAndLicenses/index#microsoft-detours", "display_name": "Microsoft Detours", "type": "section", "display_type": "Page section", "docname": "CopyrightAndLicenses/index", "anchor": "microsoft-detours", "priority": -1, "content": "Microsoft Detours is used under the Professional license ( http://research.microsoft.com/en-us/projects/detours/ ). NVIDIA agrees to include in all copies of the NVIDIA Applications a proprietary rights notice that includes a reference to Microsoft software being included in such applications. NVIDIA shall not remove or obscure, but shall retain in the Software, any copyright, trademark, or patent notices that appear in the Software.", "keywords": []}, {"id": 12, "doc_id": 18, "filename": "CopyrightAndLicenses/index.html", "domain_name": "page", "name": "CopyrightAndLicenses/index#nvidia-software-license-agreement", "display_name": "NVIDIA Software License Agreement", "type": "section", "display_type": "Page section", "docname": "CopyrightAndLicenses/index", "anchor": "nvidia-software-license-agreement", "priority": -1, "content": "NVIDIA CORPORATION NVIDIA SOFTWARE LICENSE AGREEMENT IMPORTANT \u2014 READ BEFORE DOWNLOADING, INSTALLING, COPYING OR USING THE LICENSED SOFTWARE This Software License Agreement (\u201cSLA\u201d), made and entered into as of the time and date of click through action (\u201cEffective Date\u201d), is a legal agreement between you and NVIDIA Corporation (\u201cNVIDIA\u201d) and governs the use of the NVIDIA computer software and the documentation made available for use with such NVIDIA software. By downloading, installing, copying, or otherwise using the NVIDIA software and/or documentation, you agree to be bound by the terms of this SLA. If you do not agree to the terms of this SLA, do not download, install, copy or use the NVIDIA software or documentation. IF YOU ARE ENTERING INTO THIS SLA ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY, YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE ENTITY TO THIS SLA, IN WHICH CASE \u201cYOU\u201d WILL MEAN THE ENTITY YOU REPRESENT. IF YOU DON\u2019T HAVE SUCH AUTHORITY, OR IF YOU DON\u2019T ACCEPT ALL THE TERMS AND CONDITIONS OF THIS SLA, THEN NVIDIA DOES NOT AGREE TO LICENSE THE LICENSED SOFTWARE TO YOU, AND YOU MAY NOT DOWNLOAD, INSTALL, COPY OR USE IT. LICENSE. 1.1 License Grant. Subject to the terms of the AGREEMENT, NVIDIA hereby grants you a non-exclusive, non-transferable license, without the right to sublicense (except as expressly set forth in a Supplement), during the applicable license term unless earlier terminated as provided below, to have Authorized Users install and use the Software, including modifications (if expressly permitted in a Supplement), in accordance with the Documentation. You are only licensed to activate and use Licensed Software for which you a have a valid license, even if during the download or installation you are presented with other product options. No Orders are binding on NVIDIA until accepted by NVIDIA. Your Orders are subject to the AGREEMENT. SLA Supplements : Certain Licensed Software licensed under this SLA may be subject to additional terms and conditions that will be presented to you in a Supplement for acceptance prior to the delivery of such Licensed Software under this SLA and the applicable Supplement. Licensed Software will only be delivered to you upon your acceptance of all applicable terms. 1.2 Limited Purpose Licenses . If your license is provided for one of the purposes indicated below, then notwithstanding contrary terms in Section 1.1 or in a Supplement, such licenses are for internal use and do not include any right or license to sub- license and distribute the Licensed Software or its output in any way in any public release, however limited, and/or in any manner that provides third parties with use of or access to the Licensed Software or its functionality or output, including (but not limited to) external alpha or beta testing or development phases. Further: Evaluation License . You may use evaluation licenses solely for your internal evaluation of the Licensed Software for broader adoption within your Enterprise or in connection with a NVIDIA product purchase decision, and such licenses have an expiration date as indicated by NVIDIA in its sole discretion (or ninety days from the date of download if no other duration is indicated). Educational/Academic License . You may use educational/academic licenses solely for educational purposes and all users must be enrolled or employed by an academic institution. If you do not meet NVIDIA\u2019s academic program requirements for educational institutions, you have no rights under this license. Test/Development License . You may use test/development licenses solely for your internal development, testing and/or debugging of your software applications or for interoperability testing with the Licensed Software, and such licenses have an expiration date as indicated by NVIDIA in its sole discretion (or one year from the date of download if no other duration is indicated). NVIDIA Confidential Information under the AGREEMENT includes output from Licensed Software developer tools identified as \u201cPro\u201d versions, where the output reveals functionality or performance data pertinent to NVIDIA hardware or software products. 1.3 Pre-Release Licenses . With respect to alpha, beta, preview, and other pre-release Software and Documentation ( \u201cPre- Release Licensed Software\u201d ) delivered to you under the AGREEMENT you acknowledge and agree that such Pre-Release Licensed Software (i) may not be fully functional, may contain errors or design flaws, and may have reduced or different security, privacy, accessibility, availability, and reliability standards relative to commercially provided NVIDIA software and documentation, and (ii) use of such Pre-Release Licensed Software may result in unexpected results, loss of data, project delays or other unpredictable damage or loss. THEREFORE, PRE-RELEASE LICENSED SOFTWARE IS NOT INTENDED FOR USE, AND SHOULD NOT BE USED, IN PRODUCTION OR BUSINESS-CRITICAL SYSTEMS. NVIDIA has no obligation to make available a commercial version of any Pre-Release Licensed Software and NVIDIA has the right to abandon development of Pre-Release Licensed Software at any time without liability. 1.4 Enterprise and Contractor Usage . You may allow your Enterprise employees and Contractors to access and use the Licensed Software pursuant to the terms of the AGREEMENT solely to perform work on your behalf, provided further that with respect to Contractors: (i) you obtain a written agreement from each Contractor which contains terms and obligations with respect to access to and use of Licensed Software no less protective of NVIDIA than those set forth in the AGREEMENT, and (ii) such Contractor\u2019s access and use expressly excludes any sublicensing or distribution rights for the Licensed Software. You are responsible for the compliance with the terms and conditions of the AGREEMENT by your Enterprise and Contractors. Any act or omission that, if committed by you, would constitute a breach of the AGREEMENT shall be deemed to constitute a breach of the AGREEMENT if committed by your Enterprise or Contractors. 1.5 Services . Except as expressly indicated in an Order, NVIDIA is under no obligation to provide support for the Licensed Software or to provide any patches, maintenance, updates or upgrades under the AGREEMENT. Unless patches, maintenance, updates or upgrades are provided with their separate governing terms and conditions, they constitute Licensed Software licensed to you under the AGREEMENT. LIMITATIONS. 2.1 License Restrictions . Except as expressly authorized in the AGREEMENT, you agree that you will not (nor authorize third parties to): (i) copy and use Software that was licensed to you for use in one or more NVIDIA hardware products in other unlicensed products (provided that copies solely for backup purposes are allowed); (ii) reverse engineer, decompile, disassemble (except to the extent applicable laws specifically require that such activities be permitted) or attempt to derive the source code, underlying ideas, algorithm or structure of Software provided to you in object code form; (iii) sell, transfer, assign, distribute, rent, loan, lease, sublicense or otherwise make available the Licensed Software or its functionality to third parties (a) as an application services provider or service bureau, (b) by operating hosted/virtual system environments, (c) by hosting, time sharing or providing any other type of services, or (d) otherwise by means of the internet; (iv) modify, translate or otherwise create any derivative works of any Licensed Software; (v) remove, alter, cover or obscure any proprietary notice that appears on or with the Licensed Software or any copies thereof; (vi) use the Licensed Software, or allow its use, transfer, transmission or export in violation of any applicable export control laws, rules or regulations; (vii) distribute, permit access to, or sublicense the Licensed Software as a stand-alone product; (viii) bypass, disable, circumvent or remove any form of copy protection, encryption, security or digital rights management or authentication mechanism used by NVIDIA in connection with the Licensed Software, or use the Licensed Software together with any authorization code, serial number, or other copy protection device not supplied by NVIDIA directly or through an authorized reseller; (ix) use the Licensed Software for the purpose of developing competing products or technologies or assisting a third party in such activities; (x) use the Licensed Software with any system or application where the use or failure of such system or application can reasonably be expected to threaten or result in personal injury, death, or catastrophic loss including, without limitation, use in connection with any nuclear, avionics, navigation, military, medical, life support or other life critical application (\u201cCritical Applications\u201d), unless the parties have entered into a Critical Applications agreement; (xi) distribute any modification or derivative work you make to the Licensed Software under or by reference to the same name as used by NVIDIA; or (xii) use the Licensed Software in any manner that would cause the Licensed Software to become subject to an Open Source License. Nothing in the AGREEMENT shall be construed to give you a right to use, or otherwise obtain access to, any source code from which the Software or any portion thereof is compiled or interpreted. You acknowledge that NVIDIA does not design, test, manufacture or certify the Licensed Software for use in the context of a Critical Application and NVIDIA shall not be liable to you or any third party, in whole or in part, for any claims or damages arising from such use. You agree to defend, indemnify and hold harmless NVIDIA and its Affiliates, and their respective employees, contractors, agents, officers and directors, from and against any and all claims, damages, obligations, losses, liabilities, costs or debt, fines, restitutions and expenses (including but not limited to attorney\u2019s fees and costs incident to establishing the right of indemnification) arising out of or related to you and your Enterprise, and their respective employees, contractors, agents, distributors, resellers, end users, officers and directors use of Licensed Software outside of the scope of the AGREEMENT or any other breach of the terms of the AGREEMENT. 2.2 Third Party License Obligations . You acknowledge and agree that the Licensed Software may include or incorporate third party technology (collectively \u201cThird Party Components\u201d), which is provided for use in or with the Software and not otherwise used separately. If the Licensed Software includes or incorporates Third Party Components, then the third-party pass-through terms and conditions (\u201cThird Party Terms\u201d) for the particular Third Party Component will be bundled with the Software or otherwise made available online as indicated by NVIDIA and will be incorporated by reference into the AGREEMENT. In the event of any conflict between the terms in the AGREEMENT and the Third Party Terms, the Third Party Terms shall govern. Copyright to Third Party Components are held by the copyright holders indicated in the copyright notices indicated in the Third Party Terms. Audio/Video Encoders and Decoders . You acknowledge and agree that it is your sole responsibility to obtain any additional third party licenses required to make, have made, use, have used, sell, import, and offer for sale your products or services that include or incorporate any Third Party Components and content relating to audio and/or video encoders and decoders from, including but not limited to, Microsoft, Thomson, Fraunhofer IIS, Sisvel S.p.A., MPEG-LA, and Coding Technologies as NVIDIA does not grant to you under the AGREEMENT any necessary patent or other rights with respect to audio and/or video encoders and decoders. 2.3 Limited Rights . Your rights in the Licensed Software are limited to those expressly granted under the AGREEMENT and no other licenses are granted whether by implication, estoppel or otherwise. NVIDIA reserves all rights, title and interest in and to the Licensed Software not expressly granted under the AGREEMENT. 3. CONFIDENTIALITY. Neither party will use the other party\u2019s Confidential Information, except as necessary for the performance of the AGREEMENT, nor will either party disclose such Confidential Information to any third party, except to personnel of NVIDIA and its Affiliates, you, your Enterprise, your Enterprise Contractors, and each party\u2019s legal and financial advisors that have a need to know such Confidential Information for the performance of the AGREEMENT, provided that each such personnel, employee and Contractor is subject to a written agreement that includes confidentiality obligations consistent with those set forth herein. Each party will use all reasonable efforts to maintain the confidentiality of all of the other party\u2019s Confidential Information in its possession or control, but in no event less than the efforts that it ordinarily uses with respect to its own Confidential Information of similar nature and importance. The foregoing obligations will not restrict either party from disclosing the other party\u2019s Confidential Information or the terms and conditions of the AGREEMENT as required under applicable securities regulations or pursuant to the order or requirement of a court, administrative agency, or other governmental body, provided that the party required to make such disclosure (i) gives reasonable notice to the other party to enable it to contest such order or requirement prior to its disclosure (whether through protective orders or otherwise), (ii) uses reasonable effort to obtain confidential treatment or similar protection to the fullest extent possible to avoid such public disclosure, and (iii) discloses only the minimum amount of information necessary to comply with such requirements. 4. OWNERSHIP. You are not obligated to disclose to NVIDIA any modifications that you, your Enterprise or your Contractors make to the Licensed Software as permitted under the AGREEMENT. As between the parties, all modifications are owned by NVIDIA and licensed to you under the AGREEMENT unless otherwise expressly provided in a Supplement. The Licensed Software and all modifications owned by NVIDIA, and the respective Intellectual Property Rights therein, are and will remain the sole and exclusive property of NVIDIA or its licensors, whether the Licensed Software is separate from or combined with any other products or materials. You shall not engage in any act or omission that would impair NVIDIA\u2019s and/or its licensors\u2019 Intellectual Property Rights in the Licensed Software or any other materials, information, processes or subject matter proprietary to NVIDIA. NVIDIA\u2019s licensors are intended third party beneficiaries with the right to enforce provisions of the AGREEMENT with respect to their Confidential Information and/or Intellectual Property Rights. 5. FEEDBACK. You have no obligation to provide Feedback to NVIDIA. However, NVIDIA and/or its Affiliates may use and include any Feedback that you provide to improve the Licensed Software or other NVIDIA products, technologies or materials. Accordingly, if you provide Feedback, you agree that NVIDIA and/or its Affiliates, at their option, may, and may permit their licensees, to make, have made, use, have used, reproduce, license, distribute and otherwise commercialize the Feedback in the Licensed Software or in other NVIDIA products, technologies or materials without the payment of any royalties or fees to you. All Feedback becomes the sole property of NVIDIA and may be used in any manner NVIDIA sees fit, and you hereby assign to NVIDIA all of your right, title and interest in and to any Feedback. NVIDIA has no obligation to respond to Feedback or to incorporate Feedback into the Licensed Software. 6. NO WARRANTIES. THE LICENSED SOFTWARE AND ANY OTHER CONFIDENTIAL INFORMATION AND/OR SERVICES ARE PROVIDED BY NVIDIA \u201cAS IS\u201d AND \u201cWITH ALL FAULTS,\u201d AND NVIDIA EXPRESSLY DISCLAIMS ALL OTHER WARRANTIES OF ANY KIND OR NATURE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES OF OPERABILITY, CONDITION, VALUE, ACCURACY OF DATA, OR QUALITY, AS WELL AS ANY WARRANTIES OF MERCHANTABILITY, SYSTEM INTEGRATION, WORKMANSHIP, SUITABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON- INFRINGEMENT, OR THE ABSENCE OF ANY DEFECTS THEREIN, WHETHER LATENT OR PATENT. NO WARRANTY IS MADE BY NVIDIA ON THE BASIS OF TRADE USAGE, COURSE OF DEALING OR COURSE OF TRADE. NVIDIA DOES NOT WARRANT THAT THE LICENSED SOFTWARE OR ANY OTHER CONFIDENTIAL INFORMATION AND/OR SERVICES PROVIDED BY NVIDIA UNDER THE AGREEMENT WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION THEREOF WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT ALL ERRORS WILL BE CORRECTED. YOU ACKNOWLEDGE THAT NVIDIA\u2019S OBLIGATIONS UNDER THE AGREEMENT ARE FOR THE BENEFIT OF YOU ONLY. Nothing in this warranty section affects any statutory rights of consumers or other recipients to the extent that they cannot be waived or limited by contract under applicable law. 7. LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY LAW, NVIDIA OR ITS LICENSORS SHALL NOT BE LIABLE FOR ANY SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, OR ANY LOST PROFITS, LOSS OF USE, LOSS OF DATA OR LOSS OF GOODWILL, OR THE COSTS OF PROCURING SUBSTITUTE PRODUCTS, ARISING OUT OF OR IN CONNECTION WITH THE AGREEMENT OR THE USE OR PERFORMANCE OF THE LICENSED SOFTWARE AND ANY OTHER CONFIDENTIAL INFORMATION AND/OR SERVICES PROVIDED BY NVIDIA UNDER THE AGREEMENT, WHETHER SUCH LIABILITY ARISES FROM ANY CLAIM BASED UPON BREACH OF CONTRACT, BREACH OF WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCT LIABILITY OR ANY OTHER CAUSE OF ACTION OR THEORY OF LIABILITY. IN NO EVENT WILL NVIDIA\u2019S TOTAL CUMULATIVE LIABILITY UNDER OR ARISING OUT OF THE AGREEMENT EXCEED THE NET AMOUNTS RECEIVED BY NVIDIA FOR YOUR USE OF THE PARTICULAR LICENSED SOFTWARE DURING THE TWELVE (12) MONTHS BEFORE THE LIABILITY AROSE (or up to US$10.00 if you acquired the Licensed Software for no charge). THE NATURE OF THE LIABILITY, THE NUMBER OF CLAIMS OR SUITS OR THE NUMBER OF PARTIES WITHIN YOUR ENTERPRISE THAT ACCEPTED THE TERMS OF THE AGREEMENT SHALL NOT ENLARGE OR EXTEND THIS LIMIT. THE FOREGOING LIMITATIONS SHALL APPLY REGARDLESS OF WHETHER NVIDIA OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND REGARDLESS OF WHETHER ANY REMEDY FAILS ITS ESSENTIAL PURPOSE. The disclaimers, exclusions and limitations of liability set forth in the AGREEMENT form an essential basis of the bargain between the parties, and, absent any such disclaimers, exclusions or limitations of liability, the provisions of the AGREEMENT, including, without limitation, the economic terms, would be substantially different. TERM AND TERMINATION. 8.1 AGREEMENT, Licenses and Services . This SLA shall become effective upon the Effective Date, each Supplement upon their acceptance, and both this SLA and Supplements shall continue in effect until your last access or use of the Licensed Software and/or services hereunder, unless earlier terminated as provided in this \u201cTerm and Termination\u201d section. Each Licensed Software license ends at the earlier of (a) the expiration of the applicable license term, or (b) termination of such license or the AGREEMENT. Each service ends at the earlier of (x) the expiration of the applicable service term, (y) termination of such service or the AGREEMENT, or (z) expiration or termination of the associated license and no credit or refund will be provided upon the expiration or termination of the associated license for any service fees paid. 8.2 Termination and Effect of Expiration or Termination . NVIDIA may terminate the AGREEMENT in whole or in part: (i) if you breach any term of the AGREEMENT and fail to cure such breach within thirty (30) days following notice thereof from NVIDIA (or immediately if you violate NVIDIA\u2019s Intellectual Property Rights); (ii) if you become the subject of a voluntary or involuntary petition in bankruptcy or any proceeding relating to insolvency, receivership, liquidation or composition for the benefit of creditors, if that petition or proceeding is not dismissed with prejudice within sixty (60) days after filing, or if you cease to do business; or (iii) if you commence or participate in any legal proceeding against NVIDIA, with respect to the Licensed Software that is the subject of the proceeding during the pendency of such legal proceeding. If you or your authorized NVIDIA reseller fail to pay license fees or service fees when due then NVIDIA may, in its sole discretion, suspend or terminate your license grants, services and any other rights provided under the AGREEMENT for the affected Licensed Software, in addition to any other remedies NVIDIA may have at law or equity. Upon any expiration or termination of the AGREEMENT, a license or a service provided hereunder, (a) any amounts owed to NVIDIA become immediately due and payable, (b) you must promptly discontinue use of the affected Licensed Software and/or service, and (c) you must promptly destroy or return to NVIDIA all copies of the affected Licensed Software and all portions thereof in your possession or control, and each party will promptly destroy or return to the other all of the other party\u2019s Confidential Information within its possession or control. Upon written request, you will certify in writing that you have complied with your obligations under this section. Upon expiration or termination of the AGREEMENT all provisions survive except for the license grant provisions. CONSENT TO COLLECTION AND USE OF INFORMATION. You hereby agree and acknowledge that the Software may access, collect non-personally identifiable information about your Enterprise computer systems in order to properly optimize such systems for use with the Software. To the extent that you use the Software, you hereby consent to all of the foregoing, and represent and warrant that you have the right to grant such consent. In addition, you agree that you are solely responsible for maintaining appropriate data backups and system restore points for your Enterprise systems, and that NVIDIA will have no responsibility for any damage or loss to such systems (including loss of data or access) arising from or relating to (a) any changes to the configuration, application settings, environment variables, registry, drivers, BIOS, or other attributes of the systems (or any part of such systems) initiated through the Software; or (b) installation of any Software or third party software patches initiated through the Software. In certain systems you may change your system update preferences by unchecking \u201cAutomatically check for updates\u201d in the \u201cPreferences\u201d tab of the control panel for the Software. In connection with the receipt of the Licensed Software or services you may receive access to links to third party websites and services and the availability of those links does not imply any endorsement by NVIDIA. NVIDIA encourages you to review the privacy statements on those sites and services that you choose to visit so that you can understand how they may collect, use and share personal information of individuals. NVIDIA is not responsible or liable for: (i) the availability or accuracy of such links; or (ii) the products, services or information available on or through such links; or (iii) the privacy statements or practices of sites and services controlled by other companies or organizations. To the extent that you or members of your Enterprise provide to NVIDIA during registration or otherwise personal information, you acknowledge that such information will be collected, used and disclosed by NVIDIA in accordance with NVIDIA\u2019s privacy policy, available at URL http://www.nvidia.com/object/privacy_policy.html . GENERAL. This SLA, any Supplements incorporated hereto, and Orders constitute the entire agreement of the parties with respect to the subject matter hereto and supersede all prior negotiations, conversations, or discussions between the parties relating to the subject matter hereto, oral or written, and all past dealings or industry custom. Any additional and/or conflicting terms and conditions on purchase order(s) or any other documents issued by you are null, void, and invalid. Any amendment or waiver under the AGREEMENT must be in writing and signed by representatives of both parties. The AGREEMENT and the rights and obligations thereunder may not be assigned by you, in whole or in part, including by merger, consolidation, dissolution, operation of law, or any other manner, without written consent of NVIDIA, and any purported assignment in violation of this provision shall be void and of no effect. NVIDIA may assign, delegate or transfer the AGREEMENT and its rights and obligations hereunder, and if to a non-Affiliate you will be notified. Each party acknowledges and agrees that the other is an independent contractor in the performance of the AGREEMENT, and each party is solely responsible for all of its employees, agents, contractors, and labor costs and expenses arising in connection therewith. The parties are not partners, joint ventures or otherwise affiliated, and neither has any authority to make any statements, representations or commitments of any kind to bind the other party without prior written consent. Neither party will be responsible for any failure or delay in its performance under the AGREEMENT (except for any payment obligations) to the extent due to causes beyond its reasonable control for so long as such force majeure event continues in effect. The AGREEMENT will be governed by and construed under the laws of the State of Delaware and the United States without regard to the conflicts of law provisions thereof and without regard to the United Nations Convention on Contracts for the International Sale of Goods. The parties consent to the personal jurisdiction of the federal and state courts located in Santa Clara County, California. You acknowledge and agree that a breach of any of your promises or agreements contained in the AGREEMENT may result in irreparable and continuing injury to NVIDIA for which monetary damages may not be an adequate remedy and therefore NVIDIA is entitled to seek injunctive relief as well as such other and further relief as may be appropriate. If any court of competent jurisdiction determines that any provision of the AGREEMENT is illegal, invalid or unenforceable, the remaining provisions will remain in full force and effect. Unless otherwise specified, remedies are cumulative. The Licensed Software has been developed entirely at private expense and is \u201ccommercial items\u201d consisting of \u201ccommercial computer software\u201d and \u201ccommercial computer software documentation\u201d provided with RESTRICTED RIGHTS. Use, duplication or disclosure by the U.S. Government or a U.S. Government subcontractor is subject to the restrictions set forth in the AGREEMENT pursuant to DFARS 227.7202-3(a) or as set forth in subparagraphs (c)(1) and (2) of the Commercial Computer Software - Restricted Rights clause at FAR 52.227-19, as applicable. Contractor/manufacturer is NVIDIA, 2701 San Tomas Expressway, Santa Clara, CA 95050. You acknowledge that the Licensed Software described under the AGREEMENT is subject to export control under the U.S. Export Administration Regulations (EAR) and economic sanctions regulations administered by the U.S. Department of Treasury\u2019s Office of Foreign Assets Control (OFAC). Therefore, you may not export, reexport or transfer in-country the Licensed Software without first obtaining any license or other approval that may be required by BIS and/or OFAC. You are responsible for any violation of the U.S. or other applicable export control or economic sanctions laws, regulations and requirements related to the Licensed Software. By accepting this SLA, you confirm that you are not a resident or citizen of any country currently embargoed by the U.S. and that you are not otherwise prohibited from receiving the Licensed Software. Any notice delivered by NVIDIA to you under the AGREEMENT will be delivered via mail, email or fax. Please direct your legal notices or other correspondence to NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, California 95050, United States of America, Attention: Legal Department. GLOSSARY OF TERMS Certain capitalized terms, if not otherwise defined elsewhere in this SLA, shall have the meanings set forth below: \u201c Affiliate \u201d means any legal entity that Owns, is Owned by, or is commonly Owned with a party. \u201cOwn\u201d means having more than 50% ownership or the right to direct the management of the entity. \u201c AGREEMENT \u201d means this SLA and all associated Supplements entered by the parties referencing this SLA. \u201c Authorized Users \u201d means your Enterprise individual employees and any of your Enterprise\u2019s Contractors, subject to the terms of the \u201cEnterprise and Contractors Usage\u201d section. \u201c Confidential Information \u201d means the Licensed Software (unless made publicly available by NVIDIA without confidentiality obligations), and any NVIDIA business, marketing, pricing, research and development, know-how, technical, scientific, financial status, proposed new products or other information disclosed by NVIDIA to you which, at the time of disclosure, is designated in writing as confidential or proprietary (or like written designation), or orally identified as confidential or proprietary or is otherwise reasonably identifiable by parties exercising reasonable business judgment, as confidential. Confidential Information does not and will not include information that: (i) is or becomes generally known to the public through no fault of or breach of the AGREEMENT by the receiving party; (ii) is rightfully known by the receiving party at the time of disclosure without an obligation of confidentiality; (iii) is independently developed by the receiving party without use of the disclosing party\u2019s Confidential Information; or (iv) is rightfully obtained by the receiving party from a third party without restriction on use or disclosure. \u201c Contractor \u201d means an individual who works primarily for your Enterprise on a contractor basis from your secure network. \u201c Documentation \u201d means the NVIDIA documentation made available for use with the Software, including (without limitation) user manuals, datasheets, operations instructions, installation guides, release notes and other materials provided to you under the AGREEMENT. \u201c Enterprise \u201d means you or any company or legal entity for which you accepted the terms of this SLA, and their subsidiaries of which your company or legal entity owns more than fifty percent (50%) of the issued and outstanding equity. \u201c Feedback \u201d means any and all suggestions, feature requests, comments or other feedback regarding the Licensed Software, including possible enhancements or modifications thereto. \u201c Intellectual Property Rights \u201d means all patent, copyright, trademark, trade secret, trade dress, trade names, utility models, mask work, moral rights, rights of attribution or integrity service marks, master recording and music publishing rights, performance rights, author\u2019s rights, database rights, registered design rights and any applications for the protection or registration of these rights, or other intellectual or industrial property rights or proprietary rights, howsoever arising and in whatever media, whether now known or hereafter devised, whether or not registered, (including all claims and causes of action for infringement, misappropriation or violation and all rights in any registrations and renewals), worldwide and whether existing now or in the future. \u201c Licensed Software \u201d means Software, Documentation and all modifications owned by NVIDIA. \u201c Open Source License \u201d includes, without limitation, a software license that requires as a condition of use, modification, and/or distribution of such software that the Software be (i) disclosed or distributed in source code form; (ii) be licensed for the purpose of making derivative works; or (iii) be redistributable at no charge. \u201c Order \u201d means a purchase order issued by you, a signed purchase agreement with you, or other ordering document issued by you to NVIDIA or a NVIDIA authorized reseller (including any on-line acceptance process) that references and incorporates the AGREEMENT and is accepted by NVIDIA. \u201c Software \u201d means the NVIDIA software programs licensed to you under the AGREEMENT including, without limitation, libraries, sample code, utility programs and programming code. \u201c Supplement \u201d means the additional terms and conditions beyond those stated in this SLA that apply to certain Licensed Software licensed hereunder.", "keywords": []}, {"id": 13, "doc_id": 18, "filename": "CopyrightAndLicenses/index.html", "domain_name": "page", "name": "CopyrightAndLicenses/index#openssl", "display_name": "OpenSSL", "type": "section", "display_type": "Page section", "docname": "CopyrightAndLicenses/index", "anchor": "openssl", "priority": -1, "content": "https://www.openssl.org Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION Definitions. \u201cLicense\u201d shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. \u201cLicensor\u201d shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. \u201cLegal Entity\u201d shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \u201ccontrol\u201d means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. \u201cYou\u201d (or \u201cYour\u201d) shall mean an individual or Legal Entity exercising permissions granted by this License. \u201cSource\u201d form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. \u201cObject\u201d form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. \u201cWork\u201d shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). \u201cDerivative Works\u201d shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. \u201cContribution\u201d shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \u201csubmitted\u201d means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \u201cNot a Contribution.\u201d \u201cContributor\u201d shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: You must give any other recipients of the Work or Derivative Works a copy of this License; and You must cause any modified files to carry prominent notices stating that You changed the files; and You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and If the Work includes a \u201cNOTICE\u201d text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \u201cAS IS\u201d BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \u201c[]\u201d replaced with your own identifying information. (Don\u2019t include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \u201cprinted page\u201d as the copyright notice for easier identification within third-party archives. Copyright \u00a9 2014 Google Inc. Licensed under the Apache License, Version 2.0 (the \u201cLicense\u201d); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0", "keywords": []}, {"id": 14, "doc_id": 18, "filename": "CopyrightAndLicenses/index.html", "domain_name": "page", "name": "CopyrightAndLicenses/index#protocol-buffers", "display_name": "Protocol Buffers", "type": "section", "display_type": "Page section", "docname": "CopyrightAndLicenses/index", "anchor": "protocol-buffers", "priority": -1, "content": "Copyright \u00a9 2014, Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \u201cAS IS\u201d AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Code generated by the Protocol Buffer compiler is owned by the owner of the input file used when generating it. This code is not standalone and requires a support library to be linked with it. This support library is itself covered by the above license.", "keywords": []}, {"id": 15, "doc_id": 18, "filename": "CopyrightAndLicenses/index.html", "domain_name": "page", "name": "CopyrightAndLicenses/index#the-mesa-3d-graphics-library", "display_name": "The Mesa 3D Graphics Library", "type": "section", "display_type": "Page section", "docname": "CopyrightAndLicenses/index", "anchor": "the-mesa-3d-graphics-library", "priority": -1, "content": "Copyright (C) 1999-2007 Brian Paul All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \u201cSoftware\u201d), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \u201cAS IS\u201d, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", "keywords": []}, {"id": 16, "doc_id": 18, "filename": "CopyrightAndLicenses/index.html", "domain_name": "page", "name": "CopyrightAndLicenses/index#xxhash", "display_name": "xxHASH", "type": "section", "display_type": "Page section", "docname": "CopyrightAndLicenses/index", "anchor": "xxhash", "priority": -1, "content": "Copyright \u00a9 2012-2014, Yann Collet. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \u201cAS IS\u201d AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.", "keywords": []}, {"id": 17, "doc_id": 18, "filename": "CopyrightAndLicenses/index.html", "domain_name": "page", "name": "CopyrightAndLicenses/index#yaml-cpp", "display_name": "yaml-cpp", "type": "section", "display_type": "Page section", "docname": "CopyrightAndLicenses/index", "anchor": "yaml-cpp", "priority": -1, "content": "Copyright \u00a9 2008-2015 Jesse Beder. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \u201cSoftware\u201d), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \u201cAS IS\u201d, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", "keywords": []}, {"id": 18, "doc_id": 18, "filename": "CopyrightAndLicenses/index.html", "domain_name": "std", "name": "CopyrightAndLicenses/index", "display_name": "Copyright and Licenses", "type": "doc", "display_type": "Page", "docname": "CopyrightAndLicenses/index", "anchor": "", "priority": -1, "content": "Nsight Compute Copyright and Licenses. Information on the NVIDIA Software License Agreement as well as third party software and tools used by Nsight Compute.", "keywords": []}, {"id": 19, "doc_id": 43, "filename": "CustomizationGuide/index.html", "domain_name": "page", "name": "CustomizationGuide/index#basic-usage", "display_name": "Basic Usage", "type": "section", "display_type": "Page section", "docname": "CustomizationGuide/index", "anchor": "basic-usage", "priority": -1, "content": "In order to be able to import ncu_report you will either have to navigate to the extras/python directory, or add its absolute path to the PYTHONPATH environment variable. Then, the module can be imported like any Python module: >>> import ncu_report Importing a report Once the module is imported, you can load a report file by calling the load_report function with the path to the file. This function returns an object of type IContext which holds all the information concerning that report. >>> my_context = ncu_report.load_report("my_report.ncu-rep") Querying ranges When working with the Python module, kernel profiling results are grouped into ranges which are represented by IRange objects. You can inspect the number of ranges contained in the loaded report by calling the num_ranges() member function of an IContext object and retrieve a range by its index using range_by_idx(index) . >>> my_context.num_ranges() 1 >>> my_range = my_context.range_by_idx(0) Querying actions Inside a range , kernel profiling results are called actions . You can query the number of actions contained in a given range by using the num_actions method of an IRange object. >>> my_range.num_actions() 2 In the same way ranges can be obtained from an IContext object by using the range_by_idx(index) method, individual actions can be obtained from IRange objects by using the action_by_idx(index) method. The resulting actions are represented by the IAction class. >>> my_action = my_range.action_by_idx(0) As mentioned previously, an action represents a single kernel profiling result. To query the kernel\u2019s name you can use the name() member function of the IAction class. >>> my_action.name() MyKernel Querying metrics To get a tuple of all metric names contained within an action you can use the metric_names() method. It is meant to be combined with the metric_by_name() method which returns an IMetric object. However, for the same task you may also use the [] operator, as explained in the High-Level Interface section below. The metric names displayed here are the same as the ones you can use with the --metrics flag of NVIDIA Nsight Compute. Once you have extracted a metric from an action , you can obtain its value by using one of the following three methods: as_string() to obtain its value as a Python str as_uint64() to obtain its value as a Python int as_double() to obtain its value as a Python float For example, to print the display name of the GPU on which the kernel was profiled you can query the device__attribute_display_name metric. >>> display_name_metric = my_action.metric_by_name('device__attribute_display_name') >>> display_name_metric.as_string() 'NVIDIA GeForce RTX 3060 Ti' Note that accessing a metric with the wrong type can lead to unexpected (conversion) results. >>> display_name_metric.as_double() 0.0 Therefore, it is advisable to directly use the High-Level function value() , as explained below.", "keywords": []}, {"id": 20, "doc_id": 43, "filename": "CustomizationGuide/index.html", "domain_name": "page", "name": "CustomizationGuide/index#counter-domains", "display_name": "Counter Domains", "type": "section", "display_type": "Page section", "docname": "CustomizationGuide/index", "anchor": "counter-domains", "priority": -1, "content": "PM sampling metrics are composed of one or more raw counter dependencies internally. Each counter is associated with a counter domain , which describes how and where in the hardware the counter is collected. For metrics specified in section files, the automatic domain selection can be overwritten when needed to form more optimal PM sampling metric groups. Metrics { Label: "Short Scoreboard" Name: "pmsampling:smsp__warps_issue_stalled_short_scoreboard.avg" Groups: "sampling_ws4" CtrDomains: "gpu_sm_c" } Note that the CtrDomains field is currently only supported for the section Metrics field, but not for individual Options .", "keywords": []}, {"id": 21, "doc_id": 43, "filename": "CustomizationGuide/index.html", "domain_name": "page", "name": "CustomizationGuide/index#derived-metrics", "display_name": "Derived Metrics", "type": "section", "display_type": "Page section", "docname": "CustomizationGuide/index", "anchor": "derived-metrics", "priority": -1, "content": "Derived Metrics allow you to define new metrics composed of constants or existing metrics directly in a section file. The new metrics are computed at collection time and added permanently to the profile result in the report. They can then subsequently be used for any tables, charts, rules, etc. NVIDIA Nsight Compute currently supports the following syntax for defining derived metrics in section files: MetricDefinitions { MetricDefinitions { Name: "derived_metric_name" Expression: "derived_metric_expr" } MetricDefinitions { ... } ... } The actual metric expression is defined as follows: derived_metric_expr ::= operand operator operand operator ::= + | - | * | / operand ::= metric | constant metric ::= (an existing metric name) constant ::= double | uint64 double ::= (double-precision number of the form "N.(M)?", e.g. "5." or "0.3109") uint64 ::= (64-bit unsigned integer number of the form "N", e.g. "2029") Operators are defined as follows: For op in (+ | - | *): For each element in a metric it is applied to, the expression left-hand side op-combined with expression right-hand side. For op in (/): For each element in a metric it is applied to, the expression left-hand side op-combined with expression right-hand side. If the right-hand side operand is of integer-type, and 0, the result is the left-hand side value. Since metrics can contain regular values and/or instanced values , elements are combined as below. Constants are treated as metrics with only a regular value. 1. Regular values are operator-combined. a + b 2. If both metrics have no correlation ids, the first N values are operator-combined, where N is the minimum of the number of elements in both metrics. a1 + b1 a2 + b2 a3 a4 3. Else if both metrics have correlation ids, the sets of correlation ids from both metrics are joined and then operator-combined as applicable. a1 + b1 a2 b3 a4 + b4 b5 4. Else if only the left-hand side metric has correlation ids, the right-hand side regular metric value is operator-combined with every element of the left-hand side metric. a1 + b a2 + b a3 + b 5. Else if only the right-hand side metric has correlation ids, the right-hand side element values are operator-combined with the regular metric value of the left-hand side metric. a + b1 + b2 + b3 In all operations, the value kind of the left-hand side operand is used. If the right-hand side operand has a different value kind, it is converted. If the left-hand side operand is a string-kind, it is returned unchanged. Examples for derived metrics are derived__avg_thread_executed , which provides a hint on the number of threads executed on average at each instruction, and derived__uncoalesced_l2_transactions_global , which indicates the ratio of actual L2 transactions vs. ideal L2 transactions at each applicable instruction. MetricDefinitions { MetricDefinitions { Name: "derived__avg_thread_executed" Expression: "thread_inst_executed_true / inst_executed" } MetricDefinitions { Name: "derived__uncoalesced_l2_transactions_global" Expression: "memory_l2_transactions_global / memory_ideal_l2_transactions_global" } MetricDefinitions { Name: "sm__sass_thread_inst_executed_op_ffma_pred_on_x2" Expression: "sm__sass_thread_inst_executed_op_ffma_pred_on.sum.peak_sustained * 2" } }", "keywords": []}, {"id": 22, "doc_id": 43, "filename": "CustomizationGuide/index.html", "domain_name": "page", "name": "CustomizationGuide/index#high-level-interface", "display_name": "High-Level Interface", "type": "section", "display_type": "Page section", "docname": "CustomizationGuide/index", "anchor": "high-level-interface", "priority": -1, "content": "On top of the low-level NvRules API the Python Report Interface also implements part of the Python object model . By implementing special methods, the Python Report Interface\u2019s exposed classes can be used with built-in Python mechanisms such as iteration, string formatting and length querying. This allows you to access metrics objects via the self[key] instance method of the IAction class: >>> display_name_metric = my_action["device__attribute_display_name"] There is also a convenience method IMetric.value() which allows you to query the value of a metric object without knowledge of its type: >>> display_name_metric.value() 'NVIDIA GeForce RTX 3060 Ti' All the available methods of a class, as well as their associated Python docstrings, can be looked up interactively via >>> help(ncu_report.IMetric) or similarly for other classes and methods. In your code, you can access the docstrings via the __doc__ attribute, i.e. ncu_report.IMetric.value.__doc__ .", "keywords": []}, {"id": 23, "doc_id": 43, "filename": "CustomizationGuide/index.html", "domain_name": "page", "name": "CustomizationGuide/index#integration", "display_name": "Integration", "type": "section", "display_type": "Page section", "docname": "CustomizationGuide/index", "anchor": "integration", "priority": -1, "content": "The rule system is integrated into NVIDIA Nsight Compute as part of the profile report view. When you profile a kernel, available rules will be shown in the report\u2019s Details page. You can either select to apply all available rules at once by clicking Apply Rules at the top of the page, or apply rules individually. Once applied, the rule results will be added to the current report. By default, all rules are applied automatically. Section with a single Bottleneck rule available. The same section with the Bottleneck rule applied. It added a single message to the report. The section Rule has two associated rules, Basic Template Rule and Advanced Template Rule. The latter is not yet applied. Rules can add various UI elements, including warning and error messages as well as charts and tables. Some rules are applied independently from sections. They are shown under Independent Rules.", "keywords": []}, {"id": 24, "doc_id": 43, "filename": "CustomizationGuide/index.html", "domain_name": "page", "name": "CustomizationGuide/index#introduction", "display_name": "Introduction", "type": "section", "display_type": "Page section", "docname": "CustomizationGuide/index", "anchor": "introduction", "priority": -1, "content": "The goal of NVIDIA Nsight Compute is to design a profiling tool that can be easily extended and customized by expert users. While we provide useful defaults, this allows adapting the reports to a specific use case or to design new ways to investigate collected data. All the following is data driven and does not require the tools to be recompiled. While working with section files or rules files it is recommended to open the Metric Selection tool window from the Profile menu item. This tool window lists all sections and rules that were loaded. Rules are grouped as children of their associated section or grouped in the [Independent Rules] entry. For files that failed to load, the table shows the error message. Use the Reload button to reload rule files from disk.", "keywords": []}, {"id": 25, "doc_id": 43, "filename": "CustomizationGuide/index.html", "domain_name": "page", "name": "CustomizationGuide/index#metric-attributes", "display_name": "Metric attributes", "type": "section", "display_type": "Page section", "docname": "CustomizationGuide/index", "anchor": "metric-attributes", "priority": -1, "content": "Apart from the possibility to query the name() and value() of an IMetric object, you can also query the following additional metric attributes: metric_type() metric_subtype() rollup_operation() unit() description() The first method metric_type() returns one out of three enum values ( IMetric.MetricType_COUNTER , IMetric.MetricType_RATIO , IMetric.MetricType_THROUGHPUT ) if the metric is a hardware metric, or IMetric.MetricType_OTHER otherwise (e.g. for launch or device attributes). The method metric_subtype() returns an enum value representing the subtype of a metric (e.g. IMetric.MetricSubtype_PEAK_SUSTAINED , IMetric.MetricSubtype_PER_CYCLE_ACTIVE ). In case a metric does not have a subtype, None is returned. All available values (without the necessary IMetric.MetricSubtype_ prefix) may be found in the NvRules API documentation, or may be looked up interactively by executing help(ncu_report.IMetric) . IMetric.rollup_operation() returns the operation which is used to accumulate different values of the same metric and can be one of IMetric.RollupOperation_AVG , IMetric.RollupOperation_MAX , IMetric.RollupOperation_MIN or IMetric.RollupOperation_SUM for averaging, maximum, minimum or summation, respectively. If the metric in question does not specify a rollup operation None will be returned. Lastly, unit() and description() return a (possibly empty) string of the metric\u2019s unit and a short textual description for hardware metrics, respectively. The above methods can be combined to filter through all metrics of a report, given certain criteria: for metric in metrics: if metric.metric_type() == IMetric.MetricType_COUNTER and \\ metric.metric_subtype() == IMetric.MetricSubtype_PER_SECOND and \\ metric.rollup_operation() == IMetric.RollupOperation_AVG: print(f"{metric.name()}: {metric.value()} {metric.unit()}")", "keywords": []}, {"id": 26, "doc_id": 43, "filename": "CustomizationGuide/index.html", "domain_name": "page", "name": "CustomizationGuide/index#metric-options-and-filters", "display_name": "Metric Options and Filters", "type": "section", "display_type": "Page section", "docname": "CustomizationGuide/index", "anchor": "metric-options-and-filters", "priority": -1, "content": "Sections allow the user to specify alternative options for metrics that have a different metric name on different GPU architectures. Metric options use a min-arch/max-arch range filter , replacing the base metric with the first metric option for which the current GPU architecture matches the filter. While not strictly enforced, options for a base metric are expected to share the same meaning and subsequently unit, etc., with the base metric. In addition to its options, the base metric can be filtered by the same criteria. This is useful for metrics that are only available for certain architectures or in limited collection scopes. See ProfilerMetricOptions.proto for which filter options are available. In the below example, the metric dram__cycles_elapsed.avg.per_second is collected on SM 7.0 and SM 7.5-8.6, but not on any in between. It uses the same metric name on these architectures. Metrics { Label: "DRAM Frequency" Name: "dram__cycles_elapsed.avg.per_second" Filter { MaxArch: CC_70 } Options { Name: "dram__cycles_elapsed.avg.per_second" Filter { MinArch: CC_75 MaxArch: CC_86 } } } In the next example, the metric in the section header is only collected for launch-based collection scopes (i.e. kernel- and application replay for CUDA kernels or CUDA Graph nodes), but not in range-based scopes. Header { Metrics { Label: "Theoretical Occupancy" Name: "sm__maximum_warps_per_active_cycle_pct" Filter { CollectionFilter { CollectionScopes: CollectionScope_Launch } } } } Similarly, CollectionFilter s can be used to set the Importance of a metric, which specifies an expectation on its availability during data collection. Required metrics, for instance, are expected to be collectable and would generate an error in case they are not available, whereas Optional metrics would only generate a warning. Here is a minimal example, illustrating the functionality: Metrics { Label: "Compute (SM) Throughput" Name: "sm__throughput.avg.pct_of_peak_sustained_elapsed" Filter { CollectionFilter { Importance: Required } } } Filters can be applied to an entire section instead of or in addition to being set for individual metrics. If both types of filters are specified, they are combined, such that Metrics -scope filters take precedence over section-scope filters.", "keywords": []}, {"id": 27, "doc_id": 43, "filename": "CustomizationGuide/index.html", "domain_name": "page", "name": "CustomizationGuide/index#metric-sections", "display_name": "Metric Sections", "type": "section", "display_type": "Page section", "docname": "CustomizationGuide/index", "anchor": "metric-sections", "priority": -1, "content": "The Details page consists of sections that focus on a specific part of the kernel analysis each. Every section is defined by a corresponding section file that specifies the data to be collected as well as the visualization used in the UI or CLI output for this data. Simply modify a deployed section file to add or modify what is collected.", "keywords": []}, {"id": 28, "doc_id": 43, "filename": "CustomizationGuide/index.html", "domain_name": "page", "name": "CustomizationGuide/index#missing-sections", "display_name": "Missing Sections", "type": "section", "display_type": "Page section", "docname": "CustomizationGuide/index", "anchor": "missing-sections", "priority": -1, "content": "If new or updated section files are not used by NVIDIA Nsight Compute, it is most commonly one of two reasons: The file is not found: Section files must have the .section extension. They must also be on the section search path. The default search path is the sections directory within the installation directory. In NVIDIA Nsight Compute CLI, the search paths can be overwritten using the --section-folder and --section-folder-recursive options. In NVIDIA Nsight Compute, the search path can be configured in the Profile options. Syntax errors: If the file is found but has syntax errors, it will not be available for metric collection. However, error messages are reported for easier debugging. In NVIDIA Nsight Compute CLI, use the --list-sections option to get a list of error messages, if any. In NVIDIA Nsight Compute, error messages are reported in the Metric Selection tool window.", "keywords": []}, {"id": 29, "doc_id": 43, "filename": "CustomizationGuide/index.html", "domain_name": "page", "name": "CustomizationGuide/index#nvrules-api", "display_name": "NvRules API", "type": "section", "display_type": "Page section", "docname": "CustomizationGuide/index", "anchor": "nvrules-api", "priority": -1, "content": "The NvRules API is defined as a C/C++ style interface, which is converted to the NvRules.py Python module to be consumable by the rules. As such, C++ class interfaces are directly converted to Python classes und functions. See the NvRules API documentation for the classes and functions available in this interface.", "keywords": []}, {"id": 30, "doc_id": 43, "filename": "CustomizationGuide/index.html", "domain_name": "page", "name": "CustomizationGuide/index#nvtx-support", "display_name": "NVTX Support", "type": "section", "display_type": "Page section", "docname": "CustomizationGuide/index", "anchor": "nvtx-support", "priority": -1, "content": "The ncu_report has support for the NVIDIA Tools Extension (NVTX). This comes through the INvtxState object which represents the NVTX state of a profiled kernel. An INvtxState object can be obtained from an action by using its nvtx_state() method. It exposes the domains() method which returns a tuple of integers representing the domains this kernel has state in. These integers can be used with the domain_by_id(id) method to get an INvtxDomainInfo object which represents the state of a domain. The INvtxDomainInfo can be used to obtain a tuple of Push-Pop , or Start-End ranges using the push_pop_ranges() and start_end_ranges() methods. There is also a actions_by_nvtx member function in the IRange class which allows you to get a tuple of actions matching the NVTX state described in its parameter. The parameters for the actions_by_nvtx function are two lists of strings representing the state for which we want to query the actions. The first parameter describes the NVTX states to include while the second one describes the NVTX states to exclude. These strings are in the same format as the ones used with the --nvtx-include and --nvtx-exclude options.", "keywords": []}, {"id": 31, "doc_id": 43, "filename": "CustomizationGuide/index.html", "domain_name": "page", "name": "CustomizationGuide/index#python-report-interface", "display_name": "Python Report Interface", "type": "section", "display_type": "Page section", "docname": "CustomizationGuide/index", "anchor": "python-report-interface", "priority": -1, "content": "NVIDIA Nsight Compute features a Python-based interface to interact with exported report files. The module is called ncu_report and works on any Python version from 3.4 1 . It can be found in the extras/python directory of your NVIDIA Nsight Compute package. In order to use the Python module, you need a report file generated by NVIDIA Nsight Compute. You can obtain such a file by saving it from the graphical interface or by using the --export flag of the command line tool. The types and functions in the ncu_report module are a subset of the ones available in the NvRules API. The documentation in this section serves as a tutorial. For a more formal description of the exposed API, please refer to the the NvRules API documentation. 1 On Linux machines you will also need a GNU-compatible libc and libgcc_s.so .", "keywords": []}, {"id": 32, "doc_id": 43, "filename": "CustomizationGuide/index.html", "domain_name": "page", "name": "CustomizationGuide/index#report-file-format", "display_name": "Report File Format", "type": "section", "display_type": "Page section", "docname": "CustomizationGuide/index", "anchor": "report-file-format", "priority": -1, "content": "This section documents the internals of the profiler report files (reports in the following) as created by NVIDIA Nsight Compute. The file format is subject to change in future releases without prior notice.", "keywords": []}, {"id": 33, "doc_id": 43, "filename": "CustomizationGuide/index.html", "domain_name": "page", "name": "CustomizationGuide/index#rule-examples", "display_name": "Rule Examples", "type": "section", "display_type": "Page section", "docname": "CustomizationGuide/index", "anchor": "rule-examples", "priority": -1, "content": "The following example rule determines on which major GPU architecture a kernel was running. import NvRules def get_identifier(): return "GpuArch" def apply(handle): ctx = NvRules.get_context(handle) action = ctx.range_by_idx(0).action_by_idx(0) ccMajor = action.metric_by_name("device__attribute_compute_capability_major").as_uint64() ctx.frontend().message("Running on major compute capability " + str(ccMajor))", "keywords": []}, {"id": 34, "doc_id": 43, "filename": "CustomizationGuide/index.html", "domain_name": "page", "name": "CustomizationGuide/index#rule-file-api", "display_name": "Rule File API", "type": "section", "display_type": "Page section", "docname": "CustomizationGuide/index", "anchor": "rule-file-api", "priority": -1, "content": "The Rule File API is the implicit contract between the rule Python file and the tool. It defines which functions (syntactically and semantically) the Python file must provide to properly work as a rule. Mandatory Functions get_identifier() : Return the unique rule identifier string. apply(handle) : Apply this rule to the rule context provided by handle. Use NvRules.get_context(handle) to obtain the Context interface from handle. get_name() : Return the user-consumable display name of this rule. get_description() : Return the user-consumable description of this rule. Optional Functions get_section_identifier() : Return the unique section identifier that maps this rule to a section. Section-mapped rules will only be available if the corresponding section was collected. They implicitly assume that the metrics requested by the section are collected when the rule is applied. evaluate(handle) : Declare required metrics and rules that are necessary for this rule to be applied. Use NvRules.require_metrics(handle, [...]) to declare the list of metrics that must be collected prior to applying this rule. Use e.g. NvRules.require_rules(handle, [...]) to declare the list of other rules that must be available before applying this rule. Those are the only rules that can be safely proposed by the Controller interface.", "keywords": []}, {"id": 35, "doc_id": 43, "filename": "CustomizationGuide/index.html", "domain_name": "page", "name": "CustomizationGuide/index#rule-system", "display_name": "Rule System", "type": "section", "display_type": "Page section", "docname": "CustomizationGuide/index", "anchor": "rule-system", "priority": -1, "content": "NVIDIA Nsight Compute features a new Python-based rule system. It is designed as the successor to the Expert System (un)guided analysis in NVIDIA Visual Profiler, but meant to be more flexible and more easily extensible to different use cases and APIs.", "keywords": []}, {"id": 36, "doc_id": 43, "filename": "CustomizationGuide/index.html", "domain_name": "page", "name": "CustomizationGuide/index#rule-system-architecture", "display_name": "Rule System Architecture", "type": "section", "display_type": "Page section", "docname": "CustomizationGuide/index", "anchor": "rule-system-architecture", "priority": -1, "content": "The rule system consists of the Python interpreter, the NvRules C++ interface , the NvRules Python interface (NvRules.py) and a set of rule files. Each rule file is valid Python code that imports the NvRules.py module, adheres to certain standards defined by the Rule File API and is called to from the tool. When applying a rule, a handle to the rule Context is provided to its apply function. This context captures most of the functionality that is available to rules as part of the NvRules API . In addition, some functionality is provided directly by the NvRules module, e.g. for global error reporting. Finally, since rules are valid Python code, they can use regular libraries and language functionality that ship with Python as well. From the rule Context , multiple further objects can be accessed, e.g. the Frontend , Ranges and Actions . It should be noted that those are only interfaces, i.e. the actual implementation can vary from tool to tool that decides to implement this functionality. Naming of these interfaces is chosen to be as API-independent as possible, i.e. not to imply CUDA-specific semantics. However, since many compute and graphics APIs map to similar concepts, it can easily be mapped to CUDA terminology, too. A Range refers to a CUDA stream, an Action refers to a single CUDA kernel instance. Each action references several Metrics that have been collected during profiling (e.g. instructions executed ) or are statically available (e.g. the launch configuration). Metrics are accessed via their names from the Action . Each CUDA stream can contain any number of kernel (or other device activity) instances and so each Range can reference one or more Actions . However, currently only a single Action per Range will be available, as only a single CUDA kernel can be profiled at once. The Frontend provides an interface to manipulate the tool UI by adding messages, graphical elements such as line and bar charts or tables, as well as speedup estimations, focus metrics and source markers. The most common use case is for a rule to show at least one message, stating the result to the user, as illustrated in extras/RuleTemplates/BasicRuleTemplate.py This could be as simple as \u201cNo issues have been detected,\u201d or contain direct hints as to how the user could improve the code, e.g. \u201cMemory is more heavily utilized than Compute. Consider whether it is possible for the kernel to do more compute work.\u201d For more advanced use cases, such as adding speedup estimates, key performance indicators (a.k.a. focus metrics) or source markers to annotate individual lines of code to your rule, see the templates in extras/RuleTemplates .", "keywords": []}, {"id": 37, "doc_id": 43, "filename": "CustomizationGuide/index.html", "domain_name": "page", "name": "CustomizationGuide/index#sample-script", "display_name": "Sample Script", "type": "section", "display_type": "Page section", "docname": "CustomizationGuide/index", "anchor": "sample-script", "priority": -1, "content": "NVTX Push-Pop range filtering This is a sample script which loads a report and prints the names of all the profiled kernels which were wrapped inside BottomRange and TopRange Push-Pop ranges of the default NVTX domain. #!/usr/bin/env python3 import sys import ncu_report if len(sys.argv) != 2: print("usage: {} report_file".format(sys.argv[0]), file=sys.stderr) sys.exit(1) report = ncu_report.load_report(sys.argv[1]) for range_idx in range(report.num_ranges()): current_range = report.range_by_idx(range_idx) for action_idx in current_range.actions_by_nvtx(["BottomRange/*/TopRange"], []): action = current_range.action_by_idx(action_idx) print(action.name())", "keywords": []}, {"id": 38, "doc_id": 43, "filename": "CustomizationGuide/index.html", "domain_name": "page", "name": "CustomizationGuide/index#section-definition", "display_name": "Section Definition", "type": "section", "display_type": "Page section", "docname": "CustomizationGuide/index", "anchor": "section-definition", "priority": -1, "content": "Protocol buffer definitions are in the NVIDIA Nsight Compute installation directory under extras/FileFormat . To understand section files, start with the definitions and documentation in ProfilerSection.proto . To see the list of available PerfWorks metrics for any device or chip, use the --query-metrics option of the command line .", "keywords": []}, {"id": 39, "doc_id": 43, "filename": "CustomizationGuide/index.html", "domain_name": "page", "name": "CustomizationGuide/index#section-files", "display_name": "Section Files", "type": "section", "display_type": "Page section", "docname": "CustomizationGuide/index", "anchor": "section-files", "priority": -1, "content": "The section files delivered with the tool are stored in the sections sub-folder of the NVIDIA Nsight Compute install directory. Each section is defined in a separate file with the .section file extension. At runtime, the installed stock sections (and rules) are deployed to a user-writable directory. This can be disabled with an environment variable . Section files from the deployment directory are loaded automatically at the time the UI connects to a target application or the command line profiler is launched. This way, any changes to section files become immediately available in the next profile run. A section file is a text representation of a Google Protocol Buffer message. The full definition of all available fields of a section message is given in Section Definition . In short, each section consists of a unique Identifier (no spaces allowed), a Display Name , an optional Order value (for sorting the sections in the Details page ), an optional Description providing guidance to the user, an optional header table, an optional list of metrics to be collected but not displayed, optional bodies with additional UI elements, and other elements. See ProfilerSection.proto for the exact list of available elements. A small example of a very simple section is: Identifier: "SampleSection" DisplayName: "Sample Section" Description: "This sample section shows information on active warps and cycles." Header { Metrics { Label: "Active Warps" Name: "smsp__active_warps_avg" } Metrics { Label: "Active Cycles" Name: "smsp__active_cycles_avg" } } On data collection, this section will cause the two PerfWorks metrics smsp__active_warps_avg and smsp__active_cycles_avg to be collected. The section as shown on the Details page By default, when not available, metrics specified in section files will only generate a warning during data collection, and would then show up as \u201cN/A\u201d in the UI or CLI. This is in contrast to metrics requested via --metrics which would cause an error when not available. How to specify metrics as required for data collection is described in Metric Options and Filters . More advanced elements can be used in the body of a section. See the ProfilerSection.proto file for which elements are available. The following example shows how to use these in a slightly more complex example. The usage of regexes is allowed in tables and charts in the section Body only and follows the format regex: followed by the actual regex to match PerfWorks metric names. The supported list of metrics that can be used in sections can be queried using the command line interface with the --query-metrics option. Each of these metrics can be used in any section and will be automatically collected if they appear in any enabled section. Note that even if a metric is used in multiple sections, it will only be collected once. Look at all the shipped sections to see how they are implemented. Identifier: "SampleSection" DisplayName: "Sample Section" Description: "This sample section shows various metrics." Header { Metrics { Label: "Active Warps" Name: "smsp__active_warps_avg" } Metrics { Label: "Active Cycles" Name: "smsp__active_cycles_avg" } } Body { Items { Table { Label: "Example Table" Rows: 2 Columns: 1 Metrics { Label: "Avg. Issued Instructions Per Scheduler" Name: "smsp__inst_issued_avg" } Metrics { Label: "Avg. Executed Instructions Per Scheduler" Name: "smsp__inst_executed_avg" } } } Items { Table { Label: "Metrics Table" Columns: 2 Order: ColumnMajor Metrics { Name: "regex:.*__elapsed_cycles_sum" } } } Items { BarChart { Label: "Metrics Chart" CategoryAxis { Label: "Units" } ValueAxis { Label: "Cycles" } Metrics { Name: "regex:.*__elapsed_cycles_sum" } } } } The output of this section would look similar to this screenshot in the UI", "keywords": []}, {"id": 40, "doc_id": 43, "filename": "CustomizationGuide/index.html", "domain_name": "page", "name": "CustomizationGuide/index#source-counters", "display_name": "Source Counters", "type": "section", "display_type": "Page section", "docname": "CustomizationGuide/index", "anchor": "source-counters", "priority": -1, "content": "The Source page provides correlation of various metrics with CUDA-C, PTX and SASS source of the application, depending on availability. Which Source Counter metrics are collected and the order in which they are displayed in this page is controlled using section files, specifically using the ProfilerSectionMetrics message type. Each ProfilerSectionMetrics defines one ordered group of metrics, and can be assigned an optional Order value. This value defines the ordering among those groups in the Source page. This allows, for example, you to define a group of memory-related source counters in one and a group of instruction-related counters in another section file. Identifier: "SourceMetrics" DisplayName: "Custom Source Metrics" Metrics { Order: 2 Metrics { Label: "Instructions Executed" Name: "inst_executed" } Metrics { Label: "" Name: "collected_but_not_shown" } } If a Source Counter metric is given an empty label attribute in the section file, it will be collected but not shown on the page.", "keywords": []}, {"id": 41, "doc_id": 43, "filename": "CustomizationGuide/index.html", "domain_name": "page", "name": "CustomizationGuide/index#version-7-format", "display_name": "Version 7 Format", "type": "section", "display_type": "Page section", "docname": "CustomizationGuide/index", "anchor": "version-7-format", "priority": -1, "content": "Reports of version 7 are a combination of raw binary data and serialized Google Protocol Buffer version 2 messages (proto). All binary entries are stored as little endian. Protocol buffer definitions are in the NVIDIA Nsight Compute installation directory under extras/FileFormat . Offset [bytes] Entry Type Value 0 Magic Number Binary NVR\\0 4 Integer Binary sizeof(File Header) 8 File Header Proto Report version 8 + sizeof(File Header) Block 0 Mixed CUDA CUBIN source, profile results, session information 8 + sizeof(File Header) + sizeof(Block 0) Block 1 Mixed CUDA CUBIN source, profile results, session information \u2026 \u2026 \u2026 \u2026 Offset [bytes] Entry Type Value 0 Integer Binary sizeof(Block Header) 4 Block Header Proto Number of entries per payload type, payload size 4 + sizeof(Block Header) Block Payload Mixed Payload (CUDA CUBIN sources, profile results, session information, string table) Offset [bytes] Entry Type Value 0 Integer Binary sizeof(Payload type 1, entry 1) 4 Payload type 1, entry 1 Proto 4 + sizeof(Payload type 1, entry 1) Integer Binary sizeof(Payload type 1, entry 2) 8 + sizeof(Payload type 1, entry 1) Payload type 1, entry 2 Proto \u2026 \u2026 \u2026 \u2026 \u2026 Integer Binary sizeof(Payload type 2, entry 1) \u2026 Payload type 2, entry 1 Proto \u2026 \u2026 \u2026 \u2026 Notices Notices ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, \u201cMATERIALS\u201d) ARE BEING PROVIDED \u201cAS IS.\u201d NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. Information furnished is believed to be accurate and reliable. However, NVIDIA Corporation assumes no responsibility for the consequences of use of such information or for any infringement of patents or other rights of third parties that may result from its use. No license is granted by implication of otherwise under any patent rights of NVIDIA Corporation. Specifications mentioned in this publication are subject to change without notice. This publication supersedes and replaces all other information previously supplied. NVIDIA Corporation products are not authorized as critical components in life support devices or systems without express written approval of NVIDIA Corporation. Trademarks NVIDIA and the NVIDIA logo are trademarks or registered trademarks of NVIDIA Corporation in the U.S. and other countries. Other company and product names may be trademarks of the respective companies with which they are associated.", "keywords": []}, {"id": 42, "doc_id": 43, "filename": "CustomizationGuide/index.html", "domain_name": "page", "name": "CustomizationGuide/index#writing-rules", "display_name": "Writing Rules", "type": "section", "display_type": "Page section", "docname": "CustomizationGuide/index", "anchor": "writing-rules", "priority": -1, "content": "To create a new rule, you need to create a new text file with the extension .py and place it at some location that is detectable by the tool (see Nsight Compute Integration on how to specify the search path for rules). At a minimum, the rule file must implement two functions, get_identifier and apply . See Rule File API for a description of all functions supported in rule files. See NvRules for details on the interface available in the rule\u2019s apply function.", "keywords": []}, {"id": 43, "doc_id": 43, "filename": "CustomizationGuide/index.html", "domain_name": "std", "name": "CustomizationGuide/index", "display_name": "Customization Guide", "type": "doc", "display_type": "Page", "docname": "CustomizationGuide/index", "anchor": "", "priority": -1, "content": "Nsight Compute Customization Guide. User manual on customizing NVIDIA Nsight Compute tools or integrating them with custom workflows. Information on writing section files, rules for automatic result analysis and scripting access to report files.", "keywords": []}, {"id": 44, "doc_id": 44, "filename": "Notices/notices.html", "domain_name": "std", "name": "Notices/notices", "display_name": "", "type": "doc", "display_type": "Page", "docname": "Notices/notices", "anchor": "", "priority": -1, "content": "Notices Notices ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, \u201cMATERIALS\u201d) ARE BEING PROVIDED \u201cAS IS.\u201d NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. Information furnished is believed to be accurate and reliable. However, NVIDIA Corporation assumes no responsibility for the consequences of use of such information or for any infringement of patents or other rights of third parties that may result from its use. No license is granted by implication of otherwise under any patent rights of NVIDIA Corporation. Specifications mentioned in this publication are subject to change without notice. This publication supersedes and replaces all other information previously supplied. NVIDIA Corporation products are not authorized as critical components in life support devices or systems without express written approval of NVIDIA Corporation. Trademarks NVIDIA and the NVIDIA logo are trademarks or registered trademarks of NVIDIA Corporation in the U.S. and other countries. Other company and product names may be trademarks of the respective companies with which they are associated.", "keywords": []}, {"id": 45, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#acceleration-structure-viewer", "display_name": "Acceleration Structure Viewer", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "acceleration-structure-viewer", "priority": -1, "content": "The Acceleration Structure Viewer allows inspection of acceleration structures built using the OptiX API. In modern ray tracing APIs like OptiX, acceleration structures are data structures describing the rendered scene\u2019s geometries that will be intersected when performing ray tracing operations. More information concerning acceleration structures can be found in the OptiX programming guide . It is the responsibility of the user to set these up and pass them to the OptiX API which translates them to internal data structures that perform well on modern GPUs. The description created by the user can be very error-prone and it is sometimes hard to understand why the rendered result is not as expected. The Acceleration Structure Viewer is a component allowing OptiX users to inspect the acceleration structures they build before launching a ray tracing pipeline. The Acceleration Structure Viewer is opened through a button in the Resources window. The button will only be available when the currently viewed resource is OptiX: TraversableHandles . It opens the currently selected handle. The viewer is multi-paned: it shows a hierarchical view of the acceleration structure on the left, a graphical view of the acceleration structure in the middle, and controls and options on the right. In the hierarchical tree view on the left of the viewer the instance acceleration structures (IAS) , geometry acceleration structures (GAS) , child instances and child geometries are shown. In addition to this, some general properties for each of them is shown such as their primitive count, surface area and size on the device. In the hierarchical view on the left of the Acceleration Structure Viewer , the following information is displayed where applicable. Column Description Name An identifier for each row in the hierarchy. Click on the check box next to the name to show or hide the selected geometry or hierarchy. Double-click on this entry to jump to the item in the rendering view. # Prims The number of primitives that make up this acceleration structure. Surface Area A calculation of the total surface area for the AABB that bounds the particular entry. Size The size of the output buffer on the device holding this acceleration structure . Performance analysis tools are accessible in the bottom left corner on the main view. These tools help identify potential performance problems that are outlined in the RTX Ray Tracing Best Practices Guide . These analysis tools aim to give a broad picture of acceleration structures that may exhibit sub-optimal performance. To find the most optimal solution, profiling and experimentation is recommended but these tools may paint a better picture as to why one structure performs poorly compared to another. Action Description Instance Overlaps Identifies instance AABBs that overlap with other instances in 3D. Consider merging GASes when instance world-space AABBs overlap significantly to potentially increase performance. Instance Heatmap This allows you to set the threshold used by the AABB heatmap rendered in the visualizer.", "keywords": []}, {"id": 46, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#analysis", "display_name": "Analysis", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "analysis", "priority": -1, "content": "Guided Analysis All trace-based analysis is now covered by NVIDIA Nsight Systems . This means that NVIDIA Nsight Compute does not include analysis regarding concurrent CUDA streams or (for example) UVM events. For per-kernel analysis, NVIDIA Nsight Compute provides recommendations based on collected performance data on the Details Page . These rules currently require you to collect the required metrics via their sections up front, and do not support partial on-demand profiling. To use the rule-based recommendations, enable the respective rules in the Metric Selection . Before profiling, enable Apply Rules in the Profile Options , or click the Apply Rules button in the report afterward. Unguided Analysis All trace-based analysis is now covered by Nsight Systems. For per-kernel analysis, Python-based rules provide analysis and recommendations. See Guided Analysis above for more details. PC Sampling View Source-correlated PC sampling information can now be viewed in the Source Page . Aggregated warp states are shown on the Details Page in the Warp State Statistics section. Memory Statistics Memory Statistics are located on the Details Page . Enable the Memory Workload Analysis sections to collect the respective information. NVLink View NVLink topology diagram and NVLink property table are located on the Details Page . Enable the NVLink Topology and NVLink Table sections to collect the respective information. Refer to the Known Issues section for the limitations related to NVLink. Source-Disassembly View Source correlated with PTX and SASS disassembly is shown on the Source Page . Which information is available depends on your application\u2019s compilation/JIT flags. GPU Details View NVIDIA Nsight Compute does not automatically collect data for each executed kernel, and it does not collect any data for device-side memory copies. Summary information for all profiled kernel launches is shown on the Summary Page . Comprehensive information on all collected metrics for all profiled kernel launches is shown on the Raw Page . CPU Details View CPU callstack sampling is now covered by NVIDIA Nsight Systems . OpenACC Details View OpenACC performance analysis with NVIDIA Nsight Compute is available to limited extent. OpenACC parallel regions are not explicitly recognized, but CUDA kernels generated by the OpenACC compiler can be profiled as regular CUDA kernels. See the NVIDIA Nsight Systems release notes to check its latest support status. OpenMP Details View OpenMP performance analysis is not supported by NVIDIA Nsight Compute. See the NVIDIA Nsight Systems release notes to check its latest support status. Properties View NVIDIA Nsight Compute does not collect CUDA API and GPU activities and their properties. Performance data for profiled kernel launches is reported (for example) on the Details Page . Console View NVIDIA Nsight Compute does not currently collect stdout/stderr application output. Settings View Application launch settings are specified in the Connection Dialog . For reports collected from the UI, launch settings can be inspected on the Session Page after profiling. CPU Source View Source for CPU-only APIs is not available. Source for profiled GPU kernel launches is shown on the Source Page .", "keywords": []}, {"id": 47, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#api-statistics", "display_name": "API Statistics", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "api-statistics", "priority": -1, "content": "The API Statistics window is available when NVIDIA Nsight Compute is connected to a target application. It opens by default as soon as the connection is established. It can be re-opened using Debug > API Statistics from the main menu. Whenever the target application is suspended, it shows a summary of tracked API calls with some statistical information, such as the number of calls, their total, average, minimum and maximum duration. Note that this view cannot be used as a replacement for Nsight Systems when trying to optimize CPU performance of your application. The Reset button deletes all statistics collected to the current point and starts a new collection. Use the Export to CSV button to export the current statistics to a CSV file.", "keywords": []}, {"id": 48, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#api-stream", "display_name": "API Stream", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "api-stream", "priority": -1, "content": "The API Stream window is available when NVIDIA Nsight Compute is connected to a target application. It opens by default as soon as the connection is established. It can be re-opened using Debug > API Stream from the main menu. Whenever the target application is suspended, the window shows the history of API calls and traced kernel launches. The currently suspended API call or kernel launch (activity) is marked with a yellow arrow. If the suspension is at a subcall, the parent call is marked with a green arrow. The API call or kernel is suspended before being executed. For each activity, further information is shown such as the kernel name or the function parameters ( Func Parameters ) and return value ( Func Return ). Note that the function return value will only become available once you step out or over the API call. Use the Current Thread dropdown to switch between the active threads. The dropdown shows the thread ID followed by the current API name. One of several options can be chosen in the trigger dropdown, which are executed by the adjacent >> button. Run to Next Kernel resumes execution until the next kernel launch is found in any enabled thread. Run to Next API Call resumes execution until the next API call matching Next Trigger is found in any enabled thread. Run to Next Range Start resumes execution until the next start of an active profiler range is found. Profiler ranges are defined by using the cu(da)ProfilerStart/Stop API calls. Run to Next Range Stop resumes execution until the next stop of an active profiler range is found. The API Level dropdown changes which API levels are shown in the stream. The Export to CSV button exports the currently visible stream to a CSV file.", "keywords": []}, {"id": 49, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#as-viewer-nav", "display_name": "Navigation", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "as-viewer-nav", "priority": -1, "content": "The Acceleration Structure Viewer supports multiple navigation modes. The navigation mode can be changed using the combo box in the camera controls pane, to the right of the rendering pane. The keyboard and mouse bindings for each mode are as follows: Binding Fly Camera Dolly Camera Orbit Camera WASD/Arrow Keys Move forward, backward, left, right Move forward, backward, left, right Track (Move up, down, left, right) E/Q Move up/down Move up/down n/a Z/C Increase/decrease field of view Increase/decrease field of view Increase/decrease field of view Shift/Ctrl Move faster/slower Move faster/slower Move faster/slower Mousewheel Zoom in/out Zoom in/out Zoom in/out LMB + Drag Rotate in place Rotate left/right, move forward/backward Rotate around the geometry RMB + Drag Zoom in/out Rotate in place Zoom in/out MMB + Drag Track (Move up, down, left, right) Track (Move up, down, left, right) Track (Move up, down, left, right) Alt Temporarily switch to Orbit Camera Temporarily switch to Orbit Camera n/a F/Double Click Focus on the selected geometry Focus on the selected geometry Focus on the selected geometry Based on the coordinate system of the input geometry, you may need to change the Up Direction setting to Z-Axis or the Coordinates setting to RHS. To reset the camera to its original location, click Reset Camera . There are also a selection of Camera Controls for fast and precise navigation. To save a position, use the bookmarks controls. Each node within the acceleration structure hierarchy can also be double-clicked to quickly navigate to that location.", "keywords": []}, {"id": 50, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#baselines", "display_name": "Baselines", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "baselines", "priority": -1, "content": "The Baselines tool window can be opened by clicking the Baselines entry in the Profile menu. It provides a centralized place from which to manage configured baselines. (Refer to Baselines , for information on how to create baselines from profile results.) The baseline visibility can be controlled by clicking on the check box in a table row. When the check box is checked, the baseline will be visible in the summary header as well as all graphs in all sections. When unchecked the baseline will be hidden and will not contribute to metric difference calculations. The baseline color can be changed by double-clicking on the color swatch in the table row. The color dialog which is opened provides the ability to choose an arbitrary color as well as offers a palette of predefined colors associated with the stock baseline color rotation. The baseline name can be changed by double-clicking on the Name column in the table row. The name must not be empty and must be less than the Maximum Baseline Name Length as specified in the options dialog. The z-order of a selected baseline can be changed by clicking the Move Baseline Up and Move Baseline Down buttons in the tool bar. When a baseline is moved up or down its new position will be reflected in the report header as well as in each graph. Currently, only one baseline may be moved at a time. The selected baselines may be removed by clicking on the Clear Selected Baselines button in the tool bar. All baselines can be removed at once by clicking on the Clear All Baselines button, from either the global tool bar or the tool window tool bar. The configured baselines can be saved to a file by clicking on the Save Baselines button in the tool bar. By default baseline files use the .ncu-bln extension. Baseline files can be opened locally and/or shared with other users. Baseline information can be loaded by clicking on the Load Baselines button in the tool bar. When a baseline file is loaded, currently configured baselines will be replaced. A dialog will be presented to the user to confirm this operation when necessary. Differences between the current result and the baselines can be visualized with graphical bars for metrics in Details page section headers. Use the Difference Bars drop down to select the visualization mode. Bars are extending from left to right and have a fixed maximum.", "keywords": []}, {"id": 51, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#body", "display_name": "Body", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "body", "priority": -1, "content": "The body of this tool window displays a table with sub-launch-specific metrics. This table has four columns: Metric Name : the name of the metric Metric Unit : the unit for metric values Instance Value : the value of this metric for the selected sub-launch Aggregate Value : the aggregate value for this metric over all sub-launches in the selected result", "keywords": []}, {"id": 52, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#call-stack-nvtx-page", "display_name": "Call Stack / NVTX Page", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "call-stack-nvtx-page", "priority": -1, "content": "The CPU Call Stack section of this report page shows the CPU call stack for the executing CPU thread at the time the kernel was launched. For this information to show up in the profiler report, the option to collect CPU call stacks had to be enabled in the Connection Dialog or using the corresponding NVIDIA Nsight Compute CLI command line parameter. The NVTX State section of this report page shows the NVTX context when the kernel was launched. All thread-specific information is with respect to the thread of the kernel\u2019s launch API call. Note that NVTX information is only collected if the profiler is started with NVTX support enabled, either in the Connection Dialog or using the NVIDIA Nsight Compute CLI command line parameter.", "keywords": []}, {"id": 53, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#command-line-arguments", "display_name": "Command Line Arguments", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "command-line-arguments", "priority": -1, "content": "Please execute ncu-ui with the -h parameter within a shell window to see the currently supported command line arguments for the NVIDIA Nsight Compute UI. To open a collected profile report with ncu-ui, simply pass the path to the report file as a parameter to the shell command.", "keywords": []}, {"id": 54, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#comments-page", "display_name": "Comments Page", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "comments-page", "priority": -1, "content": "The Comments page aggregates all section comments in a single view and allows the user to edit those comments on any launch instance or section, as well as on the overall report. Comments are persisted with the report. If a section comment is added, the comment icon of the respective section in the Details Page will be highlighted.", "keywords": []}, {"id": 55, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#connection", "display_name": "Connection", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "connection", "priority": -1, "content": "Connection properties are grouped into Target Connection Options and Host Connection Properties .", "keywords": []}, {"id": 56, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#connection-dialog", "display_name": "Connection Dialog", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "connection-dialog", "priority": -1, "content": "Use the Connection Dialog to launch and attach to applications on your local and remote platforms. Start by selecting the Target Platform for profiling. By default (and if supported) your local platform will be selected. Select the platform on which you would like to start the target application or connect to a running process. When using a remote platform, you will be asked to select or create a Connection in the top drop down. To create a new connection, select + and enter your connection details. When using the local platform, localhost will be selected as the default and no further connection settings are required. You can still create or select a remote connection, if profiling will be on a remote system of the same platform. Depending on your target platform, select either Launch or Remote Launch to launch an application for profiling on the target. Note that Remote Launch will only be available if supported on the target platform. Fill in the following launch details for the application: Application Executable: Specifies the root application to launch. Note that this may not be the final application that you wish to profile. It can be a script or launcher that creates other processes. Working Directory: The directory in which the application will be launched. Command Line Arguments: Specify the arguments to pass to the application executable. Environment: The environment variables to set for the launched application. Select Attach to attach the profiler to an application already running on the target platform. This application must have been started using another NVIDIA Nsight Compute CLI instance. The list will show all application processes running on the target system which can be attached. Select the refresh button to re-create this list. Finally, select the Activity to be run on the target for the launched or attached application. Note that not all activities are necessarily compatible with all targets and connection options. Currently, the following activities exist: Interactive Profile Activity Profile Activity System Trace Activity Occupancy Calculator", "keywords": []}, {"id": 57, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#details-page", "display_name": "Details Page", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "details-page", "priority": -1, "content": "Overview The Details page is the main page for all metric data collected during a kernel launch. The page is split into individual sections. Each section consists of a header table and an optional body that can be expanded. The sections are completely user defined and can be changed easily by updating their respective files. For more information on customizing sections, see the Customization Guide . For a list of sections shipped with NVIDIA Nsight Compute, see Sections and Rules . By default, once a new profile result is collected, all applicable rules are applied. Any rule results will be shown as Recommendations on this page. Most rule results will contain an optimization advice along with an estimate of the improvement that could be achieved when successfully implementing this advice. Other rule results will be purely informative or have a warning icon to indicate a problem that occurred during execution (e.g., an optional metric that could not be collected). Results with error icons typically indicate an error while applying the rule. Estimates of potential improvement are shown below the rule result\u2019s name and exist in two types. Global estimates (\u201cEst. Speedup\u201d) are an approximation of the decrease in workload runtime, whereas local estimates (\u201cEst. Local Speedup\u201d) are an approximation of the increase in efficiency of the hardware utilization of the particular performance problem the rule addresses. Rule results often point out performance problems and guide through the analysis process. If a rule result references another report section, it will appear as a link in the recommendation. Select the link to scroll to the respective section. If the section was not collected in the same profile result, enable it in the Metric Selection tool window. You can add or edit comments in each section of the Details view by clicking on the comment button (speech bubble). The comment icon will be highlighted in sections that contain a comment. Comments are persisted in the report and are summarized in the Comments Page . Use the Comments button to annotate sections. Besides their header, sections typically have one or more bodies with additional charts or tables. Click the triangle Expander icon in the top-left corner of each section to show or hide those. If a section has multiple bodies, a dropdown in their top-right corner allows you to switch between them. Sections with multiple bodies have a dropdown to switch between them. Memory If enabled, the Memory Workload Analysis section contains a Memory chart that visualizes data transfers, cache hit rates, instructions and memory requests. More information on how to use and read this chart can be found in the Kernel Profiling Guide . Occupancy You can open the Occupancy Calculator by clicking on the calculator button in the report header or in the header of the Occupancy Section . Range Replay Note that for Range Replay results some UI elements, analysis rules, metrics or section body items such as charts or tables might not be available, as they only apply to kernel launch-based results. The filters can be checked in the corresponding section files. Rooflines If enabled, the GPU Speed Of Light Roofline Chart section contains a Roofline chart that is particularly helpful for visualizing kernel performance at a glance. (To enable roofline charts in the report, ensure that the section is enabled when profiling.) More information on how to use and read this chart can be found in Roofline Charts . NVIDIA Nsight Compute ships with several different definitions for roofline charts, including hierarchical rooflines. These additional rooflines are defined in different section files. While not part of the full section set, a new section set called roofline was added to collect and show all rooflines in one report. The idea of hierarchical rooflines is that they define multiple ceilings that represent the limiters of a hardware hierarchy. For example, a hierarchical roofline focusing on the memory hierarchy could have ceilings for the throughputs of the L1 cache, L2 cache and device memory. If the achieved performance of a kernel is limited by one of the ceilings of a hierarchical roofline, it can indicate that the corresponding unit of the hierarchy is a potential bottleneck. Sample roofline chart. The roofline chart can be zoomed and panned for more effective data analysis, using the controls in the table below. Zoom In Zoom Out Zoom Reset Pan Click the Zoom In button in the top right corner of the chart. Click the left mouse button and drag to create a rectangle that bounds the area of interest. Press the plus (+) key. Use Ctrl + MouseWheel (Windows and Linux only) Click the Zoom Out button in the top right corner of the chart. Click the right mouse button. Press the minus (-) key. Use Ctrl + MouseWheel (Windows and Linux only) Click the Zoom Reset button in the top right corner of the chart. Press the Escape (Esc) key. Use Ctrl (Command on Mac) + LeftMouseButton to grab the chart, then move the mouse. Use the cursor keys. Source Sections such as Source Counters can contain source hot spot tables. These tables indicate the N highest or lowest values of one or more metrics in your kernel source code. Select the location links to navigate directly to this location in the Source Page . Hover the mouse over a value to see which metrics contribute to it. Hot spot tables point out performance problems in your source. Timelines When collecting metrics with PM sampling , they can be viewed in a timeline . The timeline shows metrics selected in the respective section file or on the command line with their labels/names and their values over time. Different metrics may be collected in different passes (replays) of the workload, as only a limited number of them can be sampled in the same pass. Context switch trace is used to filter the collected data to only include samples from the profiled contexts and to align it in the timeline. You can hover the mouse over a metric row label to see further information on the metrics in the row. Hovering over a sample on the timeline shows the metric values at that timestamp within the current row. With the Metric Details tool window open, click to select a value on the timeline and show the metric and all its raw timestamps (absolute and relative) correlated values in the tool window. You can also use the Metric Details tool window to inspect profiler metrics generated during PM sampling. These provide information about the used sampling intervals, buffer sizes, dropped samples and other properties for each collection pass. A detailed list can be found in the metrics reference . The timeline has a context menu for further actions regarding copying content and zooming. In addition, the Enable/Disable Context Switch Filter option can be used to enable or disable the filtering of the timeline data with context switch information, if it is available. When the context switch filter is enabled (the default), samples from each pass group are only shown for the active contexts. When the context switch filter is disabled, the raw collected sampling data is shown along with a separate row for each pass group\u2019s context switch trace. When the context menu option is not available, the report does not include context switch trace data. In this case, the option Enable/Disable Trim Filter is shown instead, which, when enabled, tries to align based on the first non-zero value in any sampling metric in this pass group. However, this fallback does not take into account actual context switches.", "keywords": []}, {"id": 58, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#environment", "display_name": "Environment", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "environment", "priority": -1, "content": "Name Description Values Color Theme The currently selected UI color theme. Dark (Default) Light Mixed DPI Scaling Disable Mixed DPI Scaling if unwanted artifacts are detected when using monitors with different DPIs. Auto (Default) Off Default Document Folder Directory where documents unassociated with a project will be saved. At Startup What to do when NVIDIA Nsight Compute is launched. Show welcome page (Default) Show quick launch dialog Load last project Show empty environment Show version update notifications Show notifications when a new version of this product is available. Yes (Default) No", "keywords": []}, {"id": 59, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#exporting", "display_name": "Exporting", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "exporting", "priority": -1, "content": "The data displayed in the acceleration structure viewer document can be saved to file. Exporting an Acceleration Structure Viewer document allows for persisting the data you have collected beyond the immediate analysis session. This capability is particularly valuable for comparing different revisions of your geometry or sharing with others. Bookmarks are persisted as well.", "keywords": []}, {"id": 60, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#filtering-and-highlighting", "display_name": "Filtering and Highlighting", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "filtering-and-highlighting", "priority": -1, "content": "The acceleration structure view supports acceleration structure filtering as well as highlighting of data matching particular characteristics. The checkboxes next to each geometry allow users to toggle the rendering of each traversable. Geometry instances can also be selected by clicking on them in the main graphical view. Additionally, right clicking in the main graphical view gives options to hide or show all geometry, hide the selected geometry, or hide all but the selected geometry. Beyond filtering, the view also supports highlight-based identification of geometry specified with particular flags. Checking each highlight option will identify those resources matching that flag, colorizing for easy identification. Clicking an entry in this section will dim all geometry that does not meet the filter criteria allowing items that match the filter to standout. Selecting multiple filters requires the passing geometry to meet all selected filters (e.g., AND logic). Additionally, the heading text will be updated to reflect the number of items that meet this filter criteria.", "keywords": []}, {"id": 61, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#gpu-data", "display_name": "GPU Data", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "gpu-data", "priority": -1, "content": "The GPU Data shows the properties of all supported devices. GPU Data", "keywords": []}, {"id": 62, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#graphs", "display_name": "Graphs", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "graphs", "priority": -1, "content": "The graphs show the occupancy for your chosen block size as a blue circle, and for all other possible block sizes as a line graph. Graphs", "keywords": []}, {"id": 63, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#graphviz-dot-and-svg-exports", "display_name": "Graphviz DOT and SVG exports", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "graphviz-dot-and-svg-exports", "priority": -1, "content": "Some of the shown Resources can also be exported to GraphViz DOT or SVG* files using the Export to GraphViz or Export to SVG buttons. When exporting OptiX traversable handles , the traversable graph node types will be encoded using shapes and colors as described in the following table. Node Type Shape Color IAS Hexagon #8DD3C7 Triangle GAS Box #FFFFB3 AABB GAS Box #FCCDE5 Curve GAS Box #CCEBC5 Sphere GAS Box #BEBADA Static Transform Diamond #FB8072 SRT Transform Diamond #FDB462 Matrix Motion Transform Diamond #80B1D3 Error Paralellogram #D9D9D9", "keywords": []}, {"id": 64, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#header", "display_name": "Header", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "header", "priority": -1, "content": "On the left side of its header, this tool window displays the selected result\u2019s name and the number of sub-launches it is comprised of. The right side contains a combo box that allows selection of the sub-launch the body should represent. Each element of the combo box contains an index for the sub-launch as well as the name of the function that it launched if available.", "keywords": []}, {"id": 65, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#host-connection-properties", "display_name": "Host Connection Properties", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "host-connection-properties", "priority": -1, "content": "The Host Connection Properties determine how the command line profiler will connect to the host application during a Profile Activity . This connection is used to transfer profile information to the host during the profile session. Name Description Values Base Port Base port used to establish a connection from the command line profiler to the host application during a Profile activity (both local and remote). 1-65535 (Default: 50152) Maximum Ports Maximum number of ports to try (starting from Base Port ) when attempting to connect to the host application. 1-100 (Default: 10)", "keywords": []}, {"id": 66, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#id2", "display_name": "Interactive Profile Activity", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "id2", "priority": -1, "content": "The Interactive Profile activity allows you to initiate a session that controls the execution of the target application, similar to a debugger. You can step API calls and workloads (CUDA kernels), pause and resume, and interactively select the kernels of interest and which metrics to collect. This activity does currently not support profiling or attaching to child processes. Enable CPU Call Stack Collect the CPU-sided Call Stack at the location of each profiled kernel launch. Enable NVTX Support Collect NVTX information provided by the application or its libraries. Required to support stepping to specific NVTX contexts. Disable Profiling Start/Stop Ignore calls to cu(da)ProfilerStart or cu(da)ProfilerStop made by the application. Enable Profiling From Start Enables profiling from the application start. Disabling this is useful if the application calls cu(da)ProfilerStart and kernels before the first call to this API should not be profiled. Note that disabling this does not prevent you from manually profiling kernels. Cache Control Control the behavior of the GPU caches during profiling. Allowed values: For Flush All , all GPU caches are flushed before each kernel replay iteration during profiling. While metric values in the execution environment of the application might be slightly different without invalidating the caches, this mode offers the most reproducible metric results across the replay passes and also across multiple runs of the target application. For Flush None , no GPU caches are flushed during profiling. This can improve performance and better replicates the application behavior if only a single kernel replay pass is necessary for metric collection. However, some metric results will vary depending on prior GPU work, and between replay iterations. This can lead to inconsistent and out-of-bounds metric values. Clock Control Control the behavior of the GPU clocks during profiling. Allowed values: For Base , GPC and memory clocks are locked to their respective base frequency during profiling. This has no impact on thermal throttling. For None , no GPC or memory frequencies are changed during profiling. Import Source Enables permanently importing available source files into the report. Missing source files are searched in Source Lookup folders. Source information must be embedded in the executable, e.g. via the -lineinfo compiler option. Imported files are used in the CUDA-C view on the Source Page . Graph Profiling Set if CUDA graphs should be stepped and profiled as individual Nodes or as complete Graphs . See the Kernel Profiling Guide for more information on this mode.", "keywords": []}, {"id": 67, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#id3", "display_name": "Main Menu", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "id3", "priority": -1, "content": "File New Project Create new profiling Projects with the New Project Dialog . Open Project Open an existing profiling project. Recent Projects Open an existing profiling project from the list of recently used projects. Save Project Save the current profiling project. Save Project As Save the current profiling project with a new filename. Close Project Close the current profiling project. New File Create a new file. Open File Open an existing file. Open Remote File Download an existing file from a remote host and open it locally. The opened file will only exist in memory and will not be written to the local machine\u2019s disk unless the user explicitly saves it. For more information concerning the selection of a remote host to download the file from, see the section about Remote Connections . Only a subset of file types that are supported locally can be opened from a remote target. The following table lists file types that can be opened remotely. Extensions Description Supported ncu-rep Nsight Compute Profiler Report Yes ncu-occ Occupancy Calculator File Yes ncu-bvh OptiX AS Viewer File Yes (except on MacOSX) section Section Description No cubin Cubin File No cuh,h,hpp Header File No c,cpp,cu Source File No txt Text file No nsight-cuprof-report Nsight Compute Profiler Report (legacy) Yes Save Save the current file Save As Save a copy of the current file with a different name or type or in a different location. Save All Files Save all open files. Close Close the current file. Close All Files Close all open files. Recent Files Open an existing file from the list of recently used files. Exit Exit Nsight Compute. Connection Connect Open the Connection Dialog to launch or attach to a target application. Disabled when already connected. Disconnect Disconnect from the current target application, allows the application to continue normally and potentially re-attach. Terminate Disconnect from and terminate the current target application immediately. Debug Pause Pause the target application at the next intercepted API call or launch. Resume Resume the target application. Step In Step into the current API call or launch to the next nested call, if any, or the subsequent API call, otherwise. Step Over Step over the current API call or launch and suspend at the next, non-nested API call or launch. Step Out Step out of the current nested API call or launch to the next, non-parent API call or launch one level above. Freeze API When disabled, all CPU threads are enabled and continue to run during stepping or resume, and all threads stop as soon as at least one thread arrives at the next API call or launch. This also means that during stepping or resume the currently selected thread might change as the old selected thread makes no forward progress and the API Stream automatically switches to the thread with a new API call or launch. When enabled, only the currently selected CPU thread is enabled. All other threads are disabled and blocked. Stepping now completes if the current thread arrives at the next API call or launch. The selected thread never changes. However, if the selected thread does not call any further API calls or waits at a barrier for another thread to make progress, stepping may not complete and hang indefinitely. In this case, pause, select another thread, and continue stepping until the original thread is unblocked. In this mode, only the selected thread will ever make forward progress. Break On API Error When enabled, during resume or stepping, execution is suspended as soon as an API call returns an error code. Run to Next Kernel See API Stream tool window. Run to Next API Call See API Stream tool window. Run to Next Range Start See API Stream tool window. Run to Next Range End See API Stream tool window. API Statistics Opens the API Statistics tool window API Stream Opens the API Stream tool window Resources Opens the Resources tool window NVTX Opens the NVTX tool window Profile Profile Kernel When suspended at a kernel launch, select the profile using the current configuration. Profile Series When suspended at a kernel launch, open the Profile Series configuration dialog to setup and collect a series of profile results. Auto Profile Enable or disable auto profiling. If enabled, each kernel matching the current kernel filter (if any) will be profiled using the current section configuration. Baselines Opens the Baselines tool window. Clear Baselines Clear all current baselines. Import Source Permanently import resolved source files into the report. Existing content may be overwritten. Section/Rules Info Opens the Metric Selection tool window. Tools Project Explorer Opens the Project Explorer tool window. Output Messages Opens the Output Messages tool window. Options Opens the Options dialog. Window Save Window Layout Allows you to specify a name for the current layout. The layouts are saved to a Layouts folder in the documents directory as named \u201c.nvlayout\u201d files. Apply Window Layout Once you have saved a layout, you can restore them by using the \u201cApply Window Layout\u201d menu entry. Simply select the entry from sub-menu you want to apply. Manage Window Layout Allows you to delete or rename old layouts. Restore Default Layout Restore views to their original size and position. Show Welcome Page Opens the Welcome Page . Help Documentation Opens the latest documentation for NVIDIA Nsight Compute online. Documentation (local) Opens the local HTML documentation for NVIDIA Nsight Compute that has shipped with the tool. Check For Updates Checks online if a newer version of NVIDIA Nsight Compute is available for download. Reset Application Data Reset all NVIDIA Nsight Compute configuration data saved on disk, including option settings, default paths, recent project references etc. This will not delete saved reports. Send Feedback Opens a dialog that allows you to send bug reports and suggestions for features. Optionally, the feedback includes basic system information, screenshots, or additional files (such as profile reports). About Opens the About dialog with information about the version of NVIDIA Nsight Compute.", "keywords": []}, {"id": 68, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#id8", "display_name": "Baselines", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "id8", "priority": -1, "content": "NVIDIA Nsight Compute supports diffing collected results across one or multiple reports using Baselines. Each result in any report can be promoted to a baseline. This causes metric values from all results in all reports to show the difference to the baseline. If multiple baselines are selected simultaneously, metric values are compared to the average across all current baselines. Baselines are not stored with a report and are only available as long as the same NVIDIA Nsight Compute instance is open, unless they are saved to a ncu-bln file from the Baselines tool window . Profiler report with one baseline Select Add Baseline to promote the current result in focus to become a baseline. If a baseline is set, most metrics on the Details Page , Raw Page and Summary Page show two values: the current value of the result in focus, and the corresponding value of the baseline or the percentage of change from the corresponding baseline value. (Note that an infinite percentage gain, inf% , may be displayed when the baseline value for the metric is zero, while the focus value is not.) If multiple baselines are selected, each metric will show the following notation: <focus value> (<difference to baselines average [%]>, z=<standard score>@<number of values>) The standard score is the difference between the current value and the average across all baselines, normalized by the standard deviation. If the number of metric values contributing to the standard score equals the number of results (current and all baselines), the @<number of values> notation is omitted. Profiler report with multiple baselines Double-clicking on a baseline name allows the user to edit the displayed name. Edits are committed by pressing Enter/Return or upon loss of focus, and abandoned by pressing Esc . Hovering over the baseline color icon allows the user to remove this specific baseline from the list. Use the Clear Baselines entry from the dropdown button, the Profile menu, or the corresponding toolbar button to remove all baselines. Baseline changes can also be made in the Baselines tool window .", "keywords": []}, {"id": 69, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#interactive-profile-activity", "display_name": "Interactive Profile Activity", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "interactive-profile-activity", "priority": -1, "content": "Launch the target application from NVIDIA Nsight Compute When starting NVIDIA Nsight Compute, the Welcome Page will appear. Click on Quick Launch to open the Connection dialog. If the Connection dialog doesn\u2019t appear, you can open it using the Connect button from the main toolbar, as long as you are not currently connected. Select your target platform on the left-hand side and your connection target (machine) from the Connection drop down. If you have your local target platform selected, localhost will become available as a connection. Use the + button to add a new connection target. Then, continue by filling in the details in the Launch tab. In the Activity panel, select the Interactive Profile activity to initiate a session that allows controlling the execution of the target application and selecting the kernels of interest interactively. Press Launch to start the session. Launch the target application with tools instrumentation from the command line The ncu can act as a simple wrapper that forces the target application to load the necessary libraries for tools instrumentation. The parameter --mode=launch specifies that the target application should be launched and suspended before the first instrumented API call. That way the application waits until we connect with the UI. .. code:: text $ ncu \u2013mode=launch CuVectorAddDrv.exe Launch NVIDIA Nsight Compute and connect to target application Select the target machine at the top of the dialog to connect and update the list of attachable applications. By default, localhost is pre-selected if the target matches your current local platform. Select the Attach tab and the target application of interest and press Attach . Once connected, the layout of NVIDIA Nsight Compute changes into stepping mode that allows you to control the execution of any calls into the instrumented API. When connected, the API Stream window indicates that the target application waits before the very first API call. Control application execution Use the API Stream window to step the calls into the instrumented API. The dropdown at the top allows switching between different CPU threads of the application. Step In (F11), Step Over (F10), and Step Out (Shift + F11) are available from the Debug menu or the corresponding toolbar buttons. While stepping, function return values and function parameters are captured. Use Resume (F5) and Pause to allow the program to run freely. Freeze control is available to define the behavior of threads currently not in focus, i.e. selected in the thread drop down. By default, the API Stream stops on any API call that returns an error code. This can be toggled in the Debug menu by Break On API Error . Isolate a kernel launch To quickly isolate a kernel launch for profiling, use the Run to Next Kernel button in the toolbar of the API Stream window to jump to the next kernel launch. The execution will stop before the kernel launch is executed. Profile a kernel launch Once the execution of the target application is suspended at a kernel launch, additional actions become available in the UI. These actions are either available from the menu or from the toolbar. Please note that the actions are disabled, if the API stream is not at a qualifying state (not at a kernel launch or launching on an unsupported GPU). To profile, press Profile Kernel and wait until the result is shown in the Profiler Report . Profiling progress is reported in the lower right corner status bar. Instead of manually selecting Profile , it is also possible to enable Auto Profile from the Profile menu. If enabled, each kernel matching the current kernel filter (if any) will be profiled using the current section configuration. This is especially useful if an application is to be profiled unattended, or the number of kernel launches to be profiled is very large. Sections can be enabled or disabled using the Metric Selection tool window. Profile Series allows to configure the collection of a set of profile results at once. Each result in the set is profiled with varying parameters. Series are useful to investigate the behavior of a kernel across a large set of parameters without the need to recompile and rerun the application many times. For a detailed description of the options available in this activity, see Interactive Profile Activity .", "keywords": []}, {"id": 70, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#introduction", "display_name": "Introduction", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "introduction", "priority": -1, "content": "For users migrating from Visual Profiler to NVIDIA Nsight Compute, please see the Visual Profiler Transition Guide for comparison of features and workflows.", "keywords": []}, {"id": 71, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#launch-details", "display_name": "Launch Details", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "launch-details", "priority": -1, "content": "The Launch Details tool window can be opened using the Launch Details entry in the Profile menu or the respective tool bar button. When a result containing multiple sub-launches is selected and this tool window is open, it will display information about each sub-launch contained in the result. This tool window is split into two sections: a header displaying information applying to the result as a whole a body displaying information specific to the viewed sub-launch", "keywords": []}, {"id": 72, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#limitations", "display_name": "Limitations", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "limitations", "priority": -1, "content": "Range Replay When using Range Replay mode, instruction-level source metrics are not available. Graph Profiling When profiling complete CUDA graphs, instruction-level source metrics are not available.", "keywords": []}, {"id": 73, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#main-menu-and-toolbar", "display_name": "Main Menu and Toolbar", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "main-menu-and-toolbar", "priority": -1, "content": "Information on the main menu and toolbar.", "keywords": []}, {"id": 74, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#main-toolbar", "display_name": "Main Toolbar", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "main-toolbar", "priority": -1, "content": "The main toolbar shows commonly used operations from the main menu. See Main Menu for their description.", "keywords": []}, {"id": 75, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#memory-allocations", "display_name": "Memory Allocations", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "memory-allocations", "priority": -1, "content": "When using the asynchronous malloc/free APIs, the resource view for Memory Allocation will also include the memory objects created in this manner. These memory objects have a non-zero memory pool handle. The Mode column will indicate which code path was taken during the allocation of the corresponding object. The modes are: REUSE_STREAM_SUBPOOL: The memory object was allocated in memory that was previously freed. The memory was backed by the memory pool set as current for the stream on which the allocation was made. USE_EXISTING_POOL_MEMORY: The memory object was allocated in memory that was previously freed. The memory is backed by the default memory pool of the stream on which the allocation was made. REUSE_EVENT_DEPENDENCIES: The memory object was allocated in memory that was previously freed in another stream of the same context. A stream ordering dependency of the allocating stream on the free action existed. Cuda events and null stream interactions can create the required stream ordered dependencies. REUSE_OPPORTUNISTIC: The memory object was allocated in memory that was previously freed in another stream of the same context. However, no dependency between the free and allocation existed. This mode requires that the free be already committed at the time the allocation is requested. Changes in execution behavior might result in different modes for multiple runs of the application. REUSE_INTERNAL_DEPENDENCIES: The memory object was allocated in memory that was previously freed in another stream of the same context. New internal stream dependencies may have been added in order to establish the stream ordering required to reuse a piece of memory previously released. REQUEST_NEW_ALLOCATION: New memory had to be allocated for this memory object as no viable reusable pool memory was found. The allocation performance is comparable to using the non-asynchronous malloc/free APIs.", "keywords": []}, {"id": 76, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#metric-details", "display_name": "Metric Details", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "metric-details", "priority": -1, "content": "The Metric Details tool window can be opened using the Metric Details entry in the Profile menu or the respective tool bar button. When a report and the tool window are open, a metric can be selected in the report to display additional information in the tool window. It also contains a search bar to look up metrics in the focused report. Report metrics can be selected in the Details Page or the Raw Page . The window will show basic information (name, unit and raw value of the metric) as well as additional information, such as its extended description. The search bar can be used to open metrics in the focused report. It shows available matches as you type. The entered string must match from the start of the metric name. By default, selecting or searching for a new metric updates the current Default Tab . You can click the Pin Tab button to create a copy of the default tab, unless the same metric is already pinned. This makes it possible to save multiple tabs and quickly switch between them to compare values. Some metrics contain Instance Values . When available, they are listed in the tool window. Instance values can have a Correlation ID that allows correlating the individual value with its associated entity, e.g. a function address or instruction name. For metrics collected with PM sampling , the correlation ID is the GPU timestamp in nanoseconds. It is shown as an absolute value and relative to the first timestamp for this metric.", "keywords": []}, {"id": 77, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#metric-selection", "display_name": "Metric Selection", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "metric-selection", "priority": -1, "content": "The Metric Selection window can be opened from the main menu using Profile > Metric Selection . It tracks all metric sets, sections and rules currently loaded in NVIDIA Nsight Compute, independent from a specific connection or report. The directory to load those files from can be configured in the Profile options dialog. It is used to inspect available sets, sections and rules, as well as to configure which should be collected, and which rules should be applied. You can also specify a comma separated list of individual metrics, that should be collected. The window has two views, which can be selected using the dropdown in its header. The Metric Sets view shows all available metric sets. Each set is associated with a number of metrics sections. You can choose a set appropriate to the level of detail for which you want to collect performance metrics. Sets which collect more detailed information normally incur higher runtime overhead during profiling. When enabling a set in this view, the associated metric sections are enabled in the Metric Sections/Rules view. When disabling a set in this view, the associated sections in the Metric Sections/Rules view are disabled. If no set is enabled, or if sections are manually enabled/disabled in the Metric Sections/Rules view, the < custom > entry is marked active to represent that no section set is currently enabled. Note that the basic set is enabled by default. Whenever a kernel is profiled manually, or when auto-profiling is enabled, only sections enabled in the Metric Sections/Rules view and individual metrics specified in input box are collected. Similarly, whenever rules are applied, only rules enabled in this view are active. The enabled states of sections and rules are persisted across NVIDIA Nsight Compute launches. The Reload button reloads all sections and rules from disk again. If a new section or rule is found, it will be enabled if possible. If any errors occur while loading a rule, they will be listed in an extra entry with a warning icon and a description of the error. Use the Enable All and Disable All checkboxes to enable or disable all sections and rules at once. The Filter text box can be used to filter what is currently shown in the view. It does not alter activation of any entry. The table shows sections and rules with their activation status, their relationship and further parameters, such as associated metrics or the original file on disk. Rules associated with a section are shown as children of their section entry. Rules independent of any section are shown under an additional Independent Rules entry. Double-clicking an entry in the table\u2019s Filename column opens this file as a document. It can be edited and saved directly in NVIDIA Nsight Compute. After editing the file, Reload must be selected to apply those changes. When a section or rule file is modified, the entry in the State column will show User Modified to reflect that it has been modified from its default state. When a User Modified row is selected, the Restore button will be enabled. Clicking the Restore button will restore the entry to its default state and automatically Reload the sections and rules. Similarly, when a stock section or rule file is removed from the configured Sections Directory (specified in the Profile options dialog), the State column will show User Deleted . User Deleted files can also be restored using the Restore button. Section and rule files that are created by the user (and not shipped with NVIDIA Nsight Compute) will show up as User Created in the state column . See the Sections and Rules for the list of default sections for NVIDIA Nsight Compute.", "keywords": []}, {"id": 78, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#metrics", "display_name": "Metrics", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "metrics", "priority": -1, "content": "Metrics Correlation The page is most useful when inspecting performance information and metrics correlated with your code. Metrics are shown in columns, which can be enabled or disabled using the Column Chooser accessible using the column header right click menu. To not move out of view when scrolling horizontally, columns can be fixed. By default, the Source column is fixed to the left, enabling easy inspection of all metrics correlated to a source line. To change fixing of columns, right click the column header and select Freeze or Unfreeze , respectively. The heatmap on the right-hand side of each view can be used to quickly identify locations with high metric values of the currently selected metric in the dropdown. The heatmap uses a black-body radiation color scale where black denotes the lowest mapped value and white the highest, respectively. The current scale is shown when clicking and holding the heatmap with the right mouse button. By default, applicable metrics are shown as percentage values relative to their sum across the launch. A bar is filling from left to right to indicate the value at a specific source location relative to this metric\u2019s maximum within the launch. The [%] and [+-] buttons can be used to switch the display from relative to absolute and from abbreviated absolute to full-precision absolute, respectively. For relative values and bars, the [circle/pie] button can be used to switch the display between relative to global (launch) and relative to local (function/file) scope. This button is disabled when the view is collapsed, as percentages are always relative to the global launch scope in this case. Pre-Defined Source Metrics Live Registers Number of registers that need to be kept valid by the compiler. A high value indicates that many registers are required at this code location, potentially increasing the register pressure and the maximum number of register required by the kernel. The total number of registers reported as launch__registers_per_thread may be significantly higher than the maximum live registers. The compiler may need to allocate specific registers that can creates holes in the allocation, thereby affecting launch__registers_per_thread , even if the maximum live registers is smaller. This may happen due to ABI restrictions, or restrictions enforced by particular hardware instructions. The compiler may not have a complete picture of which registers may be used in either callee or caller and has to obey ABI conventions, thereby allocating different registers even if some register could have theoretically been re-used. Warp Stall Sampling (All Samples) 1 The number of samples from the Statistical Sampler at this program location. Warp Stall Sampling (Not-issued Samples) 2 The number of samples from the Statistical Sampler at this program location on cycles the warp scheduler issued no instructions. Note that (Not Issued) samples may be taken on a different profiling pass than (All) samples mentioned above, so their values do not strictly correlate. This metric is only available on devices with compute capability 7.0 or higher. Instructions Executed Number of times the source (instruction) was executed per individual warp, independent of the number of participating threads within each warp. Thread Instructions Executed Number of times the source (instruction) was executed by any thread, regardless of predicate presence or evaluation. Predicated-On Thread Instructions Executed Number of times the source (instruction) was executed by any active, predicated-on thread. For instructions that are executed unconditionally (i.e. without predicate), this is the number of active threads in the warp, multiplied with the respective Instructions Executed value. Avg. Threads Executed Average number of thread-level executed instructions per warp, regardless of their predicate. Avg. Predicated-On Threads Executed Average number of predicated-on thread-level executed instructions per warp. Divergent Branches Number of divergent branch targets, including fallthrough. Incremented only when there are two or more active threads with divergent targets. Divergent branches can lead to warp stalls due to resolving the branch or instruction cache misses. Information on Memory Operations Label Name Description Address Space memory_type The accessed address space (global/local/shared). Access Operation memory_access_type The type of memory access (e.g. load or store). Access Size memory_access_size_type The size of the memory access, in bits. L1 Tag Requests Global memory_l1_tag_requests_global Number of L1 tag requests generated by global memory instructions. L1 Conflicts Shared N-Way derived__memory_l1_conflicts_shared_nway Average N-way conflict in L1 per shared memory instruction. A 1-way access has no conflicts and resolves in a single pass. Note: This is a derived metric which can not be collected directly. L1 Wavefronts Shared Excessive derived__memory_l1_wavefronts_shared_excessive Excessive number of wavefronts in L1 from shared memory instructions, because not all not predicated-off threads performed the operation. Note: This is a derived metric which can not be collected directly. L1 Wavefronts Shared memory_l1_wavefronts_shared Number of wavefronts in L1 from shared memory instructions. L1 Wavefronts Shared Ideal memory_l1_wavefronts_shared_ideal Ideal number of wavefronts in L1 from shared memory instructions, assuming each not predicated-off thread performed the operation. L2 Theoretical Sectors Global Excessive derived__memory_l2_theoretical_sectors_global_excessive Excessive theoretical number of sectors requested in L2 from global memory instructions, because not all not predicated-off threads performed the operation. Note: This is a derived metric which can not be collected directly. L2 Theoretical Sectors Global memory_l2_theoretical_sectors_global Theoretical number of sectors requested in L2 from global memory instructions. L2 Theoretical Sectors Global Ideal memory_l2_theoretical_sectors_global_ideal Ideal number of sectors requested in L2 from global memory instructions, assuming each not predicated-off thread performed the operation. L2 Theoretical Sectors Local memory_l2_theoretical_sectors_local Theoretical number of sectors requested in L2 from local memory instructions. All L1/L2 Sectors/Wavefronts/Requests metrics give the number of achieved (actually required), ideal, and excessive (achieved - ideal) sectors/wavefronts/requests. Ideal metrics indicate the number that would needed, given each not predicated-off thread performed the operation of given width. Excessive metrics indicate the required surplus over the ideal case. Reducing divergence between threads can reduce the excess amount and result in less work for the respective HW units. Several of the above metrics on memory operations were renamed in version 2021.2 as follows: Old name New name memory_l2_sectors_global memory_l2_theoretical_sectors_global memory_l2_sectors_global_ideal memory_l2_theoretical_sectors_global_ideal memory_l2_sectors_local memory_l2_theoretical_sectors_local memory_l1_sectors_global memory_l1_tag_requests_global memory_l1_sectors_shared memory_l1_wavefronts_shared memory_l1_sectors_shared_ideal memory_l1_wavefronts_shared_ideal L2 Explicit Evict Policy Metrics Starting with the NVIDIA Ampere architecture the eviction policy of the L2 cache can be tuned to match the kernel\u2019s access pattern. The eviction policy can be either set implicitly for a memory window (for more details see CUaccessProperty ) or set explicitly per executed memory instruction. If set explicitly, the desired eviction behavior for the cases of an L2 cache hit or miss are passed as input to the instruction. For more details refer to CUDA\u2019s Cache Eviction Priority Hints . Label Name Description L2 Explicit Evict Policies smsp__inst_executed_memdesc_explicit_evict_type Comma separated list of configured explicit eviction policies. As the policies can be set dynamically at runtime, this list includes all policies that were part of any executed instruction. L2 Explicit Hit Policy Evict First smsp__inst_executed_memdesc_explicit_hitprop_evict_first Number of times a memory instruction was executed by any warp which had the evict_first policy set in case the access leads to a cache hit in L2. Data cached with this policy will be first in the eviction priority order and will likely be evicted when cache eviction is required. This policy is suitable for streaming data. L2 Explicit Hit Policy Evict Last smsp__inst_executed_memdesc_explicit_hitprop_evict_last Number of times a memory instruction was executed by any warp which had the evict_last policy set in case the access leads to a cache hit in L2. Data cached with this policy will be last in the eviction priority order and will likely be evicted only after other data with evict_normal or evict_first eviction policy is already evicted. This policy is suitable for data that should remain persistent in cache. L2 Explicit Hit Policy Evict Normal smsp__inst_executed_memdesc_explicit_hitprop_evict_normal Number of times a memory instruction was executed by any warp which had the evict_normal (default) policy set in case the access leads to a cache hit in L2. L2 Explicit Hit Policy Evict Normal Demote smsp__inst_executed_memdesc_explicit_hitprop_evict_normal_demote Number of times a memory instruction was executed by any warp which had the evict_normal_demote policy set in case the access leads to a cache hit in L2. L2 Explicit Miss Policy Evict First smsp__inst_executed_memdesc_explicit_missprop_evict_first Number of times a memory instruction was executed by any warp which had the evict_first policy set in case the access leads to a cache miss in L2. Data cached with this policy will be first in the eviction priority order and will likely be evicted cache eviction is required. This policy is suitable for streaming data. L2 Explicit Miss Policy Evict Normal smsp__inst_executed_memdesc_explicit_missprop_evict_normal Number of times a memory instruction was executed by any warp which had the evict_normal (default) policy set in case the access leads to a cache miss in L2. Individual Warp Stall Sampling Metrics All stall_* metrics show the information combined in Warp Stall Sampling individually. See Statistical Sampler for their descriptions. See the Customization Guide on how to add additional metrics for this view and the Metrics Reference for further information on available metrics. Register Dependencies Dependencies between registers are displayed in the SASS view. When a register is read, all the potential addresses where it could have been written are found. The links between these lines are drawn in the view. All dependencies for registers, predicates, uniform registers and uniform predicates are shown in their respective columns. The picture above shows some dependencies for a simple CUDA kernel. On the first row, which is line 9 of the SASS code, we can see writes on registers R2 and R3, represented by filled triangles pointing to the left . These registers are then read on lines 17, 20 and 23, and this is represented by regular triangles pointing to the right . There are also some lines where both types of triangles are on the same line, which means that a read and a write occured for the same register. Dependencies across source files and functions are not tracked. The Register Dependencies Tracking feature is enabled by default, but can be disabled completely in Tools > Options > Profile > Report Source Page > Enable Register Dependencies . 1 This metric was previously called Sampling Data (All). 2 This metric was previously called Sampling Data (Not Issued).", "keywords": []}, {"id": 79, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#metrics-and-units", "display_name": "Metrics and Units", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "metrics-and-units", "priority": -1, "content": "Numeric metric values are shown in various places in the report, including the header and tables and charts on most pages. NVIDIA Nsight Compute supports various ways to display those metrics and their values. When available and applicable to the UI component, metrics are shown along with their unit. This is to make it apparent if a metric represents cycles, threads, bytes/s, and so on. The unit will normally be shown in rectangular brackets, e.g. Metric Name [bytes] 128 . By default, units are scaled automatically so that metric values are shown with a reasonable order of magnitude. Units are scaled using their SI-factors, i.e. byte-based units are scaled using a factor of 1000 and the prefixes K, M, G, etc. Time-based units are also scaled using a factor of 1000, with the prefixes n, u and m. This scaling can be disabled in the Profile options. Metrics which could not be collected are shown as n/a and assigned a warning icon. If the metric floating point value is out of the regular range (i.e. nan (Not a number) or inf (infinite)), they are also assigned a warning icon. The exception are metrics for which these values are expected and which are allow-listed internally.", "keywords": []}, {"id": 80, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#navigate-the-report", "display_name": "Navigate the Report", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "navigate-the-report", "priority": -1, "content": "Navigate the report The profile report comes up by default on the Details page. You can switch between different Report Pages of the report with the dropdown labeled Page on the top-left of the report. You can also use Ctrl + Shift + N and Ctrl + Shift + P shortcut keys or corresponding toolbar button to navigate next and previous pages, respectively. A report can contain any number of results from kernel launches. The Result dropdown allows switching between the different results in a report. Diffing multiple results On the Details page, press the button Add Baseline in order for the current result to become the baseline all other results from this report and any other report opened in the same instance of NVIDIA Nsight Compute get compared to. If a baseline is set, every element on the Details page shows two values: The current value of the result in focus and the corresponding value of the baseline or the percentage of change from the corresponding baseline value. Use the Clear Baselines entry from the dropdown button, the Profile menu or the corresponding toolbar button to remove all baselines. For more information see Baselines . Executing rules On the Details page some sections may provide rules. Press the Apply button to execute an individual rule. The Apply Rules button on the top executes all available rules for the current result in focus. Rules can be user-defined too. For more information see the Customization Guide .", "keywords": []}, {"id": 81, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#navigation", "display_name": "Navigation", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "navigation", "priority": -1, "content": "The View dropdown can be used to select different code (correlation) options: SASS, PTX and Source (CUDA-C, Fortran, Python, \u2026). In side-by-side views, when selecting a line in the left-hand- or right-hand-side, any correlated lines in the opposite view are highlighted. However, when the Show Single File For Multi-File Sources option is set to Yes , the target file or source object must already be selected in the respective view for those correlated lines to be shown. The Source drop down allows you to switch between the files or functions that provide the content in the view. When a different source entry is selected, the view scrolls to the start of this file or function. If a view contains multiple source files or functions, [+] and [-] buttons are shown. These can be used to expand or collapse the view, thereby showing or hiding the file or function content except for its header. If collapsed, all metrics are shown aggregated to provide a quick overview. You can use the Find (source code) line edit to search the Source column of each view. Enter the text to search and use the associated buttons to find the next or previous occurrence in this column. While the line edit is selected, you can also use the Enter or Shift*+*Enter keys to search for the next or previous occurrence, respectively. The SASS view is filtered to only show functions that were executed in the launch. You can toggle the Show Only Executed Functions option to change this, but performance of this page may be negatively affected for large binaries. It is possible that some SASS instructions are shown as N/A . Those instructions are not currently exposed publicly. Only filenames are shown in the view, together with a File Not Found error, if the source files cannot be found in their original location. This can occur, for example, if the report was moved to a different system. Select a filename and click the Resolve button above to specify where this source can be found on the local filesystem. However, the view always shows the source files if the import source option was selected during profiling, and the files were available at that time. If a file is found in its original or any source lookup location, but its attributes don\u2019t match, a File Mismatch error is shown. See the Source Lookup options for changing file lookup behavior. If the report was collected using remote profiling, and automatic resolution of remote files is enabled in the Profile options, NVIDIA Nsight Compute will attempt to load the source from the remote target. If the connection credentials are not yet available in the current NVIDIA Nsight Compute instance, they are prompted in a dialog. Loading from a remote target is currently only available for Linux x86_64 targets and Linux and Windows hosts.", "keywords": []}, {"id": 82, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#non-interactive-profile-activity", "display_name": "Non-Interactive Profile Activity", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "non-interactive-profile-activity", "priority": -1, "content": "Launch the target application from NVIDIA Nsight Compute When starting NVIDIA Nsight Compute, the Welcome Page will appear. Click on Quick Launch to open the Connection dialog. If the Connection dialog doesn\u2019t appear, you can open it using the Connect button from the main toolbar, as long as you are not currently connected. Select your target platform on the left-hand side and your localhost from the Connection drop down. Then, fill in the launch details. In the Activity panel, select the Profile activity to initiate a session that pre-configures the profile session and launches the command line profiler to collect the data. Provide the Output File name to enable starting the session with the Launch button. Additional Launch Options For more details on these options, see Command Line Options . The options are grouped into tabs: The Filter tab exposes the options to specify which kernels should be profiled. Options include the kernel regex filter, the number of launches to skip, and the total number of launches to profile. The Sections tab allows you to select which sections should be collected for each kernel launch. Hover over a section to see its description as a tool-tip. To change the sections that are enabled by default, use the Metric Selection tool window. The Sampling tab allows you to configure sampling options for each kernel launch. The Other tab includes the option to collect NVTX information or custom metrics via the --metrics option. For a detailed description of the options available in this activity, see Profile Activity .", "keywords": []}, {"id": 83, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#nvtx", "display_name": "NVTX", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "nvtx", "priority": -1, "content": "The NVTX window is available when NVIDIA Nsight Compute is connected to a target application. If closed, it can be re-opened using Debug > NVTX from the main menu. Whenever the target application is suspended, the window shows the state of all active NVTX domains and ranges in the currently selected thread. Note that NVTX information is only tracked if the launching command line profiler instance was started with --nvtx or NVTX was enabled in the NVIDIA Nsight Compute launch dialog. Use the Current Thread dropdown in the API Stream window to change the currently selected thread. NVIDIA Nsight Compute supports NVTX named resources, such as threads, CUDA devices, CUDA contexts, etc. If a resource is named using NVTX, the appropriate UI elements will be updated.", "keywords": []}, {"id": 84, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#occupancy-calculator", "display_name": "Occupancy Calculator", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "occupancy-calculator", "priority": -1, "content": "NVIDIA Nsight Compute provides an Occupancy Calculator that allows you to compute the multiprocessor occupancy of a GPU for a given CUDA kernel. It offers feature parity to the CUDA Occupancy Calculator spreadsheet . The Occupancy Calculator can be opened directly from a profile report or as a new activity. The occupancy calculator data can be saved to a file using File > Save . By default, the file uses the .ncu-occ extension. The occupancy calculator file can be opened using File > Open File Launching from the Connection Dialog Select the Occupancy Calculator activity from the connection dialog. You can optionally specify an occupancy calculator data file, which is used to initialize the calculator with the data from the saved file. Click the Launch button to open the Occupancy Calculator. Launching from the Profiler Report The Occupancy Calculator can be opened from the Profiler Report using the calculator button located in the report header or in the header of the Occupancy section on the Detail Page . Details page header Occupancy section header The user interface consists of an input section as well as tables and graphs that display information about GPU occupancy. To use the calculator, change the input values in the input section, click the Apply button and examine the tables and graphs.", "keywords": []}, {"id": 85, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#options", "display_name": "Options", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "options", "priority": -1, "content": "NVIDIA Nsight Compute options can be accessed via the main menu under Tools > Options . All options are persisted on disk and available the next time NVIDIA Nsight Compute is launched. When an option is changed from its default setting, its label will become bold. You can use the Restore Defaults button to restore all options to their default values. Profile options", "keywords": []}, {"id": 86, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#overview", "display_name": "Overview", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "overview", "priority": -1, "content": "This document is a user guide to the next-generation NVIDIA Nsight Compute profiling tools. NVIDIA Nsight Compute is an interactive kernel profiler for CUDA applications. It provides detailed performance metrics and API debugging via a user interface and command line tool. In addition, its baseline feature allows users to compare results within the tool. NVIDIA Nsight Compute provides a customizable and data-driven user interface and metric collection and can be extended with analysis scripts for post-processing results. Important Features Interactive kernel profiler and API debugger Graphical profile report Result comparison across one or multiple reports within the tool Fast Data Collection UI and Command Line interface Fully customizable reports and analysis rules", "keywords": []}, {"id": 87, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#profile", "display_name": "Profile", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "profile", "priority": -1, "content": "Name Description Values Sections Directory Directory from which to import section files and rules. Relative paths are with respect to the NVIDIA Nsight Compute installation directory. Include Sub-Directories Recursively include section files and rules from sub-directories. Yes (Default)/No Apply Applicable Rules Automatically Automatically apply active and applicable rules. Yes (Default)/No Reload Rules Before Applying Force a rule reload before applying the rule to ensure changes in the rule script are recognized. Yes/No (Default) Default Report Page The report page to show when a report is generated or opened. Auto lets the tool decide the best page to show when opening a report. Session Summary Details Source Comments Call Stack/NVTX Raw Auto (default) Function Name Mode Determines how function/kernel names are shown. Auto (default): each component uses its preferred mode Demangled: kernel names are shown demangled with all parameters Function: kernel names are shown with their demangled function name without parameters Mangled: kernel names are shown with their mangled name, if applicable NVTX Rename Mode Determines how NVTX information is used for renaming. Range replay results are always renamed when possible. None: no renaming Kernel: kernel names are renamed using the most recent enclosing push/pop range Resources (default): resources like CPU threads or CUDA contexts and streams are renamed All: Kernel and Resources Maximum Baseline Name Length The maximum length of baseline names. 1..N (Default: 40) Number of Full Baselines to Display Number of baselines to display in the report header with all details in addition to the current result. 0..N (Default: 2) Auto-Convert Metric Units Auto-adjust displayed metric units and values (e.g. Bytes to KBytes). Yes (Default)/No Show Instanced Metric Values Show the individual values of instanced metrics in tables. Yes/No (Default) Show Metrics As Floating Point Show all numeric metrics as floating-point numbers. Yes/No (Default) Show Knowledge Base Information Show information from the knowledge base in (metric) tooltips to explain terminology. Note: Nsight Compute needs to be restarted for this option to take effect. Yes (Default)/No Metrics/Properties List of metrics and properties to show on the summary page. Comma-separated list of metric entries. Each entry has the format {Label:MetricName}. Delay Load \u2018Source\u2019 Page Delays loading the content of the report page until the page becomes visible. Avoids processing costs and memory overhead until the report page is opened. Yes/No (Default) Show Single File For Multi-File Sources Shows a single file in each Source page view, even for multi-file sources. Yes/No (Default) Show Only Executed Functions Shows only executed functions in the source page views. Disabling this can impact performance. Yes (Default)/No Auto-Resolve Remote Source Files Automatically try to resolve remote source files on the source page (e.g. via SSH) if the connection is still registered. Yes/No (Default) Enable Register Dependencies Track dependencies between SASS registers/predicates and display them in the SASS view. Yes (Default)/No Kernel Analysis Size Threshold (KB) Enable SASS flow graph analysis for functions below this threshold. SASS analysis is required for Live Register and Register Dependency information. Set to -1 to enable analysis for all functions. -1..N (Default: 1024) Enable ELF Verification Enable ELF (cubin) verification to run every time before SASS analysis. This should only be enabled when working with applications compiled before CUDA 11.0 or when encountering source page issues. Yes/No (Default) API Call History Number of recent API calls shown in API Stream View. 1..N (Default: 100)", "keywords": []}, {"id": 88, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#profile-activity", "display_name": "Profile Activity", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "profile-activity", "priority": -1, "content": "The Profile activity provides a traditional, pre-configurable profiler. After configuring which kernels to profile, which metrics to collect, etc, the application is run under the profiler without interactive control. The activity completes once the application terminates. For applications that normally do not terminate on their own, e.g. interactive user interfaces, you can cancel the activity once all expected kernels are profiled. This activity does not support attaching to processes previously launched via NVIDIA Nsight Compute. These processes will be shown grayed out in the Attach tab. Output File Path to report file where the collected profile should be stored. If not present, the report extension .ncu-rep is added automatically. The placeholder %i is supported for the filename component. It is replaced by a sequentially increasing number to create a unique filename. This maps to the --export command line option. Force Overwrite If set, existing report file are overwritten. This maps to the --force-overwrite command line option. Target Processes Select the processes you want to profile. In mode Application Only , only the root application process is profiled. In mode all , the root application process and all its child processes are profiled. This maps to the --target-processes command line option. Replay Mode Select the method for replaying kernel launches multiple times. In mode Kernel , individual kernel launches are replayed transparently during the single execution of the target application. In mode Application , the entire target application is relaunched multiple times. In each iteration, additional data for the target kernel launches is collected. Application replay requires the program execution to be deterministic. This maps to the --replay-mode command line option. See the Kernel Profiling Guide for more details on the replay modes. Graph Profiling Set if CUDA graphs should be profiled as individual Nodes or as complete Graphs . Additional Options All remaining options map to their command line profiler equivalents. See the Command Line Options for details.", "keywords": []}, {"id": 89, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#profiler-report", "display_name": "Profiler Report", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "profiler-report", "priority": -1, "content": "The profiler report contains all the information collected during profiling for each kernel launch. In the user interface, it consists of a header with general information, as well as controls to switch between report pages or individual collected launches.", "keywords": []}, {"id": 90, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#profiler-report-header", "display_name": "Header", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "profiler-report-header", "priority": -1, "content": "The Page dropdown can be used to switch between the available report pages, which are explained in detail in the next section . The Result dropdown can be used to switch between all collected kernel launches. The information displayed in each page commonly represents the selected launch instance. On some pages (e.g. Raw ), information for all launches is shown and the selected instance is highlighted. You can type in this dropdown to quickly filter and find a kernel launch. The Apply Filters button opens the filter dialog. You can use more than one filter to narrow down your results. On the filter dialog, enter your filter parameters and press OK button. The Launch dropdown, Summary Page table, and Raw Page table will be filtered accordingly. Select the arrow dropdown to access the Clear Filters button, which removes all filters. Filter Dialog The Add Baseline button promotes the current result in focus to become the baseline of all other results from this report and any other report opened in the same instance of NVIDIA Nsight Compute. Select the arrow dropdown to access the Clear Baselines button, which removes all currently active baselines. The Apply Rules button applies all rules available for this report. If rules had been applied previously, those results will be replaced. By default, rules are applied immediately once the kernel launch has been profiled. This can be changed in the options under Tools > Options > Profile > Report UI > Apply Applicable Rules Automatically . The Occupancy Calculator button navigates to the Occupancy Calculator which is opened in a new document. The Source Comparison button navigates to the Source Comparison document in case at least two profile results are available for comparison. A button on the right-hand side offers multiple operations that may be performed on the page. Available operations include: Copy as Image - Copies the contents of the page to the clipboard as an image. Save as Image - Saves the contents of the page to a file as an image. Save as PDF - Saves the contents of the page to a file as a PDF. Export to CSV - Exports the contents of page to CSV format. Reset to Default - Resets the page to a default state by removing any persisted settings. Note that not all functions are available on all pages. Below the buttons described above, a table is shown with information about the selected profile result (as Current ) and potentially additional baselines. For many values in this table tooltips provide additional information or data, e.g., the tooltip of the column Attributes provides additional information about the context type and resources used for the launch. The [+] and [-] buttons can be used to show or hide the section body content. The visibility of the output of the rules can be toggled with the R button. The info toggle button i changes the section description\u2019s visibility.", "keywords": []}, {"id": 91, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#profiles", "display_name": "Profiles", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "profiles", "priority": -1, "content": "The icon next to the View dropdown can be used to manage Source View Profiles . This button opens a dialog that shows you the list of saved source view profiles. Such profiles can be created using the Create button in the dialog. Profiles let you store the column properties of all views in the report to a file. Such properties include column visibility, freeze state, width, order and the selected navigation metric. A saved profile can be applied to any opened report using the Apply button. This updates the column properties mentioned above from the selected profile in all views. Profiles are useful for configuring views to your preferences, or for a certain use case. Start by choosing metric columns from the Column Chooser . Next, configure other properties like freezing column, changing width or order and setting a heatmap metric in the Navigation dropdown before creating the profile. Once a profile is created, you can always use this profile on any opened report to hide all non-required columns or to restore your configured properties. Simply select the profile from the source view profiles dialog and click the Apply button. Note that the column properties are stored separately for each View in the profile and when applied, only those views will be updated which are present in the selected profile. You will not see the metric columns that are not available in your report even if those were configured to be visible in the source profile you have applied.", "keywords": []}, {"id": 92, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#project-dialogs", "display_name": "Project Dialogs", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "project-dialogs", "priority": -1, "content": "New Project Creates a new project. The project must be given a name, which will also be used for the project file. You can select the location where the project file should be saved on disk. Select whether a new directory with the project name should be created in that location.", "keywords": []}, {"id": 93, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#project-explorer", "display_name": "Project Explorer", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "project-explorer", "priority": -1, "content": "The Project Explorer window allows you to inspect and manage the current project. It shows the project name as well as all Items (profile reports and other files) associated with it. Right-click on any entry to see further actions, such as adding, removing or grouping items. Type in the Search project toolbar at the top to filter the currently shown entries. Project Explorer", "keywords": []}, {"id": 94, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#projects", "display_name": "Projects", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "projects", "priority": -1, "content": "NVIDIA Nsight Compute uses Project Files to group and organize profiling reports. At any given time, only one project can be open in NVIDIA Nsight Compute. Collected reports are automatically assigned to the current project. Reports stored on disk can be assigned to a project at any time. In addition to profiling reports, related files such as notes or source code can be associated with the project for future reference. Note that only references to reports or other files are saved in the project file. Those references can become invalid, for example when associated files are deleted, removed or not available on the current system, in case the project file was moved itself. NVIDIA Nsight Compute uses the ncu-proj file extension for project files. When no custom project is current, a default project is used to store e.g. the current Connection Dialog entries. To remove all information from the default project, you must close NVIDIA Nsight Compute and then delete the file from disk. On Windows, the file is located at <USER>\\AppData\\Local\\NVIDIA Corporation\\NVIDIA Nsight Compute\\ On Linux, the file is located at <USER>/.local/share/NVIDIA Corporation/NVIDIA Nsight Compute/ On MacOSX, the file is located at <USER>/Library/Application Support/NVIDIA Corporation/NVIDIA Nsight Compute/", "keywords": []}, {"id": 95, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#quickstart", "display_name": "Quickstart", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "quickstart", "priority": -1, "content": "The following sections provide brief step-by-step guides of how to setup and run NVIDIA Nsight Compute to collect profile information. All directories are relative to the base directory of NVIDIA Nsight Compute, unless specified otherwise. The UI executable is called ncu-ui. A shortcut with this name is located in the base directory of the NVIDIA Nsight Compute installation. The actual executable is located in the folder host\\windows-desktop-win7-x64 on Windows or host/linux-desktop-glibc_2_11_3-x64 on Linux. By default, when installing from a Linux .run file, NVIDIA Nsight Compute is located in /usr/local/cuda-<cuda-version>/nsight-compute-<version> . When installing from a .deb or .rpm package, it is located in /opt/nvidia/nsight-compute/<version> to be consistent with Nsight Systems . In Windows, the default path is C:\\Program Files\\NVIDIA Corporation\\Nsight Compute <version> . After starting NVIDIA Nsight Compute, by default the Welcome Page is opened. The Start section allows the user to start a new activity, open an existing report, create a new project or load an existing project. The Continue section provides links to recently opened reports and projects. The Explore section provides information about what is new in the latest release, as well as links to additional training. See Environment on how to change the start-up action. Welcome Page", "keywords": []}, {"id": 96, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#raw-page", "display_name": "Raw Page", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "raw-page", "priority": -1, "content": "The Raw page shows a list of all collected metrics with their units per profiled kernel launch. It can be exported, for example, to CSV format for further analysis. The page features a filter edit to quickly find specific metrics. You can transpose the table of kernels and metrics by using the Transpose button. If a metric has multiple instance values, the number of instances is shown after the standard value. This metric for example has ten instance values: 35.48 {10} . You can select in the Profile options dialog that all instance values should be shown individually or inspect the metric result in the Metric Details tool window.", "keywords": []}, {"id": 97, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#remote-connections", "display_name": "Remote Connections", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "remote-connections", "priority": -1, "content": "Remote devices that support SSH can also be configured as a target in the Connection Dialog . To configure a remote device, ensure an SSH-capable Target Platform is selected, then press the + button. The following configuration dialog will be presented. NVIDIA Nsight Compute supports both password and private key authentication methods. In this dialog, select the authentication method and enter the following information: Password IP/Host Name: The IP address or host name of the target device. User Name: The user name to be used for the SSH connection. Password: The user password to be used for the SSH connection. Port: The port to be used for the SSH connection. (The default value is 22) Deployment Directory: The directory to use on the target device to deploy supporting files. The specified user must have write permissions to this location. Connection Name: The name of the remote connection that will show up in the Connection Dialog . If not set, it will default to <User>@<Host>:<Port>. Private Key IP/Host Name: The IP address or host name of the target device. User Name: The user name to be used for the SSH connection. SSH Private Key: The private key that is used to authenticate to SSH server. SSH Key Passphrase: The passphrase for your private key. Port: The port to be used for the SSH connection. (The default value is 22) Deployment Directory: The directory to use on the target device to deploy supporting files. The specified user must have write permissions to this location. Connection Name: The name of the remote connection that will show up in the Connection Dialog . If not set, it will default to <User>@<Host>:<Port>. In addition to keyfiles specified by path and plain password authentication, NVIDIA Nsight Compute supports keyboard-interactive authentication, standard keyfile path searching and SSH agents. When all information is entered, click the Add button to make use of this new connection. When a remote connection is selected in the Connection Dialog , the Application Executable file browser will browse the remote file system using the configured SSH connection, allowing the user to select the target application on the remote device. When an activity is launched on a remote device, the following steps are taken: The command line profiler and supporting files are copied into the Deployment Directory on the the remote device. (Only files that do not exist or are out of date are copied.) Communication channels are opened to prepare for the traffic between the UI and the Application Executable . For Interactive Profile activities, a SOCKS proxy is started on the host machine. For Non-Interactive Profile activities, a remote forwarding channel is opened on the target machine to tunnel profiling information back to the host. The Application Executable is executed on the remote device. For Interactive Profile activities, a connection is established to the remote application and the profiling session begins. For Non-Interactive Profile activities, the remote application is executed under the command line profiler and the specified report file is generated. For non-interactive profiling activities, the generated report file is copied back to the host, and opened. The progress of each of these steps is presented in the Progress Log . Progress Log Note that once either activity type has been launched remotely, the tools necessary for further profiling sessions can be found in the Deployment Directory on the remote device. On Linux and Mac host platforms, NVIDIA Nsight Compute supports SSH remote profiling on target machines which are not directly addressable from the machine the UI is running on through the ProxyJump and ProxyCommand SSH options. These options can be used to specify intermediate hosts to connect to or actual commands to run to obtain a socket connected to the SSH server on the target host and can be added to your SSH configuration file. Note that for both options, NVIDIA Nsight Compute runs external commands and does not implement any mechanism to authenticate to the intermediate hosts using the credentials entered in the Connection Dialog . These credentials will only be used to authenticate to the final target in the chain of machines. When using the ProxyJump option NVIDIA Nsight Compute uses the OpenSSH client to establish the connection to the intermediate hosts. This means that in order to use ProxyJump or ProxyCommand , a version of OpenSSH supporting these options must be installed on the host machine. A common way to authenticate to the intermediate hosts in this case is to use a SSH agent and have it hold the private keys used for authentication. Since the OpenSSH SSH client is used, you can also use the SSH askpass mechanism to handle these authentications in an interactive manner. It might happen on slow networks that connections used for remote profiling through SSH time out. If this is the case, the ConnectTimeout option can be used to set the desired timeout value. A known limitation of the remote profiling through SSH is that problems may arise if NVIDIA Nsight Compute tries to do remote profiling through SSH by connecting to the same machine it is running on. In this case, the workaround is to do local profiling through localhost . For more information about available options for the OpenSSH client and the ecosystem of tools it can be used with for authentication refer to the official manual pages .", "keywords": []}, {"id": 98, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#rendering-options", "display_name": "Rendering Options", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "rendering-options", "priority": -1, "content": "Under the highlight controls, additional rendering options are available. These include methods to control the geometry colors and the ability to toggle the drawing of wireframes for meshes and AABBs.", "keywords": []}, {"id": 99, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#report-pages", "display_name": "Report Pages", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "report-pages", "priority": -1, "content": "Use the Page dropdown in the header to switch between the report pages. By default, when opening a report with a single profile result, the Details Page is shown. When opening a report with multiple results, the Summary Page is selected instead. You can change the default report page in the Profile options.", "keywords": []}, {"id": 100, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#reset", "display_name": "Reset", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "reset", "priority": -1, "content": "Entries in the connection dialog are saved as part of the current project . When working in a custom project, simply close the project to reset the dialog. When not working in a custom project, entries are stored as part of the default project . You can delete all information from the default project by closing NVIDIA Nsight Compute and then deleting the project file from disk .", "keywords": []}, {"id": 101, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#resources", "display_name": "Resources", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "resources", "priority": -1, "content": "The Resources window is available when NVIDIA Nsight Compute is connected to a target application. It shows information about the currently known resources, such as CUDA devices, CUDA streams or kernels. The window is updated every time the target application is suspended. If closed, it can be re-opened using Debug > Resources from the main menu. Using the dropdown on the top, different views can be selected, where each view is specific to one kind of resource (context, stream, kernel, \u2026). The Filter edit allows you to create filter expressions using the column headers of the currently selected resource. The resource table shows all information for each resource instance. Each instance has a unique ID, the API Call ID when this resource was created, its handle, associated handles, and further parameters. When a resource is destroyed, it is removed from its table.", "keywords": []}, {"id": 102, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#send-feedback", "display_name": "Send Feedback", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "send-feedback", "priority": -1, "content": "Name Description Values Collect Usage and Platform Data Choose whether or not you wish to allow NVIDIA Nsight Compute to collect usage and platform data. Yes No (Default)", "keywords": []}, {"id": 103, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#session-page", "display_name": "Session Page", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "session-page", "priority": -1, "content": "This Session page contains basic information about the report and the machine, as well as device attributes of all devices for which launches were profiled. When switching between launch instances, the respective device attributes are highlighted.", "keywords": []}, {"id": 104, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#sessions", "display_name": "Sessions", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "sessions", "priority": -1, "content": "Instead of sessions, NVIDIA Nsight Compute uses Projects to launch and gather connection details and collected reports. Executable and Import Sessions Use the Project Explorer or the Main Menu to create a new project. Reports collected from the command line, i.e. using NVIDIA Nsight Compute CLI, can be opened directly using the main menu. In addition, you can use the Project Explorer to associate existing reports as well as any other artifacts such as executables, notes, etc., with the project. Note that those associations are only references; in other words, moving or deleting the project file on disk will not update its artifacts. nvprof or command-line profiler output files, as well as Visual Profiler sessions, cannot be imported into NVIDIA Nsight Compute.", "keywords": []}, {"id": 105, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#source-comparison", "display_name": "Source Comparison", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "source-comparison", "priority": -1, "content": "Source comparison provides a way to see the source files of two profile results side by side. It enables to quickly identify source differences and understand changes in metric values. To compare two results side by side add one result as a baseline, navigate to the other result, and then click the Source Comparison button located in the report header. For example, if you want to compare kernel XYZ from report R1 with kernel XYZ from report R2, first open report R1, add the profile result for kernel XYZ as baseline, open report R2, choose kernel XYZ, and then click the Source Comparison button. Source comparison will be shown only with first added baseline result. Source Comparison Button Source Comparison Currently only high-level Source (CUDA-C) view and SASS view are supported for comparison. Navigation to the previous or next difference is supported using the navigation buttons or the keyboard shortcuts Ctrl + 1 and Ctrl + 2 . Source Comparison Navigation Buttons", "keywords": []}, {"id": 106, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#source-lookup", "display_name": "Source Lookup", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "source-lookup", "priority": -1, "content": "Name Description Values Program Source Locations Set program source search paths. These paths are used to resolve CUDA-C source files on the Source page if the respective file cannot be found in its original location. Files which cannot be found are marked with a File Not Found error. See the Ignore File Properties option for files that are found but don\u2019t match. Ignore File Properties Ignore file properties (e.g. timestamp, size) for source resolution. If this is disabled, all file properties like modification timestamp and file size are checked against the information stored by the compiler in the application during compilation. If a file with the same name exists on a source lookup path, but not all properties match, it won\u2019t be used for resolution (and a File Mismatch error will be shown). Yes/No (Default)", "keywords": []}, {"id": 107, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#source-page", "display_name": "Source Page", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "source-page", "priority": -1, "content": "The Source page correlates assembly (SASS) with high-level code such as CUDA-C or PTX. In addition, it displays instruction-correlated metrics to help pinpoint performance problems in your code. The page can be switched between different Views to focus on a specific source layer or see two layers side-by-side. This includes SASS, PTX and Source (CUDA-C, Fortran, Python, \u2026), as well as their combinations. Which options are available depends on the source information embedded into the executable. The high-level Source (CUDA-C) view is available if the application was built with the -lineinfo or --generate-line-info nvcc flag to correlate SASS and source. When using separate linking at the ELF level, there is no PTX available in the ELF that would correspond to the final SASS. As such, NVIDIA Nsight Compute does not show any PTX even though it would be available statically in the executable and could be shown with cuobjdump -all -lptx . However, this is a pre-linked version of the PTX and cannot be reliably used for correlation. The code in the different Views can also contain warnings, errors or just notifications that are displayed as Source Markers in the left header, as shown below. These can be generated from multiple systems, but as of now only NvRules are supported.", "keywords": []}, {"id": 108, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#standalone-source-viewer", "display_name": "Standalone Source Viewer", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "standalone-source-viewer", "priority": -1, "content": "NVIDIA Nsight Compute includes a standalone source viewer for cubin files. This view is identical to the Source Page , except that it won\u2019t include any performance metrics. Cubin files can be opened from the File > Open main menu command. The SM Selection dialog will be shown before opening the standalone source view. If available, the SM version present in the file name is pre-selected. For example, if your file name is mergeSort.sm_80.cubin then SM 8.0 will be pre-selected in the dialog. Choose the appropriate SM version from the drop down menu if it\u2019s not included in the file name. SM Selection Dialog Click Ok button to open Standalone Source Viewer . Standalone Source Viewer", "keywords": []}, {"id": 109, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#status-banners", "display_name": "Status Banners", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "status-banners", "priority": -1, "content": "Status banners are used to display important messages, such as profiler errors. The message can be dismissed by clicking the \u2018X\u2019 button. The number of banners shown at the same time is limited and old messages can get dismissed automatically if new ones appear. Use the Output Messages window to see the complete message history.", "keywords": []}, {"id": 110, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#summary-page", "display_name": "Summary Page", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "summary-page", "priority": -1, "content": "The Summary page shows a table of all collected results in the report, as well as a list of the most important rule outputs ( Prioritized Rules ) which are ordered by the estimated speedup that could potential be obtained by following their guidance. Prioritized Rules are shown by default and can be toggled with the [R] button on the upper right of the page. Summary page with Summary Table and Prioritized Rules. The Summary Table gives you a quick comparison overview across all profiled workloads. It contains a number of important, pre-selected metrics which can be customized as explained below. Its columns can be sorted by clicking the column header. You can transpose the table with the Transpose button. Aggregate of all results per each counter metric is shown in the table header along with the column name. You can change the aggregated values by selecting the desired results for multiple metrics simultaneously. When selecting any entry by single-click, a list of its Prioritized Rules will be shown below the table. Double-click any entry to make the result the currently active one and switch to the Details Page page to inspect its performance data. You can configure the list of metrics included in this table in the Profile options dialog. If a metric has multiple instance values, the number of instances is shown after its standard value. A metric with ten instance values could for example look like this: 35.48 {10} . In the Profile options dialog, you can select that all instance values should be shown individually. You can also inspect the instances values of a metric result in the Metric Details tool window. In addition to metrics, you can also configure the table to include any of the following properties: Properties property__api_call_id ID of the API call associated with this profile result. property__block_size Block Size. property__creation_time Local collection time. property__demangled_name Kernel demangled name. property__device_name GPU device name. property__estimated_speedup Maximal relative speedup achievable for this profile result as estimated by the guided analysis rules. property__function_name Kernel function name or range name. property__grid_dimensions Grid Dimensions. property__grid_offset Grid Offset. property__grid_size Grid Size. property__issues_detected Number of issues detected by guided analysis rules for this profile result. property__kernel_id Kernel ID. property__mangled_name Kernel mangled name. property__process_name Process name. property__runtime_improvement Runtime improvement corresponding to the estimated speedup. property__series_id ID of the profile series. property__series_parameters Profile series parameters. property__thread_id CPU thread ID. For Range Replay reports, a smaller set of columns is shown by default, as not all apply to such results. For the currently selected metric result the Prioritized Rules show the most impactful rule results with respect to the estimated potential speedup. Clicking on any of the rule names on the left allows you to easily navigate to the containing section on the details page. With the downward-facing arrow on the right a table with the relevant key performance indicators can be toggled. This table contains the metrics which should be tracked when optimizing performance according to the rule guidance. Prioritized Rules with key performance indicators table.", "keywords": []}, {"id": 111, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#system-trace-activity", "display_name": "System Trace Activity", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "system-trace-activity", "priority": -1, "content": "Launch the target application from NVIDIA Nsight Compute When starting NVIDIA Nsight Compute, the Welcome Page will appear. Click on Quick Launch to open the Connection dialog. If the Connection dialog doesn\u2019t appear, you can open it using the Connect button from the main toolbar, as long as you are not currently connected. Select your local target platform on the left-hand side and your localhost from the Connection drop down. Then, fill in the launch details. In the Activity panel, select the System Trace activity to initiate a session with pre-configured settings. Press Launch to start the session. Additional Launch Options For more details on these options, see System-Wide Profiling Options . Once the session is completed, the Nsight Systems report is opened in a new document. By default, the timeline view is shown. It provides detailed information of the activity of the CPU and GPUs and helps understanding the overall behavior and performance of application. Once a CUDA kernel is identified to be on the critical path and not meeting the performance expectations, right click on the kernel launch on timeline and select Profile Kernel from the context menu. A new Connection Dialog opens up that is already preconfigured to profile the selected kernel launch. Proceed with optimizing the selected kernel using Non-Interactive Profile Activity", "keywords": []}, {"id": 112, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#tables", "display_name": "Tables", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "tables", "priority": -1, "content": "The tables show the occupancy, as well as the number of active threads, warps, and thread blocks per multiprocessor, and the maximum number of active blocks on the GPU. Tables", "keywords": []}, {"id": 113, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#target-connection-properties", "display_name": "Target Connection Properties", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "target-connection-properties", "priority": -1, "content": "The Target Connection Properties determine how the host connects to the target application during an Interactive Profile Activity . This connection is used to transfer profile information to the host during the profile session. Name Description Values Base Port Base port used to establish a connection from the host to the target application during an Interactive Profile activity (both local and remote). 1-65535 (Default: 49152) Maximum Ports Maximum number of ports to try (starting from Base Port ) when attempting to connect to the target application. 2-65534 (Default: 64)", "keywords": []}, {"id": 114, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#timeline", "display_name": "Timeline", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "timeline", "priority": -1, "content": "Since trace analysis is now covered by Nsight Systems, NVIDIA Nsight Compute does not provide views of the application timeline. The API Stream tool window does show a per-thread stream of the last captured CUDA API calls. However, those are serialized and do not maintain runtime concurrency or provide accurate timing information.", "keywords": []}, {"id": 115, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#trace", "display_name": "Trace", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "trace", "priority": -1, "content": "NVIDIA Nsight Compute does not support tracing GPU or API activities on an accurate timeline. This functionality is covered by NVIDIA Nsight Systems . In the Interactive Profile Activity , the API Stream tool window provides a stream of recent API calls on each thread. However, since all tracked API calls are serialized by default, it does not collect accurate timestamps.", "keywords": []}, {"id": 116, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#visual-profiler-transition-guide", "display_name": "Visual Profiler Transition Guide", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "visual-profiler-transition-guide", "priority": -1, "content": "This guide provides tips for moving from Visual Profiler to NVIDIA Nsight Compute. NVIDIA Nsight Compute tries to provide as much parity as possible with Visual Profiler\u2019s kernel profiling features, but some functionality is now covered by different tools.", "keywords": []}, {"id": 117, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#visual-studio-integration-guide", "display_name": "Visual Studio Integration Guide", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "visual-studio-integration-guide", "priority": -1, "content": "This guide provides information on using NVIDIA Nsight Compute within Microsoft Visual Studio, using the NVIDIA Nsight Integration Visual Studio extension, allowing for a seamless development workflow.", "keywords": []}, {"id": 118, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "page", "name": "NsightCompute/index#visual-studio-integration-overview", "display_name": "Visual Studio Integration Overview", "type": "section", "display_type": "Page section", "docname": "NsightCompute/index", "anchor": "visual-studio-integration-overview", "priority": -1, "content": "NVIDIA Nsight Integration is a Visual Studio extension that allows you to access the power of NVIDIA Nsight Compute from within Visual Studio. When NVIDIA Nsight Compute is installed along with NVIDIA Nsight Integration, NVIDIA Nsight Compute activities will appear under the NVIDIA \u2018Nsight\u2019 menu in the Visual Studio menu bar. These activities launch NVIDIA Nsight Compute with the current project settings and executable. For more information about using NVIDIA Nsight Compute from within Visual Studio, please visit NVIDIA Nsight Integration Overview NVIDIA Nsight Integration User Guide Notices Notices ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, \u201cMATERIALS\u201d) ARE BEING PROVIDED \u201cAS IS.\u201d NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. Information furnished is believed to be accurate and reliable. However, NVIDIA Corporation assumes no responsibility for the consequences of use of such information or for any infringement of patents or other rights of third parties that may result from its use. No license is granted by implication of otherwise under any patent rights of NVIDIA Corporation. Specifications mentioned in this publication are subject to change without notice. This publication supersedes and replaces all other information previously supplied. NVIDIA Corporation products are not authorized as critical components in life support devices or systems without express written approval of NVIDIA Corporation. Trademarks NVIDIA and the NVIDIA logo are trademarks or registered trademarks of NVIDIA Corporation in the U.S. and other countries. Other company and product names may be trademarks of the respective companies with which they are associated.", "keywords": []}, {"id": 119, "doc_id": 119, "filename": "NsightCompute/index.html", "domain_name": "std", "name": "NsightCompute/index", "display_name": "Nsight Compute", "type": "doc", "display_type": "Page", "docname": "NsightCompute/index", "anchor": "", "priority": -1, "content": "The User Guide for Nsight Compute.", "keywords": []}, {"id": 120, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "page", "name": "NsightComputeCli/index#attach", "display_name": "Attach", "type": "section", "display_type": "Page section", "docname": "NsightComputeCli/index", "anchor": "attach", "priority": -1, "content": "Option Description Default hostname Set the hostname or IP address for connecting to the machine on which the target application is running. When attaching to a local target application, use 127.0.0.1. 127.0.0.1", "keywords": []}, {"id": 121, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "page", "name": "NsightComputeCli/index#command-line-options", "display_name": "Command Line Options", "type": "section", "display_type": "Page section", "docname": "NsightComputeCli/index", "anchor": "command-line-options", "priority": -1, "content": "For long command line options, passing a unique initial substring can be sufficient.", "keywords": []}, {"id": 122, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "page", "name": "NsightComputeCli/index#config-file", "display_name": "Config File", "type": "section", "display_type": "Page section", "docname": "NsightComputeCli/index", "anchor": "config-file", "priority": -1, "content": "Using the --config-file on/off option, parsing parameters from config file can be enabled or disabled. Using the --config-file-path <path> option, default path and name of config file can be overwritten. By default, config-file with name config.ncu-cfg is searched in the current working directory, $HOME/.config/NVIDIA Corporation on Linux and %APPDATA%\\NVIDIA Corporation\\ on Windows. If a valid config file is found, ncu parses the file and initializes any command line parameters to the values set in the file. If the same command line parameter is also set explicitly during the current invocation, the latter takes precedence. Parameters can be set under various general modes and ncu command line parameters are used to determine which general-mode needs to be parsed from the config file. See the table below for more details. Command line parameters General Mode ncu \u2013mode launch-and-attach CuVectorAddMulti.exe Launch-and-attach ncu \u2013mode launch CuVectorAddMulti.exe Launch ncu \u2013mode attach Attach ncu \u2013list-sets, ncu \u2013list-sections, ncu \u2013list-rules and ncu \u2013list-metrics List ncu \u2013query-metrics Query ncu -i <MyReport.ncu-rep> Import These general modes should be defined in the config file using INI-like syntax as: [<general-mode>] <parameter>=<value> ;<comments> Sample usage [Launch-and-attach] -c = 1 --section = LaunchStats, Occupancy [Import] --open-in-ui -c = 1 --section = LaunchStats, Occupancy From this configuration, ncu will parse parameters set under [Launch-and-attach] block whenever an application is profiled in launch-and-attach mode. In the same manner, parameters set under [Import] block will be parsed whenever a report is imported. Different modes can be clubbed together if there exists a set of parameters which is common to each mode. Sample shown above can be rewritten after clubbing both modes as: [Launch-and-attach, import] -c = 1 --section = LaunchStats, Occupancy [Import] --open-in-ui Additional points Options like --open-in-ui do not expect any value to be set. These options should not be passed any value. Options like --section can be passed multiple times in the command line. These options should be written only once under a general-mode with all required values seperated by comma as shown below. Explicitly setting values for these options will not overwrite the config file values. Instead, all values will be composed together and set to the option. [<general-mode>] <parameter>=<value1>,<value2>,...", "keywords": []}, {"id": 123, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "page", "name": "NsightComputeCli/index#console-output", "display_name": "Console Output", "type": "section", "display_type": "Page section", "docname": "NsightComputeCli/index", "anchor": "console-output", "priority": -1, "content": "Option Description Default csv Use comma-separated values as console output. Implies \u2013print-units base by default. page Select the report page to print console output for. Available pages are: details Show results grouped as sections, include rule results. Some metrics that are collected by default (e.g. device attributes) are omitted if not specified explicitly in any section or using --metrics . raw Show all collected metrics by kernel launch. source Show source. See --print-source to select the source view. session Show launch settings, session info, process info and device attributes. details . If no --page option is given and --export is set, no results are printed to the console output. print-source Select the source view: sass Show SASS (assembly) instructions for each kernel launch. ptx Show PTX source of every cubin whose at least one kernel is profiled. cuda Show entire CUDA-C source file which has kernel code as per kernel launch. CLI shows CUDA source only if file exists on the host machine. cuda,sass Show SASS CUDA-C source correlation for each kernel launch. CLI shows CUDA source only if file exists on the host machine. Metric correlation with source is available in sass , and cuda,sass source view. Metrics specified with --metrics and specified section file with --section are correlated. Consider restricting the number of selected metrics such that values fit into a single output row. sass resolve-source-file Resolve CUDA source file in the --page source output. Provide comma separated files full path. print-details Select which part of a section should be shown in the details page output: header Show all metrics from header of the section. body Show all metrics from body of the section. all Show all metrics from the section. Replaces deprecated option --details-all . header print-metric-name Select one of the option to show it in the Metric Name column: label Show metric label. name Show metric name. label-name Show both metric label and metric name. label print-units Select the mode for scaling of metric units. Available modes are: auto Show all metrics automatically scaled to the most fitting order of magnitude. base Show all metrics in their base unit. auto print-fp Show all numeric metrics in the console output as floating point numbers. false print-kernel-base Set the basis for kernel name output. See --kernel-regex-base for options. demangled print-metric-instances Set output mode for metrics with instance values: none Only show GPU aggregate value. values Show GPU aggregate followed by all instance values. none print-nvtx-rename Select how NVTX should be used for renaming: none Don\u2019t use NVTX for renaming. kernel Rename kernels with the most recent enclosing NVTX push/pop range. none print-rule-details Print additional details for rule results, such as the triggering metrics. Currently has no effect in CSV mode. false print-summary Select the summary output mode. Available modes are: none No summary. per-gpu Summary for each GPU. per-kernel Summary for each kernel type. per-nvtx Summary for each NVTX context. none", "keywords": []}, {"id": 124, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "page", "name": "NsightComputeCli/index#environment-variables", "display_name": "Environment Variables", "type": "section", "display_type": "Page section", "docname": "NsightComputeCli/index", "anchor": "environment-variables", "priority": -1, "content": "The following environment variables can be set before launching NVIDIA Nsight Compute CLI, or the UI, respectively. Name Description Default/Values NV_COMPUTE_PROFILER_DISABLE_STOCK_FILE_DEPLOYMENT Disable file deployment to the versioned Sections directory, using section and rule files from the stock directory within the installation instead. By default, the versioned directory from the user\u2019s documents folder is used to ensure that any potential user updates are taken into account. Only supported in the NVIDIA Nsight Compute CLI. Default: unset Set to \u201c1\u201d to disable deployment. NV_COMPUTE_PROFILER_LOCAL_CONNECTION_OVERRIDE Override the default local connection mechanism between frontend and profiled target processes. The default mechanism is platform-dependent. This should only be used if there are connection problems between frontend and target processes in a local launch. Default: unset (use default mechanism) Set to \u201cuds\u201d to use Unix Domain Socket connections (available on Posix platforms, only). Set to \u201ctcp\u201d to use TCP (available on all platforms). Set to \u201cnamed-pipes\u201d to use Windows Named Pipes (available on Windows, only). NV_COMPUTE_PROFILER_DISABLE_SW_PRE_PASS Disable the instruction-level software (SW) metric pre-pass. When collecting SW-patched metrics, such as inst_executed , the pre-pass is used to determine which functions are executed as part of the kernel and should be patched. This requires a separate replay pass, and if only instruction-level SW metrics are to be collected, prevents single-pass data collection. Disabling the pre-pass can improve performance if memory save-and-restore is undesirable and application replay is not possible. Default: unset (use pre-pass when applicable) Set to \u201c1\u201d to disable pre-pass.", "keywords": []}, {"id": 125, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "page", "name": "NsightComputeCli/index#event-comparison", "display_name": "Event Comparison", "type": "section", "display_type": "Page section", "docname": "NsightComputeCli/index", "anchor": "event-comparison", "priority": -1, "content": "For nvprof events, the following table lists the equivalent metrics in NVIDIA Nsight Compute, if available. For a detailed explanation of the structuring of PerfWorks metrics, see Metrics Structure . Metrics starting with sm__ are collected per-SM. Metrics starting with smsp__ are collected per-SM subpartition. However, all corresponding nvprof events are collected per-SM, only. Check the Metrics Guide for more details on these terms. nvprof Event PerfWorks Metric or Formula (>= SM 7.0) active_cycles sm__cycles_active.sum active_cycles_pm sm__cycles_active.sum active_cycles_sys sys__cycles_active.sum active_warps sm__warps_active.sum active_warps_pm sm__warps_active.sum atom_count smsp__inst_executed_op_generic_atom_dot_alu.sum elapsed_cycles_pm sm__cycles_elapsed.sum elapsed_cycles_sm sm__cycles_elapsed.sum elapsed_cycles_sys sys__cycles_elapsed.sum fb_subp0_read_sectors dram__sectors_read.sum fb_subp1_read_sectors dram__sectors_read.sum fb_subp0_write_sectors dram__sectors_write.sum fb_subp1_write_sectors dram__sectors_write.sum global_atom_cas smsp__inst_executed_op_generic_atom_dot_cas.sum gred_count smsp__inst_executed_op_global_red.sum inst_executed sm__inst_executed.sum inst_executed_fma_pipe_s0 smsp__inst_executed_pipe_fma.sum inst_executed_fma_pipe_s1 smsp__inst_executed_pipe_fma.sum inst_executed_fma_pipe_s2 smsp__inst_executed_pipe_fma.sum inst_executed_fma_pipe_s3 smsp__inst_executed_pipe_fma.sum inst_executed_fp16_pipe_s0 smsp__inst_executed_pipe_fp16.sum inst_executed_fp16_pipe_s1 smsp__inst_executed_pipe_fp16.sum inst_executed_fp16_pipe_s2 smsp__inst_executed_pipe_fp16.sum inst_executed_fp16_pipe_s3 smsp__inst_executed_pipe_fp16.sum inst_executed_fp64_pipe_s0 smsp__inst_executed_pipe_fp64.sum inst_executed_fp64_pipe_s1 smsp__inst_executed_pipe_fp64.sum inst_executed_fp64_pipe_s2 smsp__inst_executed_pipe_fp64.sum inst_executed_fp64_pipe_s3 smsp__inst_executed_pipe_fp64.sum inst_issued1 sm__inst_issued.sum l2_subp0_read_sector_misses lts__t_sectors_op_read_lookup_miss.sum l2_subp1_read_sector_misses lts__t_sectors_op_read_lookup_miss.sum l2_subp0_read_sysmem_sector_queries lts__t_sectors_aperture_sysmem_op_read.sum l2_subp1_read_sysmem_sector_queries lts__t_sectors_aperture_sysmem_op_read.sum l2_subp0_read_tex_hit_sectors lts__t_sectors_srcunit_tex_op_read_lookup_hit.sum l2_subp1_read_tex_hit_sectors lts__t_sectors_srcunit_tex_op_read_lookup_hit.sum l2_subp0_read_tex_sector_queries lts__t_sectors_srcunit_tex_op_read.sum l2_subp1_read_tex_sector_queries lts__t_sectors_srcunit_tex_op_read.sum l2_subp0_total_read_sector_queries lts__t_sectors_op_read.sum + lts__t_sectors_op_atom.sum + lts__t_sectors_op_red.sum l2_subp1_total_read_sector_queries lts__t_sectors_op_read.sum + lts__t_sectors_op_atom.sum + lts__t_sectors_op_red.sum l2_subp0_total_write_sector_queries lts__t_sectors_op_write.sum + lts__t_sectors_op_atom.sum + lts__t_sectors_op_red.sum l2_subp1_total_write_sector_queries lts__t_sectors_op_write.sum + lts__t_sectors_op_atom.sum + lts__t_sectors_op_red.sum l2_subp0_write_sector_misses lts__t_sectors_op_write_lookup_miss.sum l2_subp1_write_sector_misses lts__t_sectors_op_write_lookup_miss.sum l2_subp0_write_sysmem_sector_queries lts__t_sectors_aperture_sysmem_op_write.sum l2_subp1_write_sysmem_sector_queries lts__t_sectors_aperture_sysmem_op_write.sum l2_subp0_write_tex_hit_sectors lts__t_sectors_srcunit_tex_op_write_lookup_hit.sum l2_subp1_write_tex_hit_sectors lts__t_sectors_srcunit_tex_op_write_lookup_hit.sum l2_subp0_write_tex_sector_queries lts__t_sectors_srcunit_tex_op_write.sum l2_subp1_write_tex_sector_queries lts__t_sectors_srcunit_tex_op_write.sum not_predicated_off_thread_inst_executed smsp__thread_inst_executed_pred_on.sum pcie_rx_active_pulse n/a pcie_tx_active_pulse n/a prof_trigger_00 n/a prof_trigger_01 n/a prof_trigger_02 n/a prof_trigger_03 n/a prof_trigger_04 n/a prof_trigger_05 n/a prof_trigger_06 n/a prof_trigger_07 n/a inst_issued0 smsp__issue_inst0.sum sm_cta_launched sm__ctas_launched.sum shared_load smsp__inst_executed_op_shared_ld.sum shared_store smsp__inst_executed_op_shared_st.sum generic_load smsp__inst_executed_op_generic_ld.sum generic_store smsp__inst_executed_op_generic_st.sum global_load smsp__inst_executed_op_global_ld.sum global_store smsp__inst_executed_op_global_st.sum local_load smsp__inst_executed_op_local_ld.sum local_store smsp__inst_executed_op_local_st.sum shared_atom smsp__inst_executed_op_shared_atom.sum shared_atom_cas smsp__inst_executed_op_shared_atom_dot_cas.sum shared_ld_bank_conflict l1tex__data_bank_conflicts_pipe_lsu_mem_shared_op_ld.sum shared_st_bank_conflict l1tex__data_bank_conflicts_pipe_lsu_mem_shared_op_st.sum shared_ld_transactions l1tex__data_pipe_lsu_wavefronts_mem_shared_op_ld.sum shared_st_transactions l1tex__data_pipe_lsu_wavefronts_mem_shared_op_st.sum tensor_pipe_active_cycles_s0 smsp__pipe_tensor_cycles_active.sum tensor_pipe_active_cycles_s1 smsp__pipe_tensor_cycles_active.sum tensor_pipe_active_cycles_s2 smsp__pipe_tensor_cycles_active.sum tensor_pipe_active_cycles_s3 smsp__pipe_tensor_cycles_active.sum thread_inst_executed smsp__thread_inst_executed.sum warps_launched smsp__warps_launched.sum", "keywords": []}, {"id": 126, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "page", "name": "NsightComputeCli/index#file", "display_name": "File", "type": "section", "display_type": "Page section", "docname": "NsightComputeCli/index", "anchor": "file", "priority": -1, "content": "Option Description Default log-file Send all tool output to the specified file, or one of the standard channels. The file will be overwritten. If the file doesn\u2019t exist, a new one will be created.\u201dstdout\u201d as the whole file name indicates standard output channel (stdout). \u201cstderr\u201d as the whole file name indicates standard error channel (stderr).\u201d If --log-file is not set , profile results will be printed on the console. o,export Set the output file for writing the profile report. If not set, a temporary file will be used which is removed afterwards. The specified name supports macro expansion. See File Macros for more details. If --export is set and no --page option is given, no profile results will be printed on the console. f,force-overwrite Force overwriting all output files. By default, the profiler won\u2019t overwrite existing output files and show an error instead. i,import Set the input file for reading the profile results. open-in-ui Open report in UI instead of showing result on terminal. (Only available on host platforms) section-folder-restore Restores stock files to the default section folder or the folder specified by an accompanying \u2013section-folder option. If the operation will overwrite modified files then the \u2013force-overwrite option is required.", "keywords": []}, {"id": 127, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "page", "name": "NsightComputeCli/index#file-macros", "display_name": "File Macros", "type": "section", "display_type": "Page section", "docname": "NsightComputeCli/index", "anchor": "file-macros", "priority": -1, "content": "The file name specified with option -o or --export supports the following macro expansions. Occurrences of these macros in the report file name are replaced by the corresponding character sequence. If not specified otherwise, the macros cannot be used as part of the file path. Macro Description %h Expands to the host name of the machine on which the command line profiler is running. %q{ENV_NAME} Expands to the content of the variable with the given name ENV_NAME from the environment of the command line profiler. %p Expands to the process ID of the command line profiler. %i Expands to the lowest unused positive integer number that guarantees the resulting file name is not yet used. This macro can only be used once in the output file name. %% Expands to a single % character in the output file name. This macro can be used in the file path and the file name.", "keywords": []}, {"id": 128, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "page", "name": "NsightComputeCli/index#filtering", "display_name": "Filtering", "type": "section", "display_type": "Page section", "docname": "NsightComputeCli/index", "anchor": "filtering", "priority": -1, "content": "Filtering by kernel name Both nvprof and NVIDIA Nsight Compute CLI support filtering which kernels\u2019 data should be collected. In nvprof, the option is --kernels and applies to following metric collection options. In NVIDIA Nsight Compute CLI, the option is named --kernel-regex and applies to the complete application execution. In other words, NVIDIA Nsight Compute CLI does not currently support collecting different metrics for different kernels, unless they execute on different GPU architectures. Filtering by kernel ID Nvprof allows users to specify which kernels to profile using a kernel ID description, using the same --kernels option. In NVIDIA Nsight Compute CLI, the syntax for this kernel ID is identical, but the option is named --kernel-id . Filtering by device Both nvprof and NVIDIA Nsight Compute CLI use --devices to filter the devices which to profile. In contrast to nvprof, in NVIDIA Nsight Compute CLI the option applies globally, not only to following options.", "keywords": []}, {"id": 129, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "page", "name": "NsightComputeCli/index#general", "display_name": "General", "type": "section", "display_type": "Page section", "docname": "NsightComputeCli/index", "anchor": "general", "priority": -1, "content": "Option Description Default h,help Show help message v,version Show version information mode Select the mode of interaction with the target application launch-and-attach: Launch the target application and immediately attach for profiling. launch: Launch the target application and suspend in the first intercepted API call, wait for tool to attach. attach: Attach to a previously launched application to which no other tool is attached. launch-and-attach p,port Base port used for connecting to target applications for --mode launch/attach 49152 max-connections Maximum number of ports for connecting to target applications 64 config-file Use config.ncu-cfg config file to set parameters. Searches in the current working directory, in \u201c$HOME/.config/NVIDIA Corporation\u201d on Linux and in \u201c%APPDATA%\\NVIDIA Corporation\\\u201d on Windows. on config-file-path Override the default path for config file.", "keywords": []}, {"id": 130, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "page", "name": "NsightComputeCli/index#introduction", "display_name": "Introduction", "type": "section", "display_type": "Page section", "docname": "NsightComputeCli/index", "anchor": "introduction", "priority": -1, "content": "NVIDIA Nsight Compute CLI (ncu) provides a non-interactive way to profile applications from the command line. It can print the results directly on the command line or store them in a report file. It can also be used to simply launch the target application (see General for details) and later attach with NVIDIA Nsight Compute or another ncu instance. For users migrating from nvprof to NVIDIA Nsight Compute, please additionally see the Nvprof Transition Guide for comparison of features and workflows.", "keywords": []}, {"id": 131, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "page", "name": "NsightComputeCli/index#launch", "display_name": "Launch", "type": "section", "display_type": "Page section", "docname": "NsightComputeCli/index", "anchor": "launch", "priority": -1, "content": "Option Description Default check-exit-code Check the application exit code and print an error if it is different than 0. If set, --replay-mode application will stop after the first pass if the exit code is not 0. yes injection-path-64 Override the default path for the injection libraries. The injection libraries are used by the tools to intercept relevant APIs (like CUDA or NVTX). preload-library Prepend a shared library to be loaded by the application before the injection libraries. This option can be given multiple times and the libraries will be loaded in the order they were specified. call-stack Enable CPU Call Stack collection. false nvtx Enable NVTX support for tools. false target-processes Select the processes you want to profile. Available modes are: application-only Profile only the root application process. all Profile the application and all its child processes. all target-processes-filter Set the comma separated expressions to filter which processes are profiled. <process name> Set the exact process name to include for profiling. regex:<expression> Set the regex to filter matching process name profiling. On shells that recognize regular expression symbols as special characters (e.g. Linux bash), the expression needs to be escaped with quotes, e.g. --target-processes-filter regex:".*Process" . When using regex: , the expression must not include any commas. exclude:<process name> Set the exact process name to exclude for profiling. exclude-tree:<process name> Set the exact process name to exclude for profiling and further process tracking. None of its child processes will be profiled, even if they match a positive filter. This option is not available on Windows. The executable name part of the process will be considered in the match. Processing of filters stops at the first match. If any positive filter is specified, no process that is not matching a positive filter is profiled. Examples --target-processes-filter MatrixMul Filter all processes having executable name exactly as \u201cMatrixMul\u201d. --target-processes-filter regex:Matrix Filter all processes that include the string \u201cMatrix\u201d in their executable name, e.g. \u201cMatrixMul\u201d and \u201cMatrixAdd\u201d. --target-processes-filter MatrixMul,MatrixAdd Filter all processes having executable name exactly as \u201cMatrixMul\u201d or \u201cMatrixAdd\u201d. --target-processes-filter exclude:MatrixMul.exe Exclude only \u201cMatrixMul.exe\u201d. --target-processes-filter exclude-tree:ChildLauncher,ParentProcess Exclude \u201cChildLauncher\u201d and all its sub-processes. Include (only) \u201cParentProcess\u201d, but not if it\u2019s a child of \u201cChildLauncher\u201d. support-32bit Support profiling processes launched from 32-bit applications. This option is only available on x86_64 Linux. On Windows, tracking 32-bit applications is enabled by default. no null-stdin Launch the application with \u2018/dev/null\u2019 as its standard input. This avoids applications reading from standard input being stopped by SIGTTIN signals and hanging when running as backgrounded processes. false", "keywords": []}, {"id": 132, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "page", "name": "NsightComputeCli/index#launch-and-attach", "display_name": "Launch and Attach", "type": "section", "display_type": "Page section", "docname": "NsightComputeCli/index", "anchor": "launch-and-attach", "priority": -1, "content": "Launching a process for profiling In nvprof, the application to profile is passed to the tool as a command line argument. The application must be a local executable. Alternatively, you can choose to use the tool in a daemon mode and profile all applicable processes on the local machine (nvprof option --profile-all-processes ). In nvprof, the decision to profile the complete process tree or only the root process is done via the --profile-child-processes flag. In NVIDIA Nsight Compute CLI, the --target-processes option is used for this. NVIDIA Nsight Compute CLI has several modes to determine which application to collect data for. By default, the executable passed via the command line to the tool is started, connected to, and profiled. This mode is called launch-and-attach . Launching a process for attach In contrast to nvprof, you can choose to only launch a local executable. In this mode ( --mode launch ), the process is started, connected to, but then suspended at the first CUDA API call. Subsequently, there is a third mode ( --mode attach ) to attach to any process launched using the aforementioned mode. In this case, all profiling and output options would be passed to the attaching instance of NVIDIA Nsight Compute CLI. Remote profiling Finally, using launch and attach , you can connect to a launched process on a remote machine, which could even run a different operating system than the local host. Use --hostname to select which remote host to connect to. Notices Notices ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, \u201cMATERIALS\u201d) ARE BEING PROVIDED \u201cAS IS.\u201d NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. Information furnished is believed to be accurate and reliable. However, NVIDIA Corporation assumes no responsibility for the consequences of use of such information or for any infringement of patents or other rights of third parties that may result from its use. No license is granted by implication of otherwise under any patent rights of NVIDIA Corporation. Specifications mentioned in this publication are subject to change without notice. This publication supersedes and replaces all other information previously supplied. NVIDIA Corporation products are not authorized as critical components in life support devices or systems without express written approval of NVIDIA Corporation. Trademarks NVIDIA and the NVIDIA logo are trademarks or registered trademarks of NVIDIA Corporation in the U.S. and other countries. Other company and product names may be trademarks of the respective companies with which they are associated.", "keywords": []}, {"id": 133, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "page", "name": "NsightComputeCli/index#metric-collection", "display_name": "Metric Collection", "type": "section", "display_type": "Page section", "docname": "NsightComputeCli/index", "anchor": "metric-collection", "priority": -1, "content": "Finding available metrics For nvprof, you can use --query-metrics to see the list of metrics available for the current devices on your machine. You can also use --devices to filter which local devices to query. For NVIDIA Nsight Compute CLI, this functionality is the same. However, in addition, you can combine --query-metrics with --chip [chipname] to query the available metrics for any chip, not only the ones in your present CUDA devices. Note that metric names have changed between nvprof and NVIDIA Nsight Compute CLI and metric names also differ between chips after (and including) GV100 and those before. See Metric Comparison for a comparison of nvprof and NVIDIA Nsight Compute metric names. On Volta and newer GPUs, most metrics are named using a base name and various suffixes, e.g. sm__throughput.avg.pct_of_peak_sustained_elapsed . The base name is sm__throughput and the suffix is avg.pct_of_peak_sustained_elapsed . This is because most metrics follow the same structure and have the same set of suffixes. You need to pass the full name to NVIDIA Nsight Compute when selecting a metric for profiling. To reduce the number of metrics shown for Volta and newer GPUs when using --query-metrics , by default only the base names are shown. Use --query-metrics-mode suffix --metrics <metrics list> to see the full names for the chosen metrics. Use --query-metrics-mode all to see all metrics with their full name directly. Selecting which metrics to collect In both nvprof and NVIDIA Nsight Compute CLI, you can specify a comma-separated list of metric names to the --metrics option. While nvprof would allow you to collect either a list or all metrics, in NVIDIA Nsight Compute CLI you can use regular expressions to select a more fine-granular subset of all available metrics. For example, you can use --metrics "regex:.*" to collect all metrics, or --metrics "regex:smsp__cycles_elapsed" to collect all \u201csmsp__cycles_elapsed\u201d metrics. Selecting which events to collect You cannot collect any events in NVIDIA Nsight Compute CLI. Selecting which section to collect In nvprof, you can either collect individual metrics or events, or a pre-configured set (all, analysis-metrics). NVIDIA Nsight Compute CLI adds the concept of a section. A section is a file that describes which metrics to collect for which GPU architecture, or architecture range. Furthermore, it defines how those metrics will be shown in both the command line output or the user interface. This includes structuring in tables, charts, histograms etc. NVIDIA Nsight Compute CLI comes with a set of pre-defined sections, located in the sections directory. You can inspect, modify or extend those, as well as add new ones, e.g. to easily collect recurring metric sets. Each section specifies a unique section identifier , and there must not be two sections with the same identifier in the search path. By default, the sections associated with the basic section set are collected. You can select one or more individual sections using the --section [section identifier] option one or more times. If no --section option is given, but --metrics is used, no sections will be collected. Selecting which section set to collect In nvprof, you can either collect individual metrics or events, or a pre-configured set (all, analysis-metrics). NVIDIA Nsight Compute CLI adds the concept of section sets . A section set defines a group of sections to collect together, in order to achieve different profiling overheads, depending on the required analysis level of detail. If no other options are selected, the basic section set is collected. You can select one or more sets using the --set [set identifier] option one or more times. If no --set option is given, but --section or --metrics is used, no sets will be collected.", "keywords": []}, {"id": 134, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "page", "name": "NsightComputeCli/index#metric-comparison", "display_name": "Metric Comparison", "type": "section", "display_type": "Page section", "docname": "NsightComputeCli/index", "anchor": "metric-comparison", "priority": -1, "content": "NVIDIA Nsight Compute uses two groups of metrics, depending on which GPU architecture is profiled. For nvprof metrics, the following table lists the equivalent metrics in NVIDIA Nsight Compute, if available. For a detailed explanation of the structuring of PerfWorks metrics, see Metrics Structure . Metrics starting with sm__& are collected per-SM. Metrics starting with *smsp__ are collected per-SM subpartition. However, all corresponding nvprof events are collected per-SM, only. Check the Metrics Guide for more details on these terms. nvprof Metric PerfWorks Metric or Formula (>= SM 7.0) achieved_occupancy sm__warps_active.avg.pct_of_peak_sustained_active atomic_transactions l1tex__t_set_accesses_pipe_lsu_mem_global_op_atom.sum + l1tex__t_set_accesses_pipe_lsu_mem_global_op_red.sum atomic_transactions_per_request (l1tex__t_sectors_pipe_lsu_mem_global_op_atom.sum + l1tex__t_sectors_pipe_lsu_mem_global_op_red.sum) / (l1tex__t_requests_pipe_lsu_mem_global_op_atom.sum + l1tex__t_requests_pipe_lsu_mem_global_op_red.sum) branch_efficiency smsp__sass_average_branch_targets_threads_uniform.pct cf_executed smsp__inst_executed_pipe_cbu.sum + smsp__inst_executed_pipe_adu.sum cf_fu_utilization n/a cf_issued n/a double_precision_fu_utilization smsp__inst_executed_pipe_fp64.avg.pct_of_peak_sustained_active dram_read_bytes dram__bytes_read.sum dram_read_throughput dram__bytes_read.sum.per_second dram_read_transactions dram__sectors_read.sum dram_utilization dram__throughput.avg.pct_of_peak_sustained_elapsed dram_write_bytes dram__bytes_write.sum dram_write_throughput dram__bytes_write.sum.per_second dram_write_transactions dram__sectors_write.sum eligible_warps_per_cycle smsp__warps_eligible.sum.per_cycle_active flop_count_dp smsp__sass_thread_inst_executed_op_dadd_pred_on.sum + smsp__sass_thread_inst_executed_op_dmul_pred_on.sum + smsp__sass_thread_inst_executed_op_dfma_pred_on.sum * 2 flop_count_dp_add smsp__sass_thread_inst_executed_op_dadd_pred_on.sum flop_count_dp_fma smsp__sass_thread_inst_executed_op_dfma_pred_on.sum flop_count_dp_mul smsp__sass_thread_inst_executed_op_dmul_pred_on.sum flop_count_hp smsp__sass_thread_inst_executed_op_hadd_pred_on.sum + smsp__sass_thread_inst_executed_op_hmul_pred_on.sum + smsp__sass_thread_inst_executed_op_hfma_pred_on.sum * 2 flop_count_hp_add smsp__sass_thread_inst_executed_op_hadd_pred_on.sum flop_count_hp_fma smsp__sass_thread_inst_executed_op_hfma_pred_on.sum flop_count_hp_mul smsp__sass_thread_inst_executed_op_hmul_pred_on.sum flop_count_sp smsp__sass_thread_inst_executed_op_fadd_pred_on.sum + smsp__sass_thread_inst_executed_op_fmul_pred_on.sum + smsp__sass_thread_inst_executed_op_ffma_pred_on.sum * 2 flop_count_sp_add smsp__sass_thread_inst_executed_op_fadd_pred_on.sum flop_count_sp_fma smsp__sass_thread_inst_executed_op_ffma_pred_on.sum flop_count_sp_mul smsp__sass_thread_inst_executed_op_fmul_pred_on.sum flop_count_sp_special n/a flop_dp_efficiency smsp__sass_thread_inst_executed_ops_dadd_dmul_dfma_pred_on.avg.pct_of_peak_sustained_elapsed flop_hp_efficiency smsp__sass_thread_inst_executed_ops_hadd_hmul_hfma_pred_on.avg.pct_of_peak_sustained_elapsed flop_sp_efficiency smsp__sass_thread_inst_executed_ops_fadd_fmul_ffma_pred_on.avg.pct_of_peak_sustained_elapsed gld_efficiency smsp__sass_average_data_bytes_per_sector_mem_global_op_ld.pct gld_requested_throughput n/a gld_throughput l1tex__t_bytes_pipe_lsu_mem_global_op_ld.sum.per_second gld_transactions l1tex__t_sectors_pipe_lsu_mem_global_op_ld.sum gld_transactions_per_request l1tex__average_t_sectors_per_request_pipe_lsu_mem_global_op_ld.ratio global_atomic_requests l1tex__t_requests_pipe_lsu_mem_global_op_atom.sum global_hit_rate (l1tex__t_sectors_pipe_lsu_mem_global_op_ld_lookup_hit.sum + l1tex__t_sectors_pipe_lsu_mem_global_op_st_lookup_hit.sum + l1tex__t_sectors_pipe_lsu_mem_global_op_red_lookup_hit.sum + l1tex__t_sectors_pipe_lsu_mem_global_op_atom_lookup_hit.sum) / (l1tex__t_sectors_pipe_lsu_mem_global_op_ld.sum + l1tex__t_sectors_pipe_lsu_mem_global_op_st.sum + l1tex__t_sectors_pipe_lsu_mem_global_op_red.sum + l1tex__t_sectors_pipe_lsu_mem_global_op_atom.sum) global_load_requests l1tex__t_requests_pipe_lsu_mem_global_op_ld.sum global_reduction_requests l1tex__t_requests_pipe_lsu_mem_global_op_red.sum global_store_requests l1tex__t_requests_pipe_lsu_mem_global_op_st.sum gst_efficiency smsp__sass_average_data_bytes_per_sector_mem_global_op_st.pct gst_requested_throughput n/a gst_throughput l1tex__t_bytes_pipe_lsu_mem_global_op_st.sum.per_second gst_transactions l1tex__t_sectors_pipe_lsu_mem_global_op_st.sum gst_transactions_per_request l1tex__average_t_sectors_per_request_pipe_lsu_mem_global_op_st.ratio half_precision_fu_utilization smsp__inst_executed_pipe_fp16.avg.pct_of_peak_sustained_active inst_bit_convert smsp__sass_thread_inst_executed_op_conversion_pred_on.sum inst_compute_ld_st smsp__sass_thread_inst_executed_op_memory_pred_on.sum inst_control smsp__sass_thread_inst_executed_op_control_pred_on.sum inst_executed smsp__inst_executed.sum inst_executed_global_atomics smsp__sass_inst_executed_op_global_atom.sum inst_executed_global_loads smsp__inst_executed_op_global_ld.sum inst_executed_global_reductions smsp__inst_executed_op_global_red.sum inst_executed_global_stores smsp__inst_executed_op_global_st.sum inst_executed_local_loads smsp__inst_executed_op_local_ld.sum inst_executed_local_stores smsp__inst_executed_op_local_st.sum inst_executed_shared_atomics smsp__inst_executed_op_shared_atom.sum + smsp__inst_executed_op_shared_atom_dot_alu.sum + smsp__inst_executed_op_shared_atom_dot_cas.sum inst_executed_shared_loads smsp__inst_executed_op_shared_ld.sum inst_executed_shared_stores smsp__inst_executed_op_shared_st.sum inst_executed_surface_atomics smsp__inst_executed_op_surface_atom.sum inst_executed_surface_loads smsp__inst_executed_op_surface_ld.sum + smsp__inst_executed_op_shared_atom_dot_alu.sum + smsp__inst_executed_op_shared_atom_dot_cas.sum inst_executed_surface_reductions smsp__inst_executed_op_surface_red.sum inst_executed_surface_stores smsp__inst_executed_op_surface_st.sum inst_executed_tex_ops smsp__inst_executed_op_texture.sum inst_fp_16 smsp__sass_thread_inst_executed_op_fp16_pred_on.sum inst_fp_32 smsp__sass_thread_inst_executed_op_fp32_pred_on.sum inst_fp_64 smsp__sass_thread_inst_executed_op_fp64_pred_on.sum inst_integer smsp__sass_thread_inst_executed_op_integer_pred_on.sum inst_inter_thread_communication smsp__sass_thread_inst_executed_op_inter_thread_communication_pred_on.sum inst_issued smsp__inst_issued.sum inst_misc smsp__sass_thread_inst_executed_op_misc_pred_on.sum inst_per_warp smsp__average_inst_executed_per_warp.ratio inst_replay_overhead n/a ipc smsp__inst_executed.avg.per_cycle_active issue_slot_utilization smsp__issue_active.avg.pct_of_peak_sustained_active issue_slots smsp__inst_issued.sum issued_ipc smsp__inst_issued.avg.per_cycle_active l2_atomic_throughput 2 * ( lts__t_sectors_op_atom.sum.per_second + lts__t_sectors_op_red.sum.per_second ) l2_atomic_transactions 2 * ( lts__t_sectors_op_atom.sum + lts__t_sectors_op_red.sum ) l2_global_atomic_store_bytes lts__t_bytes_equiv_l1sectormiss_pipe_lsu_mem_global_op_atom.sum l2_global_load_bytes lts__t_bytes_equiv_l1sectormiss_pipe_lsu_mem_global_op_ld.sum l2_local_global_store_bytes lts__t_bytes_equiv_l1sectormiss_pipe_lsu_mem_local_op_st.sum + lts__t_bytes_equiv_l1sectormiss_pipe_lsu_mem_global_op_st.sum l2_local_load_bytes lts__t_bytes_equiv_l1sectormiss_pipe_lsu_mem_local_op_ld.sum l2_read_throughput lts__t_sectors_op_read.sum.per_second + lts__t_sectors_op_atom.sum.per_second + lts__t_sectors_op_red.sum.per_second 2 l2_read_transactions lts__t_sectors_op_read.sum + lts__t_sectors_op_atom.sum + lts__t_sectors_op_red.sum 2 l2_surface_load_bytes lts__t_bytes_equiv_l1sectormiss_pipe_tex_mem_surface_op_ld.sum l2_surface_store_bytes lts__t_bytes_equiv_l1sectormiss_pipe_tex_mem_surface_op_st.sum l2_tex_hit_rate lts__t_sector_hit_rate.pct l2_tex_read_hit_rate lts__t_sector_op_read_hit_rate.pct l2_tex_read_throughput lts__t_sectors_srcunit_tex_op_read.sum.per_second l2_tex_read_transactions lts__t_sectors_srcunit_tex_op_read.sum l2_tex_write_hit_rate lts__t_sector_op_write_hit_rate.pct l2_tex_write_throughput lts__t_sectors_srcunit_tex_op_write.sum.per_second l2_tex_write_transactions lts__t_sectors_srcunit_tex_op_write.sum l2_utilization lts__t_sectors.avg.pct_of_peak_sustained_elapsed l2_write_throughput lts__t_sectors_op_write.sum.per_second + lts__t_sectors_op_atom.sum.per_second + lts__t_sectors_op_red.sum.per_second l2_write_transactions lts__t_sectors_op_write.sum + lts__t_sectors_op_atom.sum + lts__t_sectors_op_red.sum ldst_executed n/a ldst_fu_utilization smsp__inst_executed_pipe_lsu.avg.pct_of_peak_sustained_active ldst_issued n/a local_hit_rate n/a local_load_requests l1tex__t_requests_pipe_lsu_mem_local_op_ld.sum local_load_throughput l1tex__t_bytes_pipe_lsu_mem_local_op_ld.sum.per_second local_load_transactions l1tex__t_sectors_pipe_lsu_mem_local_op_ld.sum local_load_transactions_per_request l1tex__average_t_sectors_per_request_pipe_lsu_mem_local_op_ld.ratio local_memory_overhead n/a local_store_requests l1tex__t_requests_pipe_lsu_mem_local_op_st.sum local_store_throughput l1tex__t_sectors_pipe_lsu_mem_local_op_st.sum.per_second local_store_transactions l1tex__t_sectors_pipe_lsu_mem_local_op_st.sum local_store_transactions_per_request l1tex__average_t_sectors_per_request_pipe_lsu_mem_local_op_st.ratio nvlink_data_receive_efficiency n/a nvlink_data_transmission_efficiency n/a nvlink_overhead_data_received (nvlrx__bytes_data_protocol.sum / nvlrx__bytes.sum) * 100 nvlink_overhead_data_transmitted (nvltx__bytes_data_protocol.sum / nvltx__bytes.sum) * 100 nvlink_receive_throughput nvlrx__bytes.sum.per_second nvlink_total_data_received nvlrx__bytes.sum nvlink_total_data_transmitted nvltx__bytes.sum nvlink_total_nratom_data_transmitted n/a nvlink_total_ratom_data_transmitted n/a nvlink_total_response_data_received n/a nvlink_total_write_data_transmitted n/a nvlink_transmit_throughput nvltx__bytes.sum.per_second nvlink_user_data_received nvlrx__bytes_data_user.sum nvlink_user_data_transmitted nvltx__bytes_data_user.sum nvlink_user_nratom_data_transmitted n/a nvlink_user_ratom_data_transmitted n/a nvlink_user_response_data_received n/a nvlink_user_write_data_transmitted n/a pcie_total_data_received pcie__read_bytes.sum pcie_total_data_transmitted pcie__write_bytes.sum shared_efficiency smsp__sass_average_data_bytes_per_wavefront_mem_shared.pct shared_load_throughput l1tex__data_pipe_lsu_wavefronts_mem_shared_op_ld.sum.per_second shared_load_transactions l1tex__data_pipe_lsu_wavefronts_mem_shared_op_ld.sum shared_load_transactions_per_request n/a shared_store_throughput l1tex__data_pipe_lsu_wavefronts_mem_shared_op_st.sum.per_second shared_store_transactions l1tex__data_pipe_lsu_wavefronts_mem_shared_op_st.sum shared_store_transactions_per_request n/a shared_utilization l1tex__data_pipe_lsu_wavefronts_mem_shared.avg.pct_of_peak_sustained_elapsed single_precision_fu_utilization smsp__pipe_fma_cycles_active.avg.pct_of_peak_sustained_active sm_efficiency smsp__cycles_active.avg.pct_of_peak_sustained_elapsed sm_tex_utilization l1tex__texin_sm2tex_req_cycles_active.avg.pct_of_peak_sustained_elapsed special_fu_utilization smsp__inst_executed_pipe_xu.avg.pct_of_peak_sustained_active stall_constant_memory_dependency smsp__warp_issue_stalled_imc_miss_per_warp_active.pct stall_exec_dependency smsp__warp_issue_stalled_short_scoreboard_per_warp_active.pct + smsp__warp_issue_stalled_wait_per_warp_active.pct stall_inst_fetch smsp__warp_issue_stalled_no_instruction_per_warp_active.pct stall_memory_dependency smsp__warp_issue_stalled_long_scoreboard_per_warp_active.pct stall_memory_throttle smsp__warp_issue_stalled_drain_per_warp_active.pct + smsp__warp_issue_stalled_lg_throttle_per_warp_active.pct stall_not_selected smsp__warp_issue_stalled_not_selected_per_warp_active.pct stall_other smsp__warp_issue_stalled_dispatch_stall_per_warp_active.pct + smsp__warp_issue_stalled_misc_per_warp_active.pct stall_pipe_busy smsp__warp_issue_stalled_math_pipe_throttle_per_warp_active.pct + smsp__warp_issue_stalled_mio_throttle_per_warp_active.pct stall_sleeping smsp__warp_issue_stalled_sleeping_per_warp_active.pct stall_sync smsp__warp_issue_stalled_barrier_per_warp_active.pct + smsp__warp_issue_stalled_membar_per_warp_active.pct stall_texture smsp__warp_issue_stalled_tex_throttle_per_warp_active.pct surface_atomic_requests l1tex__t_requests_pipe_tex_mem_surface_op_atom.sum surface_load_requests l1tex__t_requests_pipe_tex_mem_surface_op_ld.sum surface_reduction_requests l1tex__t_requests_pipe_tex_mem_surface_op_red.sum surface_store_requests l1tex__t_requests_pipe_tex_mem_surface_op_st.sum sysmem_read_bytes lts__t_sectors_aperture_sysmem_op_read * 32 sysmem_read_throughput lts__t_sectors_aperture_sysmem_op_read.sum.per_second sysmem_read_transactions lts__t_sectors_aperture_sysmem_op_read.sum sysmem_read_utilization n/a sysmem_utilization n/a sysmem_write_bytes lts__t_sectors_aperture_sysmem_op_write * 32 sysmem_write_throughput lts__t_sectors_aperture_sysmem_op_write.sum.per_second sysmem_write_transactions lts__t_sectors_aperture_sysmem_op_write.sum sysmem_write_utilization n/a tensor_precision_fu_utilization sm__pipe_tensor_op_hmma_cycles_active.avg.pct_of_peak_sustained_active tensor_precision_int_utilization sm__pipe_tensor_op_imma_cycles_active.avg.pct_of_peak_sustained_active (SM 7.2+) tex_cache_hit_rate l1tex__t_sector_hit_rate.pct tex_cache_throughput n/a tex_cache_transactions l1tex__lsu_writeback_active.avg.pct_of_peak_sustained_active + l1tex__tex_writeback_active.avg.pct_of_peak_sustained_active tex_fu_utilization smsp__inst_executed_pipe_tex.avg.pct_of_peak_sustained_active tex_sm_tex_utilization l1tex__f_tex2sm_cycles_active.avg.pct_of_peak_sustained_elapsed tex_sm_utilization sm__mio2rf_writeback_active.avg.pct_of_peak_sustained_elapsed tex_utilization n/a texture_load_requests l1tex__t_requests_pipe_tex_mem_texture.sum warp_execution_efficiency smsp__thread_inst_executed_per_inst_executed.ratio warp_nonpred_execution_efficiency smsp__thread_inst_executed_per_inst_executed.pct 2 Sector reads from reductions are added here only for compatibility to the current definition of the metric in nvprof. Reductions do not cause data to be communicated from L2 back to L1.", "keywords": []}, {"id": 135, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "page", "name": "NsightComputeCli/index#metrics-and-units", "display_name": "Metrics and Units", "type": "section", "display_type": "Page section", "docname": "NsightComputeCli/index", "anchor": "metrics-and-units", "priority": -1, "content": "When available and applicable, metrics are shown along with their unit. This is to make it apparent if a metric represents cycles, threads, bytes/s, and so on. By default, units are scaled automatically so that metric values are shown with a reasonable order of magnitude. Units are scaled using their SI-factors, i.e. byte-based units are scaled using a factor of 1000 and the prefixes K, M, G, etc. Time-based units are also scaled using a factor of 1000, with the prefixes n, u and m. This scaling can be changed using a command line option, see Console Output options for details.", "keywords": []}, {"id": 136, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "page", "name": "NsightComputeCli/index#modes", "display_name": "Modes", "type": "section", "display_type": "Page section", "docname": "NsightComputeCli/index", "anchor": "modes", "priority": -1, "content": "Modes change the fundamental behavior of the command line profiler. Depending on which mode is chosen, different Command Line Options become available. For example, Launch is invalid if the Attach mode is selected. Launch-and-attach: The target application is launched on the local system with the tool\u2019s injection libraries. Depending on which profiling options are chosen, selected kernels in the application are profiled and the results printed to the console or stored in a report file. The tool exits once the target application finishes or crashes, and once all results are processed. This is the default, and the only mode that supports profiling of child processes on selected platforms. Launch: The target application is launched on the local system with the tool\u2019s injection libraries. As soon as the first intercepted API call is reached (commonly cuInit() ), all application threads are suspended. The application now expects a tool to attach for profiling. You can attach using NVIDIA Nsight Compute or using the command line profiler\u2019s Attach mode. Attach: The tool tries to connect to a target application previously launched using NVIDIA Nsight Compute or using the command line profiler\u2019s Launch mode. The tool can attach to a target on the local system or using a remote connection.", "keywords": []}, {"id": 137, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "page", "name": "NsightComputeCli/index#multi-process-support", "display_name": "Multi-Process Support", "type": "section", "display_type": "Page section", "docname": "NsightComputeCli/index", "anchor": "multi-process-support", "priority": -1, "content": "NVIDIA Nsight Compute CLI supports profiling multi-process applications on the following platforms: x86_64 Windows, x86_64 Linux, DRIVE OS Linux, DRIVE OS QNX, PowerPC. See the Launch options on how to enable this feature. On x86_64 Windows, NVIDIA Nsight Compute CLI supports profiling 64-bit processes launched from 32-bit applications by default . On x86_64 Linux, launching from 32-bit applications requires you to enable the support-32bit option, and the required 32-bit libraries must be installed on your system. On DRIVE OS Linux, DRIVE OS QNX and PowerPC, tracking of 32-bit applications is not supported. Profiling of 32-bit processes is not supported on any platform. Profiling MPI applications is a special case of multi-process profiling. NVIDIA Nsight Compute CLI can be used to profile applications launched with the mpirun command. To profile all ranks on a node and store all the profiling data in a single report file: ncu --target-processes all -o <report-name> mpirun [mpi arguments] <app> [app arguments] To profile multi-node submissions, one instance of NVIDIA Nsight Compute CLI can be used per node. Ensure that you specify unique report files per rank. mpirun [mpi arguments] ncu -o report_%q{OMPI_COMM_WORLD_RANK} <app> [app arguments] To profile a single rank one can use a wrapper script. The following script (called \u201cwrap.sh\u201d) profiles rank 0 only: #!/bin/bash if [[ $OMPI_COMM_WORLD_RANK == 0 ]]; then ncu -o report_${OMPI_COMM_WORLD_RANK} --target-processes all "$@" else "$@" fi and then execute: mpirun [mpi arguments] ./wrap.sh <app> [app arguments]", "keywords": []}, {"id": 138, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "page", "name": "NsightComputeCli/index#nvprof-transition-guide", "display_name": "Nvprof Transition Guide", "type": "section", "display_type": "Page section", "docname": "NsightComputeCli/index", "anchor": "nvprof-transition-guide", "priority": -1, "content": "This guide provides tips for moving from nvprof to NVIDIA Nsight Compute CLI. NVIDIA Nsight Compute CLI tries to provide as much feature and usage parity as possible with nvprof, but some features are now covered by different tools and some command line options have changed their name or meaning.", "keywords": []}, {"id": 139, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "page", "name": "NsightComputeCli/index#nvtx-filtering", "display_name": "NVTX Filtering", "type": "section", "display_type": "Page section", "docname": "NsightComputeCli/index", "anchor": "nvtx-filtering", "priority": -1, "content": "--nvtx-include <configuration> --nvtx-exclude <configuration> These options are used to profile only those kernels which satisfy the conditions mentioned in the configuration. Through these options, you can choose which kernel falls into a specific range or collection of ranges. You can use both options multiple times, mentioning all the --nvtx-include configurations followed by all --nvtx-exclude configurations. NVTX filtering requires --nvtx option. NVTX ranges are of two types: NvtxRangeStart/End and NvtxRangePush/Pop. The configuration syntax for both the types are briefly described below. Both range and domain names can contain whitespace. Note that \u201cDomain\u201d and \u201crange\u201d in below example are for illustration purposes only and are not required to mark domain or range names. Push-Pop Ranges Quantifier Description Example / Delimiter between range names. When only a single range name is given, the delimiter must be appended to indicate that this refers to a push/pop range. A_range/ A_range/B range A_range/\\*/B range [ Range is at the bottom of the stack [A_range [A_range/+/Range Z ] Range is at the top of the stack Range Z] Range C/\\*/Range Z] Only one B rangeetween the two other ranges B range/+/Range D * Zero or more range(s) between the two other ranges B range/\\*/Range Z @ Specify domain name. If not mentioned, assuming <default domain> Domain-A@A_range Domain B@A_range/\\*/Range Z] Include kernels wrapped inside push/pop range \u2018A_range\u2019 of \u2018<default-domain>\u2019: ncu --nvtx --nvtx-include "A_range/" CuNvtx.exe Include kernels wrapped inside push/pop range \u2018A_range\u2019 of \u2018Domain-A\u2019: ncu --nvtx --nvtx-include "Domain-A@A_range/" CuNvtx.exe Include kernels wrapped inside push/pop range \u2018A_range\u2019 of \u2018<default domain>\u2019, where \u2018A_range\u2019 is at the bottom of the stack: ncu --nvtx --nvtx-include "[A_range" CuNvtx.exe Include kernels wrapped inside push/pop ranges \u2018A_range\u2019 and \u2018B range\u2019 of \u2018<default domain>\u2019, with zero or many ranges between them: ncu --nvtx --nvtx-include "A_range/*/B range" CuNvtx.exe Exclude kernels wrapped inside push/pop ranges \u2018A_range\u2019 and \u2018B range\u2019 of \u2018<default domain>\u2019, with zero or many ranges between them: ncu --nvtx --nvtx-exclude "A_range/*/B range" CuNvtx.exe Include kernels wrapped inside only push/pop range \u2018A_range\u2019 of \u2018<default domain>\u2019 but not inside \u2018B range\u2019 at the top of the stack: ncu --nvtx --nvtx-include "A_range/" --nvtx-exclude "B range]" CuNvtx.exe Start-End Ranges Quantifier Description Example , Delimiter between range names A_range,B range B range,A_range,Range C @ Specify domain name. If not mentioned, assuming <default domain> Domain-A@A_range Domain B@B range,Range Z Include kernels wrapped inside start/end range \u2018A_range\u2019 of \u2018Domain-A\u2019: ncu --nvtx --nvtx-include "Domain-A@A_range" CuNvtx.exe Include kernels wrapped inside both start/end ranges, \u2018A_range\u2019 and \u2018B range\u2019 of \u2018<default domain>\u2019: ncu --nvtx --nvtx-include "A_range,B range" CuNvtx.exe Include kernels wrapped inside start/end ranges, \u2018A_range\u2019 or \u2018B range\u2019 of \u2018<default domain>\u2019: ncu --nvtx --nvtx-include "A_range" --nvtx-include "B range" CuNvtx.exe Include all kernels, except those which are wrapped inside start/end range \u2018A_range\u2019 of \u2018<default domain>\u2019: ncu --nvtx --nvtx-exclude "A_range" CuNvtx.exe Include kernels wrapped inside only start/end \u2018B range\u2019 and not \u2018A_range\u2019 of \u2018<default domain>\u2019: ncu --nvtx --nvtx-include "B range"--nvtx-exclude "A_range" CuNvtx.exe Regular Expression Support The configuration syntax for both the types NvtxRangeStart/End and NvtxRangePush/Pop is the same. Additionally, to use regular expressions, follow the following syntax. Provide prefix \u2018regex:\u2019 to treat nvtx config as regular expression. ncu --nvtx --nvtx-include "regex:Domain[A-Z]@Range[0-9]/" CuNvtx.exe The kernels wrapped inside push/pop range with matching regex \u2018Range[0-9]\u2019 of domain with matching regex \u2018Domain[A-Z]\u2019 are profiled. Provide \u2018/\u2019 as a prefix to \u201c[\u201d or \u201c]\u201d only for the range part of the config if \u201c[\u201d or \u201c]\u201d is at the start or at the end of the range part, respectively. This is needed so that NCU can distinguish if \u201c[\u201d or \u201c]\u201d is part of the regex or represents the top/bottom of the stack. ncu --nvtx --nvtx-include "regex:[0-9]domainA@/[0-9]rangeA,RangeC[0-9/]" CuNvtx.exe The kernels wrapped inside start/end ranges with matching regex \u2018[0-9]rangeA\u2019 and \u2018RangeC[0-9]\u2019 of domain with matching regex \u2018[0-9]domainA\u2019 are profiled. If any quantifier is part of the domain/range name, you need to use \u2018\\\\\u2019 or \u2018\\\u2019 as a prefix. For the \u201c$\u201d quantifier, only the \u2018\\\\\u2019 prefix is valid. Additional Information --nvtx-include DomainA@RangeA,DomainB@RangeB //Not a valid config In a single NVTX configuration, multiple ranges with regard to a single domain can be specified. Mentioning ranges from different domains inside a single NVTX config is not supported. --nvtx-include "A_range\\[i\\]" Quantifiers \u2018@\u2019 \u2018,\u2019 \u2018[\u2019 \u2018]\u2019 \u2018/\u2019 \u2018*\u2019 \u2018+\u2019 can be used in range names using prefix \u2018\\\u2019. The kernels wrapped inside \u2018A_range[i]\u2019 of \u2018<default domain>\u2019 in the application are profiled. --nvtx-include "A_range" //Start/End configuration --nvtx-inlcude "A_range/" //Push/Pop configuration --nvtx-inlcude "A_range]" //Push/Pop configuration If the domain/range name contains \u2018\\\u2019, you need to provide \u2018\\\\\\\\\u2019 in the config. Do not use \u2018\\\\\\\\\u2019 before any quantifier. Including/Excluding only single range for Push/Pop configuration without specifying stack frame position \u2018[\u2019 or \u2018]\u2019, use \u2018/\u2019 quantifier at the end. --nvtx-include "A_range/*/B range" The order in which you mention Push/Pop configurations is important. In the above example, \u2018A_range\u2019 should be below \u2018B range\u2019 in the stack of ranges so that the kernel is profiled. NVTX filtering honors cudaProfilerStart() and cudaProfilerStop(). There is no support for ranges with no name.", "keywords": []}, {"id": 140, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "page", "name": "NsightComputeCli/index#output", "display_name": "Output", "type": "section", "display_type": "Page section", "docname": "NsightComputeCli/index", "anchor": "output", "priority": -1, "content": "API trace and summary NVIDIA Nsight Compute CLI does not support any form of API-usage related output. No API data is captured during profiling. Dependency analysis NVIDIA Nsight Compute CLI does not support any dependency analysis. No API data is captured during profiling. GPU trace NVIDIA Nsight Compute CLI does not support any GPU trace output. Due to kernel replay during profiling, kernel executions are serialized, and start and end timestamps do not necessarily match those during application execution. In addition, no records for memory activities are recorded. Print summary While nvprof has several command line options to specify which summary information to print, NVIDIA Nsight Compute CLI uses further arguments to the --print-summary options. Profiling data can be summarized per-gpu , per-kernel or per-nvtx context. Kernel name demangling Nvprof allows users to decide between name demangling on or off using the --demangling options. NVIDIA Nsight Compute CLI currently always demangles kernel names in the output. In addition, the option --kernel-regex-base can be used to decide which name format should be used when matching kernel names during filtering. Pages Nvprof has no concept of output pages, all data is shown as a list or summarized. NVIDIA Nsight Compute CLI uses pages to define how data should be structured and printed. Those correspond to the report pages used in the GUI variant. The option --page can be used to select which page to show, and details is selected by default. All pages also support printing in CSV format for easier post-processing, using the --csv option.", "keywords": []}, {"id": 141, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "page", "name": "NsightComputeCli/index#output-pages", "display_name": "Output Pages", "type": "section", "display_type": "Page section", "docname": "NsightComputeCli/index", "anchor": "output-pages", "priority": -1, "content": "The command line profiler supports printing results to the console using various pages. Each page has an equivalent in NVIDIA Nsight Compute\u2019s Profiler Report . In the command line profiler, they are slightly adapted to fit console output. To select a page, use the --page option. By default, the details page is used. Note that if --page is not used but --export is, no results will be printed to the console. Details: This page represents NVIDIA Nsight Compute\u2019s Details page. For every profiled kernel launch, each collected is printed as section as a three-column table, followed by any rule results applied to this section. Rule results not associated with any section are printed after the kernel\u2019s sections. The first section table column shows the metric name. If the metric was given a label in the section, it is used instead. The second column shows the metric unit, if available. The third column shows the unit value. Both metric unit and value are automatically adjusted to the most fitting order of magnitude. By default, only metrics defined in section headers are shown. This can be changed by passing the --details-all option on the command line. Some metrics will show multiple values, separated by \u201c;\u201d, e.g. memory_l2_transactions_global Kbytes 240; 240; 240; 240; 240. Those are instanced metrics, which have one value per represented instance. An instance can be a streaming multiprocessor, an assembly source line, etc. Raw: This page represents NVIDIA Nsight Compute\u2019s Raw page. For every profiled kernel launch, each collected metric is printed as a three-column table. Besides metrics from sections, this includes automatically collected metrics such as device attributes and kernel launch information. The first column shows the metric name. The second and third columns show the metric unit and value, respectively. Both metric unit and value are automatically adjusted to the most fitting order of magnitude. No unresolved regex:, group:, or breakdown: metrics are included.", "keywords": []}, {"id": 142, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "page", "name": "NsightComputeCli/index#pm-sampling", "display_name": "PM Sampling", "type": "section", "display_type": "Page section", "docname": "NsightComputeCli/index", "anchor": "pm-sampling", "priority": -1, "content": "These options apply to PM sampling . See here for options used in warp state sampling. Option Description Default pm-sampling-interval Set the PM sampling interval in cycles or ns (depending on the architecture), or determine dynamically when 0. 0 (auto) pm-sampling-buffer-size Set the size of the device-sided allocation for PM sampling in bytes, or determine dynamically when 0. 0 (auto) pm-sampling-max-passes Set the maximum number of passes used for PM sampling, or determine dynamically when 0. 0 (auto)", "keywords": []}, {"id": 143, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "page", "name": "NsightComputeCli/index#profile", "display_name": "Profile", "type": "section", "display_type": "Page section", "docname": "NsightComputeCli/index", "anchor": "profile", "priority": -1, "content": "Option Description Default/Examples devices List the GPU devices to enable profiling on, separated by comma. 1 All devices Examples --devices 0,2 filter-mode Set the filtering mode for kernel launches. Available modes: global: Apply provided launch filters on kernel launches collectively. per-gpu: Apply provided launch filters on kernel launches separately on each device. Effective launch filters for this mode are --launch-count and --launch-skip per-launch-config: Apply kernel filters and launch filters on kernel launches separately for each GPU launch parameter i.e. Grid Size, Block Size and Shared Memory. global kernel-id Set the identifier to use for matching kernels. If the kernel does not match the identifier, it will be ignored for profiling. The identifier must be of the following format: context-id:stream-id:[name-operator:]kernel-name:invocation-nr context-id is the CUDA context ID or regular expression to match the NVTX name. stream-id is the CUDA stream ID or regular expression to match the NVTX name. name-operator is an optional operator to kernel-name . Currently, regex is the only supported operator. kernel-name is the expression to match the kernel name. By default, this is a full, literal match to what is specified by --kernel-name-base . When specifying the optional regex name operator, this is a partial regular expression match to what is specified by --kernel-name-base . invocation-nr is the N\u2019th invocation of this kernel function. Multiple invocations can also be specified using regular expressions. If the context/stream ID is a positive number, it will be strictly matched against the CUDA context/stream ID. Otherwise it will be treated as a regular expression and matched against the context/stream name specified using the NVTX library. 1 Examples --kernel-id ::foo:2 For kernel \u201cfoo\u201d, match the second invocation. --kernel-id :::".*5|3" For all kernels, match the third invocation, and all for which the invocation number ends in \u201c5\u201d. --kernel-id ::regex:^.*foo$: Match all kernels ending in \u201cfoo\u201d. --kernel-id ::regex:^(?!foo): Match all kernels except those starting with \u201cfoo\u201d. Note that depending on your OS and shell, ` you might need to quote the expression, e.g. using single quotes in Linux bash : --kernel-id ::regex:'^(?!foo)': --kernel-id 1:2::7 Match all seventh kernel invocations on context 1, stream 2. k,kernel-name Set the expression to use when matching kernel names. <kernel name> Set the kernel name for an exact match. regex:<expression> Set the regex to use for matching the kernel name. On shells that recognize regular expression symbols as special characters (e.g. Linux bash), the expression needs to be escaped with quotes, e.g. --kernel-name regex:".*Foo" . If the kernel name or the provided expression do not match, it will be ignored for profiling. 1 Examples -k foo Match all kernels named exactly \u201cfoo\u201d. -k regex:foo Match all kernels that include the string \u201cfoo\u201d, e.g. \u201cfoo\u201d and \u201cfooBar\u201d. -k regex:"foo|bar" Match all kernels including the strings \u201cfoo\u201d or \u201cbar\u201d, e.g. \u201cfoo\u201d, \u201cfoobar\u201d, \u201c_bar2\u201d. kernel-name-base Set the basis for --kernel-name , and --kernel-id kernel-name. 1 Options are: function: Function name without parameters, templates etc. e.g. dmatrixmul demangled: Demangled function name, including parameters, templates, etc. e.g. dmatrixmul(float*,int,int) mangled: Mangled function name. e.g. _Z10dmatrixmulPfiiS_iiS_ function c,launch-count Limit the number of profiled kernel launches. The count is only incremented for launches that match the kernel filters. 1 s,launch-skip Set the number of kernel launches to skip before starting to profile kernels. The number takes into account only launches that match the kernel filters. 1 0 launch-skip-before-match Set the number of kernel launches to skip before starting to profile. The count is incremented for all launches, regardless of the kernel filters. 1 0 range-filter Filter to profile specified instance(s) of matching NVTX ranges or start/stop ranges created through cu(da)ProfilerStart/Stop APIs. Specify in format [yes/no/on/off]:[start/stop range instance(s)]:[NVTX range instance(s)] [yes/no/on/off] : default is \u2018no/off\u2019. If set to \u2018yes/on\u2019 then NVTX range numbering starts from 1 inside every start/stop range. provide numbers in regex form e.g, [2-4] or 2|3|4 to profile 2nd, 3rd and 4th instance of the matching range. NVTX range numbers will be counted for matching range provided using \u2013nvtx-include. Examples --range-filter :2:3 --nvtx-include A/ Match 2nd start/stop range and also 3rd NVTX push/pop range A in the app. --range-filter yes:2:3 --nvtx-include A/ Match 3rd NVTX push/pop range A from 2nd start/stop range. kill Terminate the target application when the requested \u2013launch-count was profiled. Allowed values: on/off yes/no no replay-mode Mechanism used for replaying a kernel launch multiple times to collect all requested profiling data: kernel: Replay individual kernel launches \u201ctransparently\u201d during the execution of the application. See Kernel Replay for more details. application: Relaunch the entire application multiple times. Requires deterministic program execution. See Application Replay for more details. range: Replay ranges of CUDA API calls and kernel launches \u201ctransparently\u201d during the execution of the application. Ranges must be defined using cu(da)ProfilerStart/Stop API pairs or NVTX expressions . See Range Replay for more details. app-range: Profile ranges without API capture by relaunching the entire application multiple times. Requires deterministic program execution. Ranges must be defined using ``cu(da)ProfilerStart/Stop`` API pairs or `NVTX expressions <index.html#nvtx-filtering>`__. See `Application Range Replay <../ProfilingGuide/index.html#application-range-replay>`__ for more details. kernel app-replay-buffer Application replay buffer location. file: Replay pass data is buffered in a temporary file. The report is created after profiling completed. This mode is more scalable, as the amount of required memory does not scale with the number of profiled kernels. memory: Replay pass data is buffered in memory, and the report is created while profiling. This mode can result in better performance if the filesystem is slow, but the amount of required memory scales with the number of profiled kernels. file app-replay-match Application replay kernel matching strategy. For all options, kernels are matched on a per-process and per-device (GPU) basis. Below options are used to configure the applied strategy in more detail. name: Kernels are matched in the following order: 1. (mangled) name, 2. order of execution grid: Kernels are matched in the following order: 1. (mangled) name, 2. CUDA grid/block size, 3. order of execution all: Kernels are matched in the following order: 1. (mangled) name, 2. CUDA grid/block size, 3. CUDA context ID, 4. CUDA stream ID, 5. order of execution grid app-replay-mode Application replay kernel matching mode: strict: Requires all kernels to match across all replay passes. relaxed: Produces results only for kernels that could be matched across replay passes. strict range-replay-options Range replay options, separated by comma. Below options are supported: enable-greedy-sync Insert ctx sync for applicable deferred APIs during capture. disable-host-restore Disable restoring device-written host allocations. none graph-profiling CUDA graph profiling mode: node Profile individual kernel nodes as regular CUDA kernels. graph Profile entire graphs as one workload (but disable profiling of individual graph kernel nodes). See the Kernel Profiling Guide for more information on this mode. node list-sections List all sections found in the searched section folders and exit. section Add a section identifier to collect in one of the following ways: <section identifier> Set the section identifier for an exact match. regex:<expression> Regular expression allows matching full section identifier. For example, .*Stats , matches all sections ending with \u2018Stats\u2019. On shells that recognize regular expression symbols as special characters (e.g. Linux bash), the expression needs to be escaped with quotes, e.g. --section "regex:.*Stats" . This option is ignored when used with --import and --page raw or --page source . 1 If no --section options are given, the sections associated with the basic set are collected. If no sets are found, all sections are collected. section-folder Add a non-recursive search path for .section files. Section files in this folder will be made available to the --section option. If no --section-folder options are given, the sections folder is added by default. section-folder-recursive Add a recursive search path for .section files. Section files in this folder and all folders below will be made available to the --section option. If no --section-folder options are given, the sections folder is added by default. list-rules List all rules found in the searched section folders and exit. apply-rules Apply active and applicable rules to each profiling result. Use --rule to limit which rules to apply. Allowed values: on/off yes/no yes rule Add a rule identifier to apply. Implies --apply-rules yes . If no --rule options are given, all applicable rules in the sections folder are applied. import-source If available from -lineinfo, correlated CUDA source files are permanently imported into the report. Allowed values: on/off yes/no Use --source-folders option to provide missing source files. no source-folders Add comma separated recursive search paths for missing CUDA source files to import into the report. list-metrics List all metrics collected from active sections. If the list of active sections is restricted using the --section option, only metrics from those sections will be listed. query-metrics Query available metrics for the devices on system. Use --devices and --chips to filter which devices to query. Note that by default, listed metric names need to be appended a valid suffix in order for them to become valid metrics. See --query-metrics-mode for how to get the list of valid suffixes, or check the Kernel Profiling Guide . query-metrics-mode Set the mode for querying metrics. Implies --query-metrics . Available modes: base: Only the base names of the metrics. suffix: Suffix names for the base metrics. This gives the list of all metrics derived from the base metrics. Use --metrics to specify the base metrics to query. all: Full names for all metrics. This gives the list of all base metrics and their suffix metrics. base query-metrics-collection Set which metric collection kind to query. Implies --query-metrics . Available collections: profiling: Query metrics available for profiling. pmsampling: Query metrics available for PM sampling . profiling metrics Specify all metrics to be profiled, separated by comma. If no --section options are given, only the temporary section containing all metrics listed using this option is collected. If --section options are given in addition to --metrics , all metrics from those sections and from --metrics are collected. Names passed to this option support the following prefixes: regex:<expression> expands to all metrics that partially match the expression. Enclose the regular expression in ^\u2026$ to force a full match. group:<name> lists all metrics of the metric group with that name. See section files for valid group names. breakdown:<metric> expands to the input metrics of the high-level throughput metric. pmsampling:<metric> collects the metric using PM sampling. Only single-pass metrics that don\u2019t require SASS-patching (_sass_) are supported. Using this prefix adds a timeline element to the report\u2019s details page. Combining multiple prefixes is not supported. If a metric requires a suffix to be valid, and neither regex: nor group: are used, this option automatically expands the name to all available first-level sub-metrics. When importing a report, :group and :breakdown are not supported. When using regex: , the expression must not include any commas. 1 disable-extra-suffixes Disable the collection of extra suffixes (avg, min, max, sum) for all metrics. Only collect what is explicity specified. list-chips List all supported chips that can be used with --chips . chips Specify the chips for querying metrics, separated by comma. Examples --chips gv100,tu102 profile-from-start Set if application should be profiled from its start. Allowed values: on/off yes/no yes disable-profiler-start-stop Disable profiler start/stop. When enabled, cu(da)ProfilerStart/Stop API calls are ignored. quiet Suppress all profiling output. verbose Make profiler output more verbose. cache-control Control the behavior of the GPU caches during profiling. Allowed values: all: All GPU caches are flushed before each kernel replay iteration during profiling. While metric values in the execution environment of the application might be slightly different without invalidating the caches, this mode offers the most reproducible metric results across the replay passes and also across multiple runs of the target application. none: No GPU caches are flushed during profiling. This can improve performance and better replicates the application behavior if only a single kernel replay pass is necessary for metric collection. However, some metric results will vary depending on prior GPU work, and between replay iterations. This can lead to inconsistent and out-of-bounds metric values. all clock-control Control the behavior of the GPU clocks during profiling. Allowed values: base: GPC and memory clocks are locked to their respective base frequency during profiling. This has no impact on thermal throttling. Note that actual clocks might still vary, depending on the level of driver support for this feature. As an alternative, use nvidia-smi to lock the clocks externally and set this option to none . none: No GPC or memory frequencies are changed during profiling. reset: Reset GPC and memory clocks for all or the selected devices and exit. Use if a previous, killed execution of ncu left the GPU clocks in a locked state. base nvtx-include Adds an include statement to the NVTX filter , which allows selecting kernels to profile based on NVTX ranges. 1 nvtx-exclude Adds an exclude statement to the NVTX filter , which allows selecting kernels to profile based on NVTX ranges. 1 1 This filtering option is available when using --import .", "keywords": []}, {"id": 144, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "page", "name": "NsightComputeCli/index#profile-import", "display_name": "Profile Import", "type": "section", "display_type": "Page section", "docname": "NsightComputeCli/index", "anchor": "profile-import", "priority": -1, "content": "Using the --import option, saved reports can be imported into the command line profiler. When using this flag, most other options are not available, except for certain result filterting options. They are marked as such in the Profile options table.", "keywords": []}, {"id": 145, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "page", "name": "NsightComputeCli/index#quickstart", "display_name": "Quickstart", "type": "section", "display_type": "Page section", "docname": "NsightComputeCli/index", "anchor": "quickstart", "priority": -1, "content": "Launch the target application with the command line profiler The command line profiler launches the target application, instruments the target API, and collects profile results for the specified kernels. The CLI executable is called ncu. A shortcut with this name is located in the base directory of the NVIDIA Nsight Compute installation. The actual executable is located in the folder target\\windows-desktop-win7-x64 on Windows or target/linux-desktop-glibc_2_11_3-x64 on Linux. By default, NVIDIA Nsight Compute is installed in /usr/local/cuda-<cuda-version>/NsightCompute-<version> on Linux and in C:\\Program Files\\NVIDIA Corporation\\Nsight Compute <version> on Windows. To collect the basic set for all kernel launches in the target application, launch: $ ncu -o profile CuVectorAddMulti.exe The application runs in instrumented mode and for each kernel launch, a profile result is created. The results are written by default to profile.nsight-cuprof. Each output from the compute profiler starts with ==PROF== The other lines are output from the application itself. For each profiled kernel, the name of the kernel function and the progress of data collection is shown. To collect all requested profile information, it may be required to replay the kernels multiple times. The total number of replay passes per kernel is shown after profiling has completed. [Vector addition of 1144477 elements] ==PROF== Connected to process 5268 Copy input data from the host memory to the CUDA device CUDA kernel launch A with 4471 blocks of 256 threads ==PROF== Profiling "vectorAdd_A" - 0: 0%....50%....100% - 46 passes CUDA kernel launch B with 4471 blocks of 256 threads ==PROF== Profiling "vectorAdd_B" - 1: 0%....50%....100% - 46 passes Copy output data from the CUDA device to the host memory Done ==PROF== Disconnected from process 5268 ==PROF== Report: profile.ncu-rep Customizing data collection Options are available to specify for which kernels data should be collected. -c limits the number of kernel launches collected. -s skips the given number of kernels before data collection starts. -k allows you to filter the kernels by a regex match of their names. --kernel-id allows you to filter kernels by context, stream, name and invocation, similar to nvprof. To limit what should be collected for each kernel launch, specify the exact *.section (files) by their identifier using --section . Each section file defines a set of metrics to be collected, grouped logically to solve a specific performance question. By default, the sections associated with the basic set are collected. Use --list-sets to see the list of currently available sets. Use --list-sections to see the list of currently available sections. The default search directory and location of pre-defined section files is also called sections/ . See the Profiling Guide for more details. Alternatively, you can collect a set of individual metrics using --metrics . The available metrics can be queried using --query-metrics . For an explanation of the naming conventions and structuring of metrics, see Metrics Structure . Most metrics in NVIDIA Nsight Compute are named using a base name and various suffixes, e.g. sm__throughput.avg.pct_of_peak_sustained_elapsed . The base name is sm__throughput and the suffix is avg.pct_of_peak_sustained_elapsed . This is because most metrics follow the same structure and have the same set of suffixes. You need to pass the base or full name to NVIDIA Nsight Compute when selecting a metric for profiling. Use --query-metrics-mode suffix --metrics <metrics list> to see the full names for the chosen metrics. Some additional metrics do not follow this structured naming. They are documented in the Metrics Reference . Changing command line output By default, a temporary file is used to store profiling results, and data is printed to the command line. To permanently store the profiler report, use -o to specify the output filename. Besides storing results in a report file, the command line profiler can print results using different pages. Those pages correspond to the respective pages in the UI\u2019s report. By default, the Details page is printed, if no explicit output file is specified. To select a different page or print in addition to storing in an explicit file, use the --page=<Page> command. Currently, the following pages are supported: details, raw, source . Use --csv to make any output comma separated and easier to process further. See Console Output for further options, e.g. summary views. Open the report in the UI The UI executable is called ncu-ui. A shortcut with this name is located in the base directory of the NVIDIA Nsight Compute installation. The actual executable is located in the folder host\\windows-desktop-win7-x64 on Windows or host/linux-desktop-glibc_2_11_3-x64 on Linux. In the UI window, close the Connection dialog and open the report file through File > Open , by dragging the report file into NVIDIA Nsight Compute. You can also specify the report file as a command line parameter to the executable, i.e. as ncu-ui <MyReport.ncu-rep> . Alternatively, when using NVIDIA Nsight Compute CLI on a platform with host support, --open-in-ui can be used directly with ncu to open a collected report in the user interface. The report opens in a new document window. For more information about the report, see the Profiler Report for collecting profile information through NVIDIA Nsight Compute.", "keywords": []}, {"id": 146, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "page", "name": "NsightComputeCli/index#response-file", "display_name": "Response File", "type": "section", "display_type": "Page section", "docname": "NsightComputeCli/index", "anchor": "response-file", "priority": -1, "content": "Response files can be specified by adding @FileName to the command line. The file name must immediately follow the @ character. The content of each response file is inserted in place of the corresponding response file option.", "keywords": []}, {"id": 147, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "page", "name": "NsightComputeCli/index#trace", "display_name": "Trace", "type": "section", "display_type": "Page section", "docname": "NsightComputeCli/index", "anchor": "trace", "priority": -1, "content": "GPU and API trace NVIDIA Nsight Compute CLI does not support any form of tracing GPU or API activities. This functionality is covered by NVIDIA Nsight Systems .", "keywords": []}, {"id": 148, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "page", "name": "NsightComputeCli/index#warp-sampling", "display_name": "Warp Sampling", "type": "section", "display_type": "Page section", "docname": "NsightComputeCli/index", "anchor": "warp-sampling", "priority": -1, "content": "Option Description Default warp-sampling-interval Set the sampling period in the range of [0..31]. The actual frequency is 2 ^ (5 + value) cycles. If set to \u2018auto\u2019, the profiler tries to automatically determine a high sampling frequency without skipping samples or overflowing the output buffer. auto warp-sampling-max-passes Set maximum number of passes used for sampling (see the Kernel Profiling Guide for more details on profiling overhead). 5 warp-sampling-buffer-size Set the size of the device-sided allocation for samples in bytes. 32*1024*1024", "keywords": []}, {"id": 149, "doc_id": 149, "filename": "NsightComputeCli/index.html", "domain_name": "std", "name": "NsightComputeCli/index", "display_name": "Nsight Compute CLI", "type": "doc", "display_type": "Page", "docname": "NsightComputeCli/index", "anchor": "", "priority": -1, "content": "The User Guide for Nsight Compute CLI.", "keywords": []}, {"id": 150, "doc_id": 150, "filename": "NvRulesAPI/index.html", "domain_name": "std", "name": "NvRulesAPI/index", "display_name": "NvRules API", "type": "doc", "display_type": "Page", "docname": "NvRulesAPI/index", "anchor": "", "priority": -1, "content": "Modules Data Structures Namespaces Notices Notices ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, \u201cMATERIALS\u201d) ARE BEING PROVIDED \u201cAS IS.\u201d NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. Information furnished is believed to be accurate and reliable. However, NVIDIA Corporation assumes no responsibility for the consequences of use of such information or for any infringement of patents or other rights of third parties that may result from its use. No license is granted by implication of otherwise under any patent rights of NVIDIA Corporation. Specifications mentioned in this publication are subject to change without notice. This publication supersedes and replaces all other information previously supplied. NVIDIA Corporation products are not authorized as critical components in life support devices or systems without express written approval of NVIDIA Corporation. Trademarks NVIDIA and the NVIDIA logo are trademarks or registered trademarks of NVIDIA Corporation in the U.S. and other countries. Other company and product names may be trademarks of the respective companies with which they are associated.", "keywords": []}, {"id": 151, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#analysis", "display_name": "Analysis", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "analysis", "priority": -1, "content": "The roofline chart can be very helpful in guiding performance optimization efforts for a particular kernel. Roofline anaysis. As shown here, the ridge point partitions the roofline chart into two regions. The area shaded in blue under the sloped Memory Bandwidth Boundary is the Memory Bound region, while the area shaded in green under the Peak Performance Boundary is the Compute Bound region. The region in which the achieved value falls, determines the current limiting factor of kernel performance. The distance from the achieved value to the respective roofline boundary (shown in this figure as a dotted white line), represents the opportunity for performance improvement. The closer the achieved value is to the roofline boundary, the more optimal is its performance. An achieved value that lies on the Memory Bandwidth Boundary but is not yet at the height of the ridge point would indicate that any further improvements in overall FLOP/s are only possible if the Arithmetic Intensity is increased at the same time. Using the baseline feature in combination with roofline charts, is a good way to track optimization progress over a number of kernel executions.", "keywords": []}, {"id": 152, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#application-range-replay", "display_name": "Application Range Replay", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "application-range-replay", "priority": -1, "content": "In Application Range Replay , all requested metrics in NVIDIA Nsight Compute are grouped into one or more passes. Similar to Range Replay , metrics are not associated with individual kernels but with the entire selected range. This allows the tool to execute workloads (kernels, CUDA graphs, \u2026) without serialization and thereby supports profiling workloads that must be run concurrently for correctness or performance reasons. In contrast to Range Replay, the range is not explicitly captured and executed directly for each pass, but instead the entire application is re-run multiple times, with one pass collected for each range in every application execution. This has the benefit that no application state must be observed and captured for each range and API calls within the range do not need to be supported explicitly, as correct execution of the range is handled by the application itself. Defining ranges to profile is identical to Range Replay . The CUDA context for which the range should be profiled must be current to the thread defining the start of the range and must be active for the entire range. Execution with Application Range Replay. An range of workloads is replayed by re-running the entire application without modifying interactions or saving and restoring memory.", "keywords": []}, {"id": 153, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#application-replay", "display_name": "Application Replay", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "application-replay", "priority": -1, "content": "In Application Replay , all metrics requested for a specific kernel launch in NVIDIA Nsight Compute are grouped into one or more passes. In contrast to Kernel Replay , the complete application is run multiple times, so that in each run one of those passes can be collected per kernel. For correctly identifying and combining performance counters collected from multiple application replay passes of a single kernel launch into one result, the application needs to be deterministic with respect to its kernel activities and their assignment to GPUs, contexts, streams, and potentially NVTX ranges. Normally, this also implies that the application needs to be deterministic with respect to its overall execution. Application replay has the benefit that memory accessed by the kernel does not need to be saved and restored via the tool, as each kernel launch executes only once during the lifetime of the application process. Besides avoiding memory save-and-restore overhead, application replay also allows to disable Cache Control . This is especially useful if other GPU activities preceding a specific kernel launch are used by the application to set caches to some expected state. In addition, application replay can support profiling kernels that have interdependencies to the host during execution. With kernel replay, this class of kernels typically hangs when being profiled, because the necessary responses from the host are missing in all but the first pass. In contrast, application replay ensures the correct behavior of the program execution in each pass. In contrast to kernel replay, multiple passes collected via application replay imply that all host-side activities of the application are duplicated, too. If the application requires significant time for e.g. setup or file-system access, the overhead will increase accordingly. Regular Application Execution Execution with Application Replay. No memory is saved or restored, but the cost of running the application itself is duplicated. Across application replay passes, NVIDIA Nsight Compute matches metric data for the individual, selected kernel launches. The matching strategy can be selected using the --app-replay-match option. For matching, only kernels within the same process and running on the same device are considered. By default, the grid strategy is used, which matches launches according to their kernel name and grid size. When multiple launches have the same attributes (e.g. name and grid size), they are matched in execution order. Kernel matching during application replay using the grid strategy.", "keywords": []}, {"id": 154, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#cache-control", "display_name": "Cache Control", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "cache-control", "priority": -1, "content": "As explained in Kernel Replay , the kernel might need to be replayed multiple times to collect all requested metrics. While NVIDIA Nsight Compute can save and restore the contents of GPU device memory accessed by the kernel for each pass, it cannot do the same for the contents of HW caches, such as e.g. the L1 and L2 cache. This can have the effect that later replay passes might have better or worse performance than e.g. the first pass, as the caches could already be primed with the data last accessed by the kernel. Similarly, the values of HW performance counters collected by the first pass might depend on which kernels, if any, were executed prior to the measured kernel launch. In order to make HW performance counter value more deterministic, NVIDIA Nsight Compute by default flushes all GPU caches before each replay pass. As a result, in each pass, the kernel will access a clean cache and the behavior will be as if the kernel was executed in complete isolation. This behavior might be undesirable for performance analysis, especially if the measurement focuses on a kernel within a larger application execution, and if the collected data targets cache-centric metrics. In this case, you can use --cache-control none to disable flushing of any HW cache by the tool.", "keywords": []}, {"id": 155, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#clock-control", "display_name": "Clock Control", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "clock-control", "priority": -1, "content": "For many metrics, their value is directly influenced by the current GPU SM and memory clock frequencies. For example, if a kernel instance is profiled that has prior kernel executions in the application, the GPU might already be in a higher clocked state and the measured kernel duration, along with other metrics, will be affected. Likewise, if a kernel instance is the first kernel to be launched in the application, GPU clocks will regularly be lower. In addition, due to kernel replay, the metric value might depend on which replay pass it is collected in, as later passes would result in higher clock states. To mitigate this non-determinism, NVIDIA Nsight Compute attempts to limit GPU clock frequencies to their base value. As a result, metric values are less impacted by the location of the kernel in the application, or by the number of the specific replay pass. However, this behavior might be undesirable for analysis of the kernel, e.g. in cases where an external tool is used to fix clock frequencies, or where the behavior of the kernel within the application is analyzed. To solve this, users can adjust the --clock-control option to specify if any clock frequencies should be fixed by the tool. Factors affecting Clock Control: Note that thermal throttling directed by the driver cannot be controlled by the tool and always overrides any selected options. On mobile targets, e.g. L4T or QNX, there may be variations in profiling results due the inability for the tool to lock clocks. Using Nsight Compute\u2019s --clock-control to set the GPU clocks will fail or will be silently ignored when profiling on a GPU partition. On L4T, you can use the jetson_clocks script to lock the clocks at their maximums during profiling. See the Special Configurations section for MIG and vGPU clock control.", "keywords": []}, {"id": 156, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#compatibility", "display_name": "Compatibility", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "compatibility", "priority": -1, "content": "The set of available replay modes and metrics depends on the type of GPU workload to profile. Workload Type Replay Mode Metric Groups Kernel Application Range Application-Range Hardware Counters / SMSP Unit-Level Source Instruction-Level Source Launch PM Sampling Kernel Yes Yes Yes 2 Yes 2 Yes Yes Yes Yes Yes Range No No Yes Yes Yes No No Some Yes Cmdlist Yes No No Yes 2 Yes Yes Yes Some Yes Graph 1 Yes No No Yes 2 Yes No No Some Yes Footnotes 1 Limitations also apply to kernels profiled outside of graphs. 2 Workload type is supported as part of the profiled range, but not separated in the result. Metric support matches that of Range workloads.", "keywords": []}, {"id": 157, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#defining-ranges", "display_name": "Defining Ranges", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "defining-ranges", "priority": -1, "content": "Range replay requires you to specify the range for profiling in the application. A range is defined by a start and an end marker and includes all CUDA API calls and kernels launched between these markers from any CPU thread. The application is responsible for inserting appropriate synchronization between threads to ensure that the anticipated set of API calls is captured. Range markers can be set using one of the following options: Profiler Start/Stop API Set the start marker using cu(da)ProfilerStart and the end marker using cu(da)ProfilerStop . Note: The CUDA driver API variants of this API require to include cudaProfiler.h . The CUDA runtime variants require to include cuda_profiler_api.h . This is the default for NVIDIA Nsight Compute. NVTX Ranges Define the range using an NVTX Include expression. The range capture starts with the first CUDA API call and ends at the last API call for which the expression is matched, respectively. If multiple expressions are specified, a range is defined as soon as any of them matches. Hence, multiple expressions can be used to conveniently capture and profile multiple ranges for the same application execution. The application must have been instrumented with the NVTX API for any expressions to match. This mode is enabled by passing --nvtx --nvtx-include <expression> [--nvtx-include <expression>] to the NVIDIA Nsight Compute CLI. Ranges must fulfill several requirements: It must be possible to synchronize all active CUDA contexts at the start of the range. Ranges must not include unsupported CUDA API calls. See Supported APIs for the list of currently supported APIs. In addition, there are several recommendations that ranges should comply with to guarantee a correct capture and replay: Set ranges as narrow as possible for capturing a specific set of CUDA kernel lanuches. The more API calls are included, the higher the potentially created overhead from capturing and replaying these API calls. Avoid freeing host allocations written by device memory during the range. This includes both heap as well as stack allocations. NVIDIA Nsight Compute does not intercept creation or destruction of generic host (CPU)-based allocations. However, to guarantee correct program execution after any replay of the range, the tool attempts to restore host allocations that were written from device memory during the capture. If these host addresses are invalid or re-assigned, the program behavior is undefined and potentially unstable. In cases where avoiding freeing such allocations is not possible, you should limit profiling to one range using --launch-count 1 , set the disable-host-restore range replay option and optionally use --kill yes to terminate the process after this range. When defining the range markers using cu(da)ProfilerStart/Stop , prefer the CUDA driver API calls cuProfilerStart/Stop . Internally, NVIDIA Nsight Compute only intercepts the CUDA driver API variants and the CUDA runtime API may not trigger these if no CUDA context is active on the calling thread.", "keywords": []}, {"id": 158, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#device-memory", "display_name": "Device Memory", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "device-memory", "priority": -1, "content": "Example Device Memory table, collected on an RTX 2080 Ti Columns Sectors For each access type, the total number of sectors requested from device memory. % Peak Percentage of peak device memory utilization. Higher values imply a higher utilization of the unit and can show potential bottlenecks, as it does not necessarily indicate efficient usage. Bytes Total number of bytes transferred between L2 Cache and device memory. Throughput Achieved device memory throughput in bytes per second. High values indicate high utilization of the unit. Rows (Access Types) Device memory loads and stores. Total The aggregate for all access types in the same column. Metrics Metrics from this table can be collected on the command line using --set full , --section MemoryWorkloadAnalysis_Tables or --metrics group:memory__dram_table .", "keywords": []}, {"id": 159, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#faq", "display_name": "FAQ", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "faq", "priority": -1, "content": "n/a metric values n/a means that the metric value is \u201cnot available\u201d. The most common reason is that the requested metric does not exist. This can either be the result of a typo, or a missing suffix . Verify the metric name against the output of of the --query-metrics NVIDIA Nsight Compute CLI option. If the metric name was copied (e.g. from an old version of this documentation), make sure that it does not contain zero-width unicode characters. Finally, the metric might simply not exist for the targeted GPU architecture. For example, the IMMA pipeline metric sm__inst_executed_pipe_tensor_op_imma.avg.pct_of_peak_sustained_active is not available on GV100 chips. Metric values outside the expected logical range This includes e.g. percentages exceeding 100% or metrics reporting negative values. For further details, see Range and Precision . ERR_NVGPUCTRPERM - The user does not have permission to access NVIDIA GPU Performance Counters on the target device. By default, NVIDIA drivers require elevated permissions to access GPU performance counters. On mobile platforms, profile as root/using sudo. On other platforms, you can either start profiling as root/using sudo, or by enabling non-admin profiling. For further details, see https://developer.nvidia.com/ERR_NVGPUCTRPERM . On Windows Subsystem for Linux (WSL), access to NVIDIA GPU Performance Counters must be enabled in the NVIDIA Control Panel of the Windows host. Unsupported GPU This indicates that the GPU, on which the current kernel is launched, is not supported. See the Release Notes for a list of devices supported by your version of NVIDIA Nsight Compute. It can also indicate that the current GPU configuration is not supported. For example, NVIDIA Nsight Compute might not be able to profile GPUs in SLI configuration. Connection error detected communicating with target application. The inter-process connection to the profiled application unexpectedly dropped. This happens if the application is killed or signals an exception (e.g. segmentation fault). Failed to connect. The target process may have exited. This occurs if the application does not call any CUDA API calls before it exits. the application terminates early because it was started from the wrong working directory, or with the wrong arguments. In this case, check the details in the Connection Dialog . the application crashes before calling any CUDA API calls. the application launches child processes which use the CUDA. In this case, launch with the --target-processes all option. The profiler returned an error code: (number) For the non-interactive Profile activity, the NVIDIA Nsight Compute CLI is started to generate the report. If either the application exited with a non-zero return code, or the NVIDIA Nsight Compute CLI encountered an error itself, the resulting return code will be shown in this message. For example, if the application hit a segmentation fault (SIGSEGV) on Linux, it will likely return error code 11. All non-zero return codes are considered errors, so the message is also shown if the application exits with return code 1 during regular execution. To debug this issue, it can help to run the data collection directly from the command line using ncu in order to observe the application\u2019s and the profiler\u2019s command line output, e.g. ==ERROR== The application returned an error code (11) Failed to open/create lock file (path). Please check that this process has write permissions on this file. NVIDIA Nsight Compute failed to create or open the file (path) with write permissions. This file is used for inter-process serialization . NVIDIA Nsight Compute does not remove this file after profiling by design. The error occurs if the file was created by a profiling process with permissions that prevent the current process from writing to this file, or if the current user can\u2019t acquire this file for other reasons (e.g. certain Linux kernel security settings). The file is in the current temporary directory, i.e. TMPDIR/nsight-compute-lock . On Windows, TMPDIR is the path returned by the Windows GetTempPath API function. On other platforms, it is the path supplied by the first environment variable in the list TMPDIR, TMP, TEMP, TEMPDIR . If none of these is found, it\u2019s /var/nvidia on QNX and /tmp otherwise. Older versions of NVIDIA Nsight Compute did not set write permissions for all users on this file by default. As a result, running the tool on the same system with a different user might cause this error. This has been resolved since version 2020.2.1. The following workarounds can be used to solve this problem: If it is otherwise ensured that no concurrent NVIDIA Nsight Compute instances are active on the same system, set TMPDIR to a different directory for which the current user has write permissions. Ask the user owning the file, or a system administrator, to remove it or add write permissions for all potential users. On Linux systems setting fs.protected_regular=1 , root or other users may not be able to access this file, even though the owner can, if the sticky bit is set on the temporary directory. Either disable this setting using sudo sysctl fs.protected_regular=0 , use a different temporary directory (see above), or enable access to hardware performance counters for non-root users and profile as the same user who owns the file (see https://developer.nvidia.com/ERR_NVGPUCTRPERM on how to change this setting). Profiling failed because a driver resource was unavailable. The error indicates that a required CUDA driver resource was unavailable during profiling. Most commonly, this means that NVIDIA Nsight Compute could not reserve the driver\u2019s performance monitor, which is necessary for collecting most metrics. This can happen if another application has a concurrent reservation on this resource. Such applications can be e.g. DCGM , a client of CUPTI\u2019s Profiling API , Nsight Graphics , or another instance of NVIDIA Nsight Compute without access to the same file system (see serialization for how this is prevented within the same file system). If you expect the problem to be caused by DCGM, consider using dcgmi profile --pause to stop its monitoring while profiling with NVIDIA Nsight Compute. Could not deploy stock * files to * Could not determine user home directory for section deployment. An error occurred while trying to deploy stock section or rule files. By default, NVIDIA Nsight Compute tries to deploy these to a versioned directory in the user\u2019s home directory (as identified by the HOME environment variable on Linux), e.g. /home/user/Documents/NVIDIA Nsight Compute/<version>/Sections . If the directory cannot be determined (e.g. because this environment variable is not pointing to a valid directory), or if there is an error while deploying the files (e.g. because the current process does not have write permissions on it), warning messages are shown and NVIDIA Nsight Compute falls back to using stock sections and rules from the installation directory. If you are in an environment where you consistently don\u2019t have write access to the user\u2019s home directory, consider populating this directory upfront using ncu --section-folder-restore , or by making /home/user/Documents/NVIDIA Nsight Compute/<version> a symlink to a writable directory. ProxyJump SSH option is not working NVIDIA Nsight Compute does not manage authentication or interactive prompts with the OpenSSH client launched when using the ProxyJump option. Therefore, to connect through an intermediate host for the first time, you will not be able to accept the intermediate host\u2019s key. A simple way to pinpoint the cause of failures in this case is to open a terminal and use the OpenSSH client to connect to the remote target. Once that connection succeeds, NVIDIA Nsight Compute should be able to connect to the target, too. SSH connection fails without trying to connect If the connection fails without trying to connect, there may be a problem with the settings you entered into the connection dialog. Please make sure that the IP/Host Name , User Name and Port fields are correctly set. SSH connections are still not working The problem might come from NVIDIA Nsight Compute\u2019s SSH client not finding a suitable host key algorithm to use which is supported by the remote server. You can force NVIDIA Nsight Compute to use a specific set of host key algorithms by setting the HostKeyAlgorithms option for the problematic host in your SSH configuration file. To list the supported host key algorithms for a remote target, you can use the ssh-keyscan utility which comes with the OpenSSH client. Removing host keys from known hosts files When connecting to a target machine, NVIDIA Nsight Compute tries to verify the target\u2019s host key against the same local database as the OpenSSH client. If NVIDIA Nsight Compute find the host key is incorrect, it will inform you through a failure dialog. If you trust the key hash shown in the dialog, you can remove the previously saved key for that host by manually editing your known hosts database or using the ssh-keygen -R <host> command. Qt initialization failed Failed to load Qt platform plugin See System Requirements for Linux. Notices Notices ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, \u201cMATERIALS\u201d) ARE BEING PROVIDED \u201cAS IS.\u201d NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. Information furnished is believed to be accurate and reliable. However, NVIDIA Corporation assumes no responsibility for the consequences of use of such information or for any infringement of patents or other rights of third parties that may result from its use. No license is granted by implication of otherwise under any patent rights of NVIDIA Corporation. Specifications mentioned in this publication are subject to change without notice. This publication supersedes and replaces all other information previously supplied. NVIDIA Corporation products are not authorized as critical components in life support devices or systems without express written approval of NVIDIA Corporation. Trademarks NVIDIA and the NVIDIA logo are trademarks or registered trademarks of NVIDIA Corporation in the U.S. and other countries. Other company and product names may be trademarks of the respective companies with which they are associated.", "keywords": []}, {"id": 160, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#graph-profiling", "display_name": "Graph Profiling", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "graph-profiling", "priority": -1, "content": "In multiple replay modes, NVIDIA Nsight Compute can profile CUDA graphs as single workload entities, rather than profile individual kernel nodes. The behavior can be toggled in the respective command line or UI options. The primary use cases for enabling this mode are: Profile graphs that include mandatory concurrent kernel nodes. Profile graphs that include device-sided graph launches. Profile graph behavior more accurately across multiple kernel node launches, as caches are not purged in between nodes. Note that when graph profiling is enabled, certain metrics such as instruction-level source metrics are not available. This then also applies to kernels profiled outside of graphs.", "keywords": []}, {"id": 161, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#hardware-model", "display_name": "Hardware Model", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "hardware-model", "priority": -1, "content": "Compute Model All NVIDIA GPUs are designed to support a general purpose heterogeneous parallel programming model, commonly known as Compute . This model decouples the GPU from the traditional graphics pipeline and exposes it as a general purpose parallel multi-processor. A heterogeneous computing model implies the existence of a host and a device, which in this case are the CPU and GPU, respectively. At a high level view, the host (CPU) manages resources between itself and the device and will send work off to the device to be executed in parallel. Central to the compute model is the Grid, Block, Thread hierarchy, which defines how compute work is organized on the GPU. The hierarchy from top to bottom is as follows: A Grid is a 1D, 2D or 3D array of thread blocks. A Block is a 1D, 2D or 3D array of threads, also known as a Cooperative Thread Array (CTA) . A Thread is a single thread which runs on one of the GPU\u2019s SM units. The purpose of the Grid, Block, Thread hierarchy is to expose a notion of locality amongst a group of threads, i.e. a Cooperative Thread Array (CTA). In CUDA, CTAs are referred to as Thread Blocks. The architecture can exploit this locality by providing fast shared memory and barriers between the threads within a single CTA. When a Grid is launched, the architecture guarantees that all threads within a CTA will run concurrently on the same SM. Information on the grids and blocks can be found in the Launch Statistics section. The number of CTAs that fit on each SM depends on the physical resources required by the CTA. These resource limiters include the number of threads and registers, shared memory utilization, and hardware barriers. The number CTAs per SM is referred to as the CTA occupancy , and these physical resources limit this occupancy. Details on the kernel\u2019s occupancy are collected by the Occupancy section. Each CTA can be scheduled on any of the available SMs, where there is no guarantee in the order of execution. As such, CTAs must be entirely independent, which means it is not possible for one CTA to wait on the result of another CTA. As CTAs are independent, the host (CPU) can launch a large Grid that will not fit on the hardware all at once, however any GPU will still be able to run it and produce the correct results. CTAs are further divided into groups of 32 threads called Warps . If the number of threads in a CTA is not dividable by 32, the last warp will contain the remaining number of threads. The total number of CTAs that can run concurrently on a given GPU is referred to as Wave . Consequently, the size of a Wave scales with the number of available SMs of a GPU, but also with the occupancy of the kernel. Streaming Multiprocessor The Streaming Multiprocessor (SM) is the core processing unit in the GPU. The SM is optimized for a wide diversity of workloads, including general-purpose computations, deep learning, ray tracing, as well as lighting and shading. The SM is designed to simultaneously execute multiple CTAs. CTAs can be from different grid launches. The SM implements an execution model called Single Instruction Multiple Threads (SIMT), which allows individual threads to have unique control flow while still executing as part of a warp. The Turing SM inherits the Volta SM\u2019s independent thread scheduling model. The SM maintains execution state per thread, including a program counter (PC) and call stack. The independent thread scheduling allows the GPU to yield execution of any thread, either to make better use of execution resources or to allow a thread to wait for data produced by another thread possibly in the same warp. Collecting the Source Counters section allows you to inspect instruction execution and predication details on the Source Page , along with Sampling information. Each SM is partitioned into four processing blocks, called SM sub partitions . The SM sub partitions are the primary processing elements on the SM. Each sub partition contains the following units: Warp Scheduler Register File Execution Units/Pipelines/Cores Integer Execution units Floating Point Execution units Memory Load/Store units Special Function unit Tensor Cores Shared within an SM across the four SM partitions are: Unified L1 Data Cache / Shared Memory Texture units RT Cores, if available A warp is allocated to a sub partition and resides on the sub partition from launch to completion. A warp is referred to as active or resident when it is mapped to a sub partition. A sub partition manages a fixed size pool of warps. On Volta architectures, the size of the pool is 16 warps. On Turing architectures the size of the pool is 8 warps. Active warps can be in eligible state if the warp is ready to issue an instruction. This requires the warp to have a decoded instruction, all input dependencies resolved, and for the function unit to be available. Statistics on active, eligible and issuing warps can be collected with the Scheduler Statistics section. A warp is stalled when the warp is waiting on an instruction fetch, a memory dependency (result of memory instruction), an execution dependency (result of previous instruction), or a synchronization barrier. See Warp Scheduler States for the list of stall reasons that can be profiled and the Warp State Statistics section for a summary of warp states found in the kernel execution. The most important resource under the compiler\u2019s control is the number of registers used by a kernel. Each sub partition has a set of 32-bit registers, which are allocated by the HW in fixed-size chunks. The Launch Statistics section shows the kernel\u2019s register usage. Memory Global memory is a 49-bit virtual address space that is mapped to physical memory on the device, pinned system memory, or peer memory. Global memory is visible to all threads in the GPU. Global memory is accessed through the SM L1 and GPU L2. Local memory is private storage for an executing thread and is not visible outside of that thread. It is intended for thread-local data like thread stacks and register spills. Local memory addresses are translated to global virtual addresses by the the AGU unit. Local memory has the same latency as global memory. One difference between global and local memory is that local memory is arranged such that consecutive 32-bit words are accessed by consecutive thread IDs. Accesses are therefore fully coalesced as long as all threads in a warp access the same relative address (e.g., same index in an array variable, same member in a structure variable, etc.). Shared memory is located on chip, so it has much higher bandwidth and much lower latency than either local or global memory. Shared memory can be shared across a compute CTA. Compute CTAs attempting to share data across threads via shared memory must use synchronization operations (such as __syncthreads()) between stores and loads to ensure data written by any one thread is visible to other threads in the CTA. Similarly, threads that need to share data via global memory must use a more heavyweight global memory barrier. Shared memory has 32 banks that are organized such that successive 32-bit words map to successive banks that can be accessed simultaneously. Any 32-bit memory read or write request made of 32 addresses that fall in 32 distinct memory banks can therefore be serviced simultaneously, yielding an overall bandwidth that is 32 times as high as the bandwidth of a single request. However, if two addresses of a memory request fall in the same memory bank, there is a bank conflict and the access has to be serialized. A shared memory request for a warp does not generate a bank conflict between two threads that access any address within the same 32-bit word (even though the two addresses fall in the same bank). When multiple threads make the same read access, one thread receives the data and then broadcasts it to the other threads. When multiple threads write to the same location, only one thread succeeds in the write; which thread that succeeds is undefined. Detailed memory metrics are collected by the Memory Workload Analysis section. Caches All GPU units communicate to main memory through the Level 2 cache, also known as the L2. The L2 cache sits between on-chip memory clients and the framebuffer. L2 works in physical-address space. In addition to providing caching functionality, L2 also includes hardware to perform compression and global atomics. Model of the L2 cache. The Level 1 Data Cache, or L1, plays a key role in handling global, local, shared, texture, and surface memory reads and writes, as well as reduction and atomic operations. On Volta and Turing architectures there are , there are two L1 caches per TPC, one for each SM. For more information on how L1 fits into the texturing pipeline, see the TEX unit description. Also note that while this section often uses the name \u201cL1\u201d, it should be understood that the L1 data cache, shared data, and the Texture data cache are one and the same. L1 receives requests from two units: the SM and TEX. L1 receives global and local memory requests from the SM and receives texture and surface requests from TEX. These operations access memory in the global memory space, which L1 sends through a secondary cache, the L2. Cache hit and miss rates as well as data transfers are reported in the Memory Workload Analysis section. Model of Load/Store and Texture pipelines for the L1TEX cache. Texture/Surface The TEX unit performs texture fetching and filtering. Beyond plain texture memory access, TEX is responsible for the addressing, LOD, wrap, filter, and format conversion operations necessary to convert a texture read request into a result. TEX receives two general categories of requests from the SM via its input interface: texture requests and surface load/store operations. Texture and surface memory space resides in device memory and are cached in L1. Texture and surface memory are allocated as block-linear surfaces (e.g. 2D, 2D Array, 3D). Such surfaces provide a cache-friendly layout of data such that neighboring points on a 2D surface are also located close to each other in memory, which improves access locality. Surface accesses are bounds-checked by the TEX unit prior to accessing memory, which can be used for implementing different texture wrapping modes. The L1 cache is optimized for 2D spatial locality, so threads of the same warp that read texture or surface addresses that are close together in 2D space will achieve optimal performance. The L1 cache is also designed for streaming fetches with constant latency; a cache hit reduces DRAM bandwidth demand but not fetch latency. Reading device memory through texture or surface memory presents some benefits that can make it an advantageous alternative to reading memory from global or constant memory. Information on texture and surface memory can be found in the Memory Workload Analysis section.", "keywords": []}, {"id": 162, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#introduction", "display_name": "Introduction", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "introduction", "priority": -1, "content": "This guide describes various profiling topics related to NVIDIA Nsight Compute and NVIDIA Nsight Compute CLI. Most of these apply to both the UI and the CLI version of the tool. To use the tools effectively, it is recommended to read this guide, as well as at least the following chapters of the CUDA Programming Guide : Programming Model Hardware Implementation Performance Guidelines Afterwards, it should be enough to read the Quickstart chapter of the NVIDIA Nsight Compute or NVIDIA Nsight Compute CLI documentation, respectively, to start using the tools.", "keywords": []}, {"id": 163, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#kernel-replay", "display_name": "Kernel Replay", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "kernel-replay", "priority": -1, "content": "In Kernel Replay , all metrics requested for a specific kernel instance in NVIDIA Nsight Compute are grouped into one or more passes. For the first pass, all GPU memory that can be accessed by the kernel is saved. After the first pass, the subset of memory that is written by the kernel is determined. Before each pass (except the first one), this subset is restored in its original location to have the kernel access the same memory contents in each replay pass. NVIDIA Nsight Compute attempts to use the fastest available storage location for this save-and-restore strategy. For example, if data is allocated in device memory, and there is still enough device memory available, it is stored there directly. If it runs out of device memory, the data is transferred to the CPU host memory. Likewise, if an allocation originates from CPU host memory, the tool first attempts to save it into the same memory location, if possible. As explained in Overhead , the time needed for this increases the more memory is accessed, especially written, by a kernel. If NVIDIA Nsight Compute determines that only a single replay pass is necessary to collect the requested metrics, no save-and-restore is performed at all to reduce overhead. Regular Application Execution Execution with Kernel Replay. All memory is saved, and memory written by the kernel is restored in-between replay passes.", "keywords": []}, {"id": 164, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#l1-tex-cache", "display_name": "L1/TEX Cache", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "l1-tex-cache", "priority": -1, "content": "Example L1/TEX Cache memory table, collected on an RTX 2080 Ti Model of the Global Load Pipeline for the L1TEX cache on GA100, mapped to the memory table. Columns Instructions For each access type, the total number of all actually executed assembly (SASS) instructions per warp. Predicated-off instructions are not included. E.g., the instruction LDG would be counted towards Global Loads . Requests The total number of all requests to L1, generated for each instruction type. On SM 7.0 (Volta) and newer architectures, each instruction generates exactly one request for LSU traffic (global, local, \u2026). For texture (TEX) traffic, more than one request may be generated. In the example, each of the 65536 global load instructions generates exactly one request. Wavefronts Number of wavefronts required to service the requested memory operation. Wavefronts are serialized and processed on different cycles. Wavefront % Peak Percentage of peak utilization for the units processing wavefronts . High numbers can imply that the processing pipelines are saturated and can become a bottleneck. Sectors The total number of all L1 sectors accesses sent to L1. Each load or store request accesses one or more sectors in the L1 cache. Atomics and reductions are passed through to the L2 cache. Sectors/Req The average ratio of sectors to requests for the L1 cache. For the same number of active threads in a warp, smaller numbers imply a more efficient memory access pattern. For warps with 32 active threads, the optimal ratios per access size are: 32-bit: 4, 64-bit: 8, 128-bit: 16. Smaller ratios indicate some degree of uniformity or overlapped loads within a cache line. Higher numbers can imply uncoalesced memory accesses and will result in increased memory traffic. In the example, the average ratio for global loads is 32 sectors per request, which implies that each thread needs to access a different sector. Ideally, for warps with 32 active threads, with each thread accessing a single, aligned 32-bit value, the ratio would be 4, as every 8 consecutive threads access the same sector. Hit Rate Sector hit rate (percentage of requested sectors that do not miss) in the L1 cache. Sectors that miss need to be requested from L2, thereby contributing to Sector Misses to L2 . Higher hit rates imply better performance due to lower access latencies, as the request can be served by L1 instead of a later stage. Not to be confused with Tag Hit Rate (not shown). Bytes Total number of bytes requested from L1. This is identical to the number of sectors multiplied by 32 byte, since the minimum access size in L1 is one sector. Sector Misses to L2 Total number of sectors that miss in L1 and generate subsequent requests in the L2 Cache . In this example, the 262144 sector misses for global and local loads can be computed as the miss-rate of 12.5%, multiplied by the number of 2097152 sectors. % Peak to L2 Percentage of peak utilization of the L1-to-XBAR interface, used to send L2 cache requests. If this number is high, the workload is likely dominated by scattered {writes, atomics, reductions}, which can increase the latency and cause warp stalls . Returns to SM Number of return packets sent from the L1 cache back to the SM. Larger request access sizes result in higher number of returned packets. % Peak to SM Percentage of peak utilization of the XBAR-to-L1 return path (compare Returns to SM). If this number is high, the workload is likely dominated by scattered reads, thereby causing warp stalls . Improving read-coalescing or the L1 hit rate could reduce this utilization. Rows (Access Types) The various access types, e.g. loads from global memory or reduction operations on surface memory. Loads The aggregate of all load access types in the same column. Stores The aggregate of all store access types in the same column. Total The aggregate of all load and store access types in the same column. Metrics Metrics from this table can be collected on the command line using --set full , --section MemoryWorkloadAnalysis_Tables or --metrics group:memory__first_level_cache_table .", "keywords": []}, {"id": 165, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#l2-cache", "display_name": "L2 Cache", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "l2-cache", "priority": -1, "content": "Example L2 Cache memory table, collected on an RTX 2080 Ti Model of the L2 cache on GA100, mapped to the memory table. Columns Requests For each access type, the total number of requests made to the L2 cache. This correlates with the Sector Misses to L2 for the L1 cache. Each request accesses up to four sectors from a single 128 byte cache line. Sectors For each access type, the total number of sectors requested from the L2 cache. Each request accesses between one and four sectors. Sectors/Req The average ratio of sectors to requests for the L2 cache. For the same number of active threads in a warp, smaller numbers imply a more efficient memory access pattern. Smaller ratios indicate some degree of uniformity or overlapped loads within a cache line. Higher numbers can imply uncoalesced memory accesses and will result in increased memory traffic. % Peak Percentage of peak sustained number of sectors. The \u201cwork package\u201d in the L2 cache is a sector. Higher values imply a higher utilization of the unit and can show potential bottlenecks, as it does not necessarily indicate efficient usage. Hit Rate Hit rate (percentage of requested sectors that do not miss) in the L2 cache. Sectors that miss need to be requested from a later stage, thereby contributing to one of Sector Misses to Device , Sector Misses to System , or Sector Misses to Peer . Higher hit rates imply better performance due to lower access latencies, as the request can be served by L2 instead of a later stage. Bytes Total number of bytes requested from L2. This is identical to the number of sectors multiplied by 32 byte, since the minimum access size in L2 is one sector. Throughput Achieved L2 cache throughput in bytes per second. High values indicate high utilization of the unit. Sector Misses to Device Total number of sectors that miss in L2 and generate subsequent requests in device memory . Sector Misses to System Total number of sectors that miss in L2 and generate subsequent requests in system memory . Sector Misses to Peer Total number of sectors that miss in L2 and generate subsequent requests in peer memory . Rows (Access Types) The various access types, e.g. loads or reductions originating from L1 cache. L1/TEX Total Total for all operations originating from the L1 cache. ECC Total Total for all operations caused by ECC (Error Correction Code). If ECC is enabled, L2 write requests that partially modify a sector cause a corresponding sector load from DRAM. These additional load operations increase the sector misses of L2. L2 Fabric Total Total for all operations across the L2 fabric connecting the two L2 partitions. This row is only shown for kernel launches on CUDA devices with L2 fabric. GPU Total Total for all operations across all clients of the L2 cache. Independent of having them split out separately in this table. Metrics Metrics from this table can be collected on the command line using --set full , --section MemoryWorkloadAnalysis_Tables or --metrics group:memory__l2_cache_table .", "keywords": []}, {"id": 166, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#l2-cache-eviction-policies", "display_name": "L2 Cache Eviction Policies", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "l2-cache-eviction-policies", "priority": -1, "content": "Example L2 Cache Eviction Policies memory table, collected on an A100 GPU Columns First Number of sectors accessed in the L2 cache using the evict_first policy. Data cached with this policy will be first in the eviction priority order and will likely be evicted when cache eviction is required. This policy is suitable for streaming data. Hit Rate Cache hit rate for sector accesses in the L2 cache using the evict_first policy. Last Number of sectors accessed in the L2 cache using the evict_last policy. Data cached with this policy will be last in the eviction priority order and will likely be evicted only after other data with evict_normal or evict_first eviction policy is already evicted. This policy is suitable for data that should remain persistent in cache. Hit Rate Cache hit rate for sector accesses in the L2 cache using the evict_last policy. Normal Number of sectors accessed in the L2 cache using the evict_normal policy. This is the default policy. Hit Rate Cache hit rate for sector accesses in the L2 cache using the evict_normal policy. Normal Demote Number of sectors accessed in the L2 cache using the evict_normal_demote policy. Hit Rate Cache hit rate for sector accesses in the L2 cache using the evict_normal_demote policy. Rows (Access Types) The various access types, e.g. loads or reductions, originating from L1 cache. L1/TEX Total Total for all operations originating from the L1 cache. L2 Fabric Total Total for all operations across the L2 fabric connecting the two L2 partitions. This row is only shown for kernel launches on CUDA devices with L2 fabric. GPU Total Total for all operations across all clients of the L2 cache. Independent of having them split out separately in this table. Metrics Metrics from this table can be collected on the command line using --set full , --section MemoryWorkloadAnalysis_Tables or --metrics group:memory__l2_cache_evict_policy_table . Note that this table is only available on GPUs with GA100 or newer.", "keywords": []}, {"id": 167, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#memory-chart", "display_name": "Memory Chart", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "memory-chart", "priority": -1, "content": "The Memory Chart shows a graphical, logical representation of performance data for memory subunits on and off the GPU. Performance data includes transfer sizes, hit rates, number of instructions or requests, etc.", "keywords": []}, {"id": 168, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#memory-chart-overview", "display_name": "Overview", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "memory-chart-overview", "priority": -1, "content": "Memory chart for an NVIDIA A100 GPU Logical Units (green) Logical units are shown in green color. Kernel: The CUDA kernel executing on the GPU\u2019s Streaming Multiprocessors Global: CUDA global memory Local: CUDA local memory Texture: CUDA texture memory Surface: CUDA surface memory Shared: CUDA shared memory Load Global Store Shared: Instructions loading directly from global into shared memory without intermediate register file access Physical Units (blue) Physical units are shown in blue color. L1/TEX Cache: The L1/Texture cache . The underlying physical memory is split between this cache and the user-managed Shared Memory . Shared Memory: CUDA\u2019s user-managed shared memory . The underlying physical memory is split between this and the L1/TEX Cache . L2 Cache: The L2 cache L2 Compression: The memory compression unit of the L2 Cache System Memory: Off-chip system (CPU) memory Device Memory: On-chip device (GPU) memory of the CUDA device that executes the kernel Peer Memory: On-chip device (GPU) memory of other CUDA devices Depending on the exact GPU architecture, the exact set of shown units can vary, as not all GPUs have all units. Links Links between Kernel and other logical units represent the number of executed instructions ( Inst ) targeting the respective unit. For example, the link between Kernel and Global represents the instructions loading from or storing to the global memory space. Instructions using the NVIDIA A100\u2019s Load Global Store Shared paradigm are shown separately, as their register or cache access behavior can be different from regular global loads or shared stores. Links between logical units and blue, physical units represent the number of requests ( Req ) issued as a result of their respective instructions. For example, the link going from L1/TEX Cache to Global shows the number of requests generated due to global load instructions. The color of each link represents the percentage of peak utilization of the corresponding communication path. The color legend to the right of the chart shows the applied color gradient from unused (0%) to operating at peak performance (100%). Triangle markers to the left of the legend correspond to the links in the chart. The markers offer a more accurate value estimate for the achieved peak performances than the color gradient alone. A unit often shares a common data port for incoming and outgoing traffic. While the links sharing a port might operate well below their individual peak performances, the unit\u2019s data port may have already reached its peak. Port utilization is shown in the chart by colored rectangles inside the units located at the incoming and outgoing links. Ports use the same color gradient as the data links and have also a corresponding marker to the left of the legend. An example of the correlation between the peak values reported in the memory tables and the ports in the memory chart is shown below. Mapping of peak values between memory tables and memory chart Metrics Metrics from this chart can be collected on the command line using --set full , --section MemoryWorkloadAnalysis_Chart or --metrics group:memory__chart .", "keywords": []}, {"id": 169, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#memory-tables", "display_name": "Memory Tables", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "memory-tables", "priority": -1, "content": "The Memory Tables show detailed metrics for the various memory HW units, such as shared memory, the caches, and device memory. For most table entries, you can hover over it to see the underlying metric name and description. Some entries are generated as derivatives from other cells, and do not show a metric name on their own, but the respective calculation. If a certain metric does not contribute to the generic derivative calculation, it is shown as UNUSED in the tooltip. You can hover over row or column headers to see a description of this part of the table.", "keywords": []}, {"id": 170, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#metric-collection", "display_name": "Metric Collection", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "metric-collection", "priority": -1, "content": "Collection of performance metrics is the key feature of NVIDIA Nsight Compute. Since there is a huge list of metrics available, it is often easier to use some of the tool\u2019s pre-defined sets or sections to collect a commonly used subset. Users are free to adjust which metrics are collected for which kernels as needed, but it is important to keep in mind the Overhead associated with data collection.", "keywords": []}, {"id": 171, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#metrics-decoder", "display_name": "Metrics Decoder", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "metrics-decoder", "priority": -1, "content": "The following explains terms found in NVIDIA Nsight Compute metric names, as introduced in Metrics Structure . Units dram Device (main) memory, where the GPUs global and local memory resides. fbpa The FrameBuffer Partition is a memory controller which sits between the level 2 cache (LTC) and the DRAM. The number of FBPAs varies across GPUs. fe The Frontend unit is responsible for the overall flow of workloads sent by the driver. FE also facilitates a number of synchronization operations. gpc The General Processing Cluster contains SM, Texture and L1 in the form of TPC(s). It is replicated several times across a chip. gpu The entire Graphics Processing Unit. gr Graphics Engine is responsible for all 2D and 3D graphics, compute work, and synchronous graphics copying work. idc The InDexed Constant Cache is a subunit of the SM responsible for caching constants that are indexed with a register. l1tex The Level 1 (L1)/Texture Cache is located within the GPC. It can be used as directed-mapped shared memory and/or store global, local and texture data in its cache portion. l1tex__t refers to its Tag stage. l1tex__m refers to its Miss stage. l1tex__d refers to its Data stage. ltc The Level 2 cache. ltcfabric The LTC fabric is the communication fabric for the L2 cache partitions. lts A Level 2 (L2) Cache Slice is a sub-partition of the Level 2 cache. lts__t refers to its Tag stage. lts__m refers to its Miss stage. lts__d refers to its Data stage. mcc Memory controller channel of MSS. The Memory Subsystem (MSS) provides access to local DRAM, SysRAM, and provides a SyncPoint Interface for interprocessor signaling. MCC includes the row sorter/arbiter and DRAM controllers. pm Performance monitor. sm The Streaming Multiprocessor handles execution of a kernel as groups of 32 threads, called warps. Warps are further grouped into cooperative thread arrays (CTA), called blocks in CUDA. All warps of a CTA execute on the same SM. CTAs share various resources across their threads, e.g. the shared memory. smsp Each SM is partitioned into four processing blocks, called SM sub partitions. The SM sub partitions are the primary processing elements on the SM. A sub partition manages a fixed size pool of warps. sys Logical grouping of several units. tpc Thread Processing Clusters are units in the GPC. They contain one or more SM, Texture and L1 units, the Instruction Cache (ICC) and the Indexed Constant Cache (IDC). Subunits aperture_device Memory interface to local device memory (dram) aperture_peer Memory interface to remote device memory aperture_sysmem Memory interface to system memory global Global memory is a 49-bit virtual address space that is mapped to physical memory on the device, pinned system memory, or peer memory. Global memory is visible to all threads in the GPU. Global memory is accessed through the SM L1 and GPU L2. lg Local/Global memory local Local memory is private storage for an executing thread and is not visible outside of that thread. It is intended for thread-local data like thread stacks and register spills. Local memory has the same latency as global memory. lsu Load/Store unit lsuin Load/Store input mio Memory input/output mioc Memory input/output control shared Shared memory is located on chip, so it has much higher bandwidth and much lower latency than either local or global memory. Shared memory can be shared across a compute CTA. surface Surface memory texin TEXIN texture Texture memory xbar The Crossbar (XBAR) is responsible for carrying packets from a given source unit to a specific destination unit. Pipelines adu Address Divergence Unit. The ADU is responsible for address divergence handling for branches/jumps. It also provides support for constant loads and block-level barrier instructions. alu Arithmetic Logic Unit. The ALU is responsible for execution of most bit manipulation and logic instructions. It also executes integer instructions, excluding IMAD and IMUL. On NVIDIA Ampere architecture chips, the ALU pipeline performs fast FP32-to-FP16 conversion. cbu Convergence Barrier Unit. The CBU is responsible for warp-level convergence, barrier, and branch instructions. fma Fused Multiply Add/Accumulate. The FMA pipeline processes most FP32 arithmetic (FADD, FMUL, FMAD). It also performs integer multiplication operations (IMUL, IMAD), as well as integer dot products. On GA10x, FMA is a logical pipeline that indicates peak FP32 and FP16x2 performance. It is composed of the FMAHeavy and FMALite physical pipelines. fmaheavy Fused Multiply Add/Accumulate Heavy. FMAHeavy performs FP32 arithmetic (FADD, FMUL, FMAD), FP16 arithmetic (HADD2, HMUL2, HFMA2), integer multiplication operations (IMUL, IMAD), and integer dot products. fmalite Fused Multiply Add/Accumulate Lite. FMALite performs FP32 arithmetic (FADD, FMUL, FMA) and FP16 arithmetic (HADD2, HMUL2, HFMA2). fp16 Half-precision floating-point. On Volta, Turing and NVIDIA GA100, the FP16 pipeline performs paired FP16 instructions (FP16x2). It also contains a fast FP32-to-FP16 and FP16-to-FP32 converter. Starting with GA10x chips, this functionality is part of the FMA pipeline. fp64 Double-precision floating-point. The implementation of FP64 varies greatly per chip. lsu Load Store Unit. The LSU pipeline issues load, store, atomic, and reduction instructions to the L1TEX unit for global, local, and shared memory. It also issues special register reads (S2R), shuffles, and CTA-level arrive/wait barrier instructions to the L1TEX unit. tex Texture Unit. The SM texture pipeline forwards texture and surface instructions to the L1TEX unit\u2019s TEXIN stage. On GPUs where FP64 or Tensor pipelines are decoupled, the texture pipeline forwards those types of instructions, too. tma Tensor Memory Access Unit. Provides efficient data transfer mechanisms between global and shared memories with the ability to understand and traverse multidimensional data layouts. uniform Uniform Data Path. This scalar unit executes instructions where all threads use the same input and generate the same output. xu Transcendental and Data Type Conversion Unit. The XU pipeline is responsible for special functions such as sin, cos, and reciprocal square root. It is also responsible for int-to-float, and float-to-int type conversions. Quantities instruction An assembly (SASS) instruction. Each executed instruction may generate zero or more requests. request A command into a HW unit to perform some action, e.g. load data from some memory location. Each request accesses one or more sectors. sector Aligned 32 byte-chunk of memory in a cache line or device memory. An L1 or L2 cache line is four sectors, i.e. 128 bytes. Sector accesses are classified as hits if the tag is present and the sector-data is present within the cache line. Tag-misses and tag-hit-data-misses are all classified as misses. tag Unique key to a cache line. A request may look up multiple tags, if the thread addresses do not all fall within a single cache line-aligned region. The L1 and L2 both have 128 byte cache lines. Tag accesses may be classified as hits or misses. wavefront Unique \u201cwork package\u201d generated at the end of the processing stage for requests. All work items of a wavefront are processed in parallel, while work items of different wavefronts are serialized and processed on different cycles. At least one wavefront is generated for each request. A simplified model for the processing in L1TEX for Volta and newer architectures can be described as follows: When an SM executes a global or local memory instruction for a warp, a single request is sent to L1TEX. This request communicates the information for all participating threads of this warp (up to 32). For local and global memory, based on the access pattern and the participating threads, the request requires to access a number of cache lines, and sectors within these cache lines. The L1TEX unit has internally multiple processing stages operating in a pipeline. A wavefront is the maximum unit that can pass through that pipeline stage per cycle. If not all cache lines or sectors can be accessed in a single wavefront, multiple wavefronts are created and sent for processing one by one, i.e. in a serialized manner. Limitations of the work within a wavefront may include the need for a consistent memory space, a maximum number of cache lines that can be accessed, as well as various other reasons. Each wavefront then flows through the L1TEX pipeline and fetches the sectors handled in that wavefront. The given relationships of the three key values in this model are requests:sectors is 1:N, wavefronts:sectors 1:N, and requests:wavefronts is 1:N . A wavefront is described as a (work) package that can be processed at once, i.e. there is a notion of processing one wavefront per cycle in L1TEX. Wavefronts therefore represent the number of cycles required to process the requests, while the number of sectors per request is a property of the access pattern of the memory instruction for all participating threads. For example, it is possible to have a memory instruction that requires 4 sectors per request in 1 wavefront. However, you can also have a memory instruction having 4 sectors per request, but requiring 2 or more wavefronts.", "keywords": []}, {"id": 172, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#metrics-reference", "display_name": "Metrics Reference", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "metrics-reference", "priority": -1, "content": "Overview Most metrics in NVIDIA Nsight Compute can be queried using the ncu command line interface\u2019s \u2013query-metrics option. The following metrics can be collected explicitly, but are not listed by --query-metrics , and do not follow the naming scheme explained in Metrics Structure . They should be used as-is instead. launch__* metrics are collected per kernel launch, and do not require an additional replay pass. They are available as part of the kernel launch parameters (such as grid size, block size, \u2026) or are computed using the CUDA Occupancy Calculator . Launch Metrics launch__block_dim_x Number of threads for the kernel launch in X dimension. launch__block_dim_y Number of threads for the kernel launch in Y dimension. launch__block_dim_z Number of threads for the kernel launch in Z dimension. launch__block_size Total number of threads per block for the kernel launch. launch__cluster_dim_x Number of clusters for the kernel launch in X dimension. launch__cluster_dim_y Number of clusters for the kernel launch in Y dimension. launch__cluster_dim_z Number of clusters for the kernel launch in Z dimension. launch__cluster_max_active Maximum number of clusters that can co-exist on the target device. The runtime environment may affect how the hardware schedules the clusters, so the calculated occupancy is not guaranteed to be achievable. launch__cluster_max_potential_size Largest valid cluster size for the kernel function and launch configuration. launch__cluster_scheduling_policy Cluster scheduling policy. launch__context_id CUDA context id for the kernel launch (id of the primary context if launch was on a green context). launch__device_id CUDA device id for the kernel launch. launch__func_cache_config On devices where the L1 cache and shared memory use the same hardware resources, this is the preferred cache configuration for the CUDA function. The runtime will use the requested configuration if possible, but it is free to choose a different configuration if required. launch__function_pcs Kernel function entry PCs. launch__graph_contains_device_launch Set to 1 if any node in the profiled graph can launch a CUDA device graph. launch__graph_is_device_launchable Set to 1 if the profiled graph was device-launchable. launch__green_context_id CUDA context id of the green context for the kernel launch (if applicable). launch__grid_dim_x Number of blocks for the kernel launch in X dimension. launch__grid_dim_y Number of blocks for the kernel launch in Y dimension. launch__grid_dim_z Number of blocks for the kernel launch in Z dimension. launch__grid_size Total number of blocks for the kernel launch. launch__occupancy_cluster_gpu_pct Overall GPU occupancy due to clusters. launch__occupancy_cluster_pct The ratio of active blocks to the max possible active blocks due to clusters. launch__occupancy_limit_blocks Occupancy limit due to maximum number of blocks managable per SM. launch__occupancy_limit_registers Occupancy limit due to register usage. launch__occupancy_limit_shared_mem Occupancy limit due to shared memory usage. launch__occupancy_limit_warps Occupancy limit due to block size. launch__occupancy_per_block_size Number of active warps for given block size. Instance values map from number of warps (uint64) to value (uint64). launch__occupancy_per_cluster_size Number of active clusters for given cluster size. Instance values map from number of clusters (uint64) to value (uint64). launch__occupancy_per_register_count Number of active warps for given register count. Instance values map from number of warps (uint64) to value (uint64). launch__occupancy_per_shared_mem_size Number of active warps for given shared memory size. Instance values map from number of warps (uint64) to value (uint64). launch__registers_per_thread Number of registers allocated per thread. launch__registers_per_thread_allocated Number of registers allocated per thread. launch__shared_mem_config_size Shared memory size configured for the kernel launch. The size depends on the static, dynamic, and driver shared memory requirements as well as the specified or platform-determined configuration size. launch__shared_mem_per_block_allocated Allocated shared memory size per block. launch__shared_mem_per_block_driver Shared memory size per block, allocated for the CUDA driver. launch__shared_mem_per_block_dynamic Dynamic shared memory size per block, allocated for the kernel. launch__shared_mem_per_block_static Static shared memory size per block, allocated for the kernel. launch__sm_count Number of SMs utilized in the launch. launch__stream_id CUDA stream id for the kernel launch. launch__sub_launch_name Name of each sub-launch for range-like results. launch__thread_count Total number of threads across all blocks for the kernel launch. launch__uses_cdp Set to 1 if any function object in the launched workload can use CUDA dynamic parallelism. launch__uses_green_context Set to 1 if launch was on a green context. launch__waves_per_multiprocessor Number of waves per SM. Partial waves can lead to tail effects where some SMs become idle while others still have pending work to complete. NVLink Topology Metrics nvlink__bandwidth Link bandwidth in bytes/s. Instance values map from logical nvlink ID (uint64) to value (double). nvlink__count_logical Total number of logical NVLinks. nvlink__count_physical Total number of physical links. Instance values map from physical nvlink device ID (uint64) to value (uint64). nvlink__destination_ports Destination port numbers (as strings). Instance values map from logical nvlink ID (uint64) to comma-separated list of port numbers (string). nvlink__dev0Id ID of the first connected device. Instance values map from logical nvlink ID (uint64) to value (uint64). nvlink__dev0type Type of the first connected device. Instance values map from logical nvlink ID (uint64) to values [1=GPU, 2=CPU] (uint64). nvlink__dev1Id ID of the second connected device. Instance values map from logical nvlink ID (uint64) to value (uint64). nvlink__dev1type Type of the second connected device. Instance values map from logical nvlink ID (uint64) to values [1=GPU, 2=CPU] (uint64). nvlink__dev_display_name_all Device display name. Instance values map from logical nvlink device ID (uint64) to value (string). nvlink__enabled_mask NVLink enablement mask, per device. Instance values map from physical nvlink device ID (uint64) to value (uint64). nvlink__is_direct_link Indicates, per NVLink, if the link is direct. Instance values map from logical nvlink ID (uint64) to value (uint64). nvlink__is_nvswitch_connected Indicates if NVSwitch is connected. nvlink__max_count Maximum number of NVLinks. Instance values map from physical nvlink device ID (uint64) to value (uint64). nvlink__peer_access Indicates if peer access is supported. Instance values map from logical nvlink ID (uint64) to value (uint64). nvlink__peer_atomic Indicates if peer atomics are supported. Instance values map from logical nvlink ID (uint64) to value (uint64). nvlink__source_ports Source port numbers (as strings). Instance values map from logical nvlink ID (uint64) to comma-separated list of port numbers (string). nvlink__system_access Indicates if system access is supported. Instance values map from logical nvlink ID (uint64) to value (uint64). nvlink__system_atomic Indicates if system atomics are supported. Instance values map from logical nvlink ID (uint64) to value (uint64). NUMA Topology Metrics numa__cpu_affinity CPU affinity for each device. Instance values map from device ID (uint64) to comma-separated values (string). numa__dev_display_name_all Device display names for all devices. Instance values map from device ID (uint64) to comma-separated values (string). numa__id_cpu NUMA ID of the nearest CPU for each device. Instance values map from device ID (uint64) to comma-separated values (string). numa__id_memory NUMA ID of the nearest memory for each device. Instance values map from device ID (uint64) to comma-separated values (string). Device Attributes device__attribute_* metrics represent CUDA device attributes . Collecting them does not require an additional kernel replay pass, as their value is available from the CUDA driver for each CUDA device. See below for custom device__attribute_* metrics. device__attribute_architecture Chip architecture of the CUDA device. device__attribute_confidential_computing_mode Confidential computing mode. device__attribute_device_index Device index. device__attribute_display_name Product name of the CUDA device. device__attribute_fb_bus_width Frame buffer bus width. device__attribute_fbp_count Total number of frame buffer partitions. device__attribute_implementation Chip implementation of the CUDA device. device__attribute_l2s_count Total number of Level 2 cache slices. device__attribute_limits_max_cta_per_sm Maximum number of CTA per SM. device__attribute_max_gpu_frequency_khz Maximum GPU frequency in kilohertz. device__attribute_max_ipc_per_multiprocessor Maximum number of instructions per clock per multiprocessor. device__attribute_max_ipc_per_scheduler Maximum number of instructions per clock per scheduler. device__attribute_max_mem_frequency_khz Peak memory frequency in kilohertz. device__attribute_max_registers_per_thread Maximum number of registers available per thread. device__attribute_max_warps_per_multiprocessor Maximum number of warps per multiprocessor. device__attribute_max_warps_per_scheduler Maximum number of warps per scheduler. device__attribute_num_l2s_per_fbp Number of Level 2 cache slices per frame buffer partition. device__attribute_num_schedulers_per_multiprocessor Number of schedulers per multiprocessor. device__attribute_num_tex_per_multiprocessor Number of TEX unit per multiprocessor. device__attribute_sass_level SASS level. Warp Stall Reasons Collected using warp scheduler state sampling. They are incremented regardless if the scheduler issued an instruction in the same cycle or not. These metrics have instance values mapping from the function address (uint64) to the number of samples (uint64). smsp__pcsamp_warps_issue_stalled_barrier Warp was stalled waiting for sibling warps at a CTA barrier. A high number of warps waiting at a barrier is commonly caused by diverging code paths before a barrier. This causes some warps to wait a long time until other warps reach the synchronization point. Whenever possible, try to divide up the work into blocks of uniform workloads. If the block size is 512 threads or greater, consider splitting it into smaller groups. This can increase eligible warps without affecting occupancy, unless shared memory becomes a new occupancy limiter. Also, try to identify which barrier instruction causes the most stalls, and optimize the code executed before that synchronization point first. smsp__pcsamp_warps_issue_stalled_branch_resolving Warp was stalled waiting for a branch target to be computed, and the warp program counter to be updated. To reduce the number of stalled cycles, consider using fewer jump/branch operations and reduce control flow divergence, e.g. by reducing or coalescing conditionals in your code. See also the related No Instructions state. smsp__pcsamp_warps_issue_stalled_dispatch_stall Warp was stalled waiting on a dispatch stall. A warp stalled during dispatch has an instruction ready to issue, but the dispatcher holds back issuing the warp due to other conflicts or events. smsp__pcsamp_warps_issue_stalled_drain Warp was stalled after EXIT waiting for all outstanding memory operations to complete so that warp\u2019s resources can be freed. A high number of stalls due to draining warps typically occurs when a lot of data is written to memory towards the end of a kernel. Make sure the memory access patterns of these store operations are optimal for the target architecture and consider parallelized data reduction, if applicable. smsp__pcsamp_warps_issue_stalled_imc_miss Warp was stalled waiting for an immediate constant cache (IMC) miss. A read from constant memory costs one memory read from device memory only on a cache miss; otherwise, it just costs one read from the constant cache. Immediate constants are encoded into the SASS instruction as \u2018c[bank][offset]\u2019. Accesses to different addresses by threads within a warp are serialized, thus the cost scales linearly with the number of unique addresses read by all threads within a warp. As such, the constant cache is best when threads in the same warp access only a few distinct locations. If all threads of a warp access the same location, then constant memory can be as fast as a register access. smsp__pcsamp_warps_issue_stalled_lg_throttle Warp was stalled waiting for the L1 instruction queue for local and global (LG) memory operations to be not full. Typically, this stall occurs only when executing local or global memory instructions extremely frequently. Avoid redundant global memory accesses. Try to avoid using thread-local memory by checking if dynamically indexed arrays are declared in local scope, of if the kernel has excessive register pressure causing by spills. If applicable, consider combining multiple lower-width memory operations into fewer wider memory operations and try interleaving memory operations and math instructions. smsp__pcsamp_warps_issue_stalled_long_scoreboard Warp was stalled waiting for a scoreboard dependency on a L1TEX (local, global, surface, texture) operation. Find the instruction producing the data being waited upon to identify the culprit. To reduce the number of cycles waiting on L1TEX data accesses verify the memory access patterns are optimal for the target architecture, attempt to increase cache hit rates by increasing data locality (coalescing), or by changing the cache configuration. Consider moving frequently used data to shared memory. smsp__pcsamp_warps_issue_stalled_math_pipe_throttle Warp was stalled waiting for the execution pipe to be available. This stall occurs when all active warps execute their next instruction on a specific, oversubscribed math pipeline. Try to increase the number of active warps to hide the existent latency or try changing the instruction mix to utilize all available pipelines in a more balanced way. smsp__pcsamp_warps_issue_stalled_membar Warp was stalled waiting on a memory barrier. Avoid executing any unnecessary memory barriers and assure that any outstanding memory operations are fully optimized for the target architecture. smsp__pcsamp_warps_issue_stalled_mio_throttle Warp was stalled waiting for the MIO (memory input/output) instruction queue to be not full. This stall reason is high in cases of extreme utilization of the MIO pipelines, which include special math instructions, dynamic branches, as well as shared memory instructions. When caused by shared memory accesses, trying to use fewer but wider loads can reduce pipeline pressure. smsp__pcsamp_warps_issue_stalled_misc Warp was stalled for a miscellaneous hardware reason. smsp__pcsamp_warps_issue_stalled_no_instructions Warp was stalled waiting to be selected to fetch an instruction or waiting on an instruction cache miss. A high number of warps not having an instruction fetched is typical for very short kernels with less than one full wave of work in the grid. Excessively jumping across large blocks of assembly code can also lead to more warps stalled for this reason, if this causes misses in the instruction cache. See also the related Branch Resolving state. smsp__pcsamp_warps_issue_stalled_not_selected Warp was stalled waiting for the micro scheduler to select the warp to issue. Not selected warps are eligible warps that were not picked by the scheduler to issue that cycle as another warp was selected. A high number of not selected warps typically means you have sufficient warps to cover warp latencies and you may consider reducing the number of active warps to possibly increase cache coherence and data locality. smsp__pcsamp_warps_issue_stalled_selected Warp was selected by the micro scheduler and issued an instruction. smsp__pcsamp_warps_issue_stalled_short_scoreboard Warp was stalled waiting for a scoreboard dependency on a MIO (memory input/output) operation (not to L1TEX). The primary reason for a high number of stalls due to short scoreboards is typically memory operations to shared memory. Other reasons include frequent execution of special math instructions (e.g. MUFU) or dynamic branching (e.g. BRX, JMX). Consult the Memory Workload Analysis section to verify if there are shared memory operations and reduce bank conflicts, if reported. Assigning frequently accessed values to variables can assist the compiler in using low-latency registers instead of direct memory accesses. smsp__pcsamp_warps_issue_stalled_sleeping Warp was stalled due to all threads in the warp being in the blocked, yielded, or sleep state. Reduce the number of executed NANOSLEEP instructions, lower the specified time delay, and attempt to group threads in a way that multiple threads in a warp sleep at the same time. smsp__pcsamp_warps_issue_stalled_tex_throttle Warp was stalled waiting for the L1 instruction queue for texture operations to be not full. This stall reason is high in cases of extreme utilization of the L1TEX pipeline. Try issuing fewer texture fetches, surface loads, surface stores, or decoupled math operations. If applicable, consider combining multiple lower-width memory operations into fewer wider memory operations and try interleaving memory operations and math instructions. Consider converting texture lookups or surface loads into global memory lookups. Texture can accept four threads\u2019 requests per cycle, whereas global accepts 32 threads. smsp__pcsamp_warps_issue_stalled_wait Warp was stalled waiting on a fixed latency execution dependency. Typically, this stall reason should be very low and only shows up as a top contributor in already highly optimized kernels. Try to hide the corresponding instruction latencies by increasing the number of active warps, restructuring the code or unrolling loops. Furthermore, consider switching to lower-latency instructions, e.g. by making use of fast math compiler options. Warp Stall Reasons (Not Issued) Collected using warp scheduler state sampling. They are incremented only on cycles in which the warp scheduler issued no instruction. These metrics have instance values mapping from the function address (uint64) to the number of samples (uint64). smsp__pcsamp_warps_issue_stalled_barrier_not_issued Warp was stalled waiting for sibling warps at a CTA barrier. A high number of warps waiting at a barrier is commonly caused by diverging code paths before a barrier. This causes some warps to wait a long time until other warps reach the synchronization point. Whenever possible, try to divide up the work into blocks of uniform workloads. If the block size is 512 threads or greater, consider splitting it into smaller groups. This can increase eligible warps without affecting occupancy, unless shared memory becomes a new occupancy limiter. Also, try to identify which barrier instruction causes the most stalls, and optimize the code executed before that synchronization point first. smsp__pcsamp_warps_issue_stalled_branch_resolving_not_issued Warp was stalled waiting for a branch target to be computed, and the warp program counter to be updated. To reduce the number of stalled cycles, consider using fewer jump/branch operations and reduce control flow divergence, e.g. by reducing or coalescing conditionals in your code. See also the related No Instructions state. smsp__pcsamp_warps_issue_stalled_dispatch_stall_not_issued Warp was stalled waiting on a dispatch stall. A warp stalled during dispatch has an instruction ready to issue, but the dispatcher holds back issuing the warp due to other conflicts or events. smsp__pcsamp_warps_issue_stalled_drain_not_issued Warp was stalled after EXIT waiting for all memory operations to complete so that warp resources can be freed. A high number of stalls due to draining warps typically occurs when a lot of data is written to memory towards the end of a kernel. Make sure the memory access patterns of these store operations are optimal for the target architecture and consider parallelized data reduction, if applicable. smsp__pcsamp_warps_issue_stalled_imc_miss_not_issued Warp was stalled waiting for an immediate constant cache (IMC) miss. A read from constant memory costs one memory read from device memory only on a cache miss; otherwise, it just costs one read from the constant cache. Accesses to different addresses by threads within a warp are serialized, thus the cost scales linearly with the number of unique addresses read by all threads within a warp. As such, the constant cache is best when threads in the same warp access only a few distinct locations. If all threads of a warp access the same location, then constant memory can be as fast as a register access. smsp__pcsamp_warps_issue_stalled_lg_throttle_not_issued Warp was stalled waiting for the L1 instruction queue for local and global (LG) memory operations to be not full. Typically, this stall occurs only when executing local or global memory instructions extremely frequently. Avoid redundant global memory accesses. Try to avoid using thread-local memory by checking if dynamically indexed arrays are declared in local scope, of if the kernel has excessive register pressure causing by spills. If applicable, consider combining multiple lower-width memory operations into fewer wider memory operations and try interleaving memory operations and math instructions. smsp__pcsamp_warps_issue_stalled_long_scoreboard_not_issued Warp was stalled waiting for a scoreboard dependency on a L1TEX (local, global, surface, texture) operation. Find the instruction producing the data being waited upon to identify the culprit. To reduce the number of cycles waiting on L1TEX data accesses verify the memory access patterns are optimal for the target architecture, attempt to increase cache hit rates by increasing data locality (coalescing), or by changing the cache configuration. Consider moving frequently used data to shared memory. smsp__pcsamp_warps_issue_stalled_math_pipe_throttle_not_issued Warp was stalled waiting for the execution pipe to be available. This stall occurs when all active warps execute their next instruction on a specific, oversubscribed math pipeline. Try to increase the number of active warps to hide the existent latency or try changing the instruction mix to utilize all available pipelines in a more balanced way. smsp__pcsamp_warps_issue_stalled_membar_not_issued Warp was stalled waiting on a memory barrier. Avoid executing any unnecessary memory barriers and assure that any outstanding memory operations are fully optimized for the target architecture. smsp__pcsamp_warps_issue_stalled_mio_throttle_not_issued Warp was stalled waiting for the MIO (memory input/output) instruction queue to be not full. This stall reason is high in cases of extreme utilization of the MIO pipelines, which include special math instructions, dynamic branches, as well as shared memory instructions. When caused by shared memory accesses, trying to use fewer but wider loads can reduce pipeline pressure. smsp__pcsamp_warps_issue_stalled_misc_not_issued Warp was stalled for a miscellaneous hardware reason. smsp__pcsamp_warps_issue_stalled_no_instructions_not_issued Warp was stalled waiting to be selected to fetch an instruction or waiting on an instruction cache miss. A high number of warps not having an instruction fetched is typical for very short kernels with less than one full wave of work in the grid. Excessively jumping across large blocks of assembly code can also lead to more warps stalled for this reason, if this causes misses in the instruction cache. See also the related Branch Resolving state. smsp__pcsamp_warps_issue_stalled_not_selected_not_issued Warp was stalled waiting for the micro scheduler to select the warp to issue. Not selected warps are eligible warps that were not picked by the scheduler to issue that cycle as another warp was selected. A high number of not selected warps typically means you have sufficient warps to cover warp latencies and you may consider reducing the number of active warps to possibly increase cache coherence and data locality. smsp__pcsamp_warps_issue_stalled_selected_not_issued Warp was selected by the micro scheduler and issued an instruction. smsp__pcsamp_warps_issue_stalled_short_scoreboard_not_issued Warp was stalled waiting for a scoreboard dependency on a MIO (memory input/output) operation (not to L1TEX). The primary reason for a high number of stalls due to short scoreboards is typically memory operations to shared memory. Other reasons include frequent execution of special math instructions (e.g. MUFU) or dynamic branching (e.g. BRX, JMX). Consult the Memory Workload Analysis section to verify if there are shared memory operations and reduce bank conflicts, if reported. Assigning frequently accessed values to variables can assist the compiler in using low-latency registers instead of direct memory accesses. smsp__pcsamp_warps_issue_stalled_sleeping_not_issued Warp was stalled due to all threads in the warp being in the blocked, yielded, or sleep state. Reduce the number of executed NANOSLEEP instructions, lower the specified time delay, and attempt to group threads in a way that multiple threads in a warp sleep at the same time. smsp__pcsamp_warps_issue_stalled_tex_throttle_not_issued Warp was stalled waiting for the L1 instruction queue for texture operations to be not full. This stall reason is high in cases of extreme utilization of the L1TEX pipeline. Try issuing fewer texture fetches, surface loads, surface stores, or decoupled math operations. If applicable, consider combining multiple lower-width memory operations into fewer wider memory operations and try interleaving memory operations and math instructions. Consider converting texture lookups or surface loads into global memory lookups. Texture can accept four threads\u2019 requests per cycle, whereas global accepts 32 threads. smsp__pcsamp_warps_issue_stalled_wait_not_issued Warp was stalled waiting on a fixed latency execution dependency. Typically, this stall reason should be very low and only shows up as a top contributor in already highly optimized kernels. Try to hide the corresponding instruction latencies by increasing the number of active warps, restructuring the code or unrolling loops. Furthermore, consider switching to lower-latency instructions, e.g. by making use of fast math compiler options. Source Metrics Most are collected using SASS-patching. These metrics have instance values mapping from function address (uint64) to associated values (uint64). Metrics memory_[access_]type map to string values. branch_inst_executed Number of unique branch targets assigned to the instruction, including both divergent and uniform branches. derived__avg_thread_executed Average number of thread-level executed instructions per warp (regardless of their predicate). Computed as: thread_inst_executed / inst_executed derived__avg_thread_executed_true Average number of predicated-on thread-level executed instructions per warp. Computed as: thread_inst_executed_true / inst_executed derived__memory_l1_conflicts_shared_nway Average N-way conflict in L1 per shared memory instruction. A 1-way access has no conflicts and resolves in a single pass. Computed as: memory_l1_wavefronts_shared / inst_executed derived__memory_l1_wavefronts_shared_excessive Excessive number of wavefronts in L1 from shared memory instructions, because not all not predicated-off threads performed the operation. derived__memory_l2_theoretical_sectors_global_excessive Excessive theoretical number of sectors requested in L2 from global memory instructions, because not all not predicated-off threads performed the operation. inst_executed Number of warp-level executed instructions, ignoring instruction predicates. Warp-level means the values increased by one per individual warp executing the instruction, independent of the number of participating threads within each warp. memory_access_size_type The size of the memory access, in bits. memory_access_type The type of memory access (e.g. load or store). memory_l1_tag_requests_global Number of L1 tag requests generated by global memory instructions. memory_l1_wavefronts_shared Number of wavefronts in L1 from shared memory instructions. memory_l1_wavefronts_shared_ideal Ideal number of wavefronts in L1 from shared memory instructions, assuming each not predicated-off thread performed the operation. memory_l2_theoretical_sectors_global Theoretical number of sectors requested in L2 from global memory instructions. memory_l2_theoretical_sectors_global_ideal Ideal number of sectors requested in L2 from global memory instructions, assuming each not predicated-off thread performed the operation. memory_l2_theoretical_sectors_local Theoretical number of sectors requested in L2 from local memory instructions. memory_type The accessed address space (global/local/shared). smsp__branch_targets_threads_divergent Number of divergent branch targets, including fallthrough. Incremented only when there are two or more active threads with divergent targets. smsp__branch_targets_threads_uniform Number of uniform branch execution, including fallthrough, where all active threads selected the same branch target. smsp__pcsamp_sample_count Number of collected warp state samples per program counter. This metric is collected using warp sampling. thread_inst_executed Number of thread-level executed instructions, regardless of predicate presence or evaluation. thread_inst_executed_true Number of thread-level executed instructions, where the instruction predicate evaluated to true, or no predicate was given. L2 Cache Eviction Metrics smsp__sass_inst_executed_memdesc_explicit_evict_type L2 cache eviction policy types. smsp__sass_inst_executed_memdesc_explicit_hitprop_evict_first Number of warp-level executed instructions with L2 cache eviction hit property \u2018first\u2019. smsp__sass_inst_executed_memdesc_explicit_hitprop_evict_last Number of warp-level executed instructions with L2 cache eviction hit property \u2018last\u2019. smsp__sass_inst_executed_memdesc_explicit_hitprop_evict_normal Number of warp-level executed instructions with L2 cache eviction hit property \u2018normal\u2019. smsp__sass_inst_executed_memdesc_explicit_hitprop_evict_normal_demote Number of warp-level executed instructions with L2 cache eviction hit property \u2018normal demote\u2019. smsp__sass_inst_executed_memdesc_explicit_missprop_evict_first Number of warp-level executed instructions with L2 cache eviction miss property \u2018first\u2019. smsp__sass_inst_executed_memdesc_explicit_missprop_evict_normal Number of warp-level executed instructions with L2 cache eviction miss property \u2018normal\u2019. Instructions Per Opcode Metrics Collected using SASS-patching. These metrics have instance values mapping from the SASS opcode (string) to the number of executions (uint64). sass__inst_executed_per_opcode Number of warp-level executed instructions, instanced by basic SASS opcode. sass__inst_executed_per_opcode_with_modifier_all Number of warp-level executed instructions, instanced by all SASS opcode modifiers. sass__inst_executed_per_opcode_with_modifier_selective Number of warp-level executed instructions, instanced by selective SASS opcode modifiers. sass__thread_inst_executed_true_per_opcode Number of thread-level executed instructions, instanced by basic SASS opcode. sass__thread_inst_executed_true_per_opcode_with_modifier_all Number of thread-level executed instructions, instanced by all SASS opcode modifiers. sass__thread_inst_executed_true_per_opcode_with_modifier_selective Number of thread-level executed instructions, instanced by selective SASS opcode modifiers. Metric Groups group:memory__chart Group of metrics for the workload analysis chart. group:memory__dram_table Group of metrics for the device memory workload analysis table. group:memory__first_level_cache_table Group of metrics for the L1/TEX cache workload analysis table. group:memory__l2_cache_evict_policy_table Group of metrics for the L2 cache eviction policies table. group:memory__l2_cache_table Group of metrics for the L2 cache workload analysis table. group:memory__shared_table Group of metrics for the shared memory workload analysis table. group:smsp__pcsamp_warp_stall_reasons Group of metrics for the number of samples from the warp sampler per program location. group:smsp__pcsamp_warp_stall_reasons_not_issued Group of metrics for the number of samples from the warp sampler per program location on cycles the warp scheduler issued no instructions. Profiler Metrics Metrics generated by the tool itself to inform about statistics or problems during profiling. profiler__perfworks_session_reuse Indicates if the PerfWorks session was reused between results. profiler__pmsampler_buffer_size_bytes Buffer size in bytes per pass group used for PM sampling. Instance values map from pass group to bytes. profiler__pmsampler_ctxsw_* GPU context switch states over time during PM sampling for a specific pass group. Instance values map from timestamp to context state (1 - enabled, 0 - disabled). profiler__pmsampler_dropped_samples Number of samples dropped per pass group during PM sampling due to insufficient buffer size. Instance values map from pass group to samples. profiler__pmsampler_interval_cycles Sampling interval in cycles per pass group used for PM sampling, or zero if time-based interval was used. Instance values map from pass group to cycles. profiler__pmsampler_interval_time Sampling interval in nanoseconds per pass group used for PM sampling, or zero if cycle-based interval was used. Instance values map from pass group to nanoseconds. profiler__pmsampler_merged_samples Number of samples merged per pass group during PM sampling due to HW back pressure while streaming results. Instance values map from pass group to samples. profiler__pmsampler_pass_groups Number of pass groups used for PM sampling. Instance values map from pass group to comma-separated list of metrics collected in this pass. profiler__replayer_passes Number of passes the result was replayed for profiling across all experiments. profiler__replayer_passes_type_warmup Number of passes the result was replayed to warmup the GPU for profiling. smsp__pcsamp_aggregated_passes Number of passes required for statistical warp stall sampling. smsp__pcsamp_buffer_size_bytes Buffer size in bytes for statistical warp stall sampling. smsp__pcsamp_dropped_bytes Bytes dropped during statistical warp stall sampling due to insufficient buffer size. smsp__pcsamp_interval Interval number for warp stall sampling. smsp__pcsamp_interval_cycles Interval cycles for statistical warp stall sampling.", "keywords": []}, {"id": 173, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#metrics-structure", "display_name": "Metrics Structure", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "metrics-structure", "priority": -1, "content": "Metrics Overview NVIDIA Nsight Compute uses an advanced metrics calculation system, designed to help you determine what happened (counters and metrics), and how close the program reached to peak GPU performance (throughputs as a percentage). Every counter has associated peak rates in the database, to allow computing its throughput as a percentage. Throughput metrics return the maximum percentage value of their constituent counters. These constituents have been carefully selected to represent the sections of the GPU pipeline that govern peak performance. While all counters can be converted to a %-of-peak, not all counters are suitable for peak-performance analysis; examples of unsuitable counters include qualified subsets of activity, and workload residency counters. Using throughput metrics ensures meaningful and actionable analysis. Two types of peak rates are available for every counter: burst and sustained. Burst rate is the maximum rate reportable in a single clock cycle. Sustained rate is the maximum rate achievable over an infinitely long measurement period, for \u201ctypical\u201d operations. For many counters, burst equals sustained. Since the burst rate cannot be exceeded, percentages of burst rate will always be less than 100%. Percentages of sustained rate can occasionally exceed 100% in edge cases. Metrics Entities While in NVIDIA Nsight Compute, all performance counters are named metrics , they can be split further into groups with specific properties. For metrics collected via the PerfWorks measurement library, the following entities exist: Counters may be either a raw counter from the GPU, or a calculated counter value. Every counter has four sub-metrics under it, which are also called roll-ups : .sum The sum of counter values across all unit instances. .avg The average counter value across all unit instances. .min The minimum counter value across all unit instances. .max The maximum counter value across all unit instances. Counter roll-ups have the following calculated quantities as built-in sub-metrics: .peak_sustained the peak sustained rate .peak_sustained_active the peak sustained rate during unit active cycles .peak_sustained_active.per_second the peak sustained rate during unit active cycles, per second * .peak_sustained_elapsed the peak sustained rate during unit elapsed cycles .peak_sustained_elapsed.per_second the peak sustained rate during unit elapsed cycles, per second * .per_second the number of operations per second .per_cycle_active the number of operations per unit active cycle .per_cycle_elapsed the number of operations per unit elapsed cycle .pct_of_peak_sustained_active % of peak sustained rate achieved during unit active cycles .pct_of_peak_sustained_elapsed % of peak sustained rate achieved during unit elapsed cycles * sub-metrics added in NVIDIA Nsight Compute 2022.2.0. Example: ncu --query-metrics-mode suffix --metrics sm__inst_executed --chip ga100 Ratios have three sub-metrics: .pct The value expressed as a percentage. .ratio The value expressed as a ratio. .max_rate The ratio\u2019s maximum value. Example: ncu --query-metrics-mode suffix --metrics smsp__average_warp_latency --chip ga100 Throughputs indicate how close a portion of the GPU reached to peak rate. Every throughput has the following sub-metrics: .pct_of_peak_sustained_active % of peak sustained rate achieved during unit active cycles .pct_of_peak_sustained_elapsed % of peak sustained rate achieved during unit elapsed cycles Example: ncu --query-metrics-mode suffix --metrics sm__throughput --chip ga100 Throughputs have a breakdown of underlying metrics from which the throughput value is computed. You can collect breakdown:<throughput-metric> to collect a throughput\u2019s breakdown metrics. Deprecated counter sub-metrics: The following sub-metrics were removed, due to not being useful for performance optimization: .peak_burst the peak burst rate .pct_of_peak_burst_active % of peak burst rate achieved during unit active cycles .pct_of_peak_burst_elapsed % of peak burst rate achieved during unit elapsed cycles .pct_of_peak_burst_region % of peak burst rate achieved over a user-specified \u201crange\u201d .pct_of_peak_burst_frame % of peak burst rate achieved over a user-specified \u201cframe\u201d .pct_of_peak_sustained_region % of peak sustained rate achieved over a user-specified \u201crange\u201d time .pct_of_peak_sustained_frame % of peak sustained rate achieved over a user-specified \u201cframe\u201d time .per_cycle_in_region the number of operations per user-specified \u201crange\u201d cycle .per_cycle_in_frame the number of operations per user-specified \u201cframe\u201d cycle .peak_sustained_region the peak sustained rate over a user-specified \u201crange\u201d .peak_sustained_region.per_second the peak sustained rate over a user-specified \u201crange\u201d, per second * .peak_sustained_frame the peak sustained rate over a user-specified \u201cframe\u201d .peak_sustained_frame.per_second the peak sustained rate over a user-specified \u201cframe\u201d, per second * Deprecated throughput sub-metrics: The following sub-metrics were removed, due to not being useful for performance optimization: .pct_of_peak_burst_active % of peak burst rate achieved during unit active cycles .pct_of_peak_burst_elapsed % of peak burst rate achieved during unit elapsed cycles .pct_of_peak_burst_region % of peak burst rate achieved over a user-specified \u201crange\u201d time .pct_of_peak_burst_frame % of peak burst rate achieved over a user-specified \u201cframe\u201d time .pct_of_peak_sustained_region % of peak sustained rate achieved over a user-specified \u201crange\u201d .pct_of_peak_sustained_frame % of peak sustained rate achieved over a user-specified \u201cframe\u201d In addition to PerfWorks metrics, NVIDIA Nsight Compute uses several other measurement providers that each generate their own metrics. These are explained in the Metrics Reference . Metrics Examples ## non-metric names -- *not* directly evaluable sm__inst_executed # counter smsp__average_warp_latency # ratio sm__throughput # throughput ## a counter's four first-level sub-metrics -- all evaluable sm__inst_executed.sum sm__inst_executed.avg sm__inst_executed.min sm__inst_executed.max ## all names below are metrics -- all evaluable l1tex__data_bank_conflicts_pipe_lsu.sum l1tex__data_bank_conflicts_pipe_lsu.sum.peak_sustained l1tex__data_bank_conflicts_pipe_lsu.sum.peak_sustained_active l1tex__data_bank_conflicts_pipe_lsu.sum.peak_sustained_active.per_second l1tex__data_bank_conflicts_pipe_lsu.sum.peak_sustained_elapsed l1tex__data_bank_conflicts_pipe_lsu.sum.peak_sustained_elapsed.per_second l1tex__data_bank_conflicts_pipe_lsu.sum.per_cycle_active l1tex__data_bank_conflicts_pipe_lsu.sum.per_cycle_elapsed l1tex__data_bank_conflicts_pipe_lsu.sum.per_second l1tex__data_bank_conflicts_pipe_lsu.sum.pct_of_peak_sustained_active l1tex__data_bank_conflicts_pipe_lsu.sum.pct_of_peak_sustained_elapsed ... Metrics Naming Conventions Counters and metrics _generally_ obey the naming scheme: Unit-Level Counter : unit__(subunit?)_(pipestage?)_quantity_(qualifiers?) Interface Counter : unit__(subunit?)_(pipestage?)_(interface)_quantity_(qualifiers?) Unit Metric : (counter_name).(rollup_metric) Sub-Metric : (counter_name).(rollup_metric).(submetric) where unit: A logical or physical unit of the GPU subunit: The subunit within the unit where the counter was measured. Sometimes this is a pipeline mode instead. pipestage: The pipeline stage within the subunit where the counter was measured. quantity: What is being measured. Generally matches the dimensional units . qualifiers: Any additional predicates or filters applied to the counter. Often, an unqualified counter can be broken down into several qualified sub-components. interface: Of the form sender2receiver , where sender is the source-unit and receiver is the destination-unit. rollup_metric: One of sum, avg, min, max. submetric: refer to section Metrics Entities Components are not always present. Most top-level counters have no qualifiers. Subunit and pipestage may be absent where irrelevant, or there may be many subunit specifiers for detailed counters. Cycle Metrics Counters using the term cycles in the name report the number of cycles in the unit\u2019s clock domain. Unit-level cycle metrics include: unit__cycles_elapsed : The number of cycles within a range. The cycles\u2019 DimUnits are specific to the unit\u2019s clock domain. unit__cycles_active : The number of cycles where the unit was processing data. unit__cycles_stalled : The number of cycles where the unit was unable to process new data because its output interface was blocked. unit__cycles_idle : The number of cycles where the unit was idle. Interface-level cycle counters are often (not always) available in the following variations: unit__(interface)_active : Cycles where data was transferred from source-unit to destination-unit. unit__(interface)_stalled : Cycles where the source-unit had data, but the destination-unit was unable to accept data. Instanced Metrics Metrics collected with NVIDIA Nsight Compute can have a single (aggregate) value, multiple instance values, or both. Instances allow the metric to have multiple sub-values, e.g. representing the value of an source metric at each instruction offset. If a metric has instance values, it often also has a correlation ID for each instance. Correlation IDs and values form a mapping that allows the tool to correlate the values within a context. For source metrics, that context is commonly the address ranges of the functions executed as part of the workload. You can find which metrics have instance values in the Metrics Reference . In the UI, the Metric Details tool window can be used to conveniently view correlation IDs and instance values for each metric. Also, both the UI and the command line interface provide options to show instance values in addition to a metric aggregate where applicable.", "keywords": []}, {"id": 174, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#multi-instance-gpu", "display_name": "Multi Instance GPU", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "multi-instance-gpu", "priority": -1, "content": "Multi-Instance GPU (MIG) is a feature that allows a GPU to be partitioned into multiple CUDA devices. The partitioning is carried out on two levels: First, a GPU can be split into one or multiple GPU Instances. Each GPU Instance claims ownership of one or more streaming multiprocessors (SM), a subset of the overall GPU memory, and possibly other GPU resources, such as the video encoders/decoders. Second, each GPU Instance can be further partitioned into one or more Compute Instances. Each Compute Instance has exclusive ownership of its assigned SMs of the GPU Instance. However, all Compute Instances within a GPU Instance share the GPU Instance\u2019s memory and memory bandwidth. Every Compute Instance acts and operates as a CUDA device with a unique device ID. See the driver release notes as well as the documentation for the nvidia-smi CLI tool for more information on how to configure MIG instances. For profiling, a Compute Instance can be of one of two types: isolated or shared . An isolated Compute Instance owns all of its assigned resources and does not share any GPU unit with another Compute Instance. In other words, the Compute Instance is the same size as its parent GPU Instance and consequently does not have any other sibling Compute Instances. Profiling works as usual for isolated Compute Instances. A shared Compute Instance uses GPU resources that can potentially also be accessed by other Compute Instances in the same GPU Instance. Due to this resource sharing, collecting profiling data from those shared units is not permitted. Attempts to collect metrics from a shared unit fail with an error message of ==ERROR== Failed to access the following metrics. When profiling on a MIG instance, it is not possible to collect metrics from GPU units that are shared with other MIG instances followed by the list of failing metrics. Collecting only metrics from GPU units that are exclusively owned by a shared Compute Instance is still possible. Locking Clocks NVIDIA Nsight Compute is not able to set the clock frequency on any Compute Instance for profiling. You can continue analyzing kernels without fixed clock frequencies (using --clock-control none ; see here for more details). If you have sufficient permissions, nvidia-smi can be used to configure a fixed frequency for the whole GPU by calling nvidia-smi --lock-gpu-clocks=tdp,tdp . This sets the GPU clocks to the base TDP frequency until you reset the clocks by calling nvidia-smi --reset-gpu-clocks . MIG on Baremetal (non-vGPU) All Compute Instances on a GPU share the same clock frequencies. MIG on NVIDIA vGPU Enabling profiling for a VM gives the VM access to the GPU\u2019s global performance counters, which may include activity from other VMs executing on the same GPU. Enabling profiling for a VM also allows the VM to lock clocks on the GPU, which impacts all other VMs executing on the same GPU, including MIG Compute Instances.", "keywords": []}, {"id": 175, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#overhead", "display_name": "Overhead", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "overhead", "priority": -1, "content": "As with most measurements, collecting performance data using NVIDIA Nsight Compute CLI incurs some runtime overhead on the application. The overhead does depend on a number of different factors: Number and type of collected metrics Depending on the selected metric, data is collected either through a hardware performance monitor on the GPU, through software patching of the kernel instructions or via a launch or device attribute. The overhead between these mechanisms varies greatly, with launch and device attributes being \u201cstatically\u201d available and requiring no kernel runtime overhead. Furthermore, only a limited number of metrics can be collected in a single pass of the kernel execution. If more metrics are requested, the kernel launch is replayed multiple times, with its accessible memory being saved and restored between subsequent passes to guarantee deterministic execution. Therefore, collecting more metrics can significantly increase overhead by requiring more replay passes and increasing the total amount of memory that needs to be restored during replay. The collected section set Since each set specifies a group of sections to be collected, choosing a less comprehensive set can reduce profiling overhead. See the --set command in the NVIDIA Nsight Compute CLI documentation. Number of collected sections Since each section specifies a number of metrics to be collected, selecting fewer sections can reduce profiling overhead. See the --section command in the NVIDIA Nsight Compute CLI documentation. Number of profiled kernels By default, all selected metrics are collected for all launched kernels. To reduce the impact on the application, you can try to limit performance data collection to as few kernel functions and instances as makes sense for your analysis. See the filtering commands in the NVIDIA Nsight Compute CLI documentation. There is a relatively high one-time overhead for the first profiled kernel in each context to generate the metric configuration. This overhead does not occur for subsequent kernels in the same context, if the list of collected metrics remains unchanged. GPU Architecture For some metrics, the overhead can vary depending on the exact chip they are collected on, e.g. due to varying number of units on the chip. Similarly, the overhead for resetting the L2 cache in-between kernel replay passes depends on the size of that cache.", "keywords": []}, {"id": 176, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#persistence-mode", "display_name": "Persistence Mode", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "persistence-mode", "priority": -1, "content": "The NVIDIA kernel mode driver must be running and connected to a target GPU device before any user interactions with that device can take place. The driver behavior differs depending on the OS. Generally, on Linux, if the kernel mode driver is not already running or connected to a target GPU, the invocation of any program that attempts to interact with that GPU will transparently cause the driver to load and/or initialize the GPU. When all GPU clients terminate the driver will then deinitialize the GPU. If persistence mode is not enabled (as part of the OS, or by the user), applications triggering GPU initialization may incur a short startup cost. In addition, on some configurations, there may also be a shutdown cost when the GPU is de-initialized at the end of the application. It is recommended to enable persistence mode on applicable operating systems before profiling with NVIDIA Nsight Compute for more consistent application behavior.", "keywords": []}, {"id": 177, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#pm-sampling", "display_name": "PM Sampling", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "pm-sampling", "priority": -1, "content": "NVIDIA Nsight Compute supports collecting many metrics by sampling the GPU\u2019s performance monitors (PM) periodically at fixed intervals. The resulting metrics are instanced , with each sample being composed of its value and the (GPU) timestamp when it was collected. This allows the tool to visualize the data on a timeline that helps you understand how the behavior of the profiled workload changes during its runtime. Metrics collected with PM sampling have instance values mapping from their sample timestamp (in ns) to their sample value. When logically possible, the non-instanced value of the metric represents the aggregate across all instances. The aggregation operation (e.g. sum, average) depends on the metric structure. A metric is collected using PM sampling in the following cases: The metric name has the pmsampling: prefix . The metric name includes a valid Triage group. The metric is requested in a section\u2019s Timeline field. Prefixing the metric with pmsampling: is still recommended in this case to avoid conflicts with profiler metrics of the same name collected e.g. by other sections. Architecture Support Sampling Intervals Volta and earlier Not supported n/a TU10x-GA100 Supported >= 20000 cycles GA10x and later Supported >= 1000 ns PM sampling is supported on all platforms except vGPU. See below for further limitations that apply to context switch trace . You can query the list of metrics available to PM sampling using the --query-metrics-collection pmsampling option. Note though that while all listed metrics are available to the PM sampler, only those requiring a single pass can be collected. Context Switch Trace Since this data collection samples across the entire GPU device, the tool concurrently collects a context switch trace . The trace is stored as a separate, instanced metric . It tracks when the context of interest was active and can be used to filter the sampling metric to only relevant instances and to better align metrics from multiple passes on the timeline. While it\u2019s generally preferable to have this trace collected, it can be disabled using an environment variable . Note that context switch trace is not supported on Windows Subsystem for Linux (WSL), Multi-Instance GPU (MIG), within containers or on mobile platforms. Counter Domains PM sampling metrics are composed of one or more raw counter dependencies internally. If metrics in the same pass share such a dependency, it is only collected once. Each counter is associated with a counter domain , which describes how and where in the hardware the counter is collected. There is a limited number of counters in each domain that can be collected concurrently in the same pass, and the number may vary, depending on the selected counters. Selecting counters from different domains has the possibility that more metric dependencies can be fit into the same pass. Furthermore, some counters can be collected through different domains, and the domain may be chosen by the tool or the user. When querying the PM sampling metric collection, the required and optional domains for a metric\u2019s counter dependencies are shown. E.g., for l1tex__throughput gpu_sm_a,[gpu_sm_b,gpu_sm_c] , the domain gpu_sm_a is required and one of the optional domains [gpu_sm_b,gpu_sm_c] must be chosen for this metric to be collectable. Counter domains can only be selected explicitly in section files , using one or more instances of the CtrDomains: "<domain>" field for PM sampling metrics. Note that most users should be able to rely on the tool\u2019s automatic selection of counter domains, or the pre-configured domains in section files.", "keywords": []}, {"id": 178, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#profile-series", "display_name": "Profile Series", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "profile-series", "priority": -1, "content": "The performance of a kernel is highly dependent on the used launch parameters. Small changes to the launch parameters can have a significant effect on the runtime behavior of the kernel. However, identifying the best parameter set for a kernel by manually testing a lot of combinations can be a tedious process. To make this workflow faster and more convenient, Profile Series provide the ability to automatically profile a single kernel multiple times with changing parameters. The parameters to be modified and values to be tested can be independently enabled and configured. For each combination of selected parameter values a unique profile result is collected. And the modified parameter values are tracked in the description of the results of a series. By comparing the results of a profile series, the kernel\u2019s behavior on the changing parameters can be seen and the most optimal parameter set can be identified quickly. Profile Series action. Profile Series dialog.", "keywords": []}, {"id": 179, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#profiling-applications", "display_name": "Profiling Applications", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "profiling-applications", "priority": -1, "content": "During regular execution, a CUDA application process will be launched by the user. It communicates directly with the CUDA user-mode driver, and potentially with the CUDA runtime library. Regular Application Execution When profiling an application with NVIDIA Nsight Compute, the behavior is different. The user launches the NVIDIA Nsight Compute frontend (either the UI or the CLI) on the host system, which in turn starts the actual application as a new process on the target system. While host and target are often the same machine, the target can also be a remote system with a potentially different operating system. The tool inserts its measurement libraries into the application process, which allow the profiler to intercept communication with the CUDA user-mode driver. In addition, when a kernel launch is detected, the libraries can collect the requested performance metrics from the GPU. The results are then transferred back to the frontend. Profiled Application Execution", "keywords": []}, {"id": 180, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#range-and-precision", "display_name": "Range and Precision", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "range-and-precision", "priority": -1, "content": "Overview In general, measurement values that lie outside the expected logical range of a metric can be attributed to one or more of the below root-causes. If values are exceeding such range, they are not clamped by the tool to their expected value on purpose to ensure that the rest of the profiler report remains self-consistent. Asynchronous GPU activity GPU engines other than the one measured by a metric (display, copy engine, video encoder, video decoder, etc.) potentially access shared resources during profiling. Such chip-global shared resources include L2, DRAM, PCIe, and NVLINK. If the kernel launch is small, the other engine(s) can cause significant confusion in e.g. the DRAM results, since it is not possible to isolate the DRAM traffic of the SM. To reduce the impact of such asynchronous units, consider profiling on a GPU without active display and without other processes that can access the GPU at the time. Multi-pass data collection Out-of-range metrics often occur when the profiler replays the kernel launch to collect metrics, and work distribution is significantly different across replay passes. A metric such as hit rate (hits / queries) can have significant error if hits and queries are collected on different passes and the kernel does not saturate the GPU to reach a steady state (generally > 20 \u00b5s). Similarly, it can show unexpected values when the workload is inherently variable, as e.g. in the case of spin loops. To mitigate the issue, when applicable try to increase the measured workload to allow the GPU to reach a steady state for each launch. Reducing the number of metrics collected at the same time can also improve precision by increasing the likelihood that counters contributing to one metric are collected in a single pass. Tool issue If you still observe metric issues after following the guidelines above, please reach out to us and describe your issue.", "keywords": []}, {"id": 181, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#range-replay", "display_name": "Range Replay", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "range-replay", "priority": -1, "content": "In Range Replay , all requested metrics in NVIDIA Nsight Compute are grouped into one or more passes. In contrast to Kernel Replay and Application Replay , Range Replay captures and replays complete ranges of CUDA API calls and kernel launches within the profiled application. Metrics are then not associated with individual kernels but with the entire range. This allows the tool to execute kernels without serialization and thereby supports profiling kernels that should be run concurrently for correctness or performance reasons. Execution with Range Replay. An entire range of API calls and kernel launches is captured and replayed. Host and device memory is saved and restored as necessary.", "keywords": []}, {"id": 182, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#replay", "display_name": "Replay", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "replay", "priority": -1, "content": "Depending on which metrics are to be collected, kernels might need to be replayed one or more times, since not all metrics can be collected in a single pass . For example, the number of metrics originating from hardware (HW) performance counters that the GPU can collect at the same time is limited. In addition, patch-based software (SW) performance counters can have a high impact on kernel runtime and would skew results for HW counters.", "keywords": []}, {"id": 183, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#reproducibility", "display_name": "Reproducibility", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "reproducibility", "priority": -1, "content": "In order to provide actionable and deterministic results across application runs, NVIDIA Nsight Compute applies various methods to adjust how metrics are collected. This includes serializing kernel launches, purging GPU caches before each kernel replay or adjusting GPU clocks .", "keywords": []}, {"id": 184, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#roofline-charts", "display_name": "Roofline Charts", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "roofline-charts", "priority": -1, "content": "Roofline charts provide a very helpful way to visualize achieved performance on complex processing units, like GPUs. This section introduces the Roofline charts that are presented within a profile report.", "keywords": []}, {"id": 185, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#roofline-overview", "display_name": "Overview", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "roofline-overview", "priority": -1, "content": "Kernel performance is not only dependent on the operational speed of the GPU. Since a kernel requires data to work on, performance is also dependent on the rate at which the GPU can feed data to the kernel. A typical roofline chart combines the peak performance and memory bandwidth of the GPU, with a metric called Arithmetic Intensity (a ratio between Work and Memory Traffic ), into a single chart, to more realistically represent the achieved performance of the profiled kernel. A simple roofline chart might look like the following: Roofline overview. This chart actually shows two different rooflines. However, the following components can be identified for each: Vertical Axis - The vertical axis represents Floating Point Operations per Second (FLOPS). For GPUs this number can get quite large and so the numbers on this axis can be scaled for easier reading (as shown here). In order to better accommodate the range, this axis is rendered using a logarithmic scale. Horizontal Axis - The horizontal axis represents Arithmetic Intensity , which is the ratio between Work (expressed in floating point operations per second), and Memory Traffic (expressed in bytes per second). The resulting unit is in floating point operations per byte. This axis is also shown using a logarithmic scale. Memory Bandwidth Boundary - The memory bandwidth boundary is the sloped part of the roofline. By default, this slope is determined entirely by the memory transfer rate of the GPU but can be customized inside the SpeedOfLight_RooflineChart.section file if desired. Peak Performance Boundary - The peak performance boundary is the flat part of the roofline By default, this value is determined entirely by the peak performance of the GPU but can be customized inside the SpeedOfLight_RooflineChart.section file if desired. Ridge Point - The ridge point is the point at which the memory bandwidth boundary meets the peak performance boundary. This point is a useful reference when analyzing kernel performance. Achieved Value - The achieved value represents the performance of the profiled kernel. If baselines are being used, the roofline chart will also contain an achieved value for each baseline. The outline color of the plotted achieved value point can be used to determine from which baseline the point came.", "keywords": []}, {"id": 186, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#sampling", "display_name": "Sampling", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "sampling", "priority": -1, "content": "NVIDIA Nsight Compute can collect certain performance data via sampling at fixed intervals.", "keywords": []}, {"id": 187, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#sections-and-rules", "display_name": "Sections and Rules", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "sections-and-rules", "priority": -1, "content": "Identifier and Filename Description ComputeWorkloadAnalysis (Compute Workload Analysis) Detailed analysis of the compute resources of the streaming multiprocessors (SM), including the achieved instructions per clock (IPC) and the utilization of each available pipeline. Pipelines with very high utilization might limit the overall performance. InstructionStats (Instruction Statistics) Statistics of the executed low-level assembly instructions (SASS). The instruction mix provides insight into the types and frequency of the executed instructions. A narrow mix of instruction types implies a dependency on few instruction pipelines, while others remain unused. Using multiple pipelines allows hiding latencies and enables parallel execution. LaunchStats (Launch Statistics) Summary of the configuration used to launch the kernel. The launch configuration defines the size of the kernel grid, the division of the grid into blocks, and the GPU resources needed to execute the kernel. Choosing an efficient launch configuration maximizes device utilization. MemoryWorkloadAnalysis (Memory Workload Analysis) Detailed analysis of the memory resources of the GPU. Memory can become a limiting factor for the overall kernel performance when fully utilizing the involved hardware units (Mem Busy), exhausting the available communication bandwidth between those units (Max Bandwidth), or by reaching the maximum throughput of issuing memory instructions (Mem Pipes Busy). Depending on the limiting factor, the memory chart and tables allow to identify the exact bottleneck in the memory system. NUMA Affinity (NumaAffinity) Non-uniform memory access (NUMA) affinities based on compute and memory distances for all GPUs. Nvlink (Nvlink) High-level summary of NVLink utilization. It shows the total received and transmitted (sent) memory, as well as the overall link peak utilization. Nvlink_Tables (Nvlink_Tables) Detailed tables with properties for each NVLink. Nvlink_Topology (Nvlink_Topology) NVLink Topology diagram shows logical NVLink connections with transmit/receive throughput. Occupancy (Occupancy) Occupancy is the ratio of the number of active warps per multiprocessor to the maximum number of possible active warps. Another way to view occupancy is the percentage of the hardware\u2019s ability to process warps that is actively in use. Higher occupancy does not always result in higher performance, however, low occupancy always reduces the ability to hide latencies, resulting in overall performance degradation. Large discrepancies between the theoretical and the achieved occupancy during execution typically indicates highly imbalanced workloads. PM Sampling (PmSampling) Timeline view of metrics sampled periodically over the workload duration. Data is collected across multiple passes. Use this section to understand how workload behavior changes over its runtime. PM Sampling: Warp States (PmSampling_WarpStates) Warp states sampled periodically over the workload duration. Metrics in different groups come from different passes. SchedulerStats (Scheduler Statistics) Summary of the activity of the schedulers issuing instructions. Each scheduler maintains a pool of warps that it can issue instructions for. The upper bound of warps in the pool (Theoretical Warps) is limited by the launch configuration. On every cycle each scheduler checks the state of the allocated warps in the pool (Active Warps). Active warps that are not stalled (Eligible Warps) are ready to issue their next instruction. From the set of eligible warps, the scheduler selects a single warp from which to issue one or more instructions (Issued Warp). On cycles with no eligible warps, the issue slot is skipped and no instruction is issued. Having many skipped issue slots indicates poor latency hiding. SourceCounters (Source Counters) Source metrics, including branch efficiency and sampled warp stall reasons. Warp Stall Sampling metrics are periodically sampled over the kernel runtime. They indicate when warps were stalled and couldn\u2019t be scheduled. See the documentation for a description of all stall reasons. Only focus on stalls if the schedulers fail to issue every cycle. SpeedOfLight (GPU Speed Of Light Throughput) High-level overview of the throughput for compute and memory resources of the GPU. For each unit, the throughput reports the achieved percentage of utilization with respect to the theoretical maximum. Breakdowns show the throughput for each individual sub-metric of Compute and Memory to clearly identify the highest contributor. WarpStateStats (Warp State Statistics) Analysis of the states in which all warps spent cycles during the kernel execution. The warp states describe a warp\u2019s readiness or inability to issue its next instruction. The warp cycles per instruction define the latency between two consecutive instructions. The higher the value, the more warp parallelism is required to hide this latency. For each warp state, the chart shows the average number of cycles spent in that state per issued instruction. Stalls are not always impacting the overall performance nor are they completely avoidable. Only focus on stall reasons if the schedulers fail to issue every cycle.", "keywords": []}, {"id": 188, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#serialization", "display_name": "Serialization", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "serialization", "priority": -1, "content": "NVIDIA Nsight Compute serializes kernel launches within the profiled application, potentially across multiple processes profiled by one or more instances of the tool at the same time. Serialization across processes is necessary since for the collection of HW performance metrics, some GPU and driver objects can only be acquired by a single process at a time. To achieve this, the lock file TMPDIR/nsight-compute-lock is used. On Windows, TMPDIR is the path returned by the Windows GetTempPath API function. On other platforms, it is the path supplied by the first environment variable in the list TMPDIR, TMP, TEMP, TEMPDIR . If none of these is found, it\u2019s /var/nvidia on QNX and /tmp otherwise. Serialization within the process is required for most metrics to be mapped to the proper kernel. In addition, without serialization, performance metric values might vary widely if kernel execute concurrently on the same device. It is currently not possible to disable this tool behavior. Refer to the FAQ entry on possible workarounds.", "keywords": []}, {"id": 189, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#sets-and-sections", "display_name": "Sets and Sections", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "sets-and-sections", "priority": -1, "content": "NVIDIA Nsight Compute uses Section Sets (short sets ) to decide, on a very high level, the amount of metrics to be collected. Each set includes one or more Sections , with each section specifying several logically associated metrics. For example, one section might include only high-level SM and memory utilization metrics, while another could include metrics associated with the memory units, or the HW scheduler. The number and type of metrics specified by a section has significant impact on the overhead during profiling. To allow you to quickly choose between a fast, less detailed profile and a slower, more comprehensive analysis, you can select the respective section set. See Overhead for more information on profiling overhead. By default, a relatively small number of metrics is collected. Those mostly include high-level utilization information as well as static launch and occupancy data. The latter two are regularly available without replaying the kernel launch. The basic set is collected when no --set , --section and no --metrics options are passed on the command line. The full set of sections can be collected with --set full . Use --list-sets to see the list of currently available sets. Use --list-sections to see the list of currently available sections. The default search directory and the location of pre-defined section files are also called sections/ . All related command line options can be found in the NVIDIA Nsight Compute CLI documentation.", "keywords": []}, {"id": 190, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#shared-memory", "display_name": "Shared Memory", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "shared-memory", "priority": -1, "content": "Example Shared Memory table, collected on an RTX 2080 Ti Columns Instructions For each access type, the total number of all actually executed assembly (SASS) instructions per warp. Predicated-off instructions are not included. E.g., the instruction STS would be counted towards Shared Store . Requests The total number of all requests to shared memory. On SM 7.0 (Volta) and newer architectures, each shared memory instruction generates exactly one request. Wavefronts Number of wavefronts required to service the requested shared memory data. Wavefronts are serialized and processed on different cycles. % Peak Percentage of peak utilization. Higher values imply a higher utilization of the unit and can show potential bottlenecks, as it does not necessarily indicate efficient usage. Bank Conflicts If multiple threads\u2019 requested addresses map to different offsets in the same memory bank, the accesses are serialized. The hardware splits a conflicting memory request into as many separate conflict-free requests as necessary, decreasing the effective bandwidth by a factor equal to the number of colliding memory requests. Rows (Access Types) Shared memory access operations. Total The aggregate for all access types in the same column. Metrics Metrics from this table can be collected on the command line using --set full , --section MemoryWorkloadAnalysis_Tables or --metrics group:memory__shared_table .", "keywords": []}, {"id": 191, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#supported-apis", "display_name": "Supported APIs", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "supported-apis", "priority": -1, "content": "Range replay supports a subset of the CUDA API for capture and replay. This page lists the supported functions as well as any further, API-specific limitations that may apply. If an unsupported API call is detected in the captured range, an error is reported and the range cannot be profiled. The groups listed below match the ones found in the CUDA Driver API documentation . Generally, range replay only captures and replay CUDA Driver API calls. CUDA Runtime APIs calls can be captured when they generate only supported CUDA Driver API calls internally. Deprecated APIs are not supported. Error Handling All supported. Initialization Not supported. Version Management All supported. Device Management All supported, except: cuDeviceSetMemPool Primary Context Management cuDevicePrimaryCtxGetState Context Management All supported, except: cuCtxSetCacheConfig cuCtxSetSharedMemConfig Module Management cuModuleGetFunction cuModuleGetGlobal cuModuleGetSurfRef cuModuleGetTexRef cuModuleLoad cuModuleLoadData cuModuleLoadDataEx cuModuleLoadFatBinary cuModuleUnload Library Management All supported, except: cuKernelSetAttribute cuKernelSetCacheConfig Memory Management cuArray* cuDeviceGetByPCIBusId cuDeviceGetPCIBusId cuMemAlloc cuMemAllocHost cuMemAllocPitch cuMemcpy* cuMemFree cuMemFreeHost cuMemGetAddressRange cuMemGetInfo cuMemHostAlloc cuMemHostGetDevicePointer cuMemHostGetFlags cuMemHostRegister cuMemHostUnregister cuMemset* cuMipmapped* Virtual Memory Management Not supported. Stream Ordered Memory Allocator Not supported. Unified Addressing Not supported. Stream Management cuStreamCreate* cuStreamDestroy cuStreamGet* cuStreamQuery cuStreamSetAttribute cuStreamSynchronize cuStreamWaitEvent Event Management All supported. External Resource interoperability Not supported. Stream Memory Operations Not supported. Execution Control cuFuncGetAttribute cuFuncGetModule cuFuncSetAttribute cuFuncSetCacheConfig cuLaunchCooperativeKernel cuLaunchHostFunc cuLaunchKernel Graph Management Not supported. Occupancy All supported. Texture/Surface Reference Management Not supported. Texture Object Management All supported. Surface Object Management All supported. Peer Context Memory Access Not supported. Graphics Interoperability Not supported. Driver Entry Point Access All supported. Surface Object Management All supported. OpenGL Interoperability Not supported. VDPAU Interoperability Not supported. EGL Interoperability Not supported. Green Contexts cuCtxFromGreenCtx cuGreenCtxCreate cuGreenCtxDestroy cuGreenCtxRecordEvent cuGreenCtxWaitEvent cuStreamGetGreenCtx", "keywords": []}, {"id": 192, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "page", "name": "ProfilingGuide/index#warp-sampling", "display_name": "Warp Sampling", "type": "section", "display_type": "Page section", "docname": "ProfilingGuide/index", "anchor": "warp-sampling", "priority": -1, "content": "NVIDIA Nsight Compute supports periodic sampling of the warp program counter and warp scheduler state. At a fixed interval of cycles, the sampler in each streaming multiprocessor selects an active warp and outputs the program counter and the warp scheduler state. The tool selects the minimum interval for the device. On small devices, this can be every 32 cycles. On larger chips with more multiprocessors, this may be 2048 cycles. The sampler selects a random active warp. On the same cycle the scheduler may select a different warp to issue. The resulting metrics are correlated with the individual executed instructions but don\u2019t have any time resolution. See the Warp Stall Reasons tables in the Metrics Reference for a description of the individual warp scheduler states.", "keywords": []}, {"id": 193, "doc_id": 193, "filename": "ProfilingGuide/index.html", "domain_name": "std", "name": "ProfilingGuide/index", "display_name": "Kernel Profiling Guide", "type": "doc", "display_type": "Page", "docname": "ProfilingGuide/index", "anchor": "", "priority": -1, "content": "Nsight Compute profiling guide. Kernel Profiling Guide with metric types and meaning, data collection modes and FAQ for common problems.", "keywords": []}, {"id": 194, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#gpu-support", "display_name": "GPU Support", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "gpu-support", "priority": -1, "content": "Architecture Support Kepler No Maxwell No Pascal No Volta GV100 Yes Volta GV11b Yes Turing TU1xx Yes NVIDIA GA100 Yes NVIDIA GA10x Yes NVIDIA GA10b Yes NVIDIA GH100 Yes Most metrics used in NVIDIA Nsight Compute are identical to those of the PerfWorks Metrics API and follow the documented Metrics Structure . A comparison between the metrics used in nvprof and their equivalent in NVIDIA Nsight Compute can be found in the NVIDIA Nsight Compute CLI User Manual .", "keywords": []}, {"id": 195, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#known-issues", "display_name": "Known Issues", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "known-issues", "priority": -1, "content": "Installation The installer might not show all patch-level version numbers during installation. Some command line options listed in the help of a .run installer of NVIDIA Nsight Compute are affecting only the archive extraction, but not the installation stage. To pass command line options to the embedded installer script, specify those options after -- in the form of -- -<option> . The available options for the installer script are: -help : Print help message -targetpath=<PATH> : Specify install path -noprompt : No prompts. Implies acceptance of the EULA For example, specifying only option --quiet extracts the installer archive without any output to the console, but still prompts for user interaction during the installation. To install NVIDIA Nsight Compute without any console output nor any user interaction, please specify --quiet -- -noprompt . After using the SDK Manager to install the NVIDIA Nsight Compute tools, their binary path needs to be manually added to your PATH environment variable. See also the System Requirements for more installation instructions. Launch and Connection Launching applications on remote targets/platforms is not supported for several combinations. See Platform Support for details. Manually launch the application using command line ncu --mode=launch on the remote system and connect using the UI or CLI afterwards. In the NVIDIA Nsight Compute connection dialog, a remote system can only be specified for one target platform. Remove a connection from its current target platform in order to be able to add it to another. Loading of CUDA sources via SSH requires that the remote connection is configured, and that the hostname/IP address of the connection matches the target (as seen in the report session details). For example, prefer my-machine.my-domain.com, instead of my-machine, even though the latter resolves to the same. Other issues concerning remote connections are discussed in the documentation for remote connections . Local connections between NVIDIA Nsight Compute and the launched target application might not work on some ppc64le or aarch64 (sbsa) systems configured to only support IPv6. On these platforms, the NV_COMPUTE_PROFILER_LOCAL_CONNECTION_OVERRIDE=uds environment variable can be set to use Unix Domain Sockets instead of TCP for local connections to workaround the problem. On x86_64 Linux, Unix Domain Sockets are used by default, but local TCP connections can be forced using NV_COMPUTE_PROFILER_LOCAL_CONNECTION_OVERRIDE=tcp . Profiling and Metrics Profiling of 32-bit processes is not supported. Profiling kernels executed on a device that is part of an SLI group is not supported. An \u201cUnsupported GPU\u201d error is shown in this case. Profiling a kernel while other contexts are active on the same device (e.g. X server, or secondary CUDA or graphics application) can result in varying metric values for L2/FB (Device Memory) related metrics. Specifically, L2/FB traffic from non-profiled contexts cannot be excluded from the metric results. To completely avoid this issue, profile the application on a GPU without secondary contexts accessing the same device (e.g. no X server on Linux). In the current release, profiling a kernel while any other GPU work is executing on the same MIG compute instance can result in varying metric values for all units. NVIDIA Nsight Compute enforces serialization of the CUDA launches within the target application to ensure those kernels do not influence each other. See Serialization for more details. However, GPU work issued through other APIs in the target process or workloads created by non-target processes running simultaneously in the same MIG compute instance will influence the collected metrics. Note that it is acceptable to run CUDA processes in other MIG compute instances as they will not influence the profiled MIG compute instance. On Linux kernels settings fs.protected_regular=1 (e.g. some Ubuntu 20.04 cloud service provider instances), root users may not be able to access the inter-process lock file . See the FAQ for workarounds. Profiling only supports up to 32 device instances, including instances of MIG partitions. Profiling the 33rd or higher device instance will result in indeterminate data. Enabling certain metrics can cause GPU kernels to run longer than the driver\u2019s watchdog time-out limit. In these cases the driver will terminate the GPU kernel resulting in an application error and profiling data will not be available. Please disable the driver watchdog time out before profiling such long running CUDA kernels. On Linux, setting the X Config option Interactive to false is recommended. For Windows, detailed information on disabling the Windows TDR is available at https://docs.microsoft.com/en-us/windows-hardware/drivers/display/timeout-detection-and-recovery Collecting device-level metrics, such as the NVLink metrics ( nvl* ), is not supported on NVIDIA virtual GPUs (vGPUs). As of CUDA 11.4 and R470 TRD1 driver release, NVIDIA Nsight Compute is supported in a vGPU environment which requires a vGPU license. If the license is not obtained after 20 minutes, the reported performance metrics data from the GPU will be inaccurate. This is because of a feature in vGPU environment which reduces performance but retains functionality as specified here . Profiling on NVIDIA live-migrated virtual machines is not supported and can result in undefined behavior. Profiling with enabled multi-process service (MPS) can result in undefined behavior. When Profiling using Range Replay or Application Range Replay with multiple CUDA Green Contexts active which belong to the same device context, the range result will contain counter values aggregated on all Green Contexts The NVLink Topology section is not supported for a configuration using NVSwitch. NVIDIA Nsight Compute does not support per-NVLink metrics. NVIDIA Nsight Compute does not support the Logical NVLink Throughput table. Setting a reduced NvLink Bandwidth mode does not impact the reported peak values for NvLink metrics. All peak values and corresponding percentages are calculated off the non-reduced NvLink bandwidth. Reconfiguring the NvLink Bandwidth mode using nvidia-smi` while profiling may lead to undefined tools\u2019 behavior. Profiling CUDA graph kernel nodes that can launch device graphs or are part of device-launchable graphs is not supported. Use Graph Profiling mode instead. Profiling in Graph Profiling mode is performed on the context that is specified by the stream handle for the graph launch. Consequently, only memory allocated on this context is saved off and restored during graph replay and only kernel nodes executed on this context are profiled. On CUDA drivers older than 530.x, profiling on Windows Subsystem for Linux (WSL) is not supported if the system has multiple physical NVIDIA GPUs. This is not affected by setting CUDA_VISIBLE_DEVICES . Collecting software counters through PerfWorks currently forces all functions in the module of the profiled kernel to be loaded. This increases the host and device memory footprint of the target application for the remainder of the process lifetime. PM Sampling is not supported when collecting a Profile Series. Compatibility Applications calling blocking functions on std input/output streams can result in the profiler to stop, until the blocking function call is resolved. NVIDIA Nsight Compute can hang on applications using RAPIDS in versions 0.6 and 0.7, due to an issue in cuDF. Profiling child processes launched via clone() is not supported. Profiling child processes launched from Python using os.system() is not supported on ppc64le. Profiling of Cooperative Groups kernels launched with cuLaunchCooperativeKernelMultiDevice is not yet supported. On Linux systems, when profiling bsd-csh scripts, the original application output will not be printed. As a workaround, use a different C-shell, e.g. tcsh . Attempting to use the --clock-control option to set the GPU clocks will fail when profiling on a GPU partition. Please use nvidia-smi (installed with NVIDIA display driver) to control the clocks for the entire GPU. This will require administrative privileges when the GPU is partitioned. On Linux aarch64, NVIDIA Nsight Compute does not work if the HOME environment variable is not set. NVIDIA Nsight Compute versions 2020.1.0 to 2020.2.1 are not compatible with CUDA driver version 460+ if the application launches Cooperative Groups kernels. Profiling will fail with error \u201cUnknownError\u201d. Collecting CPU call stack information on Windows Server 2016 can hang NVIDIA Nsight Compute in some cases. Currently, the only workaround is to skip CPU call stack collection on such systems by not specifying the option --call-stack . When profiling a script, --target-processes all may target utility executables such as xargs , uname or ls . To avoid profiling these, use the --target-processes-filter option accordingly. On mobile platforms, --kill option is not supported with application replay mode. NVIDIA Nsight Compute might show invalid characters for Unicode names and paths on Windows 10. As a workaround, use a third-party terminal emulator, e.g. Git bash. User Interface The API Statistics filter in NVIDIA Nsight Compute does not support units. File size is the only property considered when resolving source files. Timestamps are currently ignored. Terminating or disconnecting an application in the Interactive Profiling activity while the API Stream View is updated can lead to a crash. See the OptiX library support section for limitations concerning the Acceleration Structure Viewer . After updating from a previous version of NVIDIA Nsight Compute on Linux, the file load dialog may not allow column resizing and sorting. As a workaround, the ~/.config/QtProject.conf file can be edited to remove the treeViewHeader entry from the [FileDialog] section.", "keywords": []}, {"id": 196, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#library-support", "display_name": "Library Support", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "library-support", "priority": -1, "content": "NVIDIA Nsight Compute can be used to profile CUDA applications, as well as applications that use CUDA via NVIDIA or third-party libraries. For most such libraries, the behavior is expected to be identical to applications using CUDA directly. However, for certain libraries, NVIDIA Nsight Compute has certain restrictions, alternate behavior, or requires non-default setup steps prior to profiling.", "keywords": []}, {"id": 197, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#optix", "display_name": "OptiX", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "optix", "priority": -1, "content": "NVIDIA Nsight Compute supports profiling of OptiX applications, but with certain restrictions. Internal Kernels Kernels launched by OptiX that contain no user-defined code are given the generic name NVIDIA internal . These kernels show up on the API Stream in the NVIDIA Nsight Compute UI, and can be profiled in both the UI as well as the NVIDIA Nsight Compute CLI. However, no CUDA-C source, PTX or SASS is available for them. User Kernels Kernels launched by OptiX can contain user-defined code. OptiX identifies these kernels in the API Stream with a custom name. This name starts with raygen__ (for \u201cray generation\u201d). These kernels show up on the API Stream and can be profiled in the UI as well as the NVIDIA Nsight Compute CLI. The Source page displays CUDA-C source, PTX and SASS defined by the user. Certain parts of the kernel, including device functions that contain OptiX-internal code, will not be available in the Source page. SASS When SASS information is available in the profile report, certain instructions might not be available in the Source page and shown as N/A . The Acceleration Structure Viewer for OptiX traversable handles currently has the following limitations: The Acceleration Structure Viewer is not supported on MacOSX. Viewing instance acceleration structures using multi-level instancing is not supported. Applying motion traversables to acceleration structures is not supported. The following feature set is supported per OptiX API version: OptiX API Version Kernel Profiling API Interception Resource Tracking 6.x Yes No No 7.0 - 8.0 Yes Yes Yes", "keywords": []}, {"id": 198, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#platform-support", "display_name": "Platform Support", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "platform-support", "priority": -1, "content": "Host denotes the UI can run on that platform. Target means that we can instrument applications on that platform for data collection. Applications launched with instrumentation on a target system can be connected to from most host platforms. The reports collected on one system can be opened on any other system. Host Targets Windows Yes Windows*, Linux (x86_64) Windows Subsystem for Linux (WSL2) Yes Windows Subsystem for Linux (WSL2) as part of the Linux (x86_64) package. Linux (x86_64) Yes Windows*, Linux (x86_64), Linux (ppc64le), Linux (aarch64 sbsa) Linux (ppc64le) No Linux (ppc64le) Linux (aarch64 sbsa) Yes Linux (aarch64 sbsa) Linux (x86_64) (Drive SDK) Yes Windows*, Linux (x86_64), Linux (aarch64), QNX MacOSX 11+ Yes Windows*, Linux (x86_64), Linux (ppc64le) Linux (aarch64) No Linux (aarch64) QNX No QNX Target platforms marked with * do not support remote launch from the respective host. Remote launch means that the application can be launched on the target system from the host UI. Instead, the application must be launched from the target system. Profiling of 32-bit processes is not supported.", "keywords": []}, {"id": 199, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#support", "display_name": "Support", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "support", "priority": -1, "content": "Information on supported platforms and GPUs.", "keywords": []}, {"id": 200, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#system-requirements", "display_name": "System Requirements", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "system-requirements", "priority": -1, "content": "Linux and WSL On all Linux platforms, NVIDIA Nsight Compute CLI requires GLIBC version 2.15 or higher. On x86_64, the NVIDIA Nsight Compute UI requires GLIBC version 2.17 or higher. On Linux (aarch64 sbsa), the NVIDIA Nsight Compute UI requires GLIBC version 2.26 or higher. The NVIDIA Nsight Compute UI requires several packages to be installed to enable Qt. Please refer to the Qt for X11 Requirements . When executing ncu-ui with missing dependencies, an error message with information on the missing packages is shown. Note that only one package will be shown at a time, even though multiple may be missing from your system. For selected operating systems, the following commands install needed packages for NVIDIA Nsight Compute on X11: Ubuntu 18.04 apt install libopengl0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xkb1 libxkbcommon-x11-0 Ubuntu 20.04 apt install libopengl0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 libxcb-xkb1 libxkbcommon-x11-0 RHEL 8.6 yum install libglvnd-opengl libxcb libxkbcommon-x11 Profiling on Windows Subsystem for Linux (WSL) is only supported with WSL version 2. Profiling is supported on Windows 10 WSL with OS build version 19044 and greater, and NVIDIA display driver version 545 or higher. It is not supported on Windows 10 WSL for systems that exceed 1 TB of system memory. Profiling is supported on Windows 11 WSL with NVIDIA display driver version 525 or higher. The Linux (x86_64) NVIDIA Nsight Compute package can be used and should be installed directly within WSL2. Remote profiling to and from WSL2 works equivalently to regular Linux (x86_64) hosts and targets, as long as it\u2019s accessible via SSH. Access to NVIDIA GPU Performance Counters must be enabled in the NVIDIA Control Panel of the Windows host. See also the CUDA on WSL User Guide . Windows Only Windows 10 and 11 are supported as host and target. The Visual Studio 2017 redistributable is not automatically installed by the NVIDIA Nsight Compute installer. The workaround is to install the x64 version of the \u2018Microsoft Visual C++ Redistributable for Visual Studio 2017\u2019 manually. The installer is linked on the main download page for Visual Studio at https://www.visualstudio.com/downloads/ or download directly from https://go.microsoft.com/fwlink/?LinkId=746572 . Notices Notices ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, \u201cMATERIALS\u201d) ARE BEING PROVIDED \u201cAS IS.\u201d NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. Information furnished is believed to be accurate and reliable. However, NVIDIA Corporation assumes no responsibility for the consequences of use of such information or for any infringement of patents or other rights of third parties that may result from its use. No license is granted by implication of otherwise under any patent rights of NVIDIA Corporation. Specifications mentioned in this publication are subject to change without notice. This publication supersedes and replaces all other information previously supplied. NVIDIA Corporation products are not authorized as critical components in life support devices or systems without express written approval of NVIDIA Corporation. Trademarks NVIDIA and the NVIDIA logo are trademarks or registered trademarks of NVIDIA Corporation in the U.S. and other countries. Other company and product names may be trademarks of the respective companies with which they are associated.", "keywords": []}, {"id": 201, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2019-1", "display_name": "Updates in 2019.1", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2019-1", "priority": -1, "content": "General Support for CUDA 10.1 Improved performance Bug fixes Profiling on Volta GPUs now uses the same metric names as on Turing GPUs Section files support descriptions The default sections and rules directory has been renamed to sections NVIDIA Nsight Compute Added new profiling options to the options dialog Details page shows rule result icons in the section headers Section descriptions are shown in the details page and in the sections tool window Source page supports collapsing multiple source files or functions to show aggregated results Source page heatmap color scale has changed Invalid metric results are highlighted in the profiler report Loaded section and rule files can be opened from the sections tool window NVIDIA Nsight Compute CLI Support for profiling child processes on Linux and Windows x86_64 targets NVIDIA Nsight Compute CLI uses a temporary file if no output file is specified Support for new --quiet option Support for setting the GPU clock control mode using new --clock-control option Details page output shows the NVTX context when --nvtx is enabled Support for filtering kernel launches for profiling based on their NVTX context using new --nvtx-include and --nvtx-exclude options Added new --summary options for aggregating profiling results Added option --open-in-ui to open reports collected with NVIDIA Nsight Compute CLI directly in NVIDIA Nsight Compute Resolved Issues Installation directory scripts use absolute paths OpenACC kernel names are correctly demangled Profile activity report file supports a relative path Source view can resolve all applicable files at once UI font colors are improved Details page layout and label elision issues are resolved Turing metrics are properly reported on the Summary page All byte-based metrics use a factor of 1000 when scaling units to follow SI standards CSV exports properly align columns with empty entries Fixed the metric computation for double_precision_fu_utilization on GV11b Fixed incorrect \u2018selected\u2019 PC sampling counter values The SpeedOfLight section uses \u2018max\u2019 instead of \u2018avg\u2019 cycles metrics for Elapsed Cycles", "keywords": []}, {"id": 202, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2019-2", "display_name": "Updates in 2019.2", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2019-2", "priority": -1, "content": "General Improved performance Bug fixes Kernel launch context and stream are reported as metrics PC sampling configuration options are reported as metrics The default base port for connections to the target changed Section files support multiple, named Body fields NvRules allows users to query metrics using any convertible data type NVIDIA Nsight Compute Support for filtering kernel launches using their NVTX context Support for new options to select the connection port range The Profile activity supports configuring PC sampling parameters Sections on the Details page support selecting individual bodies NVIDIA Nsight Compute CLI Support for stepping to kernel launches from specific NVTX contexts Support for new --port and --max-connections options Support for new --sampling-* options to configure PC sampling parameters Section file errors are reported with --list-sections A warning is shown if some section files could not be loaded Resolved Issues Using the \u2013summary option works for reports that include invalid metrics The full process executable filename is reported for QNX targets The project system now properly stores the state of opened reports Fixed PTX syntax highlighting Fixed an issue when switching between manual and auto profiling in NVIDIA Nsight Compute The source page in NVIDIA Nsight Compute now works with results from multiple processes Charts on the NVIDIA Nsight Compute details page uses proper localization for numbers NVIDIA Nsight Compute no longer requires the system locale to be set to English", "keywords": []}, {"id": 203, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2019-3", "display_name": "Updates in 2019.3", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2019-3", "priority": -1, "content": "General Improved performance Bug fixes Kernel launch context and stream are reported as metrics PC sampling configuration options are reported as metrics The default base port for connections to the target changed Section files support multiple, named Body fields NvRules allows users to query metrics using any convertible data type NVIDIA Nsight Compute Support for filtering kernel launches using their NVTX context Support for new options to select the connection port range The Profile activity supports configuring PC sampling parameters Sections on the Details page support selecting individual bodies NVIDIA Nsight Compute CLI Support for stepping to kernel launches from specific NVTX contexts Support for new --port and --max-connections options Support for new --sampling-* options to configure PC sampling parameters Section file errors are reported with --list-sections A warning is shown if some section files could not be loaded Resolved Issues Using the \u2013summary option works for reports that include invalid metrics The full process executable filename is reported for QNX targets The project system now properly stores the state of opened reports Fixed PTX syntax highlighting Fixed an issue when switching between manual and auto profiling in NVIDIA Nsight Compute The source page in NVIDIA Nsight Compute now works with results from multiple processes Charts on the NVIDIA Nsight Compute details page uses proper localization for numbers NVIDIA Nsight Compute no longer requires the system locale to be set to English", "keywords": []}, {"id": 204, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2019-3-1", "display_name": "Updates in 2019.3.1", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2019-3-1", "priority": -1, "content": "NVIDIA Nsight Compute Added ability to send bug reports and suggestions for features using Send Feedback in the Help menu Resolved Issues Fixed calculation of theoretical occupancy for grids with blocks that are not a multiple of 32 threads Fixed intercepting child processes launched through Python\u2019s subprocess.Popen class Fixed issue of NVTX push/pop ranges not showing up for child threads in NVIDIA Nsight Compute CLI Fixed performance regression for metric lookups on the Source page Fixed description in rule covering the IMC stall reason Fixed cases were baseline values were not correctly calculated in the Memory tables when comparing reports of different architectures Fixed incorrect calculation of baseline values in the Executed Instruction Mix chart Fixed accessing instanced metrics in the NvRules API Fixed a bug that could cause the collection of unnecessary metrics in the Interactive Profile activity Fixed potential crash on exit of the profiled target application Switched underlying metric for SOL FB in the GPU Speed Of Light section to be driven by dram__throughput.avg.pct_of_peak_sustained_elapsed instead of fbpa__throughput.avg.pct_of_peak_sustained_elapsed", "keywords": []}, {"id": 205, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2019-4", "display_name": "Updates in 2019.4", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2019-4", "priority": -1, "content": "General Added support for the Linux PowerPC target platform Reduced the profiling overhead, especially if no source metrics are collected Reduced the overhead for non-profiled kernels Improved the deployment performance during remote launches Trying to profile on an unsupported GPU now shows an \u201cUnsupported GPU\u201d error message Added support for the %i sequential number placeholder to generate unique report file names Added support for smsp__sass_* metrics on Volta and newer GPUs The launch__occupancy_limit_shared_mem now reports the device block limit if no shared memory is used by the kernel NVIDIA Nsight Compute The Profile activity shows the command line used to launch ncu The heatmap on the Source page now shows the represented metric in its tooltip The Memory Workload Analysis Chart on the Details page now supports baselines When applying rules, a message displaying the number of new rule results is shown in the status bar The Visual Profiler Transition Guide was added to the documentation Connection dialog activity options were added to the documentation A warning dialog is shown if the application is resumed without Auto-Profile enabled Pausing the application now has immediate feedback in the toolbar controls Added a Close All command to the File menu NVIDIA Nsight Compute CLI The --query-metrics option now shows only metric base names for faster metric query. The new option --query-metrics-mode can be used to display the valid suffixes for each base metric. Added support for passing response files using the @ operator to specify command line options through a file Resolved Issues Fixed an issue that reported the wrong executable name in the Session page when attaching Fixed issues that chart labels were shown elided on the Details page Fixed an issue that caused the cache hitrates to be shown incorrectly when baselines were added Fixed an illegal memory access when collecting sass__*_histogram metrics for applications using PyTorch on Pascal GPUs Fixed an issue when attempting to collect all smsp__* metrics on Volta and newer GPUs Fixed an issue when profiling multi-context applications Fixed that profiling start/stop settings from the connection dialog weren\u2019t properly passed to the interactive profile activity Fixed that certain smsp__warp_cycles_per_issue_stall* metrics returned negative values on Pascal GPUs Fixed that metric names were truncated in the --page details non-CSV command line output Fixed that the target application could crash if a connection port was used by another application with higher privileges", "keywords": []}, {"id": 206, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2019-5", "display_name": "Updates in 2019.5", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2019-5", "priority": -1, "content": "General Added section sets to reduce the default overhead and make it easier to configure metric sets for profiling Reduced the size of the installation Added support for CUDA Graphs Recapture API The NvRules API now supports accessing correlation IDs for instanced metrics Added breakdown tables for SOL SM and SOL Memory in the Speed Of Light section for Volta+ GPUs NVIDIA Nsight Compute Added a snap-select feature to the Source page heatmap help navigate large files Added support for loading remote CUDA-C source files via SSH on demand for Linux x86_64 targets Charts on the Details page provide better help in tool tips when hovering metric names Improved the performance of the Source page when scrolling or collapsing The charts for Warp States and Compute pipelines are now sorted by value NVIDIA Nsight Compute CLI Added support for GPU cache control, see --cache-control Added support for setting the kernel name base in command line output, see --kernel-base Added support for listing the available names for --chips , see --list-chips Improved the stability on Windows when using --target-processes all Reduced the profiling overhead for small metric sets in applications with many kernels Resolved Issues Reduced the overhead caused by demangling kernel names multiple times Fixed an issue that kernel names were not demangled in CUDA Graph Nodes resources window The connection dialog better disables unsupported combinations or warns of invalid entries Fixed metric thread_inst_executed_true to derive from smsp_not_predicated_off_thread_inst_executed on Volta+ GPUs Fixed an issue with computing the theoretical occupancy on GV100 Selecting an entry on the Source page heatmap no longer selects the respective source line, to avoid losing the current selection Fixed the current view indicator of the Source page heatmap to be line-accurate Fixed an issue when comparing metrics from Pascal and later architectures on the Summary page Fixed an issue that metrics representing constant values on Volta+ couldn\u2019t be collected without non-constant metrics", "keywords": []}, {"id": 207, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2019-5-1", "display_name": "Updates in 2019.5.1", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2019-5-1", "priority": -1, "content": "General Added support for Nsight Compute Visual Studio Integration", "keywords": []}, {"id": 208, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2019-5-2", "display_name": "Updates in 2019.5.2", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2019-5-2", "priority": -1, "content": "General Bug fixes", "keywords": []}, {"id": 209, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2019-5-3", "display_name": "Updates in 2019.5.3", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2019-5-3", "priority": -1, "content": "General More C++ kernel names can be properly demangled", "keywords": []}, {"id": 210, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2020-1", "display_name": "Updates in 2020.1", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2020-1", "priority": -1, "content": "General Added support for the NVIDIA GA100/SM 8.x GPU architecture Removed support for the Pascal SM 6.x GPU architecture Windows 7 is not a supported host or target platform anymore Added a rule for reporting uncoalesced memory accesses as part of the Source Counters section Added support for report name placeholders %p, %q, %i and %h The Kernel Profiling Guide was added to the documentation NVIDIA Nsight Compute The UI command was renamed from nv-nsight-cu to ncu-ui . Old names remain for backwards compatibility. Added support for roofline analysis charts Added linked hot spot tables in section bodies to indicate performance problems in the source code Added section navigation links in rule results to quickly jump to the referenced section Added a new option to select how kernel names are shown in the UI Added new memory tables for the L1/TEX cache and the L2 cache. The old tables are still available for backwards compatibility and moved to a new section containing deprecated UI elements. Memory tables now show the metric name as a tooltip Source resolution now takes into account file properties when selecting a file from disk Results in the profile report can now be filtered by NVTX range The Source page now supports collapsing views even for single files The UI shows profiler error messages as dismissible banners for increased visibility Improved the baseline name control in the profiler report header NVIDIA Nsight Compute CLI The CLI command was renamed from nv-nsight-cu-cli to ncu . Old names remain for backwards compatibility. Queried metrics on GV100 and newer chips are sorted alphabetically Multiple instances of NVIDIA Nsight Compute CLI can now run concurrently on the same system, e.g. for profiling individual MPI ranks. Profiled kernels are serialized across all processes using a system-wide file lock. Resolved Issues More C++ kernel names can be properly demangled Fixed a free(): invalid pointer error when profiling applications using pytorch > 19.07 Fixed profiling IBM Spectrum MPI applications that require PAMI GPU hooks ( --smpiargs="-gpu" ) Fixed that the first kernel instruction was missed when computing sass__inst_executed_per_opcode Reduced surplus DRAM write traffic created from flushing caches during kernel replay The Compute Workload Analysis section shows the IMMA pipeline on GV11b GPUs Profile reports now scroll properly on MacOS when using a trackpad Relative output filenames for the Profile activity now use the document directory, instead of the current working directory Fixed path expansion of ~ on Windows Memory access information is now shown properly for RED assembly instructions on the Source page Fixed that user PYTHONHOME and PYTHONPATH environment variables would be picked up by NVIDIA Nsight Compute, resulting in locale encoding issues.", "keywords": []}, {"id": 211, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2020-1-1", "display_name": "Updates in 2020.1.1", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2020-1-1", "priority": -1, "content": "General Added support for the NVIDIA GA100/SM 8.x GPU architecture Metrics passed to --metrics on the NVIDIA Nsight Compute CLI or in the respective Profile activity option are automatically expanded to all first-level sub-metrics if required. See the documentation on --metrics for more details. Added new rules for detecting inefficiencies of using the sparse data compression on the NVIDIA Ampere architecture. The version of the NVIDIA Nsight Compute target collecting the results is shown in the Session page. Added new launch__grid_dim_[x,y,z] and launch__block_dim_[x,y,z] metrics. NVIDIA Nsight Compute The Break on API Error functionality has been improved when auto profiling. NVIDIA Nsight Compute CLI The full path to the report output file is printed after profiling. Added and corrected metrics in the nvprof Metric Comparison table. Resolved Issues Documented the breakdown: metrics prefix. Fixed handling of escaped domain delimiters in NVTX filter expressions. Fixed issues with the occupancy charts for small block sizes. Fixed an issue when choosing a default report page in the options dialog. Fixed that the scroll bar could overlap the content when exporting the report page as an image.", "keywords": []}, {"id": 212, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2020-1-2", "display_name": "Updates in 2020.1.2", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2020-1-2", "priority": -1, "content": "General The NVIDIA Nsight Compute installer for Mac is now code-signed and notarized. Disabled the creation of the Python cache when executing rules to avoid permission issues and signing conflicts. Resolved Issues Fixed the launcher script of the NVIDIA Nsight Compute CLI to no longer fail if uname -p is not available. Fixed the API parameter capture for function cuDeviceGetLuid .", "keywords": []}, {"id": 213, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2020-2", "display_name": "Updates in 2020.2", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2020-2", "priority": -1, "content": "General Added support for the NVIDIA Ampere GPUs with compute capability 8.6 and CUDA toolkit 11.1. Added support for application replay to collect metric results across multiple application runs, instead of replaying individual kernels. Added new launch__device_id metric. Added support for NVLink ( nvl* ) metrics for GPUs with compute capabilities 7.0, 7.5 and 8.0 Added documentation for memory charts and tables in the Profiling Guide . NVIDIA Nsight Compute Updated menu and toolbar layout. Added support for zoom and pan on roofline charts. The Resources tool window shows the current CUDA stream attributes. The memory chart shows a heatmap for link and port utilization. The hot-spot tables in the Source Counters section now show values as percentages, too. On-demand resolve of remote CUDA-C source is now available for MacOS hosts. Metric columns in the Summary and Raw pages are now sortable. Added a new option to set the number of recent API calls shown in the API Stream tool window. NVIDIA Nsight Compute CLI CLI output now shows NVTX payload information. CSV output now shows NVTX states. Added a new --replay-mode option to select the mechanism used for replaying a kernel launch multiple times. Added a new --kill option to terminate the application once all requested kernels were profiled. Added a new --log-file option to decide the output stream for printing tool output. Added a new --check-exit-code option to decide if the child application exit code should be checked. Resolved Issues The profiling progress dialog is not dismissed automatically anymore after an error. The inter-process lock is now automatically given write permissions for all users. All project extensions are enabled in the default dialog filter. Fixed handling of targets using tcsh during remote profiling. Fixed handling of quoted application arguments on Windows.", "keywords": []}, {"id": 214, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2020-2-1", "display_name": "Updates in 2020.2.1", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2020-2-1", "priority": -1, "content": "Resolved Issues Fixed several issues related to auto-profiling in the UI. Fixed a metric collection issue when profiling kernels on different GPU architectures with application replay. Fixed a performance problem related to profiling large process trees. Fixed that occupancy charts would not render correctly when comparing against baselines. Fixed that no memory metrics were shown on the Source page for LDGSTS instructions. Fixed the automatic sorting on the Summary and Raw pages. Fixed an issue that would cause the NVIDIA Nsight Compute CLI to consume too much memory when importing or printing reports. Long kernel names are now elided in the Details page source hot spot tables. Fixed that function names in the Resources tool window were demangled differently.", "keywords": []}, {"id": 215, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2020-3", "display_name": "Updates in 2020.3", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2020-3", "priority": -1, "content": "General Added support for derived metrics in section files. Derived metrics can be used to create new metrics based on existing metrics and constants. See the Customization Guide for details. Added a new Import Source ( --import-source ) option to the UI and command line to permanently import source files into the report, when available. Added a new section that shows selected NVLink metrics on supported systems. Added a new launch__func_cache_config metric to the Launch Statistics section. Added new branch efficiency metrics to the Source Counters section, including smsp__sass_average_branch_targets_threads_uniform.pct to replace nvprof\u2019s branch_efficiency , as well as instruction-level metrics smsp__branch_targets_threads_divergent , smsp__branch_targets_threads_uniform and branch_inst_executed . A warning is shown if kernel replay starts staging GPU memory to CPU memory or the file system. Section and rule files are deployed to a versioned directory in the user\u2019s home directory to allow easier editing of those files, and to prevent modifying the base installation. Removed support for NVLINK( nvl* ) metrics due to a potential application hang during data collection. The metrics will be added back in a future version of the driver/tool. NVIDIA Nsight Compute Added support for Profile Series . Series allow you to profile a kernel with a range of configurable parameters to analyze the performance of each combination. Added a new Allocations view to the Resources tool window which shows the state of all current memory allocations. Added a new Memory Pools view to the Resources tool window which shows the state of all current memory pools. Added coverage of peer memory to the Memory Chart . The Source page now shows the number of excessive sectors requested from L1 or L2, e.g. due to uncoalesced memory accesses. The Source column on the Source page can now be scrolled horizontally. The kernel duration gpu__time_duration.sum was added as column on the Summary page. Improved the performance of application replay when not all kernels in the application are profiled. NVIDIA Nsight Compute CLI Added a new --app-replay-match option to select the mechanism used for matching kernel instances across application replay passes. An error is shown if --nvtx-include/exclude are used without --nvtx . Resolved Issues The Grid Size column on the Raw page now shows the CUDA grid size like the Launch Statistics section, rather than the combined grid and block sizes. The Branch Resolving wap stall reason was added to the PC sampling metric groups and the Warp State Statistics section. The API Stream tool window shows kernel names according to the selected Function Name Mode. Fixed that an incorrect line could be shown after a heatmap selection on the Source page. Fixed incorrect metric usage for system memory in the Memory Chart . Previously, all requested memory of L2 from system memory was reported instead of only the portion that missed in L2.", "keywords": []}, {"id": 216, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2020-3-1", "display_name": "Updates in 2020.3.1", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2020-3-1", "priority": -1, "content": "General Added support for LDSM instruction-level metrics. NVIDIA Nsight Compute LDSM instruction-level metrics are shown in the Source page and memory tables. Improved reporting and documentation for collecting Profile Series . Frozen columns in the Source page are automatically scrolled into view. Resolved Issues Fixed an issue when profiling multi-threaded applications. Fixed an issue that NVIDIA Nsight Compute would not automatically restart when using Reset Application Data . Fixed issues with target applications using libstdc++. Fixed an issue when collecting single-pass metrics in multiple Nsight Compute instances. Fixed an issue when using Kernel ID and setting Launch Capture Count as non-zero in the UI\u2019s Profile activity. Fixed an issue that prevented different users on the same Linux system to use NVIDIA Nsight Compute in shared instance mode. Fixed an issue that prevented resources from being properly renamed using NVTX information in the UI.", "keywords": []}, {"id": 217, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2021-1", "display_name": "Updates in 2021.1", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2021-1", "priority": -1, "content": "General Added support for the CUDA toolkit 11.3. Added support for the OptiX 7 API . GpuArch enumeration values used for filtering in section files were renamed from architecture names to compute capabilities. NVTX states can now be accessed via the NvRules API . Added a rule for the Occupancy section. NVIDIA Nsight Compute Added support for new CUDA asynchronous allocator attributes in the Memory Pools resources view. Added a topology chart and link properties table in the NVLink section. The selected metric column is scrolled into view on the Source page when a new metric is selected. Users can choose the Source heatmap color scale in the Options dialog. NVIDIA Nsight Compute CLI Added file-based application replay as the new default application replay mode. File-based replay uses a temporary file for keeping replay data, instead of allocating them in memory. This keeps the required memory footprint close to constant, independent of the number of profiled kernels. Users can switch between buffer modes using the --app-replay-buffer option. CLI output now shows NVTX color and message information. --kernel-regex and --kernel-regex-base> options are deprecated and replaced by --kernel-name and --kernel-regex-base , respectively. All options which support regex need to provide regex: as a prefix before an argument to match per the regex, e.g <option> <regex:expression> Resolved Issues Fixed that baselines were not updated properly on the Comments page. Fixed that NVTX ranges named using their payloads can be used in NVTX filtering expressions. Fixed crashes in MacOSX hosts when terminating the target application. The NVLINK( nvl* ) metrics are now added back.", "keywords": []}, {"id": 218, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2021-1-1", "display_name": "Updates in 2021.1.1", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2021-1-1", "priority": -1, "content": "General Updated OpenSSL library to version 1.1.1k. NVIDIA Nsight Compute Remote source resolution can now use the IP address, in addition to the hostname, to find the necessary SSH target. NVIDIA Nsight Compute CLI Added support for the existing command line options for kernel filtering while importing data from an existing report file using --import . Option -k is not considered as deprecated option --kernel-regex anymore. Resolved Issues Fixed failure to profile kernels from applications that use the CUDA graphics interop APIs to share semaphores. Fixed wavefront metric in the L1TEX table for writes to shared memory on GA10x chips. Fixed an issue resulting in incomplete data collection for the interactive profile activity after switching from single-pass mode to collecting multiple passes in the same session. Fixed values shown in the mimimap of the Source page when all functions are collapsed. Fixed an issue causing names set by the NVTX naming APIs of one application to be applied to all subsequent sessions of the same instance of NVIDIA Nsight Compute. Fixed behavior of horizontal scroll bars when clicking in the source views on the Source page. Fixed appearance of multi-line entries in column chooser on the Source page. Fixed enablement state of the reset button on the Connection dialog. Fixed potential crash of NVIDIA Nsight Compute when windows size becomes small while being on the Source page. Fixed potential crash of NVIDIA Nsight Compute when relative paths for section/rules files could not be found. Fixed potential crash of NVIDIA Nsight Compute after removing baselines.", "keywords": []}, {"id": 219, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2021-2", "display_name": "Updates in 2021.2", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2021-2", "priority": -1, "content": "General Added support for the CUDA toolkit 11.4. Added support for OptiX version 7.3. Added support for profiling on NVIDIA virtual GPUs (vGPUs) on an upcoming GRID/vGPU release. Added a new Python-based report interface for interacting with report files from Python scripts. Added a new rule to warn users when sampling metrics were selected, but no sampling data was collected. Renamed SOL to Throughput in the Speed of Light section. Renamed several memory_* metrics used on the Source page, to better reflect the measured value. See the Source page documentation for more details. NVIDIA Nsight Compute Added support for opening cubin files in a Standalone Source Viewer without profiling the application. Moved the output of all rules so that it is visible even if a section\u2019s body is collapsed. Visibility of the rules\u2019 output can be toggled by a new button in the report header. The profiler report header now shows the report name for each baseline when ambiguous. Rules can define Focused Metrics that were most important for triggering their result output. Metrics are provided per result message which additional information, such as the underlying conditions and thresholds. Memory tables show tooltips for cells with derived metric calculations. Added a knowledge base service to show more comprehensive background information on metric names and descriptions in their tooltips. Following a link in the Source Counters hot spot tables automatically selects the corresponding metric in the Source page. Added new columns for visualizing register dependencies in the SASS view of the Source page . Functions in the SASS view are now sorted by name. Added support for OptiX 7.x resource tracking in the interactive profile activity. The Resources tool window will show information on instantiated optixDeviceContexts, optixModules, optixProgramGroups, optixPipelines and optixDenoiser objects. Added support for new CUDA graph memory allocation APIs. Improved consistency between command line parameters and the Next Trigger filter in the API Stream window for handling of regex inputs. The Next Trigger filter now considers kernel/API name as a regular expression only if string has regex: as prefix. Added ability to select font settings in the options dialog. Added ability to configure the metrics shown on the summary page via the options dialog. The selected heatmap color scale now also applies to the Memory chart . The ncu-ui script now checks for missing library dependencies, such as OpenGL or Qt . NVIDIA Nsight Compute CLI Added environment variable NV_COMPUTE_PROFILER_DISABLE_STOCK_FILE_DEPLOYMENT=1 to skip deployment of section and rule files. Resolved Issues Fixed a performance issue in the NVIDIA Nsight Compute CLI when using --page raw --csv --units auto . Fixed that the SSH passphase key is no longer persisted in the project file. Fixed state of restore button in connection dialog. The button now supports restoring the default settings, if current setting differ from the default. Fixed that the complete GPU name can be shown in the NVLINK topology diagram on MacOS. Fixed that collapsing the Source view reset the selected metrics. Fixed that correlated lines could differ between filtered and unfiltered views of the executed functions. Fixed that two application icons were shown in the MacOS dock. Improved HiDPI awareness.", "keywords": []}, {"id": 220, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2021-2-1", "display_name": "Updates in 2021.2.1", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2021-2-1", "priority": -1, "content": "General Reduced the memory overhead when loading reports in the Python Report Interface . Resolved Issues Fixed that links in the Memory Allocations Resource view were not working correctly. Fixed that NVTX state might not be correctly reset between interactive profiling activities. Fixed that the UI could crash when opening baselines from different GPU architectures.", "keywords": []}, {"id": 221, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2021-2-2", "display_name": "Updates in 2021.2.2", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2021-2-2", "priority": -1, "content": "General Changes for profiling support on NVIDIA virtual GPUs (vGPUs) for an upcoming GRID/vGPU release. Resolved Issues Fixed hang issue on QNX when using the --target-processes all option while profiling shell scripts.", "keywords": []}, {"id": 222, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2021-2-3", "display_name": "Updates in 2021.2.3", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2021-2-3", "priority": -1, "content": "General Added support for the NVIDIA GA10b chip. Resolved Issues Improved error message on QNX for failure to deploy stock section and rules files.", "keywords": []}, {"id": 223, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2021-2-4", "display_name": "Updates in 2021.2.4", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2021-2-4", "priority": -1, "content": "Resolved Issues Fixed an issue that prevented remote interactive profiling of kernels on NVIDIA GA10b chips.", "keywords": []}, {"id": 224, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2021-2-5", "display_name": "Updates in 2021.2.5", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2021-2-5", "priority": -1, "content": "Resolved Issues Improve the handling of the performance monitor reservation on mobile target GPUs.", "keywords": []}, {"id": 225, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2021-2-6", "display_name": "Updates in 2021.2.6", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2021-2-6", "priority": -1, "content": "Resolved Issues Fixed an issue causing a hang on QNX after pressing ctrl+c while profiling a multi-process application.", "keywords": []}, {"id": 226, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2021-2-7", "display_name": "Updates in 2021.2.7", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2021-2-7", "priority": -1, "content": "General Enabled stack canaries with random canary values for L4T builds.", "keywords": []}, {"id": 227, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2021-2-8", "display_name": "Updates in 2021.2.8", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2021-2-8", "priority": -1, "content": "General Updated Python libraries to version 3.10.5.", "keywords": []}, {"id": 228, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2021-2-9", "display_name": "Updates in 2021.2.9", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2021-2-9", "priority": -1, "content": "NVIDIA Nsight Compute Clarify when not all metrics for the roofline chart could be collected on the current chip.", "keywords": []}, {"id": 229, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2021-3", "display_name": "Updates in 2021.3", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2021-3", "priority": -1, "content": "General Added support for the CUDA toolkit 11.5. Added a new rule for detecting inefficient memory access patterns in the L1TEX cache and L2 cache. Added a new rule for detecting high usage of system or peer memory. Added new IAction::sass_by_pc function to the the NvRules API . The Python-based report interface is now available for Windows and MacOS hosts, too. Added Hierarchical Roofline section files in a new \u201croofline\u201d section set. Added support for collecting CPU call stack information. NVIDIA Nsight Compute Added support for new remote profiling SSH connection and authentication options as well as local SSH configuration files. Added an Occupancy Calculator which can be opened directly from a profile report or as a new activity. It offers feature parity to the CUDA Occupancy Calculator spreadsheet . Added new Baselines tool window to manage (hide, update, re-order, save/load) baseline selections. The Source page views now support multi-line/cell selection and copy/paste. Different colors are used for highlighting selections and correlated lines. The search edit on the Source page now supports Shift+Enter to search in reverse direction. The Memory Workload Analysis Chart can be configured to show throughput values instead of transferred bytes. The Profile activity now supports the --devices option. The NVLink Topology diagram displays per NVLink metrics. Added a new tool window showing the CPU call stack at the location where the current thread was suspended during interactive profiling activities. If enabled, the Call Stack / NVTX page of the profile report shows the captured CPU call stack for the selected kernel launch. NVIDIA Nsight Compute CLI Added support for printing source/metric content with the new --page source and --print-source command line options . Added new option --call-stack to enable collecting the CPU call stack for every profiled kernel launch. Resolved Issues Fixed that memory_* metrics could not be collected with the --metrics option. Fixed that selection and copy/paste was not supported for section header tables on the Details page. Fixed issues with the Source page when collapsing the content. Fixed that the UI could crash when applying rules to a new profile result. Fixed that PC Sampling metrics were not available for Profile Series . Fixed that local profiling did not work if no non-loopback address was configured for the system. Fixed termination of remote-launched applications. On QNX, terminating an application profiled via Remote Launch is now supported. Canceling remote-launched Profile activities is now supported.", "keywords": []}, {"id": 230, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2021-3-1", "display_name": "Updates in 2021.3.1", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2021-3-1", "priority": -1, "content": "Resolved Issues Fixed that kernels with the same name and launch configuration were in some scenarios associated with the wrong profiling results during application replay. Fixed an issue with binary forward compatibility of the report format. Fixed an issue with applications calling into the CUDA API during process teardown. Fixed an issue profiling application using pre-CUDA API 3.1 contexts. Fixed a crash when resolving files on the Source page. Fixed that opening reports with large embedded CUBINs would hang the UI. Fixed an issue with remote profiling on a target where the UI is already launched.", "keywords": []}, {"id": 231, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2022-1", "display_name": "Updates in 2022.1", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2022-1", "priority": -1, "content": "General Added support for the CUDA toolkit 11.6. Added support for GA103 chips. Added a new Range Replay mode to profile ranges of multiple, concurrent kernels. Range replay is available in the NVIDIA Nsight Compute CLI and the non-interactive Profile activity. Added a new rule to detect non-fused floating-point instructions. The Uncoalesced Memory access rules now show results in a dynamic table. Unix Domain Sockets and Windows Named Pipes are used for local connection between the host and target processes on x86_64 Linux and Windows, respectively. The NvRules API now supports querying action names using different function name bases (e.g. demangled). NVIDIA Nsight Compute The default report page is now chosen automatically when opening a report. Added coverage for ECC (Error Correction Code) operations in the L2 Cache table of the Memory Analysis section. Added a new L2 Evict Policies table to the Memory Analysis section. The Occupancy Calculator now updates automatically when the input changes. Added new metric Thread Instructions Executed to the Source page. Added tooltips to the Register Dependency columns in the Source page to identify the associated register more conveniently. Improved the selection of Sections and Sets in the Profile activity connection dialog. NVLink utilization is shown in the NVLink Tables section. NVLink links are colored according to the measured throughput. NVIDIA Nsight Compute CLI --kernel-regex and --kernel-regex-base options are no longer supported. Alternate options are --kernel-name and --kernel-name-base respectively, added in 2021.1.0. Added support to resolve CUDA source files in the --page source output with the new --resolve-source-file command line option . Added new option --target-processes-filter to filter the processes being profiled by name. The CPU Stack Trace is shown in the NVIDIA Nsight Compute CLI output. Resolved Issues Fixed the calculation of aggregated average instruction execution metrics in non-SASS views on the Source page. Fixed that atomic instructions are counted as both loads and stores in the Memory Analysis tables.", "keywords": []}, {"id": 232, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2022-1-1", "display_name": "Updates in 2022.1.1", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2022-1-1", "priority": -1, "content": "General Filtering kernel launches or profile results based on NVTX domains/ranges now takes registered strings in the payload field into account, if the range name is empty. Added support for the suffix .max_rate for ratio metrics. Resolved Issues Fixed a crash during the disassembly of the kernel\u2019s SASS code for the Source page. Fixed a crash on exit of the NVIDIA Nsight Compute UI. Fixed a hang during profiling when CPU call stack collection is enabled. Fixed missing to flush UVM buffers before taking memory checkpoints during Range Replay . Fixed tracking of memory during Range Replay , if the CUDA context has any device mapped memory allocations. Fixed the maximum available shared memory sizes in the Occupancy Calculator for NVIDIA Ampere GPUs. Fixed that the shared memory usage of the kernel is incorrectly initialized when opening the Occupancy Calculator from a profile report.", "keywords": []}, {"id": 233, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2022-2", "display_name": "Updates in 2022.2", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2022-2", "priority": -1, "content": "General Added support for the CUDA toolkit 11.7. Improved performance for profiling and metric query. Added Linux (aarch64 sbsa) as a supported host platform . The NVIDIA Nsight Compute CLI stores the command line arguments, which can be viewed in the Session report page. Added an API to query the version of the Python Report and NvRules interfaces. Added an API to query the PTX in the Python Report and NvRules interfaces. NVIDIA Nsight Compute The Acceleration Structure Viewer allows inspection of acceleration structures built using the OptiX API for debugging and performance optimization. The Source page column chooser now supports to enable or disable groups of metrics. Note that not all metrics are enabled anymore by default to make the view easier to use. The Resources tool window now links to the exact target resource instances for CUDA resource types. The Resources tool window now shows the instanced nodes for CUDA graphs. The Resources tool window now shows the loading state and number of loaded functions for CUDA Modules . The Resources tool window now shows the graph node enablement state for applicable instanced graph nodes. The Resources tool window now shows the graph node priorities for instanced kernel graph nodes. Added regex support in the Next Trigger filter for NVTX based filtering. The Next Trigger filter now considers the NVTX config as a regular expression if the regex: prefix is specified. Added regex support in the report\u2019s Filter Results dialog. Added keyboard shortcuts to navigate between the pages in a report. The behavior for selecting sets and sections is now consistent between the Sections/Rules Info window and the non-interactive profile activity . Reports can now be opened directly from the welcome dialog. NVIDIA Nsight Compute CLI Added support for collecting sampling-based warp stalls in range replay mode. Added regex support in NVTX filtering . The metric type is shown when querying metrics. Resolved Issues Reduced overhead of connecting to the host UI for non-interactive remote profiling sessions. Fixed issues with persisting the Source page state when collapsing or switching between results. Fixed an issue that locked GPU clocks were not reset when terminating the NVIDIA Nsight Compute CLI while profiling a kernel. Fixed issues with selecting and copying text from the Details page tables. Fixed an issue with opening report files in the UI on MacOSX. Fixed an issue with the Freeze API option.", "keywords": []}, {"id": 234, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2022-2-1", "display_name": "Updates in 2022.2.1", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2022-2-1", "priority": -1, "content": "Resolved Issues Fixed an issue that caused some tootips to not show up for the charts on the Details page. Fixed the incorrect reporting of the accessed bytes for LDGSTS (access) traffic in the L1TEX memory table. Fixed an issue that resulted in an empty view on the Source page after resolving multiple source files at once. Fixed a failure to connect to remote machines over SSH due to a mismatch in the configuration of data compression. Fixed a potential failure to profile kernels on multiple devices of the same type of chip. The failure occurred on the attempt to profile on the second device.", "keywords": []}, {"id": 235, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2022-3", "display_name": "Updates in 2022.3", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2022-3", "priority": -1, "content": "General Added support for the CUDA toolkit 11.8. Added support for the Ada GPU architecture. Added support for the Hopper GPU architecture. Added support for OptiX 7.6 . Added uncoalescedGlobalAccesses sample CUDA application and document to show how the NVIDIA Nsight Compute profiler can be used to analyze and identify the memory accesses which are uncoalesced and result in inefficient DRAM accesses. Refer to the README, sample code and document under extras/samples/uncoalescedGlobalAccesses . Added Metrics Reference in the documentation that lists metrics not available through --query-metrics . Reduced the overhead of collecting SASS-patching based metrics. On Multi-Instance GPU (MIG) configurations, NVIDIA Nsight Compute cannot lock clocks anymore. Users are expected to lock clocks externally using nvidia-smi. NVIDIA Nsight Compute Wrapper script nv-nsight-cu is deprecated in favor of ncu-ui and will be removed in a future release. Source page supports range replay results. Added a second chart on the Compute Workload Analysis section to avoid mixing metrics with different meaning. NVIDIA Nsight Compute now tracks traversable handles created with optixAccelRelocate . NVIDIA Nsight Compute now tracks traversable handles created as updates from others. The Acceleration Structure viewer now reports unsupported inputs. The Acceleration Structure viewer now supports opening multiple traversable handles. The Acceleration Structure viewer now uses OptiX naming for displayed elements. NVIDIA Nsight Compute CLI Wrapper script nv-nsight-cu-cli is deprecated in favor of ncu and will be removed in a future release. Added new option --filter-mode per-gpu to enable filtering of kernel launches on each GPU separately. Added new option --app-replay-mode relaxed to produce profiling results for valid kernels even if the number of kernel launches is inconsistent across application replay passes. Added a documentation section on supported environment variables . Improved the performance when loading existing reports on the command line. Resolved Issues Fixed an issue when resolving files on the Source page. Fixed an issue when profiling OptiX applications. Fixed an issue in the OptiX traversable handle management caused by clashing handle values. Fixed an issue in the Acceleration Structure viewer causing the display of invalid memory when viewing AABB buffers.", "keywords": []}, {"id": 236, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2022-4", "display_name": "Updates in 2022.4", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2022-4", "priority": -1, "content": "General Added support for the CUDA toolkit 12.0. Added support for profiling CUDA graphs as complete workloads instead of as single kernel nodes. Enable this using the Graph Profiling option in the activities . Similarly to range replay results, selected metrics are not available when profiling graphs. Added support for profiling on Windows Subsystem for Linux (WSL2). See the System Requirements for more details. Deprecated nv-nsight-cu and nv-nsight-cu-cli aliases are removed in favor of ncu-ui and ncu . NVIDIA Nsight Compute The Source page now loads disassembly and static analysis results asynchronously in the background. Added a new Metric Details tool window to inspect metric information such as raw value, unit, description or instance values. Open the tool window and select a metric on the Details or Raw page or lookup any metric in the focused report directly in the tool window\u2019s search bar. In the Source page PTX view, the source name will be shown as a list of comma-separated files. Added flexibility with NVTX based filtering in the Next Trigger filter, similar to the command line. Filters can now use nvtx-include and nvtx-exclude expressions by adding the nvtx-include: or nvtx-exclude: prefix. NVTX views now show the payload type. Simplified the command line generated by the Profile activity . Reduced the number of steps required to re-run the Profile activity . The way to rename Baselines in-place has been improved. The Resources tool window now shows the CUDA Dynamic Parallelism state for CUDA functions and modules. OptiX traversable handles can now be exported as Graphviz DOT or SVG files for visualization from the Resources tool window. All OptiX build, instance and geometry flags can be viewed in the Acceleration Structure Viewer . Added OptiX-specific highlight filters to the Acceleration Structure Viewer. Added support for user-specified index strides to the Acceleration Structure Viewer. NVIDIA Nsight Compute CLI Added new option --graph-profiling graph to enable profiling of complete CUDA graphs as single workloads. Added new option --filter-mode per-launch-config to enable filtering of kernel launches for each GPU launch parameter separately. Added support to print section body item metrics on the details page with the new --print-details command line option . Added support to select what to show in Metric Name column on the details page with the new --print-metric-name command line option . Removed deprecated options: --units , --fp , --summary and --kernel-base Added support to print launch, session, process and device attributes on session page with the new --page session option. Added --kill yes support for application replay mode. Resolved Issues Fixed an issue that NVIDIA Nsight Compute could crash when continuing profiling after transposing the Raw page table. Fixed an issue that caused closing a report document to be delayed by pending source analysis. Fixed support for profiling applications with older OptiX versions. Fixed display of OptiX module inputs for IR and built-in modules.", "keywords": []}, {"id": 237, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2022-4-1", "display_name": "Updates in 2022.4.1", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2022-4-1", "priority": -1, "content": "General Improved the documentation for the NvRules API. The python report interface links libstdc++ statically. Resolved Issues Fixed an issue that enabled profiling on CUDA Graph uploads. Fixed formatting issues during unit conversion of metric instances. Fixed an issue that could lead to a crash during application replay. Fixed an issue that could lead to a crash in the python report interface. Fixed typos in the metrics reference documentation and descriptions.", "keywords": []}, {"id": 238, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2023-1", "display_name": "Updates in 2023.1", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2023-1", "priority": -1, "content": "General Added support for the CUDA toolkit 12.1. Added a new app-range replay mode to profile ranges without API capture by relaunching the entire application multiple times. Added sharedBankConflicts sample CUDA application and document to show how NVIDIA Nsight Compute can be used to analyze and identify the shared memory bank conflicts which result in inefficient shared memory accesses. Refer to the README.TXT file, sample code and document under extras/samples/sharedBankConflicts . Jupyter notebook samples are available in the Nsight training github repository . The equivalent of the high-level Python report interface is now available in rule files. NVIDIA Nsight Compute Added support for profiling individual metrics in Interactive Profile activity . A new input field for metrics was added in the Metric Selection tool window. Files on remote systems can be opened directly from the menu . Metric- and section-related entries in the menu, Profile activity and Metric Selection tool window were renamed to make them more clear. CPU and GPU NUMA topology metrics can be collected on applicable systems. Topology information is shown in a new NUMA Affinity section . Added content-aware suggestions to the Details page to provide suggestions based on the selected profiling options. Added support for re-resolving source files on the Source page. Not-issued warp stall reasons are removed from the Source Counters section tables and hidden by default on the Source page. Users should focus on regular warp stall reasons by default and only inspect not-issued samples if this distinction is needed. Added support to search missing CUDA source files to permanently import into the report using Source Lookup options in the Interactive Profile activity . The source page now shows metric values as percentages by default. New buttons are added to support switching between different value modes. NVIDIA Nsight Compute CLI Added support for config files in the current working or user directory to set default ncu parameters. See the General options for more details. Added --range-filter command line option which allows to select subset of enabled profile ranges. Added new --source-folders command line option that allows to recursively search for missing CUDA source files to permanently import into the report. Resolved Issues Fixed performance issues on the Summary and Raw pages for large reports. Improved support for non-ASCII characters in filenames. Fixed an issue with delayed updates of assembly analysis information on the Source page\u2019s Source and PTX views. Fixed potential crashes when using the Python report interface.", "keywords": []}, {"id": 239, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2023-1-1", "display_name": "Updates in 2023.1.1", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2023-1-1", "priority": -1, "content": "NVIDIA Nsight Compute Added new configuration options to set the default view mode and precision for the Source page. Resolved Issues Added support for the DT_RUNPATH attribute when intercepting calls to dlopen . Fixed issue for applications or libraries relying on DT_RUNPATH not finding all dynamic libraries when launched by NVIDIA Nsight Compute. Improved interaction between custom additional metrics and the selected metric set. Adding custom metrics no longer forces switching to the custom metric set. Added ability to gracefully skip folders with insufficient access permissions while importing source code. Fixed the calculation of the peak values for the L1 and L2 cache bandwidths in the hierarchical roofline charts. Fixed issue that prevented modules loaded with function optixModuleCreateFromPTX showing up in the Optix: Modules table of the Resources tool window. Fixed handling of deprecated functions when querying function pointers from the OptiX interception library. Fixed that sometimes sections or rules couldn\u2019t be easily selected in the tool window. Fixed issue with Reset Application Data that prevented some setting from correctly resetting. Fixed potential crash of NVIDIA Nsight Compute when Reset Application Data was executed multiple times in a row. Fixed a crash when saving or loading baselines for non-kernel results. Fixed that memory written while executing a CUDA graph was not properly restored in single-pass graph profiling. Fixed potential memory leak while collecting SW counters for modules with unpatched kernel functions.", "keywords": []}, {"id": 240, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2023-2", "display_name": "Updates in 2023.2", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2023-2", "priority": -1, "content": "General Extended the rules system to show estimates of the potential speedup that can be achieved by addressing the corresponding performance bottleneck. These speedups allow prioritizing applicable rules and help focusing first on optimization strategies with the highest potential performance gain. Added support for rules to highlight individual source lines. Lines with global/local memory access with high excessive sector counts and shared accesses with many bank conflicts are automatically detected and highlighted. Added the ability to query metric attributes in NvRules API. Added support for creating instanced metrics through the NvRules API. For Orin+ mobile chips on the Linux aarch64 platform, added metrics ( mcc__* ) support for memory controller channel (MC Channel) unit which connects to the DRAM. NVIDIA Nsight Compute Added hyperlinks to the SASS View of the Source Page for instructions that reference others by address or offset. This enables to quickly jump to the target instruction of a branch. Improved the search bar in the Metric Details tool window. The search string now matches any part of the metric names, and the matching results are shown in a sorted order. Added a visual indication of scale of the metric value changes when the baselines are used. The background bars in the table cells of the Details Page allow to quickly identify which metrics values increased or decreased the most. The color scheme can be configured in the Baselines tool window . Added support for rules toggle button on the Summary Page. Allows to hide the bottom pane with the rules output for the selected kernel launch. Added support for allowing users to configure properties on Summary Page using Metrics/Properties profile option . Added percentage bars on Summary Page . NVIDIA Nsight Compute CLI Added support for tracking child processes launched with posix_spawn(p) when using --target-processes all . Added support for tracking child processes launched with system() on Windows and Linux (aarch64, x86_64) when using --target-processes all . Resolved Issues Fixed table alignment in the output of the NVIDIA Nsight Compute CLI on Windows when printing Unicode characters. Fixed view corruption in the Source Page after switching from the collapsed view to the expanded view. Fixed missing tooltip descriptions for some SASS instructions. Fixed potential crash when copying from the Resources tool window using CTRL+C. Fixed possible crash when restoring sections in the Sections tool window.", "keywords": []}, {"id": 241, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2023-2-1", "display_name": "Updates in 2023.2.1", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2023-2-1", "priority": -1, "content": "Resolved Issues Fixed a crash during application replay while having the temporary directory located on a network file system (NFS). Improved detection mechanism for C2C interface. Added caching of the detected configuration to reduce overhead.", "keywords": []}, {"id": 242, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2023-2-2", "display_name": "Updates in 2023.2.2", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2023-2-2", "priority": -1, "content": "Resolved Issues Fixed possible crash when profiling CUDA graphs on multiple GPUs. Fixed the detection mechanism of the C2C interface, i.e. metric c2clink__present . The fix requires the display driver shipping with this release or any newer driver.", "keywords": []}, {"id": 243, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2023-3", "display_name": "Updates in 2023.3", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2023-3", "priority": -1, "content": "General NVIDIA Nsight Compute now supports collecting many metrics by sampling the GPU\u2019s performance monitors (PM) periodically at fixed intervals. The results can be visualized on a timeline . Added WSL profiling support on Windows 10 WSL with OS build version 19044 and greater. WSL profiling is not supported on Windows 10 WSL for systems that exceed 1 TB of system memory. Rule outputs are prioritized to improve the accuracy of estimated speedups. The Summary page now shows the most actionable optimization advices when a result row is selected. Improved the handling and reporting for unavailable metrics during collection and when applying rules. Added instructionMix sample CUDA application and document to show how to use NVIDIA Nsight Compute to analyze and identify the performance bottleneck due to an imbalanced instruction mix. Refer to the README.TXT file, sample code, and document under extras/samples/instructionMix . NVIDIA Nsight Compute Added support to see the source files of two profile results side by side using Source Comparison . This allows you to quickly identify source differences and understand changes in metric values. The Summary page is now the default page when a report is opened. Previous behavior can be enabled in the options dialog. On the Summary and Raw pages, values from all/selected rows are automatically aggregated in the column header for applicable metrics. Selected individual cells are aggregated in the bottom status bar. Added Launch Name and Device options in the filter dialog launched by Apply Filters button in the report header . Added support for source view profiles that persist the Source page configuration and allow you to re-apply it to other reports. The Metric Details tool window now supports querying metrics beyond the current report by using the chip:<chipname> tag in the search. Added support for CUDA Graph Edge Data (such as port and dependency type) and CUDA Graph Conditional Handles in the Resources tool window. The Acceleration Structure Viewer and Resources tool window now support OptiX Opacity Micromaps. NVIDIA Nsight Compute CLI Tracking and profiling all child processes ( --target-processes all ) is now the default for ncu. Improved reporting of requested but unavailable metrics. Metrics requested in section files are by default considered optional and only cause a warning to be shown. Resolved Issues Support for tracking child processes launched with system() is available on Linux ppc64le. Improved the behavior of following SASS navigation links on the Source page. Fixed issues with profiling CUDA graphs in graph-profiling mode when nodes are associated with a non-current CUDA context. Fixed an issue in L2 bandwidth calculations in the hierarchical roofline sections.", "keywords": []}, {"id": 244, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2023-3-1", "display_name": "Updates in 2023.3.1", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2023-3-1", "priority": -1, "content": "General Switched to using OpenSSL version 1.1.1w. Improved the speedup estimates for rule IssueSlotUtilization as well as its child rules. Updated report files and documentation for the samples located at extras/samples/ . Resolved Issues Fixed collection of context switch data during PM Sampling when using Range Replay . Fixed potential crash of NVIDIA Nsight Compute when an invalid regular expression was provided as requested metric. Improved the performance of NVIDIA Nsight Compute in cases where only a single process is being profiled and --target-processes all was specified. Fixed an issue of reporting too high register counts on the Source Page. Fixed a bug that could cause a GPU fault while collecting SW counters through PerfWorks. Fixed showing incorrect baseline values for the Runtime Improvement values on the Summary Page.", "keywords": []}, {"id": 245, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2024-1", "display_name": "Updates in 2024.1", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2024-1", "priority": -1, "content": "General Switched to using OpenSSL version 3.0.10. Added new metrics available when profiling on CUDA Green Contexts. Reduced the number of passes required for collecting PM sampling sections. Counter domains can now be specified for PM sampling metrics in section files. PM sampling metrics can now be queried in the command line and Metric Details window by specifying the respective collection option. Added a new optional PmSampling_WarpStates section for understanding warp stall reasons over the workload duration. Added a new rule for detecting load imbalances. Improved the performance of graph-level profiling on new drivers. Updated the metrics compatibility table for OptiX cmdlists and instruction-level SASS metrics. NVIDIA Nsight Compute Added SASS view and Source Markers support in Source Comparison . Improved Source Comparison diff visualization by adding empty lines on other side of inserted/deleted lines. The Source page column chooser can now be opened directly from the Navigation drop down. Added a Launch Details tool window for showing information about individual launches within larger workloads like OptiX command lists. Added support for CUDA Green Contexts in the Resources tool window, the Launch Statistics section and the report header. NVIDIA Nsight Compute CLI Improved documentation on NVTX expressions and command line output when a potentially incorrect expression led to no workloads being profiled. Improved checking for invalid expressions when using the --target-processes-filer option. Resolved Issues Fixed that the L1 cache achieved roofline value was missing when profiling on GH100. Fixed several \u201cLaunch Failed\u201d errors when collecting instruction-level SASS metrics. Fixed that Live Register values would be too high for some workloads. Fixed a scrolling issue on the Source page when collapsing a multi-file view. Fixed an issue that no PM sampling data would be shown in the timeline when context switch trace was not available. Fixed a display issue in the memory chart when adding baselines. Fixed a crash when adding baselines. Fixed a crash in timeline views when not all configured data was available. Fixed that the application history was not always deleted when selecting Reset Application Data. Fixed an error in the metric compatibility documentation.", "keywords": []}, {"id": 246, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "page", "name": "ReleaseNotes/index#updates-in-2024-1-1", "display_name": "Updates in 2024.1.1", "type": "section", "display_type": "Page section", "docname": "ReleaseNotes/index", "anchor": "updates-in-2024-1-1", "priority": -1, "content": "General Added clarification that for profiling a range with multiple, active CUDA Green Contexts, counter values that are not attributable to SMs will be aggregated over all these Green Contexts. Resolved Issues Changed the way the PerfWorks library is loaded into the target application\u2019s process space. This addresses possible connection errors in case the library search path includes other directories with PerfWorks libraries. Fixed an issue that caused PM sampling data to be missing from the results of a Profile Series. Fixed the incorrect calculation of the percentage values in the Inline Function table. Fixed a potential crash of the NVIDIA Nsight Compute UI when PM sampling data was requested, but no sample was collected.", "keywords": []}, {"id": 247, "doc_id": 247, "filename": "ReleaseNotes/index.html", "domain_name": "std", "name": "ReleaseNotes/index", "display_name": "Release Notes", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/index", "anchor": "", "priority": -1, "content": "Nsight Compute Release Notes. Release notes, including new features and important bug fixes. Supported platforms and GPUs. List of known issues for the current release.", "keywords": []}, {"id": 248, "doc_id": 248, "filename": "ReleaseNotes/topics/gpu-support.html", "domain_name": "std", "name": "ReleaseNotes/topics/gpu-support", "display_name": "GPU Support", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/gpu-support", "anchor": "", "priority": -1, "content": "Architecture Support Kepler No Maxwell No Pascal No Volta GV100 Yes Volta GV11b Yes Turing TU1xx Yes NVIDIA GA100 Yes NVIDIA GA10x Yes NVIDIA GA10b Yes NVIDIA GH100 Yes Most metrics used in NVIDIA Nsight Compute are identical to those of the PerfWorks Metrics API and follow the documented Metrics Structure . A comparison between the metrics used in nvprof and their equivalent in NVIDIA Nsight Compute can be found in the NVIDIA Nsight Compute CLI User Manual .", "keywords": []}, {"id": 249, "doc_id": 249, "filename": "ReleaseNotes/topics/known-issues.html", "domain_name": "std", "name": "ReleaseNotes/topics/known-issues", "display_name": "Known Issues", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/known-issues", "anchor": "", "priority": -1, "content": "Installation The installer might not show all patch-level version numbers during installation. Some command line options listed in the help of a .run installer of NVIDIA Nsight Compute are affecting only the archive extraction, but not the installation stage. To pass command line options to the embedded installer script, specify those options after -- in the form of -- -<option> . The available options for the installer script are: -help : Print help message -targetpath=<PATH> : Specify install path -noprompt : No prompts. Implies acceptance of the EULA For example, specifying only option --quiet extracts the installer archive without any output to the console, but still prompts for user interaction during the installation. To install NVIDIA Nsight Compute without any console output nor any user interaction, please specify --quiet -- -noprompt . After using the SDK Manager to install the NVIDIA Nsight Compute tools, their binary path needs to be manually added to your PATH environment variable. See also the System Requirements for more installation instructions. Launch and Connection Launching applications on remote targets/platforms is not supported for several combinations. See Platform Support for details. Manually launch the application using command line ncu --mode=launch on the remote system and connect using the UI or CLI afterwards. In the NVIDIA Nsight Compute connection dialog, a remote system can only be specified for one target platform. Remove a connection from its current target platform in order to be able to add it to another. Loading of CUDA sources via SSH requires that the remote connection is configured, and that the hostname/IP address of the connection matches the target (as seen in the report session details). For example, prefer my-machine.my-domain.com, instead of my-machine, even though the latter resolves to the same. Other issues concerning remote connections are discussed in the documentation for remote connections . Local connections between NVIDIA Nsight Compute and the launched target application might not work on some ppc64le or aarch64 (sbsa) systems configured to only support IPv6. On these platforms, the NV_COMPUTE_PROFILER_LOCAL_CONNECTION_OVERRIDE=uds environment variable can be set to use Unix Domain Sockets instead of TCP for local connections to workaround the problem. On x86_64 Linux, Unix Domain Sockets are used by default, but local TCP connections can be forced using NV_COMPUTE_PROFILER_LOCAL_CONNECTION_OVERRIDE=tcp . Profiling and Metrics Profiling of 32-bit processes is not supported. Profiling kernels executed on a device that is part of an SLI group is not supported. An \u201cUnsupported GPU\u201d error is shown in this case. Profiling a kernel while other contexts are active on the same device (e.g. X server, or secondary CUDA or graphics application) can result in varying metric values for L2/FB (Device Memory) related metrics. Specifically, L2/FB traffic from non-profiled contexts cannot be excluded from the metric results. To completely avoid this issue, profile the application on a GPU without secondary contexts accessing the same device (e.g. no X server on Linux). In the current release, profiling a kernel while any other GPU work is executing on the same MIG compute instance can result in varying metric values for all units. NVIDIA Nsight Compute enforces serialization of the CUDA launches within the target application to ensure those kernels do not influence each other. See Serialization for more details. However, GPU work issued through other APIs in the target process or workloads created by non-target processes running simultaneously in the same MIG compute instance will influence the collected metrics. Note that it is acceptable to run CUDA processes in other MIG compute instances as they will not influence the profiled MIG compute instance. On Linux kernels settings fs.protected_regular=1 (e.g. some Ubuntu 20.04 cloud service provider instances), root users may not be able to access the inter-process lock file . See the FAQ for workarounds. Profiling only supports up to 32 device instances, including instances of MIG partitions. Profiling the 33rd or higher device instance will result in indeterminate data. Enabling certain metrics can cause GPU kernels to run longer than the driver\u2019s watchdog time-out limit. In these cases the driver will terminate the GPU kernel resulting in an application error and profiling data will not be available. Please disable the driver watchdog time out before profiling such long running CUDA kernels. On Linux, setting the X Config option Interactive to false is recommended. For Windows, detailed information on disabling the Windows TDR is available at https://docs.microsoft.com/en-us/windows-hardware/drivers/display/timeout-detection-and-recovery Collecting device-level metrics, such as the NVLink metrics ( nvl* ), is not supported on NVIDIA virtual GPUs (vGPUs). As of CUDA 11.4 and R470 TRD1 driver release, NVIDIA Nsight Compute is supported in a vGPU environment which requires a vGPU license. If the license is not obtained after 20 minutes, the reported performance metrics data from the GPU will be inaccurate. This is because of a feature in vGPU environment which reduces performance but retains functionality as specified here . Profiling on NVIDIA live-migrated virtual machines is not supported and can result in undefined behavior. Profiling with enabled multi-process service (MPS) can result in undefined behavior. When Profiling using Range Replay or Application Range Replay with multiple CUDA Green Contexts active which belong to the same device context, the range result will contain counter values aggregated on all Green Contexts The NVLink Topology section is not supported for a configuration using NVSwitch. NVIDIA Nsight Compute does not support per-NVLink metrics. NVIDIA Nsight Compute does not support the Logical NVLink Throughput table. Setting a reduced NvLink Bandwidth mode does not impact the reported peak values for NvLink metrics. All peak values and corresponding percentages are calculated off the non-reduced NvLink bandwidth. Reconfiguring the NvLink Bandwidth mode using nvidia-smi` while profiling may lead to undefined tools\u2019 behavior. Profiling CUDA graph kernel nodes that can launch device graphs or are part of device-launchable graphs is not supported. Use Graph Profiling mode instead. Profiling in Graph Profiling mode is performed on the context that is specified by the stream handle for the graph launch. Consequently, only memory allocated on this context is saved off and restored during graph replay and only kernel nodes executed on this context are profiled. On CUDA drivers older than 530.x, profiling on Windows Subsystem for Linux (WSL) is not supported if the system has multiple physical NVIDIA GPUs. This is not affected by setting CUDA_VISIBLE_DEVICES . Collecting software counters through PerfWorks currently forces all functions in the module of the profiled kernel to be loaded. This increases the host and device memory footprint of the target application for the remainder of the process lifetime. PM Sampling is not supported when collecting a Profile Series. Compatibility Applications calling blocking functions on std input/output streams can result in the profiler to stop, until the blocking function call is resolved. NVIDIA Nsight Compute can hang on applications using RAPIDS in versions 0.6 and 0.7, due to an issue in cuDF. Profiling child processes launched via clone() is not supported. Profiling child processes launched from Python using os.system() is not supported on ppc64le. Profiling of Cooperative Groups kernels launched with cuLaunchCooperativeKernelMultiDevice is not yet supported. On Linux systems, when profiling bsd-csh scripts, the original application output will not be printed. As a workaround, use a different C-shell, e.g. tcsh . Attempting to use the --clock-control option to set the GPU clocks will fail when profiling on a GPU partition. Please use nvidia-smi (installed with NVIDIA display driver) to control the clocks for the entire GPU. This will require administrative privileges when the GPU is partitioned. On Linux aarch64, NVIDIA Nsight Compute does not work if the HOME environment variable is not set. NVIDIA Nsight Compute versions 2020.1.0 to 2020.2.1 are not compatible with CUDA driver version 460+ if the application launches Cooperative Groups kernels. Profiling will fail with error \u201cUnknownError\u201d. Collecting CPU call stack information on Windows Server 2016 can hang NVIDIA Nsight Compute in some cases. Currently, the only workaround is to skip CPU call stack collection on such systems by not specifying the option --call-stack . When profiling a script, --target-processes all may target utility executables such as xargs , uname or ls . To avoid profiling these, use the --target-processes-filter option accordingly. On mobile platforms, --kill option is not supported with application replay mode. NVIDIA Nsight Compute might show invalid characters for Unicode names and paths on Windows 10. As a workaround, use a third-party terminal emulator, e.g. Git bash. User Interface The API Statistics filter in NVIDIA Nsight Compute does not support units. File size is the only property considered when resolving source files. Timestamps are currently ignored. Terminating or disconnecting an application in the Interactive Profiling activity while the API Stream View is updated can lead to a crash. See the OptiX library support section for limitations concerning the Acceleration Structure Viewer . After updating from a previous version of NVIDIA Nsight Compute on Linux, the file load dialog may not allow column resizing and sorting. As a workaround, the ~/.config/QtProject.conf file can be edited to remove the treeViewHeader entry from the [FileDialog] section.", "keywords": []}, {"id": 250, "doc_id": 250, "filename": "ReleaseNotes/topics/library-support.html", "domain_name": "std", "name": "ReleaseNotes/topics/library-support", "display_name": "Library Support", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/library-support", "anchor": "", "priority": -1, "content": "NVIDIA Nsight Compute can be used to profile CUDA applications, as well as applications that use CUDA via NVIDIA or third-party libraries. For most such libraries, the behavior is expected to be identical to applications using CUDA directly. However, for certain libraries, NVIDIA Nsight Compute has certain restrictions, alternate behavior, or requires non-default setup steps prior to profiling.", "keywords": []}, {"id": 251, "doc_id": 251, "filename": "ReleaseNotes/topics/library-support-optix.html", "domain_name": "std", "name": "ReleaseNotes/topics/library-support-optix", "display_name": "OptiX", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/library-support-optix", "anchor": "", "priority": -1, "content": "NVIDIA Nsight Compute supports profiling of OptiX applications, but with certain restrictions. Internal Kernels Kernels launched by OptiX that contain no user-defined code are given the generic name NVIDIA internal . These kernels show up on the API Stream in the NVIDIA Nsight Compute UI, and can be profiled in both the UI as well as the NVIDIA Nsight Compute CLI. However, no CUDA-C source, PTX or SASS is available for them. User Kernels Kernels launched by OptiX can contain user-defined code. OptiX identifies these kernels in the API Stream with a custom name. This name starts with raygen__ (for \u201cray generation\u201d). These kernels show up on the API Stream and can be profiled in the UI as well as the NVIDIA Nsight Compute CLI. The Source page displays CUDA-C source, PTX and SASS defined by the user. Certain parts of the kernel, including device functions that contain OptiX-internal code, will not be available in the Source page. SASS When SASS information is available in the profile report, certain instructions might not be available in the Source page and shown as N/A . The Acceleration Structure Viewer for OptiX traversable handles currently has the following limitations: The Acceleration Structure Viewer is not supported on MacOSX. Viewing instance acceleration structures using multi-level instancing is not supported. Applying motion traversables to acceleration structures is not supported. The following feature set is supported per OptiX API version: OptiX API Version Kernel Profiling API Interception Resource Tracking 6.x Yes No No 7.0 - 8.0 Yes Yes Yes", "keywords": []}, {"id": 252, "doc_id": 252, "filename": "ReleaseNotes/topics/platform-support.html", "domain_name": "std", "name": "ReleaseNotes/topics/platform-support", "display_name": "Platform Support", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/platform-support", "anchor": "", "priority": -1, "content": "Host denotes the UI can run on that platform. Target means that we can instrument applications on that platform for data collection. Applications launched with instrumentation on a target system can be connected to from most host platforms. The reports collected on one system can be opened on any other system. Host Targets Windows Yes Windows*, Linux (x86_64) Windows Subsystem for Linux (WSL2) Yes Windows Subsystem for Linux (WSL2) as part of the Linux (x86_64) package. Linux (x86_64) Yes Windows*, Linux (x86_64), Linux (ppc64le), Linux (aarch64 sbsa) Linux (ppc64le) No Linux (ppc64le) Linux (aarch64 sbsa) Yes Linux (aarch64 sbsa) Linux (x86_64) (Drive SDK) Yes Windows*, Linux (x86_64), Linux (aarch64), QNX MacOSX 11+ Yes Windows*, Linux (x86_64), Linux (ppc64le) Linux (aarch64) No Linux (aarch64) QNX No QNX Target platforms marked with * do not support remote launch from the respective host. Remote launch means that the application can be launched on the target system from the host UI. Instead, the application must be launched from the target system. Profiling of 32-bit processes is not supported.", "keywords": []}, {"id": 253, "doc_id": 253, "filename": "ReleaseNotes/topics/release-notes.html", "domain_name": "std", "name": "ReleaseNotes/topics/release-notes", "display_name": "Release Notes", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/release-notes", "anchor": "", "priority": -1, "content": "", "keywords": []}, {"id": 254, "doc_id": 254, "filename": "ReleaseNotes/topics/release-notes-older-versions.html", "domain_name": "std", "name": "ReleaseNotes/topics/release-notes-older-versions", "display_name": "Older Versions", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/release-notes-older-versions", "anchor": "", "priority": -1, "content": "", "keywords": []}, {"id": 255, "doc_id": 255, "filename": "ReleaseNotes/topics/support.html", "domain_name": "std", "name": "ReleaseNotes/topics/support", "display_name": "Support", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/support", "anchor": "", "priority": -1, "content": "Information on supported platforms and GPUs.", "keywords": []}, {"id": 256, "doc_id": 256, "filename": "ReleaseNotes/topics/system-requirements.html", "domain_name": "std", "name": "ReleaseNotes/topics/system-requirements", "display_name": "System Requirements", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/system-requirements", "anchor": "", "priority": -1, "content": "Linux and WSL On all Linux platforms, NVIDIA Nsight Compute CLI requires GLIBC version 2.15 or higher. On x86_64, the NVIDIA Nsight Compute UI requires GLIBC version 2.17 or higher. On Linux (aarch64 sbsa), the NVIDIA Nsight Compute UI requires GLIBC version 2.26 or higher. The NVIDIA Nsight Compute UI requires several packages to be installed to enable Qt. Please refer to the Qt for X11 Requirements . When executing ncu-ui with missing dependencies, an error message with information on the missing packages is shown. Note that only one package will be shown at a time, even though multiple may be missing from your system. For selected operating systems, the following commands install needed packages for NVIDIA Nsight Compute on X11: Ubuntu 18.04 apt install libopengl0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xkb1 libxkbcommon-x11-0 Ubuntu 20.04 apt install libopengl0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 libxcb-xinerama0 libxcb-xkb1 libxkbcommon-x11-0 RHEL 8.6 yum install libglvnd-opengl libxcb libxkbcommon-x11 Profiling on Windows Subsystem for Linux (WSL) is only supported with WSL version 2. Profiling is supported on Windows 10 WSL with OS build version 19044 and greater, and NVIDIA display driver version 545 or higher. It is not supported on Windows 10 WSL for systems that exceed 1 TB of system memory. Profiling is supported on Windows 11 WSL with NVIDIA display driver version 525 or higher. The Linux (x86_64) NVIDIA Nsight Compute package can be used and should be installed directly within WSL2. Remote profiling to and from WSL2 works equivalently to regular Linux (x86_64) hosts and targets, as long as it\u2019s accessible via SSH. Access to NVIDIA GPU Performance Counters must be enabled in the NVIDIA Control Panel of the Windows host. See also the CUDA on WSL User Guide . Windows Only Windows 10 and 11 are supported as host and target. The Visual Studio 2017 redistributable is not automatically installed by the NVIDIA Nsight Compute installer. The workaround is to install the x64 version of the \u2018Microsoft Visual C++ Redistributable for Visual Studio 2017\u2019 manually. The installer is linked on the main download page for Visual Studio at https://www.visualstudio.com/downloads/ or download directly from https://go.microsoft.com/fwlink/?LinkId=746572 .", "keywords": []}, {"id": 257, "doc_id": 257, "filename": "ReleaseNotes/topics/updates-2019-1.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2019-1", "display_name": "Updates in 2019.1", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2019-1", "anchor": "", "priority": -1, "content": "General Support for CUDA 10.1 Improved performance Bug fixes Profiling on Volta GPUs now uses the same metric names as on Turing GPUs Section files support descriptions The default sections and rules directory has been renamed to sections NVIDIA Nsight Compute Added new profiling options to the options dialog Details page shows rule result icons in the section headers Section descriptions are shown in the details page and in the sections tool window Source page supports collapsing multiple source files or functions to show aggregated results Source page heatmap color scale has changed Invalid metric results are highlighted in the profiler report Loaded section and rule files can be opened from the sections tool window NVIDIA Nsight Compute CLI Support for profiling child processes on Linux and Windows x86_64 targets NVIDIA Nsight Compute CLI uses a temporary file if no output file is specified Support for new --quiet option Support for setting the GPU clock control mode using new --clock-control option Details page output shows the NVTX context when --nvtx is enabled Support for filtering kernel launches for profiling based on their NVTX context using new --nvtx-include and --nvtx-exclude options Added new --summary options for aggregating profiling results Added option --open-in-ui to open reports collected with NVIDIA Nsight Compute CLI directly in NVIDIA Nsight Compute Resolved Issues Installation directory scripts use absolute paths OpenACC kernel names are correctly demangled Profile activity report file supports a relative path Source view can resolve all applicable files at once UI font colors are improved Details page layout and label elision issues are resolved Turing metrics are properly reported on the Summary page All byte-based metrics use a factor of 1000 when scaling units to follow SI standards CSV exports properly align columns with empty entries Fixed the metric computation for double_precision_fu_utilization on GV11b Fixed incorrect \u2018selected\u2019 PC sampling counter values The SpeedOfLight section uses \u2018max\u2019 instead of \u2018avg\u2019 cycles metrics for Elapsed Cycles", "keywords": []}, {"id": 258, "doc_id": 258, "filename": "ReleaseNotes/topics/updates-2019-2.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2019-2", "display_name": "Updates in 2019.2", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2019-2", "anchor": "", "priority": -1, "content": "General Improved performance Bug fixes Kernel launch context and stream are reported as metrics PC sampling configuration options are reported as metrics The default base port for connections to the target changed Section files support multiple, named Body fields NvRules allows users to query metrics using any convertible data type NVIDIA Nsight Compute Support for filtering kernel launches using their NVTX context Support for new options to select the connection port range The Profile activity supports configuring PC sampling parameters Sections on the Details page support selecting individual bodies NVIDIA Nsight Compute CLI Support for stepping to kernel launches from specific NVTX contexts Support for new --port and --max-connections options Support for new --sampling-* options to configure PC sampling parameters Section file errors are reported with --list-sections A warning is shown if some section files could not be loaded Resolved Issues Using the \u2013summary option works for reports that include invalid metrics The full process executable filename is reported for QNX targets The project system now properly stores the state of opened reports Fixed PTX syntax highlighting Fixed an issue when switching between manual and auto profiling in NVIDIA Nsight Compute The source page in NVIDIA Nsight Compute now works with results from multiple processes Charts on the NVIDIA Nsight Compute details page uses proper localization for numbers NVIDIA Nsight Compute no longer requires the system locale to be set to English", "keywords": []}, {"id": 259, "doc_id": 259, "filename": "ReleaseNotes/topics/updates-2019-3.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2019-3", "display_name": "Updates in 2019.3", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2019-3", "anchor": "", "priority": -1, "content": "General Improved performance Bug fixes Kernel launch context and stream are reported as metrics PC sampling configuration options are reported as metrics The default base port for connections to the target changed Section files support multiple, named Body fields NvRules allows users to query metrics using any convertible data type NVIDIA Nsight Compute Support for filtering kernel launches using their NVTX context Support for new options to select the connection port range The Profile activity supports configuring PC sampling parameters Sections on the Details page support selecting individual bodies NVIDIA Nsight Compute CLI Support for stepping to kernel launches from specific NVTX contexts Support for new --port and --max-connections options Support for new --sampling-* options to configure PC sampling parameters Section file errors are reported with --list-sections A warning is shown if some section files could not be loaded Resolved Issues Using the \u2013summary option works for reports that include invalid metrics The full process executable filename is reported for QNX targets The project system now properly stores the state of opened reports Fixed PTX syntax highlighting Fixed an issue when switching between manual and auto profiling in NVIDIA Nsight Compute The source page in NVIDIA Nsight Compute now works with results from multiple processes Charts on the NVIDIA Nsight Compute details page uses proper localization for numbers NVIDIA Nsight Compute no longer requires the system locale to be set to English", "keywords": []}, {"id": 260, "doc_id": 260, "filename": "ReleaseNotes/topics/updates-2019-3-1.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2019-3-1", "display_name": "Updates in 2019.3.1", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2019-3-1", "anchor": "", "priority": -1, "content": "NVIDIA Nsight Compute Added ability to send bug reports and suggestions for features using Send Feedback in the Help menu Resolved Issues Fixed calculation of theoretical occupancy for grids with blocks that are not a multiple of 32 threads Fixed intercepting child processes launched through Python\u2019s subprocess.Popen class Fixed issue of NVTX push/pop ranges not showing up for child threads in NVIDIA Nsight Compute CLI Fixed performance regression for metric lookups on the Source page Fixed description in rule covering the IMC stall reason Fixed cases were baseline values were not correctly calculated in the Memory tables when comparing reports of different architectures Fixed incorrect calculation of baseline values in the Executed Instruction Mix chart Fixed accessing instanced metrics in the NvRules API Fixed a bug that could cause the collection of unnecessary metrics in the Interactive Profile activity Fixed potential crash on exit of the profiled target application Switched underlying metric for SOL FB in the GPU Speed Of Light section to be driven by dram__throughput.avg.pct_of_peak_sustained_elapsed instead of fbpa__throughput.avg.pct_of_peak_sustained_elapsed", "keywords": []}, {"id": 261, "doc_id": 261, "filename": "ReleaseNotes/topics/updates-2019-4.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2019-4", "display_name": "Updates in 2019.4", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2019-4", "anchor": "", "priority": -1, "content": "General Added support for the Linux PowerPC target platform Reduced the profiling overhead, especially if no source metrics are collected Reduced the overhead for non-profiled kernels Improved the deployment performance during remote launches Trying to profile on an unsupported GPU now shows an \u201cUnsupported GPU\u201d error message Added support for the %i sequential number placeholder to generate unique report file names Added support for smsp__sass_* metrics on Volta and newer GPUs The launch__occupancy_limit_shared_mem now reports the device block limit if no shared memory is used by the kernel NVIDIA Nsight Compute The Profile activity shows the command line used to launch ncu The heatmap on the Source page now shows the represented metric in its tooltip The Memory Workload Analysis Chart on the Details page now supports baselines When applying rules, a message displaying the number of new rule results is shown in the status bar The Visual Profiler Transition Guide was added to the documentation Connection dialog activity options were added to the documentation A warning dialog is shown if the application is resumed without Auto-Profile enabled Pausing the application now has immediate feedback in the toolbar controls Added a Close All command to the File menu NVIDIA Nsight Compute CLI The --query-metrics option now shows only metric base names for faster metric query. The new option --query-metrics-mode can be used to display the valid suffixes for each base metric. Added support for passing response files using the @ operator to specify command line options through a file Resolved Issues Fixed an issue that reported the wrong executable name in the Session page when attaching Fixed issues that chart labels were shown elided on the Details page Fixed an issue that caused the cache hitrates to be shown incorrectly when baselines were added Fixed an illegal memory access when collecting sass__*_histogram metrics for applications using PyTorch on Pascal GPUs Fixed an issue when attempting to collect all smsp__* metrics on Volta and newer GPUs Fixed an issue when profiling multi-context applications Fixed that profiling start/stop settings from the connection dialog weren\u2019t properly passed to the interactive profile activity Fixed that certain smsp__warp_cycles_per_issue_stall* metrics returned negative values on Pascal GPUs Fixed that metric names were truncated in the --page details non-CSV command line output Fixed that the target application could crash if a connection port was used by another application with higher privileges", "keywords": []}, {"id": 262, "doc_id": 262, "filename": "ReleaseNotes/topics/updates-2019-5.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2019-5", "display_name": "Updates in 2019.5", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2019-5", "anchor": "", "priority": -1, "content": "General Added section sets to reduce the default overhead and make it easier to configure metric sets for profiling Reduced the size of the installation Added support for CUDA Graphs Recapture API The NvRules API now supports accessing correlation IDs for instanced metrics Added breakdown tables for SOL SM and SOL Memory in the Speed Of Light section for Volta+ GPUs NVIDIA Nsight Compute Added a snap-select feature to the Source page heatmap help navigate large files Added support for loading remote CUDA-C source files via SSH on demand for Linux x86_64 targets Charts on the Details page provide better help in tool tips when hovering metric names Improved the performance of the Source page when scrolling or collapsing The charts for Warp States and Compute pipelines are now sorted by value NVIDIA Nsight Compute CLI Added support for GPU cache control, see --cache-control Added support for setting the kernel name base in command line output, see --kernel-base Added support for listing the available names for --chips , see --list-chips Improved the stability on Windows when using --target-processes all Reduced the profiling overhead for small metric sets in applications with many kernels Resolved Issues Reduced the overhead caused by demangling kernel names multiple times Fixed an issue that kernel names were not demangled in CUDA Graph Nodes resources window The connection dialog better disables unsupported combinations or warns of invalid entries Fixed metric thread_inst_executed_true to derive from smsp_not_predicated_off_thread_inst_executed on Volta+ GPUs Fixed an issue with computing the theoretical occupancy on GV100 Selecting an entry on the Source page heatmap no longer selects the respective source line, to avoid losing the current selection Fixed the current view indicator of the Source page heatmap to be line-accurate Fixed an issue when comparing metrics from Pascal and later architectures on the Summary page Fixed an issue that metrics representing constant values on Volta+ couldn\u2019t be collected without non-constant metrics", "keywords": []}, {"id": 263, "doc_id": 263, "filename": "ReleaseNotes/topics/updates-2019-5-1.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2019-5-1", "display_name": "Updates in 2019.5.1", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2019-5-1", "anchor": "", "priority": -1, "content": "General Added support for Nsight Compute Visual Studio Integration", "keywords": []}, {"id": 264, "doc_id": 264, "filename": "ReleaseNotes/topics/updates-2019-5-2.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2019-5-2", "display_name": "Updates in 2019.5.2", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2019-5-2", "anchor": "", "priority": -1, "content": "General Bug fixes", "keywords": []}, {"id": 265, "doc_id": 265, "filename": "ReleaseNotes/topics/updates-2019-5-3.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2019-5-3", "display_name": "Updates in 2019.5.3", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2019-5-3", "anchor": "", "priority": -1, "content": "General More C++ kernel names can be properly demangled", "keywords": []}, {"id": 266, "doc_id": 266, "filename": "ReleaseNotes/topics/updates-2020-1.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2020-1", "display_name": "Updates in 2020.1", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2020-1", "anchor": "", "priority": -1, "content": "General Added support for the NVIDIA GA100/SM 8.x GPU architecture Removed support for the Pascal SM 6.x GPU architecture Windows 7 is not a supported host or target platform anymore Added a rule for reporting uncoalesced memory accesses as part of the Source Counters section Added support for report name placeholders %p, %q, %i and %h The Kernel Profiling Guide was added to the documentation NVIDIA Nsight Compute The UI command was renamed from nv-nsight-cu to ncu-ui . Old names remain for backwards compatibility. Added support for roofline analysis charts Added linked hot spot tables in section bodies to indicate performance problems in the source code Added section navigation links in rule results to quickly jump to the referenced section Added a new option to select how kernel names are shown in the UI Added new memory tables for the L1/TEX cache and the L2 cache. The old tables are still available for backwards compatibility and moved to a new section containing deprecated UI elements. Memory tables now show the metric name as a tooltip Source resolution now takes into account file properties when selecting a file from disk Results in the profile report can now be filtered by NVTX range The Source page now supports collapsing views even for single files The UI shows profiler error messages as dismissible banners for increased visibility Improved the baseline name control in the profiler report header NVIDIA Nsight Compute CLI The CLI command was renamed from nv-nsight-cu-cli to ncu . Old names remain for backwards compatibility. Queried metrics on GV100 and newer chips are sorted alphabetically Multiple instances of NVIDIA Nsight Compute CLI can now run concurrently on the same system, e.g. for profiling individual MPI ranks. Profiled kernels are serialized across all processes using a system-wide file lock. Resolved Issues More C++ kernel names can be properly demangled Fixed a free(): invalid pointer error when profiling applications using pytorch > 19.07 Fixed profiling IBM Spectrum MPI applications that require PAMI GPU hooks ( --smpiargs="-gpu" ) Fixed that the first kernel instruction was missed when computing sass__inst_executed_per_opcode Reduced surplus DRAM write traffic created from flushing caches during kernel replay The Compute Workload Analysis section shows the IMMA pipeline on GV11b GPUs Profile reports now scroll properly on MacOS when using a trackpad Relative output filenames for the Profile activity now use the document directory, instead of the current working directory Fixed path expansion of ~ on Windows Memory access information is now shown properly for RED assembly instructions on the Source page Fixed that user PYTHONHOME and PYTHONPATH environment variables would be picked up by NVIDIA Nsight Compute, resulting in locale encoding issues.", "keywords": []}, {"id": 267, "doc_id": 267, "filename": "ReleaseNotes/topics/updates-2020-1-1.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2020-1-1", "display_name": "Updates in 2020.1.1", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2020-1-1", "anchor": "", "priority": -1, "content": "General Added support for the NVIDIA GA100/SM 8.x GPU architecture Metrics passed to --metrics on the NVIDIA Nsight Compute CLI or in the respective Profile activity option are automatically expanded to all first-level sub-metrics if required. See the documentation on --metrics for more details. Added new rules for detecting inefficiencies of using the sparse data compression on the NVIDIA Ampere architecture. The version of the NVIDIA Nsight Compute target collecting the results is shown in the Session page. Added new launch__grid_dim_[x,y,z] and launch__block_dim_[x,y,z] metrics. NVIDIA Nsight Compute The Break on API Error functionality has been improved when auto profiling. NVIDIA Nsight Compute CLI The full path to the report output file is printed after profiling. Added and corrected metrics in the nvprof Metric Comparison table. Resolved Issues Documented the breakdown: metrics prefix. Fixed handling of escaped domain delimiters in NVTX filter expressions. Fixed issues with the occupancy charts for small block sizes. Fixed an issue when choosing a default report page in the options dialog. Fixed that the scroll bar could overlap the content when exporting the report page as an image.", "keywords": []}, {"id": 268, "doc_id": 268, "filename": "ReleaseNotes/topics/updates-2020-1-2.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2020-1-2", "display_name": "Updates in 2020.1.2", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2020-1-2", "anchor": "", "priority": -1, "content": "General The NVIDIA Nsight Compute installer for Mac is now code-signed and notarized. Disabled the creation of the Python cache when executing rules to avoid permission issues and signing conflicts. Resolved Issues Fixed the launcher script of the NVIDIA Nsight Compute CLI to no longer fail if uname -p is not available. Fixed the API parameter capture for function cuDeviceGetLuid .", "keywords": []}, {"id": 269, "doc_id": 269, "filename": "ReleaseNotes/topics/updates-2020-2.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2020-2", "display_name": "Updates in 2020.2", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2020-2", "anchor": "", "priority": -1, "content": "General Added support for the NVIDIA Ampere GPUs with compute capability 8.6 and CUDA toolkit 11.1. Added support for application replay to collect metric results across multiple application runs, instead of replaying individual kernels. Added new launch__device_id metric. Added support for NVLink ( nvl* ) metrics for GPUs with compute capabilities 7.0, 7.5 and 8.0 Added documentation for memory charts and tables in the Profiling Guide . NVIDIA Nsight Compute Updated menu and toolbar layout. Added support for zoom and pan on roofline charts. The Resources tool window shows the current CUDA stream attributes. The memory chart shows a heatmap for link and port utilization. The hot-spot tables in the Source Counters section now show values as percentages, too. On-demand resolve of remote CUDA-C source is now available for MacOS hosts. Metric columns in the Summary and Raw pages are now sortable. Added a new option to set the number of recent API calls shown in the API Stream tool window. NVIDIA Nsight Compute CLI CLI output now shows NVTX payload information. CSV output now shows NVTX states. Added a new --replay-mode option to select the mechanism used for replaying a kernel launch multiple times. Added a new --kill option to terminate the application once all requested kernels were profiled. Added a new --log-file option to decide the output stream for printing tool output. Added a new --check-exit-code option to decide if the child application exit code should be checked. Resolved Issues The profiling progress dialog is not dismissed automatically anymore after an error. The inter-process lock is now automatically given write permissions for all users. All project extensions are enabled in the default dialog filter. Fixed handling of targets using tcsh during remote profiling. Fixed handling of quoted application arguments on Windows.", "keywords": []}, {"id": 270, "doc_id": 270, "filename": "ReleaseNotes/topics/updates-2020-2-1.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2020-2-1", "display_name": "Updates in 2020.2.1", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2020-2-1", "anchor": "", "priority": -1, "content": "Resolved Issues Fixed several issues related to auto-profiling in the UI. Fixed a metric collection issue when profiling kernels on different GPU architectures with application replay. Fixed a performance problem related to profiling large process trees. Fixed that occupancy charts would not render correctly when comparing against baselines. Fixed that no memory metrics were shown on the Source page for LDGSTS instructions. Fixed the automatic sorting on the Summary and Raw pages. Fixed an issue that would cause the NVIDIA Nsight Compute CLI to consume too much memory when importing or printing reports. Long kernel names are now elided in the Details page source hot spot tables. Fixed that function names in the Resources tool window were demangled differently.", "keywords": []}, {"id": 271, "doc_id": 271, "filename": "ReleaseNotes/topics/updates-2020-3.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2020-3", "display_name": "Updates in 2020.3", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2020-3", "anchor": "", "priority": -1, "content": "General Added support for derived metrics in section files. Derived metrics can be used to create new metrics based on existing metrics and constants. See the Customization Guide for details. Added a new Import Source ( --import-source ) option to the UI and command line to permanently import source files into the report, when available. Added a new section that shows selected NVLink metrics on supported systems. Added a new launch__func_cache_config metric to the Launch Statistics section. Added new branch efficiency metrics to the Source Counters section, including smsp__sass_average_branch_targets_threads_uniform.pct to replace nvprof\u2019s branch_efficiency , as well as instruction-level metrics smsp__branch_targets_threads_divergent , smsp__branch_targets_threads_uniform and branch_inst_executed . A warning is shown if kernel replay starts staging GPU memory to CPU memory or the file system. Section and rule files are deployed to a versioned directory in the user\u2019s home directory to allow easier editing of those files, and to prevent modifying the base installation. Removed support for NVLINK( nvl* ) metrics due to a potential application hang during data collection. The metrics will be added back in a future version of the driver/tool. NVIDIA Nsight Compute Added support for Profile Series . Series allow you to profile a kernel with a range of configurable parameters to analyze the performance of each combination. Added a new Allocations view to the Resources tool window which shows the state of all current memory allocations. Added a new Memory Pools view to the Resources tool window which shows the state of all current memory pools. Added coverage of peer memory to the Memory Chart . The Source page now shows the number of excessive sectors requested from L1 or L2, e.g. due to uncoalesced memory accesses. The Source column on the Source page can now be scrolled horizontally. The kernel duration gpu__time_duration.sum was added as column on the Summary page. Improved the performance of application replay when not all kernels in the application are profiled. NVIDIA Nsight Compute CLI Added a new --app-replay-match option to select the mechanism used for matching kernel instances across application replay passes. An error is shown if --nvtx-include/exclude are used without --nvtx . Resolved Issues The Grid Size column on the Raw page now shows the CUDA grid size like the Launch Statistics section, rather than the combined grid and block sizes. The Branch Resolving wap stall reason was added to the PC sampling metric groups and the Warp State Statistics section. The API Stream tool window shows kernel names according to the selected Function Name Mode. Fixed that an incorrect line could be shown after a heatmap selection on the Source page. Fixed incorrect metric usage for system memory in the Memory Chart . Previously, all requested memory of L2 from system memory was reported instead of only the portion that missed in L2.", "keywords": []}, {"id": 272, "doc_id": 272, "filename": "ReleaseNotes/topics/updates-2020-3-1.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2020-3-1", "display_name": "Updates in 2020.3.1", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2020-3-1", "anchor": "", "priority": -1, "content": "General Added support for LDSM instruction-level metrics. NVIDIA Nsight Compute LDSM instruction-level metrics are shown in the Source page and memory tables. Improved reporting and documentation for collecting Profile Series . Frozen columns in the Source page are automatically scrolled into view. Resolved Issues Fixed an issue when profiling multi-threaded applications. Fixed an issue that NVIDIA Nsight Compute would not automatically restart when using Reset Application Data . Fixed issues with target applications using libstdc++. Fixed an issue when collecting single-pass metrics in multiple Nsight Compute instances. Fixed an issue when using Kernel ID and setting Launch Capture Count as non-zero in the UI\u2019s Profile activity. Fixed an issue that prevented different users on the same Linux system to use NVIDIA Nsight Compute in shared instance mode. Fixed an issue that prevented resources from being properly renamed using NVTX information in the UI.", "keywords": []}, {"id": 273, "doc_id": 273, "filename": "ReleaseNotes/topics/updates-2021-1.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2021-1", "display_name": "Updates in 2021.1", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2021-1", "anchor": "", "priority": -1, "content": "General Added support for the CUDA toolkit 11.3. Added support for the OptiX 7 API . GpuArch enumeration values used for filtering in section files were renamed from architecture names to compute capabilities. NVTX states can now be accessed via the NvRules API . Added a rule for the Occupancy section. NVIDIA Nsight Compute Added support for new CUDA asynchronous allocator attributes in the Memory Pools resources view. Added a topology chart and link properties table in the NVLink section. The selected metric column is scrolled into view on the Source page when a new metric is selected. Users can choose the Source heatmap color scale in the Options dialog. NVIDIA Nsight Compute CLI Added file-based application replay as the new default application replay mode. File-based replay uses a temporary file for keeping replay data, instead of allocating them in memory. This keeps the required memory footprint close to constant, independent of the number of profiled kernels. Users can switch between buffer modes using the --app-replay-buffer option. CLI output now shows NVTX color and message information. --kernel-regex and --kernel-regex-base> options are deprecated and replaced by --kernel-name and --kernel-regex-base , respectively. All options which support regex need to provide regex: as a prefix before an argument to match per the regex, e.g <option> <regex:expression> Resolved Issues Fixed that baselines were not updated properly on the Comments page. Fixed that NVTX ranges named using their payloads can be used in NVTX filtering expressions. Fixed crashes in MacOSX hosts when terminating the target application. The NVLINK( nvl* ) metrics are now added back.", "keywords": []}, {"id": 274, "doc_id": 274, "filename": "ReleaseNotes/topics/updates-2021-1-1.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2021-1-1", "display_name": "Updates in 2021.1.1", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2021-1-1", "anchor": "", "priority": -1, "content": "General Updated OpenSSL library to version 1.1.1k. NVIDIA Nsight Compute Remote source resolution can now use the IP address, in addition to the hostname, to find the necessary SSH target. NVIDIA Nsight Compute CLI Added support for the existing command line options for kernel filtering while importing data from an existing report file using --import . Option -k is not considered as deprecated option --kernel-regex anymore. Resolved Issues Fixed failure to profile kernels from applications that use the CUDA graphics interop APIs to share semaphores. Fixed wavefront metric in the L1TEX table for writes to shared memory on GA10x chips. Fixed an issue resulting in incomplete data collection for the interactive profile activity after switching from single-pass mode to collecting multiple passes in the same session. Fixed values shown in the mimimap of the Source page when all functions are collapsed. Fixed an issue causing names set by the NVTX naming APIs of one application to be applied to all subsequent sessions of the same instance of NVIDIA Nsight Compute. Fixed behavior of horizontal scroll bars when clicking in the source views on the Source page. Fixed appearance of multi-line entries in column chooser on the Source page. Fixed enablement state of the reset button on the Connection dialog. Fixed potential crash of NVIDIA Nsight Compute when windows size becomes small while being on the Source page. Fixed potential crash of NVIDIA Nsight Compute when relative paths for section/rules files could not be found. Fixed potential crash of NVIDIA Nsight Compute after removing baselines.", "keywords": []}, {"id": 275, "doc_id": 275, "filename": "ReleaseNotes/topics/updates-2021-2.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2021-2", "display_name": "Updates in 2021.2", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2021-2", "anchor": "", "priority": -1, "content": "General Added support for the CUDA toolkit 11.4. Added support for OptiX version 7.3. Added support for profiling on NVIDIA virtual GPUs (vGPUs) on an upcoming GRID/vGPU release. Added a new Python-based report interface for interacting with report files from Python scripts. Added a new rule to warn users when sampling metrics were selected, but no sampling data was collected. Renamed SOL to Throughput in the Speed of Light section. Renamed several memory_* metrics used on the Source page, to better reflect the measured value. See the Source page documentation for more details. NVIDIA Nsight Compute Added support for opening cubin files in a Standalone Source Viewer without profiling the application. Moved the output of all rules so that it is visible even if a section\u2019s body is collapsed. Visibility of the rules\u2019 output can be toggled by a new button in the report header. The profiler report header now shows the report name for each baseline when ambiguous. Rules can define Focused Metrics that were most important for triggering their result output. Metrics are provided per result message which additional information, such as the underlying conditions and thresholds. Memory tables show tooltips for cells with derived metric calculations. Added a knowledge base service to show more comprehensive background information on metric names and descriptions in their tooltips. Following a link in the Source Counters hot spot tables automatically selects the corresponding metric in the Source page. Added new columns for visualizing register dependencies in the SASS view of the Source page . Functions in the SASS view are now sorted by name. Added support for OptiX 7.x resource tracking in the interactive profile activity. The Resources tool window will show information on instantiated optixDeviceContexts, optixModules, optixProgramGroups, optixPipelines and optixDenoiser objects. Added support for new CUDA graph memory allocation APIs. Improved consistency between command line parameters and the Next Trigger filter in the API Stream window for handling of regex inputs. The Next Trigger filter now considers kernel/API name as a regular expression only if string has regex: as prefix. Added ability to select font settings in the options dialog. Added ability to configure the metrics shown on the summary page via the options dialog. The selected heatmap color scale now also applies to the Memory chart . The ncu-ui script now checks for missing library dependencies, such as OpenGL or Qt . NVIDIA Nsight Compute CLI Added environment variable NV_COMPUTE_PROFILER_DISABLE_STOCK_FILE_DEPLOYMENT=1 to skip deployment of section and rule files. Resolved Issues Fixed a performance issue in the NVIDIA Nsight Compute CLI when using --page raw --csv --units auto . Fixed that the SSH passphase key is no longer persisted in the project file. Fixed state of restore button in connection dialog. The button now supports restoring the default settings, if current setting differ from the default. Fixed that the complete GPU name can be shown in the NVLINK topology diagram on MacOS. Fixed that collapsing the Source view reset the selected metrics. Fixed that correlated lines could differ between filtered and unfiltered views of the executed functions. Fixed that two application icons were shown in the MacOS dock. Improved HiDPI awareness.", "keywords": []}, {"id": 276, "doc_id": 276, "filename": "ReleaseNotes/topics/updates-2021-2-1.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2021-2-1", "display_name": "Updates in 2021.2.1", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2021-2-1", "anchor": "", "priority": -1, "content": "General Reduced the memory overhead when loading reports in the Python Report Interface . Resolved Issues Fixed that links in the Memory Allocations Resource view were not working correctly. Fixed that NVTX state might not be correctly reset between interactive profiling activities. Fixed that the UI could crash when opening baselines from different GPU architectures.", "keywords": []}, {"id": 277, "doc_id": 277, "filename": "ReleaseNotes/topics/updates-2021-2-2.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2021-2-2", "display_name": "Updates in 2021.2.2", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2021-2-2", "anchor": "", "priority": -1, "content": "General Changes for profiling support on NVIDIA virtual GPUs (vGPUs) for an upcoming GRID/vGPU release. Resolved Issues Fixed hang issue on QNX when using the --target-processes all option while profiling shell scripts.", "keywords": []}, {"id": 278, "doc_id": 278, "filename": "ReleaseNotes/topics/updates-2021-2-3.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2021-2-3", "display_name": "Updates in 2021.2.3", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2021-2-3", "anchor": "", "priority": -1, "content": "General Added support for the NVIDIA GA10b chip. Resolved Issues Improved error message on QNX for failure to deploy stock section and rules files.", "keywords": []}, {"id": 279, "doc_id": 279, "filename": "ReleaseNotes/topics/updates-2021-2-4.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2021-2-4", "display_name": "Updates in 2021.2.4", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2021-2-4", "anchor": "", "priority": -1, "content": "Resolved Issues Fixed an issue that prevented remote interactive profiling of kernels on NVIDIA GA10b chips.", "keywords": []}, {"id": 280, "doc_id": 280, "filename": "ReleaseNotes/topics/updates-2021-2-5.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2021-2-5", "display_name": "Updates in 2021.2.5", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2021-2-5", "anchor": "", "priority": -1, "content": "Resolved Issues Improve the handling of the performance monitor reservation on mobile target GPUs.", "keywords": []}, {"id": 281, "doc_id": 281, "filename": "ReleaseNotes/topics/updates-2021-2-6.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2021-2-6", "display_name": "Updates in 2021.2.6", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2021-2-6", "anchor": "", "priority": -1, "content": "Resolved Issues Fixed an issue causing a hang on QNX after pressing ctrl+c while profiling a multi-process application.", "keywords": []}, {"id": 282, "doc_id": 282, "filename": "ReleaseNotes/topics/updates-2021-2-7.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2021-2-7", "display_name": "Updates in 2021.2.7", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2021-2-7", "anchor": "", "priority": -1, "content": "General Enabled stack canaries with random canary values for L4T builds.", "keywords": []}, {"id": 283, "doc_id": 283, "filename": "ReleaseNotes/topics/updates-2021-2-8.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2021-2-8", "display_name": "Updates in 2021.2.8", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2021-2-8", "anchor": "", "priority": -1, "content": "General Updated Python libraries to version 3.10.5.", "keywords": []}, {"id": 284, "doc_id": 284, "filename": "ReleaseNotes/topics/updates-2021-2-9.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2021-2-9", "display_name": "Updates in 2021.2.9", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2021-2-9", "anchor": "", "priority": -1, "content": "NVIDIA Nsight Compute Clarify when not all metrics for the roofline chart could be collected on the current chip.", "keywords": []}, {"id": 285, "doc_id": 285, "filename": "ReleaseNotes/topics/updates-2021-3.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2021-3", "display_name": "Updates in 2021.3", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2021-3", "anchor": "", "priority": -1, "content": "General Added support for the CUDA toolkit 11.5. Added a new rule for detecting inefficient memory access patterns in the L1TEX cache and L2 cache. Added a new rule for detecting high usage of system or peer memory. Added new IAction::sass_by_pc function to the the NvRules API . The Python-based report interface is now available for Windows and MacOS hosts, too. Added Hierarchical Roofline section files in a new \u201croofline\u201d section set. Added support for collecting CPU call stack information. NVIDIA Nsight Compute Added support for new remote profiling SSH connection and authentication options as well as local SSH configuration files. Added an Occupancy Calculator which can be opened directly from a profile report or as a new activity. It offers feature parity to the CUDA Occupancy Calculator spreadsheet . Added new Baselines tool window to manage (hide, update, re-order, save/load) baseline selections. The Source page views now support multi-line/cell selection and copy/paste. Different colors are used for highlighting selections and correlated lines. The search edit on the Source page now supports Shift+Enter to search in reverse direction. The Memory Workload Analysis Chart can be configured to show throughput values instead of transferred bytes. The Profile activity now supports the --devices option. The NVLink Topology diagram displays per NVLink metrics. Added a new tool window showing the CPU call stack at the location where the current thread was suspended during interactive profiling activities. If enabled, the Call Stack / NVTX page of the profile report shows the captured CPU call stack for the selected kernel launch. NVIDIA Nsight Compute CLI Added support for printing source/metric content with the new --page source and --print-source command line options . Added new option --call-stack to enable collecting the CPU call stack for every profiled kernel launch. Resolved Issues Fixed that memory_* metrics could not be collected with the --metrics option. Fixed that selection and copy/paste was not supported for section header tables on the Details page. Fixed issues with the Source page when collapsing the content. Fixed that the UI could crash when applying rules to a new profile result. Fixed that PC Sampling metrics were not available for Profile Series . Fixed that local profiling did not work if no non-loopback address was configured for the system. Fixed termination of remote-launched applications. On QNX, terminating an application profiled via Remote Launch is now supported. Canceling remote-launched Profile activities is now supported.", "keywords": []}, {"id": 286, "doc_id": 286, "filename": "ReleaseNotes/topics/updates-2021-3-1.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2021-3-1", "display_name": "Updates in 2021.3.1", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2021-3-1", "anchor": "", "priority": -1, "content": "Resolved Issues Fixed that kernels with the same name and launch configuration were in some scenarios associated with the wrong profiling results during application replay. Fixed an issue with binary forward compatibility of the report format. Fixed an issue with applications calling into the CUDA API during process teardown. Fixed an issue profiling application using pre-CUDA API 3.1 contexts. Fixed a crash when resolving files on the Source page. Fixed that opening reports with large embedded CUBINs would hang the UI. Fixed an issue with remote profiling on a target where the UI is already launched.", "keywords": []}, {"id": 287, "doc_id": 287, "filename": "ReleaseNotes/topics/updates-2022-1.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2022-1", "display_name": "Updates in 2022.1", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2022-1", "anchor": "", "priority": -1, "content": "General Added support for the CUDA toolkit 11.6. Added support for GA103 chips. Added a new Range Replay mode to profile ranges of multiple, concurrent kernels. Range replay is available in the NVIDIA Nsight Compute CLI and the non-interactive Profile activity. Added a new rule to detect non-fused floating-point instructions. The Uncoalesced Memory access rules now show results in a dynamic table. Unix Domain Sockets and Windows Named Pipes are used for local connection between the host and target processes on x86_64 Linux and Windows, respectively. The NvRules API now supports querying action names using different function name bases (e.g. demangled). NVIDIA Nsight Compute The default report page is now chosen automatically when opening a report. Added coverage for ECC (Error Correction Code) operations in the L2 Cache table of the Memory Analysis section. Added a new L2 Evict Policies table to the Memory Analysis section. The Occupancy Calculator now updates automatically when the input changes. Added new metric Thread Instructions Executed to the Source page. Added tooltips to the Register Dependency columns in the Source page to identify the associated register more conveniently. Improved the selection of Sections and Sets in the Profile activity connection dialog. NVLink utilization is shown in the NVLink Tables section. NVLink links are colored according to the measured throughput. NVIDIA Nsight Compute CLI --kernel-regex and --kernel-regex-base options are no longer supported. Alternate options are --kernel-name and --kernel-name-base respectively, added in 2021.1.0. Added support to resolve CUDA source files in the --page source output with the new --resolve-source-file command line option . Added new option --target-processes-filter to filter the processes being profiled by name. The CPU Stack Trace is shown in the NVIDIA Nsight Compute CLI output. Resolved Issues Fixed the calculation of aggregated average instruction execution metrics in non-SASS views on the Source page. Fixed that atomic instructions are counted as both loads and stores in the Memory Analysis tables.", "keywords": []}, {"id": 288, "doc_id": 288, "filename": "ReleaseNotes/topics/updates-2022-1-1.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2022-1-1", "display_name": "Updates in 2022.1.1", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2022-1-1", "anchor": "", "priority": -1, "content": "General Filtering kernel launches or profile results based on NVTX domains/ranges now takes registered strings in the payload field into account, if the range name is empty. Added support for the suffix .max_rate for ratio metrics. Resolved Issues Fixed a crash during the disassembly of the kernel\u2019s SASS code for the Source page. Fixed a crash on exit of the NVIDIA Nsight Compute UI. Fixed a hang during profiling when CPU call stack collection is enabled. Fixed missing to flush UVM buffers before taking memory checkpoints during Range Replay . Fixed tracking of memory during Range Replay , if the CUDA context has any device mapped memory allocations. Fixed the maximum available shared memory sizes in the Occupancy Calculator for NVIDIA Ampere GPUs. Fixed that the shared memory usage of the kernel is incorrectly initialized when opening the Occupancy Calculator from a profile report.", "keywords": []}, {"id": 289, "doc_id": 289, "filename": "ReleaseNotes/topics/updates-2022-2.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2022-2", "display_name": "Updates in 2022.2", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2022-2", "anchor": "", "priority": -1, "content": "General Added support for the CUDA toolkit 11.7. Improved performance for profiling and metric query. Added Linux (aarch64 sbsa) as a supported host platform . The NVIDIA Nsight Compute CLI stores the command line arguments, which can be viewed in the Session report page. Added an API to query the version of the Python Report and NvRules interfaces. Added an API to query the PTX in the Python Report and NvRules interfaces. NVIDIA Nsight Compute The Acceleration Structure Viewer allows inspection of acceleration structures built using the OptiX API for debugging and performance optimization. The Source page column chooser now supports to enable or disable groups of metrics. Note that not all metrics are enabled anymore by default to make the view easier to use. The Resources tool window now links to the exact target resource instances for CUDA resource types. The Resources tool window now shows the instanced nodes for CUDA graphs. The Resources tool window now shows the loading state and number of loaded functions for CUDA Modules . The Resources tool window now shows the graph node enablement state for applicable instanced graph nodes. The Resources tool window now shows the graph node priorities for instanced kernel graph nodes. Added regex support in the Next Trigger filter for NVTX based filtering. The Next Trigger filter now considers the NVTX config as a regular expression if the regex: prefix is specified. Added regex support in the report\u2019s Filter Results dialog. Added keyboard shortcuts to navigate between the pages in a report. The behavior for selecting sets and sections is now consistent between the Sections/Rules Info window and the non-interactive profile activity . Reports can now be opened directly from the welcome dialog. NVIDIA Nsight Compute CLI Added support for collecting sampling-based warp stalls in range replay mode. Added regex support in NVTX filtering . The metric type is shown when querying metrics. Resolved Issues Reduced overhead of connecting to the host UI for non-interactive remote profiling sessions. Fixed issues with persisting the Source page state when collapsing or switching between results. Fixed an issue that locked GPU clocks were not reset when terminating the NVIDIA Nsight Compute CLI while profiling a kernel. Fixed issues with selecting and copying text from the Details page tables. Fixed an issue with opening report files in the UI on MacOSX. Fixed an issue with the Freeze API option.", "keywords": []}, {"id": 290, "doc_id": 290, "filename": "ReleaseNotes/topics/updates-2022-2-1.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2022-2-1", "display_name": "Updates in 2022.2.1", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2022-2-1", "anchor": "", "priority": -1, "content": "Resolved Issues Fixed an issue that caused some tootips to not show up for the charts on the Details page. Fixed the incorrect reporting of the accessed bytes for LDGSTS (access) traffic in the L1TEX memory table. Fixed an issue that resulted in an empty view on the Source page after resolving multiple source files at once. Fixed a failure to connect to remote machines over SSH due to a mismatch in the configuration of data compression. Fixed a potential failure to profile kernels on multiple devices of the same type of chip. The failure occurred on the attempt to profile on the second device.", "keywords": []}, {"id": 291, "doc_id": 291, "filename": "ReleaseNotes/topics/updates-2022-3.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2022-3", "display_name": "Updates in 2022.3", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2022-3", "anchor": "", "priority": -1, "content": "General Added support for the CUDA toolkit 11.8. Added support for the Ada GPU architecture. Added support for the Hopper GPU architecture. Added support for OptiX 7.6 . Added uncoalescedGlobalAccesses sample CUDA application and document to show how the NVIDIA Nsight Compute profiler can be used to analyze and identify the memory accesses which are uncoalesced and result in inefficient DRAM accesses. Refer to the README, sample code and document under extras/samples/uncoalescedGlobalAccesses . Added Metrics Reference in the documentation that lists metrics not available through --query-metrics . Reduced the overhead of collecting SASS-patching based metrics. On Multi-Instance GPU (MIG) configurations, NVIDIA Nsight Compute cannot lock clocks anymore. Users are expected to lock clocks externally using nvidia-smi. NVIDIA Nsight Compute Wrapper script nv-nsight-cu is deprecated in favor of ncu-ui and will be removed in a future release. Source page supports range replay results. Added a second chart on the Compute Workload Analysis section to avoid mixing metrics with different meaning. NVIDIA Nsight Compute now tracks traversable handles created with optixAccelRelocate . NVIDIA Nsight Compute now tracks traversable handles created as updates from others. The Acceleration Structure viewer now reports unsupported inputs. The Acceleration Structure viewer now supports opening multiple traversable handles. The Acceleration Structure viewer now uses OptiX naming for displayed elements. NVIDIA Nsight Compute CLI Wrapper script nv-nsight-cu-cli is deprecated in favor of ncu and will be removed in a future release. Added new option --filter-mode per-gpu to enable filtering of kernel launches on each GPU separately. Added new option --app-replay-mode relaxed to produce profiling results for valid kernels even if the number of kernel launches is inconsistent across application replay passes. Added a documentation section on supported environment variables . Improved the performance when loading existing reports on the command line. Resolved Issues Fixed an issue when resolving files on the Source page. Fixed an issue when profiling OptiX applications. Fixed an issue in the OptiX traversable handle management caused by clashing handle values. Fixed an issue in the Acceleration Structure viewer causing the display of invalid memory when viewing AABB buffers.", "keywords": []}, {"id": 292, "doc_id": 292, "filename": "ReleaseNotes/topics/updates-2022-4.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2022-4", "display_name": "Updates in 2022.4", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2022-4", "anchor": "", "priority": -1, "content": "General Added support for the CUDA toolkit 12.0. Added support for profiling CUDA graphs as complete workloads instead of as single kernel nodes. Enable this using the Graph Profiling option in the activities . Similarly to range replay results, selected metrics are not available when profiling graphs. Added support for profiling on Windows Subsystem for Linux (WSL2). See the System Requirements for more details. Deprecated nv-nsight-cu and nv-nsight-cu-cli aliases are removed in favor of ncu-ui and ncu . NVIDIA Nsight Compute The Source page now loads disassembly and static analysis results asynchronously in the background. Added a new Metric Details tool window to inspect metric information such as raw value, unit, description or instance values. Open the tool window and select a metric on the Details or Raw page or lookup any metric in the focused report directly in the tool window\u2019s search bar. In the Source page PTX view, the source name will be shown as a list of comma-separated files. Added flexibility with NVTX based filtering in the Next Trigger filter, similar to the command line. Filters can now use nvtx-include and nvtx-exclude expressions by adding the nvtx-include: or nvtx-exclude: prefix. NVTX views now show the payload type. Simplified the command line generated by the Profile activity . Reduced the number of steps required to re-run the Profile activity . The way to rename Baselines in-place has been improved. The Resources tool window now shows the CUDA Dynamic Parallelism state for CUDA functions and modules. OptiX traversable handles can now be exported as Graphviz DOT or SVG files for visualization from the Resources tool window. All OptiX build, instance and geometry flags can be viewed in the Acceleration Structure Viewer . Added OptiX-specific highlight filters to the Acceleration Structure Viewer. Added support for user-specified index strides to the Acceleration Structure Viewer. NVIDIA Nsight Compute CLI Added new option --graph-profiling graph to enable profiling of complete CUDA graphs as single workloads. Added new option --filter-mode per-launch-config to enable filtering of kernel launches for each GPU launch parameter separately. Added support to print section body item metrics on the details page with the new --print-details command line option . Added support to select what to show in Metric Name column on the details page with the new --print-metric-name command line option . Removed deprecated options: --units , --fp , --summary and --kernel-base Added support to print launch, session, process and device attributes on session page with the new --page session option. Added --kill yes support for application replay mode. Resolved Issues Fixed an issue that NVIDIA Nsight Compute could crash when continuing profiling after transposing the Raw page table. Fixed an issue that caused closing a report document to be delayed by pending source analysis. Fixed support for profiling applications with older OptiX versions. Fixed display of OptiX module inputs for IR and built-in modules.", "keywords": []}, {"id": 293, "doc_id": 293, "filename": "ReleaseNotes/topics/updates-2022-4-1.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2022-4-1", "display_name": "Updates in 2022.4.1", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2022-4-1", "anchor": "", "priority": -1, "content": "General Improved the documentation for the NvRules API. The python report interface links libstdc++ statically. Resolved Issues Fixed an issue that enabled profiling on CUDA Graph uploads. Fixed formatting issues during unit conversion of metric instances. Fixed an issue that could lead to a crash during application replay. Fixed an issue that could lead to a crash in the python report interface. Fixed typos in the metrics reference documentation and descriptions.", "keywords": []}, {"id": 294, "doc_id": 294, "filename": "ReleaseNotes/topics/updates-2023-1.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2023-1", "display_name": "Updates in 2023.1", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2023-1", "anchor": "", "priority": -1, "content": "General Added support for the CUDA toolkit 12.1. Added a new app-range replay mode to profile ranges without API capture by relaunching the entire application multiple times. Added sharedBankConflicts sample CUDA application and document to show how NVIDIA Nsight Compute can be used to analyze and identify the shared memory bank conflicts which result in inefficient shared memory accesses. Refer to the README.TXT file, sample code and document under extras/samples/sharedBankConflicts . Jupyter notebook samples are available in the Nsight training github repository . The equivalent of the high-level Python report interface is now available in rule files. NVIDIA Nsight Compute Added support for profiling individual metrics in Interactive Profile activity . A new input field for metrics was added in the Metric Selection tool window. Files on remote systems can be opened directly from the menu . Metric- and section-related entries in the menu, Profile activity and Metric Selection tool window were renamed to make them more clear. CPU and GPU NUMA topology metrics can be collected on applicable systems. Topology information is shown in a new NUMA Affinity section . Added content-aware suggestions to the Details page to provide suggestions based on the selected profiling options. Added support for re-resolving source files on the Source page. Not-issued warp stall reasons are removed from the Source Counters section tables and hidden by default on the Source page. Users should focus on regular warp stall reasons by default and only inspect not-issued samples if this distinction is needed. Added support to search missing CUDA source files to permanently import into the report using Source Lookup options in the Interactive Profile activity . The source page now shows metric values as percentages by default. New buttons are added to support switching between different value modes. NVIDIA Nsight Compute CLI Added support for config files in the current working or user directory to set default ncu parameters. See the General options for more details. Added --range-filter command line option which allows to select subset of enabled profile ranges. Added new --source-folders command line option that allows to recursively search for missing CUDA source files to permanently import into the report. Resolved Issues Fixed performance issues on the Summary and Raw pages for large reports. Improved support for non-ASCII characters in filenames. Fixed an issue with delayed updates of assembly analysis information on the Source page\u2019s Source and PTX views. Fixed potential crashes when using the Python report interface.", "keywords": []}, {"id": 295, "doc_id": 295, "filename": "ReleaseNotes/topics/updates-2023-1-1.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2023-1-1", "display_name": "Updates in 2023.1.1", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2023-1-1", "anchor": "", "priority": -1, "content": "NVIDIA Nsight Compute Added new configuration options to set the default view mode and precision for the Source page. Resolved Issues Added support for the DT_RUNPATH attribute when intercepting calls to dlopen . Fixed issue for applications or libraries relying on DT_RUNPATH not finding all dynamic libraries when launched by NVIDIA Nsight Compute. Improved interaction between custom additional metrics and the selected metric set. Adding custom metrics no longer forces switching to the custom metric set. Added ability to gracefully skip folders with insufficient access permissions while importing source code. Fixed the calculation of the peak values for the L1 and L2 cache bandwidths in the hierarchical roofline charts. Fixed issue that prevented modules loaded with function optixModuleCreateFromPTX showing up in the Optix: Modules table of the Resources tool window. Fixed handling of deprecated functions when querying function pointers from the OptiX interception library. Fixed that sometimes sections or rules couldn\u2019t be easily selected in the tool window. Fixed issue with Reset Application Data that prevented some setting from correctly resetting. Fixed potential crash of NVIDIA Nsight Compute when Reset Application Data was executed multiple times in a row. Fixed a crash when saving or loading baselines for non-kernel results. Fixed that memory written while executing a CUDA graph was not properly restored in single-pass graph profiling. Fixed potential memory leak while collecting SW counters for modules with unpatched kernel functions.", "keywords": []}, {"id": 296, "doc_id": 296, "filename": "ReleaseNotes/topics/updates-2023-2.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2023-2", "display_name": "Updates in 2023.2", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2023-2", "anchor": "", "priority": -1, "content": "General Extended the rules system to show estimates of the potential speedup that can be achieved by addressing the corresponding performance bottleneck. These speedups allow prioritizing applicable rules and help focusing first on optimization strategies with the highest potential performance gain. Added support for rules to highlight individual source lines. Lines with global/local memory access with high excessive sector counts and shared accesses with many bank conflicts are automatically detected and highlighted. Added the ability to query metric attributes in NvRules API. Added support for creating instanced metrics through the NvRules API. For Orin+ mobile chips on the Linux aarch64 platform, added metrics ( mcc__* ) support for memory controller channel (MC Channel) unit which connects to the DRAM. NVIDIA Nsight Compute Added hyperlinks to the SASS View of the Source Page for instructions that reference others by address or offset. This enables to quickly jump to the target instruction of a branch. Improved the search bar in the Metric Details tool window. The search string now matches any part of the metric names, and the matching results are shown in a sorted order. Added a visual indication of scale of the metric value changes when the baselines are used. The background bars in the table cells of the Details Page allow to quickly identify which metrics values increased or decreased the most. The color scheme can be configured in the Baselines tool window . Added support for rules toggle button on the Summary Page. Allows to hide the bottom pane with the rules output for the selected kernel launch. Added support for allowing users to configure properties on Summary Page using Metrics/Properties profile option . Added percentage bars on Summary Page . NVIDIA Nsight Compute CLI Added support for tracking child processes launched with posix_spawn(p) when using --target-processes all . Added support for tracking child processes launched with system() on Windows and Linux (aarch64, x86_64) when using --target-processes all . Resolved Issues Fixed table alignment in the output of the NVIDIA Nsight Compute CLI on Windows when printing Unicode characters. Fixed view corruption in the Source Page after switching from the collapsed view to the expanded view. Fixed missing tooltip descriptions for some SASS instructions. Fixed potential crash when copying from the Resources tool window using CTRL+C. Fixed possible crash when restoring sections in the Sections tool window.", "keywords": []}, {"id": 297, "doc_id": 297, "filename": "ReleaseNotes/topics/updates-2023-2-1.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2023-2-1", "display_name": "Updates in 2023.2.1", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2023-2-1", "anchor": "", "priority": -1, "content": "Resolved Issues Fixed a crash during application replay while having the temporary directory located on a network file system (NFS). Improved detection mechanism for C2C interface. Added caching of the detected configuration to reduce overhead.", "keywords": []}, {"id": 298, "doc_id": 298, "filename": "ReleaseNotes/topics/updates-2023-2-2.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2023-2-2", "display_name": "Updates in 2023.2.2", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2023-2-2", "anchor": "", "priority": -1, "content": "Resolved Issues Fixed possible crash when profiling CUDA graphs on multiple GPUs. Fixed the detection mechanism of the C2C interface, i.e. metric c2clink__present . The fix requires the display driver shipping with this release or any newer driver.", "keywords": []}, {"id": 299, "doc_id": 299, "filename": "ReleaseNotes/topics/updates-2023-3.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2023-3", "display_name": "Updates in 2023.3", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2023-3", "anchor": "", "priority": -1, "content": "General NVIDIA Nsight Compute now supports collecting many metrics by sampling the GPU\u2019s performance monitors (PM) periodically at fixed intervals. The results can be visualized on a timeline . Added WSL profiling support on Windows 10 WSL with OS build version 19044 and greater. WSL profiling is not supported on Windows 10 WSL for systems that exceed 1 TB of system memory. Rule outputs are prioritized to improve the accuracy of estimated speedups. The Summary page now shows the most actionable optimization advices when a result row is selected. Improved the handling and reporting for unavailable metrics during collection and when applying rules. Added instructionMix sample CUDA application and document to show how to use NVIDIA Nsight Compute to analyze and identify the performance bottleneck due to an imbalanced instruction mix. Refer to the README.TXT file, sample code, and document under extras/samples/instructionMix . NVIDIA Nsight Compute Added support to see the source files of two profile results side by side using Source Comparison . This allows you to quickly identify source differences and understand changes in metric values. The Summary page is now the default page when a report is opened. Previous behavior can be enabled in the options dialog. On the Summary and Raw pages, values from all/selected rows are automatically aggregated in the column header for applicable metrics. Selected individual cells are aggregated in the bottom status bar. Added Launch Name and Device options in the filter dialog launched by Apply Filters button in the report header . Added support for source view profiles that persist the Source page configuration and allow you to re-apply it to other reports. The Metric Details tool window now supports querying metrics beyond the current report by using the chip:<chipname> tag in the search. Added support for CUDA Graph Edge Data (such as port and dependency type) and CUDA Graph Conditional Handles in the Resources tool window. The Acceleration Structure Viewer and Resources tool window now support OptiX Opacity Micromaps. NVIDIA Nsight Compute CLI Tracking and profiling all child processes ( --target-processes all ) is now the default for ncu. Improved reporting of requested but unavailable metrics. Metrics requested in section files are by default considered optional and only cause a warning to be shown. Resolved Issues Support for tracking child processes launched with system() is available on Linux ppc64le. Improved the behavior of following SASS navigation links on the Source page. Fixed issues with profiling CUDA graphs in graph-profiling mode when nodes are associated with a non-current CUDA context. Fixed an issue in L2 bandwidth calculations in the hierarchical roofline sections.", "keywords": []}, {"id": 300, "doc_id": 300, "filename": "ReleaseNotes/topics/updates-2023-3-1.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2023-3-1", "display_name": "Updates in 2023.3.1", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2023-3-1", "anchor": "", "priority": -1, "content": "General Switched to using OpenSSL version 1.1.1w. Improved the speedup estimates for rule IssueSlotUtilization as well as its child rules. Updated report files and documentation for the samples located at extras/samples/ . Resolved Issues Fixed collection of context switch data during PM Sampling when using Range Replay . Fixed potential crash of NVIDIA Nsight Compute when an invalid regular expression was provided as requested metric. Improved the performance of NVIDIA Nsight Compute in cases where only a single process is being profiled and --target-processes all was specified. Fixed an issue of reporting too high register counts on the Source Page. Fixed a bug that could cause a GPU fault while collecting SW counters through PerfWorks. Fixed showing incorrect baseline values for the Runtime Improvement values on the Summary Page.", "keywords": []}, {"id": 301, "doc_id": 301, "filename": "ReleaseNotes/topics/updates-2024-1.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2024-1", "display_name": "Updates in 2024.1", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2024-1", "anchor": "", "priority": -1, "content": "General Switched to using OpenSSL version 3.0.10. Added new metrics available when profiling on CUDA Green Contexts. Reduced the number of passes required for collecting PM sampling sections. Counter domains can now be specified for PM sampling metrics in section files. PM sampling metrics can now be queried in the command line and Metric Details window by specifying the respective collection option. Added a new optional PmSampling_WarpStates section for understanding warp stall reasons over the workload duration. Added a new rule for detecting load imbalances. Improved the performance of graph-level profiling on new drivers. Updated the metrics compatibility table for OptiX cmdlists and instruction-level SASS metrics. NVIDIA Nsight Compute Added SASS view and Source Markers support in Source Comparison . Improved Source Comparison diff visualization by adding empty lines on other side of inserted/deleted lines. The Source page column chooser can now be opened directly from the Navigation drop down. Added a Launch Details tool window for showing information about individual launches within larger workloads like OptiX command lists. Added support for CUDA Green Contexts in the Resources tool window, the Launch Statistics section and the report header. NVIDIA Nsight Compute CLI Improved documentation on NVTX expressions and command line output when a potentially incorrect expression led to no workloads being profiled. Improved checking for invalid expressions when using the --target-processes-filer option. Resolved Issues Fixed that the L1 cache achieved roofline value was missing when profiling on GH100. Fixed several \u201cLaunch Failed\u201d errors when collecting instruction-level SASS metrics. Fixed that Live Register values would be too high for some workloads. Fixed a scrolling issue on the Source page when collapsing a multi-file view. Fixed an issue that no PM sampling data would be shown in the timeline when context switch trace was not available. Fixed a display issue in the memory chart when adding baselines. Fixed a crash when adding baselines. Fixed a crash in timeline views when not all configured data was available. Fixed that the application history was not always deleted when selecting Reset Application Data. Fixed an error in the metric compatibility documentation.", "keywords": []}, {"id": 302, "doc_id": 302, "filename": "ReleaseNotes/topics/updates-2024-1-1.html", "domain_name": "std", "name": "ReleaseNotes/topics/updates-2024-1-1", "display_name": "Updates in 2024.1.1", "type": "doc", "display_type": "Page", "docname": "ReleaseNotes/topics/updates-2024-1-1", "anchor": "", "priority": -1, "content": "General Added clarification that for profiling a range with multiple, active CUDA Green Contexts, counter values that are not attributable to SMs will be aggregated over all these Green Contexts. Resolved Issues Changed the way the PerfWorks library is loaded into the target application\u2019s process space. This addresses possible connection errors in case the library search path includes other directories with PerfWorks libraries. Fixed an issue that caused PM sampling data to be missing from the results of a Profile Series. Fixed the incorrect calculation of the percentage values in the Inline Function table. Fixed a potential crash of the NVIDIA Nsight Compute UI when PM sampling data was requested, but no sample was collected.", "keywords": []}, {"id": 303, "doc_id": 305, "filename": "Training/index.html", "domain_name": "page", "name": "Training/index#external-resources", "display_name": "External Resources", "type": "section", "display_type": "Page section", "docname": "Training/index", "anchor": "external-resources", "priority": -1, "content": "Forum DevTalk Nsight Compute Forum Blogs Check the current list of blog posts Videos Check the current list of training videos Code Examples Have a look at our coding examples on GitHub", "keywords": []}, {"id": 304, "doc_id": 305, "filename": "Training/index.html", "domain_name": "page", "name": "Training/index#filter-options", "display_name": "Filter Options", "type": "section", "display_type": "Page section", "docname": "Training/index", "anchor": "filter-options", "priority": -1, "content": "Note that examples will use the term workload to refer to either kernels, graphs, ranges or cmdlists unless stated otherwise. Profile first two workloads --launch-count 2 Profile first two workloads launched on device with device ID 1 --device 1 --launch-count 2 Profile 2nd workload on each gpu --launch-skip 1 --launch-count 1 --filter-mode per-gpu Skip first 2 workloads of each launch configuration before profiling --launch-skip 2 --filter-mode per-launch-config Profile \u201cBar\u201d kernel --kernel-name Bar Profile kernels which have \u201cBar\u201d in function name --kernel-name regex:Bar Profile only 2nd invocation of kernel \u201cFoo\u201d --kernel-id ::Foo:2 Profile only 2nd invocation of all kernels which have \u201cBar\u201d in name --kernel-id ::regex:Bar:2 Skip first 2 workloads before matching \u201cFoo\u201d or \u201cBar\u201d in kernel names --launch-skip-before-match 2 --kernel-name regex:\u201cFoo|Bar\u201d Profile all 7th kernel invocations with mangled name \u201c_FooBar\u201d on CUDA context ID 1 and stream ID 2 --kernel-id 1:2:_Foobar:7 --kernel-name-base mangled Profile all workloads launched in first 3 cu(da)ProfilerStart/Stop APIs created ranges --range-filter :[1-3]: Profile all workloads launched in 2nd NVTX Push/Pop range A --range-filters ::2 --nvtx --nvtx-include A/ Profile all workloads launched in NVTX Push/Pop range A except the ones in NVTX Push/Pop range B --nvtx --nvtx-include A/ --nvtx-exclude B/ Profile all \u201cFoo\u201d kernels except those launched in NVTX Push/Pop range B --nvtx --nvtx-exclude B/ --kernel-name Foo Profile all workloads launched in 2nd NVTX Start/End range A inside 2nd cu(da)ProfilerStart/Stop APIs created range --range-filter yes:2:2 --nvtx --nvtx-include A Profile all workloads launched in 1st NVTX Push/Pop range A inside both 1st and 2nd cu(da)ProfilerStart/Stop APIs created range --range-filter yes:[1-2]:1 --nvtx --nvtx-include A/ Profile all workloads launched in 1st cu(da)ProfilerStart/Stop APIs created range with 2nd NVTX push/pop range A and domain D --range-filter no:1:2 --nvtx --nvtx-include D@A/ Notices Notices ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, \u201cMATERIALS\u201d) ARE BEING PROVIDED \u201cAS IS.\u201d NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. Information furnished is believed to be accurate and reliable. However, NVIDIA Corporation assumes no responsibility for the consequences of use of such information or for any infringement of patents or other rights of third parties that may result from its use. No license is granted by implication of otherwise under any patent rights of NVIDIA Corporation. Specifications mentioned in this publication are subject to change without notice. This publication supersedes and replaces all other information previously supplied. NVIDIA Corporation products are not authorized as critical components in life support devices or systems without express written approval of NVIDIA Corporation. Trademarks NVIDIA and the NVIDIA logo are trademarks or registered trademarks of NVIDIA Corporation in the U.S. and other countries. Other company and product names may be trademarks of the respective companies with which they are associated.", "keywords": []}, {"id": 305, "doc_id": 305, "filename": "Training/index.html", "domain_name": "std", "name": "Training/index", "display_name": "Training", "type": "doc", "display_type": "Page", "docname": "Training/index", "anchor": "", "priority": -1, "content": "Nsight Compute training content. NVIDIA Nsight Compute Training resources.", "keywords": []}, {"id": 306, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction", "display_name": "NV::Rules::IAction", "type": "class", "display_type": "C++ class", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IActionE", "priority": 1, "content": "class IAction Action interface. Represents an activity such as a CUDA kernel on a single range, for which zero or more metrics were collected Public Types", "keywords": []}, {"id": 307, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::NameBase", "display_name": "NV::Rules::IAction::NameBase", "type": "enum", "display_type": "C++ enum", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction8NameBaseE", "priority": 1, "content": "enum class NameBase Basis for action names. The basis determines how the action name is represented when calling name . FUNCTION is the minimal base name without parameters or return value. DEMANGLED is the demangled name, including parameters and return value. MANGLED is the mangled name, including parameters and return value. Values:", "keywords": []}, {"id": 308, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::NameBase::DEMANGLED", "display_name": "NV::Rules::IAction::NameBase::DEMANGLED", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction8NameBase9DEMANGLEDE", "priority": 1, "content": "enumerator DEMANGLED", "keywords": []}, {"id": 309, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::NameBase::FUNCTION", "display_name": "NV::Rules::IAction::NameBase::FUNCTION", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction8NameBase8FUNCTIONE", "priority": 1, "content": "enumerator FUNCTION", "keywords": []}, {"id": 310, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::NameBase::MANGLED", "display_name": "NV::Rules::IAction::NameBase::MANGLED", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction8NameBase7MANGLEDE", "priority": 1, "content": "enumerator MANGLED Public Functions", "keywords": []}, {"id": 311, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::add_double_metric", "display_name": "NV::Rules::IAction::add_double_metric", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction17add_double_metricEPKcN7IMetric9ValueKindEd", "priority": 1, "content": "virtual IMetric * add_double_metric const char * value_name IMetric :: ValueKind value_kind double value = 0 Add a single floating point metric to this action. Add a single floating point metric with name value_name and kind value_kind to this action Returns the new IMetric", "keywords": []}, {"id": 312, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::add_double_metric::value", "display_name": "NV::Rules::IAction::add_double_metric::value", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction17add_double_metricEPKcN7IMetric9ValueKindEd", "priority": 1, "content": "virtual IMetric * add_double_metric const char * value_name IMetric :: ValueKind value_kind double value = 0 Add a single floating point metric to this action. Add a single floating point metric with name value_name and kind value_kind to this action Returns the new IMetric", "keywords": []}, {"id": 313, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::add_double_metric::value_kind", "display_name": "NV::Rules::IAction::add_double_metric::value_kind", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction17add_double_metricEPKcN7IMetric9ValueKindEd", "priority": 1, "content": "virtual IMetric * add_double_metric const char * value_name IMetric :: ValueKind value_kind double value = 0 Add a single floating point metric to this action. Add a single floating point metric with name value_name and kind value_kind to this action Returns the new IMetric", "keywords": []}, {"id": 314, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::add_double_metric::value_name", "display_name": "NV::Rules::IAction::add_double_metric::value_name", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction17add_double_metricEPKcN7IMetric9ValueKindEd", "priority": 1, "content": "virtual IMetric * add_double_metric const char * value_name IMetric :: ValueKind value_kind double value = 0 Add a single floating point metric to this action. Add a single floating point metric with name value_name and kind value_kind to this action Returns the new IMetric", "keywords": []}, {"id": 315, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::add_integer_metric", "display_name": "NV::Rules::IAction::add_integer_metric", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction18add_integer_metricEPKcN7IMetric9ValueKindE8uint64_t", "priority": 1, "content": "virtual IMetric * add_integer_metric const char * value_name IMetric :: ValueKind value_kind uint64_t value = 0 Add a single integer metric to this action. Add a single integer metric to with name value_name and kind value_kind this action. Returns the new IMetric", "keywords": []}, {"id": 316, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::add_integer_metric::value", "display_name": "NV::Rules::IAction::add_integer_metric::value", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction18add_integer_metricEPKcN7IMetric9ValueKindE8uint64_t", "priority": 1, "content": "virtual IMetric * add_integer_metric const char * value_name IMetric :: ValueKind value_kind uint64_t value = 0 Add a single integer metric to this action. Add a single integer metric to with name value_name and kind value_kind this action. Returns the new IMetric", "keywords": []}, {"id": 317, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::add_integer_metric::value_kind", "display_name": "NV::Rules::IAction::add_integer_metric::value_kind", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction18add_integer_metricEPKcN7IMetric9ValueKindE8uint64_t", "priority": 1, "content": "virtual IMetric * add_integer_metric const char * value_name IMetric :: ValueKind value_kind uint64_t value = 0 Add a single integer metric to this action. Add a single integer metric to with name value_name and kind value_kind this action. Returns the new IMetric", "keywords": []}, {"id": 318, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::add_integer_metric::value_name", "display_name": "NV::Rules::IAction::add_integer_metric::value_name", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction18add_integer_metricEPKcN7IMetric9ValueKindE8uint64_t", "priority": 1, "content": "virtual IMetric * add_integer_metric const char * value_name IMetric :: ValueKind value_kind uint64_t value = 0 Add a single integer metric to this action. Add a single integer metric to with name value_name and kind value_kind this action. Returns the new IMetric", "keywords": []}, {"id": 319, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::add_metric", "display_name": "NV::Rules::IAction::add_metric", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction10add_metricEPKc", "priority": 1, "content": "virtual IMutableMetric * add_metric const char * value_name = 0 Add a single mutable metric to this action. Add a single, mutable metric with name value_name to this action. The metric is not initialized with any kind or value and needs to be assigned proper values and/or instances afterwards. IMutableMetric provides the following interface: void set_double(IMetric::ValueKind value_kind, double value) Return true if the value was set, false otherwise. Assign the metric a floating-point value of value_kind Acceptable kinds are FLOAT, DOUBLE or ANY (for which the implementation chooses the kind internally) bool set_double(size_t instance, IMetric::ValueKind value_kind, double value) Return true if the instance value was set, false otherwise. Assign the metric an instance floating-point value of value_kind Acceptable kinds are FLOAT, DOUBLE or ANY (for which the implementation chooses the kind internally) void set_uint64(IMetric::ValueKind value_kind, uint64_t value) Return true if the value was set, false otherwise. Assign the metric an integer value of value_kind Acceptable kinds are UINT32, UINT64 or ANY (for which the implementation chooses the kind internally) bool set_uint64(size_t instance, IMetric::ValueKind value_kind, uint64_t value) Return true if the instance value was set, false otherwise. Assign the metric an instance integer value of value_kind Acceptable kinds are UINT32, UINT64 or ANY (for which the implementation chooses the kind internally) void set_string(IMetric::ValueKind value_kind, const char* value) Return true if the value was set, false otherwise. Assign the metric a string value of value_kind Acceptable kinds are STRING or ANY (for which the implementation chooses the kind internally) bool set_string(size_t instance, IMetric::ValueKind value_kind, const char* value) Return true if the instance value was set, false otherwise. Assign the metric an instance string value of value_kind Acceptable kinds are STRING or ANY (for which the implementation chooses the kind internally) IMutableMetric *mutable_correlation_ids() Returns a new, mutable metric object representing the correlation IDs for the metric\u2019s instance values. Correlation IDs are used to associate instance values with the \u201cinstance\u201d their value represents. In the returned new metric object, the correlation IDs are that object\u2019s instance values. Returns the new IMutableMetric", "keywords": []}, {"id": 320, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::add_metric::value_name", "display_name": "NV::Rules::IAction::add_metric::value_name", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction10add_metricEPKc", "priority": 1, "content": "virtual IMutableMetric * add_metric const char * value_name = 0 Add a single mutable metric to this action. Add a single, mutable metric with name value_name to this action. The metric is not initialized with any kind or value and needs to be assigned proper values and/or instances afterwards. IMutableMetric provides the following interface: void set_double(IMetric::ValueKind value_kind, double value) Return true if the value was set, false otherwise. Assign the metric a floating-point value of value_kind Acceptable kinds are FLOAT, DOUBLE or ANY (for which the implementation chooses the kind internally) bool set_double(size_t instance, IMetric::ValueKind value_kind, double value) Return true if the instance value was set, false otherwise. Assign the metric an instance floating-point value of value_kind Acceptable kinds are FLOAT, DOUBLE or ANY (for which the implementation chooses the kind internally) void set_uint64(IMetric::ValueKind value_kind, uint64_t value) Return true if the value was set, false otherwise. Assign the metric an integer value of value_kind Acceptable kinds are UINT32, UINT64 or ANY (for which the implementation chooses the kind internally) bool set_uint64(size_t instance, IMetric::ValueKind value_kind, uint64_t value) Return true if the instance value was set, false otherwise. Assign the metric an instance integer value of value_kind Acceptable kinds are UINT32, UINT64 or ANY (for which the implementation chooses the kind internally) void set_string(IMetric::ValueKind value_kind, const char* value) Return true if the value was set, false otherwise. Assign the metric a string value of value_kind Acceptable kinds are STRING or ANY (for which the implementation chooses the kind internally) bool set_string(size_t instance, IMetric::ValueKind value_kind, const char* value) Return true if the instance value was set, false otherwise. Assign the metric an instance string value of value_kind Acceptable kinds are STRING or ANY (for which the implementation chooses the kind internally) IMutableMetric *mutable_correlation_ids() Returns a new, mutable metric object representing the correlation IDs for the metric\u2019s instance values. Correlation IDs are used to associate instance values with the \u201cinstance\u201d their value represents. In the returned new metric object, the correlation IDs are that object\u2019s instance values. Returns the new IMutableMetric", "keywords": []}, {"id": 321, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::add_string_metric", "display_name": "NV::Rules::IAction::add_string_metric", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction17add_string_metricEPKcN7IMetric9ValueKindEPKc", "priority": 1, "content": "virtual IMetric * add_string_metric const char * value_name IMetric :: ValueKind value_kind const char * value = 0 Add a single string metric to this action. Add a single string metric with name value_name and kind value_kind to this action Returns the new IMetric", "keywords": []}, {"id": 322, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::add_string_metric::value", "display_name": "NV::Rules::IAction::add_string_metric::value", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction17add_string_metricEPKcN7IMetric9ValueKindEPKc", "priority": 1, "content": "virtual IMetric * add_string_metric const char * value_name IMetric :: ValueKind value_kind const char * value = 0 Add a single string metric to this action. Add a single string metric with name value_name and kind value_kind to this action Returns the new IMetric", "keywords": []}, {"id": 323, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::add_string_metric::value_kind", "display_name": "NV::Rules::IAction::add_string_metric::value_kind", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction17add_string_metricEPKcN7IMetric9ValueKindEPKc", "priority": 1, "content": "virtual IMetric * add_string_metric const char * value_name IMetric :: ValueKind value_kind const char * value = 0 Add a single string metric to this action. Add a single string metric with name value_name and kind value_kind to this action Returns the new IMetric", "keywords": []}, {"id": 324, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::add_string_metric::value_name", "display_name": "NV::Rules::IAction::add_string_metric::value_name", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction17add_string_metricEPKcN7IMetric9ValueKindEPKc", "priority": 1, "content": "virtual IMetric * add_string_metric const char * value_name IMetric :: ValueKind value_kind const char * value = 0 Add a single string metric to this action. Add a single string metric with name value_name and kind value_kind to this action Returns the new IMetric", "keywords": []}, {"id": 325, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::metric_by_name", "display_name": "NV::Rules::IAction::metric_by_name", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction14metric_by_nameEPKc", "priority": 1, "content": "virtual IMetric * metric_by_name const char * metric_name = 0 Get a single metric by name. Get a single IMetric by metric_name", "keywords": []}, {"id": 326, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::metric_by_name::metric_name", "display_name": "NV::Rules::IAction::metric_by_name::metric_name", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction14metric_by_nameEPKc", "priority": 1, "content": "virtual IMetric * metric_by_name const char * metric_name = 0 Get a single metric by name. Get a single IMetric by metric_name", "keywords": []}, {"id": 327, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::metric_names", "display_name": "NV::Rules::IAction::metric_names", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction12metric_namesEv", "priority": 1, "content": "virtual std :: set < std :: string > metric_names = 0 Get the set of metric names. Get the set of metrics available for this action", "keywords": []}, {"id": 328, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::name", "display_name": "NV::Rules::IAction::name", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction4nameE8NameBase", "priority": 1, "content": "virtual const char * name NameBase base = NameBase :: FUNCTION = 0 Get the action name. Get the action name", "keywords": []}, {"id": 329, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::name::base", "display_name": "NV::Rules::IAction::name::base", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction4nameE8NameBase", "priority": 1, "content": "virtual const char * name NameBase base = NameBase :: FUNCTION = 0 Get the action name. Get the action name", "keywords": []}, {"id": 330, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::nvtx_state", "display_name": "NV::Rules::IAction::nvtx_state", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction10nvtx_stateEv", "priority": 1, "content": "virtual INvtxState * nvtx_state = 0 Get the NVTX state associated with this action. Returns a new INvtxState object if any NVTX state is available for this action.", "keywords": []}, {"id": 331, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::ptx_by_pc", "display_name": "NV::Rules::IAction::ptx_by_pc", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction9ptx_by_pcE8uint64_t", "priority": 1, "content": "virtual std :: string ptx_by_pc uint64_t address = 0 Get the PTX for a function address within this action. Get the PTX for a function address within this action. The address is expected to be absolute, i.e. as obtained from the correlation IDs of source-correlated metrics. Returns PTX string. An empty string is returned if no PTX is associated with this address", "keywords": []}, {"id": 332, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::ptx_by_pc::address", "display_name": "NV::Rules::IAction::ptx_by_pc::address", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction9ptx_by_pcE8uint64_t", "priority": 1, "content": "virtual std :: string ptx_by_pc uint64_t address = 0 Get the PTX for a function address within this action. Get the PTX for a function address within this action. The address is expected to be absolute, i.e. as obtained from the correlation IDs of source-correlated metrics. Returns PTX string. An empty string is returned if no PTX is associated with this address", "keywords": []}, {"id": 333, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::sass_by_pc", "display_name": "NV::Rules::IAction::sass_by_pc", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction10sass_by_pcE8uint64_t", "priority": 1, "content": "virtual std :: string sass_by_pc uint64_t address = 0 Get the disassembled SASS for a function address within this action. Get the disassembled SASS for a function address within this action. The address is expected to be absolute, i.e. as obtained from the correlation IDs of source-correlated metrics. The SASS may include formatting whitespace as generated by the disassembler. Returns SASS string. An empty string is returned if no SASS is associated with this address", "keywords": []}, {"id": 334, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::sass_by_pc::address", "display_name": "NV::Rules::IAction::sass_by_pc::address", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction10sass_by_pcE8uint64_t", "priority": 1, "content": "virtual std :: string sass_by_pc uint64_t address = 0 Get the disassembled SASS for a function address within this action. Get the disassembled SASS for a function address within this action. The address is expected to be absolute, i.e. as obtained from the correlation IDs of source-correlated metrics. The SASS may include formatting whitespace as generated by the disassembler. Returns SASS string. An empty string is returned if no SASS is associated with this address", "keywords": []}, {"id": 335, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::source_files", "display_name": "NV::Rules::IAction::source_files", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction12source_filesEv", "priority": 1, "content": "virtual std :: map < std :: string , std :: string > source_files = 0 Get the source files associated with an action. Get the map of source files associated with this action, along with their content. If content is not available for a file (e.g. because it hadn\u2019t been imported into the report), the file name will map to an empty string. Returns a map from file name to file content", "keywords": []}, {"id": 336, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::source_info", "display_name": "NV::Rules::IAction::source_info", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction11source_infoE8uint64_t", "priority": 1, "content": "virtual ISourceInfo * source_info uint64_t address = 0 Get the source info for a function address within this action. Get the source info for address within this action. Addresses are commonly obtained as correlation ids of source-correlated metrics. Returns a new ISourceInfo object if it is available", "keywords": []}, {"id": 337, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::source_info::address", "display_name": "NV::Rules::IAction::source_info::address", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IAction11source_infoE8uint64_t", "priority": 1, "content": "virtual ISourceInfo * source_info uint64_t address = 0 Get the source info for a function address within this action. Get the source info for address within this action. Addresses are commonly obtained as correlation ids of source-correlated metrics. Returns a new ISourceInfo object if it is available", "keywords": []}, {"id": 338, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "cpp", "name": "NV::Rules::IAction::~IAction", "display_name": "NV::Rules::IAction::~IAction", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "_CPPv4N2NV5Rules7IActionD0Ev", "priority": 1, "content": "inline virtual ~IAction", "keywords": []}, {"id": 339, "doc_id": 339, "filename": "api/classNV_1_1Rules_1_1IAction.html", "domain_name": "std", "name": "api/classNV_1_1Rules_1_1IAction", "display_name": "NV::Rules::IAction", "type": "doc", "display_type": "Page", "docname": "api/classNV_1_1Rules_1_1IAction", "anchor": "", "priority": -1, "content": "", "keywords": []}, {"id": 340, "doc_id": 345, "filename": "api/classNV_1_1Rules_1_1IBaseContext.html", "domain_name": "cpp", "name": "NV::Rules::IBaseContext", "display_name": "NV::Rules::IBaseContext", "type": "class", "display_type": "C++ class", "docname": "api/classNV_1_1Rules_1_1IBaseContext", "anchor": "_CPPv4N2NV5Rules12IBaseContextE", "priority": 1, "content": "class IBaseContext Subclassed by NV::Rules::IContext , NV::Rules::IEvaluator Public Functions", "keywords": []}, {"id": 341, "doc_id": 345, "filename": "api/classNV_1_1Rules_1_1IBaseContext.html", "domain_name": "cpp", "name": "NV::Rules::IBaseContext::get_version", "display_name": "NV::Rules::IBaseContext::get_version", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IBaseContext", "anchor": "_CPPv4N2NV5Rules12IBaseContext11get_versionEv", "priority": 1, "content": "virtual std :: string get_version = 0 Get version number of this interface. Returns the version number of this interface as a string of the form <year>.<major>.<minor> It matches the Nsight Compute version this interface originates from.", "keywords": []}, {"id": 342, "doc_id": 345, "filename": "api/classNV_1_1Rules_1_1IBaseContext.html", "domain_name": "cpp", "name": "NV::Rules::IBaseContext::handle_exception", "display_name": "NV::Rules::IBaseContext::handle_exception", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IBaseContext", "anchor": "_CPPv4N2NV5Rules12IBaseContext16handle_exceptionEPKc", "priority": 1, "content": "virtual bool handle_exception const char * msg = 0 Context exception handler. Should return true if a python exception should be set, false otherwise", "keywords": []}, {"id": 343, "doc_id": 345, "filename": "api/classNV_1_1Rules_1_1IBaseContext.html", "domain_name": "cpp", "name": "NV::Rules::IBaseContext::handle_exception::msg", "display_name": "NV::Rules::IBaseContext::handle_exception::msg", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IBaseContext", "anchor": "_CPPv4N2NV5Rules12IBaseContext16handle_exceptionEPKc", "priority": 1, "content": "virtual bool handle_exception const char * msg = 0 Context exception handler. Should return true if a python exception should be set, false otherwise", "keywords": []}, {"id": 344, "doc_id": 345, "filename": "api/classNV_1_1Rules_1_1IBaseContext.html", "domain_name": "cpp", "name": "NV::Rules::IBaseContext::~IBaseContext", "display_name": "NV::Rules::IBaseContext::~IBaseContext", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IBaseContext", "anchor": "_CPPv4N2NV5Rules12IBaseContextD0Ev", "priority": 1, "content": "inline virtual ~IBaseContext", "keywords": []}, {"id": 345, "doc_id": 345, "filename": "api/classNV_1_1Rules_1_1IBaseContext.html", "domain_name": "std", "name": "api/classNV_1_1Rules_1_1IBaseContext", "display_name": "NV::Rules::IBaseContext", "type": "doc", "display_type": "Page", "docname": "api/classNV_1_1Rules_1_1IBaseContext", "anchor": "", "priority": -1, "content": "", "keywords": []}, {"id": 346, "doc_id": 356, "filename": "api/classNV_1_1Rules_1_1IContext.html", "domain_name": "cpp", "name": "NV::Rules::IContext", "display_name": "NV::Rules::IContext", "type": "class", "display_type": "C++ class", "docname": "api/classNV_1_1Rules_1_1IContext", "anchor": "_CPPv4N2NV5Rules8IContextE", "priority": 1, "content": "class IContext : public NV :: Rules :: IBaseContext Context interface. The rule context provides the rule with access to all collected data, properties and means to relay results back to the caller. Public Functions", "keywords": []}, {"id": 347, "doc_id": 356, "filename": "api/classNV_1_1Rules_1_1IContext.html", "domain_name": "cpp", "name": "NV::Rules::IContext::controller", "display_name": "NV::Rules::IContext::controller", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IContext", "anchor": "_CPPv4N2NV5Rules8IContext10controllerEv", "priority": 1, "content": "virtual IController * controller = 0 Get the controller object. Get the IController object", "keywords": []}, {"id": 348, "doc_id": 356, "filename": "api/classNV_1_1Rules_1_1IContext.html", "domain_name": "cpp", "name": "NV::Rules::IContext::frontend", "display_name": "NV::Rules::IContext::frontend", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IContext", "anchor": "_CPPv4N2NV5Rules8IContext8frontendEv", "priority": 1, "content": "virtual IFrontend * frontend = 0 Get the frontend object. Get the IFrontend object", "keywords": []}, {"id": 349, "doc_id": 356, "filename": "api/classNV_1_1Rules_1_1IContext.html", "domain_name": "cpp", "name": "NV::Rules::IContext::get_version", "display_name": "NV::Rules::IContext::get_version", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IContext", "anchor": "_CPPv4N2NV5Rules8IContext11get_versionEv", "priority": 1, "content": "virtual std :: string get_version = 0 Get version number of this interface. Returns the version number of this interface as a string of the form <year>.<major>.<minor> It matches the Nsight Compute version this interface originates from.", "keywords": []}, {"id": 350, "doc_id": 356, "filename": "api/classNV_1_1Rules_1_1IContext.html", "domain_name": "cpp", "name": "NV::Rules::IContext::handle_exception", "display_name": "NV::Rules::IContext::handle_exception", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IContext", "anchor": "_CPPv4N2NV5Rules8IContext16handle_exceptionEPKc", "priority": 1, "content": "virtual bool handle_exception const char * msg = 0 Context exception handler. Should return true if a python exception should be set, false otherwise", "keywords": []}, {"id": 351, "doc_id": 356, "filename": "api/classNV_1_1Rules_1_1IContext.html", "domain_name": "cpp", "name": "NV::Rules::IContext::handle_exception::msg", "display_name": "NV::Rules::IContext::handle_exception::msg", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IContext", "anchor": "_CPPv4N2NV5Rules8IContext16handle_exceptionEPKc", "priority": 1, "content": "virtual bool handle_exception const char * msg = 0 Context exception handler. Should return true if a python exception should be set, false otherwise", "keywords": []}, {"id": 352, "doc_id": 356, "filename": "api/classNV_1_1Rules_1_1IContext.html", "domain_name": "cpp", "name": "NV::Rules::IContext::num_ranges", "display_name": "NV::Rules::IContext::num_ranges", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IContext", "anchor": "_CPPv4N2NV5Rules8IContext10num_rangesEv", "priority": 1, "content": "virtual size_t num_ranges = 0 Get the number of available ranges. Get the number of available ranges", "keywords": []}, {"id": 353, "doc_id": 356, "filename": "api/classNV_1_1Rules_1_1IContext.html", "domain_name": "cpp", "name": "NV::Rules::IContext::range_by_idx", "display_name": "NV::Rules::IContext::range_by_idx", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IContext", "anchor": "_CPPv4N2NV5Rules8IContext12range_by_idxE6size_t", "priority": 1, "content": "virtual IRange * range_by_idx size_t idx = 0 Get a single range by index. Get a single IRange by index", "keywords": []}, {"id": 354, "doc_id": 356, "filename": "api/classNV_1_1Rules_1_1IContext.html", "domain_name": "cpp", "name": "NV::Rules::IContext::range_by_idx::idx", "display_name": "NV::Rules::IContext::range_by_idx::idx", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IContext", "anchor": "_CPPv4N2NV5Rules8IContext12range_by_idxE6size_t", "priority": 1, "content": "virtual IRange * range_by_idx size_t idx = 0 Get a single range by index. Get a single IRange by index", "keywords": []}, {"id": 355, "doc_id": 356, "filename": "api/classNV_1_1Rules_1_1IContext.html", "domain_name": "cpp", "name": "NV::Rules::IContext::~IContext", "display_name": "NV::Rules::IContext::~IContext", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IContext", "anchor": "_CPPv4N2NV5Rules8IContextD0Ev", "priority": 1, "content": "inline virtual ~IContext", "keywords": []}, {"id": 356, "doc_id": 356, "filename": "api/classNV_1_1Rules_1_1IContext.html", "domain_name": "std", "name": "api/classNV_1_1Rules_1_1IContext", "display_name": "NV::Rules::IContext", "type": "doc", "display_type": "Page", "docname": "api/classNV_1_1Rules_1_1IContext", "anchor": "", "priority": -1, "content": "", "keywords": []}, {"id": 357, "doc_id": 362, "filename": "api/classNV_1_1Rules_1_1IController.html", "domain_name": "cpp", "name": "NV::Rules::IController", "display_name": "NV::Rules::IController", "type": "class", "display_type": "C++ class", "docname": "api/classNV_1_1Rules_1_1IController", "anchor": "_CPPv4N2NV5Rules11IControllerE", "priority": 1, "content": "class IController Controller interface. The controller can be used to interact with the tool runtime, e.g. to signal the tools to propose a follow-up rule. Public Functions", "keywords": []}, {"id": 358, "doc_id": 362, "filename": "api/classNV_1_1Rules_1_1IController.html", "domain_name": "cpp", "name": "NV::Rules::IController::get_message_vault", "display_name": "NV::Rules::IController::get_message_vault", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IController", "anchor": "_CPPv4N2NV5Rules11IController17get_message_vaultEv", "priority": 1, "content": "virtual std :: shared_ptr < IMessageVault > get_message_vault = 0 Get an IMessageVault object that can be used for message passing between rules.", "keywords": []}, {"id": 359, "doc_id": 362, "filename": "api/classNV_1_1Rules_1_1IController.html", "domain_name": "cpp", "name": "NV::Rules::IController::propose_rule", "display_name": "NV::Rules::IController::propose_rule", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IController", "anchor": "_CPPv4N2NV5Rules11IController12propose_ruleEPKc", "priority": 1, "content": "virtual void propose_rule const char * rule = 0 Propose the specified rule in the current context.", "keywords": []}, {"id": 360, "doc_id": 362, "filename": "api/classNV_1_1Rules_1_1IController.html", "domain_name": "cpp", "name": "NV::Rules::IController::propose_rule::rule", "display_name": "NV::Rules::IController::propose_rule::rule", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IController", "anchor": "_CPPv4N2NV5Rules11IController12propose_ruleEPKc", "priority": 1, "content": "virtual void propose_rule const char * rule = 0 Propose the specified rule in the current context.", "keywords": []}, {"id": 361, "doc_id": 362, "filename": "api/classNV_1_1Rules_1_1IController.html", "domain_name": "cpp", "name": "NV::Rules::IController::~IController", "display_name": "NV::Rules::IController::~IController", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IController", "anchor": "_CPPv4N2NV5Rules11IControllerD0Ev", "priority": 1, "content": "inline virtual ~IController", "keywords": []}, {"id": 362, "doc_id": 362, "filename": "api/classNV_1_1Rules_1_1IController.html", "domain_name": "std", "name": "api/classNV_1_1Rules_1_1IController", "display_name": "NV::Rules::IController", "type": "doc", "display_type": "Page", "docname": "api/classNV_1_1Rules_1_1IController", "anchor": "", "priority": -1, "content": "", "keywords": []}, {"id": 363, "doc_id": 372, "filename": "api/classNV_1_1Rules_1_1IEvaluator.html", "domain_name": "cpp", "name": "NV::Rules::IEvaluator", "display_name": "NV::Rules::IEvaluator", "type": "class", "display_type": "C++ class", "docname": "api/classNV_1_1Rules_1_1IEvaluator", "anchor": "_CPPv4N2NV5Rules10IEvaluatorE", "priority": 1, "content": "class IEvaluator : public NV :: Rules :: IBaseContext Evaluator interface. The evaluator is used during rule setup to pass information about rule dependencies to the tool. For most cases, its Python wrapper functions can be used instead for convenience. Public Functions", "keywords": []}, {"id": 364, "doc_id": 372, "filename": "api/classNV_1_1Rules_1_1IEvaluator.html", "domain_name": "cpp", "name": "NV::Rules::IEvaluator::get_version", "display_name": "NV::Rules::IEvaluator::get_version", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IEvaluator", "anchor": "_CPPv4N2NV5Rules10IEvaluator11get_versionEv", "priority": 1, "content": "virtual std :: string get_version = 0 Get version number of this interface. Returns the version number of this interface as a string of the form <year>.<major>.<minor> It matches the Nsight Compute version this interface originates from.", "keywords": []}, {"id": 365, "doc_id": 372, "filename": "api/classNV_1_1Rules_1_1IEvaluator.html", "domain_name": "cpp", "name": "NV::Rules::IEvaluator::handle_exception", "display_name": "NV::Rules::IEvaluator::handle_exception", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IEvaluator", "anchor": "_CPPv4N2NV5Rules10IEvaluator16handle_exceptionEPKc", "priority": 1, "content": "virtual bool handle_exception const char * msg = 0 Context exception handler. Should return true if a python exception should be set, false otherwise", "keywords": []}, {"id": 366, "doc_id": 372, "filename": "api/classNV_1_1Rules_1_1IEvaluator.html", "domain_name": "cpp", "name": "NV::Rules::IEvaluator::handle_exception::msg", "display_name": "NV::Rules::IEvaluator::handle_exception::msg", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IEvaluator", "anchor": "_CPPv4N2NV5Rules10IEvaluator16handle_exceptionEPKc", "priority": 1, "content": "virtual bool handle_exception const char * msg = 0 Context exception handler. Should return true if a python exception should be set, false otherwise", "keywords": []}, {"id": 367, "doc_id": 372, "filename": "api/classNV_1_1Rules_1_1IEvaluator.html", "domain_name": "cpp", "name": "NV::Rules::IEvaluator::require_metric", "display_name": "NV::Rules::IEvaluator::require_metric", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IEvaluator", "anchor": "_CPPv4N2NV5Rules10IEvaluator14require_metricEPKc", "priority": 1, "content": "virtual void require_metric const char * metric = 0 Define that the specified metric must have been collected in order for the calling rule to be applied.", "keywords": []}, {"id": 368, "doc_id": 372, "filename": "api/classNV_1_1Rules_1_1IEvaluator.html", "domain_name": "cpp", "name": "NV::Rules::IEvaluator::require_metric::metric", "display_name": "NV::Rules::IEvaluator::require_metric::metric", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IEvaluator", "anchor": "_CPPv4N2NV5Rules10IEvaluator14require_metricEPKc", "priority": 1, "content": "virtual void require_metric const char * metric = 0 Define that the specified metric must have been collected in order for the calling rule to be applied.", "keywords": []}, {"id": 369, "doc_id": 372, "filename": "api/classNV_1_1Rules_1_1IEvaluator.html", "domain_name": "cpp", "name": "NV::Rules::IEvaluator::require_rule", "display_name": "NV::Rules::IEvaluator::require_rule", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IEvaluator", "anchor": "_CPPv4N2NV5Rules10IEvaluator12require_ruleEPKc", "priority": 1, "content": "virtual void require_rule const char * rule = 0 Define that the specified rule must be available and ready to be applied in order for the calling rule to be applied itself.", "keywords": []}, {"id": 370, "doc_id": 372, "filename": "api/classNV_1_1Rules_1_1IEvaluator.html", "domain_name": "cpp", "name": "NV::Rules::IEvaluator::require_rule::rule", "display_name": "NV::Rules::IEvaluator::require_rule::rule", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IEvaluator", "anchor": "_CPPv4N2NV5Rules10IEvaluator12require_ruleEPKc", "priority": 1, "content": "virtual void require_rule const char * rule = 0 Define that the specified rule must be available and ready to be applied in order for the calling rule to be applied itself.", "keywords": []}, {"id": 371, "doc_id": 372, "filename": "api/classNV_1_1Rules_1_1IEvaluator.html", "domain_name": "cpp", "name": "NV::Rules::IEvaluator::~IEvaluator", "display_name": "NV::Rules::IEvaluator::~IEvaluator", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IEvaluator", "anchor": "_CPPv4N2NV5Rules10IEvaluatorD0Ev", "priority": 1, "content": "inline virtual ~IEvaluator", "keywords": []}, {"id": 372, "doc_id": 372, "filename": "api/classNV_1_1Rules_1_1IEvaluator.html", "domain_name": "std", "name": "api/classNV_1_1Rules_1_1IEvaluator", "display_name": "NV::Rules::IEvaluator", "type": "doc", "display_type": "Page", "docname": "api/classNV_1_1Rules_1_1IEvaluator", "anchor": "", "priority": -1, "content": "", "keywords": []}, {"id": 373, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend", "display_name": "NV::Rules::IFrontend", "type": "class", "display_type": "C++ class", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontendE", "priority": 1, "content": "class IFrontend Frontend interface. The frontend is responsible for relaying messages and results to the caller via user interfaces, logs or output files. Public Types", "keywords": []}, {"id": 374, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::Dict", "display_name": "NV::Rules::IFrontend::Dict", "type": "type", "display_type": "C++ type", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend4DictE", "priority": 1, "content": "using Dict = std :: map < std :: string , double >", "keywords": []}, {"id": 375, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::MarkerKind", "display_name": "NV::Rules::IFrontend::MarkerKind", "type": "enum", "display_type": "C++ enum", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend10MarkerKindE", "priority": 1, "content": "enum class MarkerKind Marker Kind. The kind of marker that is created in the Source Page with source_marker . SASS The marker will be associated with a SASS instruction. SOURCE The marker will be associated with a Source line. Values:", "keywords": []}, {"id": 376, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::MarkerKind::SASS", "display_name": "NV::Rules::IFrontend::MarkerKind::SASS", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend10MarkerKind4SASSE", "priority": 1, "content": "enumerator SASS", "keywords": []}, {"id": 377, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::MarkerKind::SOURCE", "display_name": "NV::Rules::IFrontend::MarkerKind::SOURCE", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend10MarkerKind6SOURCEE", "priority": 1, "content": "enumerator SOURCE", "keywords": []}, {"id": 378, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::MsgType", "display_name": "NV::Rules::IFrontend::MsgType", "type": "enum", "display_type": "C++ enum", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend7MsgTypeE", "priority": 1, "content": "enum class MsgType Message type. The type a message to the frontend represents when calling message . MSG_NONE No specific type for this message. MSG_OK The message is informative. MSG_OPTIMIZATION The message represents a suggestion for performance optimization. MSG_WARNING The message represents a warning or fixable issue. MSG_ERROR The message represents an error, potentially in executing the rule. Values:", "keywords": []}, {"id": 379, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::MsgType::MSG_ERROR", "display_name": "NV::Rules::IFrontend::MsgType::MSG_ERROR", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend7MsgType9MSG_ERRORE", "priority": 1, "content": "enumerator MSG_ERROR", "keywords": []}, {"id": 380, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::MsgType::MSG_NONE", "display_name": "NV::Rules::IFrontend::MsgType::MSG_NONE", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend7MsgType8MSG_NONEE", "priority": 1, "content": "enumerator MSG_NONE", "keywords": []}, {"id": 381, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::MsgType::MSG_OK", "display_name": "NV::Rules::IFrontend::MsgType::MSG_OK", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend7MsgType6MSG_OKE", "priority": 1, "content": "enumerator MSG_OK", "keywords": []}, {"id": 382, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::MsgType::MSG_OPTIMIZATION", "display_name": "NV::Rules::IFrontend::MsgType::MSG_OPTIMIZATION", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend7MsgType16MSG_OPTIMIZATIONE", "priority": 1, "content": "enumerator MSG_OPTIMIZATION", "keywords": []}, {"id": 383, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::MsgType::MSG_WARNING", "display_name": "NV::Rules::IFrontend::MsgType::MSG_WARNING", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend7MsgType11MSG_WARNINGE", "priority": 1, "content": "enumerator MSG_WARNING", "keywords": []}, {"id": 384, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::RuleId", "display_name": "NV::Rules::IFrontend::RuleId", "type": "type", "display_type": "C++ type", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend6RuleIdE", "priority": 1, "content": "using RuleId = std :: string", "keywords": []}, {"id": 385, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::Severity", "display_name": "NV::Rules::IFrontend::Severity", "type": "enum", "display_type": "C++ enum", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend8SeverityE", "priority": 1, "content": "enum class Severity Focus metric severity. The severity a focus metric represents when calling focus_metric . The severity can be used by the rule system client when processing the focus metric. SEVERITY_DEFAULT The default severity. SEVERITY_LOW Severity if low. SEVERITY_HIGH Severity if high. Values:", "keywords": []}, {"id": 386, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::Severity::SEVERITY_DEFAULT", "display_name": "NV::Rules::IFrontend::Severity::SEVERITY_DEFAULT", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend8Severity16SEVERITY_DEFAULTE", "priority": 1, "content": "enumerator SEVERITY_DEFAULT", "keywords": []}, {"id": 387, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::Severity::SEVERITY_HIGH", "display_name": "NV::Rules::IFrontend::Severity::SEVERITY_HIGH", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend8Severity13SEVERITY_HIGHE", "priority": 1, "content": "enumerator SEVERITY_HIGH", "keywords": []}, {"id": 388, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::Severity::SEVERITY_LOW", "display_name": "NV::Rules::IFrontend::Severity::SEVERITY_LOW", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend8Severity12SEVERITY_LOWE", "priority": 1, "content": "enumerator SEVERITY_LOW", "keywords": []}, {"id": 389, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::SpeedupType", "display_name": "NV::Rules::IFrontend::SpeedupType", "type": "enum", "display_type": "C++ enum", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend11SpeedupTypeE", "priority": 1, "content": "enum class SpeedupType Speedup estimation type. The type of speedup estimation used when calling speedup . LOCAL The proportional increase in efficiency of the hardware usage when viewing the performance problem in isolation. GLOBAL The proportional reduction in runtime of the entire workload. Values:", "keywords": []}, {"id": 390, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::SpeedupType::GLOBAL", "display_name": "NV::Rules::IFrontend::SpeedupType::GLOBAL", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend11SpeedupType6GLOBALE", "priority": 1, "content": "enumerator GLOBAL Public Functions", "keywords": []}, {"id": 391, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::SpeedupType::LOCAL", "display_name": "NV::Rules::IFrontend::SpeedupType::LOCAL", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend11SpeedupType5LOCALE", "priority": 1, "content": "enumerator LOCAL", "keywords": []}, {"id": 392, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::focus_metric", "display_name": "NV::Rules::IFrontend::focus_metric", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend12focus_metricEiPKcd8SeverityPKc", "priority": 1, "content": "virtual bool focus_metric int message_id const char * metric_name double metric_value Severity severity const char * info = 0 Rule focus metric message. Issues a focus metric message to the frontend, e.g. to indicate a key metric that triggered the rule output. Can be associated with a prior message using its message_id . The severity can be used to indicate this metric\u2019s impact/severity on the result. The info field can be set to a descriptive string for further information, e.g. the calculation leading to this metric being focused. Returns whether the focus_metric could be set successfully for the message_id .", "keywords": []}, {"id": 393, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::focus_metric::info", "display_name": "NV::Rules::IFrontend::focus_metric::info", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend12focus_metricEiPKcd8SeverityPKc", "priority": 1, "content": "virtual bool focus_metric int message_id const char * metric_name double metric_value Severity severity const char * info = 0 Rule focus metric message. Issues a focus metric message to the frontend, e.g. to indicate a key metric that triggered the rule output. Can be associated with a prior message using its message_id . The severity can be used to indicate this metric\u2019s impact/severity on the result. The info field can be set to a descriptive string for further information, e.g. the calculation leading to this metric being focused. Returns whether the focus_metric could be set successfully for the message_id .", "keywords": []}, {"id": 394, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::focus_metric::message_id", "display_name": "NV::Rules::IFrontend::focus_metric::message_id", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend12focus_metricEiPKcd8SeverityPKc", "priority": 1, "content": "virtual bool focus_metric int message_id const char * metric_name double metric_value Severity severity const char * info = 0 Rule focus metric message. Issues a focus metric message to the frontend, e.g. to indicate a key metric that triggered the rule output. Can be associated with a prior message using its message_id . The severity can be used to indicate this metric\u2019s impact/severity on the result. The info field can be set to a descriptive string for further information, e.g. the calculation leading to this metric being focused. Returns whether the focus_metric could be set successfully for the message_id .", "keywords": []}, {"id": 395, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::focus_metric::metric_name", "display_name": "NV::Rules::IFrontend::focus_metric::metric_name", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend12focus_metricEiPKcd8SeverityPKc", "priority": 1, "content": "virtual bool focus_metric int message_id const char * metric_name double metric_value Severity severity const char * info = 0 Rule focus metric message. Issues a focus metric message to the frontend, e.g. to indicate a key metric that triggered the rule output. Can be associated with a prior message using its message_id . The severity can be used to indicate this metric\u2019s impact/severity on the result. The info field can be set to a descriptive string for further information, e.g. the calculation leading to this metric being focused. Returns whether the focus_metric could be set successfully for the message_id .", "keywords": []}, {"id": 396, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::focus_metric::metric_value", "display_name": "NV::Rules::IFrontend::focus_metric::metric_value", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend12focus_metricEiPKcd8SeverityPKc", "priority": 1, "content": "virtual bool focus_metric int message_id const char * metric_name double metric_value Severity severity const char * info = 0 Rule focus metric message. Issues a focus metric message to the frontend, e.g. to indicate a key metric that triggered the rule output. Can be associated with a prior message using its message_id . The severity can be used to indicate this metric\u2019s impact/severity on the result. The info field can be set to a descriptive string for further information, e.g. the calculation leading to this metric being focused. Returns whether the focus_metric could be set successfully for the message_id .", "keywords": []}, {"id": 397, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::focus_metric::severity", "display_name": "NV::Rules::IFrontend::focus_metric::severity", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend12focus_metricEiPKcd8SeverityPKc", "priority": 1, "content": "virtual bool focus_metric int message_id const char * metric_name double metric_value Severity severity const char * info = 0 Rule focus metric message. Issues a focus metric message to the frontend, e.g. to indicate a key metric that triggered the rule output. Can be associated with a prior message using its message_id . The severity can be used to indicate this metric\u2019s impact/severity on the result. The info field can be set to a descriptive string for further information, e.g. the calculation leading to this metric being focused. Returns whether the focus_metric could be set successfully for the message_id .", "keywords": []}, {"id": 398, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::load_chart_from_file", "display_name": "NV::Rules::IFrontend::load_chart_from_file", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend20load_chart_from_fileEPKc", "priority": 1, "content": "virtual void load_chart_from_file const char * filename = 0 Load a ProfilerSection google protcol buffer chart from filename .", "keywords": []}, {"id": 399, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::load_chart_from_file::filename", "display_name": "NV::Rules::IFrontend::load_chart_from_file::filename", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend20load_chart_from_fileEPKc", "priority": 1, "content": "virtual void load_chart_from_file const char * filename = 0 Load a ProfilerSection google protcol buffer chart from filename .", "keywords": []}, {"id": 400, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::message", "display_name": "NV::Rules::IFrontend::message", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend7messageE7MsgTypePKcPKc", "priority": 1, "content": "virtual int message MsgType type const char * str const char * name = nullptr = 0 Rule result message. Issues a message str with a specific message type and optional name name to the frontend. Returns a message ID that is unique in this rule invocation.", "keywords": []}, {"id": 401, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::message", "display_name": "NV::Rules::IFrontend::message", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend7messageEPKcPKc", "priority": 1, "content": "virtual int message const char * str const char * name = nullptr = 0 Rule result message. Issues a message str to the frontend with the default MsgType and optional name name . Returns a message ID that is unique in this rule invocation.", "keywords": []}, {"id": 402, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::message::name", "display_name": "NV::Rules::IFrontend::message::name", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend7messageE7MsgTypePKcPKc", "priority": 1, "content": "virtual int message MsgType type const char * str const char * name = nullptr = 0 Rule result message. Issues a message str with a specific message type and optional name name to the frontend. Returns a message ID that is unique in this rule invocation.", "keywords": []}, {"id": 403, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::message::name", "display_name": "NV::Rules::IFrontend::message::name", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend7messageEPKcPKc", "priority": 1, "content": "virtual int message const char * str const char * name = nullptr = 0 Rule result message. Issues a message str to the frontend with the default MsgType and optional name name . Returns a message ID that is unique in this rule invocation.", "keywords": []}, {"id": 404, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::message::str", "display_name": "NV::Rules::IFrontend::message::str", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend7messageE7MsgTypePKcPKc", "priority": 1, "content": "virtual int message MsgType type const char * str const char * name = nullptr = 0 Rule result message. Issues a message str with a specific message type and optional name name to the frontend. Returns a message ID that is unique in this rule invocation.", "keywords": []}, {"id": 405, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::message::str", "display_name": "NV::Rules::IFrontend::message::str", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend7messageEPKcPKc", "priority": 1, "content": "virtual int message const char * str const char * name = nullptr = 0 Rule result message. Issues a message str to the frontend with the default MsgType and optional name name . Returns a message ID that is unique in this rule invocation.", "keywords": []}, {"id": 406, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::message::type", "display_name": "NV::Rules::IFrontend::message::type", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend7messageE7MsgTypePKcPKc", "priority": 1, "content": "virtual int message MsgType type const char * str const char * name = nullptr = 0 Rule result message. Issues a message str with a specific message type and optional name name to the frontend. Returns a message ID that is unique in this rule invocation.", "keywords": []}, {"id": 407, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::receive_dict_from_parent", "display_name": "NV::Rules::IFrontend::receive_dict_from_parent", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend24receive_dict_from_parentERK6RuleId", "priority": 1, "content": "virtual Dict receive_dict_from_parent const RuleId & parent_id = 0 Receive a dictionary from parent rule parent_id . Receive a dictionary of type dict[str,float] sent using send_dict_to_children . In case parent_id does not represent a pre-specified parent rule of this rule, or in case the parent rule has not been executed, an empty dict will be returned.", "keywords": []}, {"id": 408, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::receive_dict_from_parent::parent_id", "display_name": "NV::Rules::IFrontend::receive_dict_from_parent::parent_id", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend24receive_dict_from_parentERK6RuleId", "priority": 1, "content": "virtual Dict receive_dict_from_parent const RuleId & parent_id = 0 Receive a dictionary from parent rule parent_id . Receive a dictionary of type dict[str,float] sent using send_dict_to_children . In case parent_id does not represent a pre-specified parent rule of this rule, or in case the parent rule has not been executed, an empty dict will be returned.", "keywords": []}, {"id": 409, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::send_dict_to_children", "display_name": "NV::Rules::IFrontend::send_dict_to_children", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend21send_dict_to_childrenERK4Dict", "priority": 1, "content": "virtual void send_dict_to_children const Dict & dict = 0 Send a dictionary dict to all child rules. Sends a Python dictionary of type dict[str,float] to all rules that specify this rule as a parent rule. Child rules can retrieve the message using receive_dict_from_parent . In case this function is called repeatedly, the dict is updated accordingly, thereby adding new key-value pairs, and overwriting values of pre-existing keys.", "keywords": []}, {"id": 410, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::send_dict_to_children::dict", "display_name": "NV::Rules::IFrontend::send_dict_to_children::dict", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend21send_dict_to_childrenERK4Dict", "priority": 1, "content": "virtual void send_dict_to_children const Dict & dict = 0 Send a dictionary dict to all child rules. Sends a Python dictionary of type dict[str,float] to all rules that specify this rule as a parent rule. Child rules can retrieve the message using receive_dict_from_parent . In case this function is called repeatedly, the dict is updated accordingly, thereby adding new key-value pairs, and overwriting values of pre-existing keys.", "keywords": []}, {"id": 411, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::source_marker", "display_name": "NV::Rules::IFrontend::source_marker", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend13source_markerEPKc8uint64_t10MarkerKind7MsgType", "priority": 1, "content": "virtual void source_marker const char * str uint64_t address_or_line MarkerKind kind MsgType type = MsgType :: MSG_NONE = 0 Rule source marker. Creates a source marker with a message str at the source location address_or_line in the appropriate kind of source. The type denotes the urgency associated with this marker and is optional.", "keywords": []}, {"id": 412, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::source_marker", "display_name": "NV::Rules::IFrontend::source_marker", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend13source_markerEPKc8uint64_t10MarkerKindPKc7MsgType", "priority": 1, "content": "virtual void source_marker const char * str uint64_t address_or_line MarkerKind kind const char * file_name MsgType type = MsgType :: MSG_NONE = 0 Rule source marker. Creates a source marker with a message str at the source location address_or_line in the appropriate kind of source. This function supports multi-file programs, which means a file_name has to be specified. The type denotes the urgency associated with this marker and is optional.", "keywords": []}, {"id": 413, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::source_marker::address_or_line", "display_name": "NV::Rules::IFrontend::source_marker::address_or_line", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend13source_markerEPKc8uint64_t10MarkerKind7MsgType", "priority": 1, "content": "virtual void source_marker const char * str uint64_t address_or_line MarkerKind kind MsgType type = MsgType :: MSG_NONE = 0 Rule source marker. Creates a source marker with a message str at the source location address_or_line in the appropriate kind of source. The type denotes the urgency associated with this marker and is optional.", "keywords": []}, {"id": 414, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::source_marker::address_or_line", "display_name": "NV::Rules::IFrontend::source_marker::address_or_line", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend13source_markerEPKc8uint64_t10MarkerKindPKc7MsgType", "priority": 1, "content": "virtual void source_marker const char * str uint64_t address_or_line MarkerKind kind const char * file_name MsgType type = MsgType :: MSG_NONE = 0 Rule source marker. Creates a source marker with a message str at the source location address_or_line in the appropriate kind of source. This function supports multi-file programs, which means a file_name has to be specified. The type denotes the urgency associated with this marker and is optional.", "keywords": []}, {"id": 415, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::source_marker::file_name", "display_name": "NV::Rules::IFrontend::source_marker::file_name", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend13source_markerEPKc8uint64_t10MarkerKindPKc7MsgType", "priority": 1, "content": "virtual void source_marker const char * str uint64_t address_or_line MarkerKind kind const char * file_name MsgType type = MsgType :: MSG_NONE = 0 Rule source marker. Creates a source marker with a message str at the source location address_or_line in the appropriate kind of source. This function supports multi-file programs, which means a file_name has to be specified. The type denotes the urgency associated with this marker and is optional.", "keywords": []}, {"id": 416, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::source_marker::kind", "display_name": "NV::Rules::IFrontend::source_marker::kind", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend13source_markerEPKc8uint64_t10MarkerKind7MsgType", "priority": 1, "content": "virtual void source_marker const char * str uint64_t address_or_line MarkerKind kind MsgType type = MsgType :: MSG_NONE = 0 Rule source marker. Creates a source marker with a message str at the source location address_or_line in the appropriate kind of source. The type denotes the urgency associated with this marker and is optional.", "keywords": []}, {"id": 417, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::source_marker::kind", "display_name": "NV::Rules::IFrontend::source_marker::kind", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend13source_markerEPKc8uint64_t10MarkerKindPKc7MsgType", "priority": 1, "content": "virtual void source_marker const char * str uint64_t address_or_line MarkerKind kind const char * file_name MsgType type = MsgType :: MSG_NONE = 0 Rule source marker. Creates a source marker with a message str at the source location address_or_line in the appropriate kind of source. This function supports multi-file programs, which means a file_name has to be specified. The type denotes the urgency associated with this marker and is optional.", "keywords": []}, {"id": 418, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::source_marker::str", "display_name": "NV::Rules::IFrontend::source_marker::str", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend13source_markerEPKc8uint64_t10MarkerKind7MsgType", "priority": 1, "content": "virtual void source_marker const char * str uint64_t address_or_line MarkerKind kind MsgType type = MsgType :: MSG_NONE = 0 Rule source marker. Creates a source marker with a message str at the source location address_or_line in the appropriate kind of source. The type denotes the urgency associated with this marker and is optional.", "keywords": []}, {"id": 419, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::source_marker::str", "display_name": "NV::Rules::IFrontend::source_marker::str", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend13source_markerEPKc8uint64_t10MarkerKindPKc7MsgType", "priority": 1, "content": "virtual void source_marker const char * str uint64_t address_or_line MarkerKind kind const char * file_name MsgType type = MsgType :: MSG_NONE = 0 Rule source marker. Creates a source marker with a message str at the source location address_or_line in the appropriate kind of source. This function supports multi-file programs, which means a file_name has to be specified. The type denotes the urgency associated with this marker and is optional.", "keywords": []}, {"id": 420, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::source_marker::type", "display_name": "NV::Rules::IFrontend::source_marker::type", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend13source_markerEPKc8uint64_t10MarkerKind7MsgType", "priority": 1, "content": "virtual void source_marker const char * str uint64_t address_or_line MarkerKind kind MsgType type = MsgType :: MSG_NONE = 0 Rule source marker. Creates a source marker with a message str at the source location address_or_line in the appropriate kind of source. The type denotes the urgency associated with this marker and is optional.", "keywords": []}, {"id": 421, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::source_marker::type", "display_name": "NV::Rules::IFrontend::source_marker::type", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend13source_markerEPKc8uint64_t10MarkerKindPKc7MsgType", "priority": 1, "content": "virtual void source_marker const char * str uint64_t address_or_line MarkerKind kind const char * file_name MsgType type = MsgType :: MSG_NONE = 0 Rule source marker. Creates a source marker with a message str at the source location address_or_line in the appropriate kind of source. This function supports multi-file programs, which means a file_name has to be specified. The type denotes the urgency associated with this marker and is optional.", "keywords": []}, {"id": 422, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::speedup", "display_name": "NV::Rules::IFrontend::speedup", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend7speedupEi11SpeedupTyped", "priority": 1, "content": "virtual bool speedup int message_id SpeedupType type double estimated_speedup = 0 Rule estimated speedup message. Issues an estimated speedup to the frontend associated to the message with ID message_id . When type is SpeedupType::GLOBAL , it indicates what proportional decrease in workload runtime could potentially be achieved, when following the guidelines of the rule. When type is SpeedupType::LOCAL , it indicates what increase in the efficiency of the hardware usage within the context of the performance problem could be achieved. Returns whether the speedup could be set successfully for the message_id .", "keywords": []}, {"id": 423, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::speedup::estimated_speedup", "display_name": "NV::Rules::IFrontend::speedup::estimated_speedup", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend7speedupEi11SpeedupTyped", "priority": 1, "content": "virtual bool speedup int message_id SpeedupType type double estimated_speedup = 0 Rule estimated speedup message. Issues an estimated speedup to the frontend associated to the message with ID message_id . When type is SpeedupType::GLOBAL , it indicates what proportional decrease in workload runtime could potentially be achieved, when following the guidelines of the rule. When type is SpeedupType::LOCAL , it indicates what increase in the efficiency of the hardware usage within the context of the performance problem could be achieved. Returns whether the speedup could be set successfully for the message_id .", "keywords": []}, {"id": 424, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::speedup::message_id", "display_name": "NV::Rules::IFrontend::speedup::message_id", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend7speedupEi11SpeedupTyped", "priority": 1, "content": "virtual bool speedup int message_id SpeedupType type double estimated_speedup = 0 Rule estimated speedup message. Issues an estimated speedup to the frontend associated to the message with ID message_id . When type is SpeedupType::GLOBAL , it indicates what proportional decrease in workload runtime could potentially be achieved, when following the guidelines of the rule. When type is SpeedupType::LOCAL , it indicates what increase in the efficiency of the hardware usage within the context of the performance problem could be achieved. Returns whether the speedup could be set successfully for the message_id .", "keywords": []}, {"id": 425, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::speedup::type", "display_name": "NV::Rules::IFrontend::speedup::type", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontend7speedupEi11SpeedupTyped", "priority": 1, "content": "virtual bool speedup int message_id SpeedupType type double estimated_speedup = 0 Rule estimated speedup message. Issues an estimated speedup to the frontend associated to the message with ID message_id . When type is SpeedupType::GLOBAL , it indicates what proportional decrease in workload runtime could potentially be achieved, when following the guidelines of the rule. When type is SpeedupType::LOCAL , it indicates what increase in the efficiency of the hardware usage within the context of the performance problem could be achieved. Returns whether the speedup could be set successfully for the message_id .", "keywords": []}, {"id": 426, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "cpp", "name": "NV::Rules::IFrontend::~IFrontend", "display_name": "NV::Rules::IFrontend::~IFrontend", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "_CPPv4N2NV5Rules9IFrontendD0Ev", "priority": 1, "content": "inline virtual ~IFrontend", "keywords": []}, {"id": 427, "doc_id": 427, "filename": "api/classNV_1_1Rules_1_1IFrontend.html", "domain_name": "std", "name": "api/classNV_1_1Rules_1_1IFrontend", "display_name": "NV::Rules::IFrontend", "type": "doc", "display_type": "Page", "docname": "api/classNV_1_1Rules_1_1IFrontend", "anchor": "", "priority": -1, "content": "", "keywords": []}, {"id": 428, "doc_id": 437, "filename": "api/classNV_1_1Rules_1_1IMessageVault.html", "domain_name": "cpp", "name": "NV::Rules::IMessageVault", "display_name": "NV::Rules::IMessageVault", "type": "class", "display_type": "C++ class", "docname": "api/classNV_1_1Rules_1_1IMessageVault", "anchor": "_CPPv4N2NV5Rules13IMessageVaultE", "priority": 1, "content": "class IMessageVault Public Types", "keywords": []}, {"id": 429, "doc_id": 437, "filename": "api/classNV_1_1Rules_1_1IMessageVault.html", "domain_name": "cpp", "name": "NV::Rules::IMessageVault::Dict", "display_name": "NV::Rules::IMessageVault::Dict", "type": "type", "display_type": "C++ type", "docname": "api/classNV_1_1Rules_1_1IMessageVault", "anchor": "_CPPv4N2NV5Rules13IMessageVault4DictE", "priority": 1, "content": "using Dict = IFrontend :: Dict", "keywords": []}, {"id": 430, "doc_id": 437, "filename": "api/classNV_1_1Rules_1_1IMessageVault.html", "domain_name": "cpp", "name": "NV::Rules::IMessageVault::Get", "display_name": "NV::Rules::IMessageVault::Get", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IMessageVault", "anchor": "_CPPv4NK2NV5Rules13IMessageVault3GetERK6RuleId", "priority": 1, "content": "virtual Dict Get const RuleId & ruleId const = 0 Retrieve the message associated with ruleId from the vault. In case ruleId is unknown, an empty message is returned.", "keywords": []}, {"id": 431, "doc_id": 437, "filename": "api/classNV_1_1Rules_1_1IMessageVault.html", "domain_name": "cpp", "name": "NV::Rules::IMessageVault::Get::ruleId", "display_name": "NV::Rules::IMessageVault::Get::ruleId", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IMessageVault", "anchor": "_CPPv4NK2NV5Rules13IMessageVault3GetERK6RuleId", "priority": 1, "content": "virtual Dict Get const RuleId & ruleId const = 0 Retrieve the message associated with ruleId from the vault. In case ruleId is unknown, an empty message is returned.", "keywords": []}, {"id": 432, "doc_id": 437, "filename": "api/classNV_1_1Rules_1_1IMessageVault.html", "domain_name": "cpp", "name": "NV::Rules::IMessageVault::Put", "display_name": "NV::Rules::IMessageVault::Put", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IMessageVault", "anchor": "_CPPv4N2NV5Rules13IMessageVault3PutERK6RuleIdRK4Dict", "priority": 1, "content": "virtual void Put const RuleId & ruleId const Dict & message = 0 Commit a message message associated with ruleId to the vault. In case multiple messages associated with the same ruleId are commited, the messages are merged, in such a way that new key-value pairs are added, and values of pre-existing keys are updated.", "keywords": []}, {"id": 433, "doc_id": 437, "filename": "api/classNV_1_1Rules_1_1IMessageVault.html", "domain_name": "cpp", "name": "NV::Rules::IMessageVault::Put::message", "display_name": "NV::Rules::IMessageVault::Put::message", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IMessageVault", "anchor": "_CPPv4N2NV5Rules13IMessageVault3PutERK6RuleIdRK4Dict", "priority": 1, "content": "virtual void Put const RuleId & ruleId const Dict & message = 0 Commit a message message associated with ruleId to the vault. In case multiple messages associated with the same ruleId are commited, the messages are merged, in such a way that new key-value pairs are added, and values of pre-existing keys are updated.", "keywords": []}, {"id": 434, "doc_id": 437, "filename": "api/classNV_1_1Rules_1_1IMessageVault.html", "domain_name": "cpp", "name": "NV::Rules::IMessageVault::Put::ruleId", "display_name": "NV::Rules::IMessageVault::Put::ruleId", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IMessageVault", "anchor": "_CPPv4N2NV5Rules13IMessageVault3PutERK6RuleIdRK4Dict", "priority": 1, "content": "virtual void Put const RuleId & ruleId const Dict & message = 0 Commit a message message associated with ruleId to the vault. In case multiple messages associated with the same ruleId are commited, the messages are merged, in such a way that new key-value pairs are added, and values of pre-existing keys are updated.", "keywords": []}, {"id": 435, "doc_id": 437, "filename": "api/classNV_1_1Rules_1_1IMessageVault.html", "domain_name": "cpp", "name": "NV::Rules::IMessageVault::RuleId", "display_name": "NV::Rules::IMessageVault::RuleId", "type": "type", "display_type": "C++ type", "docname": "api/classNV_1_1Rules_1_1IMessageVault", "anchor": "_CPPv4N2NV5Rules13IMessageVault6RuleIdE", "priority": 1, "content": "using RuleId = IFrontend :: RuleId Public Functions", "keywords": []}, {"id": 436, "doc_id": 437, "filename": "api/classNV_1_1Rules_1_1IMessageVault.html", "domain_name": "cpp", "name": "NV::Rules::IMessageVault::~IMessageVault", "display_name": "NV::Rules::IMessageVault::~IMessageVault", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IMessageVault", "anchor": "_CPPv4N2NV5Rules13IMessageVaultD0Ev", "priority": 1, "content": "virtual ~IMessageVault = default", "keywords": []}, {"id": 437, "doc_id": 437, "filename": "api/classNV_1_1Rules_1_1IMessageVault.html", "domain_name": "std", "name": "api/classNV_1_1Rules_1_1IMessageVault", "display_name": "NV::Rules::IMessageVault", "type": "doc", "display_type": "Page", "docname": "api/classNV_1_1Rules_1_1IMessageVault", "anchor": "", "priority": -1, "content": "", "keywords": []}, {"id": 438, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric", "display_name": "NV::Rules::IMetric", "type": "class", "display_type": "C++ class", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetricE", "priority": 1, "content": "class IMetric Metric interface. Represents a single, named metric. A metric can carry one value or multiple, if it is an instanced metric. Public Types", "keywords": []}, {"id": 439, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::Description", "display_name": "NV::Rules::IMetric::Description", "type": "type", "display_type": "C++ type", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric11DescriptionE", "priority": 1, "content": "using Description = std :: string", "keywords": []}, {"id": 440, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::MetricSubtype", "display_name": "NV::Rules::IMetric::MetricSubtype", "type": "enum", "display_type": "C++ enum", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric13MetricSubtypeE", "priority": 1, "content": "enum class MetricSubtype Metric subtype. Indicates the subtype of the metric. Subtypes only apply to hardware metrics. Other metric types have subtype None in Python. Values:", "keywords": []}, {"id": 441, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::MetricSubtype::MAX_RATE", "display_name": "NV::Rules::IMetric::MetricSubtype::MAX_RATE", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric13MetricSubtype8MAX_RATEE", "priority": 1, "content": "enumerator MAX_RATE", "keywords": []}, {"id": 442, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::MetricSubtype::NONE", "display_name": "NV::Rules::IMetric::MetricSubtype::NONE", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric13MetricSubtype4NONEE", "priority": 1, "content": "enumerator NONE", "keywords": []}, {"id": 443, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::MetricSubtype::PCT", "display_name": "NV::Rules::IMetric::MetricSubtype::PCT", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric13MetricSubtype3PCTE", "priority": 1, "content": "enumerator PCT", "keywords": []}, {"id": 444, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::MetricSubtype::PCT_OF_PEAK_SUSTAINED_ACTIVE", "display_name": "NV::Rules::IMetric::MetricSubtype::PCT_OF_PEAK_SUSTAINED_ACTIVE", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric13MetricSubtype28PCT_OF_PEAK_SUSTAINED_ACTIVEE", "priority": 1, "content": "enumerator PCT_OF_PEAK_SUSTAINED_ACTIVE", "keywords": []}, {"id": 445, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::MetricSubtype::PCT_OF_PEAK_SUSTAINED_ELAPSED", "display_name": "NV::Rules::IMetric::MetricSubtype::PCT_OF_PEAK_SUSTAINED_ELAPSED", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric13MetricSubtype29PCT_OF_PEAK_SUSTAINED_ELAPSEDE", "priority": 1, "content": "enumerator PCT_OF_PEAK_SUSTAINED_ELAPSED", "keywords": []}, {"id": 446, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::MetricSubtype::PCT_OF_PEAK_SUSTAINED_FRAME", "display_name": "NV::Rules::IMetric::MetricSubtype::PCT_OF_PEAK_SUSTAINED_FRAME", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric13MetricSubtype27PCT_OF_PEAK_SUSTAINED_FRAMEE", "priority": 1, "content": "enumerator PCT_OF_PEAK_SUSTAINED_FRAME", "keywords": []}, {"id": 447, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::MetricSubtype::PCT_OF_PEAK_SUSTAINED_REGION", "display_name": "NV::Rules::IMetric::MetricSubtype::PCT_OF_PEAK_SUSTAINED_REGION", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric13MetricSubtype28PCT_OF_PEAK_SUSTAINED_REGIONE", "priority": 1, "content": "enumerator PCT_OF_PEAK_SUSTAINED_REGION", "keywords": []}, {"id": 448, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::MetricSubtype::PEAK_SUSTAINED", "display_name": "NV::Rules::IMetric::MetricSubtype::PEAK_SUSTAINED", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric13MetricSubtype14PEAK_SUSTAINEDE", "priority": 1, "content": "enumerator PEAK_SUSTAINED", "keywords": []}, {"id": 449, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::MetricSubtype::PEAK_SUSTAINED_ACTIVE", "display_name": "NV::Rules::IMetric::MetricSubtype::PEAK_SUSTAINED_ACTIVE", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric13MetricSubtype21PEAK_SUSTAINED_ACTIVEE", "priority": 1, "content": "enumerator PEAK_SUSTAINED_ACTIVE", "keywords": []}, {"id": 450, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::MetricSubtype::PEAK_SUSTAINED_ACTIVE_PER_SECOND", "display_name": "NV::Rules::IMetric::MetricSubtype::PEAK_SUSTAINED_ACTIVE_PER_SECOND", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric13MetricSubtype32PEAK_SUSTAINED_ACTIVE_PER_SECONDE", "priority": 1, "content": "enumerator PEAK_SUSTAINED_ACTIVE_PER_SECOND", "keywords": []}, {"id": 451, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::MetricSubtype::PEAK_SUSTAINED_ELAPSED", "display_name": "NV::Rules::IMetric::MetricSubtype::PEAK_SUSTAINED_ELAPSED", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric13MetricSubtype22PEAK_SUSTAINED_ELAPSEDE", "priority": 1, "content": "enumerator PEAK_SUSTAINED_ELAPSED", "keywords": []}, {"id": 452, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::MetricSubtype::PEAK_SUSTAINED_ELAPSED_PER_SECOND", "display_name": "NV::Rules::IMetric::MetricSubtype::PEAK_SUSTAINED_ELAPSED_PER_SECOND", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric13MetricSubtype33PEAK_SUSTAINED_ELAPSED_PER_SECONDE", "priority": 1, "content": "enumerator PEAK_SUSTAINED_ELAPSED_PER_SECOND", "keywords": []}, {"id": 453, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::MetricSubtype::PEAK_SUSTAINED_FRAME", "display_name": "NV::Rules::IMetric::MetricSubtype::PEAK_SUSTAINED_FRAME", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric13MetricSubtype20PEAK_SUSTAINED_FRAMEE", "priority": 1, "content": "enumerator PEAK_SUSTAINED_FRAME", "keywords": []}, {"id": 454, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::MetricSubtype::PEAK_SUSTAINED_FRAME_PER_SECOND", "display_name": "NV::Rules::IMetric::MetricSubtype::PEAK_SUSTAINED_FRAME_PER_SECOND", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric13MetricSubtype31PEAK_SUSTAINED_FRAME_PER_SECONDE", "priority": 1, "content": "enumerator PEAK_SUSTAINED_FRAME_PER_SECOND", "keywords": []}, {"id": 455, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::MetricSubtype::PEAK_SUSTAINED_REGION", "display_name": "NV::Rules::IMetric::MetricSubtype::PEAK_SUSTAINED_REGION", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric13MetricSubtype21PEAK_SUSTAINED_REGIONE", "priority": 1, "content": "enumerator PEAK_SUSTAINED_REGION", "keywords": []}, {"id": 456, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::MetricSubtype::PEAK_SUSTAINED_REGION_PER_SECOND", "display_name": "NV::Rules::IMetric::MetricSubtype::PEAK_SUSTAINED_REGION_PER_SECOND", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric13MetricSubtype32PEAK_SUSTAINED_REGION_PER_SECONDE", "priority": 1, "content": "enumerator PEAK_SUSTAINED_REGION_PER_SECOND", "keywords": []}, {"id": 457, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::MetricSubtype::PER_CYCLE_ACTIVE", "display_name": "NV::Rules::IMetric::MetricSubtype::PER_CYCLE_ACTIVE", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric13MetricSubtype16PER_CYCLE_ACTIVEE", "priority": 1, "content": "enumerator PER_CYCLE_ACTIVE", "keywords": []}, {"id": 458, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::MetricSubtype::PER_CYCLE_ELAPSED", "display_name": "NV::Rules::IMetric::MetricSubtype::PER_CYCLE_ELAPSED", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric13MetricSubtype17PER_CYCLE_ELAPSEDE", "priority": 1, "content": "enumerator PER_CYCLE_ELAPSED", "keywords": []}, {"id": 459, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::MetricSubtype::PER_CYCLE_IN_FRAME", "display_name": "NV::Rules::IMetric::MetricSubtype::PER_CYCLE_IN_FRAME", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric13MetricSubtype18PER_CYCLE_IN_FRAMEE", "priority": 1, "content": "enumerator PER_CYCLE_IN_FRAME", "keywords": []}, {"id": 460, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::MetricSubtype::PER_CYCLE_IN_REGION", "display_name": "NV::Rules::IMetric::MetricSubtype::PER_CYCLE_IN_REGION", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric13MetricSubtype19PER_CYCLE_IN_REGIONE", "priority": 1, "content": "enumerator PER_CYCLE_IN_REGION", "keywords": []}, {"id": 461, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::MetricSubtype::PER_SECOND", "display_name": "NV::Rules::IMetric::MetricSubtype::PER_SECOND", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric13MetricSubtype10PER_SECONDE", "priority": 1, "content": "enumerator PER_SECOND", "keywords": []}, {"id": 462, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::MetricSubtype::RATIO", "display_name": "NV::Rules::IMetric::MetricSubtype::RATIO", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric13MetricSubtype5RATIOE", "priority": 1, "content": "enumerator RATIO", "keywords": []}, {"id": 463, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::MetricType", "display_name": "NV::Rules::IMetric::MetricType", "type": "enum", "display_type": "C++ enum", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric10MetricTypeE", "priority": 1, "content": "enum class MetricType Metric type. Indicates the type of the metric. May take values COUNTER , RATIO or THROUGHPUT for hardware metrics, and OTHER for all other types (e.g. launch metrics, device attributes). Values:", "keywords": []}, {"id": 464, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::MetricType::COUNTER", "display_name": "NV::Rules::IMetric::MetricType::COUNTER", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric10MetricType7COUNTERE", "priority": 1, "content": "enumerator COUNTER", "keywords": []}, {"id": 465, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::MetricType::OTHER", "display_name": "NV::Rules::IMetric::MetricType::OTHER", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric10MetricType5OTHERE", "priority": 1, "content": "enumerator OTHER", "keywords": []}, {"id": 466, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::MetricType::RATIO", "display_name": "NV::Rules::IMetric::MetricType::RATIO", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric10MetricType5RATIOE", "priority": 1, "content": "enumerator RATIO", "keywords": []}, {"id": 467, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::MetricType::THROUGHPUT", "display_name": "NV::Rules::IMetric::MetricType::THROUGHPUT", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric10MetricType10THROUGHPUTE", "priority": 1, "content": "enumerator THROUGHPUT", "keywords": []}, {"id": 468, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::RollupOperation", "display_name": "NV::Rules::IMetric::RollupOperation", "type": "enum", "display_type": "C++ enum", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric15RollupOperationE", "priority": 1, "content": "enum class RollupOperation Rollup Operation. Indicates the type of operation that is used to accumulate multiple values of a given metric. May take values AVG , MAX , MIN and SUM , as well as None , if no such operation is specified. Values:", "keywords": []}, {"id": 469, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::RollupOperation::AVG", "display_name": "NV::Rules::IMetric::RollupOperation::AVG", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric15RollupOperation3AVGE", "priority": 1, "content": "enumerator AVG", "keywords": []}, {"id": 470, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::RollupOperation::MAX", "display_name": "NV::Rules::IMetric::RollupOperation::MAX", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric15RollupOperation3MAXE", "priority": 1, "content": "enumerator MAX", "keywords": []}, {"id": 471, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::RollupOperation::MIN", "display_name": "NV::Rules::IMetric::RollupOperation::MIN", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric15RollupOperation3MINE", "priority": 1, "content": "enumerator MIN", "keywords": []}, {"id": 472, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::RollupOperation::NONE", "display_name": "NV::Rules::IMetric::RollupOperation::NONE", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric15RollupOperation4NONEE", "priority": 1, "content": "enumerator NONE", "keywords": []}, {"id": 473, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::RollupOperation::SUM", "display_name": "NV::Rules::IMetric::RollupOperation::SUM", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric15RollupOperation3SUME", "priority": 1, "content": "enumerator SUM", "keywords": []}, {"id": 474, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::Unit", "display_name": "NV::Rules::IMetric::Unit", "type": "type", "display_type": "C++ type", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric4UnitE", "priority": 1, "content": "using Unit = std :: string", "keywords": []}, {"id": 475, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::ValueKind", "display_name": "NV::Rules::IMetric::ValueKind", "type": "enum", "display_type": "C++ enum", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric9ValueKindE", "priority": 1, "content": "enum class ValueKind Metric value kind. Indicates the kind (or type) of a metric value, metric instance value or correlation ID. Values:", "keywords": []}, {"id": 476, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::ValueKind::ANY", "display_name": "NV::Rules::IMetric::ValueKind::ANY", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric9ValueKind3ANYE", "priority": 1, "content": "enumerator ANY", "keywords": []}, {"id": 477, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::ValueKind::DOUBLE", "display_name": "NV::Rules::IMetric::ValueKind::DOUBLE", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric9ValueKind6DOUBLEE", "priority": 1, "content": "enumerator DOUBLE", "keywords": []}, {"id": 478, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::ValueKind::FLOAT", "display_name": "NV::Rules::IMetric::ValueKind::FLOAT", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric9ValueKind5FLOATE", "priority": 1, "content": "enumerator FLOAT", "keywords": []}, {"id": 479, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::ValueKind::STRING", "display_name": "NV::Rules::IMetric::ValueKind::STRING", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric9ValueKind6STRINGE", "priority": 1, "content": "enumerator STRING", "keywords": []}, {"id": 480, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::ValueKind::UINT32", "display_name": "NV::Rules::IMetric::ValueKind::UINT32", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric9ValueKind6UINT32E", "priority": 1, "content": "enumerator UINT32", "keywords": []}, {"id": 481, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::ValueKind::UINT64", "display_name": "NV::Rules::IMetric::ValueKind::UINT64", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric9ValueKind6UINT64E", "priority": 1, "content": "enumerator UINT64 Public Functions", "keywords": []}, {"id": 482, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::ValueKind::UNKNOWN", "display_name": "NV::Rules::IMetric::ValueKind::UNKNOWN", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric9ValueKind7UNKNOWNE", "priority": 1, "content": "enumerator UNKNOWN", "keywords": []}, {"id": 483, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::as_double", "display_name": "NV::Rules::IMetric::as_double", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric9as_doubleE6size_t", "priority": 1, "content": "virtual double as_double size_t instance = 0 Get a value from the metric instances as double. Get the value of metric instance instance as double", "keywords": []}, {"id": 484, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::as_double", "display_name": "NV::Rules::IMetric::as_double", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric9as_doubleEv", "priority": 1, "content": "virtual double as_double = 0 Get the metric value as double. Get the metric value as double", "keywords": []}, {"id": 485, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::as_double::instance", "display_name": "NV::Rules::IMetric::as_double::instance", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric9as_doubleE6size_t", "priority": 1, "content": "virtual double as_double size_t instance = 0 Get a value from the metric instances as double. Get the value of metric instance instance as double", "keywords": []}, {"id": 486, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::as_string", "display_name": "NV::Rules::IMetric::as_string", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric9as_stringE6size_t", "priority": 1, "content": "virtual const char * as_string size_t instance = 0 Get a value from the metric instances as string. Get the value of metric instance instance as string", "keywords": []}, {"id": 487, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::as_string", "display_name": "NV::Rules::IMetric::as_string", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric9as_stringEv", "priority": 1, "content": "virtual const char * as_string = 0 Get the metric value as string. Get the metric value as string", "keywords": []}, {"id": 488, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::as_string::instance", "display_name": "NV::Rules::IMetric::as_string::instance", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric9as_stringE6size_t", "priority": 1, "content": "virtual const char * as_string size_t instance = 0 Get a value from the metric instances as string. Get the value of metric instance instance as string", "keywords": []}, {"id": 489, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::as_uint64", "display_name": "NV::Rules::IMetric::as_uint64", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric9as_uint64E6size_t", "priority": 1, "content": "virtual uint64_t as_uint64 size_t instance = 0 Get a value from the metric instances as 64bit integer. Get the value of metric instance instance as 64bit integer", "keywords": []}, {"id": 490, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::as_uint64", "display_name": "NV::Rules::IMetric::as_uint64", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric9as_uint64Ev", "priority": 1, "content": "virtual uint64_t as_uint64 = 0 Get the metric value as 64bit integer. Get the metric value as 64bit integer", "keywords": []}, {"id": 491, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::as_uint64::instance", "display_name": "NV::Rules::IMetric::as_uint64::instance", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric9as_uint64E6size_t", "priority": 1, "content": "virtual uint64_t as_uint64 size_t instance = 0 Get a value from the metric instances as 64bit integer. Get the value of metric instance instance as 64bit integer", "keywords": []}, {"id": 492, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::correlation_ids", "display_name": "NV::Rules::IMetric::correlation_ids", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric15correlation_idsEv", "priority": 1, "content": "virtual IMetric * correlation_ids = 0 Get a metric object for this metric\u2019s instance value\u2019s correlation IDs. Returns a new metric object representing the correlation IDs for the metric\u2019s instance values. Use has_correlation_ids to check if this metric has correlation IDs for its instance values. Correlation IDs are used to associate instance values with the \u201cinstance\u201d their value represents. In the returned new metric object, the correlation IDs are that object\u2019s instance values.", "keywords": []}, {"id": 493, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::description", "display_name": "NV::Rules::IMetric::description", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4NK2NV5Rules7IMetric11descriptionEv", "priority": 1, "content": "virtual Description description const = 0 Get the metric description. Get a textual description of the metric", "keywords": []}, {"id": 494, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::has_correlation_ids", "display_name": "NV::Rules::IMetric::has_correlation_ids", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric19has_correlation_idsEv", "priority": 1, "content": "virtual bool has_correlation_ids = 0 Check if the metric has correlation IDs. If true, the metric has correlation IDs matching its instance values, which can be accessed using correlation_ids .", "keywords": []}, {"id": 495, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::has_value", "display_name": "NV::Rules::IMetric::has_value", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric9has_valueE9ValueKind", "priority": 1, "content": "virtual bool has_value ValueKind value_kind = 0 Check if the metric has a non-instanced value of a specific kind. Check if the metric has a value of a specific value_kind . If true, the metric may still have instance values, too.", "keywords": []}, {"id": 496, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::has_value", "display_name": "NV::Rules::IMetric::has_value", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric9has_valueEv", "priority": 1, "content": "virtual bool has_value = 0 Check if the metric has a non-instanced value. Check if the metric has a non-instanced value. If true, the metric may still have instance values, too.", "keywords": []}, {"id": 497, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::has_value::value_kind", "display_name": "NV::Rules::IMetric::has_value::value_kind", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric9has_valueE9ValueKind", "priority": 1, "content": "virtual bool has_value ValueKind value_kind = 0 Check if the metric has a non-instanced value of a specific kind. Check if the metric has a value of a specific value_kind . If true, the metric may still have instance values, too.", "keywords": []}, {"id": 498, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::kind", "display_name": "NV::Rules::IMetric::kind", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric4kindE6size_t", "priority": 1, "content": "virtual ValueKind kind size_t instance = 0 Get the metric value kind for an instance value. Get the metric value kind for its instance value instance . num_instances can be used to check the total number of instance values.", "keywords": []}, {"id": 499, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::kind", "display_name": "NV::Rules::IMetric::kind", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric4kindEv", "priority": 1, "content": "virtual ValueKind kind = 0 Get the metric value kind. Get the metric value kind", "keywords": []}, {"id": 500, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::kind::instance", "display_name": "NV::Rules::IMetric::kind::instance", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric4kindE6size_t", "priority": 1, "content": "virtual ValueKind kind size_t instance = 0 Get the metric value kind for an instance value. Get the metric value kind for its instance value instance . num_instances can be used to check the total number of instance values.", "keywords": []}, {"id": 501, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::metric_subtype", "display_name": "NV::Rules::IMetric::metric_subtype", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4NK2NV5Rules7IMetric14metric_subtypeEv", "priority": 1, "content": "virtual MetricSubtype metric_subtype const = 0 Get the metric subtype. Get the metric subtype", "keywords": []}, {"id": 502, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::metric_type", "display_name": "NV::Rules::IMetric::metric_type", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4NK2NV5Rules7IMetric11metric_typeEv", "priority": 1, "content": "virtual MetricType metric_type const = 0 Get the metric type. Get the metric type", "keywords": []}, {"id": 503, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::name", "display_name": "NV::Rules::IMetric::name", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric4nameEv", "priority": 1, "content": "virtual const char * name = 0 Get the metric name. Get the metric name", "keywords": []}, {"id": 504, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::num_instances", "display_name": "NV::Rules::IMetric::num_instances", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetric13num_instancesEv", "priority": 1, "content": "virtual size_t num_instances = 0 Get the number of instance values for this metric. Get the number of instance values for this metric. Not all metrics have instance values. If a metric has instance values, it may also have correlation_ids matching these instance values.", "keywords": []}, {"id": 505, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::rollup_operation", "display_name": "NV::Rules::IMetric::rollup_operation", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4NK2NV5Rules7IMetric16rollup_operationEv", "priority": 1, "content": "virtual RollupOperation rollup_operation const = 0 Get the type of rollup operation. Get the type of rollup operation", "keywords": []}, {"id": 506, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::unit", "display_name": "NV::Rules::IMetric::unit", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4NK2NV5Rules7IMetric4unitEv", "priority": 1, "content": "virtual Unit unit const = 0 Get the metric unit. Get the metric unit", "keywords": []}, {"id": 507, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "cpp", "name": "NV::Rules::IMetric::~IMetric", "display_name": "NV::Rules::IMetric::~IMetric", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "_CPPv4N2NV5Rules7IMetricD0Ev", "priority": 1, "content": "inline virtual ~IMetric", "keywords": []}, {"id": 508, "doc_id": 508, "filename": "api/classNV_1_1Rules_1_1IMetric.html", "domain_name": "std", "name": "api/classNV_1_1Rules_1_1IMetric", "display_name": "NV::Rules::IMetric", "type": "doc", "display_type": "Page", "docname": "api/classNV_1_1Rules_1_1IMetric", "anchor": "", "priority": -1, "content": "", "keywords": []}, {"id": 509, "doc_id": 518, "filename": "api/classNV_1_1Rules_1_1INvtxDomainInfo.html", "domain_name": "cpp", "name": "NV::Rules::INvtxDomainInfo", "display_name": "NV::Rules::INvtxDomainInfo", "type": "class", "display_type": "C++ class", "docname": "api/classNV_1_1Rules_1_1INvtxDomainInfo", "anchor": "_CPPv4N2NV5Rules15INvtxDomainInfoE", "priority": 1, "content": "class INvtxDomainInfo NvtxDomainInfo interface. Represents a single NVTX domain of the NVTX state, including all ranges associated with this domain. Public Functions", "keywords": []}, {"id": 510, "doc_id": 518, "filename": "api/classNV_1_1Rules_1_1INvtxDomainInfo.html", "domain_name": "cpp", "name": "NV::Rules::INvtxDomainInfo::name", "display_name": "NV::Rules::INvtxDomainInfo::name", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1INvtxDomainInfo", "anchor": "_CPPv4N2NV5Rules15INvtxDomainInfo4nameEv", "priority": 1, "content": "virtual std :: string name = 0 Get the domain name. Get the name of this domain", "keywords": []}, {"id": 511, "doc_id": 518, "filename": "api/classNV_1_1Rules_1_1INvtxDomainInfo.html", "domain_name": "cpp", "name": "NV::Rules::INvtxDomainInfo::push_pop_range", "display_name": "NV::Rules::INvtxDomainInfo::push_pop_range", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1INvtxDomainInfo", "anchor": "_CPPv4N2NV5Rules15INvtxDomainInfo14push_pop_rangeE6size_t", "priority": 1, "content": "virtual INvtxRange * push_pop_range size_t idx = 0 Get a push/pop range object. Get a push/pop INvtxRange object by it\u2019s running index \\idx. The index is identical to the range\u2019s order on the call stack.", "keywords": []}, {"id": 512, "doc_id": 518, "filename": "api/classNV_1_1Rules_1_1INvtxDomainInfo.html", "domain_name": "cpp", "name": "NV::Rules::INvtxDomainInfo::push_pop_range::idx", "display_name": "NV::Rules::INvtxDomainInfo::push_pop_range::idx", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1INvtxDomainInfo", "anchor": "_CPPv4N2NV5Rules15INvtxDomainInfo14push_pop_rangeE6size_t", "priority": 1, "content": "virtual INvtxRange * push_pop_range size_t idx = 0 Get a push/pop range object. Get a push/pop INvtxRange object by it\u2019s running index \\idx. The index is identical to the range\u2019s order on the call stack.", "keywords": []}, {"id": 513, "doc_id": 518, "filename": "api/classNV_1_1Rules_1_1INvtxDomainInfo.html", "domain_name": "cpp", "name": "NV::Rules::INvtxDomainInfo::push_pop_ranges", "display_name": "NV::Rules::INvtxDomainInfo::push_pop_ranges", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1INvtxDomainInfo", "anchor": "_CPPv4N2NV5Rules15INvtxDomainInfo15push_pop_rangesEv", "priority": 1, "content": "virtual std :: vector < std :: string > push_pop_ranges = 0 Get the list of push/pop range names. Get the sorted list of stacked push/pop range names in this domain, associated with the current INvtxState .", "keywords": []}, {"id": 514, "doc_id": 518, "filename": "api/classNV_1_1Rules_1_1INvtxDomainInfo.html", "domain_name": "cpp", "name": "NV::Rules::INvtxDomainInfo::start_end_range", "display_name": "NV::Rules::INvtxDomainInfo::start_end_range", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1INvtxDomainInfo", "anchor": "_CPPv4N2NV5Rules15INvtxDomainInfo15start_end_rangeE6size_t", "priority": 1, "content": "virtual INvtxRange * start_end_range size_t idx = 0 Get a start/end range object. Get a start/end INvtxRange object by it\u2019s running index \\idx.", "keywords": []}, {"id": 515, "doc_id": 518, "filename": "api/classNV_1_1Rules_1_1INvtxDomainInfo.html", "domain_name": "cpp", "name": "NV::Rules::INvtxDomainInfo::start_end_range::idx", "display_name": "NV::Rules::INvtxDomainInfo::start_end_range::idx", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1INvtxDomainInfo", "anchor": "_CPPv4N2NV5Rules15INvtxDomainInfo15start_end_rangeE6size_t", "priority": 1, "content": "virtual INvtxRange * start_end_range size_t idx = 0 Get a start/end range object. Get a start/end INvtxRange object by it\u2019s running index \\idx.", "keywords": []}, {"id": 516, "doc_id": 518, "filename": "api/classNV_1_1Rules_1_1INvtxDomainInfo.html", "domain_name": "cpp", "name": "NV::Rules::INvtxDomainInfo::start_end_ranges", "display_name": "NV::Rules::INvtxDomainInfo::start_end_ranges", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1INvtxDomainInfo", "anchor": "_CPPv4N2NV5Rules15INvtxDomainInfo16start_end_rangesEv", "priority": 1, "content": "virtual std :: vector < std :: string > start_end_ranges = 0 Get the list of start/end range names. Get the list of start/end range names in this domain, associated with the current INvtxState .", "keywords": []}, {"id": 517, "doc_id": 518, "filename": "api/classNV_1_1Rules_1_1INvtxDomainInfo.html", "domain_name": "cpp", "name": "NV::Rules::INvtxDomainInfo::~INvtxDomainInfo", "display_name": "NV::Rules::INvtxDomainInfo::~INvtxDomainInfo", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1INvtxDomainInfo", "anchor": "_CPPv4N2NV5Rules15INvtxDomainInfoD0Ev", "priority": 1, "content": "inline virtual ~INvtxDomainInfo", "keywords": []}, {"id": 518, "doc_id": 518, "filename": "api/classNV_1_1Rules_1_1INvtxDomainInfo.html", "domain_name": "std", "name": "api/classNV_1_1Rules_1_1INvtxDomainInfo", "display_name": "NV::Rules::INvtxDomainInfo", "type": "doc", "display_type": "Page", "docname": "api/classNV_1_1Rules_1_1INvtxDomainInfo", "anchor": "", "priority": -1, "content": "", "keywords": []}, {"id": 519, "doc_id": 539, "filename": "api/classNV_1_1Rules_1_1INvtxRange.html", "domain_name": "cpp", "name": "NV::Rules::INvtxRange", "display_name": "NV::Rules::INvtxRange", "type": "class", "display_type": "C++ class", "docname": "api/classNV_1_1Rules_1_1INvtxRange", "anchor": "_CPPv4N2NV5Rules10INvtxRangeE", "priority": 1, "content": "class INvtxRange NvtxRange interface. Represents a single NVTX Push/Pop or Start/End range. Public Types", "keywords": []}, {"id": 520, "doc_id": 539, "filename": "api/classNV_1_1Rules_1_1INvtxRange.html", "domain_name": "cpp", "name": "NV::Rules::INvtxRange::PayloadType", "display_name": "NV::Rules::INvtxRange::PayloadType", "type": "enum", "display_type": "C++ enum", "docname": "api/classNV_1_1Rules_1_1INvtxRange", "anchor": "_CPPv4N2NV5Rules10INvtxRange11PayloadTypeE", "priority": 1, "content": "enum class PayloadType NVTX payload type. Type of an NVTX payload. This can be used to choose the appropriate payload_as_* function. Values:", "keywords": []}, {"id": 521, "doc_id": 539, "filename": "api/classNV_1_1Rules_1_1INvtxRange.html", "domain_name": "cpp", "name": "NV::Rules::INvtxRange::PayloadType::PAYLOAD_DOUBLE", "display_name": "NV::Rules::INvtxRange::PayloadType::PAYLOAD_DOUBLE", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1INvtxRange", "anchor": "_CPPv4N2NV5Rules10INvtxRange11PayloadType14PAYLOAD_DOUBLEE", "priority": 1, "content": "enumerator PAYLOAD_DOUBLE", "keywords": []}, {"id": 522, "doc_id": 539, "filename": "api/classNV_1_1Rules_1_1INvtxRange.html", "domain_name": "cpp", "name": "NV::Rules::INvtxRange::PayloadType::PAYLOAD_FLOAT", "display_name": "NV::Rules::INvtxRange::PayloadType::PAYLOAD_FLOAT", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1INvtxRange", "anchor": "_CPPv4N2NV5Rules10INvtxRange11PayloadType13PAYLOAD_FLOATE", "priority": 1, "content": "enumerator PAYLOAD_FLOAT", "keywords": []}, {"id": 523, "doc_id": 539, "filename": "api/classNV_1_1Rules_1_1INvtxRange.html", "domain_name": "cpp", "name": "NV::Rules::INvtxRange::PayloadType::PAYLOAD_INT32", "display_name": "NV::Rules::INvtxRange::PayloadType::PAYLOAD_INT32", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1INvtxRange", "anchor": "_CPPv4N2NV5Rules10INvtxRange11PayloadType13PAYLOAD_INT32E", "priority": 1, "content": "enumerator PAYLOAD_INT32", "keywords": []}, {"id": 524, "doc_id": 539, "filename": "api/classNV_1_1Rules_1_1INvtxRange.html", "domain_name": "cpp", "name": "NV::Rules::INvtxRange::PayloadType::PAYLOAD_INT64", "display_name": "NV::Rules::INvtxRange::PayloadType::PAYLOAD_INT64", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1INvtxRange", "anchor": "_CPPv4N2NV5Rules10INvtxRange11PayloadType13PAYLOAD_INT64E", "priority": 1, "content": "enumerator PAYLOAD_INT64", "keywords": []}, {"id": 525, "doc_id": 539, "filename": "api/classNV_1_1Rules_1_1INvtxRange.html", "domain_name": "cpp", "name": "NV::Rules::INvtxRange::PayloadType::PAYLOAD_JSON", "display_name": "NV::Rules::INvtxRange::PayloadType::PAYLOAD_JSON", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1INvtxRange", "anchor": "_CPPv4N2NV5Rules10INvtxRange11PayloadType12PAYLOAD_JSONE", "priority": 1, "content": "enumerator PAYLOAD_JSON Public Functions", "keywords": []}, {"id": 526, "doc_id": 539, "filename": "api/classNV_1_1Rules_1_1INvtxRange.html", "domain_name": "cpp", "name": "NV::Rules::INvtxRange::PayloadType::PAYLOAD_UINT32", "display_name": "NV::Rules::INvtxRange::PayloadType::PAYLOAD_UINT32", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1INvtxRange", "anchor": "_CPPv4N2NV5Rules10INvtxRange11PayloadType14PAYLOAD_UINT32E", "priority": 1, "content": "enumerator PAYLOAD_UINT32", "keywords": []}, {"id": 527, "doc_id": 539, "filename": "api/classNV_1_1Rules_1_1INvtxRange.html", "domain_name": "cpp", "name": "NV::Rules::INvtxRange::PayloadType::PAYLOAD_UINT64", "display_name": "NV::Rules::INvtxRange::PayloadType::PAYLOAD_UINT64", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1INvtxRange", "anchor": "_CPPv4N2NV5Rules10INvtxRange11PayloadType14PAYLOAD_UINT64E", "priority": 1, "content": "enumerator PAYLOAD_UINT64", "keywords": []}, {"id": 528, "doc_id": 539, "filename": "api/classNV_1_1Rules_1_1INvtxRange.html", "domain_name": "cpp", "name": "NV::Rules::INvtxRange::PayloadType::PAYLOAD_UNKNOWN", "display_name": "NV::Rules::INvtxRange::PayloadType::PAYLOAD_UNKNOWN", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/classNV_1_1Rules_1_1INvtxRange", "anchor": "_CPPv4N2NV5Rules10INvtxRange11PayloadType15PAYLOAD_UNKNOWNE", "priority": 1, "content": "enumerator PAYLOAD_UNKNOWN", "keywords": []}, {"id": 529, "doc_id": 539, "filename": "api/classNV_1_1Rules_1_1INvtxRange.html", "domain_name": "cpp", "name": "NV::Rules::INvtxRange::category", "display_name": "NV::Rules::INvtxRange::category", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1INvtxRange", "anchor": "_CPPv4NK2NV5Rules10INvtxRange8categoryEv", "priority": 1, "content": "virtual uint32_t category const = 0 Get the category attribute value. Get the category attribute value. If INvtxRange::has_attributes returns false, the returned value is undefined.", "keywords": []}, {"id": 530, "doc_id": 539, "filename": "api/classNV_1_1Rules_1_1INvtxRange.html", "domain_name": "cpp", "name": "NV::Rules::INvtxRange::color", "display_name": "NV::Rules::INvtxRange::color", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1INvtxRange", "anchor": "_CPPv4NK2NV5Rules10INvtxRange5colorEv", "priority": 1, "content": "virtual uint32_t color const = 0 Get the color attribute value. Get the color attribute value. If INvtxRange::has_attributes returns false, the returned value is undefined.", "keywords": []}, {"id": 531, "doc_id": 539, "filename": "api/classNV_1_1Rules_1_1INvtxRange.html", "domain_name": "cpp", "name": "NV::Rules::INvtxRange::has_attributes", "display_name": "NV::Rules::INvtxRange::has_attributes", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1INvtxRange", "anchor": "_CPPv4NK2NV5Rules10INvtxRange14has_attributesEv", "priority": 1, "content": "virtual bool has_attributes const = 0 Check if the range has event attributes. Check if the range has event attributes, such as INvtxRange::color , INvtxRange::category , or INvtxRange::message .", "keywords": []}, {"id": 532, "doc_id": 539, "filename": "api/classNV_1_1Rules_1_1INvtxRange.html", "domain_name": "cpp", "name": "NV::Rules::INvtxRange::message", "display_name": "NV::Rules::INvtxRange::message", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1INvtxRange", "anchor": "_CPPv4NK2NV5Rules10INvtxRange7messageEv", "priority": 1, "content": "virtual std :: string message const = 0 Get the message attribute value. Get the message attribute value. If INvtxRange::has_attributes returns false, the returned value is undefined.", "keywords": []}, {"id": 533, "doc_id": 539, "filename": "api/classNV_1_1Rules_1_1INvtxRange.html", "domain_name": "cpp", "name": "NV::Rules::INvtxRange::name", "display_name": "NV::Rules::INvtxRange::name", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1INvtxRange", "anchor": "_CPPv4NK2NV5Rules10INvtxRange4nameEv", "priority": 1, "content": "virtual std :: string name const = 0 Get the range name. Get the name of this range", "keywords": []}, {"id": 534, "doc_id": 539, "filename": "api/classNV_1_1Rules_1_1INvtxRange.html", "domain_name": "cpp", "name": "NV::Rules::INvtxRange::payload_as_double", "display_name": "NV::Rules::INvtxRange::payload_as_double", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1INvtxRange", "anchor": "_CPPv4NK2NV5Rules10INvtxRange17payload_as_doubleEv", "priority": 1, "content": "virtual double payload_as_double const = 0 Get the payload attribute value as double (64-bit floating point) Get the payload attribute value as a double (64-bit floating point). If the INvtxRange::payload_type cannot be casted to double, the returned value is undefined. If INvtxRange::has_attributes returns false, the returned value is undefined.", "keywords": []}, {"id": 535, "doc_id": 539, "filename": "api/classNV_1_1Rules_1_1INvtxRange.html", "domain_name": "cpp", "name": "NV::Rules::INvtxRange::payload_as_string", "display_name": "NV::Rules::INvtxRange::payload_as_string", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1INvtxRange", "anchor": "_CPPv4NK2NV5Rules10INvtxRange17payload_as_stringEv", "priority": 1, "content": "virtual std :: string payload_as_string const = 0 Get the payload attribute value as a string. Get the payload attribute value as a string. If the INvtxRange::payload_type cannot be casted to a string, the returned value is undefined. If INvtxRange::has_attributes returns false, the returned value is undefined.", "keywords": []}, {"id": 536, "doc_id": 539, "filename": "api/classNV_1_1Rules_1_1INvtxRange.html", "domain_name": "cpp", "name": "NV::Rules::INvtxRange::payload_as_uint64", "display_name": "NV::Rules::INvtxRange::payload_as_uint64", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1INvtxRange", "anchor": "_CPPv4NK2NV5Rules10INvtxRange17payload_as_uint64Ev", "priority": 1, "content": "virtual uint64_t payload_as_uint64 const = 0 Get the payload attribute value as uint64. Get the payload attribute value as a uint64. If the INvtxRange::payload_type cannot be casted to uint64, the returned value is undefined. If INvtxRange::has_attributes returns false, the returned value is undefined.", "keywords": []}, {"id": 537, "doc_id": 539, "filename": "api/classNV_1_1Rules_1_1INvtxRange.html", "domain_name": "cpp", "name": "NV::Rules::INvtxRange::payload_type", "display_name": "NV::Rules::INvtxRange::payload_type", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1INvtxRange", "anchor": "_CPPv4NK2NV5Rules10INvtxRange12payload_typeEv", "priority": 1, "content": "virtual PayloadType payload_type const = 0 Get the payload attribute type. Get the payload attribute type. If INvtxRange::has_attributes returns false, the returned type is undefined.", "keywords": []}, {"id": 538, "doc_id": 539, "filename": "api/classNV_1_1Rules_1_1INvtxRange.html", "domain_name": "cpp", "name": "NV::Rules::INvtxRange::~INvtxRange", "display_name": "NV::Rules::INvtxRange::~INvtxRange", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1INvtxRange", "anchor": "_CPPv4N2NV5Rules10INvtxRangeD0Ev", "priority": 1, "content": "inline virtual ~INvtxRange", "keywords": []}, {"id": 539, "doc_id": 539, "filename": "api/classNV_1_1Rules_1_1INvtxRange.html", "domain_name": "std", "name": "api/classNV_1_1Rules_1_1INvtxRange", "display_name": "NV::Rules::INvtxRange", "type": "doc", "display_type": "Page", "docname": "api/classNV_1_1Rules_1_1INvtxRange", "anchor": "", "priority": -1, "content": "", "keywords": []}, {"id": 540, "doc_id": 545, "filename": "api/classNV_1_1Rules_1_1INvtxState.html", "domain_name": "cpp", "name": "NV::Rules::INvtxState", "display_name": "NV::Rules::INvtxState", "type": "class", "display_type": "C++ class", "docname": "api/classNV_1_1Rules_1_1INvtxState", "anchor": "_CPPv4N2NV5Rules10INvtxStateE", "priority": 1, "content": "class INvtxState NvtxState interface. Represents the NVTX (Nvidia Tools Extensions) state associated with a single action. Public Functions", "keywords": []}, {"id": 541, "doc_id": 545, "filename": "api/classNV_1_1Rules_1_1INvtxState.html", "domain_name": "cpp", "name": "NV::Rules::INvtxState::domain_by_id", "display_name": "NV::Rules::INvtxState::domain_by_id", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1INvtxState", "anchor": "_CPPv4N2NV5Rules10INvtxState12domain_by_idEy", "priority": 1, "content": "virtual INvtxDomainInfo * domain_by_id long long unsigned id = 0 Get a domain by ID. Get a single domain info object by its ID. Use INvtxState::domains to retrieve the list of valid domain IDs.", "keywords": []}, {"id": 542, "doc_id": 545, "filename": "api/classNV_1_1Rules_1_1INvtxState.html", "domain_name": "cpp", "name": "NV::Rules::INvtxState::domain_by_id::id", "display_name": "NV::Rules::INvtxState::domain_by_id::id", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1INvtxState", "anchor": "_CPPv4N2NV5Rules10INvtxState12domain_by_idEy", "priority": 1, "content": "virtual INvtxDomainInfo * domain_by_id long long unsigned id = 0 Get a domain by ID. Get a single domain info object by its ID. Use INvtxState::domains to retrieve the list of valid domain IDs.", "keywords": []}, {"id": 543, "doc_id": 545, "filename": "api/classNV_1_1Rules_1_1INvtxState.html", "domain_name": "cpp", "name": "NV::Rules::INvtxState::domains", "display_name": "NV::Rules::INvtxState::domains", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1INvtxState", "anchor": "_CPPv4N2NV5Rules10INvtxState7domainsEv", "priority": 1, "content": "virtual std :: vector < long long unsigned > domains = 0 Get the domain IDs. Get the list of domain IDs in this state", "keywords": []}, {"id": 544, "doc_id": 545, "filename": "api/classNV_1_1Rules_1_1INvtxState.html", "domain_name": "cpp", "name": "NV::Rules::INvtxState::~INvtxState", "display_name": "NV::Rules::INvtxState::~INvtxState", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1INvtxState", "anchor": "_CPPv4N2NV5Rules10INvtxStateD0Ev", "priority": 1, "content": "inline virtual ~INvtxState", "keywords": []}, {"id": 545, "doc_id": 545, "filename": "api/classNV_1_1Rules_1_1INvtxState.html", "domain_name": "std", "name": "api/classNV_1_1Rules_1_1INvtxState", "display_name": "NV::Rules::INvtxState", "type": "doc", "display_type": "Page", "docname": "api/classNV_1_1Rules_1_1INvtxState", "anchor": "", "priority": -1, "content": "", "keywords": []}, {"id": 546, "doc_id": 554, "filename": "api/classNV_1_1Rules_1_1IRange.html", "domain_name": "cpp", "name": "NV::Rules::IRange", "display_name": "NV::Rules::IRange", "type": "class", "display_type": "C++ class", "docname": "api/classNV_1_1Rules_1_1IRange", "anchor": "_CPPv4N2NV5Rules6IRangeE", "priority": 1, "content": "class IRange Range interface. Represents a serial, ordered stream of execution, such as a CUDA stream. It holds one or more actions that were logically executing in this range Public Functions", "keywords": []}, {"id": 547, "doc_id": 554, "filename": "api/classNV_1_1Rules_1_1IRange.html", "domain_name": "cpp", "name": "NV::Rules::IRange::action_by_idx", "display_name": "NV::Rules::IRange::action_by_idx", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IRange", "anchor": "_CPPv4N2NV5Rules6IRange13action_by_idxE6size_t", "priority": 1, "content": "virtual IAction * action_by_idx size_t idx = 0 Get a single action by index. Get a single IAction by index idx .", "keywords": []}, {"id": 548, "doc_id": 554, "filename": "api/classNV_1_1Rules_1_1IRange.html", "domain_name": "cpp", "name": "NV::Rules::IRange::action_by_idx::idx", "display_name": "NV::Rules::IRange::action_by_idx::idx", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IRange", "anchor": "_CPPv4N2NV5Rules6IRange13action_by_idxE6size_t", "priority": 1, "content": "virtual IAction * action_by_idx size_t idx = 0 Get a single action by index. Get a single IAction by index idx .", "keywords": []}, {"id": 549, "doc_id": 554, "filename": "api/classNV_1_1Rules_1_1IRange.html", "domain_name": "cpp", "name": "NV::Rules::IRange::actions_by_nvtx", "display_name": "NV::Rules::IRange::actions_by_nvtx", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IRange", "anchor": "_CPPv4N2NV5Rules6IRange15actions_by_nvtxERKNSt6vectorINSt6stringEEERKNSt6vectorINSt6stringEEE", "priority": 1, "content": "virtual std :: set < long long unsigned > actions_by_nvtx const std :: vector < std :: string > & includes const std :: vector < std :: string > & excludes = 0 Get a set of actions by their NVTX state. Get a set of indizes to IAction objects by their NVTX state. The state is defined using a series of includes and excludes .", "keywords": []}, {"id": 550, "doc_id": 554, "filename": "api/classNV_1_1Rules_1_1IRange.html", "domain_name": "cpp", "name": "NV::Rules::IRange::actions_by_nvtx::excludes", "display_name": "NV::Rules::IRange::actions_by_nvtx::excludes", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IRange", "anchor": "_CPPv4N2NV5Rules6IRange15actions_by_nvtxERKNSt6vectorINSt6stringEEERKNSt6vectorINSt6stringEEE", "priority": 1, "content": "virtual std :: set < long long unsigned > actions_by_nvtx const std :: vector < std :: string > & includes const std :: vector < std :: string > & excludes = 0 Get a set of actions by their NVTX state. Get a set of indizes to IAction objects by their NVTX state. The state is defined using a series of includes and excludes .", "keywords": []}, {"id": 551, "doc_id": 554, "filename": "api/classNV_1_1Rules_1_1IRange.html", "domain_name": "cpp", "name": "NV::Rules::IRange::actions_by_nvtx::includes", "display_name": "NV::Rules::IRange::actions_by_nvtx::includes", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/classNV_1_1Rules_1_1IRange", "anchor": "_CPPv4N2NV5Rules6IRange15actions_by_nvtxERKNSt6vectorINSt6stringEEERKNSt6vectorINSt6stringEEE", "priority": 1, "content": "virtual std :: set < long long unsigned > actions_by_nvtx const std :: vector < std :: string > & includes const std :: vector < std :: string > & excludes = 0 Get a set of actions by their NVTX state. Get a set of indizes to IAction objects by their NVTX state. The state is defined using a series of includes and excludes .", "keywords": []}, {"id": 552, "doc_id": 554, "filename": "api/classNV_1_1Rules_1_1IRange.html", "domain_name": "cpp", "name": "NV::Rules::IRange::num_actions", "display_name": "NV::Rules::IRange::num_actions", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IRange", "anchor": "_CPPv4N2NV5Rules6IRange11num_actionsEv", "priority": 1, "content": "virtual size_t num_actions = 0 Get the number of actions. Get the number of available actions in this range", "keywords": []}, {"id": 553, "doc_id": 554, "filename": "api/classNV_1_1Rules_1_1IRange.html", "domain_name": "cpp", "name": "NV::Rules::IRange::~IRange", "display_name": "NV::Rules::IRange::~IRange", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1IRange", "anchor": "_CPPv4N2NV5Rules6IRangeD0Ev", "priority": 1, "content": "inline virtual ~IRange", "keywords": []}, {"id": 554, "doc_id": 554, "filename": "api/classNV_1_1Rules_1_1IRange.html", "domain_name": "std", "name": "api/classNV_1_1Rules_1_1IRange", "display_name": "NV::Rules::IRange", "type": "doc", "display_type": "Page", "docname": "api/classNV_1_1Rules_1_1IRange", "anchor": "", "priority": -1, "content": "", "keywords": []}, {"id": 555, "doc_id": 559, "filename": "api/classNV_1_1Rules_1_1ISourceInfo.html", "domain_name": "cpp", "name": "NV::Rules::ISourceInfo", "display_name": "NV::Rules::ISourceInfo", "type": "class", "display_type": "C++ class", "docname": "api/classNV_1_1Rules_1_1ISourceInfo", "anchor": "_CPPv4N2NV5Rules11ISourceInfoE", "priority": 1, "content": "class ISourceInfo SourceInfo interface. Represents the source correlation info for a specific function address within an action Public Functions", "keywords": []}, {"id": 556, "doc_id": 559, "filename": "api/classNV_1_1Rules_1_1ISourceInfo.html", "domain_name": "cpp", "name": "NV::Rules::ISourceInfo::file_name", "display_name": "NV::Rules::ISourceInfo::file_name", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1ISourceInfo", "anchor": "_CPPv4N2NV5Rules11ISourceInfo9file_nameEv", "priority": 1, "content": "virtual const char * file_name = 0 Get the file name. Get the file name, as embedded in the correlation info", "keywords": []}, {"id": 557, "doc_id": 559, "filename": "api/classNV_1_1Rules_1_1ISourceInfo.html", "domain_name": "cpp", "name": "NV::Rules::ISourceInfo::line", "display_name": "NV::Rules::ISourceInfo::line", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1ISourceInfo", "anchor": "_CPPv4N2NV5Rules11ISourceInfo4lineEv", "priority": 1, "content": "virtual uint32_t line = 0 Get the file line. Get the line within file_name", "keywords": []}, {"id": 558, "doc_id": 559, "filename": "api/classNV_1_1Rules_1_1ISourceInfo.html", "domain_name": "cpp", "name": "NV::Rules::ISourceInfo::~ISourceInfo", "display_name": "NV::Rules::ISourceInfo::~ISourceInfo", "type": "function", "display_type": "C++ function", "docname": "api/classNV_1_1Rules_1_1ISourceInfo", "anchor": "_CPPv4N2NV5Rules11ISourceInfoD0Ev", "priority": 1, "content": "inline virtual ~ISourceInfo", "keywords": []}, {"id": 559, "doc_id": 559, "filename": "api/classNV_1_1Rules_1_1ISourceInfo.html", "domain_name": "std", "name": "api/classNV_1_1Rules_1_1ISourceInfo", "display_name": "NV::Rules::ISourceInfo", "type": "doc", "display_type": "Page", "docname": "api/classNV_1_1Rules_1_1ISourceInfo", "anchor": "", "priority": -1, "content": "", "keywords": []}, {"id": 560, "doc_id": 560, "filename": "api/data-structures.html", "domain_name": "std", "name": "api/data-structures", "display_name": "Data Structures", "type": "doc", "display_type": "Page", "docname": "api/data-structures", "anchor": "", "priority": -1, "content": "NV::Rules::IAction : Action interface. NV::Rules::IBaseContext NV::Rules::IContext : Context interface. NV::Rules::IController : Controller interface. NV::Rules::IEvaluator : Evaluator interface. NV::Rules::IFrontend : Frontend interface. NV::Rules::IMessageVault NV::Rules::IMetric : Metric interface. NV::Rules::INvtxDomainInfo : NvtxDomainInfo interface. NV::Rules::INvtxRange : NvtxRange interface. NV::Rules::INvtxState : NvtxState interface. NV::Rules::IRange : Range interface. NV::Rules::ISourceInfo : SourceInfo interface.", "keywords": []}, {"id": 561, "doc_id": 561, "filename": "api/group__NVRULES__HW.html", "domain_name": "std", "name": "api/group__NVRULES__HW", "display_name": "NvRules Tool lifetime-managed classes.", "type": "doc", "display_type": "Page", "docname": "api/group__NVRULES__HW", "anchor": "", "priority": -1, "content": "Objects of heavyweight classes are lifetime-managed by the tool. Data Structures NV::Rules::IBaseContext NV::Rules::IContext : Context interface. NV::Rules::IController : Controller interface. NV::Rules::IEvaluator : Evaluator interface. NV::Rules::IFrontend : Frontend interface. NV::Rules::IMessageVault", "keywords": []}, {"id": 562, "doc_id": 562, "filename": "api/group__NVRULES__LW.html", "domain_name": "std", "name": "api/group__NVRULES__LW", "display_name": "NvRules Python garbage-collected classes.", "type": "doc", "display_type": "Page", "docname": "api/group__NVRULES__LW", "anchor": "", "priority": -1, "content": "Objects of lightweight classes are garbage-collected by the python runtime. Data Structures NV::Rules::IAction : Action interface. NV::Rules::IMetric : Metric interface. NV::Rules::INvtxDomainInfo : NvtxDomainInfo interface. NV::Rules::INvtxRange : NvtxRange interface. NV::Rules::INvtxState : NvtxState interface. NV::Rules::IRange : Range interface. NV::Rules::ISourceInfo : SourceInfo interface.", "keywords": []}, {"id": 563, "doc_id": 573, "filename": "api/group__NVRULES__NM.html", "domain_name": "cpp", "name": "NV::Rules::ContextHandle", "display_name": "NV::Rules::ContextHandle", "type": "type", "display_type": "C++ type", "docname": "api/group__NVRULES__NM", "anchor": "_CPPv4N2NV5Rules13ContextHandleE", "priority": 1, "content": "typedef unsigned long long NV :: Rules :: ContextHandle", "keywords": []}, {"id": 564, "doc_id": 573, "filename": "api/group__NVRULES__NM.html", "domain_name": "cpp", "name": "NV::Rules::get_context", "display_name": "NV::Rules::get_context", "type": "function", "display_type": "C++ function", "docname": "api/group__NVRULES__NM", "anchor": "_CPPv4N2NV5Rules11get_contextE13ContextHandle", "priority": 1, "content": "IContext * NV :: Rules :: get_context ContextHandle h Converts the context handle. Converts the context handle h to an IContext object", "keywords": []}, {"id": 565, "doc_id": 573, "filename": "api/group__NVRULES__NM.html", "domain_name": "cpp", "name": "NV::Rules::get_context::h", "display_name": "NV::Rules::get_context::h", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/group__NVRULES__NM", "anchor": "_CPPv4N2NV5Rules11get_contextE13ContextHandle", "priority": 1, "content": "IContext * NV :: Rules :: get_context ContextHandle h Converts the context handle. Converts the context handle h to an IContext object", "keywords": []}, {"id": 566, "doc_id": 573, "filename": "api/group__NVRULES__NM.html", "domain_name": "cpp", "name": "NV::Rules::get_evaluator", "display_name": "NV::Rules::get_evaluator", "type": "function", "display_type": "C++ function", "docname": "api/group__NVRULES__NM", "anchor": "_CPPv4N2NV5Rules13get_evaluatorE13ContextHandle", "priority": 1, "content": "IEvaluator * NV :: Rules :: get_evaluator ContextHandle h Returns the evaluator object. Return the IEvaluator object from the context handle h", "keywords": []}, {"id": 567, "doc_id": 573, "filename": "api/group__NVRULES__NM.html", "domain_name": "cpp", "name": "NV::Rules::get_evaluator::h", "display_name": "NV::Rules::get_evaluator::h", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/group__NVRULES__NM", "anchor": "_CPPv4N2NV5Rules13get_evaluatorE13ContextHandle", "priority": 1, "content": "IEvaluator * NV :: Rules :: get_evaluator ContextHandle h Returns the evaluator object. Return the IEvaluator object from the context handle h", "keywords": []}, {"id": 568, "doc_id": 573, "filename": "api/group__NVRULES__NM.html", "domain_name": "cpp", "name": "NV::Rules::get_version", "display_name": "NV::Rules::get_version", "type": "function", "display_type": "C++ function", "docname": "api/group__NVRULES__NM", "anchor": "_CPPv4N2NV5Rules11get_versionE13ContextHandle", "priority": 1, "content": "std :: string NV :: Rules :: get_version ContextHandle h Get version number of this interface. Returns the version number of this interface as a string of the form <year>.<major>.<minor> It matches the Nsight Compute version this interface originates from.", "keywords": []}, {"id": 569, "doc_id": 573, "filename": "api/group__NVRULES__NM.html", "domain_name": "cpp", "name": "NV::Rules::get_version::h", "display_name": "NV::Rules::get_version::h", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/group__NVRULES__NM", "anchor": "_CPPv4N2NV5Rules11get_versionE13ContextHandle", "priority": 1, "content": "std :: string NV :: Rules :: get_version ContextHandle h Get version number of this interface. Returns the version number of this interface as a string of the form <year>.<major>.<minor> It matches the Nsight Compute version this interface originates from.", "keywords": []}, {"id": 570, "doc_id": 573, "filename": "api/group__NVRULES__NM.html", "domain_name": "cpp", "name": "NV::Rules::raise_exception", "display_name": "NV::Rules::raise_exception", "type": "function", "display_type": "C++ function", "docname": "api/group__NVRULES__NM", "anchor": "_CPPv4N2NV5Rules15raise_exceptionE13ContextHandlePKc", "priority": 1, "content": "void NV :: Rules :: raise_exception ContextHandle h const char * msg Raises a python exception. Raise a python exception with msg . This will terminate the script execution, if the context does not chose to mask the exception", "keywords": []}, {"id": 571, "doc_id": 573, "filename": "api/group__NVRULES__NM.html", "domain_name": "cpp", "name": "NV::Rules::raise_exception::h", "display_name": "NV::Rules::raise_exception::h", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/group__NVRULES__NM", "anchor": "_CPPv4N2NV5Rules15raise_exceptionE13ContextHandlePKc", "priority": 1, "content": "void NV :: Rules :: raise_exception ContextHandle h const char * msg Raises a python exception. Raise a python exception with msg . This will terminate the script execution, if the context does not chose to mask the exception", "keywords": []}, {"id": 572, "doc_id": 573, "filename": "api/group__NVRULES__NM.html", "domain_name": "cpp", "name": "NV::Rules::raise_exception::msg", "display_name": "NV::Rules::raise_exception::msg", "type": "functionParam", "display_type": "C++ function parameter", "docname": "api/group__NVRULES__NM", "anchor": "_CPPv4N2NV5Rules15raise_exceptionE13ContextHandlePKc", "priority": 1, "content": "void NV :: Rules :: raise_exception ContextHandle h const char * msg Raises a python exception. Raise a python exception with msg . This will terminate the script execution, if the context does not chose to mask the exception", "keywords": []}, {"id": 573, "doc_id": 573, "filename": "api/group__NVRULES__NM.html", "domain_name": "std", "name": "api/group__NVRULES__NM", "display_name": "NvRules non-member functions.", "type": "doc", "display_type": "Page", "docname": "api/group__NVRULES__NM", "anchor": "", "priority": -1, "content": "Non-member utility functions. Functions NV::Rules::get_context(ContextHandle h) : Converts the context handle. NV::Rules::get_evaluator(ContextHandle h) : Returns the evaluator object. NV::Rules::get_version(ContextHandle h) : Get version number of this interface. NV::Rules::raise_exception(ContextHandle h, const char *msg) : Raises a python exception. Typedefs NV::Rules::ContextHandle", "keywords": []}, {"id": 574, "doc_id": 574, "filename": "api/modules.html", "domain_name": "std", "name": "api/modules", "display_name": "Modules", "type": "doc", "display_type": "Page", "docname": "api/modules", "anchor": "", "priority": -1, "content": "NvRules Python garbage-collected classes. : Objects of lightweight classes are garbage-collected by the python runtime. NvRules Tool lifetime-managed classes. : Objects of heavyweight classes are lifetime-managed by the tool. NvRules non-member functions. : Non-member utility functions.", "keywords": []}, {"id": 575, "doc_id": 576, "filename": "api/namespaceNV.html", "domain_name": "cpp", "name": "NV", "display_name": "NV", "type": "type", "display_type": "C++ type", "docname": "api/namespaceNV", "anchor": "_CPPv42NV", "priority": 1, "content": "namespace NV Namespaces Rules", "keywords": []}, {"id": 576, "doc_id": 576, "filename": "api/namespaceNV.html", "domain_name": "std", "name": "api/namespaceNV", "display_name": "NV", "type": "doc", "display_type": "Page", "docname": "api/namespaceNV", "anchor": "", "priority": -1, "content": "", "keywords": []}, {"id": 577, "doc_id": 581, "filename": "api/namespaceNV_1_1Rules.html", "domain_name": "cpp", "name": "NV::Rules", "display_name": "NV::Rules", "type": "type", "display_type": "C++ type", "docname": "api/namespaceNV_1_1Rules", "anchor": "_CPPv4N2NV5RulesE", "priority": 1, "content": "namespace Rules Data Structures IAction : Action interface. IBaseContext IContext : Context interface. IController : Controller interface. IEvaluator : Evaluator interface. IFrontend : Frontend interface. IMessageVault IMetric : Metric interface. INvtxDomainInfo : NvtxDomainInfo interface. INvtxRange : NvtxRange interface. INvtxState : NvtxState interface. IRange : Range interface. ISourceInfo : SourceInfo interface. Enumerations RuleKind : Rule kind. Functions get_context(ContextHandle h) : Converts the context handle. get_evaluator(ContextHandle h) : Returns the evaluator object. get_version(ContextHandle h) : Get version number of this interface. raise_exception(ContextHandle h, const char *msg) : Raises a python exception. Typedefs ContextHandle", "keywords": []}, {"id": 578, "doc_id": 581, "filename": "api/namespaceNV_1_1Rules.html", "domain_name": "cpp", "name": "NV::Rules::RuleKind", "display_name": "NV::Rules::RuleKind", "type": "enum", "display_type": "C++ enum", "docname": "api/namespaceNV_1_1Rules", "anchor": "_CPPv4N2NV5Rules8RuleKindE", "priority": 1, "content": "enum class NV :: Rules :: RuleKind Rule kind. Reserved for future use. Values:", "keywords": []}, {"id": 579, "doc_id": 581, "filename": "api/namespaceNV_1_1Rules.html", "domain_name": "cpp", "name": "NV::Rules::RuleKind::DEFAULT", "display_name": "NV::Rules::RuleKind::DEFAULT", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/namespaceNV_1_1Rules", "anchor": "_CPPv4N2NV5Rules8RuleKind7DEFAULTE", "priority": 1, "content": "enumerator DEFAULT", "keywords": []}, {"id": 580, "doc_id": 581, "filename": "api/namespaceNV_1_1Rules.html", "domain_name": "cpp", "name": "NV::Rules::RuleKind::GUIDED", "display_name": "NV::Rules::RuleKind::GUIDED", "type": "enumerator", "display_type": "C++ enumerator", "docname": "api/namespaceNV_1_1Rules", "anchor": "_CPPv4N2NV5Rules8RuleKind6GUIDEDE", "priority": 1, "content": "enumerator GUIDED", "keywords": []}, {"id": 581, "doc_id": 581, "filename": "api/namespaceNV_1_1Rules.html", "domain_name": "std", "name": "api/namespaceNV_1_1Rules", "display_name": "NV::Rules", "type": "doc", "display_type": "Page", "docname": "api/namespaceNV_1_1Rules", "anchor": "", "priority": -1, "content": "", "keywords": []}, {"id": 582, "doc_id": 582, "filename": "api/namespaces.html", "domain_name": "std", "name": "api/namespaces", "display_name": "Namespaces", "type": "doc", "display_type": "Page", "docname": "api/namespaces", "anchor": "", "priority": -1, "content": "NV NV::Rules", "keywords": []}, {"id": 583, "doc_id": 588, "filename": "index.html", "domain_name": "page", "name": "index#copyright-and-licenses", "display_name": "Copyright And Licenses", "type": "section", "display_type": "Page section", "docname": "index", "anchor": "copyright-and-licenses", "priority": -1, "content": "Copyright and Licenses Information on the NVIDIA Software License Agreement as well as third party software and tools used by Nsight Compute.", "keywords": []}, {"id": 584, "doc_id": 588, "filename": "index.html", "domain_name": "page", "name": "index#developer-interfaces", "display_name": "Developer Interfaces", "type": "section", "display_type": "Page section", "docname": "index", "anchor": "developer-interfaces", "priority": -1, "content": "Customization Guide User manual on customizing NVIDIA Nsight Compute tools or integrating them with custom workflows. Information on writing section files, rules for automatic result analysis and scripting access to report files.", "keywords": []}, {"id": 585, "doc_id": 588, "filename": "index.html", "domain_name": "page", "name": "index#nsight-compute", "display_name": "Nsight Compute", "type": "section", "display_type": "Page section", "docname": "index", "anchor": "nsight-compute", "priority": -1, "content": "Release Notes Release notes, including new features and important bug fixes. Supported platforms and GPUs. List of known issues for the current release. Kernel Profiling Guide Kernel Profiling Guide with metric types and meaning, data collection modes and FAQ for common problems. Nsight Compute NVIDIA Nsight Compute User Interface (UI) manual. Information on all views, controls and workflows within the tool UI. Transitions guide for Visual Profiler. Nsight Compute CLI NVIDIA Nsight Compute Command Line Interface (CLI) manual. Information on workflows and options for the command line, including multi-process profiling and NVTX filtering. Transitions guide for Nvprof.", "keywords": []}, {"id": 586, "doc_id": 588, "filename": "index.html", "domain_name": "page", "name": "index#release-information", "display_name": "Release Information", "type": "section", "display_type": "Page section", "docname": "index", "anchor": "release-information", "priority": -1, "content": "Archives Find documentation for previous versions of NVIDIA Nsight Compute.", "keywords": []}, {"id": 587, "doc_id": 588, "filename": "index.html", "domain_name": "page", "name": "index#training", "display_name": "Training", "type": "section", "display_type": "Page section", "docname": "index", "anchor": "training", "priority": -1, "content": "Training NVIDIA Nsight Compute Training resources.", "keywords": []}, {"id": 588, "doc_id": 588, "filename": "index.html", "domain_name": "std", "name": "index", "display_name": "Nsight Compute Documentation", "type": "doc", "display_type": "Page", "docname": "index", "anchor": "", "priority": -1, "content": "", "keywords": []}]}; \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/CpuStacktrace.proto b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/CpuStacktrace.proto new file mode 100644 index 0000000000000000000000000000000000000000..c87f7392b6ced4bc5c0bb34b2f795dd6b9f44f4c --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/CpuStacktrace.proto @@ -0,0 +1,59 @@ +syntax = "proto2"; +package NV.CpuStacktrace; + +enum CpuStacktraceCategory +{ + // Every feature counts Category 0 as invalid. Then the array of categories.size() is always > 1. + CpuStacktraceCategoryInvalid = 0; + CpuStacktraceCategoryCollect = 1; + + // DO NOT RE-ORDER THESE CATEGORIES + // Always add a new category at the end. +} + +enum CpuStacktraceMethod +{ + // Every feature counts Category 0 as invalid. Then the array of categories.size() is always > 1. + CpuStacktraceMethodInvalid = 0; + CpuStacktraceMethodCollectStackRequestMessage = 1; + CpuStacktraceMethodCollectStackReplyMessage = 2; + + // DO NOT RE-ORDER THESE CATEGORIES + // Always add a new category at the end. +} + +message CpuStacktraceCollectStackRequestMessage +{ + message TypeInfo + { + optional CpuStacktraceCategory Category = 1 [default = CpuStacktraceCategoryCollect]; + optional CpuStacktraceMethod Method = 2 [default = CpuStacktraceMethodCollectStackRequestMessage]; + } + + required uint32 ThreadID = 1; +} + +message CpuStacktraceStackFrameMessage +{ + required string ModuleName = 1; + required uint64 PC = 2; + optional string FileName = 3; + optional string FuncName = 4; + optional uint32 Line = 5; +} + +message CpuStacktraceStackMessage +{ + repeated CpuStacktraceStackFrameMessage Frames = 1; +} + +message CpuStacktraceCollectStackReplyMessage +{ + message TypeInfo + { + optional CpuStacktraceCategory Category = 1 [default = CpuStacktraceCategoryCollect]; + optional CpuStacktraceMethod Method = 2 [default = CpuStacktraceMethodCollectStackReplyMessage]; + } + + required CpuStacktraceStackMessage Stack = 1; +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/Nvtx.proto b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/Nvtx.proto new file mode 100644 index 0000000000000000000000000000000000000000..c6447e8d01e36e45f573fb3a016a63a5d4a848b1 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/Nvtx.proto @@ -0,0 +1,179 @@ +syntax = "proto2"; +package NV.Nvtx; +import "Nvtx/NvtxCategories.proto"; + +enum NvtxMethod +{ + // Every feature counts Method 0 as invalid. The array of categories.size() is always > 1. + NvtxMethodInvalid = 0; + + NvtxMethodRequestStateMessage = 1; + NvtxMethodReplyStateMessage = 2; + + // ONLY ADD AT THE END OF THIS LIST. DO NOT RE-ORDER. +} + +message NvtxRequestStateMessage +{ + message TypeInfo + { + optional NvtxCategory Category = 1 [default = NvtxCategoryState]; + optional NvtxMethod Method = 2 [default = NvtxMethodRequestStateMessage]; + } +} + +enum NvtxColorType +{ + NvtxColorTypeUnknown = 0; + NvtxColorTypeArgb = 1; +} + +enum NvtxPayloadType +{ + NvtxPayloadTypeUnknown = 0; + + NvtxPayloadTypeUint64 = 1; + NvtxPayloadTypeInt64 = 2; + NvtxPayloadTypeDouble = 3; + NvtxPayloadTypeUint32 = 4; + NvtxPayloadTypeInt32 = 5; + NvtxPayloadTypeFloat = 6; + NvtxPayloadTypeJson = 7; // stored in StrValue + NvtxPayloadTypeJsonRegistered = 8; // stored in ULLValue +} + +message NvtxPayload +{ + required NvtxPayloadType PayloadType = 1 [default = NvtxPayloadTypeUnknown]; + optional uint64 ULLValue = 2; + optional int64 LLValue = 3; + optional double DoubleValue = 4; + optional uint32 UValue = 5; + optional int32 IValue = 6; + optional float FValue = 7; + optional string StrValue = 8; +} + +enum NvtxMessageType +{ + NvtxMessageTypeUnknown = 0; + NvtxMessageTypeAscii = 1; + NvtxMessageTypeUnicode = 2; + NvtxMessageTypeRegistered = 3; +} + +message NvtxMessage +{ + required NvtxMessageType MessageType = 1 [default = NvtxMessageTypeUnknown]; + optional string message = 2; + optional uint64 handle = 3; +} + +message NvtxColor +{ + required NvtxColorType ColorType = 1 [default = NvtxColorTypeUnknown]; + optional uint32 Color = 2; +} + +message NvtxEventAttributes +{ + required uint32 Version = 1; + required uint32 Category = 2; + required NvtxColor Color = 3; + required NvtxPayload Payload = 4; + required NvtxMessage Message = 5; +} + +message NvtxPushPopRange +{ + required string Name = 1; + optional NvtxEventAttributes Attributes = 2; + optional uint64 LastApiCallId = 3; +} + +message NvtxStartEndRange +{ + required uint64 Id = 1; + required string Name = 2; + optional NvtxEventAttributes Attributes = 3; + optional uint64 LastApiCallId = 4; + optional uint32 StartTID = 5; +} + +message NvtxPushPopDomain +{ + required uint64 Id = 1; + repeated NvtxPushPopRange Stack = 3; +} + +message NvtxStartEndDomain +{ + required uint64 Id = 1; + repeated NvtxStartEndRange Ranges = 3; +} + +message NvtxRegisteredString +{ + required uint64 Id = 1; + required string Value = 2; +} + +message NvtxDomainInfo +{ + required uint64 Id = 1; + required string Name = 2; + repeated NvtxRegisteredString Strings = 3; + repeated NvtxNameTable NameTables = 4; +} + +message NvtxThread +{ + required uint32 TID = 1; + repeated NvtxPushPopDomain PushPopDomains = 2; +} + +enum NvtxNameFamily +{ + NvtxNameFamilyUnknown = 0; + NvtxNameFamilyCategory = 1; + NvtxNameFamilyOsThread = 2; + NvtxNameFamilyCudaDevice = 3; + NvtxNameFamilyCudaContext = 4; + NvtxNameFamilyCudaStream = 5; + NvtxNameFamilyCudaEvent = 6; + NvtxNameFamilyClDevice = 7; + NvtxNameFamilyClContext = 8; + NvtxNameFamilyClCommandQueue = 10; + NvtxNameFamilyClMemObject = 11; + NvtxNameFamilyClSampler = 12; + NvtxNameFamilyClProgram = 13; + NvtxNameFamilyClEvent = 14; + NvtxNameFamilyCudaRtDevice = 15; + NvtxNameFamilyCudaRtStream = 16; + NvtxNameFamilyCudaRtEvent = 17; +} + +message NvtxNameTable +{ + required NvtxNameFamily Family = 1; + repeated NvtxRegisteredString Mappings = 2; +} + +message NvtxState +{ + repeated NvtxDomainInfo Domains = 1; + repeated NvtxThread Threads = 2; + repeated NvtxStartEndDomain StartEndDomains = 3; + optional uint64 DefaultDomain = 4; +} + +message NvtxReplyStateMessage +{ + message TypeInfo + { + optional NvtxCategory Category = 1 [default = NvtxCategoryState]; + optional NvtxMethod Method = 2 [default = NvtxMethodReplyStateMessage]; + } + + optional NvtxState State = 1; +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/NvtxCategories.proto b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/NvtxCategories.proto new file mode 100644 index 0000000000000000000000000000000000000000..8fb40ecb904de3587ecd8512985cd362dc33d212 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/NvtxCategories.proto @@ -0,0 +1,12 @@ +syntax = "proto2"; +package NV.Nvtx; + +enum NvtxCategory +{ + // Every feature counts Category 0 as invalid. Then the array of categories.size() is always > 1. + NvtxCategoryInvalid = 0; + NvtxCategoryState = 1; + + // DO NOT RE-ORDER THESE CATEGORIES + // Always add a new category at the end. +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/ProfilerMetricOptions.proto b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/ProfilerMetricOptions.proto new file mode 100644 index 0000000000000000000000000000000000000000..da93ce1d0c1cce554254ca1cae6ffaf3c416ee96 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/ProfilerMetricOptions.proto @@ -0,0 +1,82 @@ +syntax = "proto2"; +package NV.Profiler.Messages; + +enum GpuArch +{ + option allow_alias = true; + InvalidArch = 0; + + MinArch = + + 50; + + CC_50 = 50; + + CC_52 = 52; + CC_53 = 53; + + CC_60 = 60; + CC_61 = 61; + CC_62 = 62; + + CC_70 = 70; + + CC_72 = 72; + + CC_75 = 75; + + CC_80 = 80; + + CC_86 = 86; + + CC_87 = 87; + + CC_89 = 89; + + CC_90 = 90; + + MaxArch = + + 90; + +} + +enum CollectionScope +{ + CollectionScope_Launch = 1; + CollectionScope_Range = 2; + CollectionScope_Cmdlist = 3; +} + +enum CollectionImportance +{ + CollectionImportance_Required = 1; + CollectionImportance_Optional = 2; +} + +message CollectionFilter +{ + // if set, scopes for which to enable collection + repeated CollectionScope CollectionScopes = 1; + + optional CollectionImportance Importance = 2; +} + +message MetricOptionFilterItem +{ + // if either one is not set, the respective value from GpuArch is taken + optional GpuArch MinArch = 1; + optional GpuArch MaxArch = 2; +} + +message MetricOptionFilter +{ + // kept for backwards-compatibility + optional GpuArch MinArch = 1; + optional GpuArch MaxArch = 2; + // setting Items overrides MinArch/MaxArch + repeated MetricOptionFilterItem Items = 3; + + optional CollectionFilter CollectionFilter = 4; +} + diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/ProfilerReport.proto b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/ProfilerReport.proto new file mode 100644 index 0000000000000000000000000000000000000000..05a838fcffc848c8f079c9c94b1ddf1dec5a6efe --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/ProfilerReport.proto @@ -0,0 +1,506 @@ +syntax = "proto2"; +package NV.Profiler.Messages; + +import "CpuStacktrace/CpuStacktrace.proto"; +import "Nvtx/Nvtx.proto"; +import "Profiler/ProfilerMetricOptions.proto"; +import "Profiler/ProfilerResultsCommon.proto"; +import "Profiler/ProfilerStringTable.proto"; +import "ProfilerReport/ProfilerReportCommon.proto"; +import "ProfilerSection/ProfilerSection.proto"; +import "RuleSystem/RuleResults.proto"; + +// enable arenas for better allocation performance +option cc_enable_arenas = true; + +message DeviceProperty +{ + required string Key = 1; + required string Value = 2; +} + +message DeviceProperties +{ + repeated DeviceProperty Properties = 1; +} + +message DeviceAttribute +{ + required string Name = 1; + required ProfileMetricValue Value = 2; +} + +message DeviceAttributes +{ + required uint32 ID = 1; + optional string Name = 2; + repeated DeviceAttribute Attributes = 3; +} + +// has to match with SystemInfo.proto! +enum PlatformType +{ + Unknown = 0; + Windows = 1; + Linux = 2; + Android = 3; + OSX = 4; + QNX = 5; + Hos = 6; + Integrity = 7; + LinuxPPC = 8; +} + +enum IPAddressType +{ + IPV4 = 1; + IPV6 = 2; +} + +message IPAddress +{ + required string Address = 1; + optional IPAddressType Type = 2; +} + +message SystemInfo +{ + optional string OSName = 1; + optional string Build = 2; + optional string Processor = 3; + optional string Architecture = 4; + optional string ComputerName = 5; + optional PlatformType Platform = 6; + repeated IPAddress IPAddresses = 7; +} + +message VersionInfo +{ + required string Provider = 1; + required string Version = 2; +} + +message FilterOptions +{ + optional string KernelName = 1; + optional string KernelNameBase = 2; + optional string KernelId = 3; + optional uint32 SkipCount = 4; + optional uint32 SkipBeforeMatchCount = 5; + optional uint32 CaptureCount = 6; +} + +message PmSamplingOptions +{ + optional uint64 Interval = 1; + optional uint64 BufferSize = 2; + optional uint64 MaxPasses = 3; +} + +message WarpSamplingOptions +{ + optional bool IntervalAuto = 1; + optional uint64 Interval = 2; + optional uint64 MaxPasses = 3; + optional uint64 BufferSize = 4; +} + +message OtherOptions +{ + optional bool ApplyRules = 1; + optional string Metrics = 2; +} + +message ProfilerSettings +{ + optional bool EnableNvtx = 1; + optional bool DisableProfilingStartStop = 2; + optional bool EnableProfilingFromStart = 3; + optional string ActivityType = 4; + optional FilterOptions FilterOptions = 5; + optional OtherOptions OtherOptions = 6; + optional string EnabledSections = 7; + optional string ClockControlMode = 8; + optional WarpSamplingOptions WarpSamplingOptions = 9; + optional bool ImportSource = 10; + optional string ReplayMode = 11; + optional bool EnableCpuStack = 12; + optional PmSamplingOptions PmSamplingOptions = 13; +} + +message ReportSessionDetails +{ + optional uint32 ProcessID = 1; + + // Represented as a Unix time since Jan 1 1970 + optional uint64 CreationTime = 2; + + optional SystemInfo HostSystemInfo = 3; + optional SystemInfo TargetSystemInfo = 4; + optional DeviceProperties DeviceProperties = 5; + repeated DeviceAttributes DeviceAttributes = 6; + + // User can modify these to give themselves some hints about the report. + optional string Comments = 7; + + repeated VersionInfo VersionInfo = 8; + + optional ExecutableSettings ExecutableSettings = 9; + optional ProfilerSettings ProfilerSettings = 10; + optional string ProfilerCmdline = 11; +} + +message CommentID +{ + required string SectionID = 1; + + // In the future, this could also include something like: + // optional string TableID = 2; + // optional uint32 TableRow = 3; + // optional uint32 TableCol = 4; +} + +message Comment +{ + required CommentID ID = 1; + required string DisplayName = 2; + required string Text = 3; +} + +message ProfileSeriesInfoMessage +{ + required uint32 SeriesID = 1; + // Is set iff the current result is not the result for the default settings + optional string CombinationStr = 2; +} + +message ProfilerClockStatusMessage +{ + required bool RequestedLock = 1; + required bool ExecutedLocked = 2; +} + +// Result representing a single kernel launch. +message ProfileResult +{ + required uint32 ThreadID = 1; + required uint64 APICallID = 2; + required uint64 ProgramHandle = 3; + required uint64 KernelID = 4; + required string KernelMangledName = 5; + required string KernelFunctionName = 6; + required string KernelDemangledName = 7; + required uint32 WorkDimensions = 8; + + // x,y,z descriptions + // work offset + required Uint64x3 GlobalWorkOffset = 9; + // CUDA grid dims + required Uint64x3 GridSize = 10; + // CUDA block dims + required Uint64x3 BlockSize = 11; + + optional string Comments = 12; + + repeated ProfileMetricResult MetricResults = 13; + + // Represented as a Unix time since Jan 1 1970 + optional uint64 CreationTime = 14; + + required SourceData Source = 15; + + // This field is only set to optional in order to be backwards compatible with + // older report files. Maybe we can switch that once we rename file name endings. + optional APIType Api = 16; + + // Note: Optional for now; will become required once everything is in place + // Hint: Stored here so that any report can be opened with any version of the tool, independent + // of the actual configured template for data collection. I assume this is very common that + // old reports would have different sections than newer reports. Same is true if multiple + // people share their reports. + repeated NV.Profiler.ProfilerSection Sections = 17; + + repeated Comment SectionComments = 18; + + // Note: Optional for now, similar to Sections + repeated NV.RuleSystem.RuleResult RuleResults = 19; + + // set to true if the target was not (fully) supported + optional bool UnsupportedDevice = 20; + + optional NV.Nvtx.NvtxState Nvtx = 21; + + // the CUDA context ID of the kernel + optional uint32 ContextID = 22; + + // the CUDA stream ID of the kernel + optional uint32 StreamID = 23; + + optional ProfileSeriesInfoMessage SeriesInfo = 24; + + optional ProfilerClockStatusMessage ClockStatus = 25; + + // the CUDA context's NVTX name + optional string ContextName = 26; + + // the CUDA stream's NVTX name + optional string StreamName = 27; + + // the stack frames of the host/cpu code for this CUDA launch + optional NV.CpuStacktrace.CpuStacktraceStackMessage CpuStack = 28; + + optional CollectionScope CollectionScope = 29; + + // set to true if launch was on a Green Context + optional bool UsesGreenContext = 30; + +} + +// Result representing a replayed range including multiple API calls and kernel launches. +message RangeResult +{ + // thread and api call ID of the start marker + required uint32 ThreadID = 1; + required uint64 APICallID = 2; + + optional string Comments = 3; + + repeated ProfileMetricResult MetricResults = 4; + + // Represented as a Unix time since Jan 1 1970 + optional uint64 CreationTime = 5; + + optional APIType Api = 6; + + repeated NV.Profiler.ProfilerSection Sections = 7; + + repeated Comment SectionComments = 8; + + // set to true if the target was not (fully) supported + optional bool UnsupportedDevice = 9; + + optional NV.Nvtx.NvtxState Nvtx = 10; + + // the CUDA context ID of the kernel + optional uint32 ContextID = 11; + + optional ProfilerClockStatusMessage ClockStatus = 12; + + // the CUDA context's NVTX name + optional string ContextName = 13; + + // the stack frames of the host/cpu code for this range (start marker) + optional NV.CpuStacktrace.CpuStacktraceStackMessage CpuStack = 14; + + // store source data references. A range can have more than one associated SourceData. + repeated uint64 References = 15; + + // set to true if launch was on a Green Context + optional bool UsesGreenContext = 16; + +} + +// Result representing a command list with one or more launched functions. +message CmdlistResult +{ + // thread and api call ID of the start marker + required uint32 ThreadID = 1; + required uint64 APICallID = 2; + + optional string Comments = 3; + + repeated ProfileMetricResult MetricResults = 4; + + // Represented as a Unix time since Jan 1 1970 + optional uint64 CreationTime = 5; + + optional APIType Api = 6; + + repeated NV.Profiler.ProfilerSection Sections = 7; + + repeated Comment SectionComments = 8; + + // set to true if the target was not (fully) supported + optional bool UnsupportedDevice = 9; + + optional NV.Nvtx.NvtxState Nvtx = 10; + + // the CUDA context ID of the cmdlist + optional uint32 ContextID = 11; + + // the CUDA stream ID of the cmdlist + optional uint32 StreamID = 12; + + optional ProfilerClockStatusMessage ClockStatus = 13; + + // the CUDA context's NVTX name + optional string ContextName = 14; + + // the CUDA stream's NVTX name + optional string StreamName = 15; + + // the stack frames of the host/cpu code for this cmdlist (start marker) + optional NV.CpuStacktrace.CpuStacktraceStackMessage CpuStack = 16; + + // store source data references. A cmdlist can have more than one associated SourceData. + repeated uint64 References = 17; + + // display name which may contain the original API call name + optional string DisplayName = 18; + + optional uint32 WorkDimensions = 19; + + message CblQmdLaunchInfo + { + optional Uint64x3 GridSize = 1; + optional Uint64x3 BlockSize = 2; + } + + repeated CblQmdLaunchInfo LaunchInfos = 20; + + // Note: Optional for now, similar to Sections + repeated NV.RuleSystem.RuleResult RuleResults = 21; +} + +// Result representing a CUDA Graph +message GraphResult +{ + // thread and api call ID of the start marker + required uint32 ThreadID = 1; + required uint64 APICallID = 2; + + optional string Comments = 3; + + repeated ProfileMetricResult MetricResults = 4; + + // Represented as a Unix time since Jan 1 1970 + optional uint64 CreationTime = 5; + + optional APIType Api = 6; + + repeated NV.Profiler.ProfilerSection Sections = 7; + + repeated Comment SectionComments = 8; + + // set to true if the target was not (fully) supported + optional bool UnsupportedDevice = 9; + + optional NV.Nvtx.NvtxState Nvtx = 10; + + // the CUDA context ID of the graph + optional uint32 ContextID = 11; + + // the CUDA stream ID of the graph + optional uint32 StreamID = 12; + + optional ProfilerClockStatusMessage ClockStatus = 13; + + // the CUDA context's NVTX name + optional string ContextName = 14; + + // the CUDA stream's NVTX name + optional string StreamName = 15; + + // the stack frames of the host/cpu code for this graph (start marker) + optional NV.CpuStacktrace.CpuStacktraceStackMessage CpuStack = 16; + + // store source data references. A graph can have more than one associated SourceData. + repeated uint64 References = 17; + + // set to true if launch was on a Green Context + optional bool UsesGreenContext = 18; + +} + +message ProcessInfo +{ + required uint32 ProcessID = 1; + optional string Hostname = 2; + optional string ProcessName = 3; +} + +message BlockHeader +{ + // The data for the following two fields is encoded sequentially after this header. + // They are not *in* the header, since a large protobuf would error out. (100000 results or so) + + // Contains the number of profile sources in this block. + // Payload is of type NV.Profiler.SourceData + optional uint32 NumSources = 1; + + // Contains the number of profile results in this block. + // Payload is of type NV.Profiler.Messages.ProfileResult + optional uint32 NumResults = 2; + + optional ReportSessionDetails SessionDetails = 3; + + // The master string table to resolve strings stored as IDs + optional ProfilerStringTable StringTable = 4; + + // Size of the following payload block in bytes + optional uint32 PayloadSize = 5; + + // Process this block is associated with + // If not present, the block is considered to be associated + // with the default process, identified by ReportSessionDetails + optional ProcessInfo Process = 6; + + // Contains the number of range results in this block. + // Payload is of type NV.Profiler.Messages.RangeResult + optional uint32 NumRangeResults = 7; + + // Contains the number of cmdlist results in this block. + // Payload is of type NV.Profiler.Messages.CmdlistResult + optional uint32 NumCmdlistResults = 8; + + // Contains the number of CUDA graph results in this block. + // Payload is of type NV.Profiler.Messages.GraphResult + optional uint32 NumGraphResults = 9; +} + +message FileHeader +{ + required uint32 Version = 1; +} + +message BaselineColor +{ + enum BaselineColorType + { + BaselineColorTypeUnknown = 0; + BaselineColorTypeArgb = 1; + } + + required BaselineColorType ColorType = 1 [default = BaselineColorTypeUnknown]; + optional uint32 ColorValue = 2; +} + +message ExtendedBaselineData +{ + optional bool IsVisible = 1; + optional BaselineColor Color = 2; + optional string Name = 3; + optional string KernelName = 4; + optional string ProcessName = 5; + optional string ReportMoniker = 6; +} + +message BaselineResult +{ + oneof ValueType + { + ProfileResult ProfileResult = 1; + RangeResult RangeResult = 2; + CmdlistResult CmdlistResult = 3; + GraphResult GraphResult = 4; + } +} + +message BaselinePersistenceData +{ + // deprecated in favor of more versatile BaselineResults entry + repeated ProfileResult DeprecatedBaselineResults = 1; + repeated ProfilerStringTable StringTables = 2; + repeated ExtendedBaselineData ExtendedBaselineData = 3; + repeated BaselineResult BaselineResults = 4; +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/ProfilerReportCommon.proto b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/ProfilerReportCommon.proto new file mode 100644 index 0000000000000000000000000000000000000000..285441465725e9145be861db7a3fe5101ac3eb26 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/ProfilerReportCommon.proto @@ -0,0 +1,83 @@ +syntax = "proto2"; +package NV.Profiler.Messages; + +// enable arenas for better allocation performance +option cc_enable_arenas = true; + +// Array of 3 for dimensions and work offset. Rather than making a coords, and a separate dimensions message. +// Please be careful if you need to modify this, as it is used in the report file. +message Uint64x3 +{ + optional uint64 X = 1; + optional uint64 Y = 2; + optional uint64 Z = 3; +} + +enum APIType +{ + APIType_CUDA = 0; + +} + +// Required to be in sync with NvGpuArch's SassLevel +enum SourceSassLevel +{ + SourceSassLevel_Unset = 0; + SourceSassLevel_Sass1 = 1; + SourceSassLevel_Sass2 = 2; + SourceSassLevel_Sass3 = 3; + SourceSassLevel_Sass4 = 4; + SourceSassLevel_Sass5 = 5; + SourceSassLevel_Sass6 = 6; + SourceSassLevel_Sass7 = 7; + + SourceSassLevel_Sass8 = 8; + + SourceSassLevel_Sass9 = 9; + +} + +message SourceFile +{ + required string FileName = 1; + optional string Content = 2; +} + +message SourceFiles +{ + repeated SourceFile Files = 1; +} + +message RelocationSymbolEntry +{ + optional string SymbolName = 1; + optional uint64 Address = 2; + optional uint32 SymbolIndex = 3; +} + +message RelocationData +{ + repeated RelocationSymbolEntry Functions = 1; + repeated RelocationSymbolEntry Objects = 2; +} + +message SourceData +{ + optional uint64 Reference = 1; + optional string Code = 2; + optional bytes Intermediate = 3; + optional bytes Binary = 4; + optional SourceSassLevel SassLevel = 5; + optional uint32 SMRevision = 6; + optional uint32 BinaryFlags = 7; + optional SourceFiles SourceFiles = 8; + optional RelocationData RelocationData = 9; +} + +message ExecutableSettings +{ + required string ExecutablePath = 1; + optional string WorkDirectory = 2; + optional string CmdlineAgruments = 3; + optional string Environment = 4; +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/ProfilerResultsCommon.proto b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/ProfilerResultsCommon.proto new file mode 100644 index 0000000000000000000000000000000000000000..3b3ff6fbc5b2d234df071d32ec85905adad80934 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/ProfilerResultsCommon.proto @@ -0,0 +1,35 @@ +syntax = "proto2"; +package NV.Profiler.Messages; + +// enable arenas for better allocation performance +option cc_enable_arenas = true; + +message ProfileMetricValue +{ + optional string StringValue = 1; + optional float FloatValue = 2; + optional double DoubleValue = 3; + optional uint32 Uint32Value = 4; + optional uint64 Uint64Value = 5; +} + +message ProfileMetricListElement +{ + optional ProfileMetricValue CorrelationId = 1; + required ProfileMetricValue ElementValue = 2; +} + +enum ProfileMetricCategory +{ + MetricCategoryPm = 0; + MetricCategorySampler = 1; + // ONLY ADD AT THE END OF THIS LIST. DO NOT RE-ORDER. +} + +message ProfileMetricResult +{ + required uint32 NameId = 1; + optional ProfileMetricValue MetricValue = 2; + repeated ProfileMetricListElement MetricValueList = 3; + optional ProfileMetricCategory Category = 4 [default = MetricCategoryPm]; +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/ProfilerSection.proto b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/ProfilerSection.proto new file mode 100644 index 0000000000000000000000000000000000000000..6b31dcfb2fb133bde29976844e37796c2ef6cf15 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/ProfilerSection.proto @@ -0,0 +1,671 @@ +syntax = "proto2"; +package NV.Profiler; + +import "Profiler/ProfilerMetricOptions.proto"; + +// ============================================================================= +// COMMON +// ============================================================================= +// Deprecated, this is inferred from the metric itself now +enum HWUnitType +{ + Invalid = 0; + Default = 1; // Equals the executing HW unit + Gpc = 2; + Tpc = 3; + Sm = 4; + Smsp = 5; + Tex = 6; + Lts = 7; + Ltc = 8; + Fbpa = 9; +} + +enum SortKeys +{ + ByLabel = 0; + ByValue = 1; +} + +enum SortDirections +{ + Ascending = 0; + Descending = 1; +} + +/* + * Possible metric name syntax + * (1) "" + * (2) "regex:" + * (3) "group:" + * (4) "breakdown:[depth:]" + */ + +message ProfilerSectionMetricOption +{ + required string Name = 1; + optional string Label = 2; + optional Messages.MetricOptionFilter Filter = 3; +} + +message SourceCorrelationDisplayProperties +{ + optional bool Disabled = 1; + optional bool DivideByCorrelatedLineCount = 2; +} + +message SourceViewDisplayProperties +{ + // indicates if a metric column should be visible by default on the Source page + optional bool DefaultVisible = 1; + // indicates that this metric does not support being shown as a relative value on the Source page + optional bool DisableRelativeValues = 2; +} + +message ProfilerSectionMetricDisplayProperties +{ + optional SourceCorrelationDisplayProperties SourceCorrelation = 1; + optional SourceViewDisplayProperties SourceView = 2; +} + +message ProfilerSectionMetric +{ + // Metric name, as e.g. returned by metric query (e.g. gpu__time_duration.sum) + required string Name = 1; + // User-friendly label (e.g. 'Duration') + optional string Label = 2; + // Deprecated + optional HWUnitType HWUnit = 3; + // Show metric instance values. What instances represent depends on the specific metric. + // See the metrics reference in the documentation for more info. + optional bool ShowInstances = 4; + // The metric's base unit (e.g. bytes or bytes_per_sec) + // Normally this is inferred from the metric itself + optional string Unit = 5; + // Filter to control when the metric is collected + optional Messages.MetricOptionFilter Filter = 6; + repeated ProfilerSectionMetricOption Options = 7; + optional ProfilerSectionMetricDisplayProperties DisplayProperties = 8; + // List of ProfilerSectionMetricGroup names this metric belongs to. + repeated string Groups = 9; + optional bool DisableExtraSuffixes = 10; + // List of counter domains that should be used for collecting this metric's counter dependencies + repeated string CtrDomains = 11; +} + +// Groups support applying properties to a set of metrics and to interact with them +// more conveniently in user interfaces. +message ProfilerSectionMetricGroup +{ + // unique name + optional string Name = 1; + // user-friendly label + optional string Label = 2; + optional ProfilerSectionMetricDisplayProperties DisplayProperties = 3; +} + +message ProfilerSectionHighlightX +{ + repeated ProfilerSectionMetric Metrics = 1; +} + +// ============================================================================= +// HORIZONTAL CONTAINER +// Allows to organize multiple profiler section items in a horizontal container +// ============================================================================= +message ProfilerSectionHorizontalContainer +{ + repeated ProfilerSectionBodyItem Items = 1; +} + +// ============================================================================= +// TABLE +// Simple table that stores any number of label/metric pairs +// ============================================================================= +message ProfilerSectionTable +{ + enum LayoutOrder + { + RowMajor = 0; + ColumnMajor = 1; + } + + optional string Label = 1; + optional uint32 Rows = 2; + required uint32 Columns = 3; + optional LayoutOrder Order = 4; + // Cells are stored in row-major order + repeated ProfilerSectionMetric Metrics = 5; + optional SortKeys SortKey = 6; + optional SortDirections SortDirection = 7; + optional string Description = 8; +} + +// ============================================================================= +// CHARTS (Common) +// ============================================================================= +message ChartColor +{ + enum ChartColorType + { + ChartColorTypeUnknown = 0; + ChartColorTypeArgb = 1; + } + + required ChartColorType ColorType = 1 [default = ChartColorTypeUnknown]; + optional uint32 ColorValue = 2; +} + +message ProfilerSectionChartAxisRange +{ + optional int64 Min = 1; + optional int64 Max = 2; +} + +message ProfilerSectionChartValueAxis +{ + optional string Label = 1; + optional ProfilerSectionChartAxisRange Range = 2; + optional int64 TickCount = 3; + optional int64 Size = 4; + optional uint32 Precision = 5; +} + +message ProfilerSectionChartCategoryAxis +{ + optional string Label = 1; +} + +message ProfilerSectionChartHistogramAxis +{ + optional string Label = 1; + optional int64 BinCount = 2; +} + +message ProfilerSectionChartRooflineAxis +{ + optional string Label = 1; + optional double Base = 2; + optional double Min = 3; + optional double Max = 4; +} + +message ProfilerSectionRooflineValueCyclesPerSecondExpression +{ + // Multiple values get summed up. + // Peak values typically use the .sum.peak_sustained suffix. + // Achieved values typically use the .sum.per_cycle_elapsed suffix. + repeated ProfilerSectionMetric ValuePerCycleMetrics = 1; + + // Multiplication factor to convert cycles to seconds. + // Match the collecting unit for the above values as closely as + // possible. Typically this resolves to something like + // __cycles_elapsed.avg.per_second. + optional ProfilerSectionMetric CyclesPerSecondMetric = 2; +} + +message ProfilerSectionRooflineOptions +{ + optional string Label = 1; + optional ChartColor Color = 2; + optional bool ShowRooflineExtensions = 3; + optional bool ShowRooflinePoints = 4; +} + +message ProfilerSectionRooflineAchievedValueOptions +{ + optional string Label = 1; + optional ChartColor Color = 2; +} + +message ProfilerSectionRooflineWallOptions +{ + optional string Label = 1; + optional ChartColor Color = 2; +} + +message ProfilerSectionRooflineValue +{ + oneof RooflineValue + { + double Constant = 1; + ProfilerSectionMetric Metric = 2; + ProfilerSectionRooflineValueCyclesPerSecondExpression ValueCyclesPerSecondExpression = 3; + } +} + +message ProfilerSectionChartRoofline +{ + required ProfilerSectionRooflineValue PeakWork = 1; + required ProfilerSectionRooflineValue PeakTraffic = 2; + optional ProfilerSectionRooflineOptions Options = 3; +} + +message ProfilerSectionRooflineAchievedValue +{ + required ProfilerSectionRooflineValue AchievedWork = 1; + required ProfilerSectionRooflineValue AchievedTraffic = 2; + optional ProfilerSectionRooflineAchievedValueOptions Options = 3; +} + +message ProfilerSectionRooflineWall +{ + required ProfilerSectionRooflineValue Value = 1; + optional ProfilerSectionRooflineWallOptions Options = 2; +} + +// Table for showing top N instances of instruction-level source metrics. +// Multiple (compatible) metrics can be selected to aggregate them. +message ProfilerSourceMetricTable +{ + optional string Label = 1; + optional uint32 Rows = 2; + repeated ProfilerSectionMetric Metrics = 3; + optional SortDirections SortDirection = 4; + optional string Description = 5; +} + +message ProfilerSuffixTable +{ + + optional string Label = 1; + required ProfilerSuffixes Suffixes = 2; + required ProfilerBaseNames BaseNames = 3; + optional SortKeys SortKey = 4; + optional SortDirections SortDirection = 5; + optional string Description = 6; +} + +// ============================================================================= +// CHARTS +// ============================================================================= +message ProfilerSectionChartOptions +{ + optional string AspectRatio = 1; +} + +message ProfilerSectionBarChart +{ + enum Directions + { + Horizontal = 0; + Vertical = 1; + } + + enum ValueAxisAlignments + { + ValueAxisAlignments_Default = 0; + ValueAxisAlignments_Alternate = 1; + ValueAxisAlignments_Both = 2; + } + + optional string Label = 1; + optional Directions Direction = 2; + optional ProfilerSectionChartCategoryAxis CategoryAxis = 3; + optional ProfilerSectionChartValueAxis ValueAxis = 4; + repeated ProfilerSectionMetric Metrics = 5; + optional SortKeys SortKey = 6; + optional SortDirections SortDirection = 7; + optional ValueAxisAlignments ValueAxisAlignment = 8; + optional string Description = 9; +} + +message ProfilerSectionHistogramChart +{ + optional string Label = 1; + optional ProfilerSectionChartHistogramAxis HistogramAxis = 2; + optional ProfilerSectionChartValueAxis ValueAxis = 3; + required ProfilerSectionMetric Metric = 4; + optional string Description = 5; +} + +message ProfilerSectionLineChart +{ + optional string Label = 1; + optional ProfilerSectionChartValueAxis AxisX = 2; + optional ProfilerSectionChartValueAxis AxisY = 3; + repeated ProfilerSectionMetric Metrics = 4; + optional ProfilerSectionHighlightX HighlightX = 5; + optional string Description = 6; +} + +// Roofline Chart: +// Shows the relation between Intensity (I) and Work (W). A single chart includes +// one achieved data point and one or more peak rooflines. The metric input is +// driven by metrics for Work (W) and Traffic (T) for both, achieved and peak +// performance. The Intensity (I) is calculated as I = W / T. The axis are +// defined to use Intensity (I) for the x dimension and Work (W) for the y +// dimension. +message ProfilerSectionRooflineChart +{ + optional string Label = 1; + optional ProfilerSectionChartRooflineAxis AxisIntensity = 2; + optional ProfilerSectionChartRooflineAxis AxisWork = 3; + repeated ProfilerSectionChartRoofline Rooflines = 4; + repeated ProfilerSectionRooflineAchievedValue AchievedValues = 5; + repeated ProfilerSectionRooflineWall Walls = 6; + optional string Description = 7; + optional ProfilerSectionChartOptions Options = 8; +} + +// ============================================================================= +// CUSTOM TYPES +// ============================================================================= +message ProfilerSectionMemorySharedTable +{ + optional string Label = 1; + + optional bool ShowLoads = 2; + optional bool ShowStores = 3; + optional bool ShowAtomics = 4; + + optional bool ShowTotals = 5; +} + +// Deprecated in favor of ProfilerSectionMemoryL1TEXCacheTable +message ProfilerSectionMemoryFirstLevelCacheTable +{ + optional string Label = 1; + + optional bool ShowLoads = 2; + optional bool ShowStores = 3; + optional bool ShowAtomics = 4; + optional bool ShowReductions = 5; + + optional bool ShowGlobal = 6; + optional bool ShowLocal = 7; + optional bool ShowSurface = 8; + optional bool ShowTexture = 9; + + optional bool ShowTotalLoads = 10; + optional bool ShowTotalStores = 11; + optional bool ShowTotals = 12; +} + +message ProfilerSectionMemoryL1TEXCacheTable +{ + optional string Label = 1; + + optional bool ShowLoads = 2; + optional bool ShowStores = 3; + optional bool ShowAtomics = 4; + optional bool ShowReductions = 5; + + optional bool ShowGlobal = 6; + optional bool ShowLocal = 7; + optional bool ShowSurface = 8; + optional bool ShowTexture = 9; + + optional bool ShowTotalLoads = 10; + optional bool ShowTotalStores = 11; + optional bool ShowTotals = 12; + optional bool ShowTotalAtomicsAndReductions = 13; +} + +// Deprecated in favor of ProfilerSectionMemoryL2CacheTable +message ProfilerSectionMemorySecondLevelCacheTable +{ + optional string Label = 1; + + optional bool ShowLoads = 2; + optional bool ShowStores = 3; + optional bool ShowAtomics = 4; + optional bool ShowReductions = 5; + + optional bool ShowGlobal = 6; + optional bool ShowLocal = 7; + optional bool ShowSurface = 8; + optional bool ShowTexture = 9; + + optional bool ShowTotalLoads = 10; + optional bool ShowTotalStores = 11; + optional bool ShowTotals = 12; +} + +// L2 cache eviction policies table +message ProfilerSectionMemoryL2CacheEvictPolicyTable +{ + optional string Label = 1; + + optional bool ShowLoads = 2; + optional bool ShowStores = 3; + optional bool ShowAtomics = 4; +} + +message ProfilerSectionMemoryL2CacheTable +{ + optional string Label = 1; + + optional bool ShowLoads = 2; + optional bool ShowStores = 3; + optional bool ShowAtomics = 4; + optional bool ShowReductions = 5; +} + +message ProfilerSectionMemoryDeviceMemoryTable +{ + optional string Label = 1; + + optional bool ShowLoads = 2; + optional bool ShowStores = 3; + + optional bool ShowTotals = 4; +} + +message ProfilerSectionMemoryChart +{ + optional string Label = 1; +} + +message ProfilerSectionNvlinkTopology +{ + optional string Label = 1; +} + +message ProfilerSectionNvlinkPropertyTable +{ + optional string Label = 1; +} + +message ProfilerSectionNvlinkThroughputTable +{ + optional string Label = 1; +} + +message ProfilerSectionNumaIdTable +{ + optional string Label = 1; +} + +message ProfilerSectionGfxMetricsWidget +{ + required string Type = 1; + optional string Label = 2; + repeated ProfilerSectionMetric Metrics = 3; +} + +message ProfilerSuffixes +{ + repeated ProfilerSuffix Suffix = 1; +} + +message ProfilerSuffix +{ + required string Name = 1; + optional string Label = 2; +} + +message ProfilerBaseNames +{ + repeated ProfilerSectionMetric BaseName = 1; +} + +enum TimelineRowType +{ + StackedBar = 0; +} + +message TimelineMetricRow +{ + // Avoid using '/' in timeline labels + optional string Label = 1; + optional string Description = 2; + optional TimelineRowType Type = 3; + // Avoid using '/' in timeline labels + repeated ProfilerSectionMetric Metrics = 4; +} + +message TimelineMetricGroup +{ + // Avoid using '/' in timeline labels + optional string Label = 1; + optional string Description = 2; + // Default expanded/collapsed state + optional bool Expanded = 3; + repeated TimelineMetricRow MetricRows = 4; +} +message ProfilerSectionTimeline +{ + optional string Label = 1; + repeated TimelineMetricGroup MetricGroups = 2; + // Avoid using '/' in timeline labels + repeated ProfilerSectionMetric Metrics = 3; +} + +// ============================================================================= +// HEADER +// Simple table with two fixed columns +// ============================================================================= +message ProfilerSectionHeader +{ + // number of rows shown in the header + optional uint32 Rows = 1; + // Cells are stored in row-major order + // Notes: Cells are defined empty if either the label string and/or the + // metric string is empty. This can be used to arrange the cells in a table. + repeated ProfilerSectionMetric Metrics = 2; +} + +// ============================================================================= +// BODY +// Any number of items that are shows when the section is expanded +// ============================================================================= +message ProfilerSectionBodyItem +{ + // Note: Could switch to a oneof once we switch to a protobuf version that + // supports this. + + // Basic Item Types + optional ProfilerSectionTable Table = 1; + optional ProfilerSectionBarChart BarChart = 2; + optional ProfilerSectionHistogramChart HistogramChart = 3; + optional ProfilerSectionLineChart LineChart = 4; + optional ProfilerSectionHorizontalContainer HorizontalContainer = 5; + optional ProfilerSectionRooflineChart RooflineChart = 6; + optional ProfilerSourceMetricTable SourceMetricTable = 7; + optional ProfilerSuffixTable SuffixTable = 8; + + // Custom Item Types + optional ProfilerSectionMemorySharedTable MemorySharedTable = 101; + optional ProfilerSectionMemoryFirstLevelCacheTable MemoryFirstLevelCacheTable = 102; + optional ProfilerSectionMemorySecondLevelCacheTable MemorySecondLevelCacheTable = 103; + optional ProfilerSectionMemoryDeviceMemoryTable MemoryDeviceMemoryTable = 104; + optional ProfilerSectionMemoryChart MemoryChart = 105; + optional ProfilerSectionMemoryL1TEXCacheTable MemoryL1TEXCacheTable = 106; + optional ProfilerSectionMemoryL2CacheTable MemoryL2CacheTable = 107; + optional ProfilerSectionNvlinkTopology NvlinkTopology = 108; + optional ProfilerSectionNvlinkPropertyTable NvlinkPropertyTable = 109; + optional ProfilerSectionNvlinkThroughputTable NvlinkThroughputTable = 110; + optional ProfilerSectionMemoryL2CacheEvictPolicyTable MemoryL2CacheEvictPolicyTable = 111; + optional ProfilerSectionNumaIdTable NumaIdTable = 112; + optional ProfilerSectionTimeline Timeline = 113; + // Graphics Item Types + optional ProfilerSectionGfxMetricsWidget GfxMetricsWidget = 150; + + optional Messages.MetricOptionFilter Filter = 200; +} + +message ProfilerSectionBody +{ + repeated ProfilerSectionBodyItem Items = 1; + optional string DisplayName = 2; + optional bool SetDefault = 3; +} + +// ============================================================================= +// METRICS +// List of further metrics collected by this section +// (Note that metrics can be referenced by Header and Body, too.) +// ============================================================================= +message ProfilerSectionMetrics +{ + repeated ProfilerSectionMetric Metrics = 1; + optional uint32 Order = 2; +} + +// ============================================================================= +// METRIC DEFINITIONS +// Metric definitions describe new metrics composed of existing ones +// ============================================================================= +message ProfilerSectionMetricDefinition +{ + required string Name = 1; + // expression of the form where is one of +,-,*,/ + // and and are metric names + required string Expression = 2; + optional Messages.MetricOptionFilter Filter = 3; +} + +message ProfilerSectionMetricDefinitions +{ + repeated ProfilerSectionMetricDefinition MetricDefinitions = 1; +} + +// ============================================================================= +// SECTION SET +// ============================================================================= +message ProfilerSet +{ + required string Identifier = 1; +} + +// ============================================================================= +// SECTION +// ============================================================================= +message ProfilerSection +{ + // Unique identifier without whitespace + required string Identifier = 1; + // User-friendly name + required string DisplayName = 2; + // Order (priority) in which to show sections in the tool + // Sections with lower values are shown first. + optional uint32 Order = 3; + // Definition of the header table. + optional ProfilerSectionHeader Header = 4; + // Body definitions. + repeated ProfilerSectionBody Body = 5; + // Generic list of metrics + optional ProfilerSectionMetrics Metrics = 6; + // User-friendly description + optional string Description = 7; + // The section set identifiers this section should be part of + repeated ProfilerSet Sets = 8; + // The identifier of another section extended by this one. + // Extension section are not shown standalone in the UI + // when collected alongside the one they extend. + optional string Extends = 9; + // Definitions of derived metrics + optional ProfilerSectionMetricDefinitions MetricDefinitions = 10; + // Filter applied to the entire section + optional Messages.MetricOptionFilter Filter = 11; + // Definitions of metic groups + repeated ProfilerSectionMetricGroup Group = 12; + // List of metrics to collect for the Source page + optional ProfilerSectionMetrics SourceMetrics = 13; +} + +message ProfilerSections +{ + repeated ProfilerSection Sections = 1; +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/ProfilerStringTable.proto b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/ProfilerStringTable.proto new file mode 100644 index 0000000000000000000000000000000000000000..97b88cbf4d8371970198a45f3da9cc575733df23 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/ProfilerStringTable.proto @@ -0,0 +1,10 @@ +syntax = "proto2"; +package NV.Profiler.Messages; + +// enable arenas for better allocation performance +option cc_enable_arenas = true; + +message ProfilerStringTable +{ + repeated string Strings = 1; +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/RuleResults.proto b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/RuleResults.proto new file mode 100644 index 0000000000000000000000000000000000000000..75edd7fce5315d8b9f3e68ce5c38fbf089fa678a --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/FileFormat/RuleResults.proto @@ -0,0 +1,154 @@ +syntax = "proto2"; +package NV.RuleSystem; +import "ProfilerSection/ProfilerSection.proto"; + +// ============================================================================= +// MESSAGE +// Simple message that stores a single string +// +// TYPES +// None - No message available +// Ok - Informative, non-actionable message +// Warning - Non-fatal warnings, e.g. about as missing metrics +// Error - Execution errors/failures during rule execution, +// e.g. syntax error in Python script +// Optimization - Message about performance optimization potential; +// should be actionable +// ============================================================================= +enum RuleResultMessageType +{ + None = 0; + Ok = 1; + Warning = 2; + Error = 3; + Optimization = 4; +} + +message RuleResultMessage +{ + required string Message = 1; + required RuleResultMessageType Type = 2; + optional int32 Id = 3; + optional string Name = 4; +} + +message RuleResultProposal +{ + required string Identifier = 1; +} + +// ============================================================================= +// POTENTIAL SPEEDUP +// Stores SpeedupType and Value of the estimated maximal achievable speedup +// +// TYPE +// Unknown - not set +// Local - value represents increase in hardware efficiency in isolated context +// Global - value represents decrease in overall kernel runtime +// +// VALUE +// Expected to be in the range [0, 100], as it represents a percentage +// ============================================================================= +enum RuleResultSpeedupType +{ + Unknown = 0; + Local = 1; + Global = 2; +} + +message RuleResultSpeedup +{ + optional RuleResultSpeedupType SpeedupType = 1; + optional double Value = 2; +} + +enum RuleResultFocusSeverity +{ + Default = 0; + Low = 1; + High = 2; +} + +message RuleResultFocusMetric +{ + optional int32 MessageId = 1; + optional string MetricName = 2; + optional double MetricValue = 3; + optional RuleResultFocusSeverity Severity = 4; + optional string Info = 5; +} + +// ============================================================================= +// SOURCEMARKER +// Icon and tooltip text that gets shown on lines in the Source Page +// ============================================================================= +enum MarkerKind +{ + SASS = 0; + Source = 1; +} + +message SourceMarker +{ + optional MarkerKind Kind = 1; + oneof source_location + { + uint32 LineNumber = 2; + uint64 Address = 3; + } + optional string Tooltip = 4; + optional RuleResultMessageType Type = 5; + optional string FileName = 6; +} + +// ============================================================================= +// BODY ITEM +// A single body item +// ============================================================================= +message RuleResultBodyItem +{ + optional RuleResultMessage Message = 1; + + optional NV.Profiler.ProfilerSectionTable Table = 2; + optional NV.Profiler.ProfilerSectionBarChart BarChart = 3; + optional NV.Profiler.ProfilerSectionHistogramChart HistogramChart = 4; + optional NV.Profiler.ProfilerSectionLineChart LineChart = 5; + + optional RuleResultProposal Proposal = 6; + + optional NV.Profiler.ProfilerSectionRooflineChart RooflineChart = 7; + + repeated RuleResultFocusMetric FocusMetrics = 8; + + optional NV.Profiler.ProfilerSourceMetricTable SourceMetricTable = 9; + + optional RuleResultSpeedup Speedup = 10; + + optional NV.Profiler.ProfilerSuffixTable SuffixTable = 11; +} + +// ============================================================================= +// BODY +// Any number of items that are shows when the results are expanded +// ============================================================================= +message RuleResultBody +{ + repeated RuleResultBodyItem Items = 1; +} + +// ============================================================================= +// RESULT +// ============================================================================= +message RuleResult +{ + required string Identifier = 1; + required string DisplayName = 2; + optional RuleResultBody Body = 3; + optional string SectionIdentifier = 4; + repeated SourceMarker SourceMarkers = 5; +} + +message RuleResults +{ + repeated RuleResult RuleResults = 1; +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/AdvancedRuleTemplate.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/AdvancedRuleTemplate.py new file mode 100644 index 0000000000000000000000000000000000000000..88d7f59c48a176efc61ec0a9265420ca2b007248 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/AdvancedRuleTemplate.py @@ -0,0 +1,32 @@ +import NvRules + +def get_identifier(): + return "TemplateRule2" + +def get_name(): + return "Advanced Template Rule" + +def get_description(): + return "Another rule template, demonstrating more advanced NvRules functionality" + +def get_section_identifier(): + # map to the same template section as TemplateRule1 + return "RuleTemplateSection" + +def apply(handle): + ctx = NvRules.get_context(handle) + fe = ctx.frontend() + + action = ctx.range_by_idx(0).action_by_idx(0) + + # add two new metrics to this actions + # any existing metric with the same name would be overridden + action.add_integer_metric("new_metric_numeric", NvRules.IMetric.ValueKind_UINT64, 42) + action.add_string_metric("new_metric_string", NvRules.IMetric.ValueKind_STRING, "Hello world") + + # prove that we can retrieve the newly-added metric again + mStr = action.metric_by_name("new_metric_string") + fe.message("Added metric " + mStr.name() + " with value '" + mStr.as_string() + "'") + + # load a table, it might now use our new metrics as well + fe.load_chart_from_file("RuleTemplate2_table.chart") diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/BasicKernelInfo.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/BasicKernelInfo.py new file mode 100644 index 0000000000000000000000000000000000000000..9368eebe4fd84b5202865e76cf46eb31eae498b1 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/BasicKernelInfo.py @@ -0,0 +1,30 @@ +import NvRules + +def get_identifier(): + return "KernelInfo" + +def get_name(): + return "Kernel Information" + +def get_description(): + return "Basic kernel information. This independent rule does not map to any section." + +# The Evaluate function is used to specify to the rule system this rule's dependencies, +# e.g. the metrics that must have been collected in order for this rule to work properly. +# For rules that are tied to sections, this is guaranteed by the section itself +def evaluate(handle): + # specify which metrics are required + NvRules.require_metrics(handle, ["launch__grid_size", "launch__block_size"]) + +def apply(handle): + ctx = NvRules.get_context(handle) + + # select the default action (kernel) + action = ctx.range_by_idx(0).action_by_idx(0) + + # it is now safe to retrieve those metrics, as we declared the dependency in Evaluate + grid_size = int(action.metric_by_name("launch__grid_size").as_double()) + block_size = int(action.metric_by_name("launch__block_size").as_double()) + + # show a message in the user interface + ctx.frontend().message("Kernel " + action.name() + " launch config: " + str(grid_size) + "x" + str(block_size)) diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/BasicRuleTemplate.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/BasicRuleTemplate.py new file mode 100644 index 0000000000000000000000000000000000000000..60cef1466752b213c990a98a78c84644cbcec7b2 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/BasicRuleTemplate.py @@ -0,0 +1,43 @@ +# import our rule system interface +import NvRules + +def get_identifier(): + # an internal identifier used to map rules to a section, whitespace is not allowed + return "TemplateRule1" + +def get_name(): + # a descriptive, user-readable name for the rule, e.g. 'Memory Utilization Analysis' + return "Basic Template Rule" + +def get_description(): + # an optional description for the rule, e.g. 'Analyze memory unit utilization for this kernel' + return "A rule template, demonstration basic NvRules functionality" + +def get_section_identifier(): + # an internal identifier used to map rules to a section, whitespace is not allowed + return "RuleTemplateSection" + +# the main function for a rule, the 'handle' parameter is used to retrieve the rule context +def apply(handle): + # get the rule context, which provides all remaining functions, access to actions, metrics etc. + ctx = NvRules.get_context(handle) + + # select the first action (CUDA kernel) from the first range (CUDA stream) + action = ctx.range_by_idx(0).action_by_idx(0) + + # get the frontend object, which interacts with the UI and profiler report + fe = ctx.frontend() + + # get two metrics from this action + grid_size = int(action.metric_by_name("launch__grid_size").as_double()) + block_size = int(action.metric_by_name("launch__block_size").as_double()) + + # post a message to the frontend + fe.message("Kernel " + action.name() + " launch config: " + str(grid_size) + "x" + str(block_size)) + + # post a warning message to the frontend + fe.message(NvRules.IFrontend.MsgType_MSG_WARNING, "This is what a warning of the analysis might look like") + + # load a couple of charts and tables which are defined in small file snippets + fe.load_chart_from_file("RuleTemplate_bar.chart") + fe.load_chart_from_file("RuleTemplate_table.chart") diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/KernelInstanceBoundsAnalysis.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/KernelInstanceBoundsAnalysis.py new file mode 100644 index 0000000000000000000000000000000000000000..48000b92a35c3834f87254de8247df6a727881a8 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/KernelInstanceBoundsAnalysis.py @@ -0,0 +1,71 @@ +import NvRules +import nvanalysis + +def get_name(): + return "Kernel Bounds Analysis" + +def get_description(): + return "Kernel Bounds Analysis Rule" + +def get_identifier(): + return "kernel_instance_bounds_analysis" + +def get_section_identifier(): + return "kernel_instance_bounds_analysis" + +#def evaluate(handle): + # List rules proposed by this rule here once they are ready +# return NvRules.require_rules(handle, [ "kernel_instance_latency_analysis" ]) + +def apply(handle): + + ctx = NvRules.get_context(handle) + fe = ctx.frontend() + action = ctx.range_by_idx(0).action_by_idx(0) + + inst_issued_slots = action.metric_by_name("smsp__inst_issued_slots").as_double() + inst_executed_lsu_pipe = action.metric_by_name("smsp__inst_executed_lsu_pipe").as_double() + inst_executed_tex_pipe = action.metric_by_name("smsp__inst_executed_tex_pipe").as_double() + inst_executed_bru_pipe = action.metric_by_name("smsp__inst_executed_bru_pipe").as_double() + utilization_issue = action.metric_by_name("smsp__utilization_issue").as_double() + + m_issue_slots = inst_issued_slots + m_ldst_issued = inst_executed_lsu_pipe + inst_executed_tex_pipe + m_cf_issued = inst_executed_bru_pipe + m_issue_slot_utilization = utilization_issue + + m_cc_major = action.metric_by_name("device__attribute_compute_capability_major").as_uint64() + m_cc_minor = action.metric_by_name("device__attribute_compute_capability_minor").as_uint64() + m_device_name = action.metric_by_name("device__attribute_display_name").as_string() + + avail_mem_unit_enums = nvanalysis.units.get_memory_unit_enums(m_cc_major, m_cc_minor) + avail_func_unit_enums = nvanalysis.units.get_function_unit_enums(m_cc_major, m_cc_minor) + + avail_mem_units = [] + avail_func_units = [] + for memUnitEnum in avail_mem_unit_enums: + avail_mem_units.append(nvanalysis.units.get_memory_unit(memUnitEnum)) + for funcUnitEnum in avail_func_unit_enums: + avail_func_units.append(nvanalysis.units.get_function_unit(funcUnitEnum)) + + slot_utlization = m_issue_slot_utilization / 100.0 + max_utilized_function_unit = nvanalysis.units.get_max_utilized_function_unit(avail_func_units, action) + fu_utilization = nvanalysis.metrics.get_utilization_percent(max_utilized_function_unit.value(action)) + + # TODO + # if (memMap.containsKey(MemoryUnit.SYSMEM)) ... + + (mem_util, mem_bound) = nvanalysis.units.get_memory_utilization(avail_func_units, avail_mem_units, action) + + if fu_utilization > slot_utlization: + bound = nvanalysis.bounds.get_kernel_bound(fu_utilization, mem_util) + else: + cf_util = slot_utlization * (m_cf_issued / m_issue_slots) + ldst_util = slot_utlization * (m_ldst_issued / m_issue_slots) + arith_util = slot_utlization - cf_util - ldst_util + + sm_util = slot_utlization - ldst_util + bound = nvanalysis.bounds.get_kernel_bound(sm_util, mem_util) + + fe.message(nvanalysis.messages.kernel_bounds_msg(bound, mem_bound, m_device_name)) + diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/KernelInstanceBoundsAnalysis.section b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/KernelInstanceBoundsAnalysis.section new file mode 100644 index 0000000000000000000000000000000000000000..009889a7245ff058cfab9e49907b03032c7e3da7 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/KernelInstanceBoundsAnalysis.section @@ -0,0 +1,42 @@ +DisplayName: "Kernel Bounds" +Identifier: "kernel_instance_bounds_analysis" +Order: 10 +Metrics { + Metrics { + Label: "Instructions Issued" + Name: "smsp__inst_issued_slots" + } + Metrics { + Label: "Instructions Executed LSU" + Name: "smsp__inst_executed_lsu_pipe" + } + Metrics { + Label: "Instructions Executed TEX" + Name: "smsp__inst_executed_tex_pipe" + } + Metrics { + Label: "Instructions Executed BRU" + Name: "smsp__inst_executed_bru_pipe" + } + Metrics { + Label: "Utilization Issue" + Name: "smsp__utilization_issue" + } + Metrics { + Label: "smsp__pipe_utilization_tex_pct" + Name: "smsp__pipe_utilization_tex_pct" + } + Metrics { + Label: "smsp__pipe_utilization_lsu_pct" + Name: "smsp__pipe_utilization_lsu_pct" + } + Metrics { + Label: "smsp__pipe_utilization_bru_pct" + Name: "smsp__pipe_utilization_bru_pct" + } + Metrics { + Label: "smsp__pipe_alu_utilization_pct" + Name: "smsp__pipe_alu_utilization_pct" + } +} + diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/RuleTemplate.section b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/RuleTemplate.section new file mode 100644 index 0000000000000000000000000000000000000000..e5f71da327baf7fa4f53b30c19041b5d870f4155 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/RuleTemplate.section @@ -0,0 +1,25 @@ +Identifier: "RuleTemplateSection" +DisplayName: "Rule Template" +Order: 20 +Metrics { + Metrics { + Name: "sass__inst_executed_per_opcode" + Filter { + CollectionFilter { + CollectionScopes: CollectionScope_Launch + } + } + } +} +Header { + Rows: 1 + Metrics { + Label: "Grid Size" + Name: "launch__grid_size" + } + Metrics { + Label: "Block Size" + Name: "launch__block_size" + } +} + diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/RuleTemplate2_table.chart b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/RuleTemplate2_table.chart new file mode 100644 index 0000000000000000000000000000000000000000..7db2cd4450ba6bf95aa0ef607c053d7016cf4770 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/RuleTemplate2_table.chart @@ -0,0 +1,12 @@ +Table { + Label: "Template Rule Table" + Columns: 1 + Order: ColumnMajor + Metrics { + Label: "New numeric metric" + Name: "new_metric_numeric" + } + Metrics { + Name: "new_metric_string" + } +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/RuleTemplate_bar.chart b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/RuleTemplate_bar.chart new file mode 100644 index 0000000000000000000000000000000000000000..2f5ab244ba412dcc219e00961e5c7f32015acce6 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/RuleTemplate_bar.chart @@ -0,0 +1,14 @@ +BarChart { + Label: "Template Rule Bar Chart" + CategoryAxis { + Label: "Opcodes" + } + ValueAxis { + Label: "Instructions Executed" + } + Metrics { + Label: "" + Name: "sass__inst_executed_per_opcode" + ShowInstances: 1 + } +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/RuleTemplate_table.chart b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/RuleTemplate_table.chart new file mode 100644 index 0000000000000000000000000000000000000000..382aea542bb4a50b03ebc20e63ffe6a23a35977a --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/RuleTemplate_table.chart @@ -0,0 +1,13 @@ +Table { + Label: "Kernel Information" + Columns: 1 + Order: ColumnMajor + Metrics { + Label: "Grid Size" + Name: "launch__grid_size" + } + Metrics { + Label: "Block Size" + Name: "launch__block_size" + } +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/SpeedupWithFocusMetrics.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/SpeedupWithFocusMetrics.py new file mode 100644 index 0000000000000000000000000000000000000000..6a7dfc82026887eb2392569fb37d9bded66b50a4 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/RuleTemplates/SpeedupWithFocusMetrics.py @@ -0,0 +1,70 @@ +import NvRules + + +def get_identifier(): + return "TemplateRuleSpeedup" + + +def get_name(): + return "Speedup Estimation Template" + + +def get_description(): + return "A rule template containing a speedup estimation and focus metrics." + + +def apply(handle): + ctx = NvRules.get_context(handle) + action = ctx.range_by_idx(0).action_by_idx(0) + frontend = ctx.frontend() + + # Get metrics for the speedup estimation + compute_throughput_name = "sm__throughput.avg.pct_of_peak_sustained_elapsed" + memory_throughput_name = ( + "gpu__compute_memory_throughput.avg.pct_of_peak_sustained_elapsed" + ) + compute_throughput = action[compute_throughput_name].value() + memory_throughput = action[memory_throughput_name].value() + + # Calculate the potential speedup; we will later need a number in percent + if compute_throughput > memory_throughput: + dominated_by = "compute" + improvement_percent = 100 - compute_throughput + else: + dominated_by = "memory" + improvement_percent = 100 - memory_throughput + + # Post a message to the frontend summarizing the outcome of the rule. + # Messages of type OPTIMIZATION with a speedup estimate will also be displayed + # on the summary page. + message_id = frontend.message( + NvRules.IFrontend.MsgType_MSG_OPTIMIZATION, + "This kernel is currently dominated by {}.".format(dominated_by), + "Compute vs Memory", + ) + + # Attach a speedup estimate to the last message. + # Since we did not make sure that the required metrics are collected by a + # parent-scope section, we ought to make sure that the metrics are collected manually + # or by another section. We express this here with SpeedupType_GLOBAL. + frontend.speedup( + message_id, NvRules.IFrontend.SpeedupType_GLOBAL, improvement_percent + ) + + # Attach the two metrics which entered the speedup estimation to the last message. + # These metrics serve as focus metrics or key performance indicators and should + # be tracked when optimizing the kernel according to this rule. + frontend.focus_metric( + message_id, + compute_throughput_name, + compute_throughput, + NvRules.IFrontend.Severity_SEVERITY_DEFAULT, + "Increase the compute throughput", + ) + frontend.focus_metric( + message_id, + memory_throughput_name, + memory_throughput, + NvRules.IFrontend.Severity_SEVERITY_DEFAULT, + "Increase the memory throughput", + ) diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/python/ncu_report.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/python/ncu_report.py new file mode 100644 index 0000000000000000000000000000000000000000..f264e3b966704fc38eba55fad5f2f27f78513141 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/python/ncu_report.py @@ -0,0 +1,2936 @@ +# This file was automatically generated by SWIG (http://www.swig.org). +# Version 4.1.0 +# +# Do not make changes to this file unless you know what you are doing--modify +# the SWIG interface file instead. + + +# Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of NVIDIA CORPORATION nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + +from sys import version_info as _swig_python_version_info +if _swig_python_version_info < (2, 7, 0): + raise RuntimeError("Python 2.7 or later required") + +# Import the low-level C/C++ module +if __package__ or "." in __name__: + from . import _ncu_report +else: + import _ncu_report + +try: + import builtins as __builtin__ +except ImportError: + import __builtin__ + +def _swig_repr(self): + try: + strthis = "proxy of " + self.this.__repr__() + except __builtin__.Exception: + strthis = "" + return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) + + +def _swig_setattr_nondynamic_instance_variable(set): + def set_instance_attr(self, name, value): + if name == "thisown": + self.this.own(value) + elif name == "this": + set(self, name, value) + elif hasattr(self, name) and isinstance(getattr(type(self), name), property): + set(self, name, value) + else: + raise AttributeError("You cannot add instance attributes to %s" % self) + return set_instance_attr + + +def _swig_setattr_nondynamic_class_variable(set): + def set_class_attr(cls, name, value): + if hasattr(cls, name) and not isinstance(getattr(cls, name), property): + set(cls, name, value) + else: + raise AttributeError("You cannot add class attributes to %s" % cls) + return set_class_attr + + +def _swig_add_metaclass(metaclass): + """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass""" + def wrapper(cls): + return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy()) + return wrapper + + +class _SwigNonDynamicMeta(type): + """Meta class to enforce nondynamic attributes (no new attributes) for a class""" + __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__) + + +import weakref + +class SwigPyIterator(object): + r"""Proxy of C++ swig::SwigPyIterator class.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + __swig_destroy__ = _ncu_report.delete_SwigPyIterator + + def value(self) -> "PyObject *": + r"""value(SwigPyIterator self) -> PyObject *""" + return _ncu_report.SwigPyIterator_value(self) + + def incr(self, n: "size_t"=1) -> "swig::SwigPyIterator *": + r""" + incr(SwigPyIterator self, size_t n=1) -> SwigPyIterator + + Parameters + ---------- + n: size_t + + """ + return _ncu_report.SwigPyIterator_incr(self, n) + + def decr(self, n: "size_t"=1) -> "swig::SwigPyIterator *": + r""" + decr(SwigPyIterator self, size_t n=1) -> SwigPyIterator + + Parameters + ---------- + n: size_t + + """ + return _ncu_report.SwigPyIterator_decr(self, n) + + def distance(self, x: "SwigPyIterator") -> "ptrdiff_t": + r""" + distance(SwigPyIterator self, SwigPyIterator x) -> ptrdiff_t + + Parameters + ---------- + x: swig::SwigPyIterator const & + + """ + return _ncu_report.SwigPyIterator_distance(self, x) + + def equal(self, x: "SwigPyIterator") -> "bool": + r""" + equal(SwigPyIterator self, SwigPyIterator x) -> bool + + Parameters + ---------- + x: swig::SwigPyIterator const & + + """ + return _ncu_report.SwigPyIterator_equal(self, x) + + def copy(self) -> "swig::SwigPyIterator *": + r"""copy(SwigPyIterator self) -> SwigPyIterator""" + return _ncu_report.SwigPyIterator_copy(self) + + def next(self) -> "PyObject *": + r"""next(SwigPyIterator self) -> PyObject *""" + return _ncu_report.SwigPyIterator_next(self) + + def __next__(self) -> "PyObject *": + r"""__next__(SwigPyIterator self) -> PyObject *""" + return _ncu_report.SwigPyIterator___next__(self) + + def previous(self) -> "PyObject *": + r"""previous(SwigPyIterator self) -> PyObject *""" + return _ncu_report.SwigPyIterator_previous(self) + + def advance(self, n: "ptrdiff_t") -> "swig::SwigPyIterator *": + r""" + advance(SwigPyIterator self, ptrdiff_t n) -> SwigPyIterator + + Parameters + ---------- + n: ptrdiff_t + + """ + return _ncu_report.SwigPyIterator_advance(self, n) + + def __eq__(self, x: "SwigPyIterator") -> "bool": + r""" + __eq__(SwigPyIterator self, SwigPyIterator x) -> bool + + Parameters + ---------- + x: swig::SwigPyIterator const & + + """ + return _ncu_report.SwigPyIterator___eq__(self, x) + + def __ne__(self, x: "SwigPyIterator") -> "bool": + r""" + __ne__(SwigPyIterator self, SwigPyIterator x) -> bool + + Parameters + ---------- + x: swig::SwigPyIterator const & + + """ + return _ncu_report.SwigPyIterator___ne__(self, x) + + def __iadd__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator &": + r""" + __iadd__(SwigPyIterator self, ptrdiff_t n) -> SwigPyIterator + + Parameters + ---------- + n: ptrdiff_t + + """ + return _ncu_report.SwigPyIterator___iadd__(self, n) + + def __isub__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator &": + r""" + __isub__(SwigPyIterator self, ptrdiff_t n) -> SwigPyIterator + + Parameters + ---------- + n: ptrdiff_t + + """ + return _ncu_report.SwigPyIterator___isub__(self, n) + + def __add__(self, n: "ptrdiff_t") -> "swig::SwigPyIterator *": + r""" + __add__(SwigPyIterator self, ptrdiff_t n) -> SwigPyIterator + + Parameters + ---------- + n: ptrdiff_t + + """ + return _ncu_report.SwigPyIterator___add__(self, n) + + def __sub__(self, *args) -> "ptrdiff_t": + r""" + __sub__(SwigPyIterator self, ptrdiff_t n) -> SwigPyIterator + + Parameters + ---------- + n: ptrdiff_t + + __sub__(SwigPyIterator self, SwigPyIterator x) -> ptrdiff_t + + Parameters + ---------- + x: swig::SwigPyIterator const & + + """ + return _ncu_report.SwigPyIterator___sub__(self, *args) + def __iter__(self): + return self + +# Register SwigPyIterator in _ncu_report: +_ncu_report.SwigPyIterator_swigregister(SwigPyIterator) + +class map_string_string(object): + r"""Proxy of C++ std::map< std::string,std::string > class.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def iterator(self) -> "swig::SwigPyIterator *": + r"""iterator(map_string_string self) -> SwigPyIterator""" + return _ncu_report.map_string_string_iterator(self) + def __iter__(self): + return self.iterator() + + def __nonzero__(self) -> "bool": + r"""__nonzero__(map_string_string self) -> bool""" + return _ncu_report.map_string_string___nonzero__(self) + + def __bool__(self) -> "bool": + r"""__bool__(map_string_string self) -> bool""" + return _ncu_report.map_string_string___bool__(self) + + def __len__(self) -> "std::map< std::string,std::string >::size_type": + r"""__len__(map_string_string self) -> std::map< std::string,std::string >::size_type""" + return _ncu_report.map_string_string___len__(self) + def __iter__(self): + return self.key_iterator() + def iterkeys(self): + return self.key_iterator() + def itervalues(self): + return self.value_iterator() + def iteritems(self): + return self.iterator() + + def __getitem__(self, key: "std::map< std::string,std::string >::key_type const &") -> "std::map< std::string,std::string >::mapped_type const &": + r""" + __getitem__(map_string_string self, std::map< std::string,std::string >::key_type const & key) -> std::map< std::string,std::string >::mapped_type const & + + Parameters + ---------- + key: std::map< std::string,std::string >::key_type const & + + """ + return _ncu_report.map_string_string___getitem__(self, key) + + def __delitem__(self, key: "std::map< std::string,std::string >::key_type const &") -> "void": + r""" + __delitem__(map_string_string self, std::map< std::string,std::string >::key_type const & key) + + Parameters + ---------- + key: std::map< std::string,std::string >::key_type const & + + """ + return _ncu_report.map_string_string___delitem__(self, key) + + def has_key(self, key: "std::map< std::string,std::string >::key_type const &") -> "bool": + r""" + has_key(map_string_string self, std::map< std::string,std::string >::key_type const & key) -> bool + + Parameters + ---------- + key: std::map< std::string,std::string >::key_type const & + + """ + return _ncu_report.map_string_string_has_key(self, key) + + def keys(self) -> "PyObject *": + r"""keys(map_string_string self) -> PyObject *""" + return _ncu_report.map_string_string_keys(self) + + def values(self) -> "PyObject *": + r"""values(map_string_string self) -> PyObject *""" + return _ncu_report.map_string_string_values(self) + + def items(self) -> "PyObject *": + r"""items(map_string_string self) -> PyObject *""" + return _ncu_report.map_string_string_items(self) + + def __contains__(self, key: "std::map< std::string,std::string >::key_type const &") -> "bool": + r""" + __contains__(map_string_string self, std::map< std::string,std::string >::key_type const & key) -> bool + + Parameters + ---------- + key: std::map< std::string,std::string >::key_type const & + + """ + return _ncu_report.map_string_string___contains__(self, key) + + def key_iterator(self) -> "swig::SwigPyIterator *": + r"""key_iterator(map_string_string self) -> SwigPyIterator""" + return _ncu_report.map_string_string_key_iterator(self) + + def value_iterator(self) -> "swig::SwigPyIterator *": + r"""value_iterator(map_string_string self) -> SwigPyIterator""" + return _ncu_report.map_string_string_value_iterator(self) + + def __setitem__(self, *args) -> "void": + r""" + __setitem__(map_string_string self, std::map< std::string,std::string >::key_type const & key) + + Parameters + ---------- + key: std::map< std::string,std::string >::key_type const & + + __setitem__(map_string_string self, std::map< std::string,std::string >::key_type const & key, std::map< std::string,std::string >::mapped_type const & x) + + Parameters + ---------- + key: std::map< std::string,std::string >::key_type const & + x: std::map< std::string,std::string >::mapped_type const & + + """ + return _ncu_report.map_string_string___setitem__(self, *args) + + def asdict(self) -> "PyObject *": + r"""asdict(map_string_string self) -> PyObject *""" + return _ncu_report.map_string_string_asdict(self) + + def __init__(self, *args): + r""" + __init__(map_string_string self, std::less< std::string > const & other) -> map_string_string + + Parameters + ---------- + other: std::less< std::string > const & + + __init__(map_string_string self) -> map_string_string + __init__(map_string_string self, map_string_string other) -> map_string_string + + Parameters + ---------- + other: std::map< std::string,std::string > const & + + """ + _ncu_report.map_string_string_swiginit(self, _ncu_report.new_map_string_string(*args)) + + def empty(self) -> "bool": + r"""empty(map_string_string self) -> bool""" + return _ncu_report.map_string_string_empty(self) + + def size(self) -> "std::map< std::string,std::string >::size_type": + r"""size(map_string_string self) -> std::map< std::string,std::string >::size_type""" + return _ncu_report.map_string_string_size(self) + + def swap(self, v: "map_string_string") -> "void": + r""" + swap(map_string_string self, map_string_string v) + + Parameters + ---------- + v: std::map< std::string,std::string > & + + """ + return _ncu_report.map_string_string_swap(self, v) + + def begin(self) -> "std::map< std::string,std::string >::iterator": + r"""begin(map_string_string self) -> std::map< std::string,std::string >::iterator""" + return _ncu_report.map_string_string_begin(self) + + def end(self) -> "std::map< std::string,std::string >::iterator": + r"""end(map_string_string self) -> std::map< std::string,std::string >::iterator""" + return _ncu_report.map_string_string_end(self) + + def rbegin(self) -> "std::map< std::string,std::string >::reverse_iterator": + r"""rbegin(map_string_string self) -> std::map< std::string,std::string >::reverse_iterator""" + return _ncu_report.map_string_string_rbegin(self) + + def rend(self) -> "std::map< std::string,std::string >::reverse_iterator": + r"""rend(map_string_string self) -> std::map< std::string,std::string >::reverse_iterator""" + return _ncu_report.map_string_string_rend(self) + + def clear(self) -> "void": + r"""clear(map_string_string self)""" + return _ncu_report.map_string_string_clear(self) + + def get_allocator(self) -> "std::map< std::string,std::string >::allocator_type": + r"""get_allocator(map_string_string self) -> std::map< std::string,std::string >::allocator_type""" + return _ncu_report.map_string_string_get_allocator(self) + + def count(self, x: "std::map< std::string,std::string >::key_type const &") -> "std::map< std::string,std::string >::size_type": + r""" + count(map_string_string self, std::map< std::string,std::string >::key_type const & x) -> std::map< std::string,std::string >::size_type + + Parameters + ---------- + x: std::map< std::string,std::string >::key_type const & + + """ + return _ncu_report.map_string_string_count(self, x) + + def erase(self, *args) -> "void": + r""" + erase(map_string_string self, std::map< std::string,std::string >::key_type const & x) -> std::map< std::string,std::string >::size_type + + Parameters + ---------- + x: std::map< std::string,std::string >::key_type const & + + erase(map_string_string self, std::map< std::string,std::string >::iterator position) + + Parameters + ---------- + position: std::map< std::string,std::string >::iterator + + erase(map_string_string self, std::map< std::string,std::string >::iterator first, std::map< std::string,std::string >::iterator last) + + Parameters + ---------- + first: std::map< std::string,std::string >::iterator + last: std::map< std::string,std::string >::iterator + + """ + return _ncu_report.map_string_string_erase(self, *args) + + def find(self, x: "std::map< std::string,std::string >::key_type const &") -> "std::map< std::string,std::string >::iterator": + r""" + find(map_string_string self, std::map< std::string,std::string >::key_type const & x) -> std::map< std::string,std::string >::iterator + + Parameters + ---------- + x: std::map< std::string,std::string >::key_type const & + + """ + return _ncu_report.map_string_string_find(self, x) + + def lower_bound(self, x: "std::map< std::string,std::string >::key_type const &") -> "std::map< std::string,std::string >::iterator": + r""" + lower_bound(map_string_string self, std::map< std::string,std::string >::key_type const & x) -> std::map< std::string,std::string >::iterator + + Parameters + ---------- + x: std::map< std::string,std::string >::key_type const & + + """ + return _ncu_report.map_string_string_lower_bound(self, x) + + def upper_bound(self, x: "std::map< std::string,std::string >::key_type const &") -> "std::map< std::string,std::string >::iterator": + r""" + upper_bound(map_string_string self, std::map< std::string,std::string >::key_type const & x) -> std::map< std::string,std::string >::iterator + + Parameters + ---------- + x: std::map< std::string,std::string >::key_type const & + + """ + return _ncu_report.map_string_string_upper_bound(self, x) + __swig_destroy__ = _ncu_report.delete_map_string_string + +# Register map_string_string in _ncu_report: +_ncu_report.map_string_string_swigregister(map_string_string) + +class set_string(object): + r"""Proxy of C++ std::set< std::string > class.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def iterator(self) -> "swig::SwigPyIterator *": + r"""iterator(set_string self) -> SwigPyIterator""" + return _ncu_report.set_string_iterator(self) + def __iter__(self): + return self.iterator() + + def __nonzero__(self) -> "bool": + r"""__nonzero__(set_string self) -> bool""" + return _ncu_report.set_string___nonzero__(self) + + def __bool__(self) -> "bool": + r"""__bool__(set_string self) -> bool""" + return _ncu_report.set_string___bool__(self) + + def __len__(self) -> "std::set< std::string >::size_type": + r"""__len__(set_string self) -> std::set< std::string >::size_type""" + return _ncu_report.set_string___len__(self) + + def append(self, x: "std::set< std::string >::value_type") -> "void": + r""" + append(set_string self, std::set< std::string >::value_type x) + + Parameters + ---------- + x: std::set< std::string >::value_type + + """ + return _ncu_report.set_string_append(self, x) + + def __contains__(self, x: "std::set< std::string >::value_type") -> "bool": + r""" + __contains__(set_string self, std::set< std::string >::value_type x) -> bool + + Parameters + ---------- + x: std::set< std::string >::value_type + + """ + return _ncu_report.set_string___contains__(self, x) + + def __getitem__(self, i: "std::set< std::string >::difference_type") -> "std::set< std::string >::value_type": + r""" + __getitem__(set_string self, std::set< std::string >::difference_type i) -> std::set< std::string >::value_type + + Parameters + ---------- + i: std::set< std::string >::difference_type + + """ + return _ncu_report.set_string___getitem__(self, i) + + def add(self, x: "std::set< std::string >::value_type") -> "void": + r""" + add(set_string self, std::set< std::string >::value_type x) + + Parameters + ---------- + x: std::set< std::string >::value_type + + """ + return _ncu_report.set_string_add(self, x) + + def discard(self, x: "std::set< std::string >::value_type") -> "void": + r""" + discard(set_string self, std::set< std::string >::value_type x) + + Parameters + ---------- + x: std::set< std::string >::value_type + + """ + return _ncu_report.set_string_discard(self, x) + + def __init__(self, *args): + r""" + __init__(set_string self, std::less< std::string > const & other) -> set_string + + Parameters + ---------- + other: std::less< std::string > const & + + __init__(set_string self) -> set_string + __init__(set_string self, set_string other) -> set_string + + Parameters + ---------- + other: std::set< std::string > const & + + """ + _ncu_report.set_string_swiginit(self, _ncu_report.new_set_string(*args)) + + def empty(self) -> "bool": + r"""empty(set_string self) -> bool""" + return _ncu_report.set_string_empty(self) + + def size(self) -> "std::set< std::string >::size_type": + r"""size(set_string self) -> std::set< std::string >::size_type""" + return _ncu_report.set_string_size(self) + + def clear(self) -> "void": + r"""clear(set_string self)""" + return _ncu_report.set_string_clear(self) + + def swap(self, v: "set_string") -> "void": + r""" + swap(set_string self, set_string v) + + Parameters + ---------- + v: std::set< std::string > & + + """ + return _ncu_report.set_string_swap(self, v) + + def count(self, x: "std::set< std::string >::key_type const &") -> "std::set< std::string >::size_type": + r""" + count(set_string self, std::set< std::string >::key_type const & x) -> std::set< std::string >::size_type + + Parameters + ---------- + x: std::set< std::string >::key_type const & + + """ + return _ncu_report.set_string_count(self, x) + + def begin(self) -> "std::set< std::string >::iterator": + r"""begin(set_string self) -> std::set< std::string >::iterator""" + return _ncu_report.set_string_begin(self) + + def end(self) -> "std::set< std::string >::iterator": + r"""end(set_string self) -> std::set< std::string >::iterator""" + return _ncu_report.set_string_end(self) + + def rbegin(self) -> "std::set< std::string >::reverse_iterator": + r"""rbegin(set_string self) -> std::set< std::string >::reverse_iterator""" + return _ncu_report.set_string_rbegin(self) + + def rend(self) -> "std::set< std::string >::reverse_iterator": + r"""rend(set_string self) -> std::set< std::string >::reverse_iterator""" + return _ncu_report.set_string_rend(self) + + def erase(self, *args) -> "void": + r""" + erase(set_string self, std::set< std::string >::key_type const & x) -> std::set< std::string >::size_type + + Parameters + ---------- + x: std::set< std::string >::key_type const & + + erase(set_string self, std::set< std::string >::iterator pos) + + Parameters + ---------- + pos: std::set< std::string >::iterator + + erase(set_string self, std::set< std::string >::iterator first, std::set< std::string >::iterator last) + + Parameters + ---------- + first: std::set< std::string >::iterator + last: std::set< std::string >::iterator + + """ + return _ncu_report.set_string_erase(self, *args) + + def find(self, x: "std::set< std::string >::key_type const &") -> "std::set< std::string >::iterator": + r""" + find(set_string self, std::set< std::string >::key_type const & x) -> std::set< std::string >::iterator + + Parameters + ---------- + x: std::set< std::string >::key_type const & + + """ + return _ncu_report.set_string_find(self, x) + + def lower_bound(self, x: "std::set< std::string >::key_type const &") -> "std::set< std::string >::iterator": + r""" + lower_bound(set_string self, std::set< std::string >::key_type const & x) -> std::set< std::string >::iterator + + Parameters + ---------- + x: std::set< std::string >::key_type const & + + """ + return _ncu_report.set_string_lower_bound(self, x) + + def upper_bound(self, x: "std::set< std::string >::key_type const &") -> "std::set< std::string >::iterator": + r""" + upper_bound(set_string self, std::set< std::string >::key_type const & x) -> std::set< std::string >::iterator + + Parameters + ---------- + x: std::set< std::string >::key_type const & + + """ + return _ncu_report.set_string_upper_bound(self, x) + + def equal_range(self, x: "std::set< std::string >::key_type const &") -> "std::pair< std::set< std::string >::iterator,std::set< std::string >::iterator >": + r""" + equal_range(set_string self, std::set< std::string >::key_type const & x) -> std::pair< std::set< std::string >::iterator,std::set< std::string >::iterator > + + Parameters + ---------- + x: std::set< std::string >::key_type const & + + """ + return _ncu_report.set_string_equal_range(self, x) + + def insert(self, __x: "std::set< std::string >::value_type const &") -> "std::pair< std::set< std::string >::iterator,bool >": + r""" + insert(set_string self, std::set< std::string >::value_type const & __x) -> std::pair< std::set< std::string >::iterator,bool > + + Parameters + ---------- + __x: std::set< std::string >::value_type const & + + """ + return _ncu_report.set_string_insert(self, __x) + __swig_destroy__ = _ncu_report.delete_set_string + +# Register set_string in _ncu_report: +_ncu_report.set_string_swigregister(set_string) + +class set_ull(object): + r"""Proxy of C++ std::set< unsigned long long > class.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def iterator(self) -> "swig::SwigPyIterator *": + r"""iterator(set_ull self) -> SwigPyIterator""" + return _ncu_report.set_ull_iterator(self) + def __iter__(self): + return self.iterator() + + def __nonzero__(self) -> "bool": + r"""__nonzero__(set_ull self) -> bool""" + return _ncu_report.set_ull___nonzero__(self) + + def __bool__(self) -> "bool": + r"""__bool__(set_ull self) -> bool""" + return _ncu_report.set_ull___bool__(self) + + def __len__(self) -> "std::set< unsigned long long >::size_type": + r"""__len__(set_ull self) -> std::set< unsigned long long >::size_type""" + return _ncu_report.set_ull___len__(self) + + def append(self, x: "std::set< unsigned long long >::value_type") -> "void": + r""" + append(set_ull self, std::set< unsigned long long >::value_type x) + + Parameters + ---------- + x: std::set< unsigned long long >::value_type + + """ + return _ncu_report.set_ull_append(self, x) + + def __contains__(self, x: "std::set< unsigned long long >::value_type") -> "bool": + r""" + __contains__(set_ull self, std::set< unsigned long long >::value_type x) -> bool + + Parameters + ---------- + x: std::set< unsigned long long >::value_type + + """ + return _ncu_report.set_ull___contains__(self, x) + + def __getitem__(self, i: "std::set< unsigned long long >::difference_type") -> "std::set< unsigned long long >::value_type": + r""" + __getitem__(set_ull self, std::set< unsigned long long >::difference_type i) -> std::set< unsigned long long >::value_type + + Parameters + ---------- + i: std::set< unsigned long long >::difference_type + + """ + return _ncu_report.set_ull___getitem__(self, i) + + def add(self, x: "std::set< unsigned long long >::value_type") -> "void": + r""" + add(set_ull self, std::set< unsigned long long >::value_type x) + + Parameters + ---------- + x: std::set< unsigned long long >::value_type + + """ + return _ncu_report.set_ull_add(self, x) + + def discard(self, x: "std::set< unsigned long long >::value_type") -> "void": + r""" + discard(set_ull self, std::set< unsigned long long >::value_type x) + + Parameters + ---------- + x: std::set< unsigned long long >::value_type + + """ + return _ncu_report.set_ull_discard(self, x) + + def __init__(self, *args): + r""" + __init__(set_ull self, std::less< unsigned long long > const & other) -> set_ull + + Parameters + ---------- + other: std::less< unsigned long long > const & + + __init__(set_ull self) -> set_ull + __init__(set_ull self, set_ull other) -> set_ull + + Parameters + ---------- + other: std::set< unsigned long long > const & + + """ + _ncu_report.set_ull_swiginit(self, _ncu_report.new_set_ull(*args)) + + def empty(self) -> "bool": + r"""empty(set_ull self) -> bool""" + return _ncu_report.set_ull_empty(self) + + def size(self) -> "std::set< unsigned long long >::size_type": + r"""size(set_ull self) -> std::set< unsigned long long >::size_type""" + return _ncu_report.set_ull_size(self) + + def clear(self) -> "void": + r"""clear(set_ull self)""" + return _ncu_report.set_ull_clear(self) + + def swap(self, v: "set_ull") -> "void": + r""" + swap(set_ull self, set_ull v) + + Parameters + ---------- + v: std::set< unsigned long long > & + + """ + return _ncu_report.set_ull_swap(self, v) + + def count(self, x: "std::set< unsigned long long >::key_type const &") -> "std::set< unsigned long long >::size_type": + r""" + count(set_ull self, std::set< unsigned long long >::key_type const & x) -> std::set< unsigned long long >::size_type + + Parameters + ---------- + x: std::set< unsigned long long >::key_type const & + + """ + return _ncu_report.set_ull_count(self, x) + + def begin(self) -> "std::set< unsigned long long >::iterator": + r"""begin(set_ull self) -> std::set< unsigned long long >::iterator""" + return _ncu_report.set_ull_begin(self) + + def end(self) -> "std::set< unsigned long long >::iterator": + r"""end(set_ull self) -> std::set< unsigned long long >::iterator""" + return _ncu_report.set_ull_end(self) + + def rbegin(self) -> "std::set< unsigned long long >::reverse_iterator": + r"""rbegin(set_ull self) -> std::set< unsigned long long >::reverse_iterator""" + return _ncu_report.set_ull_rbegin(self) + + def rend(self) -> "std::set< unsigned long long >::reverse_iterator": + r"""rend(set_ull self) -> std::set< unsigned long long >::reverse_iterator""" + return _ncu_report.set_ull_rend(self) + + def erase(self, *args) -> "void": + r""" + erase(set_ull self, std::set< unsigned long long >::key_type const & x) -> std::set< unsigned long long >::size_type + + Parameters + ---------- + x: std::set< unsigned long long >::key_type const & + + erase(set_ull self, std::set< unsigned long long >::iterator pos) + + Parameters + ---------- + pos: std::set< unsigned long long >::iterator + + erase(set_ull self, std::set< unsigned long long >::iterator first, std::set< unsigned long long >::iterator last) + + Parameters + ---------- + first: std::set< unsigned long long >::iterator + last: std::set< unsigned long long >::iterator + + """ + return _ncu_report.set_ull_erase(self, *args) + + def find(self, x: "std::set< unsigned long long >::key_type const &") -> "std::set< unsigned long long >::iterator": + r""" + find(set_ull self, std::set< unsigned long long >::key_type const & x) -> std::set< unsigned long long >::iterator + + Parameters + ---------- + x: std::set< unsigned long long >::key_type const & + + """ + return _ncu_report.set_ull_find(self, x) + + def lower_bound(self, x: "std::set< unsigned long long >::key_type const &") -> "std::set< unsigned long long >::iterator": + r""" + lower_bound(set_ull self, std::set< unsigned long long >::key_type const & x) -> std::set< unsigned long long >::iterator + + Parameters + ---------- + x: std::set< unsigned long long >::key_type const & + + """ + return _ncu_report.set_ull_lower_bound(self, x) + + def upper_bound(self, x: "std::set< unsigned long long >::key_type const &") -> "std::set< unsigned long long >::iterator": + r""" + upper_bound(set_ull self, std::set< unsigned long long >::key_type const & x) -> std::set< unsigned long long >::iterator + + Parameters + ---------- + x: std::set< unsigned long long >::key_type const & + + """ + return _ncu_report.set_ull_upper_bound(self, x) + + def equal_range(self, x: "std::set< unsigned long long >::key_type const &") -> "std::pair< std::set< unsigned long long >::iterator,std::set< unsigned long long >::iterator >": + r""" + equal_range(set_ull self, std::set< unsigned long long >::key_type const & x) -> std::pair< std::set< unsigned long long >::iterator,std::set< unsigned long long >::iterator > + + Parameters + ---------- + x: std::set< unsigned long long >::key_type const & + + """ + return _ncu_report.set_ull_equal_range(self, x) + + def insert(self, __x: "std::set< unsigned long long >::value_type const &") -> "std::pair< std::set< unsigned long long >::iterator,bool >": + r""" + insert(set_ull self, std::set< unsigned long long >::value_type const & __x) -> std::pair< std::set< unsigned long long >::iterator,bool > + + Parameters + ---------- + __x: std::set< unsigned long long >::value_type const & + + """ + return _ncu_report.set_ull_insert(self, __x) + __swig_destroy__ = _ncu_report.delete_set_ull + +# Register set_ull in _ncu_report: +_ncu_report.set_ull_swigregister(set_ull) + +class vector_string(object): + r"""Proxy of C++ std::vector< std::string > class.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def iterator(self) -> "swig::SwigPyIterator *": + r"""iterator(vector_string self) -> SwigPyIterator""" + return _ncu_report.vector_string_iterator(self) + def __iter__(self): + return self.iterator() + + def __nonzero__(self) -> "bool": + r"""__nonzero__(vector_string self) -> bool""" + return _ncu_report.vector_string___nonzero__(self) + + def __bool__(self) -> "bool": + r"""__bool__(vector_string self) -> bool""" + return _ncu_report.vector_string___bool__(self) + + def __len__(self) -> "std::vector< std::string >::size_type": + r"""__len__(vector_string self) -> std::vector< std::string >::size_type""" + return _ncu_report.vector_string___len__(self) + + def __getslice__(self, i: "std::vector< std::string >::difference_type", j: "std::vector< std::string >::difference_type") -> "std::vector< std::string,std::allocator< std::string > > *": + r""" + __getslice__(vector_string self, std::vector< std::string >::difference_type i, std::vector< std::string >::difference_type j) -> vector_string + + Parameters + ---------- + i: std::vector< std::string >::difference_type + j: std::vector< std::string >::difference_type + + """ + return _ncu_report.vector_string___getslice__(self, i, j) + + def __setslice__(self, *args) -> "void": + r""" + __setslice__(vector_string self, std::vector< std::string >::difference_type i, std::vector< std::string >::difference_type j) + + Parameters + ---------- + i: std::vector< std::string >::difference_type + j: std::vector< std::string >::difference_type + + __setslice__(vector_string self, std::vector< std::string >::difference_type i, std::vector< std::string >::difference_type j, vector_string v) + + Parameters + ---------- + i: std::vector< std::string >::difference_type + j: std::vector< std::string >::difference_type + v: std::vector< std::string,std::allocator< std::string > > const & + + """ + return _ncu_report.vector_string___setslice__(self, *args) + + def __delslice__(self, i: "std::vector< std::string >::difference_type", j: "std::vector< std::string >::difference_type") -> "void": + r""" + __delslice__(vector_string self, std::vector< std::string >::difference_type i, std::vector< std::string >::difference_type j) + + Parameters + ---------- + i: std::vector< std::string >::difference_type + j: std::vector< std::string >::difference_type + + """ + return _ncu_report.vector_string___delslice__(self, i, j) + + def __delitem__(self, *args) -> "void": + r""" + __delitem__(vector_string self, std::vector< std::string >::difference_type i) + + Parameters + ---------- + i: std::vector< std::string >::difference_type + + __delitem__(vector_string self, PySliceObject * slice) + + Parameters + ---------- + slice: PySliceObject * + + """ + return _ncu_report.vector_string___delitem__(self, *args) + + def __getitem__(self, *args) -> "std::vector< std::string >::value_type const &": + r""" + __getitem__(vector_string self, PySliceObject * slice) -> vector_string + + Parameters + ---------- + slice: PySliceObject * + + __getitem__(vector_string self, std::vector< std::string >::difference_type i) -> std::vector< std::string >::value_type const & + + Parameters + ---------- + i: std::vector< std::string >::difference_type + + """ + return _ncu_report.vector_string___getitem__(self, *args) + + def __setitem__(self, *args) -> "void": + r""" + __setitem__(vector_string self, PySliceObject * slice, vector_string v) + + Parameters + ---------- + slice: PySliceObject * + v: std::vector< std::string,std::allocator< std::string > > const & + + __setitem__(vector_string self, PySliceObject * slice) + + Parameters + ---------- + slice: PySliceObject * + + __setitem__(vector_string self, std::vector< std::string >::difference_type i, std::vector< std::string >::value_type const & x) + + Parameters + ---------- + i: std::vector< std::string >::difference_type + x: std::vector< std::string >::value_type const & + + """ + return _ncu_report.vector_string___setitem__(self, *args) + + def pop(self) -> "std::vector< std::string >::value_type": + r"""pop(vector_string self) -> std::vector< std::string >::value_type""" + return _ncu_report.vector_string_pop(self) + + def append(self, x: "std::vector< std::string >::value_type const &") -> "void": + r""" + append(vector_string self, std::vector< std::string >::value_type const & x) + + Parameters + ---------- + x: std::vector< std::string >::value_type const & + + """ + return _ncu_report.vector_string_append(self, x) + + def empty(self) -> "bool": + r"""empty(vector_string self) -> bool""" + return _ncu_report.vector_string_empty(self) + + def size(self) -> "std::vector< std::string >::size_type": + r"""size(vector_string self) -> std::vector< std::string >::size_type""" + return _ncu_report.vector_string_size(self) + + def swap(self, v: "vector_string") -> "void": + r""" + swap(vector_string self, vector_string v) + + Parameters + ---------- + v: std::vector< std::string > & + + """ + return _ncu_report.vector_string_swap(self, v) + + def begin(self) -> "std::vector< std::string >::iterator": + r"""begin(vector_string self) -> std::vector< std::string >::iterator""" + return _ncu_report.vector_string_begin(self) + + def end(self) -> "std::vector< std::string >::iterator": + r"""end(vector_string self) -> std::vector< std::string >::iterator""" + return _ncu_report.vector_string_end(self) + + def rbegin(self) -> "std::vector< std::string >::reverse_iterator": + r"""rbegin(vector_string self) -> std::vector< std::string >::reverse_iterator""" + return _ncu_report.vector_string_rbegin(self) + + def rend(self) -> "std::vector< std::string >::reverse_iterator": + r"""rend(vector_string self) -> std::vector< std::string >::reverse_iterator""" + return _ncu_report.vector_string_rend(self) + + def clear(self) -> "void": + r"""clear(vector_string self)""" + return _ncu_report.vector_string_clear(self) + + def get_allocator(self) -> "std::vector< std::string >::allocator_type": + r"""get_allocator(vector_string self) -> std::vector< std::string >::allocator_type""" + return _ncu_report.vector_string_get_allocator(self) + + def pop_back(self) -> "void": + r"""pop_back(vector_string self)""" + return _ncu_report.vector_string_pop_back(self) + + def erase(self, *args) -> "std::vector< std::string >::iterator": + r""" + erase(vector_string self, std::vector< std::string >::iterator pos) -> std::vector< std::string >::iterator + + Parameters + ---------- + pos: std::vector< std::string >::iterator + + erase(vector_string self, std::vector< std::string >::iterator first, std::vector< std::string >::iterator last) -> std::vector< std::string >::iterator + + Parameters + ---------- + first: std::vector< std::string >::iterator + last: std::vector< std::string >::iterator + + """ + return _ncu_report.vector_string_erase(self, *args) + + def __init__(self, *args): + r""" + __init__(vector_string self) -> vector_string + __init__(vector_string self, vector_string other) -> vector_string + + Parameters + ---------- + other: std::vector< std::string > const & + + __init__(vector_string self, std::vector< std::string >::size_type size) -> vector_string + + Parameters + ---------- + size: std::vector< std::string >::size_type + + __init__(vector_string self, std::vector< std::string >::size_type size, std::vector< std::string >::value_type const & value) -> vector_string + + Parameters + ---------- + size: std::vector< std::string >::size_type + value: std::vector< std::string >::value_type const & + + """ + _ncu_report.vector_string_swiginit(self, _ncu_report.new_vector_string(*args)) + + def push_back(self, x: "std::vector< std::string >::value_type const &") -> "void": + r""" + push_back(vector_string self, std::vector< std::string >::value_type const & x) + + Parameters + ---------- + x: std::vector< std::string >::value_type const & + + """ + return _ncu_report.vector_string_push_back(self, x) + + def front(self) -> "std::vector< std::string >::value_type const &": + r"""front(vector_string self) -> std::vector< std::string >::value_type const &""" + return _ncu_report.vector_string_front(self) + + def back(self) -> "std::vector< std::string >::value_type const &": + r"""back(vector_string self) -> std::vector< std::string >::value_type const &""" + return _ncu_report.vector_string_back(self) + + def assign(self, n: "std::vector< std::string >::size_type", x: "std::vector< std::string >::value_type const &") -> "void": + r""" + assign(vector_string self, std::vector< std::string >::size_type n, std::vector< std::string >::value_type const & x) + + Parameters + ---------- + n: std::vector< std::string >::size_type + x: std::vector< std::string >::value_type const & + + """ + return _ncu_report.vector_string_assign(self, n, x) + + def resize(self, *args) -> "void": + r""" + resize(vector_string self, std::vector< std::string >::size_type new_size) + + Parameters + ---------- + new_size: std::vector< std::string >::size_type + + resize(vector_string self, std::vector< std::string >::size_type new_size, std::vector< std::string >::value_type const & x) + + Parameters + ---------- + new_size: std::vector< std::string >::size_type + x: std::vector< std::string >::value_type const & + + """ + return _ncu_report.vector_string_resize(self, *args) + + def insert(self, *args) -> "void": + r""" + insert(vector_string self, std::vector< std::string >::iterator pos, std::vector< std::string >::value_type const & x) -> std::vector< std::string >::iterator + + Parameters + ---------- + pos: std::vector< std::string >::iterator + x: std::vector< std::string >::value_type const & + + insert(vector_string self, std::vector< std::string >::iterator pos, std::vector< std::string >::size_type n, std::vector< std::string >::value_type const & x) + + Parameters + ---------- + pos: std::vector< std::string >::iterator + n: std::vector< std::string >::size_type + x: std::vector< std::string >::value_type const & + + """ + return _ncu_report.vector_string_insert(self, *args) + + def reserve(self, n: "std::vector< std::string >::size_type") -> "void": + r""" + reserve(vector_string self, std::vector< std::string >::size_type n) + + Parameters + ---------- + n: std::vector< std::string >::size_type + + """ + return _ncu_report.vector_string_reserve(self, n) + + def capacity(self) -> "std::vector< std::string >::size_type": + r"""capacity(vector_string self) -> std::vector< std::string >::size_type""" + return _ncu_report.vector_string_capacity(self) + __swig_destroy__ = _ncu_report.delete_vector_string + +# Register vector_string in _ncu_report: +_ncu_report.vector_string_swigregister(vector_string) + +class vector_ull(object): + r"""Proxy of C++ std::vector< unsigned long long > class.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def iterator(self) -> "swig::SwigPyIterator *": + r"""iterator(vector_ull self) -> SwigPyIterator""" + return _ncu_report.vector_ull_iterator(self) + def __iter__(self): + return self.iterator() + + def __nonzero__(self) -> "bool": + r"""__nonzero__(vector_ull self) -> bool""" + return _ncu_report.vector_ull___nonzero__(self) + + def __bool__(self) -> "bool": + r"""__bool__(vector_ull self) -> bool""" + return _ncu_report.vector_ull___bool__(self) + + def __len__(self) -> "std::vector< unsigned long long >::size_type": + r"""__len__(vector_ull self) -> std::vector< unsigned long long >::size_type""" + return _ncu_report.vector_ull___len__(self) + + def __getslice__(self, i: "std::vector< unsigned long long >::difference_type", j: "std::vector< unsigned long long >::difference_type") -> "std::vector< unsigned long long,std::allocator< unsigned long long > > *": + r""" + __getslice__(vector_ull self, std::vector< unsigned long long >::difference_type i, std::vector< unsigned long long >::difference_type j) -> vector_ull + + Parameters + ---------- + i: std::vector< unsigned long long >::difference_type + j: std::vector< unsigned long long >::difference_type + + """ + return _ncu_report.vector_ull___getslice__(self, i, j) + + def __setslice__(self, *args) -> "void": + r""" + __setslice__(vector_ull self, std::vector< unsigned long long >::difference_type i, std::vector< unsigned long long >::difference_type j) + + Parameters + ---------- + i: std::vector< unsigned long long >::difference_type + j: std::vector< unsigned long long >::difference_type + + __setslice__(vector_ull self, std::vector< unsigned long long >::difference_type i, std::vector< unsigned long long >::difference_type j, vector_ull v) + + Parameters + ---------- + i: std::vector< unsigned long long >::difference_type + j: std::vector< unsigned long long >::difference_type + v: std::vector< unsigned long long,std::allocator< unsigned long long > > const & + + """ + return _ncu_report.vector_ull___setslice__(self, *args) + + def __delslice__(self, i: "std::vector< unsigned long long >::difference_type", j: "std::vector< unsigned long long >::difference_type") -> "void": + r""" + __delslice__(vector_ull self, std::vector< unsigned long long >::difference_type i, std::vector< unsigned long long >::difference_type j) + + Parameters + ---------- + i: std::vector< unsigned long long >::difference_type + j: std::vector< unsigned long long >::difference_type + + """ + return _ncu_report.vector_ull___delslice__(self, i, j) + + def __delitem__(self, *args) -> "void": + r""" + __delitem__(vector_ull self, std::vector< unsigned long long >::difference_type i) + + Parameters + ---------- + i: std::vector< unsigned long long >::difference_type + + __delitem__(vector_ull self, PySliceObject * slice) + + Parameters + ---------- + slice: PySliceObject * + + """ + return _ncu_report.vector_ull___delitem__(self, *args) + + def __getitem__(self, *args) -> "std::vector< unsigned long long >::value_type const &": + r""" + __getitem__(vector_ull self, PySliceObject * slice) -> vector_ull + + Parameters + ---------- + slice: PySliceObject * + + __getitem__(vector_ull self, std::vector< unsigned long long >::difference_type i) -> std::vector< unsigned long long >::value_type const & + + Parameters + ---------- + i: std::vector< unsigned long long >::difference_type + + """ + return _ncu_report.vector_ull___getitem__(self, *args) + + def __setitem__(self, *args) -> "void": + r""" + __setitem__(vector_ull self, PySliceObject * slice, vector_ull v) + + Parameters + ---------- + slice: PySliceObject * + v: std::vector< unsigned long long,std::allocator< unsigned long long > > const & + + __setitem__(vector_ull self, PySliceObject * slice) + + Parameters + ---------- + slice: PySliceObject * + + __setitem__(vector_ull self, std::vector< unsigned long long >::difference_type i, std::vector< unsigned long long >::value_type const & x) + + Parameters + ---------- + i: std::vector< unsigned long long >::difference_type + x: std::vector< unsigned long long >::value_type const & + + """ + return _ncu_report.vector_ull___setitem__(self, *args) + + def pop(self) -> "std::vector< unsigned long long >::value_type": + r"""pop(vector_ull self) -> std::vector< unsigned long long >::value_type""" + return _ncu_report.vector_ull_pop(self) + + def append(self, x: "std::vector< unsigned long long >::value_type const &") -> "void": + r""" + append(vector_ull self, std::vector< unsigned long long >::value_type const & x) + + Parameters + ---------- + x: std::vector< unsigned long long >::value_type const & + + """ + return _ncu_report.vector_ull_append(self, x) + + def empty(self) -> "bool": + r"""empty(vector_ull self) -> bool""" + return _ncu_report.vector_ull_empty(self) + + def size(self) -> "std::vector< unsigned long long >::size_type": + r"""size(vector_ull self) -> std::vector< unsigned long long >::size_type""" + return _ncu_report.vector_ull_size(self) + + def swap(self, v: "vector_ull") -> "void": + r""" + swap(vector_ull self, vector_ull v) + + Parameters + ---------- + v: std::vector< unsigned long long > & + + """ + return _ncu_report.vector_ull_swap(self, v) + + def begin(self) -> "std::vector< unsigned long long >::iterator": + r"""begin(vector_ull self) -> std::vector< unsigned long long >::iterator""" + return _ncu_report.vector_ull_begin(self) + + def end(self) -> "std::vector< unsigned long long >::iterator": + r"""end(vector_ull self) -> std::vector< unsigned long long >::iterator""" + return _ncu_report.vector_ull_end(self) + + def rbegin(self) -> "std::vector< unsigned long long >::reverse_iterator": + r"""rbegin(vector_ull self) -> std::vector< unsigned long long >::reverse_iterator""" + return _ncu_report.vector_ull_rbegin(self) + + def rend(self) -> "std::vector< unsigned long long >::reverse_iterator": + r"""rend(vector_ull self) -> std::vector< unsigned long long >::reverse_iterator""" + return _ncu_report.vector_ull_rend(self) + + def clear(self) -> "void": + r"""clear(vector_ull self)""" + return _ncu_report.vector_ull_clear(self) + + def get_allocator(self) -> "std::vector< unsigned long long >::allocator_type": + r"""get_allocator(vector_ull self) -> std::vector< unsigned long long >::allocator_type""" + return _ncu_report.vector_ull_get_allocator(self) + + def pop_back(self) -> "void": + r"""pop_back(vector_ull self)""" + return _ncu_report.vector_ull_pop_back(self) + + def erase(self, *args) -> "std::vector< unsigned long long >::iterator": + r""" + erase(vector_ull self, std::vector< unsigned long long >::iterator pos) -> std::vector< unsigned long long >::iterator + + Parameters + ---------- + pos: std::vector< unsigned long long >::iterator + + erase(vector_ull self, std::vector< unsigned long long >::iterator first, std::vector< unsigned long long >::iterator last) -> std::vector< unsigned long long >::iterator + + Parameters + ---------- + first: std::vector< unsigned long long >::iterator + last: std::vector< unsigned long long >::iterator + + """ + return _ncu_report.vector_ull_erase(self, *args) + + def __init__(self, *args): + r""" + __init__(vector_ull self) -> vector_ull + __init__(vector_ull self, vector_ull other) -> vector_ull + + Parameters + ---------- + other: std::vector< unsigned long long > const & + + __init__(vector_ull self, std::vector< unsigned long long >::size_type size) -> vector_ull + + Parameters + ---------- + size: std::vector< unsigned long long >::size_type + + __init__(vector_ull self, std::vector< unsigned long long >::size_type size, std::vector< unsigned long long >::value_type const & value) -> vector_ull + + Parameters + ---------- + size: std::vector< unsigned long long >::size_type + value: std::vector< unsigned long long >::value_type const & + + """ + _ncu_report.vector_ull_swiginit(self, _ncu_report.new_vector_ull(*args)) + + def push_back(self, x: "std::vector< unsigned long long >::value_type const &") -> "void": + r""" + push_back(vector_ull self, std::vector< unsigned long long >::value_type const & x) + + Parameters + ---------- + x: std::vector< unsigned long long >::value_type const & + + """ + return _ncu_report.vector_ull_push_back(self, x) + + def front(self) -> "std::vector< unsigned long long >::value_type const &": + r"""front(vector_ull self) -> std::vector< unsigned long long >::value_type const &""" + return _ncu_report.vector_ull_front(self) + + def back(self) -> "std::vector< unsigned long long >::value_type const &": + r"""back(vector_ull self) -> std::vector< unsigned long long >::value_type const &""" + return _ncu_report.vector_ull_back(self) + + def assign(self, n: "std::vector< unsigned long long >::size_type", x: "std::vector< unsigned long long >::value_type const &") -> "void": + r""" + assign(vector_ull self, std::vector< unsigned long long >::size_type n, std::vector< unsigned long long >::value_type const & x) + + Parameters + ---------- + n: std::vector< unsigned long long >::size_type + x: std::vector< unsigned long long >::value_type const & + + """ + return _ncu_report.vector_ull_assign(self, n, x) + + def resize(self, *args) -> "void": + r""" + resize(vector_ull self, std::vector< unsigned long long >::size_type new_size) + + Parameters + ---------- + new_size: std::vector< unsigned long long >::size_type + + resize(vector_ull self, std::vector< unsigned long long >::size_type new_size, std::vector< unsigned long long >::value_type const & x) + + Parameters + ---------- + new_size: std::vector< unsigned long long >::size_type + x: std::vector< unsigned long long >::value_type const & + + """ + return _ncu_report.vector_ull_resize(self, *args) + + def insert(self, *args) -> "void": + r""" + insert(vector_ull self, std::vector< unsigned long long >::iterator pos, std::vector< unsigned long long >::value_type const & x) -> std::vector< unsigned long long >::iterator + + Parameters + ---------- + pos: std::vector< unsigned long long >::iterator + x: std::vector< unsigned long long >::value_type const & + + insert(vector_ull self, std::vector< unsigned long long >::iterator pos, std::vector< unsigned long long >::size_type n, std::vector< unsigned long long >::value_type const & x) + + Parameters + ---------- + pos: std::vector< unsigned long long >::iterator + n: std::vector< unsigned long long >::size_type + x: std::vector< unsigned long long >::value_type const & + + """ + return _ncu_report.vector_ull_insert(self, *args) + + def reserve(self, n: "std::vector< unsigned long long >::size_type") -> "void": + r""" + reserve(vector_ull self, std::vector< unsigned long long >::size_type n) + + Parameters + ---------- + n: std::vector< unsigned long long >::size_type + + """ + return _ncu_report.vector_ull_reserve(self, n) + + def capacity(self) -> "std::vector< unsigned long long >::size_type": + r"""capacity(vector_ull self) -> std::vector< unsigned long long >::size_type""" + return _ncu_report.vector_ull_capacity(self) + __swig_destroy__ = _ncu_report.delete_vector_ull + +# Register vector_ull in _ncu_report: +_ncu_report.vector_ull_swigregister(vector_ull) + + + + +def load_report(file_name: "char const *", library_dir: "std::string const &") -> "NV::Rules::IContext *": + r""" + load_report(char const * file_name, std::string const & library_dir) -> IContext + + Parameters + ---------- + file_name: char const * + library_dir: std::string const & + + """ + return _ncu_report.load_report(file_name, library_dir) +RuleKind_DEFAULT = _ncu_report.RuleKind_DEFAULT + +RuleKind_GUIDED = _ncu_report.RuleKind_GUIDED + +class IMetric(object): + r"""Proxy of C++ NV::Rules::IMetric class.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + ValueKind_UNKNOWN = _ncu_report.IMetric_ValueKind_UNKNOWN + + ValueKind_ANY = _ncu_report.IMetric_ValueKind_ANY + + ValueKind_STRING = _ncu_report.IMetric_ValueKind_STRING + + ValueKind_FLOAT = _ncu_report.IMetric_ValueKind_FLOAT + + ValueKind_DOUBLE = _ncu_report.IMetric_ValueKind_DOUBLE + + ValueKind_UINT32 = _ncu_report.IMetric_ValueKind_UINT32 + + ValueKind_UINT64 = _ncu_report.IMetric_ValueKind_UINT64 + + MetricType_OTHER = _ncu_report.IMetric_MetricType_OTHER + + MetricType_COUNTER = _ncu_report.IMetric_MetricType_COUNTER + + MetricType_RATIO = _ncu_report.IMetric_MetricType_RATIO + + MetricType_THROUGHPUT = _ncu_report.IMetric_MetricType_THROUGHPUT + + MetricSubtype_NONE = _ncu_report.IMetric_MetricSubtype_NONE + + MetricSubtype_PEAK_SUSTAINED = _ncu_report.IMetric_MetricSubtype_PEAK_SUSTAINED + + MetricSubtype_PEAK_SUSTAINED_ACTIVE = _ncu_report.IMetric_MetricSubtype_PEAK_SUSTAINED_ACTIVE + + MetricSubtype_PEAK_SUSTAINED_ACTIVE_PER_SECOND = _ncu_report.IMetric_MetricSubtype_PEAK_SUSTAINED_ACTIVE_PER_SECOND + + MetricSubtype_PEAK_SUSTAINED_ELAPSED = _ncu_report.IMetric_MetricSubtype_PEAK_SUSTAINED_ELAPSED + + MetricSubtype_PEAK_SUSTAINED_ELAPSED_PER_SECOND = _ncu_report.IMetric_MetricSubtype_PEAK_SUSTAINED_ELAPSED_PER_SECOND + + MetricSubtype_PEAK_SUSTAINED_FRAME = _ncu_report.IMetric_MetricSubtype_PEAK_SUSTAINED_FRAME + + MetricSubtype_PEAK_SUSTAINED_FRAME_PER_SECOND = _ncu_report.IMetric_MetricSubtype_PEAK_SUSTAINED_FRAME_PER_SECOND + + MetricSubtype_PEAK_SUSTAINED_REGION = _ncu_report.IMetric_MetricSubtype_PEAK_SUSTAINED_REGION + + MetricSubtype_PEAK_SUSTAINED_REGION_PER_SECOND = _ncu_report.IMetric_MetricSubtype_PEAK_SUSTAINED_REGION_PER_SECOND + + MetricSubtype_PER_CYCLE_ACTIVE = _ncu_report.IMetric_MetricSubtype_PER_CYCLE_ACTIVE + + MetricSubtype_PER_CYCLE_ELAPSED = _ncu_report.IMetric_MetricSubtype_PER_CYCLE_ELAPSED + + MetricSubtype_PER_CYCLE_IN_FRAME = _ncu_report.IMetric_MetricSubtype_PER_CYCLE_IN_FRAME + + MetricSubtype_PER_CYCLE_IN_REGION = _ncu_report.IMetric_MetricSubtype_PER_CYCLE_IN_REGION + + MetricSubtype_PER_SECOND = _ncu_report.IMetric_MetricSubtype_PER_SECOND + + MetricSubtype_PCT_OF_PEAK_SUSTAINED_ACTIVE = _ncu_report.IMetric_MetricSubtype_PCT_OF_PEAK_SUSTAINED_ACTIVE + + MetricSubtype_PCT_OF_PEAK_SUSTAINED_ELAPSED = _ncu_report.IMetric_MetricSubtype_PCT_OF_PEAK_SUSTAINED_ELAPSED + + MetricSubtype_PCT_OF_PEAK_SUSTAINED_FRAME = _ncu_report.IMetric_MetricSubtype_PCT_OF_PEAK_SUSTAINED_FRAME + + MetricSubtype_PCT_OF_PEAK_SUSTAINED_REGION = _ncu_report.IMetric_MetricSubtype_PCT_OF_PEAK_SUSTAINED_REGION + + MetricSubtype_MAX_RATE = _ncu_report.IMetric_MetricSubtype_MAX_RATE + + MetricSubtype_PCT = _ncu_report.IMetric_MetricSubtype_PCT + + MetricSubtype_RATIO = _ncu_report.IMetric_MetricSubtype_RATIO + + RollupOperation_NONE = _ncu_report.IMetric_RollupOperation_NONE + + RollupOperation_AVG = _ncu_report.IMetric_RollupOperation_AVG + + RollupOperation_MAX = _ncu_report.IMetric_RollupOperation_MAX + + RollupOperation_MIN = _ncu_report.IMetric_RollupOperation_MIN + + RollupOperation_SUM = _ncu_report.IMetric_RollupOperation_SUM + + __swig_destroy__ = _ncu_report.delete_IMetric + + def name(self) -> "char const *": + r"""name(IMetric self) -> char const *""" + return _ncu_report.IMetric_name(self) + + def metric_type(self) -> "NV::Rules::IMetric::MetricType": + r"""metric_type(IMetric self) -> NV::Rules::IMetric::MetricType""" + return _ncu_report.IMetric_metric_type(self) + + def metric_subtype(self) -> "NV::Rules::IMetric::MetricSubtype": + r"""metric_subtype(IMetric self) -> NV::Rules::IMetric::MetricSubtype""" + return _ncu_report.IMetric_metric_subtype(self) + + def rollup_operation(self) -> "NV::Rules::IMetric::RollupOperation": + r"""rollup_operation(IMetric self) -> NV::Rules::IMetric::RollupOperation""" + return _ncu_report.IMetric_rollup_operation(self) + + def unit(self) -> "NV::Rules::IMetric::Unit": + r"""unit(IMetric self) -> NV::Rules::IMetric::Unit""" + return _ncu_report.IMetric_unit(self) + + def description(self) -> "NV::Rules::IMetric::Description": + r"""description(IMetric self) -> NV::Rules::IMetric::Description""" + return _ncu_report.IMetric_description(self) + + def kind(self, *args) -> "NV::Rules::IMetric::ValueKind": + r""" + kind(IMetric self) -> NV::Rules::IMetric::ValueKind + kind(IMetric self, size_t instance) -> NV::Rules::IMetric::ValueKind + + Parameters + ---------- + instance: size_t + + """ + return _ncu_report.IMetric_kind(self, *args) + + def has_value(self, *args) -> "bool": + r""" + has_value(IMetric self) -> bool + has_value(IMetric self, NV::Rules::IMetric::ValueKind value_kind) -> bool + + Parameters + ---------- + value_kind: enum NV::Rules::IMetric::ValueKind + + """ + return _ncu_report.IMetric_has_value(self, *args) + + def as_double(self, *args) -> "double": + r""" + as_double(IMetric self) -> double + as_double(IMetric self, size_t instance) -> double + + Parameters + ---------- + instance: size_t + + """ + return _ncu_report.IMetric_as_double(self, *args) + + def as_uint64(self, *args) -> "uint64_t": + r""" + as_uint64(IMetric self) -> uint64_t + as_uint64(IMetric self, size_t instance) -> uint64_t + + Parameters + ---------- + instance: size_t + + """ + return _ncu_report.IMetric_as_uint64(self, *args) + + def as_string(self, *args) -> "char const *": + r""" + as_string(IMetric self) -> char const + as_string(IMetric self, size_t instance) -> char const * + + Parameters + ---------- + instance: size_t + + """ + return _ncu_report.IMetric_as_string(self, *args) + + def num_instances(self) -> "size_t": + r"""num_instances(IMetric self) -> size_t""" + return _ncu_report.IMetric_num_instances(self) + + def has_correlation_ids(self) -> "bool": + r"""has_correlation_ids(IMetric self) -> bool""" + return _ncu_report.IMetric_has_correlation_ids(self) + + def correlation_ids(self) -> "NV::Rules::IMetric *": + r"""correlation_ids(IMetric self) -> IMetric""" + return _ncu_report.IMetric_correlation_ids(self) + +# Register IMetric in _ncu_report: +_ncu_report.IMetric_swigregister(IMetric) + +class ISourceInfo(object): + r"""Proxy of C++ NV::Rules::ISourceInfo class.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + __swig_destroy__ = _ncu_report.delete_ISourceInfo + + def file_name(self) -> "char const *": + r"""file_name(ISourceInfo self) -> char const *""" + return _ncu_report.ISourceInfo_file_name(self) + + def line(self) -> "uint32_t": + r"""line(ISourceInfo self) -> uint32_t""" + return _ncu_report.ISourceInfo_line(self) + +# Register ISourceInfo in _ncu_report: +_ncu_report.ISourceInfo_swigregister(ISourceInfo) + +class INvtxRange(object): + r"""Proxy of C++ NV::Rules::INvtxRange class.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + PayloadType_PAYLOAD_UNKNOWN = _ncu_report.INvtxRange_PayloadType_PAYLOAD_UNKNOWN + + PayloadType_PAYLOAD_UINT64 = _ncu_report.INvtxRange_PayloadType_PAYLOAD_UINT64 + + PayloadType_PAYLOAD_INT64 = _ncu_report.INvtxRange_PayloadType_PAYLOAD_INT64 + + PayloadType_PAYLOAD_DOUBLE = _ncu_report.INvtxRange_PayloadType_PAYLOAD_DOUBLE + + PayloadType_PAYLOAD_UINT32 = _ncu_report.INvtxRange_PayloadType_PAYLOAD_UINT32 + + PayloadType_PAYLOAD_INT32 = _ncu_report.INvtxRange_PayloadType_PAYLOAD_INT32 + + PayloadType_PAYLOAD_FLOAT = _ncu_report.INvtxRange_PayloadType_PAYLOAD_FLOAT + + PayloadType_PAYLOAD_JSON = _ncu_report.INvtxRange_PayloadType_PAYLOAD_JSON + + __swig_destroy__ = _ncu_report.delete_INvtxRange + + def name(self) -> "std::string": + r"""name(INvtxRange self) -> std::string""" + return _ncu_report.INvtxRange_name(self) + + def has_attributes(self) -> "bool": + r"""has_attributes(INvtxRange self) -> bool""" + return _ncu_report.INvtxRange_has_attributes(self) + + def category(self) -> "uint32_t": + r"""category(INvtxRange self) -> uint32_t""" + return _ncu_report.INvtxRange_category(self) + + def color(self) -> "uint32_t": + r"""color(INvtxRange self) -> uint32_t""" + return _ncu_report.INvtxRange_color(self) + + def payload_type(self) -> "NV::Rules::INvtxRange::PayloadType": + r"""payload_type(INvtxRange self) -> NV::Rules::INvtxRange::PayloadType""" + return _ncu_report.INvtxRange_payload_type(self) + + def payload_as_uint64(self) -> "uint64_t": + r"""payload_as_uint64(INvtxRange self) -> uint64_t""" + return _ncu_report.INvtxRange_payload_as_uint64(self) + + def payload_as_double(self) -> "double": + r"""payload_as_double(INvtxRange self) -> double""" + return _ncu_report.INvtxRange_payload_as_double(self) + + def payload_as_string(self) -> "std::string": + r"""payload_as_string(INvtxRange self) -> std::string""" + return _ncu_report.INvtxRange_payload_as_string(self) + + def message(self) -> "std::string": + r"""message(INvtxRange self) -> std::string""" + return _ncu_report.INvtxRange_message(self) + +# Register INvtxRange in _ncu_report: +_ncu_report.INvtxRange_swigregister(INvtxRange) + +class INvtxDomainInfo(object): + r"""Proxy of C++ NV::Rules::INvtxDomainInfo class.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + __swig_destroy__ = _ncu_report.delete_INvtxDomainInfo + + def name(self) -> "std::string": + r"""name(INvtxDomainInfo self) -> std::string""" + return _ncu_report.INvtxDomainInfo_name(self) + + def push_pop_ranges(self) -> "std::vector< std::string,std::allocator< std::string > >": + r"""push_pop_ranges(INvtxDomainInfo self) -> vector_string""" + return _ncu_report.INvtxDomainInfo_push_pop_ranges(self) + + def push_pop_range(self, idx: "size_t") -> "NV::Rules::INvtxRange *": + r""" + push_pop_range(INvtxDomainInfo self, size_t idx) -> INvtxRange + + Parameters + ---------- + idx: size_t + + """ + return _ncu_report.INvtxDomainInfo_push_pop_range(self, idx) + + def start_end_ranges(self) -> "std::vector< std::string,std::allocator< std::string > >": + r"""start_end_ranges(INvtxDomainInfo self) -> vector_string""" + return _ncu_report.INvtxDomainInfo_start_end_ranges(self) + + def start_end_range(self, idx: "size_t") -> "NV::Rules::INvtxRange *": + r""" + start_end_range(INvtxDomainInfo self, size_t idx) -> INvtxRange + + Parameters + ---------- + idx: size_t + + """ + return _ncu_report.INvtxDomainInfo_start_end_range(self, idx) + +# Register INvtxDomainInfo in _ncu_report: +_ncu_report.INvtxDomainInfo_swigregister(INvtxDomainInfo) + +class INvtxState(object): + r"""Proxy of C++ NV::Rules::INvtxState class.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + __swig_destroy__ = _ncu_report.delete_INvtxState + + def domains(self) -> "std::vector< unsigned long long,std::allocator< unsigned long long > >": + r"""domains(INvtxState self) -> vector_ull""" + return _ncu_report.INvtxState_domains(self) + + def domain_by_id(self, id: "unsigned long long") -> "NV::Rules::INvtxDomainInfo *": + r""" + domain_by_id(INvtxState self, unsigned long long id) -> INvtxDomainInfo + + Parameters + ---------- + id: unsigned long long + + """ + return _ncu_report.INvtxState_domain_by_id(self, id) + +# Register INvtxState in _ncu_report: +_ncu_report.INvtxState_swigregister(INvtxState) + +class IAction(object): + r"""Proxy of C++ NV::Rules::IAction class.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + NameBase_FUNCTION = _ncu_report.IAction_NameBase_FUNCTION + + NameBase_DEMANGLED = _ncu_report.IAction_NameBase_DEMANGLED + + NameBase_MANGLED = _ncu_report.IAction_NameBase_MANGLED + + __swig_destroy__ = _ncu_report.delete_IAction + + def name(self, *args) -> "char const *": + r""" + name(IAction self, NV::Rules::IAction::NameBase base=FUNCTION) -> char const + + Parameters + ---------- + base: enum NV::Rules::IAction::NameBase + + """ + return _ncu_report.IAction_name(self, *args) + + def metric_by_name(self, metric_name: "char const *") -> "NV::Rules::IMetric *": + r""" + metric_by_name(IAction self, char const * metric_name) -> IMetric + + Parameters + ---------- + metric_name: char const * + + """ + return _ncu_report.IAction_metric_by_name(self, metric_name) + + def metric_names(self) -> "std::set< std::string,std::less< std::string >,std::allocator< std::string > >": + r"""metric_names(IAction self) -> set_string""" + return _ncu_report.IAction_metric_names(self) + + def add_integer_metric(self, value_name: "char const *", value_kind: "NV::Rules::IMetric::ValueKind", value: "uint64_t") -> "NV::Rules::IMetric *": + r""" + add_integer_metric(IAction self, char const * value_name, NV::Rules::IMetric::ValueKind value_kind, uint64_t value) -> IMetric + + Parameters + ---------- + value_name: char const * + value_kind: enum NV::Rules::IMetric::ValueKind + value: uint64_t + + """ + return _ncu_report.IAction_add_integer_metric(self, value_name, value_kind, value) + + def add_double_metric(self, value_name: "char const *", value_kind: "NV::Rules::IMetric::ValueKind", value: "double") -> "NV::Rules::IMetric *": + r""" + add_double_metric(IAction self, char const * value_name, NV::Rules::IMetric::ValueKind value_kind, double value) -> IMetric + + Parameters + ---------- + value_name: char const * + value_kind: enum NV::Rules::IMetric::ValueKind + value: double + + """ + return _ncu_report.IAction_add_double_metric(self, value_name, value_kind, value) + + def add_string_metric(self, value_name: "char const *", value_kind: "NV::Rules::IMetric::ValueKind", value: "char const *") -> "NV::Rules::IMetric *": + r""" + add_string_metric(IAction self, char const * value_name, NV::Rules::IMetric::ValueKind value_kind, char const * value) -> IMetric + + Parameters + ---------- + value_name: char const * + value_kind: enum NV::Rules::IMetric::ValueKind + value: char const * + + """ + return _ncu_report.IAction_add_string_metric(self, value_name, value_kind, value) + + def add_metric(self, value_name: "char const *") -> "NV::Rules::IMutableMetric *": + r""" + add_metric(IAction self, char const * value_name) -> NV::Rules::IMutableMetric * + + Parameters + ---------- + value_name: char const * + + """ + return _ncu_report.IAction_add_metric(self, value_name) + + def source_info(self, address: "uint64_t") -> "NV::Rules::ISourceInfo *": + r""" + source_info(IAction self, uint64_t address) -> ISourceInfo + + Parameters + ---------- + address: uint64_t + + """ + return _ncu_report.IAction_source_info(self, address) + + def source_files(self) -> "std::map< std::string,std::string,std::less< std::string >,std::allocator< std::pair< std::string const,std::string > > >": + r"""source_files(IAction self) -> map_string_string""" + return _ncu_report.IAction_source_files(self) + + def sass_by_pc(self, address: "uint64_t") -> "std::string": + r""" + sass_by_pc(IAction self, uint64_t address) -> std::string + + Parameters + ---------- + address: uint64_t + + """ + return _ncu_report.IAction_sass_by_pc(self, address) + + def nvtx_state(self) -> "NV::Rules::INvtxState *": + r"""nvtx_state(IAction self) -> INvtxState""" + return _ncu_report.IAction_nvtx_state(self) + + def ptx_by_pc(self, address: "uint64_t") -> "std::string": + r""" + ptx_by_pc(IAction self, uint64_t address) -> std::string + + Parameters + ---------- + address: uint64_t + + """ + return _ncu_report.IAction_ptx_by_pc(self, address) + +# Register IAction in _ncu_report: +_ncu_report.IAction_swigregister(IAction) + +class IRange(object): + r"""Proxy of C++ NV::Rules::IRange class.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + __swig_destroy__ = _ncu_report.delete_IRange + + def num_actions(self) -> "size_t": + r"""num_actions(IRange self) -> size_t""" + return _ncu_report.IRange_num_actions(self) + + def action_by_idx(self, idx: "size_t") -> "NV::Rules::IAction *": + r""" + action_by_idx(IRange self, size_t idx) -> IAction + + Parameters + ---------- + idx: size_t + + """ + return _ncu_report.IRange_action_by_idx(self, idx) + + def actions_by_nvtx(self, includes: "vector_string", excludes: "vector_string") -> "std::set< unsigned long long,std::less< unsigned long long >,std::allocator< unsigned long long > >": + r""" + actions_by_nvtx(IRange self, vector_string includes, vector_string excludes) -> set_ull + + Parameters + ---------- + includes: std::vector< std::string,std::allocator< std::string > > const & + excludes: std::vector< std::string,std::allocator< std::string > > const & + + """ + return _ncu_report.IRange_actions_by_nvtx(self, includes, excludes) + +# Register IRange in _ncu_report: +_ncu_report.IRange_swigregister(IRange) + +class IFrontend(object): + r"""Proxy of C++ NV::Rules::IFrontend class.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + MsgType_MSG_NONE = _ncu_report.IFrontend_MsgType_MSG_NONE + + MsgType_MSG_OK = _ncu_report.IFrontend_MsgType_MSG_OK + + MsgType_MSG_OPTIMIZATION = _ncu_report.IFrontend_MsgType_MSG_OPTIMIZATION + + MsgType_MSG_WARNING = _ncu_report.IFrontend_MsgType_MSG_WARNING + + MsgType_MSG_ERROR = _ncu_report.IFrontend_MsgType_MSG_ERROR + + MarkerKind_SASS = _ncu_report.IFrontend_MarkerKind_SASS + + MarkerKind_SOURCE = _ncu_report.IFrontend_MarkerKind_SOURCE + + Severity_SEVERITY_DEFAULT = _ncu_report.IFrontend_Severity_SEVERITY_DEFAULT + + Severity_SEVERITY_LOW = _ncu_report.IFrontend_Severity_SEVERITY_LOW + + Severity_SEVERITY_HIGH = _ncu_report.IFrontend_Severity_SEVERITY_HIGH + + SpeedupType_LOCAL = _ncu_report.IFrontend_SpeedupType_LOCAL + + SpeedupType_GLOBAL = _ncu_report.IFrontend_SpeedupType_GLOBAL + + __swig_destroy__ = _ncu_report.delete_IFrontend + + def message(self, *args) -> "int": + r""" + message(IFrontend self, char const * str, char const * name=None) -> int + + Parameters + ---------- + str: char const * + name: char const * + + message(IFrontend self, NV::Rules::IFrontend::MsgType type, char const * str, char const * name=None) -> int + + Parameters + ---------- + type: enum NV::Rules::IFrontend::MsgType + str: char const * + name: char const * + + """ + return _ncu_report.IFrontend_message(self, *args) + + def send_dict_to_children(self, dict: "NV::Rules::IFrontend::Dict const &") -> "void": + r""" + send_dict_to_children(IFrontend self, NV::Rules::IFrontend::Dict const & dict) + + Parameters + ---------- + dict: NV::Rules::IFrontend::Dict const & + + """ + return _ncu_report.IFrontend_send_dict_to_children(self, dict) + + def receive_dict_from_parent(self, parent_id: "NV::Rules::IFrontend::RuleId const &") -> "NV::Rules::IFrontend::Dict": + r""" + receive_dict_from_parent(IFrontend self, NV::Rules::IFrontend::RuleId const & parent_id) -> NV::Rules::IFrontend::Dict + + Parameters + ---------- + parent_id: NV::Rules::IFrontend::RuleId const & + + """ + return _ncu_report.IFrontend_receive_dict_from_parent(self, parent_id) + + def speedup(self, message_id: "int", type: "NV::Rules::IFrontend::SpeedupType", estimated_speedup: "double") -> "bool": + r""" + speedup(IFrontend self, int message_id, NV::Rules::IFrontend::SpeedupType type, double estimated_speedup) -> bool + + Parameters + ---------- + message_id: int + type: enum NV::Rules::IFrontend::SpeedupType + estimated_speedup: double + + """ + return _ncu_report.IFrontend_speedup(self, message_id, type, estimated_speedup) + + def focus_metric(self, message_id: "int", metric_name: "char const *", metric_value: "double", severity: "NV::Rules::IFrontend::Severity", info: "char const *") -> "bool": + r""" + focus_metric(IFrontend self, int message_id, char const * metric_name, double metric_value, NV::Rules::IFrontend::Severity severity, char const * info) -> bool + + Parameters + ---------- + message_id: int + metric_name: char const * + metric_value: double + severity: enum NV::Rules::IFrontend::Severity + info: char const * + + """ + return _ncu_report.IFrontend_focus_metric(self, message_id, metric_name, metric_value, severity, info) + + def source_marker(self, *args) -> "void": + r""" + source_marker(IFrontend self, char const * str, uint64_t address_or_line, NV::Rules::IFrontend::MarkerKind kind, NV::Rules::IFrontend::MsgType type=MSG_NONE) + + Parameters + ---------- + str: char const * + address_or_line: uint64_t + kind: enum NV::Rules::IFrontend::MarkerKind + type: enum NV::Rules::IFrontend::MsgType + + source_marker(IFrontend self, char const * str, uint64_t address_or_line, NV::Rules::IFrontend::MarkerKind kind, char const * file_name, NV::Rules::IFrontend::MsgType type=MSG_NONE) + + Parameters + ---------- + str: char const * + address_or_line: uint64_t + kind: enum NV::Rules::IFrontend::MarkerKind + file_name: char const * + type: enum NV::Rules::IFrontend::MsgType + + """ + return _ncu_report.IFrontend_source_marker(self, *args) + + def load_chart_from_file(self, filename: "char const *") -> "void": + r""" + load_chart_from_file(IFrontend self, char const * filename) + + Parameters + ---------- + filename: char const * + + """ + return _ncu_report.IFrontend_load_chart_from_file(self, filename) + + def __init__(self): + r""" + __init__(IFrontend self) -> IFrontend + + Parameters + ---------- + self: PyObject * + + """ + if self.__class__ == IFrontend: + _self = None + else: + _self = self + _ncu_report.IFrontend_swiginit(self, _ncu_report.new_IFrontend(_self, )) + def __disown__(self): + self.this.disown() + _ncu_report.disown_IFrontend(self) + return weakref.proxy(self) + +# Register IFrontend in _ncu_report: +_ncu_report.IFrontend_swigregister(IFrontend) + +class IBaseContext(object): + r"""Proxy of C++ NV::Rules::IBaseContext class.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + __swig_destroy__ = _ncu_report.delete_IBaseContext + + def handle_exception(self, msg: "char const *") -> "bool": + r""" + handle_exception(IBaseContext self, char const * msg) -> bool + + Parameters + ---------- + msg: char const * + + """ + return _ncu_report.IBaseContext_handle_exception(self, msg) + + def get_version(self) -> "std::string": + r"""get_version(IBaseContext self) -> std::string""" + return _ncu_report.IBaseContext_get_version(self) + +# Register IBaseContext in _ncu_report: +_ncu_report.IBaseContext_swigregister(IBaseContext) + +class IMessageVault(object): + r"""Proxy of C++ NV::Rules::IMessageVault class.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _ncu_report.delete_IMessageVault + + def Put(self, ruleId: "NV::Rules::IMessageVault::RuleId const &", message: "NV::Rules::IMessageVault::Dict const &") -> "void": + r""" + Put(IMessageVault self, NV::Rules::IMessageVault::RuleId const & ruleId, NV::Rules::IMessageVault::Dict const & message) + + Parameters + ---------- + ruleId: NV::Rules::IMessageVault::RuleId const & + message: NV::Rules::IMessageVault::Dict const & + + """ + return _ncu_report.IMessageVault_Put(self, ruleId, message) + + def Get(self, ruleId: "NV::Rules::IMessageVault::RuleId const &") -> "NV::Rules::IMessageVault::Dict": + r""" + Get(IMessageVault self, NV::Rules::IMessageVault::RuleId const & ruleId) -> NV::Rules::IMessageVault::Dict + + Parameters + ---------- + ruleId: NV::Rules::IMessageVault::RuleId const & + + """ + return _ncu_report.IMessageVault_Get(self, ruleId) + + def __init__(self): + r""" + __init__(IMessageVault self) -> IMessageVault + + Parameters + ---------- + self: PyObject * + + """ + if self.__class__ == IMessageVault: + _self = None + else: + _self = self + _ncu_report.IMessageVault_swiginit(self, _ncu_report.new_IMessageVault(_self, )) + def __disown__(self): + self.this.disown() + _ncu_report.disown_IMessageVault(self) + return weakref.proxy(self) + +# Register IMessageVault in _ncu_report: +_ncu_report.IMessageVault_swigregister(IMessageVault) + +class IController(object): + r"""Proxy of C++ NV::Rules::IController class.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _ncu_report.delete_IController + + def propose_rule(self, rule: "char const *") -> "void": + r""" + propose_rule(IController self, char const * rule) + + Parameters + ---------- + rule: char const * + + """ + return _ncu_report.IController_propose_rule(self, rule) + + def get_message_vault(self) -> "std::shared_ptr< NV::Rules::IMessageVault >": + r"""get_message_vault(IController self) -> std::shared_ptr< NV::Rules::IMessageVault >""" + return _ncu_report.IController_get_message_vault(self) + + def __init__(self): + r""" + __init__(IController self) -> IController + + Parameters + ---------- + self: PyObject * + + """ + if self.__class__ == IController: + _self = None + else: + _self = self + _ncu_report.IController_swiginit(self, _ncu_report.new_IController(_self, )) + def __disown__(self): + self.this.disown() + _ncu_report.disown_IController(self) + return weakref.proxy(self) + +# Register IController in _ncu_report: +_ncu_report.IController_swigregister(IController) + +class IEvaluator(IBaseContext): + r"""Proxy of C++ NV::Rules::IEvaluator class.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _ncu_report.delete_IEvaluator + + def require_metric(self, metric: "char const *") -> "void": + r""" + require_metric(IEvaluator self, char const * metric) + + Parameters + ---------- + metric: char const * + + """ + return _ncu_report.IEvaluator_require_metric(self, metric) + + def require_rule(self, rule: "char const *") -> "void": + r""" + require_rule(IEvaluator self, char const * rule) + + Parameters + ---------- + rule: char const * + + """ + return _ncu_report.IEvaluator_require_rule(self, rule) + + def __init__(self): + r""" + __init__(IEvaluator self) -> IEvaluator + + Parameters + ---------- + self: PyObject * + + """ + if self.__class__ == IEvaluator: + _self = None + else: + _self = self + _ncu_report.IEvaluator_swiginit(self, _ncu_report.new_IEvaluator(_self, )) + def __disown__(self): + self.this.disown() + _ncu_report.disown_IEvaluator(self) + return weakref.proxy(self) + +# Register IEvaluator in _ncu_report: +_ncu_report.IEvaluator_swigregister(IEvaluator) + +class IContext(IBaseContext): + r"""Proxy of C++ NV::Rules::IContext class.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + __swig_destroy__ = _ncu_report.delete_IContext + + def controller(self) -> "NV::Rules::IController *": + r"""controller(IContext self) -> IController""" + return _ncu_report.IContext_controller(self) + + def frontend(self) -> "NV::Rules::IFrontend *": + r"""frontend(IContext self) -> IFrontend""" + return _ncu_report.IContext_frontend(self) + + def num_ranges(self) -> "size_t": + r"""num_ranges(IContext self) -> size_t""" + return _ncu_report.IContext_num_ranges(self) + + def range_by_idx(self, idx: "size_t") -> "NV::Rules::IRange *": + r""" + range_by_idx(IContext self, size_t idx) -> IRange + + Parameters + ---------- + idx: size_t + + """ + return _ncu_report.IContext_range_by_idx(self, idx) + +# Register IContext in _ncu_report: +_ncu_report.IContext_swigregister(IContext) + +import platform +from pathlib import Path + + +def __get_library_dir_and_load(load_func): + ncu_os_from_python = { + 'Linux': 'linux', + 'Windows': 'windows', + 'Darwin': 'osx', + } + + ncu_arch_from_python = { + 'x86_64': 'x64', + 'AMD64': 'x64', + 'aarch64': 'a64' + } + + def __get_library_dir(): +# assume the 'nvperf_host' library is located at +# '../../host//' (for OSX) or +# '../../target//' (or all other OSes) +# relative to the 'ncu_report' module + + library_path_not_found_error = FileNotFoundError( + "Could not deduce NVIDIA Nsight Compute library directory. " + "Is 'ncu_report.py' located in 'extras/python' relative " + "to your installation directory?" + ) + +# get the directory in which the imported module 'ncu_report' resides + module_dir = Path(__file__).parent + +# check that '../../' relative to module_dir exists + if len(module_dir.parents) < 2: + raise library_path_not_found_error + + os = ncu_os_from_python[platform.system()] + if os == 'osx': + host_or_target_dir = module_dir.parents[1].joinpath("host") + else: + host_or_target_dir = module_dir.parents[1].joinpath("target") + + if not host_or_target_dir.is_dir(): + raise library_path_not_found_error + +# Filter any directories starting with 'target' as NSYS places their target +# files for local activities in the host directory + var_dirs = [sub_dir for sub_dir in host_or_target_dir.iterdir() \ + if sub_dir.is_dir() and not sub_dir.stem.startswith("target")] + +# assume there is one and only one '/' directory for the current +# operating system and architecture + arch = ncu_arch_from_python[platform.machine()] + for var_dir in var_dirs: + var_name = var_dir.stem + if (os in var_name) and (arch in var_name): + library_dir = str(var_dir) + break + + if not library_dir: + raise FileNotFoundError("Could not find any build variant for your system.") + + return library_dir + + def __convert_Path_to_str(file_name): + if isinstance(file_name, Path): + file_name = str(file_name) + return file_name + + def __raise_if_file_does_not_exist(file_name): + if not Path(file_name).exists(): + raise FileNotFoundError( + "Could not load report file: {} does not exist.".format(file_name) + ) + + def load_report(file_name): + """Load an NVIDIA Nsight Compute report file into an IContext object. + + Args: + file_name (Union[str, pathlib.Path]): The relative or absolute path + to the `.ncu-rep` report file. + + Returns: + :obj:`IContext`: An IContext object representing the loaded report file. + + Raises: + FileNotFoundError: Either if `file_name` does not exist or if the + NVIDIA Nsight Compute library directory cannot be found. + + """ + file_name = __convert_Path_to_str(file_name) + __raise_if_file_does_not_exist(file_name) + library_dir = __get_library_dir() + return load_func(file_name=file_name, library_dir=library_dir) + + return load_report + + +load_report = __get_library_dir_and_load(load_report) + +def ncu_report_add_method(cls, name): + """This decorator allows us to add methods to already defined classes + easily. + + For example, to add a method called `foo` to a class `Bar` you could use the + following syntax: + + @ncu_report_add_method(Bar, 'foo') + def name_is_not_important(self, param): + do_something_with(self.baz, param) + + Note that the first parameter of the defined function will be treated like + the `self` parameter when defining methods directly in classes. + + Also, the `name_is_not_important` function will still be usable with the + first parameter being an object of the class you are adding the method to. + """ + def decorator(func): + setattr(cls, name, func) + return func + return decorator + +@ncu_report_add_method(IContext, "__len__") +def IContext__len(ictx): + """Get the number of IRange objects of this IContext. + + Returns: + int: The number of IRange objects. + + """ + return ictx.num_ranges() + + +@ncu_report_add_method(IContext, "__getitem__") +def IContext__getitem(ictx, key): + """Get one or more IRange objects by index or by slice. + + Args: + key (int, slice): The index or slice to retrieve. + + Returns: + An IRange object or a slice of IRange objects. + + Raises: + TypeError: If `key` is not of type :obj:`int` or :obj:`slice`. + IndexError: If `key` is out of range for the IContext. + + """ + _len = len(ictx) + if isinstance(key, int): + if key < -_len or key >= _len: + raise IndexError("IContext index out of range") + if key < 0: + key += _len + return ictx.range_by_idx(key) + if isinstance(key, slice): + return tuple(ictx[i] for i in range(*key.indices(_len))) + raise TypeError( + "IContext indices must be integers or slices, not {}".format( + type(key).__name__ + ) + ) + + +@ncu_report_add_method(IContext, "__iter__") +def IContext__iter(ictx): + """Get an iterator over the IRange objects of this IContext. + + Returns: + iterator: An iterator over the IRange objects. + + """ + return (ictx[i] for i in range(len(ictx))) + +@ncu_report_add_method(IRange, "__len__") +def IRange__len(irange): + """Get the number of IAction objects of this IRange. + + Returns: + int: The number of IAction objects. + + """ + return irange.num_actions() + + +@ncu_report_add_method(IRange, "__getitem__") +def IRange__getitem(irange, key): + """Get one or more IAction objects by index or by slice. + + Args: + key (int, slice): The index or slice to retrieve. + + Returns: + An IAction object or a slice of IAction objects. + + Raises: + TypeError: If `key` is not of type :obj:`int` or :obj:`slice`. + IndexError: If `key` is out of range for the IContext. + + """ + _len = len(irange) + if isinstance(key, int): + if key < -_len or key >= _len: + raise IndexError("IRange index out of range") + if key < 0: + key += _len + return irange.action_by_idx(key) + if isinstance(key, slice): + return tuple(irange[i] for i in range(*key.indices(_len))) + raise TypeError( + "IRange indices must be integers or slices, not {}".format( + type(key).__name__ + ) + ) + + +@ncu_report_add_method(IRange, "__iter__") +def IRange__iter(irange): + """Get an iterator over the IAction objects of this IRange. + + Returns: + iterator: An iterator over the IAction objects. + + """ + return (irange[i] for i in range(len(irange))) + +@ncu_report_add_method(IAction, "__str__") +def IAction__str(iaction): + """Get a human-readable representation of this IAction. + + Returns: + str: The name of the kernel the IAction object represents. + + """ + return iaction.name() + + +@ncu_report_add_method(IAction, "__len__") +def IAction__len(iaction): + """Get the number of IMetric objects of this IAction. + + Returns: + int: The number of IMetric objects. + + """ + return len(iaction.metric_names()) + + +@ncu_report_add_method(IAction, "__iter__") +def IAction__iter(iaction): + """Get an iterator over the metric names of this IAction. + + Returns: + iterator: An iterator over the metric names. + + """ + return iter(iaction.metric_names()) + + +@ncu_report_add_method(IAction, "__getitem__") +def IAction__getitem(iaction, key): + """Get an IMetric object contained in this IAction by its name. + + Args: + key (str): The name of the IMetric object to retrieve. + + Returns: + :obj:`IMetric`: An IMetric object. + + Raises: + TypeError: If `key` is not of type :obj:`str`. + KeyError: If `key` is not the name of any IMetric object. + + """ + if not isinstance(key, str): + raise TypeError( + "IAction metric keys must be strings, not {}".format(type(key).__name__) + ) + + metric = iaction.metric_by_name(key) + + if metric is None: + raise KeyError("no metric named '{}'".format(key)) + + return metric + +IMetric_kind_to_value_func = { + IMetric.ValueKind_ANY: lambda *args: None, + IMetric.ValueKind_DOUBLE: IMetric.as_double, + IMetric.ValueKind_FLOAT: IMetric.as_double, + IMetric.ValueKind_STRING: IMetric.as_string, + IMetric.ValueKind_UINT32: IMetric.as_uint64, + IMetric.ValueKind_UINT64: IMetric.as_uint64, + IMetric.ValueKind_UNKNOWN: lambda *args: None, +} + + +@ncu_report_add_method(IMetric, "__str__") +def IMetric__str(imetric): + """Get a human-readable representation of this IMetric. + + Returns: + str: The name of the IMetric. + + """ + return imetric.name() + + +@ncu_report_add_method(IMetric, "value") +def IMetric__value(imetric, idx=None): + """Get the value of this IMetric. + + Args: + idx (:obj:`int`, optional): The index of the correlation ids. Defaults to None. + + Returns: + The value of this IMetric as str, int or float. + + """ + args = tuple() if idx is None else (idx,) + return IMetric_kind_to_value_func[imetric.kind(*args)](imetric, *args) + + +def IMetric__metric_subtype_using_None(member_func): + def IMetric__metric_subtype(imetric): + """Get the subtype of this IMetric. + + Returns: + int: The subtype of this IMetric, if applicable, None otherwise. + + """ + subtype = member_func(imetric) + if subtype == imetric.MetricSubtype_NONE: + return None + else: + return subtype + return IMetric__metric_subtype + +wrapped_metric_subtype = IMetric__metric_subtype_using_None(IMetric.metric_subtype) +setattr(IMetric, "metric_subtype", wrapped_metric_subtype) + + +def IMetric__rollup_operation_using_None(member_func): + def IMetric__rollup_operation(imetric): + """Get the rollup operation of this IMetric. + + Returns: + int, None: The rollup operation of this IMetric, if applicable, + None otherwise. + + """ + rollup_op = member_func(imetric) + if rollup_op == imetric.RollupOperation_NONE: + return None + else: + return rollup_op + return IMetric__rollup_operation + +wrapped_rollup_operation = IMetric__rollup_operation_using_None(IMetric.rollup_operation) +setattr(IMetric, "rollup_operation", wrapped_rollup_operation) + +@ncu_report_add_method(INvtxState, "__len__") +def INvtxState__len(invtx_state): + """Get the number of INvtxDomainInfo objects of this INvtxState. + + Returns: + int: The number of INvtxDomainInfo objects. + + """ + return len(invtx_state.domains()) + + +@ncu_report_add_method(INvtxState, "__iter__") +def INvtxState__iter(invtx_state): + """Get an iterator over the INvtxDomainInfo objects of this INvtxState. + + Returns: + iterator: An iterator over the INvtxDomainInfo objects. + + """ + return iter(invtx_state.domains()) + + +@ncu_report_add_method(INvtxState, "__getitem__") +def INvtxState__getitem(invtx_state, key): + """Get an INvtxDomainInfo object by ID. + + Args: + key (int): The ID of the INvtxDomainInfo object. + + Returns: + :obj:`INvtxDomainInfo`: An INvtxDomainInfo object. + + Raises: + TypeError: If `key` is not of type :obj:`int`. + KeyError: If `key` is not a valid ID. + + """ + if isinstance(key, int): + if key not in invtx_state.domains(): + raise KeyError("INvtxState invalid ID") + return invtx_state.domain_by_id(key) + raise TypeError( + "INvtxState IDs must be integers, not {}".format( + type(key).__name__ + ) + ) + +@ncu_report_add_method(INvtxDomainInfo, "__str__") +def INvtxDomainInfo__str(invtx_domain): + """Get a human-readable representation of this INvtxDomainInfo. + + Returns: + str: The name of the INvtxDomainInfo. + + """ + return invtx_domain.name() + + + diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/samples/instructionMix/README.TXT b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/samples/instructionMix/README.TXT new file mode 100644 index 0000000000000000000000000000000000000000..cbe5a3b7ac47e90489a98b163eb00969069aa471 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/samples/instructionMix/README.TXT @@ -0,0 +1,47 @@ +== Sample CUDA application for instruction mix == +Applies a Sobel filter to a image in global memory +and generates an output image in global memory. + +Compiling the code: +================== +nvcc -lineinfo -gencode arch=compute_70,code=sm_70 -gencode arch=compute_72,code=sm_72 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_87,code=sm_87 -gencode arch=compute_89,code=sm_89 instructionMix.cu -o instructionMix + +Command line arguments (all are optional): +========================================== +1) Version of Sobel filter kernel to use + 1 : double version of kernel + 2 : float version of kernel + Default value: 1 +2) Image width should be greater than or equal to block size (BLOCK_SIZE - defined in source file "instructionMix.cu") + and must be an integral multiple of block size. + Default value: DEFAULT_IMAGE_SIZE (defined in source file "instructionMix.cu") + +3) Image height should be greater than or equal to block size (BLOCK_SIZE - defined in source file "instructionMix.cu") + and must be an integral multiple of block size. + Default value: Equal to image width + +Sample usage: +============ +- Use double precision floating point version of Sobel filter kernel with default image size + > ./instructionMix + +- Use single precision floating point version of Sobel filter kernel with default image size + > ./instructionMix 2 + +- Use double precision floating point version of Sobel filter kernel with image size 1024 x 1024 + > ./instructionMix 1 1024 + +- Use double precision floating point version of Sobel filter kernel with image size 1024 x 256 + > ./instructionMix 1 1024 256 + + +Profiling the sample using Nsight Compute command line +====================================================== +- Profile the double precision floating point version of Sobel filter kernel + > ncu --set full --import-source on -o sobelDouble.ncu-rep ./instructionMix 1 + +- Profile the single precision floating point version of Sobel filter kernel + > ncu --set full --import-source on -o sobelFloat.ncu-rep ./instructionMix 2 + +The profiler report files for the sample are also provided and they can be opened in the +Nsight Compute UI using the "File->Open" menu option. diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/samples/instructionMix/instructionMix.cu b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/samples/instructionMix/instructionMix.cu new file mode 100644 index 0000000000000000000000000000000000000000..2fa8e19c0c2f89a1f55dfbc7e2a9e68706a5db0c --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/samples/instructionMix/instructionMix.cu @@ -0,0 +1,211 @@ +/* + * Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* Sample CUDA application to analyze instruction mix in a CUDA kernel. + * Applies a Sobel filter to a image in global memory + * and generates an output image in global memory. + * + */ +#include +#include +#include + +#define DEFAULT_IMAGE_SIZE 512 +#define BLOCK_SIZE 16 +enum { + SOBEL_DOUBLE = 1, + SOBEL_FLOAT = 2 + }; + +#define RUNTIME_API_CALL(apiFuncCall) \ + do \ + { \ + cudaError_t _status = apiFuncCall; \ + if (_status != cudaSuccess) \ + { \ + fprintf(stderr, "%s:%d: error: function %s failed with error %s.\n", __FILE__, \ + __LINE__, #apiFuncCall, cudaGetErrorString(_status)); \ + exit(EXIT_FAILURE); \ + } \ + } while (0) + +#define PRINT_PROGRAM_USAGE() \ + fprintf(stderr, "Usage: %s [kernel option] [] []\n" \ + " Default kernel option: 1\n" \ + " Use 1 for double version of Sobel kernel\n" \ + " Use 2 for float version of Sobel kernel\n" \ + " Default image width: %d\n" \ + " Default image height: equal to image width\n" \ + " Image width and height should be greater than or equal to block size: %d and" \ + " must be an integral multiple of block size.\n", \ + argv[0], DEFAULT_IMAGE_SIZE, BLOCK_SIZE) + + +__device__ unsigned char GetPixel( + uchar4* pImg, + int x, + int y, + int imgWidth, + int imgHeight) +{ + if (x >= 0 && y >= 0 && x < imgWidth && y < imgHeight) + { + return pImg[y * imgWidth + x].x; + } + + return 0; +} + +// sobel edge detection kernel +template +__global__ void Sobel( + uchar4* pOut, + uchar4* pImg, + const int imgWidth, + const int imgHeight) +{ + const int tx = blockIdx.x * blockDim.x + threadIdx.x; + const int ty = blockIdx.y * blockDim.y + threadIdx.y; + const int outIdx = ty * imgWidth + tx; + + const int SX[] = {1, 2, 1, 0, 0, 0, -1, -2, -1}; + const int SY[] = {1, 0, -1, 2, 0, -2, 1, 0, -1}; + + FLOAT_T sumX = 0.; + FLOAT_T sumY = 0.; + for (int j = -1; j <= 1; ++j) + { + for (int i = -1; i <= 1; ++i) + { + const auto idx = (j + 1) * 3 + (i + 1); + const auto sx = SX[idx]; + const auto sy = SY[idx]; + + const auto luminance = GetPixel(pImg, tx + i, ty + j, imgWidth, imgHeight); + sumX += (FLOAT_T)luminance * (FLOAT_T)sx; + sumY += (FLOAT_T)luminance * (FLOAT_T)sy; + } + } + + sumX /= (FLOAT_T)9.; + sumY /= (FLOAT_T)9.; + + const FLOAT_T threshold = 24.; + if (sumX > threshold || sumY > threshold) + { + pOut[outIdx] = make_uchar4(0, 255, 255, 0); + } +} + +void initImage(uchar4 *pImg, int imgWidth, int imgHeight) +{ + for(int i =0; i < imgWidth*imgHeight; i++) + { + *pImg++ = make_uchar4(i%256, i%256, i%256, 255); + } +} + +int main(int argc, char** argv) +{ + int imgWidth = DEFAULT_IMAGE_SIZE; + int imgHeight; + uchar4 *pInputImage, *pSrcImage, *pDstImage; + int kernelOption = SOBEL_DOUBLE; + + if (argc > 1) + { + kernelOption = atoi(argv[1]); + if ((kernelOption != SOBEL_DOUBLE) && (kernelOption != SOBEL_FLOAT)) + { + fprintf(stderr, "** Invalid kernel option: %s\n", argv[1]); + PRINT_PROGRAM_USAGE(); + exit(EXIT_FAILURE); + } + } + + if (argc > 2) + { + imgWidth = atoi(argv[2]); + if ((imgWidth <= 0) || (imgWidth%BLOCK_SIZE != 0)) + { + fprintf(stderr, "** Invalid image width: %s\n", argv[2]); + PRINT_PROGRAM_USAGE(); + exit(EXIT_FAILURE); + } + } + + imgHeight = imgWidth; + if (argc > 3) + { + imgHeight = atoi(argv[3]); + if ((imgHeight <= 0) || (imgHeight%BLOCK_SIZE != 0)) + { + fprintf(stderr, "** Invalid image height: %s\n", argv[3]); + PRINT_PROGRAM_USAGE(); + exit(EXIT_FAILURE); + } + } + + unsigned imgSize = sizeof(uchar4) * imgWidth * imgHeight; + + printf("Image width: %d, height: %d\n", imgWidth, imgHeight); + + pInputImage = (uchar4 *)malloc(imgSize); + RUNTIME_API_CALL(cudaMalloc((void**)&pSrcImage, imgSize)); + RUNTIME_API_CALL(cudaMalloc((void**)&pDstImage, imgSize)); + + initImage(pInputImage, imgWidth, imgHeight); + RUNTIME_API_CALL(cudaMemcpy(pSrcImage, pInputImage, imgSize, cudaMemcpyHostToDevice)); + + dim3 block(BLOCK_SIZE, BLOCK_SIZE, 1); + dim3 grid(imgWidth / block.x, imgHeight / block.y, 1); + + printf("Block size: %d x %d\n", block.x, block.y); + printf("Grid size: %d x %d\n", grid.x, grid.y); + + if (kernelOption == SOBEL_DOUBLE) + { + printf("Use double version of Sobel kernel\n"); + Sobel<<>>( pDstImage, pSrcImage, imgWidth, imgHeight); + } + else if (kernelOption == SOBEL_FLOAT) + { + printf("Use float version of Sobel kernel\n"); + Sobel<<>>( pDstImage, pSrcImage, imgWidth, imgHeight); + } + + RUNTIME_API_CALL(cudaMemcpy(pInputImage, pDstImage, imgSize, cudaMemcpyDeviceToHost)); + + // Cleanup + free(pInputImage); + RUNTIME_API_CALL(cudaFree(pSrcImage)); + RUNTIME_API_CALL(cudaFree(pDstImage)); + + printf("Done\n"); + return 0; +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/samples/interKernelCommunication/README.TXT b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/samples/interKernelCommunication/README.TXT new file mode 100644 index 0000000000000000000000000000000000000000..6a63990ffb9af5aa16200252d68448db69edc540 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/samples/interKernelCommunication/README.TXT @@ -0,0 +1,57 @@ +== Sample CUDA application for inter kernel communication == +This sample implements the following producer-consumer algorithm : +Producer : Produces grayscale pixels from RGB pixels into the buffer +Consumer : Consumes grayscale pixels from the buffer and scales them up by 2 +To simplify this illustration, it's assumed that the buffer can only have one pixel at a time. +Since the producer will not proceed further until the consumer has read the previously produced pixel +and the consumer will wait for the producer to produce at least one grayscale pixel, +both producer and consumer kernels will depend on each other and must be launched concurrently. +NOTE: This pattern is often encountered with NCCL and NVSHMEM kernels. +Understanding how to profile this sample can help resolve potential profiling issues with such kernels. +Compiling the code: +================== +nvcc -lineinfo -gencode arch=compute_70,code=sm_70 -gencode arch=compute_72,code=sm_72 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_87,code=sm_87 -gencode arch=compute_89,code=sm_89 -gencode arch=compute_90,code=sm_90 interKernelCommunication.cu -o interKernelCommunication +Command line arguments (all are optional): +========================================== +1) Specify the API to define range around the concurrent kernel launches + 1 : Run without range + 2 : Run with CUDA Profiler range + 3 : Run with NVTX range + Default value: 1 +2) Specify the number of RGB pixels to convert. It should be greater than or equal to block size (BLOCK_SIZE - defined in source file "interKernelCommunication.cu") + and must be an integral multiple of block size. + Default value: 1024 +3) Specify the maximum size of buffer queues used to process the pixels. It should be greater than zero. + Default value: 4 +Profiling the sample using Nsight Compute command line +====================================================== +- Profile the concurrent kernel launches with no defined range + > ncu ./interKernelCommunication 1 + Expected result: This will hang because the kernel launches are serialized and cannot run concurrently +- Profile the concurrent kernel launches with no defined range in range replay-mode + > ncu --replay-mode range ./interKernelCommunication 1 + Expected result: This will not hang but profiling result will not be generated because no ranges are + defined for range-profiling mode +- Profile the concurrent kernel launches with CUDA Profiler Start/Stop range in range replay-mode + > ncu --replay-mode range ./interKernelCommunication 2 + Expected result: This will not hang and profiling result will be generated for the defined range +- Profile the concurrent kernel launches with NVTX range named "nvtx-range" in range replay-mode + > ncu --replay-mode range --nvtx --nvtx-include "concurrent-kernel-range/" ./interKernelCommunication 3 + Expected result: This will not hang and profiling result will be generated for the defined nvtx-range +- Profile the concurrent kernel launches with NVTX range named "nvtx-range" in app-range replay-mode + > ncu --replay-mode app-range --nvtx --nvtx-include "concurrent-kernel-range/" ./interKernelCommunication 3 + Expected result: This will not hang and profiling result will be generated for the defined nvtx-range + This will profile the range without API capture by relaunching the entire application multiple times. + In each application run, a subset of the metrics is collected per defined range and the profiling data + is combined after all repetitions. Since the application handles all states implicitly in this mode, + no memory must be saved or restored by the tool, and there are no restrictions on which APIs can be + called within the range by the application. Note though that ranges must match between the runs so that + the tool can combine the data from the respective passes correctly. The "--replay-mode app-range" + must be used if there exists API calls in the range that aren't supported in normal range replay mode. + It must also be used if there are CPU/GPU interactions that are not done via memcpy/memset APIs but + which occur during a kernel's execution, and the execution relies on it. +See https://docs.nvidia.com/nsight-compute/ProfilingGuide/index.html#application-range-replay for more details. +Note that the set of available metrics for the "range" workload type is a subset of those available +for the "kernel" workload type. +Refer to this section in the Nsight Compute Kernel Profiling Guide +https://docs.nvidia.com/nsight-compute/ProfilingGuide/index.html#metrics-compatibility \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/samples/interKernelCommunication/interKernelCommunication.cu b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/samples/interKernelCommunication/interKernelCommunication.cu new file mode 100644 index 0000000000000000000000000000000000000000..e40a811449db15d44f690ebdf942df70679e812b --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/samples/interKernelCommunication/interKernelCommunication.cu @@ -0,0 +1,314 @@ +/* + * Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* Sample CUDA application to analyze profiling behavior of mandatory concurrent CUDA kernels. + * This sample implements the following producer-consumer algorithm : + * + * Producer : Produces grayscale pixels from RGB pixels into the buffer + * Consumer : Consumes grayscale pixels from the buffer and scales them up by 2 + * + * To simplify this illustration, it's assumed that the buffer can only have one pixel at a time. + * Since the producer will not proceed further until the consumer does not read the previously produced pixel + * and the consumer will wait for the producer to produce at least one grayscale pixel, + * both producer and consumer kernels will depend on each other and must be launched concurrently. + * + * NOTE: This pattern can be often encountered for NCCL and NVSHMEM kernels and + * understanding how to profile this sample would make it easy for one to resolve potential profiling issues with such kernels. + */ + +#include +#include +#include + +#include +#include +#include +#include + +#define DEFAULT_PIXELS_COUNT 1024 +#define BLOCK_SIZE 64 +#define MAX_BUFFER_SIZE 4 +#define QUEUE_EMPTY -1 +#define NUM_RGB_CHANNELS 3 +#define SCALE_FACTOR 2 +#define MAX_PIXEL 255 + +enum { + NO_RANGE = 1, + CUDA_PROFILER_RANGE = 2, + NVTX_RANGE = 3 + }; + +#define RUNTIME_API_CALL(apiFuncCall) \ + do \ + { \ + cudaError_t _status = apiFuncCall; \ + if (_status != cudaSuccess) \ + { \ + fprintf(stderr, "%s:%d: error: function %s failed with error %s.\n", __FILE__, \ + __LINE__, #apiFuncCall, cudaGetErrorString(_status)); \ + exit(EXIT_FAILURE); \ + } \ + } while (0) + +#define PRINT_PROGRAM_USAGE() \ + fprintf(stderr, "Usage: %s [] [] []\n" \ + " Default range option: 1\n" \ + " Use 1 to run without range\n" \ + " Use 2 to run with CUDA Profiler range\n" \ + " Use 3 to run with NVTX range\n" \ + " Default pixels count: %d\n" \ + " Pixels count should be greater than or equal to block size: %d and" \ + " must be an integral multiple of block size.\n" \ + " Default max buffer size: %d\n" \ + " Max buffer size should be greater than zero.\n", \ + argv[0], DEFAULT_PIXELS_COUNT, BLOCK_SIZE, MAX_BUFFER_SIZE) \ + + +#define START_RANGE(X) \ + printf("Range option: "); \ + switch (X) \ + { \ + case NO_RANGE: \ + { \ + printf("NO_RANGE\n"); \ + break; \ + } \ + case CUDA_PROFILER_RANGE: \ + { \ + printf("CUDA_PROFILER_RANGE\n"); \ + cudaProfilerStart(); \ + break; \ + } \ + case NVTX_RANGE: \ + { \ + printf("NVTX_RANGE\n"); \ + nvtxRangePushA("concurrent-kernel-range"); \ + break; \ + } \ + } \ + +#define END_RANGE(X) \ + switch (X) \ + { \ + case NO_RANGE : break; \ + case CUDA_PROFILER_RANGE : cudaProfilerStop(); break; \ + case NVTX_RANGE : nvtxRangePop(); break; \ + } \ + +__global__ void +Producer(int* inputPixels, volatile int* pixelsQueue, int inputSize) +{ + if (!inputPixels || !pixelsQueue || !inputSize) return; + + int idx = blockIdx.x * blockDim.x + threadIdx.x; + int stride = gridDim.x * blockDim.x * NUM_RGB_CHANNELS; + + int i = idx * NUM_RGB_CHANNELS; + while (inputSize) + { + while (pixelsQueue[idx] != QUEUE_EMPTY) + { + // wait if buffer queue is not empty + } + + // produce one grayscale pixel + pixelsQueue[idx] = (inputPixels[i] + inputPixels[i + 1] + inputPixels[i + 2]) / NUM_RGB_CHANNELS; + __threadfence(); + + i += stride; + --inputSize; + } +} + +__global__ void +Consumer(int* outputPixels, volatile int* pixelsQueue, int outputSize) +{ + if (!outputPixels || !pixelsQueue || !outputSize) return; + + int idx = blockIdx.x * blockDim.x + threadIdx.x; + int stride = gridDim.x * blockDim.x; + + int i = idx; + while (outputSize) + { + while (pixelsQueue[idx] == QUEUE_EMPTY) + { + // wait if buffer queue is empty + } + + int scaledPixel = pixelsQueue[idx] * SCALE_FACTOR; + pixelsQueue[idx] = QUEUE_EMPTY; + __threadfence(); + + scaledPixel = scaledPixel > MAX_PIXEL ? MAX_PIXEL : scaledPixel; + outputPixels[i] = scaledPixel; + + i += stride; + --outputSize; + } +} + +void ExecuteProgram(int rangeOption, int pixelsCount, int maxBufferSize) +{ + cudaStream_t streamA, streamB; + RUNTIME_API_CALL(cudaStreamCreate(&streamA)); + RUNTIME_API_CALL(cudaStreamCreate(&streamB)); + + int blockSize = BLOCK_SIZE; + int numPixelsPerBlock = pixelsCount / blockSize; + int bufferSize = std::min(numPixelsPerBlock, maxBufferSize); + while (numPixelsPerBlock % bufferSize != 0) + { + // numPixelsPerBlock should be a multiple of bufferSize + --bufferSize; + } + int gridSize = numPixelsPerBlock / bufferSize; + printf("Grid size: %d, Block size: %d, Buffer size: %d\n", gridSize, blockSize, bufferSize); + + int numPixelsQueue = gridSize * blockSize; // number of buffers needed + int* hInputPixels = (int*)malloc(pixelsCount * NUM_RGB_CHANNELS * sizeof(int)); // RGB input + int* hOutputPixels = (int*)malloc(pixelsCount * sizeof(int)); // Grayscale output + int* hPixelsQueue = (int*)malloc(numPixelsQueue * sizeof(int)); // Buffers + + // Init an arbitrary RGB pixels array + for (int i = 0, *p = hInputPixels; i < pixelsCount; ++i) + { + for (int j = 0; j < NUM_RGB_CHANNELS; ++j) + { + *p++ = (i * (j + 1)) % (MAX_PIXEL + 1); + } + } + + // Mark each pixel buffer as empty + for (int i = 0; i < numPixelsQueue ; ++i) + { + hPixelsQueue[i] = QUEUE_EMPTY; + } + + // warmup both kernels to ensure concurrency + Producer<<>>(nullptr, nullptr, 0); + Consumer<<>>(nullptr, nullptr, 0); + + RUNTIME_API_CALL(cudaStreamSynchronize(streamA)); + RUNTIME_API_CALL(cudaStreamSynchronize(streamB)); + + // Init device memory + int* dInputPixels = nullptr; + int* dOutputPixels = nullptr; + int* dPixelsQueue = nullptr; + + RUNTIME_API_CALL(cudaMalloc((void**)&dInputPixels, pixelsCount * NUM_RGB_CHANNELS * sizeof(int))); + RUNTIME_API_CALL(cudaMalloc((void**)&dOutputPixels, pixelsCount * sizeof(int))); + RUNTIME_API_CALL(cudaMalloc((void**)&dPixelsQueue, numPixelsQueue * sizeof(int))); + + RUNTIME_API_CALL(cudaMemcpy(dInputPixels, hInputPixels, pixelsCount * NUM_RGB_CHANNELS * sizeof(int), cudaMemcpyHostToDevice)); + RUNTIME_API_CALL(cudaMemcpy(dPixelsQueue, hPixelsQueue, numPixelsQueue * sizeof(int), cudaMemcpyHostToDevice)); + + // Start a range based on the user-specified option + START_RANGE(rangeOption); + + Producer<<>>(dInputPixels, dPixelsQueue, bufferSize); + Consumer<<>>(dOutputPixels, dPixelsQueue, bufferSize); + + // End the range + END_RANGE(rangeOption); + + RUNTIME_API_CALL(cudaStreamSynchronize(streamA)); + RUNTIME_API_CALL(cudaStreamSynchronize(streamB)); + RUNTIME_API_CALL(cudaMemcpy(hOutputPixels, dOutputPixels, pixelsCount * sizeof(int), cudaMemcpyDeviceToHost)); + + // Test output correctness on host side + for (int i = 0, *p = hInputPixels; i < pixelsCount; ++i) + { + int expectedPixel = 0; + for (int j = 0; j < NUM_RGB_CHANNELS; ++j) + { + expectedPixel += *p++; + } + expectedPixel /= NUM_RGB_CHANNELS; + expectedPixel *= SCALE_FACTOR; + expectedPixel = std::min(expectedPixel, MAX_PIXEL); + + assert(expectedPixel == hOutputPixels[i]); + } + + RUNTIME_API_CALL(cudaFree(dInputPixels)); + RUNTIME_API_CALL(cudaFree(dOutputPixels)); + RUNTIME_API_CALL(cudaFree(dPixelsQueue)); + free(hInputPixels); + free(hOutputPixels); + free(hPixelsQueue); + RUNTIME_API_CALL(cudaStreamDestroy(streamA)); + RUNTIME_API_CALL(cudaStreamDestroy(streamB)); +} + +int main(int argc, char** argv) +{ + int rangeOption = NO_RANGE; + int pixelsCount = DEFAULT_PIXELS_COUNT; + int maxBufferSize = MAX_BUFFER_SIZE; + + if (argc > 1) + { + rangeOption = atoi(argv[1]); + if ((rangeOption < NO_RANGE) || (rangeOption > NVTX_RANGE)) + { + fprintf(stderr, "** Invalid range option: %s\n", argv[1]); + PRINT_PROGRAM_USAGE(); + exit(EXIT_FAILURE); + } + } + + if (argc > 2) + { + pixelsCount = atoi(argv[2]); + if ((pixelsCount <= 0) || (pixelsCount % BLOCK_SIZE != 0)) + { + fprintf(stderr, "** Invalid pixels count: %s\n", argv[2]); + PRINT_PROGRAM_USAGE(); + exit(EXIT_FAILURE); + } + } + + if (argc > 3) + { + maxBufferSize = atoi(argv[3]); + if (maxBufferSize <= 0) + { + fprintf(stderr, "** Invalid max buffer size: %s\n", argv[3]); + PRINT_PROGRAM_USAGE(); + exit(EXIT_FAILURE); + } + } + + printf("Pixels count: %d, Max buffer size: %d\n", pixelsCount, maxBufferSize); + ExecuteProgram(rangeOption, pixelsCount, maxBufferSize); + + return 0; +} \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/samples/sharedBankConflicts/README.TXT b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/samples/sharedBankConflicts/README.TXT new file mode 100644 index 0000000000000000000000000000000000000000..9839b78defe02b1c848002246520fc07dc7632b2 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/samples/sharedBankConflicts/README.TXT @@ -0,0 +1,51 @@ +== Sample CUDA application for shared memory bank conflicts == +Transposes a N x N square matrix of float elements in +global memory and generates an output matrix in global memory. + +Defines two versions of CUDA kernel: +transposeCoalesced : Coalesced global memory transpose with shared memory bank conflicts +transposeNoBankConflicts : Coalesced global memory transpose with reduced shared memory bank conflicts + +Compiling the code: +================== + > nvcc -lineinfo -gencode arch=compute_70,code=sm_70 -gencode arch=compute_72,code=sm_72 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_87,code=sm_87 -gencode arch=compute_89,code=sm_89 sharedBankConflicts.cu -o sharedBankConflicts + +Command line arguments (all are optional): +========================================== +1) Integer value, If not specified uses 1. + 1: Use transposeCoalesced() kernel + 2: Use transposeNoBankConflicts() kernel + +2) Matrix size should be greater than or equal to tile size (TILE_DIM - defined in source file "sharedBankConflicts.cu") + and must be an integral multiple of tile size. + Default value: DEFAULT_MATRIX_SIZE (defined in source file "sharedBankConflicts.cu") + +3) String value can be one of "none", "shared", "l1", "equal" + Default value: "none" + Refer the CUDA Runtime API cudaFuncSetCacheConfig() documentation for details of cache configuration. + +Sample usage: +============ +- Run with default arguments - transposeCoalesced() kernel and default value of N + > ./sharedBankConflicts + +- Run with the transposeNoBankConflicts() kernel and default value of N + > ./sharedBankConflicts 2 + + - Run with the transposeCoalesced() kernel and N=1024 + > ./sharedBankConflicts 1 1024 + + - Run with the transposeNoBankConflicts() kernel with N=1024 and cache config option "l1" (to prefer larger L1 cache and smaller shared memory) + > ./sharedBankConflicts 2 1024 l1 + + +Profiling the sample using Nsight Compute command line +====================================================== +- Profile transposeCoalesced() - the initial version of kernel + > ncu --set full --import-source on -o transposeCoalesced.ncu-rep ./sharedBankConflicts 1 + +- Profile transposeNoBankConflicts() - the updated version of the kernel + > ncu --set full --import-source on -o transposeNoBankConflicts.ncu-rep ./sharedBankConflicts 2 + +The profiler report files for the sample are also provided and they can be opened in the +Nsight Compute UI using the "File->Open" menu option. diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/samples/sharedBankConflicts/sharedBankConflicts.cu b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/samples/sharedBankConflicts/sharedBankConflicts.cu new file mode 100644 index 0000000000000000000000000000000000000000..1d40534a3b4720ef8defb5e18b585c52811cd7dd --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/samples/sharedBankConflicts/sharedBankConflicts.cu @@ -0,0 +1,281 @@ +/* + * Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* Sample CUDA application for shared memory bank conflicts. + * Transposes a N x N square matrix of float elements in + * global memory and generates an output matrix in global memory. + * + */ + +#include +#include + +#define DEFAULT_KERNEL_OPTION 1 +#define DEFAULT_MATRIX_SIZE 512 + +#define RUNTIME_API_CALL(apiFuncCall) \ + do \ + { \ + cudaError_t _status = apiFuncCall; \ + if (_status != cudaSuccess) \ + { \ + fprintf(stderr, "%s:%d: error: function %s failed with error %s.\n", __FILE__, \ + __LINE__, #apiFuncCall, cudaGetErrorString(_status)); \ + exit(EXIT_FAILURE); \ + } \ + } while (0) + +#define PRINT_PROGRAM_USAGE() \ + fprintf(stderr, "Usage: %s [] [] []\n" \ + " Default kernel option: %d\n" \ + " Use 1 for '%s' and 2 for '%s'\n" \ + " Default matrix size: %d\n" \ + " Matrix size should be greater than or equal to tile size: %d and" \ + " must be an integral multiple of tile size.\n" \ + " Default cache config option: none\n" \ + " Options: none|shared|l1|equal\n", \ + argv[0], DEFAULT_KERNEL_OPTION, \ + "transposeCoalesced", "transposeNoBankConflicts", \ + DEFAULT_MATRIX_SIZE, TILE_DIM) + +// Each block transposes a tile of (TILE_DIM x TILE_DIM) elements +// using TILE_DIM x BLOCK_ROWS threads, +// so that each thread transposes (TILE_DIM / BLOCK_ROWS) elements. +// TILE_DIM must be an integral multiple of BLOCK_ROWS +#define TILE_DIM 32 +#define BLOCK_ROWS 8 + +// Coalesced global memory transpose with shared memory bank conflicts +__global__ void transposeCoalesced(float* odata, float* idata, int width, int height) +{ + __shared__ float tile[TILE_DIM][TILE_DIM]; + + int xIndex = blockIdx.x * TILE_DIM + threadIdx.x; + int yIndex = blockIdx.y * TILE_DIM + threadIdx.y; + int indexIn = xIndex + yIndex*width; + + xIndex = blockIdx.y * TILE_DIM + threadIdx.x; + yIndex = blockIdx.x * TILE_DIM + threadIdx.y; + int indexOut = xIndex + yIndex*height; + + for (int i = 0; i < TILE_DIM; i += BLOCK_ROWS) + { + tile[threadIdx.y + i][threadIdx.x] = idata[indexIn + i * width]; + } + + __syncthreads(); + + for (int i = 0; i < TILE_DIM; i += BLOCK_ROWS) + { + odata[indexOut + i * height] = tile[threadIdx.x][threadIdx.y + i]; + } +} + +// Coalesced global memory transpose with no shared memory bank conflicts +__global__ void transposeNoBankConflicts(float* odata, float* idata, int width, int height) +{ + __shared__ float tile[TILE_DIM][TILE_DIM + 1]; + + int xIndex = blockIdx.x * TILE_DIM + threadIdx.x; + int yIndex = blockIdx.y * TILE_DIM + threadIdx.y; + int indexIn = xIndex + yIndex*width; + + xIndex = blockIdx.y * TILE_DIM + threadIdx.x; + yIndex = blockIdx.x * TILE_DIM + threadIdx.y; + int indexOut = xIndex + yIndex*height; + + for (int i = 0; i < TILE_DIM; i += BLOCK_ROWS) + { + tile[threadIdx.y + i][threadIdx.x] = idata[indexIn + i * width]; + } + + __syncthreads(); + + for (int i = 0; i < TILE_DIM; i += BLOCK_ROWS) + { + odata[indexOut + i * height] = tile[threadIdx.x][threadIdx.y + i]; + } +} + +void computeTransposeGold(float* gold, float* idata, const int size_x, const int size_y) +{ + for (int y = 0; y < size_y; ++y) + { + for (int x = 0; x < size_x; ++x) + { + gold[(x * size_y) + y] = idata[(y * size_x) + x]; + } + } +} + +bool compareData(const float* reference, const float* data, const unsigned int len) +{ + const float epsilon = 0.01f; + + for (unsigned int i = 0; i < len; ++i) + { + float diff = reference[i] - data[i]; + if ((diff > epsilon) || (diff < -epsilon)) + return false; + } + + return true; +} + +int setCacheConfig(const char *cacheConfigStr, const void *kernel) +{ + const int NumCacheConfigs = 4; + const char *cacheConfigOptionsStr[NumCacheConfigs] = { "none", "shared", "l1", "equal"}; + cudaFuncCache cacheConfigOptions[NumCacheConfigs] = {cudaFuncCachePreferNone, cudaFuncCachePreferShared, cudaFuncCachePreferL1, cudaFuncCachePreferEqual}; + cudaFuncCache cacheConfigOption; + int i; + + for(i = 0; i < NumCacheConfigs; i++) + { + if (strcmp(cacheConfigStr, cacheConfigOptionsStr[i]) == 0) + { + cacheConfigOption = cacheConfigOptions[i]; + break; + } + } + + if (i >= NumCacheConfigs) + { + fprintf(stderr, "Invalid cache config option : '%s'\n", cacheConfigStr); + return -1; + } + + fprintf(stderr, "Set cache config option : '%s'\n", cacheConfigStr); + RUNTIME_API_CALL(cudaFuncSetCacheConfig(kernel, cacheConfigOption)); + + return 0; +} + +int main(int argc, char* argv[]) +{ + int kernelOption = DEFAULT_KERNEL_OPTION; + if (argc > 1) + { + kernelOption = atoi(argv[1]); + } + + void (*kernel)(float*, float*, int, int); + const char* kernelName; + if (kernelOption == 1) + { + kernel = &transposeCoalesced; + kernelName = "transposeCoalesced"; + } + else if (kernelOption == 2) + { + kernel = &transposeNoBankConflicts; + kernelName = "transposeNoBankConflicts"; + } + else + { + fprintf(stderr, "** Invalid kernel option: %s\n", argv[1]); + PRINT_PROGRAM_USAGE(); + exit(EXIT_FAILURE); + } + + int matrixSize = DEFAULT_MATRIX_SIZE; + if (argc > 2) + { + matrixSize = atoi(argv[2]); + } + + if ((matrixSize < TILE_DIM) || (matrixSize % TILE_DIM != 0)) + { + fprintf(stderr, "** Invalid matrix size: %s\n", argv[2]); + PRINT_PROGRAM_USAGE(); + exit(EXIT_FAILURE); + } + + // size of memory required to store the matrix + size_t memSize = sizeof(float) * matrixSize * matrixSize; + + // allocate host memory + float* h_idata = (float*)malloc(memSize); + float* h_odata = (float*)malloc(memSize); + float* transposeGold = (float*)malloc(memSize); + + // allocate device memory + float *d_idata, *d_odata; + RUNTIME_API_CALL(cudaMalloc((void**)&d_idata, memSize)); + RUNTIME_API_CALL(cudaMalloc((void**)&d_odata, memSize)); + + // initialize host data + for (int i = 0; i < (matrixSize * matrixSize); ++i) + { + h_idata[i] = (float)i; + } + + // copy host data to device + RUNTIME_API_CALL(cudaMemcpy(d_idata, h_idata, memSize, cudaMemcpyHostToDevice)); + + printf("\nmatrix size: %dx%d (%dx%d tiles), kernel name: '%s', " + "tile size: %dx%d, block size: %dx%d\n", + matrixSize, matrixSize, + matrixSize/TILE_DIM, matrixSize/TILE_DIM, + kernelName, + TILE_DIM, TILE_DIM, + TILE_DIM, BLOCK_ROWS); + + if ((argc > 3) && setCacheConfig(argv[3], (const void *)kernel)) + { + PRINT_PROGRAM_USAGE(); + exit(EXIT_FAILURE); + } + + // execution configuration parameters + dim3 grid(matrixSize / TILE_DIM, matrixSize / TILE_DIM); + dim3 threads(TILE_DIM, BLOCK_ROWS); + + kernel<<>>(d_odata, d_idata, matrixSize, matrixSize); + cudaError_t err = cudaGetLastError(); + if (err != cudaSuccess) + { + fprintf(stderr, "Failed to launch '%s' kernel (error code %s)!\n", + kernelName, cudaGetErrorString(err)); + exit(EXIT_FAILURE); + } + RUNTIME_API_CALL(cudaMemcpy(h_odata, d_odata, memSize, cudaMemcpyDeviceToHost)); + + // Compute reference transpose solution + computeTransposeGold(transposeGold, h_idata, matrixSize, matrixSize); + + bool res = compareData(transposeGold, h_odata, matrixSize * matrixSize); + if (res == false) + { + fprintf(stderr, "** '%s' kernel FAILED\n", kernelName); + exit(EXIT_FAILURE); + } + + printf("Done\n"); + return 0; +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/samples/uncoalescedGlobalAccesses/README.TXT b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/samples/uncoalescedGlobalAccesses/README.TXT new file mode 100644 index 0000000000000000000000000000000000000000..5b228a3db5c45f4dcbcdc661862c46554ef1e613 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/samples/uncoalescedGlobalAccesses/README.TXT @@ -0,0 +1,40 @@ +== Sample CUDA application for uncoalesced global memory accesses == +Adds a floating point constant to an input array of double3 of N elements in global memory and generates an output array of double3 in global memory. + +Defines two versions of CUDA kernel +addConstDouble3 : naive version which results in uncoalesced global memory accesses +addConstDouble : version which treats the double3 array as a double array and avoids uncoalesced global memory accesses + +Compiling the code: +================== + > nvcc -lineinfo -gencode arch=compute_70,code=sm_70 -gencode arch=compute_72,code=sm_72 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_87,code=sm_87 -gencode arch=compute_89,code=sm_89 uncoalescedGlobalAccesses.cu -o uncoalescedGlobalAccesses + +Command line arguments (both are optional): +========================================== +1) Integer value, If not specified uses 0. + 0: Use naive version of kernel addConstDouble3() + 1: Use addConstDouble() kernel +2) Should be a positive number. Default value: 1048576 (1024 x 1024) + +Sample usage: +============ +- Run with default arguments - addConstDouble3() kernel and default value of N + > uncoalescedGlobalAccesses + +- Run with the addConstDouble() kernel and default value of N + > uncoalescedGlobalAccesses 1 + + - Run with the addConstDouble3() kernel and N=512 + > uncoalescedGlobalAccesses 0 512 + + +Profiling the sample using Nsight Compute command line +====================================================== +- Profile addConstDouble3() - the initial version of kernel + > ncu --set full --import-source on -o addConstDouble3.ncu-rep ./uncoalescedGlobalAccesses + +- Profile addConstDouble() - the updated version of the kernel + > ncu --set full --import-source on -o addConstDouble.ncu-rep ./uncoalescedGlobalAccesses 1 + +The profiler report files for the sample are also provided and they can be opened in the +Nsight Compute UI using the "File->Open" menu option. diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/samples/uncoalescedGlobalAccesses/uncoalescedGlobalAccesses.cu b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/samples/uncoalescedGlobalAccesses/uncoalescedGlobalAccesses.cu new file mode 100644 index 0000000000000000000000000000000000000000..9cbb5182a28b7c458de4f456ce4a70ff331cbb0f --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/extras/samples/uncoalescedGlobalAccesses/uncoalescedGlobalAccesses.cu @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2022-2023, NVIDIA CORPORATION. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Sample CUDA application for uncoalesced global memory accesses. + * Adds a floating point constant to an input array of double3 elements in + * global memory and generates an output array of double3 in global memory. + */ + +#include +#include + +#define BLOCK_SIZE 256 + +#define RUNTIME_API_CALL(apiFuncCall) \ +do { \ + cudaError_t _status = apiFuncCall; \ + if (_status != cudaSuccess) { \ + fprintf(stderr, "%s:%d: error: function %s failed with error %s.\n", \ + __FILE__, __LINE__, #apiFuncCall, cudaGetErrorString(_status));\ + exit(EXIT_FAILURE); \ + } \ +} while (0) + +__global__ void addConstDouble3(int numElements, double3 *d_in, double k, double3 *d_out) +{ + int index = blockIdx.x * blockDim.x + threadIdx.x; + if (index < numElements) + { + double3 a = d_in[index]; + a.x += k; + a.y += k; + a.z += k; + d_out[index] = a; + } +} + +__global__ void addConstDouble(int numElements, double *d_in, double k, double *d_out) +{ + int index = blockIdx.x * blockDim.x + threadIdx.x; + if (index < numElements) + { + d_out[index] = d_in[index] + k; + } +} + +int main (int argc, char *argv[]) +{ + // Error code to check return values for CUDA calls + cudaError_t err = cudaSuccess; + double constK = 10.0; + + int kernelOption = 0; + if (argc > 1) + { + kernelOption = atoi(argv[1]); + } + + int numElements = 1024*1024; + if (argc > 2) + { + numElements = atoi(argv[2]); + if (numElements <= 0) + { + fprintf(stderr, "Invalid number of elements(%s), should be a positive number\n", argv[2]); + exit(EXIT_FAILURE); + } + } + + printf("double3 constant addition of %d elements\n", numElements); + printf("kernelOption=%d\n", kernelOption); + + size_t size = numElements * sizeof(double3); + + // Allocate the host input array + double3 *h_A = (double3 *)malloc(size); + + + // Allocate the host output array + double3 *h_B = (double3 *)malloc(size); + + // Verify that allocations succeeded + if (h_A == NULL || h_B == NULL) + { + fprintf(stderr, "Failed to allocate host arrays!\n"); + exit(EXIT_FAILURE); + } + + // Initialize the host input vectors + for (int i = 0; i < numElements; ++i) + { + h_A[i].x = rand()/(double)RAND_MAX; + h_A[i].y = rand()/(double)RAND_MAX; + h_A[i].z = rand()/(double)RAND_MAX; + } + + // Allocate the device input array A + double3 *d_A = NULL; + RUNTIME_API_CALL(cudaMalloc((void **)&d_A, size)); + + + // Allocate the device output array B + double3 *d_B = NULL; + RUNTIME_API_CALL(cudaMalloc((void **)&d_B, size)); + + // Copy the host input array A in host memory to the device input array in device memory + RUNTIME_API_CALL(cudaMemcpy(d_A, h_A, size, cudaMemcpyHostToDevice)); + + // Launch the CUDA Kernel + int threadsPerBlock = BLOCK_SIZE; + if (kernelOption == 0) + { + int blocksPerGrid =(numElements + threadsPerBlock - 1) / threadsPerBlock; + printf("CUDA kernel addConstDouble3 launch with %d blocks of %d threads\n", blocksPerGrid, threadsPerBlock); + addConstDouble3<<>>(numElements, d_A, constK, d_B); + } + else if (kernelOption == 1) + { + int blocksPerGrid =(numElements*3 + threadsPerBlock - 1) / threadsPerBlock; + printf("CUDA kernel addConstDouble launch with %d blocks of %d threads\n", blocksPerGrid, threadsPerBlock); + addConstDouble<<>>(numElements*3, (double *)d_A, constK, (double *)d_B); + } + else + { + fprintf(stderr, "** Invalid kernel option %d\n", kernelOption); + exit(EXIT_FAILURE); + } + + err = cudaGetLastError(); + if (err != cudaSuccess) + { + fprintf(stderr, "Failed to launch kernel (error code %s)!\n", cudaGetErrorString(err)); + exit(EXIT_FAILURE); + } + + // Copy the device result array in device memory to the host result vector + // in host memory. + RUNTIME_API_CALL(cudaMemcpy(h_B, d_B, size, cudaMemcpyDeviceToHost)); + + + // Verify that the result vector is correct + for (int i = 0; i < numElements; ++i) + { + if ((fabs(h_A[i].x + constK - h_B[i].x) > 1e-5) || + (fabs(h_A[i].y + constK - h_B[i].y) > 1e-5) || + (fabs(h_A[i].z + constK - h_B[i].z) > 1e-5)) + { + fprintf(stderr, "Result verification failed at element %d!\n", i); + exit(EXIT_FAILURE); + } + } + + // Free device global memory + RUNTIME_API_CALL(cudaFree(d_A)); + RUNTIME_API_CALL(cudaFree(d_B)); + + // Free host memory + free(h_A); + free(h_B); + + printf("Done\n"); + return 0; +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/ad10x-gfxt.config b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/ad10x-gfxt.config new file mode 100644 index 0000000000000000000000000000000000000000..5aa8c41236b6efeaa3aa4e49d5cf099623d7c4da --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/ad10x-gfxt.config @@ -0,0 +1,786 @@ +# NOTE: Metrics representing a superset of other metrics must be declared first +# if they appear in the same group (displayRows). Otherwise different metrics will +# dominate in the group row depending on zoom level if overlay display mode is used. +version: 3 +metricSets: +- alias: ad10x-gfxt + name: Graphics Throughput Metrics for NVIDIA AD10x (frequency >= 10kHz) + chips: [AD102, AD103, AD104, AD106, AD107] + counterWidth: narrow + displayRows: + - name: + type: overlay + displayHeightScale: 0.5 + metrics: + - Sync Copy Engine Active + - GR Active + - name: + type: overlay + displayHeightScale: -0.5 + metrics: + - GPU Memory Read Bandwidth + - GPU Memory Write Bandwidth + - PCIe Read Bandwidth + - PCIe Write Bandwidth + - name: GPU Active + description: Activity of the graphics and copy engines + type: overlay + metrics: + - Sync Copy Engine Active + - Async Copy Engine Active 0 + - Async Copy Engine Active 1 + - Async Copy Engine Active 2 + - GR Active + - name: Unit Throughputs + description: Throughput of each major hardware unit + type: overlay + displayHeightScale: 2.0 + metrics: + - SM Throughput + - RTCORE Throughput + - VAF Throughput + - L1 Throughput + - L2 Throughput + - VRAM Throughput + - PCIe Throughput + - PD Throughput + - PES+VPC Throughput + - RASTER Throughput + - PROP Throughput + - ZROP Throughput + - CROP Throughput + - name: Compute in Flight + description: Compute dispatches sent to the GPU queues that have been issued, + but not yet complete + type: overlay + metrics: + - Sync Compute in Flight + - Async Compute in Flight + - name: Draw/Dispatch Start + description: Draw and dispatch start times + type: overlay + metrics: + - Draw Started + - Dispatch Started + - name: SM Occupancy (TPC View) + type: stacked + displayHeightScale: 2.0 + metrics: + - Vertex/Tess/Geometry Warps + - Pixel Warps + - Compute Warps + - Unallocated Warps in Active SMs + - Idle SM Unused Warp Slots + - name: Active Threads Per Warp + description: Use this row to observe the fraction of active thread lanes per warp-level + instruction + type: overlay + metrics: + - Active Threads Per Warp + - name: FE Stalls + description: FE stalls waiting for commands to complete + type: overlay + metrics: + - FE Stalled Sync + - FE Stalled Async + - name: FE Pipeline Stalling Commands + description: FE commands that require parts of the pipeline to stall + type: overlay + metrics: + - Go Idle Sync + - Subchannel Switch Sync + - Go Idle Async + - Subchannel Switch Async + - Pixel Shader Barriers + - name: SM Register Usage (Occupancy Limiter) + description: 'Average # of registers allocated each cycle per SM' + type: stacked + metrics: + - 3D Register Allocation + - CS Register Allocation + - name: SM Shared+ISBE Memory Usage (Occupancy Limiter) + description: 'Average # of shared and ISBE memory bytes allocated each cycle' + type: stacked + metrics: + - CS Shared Memory Allocated (Sync) + - CS Shared Memory Allocated (Async) + - VTG ISBE Memory Allocated + - name: SM TRAM Memory Usage (Occupancy Limiter) + description: 'Average # of TRAM memory bytes allocated each cycle' + type: stacked + metrics: + - PS TRAM Memory Allocated + - name: Active Thread Groups in SM (Occupancy Limiter) + description: 'Average # of active threads per SM each cycle' + type: stacked + metrics: + - Active Thread Groups in SM + - name: SM Instruction Throughputs + description: SM instruction throughput breakdown by pipe + type: overlay + metrics: + - SM Issue Active + - SM ALU Pipe Throughput + - SM FMA Light Pipe Throughput + - SM FMA Heavy Pipe Throughput + - SM SFU Pipe Throughput + - name: L1 Throughputs + description: L1 cache throughputs breakdown by stage + type: overlay + metrics: + - L1 LSU Data-Stage Throughput + - L1 Texture Data-Stage Throughput + - L1 LSU Writeback-Stage Throughput + - L1 Texture Writeback-Stage Throughput + - L1 Texture Filter-Stage Throughput + - name: L1 LSU Throughputs + description: L1 cache LSU throughputs breakdown by memory space + type: overlay + metrics: + - L1 Local+Global Data-Stage Throughput + - L1 Shared+Attribute Data-Stage Throughput + - L1 Surface Data-Stage Throughput + - name: L1 Hit Rate + description: L1 cache hit rate for all operations + type: overlay + metrics: + - L1 Hit Rate + - name: L2 Bandwidth (Source) + description: L2 cache bandwidth breakdown by source unit + type: stacked + metrics: + - L2 Bandwidth from L1 + - L2 Bandwidth from GCC + - L2 Bandwidth from PE + - L2 Bandwidth from CROP + - L2 Bandwidth from ZROP + - L2 Bandwidth from Raster + - L2 Bandwidth from FBP + - L2 Bandwidth from HUB + - name: L2 Bandwidth (Destination) + description: L2 cache bandwidth breakdown by destination unit + type: stacked + metrics: + - L2 Bandwidth to VRAM + - L2 Bandwidth to PCIe+Peer + - name: L2 Hit Rates + description: L2 cache hit rates in aggregate and for read operations from L1 + type: overlay + metrics: + - L2 Hit Rate + - L2 Hit Rate from L1 + - name: GPU Memory Bandwidth + description: GPU memory read/write bandwidth + type: stacked + metrics: + - GPU Memory Read Bandwidth + - GPU Memory Write Bandwidth + - name: PCIe Bandwidth + description: PCIe read/write bandwidth + type: overlay + metrics: + - PCIe Read Bandwidth + - PCIe Write Bandwidth + - name: PCIe to BAR Requests + description: PCIe to BAR 0/1/2 read/write requests + type: overlay + metrics: + - PCIe Read Requests to BAR1 + - PCIe Write Requests to BAR1 + - PCIe Read Requests to BAR0 + - PCIe Write Requests to BAR0 + - PCIe Read Requests to BAR2 + - PCIe Write Requests to BAR2 + - name: ZCULL + description: Total/Rejected number of samples sent to ZCULL + type: overlay + metrics: + - ZCULL Rejected Samples + - ZCULL Input Samples + metrics: + - name: Sync Copy Engine Active + id: HOST.TriageSCG.gpu__engine_cycles_active_any_syncce + color: '#B2B233' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Workloads + suffix: .sum + - name: Async Copy Engine Active 0 + id: FE_A.TriageSCG.gpu__scheduler_engine_asyncce0_cycles_active + color: '#FFA700' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Workloads + suffix: .sum + - name: Async Copy Engine Active 1 + id: FE_A.TriageSCG.gpu__scheduler_engine_asyncce1_cycles_active + color: '#FFA700' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Workloads + suffix: .sum + - name: Async Copy Engine Active 2 + id: HOST.TriageSCG.gpu__scheduler_engine_asyncce2_cycles_active + color: '#FFA700' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Workloads + suffix: .sum + - name: GR Active + id: FE_B.TriageSCG.gr__cycles_active + description: Number of cycles the graphics/compute engine is active. The graphics + and compute engine are active if there is any work in the graphics pipe or if + the compute pipe is processing a dispatch. + color: '#ED6A32' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Workloads + suffix: .sum + - name: SM Throughput + id: TriageSCG.sm__throughput + color: '#D100EE' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: RTCORE Throughput + id: rtcore__cycles_executed + color: '#D18841' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: VAF Throughput + id: TPC.TriageSCG.vaf__throughput + color: '#D13341' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 Throughput + id: SM_A.TriageSCG.l1tex__throughput + color: '#FFC425' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Throughput + id: LTS.TriageSCG.lts__throughput + color: '#00AEDB' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: VRAM Throughput + id: FBSP.TriageSCG.dramc__throughput + color: '#F37735' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PCIe Throughput + id: PCI.TriageSCG.pcie__throughput + color: '#3577F3' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PD Throughput + id: HUB_B.TriageSCG.pda__throughput + color: '#00B159' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PES+VPC Throughput + id: GPC_B.TriageSCG.pes__throughput + color: '#3FB159' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: RASTER Throughput + id: GPC_A.TriageSCG.raster__throughput + color: '#6FB159' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PROP Throughput + id: GPC_A.TriageSCG.prop__throughput + color: '#9FB159' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: ZROP Throughput + id: ROP.TriageSCG.zrop__throughput + color: '#854442' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: CROP Throughput + id: ROP.TriageSCG.crop__throughput + color: '#AFB159' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Sync Compute in Flight + id: FE_A.TriageSCG.gr__compute_cycles_active_queue_sync + color: '#FE7F9C' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Async Compute in Flight + id: FE_A.TriageSCG.gr__compute_cycles_active_queue_async + color: '#FFD179' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Draw Started + id: FE_B.TriageSCG.fe__draw_count + description: Number of draw calls started + color: '#F0F000' + subMetrics: + - name: Workloads + suffix: .sum + - name: Dispatch Started + id: FE_A.TriageSCG.gr__dispatch_count + description: Number of compute dispatches/grid launches started + color: '#00F0F0' + subMetrics: + - name: Workloads + suffix: .sum + - name: Vertex/Tess/Geometry Warps + id: SM_B.TriageSCG.tpc__warps_active_shader_vtg_realtime + color: '#0057E7' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Pixel Warps + id: TPC.TriageSCG.tpc__warps_active_shader_ps_realtime + color: '#008744' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Compute Warps + id: TPC.TriageSCG.tpc__warps_active_shader_cs_realtime + color: '#FFA700' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Unallocated Warps in Active SMs + id: TriageSCG.tpc__warps_inactive_sm_active_realtime + color: '#696969' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Idle SM Unused Warp Slots + id: TriageSCG.tpc__warps_inactive_sm_idle_realtime + color: '#C0C0C0' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Active Threads Per Warp + id: smsp__thread_inst_executed_pred_on_per_inst_executed + color: green + schedulingTarget: smpc + subMetrics: + - name: Threads/Warp + suffix: .ratio + - name: Coherence + suffix: .pct + - name: FE Stalled Sync + id: FE_B.TriageSCG.fe__cycles_stalled_cmd_wfi_queue_sync + color: '#AA1111' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: FE Stalled Async + id: FE_B.TriageSCG.fe__cycles_stalled_cmd_wfi_queue_async + color: '#11AA11' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Go Idle Sync + id: FE_B.TriageSCG.fe__output_ops_cmd_go_idle_queue_sync + color: '#11AA11' + subMetrics: + - name: Commands + suffix: .sum + - name: Subchannel Switch Sync + id: FE_A.TriageSCG.fe__output_ops_cmd_subchsw_queue_sync + color: '#AA11AA' + subMetrics: + - name: Commands + suffix: .sum + - name: Go Idle Async + id: FE_B.TriageSCG.fe__output_ops_cmd_go_idle_queue_async + color: '#AA1111' + subMetrics: + - name: Commands + suffix: .sum + - name: Subchannel Switch Async + id: FE_A.TriageSCG.fe__output_ops_cmd_subchsw_queue_async + color: '#1111AA' + subMetrics: + - name: Commands + suffix: .sum + - name: Pixel Shader Barriers + id: FE_B.TriageSCG.fe__pixel_shader_barriers + color: '#11AAAA' + subMetrics: + - name: Commands + suffix: .sum + - name: 3D Register Allocation + id: TPC.TriageSCG.tpc__sm_rf_registers_allocated_shader_3d_realtime + color: '#008744' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg Registers per SM + suffix: .avg.per_cycle_elapsed + multiplier: 0.5 + - name: CS Register Allocation + id: TPC.TriageSCG.tpc__sm_rf_registers_allocated_shader_cs_realtime + color: '#FFA700' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg Registers per SM + suffix: .avg.per_cycle_elapsed + multiplier: 0.5 + - name: CS Shared Memory Allocated (Sync) + id: TPC.TriageSCG.tpc__l1tex_mem_shared_data_compute_bytes_allocated_queue_sync_realtime + color: '#B2B233' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg Bytes + suffix: .avg.per_cycle_elapsed + - name: CS Shared Memory Allocated (Async) + id: TPC.TriageSCG.tpc__l1tex_mem_shared_data_compute_bytes_allocated_queue_async_realtime + color: '#B233B2' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg Bytes + suffix: .avg.per_cycle_elapsed + - name: VTG ISBE Memory Allocated + id: TPC.TriageSCG.tpc__l1tex_mem_shared_data_isbe_bytes_allocated_realtime + color: '#33B2B2' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg Bytes + suffix: .avg.per_cycle_elapsed + - name: PS TRAM Memory Allocated + id: TPC.TriageSCG.tpc__l1tex_mem_shared_data_tram_bytes_allocated_realtime + color: '#33B233' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg Bytes + suffix: .avg.per_cycle_elapsed + - name: Active Thread Groups in SM + id: SM_B.TriageSCG.sm__ctas_active + color: '#B23333' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg CTAs per SM + suffix: .avg.per_cycle_elapsed + - name: SM Issue Active + id: SM_A.TriageSCG.sm__inst_executed_realtime + description: SM instruction issue rate. Each SM can issue 4 instructions/cycle + (1 instruction/SMSP/cycle). + color: '#CFCF3F' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Instructions + suffix: .sum + - name: Avg Inst/Clk per SM + suffix: .avg.per_cycle_elapsed + - name: Peak Inst/Clk per SM + suffix: .avg.peak_sustained + - name: SM ALU Pipe Throughput + id: SM_A.TriageSCG.sm__inst_executed_pipe_alu_realtime + color: '#FF6F00' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Instructions + suffix: .sum + - name: Avg Inst/Clk per SM + suffix: .avg.per_cycle_elapsed + - name: Peak Inst/Clk per SM + suffix: .avg.peak_sustained + - name: SM FMA Light Pipe Throughput + id: SM_C.TriageSCG.smsp__inst_executed_pipe_fmalite + color: '#00CF00' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Instructions + suffix: .sum + - name: Avg Inst/Clk per SM + suffix: .avg.per_cycle_elapsed + - name: Peak Inst/Clk per SM + suffix: .avg.peak_sustained + - name: SM FMA Heavy Pipe Throughput + id: SM_C.TriageSCG.smsp__inst_executed_pipe_fmaheavy + color: '#CF003F' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Instructions + suffix: .sum + - name: Avg Inst/Clk per SM + suffix: .avg.per_cycle_elapsed + - name: Peak Inst/Clk per SM + suffix: .avg.peak_sustained + - name: SM SFU Pipe Throughput + id: SM_A.TriageSCG.sm__inst_executed_pipe_xu_realtime + color: '#00003F' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Instructions + suffix: .sum + - name: Avg Inst/Clk per SM + suffix: .avg.per_cycle_elapsed + - name: Peak Inst/Clk per SM + suffix: .avg.peak_sustained + - name: L1 LSU Data-Stage Throughput + id: SM_A.TriageSCG.l1tex__data_pipe_lsu_wavefronts + color: '#CFCF3F' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 Texture Data-Stage Throughput + id: SM_A.TriageSCG.l1tex__data_pipe_tex_wavefronts + color: '#00003F' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 LSU Writeback-Stage Throughput + id: SM_A.TriageSCG.l1tex__lsu_writeback_active + color: '#CF003F' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 Texture Writeback-Stage Throughput + id: SM_A.TriageSCG.l1tex__tex_writeback_active + color: '#33B2B2' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 Texture Filter-Stage Throughput + id: SM_A.TriageSCG.l1tex__f_wavefronts_realtime + color: '#3F00CF' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 Local+Global Data-Stage Throughput + id: SM_A.TriageSCG.l1tex__data_pipe_lsu_wavefronts_mem_lg + color: '#FF6F00' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 Shared+Attribute Data-Stage Throughput + id: SM_A.TriageSCG.l1tex__data_pipe_lsu_wavefronts_mem_shared_realtime + color: '#00CF00' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 Surface Data-Stage Throughput + id: SM_A.TriageSCG.l1tex__data_pipe_lsu_wavefronts_mem_surface_realtime + color: '#FFCA18' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 Hit Rate + id: SM_B.TriageSCG.l1tex__t_sector_hit_rate + color: '#551DCC' + subMetrics: + - name: Ratio % + suffix: .pct + - name: L2 Bandwidth from L1 + id: LTS.TriageSCG.lts__t_sector_throughput_srcunit_tex + color: '#11AA11' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth from GCC + id: LTS.TriageSCG.lts__t_sector_throughput_srcunit_gcc + color: '#11AAAA' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth from PE + id: LTS.TriageSCG.lts__t_sector_throughput_srcunit_pe + color: '#AAAA11' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth from CROP + id: ROP.TriageSCG.lts__t_sector_throughput_srcunit_crop + color: '#AA1111' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth from ZROP + id: ROP.TriageSCG.lts__t_sector_throughput_srcunit_zrop + color: '#1111AA' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth from Raster + id: TriageSCG.lts__t_sector_throughput_srcunit_raster + color: '#AA11AA' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth from FBP + id: LTS.TriageSCG.lts__t_sector_throughput_srcnode_fbp + color: '#111111' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth from HUB + id: LTS.TriageSCG.lts__t_sector_throughput_srcnode_hub + color: '#AAAAAA' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth to VRAM + id: LTS.TriageSCG.lts__t_sector_throughput_aperture_device + color: '#AA1111' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth to PCIe+Peer + id: LTS.TriageSCG.lts__t_sector_throughput_aperture_other + color: '#11AA11' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Hit Rate + id: LTS.TriageSCG.lts__average_t_sector_hit_rate_realtime + color: '#88001B' + subMetrics: + - name: Ratio % + suffix: .pct + - name: L2 Hit Rate from L1 + id: LTS.TriageSCG.lts__average_t_sector_hit_rate_srcunit_tex_realtime + color: '#FFCA18' + subMetrics: + - name: Ratio % + suffix: .pct + - name: GPU Memory Read Bandwidth + id: FBSP.TriageSCG.dramc__read_throughput + color: '#CCCC00' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: GPU Memory Write Bandwidth + id: FBSP.TriageSCG.dramc__write_throughput + color: '#CC00CC' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PCIe Read Bandwidth + id: PCI.TriageSCG.pcie__read_bytes + description: Number of bytes received by GPU (includes protocol) + color: '#FF3D00' + schedulingRule: migOptional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Bytes + suffix: .sum + - name: GB/s + suffix: .sum.per_second + multiplier: 1.0e-09 + - name: PCIe Write Bandwidth + id: PCI.TriageSCG.pcie__write_bytes + description: Number of bytes transmitted by GPU (includes protocol) + color: '#00CFCF' + schedulingRule: migOptional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Bytes + suffix: .sum + - name: GB/s + suffix: .sum.per_second + multiplier: 1.0e-09 + - name: PCIe Read Requests to BAR1 + id: pcie__rx_requests_aperture_bar1_op_read + description: CPU+Peer Reads from VRAM over PCIe + color: '#87FFFF' + subMetrics: + - name: Requests + suffix: .sum + - name: PCIe Write Requests to BAR1 + id: pcie__rx_requests_aperture_bar1_op_write + description: CPU+Peer Writes to VRAM over PCIe + color: '#8700FF' + subMetrics: + - name: Requests + suffix: .sum + - name: PCIe Read Requests to BAR0 + id: pcie__rx_requests_aperture_bar0_op_read + color: '#AFFF87' + subMetrics: + - name: Requests + suffix: .sum + - name: PCIe Write Requests to BAR0 + id: pcie__rx_requests_aperture_bar0_op_write + color: '#870087' + subMetrics: + - name: Requests + suffix: .sum + - name: PCIe Read Requests to BAR2 + id: pcie__rx_requests_aperture_bar2_op_read + color: '#AFAF00' + subMetrics: + - name: Requests + suffix: .sum + - name: PCIe Write Requests to BAR2 + id: pcie__rx_requests_aperture_bar2_op_write + color: '#870000' + subMetrics: + - name: Requests + suffix: .sum + - name: ZCULL Rejected Samples + id: GPC_A.TriageSCG.raster__zcull_input_samples_op_rejected_realtime + color: '#663399' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Sum + suffix: .sum + - name: ZCULL Input Samples + id: GPC_A.TriageSCG.raster__zcull_input_samples_realtime + color: '#CC3399' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Sum + suffix: .sum diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/ad10x.config b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/ad10x.config new file mode 100644 index 0000000000000000000000000000000000000000..7cff567fbcf5d98e8737eb8702f0adfdfa15dd19 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/ad10x.config @@ -0,0 +1,230 @@ +# NOTE: Metrics representing a superset of other metrics must be declared first +# if they appear in the same group (displayRows). Otherwise different metrics will +# dominate in the group row depending on zoom level if overlay display mode is used. +version: 3 +metricSets: +- alias: ad10x + name: General Metrics for NVIDIA AD10x (any frequency) + chips: [AD102, AD103, AD104, AD106, AD107] + counterWidth: wide + displayRows: + - name: + type: overlay + displayHeightScale: 0.5 + metrics: + - GR Active + - name: + type: overlay + displayHeightScale: -0.5 + metrics: + - PCIe RX Throughput + - PCIe TX Throughput + - name: GPC Clock Frequency + type: overlay + metrics: + - GPC Clock Frequency + - name: SYS Clock Frequency + type: overlay + metrics: + - SYS Clock Frequency + - name: GPU Active + description: The graphics or compute engine is active + type: overlay + metrics: + - GR Active + - name: Compute in Flight + description: Compute dispatches sent to the GPU queues that have been issued, + but not yet complete + type: overlay + metrics: + - Sync Compute in Flight + - Async Compute in Flight + - name: SM Active + type: overlay + metrics: + - SM Active + - name: SM Instructions + type: overlay + metrics: + - SM Issue + - Tensor Active + - name: SM Warp Occupancy + type: stacked + displayHeightScale: 3.0 + metrics: + - Vertex/Tess/Geometry Warps in Flight + - Pixel Warps in Flight + - Compute Warps in Flight + - Unallocated Warps in Active SMs + - name: DRAM Bandwidth + type: stacked + metrics: + - DRAM Read Bandwidth + - DRAM Write Bandwidth + - name: PCIe Bandwidth + type: overlay + metrics: + - PCIe RX Throughput + - PCIe TX Throughput + - name: PCIe Read Requests to BAR1 + metrics: + - PCIe Read Requests to BAR1 + - name: PCIe Write Requests to BAR1 + metrics: + - PCIe Write Requests to BAR1 + metrics: + - name: GPC Clock Frequency + id: gpc__cycles_elapsed + description: The frequency of the GPC graphics clock. In NVIDIA GPU Specs this + is the Boost Clock and Base Clock. In nvidia-smi this is the "gr", "graphics", + "Graphics Clock". + color: '#8BDDB4' + subMetrics: + - name: MHz + suffix: .avg.per_second + multiplier: 1.0e-06 + - name: SYS Clock Frequency + id: sys__cycles_elapsed + description: The frequency of the SYS clock. The SYS clock is the clock used for + the copy engines, compute and graphics command processor, and the hardware performance + monitor streaming unit. + color: '#118E44' + schedulingRule: migOptional + subMetrics: + - name: MHz + suffix: .avg.per_second + multiplier: 1.0e-06 + - name: GR Active + id: FE_B.TriageSCG.gr__cycles_active + description: Number of cycles the graphics/compute engine is active. The graphics + and compute engine are active if there is any work in the graphics pipe or if + the compute pipe is processing a dispatch. + color: '#ED6A32' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Sync Compute in Flight + id: FE_A.TriageSCG.gr__compute_cycles_active_queue_sync + color: '#FE7F9C' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Async Compute in Flight + id: FE_A.TriageSCG.gr__compute_cycles_active_queue_async + color: '#FFD179' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: SM Active + id: sm__cycles_active + description: Total number of cycles the SM is active (at least 1 active warp) + color: '#FFA5A5' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: SM Issue + id: sm__inst_executed_realtime + description: SM instruction issue rate. Each SM can issue 4 instructions/cycle + (1 instruction/SMSP/cycle). + color: '#98C4DD' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Tensor Active + id: sm__pipe_tensor_cycles_active_realtime + description: Cycles the tensor pipe is active + color: '#B3FF70' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Vertex/Tess/Geometry Warps in Flight + id: tpc__warps_active_shader_vtg_realtime + description: Total number of graphics vertex, tesselation, geometry, and mesh + shader warps in flight + color: '#FFA5A5' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Pixel Warps in Flight + id: tpc__warps_active_shader_ps_realtime + description: Total number of pixel shader warps in flight + color: '#8BDDB4' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Compute Warps in Flight + id: tpc__warps_active_shader_cs_realtime + description: Total number of compute shader warps in flight + color: '#FFD179' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Unallocated Warps in Active SMs + id: tpc__warps_inactive_sm_active_realtime + description: Total number of warp slots available on active SMs + color: '#696969' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: DRAM Read Bandwidth + id: dram__read_throughput + description: The ratio of cycles the DRAM interface was active reading data to + the elapsed cycles in the same period as a percentage + color: '#FFA5A5' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: DRAM Write Bandwidth + id: dram__write_throughput + description: The ratio of cycles the DRAM interface was active writing data to + the elapsed cycles in the same period as a percentage + color: '#98C4DD' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PCIe RX Throughput + id: pcie__read_bytes + description: Number of bytes received by GPU (includes protocol) + color: '#FF3D00' + schedulingRule: migOptional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PCIe TX Throughput + id: pcie__write_bytes + description: Number of bytes transmitted by GPU (includes protocol) + color: '#00CFCF' + schedulingRule: migOptional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PCIe Read Requests to BAR1 + id: pcie__rx_requests_aperture_bar1_op_read + description: CPU+Peer Reads from VRAM over PCIe + color: '#87FFFF' + subMetrics: + - name: Requests + suffix: .sum + - name: PCIe Write Requests to BAR1 + id: pcie__rx_requests_aperture_bar1_op_write + description: CPU+Peer Writes to VRAM over PCIe + color: '#8700FF' + subMetrics: + - name: Requests + suffix: .sum diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/ga100.config b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/ga100.config new file mode 100644 index 0000000000000000000000000000000000000000..bbc9ba179377fe6f90dca6a97474045cf3e5ccbf --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/ga100.config @@ -0,0 +1,271 @@ +# NOTE: Metrics representing a superset of other metrics must be declared first +# if they appear in the same group (displayRows). Otherwise different metrics will +# dominate in the group row depending on zoom level if overlay display mode is used. +version: 3 +metricSets: +- alias: ga100 + name: General Metrics for NVIDIA GA100 (any frequency) + chips: [GA100] + counterWidth: wide + displayRows: + - name: + type: overlay + displayHeightScale: 0.5 + metrics: + - GR Active + - name: + type: overlay + displayHeightScale: -0.5 + metrics: + - NVLink RX Responses User Data + - NVLink TX Responses User Data + - PCIe RX Throughput + - PCIe TX Throughput + - name: GPC Clock Frequency + type: overlay + metrics: + - GPC Clock Frequency + - name: SYS Clock Frequency + type: overlay + metrics: + - SYS Clock Frequency + - name: GPU Active + description: The graphics or compute engine is active + type: overlay + metrics: + - GR Active + - name: SM Active + type: overlay + metrics: + - SM Active + - name: SM Instructions + type: overlay + metrics: + - SM Issue + - Tensor Active + - name: SM Warp Occupancy + type: stacked + displayHeightScale: 3.0 + metrics: + - Vertex/Tess/Geometry Warps in Flight + - Pixel Warps in Flight + - Compute Warps in Flight + - Unallocated Warps in Active SMs + - name: DRAM Bandwidth + type: stacked + metrics: + - DRAM Read Bandwidth + - DRAM Write Bandwidth + - name: NVLink RX Bandwidth + type: stacked + metrics: + - NVLink RX Requests Protocol Data + - NVLink RX Requests User Data + - NVLink RX Responses Protocol Data + - NVLink RX Responses User Data + - name: NVLink TX Bandwidth + type: stacked + metrics: + - NVLink TX Requests Protocol Data + - NVLink TX Requests User Data + - NVLink TX Responses Protocol Data + - NVLink TX Responses User Data + - name: PCIe Bandwidth + type: overlay + metrics: + - PCIe RX Throughput + - PCIe TX Throughput + metrics: + - name: GPC Clock Frequency + id: gpc__cycles_elapsed + description: The frequency of the GPC graphics clock. In NVIDIA GPU Specs this + is the Boost Clock and Base Clock. In nvidia-smi this is the "gr", "graphics", + "Graphics Clock". + color: '#8BDDB4' + subMetrics: + - name: MHz + suffix: .avg.per_second + multiplier: 1.0e-06 + - name: SYS Clock Frequency + id: sys__cycles_elapsed + description: The frequency of the SYS clock. The SYS clock is the clock used for + the copy engines, compute and graphics command processor, and the hardware performance + monitor streaming unit. + color: '#118E44' + schedulingRule: migOptional + subMetrics: + - name: MHz + suffix: .avg.per_second + multiplier: 1.0e-06 + - name: GR Active + id: gr__cycles_active + description: Number of cycles the graphics/compute engine is active. The graphics + and compute engine are active if there is any work in the graphics pipe or if + the compute pipe is processing a dispatch. + color: '#ED6A32' + subMetrics: + - name: Throughput % + suffix: .sum.pct_of_peak_sustained_elapsed + - name: SM Active + id: sm__cycles_active + description: Total number of cycles the SM is active (at least 1 active warp) + color: '#FFA5A5' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: SM Issue + id: sm__inst_executed_realtime + description: SM instruction issue rate. Each SM can issue 4 instructions/cycle + (1 instruction/SMSP/cycle). + color: '#98C4DD' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Tensor Active + id: sm__pipe_tensor_cycles_active_realtime + description: Cycles the tensor pipe is active + color: '#B3FF70' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Vertex/Tess/Geometry Warps in Flight + id: tpc__warps_active_shader_vtg_realtime + description: Total number of graphics vertex, tesselation, geometry, and mesh + shader warps in flight + color: '#FFA5A5' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Pixel Warps in Flight + id: tpc__warps_active_shader_ps_realtime + description: Total number of pixel shader warps in flight + color: '#8BDDB4' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Compute Warps in Flight + id: tpc__warps_active_shader_cs_realtime + description: Total number of compute shader warps in flight + color: '#FFD179' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Unallocated Warps in Active SMs + id: tpc__warps_inactive_sm_active_realtime + description: Total number of warp slots available on active SMs + color: '#696969' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: DRAM Read Bandwidth + id: dram__read_throughput + description: The ratio of cycles the DRAM interface was active reading data to + the elapsed cycles in the same period as a percentage + color: '#FFA5A5' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: DRAM Write Bandwidth + id: dram__write_throughput + description: The ratio of cycles the DRAM interface was active writing data to + the elapsed cycles in the same period as a percentage + color: '#98C4DD' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink RX Requests Protocol Data + id: nvlrx__bytes_packet_request_data_protocol + description: Number of bytes of NVLRX request protocol data + color: '#C79536' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink RX Requests User Data + id: nvlrx__bytes_packet_request_data_user + description: Number of bytes of NVLRX request user data + color: '#FFD179' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink RX Responses Protocol Data + id: nvlrx__bytes_packet_response_data_protocol + description: Number of bytes of NVLRX response protocol data + color: '#C25D5D' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink RX Responses User Data + id: nvlrx__bytes_packet_response_data_user + description: Number of bytes of NVLRX response user data + color: '#FFA5A5' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink TX Requests Protocol Data + id: nvltx__bytes_packet_request_data_protocol + description: Number of bytes of NVLTX request protocol data + color: '#9052BF' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink TX Requests User Data + id: nvltx__bytes_packet_request_data_user + description: Number of bytes of NVLTX request user data + color: '#D6A4FC' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink TX Responses Protocol Data + id: nvltx__bytes_packet_response_data_protocol + description: Number of bytes of NVLTX response protocol data + color: '#6999B5' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink TX Responses User Data + id: nvltx__bytes_packet_response_data_user + description: Number of bytes of NVLTX response user data + color: '#98C4DD' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PCIe RX Throughput + id: pcie__read_bytes + description: Number of bytes received by GPU (includes protocol) + color: '#FF3D00' + schedulingRule: migOptional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PCIe TX Throughput + id: pcie__write_bytes + description: Number of bytes transmitted by GPU (includes protocol) + color: '#00CFCF' + schedulingRule: migOptional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/ga10b.config b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/ga10b.config new file mode 100644 index 0000000000000000000000000000000000000000..0225cdcc30c71b1098dcc110971199a24eb77f48 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/ga10b.config @@ -0,0 +1,162 @@ +# NOTE: Metrics representing a superset of other metrics must be declared first +# if they appear in the same group (displayRows). Otherwise different metrics will +# dominate in the group row depending on zoom level if overlay display mode is used. +version: 3 +metricSets: +- alias: ga10b + name: General Metrics for NVIDIA GA10B (any frequency) + chips: [GA10B] + counterWidth: wide + displayRows: + - name: + type: overlay + displayHeightScale: 1.0 + metrics: + - GR Active + - name: GPC Clock Frequency + type: overlay + metrics: + - GPC Clock Frequency + - name: SYS Clock Frequency + type: overlay + metrics: + - SYS Clock Frequency + - name: GPU Active + description: The graphics or compute engine is active + type: overlay + metrics: + - GR Active + - name: Compute in Flight + description: Compute dispatches sent to the GPU queues that have been issued, + but not yet complete + type: overlay + metrics: + - Sync Compute in Flight + - Async Compute in Flight + - name: SM Active + type: overlay + metrics: + - SM Active + - name: SM Instructions + type: overlay + metrics: + - SM Issue + - Tensor Active + - name: SM Warp Occupancy + type: stacked + displayHeightScale: 3.0 + metrics: + - Vertex/Tess/Geometry Warps in Flight + - Pixel Warps in Flight + - Compute Warps in Flight + - Unallocated Warps in Active SMs + metrics: + - name: GPC Clock Frequency + id: gpc__cycles_elapsed + description: The frequency of the GPC graphics clock. In NVIDIA GPU Specs this + is the Boost Clock and Base Clock. In nvidia-smi this is the "gr", "graphics", + "Graphics Clock". + color: '#8BDDB4' + subMetrics: + - name: MHz + suffix: .avg.per_second + multiplier: 1.0e-06 + - name: SYS Clock Frequency + id: sys__cycles_elapsed + description: The frequency of the SYS clock. The SYS clock is the clock used for + the copy engines, compute and graphics command processor, and the hardware performance + monitor streaming unit. + color: '#118E44' + schedulingRule: migOptional + subMetrics: + - name: MHz + suffix: .avg.per_second + multiplier: 1.0e-06 + - name: GR Active + id: FE_A.TriageSCG.gr__cycles_active + description: Number of cycles the graphics/compute engine is active. The graphics + and compute engine are active if there is any work in the graphics pipe or if + the compute pipe is processing a dispatch. + color: '#ED6A32' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Sync Compute in Flight + id: FE_A.TriageSCG.gr__compute_cycles_active_queue_sync + color: '#FE7F9C' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Async Compute in Flight + id: FE_A.TriageSCG.gr__compute_cycles_active_queue_async + color: '#FFD179' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: SM Active + id: sm__cycles_active + description: Total number of cycles the SM is active (at least 1 active warp) + color: '#FFA5A5' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: SM Issue + id: sm__inst_executed_realtime + description: SM instruction issue rate. Each SM can issue 4 instructions/cycle + (1 instruction/SMSP/cycle). + color: '#98C4DD' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Tensor Active + id: sm__pipe_tensor_cycles_active_realtime + description: Cycles the tensor pipe is active + color: '#B3FF70' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Vertex/Tess/Geometry Warps in Flight + id: tpc__warps_active_shader_vtg_realtime + description: Total number of graphics vertex, tesselation, geometry, and mesh + shader warps in flight + color: '#FFA5A5' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Pixel Warps in Flight + id: tpc__warps_active_shader_ps_realtime + description: Total number of pixel shader warps in flight + color: '#8BDDB4' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Compute Warps in Flight + id: tpc__warps_active_shader_cs_realtime + description: Total number of compute shader warps in flight + color: '#FFD179' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Unallocated Warps in Active SMs + id: tpc__warps_inactive_sm_active_realtime + description: Total number of warp slots available on active SMs + color: '#696969' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/ga10x-gfxact.config b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/ga10x-gfxact.config new file mode 100644 index 0000000000000000000000000000000000000000..df9c86d4aa87174d171ccdf0f30dbd9cbd911d81 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/ga10x-gfxact.config @@ -0,0 +1,746 @@ +# NOTE: Metrics representing a superset of other metrics must be declared first +# if they appear in the same group (displayRows). Otherwise different metrics will +# dominate in the group row depending on zoom level if overlay display mode is used. +version: 3 +metricSets: +- alias: ga10x-gfxact + name: Graphics Async Compute Triage Metrics for NVIDIA GA10x (frequency >= 10kHz) + chips: [GA102, GA103, GA104, GA106, GA107] + counterWidth: narrow + displayRows: + - name: + type: overlay + displayHeightScale: 0.5 + metrics: + - GPU Active + - Async Copy Engine Active + - Sync Copy Engine Active + - GR Active + - name: + type: overlay + displayHeightScale: -0.5 + metrics: + - GPU Memory Read Bandwidth + - GPU Memory Write Bandwidth + - PCIe Read Bandwidth + - PCIe Write Bandwidth + - name: GPU Active + description: The graphics or copy engine is active + type: overlay + metrics: + - GPU Active + - Sync Copy Engine Active + - Async Copy Engine Active + - GR Active + - name: Unit Throughputs + description: Throughput of each major hardware unit + type: overlay + displayHeightScale: 2.0 + metrics: + - SM Throughput + - L1 Throughput + - RTCORE Throughput + - VAF Throughput + - L2 Throughput + - VRAM Throughput + - PCIe Throughput + - PD Throughput + - PES+VPC Throughput + - RASTER Throughput + - PROP Throughput + - ZROP Throughput + - CROP Throughput + - name: Compute in Flight + description: Compute dispatches sent to the GPU queues that have been issued, + but not yet complete + type: overlay + metrics: + - Sync Compute in Flight + - Async Compute in Flight + - name: Draw/Dispatch Start + description: Draw and dispatch start times + type: overlay + metrics: + - Draw Started + - Dispatch Started + - name: SM Occupancy (TPC View) + type: stacked + metrics: + - Vertex/Tess/Geometry Warps + - Pixel Warps + - Compute Warps + - Active SM Unused Warp Slots + - Idle SM Unused Warp Slots + - name: FE Stalls + description: FE stalls waiting for commands to complete + type: overlay + metrics: + - FE Stalled Sync + - FE Stalled Async + - name: FE Pipeline Stalling Commands + description: FE commands that require parts of the pipeline to stall + type: overlay + metrics: + - Go Idle Sync + - Subchannel Switch Sync + - Go Idle Async + - Subchannel Switch Async + - Pixel Shader Barriers + - name: SM Register Usage (Occupancy Limiter) + description: 'Average # of registers allocated each cycle per SM' + type: stacked + metrics: + - 3D Register Allocation + - CS Register Allocation (Sync) + - CS Register Allocation (Async) + - name: SM Shared Memory Usage (Occupancy Limiter) + description: 'Average # of shared memory bytes allocated each cycle' + type: stacked + metrics: + - Shared Memory Allocated (Sync) + - Shared Memory Allocated (Async) + - name: Active Thread Groups in SM (Occupancy Limiter) + description: 'Average # of active threads per SM each cycle' + type: stacked + metrics: + - Active Thread Groups in SM Total + - Active Thread Groups in SM (sync) + - Active Thread Groups in SM (async) + - name: SM Instruction Throughputs + description: SM instruction throughput breakdown by pipe + type: overlay + metrics: + - SM Executed Instructions + - SM ALU Pipe Throughput + - SM FMA Light Pipe Throughput + - SM FMA Heavy Pipe Throughput + - SM SFU Pipe Throughput + - name: L1 Throughputs + description: L1 cache throughputs breakdown by stage + type: overlay + metrics: + - L1 LSU Data-Stage Throughput + - L1 Texture Data-Stage Throughput + - L1 LSU Writeback-Stage Throughput + - L1 Texture Writeback-Stage Throughput + - L1 Texture Filter-Stage Throughput + - name: L1 LSU Throughputs + description: L1 cache LSU throughputs breakdown by memory space + type: overlay + metrics: + - L1 Local+Global Data-Stage Throughput + - L1 Shared+Attribute Data-Stage Throughput + - L1 Surface Data-Stage Throughput + - name: L1 Hit Rate + description: L1 cache hit rate for all operations + type: overlay + metrics: + - L1 Hit Rate + - name: TEX Stalled on Descriptor Cache Miss + description: Cycles where the texture pipe input stage was stalled on a TSL1 miss, + waiting for L1.5 + type: overlay + metrics: + - TEX Stalled on Descriptor Cache Miss + - name: L2 Bandwidth (Source) + description: L2 cache bandwidth breakdown by source unit + type: stacked + metrics: + - L2 Bandwidth from L1 + - L2 Bandwidth from GCC + - L2 Bandwidth from PE + - L2 Bandwidth from CROP + - L2 Bandwidth from ZROP + - L2 Bandwidth from Raster + - L2 Bandwidth from FBP + - L2 Bandwidth from HUB + - name: L2 Bandwidth (Destination) + description: L2 cache bandwidth breakdown by destination unit + type: stacked + metrics: + - L2 Bandwidth to VRAM + - L2 Bandwidth to PCIe+Peer + - name: L2 Hit Rates + description: L2 cache hit rates in aggregate and for read operations from L1 + type: overlay + metrics: + - L2 Hit Rate + - L2 Hit Rate from L1 + - name: GPU Memory Bandwidth + description: GPU memory read/write bandwidth + type: stacked + metrics: + - GPU Memory Read Bandwidth + - GPU Memory Write Bandwidth + - name: PCIe Bandwidth + description: PCIe read/write bandwidth + type: overlay + metrics: + - PCIe Read Bandwidth + - PCIe Write Bandwidth + - name: PCIe to BAR Requests + description: PCIe to BAR 0/1/2 read/write requests + type: overlay + metrics: + - PCIe Read Requests to BAR1 + - PCIe Write Requests to BAR1 + - PCIe Read Requests to BAR0 + - PCIe Write Requests to BAR0 + - PCIe Read Requests to BAR2 + - PCIe Write Requests to BAR2 + - name: ZCULL + description: Total/Rejected number of samples sent to ZCULL + type: overlay + metrics: + - ZCULL Rejected Samples + - ZCULL Input Samples + metrics: + - name: GPU Active + id: HOST.TriageAC.gpu__engine_cycles_active_gr_or_ce + color: '#33B2B2' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Sync Copy Engine Active + id: HOST.TriageAC.gpu__engine_cycles_active_any_syncce + color: '#B2B233' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Async Copy Engine Active + id: HOST.TriageAC.gpu__engine_cycles_active_any_asyncce + color: '#FFA700' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: GR Active + id: FE_A.TriageAC.gr__cycles_active + color: '#FFFF00' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: SM Throughput + id: TriageAC.sm__throughput + color: '#D100EE' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 Throughput + id: SM_A.TriageAC.l1tex__throughput + color: '#FFC425' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: RTCORE Throughput + id: rtcore__cycles_executed + color: '#D18841' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: VAF Throughput + id: TPC.TriageAC.vaf__throughput + color: '#D13341' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Throughput + id: LTS.TriageAC.lts__throughput + color: '#00AEDB' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: VRAM Throughput + id: FBSP.TriageAC.dramc__throughput + color: '#F37735' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PCIe Throughput + id: PCI.TriageAC.pcie__throughput + color: '#3577F3' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PD Throughput + id: HUB_B.TriageAC.pda__throughput + color: '#00B159' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PES+VPC Throughput + id: GPC_B.TriageAC.pes__throughput + color: '#3FB159' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: RASTER Throughput + id: GPC_A.TriageAC.raster__throughput + color: '#6FB159' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PROP Throughput + id: GPC_A.TriageAC.prop__throughput + color: '#9FB159' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: ZROP Throughput + id: ROP.TriageAC.zrop__throughput + color: '#854442' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: CROP Throughput + id: ROP.TriageAC.crop__throughput + color: '#AFB159' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Sync Compute in Flight + id: FE_A.TriageAC.gr__compute_cycles_active_queue_sync + color: '#FE7F9C' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Async Compute in Flight + id: FE_A.TriageAC.gr__compute_cycles_active_queue_async + color: '#EEAA11' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Draw Started + id: FE_A.TriageAC.fe__draw_count + description: Number of draw calls started + color: '#F0F000' + subMetrics: + - name: Workloads + suffix: .sum + - name: Dispatch Started + id: FE_A.TriageAC.gr__dispatch_count + description: Number of compute dispatches/grid launches started + color: '#00F0F0' + subMetrics: + - name: Workloads + suffix: .sum + - name: Vertex/Tess/Geometry Warps + id: SM_B.TriageAC.tpc__warps_active_shader_vtg_realtime + color: '#0057E7' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Pixel Warps + id: TPC.TriageAC.tpc__warps_active_shader_ps_realtime + color: '#008744' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Compute Warps + id: TPC.TriageAC.tpc__warps_active_shader_cs_realtime + color: '#FFA700' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Active SM Unused Warp Slots + id: TriageAC.tpc__warps_inactive_sm_active_realtime + color: '#696969' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Idle SM Unused Warp Slots + id: TriageAC.tpc__warps_inactive_sm_idle_realtime + color: '#C0C0C0' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: FE Stalled Sync + id: FE_A.TriageAC.fe__cycles_stalled_cmd_wfi_queue_sync + color: '#AA1111' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: FE Stalled Async + id: FE_A.TriageAC.fe__cycles_stalled_cmd_wfi_queue_async + color: '#11AA11' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Go Idle Sync + id: FE_B.TriageAC.fe__output_ops_cmd_go_idle_queue_sync + color: '#11AA11' + subMetrics: + - name: Commands + suffix: .sum + - name: Subchannel Switch Sync + id: FE_B.TriageAC.fe__output_ops_cmd_subchsw_queue_sync + color: '#AA11AA' + subMetrics: + - name: Commands + suffix: .sum + - name: Go Idle Async + id: FE_B.TriageAC.fe__output_ops_cmd_go_idle_queue_async + color: '#AA1111' + subMetrics: + - name: Commands + suffix: .sum + - name: Subchannel Switch Async + id: FE_B.TriageAC.fe__output_ops_cmd_subchsw_queue_async + color: '#1111AA' + subMetrics: + - name: Commands + suffix: .sum + - name: Pixel Shader Barriers + id: FE_A.TriageAC.fe__pixel_shader_barriers + color: '#11AAAA' + subMetrics: + - name: Commands + suffix: .sum + - name: 3D Register Allocation + id: TPC.TriageAC.tpc__sm_rf_registers_allocated_shader_3d_realtime + color: '#008744' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg Registers per SM + suffix: .avg.per_cycle_elapsed + multiplier: 0.5 + - name: CS Register Allocation (Sync) + id: TPC.TriageAC.tpc__sm_rf_registers_allocated_shader_cs_queue_sync_realtime + color: '#FFA700' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg Registers per SM + suffix: .avg.per_cycle_elapsed + multiplier: 0.5 + - name: CS Register Allocation (Async) + id: TPC.TriageAC.tpc__sm_rf_registers_allocated_shader_cs_queue_async_realtime + color: '#FFC720' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg Registers per SM + suffix: .avg.per_cycle_elapsed + multiplier: 0.5 + - name: Shared Memory Allocated (Sync) + id: TPC.TriageAC.tpc__l1tex_mem_shared_data_compute_bytes_allocated_queue_sync_realtime + color: '#B2B233' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg Bytes + suffix: .avg.per_cycle_elapsed + - name: Shared Memory Allocated (Async) + id: TPC.TriageAC.tpc__l1tex_mem_shared_data_compute_bytes_allocated_queue_async_realtime + color: '#B233B2' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg Bytes + suffix: .avg.per_cycle_elapsed + - name: Active Thread Groups in SM Total + id: SM_B.TriageAC.tpc__ctas_active + color: '#B23333' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg CTAs per SM + suffix: .avg.per_cycle_elapsed + - name: Active Thread Groups in SM (sync) + id: TriageAC.tpc__ctas_active_queue_sync_realtime + color: '#33B233' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg CTAs per SM + suffix: .avg.per_cycle_elapsed + - name: Active Thread Groups in SM (async) + id: TPC.TriageAC.tpc__ctas_active_queue_async_realtime + color: '#3333B2' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg CTAs per SM + suffix: .avg.per_cycle_elapsed + - name: SM Executed Instructions + id: SM_A.TriageAC.sm__inst_executed_realtime + color: '#CFCF3F' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Instructions + suffix: .sum + - name: Avg Inst/Clk per SM + suffix: .avg.per_cycle_elapsed + - name: Peak Inst/Clk per SM + suffix: .avg.peak_sustained + - name: SM ALU Pipe Throughput + id: SM_A.TriageAC.sm__inst_executed_pipe_alu_realtime + color: '#FF6F00' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Instructions + suffix: .sum + - name: Avg Inst/Clk per SM + suffix: .avg.per_cycle_elapsed + - name: Peak Inst/Clk per SM + suffix: .avg.peak_sustained + - name: SM FMA Light Pipe Throughput + id: SM_C.TriageAC.smsp__inst_executed_pipe_fmalite + color: '#00CF00' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Instructions + suffix: .sum + - name: Avg Inst/Clk per SM + suffix: .avg.per_cycle_elapsed + - name: Peak Inst/Clk per SM + suffix: .avg.peak_sustained + - name: SM FMA Heavy Pipe Throughput + id: SM_C.TriageAC.smsp__inst_executed_pipe_fmaheavy + color: '#CF003F' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Instructions + suffix: .sum + - name: Avg Inst/Clk per SM + suffix: .avg.per_cycle_elapsed + - name: Peak Inst/Clk per SM + suffix: .avg.peak_sustained + - name: SM SFU Pipe Throughput + id: SM_C.TriageAC.smsp__inst_executed_pipe_xu + color: '#00003F' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Instructions + suffix: .sum + - name: Avg Inst/Clk per SM + suffix: .avg.per_cycle_elapsed + - name: Peak Inst/Clk per SM + suffix: .avg.peak_sustained + - name: L1 LSU Data-Stage Throughput + id: SM_A.TriageAC.l1tex__data_pipe_lsu_wavefronts + color: '#CFCF3F' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 Texture Data-Stage Throughput + id: SM_A.TriageAC.l1tex__data_pipe_tex_wavefronts + color: '#00003F' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 LSU Writeback-Stage Throughput + id: SM_A.TriageAC.l1tex__lsu_writeback_active + color: '#CF003F' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 Texture Writeback-Stage Throughput + id: SM_A.TriageAC.l1tex__tex_writeback_active + color: '#33B2B2' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 Texture Filter-Stage Throughput + id: SM_A.TriageAC.l1tex__f_wavefronts_realtime + color: '#3F00CF' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 Local+Global Data-Stage Throughput + id: SM_A.TriageAC.l1tex__data_pipe_lsu_wavefronts_mem_lg + color: '#FF6F00' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 Shared+Attribute Data-Stage Throughput + id: SM_A.TriageAC.l1tex__data_pipe_lsu_wavefronts_mem_shared_realtime + color: '#00CF00' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 Surface Data-Stage Throughput + id: SM_A.TriageAC.l1tex__data_pipe_lsu_wavefronts_mem_surface_realtime + color: '#FFCA18' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 Hit Rate + id: SM_B.TriageAC.l1tex__t_sector_hit_rate + color: '#551DCC' + subMetrics: + - name: Ratio % + suffix: .pct + - name: TEX Stalled on Descriptor Cache Miss + id: SM_A.TriageAC.l1tex__texin_cycles_stalled_on_tsl1_miss + color: '#CF3F3F' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth from L1 + id: LTS.TriageAC.lts__t_sector_throughput_srcunit_tex + color: '#11AA11' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth from GCC + id: LTS.TriageAC.lts__t_sector_throughput_srcunit_gcc + color: '#11AAAA' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth from PE + id: LTS.TriageAC.lts__t_sector_throughput_srcunit_pe + color: '#AAAA11' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth from CROP + id: ROP.TriageAC.lts__t_sector_throughput_srcunit_crop + color: '#AA1111' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth from ZROP + id: ROP.TriageAC.lts__t_sector_throughput_srcunit_zrop + color: '#1111AA' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth from Raster + id: TriageAC.lts__t_sector_throughput_srcunit_raster + color: '#AA11AA' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth from FBP + id: LTS.TriageAC.lts__t_sector_throughput_srcnode_fbp + color: '#111111' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth from HUB + id: LTS.TriageAC.lts__t_sector_throughput_srcnode_hub + color: '#AAAAAA' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth to VRAM + id: LTS.TriageAC.lts__t_sector_throughput_aperture_device + color: '#AA1111' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth to PCIe+Peer + id: LTS.TriageAC.lts__t_sector_throughput_aperture_other + color: '#11AA11' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Hit Rate + id: LTS.TriageAC.lts__average_t_sector_hit_rate_realtime + color: '#88001B' + subMetrics: + - name: Ratio % + suffix: .pct + - name: L2 Hit Rate from L1 + id: LTS.TriageAC.lts__average_t_sector_hit_rate_srcunit_tex_realtime + color: '#FFCA18' + subMetrics: + - name: Ratio % + suffix: .pct + - name: GPU Memory Read Bandwidth + id: FBSP.TriageAC.dramc__read_throughput + color: '#CCCC00' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: GPU Memory Write Bandwidth + id: FBSP.TriageAC.dramc__write_throughput + color: '#CC00CC' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PCIe Read Bandwidth + id: PCI.TriageAC.pcie__read_bytes + color: '#FF3D00' + schedulingRule: migOptional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Bytes + suffix: .sum + - name: GB/s + suffix: .sum.per_second + multiplier: 1.0e-09 + - name: PCIe Write Bandwidth + id: PCI.TriageAC.pcie__write_bytes + color: '#00CFCF' + schedulingRule: migOptional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Bytes + suffix: .sum + - name: GB/s + suffix: .sum.per_second + multiplier: 1.0e-09 + - name: PCIe Read Requests to BAR1 + id: pcie__rx_requests_aperture_bar1_op_read + description: CPU+Peer Reads from VRAM over PCIe + color: '#87FFFF' + subMetrics: + - name: Requests + suffix: .sum + - name: PCIe Write Requests to BAR1 + id: pcie__rx_requests_aperture_bar1_op_write + description: CPU+Peer Writes to VRAM over PCIe + color: '#8700FF' + subMetrics: + - name: Requests + suffix: .sum + - name: PCIe Read Requests to BAR0 + id: pcie__rx_requests_aperture_bar0_op_read + color: '#AFFF87' + subMetrics: + - name: Requests + suffix: .sum + - name: PCIe Write Requests to BAR0 + id: pcie__rx_requests_aperture_bar0_op_write + color: '#870087' + subMetrics: + - name: Requests + suffix: .sum + - name: PCIe Read Requests to BAR2 + id: pcie__rx_requests_aperture_bar2_op_read + color: '#AFAF00' + subMetrics: + - name: Requests + suffix: .sum + - name: PCIe Write Requests to BAR2 + id: pcie__rx_requests_aperture_bar2_op_write + color: '#870000' + subMetrics: + - name: Requests + suffix: .sum + - name: ZCULL Rejected Samples + id: GPC_A.TriageSCG.raster__zcull_input_samples_op_rejected_realtime + color: '#663399' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Sum + suffix: .sum + - name: ZCULL Input Samples + id: GPC_A.TriageSCG.raster__zcull_input_samples_realtime + color: '#CC3399' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Sum + suffix: .sum diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/ga10x-gfxt.config b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/ga10x-gfxt.config new file mode 100644 index 0000000000000000000000000000000000000000..914ba1e9ed8ee183da57953796e980dfbe4d751a --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/ga10x-gfxt.config @@ -0,0 +1,771 @@ +# NOTE: Metrics representing a superset of other metrics must be declared first +# if they appear in the same group (displayRows). Otherwise different metrics will +# dominate in the group row depending on zoom level if overlay display mode is used. +version: 3 +metricSets: +- alias: ga10x-gfxt + name: Graphics Throughput Metrics for NVIDIA GA10x (frequency >= 10kHz) + chips: [GA102, GA103, GA104, GA106, GA107] + counterWidth: narrow + displayRows: + - name: + type: overlay + displayHeightScale: 0.5 + metrics: + - GPU Active + - Async Copy Engine Active + - Sync Copy Engine Active + - GR Active + - name: + type: overlay + displayHeightScale: -0.5 + metrics: + - GPU Memory Read Bandwidth + - GPU Memory Write Bandwidth + - PCIe Read Bandwidth + - PCIe Write Bandwidth + - name: GPU Active + description: Activity of the graphics and copy engines + type: overlay + metrics: + - GPU Active + - Sync Copy Engine Active + - Async Copy Engine Active + - GR Active + - name: Unit Throughputs + description: Throughput of each major hardware unit + type: overlay + displayHeightScale: 2.0 + metrics: + - SM Throughput + - RTCORE Throughput + - VAF Throughput + - L1 Throughput + - L2 Throughput + - VRAM Throughput + - PCIe Throughput + - PD Throughput + - PES+VPC Throughput + - RASTER Throughput + - PROP Throughput + - ZROP Throughput + - CROP Throughput + - name: Compute in Flight + description: Compute dispatches sent to the GPU queues that have been issued, + but not yet complete + type: overlay + metrics: + - Sync Compute in Flight + - Async Compute in Flight + - name: Draw/Dispatch Start + description: Draw and dispatch start times + type: overlay + metrics: + - Draw Started + - Dispatch Started + - name: SM Occupancy (TPC View) + type: stacked + displayHeightScale: 2.0 + metrics: + - Vertex/Tess/Geometry Warps + - Pixel Warps + - Compute Warps + - Unallocated Warps in Active SMs + - Idle SM Unused Warp Slots + - name: Active Threads Per Warp + description: Use this row to observe the fraction of active thread lanes per warp-level + instruction + type: overlay + metrics: + - Active Threads Per Warp + - name: FE Stalls + description: FE stalls waiting for commands to complete + type: overlay + metrics: + - FE Stalled Sync + - FE Stalled Async + - name: FE Pipeline Stalling Commands + description: FE commands that require parts of the pipeline to stall + type: overlay + metrics: + - Go Idle Sync + - Subchannel Switch Sync + - Go Idle Async + - Subchannel Switch Async + - Pixel Shader Barriers + - name: SM Register Usage (Occupancy Limiter) + description: 'Average # of registers allocated each cycle per SM' + type: stacked + metrics: + - 3D Register Allocation + - CS Register Allocation + - name: SM Shared+ISBE Memory Usage (Occupancy Limiter) + description: 'Average # of shared and ISBE memory bytes allocated each cycle' + type: stacked + metrics: + - CS Shared Memory Allocated (Sync) + - CS Shared Memory Allocated (Async) + - VTG ISBE Memory Allocated + - name: SM TRAM Memory Usage (Occupancy Limiter) + description: 'Average # of TRAM memory bytes allocated each cycle' + type: stacked + metrics: + - PS TRAM Memory Allocated + - name: Active Thread Groups in SM (Occupancy Limiter) + description: 'Average # of active threads per SM each cycle' + type: stacked + metrics: + - Active Thread Groups in SM + - name: SM Instruction Throughputs + description: SM instruction throughput breakdown by pipe + type: overlay + metrics: + - SM Issue Active + - SM ALU Pipe Throughput + - SM FMA Light Pipe Throughput + - SM FMA Heavy Pipe Throughput + - SM SFU Pipe Throughput + - name: L1 Throughputs + description: L1 cache throughputs breakdown by stage + type: overlay + metrics: + - L1 LSU Data-Stage Throughput + - L1 Texture Data-Stage Throughput + - L1 LSU Writeback-Stage Throughput + - L1 Texture Writeback-Stage Throughput + - L1 Texture Filter-Stage Throughput + - name: L1 LSU Throughputs + description: L1 cache LSU throughputs breakdown by memory space + type: overlay + metrics: + - L1 Local+Global Data-Stage Throughput + - L1 Shared+Attribute Data-Stage Throughput + - L1 Surface Data-Stage Throughput + - name: L1 Hit Rate + description: L1 cache hit rate for all operations + type: overlay + metrics: + - L1 Hit Rate + - name: L2 Bandwidth (Source) + description: L2 cache bandwidth breakdown by source unit + type: stacked + metrics: + - L2 Bandwidth from L1 + - L2 Bandwidth from GCC + - L2 Bandwidth from PE + - L2 Bandwidth from CROP + - L2 Bandwidth from ZROP + - L2 Bandwidth from Raster + - L2 Bandwidth from FBP + - L2 Bandwidth from HUB + - name: L2 Bandwidth (Destination) + description: L2 cache bandwidth breakdown by destination unit + type: stacked + metrics: + - L2 Bandwidth to VRAM + - L2 Bandwidth to PCIe+Peer + - name: L2 Hit Rates + description: L2 cache hit rates in aggregate and for read operations from L1 + type: overlay + metrics: + - L2 Hit Rate + - L2 Hit Rate from L1 + - name: GPU Memory Bandwidth + description: GPU memory read/write bandwidth + type: stacked + metrics: + - GPU Memory Read Bandwidth + - GPU Memory Write Bandwidth + - name: PCIe Bandwidth + description: PCIe read/write bandwidth + type: overlay + metrics: + - PCIe Read Bandwidth + - PCIe Write Bandwidth + - name: PCIe to BAR Requests + description: PCIe to BAR 0/1/2 read/write requests + type: overlay + metrics: + - PCIe Read Requests to BAR1 + - PCIe Write Requests to BAR1 + - PCIe Read Requests to BAR0 + - PCIe Write Requests to BAR0 + - PCIe Read Requests to BAR2 + - PCIe Write Requests to BAR2 + - name: ZCULL + description: Total/Rejected number of samples sent to ZCULL + type: overlay + metrics: + - ZCULL Rejected Samples + - ZCULL Input Samples + metrics: + - name: GPU Active + id: HOST.TriageSCG.gpu__engine_cycles_active_gr_or_ce + color: '#33B2B2' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Sync Copy Engine Active + id: HOST.TriageSCG.gpu__engine_cycles_active_any_syncce + color: '#B2B233' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Async Copy Engine Active + id: HOST.TriageSCG.gpu__engine_cycles_active_any_asyncce + color: '#FFA700' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: GR Active + id: FE_A.TriageSCG.gr__cycles_active + description: Number of cycles the graphics/compute engine is active. The graphics + and compute engine are active if there is any work in the graphics pipe or if + the compute pipe is processing a dispatch. + color: '#ED6A32' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: SM Throughput + id: TriageSCG.sm__throughput + color: '#D100EE' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: RTCORE Throughput + id: rtcore__cycles_executed + color: '#D18841' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: VAF Throughput + id: TPC.TriageSCG.vaf__throughput + color: '#D13341' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 Throughput + id: SM_A.TriageSCG.l1tex__throughput + color: '#FFC425' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Throughput + id: LTS.TriageSCG.lts__throughput + color: '#00AEDB' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: VRAM Throughput + id: FBSP.TriageSCG.dramc__throughput + color: '#F37735' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PCIe Throughput + id: PCI.TriageSCG.pcie__throughput + color: '#3577F3' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PD Throughput + id: HUB_B.TriageSCG.pda__throughput + color: '#00B159' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PES+VPC Throughput + id: GPC_B.TriageSCG.pes__throughput + color: '#3FB159' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: RASTER Throughput + id: GPC_A.TriageSCG.raster__throughput + color: '#6FB159' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PROP Throughput + id: GPC_A.TriageSCG.prop__throughput + color: '#9FB159' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: ZROP Throughput + id: ROP.TriageSCG.zrop__throughput + color: '#854442' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: CROP Throughput + id: ROP.TriageSCG.crop__throughput + color: '#AFB159' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Sync Compute in Flight + id: FE_A.TriageSCG.gr__compute_cycles_active_queue_sync + color: '#FE7F9C' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Async Compute in Flight + id: FE_A.TriageSCG.gr__compute_cycles_active_queue_async + color: '#FFD179' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Draw Started + id: FE_A.TriageSCG.fe__draw_count + description: Number of draw calls started + color: '#F0F000' + subMetrics: + - name: Workloads + suffix: .sum + - name: Dispatch Started + id: FE_A.TriageSCG.gr__dispatch_count + description: Number of compute dispatches/grid launches started + color: '#00F0F0' + subMetrics: + - name: Workloads + suffix: .sum + - name: Vertex/Tess/Geometry Warps + id: SM_B.TriageSCG.tpc__warps_active_shader_vtg_realtime + color: '#0057E7' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Pixel Warps + id: TPC.TriageSCG.tpc__warps_active_shader_ps_realtime + color: '#008744' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Compute Warps + id: TPC.TriageSCG.tpc__warps_active_shader_cs_realtime + color: '#FFA700' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Unallocated Warps in Active SMs + id: TriageSCG.tpc__warps_inactive_sm_active_realtime + color: '#696969' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Idle SM Unused Warp Slots + id: TriageSCG.tpc__warps_inactive_sm_idle_realtime + color: '#C0C0C0' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Active Threads Per Warp + id: smsp__thread_inst_executed_pred_on_per_inst_executed + color: green + schedulingTarget: smpc + subMetrics: + - name: Threads/Warp + suffix: .ratio + - name: Coherence + suffix: .pct + - name: FE Stalled Sync + id: FE_A.TriageSCG.fe__cycles_stalled_cmd_wfi_queue_sync + color: '#AA1111' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: FE Stalled Async + id: FE_A.TriageSCG.fe__cycles_stalled_cmd_wfi_queue_async + color: '#11AA11' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Go Idle Sync + id: FE_B.TriageSCG.fe__output_ops_cmd_go_idle_queue_sync + color: '#11AA11' + subMetrics: + - name: Commands + suffix: .sum + - name: Subchannel Switch Sync + id: FE_B.TriageSCG.fe__output_ops_cmd_subchsw_queue_sync + color: '#AA11AA' + subMetrics: + - name: Commands + suffix: .sum + - name: Go Idle Async + id: FE_B.TriageSCG.fe__output_ops_cmd_go_idle_queue_async + color: '#AA1111' + subMetrics: + - name: Commands + suffix: .sum + - name: Subchannel Switch Async + id: FE_B.TriageSCG.fe__output_ops_cmd_subchsw_queue_async + color: '#1111AA' + subMetrics: + - name: Commands + suffix: .sum + - name: Pixel Shader Barriers + id: FE_A.TriageSCG.fe__pixel_shader_barriers + color: '#11AAAA' + subMetrics: + - name: Commands + suffix: .sum + - name: 3D Register Allocation + id: TPC.TriageSCG.tpc__sm_rf_registers_allocated_shader_3d_realtime + color: '#008744' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg Registers per SM + suffix: .avg.per_cycle_elapsed + multiplier: 0.5 + - name: CS Register Allocation + id: TPC.TriageSCG.tpc__sm_rf_registers_allocated_shader_cs_realtime + color: '#FFA700' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg Registers per SM + suffix: .avg.per_cycle_elapsed + multiplier: 0.5 + - name: CS Shared Memory Allocated (Sync) + id: TPC.TriageSCG.tpc__l1tex_mem_shared_data_compute_bytes_allocated_queue_sync_realtime + color: '#B2B233' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg Bytes + suffix: .avg.per_cycle_elapsed + - name: CS Shared Memory Allocated (Async) + id: TPC.TriageSCG.tpc__l1tex_mem_shared_data_compute_bytes_allocated_queue_async_realtime + color: '#B233B2' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg Bytes + suffix: .avg.per_cycle_elapsed + - name: VTG ISBE Memory Allocated + id: TPC.TriageSCG.tpc__l1tex_mem_shared_data_isbe_bytes_allocated_realtime + color: '#33B2B2' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg Bytes + suffix: .avg.per_cycle_elapsed + - name: PS TRAM Memory Allocated + id: TPC.TriageSCG.tpc__l1tex_mem_shared_data_tram_bytes_allocated_realtime + color: '#33B233' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg Bytes + suffix: .avg.per_cycle_elapsed + - name: Active Thread Groups in SM + id: SM_B.TriageSCG.sm__ctas_active + color: '#B23333' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg CTAs per SM + suffix: .avg.per_cycle_elapsed + - name: SM Issue Active + id: SM_A.TriageSCG.sm__inst_executed_realtime + description: SM instruction issue rate. Each SM can issue 4 instructions/cycle + (1 instruction/SMSP/cycle). + color: '#CFCF3F' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Instructions + suffix: .sum + - name: Avg Inst/Clk per SM + suffix: .avg.per_cycle_elapsed + - name: Peak Inst/Clk per SM + suffix: .avg.peak_sustained + - name: SM ALU Pipe Throughput + id: SM_A.TriageSCG.sm__inst_executed_pipe_alu_realtime + color: '#FF6F00' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Instructions + suffix: .sum + - name: Avg Inst/Clk per SM + suffix: .avg.per_cycle_elapsed + - name: Peak Inst/Clk per SM + suffix: .avg.peak_sustained + - name: SM FMA Light Pipe Throughput + id: SM_C.TriageSCG.smsp__inst_executed_pipe_fmalite + color: '#00CF00' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Instructions + suffix: .sum + - name: Avg Inst/Clk per SM + suffix: .avg.per_cycle_elapsed + - name: Peak Inst/Clk per SM + suffix: .avg.peak_sustained + - name: SM FMA Heavy Pipe Throughput + id: SM_C.TriageSCG.smsp__inst_executed_pipe_fmaheavy + color: '#CF003F' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Instructions + suffix: .sum + - name: Avg Inst/Clk per SM + suffix: .avg.per_cycle_elapsed + - name: Peak Inst/Clk per SM + suffix: .avg.peak_sustained + - name: SM SFU Pipe Throughput + id: SM_A.TriageSCG.sm__inst_executed_pipe_xu_realtime + color: '#00003F' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Instructions + suffix: .sum + - name: Avg Inst/Clk per SM + suffix: .avg.per_cycle_elapsed + - name: Peak Inst/Clk per SM + suffix: .avg.peak_sustained + - name: L1 LSU Data-Stage Throughput + id: SM_A.TriageSCG.l1tex__data_pipe_lsu_wavefronts + color: '#CFCF3F' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 Texture Data-Stage Throughput + id: SM_A.TriageSCG.l1tex__data_pipe_tex_wavefronts + color: '#00003F' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 LSU Writeback-Stage Throughput + id: SM_A.TriageSCG.l1tex__lsu_writeback_active + color: '#CF003F' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 Texture Writeback-Stage Throughput + id: SM_A.TriageSCG.l1tex__tex_writeback_active + color: '#33B2B2' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 Texture Filter-Stage Throughput + id: SM_A.TriageSCG.l1tex__f_wavefronts_realtime + color: '#3F00CF' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 Local+Global Data-Stage Throughput + id: SM_A.TriageSCG.l1tex__data_pipe_lsu_wavefronts_mem_lg + color: '#FF6F00' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 Shared+Attribute Data-Stage Throughput + id: SM_A.TriageSCG.l1tex__data_pipe_lsu_wavefronts_mem_shared_realtime + color: '#00CF00' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 Surface Data-Stage Throughput + id: SM_A.TriageSCG.l1tex__data_pipe_lsu_wavefronts_mem_surface_realtime + color: '#FFCA18' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 Hit Rate + id: SM_B.TriageSCG.l1tex__t_sector_hit_rate + color: '#551DCC' + subMetrics: + - name: Ratio % + suffix: .pct + - name: L2 Bandwidth from L1 + id: LTS.TriageSCG.lts__t_sector_throughput_srcunit_tex + color: '#11AA11' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth from GCC + id: LTS.TriageSCG.lts__t_sector_throughput_srcunit_gcc + color: '#11AAAA' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth from PE + id: LTS.TriageSCG.lts__t_sector_throughput_srcunit_pe + color: '#AAAA11' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth from CROP + id: ROP.TriageSCG.lts__t_sector_throughput_srcunit_crop + color: '#AA1111' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth from ZROP + id: ROP.TriageSCG.lts__t_sector_throughput_srcunit_zrop + color: '#1111AA' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth from Raster + id: TriageSCG.lts__t_sector_throughput_srcunit_raster + color: '#AA11AA' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth from FBP + id: LTS.TriageSCG.lts__t_sector_throughput_srcnode_fbp + color: '#111111' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth from HUB + id: LTS.TriageSCG.lts__t_sector_throughput_srcnode_hub + color: '#AAAAAA' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth to VRAM + id: LTS.TriageSCG.lts__t_sector_throughput_aperture_device + color: '#AA1111' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth to PCIe+Peer + id: LTS.TriageSCG.lts__t_sector_throughput_aperture_other + color: '#11AA11' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Hit Rate + id: LTS.TriageSCG.lts__average_t_sector_hit_rate_realtime + color: '#88001B' + subMetrics: + - name: Ratio % + suffix: .pct + - name: L2 Hit Rate from L1 + id: LTS.TriageSCG.lts__average_t_sector_hit_rate_srcunit_tex_realtime + color: '#FFCA18' + subMetrics: + - name: Ratio % + suffix: .pct + - name: GPU Memory Read Bandwidth + id: FBSP.TriageSCG.dramc__read_throughput + color: '#CCCC00' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: GPU Memory Write Bandwidth + id: FBSP.TriageSCG.dramc__write_throughput + color: '#CC00CC' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PCIe Read Bandwidth + id: PCI.TriageSCG.pcie__read_bytes + description: Number of bytes received by GPU (includes protocol) + color: '#FF3D00' + schedulingRule: migOptional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Bytes + suffix: .sum + - name: GB/s + suffix: .sum.per_second + multiplier: 1.0e-09 + - name: PCIe Write Bandwidth + id: PCI.TriageSCG.pcie__write_bytes + description: Number of bytes transmitted by GPU (includes protocol) + color: '#00CFCF' + schedulingRule: migOptional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Bytes + suffix: .sum + - name: GB/s + suffix: .sum.per_second + multiplier: 1.0e-09 + - name: PCIe Read Requests to BAR1 + id: pcie__rx_requests_aperture_bar1_op_read + description: CPU+Peer Reads from VRAM over PCIe + color: '#87FFFF' + subMetrics: + - name: Requests + suffix: .sum + - name: PCIe Write Requests to BAR1 + id: pcie__rx_requests_aperture_bar1_op_write + description: CPU+Peer Writes to VRAM over PCIe + color: '#8700FF' + subMetrics: + - name: Requests + suffix: .sum + - name: PCIe Read Requests to BAR0 + id: pcie__rx_requests_aperture_bar0_op_read + color: '#AFFF87' + subMetrics: + - name: Requests + suffix: .sum + - name: PCIe Write Requests to BAR0 + id: pcie__rx_requests_aperture_bar0_op_write + color: '#870087' + subMetrics: + - name: Requests + suffix: .sum + - name: PCIe Read Requests to BAR2 + id: pcie__rx_requests_aperture_bar2_op_read + color: '#AFAF00' + subMetrics: + - name: Requests + suffix: .sum + - name: PCIe Write Requests to BAR2 + id: pcie__rx_requests_aperture_bar2_op_write + color: '#870000' + subMetrics: + - name: Requests + suffix: .sum + - name: ZCULL Rejected Samples + id: GPC_A.TriageSCG.raster__zcull_input_samples_op_rejected_realtime + color: '#663399' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Sum + suffix: .sum + - name: ZCULL Input Samples + id: GPC_A.TriageSCG.raster__zcull_input_samples_realtime + color: '#CC3399' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Sum + suffix: .sum diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/ga10x.config b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/ga10x.config new file mode 100644 index 0000000000000000000000000000000000000000..e7e247ef6f2ca71400d0ec09d517be7928cb8ff5 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/ga10x.config @@ -0,0 +1,310 @@ +# NOTE: Metrics representing a superset of other metrics must be declared first +# if they appear in the same group (displayRows). Otherwise different metrics will +# dominate in the group row depending on zoom level if overlay display mode is used. +version: 3 +metricSets: +- alias: ga10x + name: General Metrics for NVIDIA GA10x (any frequency) + chips: [GA102, GA103, GA104, GA106, GA107] + counterWidth: wide + displayRows: + - name: + type: overlay + displayHeightScale: 0.5 + metrics: + - GR Active + - name: + type: overlay + displayHeightScale: -0.5 + metrics: + - NVLink RX Responses User Data + - NVLink TX Responses User Data + - PCIe RX Throughput + - PCIe TX Throughput + - name: GPC Clock Frequency + type: overlay + metrics: + - GPC Clock Frequency + - name: SYS Clock Frequency + type: overlay + metrics: + - SYS Clock Frequency + - name: GPU Active + description: The graphics or compute engine is active + type: overlay + metrics: + - GR Active + - name: Compute in Flight + description: Compute dispatches sent to the GPU queues that have been issued, + but not yet complete + type: overlay + metrics: + - Sync Compute in Flight + - Async Compute in Flight + - name: SM Active + type: overlay + metrics: + - SM Active + - name: SM Instructions + type: overlay + metrics: + - SM Issue + - Tensor Active + - name: SM Warp Occupancy + type: stacked + displayHeightScale: 3.0 + metrics: + - Vertex/Tess/Geometry Warps in Flight + - Pixel Warps in Flight + - Compute Warps in Flight + - Unallocated Warps in Active SMs + - name: DRAM Bandwidth + type: stacked + metrics: + - DRAM Read Bandwidth + - DRAM Write Bandwidth + - name: NVLink RX Bandwidth + type: stacked + metrics: + - NVLink RX Requests Protocol Data + - NVLink RX Requests User Data + - NVLink RX Responses Protocol Data + - NVLink RX Responses User Data + - name: NVLink TX Bandwidth + type: stacked + metrics: + - NVLink TX Requests Protocol Data + - NVLink TX Requests User Data + - NVLink TX Responses Protocol Data + - NVLink TX Responses User Data + - name: PCIe Bandwidth + type: overlay + metrics: + - PCIe RX Throughput + - PCIe TX Throughput + - name: PCIe Read Requests to BAR1 + metrics: + - PCIe Read Requests to BAR1 + - name: PCIe Write Requests to BAR1 + metrics: + - PCIe Write Requests to BAR1 + metrics: + - name: GPC Clock Frequency + id: gpc__cycles_elapsed + description: The frequency of the GPC graphics clock. In NVIDIA GPU Specs this + is the Boost Clock and Base Clock. In nvidia-smi this is the "gr", "graphics", + "Graphics Clock". + color: '#8BDDB4' + subMetrics: + - name: MHz + suffix: .avg.per_second + multiplier: 1.0e-06 + - name: SYS Clock Frequency + id: sys__cycles_elapsed + description: The frequency of the SYS clock. The SYS clock is the clock used for + the copy engines, compute and graphics command processor, and the hardware performance + monitor streaming unit. + color: '#118E44' + schedulingRule: migOptional + subMetrics: + - name: MHz + suffix: .avg.per_second + multiplier: 1.0e-06 + - name: GR Active + id: FE_A.TriageSCG.gr__cycles_active + description: Number of cycles the graphics/compute engine is active. The graphics + and compute engine are active if there is any work in the graphics pipe or if + the compute pipe is processing a dispatch. + color: '#ED6A32' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Sync Compute in Flight + id: FE_A.TriageSCG.gr__compute_cycles_active_queue_sync + color: '#FE7F9C' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Async Compute in Flight + id: FE_A.TriageSCG.gr__compute_cycles_active_queue_async + color: '#FFD179' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: SM Active + id: sm__cycles_active + description: Total number of cycles the SM is active (at least 1 active warp) + color: '#FFA5A5' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: SM Issue + id: sm__inst_executed_realtime + description: SM instruction issue rate. Each SM can issue 4 instructions/cycle + (1 instruction/SMSP/cycle). + color: '#98C4DD' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Tensor Active + id: sm__pipe_tensor_cycles_active_realtime + description: Cycles the tensor pipe is active + color: '#B3FF70' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Vertex/Tess/Geometry Warps in Flight + id: tpc__warps_active_shader_vtg_realtime + description: Total number of graphics vertex, tesselation, geometry, and mesh + shader warps in flight + color: '#FFA5A5' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Pixel Warps in Flight + id: tpc__warps_active_shader_ps_realtime + description: Total number of pixel shader warps in flight + color: '#8BDDB4' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Compute Warps in Flight + id: tpc__warps_active_shader_cs_realtime + description: Total number of compute shader warps in flight + color: '#FFD179' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Unallocated Warps in Active SMs + id: tpc__warps_inactive_sm_active_realtime + description: Total number of warp slots available on active SMs + color: '#696969' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: DRAM Read Bandwidth + id: dram__read_throughput + description: The ratio of cycles the DRAM interface was active reading data to + the elapsed cycles in the same period as a percentage + color: '#FFA5A5' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: DRAM Write Bandwidth + id: dram__write_throughput + description: The ratio of cycles the DRAM interface was active writing data to + the elapsed cycles in the same period as a percentage + color: '#98C4DD' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink RX Requests Protocol Data + id: nvlrx__bytes_packet_request_data_protocol + description: Number of bytes of NVLRX request protocol data + color: '#C79536' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink RX Requests User Data + id: nvlrx__bytes_packet_request_data_user + description: Number of bytes of NVLRX request user data + color: '#FFD179' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink RX Responses Protocol Data + id: nvlrx__bytes_packet_response_data_protocol + description: Number of bytes of NVLRX response protocol data + color: '#C25D5D' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink RX Responses User Data + id: nvlrx__bytes_packet_response_data_user + description: Number of bytes of NVLRX response user data + color: '#FFA5A5' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink TX Requests Protocol Data + id: nvltx__bytes_packet_request_data_protocol + description: Number of bytes of NVLTX request protocol data + color: '#9052BF' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink TX Requests User Data + id: nvltx__bytes_packet_request_data_user + description: Number of bytes of NVLTX request user data + color: '#D6A4FC' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink TX Responses Protocol Data + id: nvltx__bytes_packet_response_data_protocol + description: Number of bytes of NVLTX response protocol data + color: '#6999B5' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink TX Responses User Data + id: nvltx__bytes_packet_response_data_user + description: Number of bytes of NVLTX response user data + color: '#98C4DD' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PCIe RX Throughput + id: pcie__read_bytes + description: Number of bytes received by GPU (includes protocol) + color: '#FF3D00' + schedulingRule: migOptional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PCIe TX Throughput + id: pcie__write_bytes + description: Number of bytes transmitted by GPU (includes protocol) + color: '#00CFCF' + schedulingRule: migOptional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PCIe Read Requests to BAR1 + id: pcie__rx_requests_aperture_bar1_op_read + description: CPU+Peer Reads from VRAM over PCIe + color: '#87FFFF' + subMetrics: + - name: Requests + suffix: .sum + - name: PCIe Write Requests to BAR1 + id: pcie__rx_requests_aperture_bar1_op_write + description: CPU+Peer Writes to VRAM over PCIe + color: '#8700FF' + subMetrics: + - name: Requests + suffix: .sum diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/gh100.config b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/gh100.config new file mode 100644 index 0000000000000000000000000000000000000000..b62c69d6865bbf2ce5fdd1e391cd01309c635922 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/gh100.config @@ -0,0 +1,271 @@ +# NOTE: Metrics representing a superset of other metrics must be declared first +# if they appear in the same group (displayRows). Otherwise different metrics will +# dominate in the group row depending on zoom level if overlay display mode is used. +version: 3 +metricSets: +- alias: gh100 + name: General Metrics for NVIDIA GH100 (any frequency) + chips: [GH100] + counterWidth: wide + displayRows: + - name: + type: overlay + displayHeightScale: 0.5 + metrics: + - GR Active + - name: + type: overlay + displayHeightScale: -0.5 + metrics: + - NVLink RX Responses User Data + - NVLink TX Responses User Data + - PCIe RX Throughput + - PCIe TX Throughput + - name: GPC Clock Frequency + type: overlay + metrics: + - GPC Clock Frequency + - name: SYS Clock Frequency + type: overlay + metrics: + - SYS Clock Frequency + - name: GPU Active + description: The graphics or compute engine is active + type: overlay + metrics: + - GR Active + - name: SM Active + type: overlay + metrics: + - SM Active + - name: SM Instructions + type: overlay + metrics: + - SM Issue + - Tensor Active + - name: SM Warp Occupancy + type: stacked + displayHeightScale: 3.0 + metrics: + - Vertex/Tess/Geometry Warps in Flight + - Pixel Warps in Flight + - Compute Warps in Flight + - Unallocated Warps in Active SMs + - name: DRAM Bandwidth + type: stacked + metrics: + - DRAM Read Bandwidth + - DRAM Write Bandwidth + - name: NVLink RX Bandwidth + type: stacked + metrics: + - NVLink RX Requests Protocol Data + - NVLink RX Requests User Data + - NVLink RX Responses Protocol Data + - NVLink RX Responses User Data + - name: NVLink TX Bandwidth + type: stacked + metrics: + - NVLink TX Requests Protocol Data + - NVLink TX Requests User Data + - NVLink TX Responses Protocol Data + - NVLink TX Responses User Data + - name: PCIe Bandwidth + type: overlay + metrics: + - PCIe RX Throughput + - PCIe TX Throughput + metrics: + - name: GPC Clock Frequency + id: gpc__cycles_elapsed + description: The frequency of the GPC graphics clock. In NVIDIA GPU Specs this + is the Boost Clock and Base Clock. In nvidia-smi this is the "gr", "graphics", + "Graphics Clock". + color: '#8BDDB4' + subMetrics: + - name: MHz + suffix: .avg.per_second + multiplier: 1.0e-06 + - name: SYS Clock Frequency + id: sys__cycles_elapsed + description: The frequency of the SYS clock. The SYS clock is the clock used for + the copy engines, compute and graphics command processor, and the hardware performance + monitor streaming unit. + color: '#118E44' + schedulingRule: migOptional + subMetrics: + - name: MHz + suffix: .avg.per_second + multiplier: 1.0e-06 + - name: GR Active + id: gr__cycles_active + description: Number of cycles the graphics/compute engine is active. The graphics + and compute engine are active if there is any work in the graphics pipe or if + the compute pipe is processing a dispatch. + color: '#ED6A32' + subMetrics: + - name: Throughput % + suffix: .sum.pct_of_peak_sustained_elapsed + - name: SM Active + id: sm__cycles_active + description: Total number of cycles the SM is active (at least 1 active warp) + color: '#FFA5A5' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: SM Issue + id: sm__inst_executed_realtime + description: SM instruction issue rate. Each SM can issue 4 instructions/cycle + (1 instruction/SMSP/cycle). + color: '#98C4DD' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Tensor Active + id: sm__pipe_tensor_cycles_active_realtime + description: Cycles the tensor pipe is active + color: '#B3FF70' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Vertex/Tess/Geometry Warps in Flight + id: tpc__warps_active_shader_vtg_realtime + description: Total number of graphics vertex, tesselation, geometry, and mesh + shader warps in flight + color: '#FFA5A5' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Pixel Warps in Flight + id: tpc__warps_active_shader_ps_realtime + description: Total number of pixel shader warps in flight + color: '#8BDDB4' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Compute Warps in Flight + id: tpc__warps_active_shader_cs_realtime + description: Total number of compute shader warps in flight + color: '#FFD179' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Unallocated Warps in Active SMs + id: tpc__warps_inactive_sm_active_realtime + description: Total number of warp slots available on active SMs + color: '#696969' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: DRAM Read Bandwidth + id: dram__read_throughput + description: The ratio of cycles the DRAM interface was active reading data to + the elapsed cycles in the same period as a percentage + color: '#FFA5A5' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: DRAM Write Bandwidth + id: dram__write_throughput + description: The ratio of cycles the DRAM interface was active writing data to + the elapsed cycles in the same period as a percentage + color: '#98C4DD' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink RX Requests Protocol Data + id: nvlrx__bytes_packet_request_data_protocol + description: Number of bytes of NVLRX request protocol data + color: '#C79536' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink RX Requests User Data + id: nvlrx__bytes_packet_request_data_user + description: Number of bytes of NVLRX request user data + color: '#FFD179' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink RX Responses Protocol Data + id: nvlrx__bytes_packet_response_data_protocol + description: Number of bytes of NVLRX response protocol data + color: '#C25D5D' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink RX Responses User Data + id: nvlrx__bytes_packet_response_data_user + description: Number of bytes of NVLRX response user data + color: '#FFA5A5' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink TX Requests Protocol Data + id: nvltx__bytes_packet_request_data_protocol + description: Number of bytes of NVLTX request protocol data + color: '#9052BF' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink TX Requests User Data + id: nvltx__bytes_packet_request_data_user + description: Number of bytes of NVLTX request user data + color: '#D6A4FC' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink TX Responses Protocol Data + id: nvltx__bytes_packet_response_data_protocol + description: Number of bytes of NVLTX response protocol data + color: '#6999B5' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink TX Responses User Data + id: nvltx__bytes_packet_response_data_user + description: Number of bytes of NVLTX response user data + color: '#98C4DD' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PCIe RX Throughput + id: pcie__read_bytes + description: Number of bytes received by GPU (includes protocol) + color: '#FF3D00' + schedulingRule: migOptional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PCIe TX Throughput + id: pcie__write_bytes + description: Number of bytes transmitted by GPU (includes protocol) + color: '#00CFCF' + schedulingRule: migOptional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/index.config b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/index.config new file mode 100644 index 0000000000000000000000000000000000000000..7a5e4d9bd9b1a1713b1596f1481be5c83e5f9d66 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/index.config @@ -0,0 +1,11 @@ +tu10x +tu11x +ga100 +ga10x +ga10b +gh100 +ad10x +tu10x-gfxt +ga10x-gfxt +ad10x-gfxt +ga10x-gfxact diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/tu10x-gfxt.config b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/tu10x-gfxt.config new file mode 100644 index 0000000000000000000000000000000000000000..3f17427bda46c3ad9e16029865b31605c808ef52 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/tu10x-gfxt.config @@ -0,0 +1,556 @@ +# NOTE: Metrics representing a superset of other metrics must be declared first +# if they appear in the same group (displayRows). Otherwise different metrics will +# dominate in the group row depending on zoom level if overlay display mode is used. +version: 3 +metricSets: +- alias: tu10x-gfxt + name: Graphics Throughput Metrics for NVIDIA TU10x (frequency >= 10kHz) + chips: [TU102, TU104, TU106] + counterWidth: narrow + displayRows: + - name: + type: overlay + displayHeightScale: 0.5 + metrics: + - GPU Active + - Async Copy Engine Active + - Sync Copy Engine Active + - GR Active + - name: + type: overlay + displayHeightScale: -0.5 + metrics: + - GPU Memory Read Bandwidth + - GPU Memory Write Bandwidth + - PCIe Read Bandwidth + - PCIe Write Bandwidth + - name: GPU Active + description: Activity of the graphics and copy engines + type: overlay + metrics: + - GPU Active + - Sync Copy Engine Active + - Async Copy Engine Active + - GR Active + - name: Unit Throughputs + description: Throughput of each major hardware unit + type: overlay + displayHeightScale: 2.0 + metrics: + - SM Throughput + - RTCORE Throughput + - VAF Throughput + - L1 Throughput + - L2 Throughput + - VRAM Throughput + - PCIe Throughput + - PD Throughput + - PES+VPC Throughput + - RASTER Throughput + - PROP Throughput + - ZROP Throughput + - CROP Throughput + - name: Compute in Flight + description: Compute dispatches sent to the GPU queues that have been issued, + but not yet complete + type: overlay + metrics: + - Sync Compute in Flight + - Async Compute in Flight + - name: Draw/Dispatch Start + description: Draw and dispatch start times + type: overlay + metrics: + - Draw Started + - Dispatch Started + - name: SM Occupancy (TPC View) + type: stacked + displayHeightScale: 2.0 + metrics: + - Vertex/Tess/Geometry Warps + - Pixel Warps + - Compute Warps + - Unallocated Warps in Active SMs + - Idle SM Unused Warp Slots + - name: Warp Can't Launch + description: Warp can't launch reasons + type: overlay + metrics: + - PS Warp Can't Launch + - PS Warp Can't Launch - Register Limited + - CS Warp Can't Launch - Register Limited + - name: SM Instruction Throughputs + description: SM instruction throughput breakdown by pipe + type: overlay + metrics: + - SM Issue Active + - SM ALU Pipe Throughput + - SM FMA Pipe Throughput + - SM SFU Pipe Throughput + - SM FP16+Tensor Pipe Throughput + - name: L1 Throughputs + description: L1 cache throughputs breakdown by stage + type: overlay + metrics: + - L1 LSU Data-Stage Throughput + - L1 Texture Data-Stage Throughput + - L1 LSU Writeback-Stage Throughput + - L1 Texture Filter-Stage Throughput + - name: L2 Bandwidth + description: L2 bandwidth breakdown by source unit + type: stacked + metrics: + - L2 Bandwidth from CROP + - L2 Bandwidth from L1 + - L2 Bandwidth from ZROP + - name: L2 Hit Rates + description: L2 cache hit rates in aggregate and for read operations from L1 + type: overlay + metrics: + - L2 Hit Rate + - L2 Hit Rate from L1 + - name: GPU Memory Bandwidth + description: GPU memory read/write bandwidth + type: stacked + metrics: + - GPU Memory Read Bandwidth + - GPU Memory Write Bandwidth + - name: PCIe Bandwidth + description: PCIe read/write bandwidth + type: overlay + metrics: + - PCIe Read Bandwidth + - PCIe Write Bandwidth + - name: PCIe to BAR Requests + description: PCIe to BAR 0/1/2 read/write requests + type: overlay + metrics: + - PCIe Read Requests to BAR1 + - PCIe Write Requests to BAR1 + - PCIe Read Requests to BAR0 + - PCIe Write Requests to BAR0 + - PCIe Read Requests to BAR2 + - PCIe Write Requests to BAR2 + - name: ZCULL + description: Total/Rejected number of samples sent to ZCULL + type: overlay + metrics: + - ZCULL Rejected Samples + - ZCULL Input Samples + metrics: + - name: GPU Active + id: FE_A.TriageA.gpu__engine_cycles_active_gr_or_ce + color: '#33B2B2' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Workloads + suffix: .sum + - name: Sync Copy Engine Active + id: FE_A.TriageA.gpu__engine_cycles_active_any_syncce + color: '#B2B233' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Workloads + suffix: .sum + - name: Async Copy Engine Active + id: FE_A.TriageA.gpu__engine_cycles_active_any_asyncce + color: '#FFA700' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Workloads + suffix: .sum + - name: GR Active + id: FE_A.TriageA.gr__cycles_active + description: Number of cycles the graphics/compute engine is active. The graphics + and compute engine are active if there is any work in the graphics pipe or if + the compute pipe is processing a dispatch. + color: '#ED6A32' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Workloads + suffix: .sum + - name: SM Throughput + id: SM.TriageA.sm__throughput + color: '#D100EE' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: RTCORE Throughput + id: rtcore__cycles_executed + color: '#D18841' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: VAF Throughput + id: TPC.TriageA.vaf__throughput + color: '#D13341' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 Throughput + id: SM.TriageA.l1tex__throughput + color: '#FFC425' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Throughput + id: LTS.TriageA.lts__throughput + color: '#00AEDB' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: VRAM Throughput + id: FBPA.TriageA.dramc__throughput + color: '#F37735' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PCIe Throughput + id: PCI.TriageA.pcie__throughput + color: '#3577F3' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PD Throughput + id: HUB.TriageA.pda__throughput + color: '#00B159' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PES+VPC Throughput + id: GPC_B.TriageA.pes__throughput + color: '#3FB159' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: RASTER Throughput + id: GPC_A.TriageA.raster__throughput + color: '#6FB159' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PROP Throughput + id: GPC_A.TriageA.prop__throughput + color: '#9FB159' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: ZROP Throughput + id: ROP.TriageA.zrop__throughput + color: '#854442' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: CROP Throughput + id: ROP.TriageA.crop__throughput + color: '#AFB159' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Sync Compute in Flight + id: HUB.TriageA.gr__dispatch_cycles_active_queue_sync + color: '#FE7F9C' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Async Compute in Flight + id: HUB.TriageA.gr__dispatch_cycles_active_queue_async + color: '#FFD179' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Draw Started + id: FE_A.TriageA.fe__draw_count + description: Number of draw calls started + color: '#F0F000' + subMetrics: + - name: Workloads + suffix: .sum + - name: Dispatch Started + id: HUB.TriageA.gr__dispatch_count + description: Number of compute dispatches/grid launches started + color: '#00F0F0' + subMetrics: + - name: Workloads + suffix: .sum + - name: Vertex/Tess/Geometry Warps + id: TPC.TriageA.tpc__warps_active_shader_vtg_realtime + color: '#0057E7' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Pixel Warps + id: TPC.TriageA.tpc__warps_active_shader_ps_realtime + color: '#008744' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Compute Warps + id: TPC.TriageA.tpc__warps_active_shader_cs_realtime + color: '#FFA700' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Unallocated Warps in Active SMs + id: TPC.TriageA.tpc__warps_inactive_sm_active_realtime + color: '#696969' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Idle SM Unused Warp Slots + id: TPC.TriageA.tpc__warps_inactive_sm_idle_realtime + color: '#C0C0C0' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: PS Warp Can't Launch + id: tpc__warp_launch_cycles_stalled_shader_ps + color: '#FF6F00' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PS Warp Can't Launch - Register Limited + id: tpc__warp_launch_cycles_stalled_shader_ps_reason_register_allocation + color: '#00CF00' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: CS Warp Can't Launch - Register Limited + id: tpc__warp_launch_cycles_stalled_shader_cs_reason_register_allocation + color: '#1111CF' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: SM Issue Active + id: SM.TriageA.sm__inst_executed_realtime + description: SM instruction issue rate. Each SM can issue 4 instructions/cycle + (1 instruction/SMSP/cycle). + color: '#CFCF3F' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Instructions + suffix: .sum + - name: Avg Inst/Clk per SM + suffix: .avg.per_cycle_elapsed + - name: Peak Inst/Clk per SM + suffix: .avg.peak_sustained + - name: SM ALU Pipe Throughput + id: SM.TriageA.sm__inst_executed_pipe_alu_realtime + color: '#FF6F00' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Instructions + suffix: .sum + - name: Avg Inst/Clk per SM + suffix: .avg.per_cycle_elapsed + - name: Peak Inst/Clk per SM + suffix: .avg.peak_sustained + - name: SM FMA Pipe Throughput + id: SM.TriageA.sm__inst_executed_pipe_fma_realtime + color: '#00CF00' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Instructions + suffix: .sum + - name: Avg Inst/Clk per SM + suffix: .avg.per_cycle_elapsed + - name: Peak Inst/Clk per SM + suffix: .avg.peak_sustained + - name: SM SFU Pipe Throughput + id: SM.TriageA.sm__inst_executed_pipe_xu_realtime + color: '#00003F' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Instructions + suffix: .sum + - name: Avg Inst/Clk per SM + suffix: .avg.per_cycle_elapsed + - name: Peak Inst/Clk per SM + suffix: .avg.peak_sustained + - name: SM FP16+Tensor Pipe Throughput + id: SM.TriageA.sm__pipe_shared_cycles_active_realtime + description: Cycles the tensor pipe or fp16x2 pipe is active + color: '#CF003F' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Instructions + suffix: .sum + - name: Avg Inst/Clk per SM + suffix: .avg.per_cycle_elapsed + - name: Peak Inst/Clk per SM + suffix: .avg.peak_sustained + - name: L1 LSU Data-Stage Throughput + id: SM.TriageA.l1tex__data_pipe_lsu_wavefronts + color: '#CFCF3F' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 Texture Data-Stage Throughput + id: SM.TriageA.l1tex__data_pipe_tex_wavefronts_realtime + color: '#00003F' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 LSU Writeback-Stage Throughput + id: SM.TriageA.l1tex__lsu_writeback_active + color: '#CF003F' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L1 Texture Filter-Stage Throughput + id: SM.TriageA.l1tex__f_cycles_active + color: '#3F00CF' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth from CROP + id: TriageA.lts__t_sector_throughput_srcunit_crop + color: '#AA1111' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth from L1 + id: TriageA.lts__t_sector_throughput_srcunit_tex + color: '#11AA11' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Bandwidth from ZROP + id: TriageA.lts__t_sector_throughput_srcunit_zrop + color: '#1111AA' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: L2 Hit Rate + id: LTS.TriageA.lts__average_t_sector_op_read_realtime_hit_rate + color: '#88001B' + subMetrics: + - name: Ratio % + suffix: .pct + - name: L2 Hit Rate from L1 + id: LTS.TriageA.lts__average_t_sector_srcunit_tex_op_read_realtime_hit_rate + color: '#FFCA18' + subMetrics: + - name: Ratio % + suffix: .pct + - name: GPU Memory Read Bandwidth + id: FBPA.TriageA.dramc__read_throughput + color: '#CCCC00' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: GPU Memory Write Bandwidth + id: FBPA.TriageA.dramc__write_throughput + color: '#CC00CC' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PCIe Read Bandwidth + id: PCI.TriageA.pcie__read_bytes + description: Number of bytes received by GPU (includes protocol) + color: '#FF3D00' + schedulingRule: migOptional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Bytes + suffix: .sum + - name: GB/s + suffix: .sum.per_second + multiplier: 1.0e-09 + - name: PCIe Write Bandwidth + id: PCI.TriageA.pcie__write_bytes + description: Number of bytes transmitted by GPU (includes protocol) + color: '#00CFCF' + schedulingRule: migOptional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Bytes + suffix: .sum + - name: GB/s + suffix: .sum.per_second + multiplier: 1.0e-09 + - name: PCIe Read Requests to BAR1 + id: pcie__rx_requests_aperture_bar1_op_read + description: CPU+Peer Reads from VRAM over PCIe + color: '#87FFFF' + subMetrics: + - name: Requests + suffix: .sum + - name: PCIe Write Requests to BAR1 + id: pcie__rx_requests_aperture_bar1_op_write + description: CPU+Peer Writes to VRAM over PCIe + color: '#8700FF' + subMetrics: + - name: Requests + suffix: .sum + - name: PCIe Read Requests to BAR0 + id: pcie__rx_requests_aperture_bar0_op_read + color: '#AFFF87' + subMetrics: + - name: Requests + suffix: .sum + - name: PCIe Write Requests to BAR0 + id: pcie__rx_requests_aperture_bar0_op_write + color: '#870087' + subMetrics: + - name: Requests + suffix: .sum + - name: PCIe Read Requests to BAR2 + id: pcie__rx_requests_aperture_bar2_op_read + color: '#AFAF00' + subMetrics: + - name: Requests + suffix: .sum + - name: PCIe Write Requests to BAR2 + id: pcie__rx_requests_aperture_bar2_op_write + color: '#870000' + subMetrics: + - name: Requests + suffix: .sum + - name: ZCULL Rejected Samples + id: GPC_A.TriageA.raster__zcull_input_samples_op_rejected_realtime + color: '#663399' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Sum + suffix: .sum + - name: ZCULL Input Samples + id: GPC_A.TriageA.raster__zcull_input_samples_realtime + color: '#CC3399' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Sum + suffix: .sum diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/tu10x.config b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/tu10x.config new file mode 100644 index 0000000000000000000000000000000000000000..001dec8b3704e4df205f8092968d879f998e4131 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/tu10x.config @@ -0,0 +1,330 @@ +# NOTE: Metrics representing a superset of other metrics must be declared first +# if they appear in the same group (displayRows). Otherwise different metrics will +# dominate in the group row depending on zoom level if overlay display mode is used. +version: 3 +metricSets: +- alias: tu10x + name: General Metrics for NVIDIA TU10x (any frequency) + chips: [TU102, TU104, TU106] + counterWidth: wide + displayRows: + - name: + type: overlay + displayHeightScale: 0.5 + metrics: + - GR Active + - name: + type: overlay + displayHeightScale: -0.5 + metrics: + - NVLink RX Responses User Data + - NVLink TX Responses User Data + - PCIe RX Throughput + - PCIe TX Throughput + - name: GPC Clock Frequency + type: overlay + metrics: + - GPC Clock Frequency + - name: SYS Clock Frequency + type: overlay + metrics: + - SYS Clock Frequency + - name: GPU Active + description: The graphics or compute engine is active + type: overlay + metrics: + - GR Active + - name: Compute in Flight + description: Compute dispatches sent to the GPU queues that have been issued, + but not yet complete + type: overlay + metrics: + - Sync Compute in Flight + - Async Compute in Flight + - name: Draw/Dispatch Start + description: Draw and dispatch start times + type: overlay + metrics: + - Draw Started + - Dispatch Started + - name: SM Active + type: overlay + metrics: + - SM Active + - name: SM Instructions + type: overlay + metrics: + - SM Issue + - Tensor Active / FP16 Active + - name: SM Warp Occupancy + type: stacked + displayHeightScale: 3.0 + metrics: + - Vertex/Tess/Geometry Warps in Flight + - Pixel Warps in Flight + - Compute Warps in Flight + - Unallocated Warps in Active SMs + - name: DRAM Bandwidth + type: stacked + metrics: + - DRAM Read Bandwidth + - DRAM Write Bandwidth + - name: NVLink RX Bandwidth + type: stacked + metrics: + - NVLink RX Requests Protocol Data + - NVLink RX Requests User Data + - NVLink RX Responses Protocol Data + - NVLink RX Responses User Data + - name: NVLink TX Bandwidth + type: stacked + metrics: + - NVLink TX Requests Protocol Data + - NVLink TX Requests User Data + - NVLink TX Responses Protocol Data + - NVLink TX Responses User Data + - name: PCIe Bandwidth + type: overlay + metrics: + - PCIe RX Throughput + - PCIe TX Throughput + - name: PCIe Read Requests to BAR1 + metrics: + - PCIe Read Requests to BAR1 + - name: PCIe Write Requests to BAR1 + metrics: + - PCIe Write Requests to BAR1 + metrics: + - name: GPC Clock Frequency + id: gpc__cycles_elapsed + description: The frequency of the GPC graphics clock. In NVIDIA GPU Specs this + is the Boost Clock and Base Clock. In nvidia-smi this is the "gr", "graphics", + "Graphics Clock". + color: '#8BDDB4' + subMetrics: + - name: MHz + suffix: .avg.per_second + multiplier: 1.0e-06 + - name: SYS Clock Frequency + id: sys__cycles_elapsed + description: The frequency of the SYS clock. The SYS clock is the clock used for + the copy engines, compute and graphics command processor, and the hardware performance + monitor streaming unit. + color: '#118E44' + schedulingRule: migOptional + subMetrics: + - name: MHz + suffix: .avg.per_second + multiplier: 1.0e-06 + - name: GR Active + id: gr__cycles_active + description: Number of cycles the graphics/compute engine is active. The graphics + and compute engine are active if there is any work in the graphics pipe or if + the compute pipe is processing a dispatch. + color: '#ED6A32' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Sync Compute in Flight + id: HUB.TriageA.gr__dispatch_cycles_active_queue_sync + color: '#FE7F9C' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Async Compute in Flight + id: HUB.TriageA.gr__dispatch_cycles_active_queue_async + color: '#FFD179' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Draw Started + id: FE_A.TriageA.fe__draw_count + description: Number of draw calls started + color: '#F0F000' + subMetrics: + - name: Workloads + suffix: .sum + - name: Dispatch Started + id: HUB.TriageA.gr__dispatch_count + description: Number of compute dispatches/grid launches started + color: '#00F0F0' + subMetrics: + - name: Workloads + suffix: .sum + - name: SM Active + id: sm__cycles_active + description: Total number of cycles the SM is active (at least 1 active warp) + color: '#FFA5A5' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: SM Issue + id: SM.TriageA.sm__inst_executed_realtime + description: SM instruction issue rate. Each SM can issue 4 instructions/cycle + (1 instruction/SMSP/cycle). + color: '#98C4DD' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Tensor Active / FP16 Active + id: SM.TriageA.sm__pipe_shared_cycles_active_realtime + description: Cycles the tensor pipe or fp16x2 pipe is active + color: '#B3FF70' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Vertex/Tess/Geometry Warps in Flight + id: TPC.TriageA.tpc__warps_active_shader_vtg_realtime + description: Total number of graphics vertex, tesselation, geometry, and mesh + shader warps in flight + color: '#FFA5A5' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Pixel Warps in Flight + id: TPC.TriageA.tpc__warps_active_shader_ps_realtime + description: Total number of pixel shader warps in flight + color: '#8BDDB4' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Compute Warps in Flight + id: TPC.TriageA.tpc__warps_active_shader_cs_realtime + description: Total number of compute shader warps in flight + color: '#FFD179' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Unallocated Warps in Active SMs + id: TPC.TriageA.tpc__warps_inactive_sm_active_realtime + description: Total number of warp slots available on active SMs + color: '#696969' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: DRAM Read Bandwidth + id: dramc__read_throughput + description: The ratio of cycles the DRAM interface was active reading data to + the elapsed cycles in the same period as a percentage + color: '#FFA5A5' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: DRAM Write Bandwidth + id: dramc__write_throughput + description: The ratio of cycles the DRAM interface was active writing data to + the elapsed cycles in the same period as a percentage + color: '#98C4DD' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink RX Requests Protocol Data + id: nvlrx__bytes_packet_request_data_protocol + description: Number of bytes of NVLRX request protocol data + color: '#C79536' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink RX Requests User Data + id: nvlrx__bytes_packet_request_data_user + description: Number of bytes of NVLRX request user data + color: '#FFD179' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink RX Responses Protocol Data + id: nvlrx__bytes_packet_response_data_protocol + description: Number of bytes of NVLRX response protocol data + color: '#C25D5D' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink RX Responses User Data + id: nvlrx__bytes_packet_response_data_user + description: Number of bytes of NVLRX response user data + color: '#FFA5A5' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink TX Requests Protocol Data + id: nvltx__bytes_packet_request_data_protocol + description: Number of bytes of NVLTX request protocol data + color: '#9052BF' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink TX Requests User Data + id: nvltx__bytes_packet_request_data_user + description: Number of bytes of NVLTX request user data + color: '#D6A4FC' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink TX Responses Protocol Data + id: nvltx__bytes_packet_response_data_protocol + description: Number of bytes of NVLTX response protocol data + color: '#6999B5' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: NVLink TX Responses User Data + id: nvltx__bytes_packet_response_data_user + description: Number of bytes of NVLTX response user data + color: '#98C4DD' + schedulingRule: optional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PCIe RX Throughput + id: PCI.TriageA.pcie__read_bytes + description: Number of bytes received by GPU (includes protocol) + color: '#FF3D00' + schedulingRule: migOptional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PCIe TX Throughput + id: PCI.TriageA.pcie__write_bytes + description: Number of bytes transmitted by GPU (includes protocol) + color: '#00CFCF' + schedulingRule: migOptional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PCIe Read Requests to BAR1 + id: pcie__rx_requests_aperture_bar1_op_read + description: CPU+Peer Reads from VRAM over PCIe + color: '#87FFFF' + subMetrics: + - name: Requests + suffix: .sum + - name: PCIe Write Requests to BAR1 + id: pcie__rx_requests_aperture_bar1_op_write + description: CPU+Peer Writes to VRAM over PCIe + color: '#8700FF' + subMetrics: + - name: Requests + suffix: .sum diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/tu11x.config b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/tu11x.config new file mode 100644 index 0000000000000000000000000000000000000000..70214ea3404b5b49876cc0ec3c6d95da8e458566 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/GpuMetrics/tu11x.config @@ -0,0 +1,242 @@ +# NOTE: Metrics representing a superset of other metrics must be declared first +# if they appear in the same group (displayRows). Otherwise different metrics will +# dominate in the group row depending on zoom level if overlay display mode is used. +version: 3 +metricSets: +- alias: tu11x + name: General Metrics for NVIDIA TU11x (any frequency) + chips: [TU116, TU117] + counterWidth: wide + displayRows: + - name: + type: overlay + displayHeightScale: 0.5 + metrics: + - GR Active + - name: + type: overlay + displayHeightScale: -0.5 + metrics: + - PCIe RX Throughput + - PCIe TX Throughput + - name: GPC Clock Frequency + type: overlay + metrics: + - GPC Clock Frequency + - name: SYS Clock Frequency + type: overlay + metrics: + - SYS Clock Frequency + - name: GPU Active + description: The graphics or compute engine is active + type: overlay + metrics: + - GR Active + - name: Compute in Flight + description: Compute dispatches sent to the GPU queues that have been issued, + but not yet complete + type: overlay + metrics: + - Sync Compute in Flight + - Async Compute in Flight + - name: Draw/Dispatch Start + description: Draw and dispatch start times + type: overlay + metrics: + - Draw Started + - Dispatch Started + - name: SM Active + type: overlay + metrics: + - SM Active + - name: SM Instructions + type: overlay + metrics: + - SM Issue + - name: SM Warp Occupancy + type: stacked + displayHeightScale: 3.0 + metrics: + - Vertex/Tess/Geometry Warps in Flight + - Pixel Warps in Flight + - Compute Warps in Flight + - Unallocated Warps in Active SMs + - name: DRAM Bandwidth + type: stacked + metrics: + - DRAM Read Bandwidth + - DRAM Write Bandwidth + - name: PCIe Bandwidth + type: overlay + metrics: + - PCIe RX Throughput + - PCIe TX Throughput + - name: PCIe Read Requests to BAR1 + metrics: + - PCIe Read Requests to BAR1 + - name: PCIe Write Requests to BAR1 + metrics: + - PCIe Write Requests to BAR1 + metrics: + - name: GPC Clock Frequency + id: gpc__cycles_elapsed + description: The frequency of the GPC graphics clock. In NVIDIA GPU Specs this + is the Boost Clock and Base Clock. In nvidia-smi this is the "gr", "graphics", + "Graphics Clock". + color: '#8BDDB4' + subMetrics: + - name: MHz + suffix: .avg.per_second + multiplier: 1.0e-06 + - name: SYS Clock Frequency + id: sys__cycles_elapsed + description: The frequency of the SYS clock. The SYS clock is the clock used for + the copy engines, compute and graphics command processor, and the hardware performance + monitor streaming unit. + color: '#118E44' + schedulingRule: migOptional + subMetrics: + - name: MHz + suffix: .avg.per_second + multiplier: 1.0e-06 + - name: GR Active + id: gr__cycles_active + description: Number of cycles the graphics/compute engine is active. The graphics + and compute engine are active if there is any work in the graphics pipe or if + the compute pipe is processing a dispatch. + color: '#ED6A32' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Sync Compute in Flight + id: HUB.TriageA.gr__dispatch_cycles_active_queue_sync + color: '#FE7F9C' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Async Compute in Flight + id: HUB.TriageA.gr__dispatch_cycles_active_queue_async + color: '#FFD179' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Draw Started + id: FE_A.TriageA.fe__draw_count + description: Number of draw calls started + color: '#F0F000' + subMetrics: + - name: Workloads + suffix: .sum + - name: Dispatch Started + id: HUB.TriageA.gr__dispatch_count + description: Number of compute dispatches/grid launches started + color: '#00F0F0' + subMetrics: + - name: Workloads + suffix: .sum + - name: SM Active + id: sm__cycles_active + description: Total number of cycles the SM is active (at least 1 active warp) + color: '#FFA5A5' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: SM Issue + id: SM.TriageA.sm__inst_executed_realtime + description: SM instruction issue rate. Each SM can issue 4 instructions/cycle + (1 instruction/SMSP/cycle). + color: '#98C4DD' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Vertex/Tess/Geometry Warps in Flight + id: TPC.TriageA.tpc__warps_active_shader_vtg_realtime + description: Total number of graphics vertex, tesselation, geometry, and mesh + shader warps in flight + color: '#FFA5A5' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Pixel Warps in Flight + id: TPC.TriageA.tpc__warps_active_shader_ps_realtime + description: Total number of pixel shader warps in flight + color: '#8BDDB4' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Compute Warps in Flight + id: TPC.TriageA.tpc__warps_active_shader_cs_realtime + description: Total number of compute shader warps in flight + color: '#FFD179' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: Unallocated Warps in Active SMs + id: TPC.TriageA.tpc__warps_inactive_sm_active_realtime + description: Total number of warp slots available on active SMs + color: '#696969' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: Avg + suffix: .avg + - name: Avg Warps per Cycle + suffix: .avg.per_cycle_elapsed + - name: DRAM Read Bandwidth + id: dramc__read_throughput + description: The ratio of cycles the DRAM interface was active reading data to + the elapsed cycles in the same period as a percentage + color: '#FFA5A5' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: DRAM Write Bandwidth + id: dramc__write_throughput + description: The ratio of cycles the DRAM interface was active writing data to + the elapsed cycles in the same period as a percentage + color: '#98C4DD' + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PCIe RX Throughput + id: PCI.TriageA.pcie__read_bytes + description: Number of bytes received by GPU (includes protocol) + color: '#FF3D00' + schedulingRule: migOptional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PCIe TX Throughput + id: PCI.TriageA.pcie__write_bytes + description: Number of bytes transmitted by GPU (includes protocol) + color: '#00CFCF' + schedulingRule: migOptional + subMetrics: + - name: Throughput % + suffix: .avg.pct_of_peak_sustained_elapsed + - name: PCIe Read Requests to BAR1 + id: pcie__rx_requests_aperture_bar1_op_read + description: CPU+Peer Reads from VRAM over PCIe + color: '#87FFFF' + subMetrics: + - name: Requests + suffix: .sum + - name: PCIe Write Requests to BAR1 + id: pcie__rx_requests_aperture_bar1_op_write + description: CPU+Peer Writes to VRAM over PCIe + color: '#8700FF' + subMetrics: + - name: Requests + suffix: .sum diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/NsysVsIntegration.xml b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/NsysVsIntegration.xml new file mode 100644 index 0000000000000000000000000000000000000000..0e8fb596148e44e3df7d5e99419a22a3bc7654c7 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/NsysVsIntegration.xml @@ -0,0 +1,17 @@ + + + + + + + + + diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/PythonNvtx/annotations.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/PythonNvtx/annotations.json new file mode 100644 index 0000000000000000000000000000000000000000..f6a23b8e286ba9cb2c6fe238cbbd87859781bdef --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/PythonNvtx/annotations.json @@ -0,0 +1,37 @@ +[ + { + "_comment": ["Minimal annotations example", + "Note that module's name must include parent packages"], + + "module": "torch.nn.functional", + "functions": ["sigmoid"] + }, + + { + "_comment": "Set custom attributes - domain, category, color", + + "domain": "My Domain", + "category": "My Category", + "color": "0x008000", + "module": "torch.nn.functional", + "functions": ["sigmoid"] + }, + + { + "_comment": [ + "More complex example:", + "- Attributes can be overridden per function", + "- Methods can also be annotated (Adadelta.step)" + ], + + "module": "torch.nn.functional", + "domain": "More complex example", + "category": "functional", + "color": "0x008000", + "functions": [ + "sigmoid", + {"function": "log_softmax", "color": "0xFF0000"}, + {"function": "Adadelta.step", "color": "0x800080", "module": "torch.optim.adadelta", "domain": "optim"} + ] + } +] \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/config.ini b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/config.ini new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/etw_providers_template.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/etw_providers_template.json new file mode 100644 index 0000000000000000000000000000000000000000..833c9c517ac117de303009f8f0bafb0e4009751a --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/etw_providers_template.json @@ -0,0 +1,63 @@ +// Note: Remove all comments in this template before using it because JSON does +// not support comments. +{ + "version": "1.0", + "providers": [ + { + // "name" and "guid" are mandatory. + "name": "Provider Name 1", + "guid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxx", + // Other attributes are optional. Remove if not use. + "bufferSize": 0, + "minBuffers": 0, + "maxBuffers": 0, + "keyword": "0x0000000000000000", + // Possible values for "level" (only one can be set): + // TRACE_LEVEL_CRITICAL + // TRACE_LEVEL_ERROR + // TRACE_LEVEL_WARNING + // TRACE_LEVEL_INFORMATION + // TRACE_LEVEL_VERBOSE + "level": "TRACE_LEVEL_", + // Possible values for "flags" (multiple can be set): + // EVENT_TRACE_FLAG_ALPC + // EVENT_TRACE_FLAG_CSWITCH + // EVENT_TRACE_FLAG_DBGPRINT + // EVENT_TRACE_FLAG_DISK_FILE_IO + // EVENT_TRACE_FLAG_DISK_IO + // EVENT_TRACE_FLAG_DISK_IO_INIT + // EVENT_TRACE_FLAG_DISPATCHER + // EVENT_TRACE_FLAG_DPC + // EVENT_TRACE_FLAG_DRIVER + // EVENT_TRACE_FLAG_FILE_IO + // EVENT_TRACE_FLAG_FILE_IO_INIT + // EVENT_TRACE_FLAG_IMAGE_LOAD + // EVENT_TRACE_FLAG_INTERRUPT + // EVENT_TRACE_FLAG_JOB + // EVENT_TRACE_FLAG_MEMORY_HARD_FAULTS + // EVENT_TRACE_FLAG_MEMORY_PAGE_FAULTS + // EVENT_TRACE_FLAG_NETWORK_TCPIP + // EVENT_TRACE_FLAG_NO_SYSCONFIG + // EVENT_TRACE_FLAG_PROCESS + // EVENT_TRACE_FLAG_PROCESS_COUNTERS + // EVENT_TRACE_FLAG_PROFILE + // EVENT_TRACE_FLAG_REGISTRY + // EVENT_TRACE_FLAG_SPLIT_IO + // EVENT_TRACE_FLAG_SYSTEMCALL + // EVENT_TRACE_FLAG_THREAD + // EVENT_TRACE_FLAG_VAMAP + // EVENT_TRACE_FLAG_VIRTUAL_ALLOC + "flags": ["EVENT_TRACE_FLAG_", "EVENT_TRACE_FLAG_"] + }, + { + "name": "Provider Name 2", + "guid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxx", + "bufferSize": 0, + "minBuffers": 0, + "maxBuffers": 0, + "keyword": "0x0000000000000000", + "level": "TRACE_LEVEL_", + "flags": ["EVENT_TRACE_FLAG_", "EVENT_TRACE_FLAG_"] + } + ] +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvlog.config.template b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvlog.config.template new file mode 100644 index 0000000000000000000000000000000000000000..6bf26c26f175daf1d47dc8ae478c1c9223d4b8ce --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvlog.config.template @@ -0,0 +1,27 @@ +# Rename this file to nvlog.config and put into one of the two places: +# * Next to the nsys-ui binary. +# * Into your current directory. + +# Enable all loggers: ++ 75iw 75ef 0IW 0EF global +# Except for too verbose ones +- quadd_verbose_ + +# Append logs to a file: +$ nsys-ui.log + +# Flush the log file after every log message: +ForceFlush + +# On Windows, use OutputDebugString(): +OutputDebugString + +# Log into stderr: +UseStderr + +# Specify logging format: +# Simple format +# Format $time $tid $name $text + +# A more verbose variant of logging format: +Format $sevc$time|${name:0}|${tid:5}|${file:0}:${line:0}[${sfunc:0}]: $text diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvToolsExt.h b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvToolsExt.h new file mode 100644 index 0000000000000000000000000000000000000000..71ac59c985bd5b51a9b767b069c2223e5a184d99 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvToolsExt.h @@ -0,0 +1,1470 @@ +/* +* Copyright 2009-2022 NVIDIA Corporation. All rights reserved. +* +* Licensed under the Apache License v2.0 with LLVM Exceptions. +* See https://llvm.org/LICENSE.txt for license information. +* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +*/ + +/** \file nvToolsExt.h + */ + +/* ========================================================================= */ +/** \mainpage + * \tableofcontents + * \section INTRODUCTION Introduction + * + * The NVIDIA Tools Extension library is a set of functions that a + * developer can use to provide additional information to tools. + * The additional information is used by the tool to improve + * analysis and visualization of data. + * + * The library introduces close to zero overhead if no tool is + * attached to the application. The overhead when a tool is + * attached is specific to the tool. + * + * \section INITIALIZATION_SECTION Initialization + * + * Typically the tool's library that plugs into NVTX is indirectly + * loaded via enviromental properties that are platform specific. + * For some platform or special cases, the user may be required + * to instead explicity initialize instead though. This can also + * be helpful to control when the API loads a tool's library instead + * of what would typically be the first function call to emit info. + * For these rare case, see \ref INITIALIZATION for additional information. + * + * \section MARKERS_AND_RANGES Markers and Ranges + * + * Markers and ranges are used to describe events at a specific time (markers) + * or over a time span (ranges) during the execution of the application + * respectively. + * + * \subsection MARKERS Markers + * + * Markers denote specific moments in time. + * + * + * See \ref DOMAINS and \ref EVENT_ATTRIBUTES for additional information on + * how to specify the domain. + * + * \subsection THREAD_RANGES Thread Ranges + * + * Thread ranges denote nested time ranges. Nesting is maintained per thread + * per domain and does not require any additional correlation mechanism. The + * duration of a thread range is defined by the corresponding pair of + * nvtxRangePush* to nvtxRangePop API calls. + * + * See \ref DOMAINS and \ref EVENT_ATTRIBUTES for additional information on + * how to specify the domain. + * + * \subsection PROCESS_RANGES Process Ranges + * + * Process ranges denote a time span that can expose arbitrary concurrency, as + * opposed to thread ranges that only support nesting. In addition the range + * start event can happen on a different thread than the end marker. For the + * correlation of a start/end pair an unique correlation ID is used that is + * returned from the start API call and needs to be passed into the end API + * call. + * + * \subsection EVENT_ATTRIBUTES Event Attributes + * + * \ref MARKERS_AND_RANGES can be annotated with various attributes to provide + * additional information for an event or to guide the tool's visualization of + * the data. Each of the attributes is optional and if left unused the + * attributes fall back to a default value. The attributes include: + * - color + * - category + * + * To specify any attribute other than the text message, the \ref + * EVENT_ATTRIBUTE_STRUCTURE "Event Attribute Structure" must be used. + * + * \section DOMAINS Domains + * + * Domains enable developers to scope annotations. By default all events and + * annotations are in the default domain. Additional domains can be registered. + * This allows developers to scope markers, ranges, and resources names to + * avoid conflicts. + * + * The function ::nvtxDomainCreateA or ::nvtxDomainCreateW is used to create + * a named domain. + * + * Each domain maintains its own + * - categories + * - thread range stacks + * - registered strings + * + * The function ::nvtxDomainDestroy marks the end of the domain. Destroying + * a domain unregisters and destroys all objects associated with it such as + * registered strings, resource objects, named categories, and started ranges. + * + * \section RESOURCE_NAMING Resource Naming + * + * This section covers calls that allow to annotate objects with user-provided + * names in order to allow for a better analysis of complex trace data. All of + * the functions take the handle or the ID of the object to name and the name. + * The functions can be called multiple times during the execution of an + * application, however, in that case it is implementation dependent which + * name will be reported by the tool. + * + * \subsection CATEGORY_NAMING Category Naming + * + * Some function in this library support associating an integer category + * to enable filtering and sorting. The category naming functions allow + * the application to associate a user friendly name with the integer + * category. Support for domains have been added in NVTX_VERSION_2 to + * avoid collisions when domains are developed independantly. + * + * \subsection RESOURCE_OBJECTS Resource Objects + * + * Resource objects are a generic mechanism for attaching data to an application + * resource. The identifier field makes the association to a pointer or handle, + * while the type field helps provide deeper understanding of the identifier as + * well as enabling differentiation in cases where handles generated by different + * APIs may collide. The resource object may also have an associated message to + * associate with the application resource, enabling further annotation of this + * object and how it is used. + * + * The resource object was introduced in NVTX_VERSION_2 to supersede existing naming + * functions and allow the application resource identified by those functions to be + * associated to a domain. The other naming functions are still supported for backward + * compatibility but will be associated only to the default domain. + * + * \subsection RESOURCE_NAMING_OS Resource Naming + * + * Some operating system resources creation APIs do not support providing a user friendly + * name, such as some OS thread creation APIs. This API support resource naming though + * both through resource objects and functions following the pattern + * nvtxName[RESOURCE_TYPE][A|W](identifier, name). Resource objects introduced in NVTX_VERSION 2 + * supersede the other functions with a a more general method of assigning names to OS resources, + * along with associating them to domains too. The older nvtxName* functions are only associated + * with the default domain. + * \section EXTENSIONS Optional Extensions + * Optional extensions will either appear within the existing sections the extend or appear + * in the "Related Pages" when they introduce new concepts. + */ + + /** + * Tools Extension API version + */ +#if defined(NVTX_VERSION) && NVTX_VERSION < 3 +#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." +#endif + +/* Header guard */ +#if !defined(NVTX_VERSION) +#define NVTX_VERSION 3 + +#if defined(_MSC_VER) +#define NVTX_API __stdcall +#define NVTX_INLINE_STATIC __inline static +#else /*defined(__GNUC__)*/ +#define NVTX_API +#define NVTX_INLINE_STATIC inline static +#endif /* Platform */ + +#if defined(NVTX_NO_IMPL) +/* When omitting implementation, avoid declaring functions inline */ +/* without definitions, since this causes compiler warnings. */ +#define NVTX_DECLSPEC +#elif defined(NVTX_EXPORT_API) +/* Allow overriding definition of NVTX_DECLSPEC when exporting API. */ +/* Default is empty, meaning non-inline with external linkage. */ +#if !defined(NVTX_DECLSPEC) +#define NVTX_DECLSPEC +#endif +#else +/* Normal NVTX usage defines the NVTX API inline with static */ +/* (internal) linkage. */ +#define NVTX_DECLSPEC NVTX_INLINE_STATIC +#endif + +#include "nvtxDetail/nvtxLinkOnce.h" + +#define NVTX_VERSIONED_IDENTIFIER_L3(NAME, VERSION) NAME##_v##VERSION +#define NVTX_VERSIONED_IDENTIFIER_L2(NAME, VERSION) NVTX_VERSIONED_IDENTIFIER_L3(NAME, VERSION) +#define NVTX_VERSIONED_IDENTIFIER(NAME) NVTX_VERSIONED_IDENTIFIER_L2(NAME, NVTX_VERSION) + +/** + * The nvToolsExt library depends on stdint.h. If the build tool chain in use + * does not include stdint.h then define NVTX_STDINT_TYPES_ALREADY_DEFINED + * and define the following types: + *
    + *
  • uint8_t + *
  • int8_t + *
  • uint16_t + *
  • int16_t + *
  • uint32_t + *
  • int32_t + *
  • uint64_t + *
  • int64_t + *
  • uintptr_t + *
  • intptr_t + *
+ * #define NVTX_STDINT_TYPES_ALREADY_DEFINED if you are using your own header file. + */ +#ifndef NVTX_STDINT_TYPES_ALREADY_DEFINED +#include +#endif + +#include + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** +* Result Codes +*/ + +#define NVTX_SUCCESS 0 +#define NVTX_FAIL 1 +#define NVTX_ERR_INIT_LOAD_PROPERTY 2 +#define NVTX_ERR_INIT_ACCESS_LIBRARY 3 +#define NVTX_ERR_INIT_LOAD_LIBRARY 4 +#define NVTX_ERR_INIT_MISSING_LIBRARY_ENTRY_POINT 5 +#define NVTX_ERR_INIT_FAILED_LIBRARY_ENTRY_POINT 6 +#define NVTX_ERR_NO_INJECTION_LIBRARY_AVAILABLE 7 + +/** + * Size of the nvtxEventAttributes_t structure. + */ +#define NVTX_EVENT_ATTRIB_STRUCT_SIZE ( (uint16_t)( sizeof(nvtxEventAttributes_t) ) ) + +#define NVTX_NO_PUSH_POP_TRACKING ((int)-2) + +typedef uint64_t nvtxRangeId_t; + +/* Forward declaration of opaque domain registration structure */ +struct nvtxDomainRegistration_st; +typedef struct nvtxDomainRegistration_st nvtxDomainRegistration; + +/* \brief Domain Handle Structure. +* \anchor DOMAIN_HANDLE_STRUCTURE +* +* This structure is opaque to the user and is used as a handle to reference +* a domain. This type is returned from tools when using the NVTX API to +* create a domain. +* +*/ +typedef nvtxDomainRegistration* nvtxDomainHandle_t; + +/* Forward declaration of opaque string registration structure */ +struct nvtxStringRegistration_st; +typedef struct nvtxStringRegistration_st nvtxStringRegistration; + +/* \brief Registered String Handle Structure. +* \anchor REGISTERED_STRING_HANDLE_STRUCTURE +* +* This structure is opaque to the user and is used as a handle to reference +* a registered string. This type is returned from tools when using the NVTX +* API to create a registered string. +* +*/ +typedef nvtxStringRegistration* nvtxStringHandle_t; + +/* ========================================================================= */ +/** \defgroup GENERAL General + * @{ + */ + +/** --------------------------------------------------------------------------- + * Color Types + * ------------------------------------------------------------------------- */ +typedef enum nvtxColorType_t +{ + NVTX_COLOR_UNKNOWN = 0, /**< Color attribute is unused. */ + NVTX_COLOR_ARGB = 1 /**< An ARGB color is provided. */ +} nvtxColorType_t; + +/** --------------------------------------------------------------------------- + * Message Types + * ------------------------------------------------------------------------- */ +typedef enum nvtxMessageType_t +{ + NVTX_MESSAGE_UNKNOWN = 0, /**< Message payload is unused. */ + NVTX_MESSAGE_TYPE_ASCII = 1, /**< A character sequence is used as payload. */ + NVTX_MESSAGE_TYPE_UNICODE = 2, /**< A wide character sequence is used as payload. */ + /* NVTX_VERSION_2 */ + NVTX_MESSAGE_TYPE_REGISTERED = 3, /**< A unique string handle that was registered + with \ref nvtxDomainRegisterStringA() or + \ref nvtxDomainRegisterStringW(). */ +} nvtxMessageType_t; + +typedef union nvtxMessageValue_t +{ + const char* ascii; + const wchar_t* unicode; + /* NVTX_VERSION_2 */ + nvtxStringHandle_t registered; +} nvtxMessageValue_t; + + +/** @} */ /*END defgroup*/ +/* ------------------------------------------------------------------------- */ +/** \brief Force initialization (optional) +* +* Force NVTX library to initialize. The first call to any NVTX API function +* will automatically initialize the entire API. This can make the first call +* much slower than subsequent calls. In applications where the first call to +* NVTX may be in a performance-critical section, calling nvtxInitialize before +* any performance-critical sections will ensure NVTX initialization occurs at +* an acceptable time. Since nvtxInitialize takes no parameters and has no +* expected behavior besides initialization, it is convenient to add a call to +* nvtxInitialize in NVTX-instrumented applications that need to force earlier +* initialization without changing any other code. For example, if an app's +* first NVTX call is nvtxDomainCreate, and it is difficult to move that call +* earlier because the domain handle must be stored in an object only created +* at that point, adding a call to nvtxInitialize at the top of main() will +* ensure the later call to nvtxDomainCreate is as fast as possible. +* +* \version \NVTX_VERSION_3 +* +* \param reserved - must be zero or NULL. +* +* @{ */ +NVTX_DECLSPEC void NVTX_API nvtxInitialize(const void* reserved); +/** @} */ + + +/** @} */ /*END defgroup*/ + +/* ========================================================================= */ +/** \defgroup EVENT_ATTRIBUTES Event Attributes +* @{ +*/ + +/** --------------------------------------------------------------------------- +* Payload Types +* ------------------------------------------------------------------------- */ +typedef enum nvtxPayloadType_t +{ + NVTX_PAYLOAD_UNKNOWN = 0, /**< Color payload is unused. */ + NVTX_PAYLOAD_TYPE_UNSIGNED_INT64 = 1, /**< A 64 bit unsigned integer value is used as payload. */ + NVTX_PAYLOAD_TYPE_INT64 = 2, /**< A 64 bit signed integer value is used as payload. */ + NVTX_PAYLOAD_TYPE_DOUBLE = 3, /**< A 64 bit floating point value is used as payload. */ + /* NVTX_VERSION_2 */ + NVTX_PAYLOAD_TYPE_UNSIGNED_INT32 = 4, /**< A 32 bit floating point value is used as payload. */ + NVTX_PAYLOAD_TYPE_INT32 = 5, /**< A 32 bit floating point value is used as payload. */ + NVTX_PAYLOAD_TYPE_FLOAT = 6 /**< A 32 bit floating point value is used as payload. */ +} nvtxPayloadType_t; + +/** \brief Event Attribute Structure. + * \anchor EVENT_ATTRIBUTE_STRUCTURE + * + * This structure is used to describe the attributes of an event. The layout of + * the structure is defined by a specific version of the tools extension + * library and can change between different versions of the Tools Extension + * library. + * + * \par Initializing the Attributes + * + * The caller should always perform the following three tasks when using + * attributes: + *
    + *
  • Zero the structure + *
  • Set the version field + *
  • Set the size field + *
+ * + * Zeroing the structure sets all the event attributes types and values + * to the default value. + * + * The version and size field are used by the Tools Extension + * implementation to handle multiple versions of the attributes structure. + * + * It is recommended that the caller use one of the following to methods + * to initialize the event attributes structure: + * + * \par Method 1: Initializing nvtxEventAttributes for future compatibility + * \code + * nvtxEventAttributes_t eventAttrib = {0}; + * eventAttrib.version = NVTX_VERSION; + * eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE; + * \endcode + * + * \par Method 2: Initializing nvtxEventAttributes for a specific version + * \code + * nvtxEventAttributes_t eventAttrib = {0}; + * eventAttrib.version = 1; + * eventAttrib.size = (uint16_t)(sizeof(nvtxEventAttributes_v1)); + * \endcode + * + * If the caller uses Method 1 it is critical that the entire binary + * layout of the structure be configured to 0 so that all fields + * are initialized to the default value. + * + * The caller should either use both NVTX_VERSION and + * NVTX_EVENT_ATTRIB_STRUCT_SIZE (Method 1) or use explicit values + * and a versioned type (Method 2). Using a mix of the two methods + * will likely cause either source level incompatibility or binary + * incompatibility in the future. + * + * \par Settings Attribute Types and Values + * + * + * \par Example: + * \code + * // Initialize + * nvtxEventAttributes_t eventAttrib = {0}; + * eventAttrib.version = NVTX_VERSION; + * eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE; + * + * // Configure the Attributes + * eventAttrib.colorType = NVTX_COLOR_ARGB; + * eventAttrib.color = 0xFF880000; + * eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII; + * eventAttrib.message.ascii = "Example"; + * \endcode + * + * In the example the caller does not have to set the value of + * \ref ::nvtxEventAttributes_v2::category or + * \ref ::nvtxEventAttributes_v2::payload as these fields were set to + * the default value by {0}. + * \sa + * ::nvtxDomainMarkEx + * ::nvtxDomainRangeStartEx + * ::nvtxDomainRangePushEx + */ +typedef struct nvtxEventAttributes_v2 +{ + /** + * \brief Version flag of the structure. + * + * Needs to be set to NVTX_VERSION to indicate the version of NVTX APIs + * supported in this header file. This can optionally be overridden to + * another version of the tools extension library. + */ + uint16_t version; + + /** + * \brief Size of the structure. + * + * Needs to be set to the size in bytes of the event attribute + * structure used to specify the event. + */ + uint16_t size; + + /** + * \brief ID of the category the event is assigned to. + * + * A category is a user-controlled ID that can be used to group + * events. The tool may use category IDs to improve filtering or + * enable grouping of events in the same category. The functions + * \ref ::nvtxNameCategoryA or \ref ::nvtxNameCategoryW can be used + * to name a category. + * + * Default Value is 0 + */ + uint32_t category; + + /** \brief Color type specified in this attribute structure. + * + * Defines the color format of the attribute structure's \ref COLOR_FIELD + * "color" field. + * + * Default Value is NVTX_COLOR_UNKNOWN + */ + int32_t colorType; /* nvtxColorType_t */ + + /** \brief Color assigned to this event. \anchor COLOR_FIELD + * + * The color that the tool should use to visualize the event. + */ + uint32_t color; + + /** + * \brief Payload type specified in this attribute structure. + * + * Defines the payload format of the attribute structure's \ref PAYLOAD_FIELD + * "payload" field. + * + * Default Value is NVTX_PAYLOAD_UNKNOWN + */ + int32_t payloadType; /* nvtxPayloadType_t */ + + int32_t reserved0; + + /** + * \brief Payload assigned to this event. \anchor PAYLOAD_FIELD + * + * A numerical value that can be used to annotate an event. The tool could + * use the payload data to reconstruct graphs and diagrams. + */ + union payload_t + { + uint64_t ullValue; + int64_t llValue; + double dValue; + /* NVTX_VERSION_2 */ + uint32_t uiValue; + int32_t iValue; + float fValue; + } payload; + + /** \brief Message type specified in this attribute structure. + * + * Defines the message format of the attribute structure's \ref MESSAGE_FIELD + * "message" field. + * + * Default Value is NVTX_MESSAGE_UNKNOWN + */ + int32_t messageType; /* nvtxMessageType_t */ + + /** \brief Message assigned to this attribute structure. \anchor MESSAGE_FIELD + * + * The text message that is attached to an event. + */ + nvtxMessageValue_t message; + +} nvtxEventAttributes_v2; + +typedef struct nvtxEventAttributes_v2 nvtxEventAttributes_t; + +/** @} */ /*END defgroup*/ +/* ========================================================================= */ +/** \defgroup MARKERS_AND_RANGES Markers and Ranges + * + * See \ref MARKERS_AND_RANGES for more details + * + * @{ + */ + +/** \name Marker */ + +/* ------------------------------------------------------------------------- */ +/** \brief Marks an instantaneous event in the application. +* +* A marker can contain a text message or specify additional information +* using the event attributes structure. These attributes include a text +* message, color, category, and a payload. Each of the attributes is optional +* and can only be sent out using the \ref nvtxDomainMarkEx function. +* +* nvtxDomainMarkEx(NULL, event) is equivalent to calling +* nvtxMarkEx(event). +* +* \param domain - The domain of scoping the category. +* \param eventAttrib - The event attribute structure defining the marker's +* attribute types and attribute values. +* +* \sa +* ::nvtxMarkEx +* +* \version \NVTX_VERSION_2 +* @{ */ +NVTX_DECLSPEC void NVTX_API nvtxDomainMarkEx(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib); +/** @} */ + +/* ------------------------------------------------------------------------- */ +/** \brief Marks an instantaneous event in the application. + * + * A marker can contain a text message or specify additional information + * using the event attributes structure. These attributes include a text + * message, color, category, and a payload. Each of the attributes is optional + * and can only be sent out using the \ref nvtxMarkEx function. + * If \ref nvtxMarkA or \ref nvtxMarkW are used to specify the marker + * or if an attribute is unspecified then a default value will be used. + * + * \param eventAttrib - The event attribute structure defining the marker's + * attribute types and attribute values. + * + * \par Example: + * \code + * // zero the structure + * nvtxEventAttributes_t eventAttrib = {0}; + * // set the version and the size information + * eventAttrib.version = NVTX_VERSION; + * eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE; + * // configure the attributes. 0 is the default for all attributes. + * eventAttrib.colorType = NVTX_COLOR_ARGB; + * eventAttrib.color = 0xFF880000; + * eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII; + * eventAttrib.message.ascii = "Example nvtxMarkEx"; + * nvtxMarkEx(&eventAttrib); + * \endcode + * + * \sa + * ::nvtxDomainMarkEx + * + * \version \NVTX_VERSION_1 + * @{ */ +NVTX_DECLSPEC void NVTX_API nvtxMarkEx(const nvtxEventAttributes_t* eventAttrib); +/** @} */ + +/* ------------------------------------------------------------------------- */ +/** \brief Marks an instantaneous event in the application. + * + * A marker created using \ref nvtxMarkA or \ref nvtxMarkW contains only a + * text message. + * + * \param message - The message associated to this marker event. + * + * \par Example: + * \code + * nvtxMarkA("Example nvtxMarkA"); + * nvtxMarkW(L"Example nvtxMarkW"); + * \endcode + * + * \sa + * ::nvtxDomainMarkEx + * ::nvtxMarkEx + * + * \version \NVTX_VERSION_0 + * @{ */ +NVTX_DECLSPEC void NVTX_API nvtxMarkA(const char* message); +NVTX_DECLSPEC void NVTX_API nvtxMarkW(const wchar_t* message); +/** @} */ + + +/** \name Process Ranges */ + +/* ------------------------------------------------------------------------- */ +/** \brief Starts a process range in a domain. +* +* \param domain - The domain of scoping the category. +* \param eventAttrib - The event attribute structure defining the range's +* attribute types and attribute values. +* +* \return The unique ID used to correlate a pair of Start and End events. +* +* \remarks Ranges defined by Start/End can overlap. +* +* \par Example: +* \code +* nvtxDomainHandle_t domain = nvtxDomainCreateA("my domain"); +* nvtxEventAttributes_t eventAttrib = {0}; +* eventAttrib.version = NVTX_VERSION; +* eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE; +* eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII; +* eventAttrib.message.ascii = "my range"; +* nvtxRangeId_t rangeId = nvtxDomainRangeStartEx(&eventAttrib); +* // ... +* nvtxDomainRangeEnd(rangeId); +* \endcode +* +* \sa +* ::nvtxDomainRangeEnd +* +* \version \NVTX_VERSION_2 +* @{ */ +NVTX_DECLSPEC nvtxRangeId_t NVTX_API nvtxDomainRangeStartEx(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib); +/** @} */ + +/* ------------------------------------------------------------------------- */ +/** \brief Starts a process range. + * + * \param eventAttrib - The event attribute structure defining the range's + * attribute types and attribute values. + * + * \return The unique ID used to correlate a pair of Start and End events. + * + * \remarks Ranges defined by Start/End can overlap. + * + * \par Example: + * \code + * nvtxEventAttributes_t eventAttrib = {0}; + * eventAttrib.version = NVTX_VERSION; + * eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE; + * eventAttrib.category = 3; + * eventAttrib.colorType = NVTX_COLOR_ARGB; + * eventAttrib.color = 0xFF0088FF; + * eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII; + * eventAttrib.message.ascii = "Example Range"; + * nvtxRangeId_t rangeId = nvtxRangeStartEx(&eventAttrib); + * // ... + * nvtxRangeEnd(rangeId); + * \endcode + * + * \sa + * ::nvtxRangeEnd + * ::nvtxDomainRangeStartEx + * + * \version \NVTX_VERSION_1 + * @{ */ +NVTX_DECLSPEC nvtxRangeId_t NVTX_API nvtxRangeStartEx(const nvtxEventAttributes_t* eventAttrib); +/** @} */ + +/* ------------------------------------------------------------------------- */ +/** \brief Starts a process range. + * + * \param message - The event message associated to this range event. + * + * \return The unique ID used to correlate a pair of Start and End events. + * + * \remarks Ranges defined by Start/End can overlap. + * + * \par Example: + * \code + * nvtxRangeId_t r1 = nvtxRangeStartA("Range 1"); + * nvtxRangeId_t r2 = nvtxRangeStartW(L"Range 2"); + * nvtxRangeEnd(r1); + * nvtxRangeEnd(r2); + * \endcode + * + * \sa + * ::nvtxRangeEnd + * ::nvtxRangeStartEx + * ::nvtxDomainRangeStartEx + * + * \version \NVTX_VERSION_0 + * @{ */ +NVTX_DECLSPEC nvtxRangeId_t NVTX_API nvtxRangeStartA(const char* message); +NVTX_DECLSPEC nvtxRangeId_t NVTX_API nvtxRangeStartW(const wchar_t* message); +/** @} */ + +/* ------------------------------------------------------------------------- */ +/** \brief Ends a process range. +* +* \param domain - The domain +* \param id - The correlation ID returned from a nvtxRangeStart call. +* +* \remarks This function is offered completeness but is an alias for ::nvtxRangeEnd. +* It does not need a domain param since that is associated iwth the range ID at ::nvtxDomainRangeStartEx +* +* \par Example: +* \code +* nvtxDomainHandle_t domain = nvtxDomainCreateA("my domain"); +* nvtxEventAttributes_t eventAttrib = {0}; +* eventAttrib.version = NVTX_VERSION; +* eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE; +* eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII; +* eventAttrib.message.ascii = "my range"; +* nvtxRangeId_t rangeId = nvtxDomainRangeStartEx(&eventAttrib); +* // ... +* nvtxDomainRangeEnd(rangeId); +* \endcode +* +* \sa +* ::nvtxDomainRangeStartEx +* +* \version \NVTX_VERSION_2 +* @{ */ +NVTX_DECLSPEC void NVTX_API nvtxDomainRangeEnd(nvtxDomainHandle_t domain, nvtxRangeId_t id); +/** @} */ + +/* ------------------------------------------------------------------------- */ +/** \brief Ends a process range. + * + * \param id - The correlation ID returned from an nvtxRangeStart call. + * + * \sa + * ::nvtxDomainRangeStartEx + * ::nvtxRangeStartEx + * ::nvtxRangeStartA + * ::nvtxRangeStartW + * + * \version \NVTX_VERSION_0 + * @{ */ +NVTX_DECLSPEC void NVTX_API nvtxRangeEnd(nvtxRangeId_t id); +/** @} */ + +/** \name Thread Ranges */ + +/* ------------------------------------------------------------------------- */ +/** \brief Starts a nested thread range. +* +* \param domain - The domain of scoping. +* \param eventAttrib - The event attribute structure defining the range's +* attribute types and attribute values. +* +* \return The 0 based level of range being started. This value is scoped to the domain. +* If an error occurs, a negative value is returned. +* +* \par Example: +* \code +* nvtxDomainHandle_t domain = nvtxDomainCreateA("example domain"); +* nvtxEventAttributes_t eventAttrib = {0}; +* eventAttrib.version = NVTX_VERSION; +* eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE; +* eventAttrib.colorType = NVTX_COLOR_ARGB; +* eventAttrib.color = 0xFFFF0000; +* eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII; +* eventAttrib.message.ascii = "Level 0"; +* nvtxDomainRangePushEx(domain, &eventAttrib); +* +* // Re-use eventAttrib +* eventAttrib.messageType = NVTX_MESSAGE_TYPE_UNICODE; +* eventAttrib.message.unicode = L"Level 1"; +* nvtxDomainRangePushEx(domain, &eventAttrib); +* +* nvtxDomainRangePop(domain); //level 1 +* nvtxDomainRangePop(domain); //level 0 +* \endcode +* +* \sa +* ::nvtxDomainRangePop +* +* \version \NVTX_VERSION_2 +* @{ */ +NVTX_DECLSPEC int NVTX_API nvtxDomainRangePushEx(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib); +/** @} */ + +/* ------------------------------------------------------------------------- */ +/** \brief Starts a nested thread range. + * + * \param eventAttrib - The event attribute structure defining the range's + * attribute types and attribute values. + * + * \return The 0 based level of range being started. This level is per domain. + * If an error occurs a negative value is returned. + * + * \par Example: + * \code + * nvtxEventAttributes_t eventAttrib = {0}; + * eventAttrib.version = NVTX_VERSION; + * eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE; + * eventAttrib.colorType = NVTX_COLOR_ARGB; + * eventAttrib.color = 0xFFFF0000; + * eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII; + * eventAttrib.message.ascii = "Level 0"; + * nvtxRangePushEx(&eventAttrib); + * + * // Re-use eventAttrib + * eventAttrib.messageType = NVTX_MESSAGE_TYPE_UNICODE; + * eventAttrib.message.unicode = L"Level 1"; + * nvtxRangePushEx(&eventAttrib); + * + * nvtxRangePop(); + * nvtxRangePop(); + * \endcode + * + * \sa + * ::nvtxDomainRangePushEx + * ::nvtxRangePop + * + * \version \NVTX_VERSION_1 + * @{ */ +NVTX_DECLSPEC int NVTX_API nvtxRangePushEx(const nvtxEventAttributes_t* eventAttrib); +/** @} */ + +/* ------------------------------------------------------------------------- */ +/** \brief Starts a nested thread range. + * + * \param message - The event message associated to this range event. + * + * \return The 0 based level of range being started. If an error occurs a + * negative value is returned. + * + * \par Example: + * \code + * nvtxRangePushA("Level 0"); + * nvtxRangePushW(L"Level 1"); + * nvtxRangePop(); + * nvtxRangePop(); + * \endcode + * + * \sa + * ::nvtxDomainRangePushEx + * ::nvtxRangePop + * + * \version \NVTX_VERSION_0 + * @{ */ +NVTX_DECLSPEC int NVTX_API nvtxRangePushA(const char* message); +NVTX_DECLSPEC int NVTX_API nvtxRangePushW(const wchar_t* message); +/** @} */ + + +/* ------------------------------------------------------------------------- */ +/** \brief Ends a nested thread range. +* +* \return The level of the range being ended. If an error occurs a negative +* value is returned on the current thread. +* +* \par Example: +* \code +* nvtxDomainHandle_t domain = nvtxDomainCreate("example library"); +* nvtxDomainRangePushA(domain, "Level 0"); +* nvtxDomainRangePushW(domain, L"Level 1"); +* nvtxDomainRangePop(domain); +* nvtxDomainRangePop(domain); +* \endcode +* +* \sa +* ::nvtxRangePushEx +* ::nvtxRangePushA +* ::nvtxRangePushW +* +* \version \NVTX_VERSION_2 +* @{ */ +NVTX_DECLSPEC int NVTX_API nvtxDomainRangePop(nvtxDomainHandle_t domain); +/** @} */ + +/* ------------------------------------------------------------------------- */ +/** \brief Ends a nested thread range. + * + * \return The level of the range being ended. If an error occurs a negative + * value is returned on the current thread. + * + * \par Example: + * \code + * nvtxRangePushA("Level 0"); + * nvtxRangePushW(L"Level 1"); + * nvtxRangePop(); + * nvtxRangePop(); + * \endcode + * + * \sa + * ::nvtxRangePushEx + * ::nvtxRangePushA + * ::nvtxRangePushW + * + * \version \NVTX_VERSION_0 + * @{ */ +NVTX_DECLSPEC int NVTX_API nvtxRangePop(void); +/** @} */ + + +/** @} */ /*END defgroup*/ +/* ========================================================================= */ +/** \defgroup RESOURCE_NAMING Resource Naming + * + * See \ref RESOURCE_NAMING for more details + * + * @{ + */ + + +/* ------------------------------------------------------------------------- */ +/** \name Functions for Generic Resource Naming*/ +/* ------------------------------------------------------------------------- */ + +/* ------------------------------------------------------------------------- */ +/** \cond SHOW_HIDDEN +* \brief Resource typing helpers. +* +* Classes are used to make it easy to create a series of resource types +* per API without collisions +*/ +#define NVTX_RESOURCE_MAKE_TYPE(CLASS, INDEX) ((((uint32_t)(NVTX_RESOURCE_CLASS_ ## CLASS))<<16)|((uint32_t)(INDEX))) +#define NVTX_RESOURCE_CLASS_GENERIC 1 +/** \endcond */ + +/* ------------------------------------------------------------------------- */ +/** \brief Generic resource type for when a resource class is not available. +* +* \sa +* ::nvtxDomainResourceCreate +* +* \version \NVTX_VERSION_2 +*/ +typedef enum nvtxResourceGenericType_t +{ + NVTX_RESOURCE_TYPE_UNKNOWN = 0, + NVTX_RESOURCE_TYPE_GENERIC_POINTER = NVTX_RESOURCE_MAKE_TYPE(GENERIC, 1), /**< Generic pointer assumed to have no collisions with other pointers. */ + NVTX_RESOURCE_TYPE_GENERIC_HANDLE = NVTX_RESOURCE_MAKE_TYPE(GENERIC, 2), /**< Generic handle assumed to have no collisions with other handles. */ + NVTX_RESOURCE_TYPE_GENERIC_THREAD_NATIVE = NVTX_RESOURCE_MAKE_TYPE(GENERIC, 3), /**< OS native thread identifier. */ + NVTX_RESOURCE_TYPE_GENERIC_THREAD_POSIX = NVTX_RESOURCE_MAKE_TYPE(GENERIC, 4) /**< POSIX pthread identifier. */ +} nvtxResourceGenericType_t; + + + +/** \brief Resource Attribute Structure. +* \anchor RESOURCE_ATTRIBUTE_STRUCTURE +* +* This structure is used to describe the attributes of a resource. The layout of +* the structure is defined by a specific version of the tools extension +* library and can change between different versions of the Tools Extension +* library. +* +* \par Initializing the Attributes +* +* The caller should always perform the following three tasks when using +* attributes: +*
    +*
  • Zero the structure +*
  • Set the version field +*
  • Set the size field +*
+* +* Zeroing the structure sets all the resource attributes types and values +* to the default value. +* +* The version and size field are used by the Tools Extension +* implementation to handle multiple versions of the attributes structure. +* +* It is recommended that the caller use one of the following to methods +* to initialize the event attributes structure: +* +* \par Method 1: Initializing nvtxEventAttributes for future compatibility +* \code +* nvtxResourceAttributes_t attribs = {0}; +* attribs.version = NVTX_VERSION; +* attribs.size = NVTX_RESOURCE_ATTRIB_STRUCT_SIZE; +* \endcode +* +* \par Method 2: Initializing nvtxEventAttributes for a specific version +* \code +* nvtxResourceAttributes_v0 attribs = {0}; +* attribs.version = 2; +* attribs.size = (uint16_t)(sizeof(nvtxResourceAttributes_v0)); +* \endcode +* +* If the caller uses Method 1 it is critical that the entire binary +* layout of the structure be configured to 0 so that all fields +* are initialized to the default value. +* +* The caller should either use both NVTX_VERSION and +* NVTX_RESOURCE_ATTRIB_STRUCT_SIZE (Method 1) or use explicit values +* and a versioned type (Method 2). Using a mix of the two methods +* will likely cause either source level incompatibility or binary +* incompatibility in the future. +* +* \par Settings Attribute Types and Values +* +* +* \par Example: +* \code +* nvtxDomainHandle_t domain = nvtxDomainCreateA("example domain"); +* +* // Initialize +* nvtxResourceAttributes_t attribs = {0}; +* attribs.version = NVTX_VERSION; +* attribs.size = NVTX_RESOURCE_ATTRIB_STRUCT_SIZE; +* +* // Configure the Attributes +* attribs.identifierType = NVTX_RESOURCE_TYPE_GENERIC_POINTER; +* attribs.identifier.pValue = (const void*)pMutex; +* attribs.messageType = NVTX_MESSAGE_TYPE_ASCII; +* attribs.message.ascii = "Single thread access to database."; +* +* nvtxResourceHandle_t handle = nvtxDomainResourceCreate(domain, attribs); +* \endcode +* +* \sa +* ::nvtxDomainResourceCreate +*/ +typedef struct nvtxResourceAttributes_v0 +{ + /** + * \brief Version flag of the structure. + * + * Needs to be set to NVTX_VERSION to indicate the version of NVTX APIs + * supported in this header file. This can optionally be overridden to + * another version of the tools extension library. + */ + uint16_t version; + + /** + * \brief Size of the structure. + * + * Needs to be set to the size in bytes of this attribute + * structure. + */ + uint16_t size; + + /** + * \brief Identifier type specifies how to interpret the identifier field + * + * Defines the identifier format of the attribute structure's \ref RESOURCE_IDENTIFIER_FIELD + * "identifier" field. + * + * Default Value is NVTX_RESOURCE_TYPE_UNKNOWN + */ + int32_t identifierType; /* values from enums following the pattern nvtxResource[name]Type_t */ + + /** + * \brief Identifier for the resource. + * \anchor RESOURCE_IDENTIFIER_FIELD + * + * An identifier may be a pointer or a handle to an OS or middleware API object. + * The resource type will assist in avoiding collisions where handles values may collide. + */ + union identifier_t + { + const void* pValue; + uint64_t ullValue; + } identifier; + + /** \brief Message type specified in this attribute structure. + * + * Defines the message format of the attribute structure's \ref RESOURCE_MESSAGE_FIELD + * "message" field. + * + * Default Value is NVTX_MESSAGE_UNKNOWN + */ + int32_t messageType; /* nvtxMessageType_t */ + + /** \brief Message assigned to this attribute structure. \anchor RESOURCE_MESSAGE_FIELD + * + * The text message that is attached to a resource. + */ + nvtxMessageValue_t message; + +} nvtxResourceAttributes_v0; + +typedef struct nvtxResourceAttributes_v0 nvtxResourceAttributes_t; + +/* \cond SHOW_HIDDEN +* \version \NVTX_VERSION_2 +*/ +#define NVTX_RESOURCE_ATTRIB_STRUCT_SIZE ( (uint16_t)( sizeof(nvtxResourceAttributes_v0) ) ) +typedef struct nvtxResourceHandle* nvtxResourceHandle_t; +/** \endcond */ + + + +/* ------------------------------------------------------------------------- */ +/** \brief Create a resource object to track and associate data with OS and middleware objects +* +* Allows users to associate an API handle or pointer with a user-provided name. +* +* +* \param domain - Domain to own the resource object +* \param attribs - Attributes to be associated with the resource +* +* \return A handle that represents the newly created resource object. +* +* \par Example: +* \code +* nvtxDomainHandle_t domain = nvtxDomainCreateA("example domain"); +* nvtxResourceAttributes_t attribs = {0}; +* attribs.version = NVTX_VERSION; +* attribs.size = NVTX_RESOURCE_ATTRIB_STRUCT_SIZE; +* attribs.identifierType = NVTX_RESOURCE_TYPE_GENERIC_POINTER; +* attribs.identifier.pValue = (const void*)pMutex; +* attribs.messageType = NVTX_MESSAGE_TYPE_ASCII; +* attribs.message.ascii = "Single thread access to database."; +* nvtxResourceHandle_t handle = nvtxDomainResourceCreate(domain, attribs); +* \endcode +* +* \sa +* ::nvtxResourceAttributes_t +* ::nvtxDomainResourceDestroy +* +* \version \NVTX_VERSION_2 +* @{ */ +NVTX_DECLSPEC nvtxResourceHandle_t NVTX_API nvtxDomainResourceCreate(nvtxDomainHandle_t domain, nvtxResourceAttributes_t* attribs); +/** @} */ + +/* ------------------------------------------------------------------------- */ +/** \brief Destroy a resource object to track and associate data with OS and middleware objects +* +* Allows users to associate an API handle or pointer with a user-provided name. +* +* \param resource - Handle to the resource in which to operate. +* +* \par Example: +* \code +* nvtxDomainHandle_t domain = nvtxDomainCreateA("example domain"); +* nvtxResourceAttributes_t attribs = {0}; +* attribs.version = NVTX_VERSION; +* attribs.size = NVTX_RESOURCE_ATTRIB_STRUCT_SIZE; +* attribs.identifierType = NVTX_RESOURCE_TYPE_GENERIC_POINTER; +* attribs.identifier.pValue = (const void*)pMutex; +* attribs.messageType = NVTX_MESSAGE_TYPE_ASCII; +* attribs.message.ascii = "Single thread access to database."; +* nvtxResourceHandle_t handle = nvtxDomainResourceCreate(domain, attribs); +* nvtxDomainResourceDestroy(handle); +* \endcode +* +* \sa +* ::nvtxDomainResourceCreate +* +* \version \NVTX_VERSION_2 +* @{ */ +NVTX_DECLSPEC void NVTX_API nvtxDomainResourceDestroy(nvtxResourceHandle_t resource); +/** @} */ + + +/** \name Functions for NVTX Category Naming*/ + +/* ------------------------------------------------------------------------- */ +/** +* \brief Annotate an NVTX category used within a domain. +* +* Categories are used to group sets of events. Each category is identified +* through a unique ID and that ID is passed into any of the marker/range +* events to assign that event to a specific category. The nvtxDomainNameCategory +* function calls allow the user to assign a name to a category ID that is +* specific to the domain. +* +* nvtxDomainNameCategory(NULL, category, name) is equivalent to calling +* nvtxNameCategory(category, name). +* +* \param domain - The domain of scoping the category. +* \param category - The category ID to name. +* \param name - The name of the category. +* +* \remarks The category names are tracked per domain. +* +* \par Example: +* \code +* nvtxDomainHandle_t domain = nvtxDomainCreateA("example"); +* nvtxDomainNameCategoryA(domain, 1, "Memory Allocation"); +* nvtxDomainNameCategoryW(domain, 2, L"Memory Transfer"); +* \endcode +* +* \version \NVTX_VERSION_2 +* @{ */ +NVTX_DECLSPEC void NVTX_API nvtxDomainNameCategoryA(nvtxDomainHandle_t domain, uint32_t category, const char* name); +NVTX_DECLSPEC void NVTX_API nvtxDomainNameCategoryW(nvtxDomainHandle_t domain, uint32_t category, const wchar_t* name); +/** @} */ + +/** \brief Annotate an NVTX category. + * + * Categories are used to group sets of events. Each category is identified + * through a unique ID and that ID is passed into any of the marker/range + * events to assign that event to a specific category. The nvtxNameCategory + * function calls allow the user to assign a name to a category ID. + * + * \param category - The category ID to name. + * \param name - The name of the category. + * + * \remarks The category names are tracked per process. + * + * \par Example: + * \code + * nvtxNameCategory(1, "Memory Allocation"); + * nvtxNameCategory(2, "Memory Transfer"); + * nvtxNameCategory(3, "Memory Object Lifetime"); + * \endcode + * + * \version \NVTX_VERSION_1 + * @{ */ +NVTX_DECLSPEC void NVTX_API nvtxNameCategoryA(uint32_t category, const char* name); +NVTX_DECLSPEC void NVTX_API nvtxNameCategoryW(uint32_t category, const wchar_t* name); +/** @} */ + +/** \name Functions for OS Threads Naming*/ + +/* ------------------------------------------------------------------------- */ +/** \brief Annotate an OS thread. + * + * Allows the user to name an active thread of the current process. If an + * invalid thread ID is provided or a thread ID from a different process is + * used the behavior of the tool is implementation dependent. + * + * Tools expect thread ID to be a number that uniquely identifies the thread + * at the time of the call. Note that a thread's ID can be reused after + * it is destroyed. Tools may choose how to handle aliasing of thread IDs. + * + * POSIX pthread_t type returned by pthread_self() may not comply with these + * expectations. Please use OS-specific thread ID instead of pthread_t. + * + * The thread name is associated to the default domain. To support domains + * use resource objects via ::nvtxDomainResourceCreate. + * + * \param threadId - The ID of the thread to name. + * \param name - The name of the thread. + * + * \par Examples: + * MS Windows: + * \code + * #include + * nvtxNameOsThread(GetCurrentThreadId(), "Current thread"); + * nvtxNameOsThread(GetThreadId(SomeThreadHandle), "Other thread"); + * \endcode + * + * Android: + * \code + * #include + * nvtxNameOsThreadA(gettid(), "Current thread"); + * nvtxNameOsThreadA(getpid(), "Main thread"); + * \endcode + * + * Linux: + * \code + * #include + * nvtxNameOsThreadA(syscall(SYS_gettid), "Current thread"); + * \endcode + * \code + * #include + * nvtxNameOsThreadA(getpid(), "Main thread"); + * \endcode + * + * OS X: + * \code + * #include + * nvtxNameOsThreadA(syscall(SYS_thread_selfid), "Current thread"); + * \endcode + * \code + * #include + * __uint64_t id; + * pthread_threadid_np(pthread_self(), &id); + * nvtxNameOsThreadA(id, "Current thread"); + * pthread_threadid_np(somePThreadId, &id); + * nvtxNameOsThreadA(id, "Other thread"); + * \endcode + * + * \version \NVTX_VERSION_1 + * @{ */ +NVTX_DECLSPEC void NVTX_API nvtxNameOsThreadA(uint32_t threadId, const char* name); +NVTX_DECLSPEC void NVTX_API nvtxNameOsThreadW(uint32_t threadId, const wchar_t* name); +/** @} */ + + +/** @} */ /*END defgroup*/ +/* ========================================================================= */ +/** \defgroup STRING_REGISTRATION String Registration +* +* Registered strings are intended to increase performance by lowering instrumentation +* overhead. String may be registered once and the handle may be passed in place of +* a string where an the APIs may allow. +* +* See \ref STRING_REGISTRATION for more details +* +* @{ +*/ + +/* ------------------------------------------------------------------------- */ +/** \brief Register a string. + +* Registers an immutable string with NVTX. Once registered the pointer used +* to register the domain name can be used in nvtxEventAttributes_t +* \ref MESSAGE_FIELD. This allows NVTX implementation to skip copying the +* contents of the message on each event invocation. +* +* String registration is an optimization. It is recommended to use string +* registration if the string will be passed to an event many times. +* +* String are not unregistered, except that by unregistering the entire domain +* +* \param domain - Domain handle. If NULL then the global domain is used. +* \param string - A unique pointer to a sequence of characters. +* +* \return A handle representing the registered string. +* +* \par Example: +* \code +* nvtxDomainCreateA("com.nvidia.nvtx.example"); +* nvtxStringHandle_t message = nvtxDomainRegisterStringA(domain, "registered string"); +* nvtxEventAttributes_t eventAttrib = {0}; +* eventAttrib.version = NVTX_VERSION; +* eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE; +* eventAttrib.messageType = NVTX_MESSAGE_TYPE_REGISTERED; +* eventAttrib.message.registered = message; +* \endcode +* +* \version \NVTX_VERSION_2 +* @{ */ +NVTX_DECLSPEC nvtxStringHandle_t NVTX_API nvtxDomainRegisterStringA(nvtxDomainHandle_t domain, const char* string); +NVTX_DECLSPEC nvtxStringHandle_t NVTX_API nvtxDomainRegisterStringW(nvtxDomainHandle_t domain, const wchar_t* string); +/** @} */ + +/** @} */ /*END defgroup*/ +/* ========================================================================= */ +/** \defgroup DOMAINS Domains +* +* Domains are used to group events to a developer defined scope. Middleware +* vendors may also scope their own events to avoid collisions with the +* the application developer's events, so that the application developer may +* inspect both parts and easily differentiate or filter them. By default +* all events are scoped to a global domain where NULL is provided or when +* using APIs provided b versions of NVTX below v2 +* +* Domains are intended to be typically long lived objects with the intention +* of logically separating events of large modules from each other such as +* middleware libraries from each other and the main application. +* +* See \ref DOMAINS for more details +* +* @{ +*/ + +/* ------------------------------------------------------------------------- */ +/** \brief Register a NVTX domain. +* +* Domains are used to scope annotations. All NVTX_VERSION_0 and NVTX_VERSION_1 +* annotations are scoped to the global domain. The function nvtxDomainCreate +* creates a new named domain. +* +* Each domain maintains its own nvtxRangePush and nvtxRangePop stack. +* +* \param name - A unique string representing the domain. +* +* \return A handle representing the domain. +* +* \par Example: +* \code +* nvtxDomainHandle_t domain = nvtxDomainCreateA("com.nvidia.nvtx.example"); +* +* nvtxMarkA("nvtxMarkA to global domain"); +* +* nvtxEventAttributes_t eventAttrib1 = {0}; +* eventAttrib1.version = NVTX_VERSION; +* eventAttrib1.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE; +* eventAttrib1.message.ascii = "nvtxDomainMarkEx to global domain"; +* nvtxDomainMarkEx(NULL, &eventAttrib1); +* +* nvtxEventAttributes_t eventAttrib2 = {0}; +* eventAttrib2.version = NVTX_VERSION; +* eventAttrib2.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE; +* eventAttrib2.message.ascii = "nvtxDomainMarkEx to com.nvidia.nvtx.example"; +* nvtxDomainMarkEx(domain, &eventAttrib2); +* nvtxDomainDestroy(domain); +* \endcode +* +* \sa +* ::nvtxDomainDestroy +* +* \version \NVTX_VERSION_2 +* @{ */ +NVTX_DECLSPEC nvtxDomainHandle_t NVTX_API nvtxDomainCreateA(const char* name); +NVTX_DECLSPEC nvtxDomainHandle_t NVTX_API nvtxDomainCreateW(const wchar_t* name); +/** @} */ + +/* ------------------------------------------------------------------------- */ +/** \brief Unregister a NVTX domain. +* +* Unregisters the domain handle and frees all domain specific resources. +* +* \param domain - the domain handle +* +* \par Example: +* \code +* nvtxDomainHandle_t domain = nvtxDomainCreateA("com.nvidia.nvtx.example"); +* nvtxDomainDestroy(domain); +* \endcode +* +* \sa +* ::nvtxDomainCreateA +* ::nvtxDomainCreateW +* +* \version \NVTX_VERSION_2 +* @{ */ +NVTX_DECLSPEC void NVTX_API nvtxDomainDestroy(nvtxDomainHandle_t domain); +/** @} */ + + +/** @} */ /*END defgroup*/ +/* ========================================================================= */ +/** \cond SHOW_HIDDEN */ + +#ifdef UNICODE + #define nvtxMark nvtxMarkW + #define nvtxRangeStart nvtxRangeStartW + #define nvtxRangePush nvtxRangePushW + #define nvtxNameCategory nvtxNameCategoryW + #define nvtxNameOsThread nvtxNameOsThreadW + /* NVTX_VERSION_2 */ + #define nvtxDomainCreate nvtxDomainCreateW + #define nvtxDomainRegisterString nvtxDomainRegisterStringW + #define nvtxDomainNameCategory nvtxDomainNameCategoryW +#else + #define nvtxMark nvtxMarkA + #define nvtxRangeStart nvtxRangeStartA + #define nvtxRangePush nvtxRangePushA + #define nvtxNameCategory nvtxNameCategoryA + #define nvtxNameOsThread nvtxNameOsThreadA + /* NVTX_VERSION_2 */ + #define nvtxDomainCreate nvtxDomainCreateA + #define nvtxDomainRegisterString nvtxDomainRegisterStringA + #define nvtxDomainNameCategory nvtxDomainNameCategoryA +#endif + +/** \endcond */ + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#define NVTX_IMPL_GUARD /* Ensure other headers cannot included directly */ + +#include "nvtxDetail/nvtxTypes.h" + +#ifndef NVTX_NO_IMPL +#include "nvtxDetail/nvtxImpl.h" +#endif /*NVTX_NO_IMPL*/ + +#undef NVTX_IMPL_GUARD + +#endif /* !defined(NVTX_VERSION) */ diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvToolsExtCuda.h b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvToolsExtCuda.h new file mode 100644 index 0000000000000000000000000000000000000000..8dec2838f10b2b4c91bc3b91624c74155c4c717e --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvToolsExtCuda.h @@ -0,0 +1,141 @@ +/* +* Copyright 2009-2022 NVIDIA Corporation. All rights reserved. +* +* Licensed under the Apache License v2.0 with LLVM Exceptions. +* See https://llvm.org/LICENSE.txt for license information. +* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +*/ + +#include "nvToolsExt.h" + +#include "cuda.h" + +#ifndef NVTOOLSEXT_CUDA_V3 +#define NVTOOLSEXT_CUDA_V3 + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* ========================================================================= */ +/** \name Functions for CUDA Resource Naming +*/ +/** \addtogroup RESOURCE_NAMING + * \section RESOURCE_NAMING_CUDA CUDA Resource Naming + * + * This section covers the API functions that allow to annotate CUDA resources + * with user-provided names. + * + * @{ + */ + +/* ------------------------------------------------------------------------- */ +/* \cond SHOW_HIDDEN +* \brief Used to build a non-colliding value for resource types separated class +* \version \NVTX_VERSION_2 +*/ +#define NVTX_RESOURCE_CLASS_CUDA 4 +/** \endcond */ + +/* ------------------------------------------------------------------------- */ +/** \brief Resource types for CUDA +*/ +typedef enum nvtxResourceCUDAType_t +{ + NVTX_RESOURCE_TYPE_CUDA_DEVICE = NVTX_RESOURCE_MAKE_TYPE(CUDA, 1), /* CUdevice */ + NVTX_RESOURCE_TYPE_CUDA_CONTEXT = NVTX_RESOURCE_MAKE_TYPE(CUDA, 2), /* CUcontext */ + NVTX_RESOURCE_TYPE_CUDA_STREAM = NVTX_RESOURCE_MAKE_TYPE(CUDA, 3), /* CUstream */ + NVTX_RESOURCE_TYPE_CUDA_EVENT = NVTX_RESOURCE_MAKE_TYPE(CUDA, 4), /* CUevent */ +} nvtxResourceCUDAType_t; + + +/* ------------------------------------------------------------------------- */ +/** \brief Annotates a CUDA device. + * + * Allows the user to associate a CUDA device with a user-provided name. + * + * \param device - The handle of the CUDA device to name. + * \param name - The name of the CUDA device. + * + * \version \NVTX_VERSION_1 + * @{ */ +NVTX_DECLSPEC void NVTX_API nvtxNameCuDeviceA(CUdevice device, const char* name); +NVTX_DECLSPEC void NVTX_API nvtxNameCuDeviceW(CUdevice device, const wchar_t* name); +/** @} */ + +/* ------------------------------------------------------------------------- */ +/** \brief Annotates a CUDA context. + * + * Allows the user to associate a CUDA context with a user-provided name. + * + * \param context - The handle of the CUDA context to name. + * \param name - The name of the CUDA context. + * + * \par Example: + * \code + * CUresult status = cuCtxCreate( &cuContext, 0, cuDevice ); + * if ( CUDA_SUCCESS != status ) + * goto Error; + * nvtxNameCuContext(cuContext, "CTX_NAME"); + * \endcode + * + * \version \NVTX_VERSION_1 + * @{ */ +NVTX_DECLSPEC void NVTX_API nvtxNameCuContextA(CUcontext context, const char* name); +NVTX_DECLSPEC void NVTX_API nvtxNameCuContextW(CUcontext context, const wchar_t* name); +/** @} */ + +/* ------------------------------------------------------------------------- */ +/** \brief Annotates a CUDA stream. + * + * Allows the user to associate a CUDA stream with a user-provided name. + * + * \param stream - The handle of the CUDA stream to name. + * \param name - The name of the CUDA stream. + * + * \version \NVTX_VERSION_1 + * @{ */ +NVTX_DECLSPEC void NVTX_API nvtxNameCuStreamA(CUstream stream, const char* name); +NVTX_DECLSPEC void NVTX_API nvtxNameCuStreamW(CUstream stream, const wchar_t* name); +/** @} */ + +/* ------------------------------------------------------------------------- */ +/** \brief Annotates a CUDA event. + * + * Allows the user to associate a CUDA event with a user-provided name. + * + * \param event - The handle of the CUDA event to name. + * \param name - The name of the CUDA event. + * + * \version \NVTX_VERSION_1 + * @{ */ +NVTX_DECLSPEC void NVTX_API nvtxNameCuEventA(CUevent event, const char* name); +NVTX_DECLSPEC void NVTX_API nvtxNameCuEventW(CUevent event, const wchar_t* name); +/** @} */ + +/** @} */ /* END RESOURCE_NAMING */ + +/* ========================================================================= */ +#ifdef UNICODE + #define nvtxNameCuDevice nvtxNameCuDeviceW + #define nvtxNameCuContext nvtxNameCuContextW + #define nvtxNameCuStream nvtxNameCuStreamW + #define nvtxNameCuEvent nvtxNameCuEventW +#else + #define nvtxNameCuDevice nvtxNameCuDeviceA + #define nvtxNameCuContext nvtxNameCuContextA + #define nvtxNameCuStream nvtxNameCuStreamA + #define nvtxNameCuEvent nvtxNameCuEventA +#endif + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#ifndef NVTX_NO_IMPL +#define NVTX_IMPL_GUARD_CUDA /* Ensure other headers cannot included directly */ +#include "nvtxDetail/nvtxImplCuda_v3.h" +#undef NVTX_IMPL_GUARD_CUDA +#endif /*NVTX_NO_IMPL*/ + +#endif /* NVTOOLSEXT_CUDA_V3 */ diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvToolsExtCudaRt.h b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvToolsExtCudaRt.h new file mode 100644 index 0000000000000000000000000000000000000000..7119c14e7749d6c0857a86bdcb679bd2045dcf24 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvToolsExtCudaRt.h @@ -0,0 +1,117 @@ +/* +* Copyright 2009-2022 NVIDIA Corporation. All rights reserved. +* +* Licensed under the Apache License v2.0 with LLVM Exceptions. +* See https://llvm.org/LICENSE.txt for license information. +* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +*/ + +#include "nvToolsExt.h" + +#include "cuda.h" +#include "driver_types.h" + +#ifndef NVTOOLSEXT_CUDART_V3 +#define NVTOOLSEXT_CUDART_V3 + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* ========================================================================= */ +/** \name Functions for CUDA Resource Naming +*/ +/** \addtogroup RESOURCE_NAMING + * \section RESOURCE_NAMING_CUDART CUDA Runtime Resource Naming + * + * This section covers the API functions that allow to annotate CUDA resources + * with user-provided names. + * + * @{ + */ + +/* ------------------------------------------------------------------------- */ +/* \cond SHOW_HIDDEN +* \brief Used to build a non-colliding value for resource types separated class +* \version \NVTX_VERSION_2 +*/ +#define NVTX_RESOURCE_CLASS_CUDART 5 +/** \endcond */ + +/* ------------------------------------------------------------------------- */ +/** \brief Resource types for CUDART +*/ +typedef enum nvtxResourceCUDARTType_t +{ + NVTX_RESOURCE_TYPE_CUDART_DEVICE = NVTX_RESOURCE_MAKE_TYPE(CUDART, 0), /* int device */ + NVTX_RESOURCE_TYPE_CUDART_STREAM = NVTX_RESOURCE_MAKE_TYPE(CUDART, 1), /* cudaStream_t */ + NVTX_RESOURCE_TYPE_CUDART_EVENT = NVTX_RESOURCE_MAKE_TYPE(CUDART, 2), /* cudaEvent_t */ +} nvtxResourceCUDARTType_t; + + +/* ------------------------------------------------------------------------- */ +/** \brief Annotates a CUDA device. + * + * Allows the user to associate a CUDA device with a user-provided name. + * + * \param device - The id of the CUDA device to name. + * \param name - The name of the CUDA device. + * + * \version \NVTX_VERSION_1 + * @{ */ +NVTX_DECLSPEC void NVTX_API nvtxNameCudaDeviceA(int device, const char* name); +NVTX_DECLSPEC void NVTX_API nvtxNameCudaDeviceW(int device, const wchar_t* name); +/** @} */ + +/* ------------------------------------------------------------------------- */ +/** \brief Annotates a CUDA stream. + * + * Allows the user to associate a CUDA stream with a user-provided name. + * + * \param stream - The handle of the CUDA stream to name. + * \param name - The name of the CUDA stream. + * + * \version \NVTX_VERSION_1 + * @{ */ +NVTX_DECLSPEC void NVTX_API nvtxNameCudaStreamA(cudaStream_t stream, const char* name); +NVTX_DECLSPEC void NVTX_API nvtxNameCudaStreamW(cudaStream_t stream, const wchar_t* name); +/** @} */ + +/* ------------------------------------------------------------------------- */ +/** \brief Annotates a CUDA event. + * + * Allows the user to associate a CUDA event with a user-provided name. + * + * \param event - The handle of the CUDA event to name. + * \param name - The name of the CUDA event. + * + * \version \NVTX_VERSION_1 + * @{ */ +NVTX_DECLSPEC void NVTX_API nvtxNameCudaEventA(cudaEvent_t event, const char* name); +NVTX_DECLSPEC void NVTX_API nvtxNameCudaEventW(cudaEvent_t event, const wchar_t* name); +/** @} */ + +/** @} */ /* END RESOURCE_NAMING */ + +/* ========================================================================= */ +#ifdef UNICODE + #define nvtxNameCudaDevice nvtxNameCudaDeviceW + #define nvtxNameCudaStream nvtxNameCudaStreamW + #define nvtxNameCudaEvent nvtxNameCudaEventW +#else + #define nvtxNameCudaDevice nvtxNameCudaDeviceA + #define nvtxNameCudaStream nvtxNameCudaStreamA + #define nvtxNameCudaEvent nvtxNameCudaEventA +#endif + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#ifndef NVTX_NO_IMPL +#define NVTX_IMPL_GUARD_CUDART /* Ensure other headers cannot included directly */ +#include "nvtxDetail/nvtxImplCudaRt_v3.h" +#undef NVTX_IMPL_GUARD_CUDART +#endif /*NVTX_NO_IMPL*/ + +#endif /* NVTOOLSEXT_CUDART_V3 */ diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvToolsExtOpenCL.h b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvToolsExtOpenCL.h new file mode 100644 index 0000000000000000000000000000000000000000..3ab1b2ef30aab6c62af23350b8cf652f09a87f72 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvToolsExtOpenCL.h @@ -0,0 +1,191 @@ +/* +* Copyright 2009-2022 NVIDIA Corporation. All rights reserved. +* +* Licensed under the Apache License v2.0 with LLVM Exceptions. +* See https://llvm.org/LICENSE.txt for license information. +* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +*/ + +#include "nvToolsExt.h" + +#include + +#ifndef NVTOOLSEXT_OPENCL_V3 +#define NVTOOLSEXT_OPENCL_V3 + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* ========================================================================= */ +/** \name Functions for OpenCL Resource Naming + */ +/** \addtogroup RESOURCE_NAMING + * \section RESOURCE_NAMING_OPENCL OpenCL Resource Naming + * + * This section covers the API functions that allow to annotate OpenCL resources + * with user-provided names. + * + * @{ + */ + +/* ------------------------------------------------------------------------- */ +/* \cond SHOW_HIDDEN +* \brief Used to build a non-colliding value for resource types separated class +* \version \NVTX_VERSION_2 +*/ +#define NVTX_RESOURCE_CLASS_OPENCL 6 +/** \endcond */ + +/* ------------------------------------------------------------------------- */ +/** \brief Resource types for OpenCL +*/ +typedef enum nvtxResourceOpenCLType_t +{ + NVTX_RESOURCE_TYPE_OPENCL_DEVICE = NVTX_RESOURCE_MAKE_TYPE(OPENCL, 1), + NVTX_RESOURCE_TYPE_OPENCL_CONTEXT = NVTX_RESOURCE_MAKE_TYPE(OPENCL, 2), + NVTX_RESOURCE_TYPE_OPENCL_COMMANDQUEUE = NVTX_RESOURCE_MAKE_TYPE(OPENCL, 3), + NVTX_RESOURCE_TYPE_OPENCL_MEMOBJECT = NVTX_RESOURCE_MAKE_TYPE(OPENCL, 4), + NVTX_RESOURCE_TYPE_OPENCL_SAMPLER = NVTX_RESOURCE_MAKE_TYPE(OPENCL, 5), + NVTX_RESOURCE_TYPE_OPENCL_PROGRAM = NVTX_RESOURCE_MAKE_TYPE(OPENCL, 6), + NVTX_RESOURCE_TYPE_OPENCL_EVENT = NVTX_RESOURCE_MAKE_TYPE(OPENCL, 7), +} nvtxResourceOpenCLType_t; + + +/* ------------------------------------------------------------------------- */ +/** \brief Annotates an OpenCL device. + * + * Allows to associate an OpenCL device with a user-provided name. + * + * \param device - The handle of the OpenCL device to name. + * \param name - The name of the OpenCL device. + * + * \version \NVTX_VERSION_1 + * @{ */ +NVTX_DECLSPEC void NVTX_API nvtxNameClDeviceA(cl_device_id device, const char* name); +NVTX_DECLSPEC void NVTX_API nvtxNameClDeviceW(cl_device_id device, const wchar_t* name); +/** @} */ + +/* ------------------------------------------------------------------------- */ +/** \brief Annotates an OpenCL context. + * + * Allows to associate an OpenCL context with a user-provided name. + * + * \param context - The handle of the OpenCL context to name. + * \param name - The name of the OpenCL context. + * + * \version \NVTX_VERSION_1 + * @{ */ +NVTX_DECLSPEC void NVTX_API nvtxNameClContextA(cl_context context, const char* name); +NVTX_DECLSPEC void NVTX_API nvtxNameClContextW(cl_context context, const wchar_t* name); +/** @} */ + +/* ------------------------------------------------------------------------- */ +/** \brief Annotates an OpenCL command queue. + * + * Allows to associate an OpenCL command queue with a user-provided name. + * + * \param command_queue - The handle of the OpenCL command queue to name. + * \param name - The name of the OpenCL command queue. + * + * \version \NVTX_VERSION_1 + * @{ */ +NVTX_DECLSPEC void NVTX_API nvtxNameClCommandQueueA(cl_command_queue command_queue, const char* name); +NVTX_DECLSPEC void NVTX_API nvtxNameClCommandQueueW(cl_command_queue command_queue, const wchar_t* name); +/** @} */ + +/* ------------------------------------------------------------------------- */ +/** \brief Annotates an OpenCL memory object. + * + * Allows to associate an OpenCL memory object with a user-provided name. + * + * \param memobj - The handle of the OpenCL memory object to name. + * \param name - The name of the OpenCL memory object. + * + * \version \NVTX_VERSION_1 + * @{ */ +NVTX_DECLSPEC void NVTX_API nvtxNameClMemObjectA(cl_mem memobj, const char* name); +NVTX_DECLSPEC void NVTX_API nvtxNameClMemObjectW(cl_mem memobj, const wchar_t* name); +/** @} */ + +/* ------------------------------------------------------------------------- */ +/** \brief Annotates an OpenCL sampler. + * + * Allows to associate an OpenCL sampler with a user-provided name. + * + * \param sampler - The handle of the OpenCL sampler to name. + * \param name - The name of the OpenCL sampler. + * + * \version \NVTX_VERSION_1 + * @{ */ +NVTX_DECLSPEC void NVTX_API nvtxNameClSamplerA(cl_sampler sampler, const char* name); +NVTX_DECLSPEC void NVTX_API nvtxNameClSamplerW(cl_sampler sampler, const wchar_t* name); +/** @} */ + +/* ------------------------------------------------------------------------- */ +/** \brief Annotates an OpenCL program. + * + * Allows to associate an OpenCL program with a user-provided name. + * + * \param program - The handle of the OpenCL program to name. + * \param name - The name of the OpenCL program. + * + * \code + * cpProgram = clCreateProgramWithSource(cxGPUContext, 1, + * (const char **) &cSourceCL, &program_length, &ciErrNum); + * shrCheckErrorEX(ciErrNum, CL_SUCCESS, pCleanup); + * nvtxNameClProgram(cpProgram, L"PROGRAM_NAME"); + * \endcode + * + * \version \NVTX_VERSION_1 + * @{ */ +NVTX_DECLSPEC void NVTX_API nvtxNameClProgramA(cl_program program, const char* name); +NVTX_DECLSPEC void NVTX_API nvtxNameClProgramW(cl_program program, const wchar_t* name); +/** @} */ + +/* ------------------------------------------------------------------------- */ +/** \brief Annotates an OpenCL event. + * + * Allows to associate an OpenCL event with a user-provided name. + * + * \param evnt - The handle of the OpenCL event to name. + * \param name - The name of the OpenCL event. + * + * \version \NVTX_VERSION_1 + * @{ */ +NVTX_DECLSPEC void NVTX_API nvtxNameClEventA(cl_event evnt, const char* name); +NVTX_DECLSPEC void NVTX_API nvtxNameClEventW(cl_event evnt, const wchar_t* name); +/** @} */ + +/** @} */ /* END RESOURCE_NAMING */ + +/* ========================================================================= */ +#ifdef UNICODE + #define nvtxNameClDevice nvtxNameClDeviceW + #define nvtxNameClContext nvtxNameClContextW + #define nvtxNameClCommandQueue nvtxNameClCommandQueueW + #define nvtxNameClMemObject nvtxNameClMemObjectW + #define nvtxNameClSampler nvtxNameClSamplerW + #define nvtxNameClProgram nvtxNameClProgramW + #define nvtxNameClEvent nvtxNameClEventW +#else + #define nvtxNameClDevice nvtxNameClDeviceA + #define nvtxNameClContext nvtxNameClContextA + #define nvtxNameClCommandQueue nvtxNameClCommandQueueA + #define nvtxNameClMemObject nvtxNameClMemObjectA + #define nvtxNameClSampler nvtxNameClSamplerA + #define nvtxNameClProgram nvtxNameClProgramA + #define nvtxNameClEvent nvtxNameClEventA +#endif + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#ifndef NVTX_NO_IMPL +#define NVTX_IMPL_GUARD_OPENCL /* Ensure other headers cannot included directly */ +#include "nvtxDetail/nvtxImplOpenCL_v3.h" +#undef NVTX_IMPL_GUARD_OPENCL +#endif /*NVTX_NO_IMPL*/ + +#endif /* NVTOOLSEXT_OPENCL_V3 */ diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvToolsExtSync.h b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvToolsExtSync.h new file mode 100644 index 0000000000000000000000000000000000000000..8a178f3c316bf86d1b653c9b54e626831275eda6 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvToolsExtSync.h @@ -0,0 +1,382 @@ +/* +* Copyright 2009-2022 NVIDIA Corporation. All rights reserved. +* +* Licensed under the Apache License v2.0 with LLVM Exceptions. +* See https://llvm.org/LICENSE.txt for license information. +* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +*/ + +#include "nvToolsExt.h" + +#ifndef NVTOOLSEXT_SYNC_V3 +#define NVTOOLSEXT_SYNC_V3 + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* \cond SHOW_HIDDEN +* \version \NVTX_VERSION_2 +*/ +#define NVTX_SYNCUSER_ATTRIB_STRUCT_SIZE ( (uint16_t)( sizeof(nvtxSyncUserAttributes_v0) ) ) +/** \endcond */ + + +/** +* \page PAGE_SYNCHRONIZATION Synchronization +* +* This section covers a subset of the API that allow users to track additional +* synchronization details of their application. Naming OS synchronization primitives +* may allow users to better understand the data collected by traced synchronization +* APIs. Additionally, a user defined synchronization object can allow the users to +* to tell the tools when the user is building their own synchronization system +* that do not rely on the OS to provide behaviors and instead use techniques like +* atomic operations and spinlocks. +* +* See module \ref SYNCHRONIZATION for details. +* +* \par Example: +* \code +* class MyMutex +* { +* volatile long bLocked; +* nvtxSyncUser_t hSync; +* public: +* MyMutex(const char* name, nvtxDomainHandle_t d){ +* bLocked = 0; +* +* nvtxSyncUserAttributes_t attribs = { 0 }; +* attribs.version = NVTX_VERSION; +* attribs.size = NVTX_SYNCUSER_ATTRIB_STRUCT_SIZE; +* attribs.messageType = NVTX_MESSAGE_TYPE_ASCII; +* attribs.message.ascii = name; +* hSync = nvtxDomainSyncUserCreate(d, &attribs); +* } +* +* ~MyMutex() { +* nvtxDomainSyncUserDestroy(hSync); +* } +* +* bool Lock() { +* nvtxDomainSyncUserAcquireStart(hSync); +* bool acquired = __sync_bool_compare_and_swap(&bLocked, 0, 1);//atomic compiler intrinsic + +* if (acquired) { +* nvtxDomainSyncUserAcquireSuccess(hSync); +* } +* else { +* nvtxDomainSyncUserAcquireFailed(hSync); +* } +* return acquired; +* } + +* void Unlock() { +* nvtxDomainSyncUserReleasing(hSync); +* bLocked = false; +* } +* }; +* \endcode +* +* \version \NVTX_VERSION_2 +*/ + +/* ------------------------------------------------------------------------- */ +/* \cond SHOW_HIDDEN +* \brief Used to build a non-colliding value for resource types separated class +* \version \NVTX_VERSION_2 +*/ +#define NVTX_RESOURCE_CLASS_SYNC_OS 2 /**< Synchronization objects that are OS specific. */ +#define NVTX_RESOURCE_CLASS_SYNC_PTHREAD 3 /**< Synchronization objects that are from the POSIX Threads API (pthread)*/ +/** \endcond */ + + +/* ------------------------------------------------------------------------- */ +/** \defgroup SYNCHRONIZATION Synchronization +* See page \ref PAGE_SYNCHRONIZATION. +* @{ +*/ + +/** \brief Resource type values for OSs with POSIX Thread API support + */ +typedef enum nvtxResourceSyncPosixThreadType_t +{ + NVTX_RESOURCE_TYPE_SYNC_PTHREAD_MUTEX = NVTX_RESOURCE_MAKE_TYPE(SYNC_PTHREAD, 1), /* pthread_mutex_t */ + NVTX_RESOURCE_TYPE_SYNC_PTHREAD_CONDITION = NVTX_RESOURCE_MAKE_TYPE(SYNC_PTHREAD, 2), /* pthread_cond_t */ + NVTX_RESOURCE_TYPE_SYNC_PTHREAD_RWLOCK = NVTX_RESOURCE_MAKE_TYPE(SYNC_PTHREAD, 3), /* pthread_rwlock_t */ + NVTX_RESOURCE_TYPE_SYNC_PTHREAD_BARRIER = NVTX_RESOURCE_MAKE_TYPE(SYNC_PTHREAD, 4), /* pthread_barrier_t */ + NVTX_RESOURCE_TYPE_SYNC_PTHREAD_SPINLOCK = NVTX_RESOURCE_MAKE_TYPE(SYNC_PTHREAD, 5), /* pthread_spinlock_t */ + NVTX_RESOURCE_TYPE_SYNC_PTHREAD_ONCE = NVTX_RESOURCE_MAKE_TYPE(SYNC_PTHREAD, 6) /* pthread_once_t */ +} nvtxResourceSyncPosixThreadType_t; + +/** \brief Resource type values for Windows OSs +*/ +typedef enum nvtxResourceSyncWindowsType_t +{ + NVTX_RESOURCE_TYPE_SYNC_WINDOWS_MUTEX = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 1), + NVTX_RESOURCE_TYPE_SYNC_WINDOWS_SEMAPHORE = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 2), + NVTX_RESOURCE_TYPE_SYNC_WINDOWS_EVENT = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 3), + NVTX_RESOURCE_TYPE_SYNC_WINDOWS_CRITICAL_SECTION = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 4), + NVTX_RESOURCE_TYPE_SYNC_WINDOWS_SRWLOCK = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 5) +} nvtxResourceSyncWindowsType_t; + +/** \brief Resource type values for Linux and Linux derived OSs such as Android +* \sa +* ::nvtxResourceSyncPosixThreadType_t +*/ +typedef enum nvtxResourceSyncLinuxType_t +{ + NVTX_RESOURCE_TYPE_SYNC_LINUX_MUTEX = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 1), + NVTX_RESOURCE_TYPE_SYNC_LINUX_FUTEX = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 2), + NVTX_RESOURCE_TYPE_SYNC_LINUX_SEMAPHORE = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 3), + NVTX_RESOURCE_TYPE_SYNC_LINUX_COMPLETION = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 4), + NVTX_RESOURCE_TYPE_SYNC_LINUX_SPINLOCK = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 5), + NVTX_RESOURCE_TYPE_SYNC_LINUX_SEQLOCK = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 6), + NVTX_RESOURCE_TYPE_SYNC_LINUX_RCU = NVTX_RESOURCE_MAKE_TYPE(SYNC_OS, 7) +} nvtxResourceSyncLinuxType_t; + +/** \brief Resource type values for Android come from Linux. +* \sa +* ::nvtxResourceSyncLinuxType_t +* ::nvtxResourceSyncPosixThreadType_t +*/ +typedef enum nvtxResourceSyncLinuxType_t nvtxResourceSyncAndroidType_t; + +/** \brief User Defined Synchronization Object Handle . +* \anchor SYNCUSER_HANDLE_STRUCTURE +* +* This structure is opaque to the user and is used as a handle to reference +* a user defined syncrhonization object. The tools will return a pointer through the API for the application +* to hold on it's behalf to reference the string in the future. +* +*/ +typedef struct nvtxSyncUser* nvtxSyncUser_t; + +/** \brief User Defined Synchronization Object Attributes Structure. +* \anchor USERDEF_SYNC_ATTRIBUTES_STRUCTURE +* +* This structure is used to describe the attributes of a user defined synchronization +* object. The layout of the structure is defined by a specific version of the tools +* extension library and can change between different versions of the Tools Extension +* library. +* +* \par Initializing the Attributes +* +* The caller should always perform the following three tasks when using +* attributes: +*
    +*
  • Zero the structure +*
  • Set the version field +*
  • Set the size field +*
+* +* Zeroing the structure sets all the event attributes types and values +* to the default value. +* +* The version and size field are used by the Tools Extension +* implementation to handle multiple versions of the attributes structure. +* +* It is recommended that the caller use one of the following to methods +* to initialize the event attributes structure: +* +* \par Method 1: Initializing nvtxEventAttributes for future compatibility +* \code +* nvtxSyncUserAttributes_t attribs = {0}; +* attribs.version = NVTX_VERSION; +* attribs.size = NVTX_SYNCUSER_ATTRIB_STRUCT_SIZE; +* \endcode +* +* \par Method 2: Initializing nvtxSyncUserAttributes_t for a specific version +* \code +* nvtxSyncUserAttributes_t attribs = {0}; +* attribs.version = 1; +* attribs.size = (uint16_t)(sizeof(nvtxSyncUserAttributes_t)); +* \endcode +* +* If the caller uses Method 1 it is critical that the entire binary +* layout of the structure be configured to 0 so that all fields +* are initialized to the default value. +* +* The caller should either use both NVTX_VERSION and +* NVTX_SYNCUSER_ATTRIB_STRUCT_SIZE (Method 1) or use explicit values +* and a versioned type (Method 2). Using a mix of the two methods +* will likely cause either source level incompatibility or binary +* incompatibility in the future. +* +* \par Settings Attribute Types and Values +* +* +* \par Example: +* \code +* // Initialize +* nvtxSyncUserAttributes_t attribs = {0}; +* attribs.version = NVTX_VERSION; +* attribs.size = NVTX_SYNCUSER_ATTRIB_STRUCT_SIZE; +* +* // Configure the Attributes +* attribs.messageType = NVTX_MESSAGE_TYPE_ASCII; +* attribs.message.ascii = "Example"; +* \endcode +* +* \sa +* ::nvtxDomainSyncUserCreate +*/ +typedef struct nvtxSyncUserAttributes_v0 +{ + /** + * \brief Version flag of the structure. + * + * Needs to be set to NVTX_VERSION to indicate the version of NVTX APIs + * supported in this header file. This can optionally be overridden to + * another version of the tools extension library. + */ + uint16_t version; + + /** + * \brief Size of the structure. + * + * Needs to be set to the size in bytes of the event attribute + * structure used to specify the event. + */ + uint16_t size; + + /** \brief Message type specified in this attribute structure. + * + * Defines the message format of the attribute structure's \ref nvtxSyncUserAttributes_v0::message + * "message" field. + * + * Default Value is NVTX_MESSAGE_UNKNOWN + */ + int32_t messageType; /* nvtxMessageType_t */ + + /** \brief Message assigned to this attribute structure. + * + * The text message that is attached to an event. + */ + nvtxMessageValue_t message; + +} nvtxSyncUserAttributes_v0; + +typedef struct nvtxSyncUserAttributes_v0 nvtxSyncUserAttributes_t; + +/* ------------------------------------------------------------------------- */ +/** \brief Create a user defined synchronization object +* This is used to track non-OS synchronization working with spinlocks and atomics +* +* \param domain - Domain to own the resource +* \param attribs - A structure to assign multiple attributes to the object. +* +* \return A handle that represents the newly created user defined synchronization object. +* +* \sa +* ::nvtxDomainSyncUserCreate +* ::nvtxDomainSyncUserDestroy +* ::nvtxDomainSyncUserAcquireStart +* ::nvtxDomainSyncUserAcquireFailed +* ::nvtxDomainSyncUserAcquireSuccess +* ::nvtxDomainSyncUserReleasing +* +* \version \NVTX_VERSION_2 +*/ +NVTX_DECLSPEC nvtxSyncUser_t NVTX_API nvtxDomainSyncUserCreate(nvtxDomainHandle_t domain, const nvtxSyncUserAttributes_t* attribs); + +/* ------------------------------------------------------------------------- */ +/** \brief Destroy a user defined synchronization object +* This is used to track non-OS synchronization working with spinlocks and atomics +* +* \param handle - A handle to the object to operate on. +* +* \sa +* ::nvtxDomainSyncUserCreate +* ::nvtxDomainSyncUserDestroy +* ::nvtxDomainSyncUserAcquireStart +* ::nvtxDomainSyncUserAcquireFailed +* ::nvtxDomainSyncUserAcquireSuccess +* ::nvtxDomainSyncUserReleasing +* +* \version \NVTX_VERSION_2 +*/ +NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserDestroy(nvtxSyncUser_t handle); + +/* ------------------------------------------------------------------------- */ +/** \brief Signal to tools that an attempt to acquire a user defined synchronization object +* +* \param handle - A handle to the object to operate on. +* +* \sa +* ::nvtxDomainSyncUserCreate +* ::nvtxDomainSyncUserDestroy +* ::nvtxDomainSyncUserAcquireStart +* ::nvtxDomainSyncUserAcquireFailed +* ::nvtxDomainSyncUserAcquireSuccess +* ::nvtxDomainSyncUserReleasing +* +* \version \NVTX_VERSION_2 +*/ +NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserAcquireStart(nvtxSyncUser_t handle); + +/* ------------------------------------------------------------------------- */ +/** \brief Signal to tools of failure in acquiring a user defined synchronization object +* This should be called after \ref nvtxDomainSyncUserAcquireStart +* +* \param handle - A handle to the object to operate on. +* +* \sa +* ::nvtxDomainSyncUserCreate +* ::nvtxDomainSyncUserDestroy +* ::nvtxDomainSyncUserAcquireStart +* ::nvtxDomainSyncUserAcquireFailed +* ::nvtxDomainSyncUserAcquireSuccess +* ::nvtxDomainSyncUserReleasing +* +* \version \NVTX_VERSION_2 +*/NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserAcquireFailed(nvtxSyncUser_t handle); + +/* ------------------------------------------------------------------------- */ +/** \brief Signal to tools of success in acquiring a user defined synchronization object +* This should be called after \ref nvtxDomainSyncUserAcquireStart. +* +* \param handle - A handle to the object to operate on. +* +* \sa +* ::nvtxDomainSyncUserCreate +* ::nvtxDomainSyncUserDestroy +* ::nvtxDomainSyncUserAcquireStart +* ::nvtxDomainSyncUserAcquireFailed +* ::nvtxDomainSyncUserAcquireSuccess +* ::nvtxDomainSyncUserReleasing +* +* \version \NVTX_VERSION_2 +*/NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserAcquireSuccess(nvtxSyncUser_t handle); + +/* ------------------------------------------------------------------------- */ +/** \brief Signal to tools of releasing a reservation on user defined synchronization object +* This should be called after \ref nvtxDomainSyncUserAcquireSuccess. +* +* \param handle - A handle to the object to operate on. +* +* \sa +* ::nvtxDomainSyncUserCreate +* ::nvtxDomainSyncUserDestroy +* ::nvtxDomainSyncUserAcquireStart +* ::nvtxDomainSyncUserAcquireFailed +* ::nvtxDomainSyncUserAcquireSuccess +* ::nvtxDomainSyncUserReleasing +* +* \version \NVTX_VERSION_2 +*/ +NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserReleasing(nvtxSyncUser_t handle); + + +/** @} */ /*END defgroup*/ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#ifndef NVTX_NO_IMPL +#define NVTX_IMPL_GUARD_SYNC /* Ensure other headers cannot included directly */ +#include "nvtxDetail/nvtxImplSync_v3.h" +#undef NVTX_IMPL_GUARD_SYNC +#endif /*NVTX_NO_IMPL*/ + +#endif /* NVTOOLSEXT_SYNC_V3 */ diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtx3.hpp b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtx3.hpp new file mode 100644 index 0000000000000000000000000000000000000000..31f51b8e34b4020d3813a0a787823cf184ac7bef --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtx3.hpp @@ -0,0 +1,2889 @@ +/* + * Copyright (c) 2020-2022, NVIDIA CORPORATION. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* Temporary helper #defines, #undef'ed at end of header */ +#define NVTX3_CPP_VERSION_MAJOR 1 +#define NVTX3_CPP_VERSION_MINOR 0 + +/* This section handles the decision of whether to provide unversioned symbols. + * If NVTX3_CPP_REQUIRE_EXPLICIT_VERSION is #defined, unversioned symbols are + * not provided, and explicit-version symbols such as nvtx3::v1::scoped_range + * and NVTX3_V1_FUNC_RANGE must be used. By default, the first #include of this + * header will define the unversioned symbols such as nvtx3::scoped_range and + * NVTX3_FUNC_RANGE. Subsequently including a different major version of this + * header without #defining NVTX3_CPP_REQUIRE_EXPLICIT_VERSION triggers an error + * since the symbols would conflict. Subsequently including of a different + * minor version within the same major version is allowed. Functionality of + * minor versions is cumulative, regardless of include order. + * + * Since NVTX3_CPP_REQUIRE_EXPLICIT_VERSION allows all combinations of versions + * to coexist without problems within a translation unit, the recommended best + * practice for instrumenting header-based libraries with NVTX C++ Wrappers is + * is to #define NVTX3_CPP_REQUIRE_EXPLICIT_VERSION before including nvtx3.hpp, + * #undef it afterward, and only use explicit-version symbols. This is not + * necessary in common cases, such as instrumenting a standalone application, or + * static/shared libraries in .cpp files or headers private to those projects. + */ +/* clang-format off */ +#if !defined(NVTX3_CPP_REQUIRE_EXPLICIT_VERSION) + /* Define macro used by all definitions in this header to indicate the + * unversioned symbols should be defined in addition to the versioned ones. + */ + #define NVTX3_INLINE_THIS_VERSION + + #if !defined(NVTX3_CPP_INLINED_VERSION_MAJOR) + /* First occurrence of this header in the translation unit. Define macros + * indicating which version shall be used for unversioned symbols. + */ + + /** + * @brief Semantic major version number for NVTX C++ wrappers of unversioned symbols + * + * Breaking changes may occur between major versions, and different major versions + * cannot provide unversioned symbols in the same translation unit (.cpp file). + * + * Note: If NVTX3_CPP_REQUIRE_EXPLICIT_VERSION is defined, this macro is not defined. + * + * Not to be confused with the version number of the NVTX core library. + */ + #define NVTX3_CPP_INLINED_VERSION_MAJOR 1 // NVTX3_CPP_VERSION_MAJOR + + /** + * @brief Semantic minor version number for NVTX C++ wrappers of unversioned symbols + * + * No breaking changes occur between minor versions -- minor version changes within + * a major version are purely additive. + * + * Note: If NVTX3_CPP_REQUIRE_EXPLICIT_VERSION is defined, this macro is not defined. + * + * Not to be confused with the version number of the NVTX core library. + */ + #define NVTX3_CPP_INLINED_VERSION_MINOR 0 // NVTX3_CPP_VERSION_MINOR + #elif NVTX3_CPP_INLINED_VERSION_MAJOR != NVTX3_CPP_VERSION_MAJOR + /* Unsupported case -- cannot define unversioned symbols for different major versions + * in the same translation unit. + */ + #error \ + "Two different major versions of the NVTX C++ Wrappers are being included in a single .cpp file, with unversioned symbols enabled in both. Only one major version can enable unversioned symbols in a .cpp file. To disable unversioned symbols, #define NVTX3_CPP_REQUIRE_EXPLICIT_VERSION before #including nvtx3.hpp, and use the explicit-version symbols instead -- this is the preferred way to use nvtx3.hpp from a header file." + #elif (NVTX3_CPP_INLINED_VERSION_MAJOR == NVTX3_CPP_VERSION_MAJOR) && \ + (NVTX3_CPP_INLINED_VERSION_MINOR < NVTX3_CPP_VERSION_MINOR) + /* An older minor version of the same major version already defined unversioned + * symbols. The new features provided in this header will be inlined + * redefine the minor version macro to this header's version. + */ + #undef NVTX3_CPP_INLINED_VERSION_MINOR + #define NVTX3_CPP_INLINED_VERSION_MINOR 0 // NVTX3_CPP_VERSION_MINOR + // else, already have this version or newer, nothing to do + #endif +#endif +/* clang-format on */ + +/** + * @file nvtx3.hpp + * + * @brief Provides C++ constructs making the NVTX library safer and easier to + * use with zero overhead. + */ + +/** + * \mainpage + * \tableofcontents + * + * \section QUICK_START Quick Start + * + * To add NVTX ranges to your code, use the `nvtx3::scoped_range` RAII object. A + * range begins when the object is created, and ends when the object is + * destroyed. + * + * \code{.cpp} + * #include "nvtx3.hpp" + * void some_function() { + * // Begins a NVTX range with the messsage "some_function" + * // The range ends when some_function() returns and `r` is destroyed + * nvtx3::scoped_range r{"some_function"}; + * + * for(int i = 0; i < 6; ++i) { + * nvtx3::scoped_range loop{"loop range"}; + * std::this_thread::sleep_for(std::chrono::seconds{1}); + * } + * } // Range ends when `r` is destroyed + * \endcode + * + * The example code above generates the following timeline view in Nsight + * Systems: + * + * \image html + * https://raw.githubusercontent.com/NVIDIA/NVTX/release-v3/docs/images/example_range.png + * + * Alternatively, use the \ref MACROS like `NVTX3_FUNC_RANGE()` to add + * ranges to your code that automatically use the name of the enclosing function + * as the range's message. + * + * \code{.cpp} + * #include "nvtx3.hpp" + * void some_function() { + * // Creates a range with a message "some_function" that ends when the + * // enclosing function returns + * NVTX3_FUNC_RANGE(); + * ... + * } + * \endcode + * + * + * \section Overview + * + * The NVTX library provides a set of functions for users to annotate their code + * to aid in performance profiling and optimization. These annotations provide + * information to tools like Nsight Systems to improve visualization of + * application timelines. + * + * \ref RANGES are one of the most commonly used NVTX constructs for annotating + * a span of time. For example, imagine a user wanted to see every time a + * function, `my_function`, is called and how long it takes to execute. This can + * be accomplished with an NVTX range created on the entry to the function and + * terminated on return from `my_function` using the push/pop C APIs: + * + * \code{.cpp} + * void my_function(...) { + * nvtxRangePushA("my_function"); // Begins NVTX range + * // do work + * nvtxRangePop(); // Ends NVTX range + * } + * \endcode + * + * One of the challenges with using the NVTX C API is that it requires manually + * terminating the end of the range with `nvtxRangePop`. This can be challenging + * if `my_function()` has multiple returns or can throw exceptions as it + * requires calling `nvtxRangePop()` before all possible return points. + * + * NVTX C++ solves this inconvenience through the "RAII" technique by providing + * a `nvtx3::scoped_range` class that begins a range at construction and ends + * the range on destruction. The above example then becomes: + * + * \code{.cpp} + * void my_function(...) { + * nvtx3::scoped_range r{"my_function"}; // Begins NVTX range + * // do work + * } // Range ends on exit from `my_function` when `r` is destroyed + * \endcode + * + * The range object `r` is deterministically destroyed whenever `my_function` + * returns---ending the NVTX range without manual intervention. For more + * information, see \ref RANGES and `nvtx3::scoped_range_in`. + * + * Another inconvenience of the NVTX C APIs are the several constructs where the + * user is expected to initialize an object at the beginning of an application + * and reuse that object throughout the lifetime of the application. For example + * see domains, categories, and registered messages. + * + * Example: + * \code{.cpp} + * nvtxDomainHandle_t D = nvtxDomainCreateA("my domain"); + * // Reuse `D` throughout the rest of the application + * \endcode + * + * This can be problematic if the user application or library does not have an + * explicit initialization function called before all other functions to + * ensure that these long-lived objects are initialized before being used. + * + * NVTX C++ makes use of the "construct on first use" technique to alleviate + * this inconvenience. In short, a function local static object is constructed + * upon the first invocation of a function and returns a reference to that + * object on all future invocations. See the documentation for `nvtx3::domain`, + * `nvtx3::named_category`, `nvtx3::registered_string`, and + * https://isocpp.org/wiki/faq/ctors#static-init-order-on-first-use for more + * information. + * + * Using construct on first use, the above example becomes: + * \code{.cpp} + * struct my_domain{ static constexpr char const* name{"my domain"}; }; + * + * // The first invocation of `domain::get` for the type `my_domain` will + * // construct a `nvtx3::domain` object and return a reference to it. Future + * // invocations simply return a reference. + * nvtx3::domain const& D = nvtx3::domain::get(); + * \endcode + * For more information about NVTX and how it can be used, see + * https://docs.nvidia.com/cuda/profiler-users-guide/index.html#nvtx and + * https://devblogs.nvidia.com/cuda-pro-tip-generate-custom-application-profile-timelines-nvtx/ + * for more information. + * + * \section RANGES Ranges + * + * Ranges are used to describe a span of time during the execution of an + * application. Common examples are using ranges to annotate the time it takes + * to execute a function or an iteration of a loop. + * + * NVTX C++ uses RAII to automate the generation of ranges that are tied to the + * lifetime of objects. Similar to `std::lock_guard` in the C++ Standard + * Template Library. + * + * \subsection scoped_range Scoped Range + * + * `nvtx3::scoped_range_in` is a class that begins a range upon construction + * and ends the range at destruction. This is one of the most commonly used + * constructs in NVTX C++ and is useful for annotating spans of time on a + * particular thread. These ranges can be nested to arbitrary depths. + * + * `nvtx3::scoped_range` is an alias for a `nvtx3::scoped_range_in` in the + * global NVTX domain. For more information about Domains, see \ref DOMAINS. + * + * Various attributes of a range can be configured constructing a + * `nvtx3::scoped_range_in` with a `nvtx3::event_attributes` object. For + * more information, see \ref ATTRIBUTES. + * + * Example: + * + * \code{.cpp} + * void some_function() { + * // Creates a range for the duration of `some_function` + * nvtx3::scoped_range r{}; + * + * while(true) { + * // Creates a range for every loop iteration + * // `loop_range` is nested inside `r` + * nvtx3::scoped_range loop_range{}; + * } + * } + * \endcode + * + * \subsection unique_range Unique Range + * + * `nvtx3::unique_range` is similar to `nvtx3::scoped_range`, with a few key differences: + * - `unique_range` objects can be destroyed in any order whereas `scoped_range` objects must be + * destroyed in exact reverse creation order + * - `unique_range` can start and end on different threads + * - `unique_range` is moveable + * - `unique_range` objects can be constructed as heap objects + * + * There is extra overhead associated with `unique_range` constructs and therefore use of + * `nvtx3::scoped_range_in` should be preferred. + * + * \section MARKS Marks + * + * `nvtx3::mark` annotates an instantaneous point in time with a "marker". + * + * Unlike a "range" which has a beginning and an end, a marker is a single event + * in an application, such as detecting a problem: + * + * \code{.cpp} + * bool success = do_operation(...); + * if (!success) { + * nvtx3::mark("operation failed!"); + * } + * \endcode + * + * \section DOMAINS Domains + * + * Similar to C++ namespaces, domains allow for scoping NVTX events. By default, + * all NVTX events belong to the "global" domain. Libraries and applications + * should scope their events to use a custom domain to differentiate where the + * events originate from. + * + * It is common for a library or application to have only a single domain and + * for the name of that domain to be known at compile time. Therefore, Domains + * in NVTX C++ are represented by _tag types_. + * + * For example, to define a custom domain, simply define a new concrete type + * (a `class` or `struct`) with a `static` member called `name` that contains + * the desired name of the domain. + * + * \code{.cpp} + * struct my_domain{ static constexpr char const* name{"my domain"}; }; + * \endcode + * + * For any NVTX C++ construct that can be scoped to a domain, the type + * `my_domain` can be passed as an explicit template argument to scope it to + * the custom domain. + * + * The tag type `nvtx3::domain::global` represents the global NVTX domain. + * + * \code{.cpp} + * // By default, `scoped_range_in` belongs to the global domain + * nvtx3::scoped_range_in<> r0{}; + * + * // Alias for a `scoped_range_in` in the global domain + * nvtx3::scoped_range r1{}; + * + * // `r` belongs to the custom domain + * nvtx3::scoped_range_in r{}; + * \endcode + * + * When using a custom domain, it is recommended to define type aliases for NVTX + * constructs in the custom domain. + * \code{.cpp} + * using my_scoped_range = nvtx3::scoped_range_in; + * using my_registered_string = nvtx3::registered_string_in; + * using my_named_category = nvtx3::named_category_in; + * \endcode + * + * See `nvtx3::domain` for more information. + * + * \section ATTRIBUTES Event Attributes + * + * NVTX events can be customized with various attributes to provide additional + * information (such as a custom message) or to control visualization of the + * event (such as the color used). These attributes can be specified per-event + * via arguments to a `nvtx3::event_attributes` object. + * + * NVTX events can be customized via four "attributes": + * - \ref COLOR : color used to visualize the event in tools. + * - \ref MESSAGES : Custom message string. + * - \ref PAYLOAD : User-defined numerical value. + * - \ref CATEGORY : Intra-domain grouping. + * + * It is possible to construct a `nvtx3::event_attributes` from any number of + * attribute objects (nvtx3::color, nvtx3::message, nvtx3::payload, + * nvtx3::category) in any order. If an attribute is not specified, a tool + * specific default value is used. See `nvtx3::event_attributes` for more + * information. + * + * \code{.cpp} + * // Set message, same as passing nvtx3::message{"message"} + * nvtx3::event_attributes attr{"message"}; + * + * // Set message and color + * nvtx3::event_attributes attr{"message", nvtx3::rgb{127, 255, 0}}; + * + * // Set message, color, payload, category + * nvtx3::event_attributes attr{"message", + * nvtx3::rgb{127, 255, 0}, + * nvtx3::payload{42}, + * nvtx3::category{1}}; + * + * // Same as above -- can use any order of arguments + * nvtx3::event_attributes attr{nvtx3::payload{42}, + * nvtx3::category{1}, + * "message", + * nvtx3::rgb{127, 255, 0}}; + * + * // Multiple arguments of the same type are allowed, but only the first is + * // used -- in this example, payload is set to 42: + * nvtx3::event_attributes attr{ nvtx3::payload{42}, nvtx3::payload{7} }; + * + * // Using the nvtx3 namespace in a local scope makes the syntax more succinct: + * using namespace nvtx3; + * event_attributes attr{"message", rgb{127, 255, 0}, payload{42}, category{1}}; + * \endcode + * + * \subsection MESSAGES message + * + * `nvtx3::message` sets the message string for an NVTX event. + * + * Example: + * \code{.cpp} + * // Create an `event_attributes` with the message "my message" + * nvtx3::event_attributes attr{nvtx3::message{"my message"}}; + * + * // strings and string literals implicitly assumed to be a `nvtx3::message` + * nvtx3::event_attributes attr{"my message"}; + * \endcode + * + * \subsubsection REGISTERED_MESSAGE Registered Messages + * + * Associating a `nvtx3::message` with an event requires copying the contents of + * the message every time the message is used, i.e., copying the entire message + * string. This may cause non-trivial overhead in performance sensitive code. + * + * To eliminate this overhead, NVTX allows registering a message string, + * yielding a "handle" that is inexpensive to copy that may be used in place of + * a message string. When visualizing the events, tools such as Nsight Systems + * will take care of mapping the message handle to its string. + * + * A message should be registered once and the handle reused throughout the rest + * of the application. This can be done by either explicitly creating static + * `nvtx3::registered_string` objects, or using the + * `nvtx3::registered_string::get` construct on first use helper (recommended). + * + * Similar to \ref DOMAINS, `nvtx3::registered_string::get` requires defining a + * custom tag type with a static `message` member whose value will be the + * contents of the registered string. + * + * Example: + * \code{.cpp} + * // Explicitly constructed, static `registered_string` in my_domain: + * static registered_string_in static_message{"my message"}; + * + * // Or use construct on first use: + * // Define a tag type with a `message` member string to register + * struct my_message{ static constexpr char const* message{ "my message" }; }; + * + * // Uses construct on first use to register the contents of + * // `my_message::message` + * auto& msg = nvtx3::registered_string_in::get(); + * \endcode + * + * \subsection COLOR color + * + * Associating a `nvtx3::color` with an event allows controlling how the event + * is visualized in a tool such as Nsight Systems. This is a convenient way to + * visually differentiate among different events. + * + * \code{.cpp} + * // Define a color via rgb color values + * nvtx3::color c{nvtx3::rgb{127, 255, 0}}; + * nvtx3::event_attributes attr{c}; + * + * // rgb color values can be passed directly to an `event_attributes` + * nvtx3::event_attributes attr1{nvtx3::rgb{127,255,0}}; + * \endcode + * + * \subsection CATEGORY category + * + * A `nvtx3::category` is simply an integer id that allows for fine-grain + * grouping of NVTX events. For example, one might use separate categories for + * IO, memory allocation, compute, etc. + * + * \code{.cpp} + * nvtx3::event_attributes{nvtx3::category{1}}; + * \endcode + * + * \subsubsection NAMED_CATEGORIES Named Categories + * + * Associates a `name` string with a category `id` to help differentiate among + * categories. + * + * For any given category id `Id`, a `named_category{Id, "name"}` should only + * be constructed once and reused throughout an application. This can be done by + * either explicitly creating static `nvtx3::named_category` objects, or using + * the `nvtx3::named_category::get` construct on first use helper (recommended). + * + * Similar to \ref DOMAINS, `nvtx3::named_category::get` requires defining a + * custom tag type with static `name` and `id` members. + * + * \code{.cpp} + * // Explicitly constructed, static `named_category` in my_domain: + * static nvtx3::named_category_in static_category{42, "my category"}; + * + * // Or use construct on first use: + * // Define a tag type with `name` and `id` members + * struct my_category { + * static constexpr char const* name{"my category"}; // category name + * static constexpr uint32_t id{42}; // category id + * }; + * + * // Use construct on first use to name the category id `42` + * // with name "my category": + * auto& cat = named_category_in::get(); + * + * // Range `r` associated with category id `42` + * nvtx3::event_attributes attr{cat}; + * \endcode + * + * \subsection PAYLOAD payload + * + * Allows associating a user-defined numerical value with an event. + * + * \code{.cpp} + * // Constructs a payload from the `int32_t` value 42 + * nvtx3:: event_attributes attr{nvtx3::payload{42}}; + * \endcode + * + * + * \section EXAMPLE Example + * + * Putting it all together: + * \code{.cpp} + * // Define a custom domain tag type + * struct my_domain{ static constexpr char const* name{"my domain"}; }; + * + * // Define a named category tag type + * struct my_category{ + * static constexpr char const* name{"my category"}; + * static constexpr uint32_t id{42}; + * }; + * + * // Define a registered string tag type + * struct my_message{ static constexpr char const* message{"my message"}; }; + * + * // For convenience, use aliases for domain scoped objects + * using my_scoped_range = nvtx3::scoped_range_in; + * using my_registered_string = nvtx3::registered_string_in; + * using my_named_category = nvtx3::named_category_in; + * + * // Default values for all attributes + * nvtx3::event_attributes attr{}; + * my_scoped_range r0{attr}; + * + * // Custom (unregistered) message, and unnamed category + * nvtx3::event_attributes attr1{"message", nvtx3::category{2}}; + * my_scoped_range r1{attr1}; + * + * // Alternatively, pass arguments of `event_attributes` ctor directly to + * // `my_scoped_range` + * my_scoped_range r2{"message", nvtx3::category{2}}; + * + * // construct on first use a registered string + * auto& msg = my_registered_string::get(); + * + * // construct on first use a named category + * auto& cat = my_named_category::get(); + * + * // Use registered string and named category with a custom payload + * my_scoped_range r3{msg, cat, nvtx3::payload{42}}; + * + * // Any number of arguments in any order + * my_scoped_range r{nvtx3::rgb{127, 255,0}, msg}; + * + * \endcode + * \section MACROS Convenience Macros + * + * Oftentimes users want to quickly and easily add NVTX ranges to their library + * or application to aid in profiling and optimization. + * + * A convenient way to do this is to use the \ref NVTX3_FUNC_RANGE and + * \ref NVTX3_FUNC_RANGE_IN macros. These macros take care of constructing an + * `nvtx3::scoped_range_in` with the name of the enclosing function as the + * range's message. + * + * \code{.cpp} + * void some_function() { + * // Automatically generates an NVTX range for the duration of the function + * // using "some_function" as the event's message. + * NVTX3_FUNC_RANGE(); + * } + * \endcode + * + */ + +/* Temporary helper #defines, removed with #undef at end of header */ + +#if !defined(NVTX3_USE_CHECKED_OVERLOADS_FOR_GET) +#if defined(_MSC_VER) && _MSC_VER < 1914 \ + || defined(__GNUC__) && __GNUC__ == 8 && __GNUC_MINOR__ < 4 +/* Microsoft's compiler prior to VS2017 Update 7 (15.7) uses an older parser + * that does not work with domain::get's specialization for domain::global, + * and would require extra conditions to make SFINAE work for the overloaded + * get() functions. This macro disables use of overloaded get() in order to + * work with VS2015 and versions of VS2017 below 15.7, without penalizing + * users of newer compilers. Building with this flag set to 0 means errors + * when defining tag structs (see documentation for domain, named_category, + * and registered_string) will have more complex compiler error messages + * instead of the clear static_assert messages from the get() overloads. + */ +#define NVTX3_USE_CHECKED_OVERLOADS_FOR_GET 0 +#else +#define NVTX3_USE_CHECKED_OVERLOADS_FOR_GET 1 +#endif +#define NVTX3_USE_CHECKED_OVERLOADS_FOR_GET_DEFINED_HERE +#endif + +/* Within this header, nvtx3::NVTX3_VERSION_NAMESPACE resolves to nvtx3::vX, + * where "X" is the major version number. */ +#define NVTX3_CONCAT(A, B) A##B +#define NVTX3_NAMESPACE_FOR(VERSION) NVTX3_CONCAT(v, VERSION) +#define NVTX3_VERSION_NAMESPACE NVTX3_NAMESPACE_FOR(NVTX3_CPP_VERSION_MAJOR) + +/* Avoid duplicating #if defined(NVTX3_INLINE_THIS_VERSION) for namespaces + * in each minor version by making a macro to use unconditionally, which + * resolves to "inline" or nothing as appropriate. */ +#if defined(NVTX3_INLINE_THIS_VERSION) +#define NVTX3_INLINE_IF_REQUESTED inline +#else +#define NVTX3_INLINE_IF_REQUESTED +#endif + +/* Enables the use of constexpr when support for C++14 constexpr is present. + * + * Initialization of a class member that is a union to a specific union member + * can only be done in the body of a constructor, not in a member initializer + * list. A constexpr constructor must have an empty body until C++14, so there + * is no way to make an initializer of a member union constexpr in C++11. This + * macro allows making functions constexpr in C++14 or newer, but non-constexpr + * in C++11 compilation. It is used here on constructors that initialize their + * member unions. + */ +#if __cpp_constexpr >= 201304L +#define NVTX3_CONSTEXPR_IF_CPP14 constexpr +#else +#define NVTX3_CONSTEXPR_IF_CPP14 +#endif + + /* Use a macro for static asserts, which defaults to static_assert, but that + * testing tools can replace with a logging function. For example: + * #define NVTX3_STATIC_ASSERT(c, m) \ + * do { if (!(c)) printf("static_assert would fail: %s\n", m); } while (0) + */ +#if !defined(NVTX3_STATIC_ASSERT) +#define NVTX3_STATIC_ASSERT(condition, message) static_assert(condition, message); +#define NVTX3_STATIC_ASSERT_DEFINED_HERE +#endif + +/* Implementation sections, enclosed in guard macros for each minor version */ + +#ifndef NVTX3_CPP_DEFINITIONS_V1_0 +#define NVTX3_CPP_DEFINITIONS_V1_0 + +#include "nvToolsExt.h" + +#include +#include +#include +#include +#include + +namespace nvtx3 { + +NVTX3_INLINE_IF_REQUESTED namespace NVTX3_VERSION_NAMESPACE +{ + +namespace detail { + +template +struct always_false : std::false_type {}; + +template +struct has_name : std::false_type {}; +template +struct has_name : std::true_type {}; + +template +struct has_id : std::false_type {}; +template +struct has_id : std::true_type {}; + +template +struct has_message : std::false_type {}; +template +struct has_message : std::true_type {}; + +template +struct is_c_string : std::false_type {}; +template +struct is_c_string::value || + std::is_convertible::value +>::type> : std::true_type {}; + +template +using is_uint32 = std::is_same::type, uint32_t>; + +} // namespace detail + +/** + * @brief `domain`s allow for grouping NVTX events into a single scope to + * differentiate them from events in other `domain`s. + * + * By default, all NVTX constructs are placed in the "global" NVTX domain. + * + * A custom `domain` may be used in order to differentiate a library's or + * application's NVTX events from other events. + * + * `domain`s are expected to be long-lived and unique to a library or + * application. As such, it is assumed a domain's name is known at compile + * time. Therefore, all NVTX constructs that can be associated with a domain + * require the domain to be specified via a *type* `D` passed as an + * explicit template parameter. + * + * The type `domain::global` may be used to indicate that the global NVTX + * domain should be used. + * + * None of the C++ NVTX constructs require the user to manually construct a + * `domain` object. Instead, if a custom domain is desired, the user is + * expected to define a type `D` that contains a member + * `D::name` which resolves to either a `char const*` or `wchar_t + * const*`. The value of `D::name` is used to name and uniquely + * identify the custom domain. + * + * Upon the first use of an NVTX construct associated with the type + * `D`, the "construct on first use" pattern is used to construct a + * function local static `domain` object. All future NVTX constructs + * associated with `D` will use a reference to the previously + * constructed `domain` object. See `domain::get`. + * + * Example: + * \code{.cpp} + * // The type `my_domain` defines a `name` member used to name and identify + * // the `domain` object identified by `my_domain`. + * struct my_domain{ static constexpr char const* name{"my_domain"}; }; + * + * // The NVTX range `r` will be grouped with all other NVTX constructs + * // associated with `my_domain`. + * nvtx3::scoped_range_in r{}; + * + * // An alias can be created for a `scoped_range_in` in the custom domain + * using my_scoped_range = nvtx3::scoped_range_in; + * my_scoped_range my_range{}; + * + * // `domain::global` indicates that the global NVTX domain is used + * nvtx3::scoped_range_in r2{}; + * + * // For convenience, `nvtx3::scoped_range` is an alias for a range in the + * // global domain + * nvtx3::scoped_range r3{}; + * \endcode + */ +class domain { + public: + domain(domain const&) = delete; + domain& operator=(domain const&) = delete; + domain(domain&&) = delete; + domain& operator=(domain&&) = delete; + + /** + * @brief Tag type for the "global" NVTX domain. + * + * This type may be passed as a template argument to any function/class + * expecting a type to identify a domain to indicate that the global domain + * should be used. + * + * All NVTX events in the global domain across all libraries and + * applications will be grouped together. + * + */ + struct global { + }; + +#if NVTX3_USE_CHECKED_OVERLOADS_FOR_GET + /** + * @brief Returns reference to an instance of a function local static + * `domain` object. + * + * Uses the "construct on first use" idiom to safely ensure the `domain` + * object is initialized exactly once upon first invocation of + * `domain::get()`. All following invocations will return a + * reference to the previously constructed `domain` object. See + * https://isocpp.org/wiki/faq/ctors#static-init-order-on-first-use + * + * None of the constructs in this header require the user to directly invoke + * `domain::get`. It is automatically invoked when constructing objects like + * a `scoped_range_in` or `category`. Advanced users may wish to use + * `domain::get` for the convenience of the "construct on first use" idiom + * when using domains with their own use of the NVTX C API. + * + * This function is threadsafe as of C++11. If two or more threads call + * `domain::get` concurrently, exactly one of them is guaranteed + * to construct the `domain` object and the other(s) will receive a + * reference to the object after it is fully constructed. + * + * The domain's name is specified via the type `D` pass as an + * explicit template parameter. `D` is required to contain a + * member `D::name` that resolves to either a `char const*` or + * `wchar_t const*`. The value of `D::name` is used to name and + * uniquely identify the `domain`. + * + * Example: + * \code{.cpp} + * // The type `my_domain` defines a `name` member used to name and identify + * // the `domain` object identified by `my_domain`. + * struct my_domain{ static constexpr char const* name{"my domain"}; }; + * + * auto& D1 = domain::get(); // First invocation constructs a + * // `domain` with the name "my domain" + * + * auto& D2 = domain::get(); // Quickly returns reference to + * // previously constructed `domain`. + * \endcode + * + * @tparam D Type that contains a `D::name` member used to + * name the `domain` object. + * @return Reference to the `domain` corresponding to the type `D`. + */ + template ::value + , int>::type = 0> + static domain const& get() noexcept + { + static domain const d(D::name); + return d; + } + + /** + * @brief Overload of `domain::get` to provide a clear compile error when + * `D` has a `name` member that is not directly convertible to either + * `char const*` or `wchar_t const*`. + */ + template ::value + , int>::type = 0> + static domain const& get() noexcept + { + NVTX3_STATIC_ASSERT(detail::always_false::value, + "Type used to identify an NVTX domain must contain a static constexpr member " + "called 'name' of type const char* or const wchar_t* -- 'name' member is not " + "convertible to either of those types"); + static domain const unused; + return unused; // Function must compile for static_assert to be triggered + } + + /** + * @brief Overload of `domain::get` to provide a clear compile error when + * `D` does not have a `name` member. + */ + template ::value + , int>::type = 0> + static domain const& get() noexcept + { + NVTX3_STATIC_ASSERT(detail::always_false::value, + "Type used to identify an NVTX domain must contain a static constexpr member " + "called 'name' of type const char* or const wchar_t* -- 'name' member is missing"); + static domain const unused; + return unused; // Function must compile for static_assert to be triggered + } +#else + template + static domain const& get() noexcept + { + static domain const d(D::name); + return d; + } +#endif + + /** + * @brief Conversion operator to `nvtxDomainHandle_t`. + * + * Allows transparently passing a domain object into an API expecting a + * native `nvtxDomainHandle_t` object. + */ + operator nvtxDomainHandle_t() const noexcept { return _domain; } + + private: + /** + * @brief Construct a new domain with the specified `name`. + * + * This constructor is private as it is intended that `domain` objects only + * be created through the `domain::get` function. + * + * @param name A unique name identifying the domain + */ + explicit domain(char const* name) noexcept : _domain{nvtxDomainCreateA(name)} {} + + /** + * @brief Construct a new domain with the specified `name`. + * + * This constructor is private as it is intended that `domain` objects only + * be created through the `domain::get` function. + * + * @param name A unique name identifying the domain + */ + explicit domain(wchar_t const* name) noexcept : _domain{nvtxDomainCreateW(name)} {} + + /** + * @brief Construct a new domain with the specified `name`. + * + * This constructor is private as it is intended that `domain` objects only + * be created through the `domain::get` function. + * + * @param name A unique name identifying the domain + */ + explicit domain(std::string const& name) noexcept : domain{name.c_str()} {} + + /** + * @brief Construct a new domain with the specified `name`. + * + * This constructor is private as it is intended that `domain` objects only + * be created through the `domain::get` function. + * + * @param name A unique name identifying the domain + */ + explicit domain(std::wstring const& name) noexcept : domain{name.c_str()} {} + + /** + * @brief Default constructor creates a `domain` representing the + * "global" NVTX domain. + * + * All events not associated with a custom `domain` are grouped in the + * "global" NVTX domain. + * + */ + domain() noexcept {} + + /** + * @brief Intentionally avoid calling nvtxDomainDestroy on the `domain` object. + * + * No currently-available tools attempt to free domain resources when the + * nvtxDomainDestroy function is called, due to the thread-safety and + * efficiency challenges of freeing thread-local storage for other threads. + * Since libraries may be disallowed from introducing static destructors, + * and destroying the domain is likely to have no effect, the destructor + * for `domain` intentionally chooses to not destroy the domain. + * + * In a situation where domain destruction is necessary, either manually + * call nvtxDomainDestroy on the domain's handle, or make a class that + * derives from `domain` and calls nvtxDomainDestroy in its destructor. + */ + ~domain() = default; + + private: + nvtxDomainHandle_t const _domain{}; ///< The `domain`s NVTX handle +}; + +/** + * @brief Returns reference to the `domain` object that represents the global + * NVTX domain. + * + * This specialization for `domain::global` returns a default constructed, + * `domain` object for use when the "global" domain is desired. + * + * All NVTX events in the global domain across all libraries and applications + * will be grouped together. + * + * @return Reference to the `domain` corresponding to the global NVTX domain. + * + */ +template <> +inline domain const& domain::get() noexcept +{ + static domain const d{}; + return d; +} + +/** + * @brief Indicates the values of the red, green, and blue color channels for + * an RGB color to use as an event attribute (assumes no transparency). + * + */ +struct rgb { + /// Type used for component values + using component_type = uint8_t; + + /** + * @brief Construct a rgb with red, green, and blue channels + * specified by `red_`, `green_`, and `blue_`, respectively. + * + * Valid values are in the range `[0,255]`. + * + * @param red_ Value of the red channel + * @param green_ Value of the green channel + * @param blue_ Value of the blue channel + */ + constexpr rgb( + component_type red_, + component_type green_, + component_type blue_) noexcept + : red{red_}, green{green_}, blue{blue_} + { + } + + component_type red{}; ///< Red channel value + component_type green{}; ///< Green channel value + component_type blue{}; ///< Blue channel value +}; + +/** + * @brief Indicates the value of the alpha, red, green, and blue color + * channels for an ARGB color to use as an event attribute. + * + */ +struct argb final : rgb { + /** + * @brief Construct an argb with alpha, red, green, and blue channels + * specified by `alpha_`, `red_`, `green_`, and `blue_`, respectively. + * + * Valid values are in the range `[0,255]`. + * + * @param alpha_ Value of the alpha channel (opacity) + * @param red_ Value of the red channel + * @param green_ Value of the green channel + * @param blue_ Value of the blue channel + * + */ + constexpr argb( + component_type alpha_, + component_type red_, + component_type green_, + component_type blue_) noexcept + : rgb{red_, green_, blue_}, alpha{alpha_} + { + } + + component_type alpha{}; ///< Alpha channel value +}; + +/** + * @brief Represents a custom color that can be associated with an NVTX event + * via it's `event_attributes`. + * + * Specifying colors for NVTX events is a convenient way to visually + * differentiate among different events in a visualization tool such as Nsight + * Systems. + * + */ +class color { + public: + /// Type used for the color's value + using value_type = uint32_t; + + /** + * @brief Constructs a `color` using the value provided by `hex_code`. + * + * `hex_code` is expected to be a 4 byte argb hex code. + * + * The most significant byte indicates the value of the alpha channel + * (opacity) (0-255) + * + * The next byte indicates the value of the red channel (0-255) + * + * The next byte indicates the value of the green channel (0-255) + * + * The least significant byte indicates the value of the blue channel + * (0-255) + * + * @param hex_code The hex code used to construct the `color` + */ + constexpr explicit color(value_type hex_code) noexcept : _value{hex_code} {} + + /** + * @brief Construct a `color` using the alpha, red, green, blue components + * in `argb`. + * + * @param argb The alpha, red, green, blue components of the desired `color` + */ + constexpr color(argb argb_) noexcept + : color{from_bytes_msb_to_lsb(argb_.alpha, argb_.red, argb_.green, argb_.blue)} + { + } + + /** + * @brief Construct a `color` using the red, green, blue components in + * `rgb`. + * + * Uses maximum value for the alpha channel (opacity) of the `color`. + * + * @param rgb The red, green, blue components of the desired `color` + */ + constexpr color(rgb rgb_) noexcept + : color{from_bytes_msb_to_lsb(0xFF, rgb_.red, rgb_.green, rgb_.blue)} + { + } + + /** + * @brief Returns the `color`s argb hex code + * + */ + constexpr value_type get_value() const noexcept { return _value; } + + /** + * @brief Return the NVTX color type of the color. + * + */ + constexpr nvtxColorType_t get_type() const noexcept { return _type; } + + color() = delete; + ~color() = default; + color(color const&) = default; + color& operator=(color const&) = default; + color(color&&) = default; + color& operator=(color&&) = default; + + private: + /** + * @brief Constructs an unsigned, 4B integer from the component bytes in + * most to least significant byte order. + * + */ + constexpr static value_type from_bytes_msb_to_lsb( + uint8_t byte3, + uint8_t byte2, + uint8_t byte1, + uint8_t byte0) noexcept + { + return uint32_t{byte3} << 24 | uint32_t{byte2} << 16 | uint32_t{byte1} << 8 | uint32_t{byte0}; + } + + value_type _value{}; ///< color's argb color code + nvtxColorType_t _type{NVTX_COLOR_ARGB}; ///< NVTX color type code +}; + +/** + * @brief Object for intra-domain grouping of NVTX events. + * + * A `category` is simply an integer id that allows for fine-grain grouping of + * NVTX events. For example, one might use separate categories for IO, memory + * allocation, compute, etc. + * + * Example: + * \code{.cpp} + * nvtx3::category cat1{1}; + * + * // Range `r1` belongs to the category identified by the value `1`. + * nvtx3::scoped_range r1{cat1}; + * + * // Range `r2` belongs to the same category as `r1` + * nvtx3::scoped_range r2{nvtx3::category{1}}; + * \endcode + * + * To associate a name string with a category id, see `named_category`. + * + */ +class category { + public: + /// Type used for `category`s integer id. + using id_type = uint32_t; + + /** + * @brief Construct a `category` with the specified `id`. + * + * The `category` will be unnamed and identified only by its `id` value. + * + * All `category`s in a domain sharing the same `id` are equivalent. + * + * @param[in] id The `category`'s identifying value + */ + constexpr explicit category(id_type id) noexcept : id_{id} {} + + /** + * @brief Returns the id of the category. + * + */ + constexpr id_type get_id() const noexcept { return id_; } + + category() = delete; + ~category() = default; + category(category const&) = default; + category& operator=(category const&) = default; + category(category&&) = default; + category& operator=(category&&) = default; + + private: + id_type id_{}; ///< category's unique identifier +}; + +/** + * @brief A `category` with an associated name string. + * + * Associates a `name` string with a category `id` to help differentiate among + * categories. + * + * For any given category id `Id`, a `named_category(Id, "name")` should only + * be constructed once and reused throughout an application. This can be done + * by either explicitly creating static `named_category` objects, or using the + * `named_category::get` construct on first use helper (recommended). + * + * Creating two or more `named_category` objects with the same value for `id` + * in the same domain results in undefined behavior. + * + * Similarly, behavior is undefined when a `named_category` and `category` + * share the same value of `id`. + * + * Example: + * \code{.cpp} + * // Explicitly constructed, static `named_category` in global domain: + * static nvtx3::named_category static_category{42, "my category"}; + * + * // Range `r` associated with category id `42` + * nvtx3::scoped_range r{static_category}; + * + * // OR use construct on first use: + * + * // Define a type with `name` and `id` members + * struct my_category { + * static constexpr char const* name{"my category"}; // category name + * static constexpr uint32_t id{42}; // category id + * }; + * + * // Use construct on first use to name the category id `42` + * // with name "my category" + * auto& cat = named_category_in::get(); + * + * // Range `r` associated with category id `42` + * nvtx3::scoped_range r{cat}; + * \endcode + * + * `named_category_in`'s association of a name to a category id is local to + * the domain specified by the type `D`. An id may have a different name in + * another domain. + * + * @tparam D Type containing `name` member used to identify the `domain` to + * which the `named_category_in` belongs. Else, `domain::global` to indicate + * that the global NVTX domain should be used. + */ +template +class named_category_in final : public category { + public: +#if NVTX3_USE_CHECKED_OVERLOADS_FOR_GET + /** + * @brief Returns a global instance of a `named_category_in` as a + * function-local static. + * + * Creates a `named_category_in` with name and id specified by the contents + * of a type `C`. `C::name` determines the name and `C::id` determines the + * category id. + * + * This function is useful for constructing a named `category` exactly once + * and reusing the same instance throughout an application. + * + * Example: + * \code{.cpp} + * // Define a type with `name` and `id` members + * struct my_category { + * static constexpr char const* name{"my category"}; // category name + * static constexpr uint32_t id{42}; // category id + * }; + * + * // Use construct on first use to name the category id `42` + * // with name "my category" + * auto& cat = named_category_in::get(); + * + * // Range `r` associated with category id `42` + * nvtx3::scoped_range r{cat}; + * \endcode + * + * Uses the "construct on first use" idiom to safely ensure the `category` + * object is initialized exactly once. See + * https://isocpp.org/wiki/faq/ctors#static-init-order-on-first-use + * + * @tparam C Type containing a member `C::name` that resolves to either a + * `char const*` or `wchar_t const*` and `C::id`. + */ + template ::value && + detail::is_uint32::value + , int>::type = 0> + static named_category_in const& get() noexcept + { + static named_category_in const cat(C::id, C::name); + return cat; + } + + /** + * @brief Overload of `named_category_in::get` to provide a clear compile error + * when `C` has the required `name` and `id` members, but they are not the + * required types. `name` must be directly convertible to `char const*` or + * `wchar_t const*`, and `id` must be `uint32_t`. + */ + template ::value || + !detail::is_uint32::value + , int>::type = 0> + static named_category_in const& get() noexcept + { + NVTX3_STATIC_ASSERT(detail::is_c_string::value, + "Type used to name an NVTX category must contain a static constexpr member " + "called 'name' of type const char* or const wchar_t* -- 'name' member is not " + "convertible to either of those types"); + NVTX3_STATIC_ASSERT(detail::is_uint32::value, + "Type used to name an NVTX category must contain a static constexpr member " + "called 'id' of type uint32_t -- 'id' member is the wrong type"); + static named_category_in const unused; + return unused; // Function must compile for static_assert to be triggered + } + + /** + * @brief Overload of `named_category_in::get` to provide a clear compile error + * when `C` does not have the required `name` and `id` members. + */ + template ::value || + !detail::has_id::value + , int>::type = 0> + static named_category_in const& get() noexcept + { + NVTX3_STATIC_ASSERT(detail::has_name::value, + "Type used to name an NVTX category must contain a static constexpr member " + "called 'name' of type const char* or const wchar_t* -- 'name' member is missing"); + NVTX3_STATIC_ASSERT(detail::has_id::value, + "Type used to name an NVTX category must contain a static constexpr member " + "called 'id' of type uint32_t -- 'id' member is missing"); + static named_category_in const unused; + return unused; // Function must compile for static_assert to be triggered + } +#else + template + static named_category_in const& get() noexcept + { + static named_category_in const cat(C::id, C::name); + return cat; + } +#endif + + private: + // Default constructor is only used internally for static_assert(false) cases. + named_category_in() noexcept : category{0} {} + + public: + /** + * @brief Construct a `named_category_in` with the specified `id` and `name`. + * + * The name `name` will be registered with `id`. + * + * Every unique value of `id` should only be named once. + * + * @param[in] id The category id to name + * @param[in] name The name to associated with `id` + */ + named_category_in(id_type id, char const* name) noexcept : category{id} + { +#ifndef NVTX_DISABLE + nvtxDomainNameCategoryA(domain::get(), get_id(), name); +#else + (void)id; + (void)name; +#endif + }; + + /** + * @brief Construct a `named_category_in` with the specified `id` and `name`. + * + * The name `name` will be registered with `id`. + * + * Every unique value of `id` should only be named once. + * + * @param[in] id The category id to name + * @param[in] name The name to associated with `id` + */ + named_category_in(id_type id, wchar_t const* name) noexcept : category{id} + { +#ifndef NVTX_DISABLE + nvtxDomainNameCategoryW(domain::get(), get_id(), name); +#else + (void)id; + (void)name; +#endif + }; +}; + +/** + * @brief Alias for a `named_category_in` in the global NVTX domain. + * + */ +using named_category = named_category_in; + +/** + * @brief A message registered with NVTX. + * + * Normally, associating a `message` with an NVTX event requires copying the + * contents of the message string. This may cause non-trivial overhead in + * highly performance sensitive regions of code. + * + * message registration is an optimization to lower the overhead of + * associating a message with an NVTX event. Registering a message yields a + * handle that is inexpensive to copy that may be used in place of a message + * string. + * + * A particular message should only be registered once and the handle + * reused throughout the rest of the application. This can be done by either + * explicitly creating static `registered_string_in` objects, or using the + * `registered_string_in::get` construct on first use helper (recommended). + * + * Example: + * \code{.cpp} + * // Explicitly constructed, static `registered_string` in my_domain: + * static registered_string_in static_message{"message"}; + * + * // "message" is associated with the range `r` + * nvtx3::scoped_range r{static_message}; + * + * // Or use construct on first use: + * + * // Define a type with a `message` member that defines the contents of the + * // registered string + * struct my_message{ static constexpr char const* message{ "my message" }; }; + * + * // Uses construct on first use to register the contents of + * // `my_message::message` + * auto& msg = registered_string_in::get(); + * + * // "my message" is associated with the range `r` + * nvtx3::scoped_range r{msg}; + * \endcode + * + * `registered_string_in`s are local to a particular domain specified via + * the type `D`. + * + * @tparam D Type containing `name` member used to identify the `domain` to + * which the `registered_string_in` belongs. Else, `domain::global` to indicate + * that the global NVTX domain should be used. + */ +template +class registered_string_in { + public: +#if NVTX3_USE_CHECKED_OVERLOADS_FOR_GET + /** + * @brief Returns a global instance of a `registered_string_in` as a function + * local static. + * + * Provides a convenient way to register a message with NVTX without having + * to explicitly register the message. + * + * Upon first invocation, constructs a `registered_string_in` whose contents + * are specified by `message::message`. + * + * All future invocations will return a reference to the object constructed + * in the first invocation. + * + * Example: + * \code{.cpp} + * // Define a type with a `message` member that defines the contents of the + * // registered string + * struct my_message{ static constexpr char const* message{ "my message" }; + * }; + * + * // Uses construct on first use to register the contents of + * // `my_message::message` + * auto& msg = registered_string_in::get(); + * + * // "my message" is associated with the range `r` + * nvtx3::scoped_range r{msg}; + * \endcode + * + * @tparam M Type required to contain a member `M::message` that + * resolves to either a `char const*` or `wchar_t const*` used as the + * registered string's contents. + * @return Reference to a `registered_string_in` associated with the type `M`. + */ + template ::value + , int>::type = 0> + static registered_string_in const& get() noexcept + { + static registered_string_in const regstr(M::message); + return regstr; + } + + /** + * @brief Overload of `registered_string_in::get` to provide a clear compile error + * when `M` has a `message` member that is not directly convertible to either + * `char const*` or `wchar_t const*`. + */ + template ::value + , int>::type = 0> + static registered_string_in const& get() noexcept + { + NVTX3_STATIC_ASSERT(detail::always_false::value, + "Type used to register an NVTX string must contain a static constexpr member " + "called 'message' of type const char* or const wchar_t* -- 'message' member is " + "not convertible to either of those types"); + static registered_string_in const unused; + return unused; // Function must compile for static_assert to be triggered + } + + /** + * @brief Overload of `registered_string_in::get` to provide a clear compile error when + * `M` does not have a `message` member. + */ + template ::value + , int>::type = 0> + static registered_string_in const& get() noexcept + { + NVTX3_STATIC_ASSERT(detail::always_false::value, + "Type used to register an NVTX string must contain a static constexpr member " + "called 'message' of type const char* or const wchar_t* -- 'message' member " + "is missing"); + static registered_string_in const unused; + return unused; // Function must compile for static_assert to be triggered + } +#else + template + static registered_string_in const& get() noexcept + { + static registered_string_in const regstr(M::message); + return regstr; + } +#endif + + /** + * @brief Constructs a `registered_string_in` from the specified `msg` string. + * + * Registers `msg` with NVTX and associates a handle with the registered + * message. + * + * A particular message should should only be registered once and the handle + * reused throughout the rest of the application. + * + * @param msg The contents of the message + */ + explicit registered_string_in(char const* msg) noexcept + : handle_{nvtxDomainRegisterStringA(domain::get(), msg)} + { + } + + /** + * @brief Constructs a `registered_string_in` from the specified `msg` string. + * + * Registers `msg` with NVTX and associates a handle with the registered + * message. + * + * A particular message should should only be registered once and the handle + * reused throughout the rest of the application. + * + * @param msg The contents of the message + */ + explicit registered_string_in(std::string const& msg) noexcept + : registered_string_in{msg.c_str()} {} + + /** + * @brief Constructs a `registered_string_in` from the specified `msg` string. + * + * Registers `msg` with NVTX and associates a handle with the registered + * message. + * + * A particular message should should only be registered once and the handle + * reused throughout the rest of the application. + * + * @param msg The contents of the message + */ + explicit registered_string_in(wchar_t const* msg) noexcept + : handle_{nvtxDomainRegisterStringW(domain::get(), msg)} + { + } + + /** + * @brief Constructs a `registered_string_in` from the specified `msg` string. + * + * Registers `msg` with NVTX and associates a handle with the registered + * message. + * + * A particular message should only be registered once and the handle + * reused throughout the rest of the application. + * + * @param msg The contents of the message + */ + explicit registered_string_in(std::wstring const& msg) noexcept + : registered_string_in{msg.c_str()} {} + + /** + * @brief Returns the registered string's handle + * + */ + nvtxStringHandle_t get_handle() const noexcept { return handle_; } + +private: + // Default constructor is only used internally for static_assert(false) cases. + registered_string_in() noexcept {}; +public: + ~registered_string_in() = default; + registered_string_in(registered_string_in const&) = default; + registered_string_in& operator=(registered_string_in const&) = default; + registered_string_in(registered_string_in&&) = default; + registered_string_in& operator=(registered_string_in&&) = default; + + private: + nvtxStringHandle_t handle_{}; ///< The handle returned from + ///< registering the message with NVTX +}; + +/** + * @brief Alias for a `registered_string_in` in the global NVTX domain. + * + */ +using registered_string = registered_string_in; + +/** + * @brief Allows associating a message string with an NVTX event via + * its `EventAttribute`s. + * + * Associating a `message` with an NVTX event through its `event_attributes` + * allows for naming events to easily differentiate them from other events. + * + * Every time an NVTX event is created with an associated `message`, the + * contents of the message string must be copied. This may cause non-trivial + * overhead in highly performance sensitive sections of code. Use of a + * `nvtx3::registered_string` is recommended in these situations. + * + * Example: + * \code{.cpp} + * // Creates an `event_attributes` with message "message 0" + * nvtx3::event_attributes attr0{nvtx3::message{"message 0"}}; + * + * // `range0` contains message "message 0" + * nvtx3::scoped_range range0{attr0}; + * + * // `std::string` and string literals are implicitly assumed to be + * // the contents of an `nvtx3::message` + * // Creates an `event_attributes` with message "message 1" + * nvtx3::event_attributes attr1{"message 1"}; + * + * // `range1` contains message "message 1" + * nvtx3::scoped_range range1{attr1}; + * + * // `range2` contains message "message 2" + * nvtx3::scoped_range range2{nvtx3::Mesage{"message 2"}}; + * + * // `std::string` and string literals are implicitly assumed to be + * // the contents of an `nvtx3::message` + * // `range3` contains message "message 3" + * nvtx3::scoped_range range3{"message 3"}; + * \endcode + */ +class message { + public: + using value_type = nvtxMessageValue_t; + + /** + * @brief Construct a `message` whose contents are specified by `msg`. + * + * @param msg The contents of the message + */ + NVTX3_CONSTEXPR_IF_CPP14 message(char const* msg) noexcept : type_{NVTX_MESSAGE_TYPE_ASCII} + { + value_.ascii = msg; + } + + /** + * @brief Construct a `message` whose contents are specified by `msg`. + * + * @param msg The contents of the message + */ + message(std::string const& msg) noexcept : message{msg.c_str()} {} + + /** + * @brief Disallow construction for `std::string` r-value + * + * `message` is a non-owning type and therefore cannot take ownership of an + * r-value. Therefore, constructing from an r-value is disallowed to prevent + * a dangling pointer. + * + */ + message(std::string&&) = delete; + + /** + * @brief Construct a `message` whose contents are specified by `msg`. + * + * @param msg The contents of the message + */ + NVTX3_CONSTEXPR_IF_CPP14 message(wchar_t const* msg) noexcept : type_{NVTX_MESSAGE_TYPE_UNICODE} + { + value_.unicode = msg; + } + + /** + * @brief Construct a `message` whose contents are specified by `msg`. + * + * @param msg The contents of the message + */ + message(std::wstring const& msg) noexcept : message{msg.c_str()} {} + + /** + * @brief Disallow construction for `std::wstring` r-value + * + * `message` is a non-owning type and therefore cannot take ownership of an + * r-value. Therefore, constructing from an r-value is disallowed to prevent + * a dangling pointer. + * + */ + message(std::wstring&&) = delete; + + /** + * @brief Construct a `message` from a `registered_string_in`. + * + * @tparam D Type containing `name` member used to identify the `domain` + * to which the `registered_string_in` belongs. Else, `domain::global` to + * indicate that the global NVTX domain should be used. + * @param msg The message that has already been registered with NVTX. + */ + template + NVTX3_CONSTEXPR_IF_CPP14 message(registered_string_in const& msg) noexcept + : type_{NVTX_MESSAGE_TYPE_REGISTERED} + { + value_.registered = msg.get_handle(); + } + + /** + * @brief Construct a `message` from NVTX C API type and value. + * + * @param type nvtxMessageType_t enum value indicating type of the payload + * @param value nvtxMessageValue_t union containing message + */ + constexpr message( + nvtxMessageType_t const& type, + nvtxMessageValue_t const& value) noexcept + : type_{type}, value_(value) + { + } + + /** + * @brief Construct a `message` from NVTX C API registered string handle. + * + * @param handle nvtxStringHandle_t value of registered string handle + */ + NVTX3_CONSTEXPR_IF_CPP14 message(nvtxStringHandle_t handle) noexcept + : type_{NVTX_MESSAGE_TYPE_REGISTERED} + { + value_.registered = handle; + } + + /** + * @brief Return the union holding the value of the message. + * + */ + constexpr value_type get_value() const noexcept { return value_; } + + /** + * @brief Return the type information about the value the union holds. + * + */ + constexpr nvtxMessageType_t get_type() const noexcept { return type_; } + + private: + nvtxMessageType_t type_{}; ///< message type + nvtxMessageValue_t value_{}; ///< message contents +}; + +/** + * @brief A numerical value that can be associated with an NVTX event via + * its `event_attributes`. + * + * Example: + * \code{.cpp} + * // Constructs a payload from the int32_t value 42 + * nvtx3:: event_attributes attr{nvtx3::payload{42}}; + * + * // `range0` will have an int32_t payload of 42 + * nvtx3::scoped_range range0{attr}; + * + * // range1 has double payload of 3.14 + * nvtx3::scoped_range range1{nvtx3::payload{3.14}}; + * \endcode + */ +class payload { + public: + using value_type = typename nvtxEventAttributes_v2::payload_t; + + /** + * @brief Construct a `payload` from a signed, 8 byte integer. + * + * @param value Value to use as contents of the payload + */ + NVTX3_CONSTEXPR_IF_CPP14 explicit payload(int64_t value) noexcept + : type_{NVTX_PAYLOAD_TYPE_INT64}, value_{} + { + value_.llValue = value; + } + + /** + * @brief Construct a `payload` from a signed, 4 byte integer. + * + * @param value Value to use as contents of the payload + */ + NVTX3_CONSTEXPR_IF_CPP14 explicit payload(int32_t value) noexcept + : type_{NVTX_PAYLOAD_TYPE_INT32}, value_{} + { + value_.iValue = value; + } + + /** + * @brief Construct a `payload` from an unsigned, 8 byte integer. + * + * @param value Value to use as contents of the payload + */ + NVTX3_CONSTEXPR_IF_CPP14 explicit payload(uint64_t value) noexcept + : type_{NVTX_PAYLOAD_TYPE_UNSIGNED_INT64}, value_{} + { + value_.ullValue = value; + } + + /** + * @brief Construct a `payload` from an unsigned, 4 byte integer. + * + * @param value Value to use as contents of the payload + */ + NVTX3_CONSTEXPR_IF_CPP14 explicit payload(uint32_t value) noexcept + : type_{NVTX_PAYLOAD_TYPE_UNSIGNED_INT32}, value_{} + { + value_.uiValue = value; + } + + /** + * @brief Construct a `payload` from a single-precision floating point + * value. + * + * @param value Value to use as contents of the payload + */ + NVTX3_CONSTEXPR_IF_CPP14 explicit payload(float value) noexcept + : type_{NVTX_PAYLOAD_TYPE_FLOAT}, value_{} + { + value_.fValue = value; + } + + /** + * @brief Construct a `payload` from a double-precision floating point + * value. + * + * @param value Value to use as contents of the payload + */ + NVTX3_CONSTEXPR_IF_CPP14 explicit payload(double value) noexcept + : type_{NVTX_PAYLOAD_TYPE_DOUBLE}, value_{} + { + value_.dValue = value; + } + + /** + * @brief Construct a `payload` from NVTX C API type and value. + * + * @param type nvtxPayloadType_t enum value indicating type of the payload + * @param value nvtxEventAttributes_t::payload_t union containing payload + */ + constexpr payload( + nvtxPayloadType_t const& type, + value_type const& value) noexcept + : type_{type}, value_(value) + { + } + + /** + * @brief Return the union holding the value of the payload + * + */ + constexpr value_type get_value() const noexcept { return value_; } + + /** + * @brief Return the information about the type the union holds. + * + */ + constexpr nvtxPayloadType_t get_type() const noexcept { return type_; } + + private: + nvtxPayloadType_t type_; ///< Type of the payload value + value_type value_; ///< Union holding the payload value +}; + +/** + * @brief Describes the attributes of a NVTX event. + * + * NVTX events can be customized via four "attributes": + * + * - color: color used to visualize the event in tools such as Nsight + * Systems. See `color`. + * - message: Custom message string. See `message`. + * - payload: User-defined numerical value. See `payload`. + * - category: Intra-domain grouping. See `category`. + * + * These component attributes are specified via an `event_attributes` object. + * See `nvtx3::color`, `nvtx3::message`, `nvtx3::payload`, and + * `nvtx3::category` for how these individual attributes are constructed. + * + * While it is possible to specify all four attributes, it is common to want + * to only specify a subset of attributes and use default values for the + * others. For convenience, `event_attributes` can be constructed from any + * number of attribute components in any order. + * + * Example: + * \code{.cpp} + * // Set message, same as using nvtx3::message{"message"} + * event_attributes attr{"message"}; + * + * // Set message and color + * event_attributes attr{"message", nvtx3::rgb{127, 255, 0}}; + * + * // Set message, color, payload, category + * event_attributes attr{"message", + * nvtx3::rgb{127, 255, 0}, + * nvtx3::payload{42}, + * nvtx3::category{1}}; + * + * // Same as above -- can use any order of arguments + * event_attributes attr{nvtx3::payload{42}, + * nvtx3::category{1}, + * "message", + * nvtx3::rgb{127, 255, 0}}; + * + * // Multiple arguments of the same type are allowed, but only the first is + * // used -- in this example, payload is set to 42: + * event_attributes attr{ nvtx3::payload{42}, nvtx3::payload{7} }; + * + * // Range `r` will be customized according the attributes in `attr` + * nvtx3::scoped_range r{attr}; + * + * // For convenience, `event_attributes` constructor arguments may be passed + * // to the `scoped_range_in` contructor -- they are forwarded to the + * // `event_attributes` constructor + * nvtx3::scoped_range r{nvtx3::payload{42}, nvtx3::category{1}, "message"}; + * + * // Using the nvtx3 namespace in a local scope makes the syntax more succinct: + * using namespace nvtx3; + * scoped_range r{payload{42}, category{1}, "message"}; + * \endcode + * + */ +class event_attributes { + public: + using value_type = nvtxEventAttributes_t; + + /** + * @brief Default constructor creates an `event_attributes` with no + * category, color, payload, nor message. + */ + constexpr event_attributes() noexcept + : attributes_{ + NVTX_VERSION, // version + sizeof(nvtxEventAttributes_t), // size + 0, // category + NVTX_COLOR_UNKNOWN, // color type + 0, // color value + NVTX_PAYLOAD_UNKNOWN, // payload type + 0, // reserved 4B + 0, // payload value (union) + NVTX_MESSAGE_UNKNOWN, // message type + 0 // message value (union) + } + { + } + + /** + * @brief Variadic constructor where the first argument is a `category`. + * + * Sets the value of the `EventAttribute`s category based on `c` and + * forwards the remaining variadic parameter pack to the next constructor. + * + */ + template + NVTX3_CONSTEXPR_IF_CPP14 explicit event_attributes(category const& c, Args const&... args) noexcept + : event_attributes(args...) + { + attributes_.category = c.get_id(); + } + + /** + * @brief Variadic constructor where the first argument is a `color`. + * + * Sets the value of the `EventAttribute`s color based on `c` and forwards + * the remaining variadic parameter pack to the next constructor. + * + */ + template + NVTX3_CONSTEXPR_IF_CPP14 explicit event_attributes(color const& c, Args const&... args) noexcept + : event_attributes(args...) + { + attributes_.color = c.get_value(); + attributes_.colorType = c.get_type(); + } + + /** + * @brief Variadic constructor where the first argument is a `payload`. + * + * Sets the value of the `EventAttribute`s payload based on `p` and forwards + * the remaining variadic parameter pack to the next constructor. + * + */ + template + NVTX3_CONSTEXPR_IF_CPP14 explicit event_attributes(payload const& p, Args const&... args) noexcept + : event_attributes(args...) + { + attributes_.payload = p.get_value(); + attributes_.payloadType = p.get_type(); + } + + /** + * @brief Variadic constructor where the first argument is a `message`. + * + * Sets the value of the `EventAttribute`s message based on `m` and forwards + * the remaining variadic parameter pack to the next constructor. + * + */ + template + NVTX3_CONSTEXPR_IF_CPP14 explicit event_attributes(message const& m, Args const&... args) noexcept + : event_attributes(args...) + { + attributes_.message = m.get_value(); + attributes_.messageType = m.get_type(); + } + + ~event_attributes() = default; + event_attributes(event_attributes const&) = default; + event_attributes& operator=(event_attributes const&) = default; + event_attributes(event_attributes&&) = default; + event_attributes& operator=(event_attributes&&) = default; + + /** + * @brief Get raw pointer to underlying NVTX attributes object. + * + */ + constexpr value_type const* get() const noexcept { return &attributes_; } + + private: + value_type attributes_{}; ///< The NVTX attributes structure +}; + +/** + * @brief A RAII object for creating a NVTX range local to a thread within a + * domain. + * + * When constructed, begins a nested NVTX range on the calling thread in the + * specified domain. Upon destruction, ends the NVTX range. + * + * Behavior is undefined if a `scoped_range_in` object is + * created/destroyed on different threads. + * + * `scoped_range_in` is neither moveable nor copyable. + * + * `scoped_range_in`s may be nested within other ranges. + * + * The domain of the range is specified by the template type parameter `D`. + * By default, the `domain::global` is used, which scopes the range to the + * global NVTX domain. The convenience alias `scoped_range` is provided for + * ranges scoped to the global domain. + * + * A custom domain can be defined by creating a type, `D`, with a static + * member `D::name` whose value is used to name the domain associated with + * `D`. `D::name` must resolve to either `char const*` or `wchar_t const*` + * + * Example: + * \code{.cpp} + * // Define a type `my_domain` with a member `name` used to name the domain + * // associated with the type `my_domain`. + * struct my_domain{ + * static constexpr char const* name{"my domain"}; + * }; + * \endcode + * + * Usage: + * \code{.cpp} + * nvtx3::scoped_range_in r1{"range 1"}; // Range in my domain + * + * // Three equivalent ways to make a range in the global domain: + * nvtx3::scoped_range_in r2{"range 2"}; + * nvtx3::scoped_range_in<> r3{"range 3"}; + * nvtx3::scoped_range r4{"range 4"}; + * + * // Create an alias to succinctly make ranges in my domain: + * using my_scoped_range = nvtx3::scoped_range_in; + * + * my_scoped_range r3{"range 3"}; + * \endcode + */ +template +class scoped_range_in { + public: + /** + * @brief Construct a `scoped_range_in` with the specified + * `event_attributes` + * + * Example: + * \code{cpp} + * nvtx3::event_attributes attr{"msg", nvtx3::rgb{127,255,0}}; + * nvtx3::scoped_range range{attr}; // Creates a range with message contents + * // "msg" and green color + * \endcode + * + * @param[in] attr `event_attributes` that describes the desired attributes + * of the range. + */ + explicit scoped_range_in(event_attributes const& attr) noexcept + { +#ifndef NVTX_DISABLE + nvtxDomainRangePushEx(domain::get(), attr.get()); +#else + (void)attr; +#endif + } + + /** + * @brief Constructs a `scoped_range_in` from the constructor arguments + * of an `event_attributes`. + * + * Forwards the arguments `args...` to construct an + * `event_attributes` object. The `event_attributes` object is then + * associated with the `scoped_range_in`. + * + * For more detail, see `event_attributes` documentation. + * + * Example: + * \code{cpp} + * // Creates a range with message "message" and green color + * nvtx3::scoped_range r{"message", nvtx3::rgb{127,255,0}}; + * \endcode + * + * @param[in] args Arguments to used to construct an `event_attributes` associated with this + * range. + * + */ + template + explicit scoped_range_in(Args const&... args) noexcept + : scoped_range_in{event_attributes{args...}} + { + } + + /** + * @brief Default constructor creates a `scoped_range_in` with no + * message, color, payload, nor category. + * + */ + scoped_range_in() noexcept : scoped_range_in{event_attributes{}} {} + + /** + * @brief Delete `operator new` to disallow heap allocated objects. + * + * `scoped_range_in` must follow RAII semantics to guarantee proper push/pop semantics. + * + */ + void* operator new(std::size_t) = delete; + + scoped_range_in(scoped_range_in const&) = delete; + scoped_range_in& operator=(scoped_range_in const&) = delete; + scoped_range_in(scoped_range_in&&) = delete; + scoped_range_in& operator=(scoped_range_in&&) = delete; + + /** + * @brief Destroy the scoped_range_in, ending the NVTX range event. + */ + ~scoped_range_in() noexcept + { +#ifndef NVTX_DISABLE + nvtxDomainRangePop(domain::get()); +#endif + } +}; + +/** + * @brief Alias for a `scoped_range_in` in the global NVTX domain. + * + */ +using scoped_range = scoped_range_in; + +namespace detail { + +/// @cond internal +template +class optional_scoped_range_in +{ +public: + optional_scoped_range_in() = default; + + void begin(event_attributes const& attr) noexcept + { +#ifndef NVTX_DISABLE + // This class is not meant to be part of the public NVTX C++ API and should + // only be used in the `NVTX3_FUNC_RANGE_IF` and `NVTX3_FUNC_RANGE_IF_IN` + // macros. However, to prevent developers from misusing this class, make + // sure to not start multiple ranges. + if (initialized) { return; } + + nvtxDomainRangePushEx(domain::get(), attr.get()); + initialized = true; +#endif + } + + ~optional_scoped_range_in() noexcept + { +#ifndef NVTX_DISABLE + if (initialized) { nvtxDomainRangePop(domain::get()); } +#endif + } + + void* operator new(std::size_t) = delete; + optional_scoped_range_in(optional_scoped_range_in const&) = delete; + optional_scoped_range_in& operator=(optional_scoped_range_in const&) = delete; + optional_scoped_range_in(optional_scoped_range_in&&) = delete; + optional_scoped_range_in& operator=(optional_scoped_range_in&&) = delete; + +private: +#ifndef NVTX_DISABLE + bool initialized = false; +#endif +}; +/// @endcond + +} // namespace detail + +/** + * @brief Handle used for correlating explicit range start and end events. + * + * A handle is "null" if it does not correspond to any range. + * + */ +struct range_handle { + /// Type used for the handle's value + using value_type = nvtxRangeId_t; + + + /** + * @brief Construct a `range_handle` from the given id. + * + */ + constexpr explicit range_handle(value_type id) noexcept : _range_id{id} {} + + /** + * @brief Constructs a null range handle. + * + * A null range_handle corresponds to no range. Calling `end_range` on a + * null handle is undefined behavior when a tool is active. + * + */ + constexpr range_handle() noexcept = default; + + /** + * @brief Checks whether this handle is null + * + * Provides contextual conversion to `bool`. + * + * \code{cpp} + * range_handle handle{}; + * if (handle) {...} + * \endcode + * + */ + constexpr explicit operator bool() const noexcept { return get_value() != null_range_id; }; + + /** + * @brief Implicit conversion from `nullptr` constructs a null handle. + * + * Satisfies the "NullablePointer" requirement to make `range_handle` comparable with `nullptr`. + * + */ + constexpr range_handle(std::nullptr_t) noexcept {} + + /** + * @brief Returns the `range_handle`'s value + * + * @return value_type The handle's value + */ + constexpr value_type get_value() const noexcept { return _range_id; } + + private: + /// Sentinel value for a null handle that corresponds to no range + static constexpr value_type null_range_id = nvtxRangeId_t{0}; + + value_type _range_id{null_range_id}; ///< The underlying NVTX range id +}; + +/** + * @brief Compares two range_handles for equality + * + * @param lhs The first range_handle to compare + * @param rhs The second range_handle to compare + */ +inline constexpr bool operator==(range_handle lhs, range_handle rhs) noexcept +{ + return lhs.get_value() == rhs.get_value(); +} + +/** + * @brief Compares two range_handles for inequality + * + * @param lhs The first range_handle to compare + * @param rhs The second range_handle to compare + */ +inline constexpr bool operator!=(range_handle lhs, range_handle rhs) noexcept { return !(lhs == rhs); } + +/** + * @brief Manually begin an NVTX range. + * + * Explicitly begins an NVTX range and returns a unique handle. To end the + * range, pass the handle to `end_range_in()`. + * + * `nvtx3::start_range(...)` is equivalent to `nvtx3::start_range_in<>(...)` and + * `nvtx3::start_range_in(...)`. + * + * `start_range_in/end_range_in` are the most explicit and lowest level APIs + * provided for creating ranges. Use of `nvtx3::unique_range_in` should be + * preferred unless one is unable to tie the range to the lifetime of an object. + * + * Example: + * \code{.cpp} + * nvtx3::event_attributes attr{"msg", nvtx3::rgb{127,255,0}}; + * // Manually begin a range + * nvtx3::range_handle h = nvtx3::start_range_in(attr); + * ... + * nvtx3::end_range_in(h); // End the range + * \endcode + * + * @tparam D Type containing `name` member used to identify the `domain` + * to which the range belongs. Else, `domain::global` to indicate that the + * global NVTX domain should be used. + * @param[in] attr `event_attributes` that describes the desired attributes + * of the range. + * @return Unique handle to be passed to `end_range_in` to end the range. + */ +template +inline range_handle start_range_in(event_attributes const& attr) noexcept +{ +#ifndef NVTX_DISABLE + return range_handle{nvtxDomainRangeStartEx(domain::get(), attr.get())}; +#else + (void)attr; + return {}; +#endif +} + +/** + * @brief Manually begin an NVTX range. + * + * Explicitly begins an NVTX range and returns a unique handle. To end the + * range, pass the handle to `end_range_in()`. + * + * `nvtx3::start_range(...)` is equivalent to `nvtx3::start_range_in<>(...)` and + * `nvtx3::start_range_in(...)`. + * + * `start_range_in/end_range_in` are the most explicit and lowest level APIs + * provided for creating ranges. Use of `nvtx3::unique_range_in` should be + * preferred unless one is unable to tie the range to the lifetime of an object. + * + * This overload uses `args...` to construct an `event_attributes` to + * associate with the range. For more detail, see `event_attributes`. + * + * Example: + * \code{cpp} + * // Manually begin a range + * nvtx3::range_handle h = nvtx3::start_range_in("msg", nvtx3::rgb{127,255,0}); + * ... + * nvtx3::end_range_in(h); // Ends the range + * \endcode + * + * @tparam D Type containing `name` member used to identify the `domain` + * to which the range belongs. Else, `domain::global` to indicate that the + * global NVTX domain should be used. + * @param args[in] Variadic parameter pack of the arguments for an `event_attributes`. + * @return Unique handle to be passed to `end_range` to end the range. + */ +template +inline range_handle start_range_in(Args const&... args) noexcept +{ +#ifndef NVTX_DISABLE + return start_range_in(event_attributes{args...}); +#else + return {}; +#endif +} + +/** + * @brief Manually begin an NVTX range in the global domain. + * + * Explicitly begins an NVTX range and returns a unique handle. To end the + * range, pass the handle to `end_range()`. + * + * `nvtx3::start_range(...)` is equivalent to `nvtx3::start_range_in<>(...)` and + * `nvtx3::start_range_in(...)`. + * + * `start_range/end_range` are the most explicit and lowest level APIs + * provided for creating ranges. Use of `nvtx3::unique_range` should be + * preferred unless one is unable to tie the range to the lifetime of an object. + * + * Example: + * \code{.cpp} + * nvtx3::event_attributes attr{"msg", nvtx3::rgb{127,255,0}}; + * // Manually begin a range + * nvtx3::range_handle h = nvtx3::start_range(attr); + * ... + * nvtx3::end_range(h); // End the range + * \endcode + * + * @param[in] attr `event_attributes` that describes the desired attributes + * of the range. + * @return Unique handle to be passed to `end_range_in` to end the range. + */ +inline range_handle start_range(event_attributes const& attr) noexcept +{ +#ifndef NVTX_DISABLE + return start_range_in(attr); +#else + (void)attr; + return {}; +#endif +} + +/** + * @brief Manually begin an NVTX range in the global domain. + * + * Explicitly begins an NVTX range and returns a unique handle. To end the + * range, pass the handle to `end_range_in()`. + * + * `nvtx3::start_range(...)` is equivalent to `nvtx3::start_range_in<>(...)` and + * `nvtx3::start_range_in(...)`. + * + * `start_range_in/end_range_in` are the most explicit and lowest level APIs + * provided for creating ranges. Use of `nvtx3::unique_range_in` should be + * preferred unless one is unable to tie the range to the lifetime of an object. + * + * This overload uses `args...` to construct an `event_attributes` to + * associate with the range. For more detail, see `event_attributes`. + * + * Example: + * \code{cpp} + * // Manually begin a range + * nvtx3::range_handle h = nvtx3::start_range("msg", nvtx3::rgb{127,255,0}); + * ... + * nvtx3::end_range(h); // Ends the range + * \endcode + * + * @param args[in] Variadic parameter pack of the arguments for an `event_attributes`. + * @return Unique handle to be passed to `end_range` to end the range. + */ +template +inline range_handle start_range(Args const&... args) noexcept +{ +#ifndef NVTX_DISABLE + return start_range_in(args...); +#else + return {}; +#endif +} + +/** + * @brief Manually end the range associated with the handle `r` in domain `D`. + * + * Explicitly ends the NVTX range indicated by the handle `r` returned from a + * prior call to `start_range_in`. The range may end on a different thread + * from where it began. + * + * @tparam D Type containing `name` member used to identify the `domain` to + * which the range belongs. Else, `domain::global` to indicate that the global + * NVTX domain should be used. + * @param r Handle to a range started by a prior call to `start_range_in`. + * + * @warning The domain type specified as template parameter to this function + * must be the same that was specified on the associated `start_range_in` call. + */ +template +inline void end_range_in(range_handle r) noexcept +{ +#ifndef NVTX_DISABLE + nvtxDomainRangeEnd(domain::get(), r.get_value()); +#else + (void)r; +#endif +} + +/** + * @brief Manually end the range associated with the handle `r` in the global + * domain. + * + * Explicitly ends the NVTX range indicated by the handle `r` returned from a + * prior call to `start_range`. The range may end on a different thread from + * where it began. + * + * @param r Handle to a range started by a prior call to `start_range`. + * + * @warning The domain type specified as template parameter to this function + * must be the same that was specified on the associated `start_range` call. + */ +inline void end_range(range_handle r) noexcept +{ +#ifndef NVTX_DISABLE + end_range_in(r); +#else + (void)r; +#endif +} + +/** + * @brief A RAII object for creating a NVTX range within a domain that can + * be created and destroyed on different threads. + * + * When constructed, begins a NVTX range in the specified domain. Upon + * destruction, ends the NVTX range. + * + * Similar to `nvtx3::scoped_range_in`, with a few key differences: + * - `unique_range` objects can be destroyed in an order whereas `scoped_range` objects must be + * destroyed in exact reverse creation order + * - `unique_range` can start and end on different threads + * - `unique_range` is moveable + * - `unique_range` objects can be constructed as heap objects + * + * There is extra overhead associated with `unique_range` constructs and therefore use of + * `nvtx3::scoped_range_in` should be preferred. + * + * @tparam D Type containing `name` member used to identify the `domain` + * to which the `unique_range_in` belongs. Else, `domain::global` to + * indicate that the global NVTX domain should be used. + */ +template +class unique_range_in { + public: + /** + * @brief Construct a new unique_range_in object with the specified event attributes + * + * Example: + * \code{cpp} + * nvtx3::event_attributes attr{"msg", nvtx3::rgb{127,255,0}}; + * nvtx3::unique_range_in range{attr}; // Creates a range with message contents + * // "msg" and green color + * \endcode + * + * @param[in] attr `event_attributes` that describes the desired attributes + * of the range. + */ + explicit unique_range_in(event_attributes const& attr) noexcept + : handle_{start_range_in(attr)} + { + } + + /** + * @brief Constructs a `unique_range_in` from the constructor arguments + * of an `event_attributes`. + * + * Forwards the arguments `args...` to construct an + * `event_attributes` object. The `event_attributes` object is then + * associated with the `unique_range_in`. + * + * For more detail, see `event_attributes` documentation. + * + * Example: + * \code{.cpp} + * // Creates a range with message "message" and green color + * nvtx3::unique_range_in<> r{"message", nvtx3::rgb{127,255,0}}; + * \endcode + * + * @param[in] args Variadic parameter pack of arguments to construct an `event_attributes` + * associated with this range. + */ + template + explicit unique_range_in(Args const&... args) noexcept + : unique_range_in{event_attributes{args...}} + { + } + + /** + * @brief Default constructor creates a `unique_range_in` with no + * message, color, payload, nor category. + * + */ + constexpr unique_range_in() noexcept : unique_range_in{event_attributes{}} {} + + /** + * @brief Destroy the `unique_range_in` ending the range. + * + */ + ~unique_range_in() noexcept = default; + + /** + * @brief Move constructor allows taking ownership of the NVTX range from + * another `unique_range_in`. + * + * @param other The range to take ownership of + */ + unique_range_in(unique_range_in&& other) noexcept = default; + + /** + * @brief Move assignment operator allows taking ownership of an NVTX range + * from another `unique_range_in`. + * + * @param other The range to take ownership of + */ + unique_range_in& operator=(unique_range_in&& other) noexcept = default; + + /// Copy construction is not allowed to prevent multiple objects from owning + /// the same range handle + unique_range_in(unique_range_in const&) = delete; + + /// Copy assignment is not allowed to prevent multiple objects from owning the + /// same range handle + unique_range_in& operator=(unique_range_in const&) = delete; + + private: + + struct end_range_handle { + using pointer = range_handle; /// Override the pointer type of the unique_ptr + void operator()(range_handle h) const noexcept { end_range_in(h); } + }; + + /// Range handle used to correlate the start/end of the range + std::unique_ptr handle_; +}; + +/** + * @brief Alias for a `unique_range_in` in the global NVTX domain. + * + */ +using unique_range = unique_range_in; + +/** + * @brief Annotates an instantaneous point in time with a "marker", using the + * attributes specified by `attr`. + * + * Unlike a "range" which has a beginning and an end, a marker is a single event + * in an application, such as detecting a problem: + * + * \code{.cpp} + * bool success = do_operation(...); + * if (!success) { + * nvtx3::event_attributes attr{"operation failed!", nvtx3::rgb{255,0,0}}; + * nvtx3::mark_in(attr); + * } + * \endcode + * + * Note that nvtx3::mark_in is a function, not a class like scoped_range_in. + * + * @tparam D Type containing `name` member used to identify the `domain` + * to which the `unique_range_in` belongs. Else, `domain::global` to + * indicate that the global NVTX domain should be used. + * @param[in] attr `event_attributes` that describes the desired attributes + * of the mark. + */ +template +inline void mark_in(event_attributes const& attr) noexcept +{ +#ifndef NVTX_DISABLE + nvtxDomainMarkEx(domain::get(), attr.get()); +#else + (void)(attr); +#endif +} + +/** + * @brief Annotates an instantaneous point in time with a "marker", using the + * arguments to construct an `event_attributes`. + * + * Unlike a "range" which has a beginning and an end, a marker is a single event + * in an application, such as detecting a problem: + * + * \code{.cpp} + * bool success = do_operation(...); + * if (!success) { + * nvtx3::mark_in("operation failed!", nvtx3::rgb{255,0,0}); + * } + * \endcode + * + * Note that nvtx3::mark_in is a function, not a class like scoped_range_in. + * + * Forwards the arguments `args...` to construct an `event_attributes` object. + * The attributes are then associated with the marker. For more detail, see + * the `event_attributes` documentation. + * + * @tparam D Type containing `name` member used to identify the `domain` + * to which the `unique_range_in` belongs. Else `domain::global` to + * indicate that the global NVTX domain should be used. + * @param[in] args Variadic parameter pack of arguments to construct an `event_attributes` + * associated with this range. + * + */ +template +inline void mark_in(Args const&... args) noexcept +{ +#ifndef NVTX_DISABLE + mark_in(event_attributes{args...}); +#endif +} + +/** + * @brief Annotates an instantaneous point in time with a "marker", using the + * attributes specified by `attr`, in the global domain. + * + * Unlike a "range" which has a beginning and an end, a marker is a single event + * in an application, such as detecting a problem: + * + * \code{.cpp} + * bool success = do_operation(...); + * if (!success) { + * nvtx3::event_attributes attr{"operation failed!", nvtx3::rgb{255,0,0}}; + * nvtx3::mark(attr); + * } + * \endcode + * + * Note that nvtx3::mark is a function, not a class like scoped_range. + * + * @param[in] attr `event_attributes` that describes the desired attributes + * of the mark. + */ +inline void mark(event_attributes const& attr) noexcept +{ +#ifndef NVTX_DISABLE + mark_in(attr); +#endif +} + +/** + * @brief Annotates an instantaneous point in time with a "marker", using the + * arguments to construct an `event_attributes`, in the global domain. + * + * Unlike a "range" which has a beginning and an end, a marker is a single event + * in an application, such as detecting a problem: + * + * \code{.cpp} + * bool success = do_operation(...); + * if (!success) { + * nvtx3::mark("operation failed!", nvtx3::rgb{255,0,0}); + * } + * \endcode + * + * Note that nvtx3::mark is a function, not a class like scoped_range. + * + * Forwards the arguments `args...` to construct an `event_attributes` object. + * The attributes are then associated with the marker. For more detail, see + * the `event_attributes` documentation. + * + * @param[in] args Variadic parameter pack of arguments to construct an + * `event_attributes` associated with this range. + * + */ +template +inline void mark(Args const&... args) noexcept +{ +#ifndef NVTX_DISABLE + mark_in(args...); +#endif +} + +} // namespace NVTX3_VERSION_NAMESPACE + +} // namespace nvtx3 + +#ifndef NVTX_DISABLE +/** + * @brief Convenience macro for generating a range in the specified `domain` + * from the lifetime of a function + * + * This macro is useful for generating an NVTX range in `domain` from + * the entry point of a function to its exit. It is intended to be the first + * line of the function. + * + * Constructs a static `registered_string_in` using the name of the immediately + * enclosing function returned by `__func__` and constructs a + * `nvtx3::scoped_range` using the registered function name as the range's + * message. + * + * Example: + * \code{.cpp} + * struct my_domain{static constexpr char const* name{"my_domain"};}; + * + * void foo(...) { + * NVTX3_FUNC_RANGE_IN(my_domain); // Range begins on entry to foo() + * // do stuff + * ... + * } // Range ends on return from foo() + * \endcode + * + * @param[in] D Type containing `name` member used to identify the + * `domain` to which the `registered_string_in` belongs. Else, + * `domain::global` to indicate that the global NVTX domain should be used. + */ +#define NVTX3_V1_FUNC_RANGE_IN(D) \ + static ::nvtx3::v1::registered_string_in const nvtx3_func_name__{__func__}; \ + static ::nvtx3::v1::event_attributes const nvtx3_func_attr__{nvtx3_func_name__}; \ + ::nvtx3::v1::scoped_range_in const nvtx3_range__{nvtx3_func_attr__}; + +/** + * @brief Convenience macro for generating a range in the specified `domain` + * from the lifetime of a function if the given boolean expression evaluates + * to true. + * + * Similar to `NVTX3_V1_FUNC_RANGE_IN(D)`, the only difference being that + * `NVTX3_V1_FUNC_RANGE_IF_IN(D, C)` only generates a range if the given boolean + * expression evaluates to true. + * + * @param[in] D Type containing `name` member used to identify the + * `domain` to which the `registered_string_in` belongs. Else, + * `domain::global` to indicate that the global NVTX domain should be used. + * + * @param[in] C Boolean expression used to determine if a range should be + * generated. + */ +#define NVTX3_V1_FUNC_RANGE_IF_IN(D, C) \ + ::nvtx3::v1::detail::optional_scoped_range_in optional_nvtx3_range__; \ + if (C) { \ + static ::nvtx3::v1::registered_string_in const nvtx3_func_name__{__func__}; \ + static ::nvtx3::v1::event_attributes const nvtx3_func_attr__{nvtx3_func_name__}; \ + optional_nvtx3_range__.begin(nvtx3_func_attr__); \ + } +#else +#define NVTX3_V1_FUNC_RANGE_IN(D) +#define NVTX3_V1_FUNC_RANGE_IF_IN(D, C) +#endif // NVTX_DISABLE + +/** + * @brief Convenience macro for generating a range in the global domain from the + * lifetime of a function. + * + * This macro is useful for generating an NVTX range in the global domain from + * the entry point of a function to its exit. It is intended to be the first + * line of the function. + * + * Constructs a static `registered_string_in` using the name of the immediately + * enclosing function returned by `__func__` and constructs a + * `nvtx3::scoped_range` using the registered function name as the range's + * message. + * + * Example: + * \code{.cpp} + * void foo(...) { + * NVTX3_FUNC_RANGE(); // Range begins on entry to foo() + * // do stuff + * ... + * } // Range ends on return from foo() + * \endcode + */ +#define NVTX3_V1_FUNC_RANGE() NVTX3_V1_FUNC_RANGE_IN(::nvtx3::v1::domain::global) + +/** + * @brief Convenience macro for generating a range in the global domain from the + * lifetime of a function if the given boolean expression evaluates to true. + * + * Similar to `NVTX3_V1_FUNC_RANGE()`, the only difference being that + * `NVTX3_V1_FUNC_RANGE_IF(C)` only generates a range if the given boolean + * expression evaluates to true. + * + * @param[in] C Boolean expression used to determine if a range should be + * generated. + */ +#define NVTX3_V1_FUNC_RANGE_IF(C) NVTX3_V1_FUNC_RANGE_IF_IN(::nvtx3::v1::domain::global, C) + +/* When inlining this version, versioned macros must have unversioned aliases. + * For each NVTX3_Vx_ #define, make an NVTX3_ alias of it here.*/ +#if defined(NVTX3_INLINE_THIS_VERSION) +/* clang format off */ +#define NVTX3_FUNC_RANGE NVTX3_V1_FUNC_RANGE +#define NVTX3_FUNC_RANGE_IF NVTX3_V1_FUNC_RANGE_IF +#define NVTX3_FUNC_RANGE_IN NVTX3_V1_FUNC_RANGE_IN +#define NVTX3_FUNC_RANGE_IF_IN NVTX3_V1_FUNC_RANGE_IF_IN +/* clang format on */ +#endif + +#endif // NVTX3_CPP_DEFINITIONS_V1_0 + +/* Add functionality for new minor versions here, by copying the above section enclosed + * in #ifndef NVTX3_CPP_DEFINITIONS_Vx_y, and incrementing the minor version. This code + * is an example of how additions for version 1.2 would look, indented for clarity. Note + * that the versioned symbols and macros are always provided, and the unversioned symbols + * are only provided if NVTX3_INLINE_THIS_VERSION was defined at the top of this header. + * + * \code{.cpp} + * #ifndef NVTX3_CPP_DEFINITIONS_V1_2 + * #define NVTX3_CPP_DEFINITIONS_V1_2 + * namespace nvtx3 { + * NVTX3_INLINE_IF_REQUESTED namespace NVTX3_VERSION_NAMESPACE { + * class new_class {}; + * inline void new_function() {} + * } + * } + * + * // Macros must have the major version in their names: + * #define NVTX3_V1_NEW_MACRO_A() ... + * #define NVTX3_V1_NEW_MACRO_B() ... + * + * // If inlining, make aliases for the macros with the version number omitted + * #if defined(NVTX3_INLINE_THIS_VERSION) + * #define NVTX3_NEW_MACRO_A NVTX3_V1_NEW_MACRO_A + * #define NVTX3_NEW_MACRO_B NVTX3_V1_NEW_MACRO_B + * #endif + * #endif // NVTX3_CPP_DEFINITIONS_V1_2 + * \endcode + */ + +/* Undefine all temporarily-defined unversioned macros, which would conflict with + * subsequent includes of different versions of this header. */ +#undef NVTX3_CPP_VERSION_MAJOR +#undef NVTX3_CPP_VERSION_MINOR +#undef NVTX3_CONCAT +#undef NVTX3_NAMESPACE_FOR +#undef NVTX3_VERSION_NAMESPACE +#undef NVTX3_INLINE_IF_REQUESTED +#undef NVTX3_CONSTEXPR_IF_CPP14 + +#if defined(NVTX3_INLINE_THIS_VERSION) +#undef NVTX3_INLINE_THIS_VERSION +#endif + +#if defined(NVTX3_USE_CHECKED_OVERLOADS_FOR_GET_DEFINED_HERE) +#undef NVTX3_USE_CHECKED_OVERLOADS_FOR_GET_DEFINED_HERE +#undef NVTX3_USE_CHECKED_OVERLOADS_FOR_GET +#endif + +#if defined(NVTX3_STATIC_ASSERT_DEFINED_HERE) +#undef NVTX3_STATIC_ASSERT_DEFINED_HERE +#undef NVTX3_STATIC_ASSERT +#endif diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxImpl.h b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxImpl.h new file mode 100644 index 0000000000000000000000000000000000000000..c0ef6774cf6856960220f46156bf46064c3ebf78 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxImpl.h @@ -0,0 +1,438 @@ +/* +* Copyright 2009-2022 NVIDIA Corporation. All rights reserved. +* +* Licensed under the Apache License v2.0 with LLVM Exceptions. +* See https://llvm.org/LICENSE.txt for license information. +* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +*/ + +#ifndef NVTX_IMPL_GUARD +#error Never include this file directly -- it is automatically included by nvToolsExt.h (except when NVTX_NO_IMPL is defined). +#endif + +/* ---- Include required platform headers ---- */ + +#if defined(_WIN32) + +#include + +#else +#include + +#if defined(__ANDROID__) +#include +#endif + +#if defined(__linux__) || defined(__CYGWIN__) +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#endif + +/* ---- Define macros used in this file ---- */ + +#define NVTX_INIT_STATE_FRESH 0 +#define NVTX_INIT_STATE_STARTED 1 +#define NVTX_INIT_STATE_COMPLETE 2 + +#ifdef NVTX_DEBUG_PRINT +#ifdef __ANDROID__ +#include +#define NVTX_ERR(...) __android_log_print(ANDROID_LOG_ERROR, "NVTOOLSEXT", __VA_ARGS__); +#define NVTX_INFO(...) __android_log_print(ANDROID_LOG_INFO, "NVTOOLSEXT", __VA_ARGS__); +#else +#include +#define NVTX_ERR(...) fprintf(stderr, "NVTX_ERROR: " __VA_ARGS__) +#define NVTX_INFO(...) fprintf(stderr, "NVTX_INFO: " __VA_ARGS__) +#endif +#else /* !defined(NVTX_DEBUG_PRINT) */ +#define NVTX_ERR(...) +#define NVTX_INFO(...) +#endif + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#ifdef __GNUC__ +#pragma GCC visibility push(hidden) +#endif + +/* ---- Forward declare all functions referenced in globals ---- */ + +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(void); +NVTX_LINKONCE_FWDDECL_FUNCTION int NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxEtiGetModuleFunctionTable)( + NvtxCallbackModule module, + NvtxFunctionTable* out_table, + unsigned int* out_size); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxEtiSetInjectionNvtxVersion)( + uint32_t version); +NVTX_LINKONCE_FWDDECL_FUNCTION const void* NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxGetExportTable)( + uint32_t exportTableId); + +#include "nvtxInitDecls.h" + +/* ---- Define all globals ---- */ + +typedef struct nvtxGlobals_t +{ + volatile unsigned int initState; + NvtxExportTableCallbacks etblCallbacks; + NvtxExportTableVersionInfo etblVersionInfo; + + /* Implementation function pointers */ + nvtxMarkEx_impl_fntype nvtxMarkEx_impl_fnptr; + nvtxMarkA_impl_fntype nvtxMarkA_impl_fnptr; + nvtxMarkW_impl_fntype nvtxMarkW_impl_fnptr; + nvtxRangeStartEx_impl_fntype nvtxRangeStartEx_impl_fnptr; + nvtxRangeStartA_impl_fntype nvtxRangeStartA_impl_fnptr; + nvtxRangeStartW_impl_fntype nvtxRangeStartW_impl_fnptr; + nvtxRangeEnd_impl_fntype nvtxRangeEnd_impl_fnptr; + nvtxRangePushEx_impl_fntype nvtxRangePushEx_impl_fnptr; + nvtxRangePushA_impl_fntype nvtxRangePushA_impl_fnptr; + nvtxRangePushW_impl_fntype nvtxRangePushW_impl_fnptr; + nvtxRangePop_impl_fntype nvtxRangePop_impl_fnptr; + nvtxNameCategoryA_impl_fntype nvtxNameCategoryA_impl_fnptr; + nvtxNameCategoryW_impl_fntype nvtxNameCategoryW_impl_fnptr; + nvtxNameOsThreadA_impl_fntype nvtxNameOsThreadA_impl_fnptr; + nvtxNameOsThreadW_impl_fntype nvtxNameOsThreadW_impl_fnptr; + + nvtxNameCuDeviceA_fakeimpl_fntype nvtxNameCuDeviceA_impl_fnptr; + nvtxNameCuDeviceW_fakeimpl_fntype nvtxNameCuDeviceW_impl_fnptr; + nvtxNameCuContextA_fakeimpl_fntype nvtxNameCuContextA_impl_fnptr; + nvtxNameCuContextW_fakeimpl_fntype nvtxNameCuContextW_impl_fnptr; + nvtxNameCuStreamA_fakeimpl_fntype nvtxNameCuStreamA_impl_fnptr; + nvtxNameCuStreamW_fakeimpl_fntype nvtxNameCuStreamW_impl_fnptr; + nvtxNameCuEventA_fakeimpl_fntype nvtxNameCuEventA_impl_fnptr; + nvtxNameCuEventW_fakeimpl_fntype nvtxNameCuEventW_impl_fnptr; + + nvtxNameClDeviceA_fakeimpl_fntype nvtxNameClDeviceA_impl_fnptr; + nvtxNameClDeviceW_fakeimpl_fntype nvtxNameClDeviceW_impl_fnptr; + nvtxNameClContextA_fakeimpl_fntype nvtxNameClContextA_impl_fnptr; + nvtxNameClContextW_fakeimpl_fntype nvtxNameClContextW_impl_fnptr; + nvtxNameClCommandQueueA_fakeimpl_fntype nvtxNameClCommandQueueA_impl_fnptr; + nvtxNameClCommandQueueW_fakeimpl_fntype nvtxNameClCommandQueueW_impl_fnptr; + nvtxNameClMemObjectA_fakeimpl_fntype nvtxNameClMemObjectA_impl_fnptr; + nvtxNameClMemObjectW_fakeimpl_fntype nvtxNameClMemObjectW_impl_fnptr; + nvtxNameClSamplerA_fakeimpl_fntype nvtxNameClSamplerA_impl_fnptr; + nvtxNameClSamplerW_fakeimpl_fntype nvtxNameClSamplerW_impl_fnptr; + nvtxNameClProgramA_fakeimpl_fntype nvtxNameClProgramA_impl_fnptr; + nvtxNameClProgramW_fakeimpl_fntype nvtxNameClProgramW_impl_fnptr; + nvtxNameClEventA_fakeimpl_fntype nvtxNameClEventA_impl_fnptr; + nvtxNameClEventW_fakeimpl_fntype nvtxNameClEventW_impl_fnptr; + + nvtxNameCudaDeviceA_impl_fntype nvtxNameCudaDeviceA_impl_fnptr; + nvtxNameCudaDeviceW_impl_fntype nvtxNameCudaDeviceW_impl_fnptr; + nvtxNameCudaStreamA_fakeimpl_fntype nvtxNameCudaStreamA_impl_fnptr; + nvtxNameCudaStreamW_fakeimpl_fntype nvtxNameCudaStreamW_impl_fnptr; + nvtxNameCudaEventA_fakeimpl_fntype nvtxNameCudaEventA_impl_fnptr; + nvtxNameCudaEventW_fakeimpl_fntype nvtxNameCudaEventW_impl_fnptr; + + nvtxDomainMarkEx_impl_fntype nvtxDomainMarkEx_impl_fnptr; + nvtxDomainRangeStartEx_impl_fntype nvtxDomainRangeStartEx_impl_fnptr; + nvtxDomainRangeEnd_impl_fntype nvtxDomainRangeEnd_impl_fnptr; + nvtxDomainRangePushEx_impl_fntype nvtxDomainRangePushEx_impl_fnptr; + nvtxDomainRangePop_impl_fntype nvtxDomainRangePop_impl_fnptr; + nvtxDomainResourceCreate_impl_fntype nvtxDomainResourceCreate_impl_fnptr; + nvtxDomainResourceDestroy_impl_fntype nvtxDomainResourceDestroy_impl_fnptr; + nvtxDomainNameCategoryA_impl_fntype nvtxDomainNameCategoryA_impl_fnptr; + nvtxDomainNameCategoryW_impl_fntype nvtxDomainNameCategoryW_impl_fnptr; + nvtxDomainRegisterStringA_impl_fntype nvtxDomainRegisterStringA_impl_fnptr; + nvtxDomainRegisterStringW_impl_fntype nvtxDomainRegisterStringW_impl_fnptr; + nvtxDomainCreateA_impl_fntype nvtxDomainCreateA_impl_fnptr; + nvtxDomainCreateW_impl_fntype nvtxDomainCreateW_impl_fnptr; + nvtxDomainDestroy_impl_fntype nvtxDomainDestroy_impl_fnptr; + nvtxInitialize_impl_fntype nvtxInitialize_impl_fnptr; + + nvtxDomainSyncUserCreate_impl_fntype nvtxDomainSyncUserCreate_impl_fnptr; + nvtxDomainSyncUserDestroy_impl_fntype nvtxDomainSyncUserDestroy_impl_fnptr; + nvtxDomainSyncUserAcquireStart_impl_fntype nvtxDomainSyncUserAcquireStart_impl_fnptr; + nvtxDomainSyncUserAcquireFailed_impl_fntype nvtxDomainSyncUserAcquireFailed_impl_fnptr; + nvtxDomainSyncUserAcquireSuccess_impl_fntype nvtxDomainSyncUserAcquireSuccess_impl_fnptr; + nvtxDomainSyncUserReleasing_impl_fntype nvtxDomainSyncUserReleasing_impl_fnptr; + + /* Tables of function pointers -- Extra null added to the end to ensure + * a crash instead of silent corruption if a tool reads off the end. */ + NvtxFunctionPointer* functionTable_CORE [NVTX_CBID_CORE_SIZE + 1]; + NvtxFunctionPointer* functionTable_CUDA [NVTX_CBID_CUDA_SIZE + 1]; + NvtxFunctionPointer* functionTable_OPENCL[NVTX_CBID_OPENCL_SIZE + 1]; + NvtxFunctionPointer* functionTable_CUDART[NVTX_CBID_CUDART_SIZE + 1]; + NvtxFunctionPointer* functionTable_CORE2 [NVTX_CBID_CORE2_SIZE + 1]; + NvtxFunctionPointer* functionTable_SYNC [NVTX_CBID_SYNC_SIZE + 1]; +} nvtxGlobals_t; + +NVTX_LINKONCE_DEFINE_GLOBAL nvtxGlobals_t NVTX_VERSIONED_IDENTIFIER(nvtxGlobals) = +{ + NVTX_INIT_STATE_FRESH, + + { + sizeof(NvtxExportTableCallbacks), + NVTX_VERSIONED_IDENTIFIER(nvtxEtiGetModuleFunctionTable) + }, + { + sizeof(NvtxExportTableVersionInfo), + NVTX_VERSION, + 0, + NVTX_VERSIONED_IDENTIFIER(nvtxEtiSetInjectionNvtxVersion) + }, + + /* Implementation function pointers */ + NVTX_VERSIONED_IDENTIFIER(nvtxMarkEx_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxMarkA_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxMarkW_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxRangeStartEx_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxRangeStartA_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxRangeStartW_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxRangeEnd_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxRangePushEx_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxRangePushA_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxRangePushW_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxRangePop_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxNameCategoryA_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxNameCategoryW_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxNameOsThreadA_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxNameOsThreadW_impl_init), + + NVTX_VERSIONED_IDENTIFIER(nvtxNameCuDeviceA_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxNameCuDeviceW_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxNameCuContextA_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxNameCuContextW_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxNameCuStreamA_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxNameCuStreamW_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxNameCuEventA_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxNameCuEventW_impl_init), + + NVTX_VERSIONED_IDENTIFIER(nvtxNameClDeviceA_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxNameClDeviceW_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxNameClContextA_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxNameClContextW_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxNameClCommandQueueA_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxNameClCommandQueueW_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxNameClMemObjectA_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxNameClMemObjectW_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxNameClSamplerA_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxNameClSamplerW_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxNameClProgramA_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxNameClProgramW_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxNameClEventA_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxNameClEventW_impl_init), + + NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaDeviceA_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaDeviceW_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaStreamA_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaStreamW_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaEventA_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaEventW_impl_init), + + NVTX_VERSIONED_IDENTIFIER(nvtxDomainMarkEx_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxDomainRangeStartEx_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxDomainRangeEnd_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxDomainRangePushEx_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxDomainRangePop_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxDomainResourceCreate_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxDomainResourceDestroy_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxDomainNameCategoryA_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxDomainNameCategoryW_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxDomainRegisterStringA_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxDomainRegisterStringW_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxDomainCreateA_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxDomainCreateW_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxDomainDestroy_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxInitialize_impl_init), + + NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserCreate_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserDestroy_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserAcquireStart_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserAcquireFailed_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserAcquireSuccess_impl_init), + NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserReleasing_impl_init), + + /* Tables of function pointers */ + { + 0, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxMarkEx_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxMarkA_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxMarkW_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeStartEx_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeStartA_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeStartW_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeEnd_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePushEx_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePushA_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePushW_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePop_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCategoryA_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCategoryW_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameOsThreadA_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameOsThreadW_impl_fnptr, + 0 + }, + { + 0, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuDeviceA_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuDeviceW_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuContextA_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuContextW_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuStreamA_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuStreamW_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuEventA_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuEventW_impl_fnptr, + 0 + }, + { + 0, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClDeviceA_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClDeviceW_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClContextA_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClContextW_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClCommandQueueA_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClCommandQueueW_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClMemObjectA_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClMemObjectW_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClSamplerA_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClSamplerW_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClProgramA_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClProgramW_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClEventA_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClEventW_impl_fnptr, + 0 + }, + { + 0, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaDeviceA_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaDeviceW_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaStreamA_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaStreamW_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaEventA_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaEventW_impl_fnptr, + 0 + }, + { + 0, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainMarkEx_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangeStartEx_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangeEnd_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangePushEx_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangePop_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainResourceCreate_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainResourceDestroy_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainNameCategoryA_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainNameCategoryW_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRegisterStringA_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRegisterStringW_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainCreateA_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainCreateW_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainDestroy_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxInitialize_impl_fnptr, + 0 + }, + { + 0, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserCreate_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserDestroy_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireStart_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireFailed_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireSuccess_impl_fnptr, + (NvtxFunctionPointer*)&NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserReleasing_impl_fnptr, + 0 + } +}; + +/* ---- Define static inline implementations of core API functions ---- */ + +#include "nvtxImplCore.h" + +/* ---- Define implementations of export table functions ---- */ + +NVTX_LINKONCE_DEFINE_FUNCTION int NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxEtiGetModuleFunctionTable)( + NvtxCallbackModule module, + NvtxFunctionTable* out_table, + unsigned int* out_size) +{ + unsigned int bytes = 0; + NvtxFunctionTable table = (NvtxFunctionTable)0; + + switch (module) + { + case NVTX_CB_MODULE_CORE: + table = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).functionTable_CORE; + bytes = (unsigned int)sizeof(NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).functionTable_CORE); + break; + case NVTX_CB_MODULE_CUDA: + table = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).functionTable_CUDA; + bytes = (unsigned int)sizeof(NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).functionTable_CUDA); + break; + case NVTX_CB_MODULE_OPENCL: + table = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).functionTable_OPENCL; + bytes = (unsigned int)sizeof(NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).functionTable_OPENCL); + break; + case NVTX_CB_MODULE_CUDART: + table = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).functionTable_CUDART; + bytes = (unsigned int)sizeof(NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).functionTable_CUDART); + break; + case NVTX_CB_MODULE_CORE2: + table = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).functionTable_CORE2; + bytes = (unsigned int)sizeof(NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).functionTable_CORE2); + break; + case NVTX_CB_MODULE_SYNC: + table = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).functionTable_SYNC; + bytes = (unsigned int)sizeof(NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).functionTable_SYNC); + break; + default: return 0; + } + + if (out_size) + *out_size = (bytes / (unsigned int)sizeof(NvtxFunctionPointer*)) - 1; + + if (out_table) + *out_table = table; + + return 1; +} + +NVTX_LINKONCE_DEFINE_FUNCTION const void* NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxGetExportTable)(uint32_t exportTableId) +{ + switch (exportTableId) + { + case NVTX_ETID_CALLBACKS: return &NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).etblCallbacks; + case NVTX_ETID_VERSIONINFO: return &NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).etblVersionInfo; + default: return 0; + } +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxEtiSetInjectionNvtxVersion)(uint32_t version) +{ + /* Reserved for custom implementations to resolve problems with tools */ + (void)version; +} + +/* ---- Define implementations of init versions of all API functions ---- */ + +#include "nvtxInitDefs.h" + +/* ---- Define implementations of initialization functions ---- */ + +#include "nvtxInit.h" + +#ifdef __GNUC__ +#pragma GCC visibility pop +#endif + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxImplCore.h b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxImplCore.h new file mode 100644 index 0000000000000000000000000000000000000000..647fcb1452fb898f30fcf8a35cf358f863339646 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxImplCore.h @@ -0,0 +1,307 @@ +/* +* Copyright 2009-2022 NVIDIA Corporation. All rights reserved. +* +* Licensed under the Apache License v2.0 with LLVM Exceptions. +* See https://llvm.org/LICENSE.txt for license information. +* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +*/ + +NVTX_DECLSPEC void NVTX_API nvtxMarkEx(const nvtxEventAttributes_t* eventAttrib) +{ +#ifndef NVTX_DISABLE + nvtxMarkEx_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxMarkEx_impl_fnptr; + if(local!=0) + (*local)(eventAttrib); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxMarkA(const char* message) +{ +#ifndef NVTX_DISABLE + nvtxMarkA_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxMarkA_impl_fnptr; + if(local!=0) + (*local)(message); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxMarkW(const wchar_t* message) +{ +#ifndef NVTX_DISABLE + nvtxMarkW_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxMarkW_impl_fnptr; + if(local!=0) + (*local)(message); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC nvtxRangeId_t NVTX_API nvtxRangeStartEx(const nvtxEventAttributes_t* eventAttrib) +{ +#ifndef NVTX_DISABLE + nvtxRangeStartEx_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeStartEx_impl_fnptr; + if(local!=0) + return (*local)(eventAttrib); + else +#endif /*NVTX_DISABLE*/ + return (nvtxRangeId_t)0; +} + +NVTX_DECLSPEC nvtxRangeId_t NVTX_API nvtxRangeStartA(const char* message) +{ +#ifndef NVTX_DISABLE + nvtxRangeStartA_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeStartA_impl_fnptr; + if(local!=0) + return (*local)(message); + else +#endif /*NVTX_DISABLE*/ + return (nvtxRangeId_t)0; +} + +NVTX_DECLSPEC nvtxRangeId_t NVTX_API nvtxRangeStartW(const wchar_t* message) +{ +#ifndef NVTX_DISABLE + nvtxRangeStartW_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeStartW_impl_fnptr; + if(local!=0) + return (*local)(message); + else +#endif /*NVTX_DISABLE*/ + return (nvtxRangeId_t)0; +} + +NVTX_DECLSPEC void NVTX_API nvtxRangeEnd(nvtxRangeId_t id) +{ +#ifndef NVTX_DISABLE + nvtxRangeEnd_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeEnd_impl_fnptr; + if(local!=0) + (*local)(id); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC int NVTX_API nvtxRangePushEx(const nvtxEventAttributes_t* eventAttrib) +{ +#ifndef NVTX_DISABLE + nvtxRangePushEx_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePushEx_impl_fnptr; + if(local!=0) + return (*local)(eventAttrib); + else +#endif /*NVTX_DISABLE*/ + return (int)NVTX_NO_PUSH_POP_TRACKING; +} + +NVTX_DECLSPEC int NVTX_API nvtxRangePushA(const char* message) +{ +#ifndef NVTX_DISABLE + nvtxRangePushA_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePushA_impl_fnptr; + if(local!=0) + return (*local)(message); + else +#endif /*NVTX_DISABLE*/ + return (int)NVTX_NO_PUSH_POP_TRACKING; +} + +NVTX_DECLSPEC int NVTX_API nvtxRangePushW(const wchar_t* message) +{ +#ifndef NVTX_DISABLE + nvtxRangePushW_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePushW_impl_fnptr; + if(local!=0) + return (*local)(message); + else +#endif /*NVTX_DISABLE*/ + return (int)NVTX_NO_PUSH_POP_TRACKING; +} + +NVTX_DECLSPEC int NVTX_API nvtxRangePop(void) +{ +#ifndef NVTX_DISABLE + nvtxRangePop_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePop_impl_fnptr; + if(local!=0) + return (*local)(); + else +#endif /*NVTX_DISABLE*/ + return (int)NVTX_NO_PUSH_POP_TRACKING; +} + +NVTX_DECLSPEC void NVTX_API nvtxNameCategoryA(uint32_t category, const char* name) +{ +#ifndef NVTX_DISABLE + nvtxNameCategoryA_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCategoryA_impl_fnptr; + if(local!=0) + (*local)(category, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxNameCategoryW(uint32_t category, const wchar_t* name) +{ +#ifndef NVTX_DISABLE + nvtxNameCategoryW_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCategoryW_impl_fnptr; + if(local!=0) + (*local)(category, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxNameOsThreadA(uint32_t threadId, const char* name) +{ +#ifndef NVTX_DISABLE + nvtxNameOsThreadA_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameOsThreadA_impl_fnptr; + if(local!=0) + (*local)(threadId, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxNameOsThreadW(uint32_t threadId, const wchar_t* name) +{ +#ifndef NVTX_DISABLE + nvtxNameOsThreadW_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameOsThreadW_impl_fnptr; + if(local!=0) + (*local)(threadId, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxDomainMarkEx(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib) +{ +#ifndef NVTX_DISABLE + nvtxDomainMarkEx_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainMarkEx_impl_fnptr; + if(local!=0) + (*local)(domain, eventAttrib); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC nvtxRangeId_t NVTX_API nvtxDomainRangeStartEx(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib) +{ +#ifndef NVTX_DISABLE + nvtxDomainRangeStartEx_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangeStartEx_impl_fnptr; + if(local!=0) + return (*local)(domain, eventAttrib); + else +#endif /*NVTX_DISABLE*/ + return (nvtxRangeId_t)0; +} + +NVTX_DECLSPEC void NVTX_API nvtxDomainRangeEnd(nvtxDomainHandle_t domain, nvtxRangeId_t id) +{ +#ifndef NVTX_DISABLE + nvtxDomainRangeEnd_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangeEnd_impl_fnptr; + if(local!=0) + (*local)(domain, id); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC int NVTX_API nvtxDomainRangePushEx(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib) +{ +#ifndef NVTX_DISABLE + nvtxDomainRangePushEx_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangePushEx_impl_fnptr; + if(local!=0) + return (*local)(domain, eventAttrib); + else +#endif /*NVTX_DISABLE*/ + return (int)NVTX_NO_PUSH_POP_TRACKING; +} + +NVTX_DECLSPEC int NVTX_API nvtxDomainRangePop(nvtxDomainHandle_t domain) +{ +#ifndef NVTX_DISABLE + nvtxDomainRangePop_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangePop_impl_fnptr; + if(local!=0) + return (*local)(domain); + else +#endif /*NVTX_DISABLE*/ + return (int)NVTX_NO_PUSH_POP_TRACKING; +} + +NVTX_DECLSPEC nvtxResourceHandle_t NVTX_API nvtxDomainResourceCreate(nvtxDomainHandle_t domain, nvtxResourceAttributes_t* attribs) +{ +#ifndef NVTX_DISABLE + nvtxDomainResourceCreate_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainResourceCreate_impl_fnptr; + if(local!=0) + return (*local)(domain, attribs); + else +#endif /*NVTX_DISABLE*/ + return (nvtxResourceHandle_t)0; +} + +NVTX_DECLSPEC void NVTX_API nvtxDomainResourceDestroy(nvtxResourceHandle_t resource) +{ +#ifndef NVTX_DISABLE + nvtxDomainResourceDestroy_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainResourceDestroy_impl_fnptr; + if(local!=0) + (*local)(resource); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxDomainNameCategoryA(nvtxDomainHandle_t domain, uint32_t category, const char* name) +{ +#ifndef NVTX_DISABLE + nvtxDomainNameCategoryA_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainNameCategoryA_impl_fnptr; + if(local!=0) + (*local)(domain, category, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxDomainNameCategoryW(nvtxDomainHandle_t domain, uint32_t category, const wchar_t* name) +{ +#ifndef NVTX_DISABLE + nvtxDomainNameCategoryW_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainNameCategoryW_impl_fnptr; + if(local!=0) + (*local)(domain, category, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC nvtxStringHandle_t NVTX_API nvtxDomainRegisterStringA(nvtxDomainHandle_t domain, const char* string) +{ +#ifndef NVTX_DISABLE + nvtxDomainRegisterStringA_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRegisterStringA_impl_fnptr; + if(local!=0) + return (*local)(domain, string); + else +#endif /*NVTX_DISABLE*/ + return (nvtxStringHandle_t)0; +} + +NVTX_DECLSPEC nvtxStringHandle_t NVTX_API nvtxDomainRegisterStringW(nvtxDomainHandle_t domain, const wchar_t* string) +{ +#ifndef NVTX_DISABLE + nvtxDomainRegisterStringW_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRegisterStringW_impl_fnptr; + if(local!=0) + return (*local)(domain, string); + else +#endif /*NVTX_DISABLE*/ + return (nvtxStringHandle_t)0; +} + +NVTX_DECLSPEC nvtxDomainHandle_t NVTX_API nvtxDomainCreateA(const char* message) +{ +#ifndef NVTX_DISABLE + nvtxDomainCreateA_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainCreateA_impl_fnptr; + if(local!=0) + return (*local)(message); + else +#endif /*NVTX_DISABLE*/ + return (nvtxDomainHandle_t)0; +} + +NVTX_DECLSPEC nvtxDomainHandle_t NVTX_API nvtxDomainCreateW(const wchar_t* message) +{ +#ifndef NVTX_DISABLE + nvtxDomainCreateW_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainCreateW_impl_fnptr; + if(local!=0) + return (*local)(message); + else +#endif /*NVTX_DISABLE*/ + return (nvtxDomainHandle_t)0; +} + +NVTX_DECLSPEC void NVTX_API nvtxDomainDestroy(nvtxDomainHandle_t domain) +{ +#ifndef NVTX_DISABLE + nvtxDomainDestroy_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainDestroy_impl_fnptr; + if(local!=0) + (*local)(domain); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxInitialize(const void* reserved) +{ +#ifndef NVTX_DISABLE + nvtxInitialize_impl_fntype local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxInitialize_impl_fnptr; + if(local!=0) + (*local)(reserved); +#endif /*NVTX_DISABLE*/ +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxImplCudaRt_v3.h b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxImplCudaRt_v3.h new file mode 100644 index 0000000000000000000000000000000000000000..07ce530ee6dc57791a51c8c5d028c9d2b91f1f3a --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxImplCudaRt_v3.h @@ -0,0 +1,81 @@ +/* +* Copyright 2009-2022 NVIDIA Corporation. All rights reserved. +* +* Licensed under the Apache License v2.0 with LLVM Exceptions. +* See https://llvm.org/LICENSE.txt for license information. +* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +*/ + +#ifndef NVTX_IMPL_GUARD_CUDART +#error Never include this file directly -- it is automatically included by nvToolsExtCudaRt.h (except when NVTX_NO_IMPL is defined). +#endif + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +typedef void (NVTX_API * nvtxNameCudaDeviceA_impl_fntype)(int device, const char* name); +typedef void (NVTX_API * nvtxNameCudaDeviceW_impl_fntype)(int device, const wchar_t* name); +typedef void (NVTX_API * nvtxNameCudaStreamA_impl_fntype)(cudaStream_t stream, const char* name); +typedef void (NVTX_API * nvtxNameCudaStreamW_impl_fntype)(cudaStream_t stream, const wchar_t* name); +typedef void (NVTX_API * nvtxNameCudaEventA_impl_fntype)(cudaEvent_t event, const char* name); +typedef void (NVTX_API * nvtxNameCudaEventW_impl_fntype)(cudaEvent_t event, const wchar_t* name); + +NVTX_DECLSPEC void NVTX_API nvtxNameCudaDeviceA(int device, const char* name) +{ +#ifndef NVTX_DISABLE + nvtxNameCudaDeviceA_impl_fntype local = (nvtxNameCudaDeviceA_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaDeviceA_impl_fnptr; + if(local!=0) + (*local)(device, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxNameCudaDeviceW(int device, const wchar_t* name) +{ +#ifndef NVTX_DISABLE + nvtxNameCudaDeviceW_impl_fntype local = (nvtxNameCudaDeviceW_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaDeviceW_impl_fnptr; + if(local!=0) + (*local)(device, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxNameCudaStreamA(cudaStream_t stream, const char* name) +{ +#ifndef NVTX_DISABLE + nvtxNameCudaStreamA_impl_fntype local = (nvtxNameCudaStreamA_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaStreamA_impl_fnptr; + if(local!=0) + (*local)(stream, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxNameCudaStreamW(cudaStream_t stream, const wchar_t* name) +{ +#ifndef NVTX_DISABLE + nvtxNameCudaStreamW_impl_fntype local = (nvtxNameCudaStreamW_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaStreamW_impl_fnptr; + if(local!=0) + (*local)(stream, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxNameCudaEventA(cudaEvent_t event, const char* name) +{ +#ifndef NVTX_DISABLE + nvtxNameCudaEventA_impl_fntype local = (nvtxNameCudaEventA_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaEventA_impl_fnptr; + if(local!=0) + (*local)(event, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxNameCudaEventW(cudaEvent_t event, const wchar_t* name) +{ +#ifndef NVTX_DISABLE + nvtxNameCudaEventW_impl_fntype local = (nvtxNameCudaEventW_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaEventW_impl_fnptr; + if(local!=0) + (*local)(event, name); +#endif /*NVTX_DISABLE*/ +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxImplCuda_v3.h b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxImplCuda_v3.h new file mode 100644 index 0000000000000000000000000000000000000000..cb80cd12975f2f58b6cbf1f341340fdb060c345b --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxImplCuda_v3.h @@ -0,0 +1,102 @@ +/* +* Copyright 2009-2022 NVIDIA Corporation. All rights reserved. +* +* Licensed under the Apache License v2.0 with LLVM Exceptions. +* See https://llvm.org/LICENSE.txt for license information. +* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +*/ + +#ifndef NVTX_IMPL_GUARD_CUDA +#error Never include this file directly -- it is automatically included by nvToolsExtCuda.h (except when NVTX_NO_IMPL is defined). +#endif + + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +typedef void (NVTX_API * nvtxNameCuDeviceA_impl_fntype)(CUdevice device, const char* name); +typedef void (NVTX_API * nvtxNameCuDeviceW_impl_fntype)(CUdevice device, const wchar_t* name); +typedef void (NVTX_API * nvtxNameCuContextA_impl_fntype)(CUcontext context, const char* name); +typedef void (NVTX_API * nvtxNameCuContextW_impl_fntype)(CUcontext context, const wchar_t* name); +typedef void (NVTX_API * nvtxNameCuStreamA_impl_fntype)(CUstream stream, const char* name); +typedef void (NVTX_API * nvtxNameCuStreamW_impl_fntype)(CUstream stream, const wchar_t* name); +typedef void (NVTX_API * nvtxNameCuEventA_impl_fntype)(CUevent event, const char* name); +typedef void (NVTX_API * nvtxNameCuEventW_impl_fntype)(CUevent event, const wchar_t* name); + +NVTX_DECLSPEC void NVTX_API nvtxNameCuDeviceA(CUdevice device, const char* name) +{ +#ifndef NVTX_DISABLE + nvtxNameCuDeviceA_impl_fntype local = (nvtxNameCuDeviceA_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuDeviceA_impl_fnptr; + if(local!=0) + (*local)(device, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxNameCuDeviceW(CUdevice device, const wchar_t* name) +{ +#ifndef NVTX_DISABLE + nvtxNameCuDeviceW_impl_fntype local = (nvtxNameCuDeviceW_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuDeviceW_impl_fnptr; + if(local!=0) + (*local)(device, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxNameCuContextA(CUcontext context, const char* name) +{ +#ifndef NVTX_DISABLE + nvtxNameCuContextA_impl_fntype local = (nvtxNameCuContextA_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuContextA_impl_fnptr; + if(local!=0) + (*local)(context, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxNameCuContextW(CUcontext context, const wchar_t* name) +{ +#ifndef NVTX_DISABLE + nvtxNameCuContextW_impl_fntype local = (nvtxNameCuContextW_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuContextW_impl_fnptr; + if(local!=0) + (*local)(context, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxNameCuStreamA(CUstream stream, const char* name) +{ +#ifndef NVTX_DISABLE + nvtxNameCuStreamA_impl_fntype local = (nvtxNameCuStreamA_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuStreamA_impl_fnptr; + if(local!=0) + (*local)(stream, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxNameCuStreamW(CUstream stream, const wchar_t* name) +{ +#ifndef NVTX_DISABLE + nvtxNameCuStreamW_impl_fntype local = (nvtxNameCuStreamW_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuStreamW_impl_fnptr; + if(local!=0) + (*local)(stream, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxNameCuEventA(CUevent event, const char* name) +{ +#ifndef NVTX_DISABLE + nvtxNameCuEventA_impl_fntype local = (nvtxNameCuEventA_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuEventA_impl_fnptr; + if(local!=0) + (*local)(event, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxNameCuEventW(CUevent event, const wchar_t* name) +{ +#ifndef NVTX_DISABLE + nvtxNameCuEventW_impl_fntype local = (nvtxNameCuEventW_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuEventW_impl_fnptr; + if(local!=0) + (*local)(event, name); +#endif /*NVTX_DISABLE*/ +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxImplOpenCL_v3.h b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxImplOpenCL_v3.h new file mode 100644 index 0000000000000000000000000000000000000000..63431f89dafd4126e5ae9c2462f4256b6202cd2c --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxImplOpenCL_v3.h @@ -0,0 +1,161 @@ +/* +* Copyright 2009-2022 NVIDIA Corporation. All rights reserved. +* +* Licensed under the Apache License v2.0 with LLVM Exceptions. +* See https://llvm.org/LICENSE.txt for license information. +* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +*/ + +#ifndef NVTX_IMPL_GUARD_OPENCL +#error Never include this file directly -- it is automatically included by nvToolsExtCuda.h (except when NVTX_NO_IMPL is defined). +#endif + + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +typedef void (NVTX_API * nvtxNameClDeviceA_impl_fntype)(cl_device_id device, const char* name); +typedef void (NVTX_API * nvtxNameClDeviceW_impl_fntype)(cl_device_id device, const wchar_t* name); +typedef void (NVTX_API * nvtxNameClContextA_impl_fntype)(cl_context context, const char* name); +typedef void (NVTX_API * nvtxNameClContextW_impl_fntype)(cl_context context, const wchar_t* name); +typedef void (NVTX_API * nvtxNameClCommandQueueA_impl_fntype)(cl_command_queue command_queue, const char* name); +typedef void (NVTX_API * nvtxNameClCommandQueueW_impl_fntype)(cl_command_queue command_queue, const wchar_t* name); +typedef void (NVTX_API * nvtxNameClMemObjectA_impl_fntype)(cl_mem memobj, const char* name); +typedef void (NVTX_API * nvtxNameClMemObjectW_impl_fntype)(cl_mem memobj, const wchar_t* name); +typedef void (NVTX_API * nvtxNameClSamplerA_impl_fntype)(cl_sampler sampler, const char* name); +typedef void (NVTX_API * nvtxNameClSamplerW_impl_fntype)(cl_sampler sampler, const wchar_t* name); +typedef void (NVTX_API * nvtxNameClProgramA_impl_fntype)(cl_program program, const char* name); +typedef void (NVTX_API * nvtxNameClProgramW_impl_fntype)(cl_program program, const wchar_t* name); +typedef void (NVTX_API * nvtxNameClEventA_impl_fntype)(cl_event evnt, const char* name); +typedef void (NVTX_API * nvtxNameClEventW_impl_fntype)(cl_event evnt, const wchar_t* name); + +NVTX_DECLSPEC void NVTX_API nvtxNameClDeviceA(cl_device_id device, const char* name) +{ +#ifndef NVTX_DISABLE + nvtxNameClDeviceA_impl_fntype local = (nvtxNameClDeviceA_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClDeviceA_impl_fnptr; + if(local!=0) + (*local)(device, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxNameClDeviceW(cl_device_id device, const wchar_t* name) +{ +#ifndef NVTX_DISABLE + nvtxNameClDeviceW_impl_fntype local = (nvtxNameClDeviceW_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClDeviceW_impl_fnptr; + if(local!=0) + (*local)(device, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxNameClContextA(cl_context context, const char* name) +{ +#ifndef NVTX_DISABLE + nvtxNameClContextA_impl_fntype local = (nvtxNameClContextA_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClContextA_impl_fnptr; + if(local!=0) + (*local)(context, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxNameClContextW(cl_context context, const wchar_t* name) +{ +#ifndef NVTX_DISABLE + nvtxNameClContextW_impl_fntype local = (nvtxNameClContextW_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClContextW_impl_fnptr; + if(local!=0) + (*local)(context, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxNameClCommandQueueA(cl_command_queue command_queue, const char* name) +{ +#ifndef NVTX_DISABLE + nvtxNameClCommandQueueA_impl_fntype local = (nvtxNameClCommandQueueA_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClCommandQueueA_impl_fnptr; + if(local!=0) + (*local)(command_queue, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxNameClCommandQueueW(cl_command_queue command_queue, const wchar_t* name) +{ +#ifndef NVTX_DISABLE + nvtxNameClCommandQueueW_impl_fntype local = (nvtxNameClCommandQueueW_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClCommandQueueW_impl_fnptr; + if(local!=0) + (*local)(command_queue, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxNameClMemObjectA(cl_mem memobj, const char* name) +{ +#ifndef NVTX_DISABLE + nvtxNameClMemObjectA_impl_fntype local = (nvtxNameClMemObjectA_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClMemObjectA_impl_fnptr; + if(local!=0) + (*local)(memobj, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxNameClMemObjectW(cl_mem memobj, const wchar_t* name) +{ +#ifndef NVTX_DISABLE + nvtxNameClMemObjectW_impl_fntype local = (nvtxNameClMemObjectW_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClMemObjectW_impl_fnptr; + if(local!=0) + (*local)(memobj, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxNameClSamplerA(cl_sampler sampler, const char* name) +{ +#ifndef NVTX_DISABLE + nvtxNameClSamplerA_impl_fntype local = (nvtxNameClSamplerA_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClSamplerA_impl_fnptr; + if(local!=0) + (*local)(sampler, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxNameClSamplerW(cl_sampler sampler, const wchar_t* name) +{ +#ifndef NVTX_DISABLE + nvtxNameClSamplerW_impl_fntype local = (nvtxNameClSamplerW_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClSamplerW_impl_fnptr; + if(local!=0) + (*local)(sampler, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxNameClProgramA(cl_program program, const char* name) +{ +#ifndef NVTX_DISABLE + nvtxNameClProgramA_impl_fntype local = (nvtxNameClProgramA_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClProgramA_impl_fnptr; + if(local!=0) + (*local)(program, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxNameClProgramW(cl_program program, const wchar_t* name) +{ +#ifndef NVTX_DISABLE + nvtxNameClProgramW_impl_fntype local = (nvtxNameClProgramW_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClProgramW_impl_fnptr; + if(local!=0) + (*local)(program, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxNameClEventA(cl_event evnt, const char* name) +{ +#ifndef NVTX_DISABLE + nvtxNameClEventA_impl_fntype local = (nvtxNameClEventA_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClEventA_impl_fnptr; + if(local!=0) + (*local)(evnt, name); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxNameClEventW(cl_event evnt, const wchar_t* name) +{ +#ifndef NVTX_DISABLE + nvtxNameClEventW_impl_fntype local = (nvtxNameClEventW_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClEventW_impl_fnptr; + if(local!=0) + (*local)(evnt, name); +#endif /*NVTX_DISABLE*/ +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxImplSync_v3.h b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxImplSync_v3.h new file mode 100644 index 0000000000000000000000000000000000000000..41378111580e87160c51358d2a00d229abc54227 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxImplSync_v3.h @@ -0,0 +1,83 @@ +/* +* Copyright 2009-2022 NVIDIA Corporation. All rights reserved. +* +* Licensed under the Apache License v2.0 with LLVM Exceptions. +* See https://llvm.org/LICENSE.txt for license information. +* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +*/ + +#ifndef NVTX_IMPL_GUARD_SYNC +#error Never include this file directly -- it is automatically included by nvToolsExtCuda.h (except when NVTX_NO_IMPL is defined). +#endif + + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +typedef nvtxSyncUser_t (NVTX_API * nvtxDomainSyncUserCreate_impl_fntype)(nvtxDomainHandle_t domain, const nvtxSyncUserAttributes_t* attribs); +typedef void (NVTX_API * nvtxDomainSyncUserDestroy_impl_fntype)(nvtxSyncUser_t handle); +typedef void (NVTX_API * nvtxDomainSyncUserAcquireStart_impl_fntype)(nvtxSyncUser_t handle); +typedef void (NVTX_API * nvtxDomainSyncUserAcquireFailed_impl_fntype)(nvtxSyncUser_t handle); +typedef void (NVTX_API * nvtxDomainSyncUserAcquireSuccess_impl_fntype)(nvtxSyncUser_t handle); +typedef void (NVTX_API * nvtxDomainSyncUserReleasing_impl_fntype)(nvtxSyncUser_t handle); + +NVTX_DECLSPEC nvtxSyncUser_t NVTX_API nvtxDomainSyncUserCreate(nvtxDomainHandle_t domain, const nvtxSyncUserAttributes_t* attribs) +{ +#ifndef NVTX_DISABLE + nvtxDomainSyncUserCreate_impl_fntype local = (nvtxDomainSyncUserCreate_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserCreate_impl_fnptr; + if(local!=0) + return (*local)(domain, attribs); + else +#endif /*NVTX_DISABLE*/ + return (nvtxSyncUser_t)0; +} + +NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserDestroy(nvtxSyncUser_t handle) +{ +#ifndef NVTX_DISABLE + nvtxDomainSyncUserDestroy_impl_fntype local = (nvtxDomainSyncUserDestroy_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserDestroy_impl_fnptr; + if(local!=0) + (*local)(handle); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserAcquireStart(nvtxSyncUser_t handle) +{ +#ifndef NVTX_DISABLE + nvtxDomainSyncUserAcquireStart_impl_fntype local = (nvtxDomainSyncUserAcquireStart_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireStart_impl_fnptr; + if(local!=0) + (*local)(handle); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserAcquireFailed(nvtxSyncUser_t handle) +{ +#ifndef NVTX_DISABLE + nvtxDomainSyncUserAcquireFailed_impl_fntype local = (nvtxDomainSyncUserAcquireFailed_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireFailed_impl_fnptr; + if(local!=0) + (*local)(handle); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserAcquireSuccess(nvtxSyncUser_t handle) +{ +#ifndef NVTX_DISABLE + nvtxDomainSyncUserAcquireSuccess_impl_fntype local = (nvtxDomainSyncUserAcquireSuccess_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireSuccess_impl_fnptr; + if(local!=0) + (*local)(handle); +#endif /*NVTX_DISABLE*/ +} + +NVTX_DECLSPEC void NVTX_API nvtxDomainSyncUserReleasing(nvtxSyncUser_t handle) +{ +#ifndef NVTX_DISABLE + nvtxDomainSyncUserReleasing_impl_fntype local = (nvtxDomainSyncUserReleasing_impl_fntype)NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserReleasing_impl_fnptr; + if(local!=0) + (*local)(handle); +#endif /*NVTX_DISABLE*/ +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxInit.h b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxInit.h new file mode 100644 index 0000000000000000000000000000000000000000..f6b4176fc828a1a534097642cb8bf4c5bae9c0e0 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxInit.h @@ -0,0 +1,312 @@ +/* +* Copyright 2009-2022 NVIDIA Corporation. All rights reserved. +* +* Licensed under the Apache License v2.0 with LLVM Exceptions. +* See https://llvm.org/LICENSE.txt for license information. +* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +*/ + +#ifndef NVTX_IMPL_GUARD +#error Never include this file directly -- it is automatically included by nvToolsExt.h (except when NVTX_NO_IMPL is defined). +#endif + +/* ---- Platform-independent helper definitions and functions ---- */ + +/* Prefer macros over inline functions to reduce symbol resolution at link time */ + +#if defined(_WIN32) +#define NVTX_PATHCHAR wchar_t +#define NVTX_STR(x) L##x +#define NVTX_GETENV _wgetenv +#define NVTX_BUFSIZE MAX_PATH +#define NVTX_DLLHANDLE HMODULE +#define NVTX_DLLOPEN(x) LoadLibraryW(x) +#define NVTX_DLLFUNC GetProcAddress +#define NVTX_DLLCLOSE FreeLibrary +#define NVTX_YIELD() SwitchToThread() +#define NVTX_MEMBAR() MemoryBarrier() +#define NVTX_ATOMIC_WRITE_32(address, value) InterlockedExchange((volatile LONG*)address, value) +#define NVTX_ATOMIC_CAS_32(old, address, exchange, comparand) old = InterlockedCompareExchange((volatile LONG*)address, exchange, comparand) +#elif defined(__GNUC__) +#define NVTX_PATHCHAR char +#define NVTX_STR(x) x +#define NVTX_GETENV getenv +#define NVTX_BUFSIZE PATH_MAX +#define NVTX_DLLHANDLE void* +#define NVTX_DLLOPEN(x) dlopen(x, RTLD_LAZY) +#define NVTX_DLLFUNC dlsym +#define NVTX_DLLCLOSE dlclose +#define NVTX_YIELD() sched_yield() +#define NVTX_MEMBAR() __sync_synchronize() +/* Ensure full memory barrier for atomics, to match Windows functions */ +#define NVTX_ATOMIC_WRITE_32(address, value) __sync_synchronize(); __sync_lock_test_and_set(address, value) +#define NVTX_ATOMIC_CAS_32(old, address, exchange, comparand) __sync_synchronize(); old = __sync_val_compare_and_swap(address, exchange, comparand) +#else +#error The library does not support your configuration! +#endif + +/* Define this to 1 for platforms that where pre-injected libraries can be discovered. */ +#if defined(_WIN32) +/* TODO */ +#define NVTX_SUPPORT_ALREADY_INJECTED_LIBRARY 0 +#else +#define NVTX_SUPPORT_ALREADY_INJECTED_LIBRARY 0 +#endif + +/* Define this to 1 for platforms that support environment variables */ +/* TODO: Detect UWP, a.k.a. Windows Store app, and set this to 0. */ +/* Try: #if defined(WINAPI_FAMILY_PARTITION) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */ +#define NVTX_SUPPORT_ENV_VARS 1 + +/* Define this to 1 for platforms that support dynamic/shared libraries */ +#define NVTX_SUPPORT_DYNAMIC_INJECTION_LIBRARY 1 + +/* Injection libraries implementing InitializeInjectionNvtx2 may be statically linked, +* and this will override any dynamic injection. Useful for platforms where dynamic +* injection is not available. Since weak symbols not explicitly marked extern are +* guaranteed to be initialized to zero if no definitions are found by the linker, the +* dynamic injection process proceeds normally if pfnInitializeInjectionNvtx2 is 0. */ +#if defined(__GNUC__) && !defined(_WIN32) && !defined(__CYGWIN__) +#define NVTX_SUPPORT_STATIC_INJECTION_LIBRARY 1 +/* To statically inject an NVTX library, define InitializeInjectionNvtx2_fnptr as a normal +* symbol (not weak) pointing to the implementation of InitializeInjectionNvtx2 (which +* does not need to be named "InitializeInjectionNvtx2" as is necessary in a dynamic +* injection library. */ +__attribute__((weak)) NvtxInitializeInjectionNvtxFunc_t InitializeInjectionNvtx2_fnptr; +#else +#define NVTX_SUPPORT_STATIC_INJECTION_LIBRARY 0 +#endif + +/* This function tries to find or load an NVTX injection library and get the +* address of its InitializeInjection2 function. If such a function pointer +* is found, it is called, and passed the address of this NVTX instance's +* nvtxGetExportTable function, so the injection can attach to this instance. +* If the initialization fails for any reason, any dynamic library loaded will +* be freed, and all NVTX implementation functions will be set to no-ops. If +* initialization succeeds, NVTX functions not attached to the tool will be set +* to no-ops. This is implemented as one function instead of several small +* functions to minimize the number of weak symbols the linker must resolve. +* Order of search is: +* - Pre-injected library exporting InitializeInjectionNvtx2 +* - Loadable library exporting InitializeInjectionNvtx2 +* - Path specified by env var NVTX_INJECTION??_PATH (?? is 32 or 64) +* - On Android, libNvtxInjection??.so within the package (?? is 32 or 64) +* - Statically-linked injection library defining InitializeInjectionNvtx2_fnptr +*/ +NVTX_LINKONCE_FWDDECL_FUNCTION int NVTX_VERSIONED_IDENTIFIER(nvtxInitializeInjectionLibrary)(void); +NVTX_LINKONCE_DEFINE_FUNCTION int NVTX_VERSIONED_IDENTIFIER(nvtxInitializeInjectionLibrary)(void) +{ + const char* const initFuncName = "InitializeInjectionNvtx2"; + NvtxInitializeInjectionNvtxFunc_t init_fnptr = (NvtxInitializeInjectionNvtxFunc_t)0; + NVTX_DLLHANDLE injectionLibraryHandle = (NVTX_DLLHANDLE)0; + int entryPointStatus = 0; + +#if NVTX_SUPPORT_ALREADY_INJECTED_LIBRARY + /* Use POSIX global symbol chain to query for init function from any module */ + init_fnptr = (NvtxInitializeInjectionNvtxFunc_t)NVTX_DLLFUNC(0, initFuncName); +#endif + +#if NVTX_SUPPORT_DYNAMIC_INJECTION_LIBRARY + /* Try discovering dynamic injection library to load */ + if (!init_fnptr) + { +#if NVTX_SUPPORT_ENV_VARS + /* If env var NVTX_INJECTION64_PATH is set, it should contain the path + * to a 64-bit dynamic NVTX injection library (and similar for 32-bit). */ + const NVTX_PATHCHAR* const nvtxEnvVarName = (sizeof(void*) == 4) + ? NVTX_STR("NVTX_INJECTION32_PATH") + : NVTX_STR("NVTX_INJECTION64_PATH"); +#endif /* NVTX_SUPPORT_ENV_VARS */ + NVTX_PATHCHAR injectionLibraryPathBuf[NVTX_BUFSIZE]; + const NVTX_PATHCHAR* injectionLibraryPath = (const NVTX_PATHCHAR*)0; + + /* Refer to this variable explicitly in case all references to it are #if'ed out */ + (void)injectionLibraryPathBuf; + +#if NVTX_SUPPORT_ENV_VARS + /* Disable the warning for getenv & _wgetenv -- this usage is safe because + * these functions are not called again before using the returned value. */ +#if defined(_MSC_VER) +#pragma warning( push ) +#pragma warning( disable : 4996 ) +#endif + injectionLibraryPath = NVTX_GETENV(nvtxEnvVarName); +#if defined(_MSC_VER) +#pragma warning( pop ) +#endif +#endif + +#if defined(__ANDROID__) + if (!injectionLibraryPath) + { + const char *bits = (sizeof(void*) == 4) ? "32" : "64"; + char cmdlineBuf[32]; + char pkgName[PATH_MAX]; + int count; + int pid; + FILE *fp; + size_t bytesRead; + size_t pos; + + pid = (int)getpid(); + count = snprintf(cmdlineBuf, sizeof(cmdlineBuf), "/proc/%d/cmdline", pid); + if (count <= 0 || count >= (int)sizeof(cmdlineBuf)) + { + NVTX_ERR("Path buffer too small for: /proc/%d/cmdline\n", pid); + return NVTX_ERR_INIT_ACCESS_LIBRARY; + } + + fp = fopen(cmdlineBuf, "r"); + if (!fp) + { + NVTX_ERR("File couldn't be opened: %s\n", cmdlineBuf); + return NVTX_ERR_INIT_ACCESS_LIBRARY; + } + + bytesRead = fread(pkgName, 1, sizeof(pkgName) - 1, fp); + fclose(fp); + if (bytesRead == 0) + { + NVTX_ERR("Package name couldn't be read from file: %s\n", cmdlineBuf); + return NVTX_ERR_INIT_ACCESS_LIBRARY; + } + + pkgName[bytesRead] = 0; + + /* String can contain colon as a process separator. In this case the package name is before the colon. */ + pos = 0; + while (pos < bytesRead && pkgName[pos] != ':' && pkgName[pos] != '\0') + { + ++pos; + } + pkgName[pos] = 0; + + count = snprintf(injectionLibraryPathBuf, NVTX_BUFSIZE, "/data/data/%s/files/libNvtxInjection%s.so", pkgName, bits); + if (count <= 0 || count >= NVTX_BUFSIZE) + { + NVTX_ERR("Path buffer too small for: /data/data/%s/files/libNvtxInjection%s.so\n", pkgName, bits); + return NVTX_ERR_INIT_ACCESS_LIBRARY; + } + + /* On Android, verify path is accessible due to aggressive file access restrictions. */ + /* For dlopen, if the filename contains a leading slash, then it is interpreted as a */ + /* relative or absolute pathname; otherwise it will follow the rules in ld.so. */ + if (injectionLibraryPathBuf[0] == '/') + { +#if (__ANDROID_API__ < 21) + int access_err = access(injectionLibraryPathBuf, F_OK | R_OK); +#else + int access_err = faccessat(AT_FDCWD, injectionLibraryPathBuf, F_OK | R_OK, 0); +#endif + if (access_err != 0) + { + NVTX_ERR("Injection library path wasn't accessible [code=%s] [path=%s]\n", strerror(errno), injectionLibraryPathBuf); + return NVTX_ERR_INIT_ACCESS_LIBRARY; + } + } + injectionLibraryPath = injectionLibraryPathBuf; + } +#endif + + /* At this point, injectionLibraryPath is specified if a dynamic + * injection library was specified by a tool. */ + if (injectionLibraryPath) + { + /* Load the injection library */ + injectionLibraryHandle = NVTX_DLLOPEN(injectionLibraryPath); + if (!injectionLibraryHandle) + { + NVTX_ERR("Failed to load injection library\n"); + return NVTX_ERR_INIT_LOAD_LIBRARY; + } + else + { + /* Attempt to get the injection library's entry-point */ + init_fnptr = (NvtxInitializeInjectionNvtxFunc_t)NVTX_DLLFUNC(injectionLibraryHandle, initFuncName); + if (!init_fnptr) + { + NVTX_DLLCLOSE(injectionLibraryHandle); + NVTX_ERR("Failed to get address of function InitializeInjectionNvtx2 from injection library\n"); + return NVTX_ERR_INIT_MISSING_LIBRARY_ENTRY_POINT; + } + } + } + } +#endif + +#if NVTX_SUPPORT_STATIC_INJECTION_LIBRARY + if (!init_fnptr) + { + /* Check weakly-defined function pointer. A statically-linked injection can define this as + * a normal symbol and it will take precedence over a dynamic injection. */ + if (InitializeInjectionNvtx2_fnptr) + { + init_fnptr = InitializeInjectionNvtx2_fnptr; + } + } +#endif + + /* At this point, if init_fnptr is not set, then no tool has specified + * an NVTX injection library -- return non-success result so all NVTX + * API functions will be set to no-ops. */ + if (!init_fnptr) + { + return NVTX_ERR_NO_INJECTION_LIBRARY_AVAILABLE; + } + + /* Invoke injection library's initialization function. If it returns + * 0 (failure) and a dynamic injection was loaded, unload it. */ + entryPointStatus = init_fnptr(NVTX_VERSIONED_IDENTIFIER(nvtxGetExportTable)); + if (entryPointStatus == 0) + { + NVTX_ERR("Failed to initialize injection library -- initialization function returned 0\n"); + if (injectionLibraryHandle) + { + NVTX_DLLCLOSE(injectionLibraryHandle); + } + return NVTX_ERR_INIT_FAILED_LIBRARY_ENTRY_POINT; + } + + return NVTX_SUCCESS; +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(void) +{ + unsigned int old; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).initState == NVTX_INIT_STATE_COMPLETE) + { + return; + } + + NVTX_ATOMIC_CAS_32( + old, + &NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).initState, + NVTX_INIT_STATE_STARTED, + NVTX_INIT_STATE_FRESH); + if (old == NVTX_INIT_STATE_FRESH) + { + int result; + int forceAllToNoops; + + /* Load & initialize injection library -- it will assign the function pointers */ + result = NVTX_VERSIONED_IDENTIFIER(nvtxInitializeInjectionLibrary)(); + + /* Set all pointers not assigned by the injection to null */ + forceAllToNoops = result != NVTX_SUCCESS; /* Set all to null if injection init failed */ + NVTX_VERSIONED_IDENTIFIER(nvtxSetInitFunctionsToNoops)(forceAllToNoops); + + /* Signal that initialization has finished, so now the assigned function pointers will be used */ + NVTX_ATOMIC_WRITE_32( + &NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).initState, + NVTX_INIT_STATE_COMPLETE); + } + else /* Spin-wait until initialization has finished */ + { + NVTX_MEMBAR(); + while (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).initState != NVTX_INIT_STATE_COMPLETE) + { + NVTX_YIELD(); + NVTX_MEMBAR(); + } + } +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxInitDecls.h b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxInitDecls.h new file mode 100644 index 0000000000000000000000000000000000000000..f595b940eb38d79e42fb45ef50710b5d1978ef98 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxInitDecls.h @@ -0,0 +1,81 @@ +/* +* Copyright 2009-2022 NVIDIA Corporation. All rights reserved. +* +* Licensed under the Apache License v2.0 with LLVM Exceptions. +* See https://llvm.org/LICENSE.txt for license information. +* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +*/ + +#ifndef NVTX_IMPL_GUARD +#error Never include this file directly -- it is automatically included by nvToolsExt.h (except when NVTX_NO_IMPL is defined). +#endif + +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxMarkEx_impl_init)(const nvtxEventAttributes_t* eventAttrib); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxMarkA_impl_init)(const char* message); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxMarkW_impl_init)(const wchar_t* message); +NVTX_LINKONCE_FWDDECL_FUNCTION nvtxRangeId_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxRangeStartEx_impl_init)(const nvtxEventAttributes_t* eventAttrib); +NVTX_LINKONCE_FWDDECL_FUNCTION nvtxRangeId_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxRangeStartA_impl_init)(const char* message); +NVTX_LINKONCE_FWDDECL_FUNCTION nvtxRangeId_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxRangeStartW_impl_init)(const wchar_t* message); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxRangeEnd_impl_init)(nvtxRangeId_t id); +NVTX_LINKONCE_FWDDECL_FUNCTION int NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxRangePushEx_impl_init)(const nvtxEventAttributes_t* eventAttrib); +NVTX_LINKONCE_FWDDECL_FUNCTION int NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxRangePushA_impl_init)(const char* message); +NVTX_LINKONCE_FWDDECL_FUNCTION int NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxRangePushW_impl_init)(const wchar_t* message); +NVTX_LINKONCE_FWDDECL_FUNCTION int NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxRangePop_impl_init)(void); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCategoryA_impl_init)(uint32_t category, const char* name); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCategoryW_impl_init)(uint32_t category, const wchar_t* name); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameOsThreadA_impl_init)(uint32_t threadId, const char* name); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameOsThreadW_impl_init)(uint32_t threadId, const wchar_t* name); + +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCuDeviceA_impl_init)(nvtx_CUdevice device, const char* name); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCuDeviceW_impl_init)(nvtx_CUdevice device, const wchar_t* name); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCuContextA_impl_init)(nvtx_CUcontext context, const char* name); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCuContextW_impl_init)(nvtx_CUcontext context, const wchar_t* name); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCuStreamA_impl_init)(nvtx_CUstream stream, const char* name); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCuStreamW_impl_init)(nvtx_CUstream stream, const wchar_t* name); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCuEventA_impl_init)(nvtx_CUevent event, const char* name); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCuEventW_impl_init)(nvtx_CUevent event, const wchar_t* name); + +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClDeviceA_impl_init)(nvtx_cl_device_id device, const char* name); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClDeviceW_impl_init)(nvtx_cl_device_id device, const wchar_t* name); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClContextA_impl_init)(nvtx_cl_context context, const char* name); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClContextW_impl_init)(nvtx_cl_context context, const wchar_t* name); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClCommandQueueA_impl_init)(nvtx_cl_command_queue command_queue, const char* name); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClCommandQueueW_impl_init)(nvtx_cl_command_queue command_queue, const wchar_t* name); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClMemObjectA_impl_init)(nvtx_cl_mem memobj, const char* name); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClMemObjectW_impl_init)(nvtx_cl_mem memobj, const wchar_t* name); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClSamplerA_impl_init)(nvtx_cl_sampler sampler, const char* name); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClSamplerW_impl_init)(nvtx_cl_sampler sampler, const wchar_t* name); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClProgramA_impl_init)(nvtx_cl_program program, const char* name); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClProgramW_impl_init)(nvtx_cl_program program, const wchar_t* name); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClEventA_impl_init)(nvtx_cl_event evnt, const char* name); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClEventW_impl_init)(nvtx_cl_event evnt, const wchar_t* name); + +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaDeviceA_impl_init)(int device, const char* name); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaDeviceW_impl_init)(int device, const wchar_t* name); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaStreamA_impl_init)(nvtx_cudaStream_t stream, const char* name); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaStreamW_impl_init)(nvtx_cudaStream_t stream, const wchar_t* name); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaEventA_impl_init)(nvtx_cudaEvent_t event, const char* name); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaEventW_impl_init)(nvtx_cudaEvent_t event, const wchar_t* name); + +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainMarkEx_impl_init)(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib); +NVTX_LINKONCE_FWDDECL_FUNCTION nvtxRangeId_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainRangeStartEx_impl_init)(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainRangeEnd_impl_init)(nvtxDomainHandle_t domain, nvtxRangeId_t id); +NVTX_LINKONCE_FWDDECL_FUNCTION int NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainRangePushEx_impl_init)(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib); +NVTX_LINKONCE_FWDDECL_FUNCTION int NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainRangePop_impl_init)(nvtxDomainHandle_t domain); +NVTX_LINKONCE_FWDDECL_FUNCTION nvtxResourceHandle_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainResourceCreate_impl_init)(nvtxDomainHandle_t domain, nvtxResourceAttributes_t* attribs); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainResourceDestroy_impl_init)(nvtxResourceHandle_t resource); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainNameCategoryA_impl_init)(nvtxDomainHandle_t domain, uint32_t category, const char* name); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainNameCategoryW_impl_init)(nvtxDomainHandle_t domain, uint32_t category, const wchar_t* name); +NVTX_LINKONCE_FWDDECL_FUNCTION nvtxStringHandle_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainRegisterStringA_impl_init)(nvtxDomainHandle_t domain, const char* string); +NVTX_LINKONCE_FWDDECL_FUNCTION nvtxStringHandle_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainRegisterStringW_impl_init)(nvtxDomainHandle_t domain, const wchar_t* string); +NVTX_LINKONCE_FWDDECL_FUNCTION nvtxDomainHandle_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainCreateA_impl_init)(const char* message); +NVTX_LINKONCE_FWDDECL_FUNCTION nvtxDomainHandle_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainCreateW_impl_init)(const wchar_t* message); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainDestroy_impl_init)(nvtxDomainHandle_t domain); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxInitialize_impl_init)(const void* reserved); + +NVTX_LINKONCE_FWDDECL_FUNCTION nvtxSyncUser_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserCreate_impl_init)(nvtxDomainHandle_t domain, const nvtxSyncUserAttributes_t* attribs); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserDestroy_impl_init)(nvtxSyncUser_t handle); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserAcquireStart_impl_init)(nvtxSyncUser_t handle); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserAcquireFailed_impl_init)(nvtxSyncUser_t handle); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserAcquireSuccess_impl_init)(nvtxSyncUser_t handle); +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserReleasing_impl_init)(nvtxSyncUser_t handle); diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxInitDefs.h b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxInitDefs.h new file mode 100644 index 0000000000000000000000000000000000000000..329ea9e2f77435a1a863b312bd6d50f1f55f126e --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxInitDefs.h @@ -0,0 +1,573 @@ +/* +* Copyright 2009-2022 NVIDIA Corporation. All rights reserved. +* +* Licensed under the Apache License v2.0 with LLVM Exceptions. +* See https://llvm.org/LICENSE.txt for license information. +* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +*/ + +#ifndef NVTX_IMPL_GUARD +#error Never include this file directly -- it is automatically included by nvToolsExt.h (except when NVTX_NO_IMPL is defined). +#endif + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxMarkEx_impl_init)(const nvtxEventAttributes_t* eventAttrib){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + nvtxMarkEx(eventAttrib); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxMarkA_impl_init)(const char* message){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + nvtxMarkA(message); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxMarkW_impl_init)(const wchar_t* message){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + nvtxMarkW(message); +} + +NVTX_LINKONCE_DEFINE_FUNCTION nvtxRangeId_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxRangeStartEx_impl_init)(const nvtxEventAttributes_t* eventAttrib){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + return nvtxRangeStartEx(eventAttrib); +} + +NVTX_LINKONCE_DEFINE_FUNCTION nvtxRangeId_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxRangeStartA_impl_init)(const char* message){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + return nvtxRangeStartA(message); +} + +NVTX_LINKONCE_DEFINE_FUNCTION nvtxRangeId_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxRangeStartW_impl_init)(const wchar_t* message){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + return nvtxRangeStartW(message); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxRangeEnd_impl_init)(nvtxRangeId_t id){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + nvtxRangeEnd(id); +} + +NVTX_LINKONCE_DEFINE_FUNCTION int NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxRangePushEx_impl_init)(const nvtxEventAttributes_t* eventAttrib){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + return nvtxRangePushEx(eventAttrib); +} + +NVTX_LINKONCE_DEFINE_FUNCTION int NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxRangePushA_impl_init)(const char* message){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + return nvtxRangePushA(message); +} + +NVTX_LINKONCE_DEFINE_FUNCTION int NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxRangePushW_impl_init)(const wchar_t* message){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + return nvtxRangePushW(message); +} + +NVTX_LINKONCE_DEFINE_FUNCTION int NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxRangePop_impl_init)(void){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + return nvtxRangePop(); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCategoryA_impl_init)(uint32_t category, const char* name){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + nvtxNameCategoryA(category, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCategoryW_impl_init)(uint32_t category, const wchar_t* name){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + nvtxNameCategoryW(category, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameOsThreadA_impl_init)(uint32_t threadId, const char* name){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + nvtxNameOsThreadA(threadId, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameOsThreadW_impl_init)(uint32_t threadId, const wchar_t* name){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + nvtxNameOsThreadW(threadId, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainMarkEx_impl_init)(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + nvtxDomainMarkEx(domain, eventAttrib); +} + +NVTX_LINKONCE_DEFINE_FUNCTION nvtxRangeId_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainRangeStartEx_impl_init)(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + return nvtxDomainRangeStartEx(domain, eventAttrib); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainRangeEnd_impl_init)(nvtxDomainHandle_t domain, nvtxRangeId_t id){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + nvtxDomainRangeEnd(domain, id); +} + +NVTX_LINKONCE_DEFINE_FUNCTION int NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainRangePushEx_impl_init)(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + return nvtxDomainRangePushEx(domain, eventAttrib); +} + +NVTX_LINKONCE_DEFINE_FUNCTION int NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainRangePop_impl_init)(nvtxDomainHandle_t domain){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + return nvtxDomainRangePop(domain); +} + +NVTX_LINKONCE_DEFINE_FUNCTION nvtxResourceHandle_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainResourceCreate_impl_init)(nvtxDomainHandle_t domain, nvtxResourceAttributes_t* attribs){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + return nvtxDomainResourceCreate(domain, attribs); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainResourceDestroy_impl_init)(nvtxResourceHandle_t resource){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + nvtxDomainResourceDestroy(resource); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainNameCategoryA_impl_init)(nvtxDomainHandle_t domain, uint32_t category, const char* name){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + nvtxDomainNameCategoryA(domain, category, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainNameCategoryW_impl_init)(nvtxDomainHandle_t domain, uint32_t category, const wchar_t* name){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + nvtxDomainNameCategoryW(domain, category, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION nvtxStringHandle_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainRegisterStringA_impl_init)(nvtxDomainHandle_t domain, const char* string){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + return nvtxDomainRegisterStringA(domain, string); +} + +NVTX_LINKONCE_DEFINE_FUNCTION nvtxStringHandle_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainRegisterStringW_impl_init)(nvtxDomainHandle_t domain, const wchar_t* string){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + return nvtxDomainRegisterStringW(domain, string); +} + +NVTX_LINKONCE_DEFINE_FUNCTION nvtxDomainHandle_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainCreateA_impl_init)(const char* message){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + return nvtxDomainCreateA(message); +} + +NVTX_LINKONCE_DEFINE_FUNCTION nvtxDomainHandle_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainCreateW_impl_init)(const wchar_t* message){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + return nvtxDomainCreateW(message); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainDestroy_impl_init)(nvtxDomainHandle_t domain){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + nvtxDomainDestroy(domain); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxInitialize_impl_init)(const void* reserved){ + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + nvtxInitialize(reserved); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCuDeviceA_impl_init)(nvtx_CUdevice device, const char* name){ + nvtxNameCuDeviceA_fakeimpl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuDeviceA_impl_fnptr; + if (local) + local(device, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCuDeviceW_impl_init)(nvtx_CUdevice device, const wchar_t* name){ + nvtxNameCuDeviceW_fakeimpl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuDeviceW_impl_fnptr; + if (local) + local(device, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCuContextA_impl_init)(nvtx_CUcontext context, const char* name){ + nvtxNameCuContextA_fakeimpl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuContextA_impl_fnptr; + if (local) + local(context, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCuContextW_impl_init)(nvtx_CUcontext context, const wchar_t* name){ + nvtxNameCuContextW_fakeimpl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuContextW_impl_fnptr; + if (local) + local(context, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCuStreamA_impl_init)(nvtx_CUstream stream, const char* name){ + nvtxNameCuStreamA_fakeimpl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuStreamA_impl_fnptr; + if (local) + local(stream, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCuStreamW_impl_init)(nvtx_CUstream stream, const wchar_t* name){ + nvtxNameCuStreamW_fakeimpl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuStreamW_impl_fnptr; + if (local) + local(stream, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCuEventA_impl_init)(nvtx_CUevent event, const char* name){ + nvtxNameCuEventA_fakeimpl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuEventA_impl_fnptr; + if (local) + local(event, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCuEventW_impl_init)(nvtx_CUevent event, const wchar_t* name){ + nvtxNameCuEventW_fakeimpl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuEventW_impl_fnptr; + if (local) + local(event, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaDeviceA_impl_init)(int device, const char* name){ + nvtxNameCudaDeviceA_impl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaDeviceA_impl_fnptr; + if (local) + local(device, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaDeviceW_impl_init)(int device, const wchar_t* name){ + nvtxNameCudaDeviceW_impl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaDeviceW_impl_fnptr; + if (local) + local(device, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaStreamA_impl_init)(nvtx_cudaStream_t stream, const char* name){ + nvtxNameCudaStreamA_fakeimpl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaStreamA_impl_fnptr; + if (local) + local(stream, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaStreamW_impl_init)(nvtx_cudaStream_t stream, const wchar_t* name){ + nvtxNameCudaStreamW_fakeimpl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaStreamW_impl_fnptr; + if (local) + local(stream, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaEventA_impl_init)(nvtx_cudaEvent_t event, const char* name){ + nvtxNameCudaEventA_fakeimpl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaEventA_impl_fnptr; + if (local) + local(event, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaEventW_impl_init)(nvtx_cudaEvent_t event, const wchar_t* name){ + nvtxNameCudaEventW_fakeimpl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaEventW_impl_fnptr; + if (local) + local(event, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClDeviceA_impl_init)(nvtx_cl_device_id device, const char* name){ + nvtxNameClDeviceA_fakeimpl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClDeviceA_impl_fnptr; + if (local) + local(device, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClDeviceW_impl_init)(nvtx_cl_device_id device, const wchar_t* name){ + nvtxNameClDeviceW_fakeimpl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClDeviceW_impl_fnptr; + if (local) + local(device, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClContextA_impl_init)(nvtx_cl_context context, const char* name){ + nvtxNameClContextA_fakeimpl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClContextA_impl_fnptr; + if (local) + local(context, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClContextW_impl_init)(nvtx_cl_context context, const wchar_t* name){ + nvtxNameClContextW_fakeimpl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClContextW_impl_fnptr; + if (local) + local(context, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClCommandQueueA_impl_init)(nvtx_cl_command_queue command_queue, const char* name){ + nvtxNameClCommandQueueA_fakeimpl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClCommandQueueA_impl_fnptr; + if (local) + local(command_queue, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClCommandQueueW_impl_init)(nvtx_cl_command_queue command_queue, const wchar_t* name){ + nvtxNameClCommandQueueW_fakeimpl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClCommandQueueW_impl_fnptr; + if (local) + local(command_queue, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClMemObjectA_impl_init)(nvtx_cl_mem memobj, const char* name){ + nvtxNameClMemObjectA_fakeimpl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClMemObjectA_impl_fnptr; + if (local) + local(memobj, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClMemObjectW_impl_init)(nvtx_cl_mem memobj, const wchar_t* name){ + nvtxNameClMemObjectW_fakeimpl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClMemObjectW_impl_fnptr; + if (local) + local(memobj, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClSamplerA_impl_init)(nvtx_cl_sampler sampler, const char* name){ + nvtxNameClSamplerA_fakeimpl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClSamplerA_impl_fnptr; + if (local) + local(sampler, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClSamplerW_impl_init)(nvtx_cl_sampler sampler, const wchar_t* name){ + nvtxNameClSamplerW_fakeimpl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClSamplerW_impl_fnptr; + if (local) + local(sampler, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClProgramA_impl_init)(nvtx_cl_program program, const char* name){ + nvtxNameClProgramA_fakeimpl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClProgramA_impl_fnptr; + if (local) + local(program, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClProgramW_impl_init)(nvtx_cl_program program, const wchar_t* name){ + nvtxNameClProgramW_fakeimpl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClProgramW_impl_fnptr; + if (local) + local(program, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClEventA_impl_init)(nvtx_cl_event evnt, const char* name){ + nvtxNameClEventA_fakeimpl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClEventA_impl_fnptr; + if (local) + local(evnt, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxNameClEventW_impl_init)(nvtx_cl_event evnt, const wchar_t* name){ + nvtxNameClEventW_fakeimpl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClEventW_impl_fnptr; + if (local) + local(evnt, name); +} + +NVTX_LINKONCE_DEFINE_FUNCTION nvtxSyncUser_t NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserCreate_impl_init)(nvtxDomainHandle_t domain, const nvtxSyncUserAttributes_t* attribs){ + nvtxDomainSyncUserCreate_impl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserCreate_impl_fnptr; + if (local) { + return local(domain, attribs); + } + return (nvtxSyncUser_t)0; +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserDestroy_impl_init)(nvtxSyncUser_t handle){ + nvtxDomainSyncUserDestroy_impl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserDestroy_impl_fnptr; + if (local) + local(handle); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserAcquireStart_impl_init)(nvtxSyncUser_t handle){ + nvtxDomainSyncUserAcquireStart_impl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireStart_impl_fnptr; + if (local) + local(handle); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserAcquireFailed_impl_init)(nvtxSyncUser_t handle){ + nvtxDomainSyncUserAcquireFailed_impl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireFailed_impl_fnptr; + if (local) + local(handle); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserAcquireSuccess_impl_init)(nvtxSyncUser_t handle){ + nvtxDomainSyncUserAcquireSuccess_impl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireSuccess_impl_fnptr; + if (local) + local(handle); +} + +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_API NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserReleasing_impl_init)(nvtxSyncUser_t handle){ + nvtxDomainSyncUserReleasing_impl_fntype local; + NVTX_VERSIONED_IDENTIFIER(nvtxInitOnce)(); + local = NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserReleasing_impl_fnptr; + if (local) + local(handle); +} + +NVTX_LINKONCE_FWDDECL_FUNCTION void NVTX_VERSIONED_IDENTIFIER(nvtxSetInitFunctionsToNoops)(int forceAllToNoops); +NVTX_LINKONCE_DEFINE_FUNCTION void NVTX_VERSIONED_IDENTIFIER(nvtxSetInitFunctionsToNoops)(int forceAllToNoops) +{ + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxMarkEx_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxMarkEx_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxMarkEx_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxMarkA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxMarkA_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxMarkA_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxMarkW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxMarkW_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxMarkW_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeStartEx_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxRangeStartEx_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeStartEx_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeStartA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxRangeStartA_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeStartA_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeStartW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxRangeStartW_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeStartW_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeEnd_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxRangeEnd_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangeEnd_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePushEx_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxRangePushEx_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePushEx_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePushA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxRangePushA_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePushA_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePushW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxRangePushW_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePushW_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePop_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxRangePop_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxRangePop_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCategoryA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCategoryA_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCategoryA_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCategoryW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCategoryW_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCategoryW_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameOsThreadA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameOsThreadA_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameOsThreadA_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameOsThreadW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameOsThreadW_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameOsThreadW_impl_fnptr = NULL; + + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuDeviceA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCuDeviceA_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuDeviceA_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuDeviceW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCuDeviceW_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuDeviceW_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuContextA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCuContextA_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuContextA_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuContextW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCuContextW_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuContextW_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuStreamA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCuStreamA_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuStreamA_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuStreamW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCuStreamW_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuStreamW_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuEventA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCuEventA_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuEventA_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuEventW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCuEventW_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCuEventW_impl_fnptr = NULL; + + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClDeviceA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameClDeviceA_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClDeviceA_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClDeviceW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameClDeviceW_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClDeviceW_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClContextA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameClContextA_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClContextA_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClContextW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameClContextW_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClContextW_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClCommandQueueA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameClCommandQueueA_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClCommandQueueA_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClCommandQueueW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameClCommandQueueW_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClCommandQueueW_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClMemObjectA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameClMemObjectA_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClMemObjectA_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClMemObjectW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameClMemObjectW_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClMemObjectW_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClSamplerA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameClSamplerA_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClSamplerA_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClSamplerW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameClSamplerW_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClSamplerW_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClProgramA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameClProgramA_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClProgramA_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClProgramW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameClProgramW_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClProgramW_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClEventA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameClEventA_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClEventA_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClEventW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameClEventW_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameClEventW_impl_fnptr = NULL; + + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaDeviceA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaDeviceA_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaDeviceA_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaDeviceW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaDeviceW_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaDeviceW_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaStreamA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaStreamA_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaStreamA_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaStreamW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaStreamW_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaStreamW_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaEventA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaEventA_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaEventA_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaEventW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxNameCudaEventW_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxNameCudaEventW_impl_fnptr = NULL; + + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainMarkEx_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainMarkEx_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainMarkEx_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangeStartEx_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainRangeStartEx_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangeStartEx_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangeEnd_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainRangeEnd_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangeEnd_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangePushEx_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainRangePushEx_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangePushEx_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangePop_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainRangePop_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRangePop_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainResourceCreate_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainResourceCreate_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainResourceCreate_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainResourceDestroy_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainResourceDestroy_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainResourceDestroy_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainNameCategoryA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainNameCategoryA_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainNameCategoryA_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainNameCategoryW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainNameCategoryW_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainNameCategoryW_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRegisterStringA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainRegisterStringA_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRegisterStringA_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRegisterStringW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainRegisterStringW_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainRegisterStringW_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainCreateA_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainCreateA_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainCreateA_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainCreateW_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainCreateW_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainCreateW_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainDestroy_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainDestroy_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainDestroy_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxInitialize_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxInitialize_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxInitialize_impl_fnptr = NULL; + + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserCreate_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserCreate_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserCreate_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserDestroy_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserDestroy_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserDestroy_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireStart_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserAcquireStart_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireStart_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireFailed_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserAcquireFailed_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireFailed_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireSuccess_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserAcquireSuccess_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserAcquireSuccess_impl_fnptr = NULL; + if (NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserReleasing_impl_fnptr == NVTX_VERSIONED_IDENTIFIER(nvtxDomainSyncUserReleasing_impl_init) || forceAllToNoops) + NVTX_VERSIONED_IDENTIFIER(nvtxGlobals).nvtxDomainSyncUserReleasing_impl_fnptr = NULL; +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxLinkOnce.h b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxLinkOnce.h new file mode 100644 index 0000000000000000000000000000000000000000..b204210cc51b39a23d64b0d8401f585192433eb6 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxLinkOnce.h @@ -0,0 +1,83 @@ +/* +* Copyright 2009-2022 NVIDIA Corporation. All rights reserved. +* +* Licensed under the Apache License v2.0 with LLVM Exceptions. +* See https://llvm.org/LICENSE.txt for license information. +* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +*/ + +#ifndef __NVTX_LINKONCE_H__ +#define __NVTX_LINKONCE_H__ + +/* This header defines macros to permit making definitions of global variables + * and functions in C/C++ header files which may be included multiple times in + * a translation unit or linkage unit. It allows authoring header-only libraries + * which can be used by multiple other header-only libraries (either as the same + * copy or multiple copies), and does not require any build changes, such as + * adding another .c file, linking a static library, or deploying a dynamic + * library. Globals defined with these macros have the property that they have + * the same address, pointing to a single instance, for the entire linkage unit. + * It is expected but not guaranteed that each linkage unit will have a separate + * instance. + * + * In some situations it is desirable to declare a variable without initializing + * it, refer to it in code or other variables' initializers, and then initialize + * it later. Similarly, functions can be prototyped, have their address taken, + * and then have their body defined later. In such cases, use the FWDDECL macros + * when forward-declaring LINKONCE global variables without initializers and + * function prototypes, and then use the DEFINE macros when later defining them. + * Although in many cases the FWDDECL macro is equivalent to the DEFINE macro, + * following this pattern makes code maximally portable. + */ + +#if defined(__MINGW32__) /* MinGW */ + #define NVTX_LINKONCE_WEAK __attribute__((section(".gnu.linkonce.0."))) + #if defined(__cplusplus) + #define NVTX_LINKONCE_DEFINE_GLOBAL __declspec(selectany) + #define NVTX_LINKONCE_DEFINE_FUNCTION extern "C" inline NVTX_LINKONCE_WEAK + #else + #define NVTX_LINKONCE_DEFINE_GLOBAL __declspec(selectany) + #define NVTX_LINKONCE_DEFINE_FUNCTION NVTX_LINKONCE_WEAK + #endif +#elif defined(_MSC_VER) /* MSVC */ + #if defined(__cplusplus) + #define NVTX_LINKONCE_DEFINE_GLOBAL extern "C" __declspec(selectany) + #define NVTX_LINKONCE_DEFINE_FUNCTION extern "C" inline + #else + #define NVTX_LINKONCE_DEFINE_GLOBAL __declspec(selectany) + #define NVTX_LINKONCE_DEFINE_FUNCTION __inline + #endif +#elif defined(__CYGWIN__) && defined(__clang__) /* Clang on Cygwin */ + #define NVTX_LINKONCE_WEAK __attribute__((section(".gnu.linkonce.0."))) + #if defined(__cplusplus) + #define NVTX_LINKONCE_DEFINE_GLOBAL NVTX_LINKONCE_WEAK + #define NVTX_LINKONCE_DEFINE_FUNCTION extern "C" NVTX_LINKONCE_WEAK + #else + #define NVTX_LINKONCE_DEFINE_GLOBAL NVTX_LINKONCE_WEAK + #define NVTX_LINKONCE_DEFINE_FUNCTION NVTX_LINKONCE_WEAK + #endif +#elif defined(__CYGWIN__) /* Assume GCC or compatible */ + #define NVTX_LINKONCE_WEAK __attribute__((weak)) + #if defined(__cplusplus) + #define NVTX_LINKONCE_DEFINE_GLOBAL __declspec(selectany) + #define NVTX_LINKONCE_DEFINE_FUNCTION extern "C" inline + #else + #define NVTX_LINKONCE_DEFINE_GLOBAL NVTX_LINKONCE_WEAK + #define NVTX_LINKONCE_DEFINE_FUNCTION NVTX_LINKONCE_WEAK + #endif +#else /* All others: Assume GCC, clang, or compatible */ + #define NVTX_LINKONCE_WEAK __attribute__((weak)) + #define NVTX_LINKONCE_HIDDEN __attribute__((visibility("hidden"))) + #if defined(__cplusplus) + #define NVTX_LINKONCE_DEFINE_GLOBAL NVTX_LINKONCE_HIDDEN NVTX_LINKONCE_WEAK + #define NVTX_LINKONCE_DEFINE_FUNCTION extern "C" NVTX_LINKONCE_HIDDEN inline + #else + #define NVTX_LINKONCE_DEFINE_GLOBAL NVTX_LINKONCE_HIDDEN NVTX_LINKONCE_WEAK + #define NVTX_LINKONCE_DEFINE_FUNCTION NVTX_LINKONCE_HIDDEN NVTX_LINKONCE_WEAK + #endif +#endif + +#define NVTX_LINKONCE_FWDDECL_GLOBAL NVTX_LINKONCE_DEFINE_GLOBAL extern +#define NVTX_LINKONCE_FWDDECL_FUNCTION NVTX_LINKONCE_DEFINE_FUNCTION + +#endif /* __NVTX_LINKONCE_H__ */ diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxTypes.h b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxTypes.h new file mode 100644 index 0000000000000000000000000000000000000000..4d34cf40683f7e9fb754f25cb03481c30b0d64f1 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/nvtx/include/nvtx3/nvtxDetail/nvtxTypes.h @@ -0,0 +1,304 @@ +/* +* Copyright 2009-2022 NVIDIA Corporation. All rights reserved. +* +* Licensed under the Apache License v2.0 with LLVM Exceptions. +* See https://llvm.org/LICENSE.txt for license information. +* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +*/ + +/* This header defines types which are used by the internal implementation +* of NVTX and callback subscribers. API clients do not use these types, +* so they are defined here instead of in nvToolsExt.h to clarify they are +* not part of the NVTX client API. */ + +#ifndef NVTX_IMPL_GUARD +#error Never include this file directly -- it is automatically included by nvToolsExt.h. +#endif + +/* ------ Dependency-free types binary-compatible with real types ------- */ + +/* In order to avoid having the NVTX core API headers depend on non-NVTX +* headers like cuda.h, NVTX defines binary-compatible types to use for +* safely making the initialization versions of all NVTX functions without +* needing to have definitions for the real types. */ + +typedef int nvtx_CUdevice; +typedef void* nvtx_CUcontext; +typedef void* nvtx_CUstream; +typedef void* nvtx_CUevent; + +typedef void* nvtx_cudaStream_t; +typedef void* nvtx_cudaEvent_t; + +typedef void* nvtx_cl_platform_id; +typedef void* nvtx_cl_device_id; +typedef void* nvtx_cl_context; +typedef void* nvtx_cl_command_queue; +typedef void* nvtx_cl_mem; +typedef void* nvtx_cl_program; +typedef void* nvtx_cl_kernel; +typedef void* nvtx_cl_event; +typedef void* nvtx_cl_sampler; + +typedef struct nvtxSyncUser* nvtxSyncUser_t; +struct nvtxSyncUserAttributes_v0; +typedef struct nvtxSyncUserAttributes_v0 nvtxSyncUserAttributes_t; + +/* --------- Types for function pointers (with fake API types) ---------- */ + +typedef void (NVTX_API * nvtxMarkEx_impl_fntype)(const nvtxEventAttributes_t* eventAttrib); +typedef void (NVTX_API * nvtxMarkA_impl_fntype)(const char* message); +typedef void (NVTX_API * nvtxMarkW_impl_fntype)(const wchar_t* message); +typedef nvtxRangeId_t (NVTX_API * nvtxRangeStartEx_impl_fntype)(const nvtxEventAttributes_t* eventAttrib); +typedef nvtxRangeId_t (NVTX_API * nvtxRangeStartA_impl_fntype)(const char* message); +typedef nvtxRangeId_t (NVTX_API * nvtxRangeStartW_impl_fntype)(const wchar_t* message); +typedef void (NVTX_API * nvtxRangeEnd_impl_fntype)(nvtxRangeId_t id); +typedef int (NVTX_API * nvtxRangePushEx_impl_fntype)(const nvtxEventAttributes_t* eventAttrib); +typedef int (NVTX_API * nvtxRangePushA_impl_fntype)(const char* message); +typedef int (NVTX_API * nvtxRangePushW_impl_fntype)(const wchar_t* message); +typedef int (NVTX_API * nvtxRangePop_impl_fntype)(void); +typedef void (NVTX_API * nvtxNameCategoryA_impl_fntype)(uint32_t category, const char* name); +typedef void (NVTX_API * nvtxNameCategoryW_impl_fntype)(uint32_t category, const wchar_t* name); +typedef void (NVTX_API * nvtxNameOsThreadA_impl_fntype)(uint32_t threadId, const char* name); +typedef void (NVTX_API * nvtxNameOsThreadW_impl_fntype)(uint32_t threadId, const wchar_t* name); + +/* Real impl types are defined in nvtxImplCuda_v3.h, where CUDA headers are included */ +typedef void (NVTX_API * nvtxNameCuDeviceA_fakeimpl_fntype)(nvtx_CUdevice device, const char* name); +typedef void (NVTX_API * nvtxNameCuDeviceW_fakeimpl_fntype)(nvtx_CUdevice device, const wchar_t* name); +typedef void (NVTX_API * nvtxNameCuContextA_fakeimpl_fntype)(nvtx_CUcontext context, const char* name); +typedef void (NVTX_API * nvtxNameCuContextW_fakeimpl_fntype)(nvtx_CUcontext context, const wchar_t* name); +typedef void (NVTX_API * nvtxNameCuStreamA_fakeimpl_fntype)(nvtx_CUstream stream, const char* name); +typedef void (NVTX_API * nvtxNameCuStreamW_fakeimpl_fntype)(nvtx_CUstream stream, const wchar_t* name); +typedef void (NVTX_API * nvtxNameCuEventA_fakeimpl_fntype)(nvtx_CUevent event, const char* name); +typedef void (NVTX_API * nvtxNameCuEventW_fakeimpl_fntype)(nvtx_CUevent event, const wchar_t* name); + +/* Real impl types are defined in nvtxImplOpenCL_v3.h, where OPENCL headers are included */ +typedef void (NVTX_API * nvtxNameClDeviceA_fakeimpl_fntype)(nvtx_cl_device_id device, const char* name); +typedef void (NVTX_API * nvtxNameClDeviceW_fakeimpl_fntype)(nvtx_cl_device_id device, const wchar_t* name); +typedef void (NVTX_API * nvtxNameClContextA_fakeimpl_fntype)(nvtx_cl_context context, const char* name); +typedef void (NVTX_API * nvtxNameClContextW_fakeimpl_fntype)(nvtx_cl_context context, const wchar_t* name); +typedef void (NVTX_API * nvtxNameClCommandQueueA_fakeimpl_fntype)(nvtx_cl_command_queue command_queue, const char* name); +typedef void (NVTX_API * nvtxNameClCommandQueueW_fakeimpl_fntype)(nvtx_cl_command_queue command_queue, const wchar_t* name); +typedef void (NVTX_API * nvtxNameClMemObjectA_fakeimpl_fntype)(nvtx_cl_mem memobj, const char* name); +typedef void (NVTX_API * nvtxNameClMemObjectW_fakeimpl_fntype)(nvtx_cl_mem memobj, const wchar_t* name); +typedef void (NVTX_API * nvtxNameClSamplerA_fakeimpl_fntype)(nvtx_cl_sampler sampler, const char* name); +typedef void (NVTX_API * nvtxNameClSamplerW_fakeimpl_fntype)(nvtx_cl_sampler sampler, const wchar_t* name); +typedef void (NVTX_API * nvtxNameClProgramA_fakeimpl_fntype)(nvtx_cl_program program, const char* name); +typedef void (NVTX_API * nvtxNameClProgramW_fakeimpl_fntype)(nvtx_cl_program program, const wchar_t* name); +typedef void (NVTX_API * nvtxNameClEventA_fakeimpl_fntype)(nvtx_cl_event evnt, const char* name); +typedef void (NVTX_API * nvtxNameClEventW_fakeimpl_fntype)(nvtx_cl_event evnt, const wchar_t* name); + +/* Real impl types are defined in nvtxImplCudaRt_v3.h, where CUDART headers are included */ +typedef void (NVTX_API * nvtxNameCudaDeviceA_impl_fntype)(int device, const char* name); +typedef void (NVTX_API * nvtxNameCudaDeviceW_impl_fntype)(int device, const wchar_t* name); +typedef void (NVTX_API * nvtxNameCudaStreamA_fakeimpl_fntype)(nvtx_cudaStream_t stream, const char* name); +typedef void (NVTX_API * nvtxNameCudaStreamW_fakeimpl_fntype)(nvtx_cudaStream_t stream, const wchar_t* name); +typedef void (NVTX_API * nvtxNameCudaEventA_fakeimpl_fntype)(nvtx_cudaEvent_t event, const char* name); +typedef void (NVTX_API * nvtxNameCudaEventW_fakeimpl_fntype)(nvtx_cudaEvent_t event, const wchar_t* name); + +typedef void (NVTX_API * nvtxDomainMarkEx_impl_fntype)(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib); +typedef nvtxRangeId_t (NVTX_API * nvtxDomainRangeStartEx_impl_fntype)(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib); +typedef void (NVTX_API * nvtxDomainRangeEnd_impl_fntype)(nvtxDomainHandle_t domain, nvtxRangeId_t id); +typedef int (NVTX_API * nvtxDomainRangePushEx_impl_fntype)(nvtxDomainHandle_t domain, const nvtxEventAttributes_t* eventAttrib); +typedef int (NVTX_API * nvtxDomainRangePop_impl_fntype)(nvtxDomainHandle_t domain); +typedef nvtxResourceHandle_t (NVTX_API * nvtxDomainResourceCreate_impl_fntype)(nvtxDomainHandle_t domain, nvtxResourceAttributes_t* attribs); +typedef void (NVTX_API * nvtxDomainResourceDestroy_impl_fntype)(nvtxResourceHandle_t resource); +typedef void (NVTX_API * nvtxDomainNameCategoryA_impl_fntype)(nvtxDomainHandle_t domain, uint32_t category, const char* name); +typedef void (NVTX_API * nvtxDomainNameCategoryW_impl_fntype)(nvtxDomainHandle_t domain, uint32_t category, const wchar_t* name); +typedef nvtxStringHandle_t (NVTX_API * nvtxDomainRegisterStringA_impl_fntype)(nvtxDomainHandle_t domain, const char* string); +typedef nvtxStringHandle_t (NVTX_API * nvtxDomainRegisterStringW_impl_fntype)(nvtxDomainHandle_t domain, const wchar_t* string); +typedef nvtxDomainHandle_t (NVTX_API * nvtxDomainCreateA_impl_fntype)(const char* message); +typedef nvtxDomainHandle_t (NVTX_API * nvtxDomainCreateW_impl_fntype)(const wchar_t* message); +typedef void (NVTX_API * nvtxDomainDestroy_impl_fntype)(nvtxDomainHandle_t domain); +typedef void (NVTX_API * nvtxInitialize_impl_fntype)(const void* reserved); + +typedef nvtxSyncUser_t (NVTX_API * nvtxDomainSyncUserCreate_impl_fntype)(nvtxDomainHandle_t domain, const nvtxSyncUserAttributes_t* attribs); +typedef void (NVTX_API * nvtxDomainSyncUserDestroy_impl_fntype)(nvtxSyncUser_t handle); +typedef void (NVTX_API * nvtxDomainSyncUserAcquireStart_impl_fntype)(nvtxSyncUser_t handle); +typedef void (NVTX_API * nvtxDomainSyncUserAcquireFailed_impl_fntype)(nvtxSyncUser_t handle); +typedef void (NVTX_API * nvtxDomainSyncUserAcquireSuccess_impl_fntype)(nvtxSyncUser_t handle); +typedef void (NVTX_API * nvtxDomainSyncUserReleasing_impl_fntype)(nvtxSyncUser_t handle); + +/* ---------------- Types for callback subscription --------------------- */ + +typedef const void *(NVTX_API * NvtxGetExportTableFunc_t)(uint32_t exportTableId); +typedef int (NVTX_API * NvtxInitializeInjectionNvtxFunc_t)(NvtxGetExportTableFunc_t exportTable); + +typedef enum NvtxCallbackModule +{ + NVTX_CB_MODULE_INVALID = 0, + NVTX_CB_MODULE_CORE = 1, + NVTX_CB_MODULE_CUDA = 2, + NVTX_CB_MODULE_OPENCL = 3, + NVTX_CB_MODULE_CUDART = 4, + NVTX_CB_MODULE_CORE2 = 5, + NVTX_CB_MODULE_SYNC = 6, + /* --- New constants must only be added directly above this line --- */ + NVTX_CB_MODULE_SIZE, + NVTX_CB_MODULE_FORCE_INT = 0x7fffffff +} NvtxCallbackModule; + +typedef enum NvtxCallbackIdCore +{ + NVTX_CBID_CORE_INVALID = 0, + NVTX_CBID_CORE_MarkEx = 1, + NVTX_CBID_CORE_MarkA = 2, + NVTX_CBID_CORE_MarkW = 3, + NVTX_CBID_CORE_RangeStartEx = 4, + NVTX_CBID_CORE_RangeStartA = 5, + NVTX_CBID_CORE_RangeStartW = 6, + NVTX_CBID_CORE_RangeEnd = 7, + NVTX_CBID_CORE_RangePushEx = 8, + NVTX_CBID_CORE_RangePushA = 9, + NVTX_CBID_CORE_RangePushW = 10, + NVTX_CBID_CORE_RangePop = 11, + NVTX_CBID_CORE_NameCategoryA = 12, + NVTX_CBID_CORE_NameCategoryW = 13, + NVTX_CBID_CORE_NameOsThreadA = 14, + NVTX_CBID_CORE_NameOsThreadW = 15, + /* --- New constants must only be added directly above this line --- */ + NVTX_CBID_CORE_SIZE, + NVTX_CBID_CORE_FORCE_INT = 0x7fffffff +} NvtxCallbackIdCore; + +typedef enum NvtxCallbackIdCore2 +{ + NVTX_CBID_CORE2_INVALID = 0, + NVTX_CBID_CORE2_DomainMarkEx = 1, + NVTX_CBID_CORE2_DomainRangeStartEx = 2, + NVTX_CBID_CORE2_DomainRangeEnd = 3, + NVTX_CBID_CORE2_DomainRangePushEx = 4, + NVTX_CBID_CORE2_DomainRangePop = 5, + NVTX_CBID_CORE2_DomainResourceCreate = 6, + NVTX_CBID_CORE2_DomainResourceDestroy = 7, + NVTX_CBID_CORE2_DomainNameCategoryA = 8, + NVTX_CBID_CORE2_DomainNameCategoryW = 9, + NVTX_CBID_CORE2_DomainRegisterStringA = 10, + NVTX_CBID_CORE2_DomainRegisterStringW = 11, + NVTX_CBID_CORE2_DomainCreateA = 12, + NVTX_CBID_CORE2_DomainCreateW = 13, + NVTX_CBID_CORE2_DomainDestroy = 14, + NVTX_CBID_CORE2_Initialize = 15, + /* --- New constants must only be added directly above this line --- */ + NVTX_CBID_CORE2_SIZE, + NVTX_CBID_CORE2_FORCE_INT = 0x7fffffff +} NvtxCallbackIdCore2; + +typedef enum NvtxCallbackIdCuda +{ + NVTX_CBID_CUDA_INVALID = 0, + NVTX_CBID_CUDA_NameCuDeviceA = 1, + NVTX_CBID_CUDA_NameCuDeviceW = 2, + NVTX_CBID_CUDA_NameCuContextA = 3, + NVTX_CBID_CUDA_NameCuContextW = 4, + NVTX_CBID_CUDA_NameCuStreamA = 5, + NVTX_CBID_CUDA_NameCuStreamW = 6, + NVTX_CBID_CUDA_NameCuEventA = 7, + NVTX_CBID_CUDA_NameCuEventW = 8, + /* --- New constants must only be added directly above this line --- */ + NVTX_CBID_CUDA_SIZE, + NVTX_CBID_CUDA_FORCE_INT = 0x7fffffff +} NvtxCallbackIdCuda; + +typedef enum NvtxCallbackIdCudaRt +{ + NVTX_CBID_CUDART_INVALID = 0, + NVTX_CBID_CUDART_NameCudaDeviceA = 1, + NVTX_CBID_CUDART_NameCudaDeviceW = 2, + NVTX_CBID_CUDART_NameCudaStreamA = 3, + NVTX_CBID_CUDART_NameCudaStreamW = 4, + NVTX_CBID_CUDART_NameCudaEventA = 5, + NVTX_CBID_CUDART_NameCudaEventW = 6, + /* --- New constants must only be added directly above this line --- */ + NVTX_CBID_CUDART_SIZE, + NVTX_CBID_CUDART_FORCE_INT = 0x7fffffff +} NvtxCallbackIdCudaRt; + +typedef enum NvtxCallbackIdOpenCL +{ + NVTX_CBID_OPENCL_INVALID = 0, + NVTX_CBID_OPENCL_NameClDeviceA = 1, + NVTX_CBID_OPENCL_NameClDeviceW = 2, + NVTX_CBID_OPENCL_NameClContextA = 3, + NVTX_CBID_OPENCL_NameClContextW = 4, + NVTX_CBID_OPENCL_NameClCommandQueueA = 5, + NVTX_CBID_OPENCL_NameClCommandQueueW = 6, + NVTX_CBID_OPENCL_NameClMemObjectA = 7, + NVTX_CBID_OPENCL_NameClMemObjectW = 8, + NVTX_CBID_OPENCL_NameClSamplerA = 9, + NVTX_CBID_OPENCL_NameClSamplerW = 10, + NVTX_CBID_OPENCL_NameClProgramA = 11, + NVTX_CBID_OPENCL_NameClProgramW = 12, + NVTX_CBID_OPENCL_NameClEventA = 13, + NVTX_CBID_OPENCL_NameClEventW = 14, + /* --- New constants must only be added directly above this line --- */ + NVTX_CBID_OPENCL_SIZE, + NVTX_CBID_OPENCL_FORCE_INT = 0x7fffffff +} NvtxCallbackIdOpenCL; + +typedef enum NvtxCallbackIdSync +{ + NVTX_CBID_SYNC_INVALID = 0, + NVTX_CBID_SYNC_DomainSyncUserCreate = 1, + NVTX_CBID_SYNC_DomainSyncUserDestroy = 2, + NVTX_CBID_SYNC_DomainSyncUserAcquireStart = 3, + NVTX_CBID_SYNC_DomainSyncUserAcquireFailed = 4, + NVTX_CBID_SYNC_DomainSyncUserAcquireSuccess = 5, + NVTX_CBID_SYNC_DomainSyncUserReleasing = 6, + /* --- New constants must only be added directly above this line --- */ + NVTX_CBID_SYNC_SIZE, + NVTX_CBID_SYNC_FORCE_INT = 0x7fffffff +} NvtxCallbackIdSync; + +/* IDs for NVTX Export Tables */ +typedef enum NvtxExportTableID +{ + NVTX_ETID_INVALID = 0, + NVTX_ETID_CALLBACKS = 1, + NVTX_ETID_RESERVED0 = 2, + NVTX_ETID_VERSIONINFO = 3, + /* --- New constants must only be added directly above this line --- */ + NVTX_ETID_SIZE, + NVTX_ETID_FORCE_INT = 0x7fffffff +} NvtxExportTableID; + +typedef void (* NvtxFunctionPointer)(void); /* generic uncallable function pointer, must be casted to appropriate function type */ +typedef NvtxFunctionPointer** NvtxFunctionTable; /* double pointer because array(1) of pointers(2) to function pointers */ + +typedef struct NvtxExportTableCallbacks +{ + size_t struct_size; + + /* returns an array of pointer to function pointers*/ + int (NVTX_API *GetModuleFunctionTable)( + NvtxCallbackModule module, + NvtxFunctionTable* out_table, + unsigned int* out_size); +} NvtxExportTableCallbacks; + +typedef struct NvtxExportTableVersionInfo +{ + /* sizeof(NvtxExportTableVersionInfo) */ + size_t struct_size; + + /* The API version comes from the NVTX library linked to the app. The + * injection library is can use this info to make some assumptions */ + uint32_t version; + + /* Reserved for alignment, do not use */ + uint32_t reserved0; + + /* This must be set by tools when attaching to provide applications + * the ability to, in emergency situations, detect problematic tools + * versions and modify the NVTX source to prevent attaching anything + * that causes trouble in the app. Currently, this value is ignored. */ + void (NVTX_API *SetInjectionNvtxVersion)( + uint32_t version); +} NvtxExportTableVersionInfo; + + + + + + + diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/lib/gpustats.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/lib/gpustats.py new file mode 100644 index 0000000000000000000000000000000000000000..a337b301716273943722bfea33ccc0eea15bc28b --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/lib/gpustats.py @@ -0,0 +1,239 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +# Used as intermediate class to create GPU operation tables including the profiling overhead. +class GPUOperation(nsysstats.ExpertSystemsReport): + query_union = """ + UNION ALL + """ + + def __init__(self, dbfile, args=[]): + super().__init__(dbfile, args) + + self._gpu_ops_tables = { + "GPU_CUDA": self._query_cuda_gpu_ops(), + "GPU_VULKAN": self._query_vulkan_gpu_ops(), + "GPU_OPENGL": self._query_opengl_gpu_ops(), + "GPU_DX12": self._query_dx12_gpu_ops() + } + + self._gpu_ops_tables = {key: value for key, value in self._gpu_ops_tables.items() if value is not None} + self._query_gpu_ops_union = "" + + def query_gpu_ops_union(self): + return self._query_gpu_ops_union + + def _select_gpu_ops_columns(self, table: str, api: str, global_id='globalPid', device_id='deviceId', context_id='contextId'): + query = """ + SELECT + start, + end, + ({GLOBAL_ID} >> 24) & 0x00FFFFFF AS pid, + {GLOBAL_ID} AS globalId, + {DEVICE_ID} AS deviceId, + {CONTEXT_ID} AS contextId, + '{API}' AS api + FROM + {TABLE} + WHERE + start > 0 + """ + + return query.format( + TABLE = table, + GLOBAL_ID = global_id, + DEVICE_ID = device_id, + CONTEXT_ID = context_id, + API = api + ) + + def _add_profiling_overhead(self, gpu_ops_table: str, overhead_condition='false'): + if self.table_exists('PROFILER_OVERHEAD'): + # Add the profiling overhead to the GPU operation table + # 1. CTE "range": Get [min(start), max(end)] for each deviceId/PID. It will be + # used as the clipping range for overheads. + # 2. CTE "overhead": Select the profiling overhead that we want to take into + # account. + # 3. Duplicate overhead rows for each deviceId/PID. This will create a deviceId + # column that is not initially in the PROFILER_OVERHEAD table. + # Note: a profiling overhead on one thread affects all GPUs of the same + # process. + # 4. The overhead rows are combined with GPU operation rows. + query_overhead = """ + WITH + gpuops AS ( + {TABLE} + ), + range AS ( + SELECT + min(start) AS start, + max(end) AS end, + pid, + globalId, + deviceId, + contextId, + api + FROM + gpuops + GROUP BY deviceId, pid + ), + overheadID AS ( + SELECT + id + FROM + StringIds + WHERE + {CONDITION} + ), + overhead AS ( + SELECT + po.start, + po.end, + (po.globalTid >> 24) & 0x00FFFFFF AS pid + FROM + PROFILER_OVERHEAD AS po + JOIN + overheadID AS co + ON co.id == po.nameId + ) + SELECT + co.start, + co.end, + co.pid, + range.globalId, + range.deviceId, + range.contextId, + range.api + FROM + overhead AS co + JOIN + range + ON co.pid == range.pid + AND co.start > range.start + AND co.end < range.end + UNION ALL + SELECT + * + FROM + gpuops + """ + + gpu_ops_table = query_overhead.format( + TABLE = gpu_ops_table, + CONDITION = overhead_condition + ) + + return gpu_ops_table + + def _query_cuda_gpu_ops(self): + sub_queries = [] + + kernel = 'CUPTI_ACTIVITY_KIND_KERNEL' + memcpy = 'CUPTI_ACTIVITY_KIND_MEMCPY' + memset = 'CUPTI_ACTIVITY_KIND_MEMSET' + + if self.table_exists(kernel): + sub_queries.append(self._select_gpu_ops_columns(kernel, 'cuda')) + + if self.table_exists(memcpy): + sub_queries.append(self._select_gpu_ops_columns(memcpy, 'cuda')) + + if self.table_exists(memset): + sub_queries.append(self._select_gpu_ops_columns(memset, 'cuda')) + + if len(sub_queries) == 0: + return + + ops = self.query_union.join(sub_queries) + overhead_condition = "value == 'CUDA profiling data flush overhead' \ + OR value == 'CUDA profiling stop overhead' \ + OR value == 'CUDA profiling overhead'" + return self._add_profiling_overhead(ops, overhead_condition) + + def _query_vulkan_gpu_ops(self): + vulkan = 'VULKAN_WORKLOAD' + + if not self.table_exists(vulkan): + return None + + self.table_col_checks[vulkan] = \ + { 'gpu': + "{DBFILE} could not be analyzed due to missing 'gpu'." + " Please re-export the report file with a recent version of Nsight Systems." } + + ops = self._select_gpu_ops_columns(vulkan, 'vulkan', 'globalTid', 'gpu') + return self._add_profiling_overhead(ops, "value == 'Vulkan profiling overhead'") + + def _query_opengl_gpu_ops(self): + opengl = 'OPENGL_WORKLOAD' + + if not self.table_exists(opengl): + return None + + ops = self._select_gpu_ops_columns(opengl, 'opengl', 'globalTid', 'gpu') + return self._add_profiling_overhead(ops, "value == 'OpenGL profiling overhead'") + + def _query_dx12_gpu_ops(self): + dx12 = 'DX12_WORKLOAD' + + if not self.table_exists(dx12): + return None + + self.table_col_checks[dx12] = \ + { 'gpu': + "{DBFILE} could not be analyzed due to missing 'gpu'." + " Please re-export the report file with a recent version of Nsight Systems."} + + ops = self._select_gpu_ops_columns(dx12, 'dx12', 'globalTid', 'gpu', 'shortContextId') + return self._add_profiling_overhead(ops, "value == 'DX12 profiling overhead'") + + # Creates the GPU operation view for each API and combines them into one. + # query_to_apply is a string query that needs to be applied to each GPU operation view + # before the union. It must contain a placeholder with 'GPU_TABLE' as named index. + def create_gpu_ops_view(self, query_to_apply=None): + tables_to_union = [] + + create_gpu_view = """ + CREATE TEMP VIEW {TABLE} AS + {QUERY} + """ + + query_gpu_ops = """ + SELECT * + FROM {TABLE} + """ + + for table_name, query in self._gpu_ops_tables.items(): + if query_to_apply is not None: + query = query_to_apply.format(GPU_TABLE = query) + + errmsg = self._execute_statement( + create_gpu_view.format( + TABLE = table_name, + QUERY = query + ) + ) + if errmsg != None: + return errmsg + + tables_to_union.append(query_gpu_ops.format(TABLE = table_name)) + + self._query_gpu_ops_union = self.query_union.join(tables_to_union) + + def setup(self): + if len(self._gpu_ops_tables) == 0: + return "{DBFILE} could not be analyzed because it does not contain the required data." \ + " Does the application launch GPU operations?" + + err = super().setup() + if err != None: + return err diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/lib/kernel_helper.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/lib/kernel_helper.py new file mode 100644 index 0000000000000000000000000000000000000000..1a8f73335f39754bbf718e5d56926b09fc95ff6c --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/lib/kernel_helper.py @@ -0,0 +1,188 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +EVENT_TYPE_NVTX_DOMAIN_CREATE = 75 +EVENT_TYPE_NVTX_PUSHPOP_RANGE = 59 +EVENT_TYPE_NVTX_STARTEND_RANGE = 60 +EVENT_TYPE_NVTXT_PUSHPOP_RANGE = 70 +EVENT_TYPE_NVTXT_STARTEND_RANGE = 71 + +CREATE_RUNTIME_RIDX_STATEMENTS = [ +f""" +DROP TABLE IF EXISTS temp.NVTX_EVENTS_MINMAXTS +""", + +f""" +CREATE TEMP TABLE NVTX_EVENTS_MINMAXTS +AS SELECT + min(min(start), min(end)) AS min, + max(max(start), max(end)) AS max +FROM main.NVTX_EVENTS +WHERE + eventType == {EVENT_TYPE_NVTX_PUSHPOP_RANGE} + OR eventType == {EVENT_TYPE_NVTX_STARTEND_RANGE} + OR eventType == {EVENT_TYPE_NVTXT_PUSHPOP_RANGE} + OR eventType == {EVENT_TYPE_NVTXT_STARTEND_RANGE} +""", + +f""" +DROP TABLE IF EXISTS temp.NVTX_EVENTS_RIDX +""", + +f""" +CREATE VIRTUAL TABLE temp.NVTX_EVENTS_RIDX +USING rtree ( + rangeId, + startTS, + endTS, + +startNS INTEGER, + +endNS INTEGER, + +tid INTEGER, + +name TEXT, +) +""", + +f""" +INSERT INTO temp.NVTX_EVENTS_RIDX + SELECT + e.rowid AS rangeId, + rtree_scale(e.start, + (SELECT min FROM temp.NVTX_EVENTS_MINMAXTS), + (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)) AS startTS, + rtree_scale(ifnull(e.end, (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)), + (SELECT min FROM temp.NVTX_EVENTS_MINMAXTS), + (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)) AS endTS, + e.start AS startNS, + ifnull(e.end, (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)) AS endNS, + e.globalTid AS tid, + COALESCE(sid.value, e.text) AS name + FROM + main.NVTX_EVENTS AS e + LEFT JOIN + StringIds AS sid + ON e.textId == sid.id + WHERE + (e.eventType == {EVENT_TYPE_NVTX_PUSHPOP_RANGE} + OR e.eventType == {EVENT_TYPE_NVTX_STARTEND_RANGE} + OR e.eventType == {EVENT_TYPE_NVTXT_PUSHPOP_RANGE} + OR e.eventType == {EVENT_TYPE_NVTXT_STARTEND_RANGE}) + AND e.endGlobalTid IS NULL +""", + + ] + +QUERY_NVTX_KERNEL_NAME = """ +WITH + kernel AS ( + {KERNEL_TABLE} + ), + projection AS ( + SELECT + kernel.rowid, + rt.name AS nvtxName, + max(rt.startNS) AS maxStart + FROM + kernel + LEFT JOIN + main.CUPTI_ACTIVITY_KIND_RUNTIME AS r + ON kernel.correlationId == r.correlationId + AND kernel.globalPid == (r.globalTid & 0xFFFFFFFFFF000000) + LEFT JOIN + temp.NVTX_EVENTS_RIDX AS rt + ON rt.startTS <= rtree_scale(r.start, + (SELECT min FROM temp.NVTX_EVENTS_MINMAXTS), + (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)) + AND rt.endTS >= rtree_scale(r.end, + (SELECT min FROM temp.NVTX_EVENTS_MINMAXTS), + (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)) + AND rt.startNS <= r.start + AND rt.endNS >= r.end + AND rt.tid == r.globalTid + GROUP BY kernel.rowid + ) +SELECT + kernel.*, + COALESCE(nvtxName || '/' || kernelName, kernelName) AS name +FROM + kernel +JOIN + projection + ON kernel.rowid == projection.rowid +""" + +QUERY_KERNEL_NAME = """ +WITH + kernel AS ( + {KERNEL_TABLE} + ) +SELECT + *, + kernelName as name +FROM + kernel +""" + +QUERY_KERNEL = """ +SELECT + kernel.rowid, + kernel.*, + sid.value AS kernelName +FROM + CUPTI_ACTIVITY_KIND_KERNEL as kernel +LEFT JOIN + StringIds AS sid + ON sid.id == coalesce(kernel.{NAME_COL_NAME}, kernel.demangledName) +""" + +# Create a temporary view named 'CUPTI_ACTIVITY_KIND_KERNEL_NAMED' by adding +# a new column 'name' to the 'CUPTI_ACTIVITY_KIND_KERNEL' table. This column +# gives the kernel string name, which can be either the base or mangled name, +# optionally prefixed by the corresponding NVTX range name based on the +# provided options. +def create_kernel_view(instance): + use_base = getattr(instance._parsed_args, 'base', False) + use_mangled = getattr(instance._parsed_args, 'mangled', False) + use_nvtx_name = getattr(instance._parsed_args, 'nvtx_name', False) + + name_col_name = 'demangledName' + if use_base: + name_col_name = 'shortName' + elif use_mangled and instance.table_col_exists('CUPTI_ACTIVITY_KIND_KERNEL', 'mangledName'): + name_col_name = 'mangledName' + + kernel_query = QUERY_KERNEL.format(NAME_COL_NAME = name_col_name) + if use_nvtx_name: + if not instance.table_exists('NVTX_EVENTS'): + return "{DBFILE} does not contain NV Tools Extension (NVTX) data." + if not instance.table_exists('CUPTI_ACTIVITY_KIND_RUNTIME'): + return "{DBFILE} does not contain CUDA API data." + + for stmt in CREATE_RUNTIME_RIDX_STATEMENTS: + errmsg = instance._execute_statement(stmt) + if errmsg != None: + return errmsg + + kernel_name_query = QUERY_NVTX_KERNEL_NAME.format(KERNEL_TABLE = kernel_query) + else: + kernel_name_query = QUERY_KERNEL_NAME.format(KERNEL_TABLE = kernel_query) + + errmsg = instance._execute_statement( + 'DROP VIEW IF EXISTS temp.CUPTI_ACTIVITY_KIND_KERNEL_NAMED' + ) + if errmsg != None: + return errmsg + + errmsg = instance._execute_statement( + 'CREATE TEMP VIEW CUPTI_ACTIVITY_KIND_KERNEL_NAMED AS {QUERY}'.format( + QUERY = kernel_name_query + ) + ) + if errmsg != None: + return errmsg diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/lib/nsysstats.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/lib/nsysstats.py new file mode 100644 index 0000000000000000000000000000000000000000..d8bb225a8047bc9dec5eccbfa96e0823d569c4b9 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/lib/nsysstats.py @@ -0,0 +1,616 @@ +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import sys +import inspect +import os.path +import urllib.parse +import csv +import sqlite3 +import re +import argparse + +class Report: + + class Error(Exception): + pass + + class Error_MissingDatabaseFile(Error): + def __init__(self, filename): + super().__init__(f'Database file {filename} does not exist.') + + class Error_InvalidDatabaseFile(Error): + def __init__(self, filename): + super().__init__(f'Database file {filename} could not be opened and appears to be invalid.') + + class Error_InvalidSQL(Error): + def __init__(self, sql): + super().__init__(f'Bad SQL statement: {sql}') + + class Error_ArgumentError(Error): + def __init__(self, msg): + super().__init__(msg) + + class ArgumentParser(argparse.ArgumentParser): + def __init__(self, **kwargs): + self._options = [] + super().__init__(self, **kwargs) + + def exit(self, status=0, message=None): + raise Report.Error_ArgumentError(message) + + def error(self, message): + raise Report.Error_ArgumentError(message) + + # Allow optional arguments without dashes. + def add_optional_arg(self, *args, **kwargs): + self._options.extend(args) + dash_args = [] + for arg in args: + if arg[0] == '+': + dash_args.append(arg[1:]) + else: + dash_args.append('--' + arg) + return self.add_argument(*dash_args, **kwargs) + + def parse_optional_dashless_args(self, args, parsed_args=None): + formatted_args = [] + for arg in args: + if arg.split('=')[0] in self._options: + arg = '--' + arg + formatted_args.append(arg) + return self.parse_args(formatted_args, namespace=parsed_args) + + # SQL Aggregate function that takes two arguments: start and end. Finds the + # total duration where at least one range is active, but doesn't over-count + # when events overlap. Events can be fed in any order. + class SQLiteAggregateUniqueDuration: + def __init__(self): + self.segments = [] + + def step(self, start, end): + if start >= end: + return + new_segs = [] + new_start = start + new_end = end + + for s in self.segments: + if start <= s[1] and end >= s[0]: + new_start = min(new_start, s[0]) + new_end = max(new_end, s[1]) + else: + new_segs.append(s) + + new_segs.append([new_start, new_end]) + self.segments = new_segs + + def finalize(self): + dur = 0 + for s in self.segments: + dur += s[1] - s[0] + self.segments = [] + return dur + + EXIT_HELP = 25 + EXIT_DB = 26 + EXIT_NODATA = 27 + EXIT_SCRIPT = 28 + EXIT_INVALID_ARG = 29 + + DEFAULT_ROW_LIMIT = 50 + + _LOAD_TABLE_QUERY = """ + SELECT name + FROM sqlite_master + WHERE type LIKE 'table' + OR type LIKE 'view'; +""" + + _CREATE_FILTERED_VIEW_QUERY = """ + CREATE TEMP VIEW {TABLE} AS + SELECT rowid, * + FROM main.{TABLE} + WHERE ((start >= {START} AND start < {END}) + OR (end >= {START} AND end < {END}) + OR (start < {START} AND end >= {END})) + """ + + _FIND_NVTX_RANGE_QUERY = """ + WITH + domain AS ( + SELECT + domainId, + globalTid, + text + FROM + NVTX_EVENTS + WHERE + eventType == 75 -- EVENT_TYPE_NVTX_DOMAIN_CREATE + ) + SELECT + nvtx.start, + nvtx.end, + nvtx.globalTid + FROM + NVTX_EVENTS AS nvtx + LEFT JOIN + domain + ON nvtx.domainId == domain.domainId + AND nvtx.globalTid >> 24 == domain.globalTid >> 24 + LEFT JOIN + StringIds AS sid + ON nvtx.textId == sid.id + WHERE + nvtx.eventType IN (59, 60, 70, 71) -- EVENT_TYPE_NVTX[T]_(PUSHPOP|STARTEND)_RANGE + AND coalesce(nvtx.text, sid.value) || coalesce('@' || domain.text, '') == '{NVTX_RANGE}' + ORDER BY 1 + LIMIT 1 OFFSET {NVTX_IDX} + """ + + _boilerplate_statements = [ + f'pragma cache_size=-{32 * 1024}', # Set main DB page cache to 32MB + f'pragma temp.cache_size=-{32 * 1024}', # Set temp DB page cache to 32MB + ] + + _arg_opts = [ + [['start'], {'type': int, 'help': 'start time used for filtering'}], + [['end'], {'type': int, 'help': 'end time used for filtering'}], + [['nvtx'], {'type': str, 'help': 'NVTX range and domain for filtering'}], + ] + + script_name = None + display_name = 'NO NAME GIVEN' + usage = "{SCRIPT} -- NO USAGE INFORMATION PROVIDED" + should_display = True + table_checks = {} + table_col_checks = {} + statements = [] + query = "SELECT 1 AS 'ONE'" + + def __init__(self, dbfile, args=[]): + self._tables = None + self._dbcon = None + self._dbcur = None + self._dbfile = dbfile + self._args = [] + self._headers = [] + self._parsed_args = None + self._parser = None + + if isinstance(args, argparse.Namespace): + self._parsed_args = args + else: + self._args = args + + # Check DB file + if not os.path.exists(self._dbfile): + raise self.Error_MissingDatabaseFile(self._dbfile) + + # Open DB file + dburi_query = { + 'mode': 'ro', + 'nolock': '1', + 'immutable': '1' + } + + qstr = urllib.parse.urlencode(dburi_query) + urlstr = urllib.parse.urlunsplit(['file', '', os.path.abspath(self._dbfile), qstr, '']) + try: + self._dbcon = sqlite3.connect(urlstr, isolation_level=None, uri=True, check_same_thread=False) + except sqlite3.Error: + self._dbcon = None + raise self.Error_InvalidDatabaseFile(self._dbfile) + + # attach helper functions + self._dbcon.create_aggregate('unique_duration', 2, self.SQLiteAggregateUniqueDuration) + + # load tables + try: + cur = self._dbcon.execute(self._LOAD_TABLE_QUERY) + except sqlite3.Error: + raise self.Error_InvalidDatabaseFile(self._dbfile) + + self._tables = set(r[0] for r in cur.fetchall()) + self._dbfile_basename = os.path.basename(os.path.splitext(self._dbfile)[0]) + + def __del__(self): + if self._dbcon != None: + self._dbcon.close() + + def table_exists(self, table): + return table in self._tables + + def search_tables(self, regex_str): + regex = re.compile(regex_str) + matches = [] + for t in self._tables: + if regex.search(t) != None: + matches.append(t) + return matches + + def table_col_exists(self, table, col): + q = 'SELECT name FROM pragma_table_info(?) WHERE name = ?' + try: + cur = self._dbcon.execute(q, (table, col)) + except sqlite3.Error: + raise self.Error_InvalidSQL(q) + + return cur.fetchone() != None + + def check_columns(self): + for table, columns in self.table_col_checks.items(): + for col, errmsg in columns.items(): + if not self.table_col_exists(table, col): + return errmsg + + def setup(self): + for table, errmsg in self.table_checks.items(): + if not self.table_exists(table): + return errmsg + + errmsg = self.check_columns() + if errmsg != None: + return errmsg + + self._parser = self.ArgumentParser(allow_abbrev=False) + for opt in self._get_arg_options(): + self._parser.add_optional_arg(*opt[0], **opt[1]) + self._parsed_args = self._parser.parse_optional_dashless_args(self._args, self._parsed_args) + + pid = getattr(self._parsed_args, 'process', -1) + # Negative value indicates no filtering. + pid = None if pid < 0 else pid + + tid = getattr(self._parsed_args, 'thread', -1) + tid = None if tid < 0 else tid + + errmsg = self.filter_time_range(self._parsed_args.start, + self._parsed_args.end, self._parsed_args.nvtx, pid, tid) + if errmsg != None: + return errmsg + + def get_statements(self): + return self.statements + + def _execute_statement(self, stmt): + if self._dbcon == None: + raise RuntimeError(f'Called {__name__}() with invalid database connection.') + + try: + self._dbcon.execute(stmt) + except sqlite3.Error as err: + return str(err) + + def run_statements(self): + for stmt in self._boilerplate_statements: + errmsg = self._execute_statement(stmt) + if errmsg != None: + return errmsg + + for stmt in self.get_statements(): + errmsg = self._execute_statement(stmt) + if errmsg != None: + return errmsg + + def get_query(self): + return self.query + + def run_query(self): + csvw = csv.writer(sys.stdout) + qcur = self._dbcon.execute(self.get_query()) + qcur.arraysize = 100 + header = list(d[0] for d in qcur.description) + csvw.writerow(header) + + rows = qcur.fetchmany() + while rows != []: + csvw.writerows(rows) + rows = qcur.fetchmany() + + def start_query(self): + if self._dbcon == None: + raise RuntimeError(f'Called {__name__}() with invalid database connection.') + if self._dbcur != None: + raise RuntimeError(f'Called {__name__}() more than once.') + + try: + self._dbcur = self._dbcon.execute(self.get_query()) + except sqlite3.Error as err: + return str(err) + self._headers = list(d[0] for d in self._dbcur.description) + + def get_query_row(self): + if self._dbcon == None: + raise RuntimeError(f'Called {__name__}() with invalid database connection.') + if self._dbcur == None: + raise RuntimeError(f'Called {__name__}() without valid query.') + + row = self._dbcur.fetchone() + if row == None: + del self._dbcur + self._dbcur = None + return row + + def _query_nvtx_filter_range(self, nvtx): + if self._dbcon == None: + raise RuntimeError(f'Called {__name__}() with invalid database connection.') + + if not self.table_exists('NVTX_EVENTS'): + errmsg = "{DBFILE} does not contain NV Tools Extension (NVTX) data.".format( + DBFILE = self.dbfile) + return (errmsg, None, None, None) + + if not self.table_exists('StringIds'): + errmsg = "{DBFILE} file does not contain StringIds table.".format( + DBFILE = self.dbfile) + return (errmsg, None, None, None) + + nvtx_range = nvtx + nvtx_idx = 0 + + # Find last slash (in case name contains a slash) and try to + # convert integer behind it. If number won't convert, assume + # slash and anything trailing is part of the name. + slash_idx = nvtx.rfind("/") + if slash_idx != -1: + name = nvtx[:slash_idx] + numbStr = nvtx[slash_idx+1:] + numb = None + try: + numb = int(numbStr) + if numb < 0: + numb = None + except: + pass + if numb is not None: + nvtx_range = name + nvtx_idx = numb + + try: + cur = self._dbcon.execute(self._FIND_NVTX_RANGE_QUERY.format( + NVTX_RANGE = nvtx_range, NVTX_IDX = nvtx_idx)) + except sqlite3.Error as err: + return (str(err), None, None, None) + + row = cur.fetchone() + if row: + return (None, row[0], row[1], row[2]) + + errmsg = "NVTX range '{NVTX_RANGE}' could not be found in {DBFILE}.".format( + NVTX_RANGE = nvtx, + DBFILE = self.dbfile) + return (errmsg, None, None, None) + + # Filters tables according to start, end, and nvtx flags, if applicable. + # Tables that should NOT be filtered (e.g. those used for correlation ID matching) + # should be prefixed with 'main' in the query. + def filter_time_range(self, start, end, nvtx, pid, tid): + if all(val is None for val in (start, end, nvtx, pid, tid)): + return None + + nvtx_globaltid = None + if nvtx is None: + start = 0 if start is None else start + # If no value is specified, set the end variable to the largest + # possible timestamp value. + end = 0x7FFFFFFFFFFFFFFF if end is None else end + else: + err, nvtx_start, nvtx_end, nvtx_globaltid = self._query_nvtx_filter_range(nvtx) + if err != None: + return err + + start = nvtx_start if start is None else start + end = nvtx_end if end is None else end + + if start > end: + return "The start time cannot be greater than the end time." + + if (pid is not None or tid is not None) and nvtx is not None: + return "The 'nvtx' option cannot be used with 'pid' or 'tid'." + + for table in self._tables: + if not self.table_col_exists(table, 'start') or not self.table_col_exists(table, 'end'): + continue + + statement = self._CREATE_FILTERED_VIEW_QUERY.format( + TABLE = table, START = start, END = end) + + if pid is not None: + if self.table_col_exists(table, 'globalTid'): + statement += ' AND (globalTid >> 24) & 0x00FFFFFF == {PID}'.format(PID = pid) + elif self.table_col_exists(table, 'globalPid'): + statement += ' AND (globalPid >> 24) & 0x00FFFFFF == {PID}'.format(PID = pid) + + if tid is not None and self.table_col_exists(table, 'globalTid'): + statement += ' AND globalTid & 0x00FFFFFF == {TID}'.format(TID = tid) + + if nvtx_globaltid is not None: + nvtx_pid = (nvtx_globaltid >> 24) & 0x00FFFFFF + nvtx_tid = nvtx_globaltid & 0x00FFFFFF + + if self.table_col_exists(table, 'globalTid'): + if nvtx_pid != nvtx_tid: + # NVTX Push/Pop range. + statement += ' AND globalTid == {GLOBAL_TID}'.format(GLOBAL_TID = nvtx_globaltid) + else: + # NVTX Start/End range. + statement += ' AND globalTid >> 24 == {GLOBAL_TID} >> 24'.format(GLOBAL_TID = nvtx_globaltid) + elif self.table_col_exists(table, 'globalPid'): + statement += ' AND globalPid >> 24 == {GLOBAL_TID} >> 24'.format(GLOBAL_TID = nvtx_globaltid) + + errmsg = self._execute_statement('DROP VIEW IF EXISTS temp.{TABLE}'.format(TABLE = table)) + if errmsg != None: + return errmsg + + errmsg = self._execute_statement(statement) + if errmsg != None: + return errmsg + + @property + def dbfile(self): + return self._dbfile + + @property + def dbfile_basename(self): + return self._dbfile_basename + + @property + def parsed_args(self): + return self._parsed_args + + @property + def headers(self): + return self._headers + + @property + def dbcon(self): + return self._dbcon + + @property + def tables(self): + return self._tables + + @classmethod + def get_script_name(klass): + if klass.script_name == None: + klass.script_name = os.path.basename(inspect.getmodule(klass).__file__) + if klass.script_name.endswith('.py'): + klass.script_name = klass.script_name[0:-3] + return klass.script_name + + @classmethod + def get_display_name(klass): + return klass.display_name + + @classmethod + def get_usage_summary(klass): + return klass.get_usage().split("\n", 1)[0] + + @classmethod + def get_usage(klass): + return klass.usage.format( + SCRIPT=klass.get_script_name(), + DISPLAY_NAME=klass.get_display_name(), + ROW_LIMIT=klass.DEFAULT_ROW_LIMIT) + + @classmethod + def get_should_display(klass): + if klass.get_script_name()[0] == '_': + return False + return klass.should_display + + @classmethod + def _get_arg_options(klass): + opts = [] + for k in klass.__mro__: + if '_arg_opts' in k.__dict__: + opts.extend(k._arg_opts) + return opts + + @classmethod + def Setup(klass, dbfile, args): + try: + report = klass(dbfile, args) + except (klass.Error_MissingDatabaseFile, klass.Error_InvalidDatabaseFile) as err: + return None, klass.EXIT_DB, str(err) + + # If/when we upgrade to Python 3.9 or higher, look into passing + # exit_on_error=False to the ArgumentParser constructor and updating + # how errors are handled with the .exit() function. + try: + errmsg = report.setup() + except klass.Error_ArgumentError as ex: + return None, klass.EXIT_INVALID_ARG, str(ex) + + if errmsg != None: + return None, klass.EXIT_NODATA, errmsg.format(DBFILE=report.dbfile) + + errmsg = report.run_statements() + if errmsg != None: + return None, klass.EXIT_SCRIPT, errmsg + + return report, None, None + + @classmethod + def Report(klass, dbfile, args): + report, exitval, errmsg = klass.Setup(dbfile, args) + if report == None: + return None, exitval, errmsg + + errmsg = report.start_query() + if errmsg != None: + return None, klass.EXIT_SCRIPT, errmsg + + return report, None, None + + @classmethod + def Main(klass): + if len(sys.argv) <= 1: + print(klass.get_usage()) + exit(klass.EXIT_HELP) + + dbfile = sys.argv[1] + args = sys.argv[2:] + + report, exitval, errmsg = klass.Report(dbfile, args) + if report == None: + print(errmsg, file=sys.stderr) + exit(exitval) + + csvw = csv.writer(sys.stdout) + + first_row = True + while True: + row = report.get_query_row() + if row == None: + break + if first_row: + first_row = False + csvw.writerow(report.headers) + csvw.writerow(row) + +class StatsReport(Report): + + def MessageNoResult(self): + return "Report was successfully run, but no data was returned." + +class ExpertSystemsReport(Report): + + DEFAULT_ROW_LIMIT = 50 + + _arg_opts = [ + [['rows'], {'type': int, 'help': 'max rows', 'default': DEFAULT_ROW_LIMIT}], + ] + + def setup(self): + err = super().setup() + if err != None: + return err + + self._row_limit = self.parsed_args.rows + + message_advice = "NO ADVICE MESSAGE DEFINED" + message_noresult = "NO NON-RESULT MESSAGE DEFINED" + + def MessageAdvice(self, extended=True): + if extended and hasattr(self, 'message_advice_extended'): + return self.message_advice_extended + return self.message_advice + + def MessageNoResult(self): + return self.message_noresult + + def MessageRowLimit(self, rows): + if self._row_limit <= 0 or rows < self._row_limit: + return '' + if self._row_limit == 1: + return 'Only the top result is displayed. More data may be available.' + return f"Only the top {rows} results are displayed. More data may be available." diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/Dockerfile b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..1affc205387cff741e548020b381ae91e16e1b8a --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/Dockerfile @@ -0,0 +1,19 @@ +FROM ubuntu:22.04 + +ENV DEBIAN_FRONTEND=noninteractive + +# Download Nsight Systems +WORKDIR ~ +ADD http://developer.download.nvidia.com/devtools/repos/ubuntu2204/amd64/nsight-systems-2023.3.1_2023.3.1.92-1_amd64.deb . +RUN apt update -y && \ + apt install -y ./nsight-systems-2023.3.1_2023.3.1.92-1_amd64.deb && \ + rm -rf nsight-systems-2023.3.1_2023.3.1.92-1_amd64.deb +ENV PATH=/opt/nvidia/nsight-systems/2023.3.1/bin:${PATH} + +# Install recipe dependencies +RUN apt update -y && \ + apt install -y python3-pip python3-venv +RUN python3 /opt/nvidia/nsight-systems/2023.3.1/target-linux-x64/python/packages/nsys_recipe/install.py --current + +# Cleanup +RUN apt clean -y && apt autoclean -y && apt autoremove -y --purge diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/__init__.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ca9a9bccaf29e0063e0d89aca3ef9ad5a98b3fb1 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/__init__.py @@ -0,0 +1,56 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import sys +import os + +from ctypes import cdll + +if sys.version_info < (3, 6): + raise RuntimeError("Python 3.6 or later is required.") + +from nsys_recipe import log +from nsys_recipe.log import logger +from nsys_recipe.nsys_constants import * + +log.customize_logger("stderr", "info") + +try: + from nsys_recipe.lib import * + from nsys_recipe.lib.nsys_path import find_installed_file + + # These are modules that might conflict with recipe modules. + # To avoid ambiguity, we import the parent directory. + report_modules = [ + NSYS_RULE_DIR, + NSYS_REPORT_DIR, + ] + module_paths = [ + os.path.dirname(find_installed_file(module)) for module in report_modules + ] + + additional_modules = [NSYS_PYTHON_LIB_DIR, NSYS_RECIPE_THIRDPARTY_PATH] + module_paths += [find_installed_file(module) for module in additional_modules] + + sys.path = module_paths + sys.path + + # Load the SQLite extension library. + cdll.LoadLibrary(find_installed_file(NSYS_SQLITE_LIB)) + +except ModuleNotFoundError as e: + req_file = NSYS_RECIPE_REQ_COMMON_PATH + install_file = NSYS_RECIPE_INSTALL_PATH + + logger.error( + f"{e}\nAll packages listed in '{req_file}' must be installed." + f" You can automate the installation using the '{install_file}' script." + " For more information, please refer to the Nsight Systems User Guide." + ) + sys.exit(1) diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/__main__.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..974d890310f5fb2f244bf8ab2eeccf4713b02ab1 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/__main__.py @@ -0,0 +1,133 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import argparse +import os +import sys +import shutil + +from nsys_recipe import Context, log, recipe_loader +from nsys_recipe.log import logger +import nsys_recipe + + +def print_recipe_list(): + print("\nThe following built-in recipes are available:\n") + + recipe_names = os.listdir(nsys_recipe.NSYS_RECIPE_RECIPES_PATH) + recipe_names.sort() + + for recipe_name in recipe_names: + metadata = recipe_loader.get_metadata_dict( + nsys_recipe.NSYS_RECIPE_RECIPES_PATH, recipe_name + ) + if metadata is None: + continue + + display_name = metadata.get("display_name", "NO DISPLAY NAME") + print(f" {recipe_name} -- {display_name}") + + +def get_recipe_parsed_args(recipe_class, recipe_args): + parser = recipe_class.get_argument_parser() + parser.add_context_arguments() + return parser.parse_args(recipe_args) + + +@log.time("Total") +def run_recipe(recipe_name, recipe_args): + exit_code = 1 + + recipe_class = recipe_loader.get_recipe_class_from_name(recipe_name) + if recipe_class is None: + return None, exit_code + + parsed_args = get_recipe_parsed_args(recipe_class, recipe_args) + + try: + with Context.create_context(parsed_args.mode) as context: + with recipe_class(parsed_args) as recipe: + recipe.run(context) + return recipe, 0 + except nsys_recipe.ModeModuleNotFoundError as e: + req_file = nsys_recipe.NSYS_RECIPE_REQ_DASK_PATH + logger.error(f"{e}\nPlease install packages from '{req_file}'") + except nsys_recipe.StatsModuleNotFoundError as e: + logger.error(f"{e}\nPlease make sure the Stats report exists.") + except nsys_recipe.StatsInternalError as e: + logger.error(f"{e}") + except nsys_recipe.ValueError as e: + logger.error(f"{e}") + except nsys_recipe.NoDataError: + # Early exit due to lack of data. + logger.info("No output generated.") + exit_code = 0 + + return None, exit_code + + +def get_main_parsed_args(): + parser = argparse.ArgumentParser(add_help=False, allow_abbrev=False) + parser.add_argument( + "--help-recipes", action="store_true", help="Print available recipes" + ) + + # Options for internal use. + parser.add_argument( + "--clear-output", action="store_true", help="Delete output directory" + ) + parser.add_argument( + "--log-level", + choices=log.levels.keys(), + default="info", + help="Set the log level", + ) + parser.add_argument( + "--log-stream", + choices=log.streams.keys(), + default="stderr", + help="Set the log stream", + ) + + return parser.parse_known_args() + + +def main(): + parsed_args, remaining_args = get_main_parsed_args() + + log.customize_logger(parsed_args.log_stream, parsed_args.log_level) + + if parsed_args.help_recipes: + print_recipe_list() + sys.exit(0) + + if not remaining_args: + logger.error("No recipe specified.") + sys.exit(1) + + if all(arg.startswith("-") or arg in ("--help", "-h") for arg in remaining_args): + print("usage: []") + print_recipe_list() + print("\nTo get help on a specific recipe, run ' --help'.") + sys.exit(0) + + recipe, exit_code = run_recipe(remaining_args[0], remaining_args[1:]) + if recipe is None: + sys.exit(exit_code) + + if recipe.output_dir is not None: + if parsed_args.clear_output: + shutil.rmtree(recipe.output_dir) + else: + print(f"Generated:\n {recipe.output_dir}") + + +if __name__ == "__main__": + main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/clean.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/clean.py new file mode 100644 index 0000000000000000000000000000000000000000..cbec1ef2d7932bc23e435baf4f68797270645399 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/clean.py @@ -0,0 +1,24 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import glob +import os +import shutil + + +# Delete all directories that contain the nsys-analysis file. +def main(): + for directory in glob.glob("*/"): + if len(glob.glob(os.path.join(directory, "*.nsys-analysis"))): + shutil.rmtree(directory) + + +if __name__ == "__main__": + main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/data_service.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/data_service.py new file mode 100644 index 0000000000000000000000000000000000000000..a70c72a9c0ed8b447fb12c0dfa28d5bd381660c0 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/data_service.py @@ -0,0 +1,600 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +from asyncore import file_dispatcher +import importlib +import numpy as np +import os +import pandas as pd +import pyarrow as pa +import pyarrow.parquet as pq +import subprocess +import sys + +from pathlib import Path + +import nsysstats + +from nsys_recipe.log import logger +from nsys_recipe.lib import exceptions, nsys_path +from nsys_recipe import nsys_constants + +EVENT_TYPE_NVTX_DOMAIN_CREATE = 75 +EVENT_TYPE_NVTX_PUSHPOP_RANGE = 59 +EVENT_TYPE_NVTX_STARTEND_RANGE = 60 + + +class _Loader: + output_suffix = "" + + def __init__(self, report_path): + self._report_path = report_path + + def _validate_export_time(self, path): + if not Path(path).exists(): + return False + + return os.path.getctime(self._report_path) < os.path.getctime(path) + + def validate_table(self, path, table, columns): + raise NotImplementedError() + + def read_table(self, handle, table, columns): + raise NotImplementedError() + + def list_tables(self, path): + raise NotImplementedError + + +class _ParquetLoader(_Loader): + output_suffix = "_pqtdir" + file_extension = ".parquet" + + def validate_table(self, path, table, columns): + file_path = Path(path) / f"{table}{self.file_extension}" + + if not self._validate_export_time(file_path): + return None + + parquet_file = pq.ParquetFile(file_path) + parquet_schema = parquet_file.schema + parquet_columns = parquet_schema.names + + if columns and any(column not in parquet_columns for column in columns): + return None + + return parquet_file + + def read_table(self, handle, table, columns): + if not columns: + columns = None + + return handle.read(columns).to_pandas() + + def list_tables(self, path): + path = Path(path) + + if not path.exists(): + return [] + + files = list(path.glob(f"*{self.file_extension}")) + return [file.stem for file in files] + + +class _ArrowLoader(_Loader): + output_suffix = "_arwdir" + file_extension = ".arrow" + + def validate_table(self, path, table, columns): + file_path = Path(path) / f"{table}{self.file_extension}" + + if not self._validate_export_time(file_path): + return None + + reader = pa.RecordBatchStreamReader(file_path) + arrow_schema = reader.schema + arrow_columns = arrow_schema.names + + if columns and any(column not in arrow_columns for column in columns): + return None + + return reader + + def read_table(self, handle, table, columns): + df = handle.read_pandas() + return df[columns] if columns else df + + def list_tables(self, path): + path = Path(path) + + if not path.exists(): + return [] + + files = list(path.glob(f"*{self.file_extension}")) + return [file.stem for file in files] + + +class _SqliteLoader(_Loader): + output_suffix = ".sqlite" + file_extension = ".sqlite" + + def validate_tables(self, path, tables): + if not self._validate_export_time(path): + return None + + try: + sql_report = nsysstats.Report(path) + except nsysstats.Report.Error_InvalidDatabaseFile: + return None + + if sql_report is None: + return None + + if tables and any(not sql_report.table_exists(table) for table in tables): + return None + + return sql_report + + def validate_table(self, path, table, columns): + sql_report = self.validate_tables(path, [table]) + + if sql_report is None: + return None + + if columns and any( + not sql_report.table_col_exists(table, column) for column in columns + ): + return None + + return sql_report + + def read_sql_query(self, handle, query): + df = pd.read_sql(query, handle.dbcon) + return df + + def read_table(self, handle, table, columns): + column_query = ",".join(columns) if columns else "*" + query = f"SELECT {column_query} FROM {table}" + return self.read_sql_query(handle, query) + + def list_tables(self, path): + if Path(path) is None: + return [] + + try: + return nsysstats.Report(path).tables + except Exception: + return [] + + +class StatsService: + def __init__(self, report_path): + self._data_service = DataService(report_path) + self._sqlite_file = Path(report_path).with_suffix(".sqlite") + + def _get_stats_class(self, module, class_name): + try: + stats_module_path = f"{nsys_constants.NSYS_REPORT_DIR}.{module}" + module = importlib.import_module(stats_module_path) + except ModuleNotFoundError as e: + try: + rule_module_path = f"{nsys_constants.NSYS_RULE_DIR}.{module}" + module = importlib.import_module(rule_module_path) + except ModuleNotFoundError: + raise exceptions.StatsModuleNotFoundError(e) from e + + return getattr(module, class_name) + + def _setup(self, stats_class, parsed_args): + report, exitval, errmsg = stats_class.Setup(self._sqlite_file, parsed_args) + + if report is not None: + return report + + if exitval == stats_class.EXIT_NODATA: + return None + + raise exceptions.StatsInternalError(errmsg) + + def read_sql_report(self, module, class_name, parsed_args): + stats_class = self._get_stats_class(module, class_name) + report = None + + if self._data_service._get_service("sqlite")._validate_export_time( + self._sqlite_file + ): + report = self._setup(stats_class, parsed_args) + + if report is None: + hints = {"format": "sqlite"} + if not self._data_service.export(None, hints): + return None + + report = self._setup(stats_class, parsed_args) + + if report is None: + return None + + return pd.read_sql(report.get_query(), report.dbcon) + + +class DataService: + def __init__(self, report_path): + if not Path(report_path).exists: + raise FileNotFoundError(f"{report_path} does not exist.") + + self._report_path = Path(report_path) + self._service_instances = {} + + def _create_service(self, format): + loader_map = { + "parquetdir": _ParquetLoader, + "arrowdir": _ArrowLoader, + "sqlite": _SqliteLoader, + } + + if format not in loader_map: + raise NotImplementedError("Invalid format type.") + + return loader_map[format](self._report_path) + + def _get_service(self, format): + if format not in self._service_instances: + self._service_instances[format] = self._create_service(format) + + return self._service_instances[format] + + def _get_output_path(self, hints): + service = self._get_service(hints.get("format", "parquetdir")) + + default_output_path = ( + str(self._report_path.with_suffix("")) + service.output_suffix + ) + return hints.get("path", default_output_path) + + def _get_export_args(self, tables, hints): + format_type = hints.get("format", "parquetdir") + mode = hints.get("mode", "partial") + output_path = self._get_output_path(hints) + + export_args = [ + "--type", + format_type, + "--output", + output_path, + "--force-overwrite", + "true", + "--lazy", + "false", + ] + + if mode == "partial" and tables: + export_args += ["--tables", ",".join(tables)] + + return export_args + + def export(self, tables, hints): + format_type = hints.get("format", "parquetdir") + output_path = self._get_output_path(hints) + + # TODO(DTSP-15985): Support directory of files for SQLite. + # We do not currently offer support for partial exports in SQLite. + # Regardless of the 'table' argument, all tables will always be imported. + if format_type == "sqlite": + tables = None + + if isinstance(tables, str): + tables = [tables] + + export_args = self._get_export_args(tables, hints) + + nsys_exe = nsys_path.find_installed_file(nsys_constants.NSYS_EXE_NAME) + cmd = [nsys_exe, "export", *export_args, self._report_path] + if tables: + logger.info( + f"Exporting {tables} from {self._report_path} to {output_path}..." + ) + else: + logger.info(f"Exporting {self._report_path} to {output_path}...") + + try: + p = subprocess.run(cmd, text=True, capture_output=True) + except Exception as e: + logger.error(f"Failed to export {self._report_path}: {e}") + return False + + if p.returncode: + logger.error(f"Failed to export {self._report_path}: {p.stderr}") + return False + + return True + + def read_tables(self, table_column_dict, hints=None): + """Read tables into dataframes. + + Parameters + ---------- + table_column_dict : dict + Dictionary of tables and columns. + hints : dict + Additional configurations. + """ + if hints is None: + hints = {} + + result_dict = {} + tables_to_export = [] + + output_path = self._get_output_path(hints) + overwrite = hints.get("overwrite", False) + service = self._get_service(hints.get("format", "parquetdir")) + + if not overwrite: + for table, columns in table_column_dict.items(): + handle = service.validate_table(output_path, table, columns) + if handle is not None: + result_dict[table] = service.read_table(handle, table, columns) + else: + tables_to_export.append(table) + else: + tables_to_export = list(table_column_dict.keys()) + + if tables_to_export and not self.export(tables_to_export, hints): + return None + + for table in tables_to_export: + columns = table_column_dict[table] + handle = service.validate_table(output_path, table, columns) + if handle is not None: + result_dict[table] = service.read_table(handle, table, columns) + else: + logger.error( + f"Could not validate '{table}'." + " Please ensure the table and column names are correct or" + " re-try with a recent version of Nsight Systems." + ) + return None + + return result_dict + + def read_sql_query(self, query, tables=None, hints=None): + """Read the SQL query into a dataframe. + + Parameters + ---------- + query : str + SQL query to execute. + tables : list of str or str + If specified, the function will export the tables before executing + the query and check whether the table names are valid. If no + tables are provided, all tables will be exported, and no checks + will be made before executing the query. + hints : dict + Additional configurations. + """ + if hints is None: + hints = {} + + format_type = hints.get("format", "sqlite") + if format_type != "sqlite": + raise NotImplementedError("Invalid format type") + + output_path = self._get_output_path(hints) + overwrite = hints.get("overwrite", False) + service = self._get_service(format_type) + + if isinstance(tables, str): + tables = [tables] + + if not overwrite and tables: + handle = service.validate_tables(output_path, tables) + if handle is not None: + return service.read_sql_query(handle, query) + + if not self.export(tables, hints): + return None + + handle = service.validate_tables(output_path, tables) + if handle is not None: + return service.read_sql_query(handle, query) + + logger.error( + f"Could not validate {tables}." + " Please ensure the table names are correct or" + " re-try with a recent version of Nsight Systems." + ) + + def list_tables(self, hints=None): + """List the available tables in the report file.""" + if hints is None: + hints = {} + + service = self._get_service(hints.get("format", "parquetdir")) + return service.list_tables(self._get_output_path(hints)) + + +def _get_time_cols(df): + if "start" in df.columns: + if "end" in df.columns: + # Time range. + return ("start", "end") + else: + # Point in time. + return ("start", "start") + + if "timestamp" in df.columns: + # Point in time. + return ("timestamp", "timestamp") + elif "rawTimestamp" in df.columns: + # Point in time. + return ("rawTimestamp", "rawTimestamp") + else: + raise NotImplementedError + + +def filter_by_time_range(dfs, start_time=0, end_time=sys.maxsize): + """Filter the dataframe(s) to retain only events that start + or end within the given range. + + Parameters + ---------- + dfs : list of dataframes or dataframe + Dataframes to filter. + start_time : int + Start time of the desired range. + end_time : int + End time of the desired range. + """ + if not isinstance(dfs, list): + dfs = [dfs] + + for df in dfs: + if df.empty: + continue + + start_col, end_col = _get_time_cols(df) + + mask = pd.Series(True, index=df.index) + if end_time is not None: + mask &= df[start_col] <= end_time + if start_time is not None: + mask &= df[end_col] >= start_time + + df.drop(df[~mask].index, inplace=True) + + +def apply_time_offset(dfs, session_offset): + """Synchronize session start times. + + Parameters + ---------- + dfs : list of dataframes or dataframe + Dataframes to filter. + session_offset : int + Offset of the session time + """ + if not isinstance(dfs, list): + dfs = [dfs] + + for df in dfs: + if df.empty: + continue + + start_col, end_col = _get_time_cols(df) + + df.loc[:, start_col] += session_offset + + if start_col != end_col: + df.loc[:, end_col] += session_offset + + +def compute_session_duration(analysis_df, target_info_df, min_session): + profile_duration = analysis_df.at[0, "duration"] + session_time = target_info_df.at[0, "utcEpochNs"] + + session_offset = session_time - min_session + profile_duration += session_offset + + return session_offset, profile_duration + + +def replace_id_with_value(main_df, str_df, id_column): + """Replace the values in 'id_column' of 'main_df' with the corresponding + string value stored in 'str_df'. + + Parameters + ---------- + main_df : dataframe + Dataframe containing 'id_column'. + str_df : dataframe + Dataframe 'StringId' that maps IDs to string values. + id_column : str + Name of the column that should be replaced with the corresponding + string values. + """ + renamed_str_df = str_df.rename(columns={"id": id_column}) + merged_df = main_df.merge(renamed_str_df, on=id_column, how="left") + + # Drop the original 'id_column' column and rename 'value' column to 'id_column'. + merged_df = merged_df.drop(columns=[id_column]) + + merged_df = merged_df.rename(columns={"value": id_column}) + + return merged_df + + +def get_domain_range_df(nvtx_df, domain_name): + """Get push/pop and start/end ranges of the specified domain.""" + domain_df = nvtx_df[ + (nvtx_df["eventType"] == EVENT_TYPE_NVTX_DOMAIN_CREATE) + & (nvtx_df["text"] == domain_name) + ] + + if domain_df.empty: + return domain_df + + domain_id = domain_df["domainId"].iloc[0] + + return nvtx_df[ + (nvtx_df["domainId"] == domain_id) + & ( + nvtx_df["eventType"].isin( + [EVENT_TYPE_NVTX_PUSHPOP_RANGE, EVENT_TYPE_NVTX_STARTEND_RANGE] + ) + ) + ] + + +def combine_text_fields(nvtx_df, str_df): + """Combine the 'text' and 'textId' fields of the NVTX dataframe. + + This function simplifies the lookup process for accessing the event + message. The 'text' field corresponds to the NVTX event message passed + through 'nvtxDomainRegisterString', while the 'textId' field corresponds + to the other case. By merging these fields, we streamline the process of + retrieving the message. + """ + if not nvtx_df["textId"].notnull().any(): + return nvtx_df.copy() + + nvtx_textId_df = replace_id_with_value(nvtx_df, str_df, "textId") + mask = ~nvtx_textId_df["textId"].isna() + nvtx_textId_df.loc[mask, "text"] = nvtx_textId_df.loc[mask, "textId"] + return nvtx_textId_df.drop(columns=["textId"]) + + +def extract_pid(global_id_series): + """Extract the PID from the global ID. + + Parameters + ---------- + global_id_series: series + Either the 'globalPid' or 'globalTid' column of the dataframe. + """ + pid = (global_id_series >> np.array(24)) & 0x00FFFFFF + return pid + + +def combine_api_gpu_dfs(runtime_df, gpu_df): + """Combine the runtime dataframe and the gpu dataframes. + + This function merges all the dataframes based on the 'correlationId'. The + 'start' and 'end' columns of the GPU dataframes are renamed to 'gpu_start' + and 'gpu_end'. + """ + gpu_df["pid"] = extract_pid(gpu_df["globalPid"]) + gpu_df = gpu_df.rename(columns={"start": "gpu_start", "end": "gpu_end"}) + + api_df = runtime_df.copy() + api_df["pid"] = extract_pid(api_df["globalTid"]) + api_df = api_df.merge(gpu_df, on=["correlationId", "pid"], how="inner") + + # Both PID and globalPid can be retrieved from globalTid. + return api_df.drop(columns=["pid", "globalPid"]) diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/format.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/format.py new file mode 100644 index 0000000000000000000000000000000000000000..c91d6e29b7444799b64b3c56e990c82f7707fbd2 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/format.py @@ -0,0 +1,37 @@ +import importlib.util +import subprocess +import sys + +from pathlib import Path + + +def run_python_command(cmd, errmsg=""): + cmd = [sys.executable, "-m"] + cmd + result = subprocess.run(cmd) + + if result.returncode != 0: + sys.exit(errmsg) + + +def install_package(): + spec = importlib.util.find_spec("black") + if spec is not None: + return + + run_python_command( + ["pip", "install", "black"], "Failed to install 'black' package." + ) + + +def format(): + recipe_pkg_dir = Path(__file__).parent + run_python_command(["black", recipe_pkg_dir], "Failed to format.") + + +def main(): + install_package() + format() + + +if __name__ == "__main__": + main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/install.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/install.py new file mode 100644 index 0000000000000000000000000000000000000000..26fc8927211a186c1581540b67fcd26528290ed2 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/install.py @@ -0,0 +1,240 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import argparse +import glob +import os +import platform +import shutil +import subprocess +import sys +import tarfile + +from pathlib import Path + +import nsys_constants + +DEPS_DIR = "recipe-deps" + + +def parse_args(): + parser = argparse.ArgumentParser( + formatter_class=argparse.RawTextHelpFormatter, + description="Install Recipe dependencies", + ) + + group = parser.add_mutually_exclusive_group(required=True) + group.add_argument( + "--current", + action="store_true", + help="""Install packages in the current environment +If a venv is active, packages will be installed there. +Otherwise, packages will be installed in the system +site-packages directory. It enables usage of 'nsys recipe' +without having to activate a virtual environment. However, new +packages risk colliding with existing ones if different +versions are required.""", + ) + group.add_argument( + "--venv", + metavar="PATH", + type=str, + help="""Install packages in a virtual environment +If it doesn't already exist, it is created. It prevents risk +of package collision in the current environment but requires +the virtual environment to be activated before running +'nsys recipe'.""", + ) + + group.add_argument( + "--tar", action="store_true", help="Download wheel packages online and tar" + ) + parser.add_argument( + "--untar", action="store_true", help="Untar the wheel packages and install" + ) + parser.add_argument( + "--no-common", + dest="common", + action="store_const", + const=[], + default=["-r", nsys_constants.NSYS_RECIPE_REQ_COMMON_PATH], + help="Do not install common requirements", + ) + parser.add_argument( + "--no-jupyter", + dest="jupyter", + action="store_const", + const=[], + default=["-r", nsys_constants.NSYS_RECIPE_REQ_JUPYTER_PATH], + help="Do not install requirements for Jupyter Notebook", + ) + parser.add_argument( + "--no-dask", + dest="dask", + action="store_const", + const=[], + default=["-r", nsys_constants.NSYS_RECIPE_REQ_DASK_PATH], + help="Do not install requirements for Dask", + ) + parser.add_argument("--quiet", action="store_true", help="Only display errors") + + parsed_args = parser.parse_args() + if parsed_args.tar and parsed_args.untar: + parser.error( + "the '--untar' option cannot be used with the '--tar' option" + " and requires either the '--current' option or the '--venv' option" + ) + + return parser.parse_args() + + +def run_python_command(args, cmd, errmsg="", verbose=True): + cmd = [args.python, "-m"] + cmd + + if args.quiet or not verbose: + result = subprocess.run(cmd, stdout=subprocess.DEVNULL) + else: + result = subprocess.run(cmd) + + if result.returncode != 0: + sys.exit(errmsg) + + +def check_env(args): + args.python = sys.executable + + run_python_command(args, ["pip", "--version"], "pip not available.", verbose=False) + + current_venv = os.getenv("VIRTUAL_ENV") + if args.venv is not None and current_venv is not None: + sys.exit( + f"The venv {current_venv} is already active." + " Please use the '--current' option to install packages there," + " or deactivate it to use the '--venv' option." + ) + + +def prepare_env(args): + if args.venv is not None: + # Create requested venv. + run_python_command(args, ["venv", args.venv], "venv not available.") + + python_exe = Path(args.python).name + if platform.system() == "Windows": + args.python = Path(args.venv) / "Scripts" / python_exe + elif platform.system() == "Linux": + args.python = Path(args.venv) / "bin" / python_exe + + if not args.python.exists(): + sys.exit("Failed to use venv.") + + # Upgrade pip to make sure all packages are available. + run_python_command( + args, ["pip", "install", "--upgrade", "pip"], "Failed to upgrade pip." + ) + + +def tar_deps(args): + deps_tar = f"{DEPS_DIR}.tar.gz" + if Path(deps_tar).is_file(): + print(f"{DEPS_DIR}.tar.gz already exists.") + return + + run_python_command( + args, + ["pip", "download", "-d", DEPS_DIR] + args.common + args.jupyter + args.dask, + "Failed to download packages.", + ) + + with tarfile.open(deps_tar, "w:gz") as tar: + tar.add(DEPS_DIR) + + shutil.rmtree(DEPS_DIR) + + print(f"{DEPS_DIR}.tar.gz created.") + + +def untar_deps(args): + deps_tar = f"{DEPS_DIR}.tar.gz" + if not Path(deps_tar).is_file(): + sys.exit( + f"{DEPS_DIR}.tar.gz does not exist. Please download it using the --tar option." + ) + + prepare_env(args) + + with tarfile.open(deps_tar, "r:gz") as tar: + tar.extractall() + + files = glob.glob(f"{DEPS_DIR}/*") + run_python_command( + args, ["pip", "install", "--no-index"] + files, "Failed to install packages." + ) + + +def install_deps(args): + prepare_env(args) + + run_python_command( + args, + ["pip", "install"] + args.common + args.jupyter + args.dask, + "Failed to install packages.", + ) + + +def venv_activation_command(args): + if platform.system() == "Windows": + return Path(f'"{args.venv}"') / "Scripts" / "activate.bat" + elif platform.system() == "Linux": + bash_cmd = Path(f"'{args.venv}'") / "bin" / "activate" + return f"source {bash_cmd}" + return None + + +def print_message(args): + if args.quiet: + return + + current_venv = os.getenv("VIRTUAL_ENV") + if args.venv is not None: + print(f"Success: Packages were installed in the venv '{args.venv}'.") + + cmd = venv_activation_command(args) + if cmd is not None: + print( + "Activate the venv with this command before running 'nsys recipe':\n" + f"{cmd}" + ) + elif current_venv is not None: + print( + f"Success: Packages were installed in the current venv '{current_venv}'.\n" + "It is required to be active before running 'nsys recipe'." + ) + else: + print("Success: Packages were installed in the system site-packages directory.") + + +def main(): + args = parse_args() + check_env(args) + + if args.tar: + tar_deps(args) + + if args.untar: + untar_deps(args) + print_message(args) + elif not args.tar: + install_deps(args) + print_message(args) + + +if __name__ == "__main__": + main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/__init__.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..76c6d0f97c72d70f518733a18395ff0253da703d --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/__init__.py @@ -0,0 +1,18 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +from nsys_recipe.lib import args +from nsys_recipe.lib import helpers +from nsys_recipe.lib import nsys_path +from nsys_recipe.lib import recipe +from nsys_recipe.lib import recipe_loader + +from nsys_recipe.lib.exceptions import * +from nsys_recipe.lib.recipe import * diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/args.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/args.py new file mode 100644 index 0000000000000000000000000000000000000000..8b32b1031fd365080a50bb95615ee1408c49aa9f --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/args.py @@ -0,0 +1,340 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import argparse +import glob +import os +import socket +import sys +import textwrap + +from enum import Enum + +from nsys_recipe.lib import recipe +from nsys_recipe.log import logger + + +def _replace_range(name, start_index, end_index, value): + return name[:start_index] + str(value) + name[end_index + 1 :] + + +def _substitute_env_var(name, index): + pos = index + 1 + if pos >= len(name) or name[pos] != "{": + logger.error("Missing '{' token after '%q' expression.") + return name, len(name) + + pos += 1 + end = name.find("}", pos) + if end == -1: + logger.error("Missing '}' token after '%q{' expression.") + return name, len(name) + + env_var = name[pos:end] + value = os.getenv(env_var) + + if value is None: + logger.warning(f"Environment variable '{env_var}' is not set.") + return name, end + 1 + + start = index - 1 + return _replace_range(name, start, end, value), start + len(value) + + +def _substitute_hostname(name, index): + try: + hostname = socket.gethostname() + except socket.error as e: + logger.warning(f"Unable to get host name: {e}") + hostname = "" + + start = index - 1 + end = start + 1 + return _replace_range(name, start, end, hostname), start + len(hostname) + + +def _substitute_pid(name, index): + pid = os.getpid() + start = index - 1 + end = start + 1 + return _replace_range(name, start, end, pid), start + len(str(pid)) + + +def _substitute_counters(name, counter_indices): + if not counter_indices: + return name + + orig_name = name + for num in range(1, sys.maxsize): + name = orig_name + for index in reversed(counter_indices): + name = _replace_range(name, index, index + 1, num) + if not os.path.exists(name): + return name + num += 1 + + raise ValueError("Maximum limit reached. Unable to find an available output name.") + + +def process_output(name): + counter_indices = [] + + index = name.find("%") + while index != -1: + index += 1 + if index >= len(name): + logger.error("Unterminated " % " expression.") + return name + + token = name[index] + if token == "q": + name, index = _substitute_env_var(name, index) + elif token == "h": + name, index = _substitute_hostname(name, index) + elif token == "p": + name, index = _substitute_pid(name, index) + elif token == "n": + counter_indices.append(index - 1) + elif token == "%": + name = _replace_range(name, index, index, "") + else: + logger.error(f"Unknown expression '%{token}'.") + + index = name.find("%", index) + + return _substitute_counters(name, counter_indices) + + +def process_directory(report_dir): + files = [] + + report_dir = os.path.abspath(report_dir) + for ext in ("*.nsys-rep", "*.qdrep"): + files.extend(glob.glob(os.path.join(report_dir, ext))) + + if not files: + raise argparse.ArgumentTypeError("No nsys-rep files found.") + + return files + + +def process_input(path): + extensions = (".qdrep", ".nsys-rep") + n = None + + if ":" in path: + path, n = path.split(":") + try: + n = int(n) + except ValueError as e: + raise argparse.ArgumentTypeError("'n' must be an integer.") from e + + if os.path.isfile(path): + if n is not None: + raise argparse.ArgumentTypeError( + "The ':n' syntax cannot be used for files." + ) + if not path.endswith(extensions): + raise argparse.ArgumentTypeError(f"{path} is not a nsys-rep file.") + return path + + if os.path.isdir(path): + files = sorted( + file + for extension in extensions + for file in glob.glob(os.path.join(path, f"*{extension}")) + ) + if not files: + raise argparse.ArgumentTypeError(f"{path} does not contain nsys-rep files.") + return files[:n] + + raise argparse.ArgumentTypeError(f"{path} does not exist.") + + +def process_bin(value_str): + try: + value = int(value_str) + except ValueError: + raise argparse.ArgumentTypeError(f"invalid int value: '{value_str}'") + + if value < 1: + raise argparse.ArgumentTypeError("value must be greater than 1") + return value + + +class TextHelpFormatter(argparse.HelpFormatter): + """This class is similar to argparse.RawDescriptionHelpFormatter, but + retains line breaks when formatting the help message.""" + + def _fill_text(self, text, width, indent=""): + lines = text.splitlines() + a = [ + textwrap.fill(line, width, initial_indent=indent, subsequent_indent=indent) + for line in lines + ] + return "\n".join(a) + + def _split_lines(self, text, width): + return self._fill_text(text, width).split("\n") + + +class Option(Enum): + """Common recipe options""" + + OUTPUT = 0 + FORCE_OVERWRITE = 1 + ROWS = 2 + START = 3 + END = 4 + NVTX = 5 + BASE = 6 + MANGLED = 7 + BINS = 8 + CSV = 9 + INPUT = 10 + + +class ModeAction(argparse.Action): + def __init__(self, **kwargs): + kwargs.setdefault( + "choices", + tuple(mode.name.replace("_", "-").lower() for mode in recipe.Mode), + ) + super().__init__(**kwargs) + + def __call__(self, parser, namespace, values, option_string=None): + value = recipe.Mode[values.replace("-", "_").upper()] + setattr(namespace, self.dest, value) + + +class InputAction(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + # Remove any inner lists. + flattened_list = [] + for value in values: + if isinstance(value, list): + flattened_list.extend(value) + else: + flattened_list.append(value) + setattr(namespace, self.dest, flattened_list) + + +class ArgumentParser(argparse.ArgumentParser): + """Custom argument parser with predefined arguments""" + + def __init__(self, **kwargs): + super().__init__(**kwargs) + self._context_group = self.add_argument_group("Context") + self._recipe_group = self.add_argument_group("Recipe") + + @property + def recipe_group(self): + return self._recipe_group + + def add_recipe_argument(self, option, *args, **kwargs): + self.add_argument_to_group(self._recipe_group, option, *args, **kwargs) + + def add_argument_to_group(self, group, option, *args, **kwargs): + if not isinstance(option, Option): + group.add_argument(option, *args, **kwargs) + return + + if option == Option.OUTPUT: + group.add_argument( + "--output", + type=process_output, + help="Output directory name.\n" + "Any %%q{ENV_VAR} pattern in the filename will be substituted with the value of the environment variable.\n" + "Any %%h pattern in the filename will be substituted with the hostname of the system.\n" + "Any %%p pattern in the filename will be substituted with the PID.\n" + "Any %%n pattern in the filename will be substituted with the minimal positive integer that is not already occupied.\n" + "Any %%%% pattern in the filename will be substituted with %%", + **kwargs, + ) + elif option == Option.FORCE_OVERWRITE: + group.add_argument( + "--force-overwrite", + action="store_true", + help="Overwrite existing directory", + **kwargs, + ) + elif option == Option.ROWS: + group.add_argument( + "--rows", + metavar="limit", + type=int, + default=-1, + help="Maximum number of rows per input file", + **kwargs, + ) + elif option == Option.START: + group.add_argument( + "--start", + metavar="time", + type=int, + help="Start time used for filtering in nanoseconds", + **kwargs, + ) + elif option == Option.END: + group.add_argument( + "--end", + metavar="time", + type=int, + help="End time used for filtering in nanoseconds", + **kwargs, + ) + elif option == Option.NVTX: + group.add_argument( + "--nvtx", + metavar="range[@domain]", + type=str, + help="NVTX range and domain used for filtering", + **kwargs, + ) + elif option == Option.BASE: + group.add_argument( + "--base", action="store_true", help="Kernel base name", **kwargs + ) + elif option == Option.MANGLED: + group.add_argument( + "--mangled", action="store_true", help="Kernel mangled name", **kwargs + ) + elif option == Option.BINS: + group.add_argument( + "--bins", type=process_bin, default=30, help="Number of bins", **kwargs + ) + elif option == Option.CSV: + group.add_argument( + "--csv", + action="store_true", + help="Additionally output data as CSV", + **kwargs, + ) + elif option == Option.INPUT: + group.add_argument( + "--input", + type=process_input, + default=None, + nargs="+", + action=InputAction, + help="One or more paths to nsys-rep files or directories.\n" + "Directories can optionally be followed by ':n' to limit the number of files", + **kwargs, + ) + else: + raise NotImplementedError + + def add_context_arguments(self): + self._context_group.add_argument( + "--mode", + action=ModeAction, + default=recipe.Mode.CONCURRENT, + help="Mode to run tasks", + ) diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/collective_loader.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/collective_loader.py new file mode 100644 index 0000000000000000000000000000000000000000..049818d2f8c133eb868ca4da9230a75e10f5b4de --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/collective_loader.py @@ -0,0 +1,77 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +from nsys_recipe.data_service import DataService +from nsys_recipe.lib import exceptions + + +def filter_mapper_results(mapper_res): + """Filter empty results along with their associated report files. + + Returns + ------- + filtered_files : list of str + List of report files with non-empty data. This can be used + instead of the original files to avoid duplicated warning/error + messages when reading the same table afterwards. + filtered_res: list + List of non-empty results. + """ + filtered_res = [] + filtered_files = [] + + for file, res in mapper_res: + if res is not None: + filtered_res.append(res) + filtered_files.append(file) + + if not filtered_res: + raise exceptions.NoDataError + return filtered_files, filtered_res + + +class ProfileInfo: + @staticmethod + def mapper_func(report_path): + service = DataService(report_path) + + table_column_dict = { + "ANALYSIS_DETAILS": ["duration"], + "TARGET_INFO_SESSION_START_TIME": ["utcEpochNs"], + } + + df_dict = service.read_tables(table_column_dict) + if df_dict is None: + return None, None + + profile_duration = df_dict["ANALYSIS_DETAILS"].at[0, "duration"] + session_time = df_dict["TARGET_INFO_SESSION_START_TIME"].at[0, "utcEpochNs"] + + return report_path, (profile_duration, session_time) + + @staticmethod + def reducer_func(mapper_res): + profile_durations, session_times = zip(*mapper_res) + + min_session = min(session_times) + profile_durations = [ + duration + (session - min_session) for duration, session in mapper_res + ] + + return max(profile_durations), min_session + + @staticmethod + def get_profile_info(context, input): + """Get the maximum profile duration and the minimum session time.""" + mapper_res = context.wait(context.map(ProfileInfo.mapper_func, input)) + filtered_files, filtered_res = filter_mapper_results(mapper_res) + max_duration, min_session = ProfileInfo.reducer_func(filtered_res) + + return max_duration, min_session, filtered_files diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/exceptions.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..58a19182c7efc2af8f1ea37188501bbd640eb2ac --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/exceptions.py @@ -0,0 +1,33 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + + +class RecipeException(Exception): + """A base Exception class for all Recipe exceptions to inherit from.""" + + +class ModeModuleNotFoundError(RecipeException): + pass + + +class StatsModuleNotFoundError(RecipeException): + pass + + +class StatsInternalError(RecipeException): + pass + + +class NoDataError(RecipeException): + pass + + +class ValueError(RecipeException): + pass diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/heatmap.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/heatmap.py new file mode 100644 index 0000000000000000000000000000000000000000..24c060bfdb5f75bc184059cd460812feb40587e2 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/heatmap.py @@ -0,0 +1,173 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import math +import numpy as np +import pandas as pd + + +def get_bin_size(bin_number, max_duration): + return math.ceil(max_duration / bin_number) + + +def generate_bin_list(bin_number, bin_size, include_last=False): + """Generates a list of values determining the boundaries of each bin. + + Parameters + ---------- + bin_number : int + Total number of bins in the generated list. + bin_size : int + Size of each bin. + include_last : bool + Whether the maximum bin boundary should be included or not. + """ + bin_count = bin_number + 1 if include_last else bin_number + return [bin_size * i for i in range(bin_count)] + + +def group_overlapping_ranges(range_df): + """Assign unique group identifiers to overlapping ranges.""" + df = range_df.sort_values("start") + cumulative_max_end = df["end"].cummax() + groups = (df["start"] > cumulative_max_end.shift()).cumsum() + return groups + + +def consolidate_ranges(range_df): + """Consolidate overlapping time ranges. + + For each set of overlapping ranges, only the earliest start time and latest + end time will be retained. + """ + groups = group_overlapping_ranges(range_df) + return range_df.groupby(groups).agg({"start": "min", "end": "max"}) + + +def _calculate_bin_info(starts, ends, bin_size): + # Scale the start and end times by the bin size. + start_scaled = starts / bin_size + end_scaled = ends / bin_size + + # Calculate the bin index for each start and end. + start_bins = np.floor(start_scaled).astype(int) + end_bins = np.floor(end_scaled).astype(int) + + # Calculate the clipped start and end values to ensure they don't exceed + # the bin boundaries. + ends = np.minimum(np.ceil(start_scaled), end_scaled) + starts = np.maximum(np.floor(end_scaled), start_scaled) + + # Calculate the coverage percentage. + start_percents = ends - start_scaled + end_percents = end_scaled - starts + + return start_bins, end_bins, start_percents, end_percents + + +def _rectify_pct_inplace(bin_pcts, bin_size, profile_duration, session_offset): + # Any portion of the bins that is outside the profiling session will be + # removed. + start_bin, end_bin, start_percent, end_percent = _calculate_bin_info( + session_offset, profile_duration, bin_size + ) + + if start_percent != 0: + bin_pcts[start_bin] /= start_percent + if end_percent != 0 and start_bin != end_bin: + bin_pcts[end_bin] /= end_percent + + # Set values outside the profiling session to NaN. + bin_pcts[end_bin + 1 :] = np.nan + bin_pcts[:start_bin] = np.nan + + +def get_zero_bin_pcts(bin_size, bin_num, profile_duration, session_offset): + """Fill each bin with zero.""" + bin_pcts = np.zeros(bin_num) + _rectify_pct_inplace(bin_pcts, bin_size, profile_duration, session_offset) + return bin_pcts + + +def calculate_bin_pcts( + df, bin_size, bin_num, profile_duration, session_offset, value_key=None +): + """Calculate the percentage for each bin.""" + values = df[value_key] if value_key else np.ones(df.shape[0]) + + start_bins, end_bins, start_percents, end_percents = _calculate_bin_info( + df["start"], df["end"], bin_size + ) + + # Handle cases where the range falls in a single bin. + # In this case, either the start or the end arrays can be used. + single_bin_indices = np.where(end_bins == start_bins)[0] + bin_pcts = np.bincount( + start_bins[single_bin_indices], + weights=start_percents[single_bin_indices] * values[single_bin_indices], + minlength=bin_num, + ).astype(float) + + # Handle cases where the range spans multiple bins. + # We add the percentages individually for each bin. + multi_bin_indices = np.where(end_bins != start_bins)[0] + for i in multi_bin_indices: + bin_pcts[end_bins[i]] += end_percents[i] * values[i] + bin_pcts[start_bins[i]] += start_percents[i] * values[i] + bin_pcts[start_bins[i] + 1 : end_bins[i]] += values[i] + + _rectify_pct_inplace(bin_pcts, bin_size, profile_duration, session_offset) + + return (bin_pcts * 100).round(1) + + +def calculate_overlapping_ranges(df1, df2): + """Calculate overlapping ranges from two dataframes.""" + df1["type"] = "df1" + df2["type"] = "df2" + + all_df = pd.concat([df1, df2]).reset_index(drop=True) + all_df["group"] = group_overlapping_ranges(all_df) + + group_df1 = all_df[all_df["type"] == "df1"] + group_df2 = all_df[all_df["type"] == "df2"] + + df1 = df1.drop(columns=["type"]) + df2 = df2.drop(columns=["type"]) + + # Ranges that have no shared groups are excluded, as they cannot overlap + # with other ranges. + merged_df = pd.merge(group_df1, group_df2, on="group", suffixes=("_df1", "_df2")) + + start1 = merged_df["start_df1"].values + end1 = merged_df["end_df1"].values + + start2 = merged_df["start_df2"].values + end2 = merged_df["end_df2"].values + + overlap_start = np.maximum(start1[:, np.newaxis], start2) + overlap_end = np.minimum(end1[:, np.newaxis], end2) + + overlap_start = overlap_start.reshape(-1) + overlap_end = overlap_end.reshape(-1) + + differences = overlap_end - overlap_start + mask = differences > 0 + + overlap_start = overlap_start[mask] + overlap_start = np.unique(overlap_start) + + overlap_end = overlap_end[mask] + overlap_end = np.unique(overlap_end) + + if len(overlap_start) != len(overlap_end): + raise RuntimeError("Start and end counts do not match.") + + return pd.DataFrame({"start": overlap_start, "end": overlap_end}) diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/helpers.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/helpers.py new file mode 100644 index 0000000000000000000000000000000000000000..8cdb21cb05f0b8d05c19e923a88a08625fc0fc71 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/helpers.py @@ -0,0 +1,48 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import numpy as np + +from nsys_recipe.lib import exceptions + + +def filter_none(dfs): + """Remove Nones from the dataframe list. + + If the list only contains Nones or empty dataframes, raise an exception. + """ + dfs = [df for df in dfs if df is not None and len(df) != 0] + if not dfs: + raise exceptions.NoDataError + return dfs + + +def stddev(group_df, series_dict, n_col_name="Instances"): + """Calculate the standard deviation out of aggregated values. + + Parameters + ---------- + group_df : dataframe + Subset of data sharing a common grouping key. It contains values before + the overall aggregation. + series_dict : dict + Dictionary of series containing the overall aggregated values. + n_col_name : str + Name of the column representing population size. + """ + instance = series_dict[n_col_name].loc[group_df.name] + if instance <= 1: + return group_df["StdDev"].iloc[0] + + var_sum = np.dot(group_df[n_col_name] - 1, group_df["StdDev"] ** 2) + deviation = group_df["Avg"] - series_dict["Avg"].loc[group_df.name] + dev_sum = np.dot(group_df[n_col_name], deviation**2) + variance = (var_sum + dev_sum) / (instance - 1) + return (variance**0.5).round(1) diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/nsys_display.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/nsys_display.py new file mode 100644 index 0000000000000000000000000000000000000000..81633a8deb1c618ddaf9511c9ff86603f5f13735 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/nsys_display.py @@ -0,0 +1,204 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd +import plotly.graph_objects as go +import plotly.express as px +from plotly.subplots import make_subplots + +from ipywidgets import Dropdown, interact + + +def get_stats_cols(df): + column_names_set = set(df.columns) + q1 = "Q1" if "Q1" in column_names_set else "Q1 (approx)" + q3 = "Q3" if "Q3" in column_names_set else "Q3 (approx)" + + if "Med" in column_names_set: + med = "Med" + elif "Median" in column_names_set: + med = "Median" + else: + med = "Median (approx)" + + if "StdDev" in column_names_set: + std = "StdDev" + elif "Std" in column_names_set: + std = "Std" + else: + std = "Std (approx)" + + return q1, med, q3, std + + +def display_box(df, x=None, **layout_args): + if x is None: + x = df.index + + q1, med, q3, std = get_stats_cols(df) + + fig = go.Figure() + fig.add_trace( + go.Box( + x=x, + q1=df[q1], + median=df[med], + q3=df[q3], + lowerfence=df["Min"], + upperfence=df["Max"], + sd=df[std], + ) + ) + + fig.update_layout(**layout_args) + fig.show() + + +def display_stats_scatter(df, x=None, **layout_args): + if x is None: + x = df.index + + fig = go.Figure() + + q1, med, q3, _ = get_stats_cols(df) + col_names = [q1, med, q3, "Min", "Max"] + + for name in col_names: + fig.add_trace(go.Scatter(x=x, y=df[name], name=name)) + + fig.update_layout(**layout_args) + fig.show() + + +def display_table_per_rank(df): + if df.empty: + display(df) + return + + report_groups = df.groupby("File") + + def display_table(name): + report_df = report_groups.get_group(name) + report_df = report_df.drop(columns=["File"]) + display(report_df) + + dropdown = Dropdown( + options=report_groups.groups.keys(), layout={"width": "max-content"} + ) + + interact(display_table, name=dropdown) + + +def display_stats_per_operation( + df, x=None, box=True, scatter=True, table=True, **layout_args +): + if df.empty: + display(df) + return + + if x is None: + x = df.index + + op_groups = df.groupby(x) + + def display_graphs(name): + op_df = op_groups.get_group(name) + if table: + display(op_df.reset_index(drop=True).set_index("File")) + if box: + display_box(op_df, x=op_df["File"], **layout_args) + if scatter: + display_stats_scatter(op_df, x=op_df["File"], **layout_args) + + operations = list(op_groups.groups.keys()) + + # Plot is not being displayed for the default dropdown value. If there is + # only one element, do not create the dropdown. Otherwise, set it to the + # second element before resetting to the first one. + if len(operations) > 1: + dropdown = Dropdown( + options=operations, layout={"width": "max-content"}, value=operations[1] + ) + interact(display_graphs, name=dropdown) + dropdown.value = operations[0] + elif len(operations) == 1: + display_graphs(operations[0]) + + +def display_summary_graph(df, value_col, **layout_args): + fig = px.line(df.groupby("Duration")[value_col].mean()) + fig.update_layout(**layout_args) + fig.show() + + +def _get_heatmap_height(name_count, plot_count=1): + if name_count < 9: + name_count = 9 + return (name_count * 27 + 110) * plot_count + + +def display_heatmaps( + df, types, xaxis_title, yaxis_title, zaxis_title, zmax=100, **layout_args +): + unique_name_count = df["Name"].nunique() + height = _get_heatmap_height(unique_name_count, len(types)) + + fig = make_subplots( + len(types), 1, subplot_titles=types, vertical_spacing=150 / height + ) + + for index, type in enumerate(types): + fig.add_trace( + go.Heatmap( + x=df["Duration"], + y=df["Name"], + z=df[type], + showscale=False, + zmax=zmax, + zauto=False, + ), + index + 1, + 1, + ) + + fig.update_layout(height=height, **layout_args) + fig.update_xaxes(title=xaxis_title) + fig.update_yaxes( + title=yaxis_title, categoryorder="category descending", nticks=unique_name_count + ) + fig.update_traces({"colorbar": {"title_text": zaxis_title}}, showscale=True, row=0) + fig.update_traces( + hovertemplate=f"{xaxis_title}: %{{x}}
{yaxis_title}: %{{y}}
{zaxis_title}: %{{z}}" + ) + fig.show() + + +def display_heatmap( + df, value_col, xaxis_title, yaxis_title, zaxis_title, zmax=100, **layout_args +): + fig = px.imshow( + df.pivot(index="Name", columns="Duration")[value_col], range_color=(0, zmax) + ) + + unique_name_count = df["Name"].nunique() + fig.update_layout( + height=_get_heatmap_height(unique_name_count), + coloraxis_colorbar_title=zaxis_title, + **layout_args, + ) + fig.update_xaxes(title=xaxis_title) + fig.update_yaxes( + title=yaxis_title, categoryorder="category descending", nticks=unique_name_count + ) + fig.update_traces( + hovertemplate=f"{xaxis_title}: %{{x}}
{yaxis_title}: %{{y}}
{zaxis_title}: %{{z}}" + ) + + fig.show() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/nsys_path.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/nsys_path.py new file mode 100644 index 0000000000000000000000000000000000000000..a85cb919a5143049a06a5fcb186d94e01753908d --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/nsys_path.py @@ -0,0 +1,55 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import os + +from pathlib import Path + +from nsys_recipe import nsys_constants +from nsys_recipe.lib import exceptions + + +def get_install_dir(): + """Return the Nsys install directory path. + + If the env var NSYS_DIR is set, return that. + If not, deduce it from the current file path. + """ + nsysdir = os.getenv("NSYS_DIR") + if nsysdir is not None: + return nsysdir + + parents = Path(__file__).parents + if len(parents) >= 6: + return str(parents[5].resolve()) + + return None + + +def find_installed_file(relative_path): + """Return the full path of the file located in the target or host + directory.""" + install_dir = get_install_dir() + + if install_dir is not None: + candidate_dirs = ( + nsys_constants.NSYS_TARGET_DIR, + nsys_constants.NSYS_HOST_DIR, + "", + ) + for candidate_dir in candidate_dirs: + candidate = Path(install_dir) / candidate_dir / relative_path + if candidate.exists(): + return str(candidate) + + raise exceptions.ValueError( + f"Cannot find '{relative_path}'." + " Please set NSYS_DIR to a valid Nsys install directory that contains internal dependencies." + ) diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/nsys_pres.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/nsys_pres.py new file mode 100644 index 0000000000000000000000000000000000000000..8074e5f4f161db4f22ba071feb62c6441980513b --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/nsys_pres.py @@ -0,0 +1,449 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pickle +import importlib +import os +import sys +import glob +import math +import re +from collections import deque +import pandas as pd +import numpy as np +import sqlite3 + +import concurrent.futures + +# import nsys_rep +# import nvtx +# import multinode_loader + +k_nanoseconds2milliseconds = 1000000 + + +k_nvtx_start = "gpu_start" +k_nvtx_end = "gpu_end" +k_nvtx_duration = "gpu_duration" +k_nvtx_text = "text" + + +k_nvtx_stats_count = "Count" +k_nvtx_stats_sum = "Sum" +k_nvtx_stats_min = "Min" +k_nvtx_stats_max = "Max" +k_nvtx_stats_mean = "Mean" +k_nvtx_stats_median = "Median" +# k_nvtx_stats_std = 'StdDev' +k_nvtx_stats_q1 = "Q1" +k_nvtx_stats_q3 = "Q3" +k_nvtx_stats_rank = "Rank" + + +# DTSP-14650: Code cleanup +def display_column_graph( + figs, + vis_df, + columnName, + title="", + xaxis_title="Rank", + yaxis_title="Time", + legend_title="Legend", +): + k_nanoseconds2milliseconds = 1000000 + ranks_ds = vis_df[k_nvtx_stats_rank] + column_ds = pd.Series(vis_df[columnName].values / k_nanoseconds2milliseconds) + + return __display_graph( + figs, + ranks_ds, # x_axis + column_ds, # y_axes + title=" ".join([title, columnName]), + xaxis_title=xaxis_title, + yaxis_title=yaxis_title, + legend_title=legend_title, + ) + + +def display_pace_graph( + figs, + fileDir, + tableName, # nsys_rep.k_table_nvtx + selectRowByColumnName, # k_nvtx_text + selectRowByColumnValue, # ex: a particular NVTX range name like ncclAllReduce + paceColumnName, # ex: start, end, gpu_start, gpu_end + wall_adjust=True, + title=None, + xaxis_title="Ranks", + yaxis_title="Time", + legend_title="Steps", +): + session_start_min = sys.maxsize + # session_start_list = list() + if wall_adjust == True: + for fileData in fileDir: + session_df = fileData[nsys_rep.k_table_session_start] + session_start = session_df.at[0, "utcEpochNs"] + if session_start < session_start_min: + session_start_min = session_start + + pace_ds_list = list() + table_gdf_list = list() # for pacing + for fileData in fileDir: + table_df = fileData[tableName] + + table_df = table_df.loc[ + (table_df[paceColumnName].isna() == False) + & (table_df[selectRowByColumnName] == selectRowByColumnValue) + ] + + if wall_adjust == True: + session_df = fileData[nsys_rep.k_table_session_start] + session_offset = session_df.at[0, "utcEpochNs"] - session_start_min + table_df["session_offset"] = session_offset + table_df[paceColumnName] = ( + table_df[paceColumnName] + table_df["session_offset"] + ) + + pace_ds = table_df[paceColumnName].values + pace_ds_list.append(pace_ds) + pace_df = pd.DataFrame(pace_ds_list) + + import warnings + + warnings.filterwarnings("ignore") + fig = pace_df.plot.line(orientation="v") + fig.update_layout( + xaxis_title=xaxis_title, + yaxis_title=yaxis_title, + legend_title=legend_title, + title=( + title + if (title != None) + else (" ".join(["Pace of", selectRowByColumnValue, paceColumnName])) + ), + ) + fig.show() + + if figs != None: + figs.append(fig) + + display("Each line represents how long it took a rank to reach this point in time.") + return fig + + +def display_boxplots_grouped( + figs, + stats_groups, + orientation="v", + title=None, + xaxis_title="Names", + yaxis_title="Time", + legend_title="Legend", +): + # if we wanted outliers + # The lower fence is at x = Q1 - 1.5 * IQR. + # The upper fence is at x = Q3 + I.5 * IQR. + # The IQR is the interquartile range: IQR = Q3 - Q1. + # Since the IQR is the length of the box in the boxplot, + # outliers are data that is more than 1.5 boxlengths + # from the boxplot box. + mean_ds = stats_groups["Mean"].mean() + min_ds = stats_groups["Min"].min() + q1_ds = stats_groups["Q1"].min() + q3_ds = stats_groups["Q3"].max() + max_ds = stats_groups["Max"].max() + median_ds = stats_groups["Median"].median() + index = list(stats_groups.groups.keys()) + + return display_boxplot( + figs, + index, + min_ds, + q1_ds, + median_ds, + q3_ds, + max_ds, + mean_ds=mean_ds, + orientation=orientation, + title=title, + xaxis_title=xaxis_title, + ) + + +def display_boxplots_df( + figs, + stats_df, + orientation="v", + title=None, + xaxis_title="Names", + yaxis_title="Time", + legend_title="Legend", +): + # if we wanted outliers + # The lower fence is at x = Q1 - 1.5 * IQR. + # The upper fence is at x = Q3 + I.5 * IQR. + # The IQR is the interquartile range: IQR = Q3 - Q1. + # Since the IQR is the length of the box in the boxplot, + # outliers are data that is more than 1.5 boxlengths + # from the boxplot box. + mean_ds = stats_df.get("Mean", None) + if mean_ds is None: + mean_ds = stats_df.get("mean", None) + + min_ds = stats_df.get("Min", None) + if min_ds is None: + min_ds = stats_df.get("min", None) + + max_ds = stats_df.get("Max", None) + if max_ds is None: + max_ds = stats_df.get("max", None) + + q1_ds = stats_df.get("Q1", None) + if q1_ds is None: + q1_ds = stats_df.get("Q1 (approx)", None) + if q1_ds is None: + q1_ds = stats_df["25%"] + + median_ds = stats_df.get("Median") + if median_ds is None: + median_ds = stats_df.get("Median (approx)", None) + if median_ds is None: + median_ds = stats_df["50%"] + + q3_ds = stats_df.get("Q3", None) + if q3_ds is None: + q3_ds = stats_df.get("Q3 (approx)", None) + if q3_ds is None: + q3_ds = stats_df["75%"] + + index = stats_df.index + + return display_boxplot( + figs, + index, + min_ds, + q1_ds, + median_ds, + q3_ds, + max_ds, + mean_ds=mean_ds, + orientation=orientation, + title=title, + xaxis_title=xaxis_title, + ) + + +def display_boxplot_and_graph( + figs, + ranks_ds, + vis_df, + orientation="v", + title=None, + xaxis_title=None, + yaxis_title="Time", + legend_title="Legend", +): + result_figs = list() + display_boxplot( + result_figs, + ranks_ds, + vis_df["Min"], + vis_df["Q1"], + vis_df["Median"], + vis_df["Q3"], + vis_df["Max"], + mean_ds=vis_df["Mean"], + orientation=orientation, + title=(title + " - Full Distribution"), + xaxis_title=xaxis_title, + yaxis_title=yaxis_title, + legend_title=legend_title, + ) + + display_graph( + result_figs, + ranks_ds, + vis_df[["Q1", "Median", "Q3"]], + title=(title + " - 50% of Distribution"), + xaxis_title=xaxis_title, + yaxis_title=yaxis_title, + legend_title=legend_title, + ) + + if figs != None: + figs.extend(result_figs) + + return result_figs + + +def display_boxplot( + figs, + x_axis, + min_ds, + q1_ds, + median_ds, + q3_ds, + max_ds, + mean_ds=None, + orientation="v", + title=None, + xaxis_title=None, + yaxis_title="Time", + legend_title="Legend", +): + import plotly.graph_objects as go + + fig = go.Figure() + fig.add_trace( + go.Box( + x=x_axis, + lowerfence=min_ds, + q1=q1_ds, + median=median_ds, + q3=q3_ds, + upperfence=max_ds, + mean=mean_ds, + ) + ) + fig.update_traces(orientation=orientation) + fig.update_layout( + xaxis_title=xaxis_title, + yaxis_title=yaxis_title, + legend_title=legend_title, + title=title, + height=800, + ) + fig.show() + + if figs != None: + figs.append(fig) + + return fig + + +def display_graph( + figs, + x_axis, + y_axes, + title=None, + xaxis_title=None, + yaxis_title=None, + legend_title="Legend", +): + data = None + if isinstance(y_axes, pd.DataFrame) == True: + data = y_axes.set_index(x_axis) + elif isinstance(y_axes, dict) == True: + data = pd.DataFrame(y_axes, index=x_axis) + elif isinstance(y_axes, pd.Series) == True: + data = d.DataFrame({"": y_axes}, index=x_axis) + elif isinstance(y_axes, np.ndarray) == True: + data = pd.DataFrame({"": pd.Series(y_axes)}, index=x_axis) + else: + # print(type(y_axes)) + return + + fig = data.plot.line() + fig.update_layout( + title=title, + xaxis_title=xaxis_title, + yaxis_title=yaxis_title, + legend_title=legend_title, + ) + + fig.show() + + if figs != None: + figs.append(fig) + + return fig + + +def display_pace_graph(figs, pace_map_by_column, pace_column, start=1): + pace_df = pace_map_by_column[pace_column] + pace_df = pace_df.loc[start:] + + __display_pace_graph(figs, pace_df, pace_column) + + +def display_pace_graph_delta_minus_median(figs, pace_map_by_column, start=1): + pace_column = "delta" + stats_df = pace_map_by_column["delta_stats"] + median_ds = stats_df["Median"] + + pace_df = pace_map_by_column[pace_column].copy() + for columnName, column_ds in list(pace_df.items()): + pace_df[columnName] = column_ds - median_ds + + pace_df = pace_df.loc[start:] + __display_pace_graph(figs, pace_df, "variance of " + pace_column) + + +def __display_pace_graph(figs, pace_df, pace_column): + # display(pace_df) + + import warnings + + warnings.filterwarnings("ignore") + + fig = pace_df.plot.line() + fig.update_layout( + yaxis_title="Time", + title="Progress - Iterations defined by " + pace_column, + ) + fig.show() + figs.append(fig) + + fig = pace_df.T.plot.line() + fig.update_layout( + yaxis_title="Time", + title="Consistency - Iterations defined by " + pace_column, + ) + fig.show() + figs.append(fig) + + +def __display_stats_per_rank_of_group(selected, rank_stats_gdf): + df = rank_stats_gdf.get_group(selected) + df = df.reset_index(drop=True) + df = df.set_index(df[k_nvtx_stats_rank]) + + display(df) + + figs = list() + display_boxplots_df(figs, df, xaxis_title="Ranks") + display_graph( + figs, + df.index, + df[["Q1", "Median", "Q3"]], + title="50% of Distribution", + xaxis_title="Ranks", + ) + + +def display_stats_per_rank_groups_combobox(rank_stats_gdf): + from ipywidgets import interact, fixed, Dropdown + + list_names = list(rank_stats_gdf.groups.keys()) + + # Plot does not display if the value is not manually changed + if len(list_names) > 1: + dropdown = Dropdown( + options=list_names, layout={"width": "max-content"}, value=list_names[1] + ) + interact( + __display_stats_per_rank_of_group, + selected=dropdown, + rank_stats_gdf=fixed(rank_stats_gdf), + ) + dropdown.value = list_names[0] + elif len(list_names) == 1: + __display_stats_per_rank_of_group(list_names[0], rank_stats_gdf) diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/nvtx.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/nvtx.py new file mode 100644 index 0000000000000000000000000000000000000000..660c811689ff6a8993706368d7051f61cd56f9ce --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/nvtx.py @@ -0,0 +1,125 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd + +from collections import defaultdict, OrderedDict + + +def _compute_gpu_projection_df(nvtx_df, cuda_df, cuda_nvtx_index_map): + # Each NVTX index will be associated with the minimum start time and the + # maximum end time of the CUDA operations that the corresponsing NVTX range + # encloses. + nvtx_gpu_start_dict = OrderedDict() + nvtx_gpu_end_dict = OrderedDict() + + for cuda_row in cuda_df.itertuples(): + if cuda_row.Index not in cuda_nvtx_index_map: + continue + + nvtx_indices = cuda_nvtx_index_map[cuda_row.Index] + for nvtx_index in nvtx_indices: + if nvtx_index not in nvtx_gpu_start_dict: + nvtx_gpu_start_dict[nvtx_index] = cuda_row.gpu_start + nvtx_gpu_end_dict[nvtx_index] = cuda_row.gpu_end + continue + if cuda_row.gpu_start < nvtx_gpu_start_dict[nvtx_index]: + nvtx_gpu_start_dict[nvtx_index] = cuda_row.gpu_start + if cuda_row.gpu_end > nvtx_gpu_end_dict[nvtx_index]: + nvtx_gpu_end_dict[nvtx_index] = cuda_row.gpu_end + + return pd.DataFrame( + { + "text": nvtx_df.loc[nvtx_gpu_end_dict.keys(), "text"], + "start": nvtx_gpu_start_dict, + "end": nvtx_gpu_end_dict, + } + ) + + +def _find_cuda_nvtx_ranges(nvtx_df, cuda_df): + # Each CUDA index will be associated with a set of indices of NVTX ranges + # that enclose the corresponding CUDA operation. + cuda_nvtx_index_map = defaultdict(set) + + cuda_time_df = pd.DataFrame( + data={"start": cuda_df["start"], "end": cuda_df["end"]} + ).sort_values("start") + nvtx_start_df = pd.DataFrame(data={"time": nvtx_df["start"]}).sort_values("time") + nvtx_end_df = pd.DataFrame(data={"time": nvtx_df["end"]}).sort_values("time") + + cuda_iter = iter(cuda_time_df.itertuples()) + nvtx_start_iter = iter(nvtx_start_df.itertuples()) + nvtx_end_iter = iter(nvtx_end_df.itertuples()) + + cuda_row = next(cuda_iter) + nvtx_start_row = next(nvtx_start_iter) + nvtx_end_row = next(nvtx_end_iter) + + nvtx_active_indices = set() + + while True: + if ( + nvtx_start_row is not None + and nvtx_start_row.time <= nvtx_end_row.time + and nvtx_start_row.time <= cuda_row.start + ): + nvtx_active_indices.add(nvtx_start_row.Index) + + try: + nvtx_start_row = next(nvtx_start_iter) + except StopIteration: + nvtx_start_row = None + elif nvtx_end_row.time <= cuda_row.start or nvtx_end_row.time <= cuda_row.end: + nvtx_active_indices.remove(nvtx_end_row.Index) + + try: + nvtx_end_row = next(nvtx_end_iter) + except StopIteration: + break + else: + if nvtx_active_indices: + cuda_nvtx_index_map[cuda_row.Index] = nvtx_active_indices.copy() + + try: + cuda_row = next(cuda_iter) + except StopIteration: + break + + return dict(cuda_nvtx_index_map) + + +def project_nvtx_onto_gpu(nvtx_df, cuda_df): + """Project the NVTX ranges from the CPU onto the GPU. + + The projected range will have the start timestamp of the first enclosed GPU + operation and the end timestamp of the last enclosed GPU operation. + """ + # Filter ranges that are incomplete or end on a different thread. + filtered_nvtx_df = nvtx_df[ + nvtx_df["start"].notnull() + & nvtx_df["end"].notnull() + & nvtx_df["endGlobalTid"].isnull() + ] + + cuda_nvtx_index_map = {} + + nvtx_gdf = filtered_nvtx_df.groupby("globalTid") + cuda_gdf = cuda_df.groupby("globalTid") + + for global_tid, nvtx_tid_df in nvtx_gdf: + if global_tid not in cuda_gdf.groups: + continue + + cuda_tid_df = cuda_gdf.get_group(global_tid) + cuda_nvtx_tid_index_map = _find_cuda_nvtx_ranges(nvtx_tid_df, cuda_tid_df) + cuda_nvtx_index_map.update(cuda_nvtx_tid_index_map) + + return _compute_gpu_projection_df(filtered_nvtx_df, cuda_df, cuda_nvtx_index_map) diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/pace.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/pace.py new file mode 100644 index 0000000000000000000000000000000000000000..01e0ba3af010022a9d1056660469e8cb9312efdf --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/pace.py @@ -0,0 +1,95 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd + +from collections import namedtuple + +from nsys_recipe.lib import summary + +PaceInfo = namedtuple("PaceInfo", ["filename", "pace_df", "stats_df", "session_start"]) + + +def get_session_start_time(session_start_df): + return session_start_df.at[0, "utcEpochNs"] + + +def filter_by_pace_name(range_df, pace_col, pace_name): + filtered_range_df = range_df[range_df[pace_col] == pace_name] + return filtered_range_df.reset_index(drop=True) + + +def compute_pace_stats_dfs(range_df, pace_col): + # Filter out incomplete ranges. + pace_df = range_df[range_df["start"].notnull() & range_df["end"].notnull()] + + pace_df["duration"] = pace_df["end"] - pace_df["start"] + pace_gdf = pace_df.groupby(pace_col) + stats_df = summary.describe_duration(pace_gdf["duration"]) + + # Calculate the difference in values between the 'start' column and the + # previous row's 'end' column. + pace_df["delta"] = pace_df["start"] - pace_df["end"].shift(fill_value=0) + pace_df["delta_accum"] = pace_df["delta"].cumsum() + pace_df["duration_accum"] = pace_df["duration"].cumsum() + + # Drop the name column that contains the same value for all rows and + # reset index. + pace_df = pace_df.drop(columns=[pace_col]).reset_index(drop=True) + + return pace_df, stats_df + + +def apply_time_offset(session_starts, pace_dfs): + # Synchronize session start times. + global_min_start = min(session_starts) + for pace_df, session_start in zip(pace_dfs, session_starts): + session_offset = session_start - global_min_start + pace_df["start"] = pace_df["start"] + session_offset + pace_df["end"] = pace_df["end"] + session_offset + + +def describe_delta(df): + agg_df = df.agg(["min", "max", "count", "std", "mean", "sum"]) + quantile_df = df.quantile([0.25, 0.5, 0.75]) + quantile_df.index = ["25%", "50%", "75%"] + + # We transpose the concatenated df to have the statistics as columns. + stats_df = pd.concat([agg_df, quantile_df]).T + stats_df = summary.format_columns(stats_df) + + return stats_df + + +def split_columns_as_dataframes(pace_dfs): + # We want to get the pace info in individual dataframes per column and not + # per rank. + pace_df_by_column = {} + + cols = ["start", "end", "duration_accum", "delta_accum", "duration", "delta"] + for col in cols: + rank_column_value_map = { + # Parquet must have string column names. + str(rank): pace_df[col] + for rank, pace_df in enumerate(pace_dfs) + } + + rank_column_value_df = pd.DataFrame(rank_column_value_map) + rank_column_value_df = rank_column_value_df.rename_axis( + index="Iteration", columns="Rank" + ) + pace_df_by_column[col] = rank_column_value_df + + delta_df = pace_df_by_column["delta"] + # 'delta_df' has ranks as columns and iterations as the index. We + # transpose it to get the statistics per iteration instead of per rank. + pace_df_by_column["delta_stats"] = describe_delta(delta_df.T) + + return pace_df_by_column diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/recipe.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/recipe.py new file mode 100644 index 0000000000000000000000000000000000000000..2a666382c8083af3df1f307cd6befe9dbc6280f3 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/recipe.py @@ -0,0 +1,530 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import contextlib +import importlib +import inspect +import json +import os +import psutil +import shutil +import signal +import sys + +from datetime import datetime +from enum import Enum +from functools import partial + +from nsys_recipe import nsys_constants +from nsys_recipe.lib import args, exceptions, nsys_path +from nsys_recipe.log import logger + + +class Mode(Enum): + """Data processing modes.""" + + NONE = 0 + CONCURRENT = 1 + DASK_FUTURES = 2 + + +class Context: + """Abstract base class for data processing engines, each associated to a Mode.""" + + mode = None + context_map = None + + def __init__(self): + def exit_signal(signum, frame): + sys.exit(128 + signum) + + signal.signal(signal.SIGINT, exit_signal) + + def __enter__(self): + return self + + def __exit__(*args): + pass + + def launch(self, function, *args, **kwargs): + """Wrapper for task execution. + + Parameters + ---------- + function : callable + Function to execute. + *args : tuple + Positional arguments. + **kwargs : dict + Dictionary of keyword arguments. + + Returns + ------- + result : return type of function + """ + raise NotImplementedError + + def map(self, function, *iterables, **kwargs): + """Execute task for each iterable. + + The function is applied to each element in iterables, which should + have the same length. The kwargs remains packed and is passed as + argument to the function. Results are guaranteed to be in the same + order as the input. + + Parameters + ---------- + function : callable + Function to execute. + *iterables : iterables + Objects to map over. + **kwargs : dict + Dictionary of keyword arguments. + + Returns + ------- + result : list + """ + raise NotImplementedError + + def wait(self, waitable): + """Wrapper for task completion. + + If waitable is a remote result, wait until computation completes and + return the value of the variable. This is meant to be used on results + of launch and map functions. + + Returns + ------- + result : depends on input + Returns a list of results if the waitable is a list. + Returns single element otherwise. + """ + raise NotImplementedError + + @staticmethod + def import_module(name): + try: + module = importlib.import_module(name) + except ModuleNotFoundError as e: + raise exceptions.ModeModuleNotFoundError(e) from e + return module + + @staticmethod + def register_process_termination(): + def terminate_process(signum, frame): + psutil.Process().terminate() + + signal.signal(signal.SIGINT, terminate_process) + + @staticmethod + def convert_to_original_type(value): + with contextlib.suppress(ValueError): + return int(value) + with contextlib.suppress(ValueError): + return float(value) + with contextlib.suppress(ValueError): + return bool(value) + + return value + + @staticmethod + def get_mode_argument_dict(prefix): + argument_dict = {} + + for key, value in os.environ.items(): + if key.upper().startswith(prefix): + # Lowercase and remove the prefix. + processed_key = key.lower()[len(prefix) :] + argument_dict[processed_key] = Context.convert_to_original_type(value) + + return argument_dict + + @classmethod + def create_context(cls, mode=Mode.CONCURRENT): + """Create an instance of Context corresponding to mode. + + The first time this is called, create context_map that maps each + context to its mode. + + Parameters + ---------- + mode : Mode + Mode of the context to create. + + Returns + ------- + context : Context + """ + if cls.context_map is None: + keys = Mode + values = [ContextNone, ContextConcurrent, ContextDaskFutures] + cls.context_map = dict(zip(keys, values)) + + if mode not in cls.context_map: + raise NotImplementedError + + return cls.context_map[mode]() + + +class ContextNone(Context): + """Standard single-threaded mode.""" + + mode = Mode.NONE + + def launch(self, function, *args, **kwargs): + return function(*args, **kwargs) + + def map(self, function, *iterables, **kwargs): + partial_func = partial(function, **kwargs) + return [*map(partial(self.launch, partial_func), *iterables)] + + def wait(self, waitable): + return waitable + + +class ContextConcurrent(Context): + """Concurrent mode using concurrent.futures.""" + + mode = Mode.CONCURRENT + + def __init__(self, executor=None): + super().__init__() + + self._executor = executor + self._custom = False + + if self._executor is None: + self._custom = True + argument_dict = self.get_mode_argument_dict("NSYS_CONCURRENT_") + pkg_concurrent_futures = Context.import_module("concurrent.futures") + + # The 'initializer' argument is available starting from 3.7. + if sys.version_info >= (3, 7): + self._executor = pkg_concurrent_futures.ProcessPoolExecutor( + initializer=Context.register_process_termination, **argument_dict + ) + else: + self._executor = pkg_concurrent_futures.ProcessPoolExecutor( + **argument_dict + ) + + def __enter__(self): + if self._executor is None: + raise RuntimeError("Executor is shutdown.") + return self + + def __exit__(self, *args): + self.close() + + def close(self): + if self._custom: + self._executor.shutdown() + self._executor = None + + def launch(self, function, *args, **kwargs): + return self._executor.submit(function, *args, **kwargs).result() + + def map(self, function, *iterables, **kwargs): + partial_func = partial(function, **kwargs) + return [*self._executor.map(partial_func, *iterables)] + + def wait(self, waitable): + return waitable + + +class ContextDaskFutures(Context): + """Concurrent mode using dask.distributed.""" + + mode = Mode.DASK_FUTURES + + def __init__(self, cluster=None): + super().__init__() + + self._cluster = cluster + + pkg_dask_distributed = Context.import_module("distributed") + + if self._cluster is not None: + self._client = pkg_dask_distributed.Client(self._cluster) + else: + argument_dict = self.get_mode_argument_dict("NSYS_DASK_") + self._client = pkg_dask_distributed.Client(**argument_dict) + + def _dask_worker_callback(recipe_pkg_path): + Context.register_process_termination() + sys.path.insert(0, recipe_pkg_path) + + # We assume that all worker nodes have the same recipe path. + recipe_pkg_path = nsys_path.find_installed_file( + nsys_constants.NSYS_PYTHON_PKG_DIR + ) + partial_callback = partial(_dask_worker_callback, recipe_pkg_path) + self._client.register_worker_callbacks(setup=partial_callback) + + def __enter__(self): + if self._client is None: + raise RuntimeError("Client is closed.") + return self + + def __exit__(self, *args): + self.close() + + def close(self): + if self._client is not None: + self._client.close() + self._client = None + + def launch(self, function, *args, **kwargs): + return self._client.submit(function, *args, **kwargs) + + def map(self, function, *iterables, **kwargs): + partial_func = partial(function, **kwargs) + return self._client.map(partial_func, *iterables) + + def wait(self, waitable): + if isinstance(waitable, list): + return self._client.gather(waitable) + return waitable.result() + + +class Recipe: + """Base class for all recipes""" + + recipe_dir = None + recipe_name = None + metadata_dict = None + + def __init__(self, parsed_args): + """Initialize. + + Parameters + ---------- + parsed_args : argparse.Namespace + Parsed arguments. + """ + self._parsed_args = parsed_args + self._output_dir = None + self._output_files = {} + self._analysis_dict = {} + # Used as the default output directory if the user doesn't specify a + # name using the '--output' option. + self._default_output_name = self.get_recipe_name() + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + if self.output_dir is not None and exc_type is not None: + shutil.rmtree(self._output_dir) + + @property + def output_dir(self): + """Get output directory name without creating it.""" + return self._output_dir + + def set_default_output_name(self, name): + """Set the default output directory name.""" + self._default_output_name = name + + def _generate_incremental_name(self, name): + i = 1 + while os.path.exists(f"{name}-{i}"): + i += 1 + return f"{name}-{i}" + + def _generate_unique_output_name(self): + output_name = self.get_parsed_arg("output") + if output_name is None: + return self._generate_incremental_name(self._default_output_name) + + if os.path.exists(output_name): + if not self.get_parsed_arg("force_overwrite", False): + logger.warning( + f"Failed to create '{output_name}': Directory exists." + " Use '--force-overwrite' to overwrite existing directories," + " or '--auto-increment' for a unique name." + ) + return self._generate_incremental_name(self._default_output_name) + else: + shutil.rmtree(output_name) + + return output_name + + def get_parsed_arg(self, name, default=None): + return getattr(self._parsed_args, name, default) + + def get_output_dir(self): + """Return a unique output directory name. + + The first time this is called, create a unique directory where the + output files are stored. + Unless the '--output' option is specified with a directory name that + does not exist or used along the '--force-overwrite' option, a unique + directory name will be generated with an incrementing id. + """ + if self._output_dir is None: + self._output_dir = self._generate_unique_output_name() + os.makedirs(self._output_dir) + + return self._output_dir + + def add_output_file(self, filename, filetype=None): + """Get path of the output file. + + Prepend the output directory name to filename. + If filetype is not None, add it to _output_files so it can later be + recorded in the nsys-analysis json file. + + Parameters + ---------- + filename : str + Output file name. + filetype : str + File type to be recorded. + + Returns + ------- + filepath : str + Output file path. + """ + if filetype: + self._output_files[filename] = filetype + return os.path.join(self.get_output_dir(), filename) + + def create_analysis_file(self): + """Create the nsys-analysis json file containing metadata.""" + output_name = os.path.basename(self.get_output_dir()) + analysis_filename = f"{output_name}.nsys-analysis" + + with open(self.add_output_file(analysis_filename), "w") as f: + json.dump(self._analysis_dict, f, indent=4) + + def create_notebook(self, notebook_name, dir_path=None, replace_dict=None): + """Create output jupyter notebook from an existing template notebook. + + The output notebook is created under the same name as the template. + Any key strings contained in replace_dict will be replaced by its value. + + Parameters + ---------- + notebook_name : str + Name of the template notebook file located in the same directory as + the recipe script. + dir_path : str + Directory path to the notebook in case it is located in a different + location. + replace_dict : dict + Dictionary containing the string to be replaced and the new value. + """ + + if dir_path is not None: + notebook_dir = dir_path + else: + notebook_dir = os.path.dirname(inspect.getmodule(self).__file__) + + nb_template = os.path.join(notebook_dir, notebook_name) + nb_output_file = self.add_output_file(notebook_name, "Notebook") + + if not os.path.exists(nb_template): + raise NotImplementedError(f"File {nb_template} not found.") + + if replace_dict: + with open(nb_template, "r") as f: + file_content = f.read() + + for key, value in replace_dict.items(): + file_content = file_content.replace(str(key), str(value)) + + with open(nb_output_file, "w") as f: + f.write(file_content) + else: + shutil.copy(nb_template, nb_output_file) + + def add_notebook_helper_file(self, filename): + """Copy the helper file from the lib directory to the output directory, + where it can be accessed by the notebook generated by the + create_notebook function. + + Parameters + ---------- + filename : str + Name of the helper file located in the lib directory. + """ + filepath = os.path.join(os.path.dirname(__file__), filename) + if not os.path.exists(filepath): + raise NotImplementedError(f"File {filepath} not found.") + + output_path = self.add_output_file(filename) + shutil.copy(filepath, output_path) + + def run(self, context): + self._analysis_dict = { + "RecipeJsonVersion": "1.2.0", + "RecipeRuntimeVersion": "2.0.0", + "RecipeName": self.get_recipe_name(), + "DisplayName": self.get_metadata("display_name"), + "Mode": context.mode.name.replace("_", "-").lower(), + "StartTime": str(datetime.now()), + } + + @classmethod + def get_recipe_dir(cls): + if cls.recipe_dir is None: + cls.recipe_dir = os.path.dirname(inspect.getmodule(cls).__file__) + return cls.recipe_dir + + @classmethod + def get_recipe_name(cls): + if cls.recipe_name is None: + cls.recipe_name = os.path.basename(cls.get_recipe_dir()) + return cls.recipe_name + + @classmethod + def get_metadata(cls, key): + """Get metadata info. + + Parameters + ---------- + key : str + Key to be searched in the metadata dictionary item. + + Returns + ------- + value : str + Value for the specified key if key is found, None otherwise. + """ + if cls.metadata_dict is None: + json_path = os.path.join(cls.get_recipe_dir(), "metadata.json") + + if not os.path.exists(json_path): + raise NotImplementedError("File metadata.json not found.") + + with open(json_path) as f: + cls.metadata_dict = json.load(f) + + if key not in cls.metadata_dict: + raise NotImplementedError(f"Key {key} not found in metadata.json.") + + val = cls.metadata_dict[key] + # A list of strings was used to save the description for better + # readability. Convert the list into a single string before returning. + if key == "description": + return "".join(val) + return val + + @classmethod + def get_argument_parser(cls): + """Get default argument parser.""" + return args.ArgumentParser( + prog=cls.get_recipe_name(), + description=cls.get_metadata("description"), + formatter_class=args.TextHelpFormatter, + ) diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/recipe_loader.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/recipe_loader.py new file mode 100644 index 0000000000000000000000000000000000000000..248da52293cba9d1d121a8682b3b718e6ac679fc --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/recipe_loader.py @@ -0,0 +1,97 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import importlib +import inspect +import json +import os +import sys + +from nsys_recipe import nsys_constants +from nsys_recipe.lib import recipe +from nsys_recipe.log import logger + + +def get_metadata_dict(recipe_dir, recipe_name): + json_path = os.path.join(recipe_dir, recipe_name, "metadata.json") + if not os.path.exists(json_path): + return None + + with open(json_path) as f: + return json.load(f) + + +def is_recipe_subclass(obj): + return ( + inspect.isclass(obj) and issubclass(obj, recipe.Recipe) and obj != recipe.Recipe + ) + + +def get_recipe_class_from_module(module, class_name=None): + if class_name is not None: + recipe_class = getattr(module, class_name) + if is_recipe_subclass(recipe_class): + return recipe_class + + logger.error(f"{class_name} is not a Recipe class.") + return None + + members = inspect.getmembers(module, is_recipe_subclass) + if not members: + logger.error("No Recipe class found.") + return None + + name, recipe_class = members[0] + if len(members) > 1: + logger.warning( + f"Multiple Recipe classes detected. Using the first class '{name}' as default." + " To choose a different class, please set the 'class_name' field in the metadata file." + ) + + return recipe_class + + +def get_recipe_module(search_path, recipe_name, module_name): + sys.path.append(search_path) + recipe_module_path = f"{recipe_name}.{module_name}" + try: + return importlib.import_module(recipe_module_path) + except Exception as e: + logger.error(f"Could not import {recipe_module_path}: {e}") + + +def get_recipe_class_from_name(recipe_name): + # Search for the recipe in the following order: + # 1. 'nsys_recipe' package. + # 2. Current directory. + # 3. Directory set by the environment variable NSYS_RECIPE_PATH. + recipe_search_paths = [nsys_constants.NSYS_RECIPE_RECIPES_PATH, ""] + + recipe_path_env_var = os.getenv("NSYS_RECIPE_PATH") + if recipe_path_env_var is not None: + recipe_search_paths.append(recipe_path_env_var) + + for search_path in recipe_search_paths: + metadata = get_metadata_dict(search_path, recipe_name) + if metadata is None: + continue + + module_name = metadata.get("module_name") + if module_name is None: + logger.error("'module_name' not found.") + return None + + module = get_recipe_module(search_path, recipe_name, module_name) + if module is None: + return None + return get_recipe_class_from_module(module, metadata.get("class_name")) + + logger.error("Unknown recipe.") + return None diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/summary.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/summary.py new file mode 100644 index 0000000000000000000000000000000000000000..f773263b4966e229688aa5b6c9d1851919765260 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/lib/summary.py @@ -0,0 +1,93 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd + +from collections import namedtuple + +StatsInfo = namedtuple("StatsInfo", ["filename", "stats_df"]) + + +def format_columns(df): + """Format a predefined set of statistical columns. + + - The first letter of each column name is capitalized. + - The statistical columns are ordered according to a predefined sequence. + - Any remaining columns that are not part of the predefined set are + appended at the end. + """ + formatted_df = df.rename( + { + "25%": "Q1", + "50%": "Median", + "75%": "Q3", + 0.25: "Q1", + 0.5: "Median", + 0.75: "Q3", + }, + axis="columns", + ) + + formatted_df.columns = formatted_df.columns.str.title() + formatted_df = formatted_df.rename_axis(index=str.title) + + stats_cols = ["Count", "Mean", "Std", "Min", "Q1", "Median", "Q3", "Max", "Sum"] + other_columns = [col for col in formatted_df.columns if col not in stats_cols] + + return formatted_df[stats_cols + other_columns] + + +def aggregate_stats_dfs(dfs): + """Aggregate multiple statistical dataframes into one. + + The input dataframes should be formatted using the 'format_columns' + function. They should include all the statistical columns present in the + default pandas describe() function, along with the sum column. + """ + stats_df = pd.concat(dfs) + stats_gdf = stats_df.groupby(stats_df.index) + + sum_total = stats_gdf["Sum"].sum() + count_total = stats_gdf["Count"].sum() + weighted_mean = sum_total / count_total + + aggregated_df = pd.DataFrame( + { + "Count": count_total, + "Mean": weighted_mean, + "Std (approx)": stats_gdf["Std"].mean(), + "Min": stats_gdf["Min"].min(), + "Q1 (approx)": stats_gdf["Q1"].min(), + "Median (approx)": stats_gdf["Median"].median(), + "Q3 (approx)": stats_gdf["Q3"].max(), + "Max": stats_gdf["Max"].max(), + "Sum": sum_total, + }, + index=stats_gdf.groups.keys(), + ).round(1) + aggregated_df.index.name = stats_df.index.name + + return aggregated_df + + +def describe_duration(series_groupby): + """Generate descriptive statistics. + + This function extends the pandas describe() function by including the + 'sum' column for the given 'duration' of a grouped dataframe. + """ + agg_df = series_groupby.agg(["min", "max", "count", "std", "mean", "sum"]) + quantile_df = series_groupby.quantile([0.25, 0.5, 0.75]) + + quantile_df = quantile_df.unstack() + quantile_df.columns = ["25%", "50%", "75%"] + + stats_df = pd.merge(agg_df, quantile_df, left_index=True, right_index=True) + return format_columns(stats_df) diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/log.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/log.py new file mode 100644 index 0000000000000000000000000000000000000000..a476dc48e7a059eff615753fa45614f26334d3b2 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/log.py @@ -0,0 +1,58 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import logging +import sys +import timeit + +levels = { + "critical": logging.CRITICAL, + "error": logging.ERROR, + "warning": logging.WARNING, + "warn": logging.WARNING, + "info": logging.INFO, + "debug": logging.DEBUG, +} + +streams = {"stdout": sys.stdout, "stderr": sys.stderr} + +logger = logging.getLogger(__package__) + + +def customize_logger(stream_str, log_level_str): + stream = streams[stream_str] + + handler = logging.StreamHandler(stream) + formatter = logging.Formatter("%(levelname)s: %(message)s") + handler.setFormatter(formatter) + + logger.handlers.clear() + logger.addHandler(handler) + + log_level = levels[log_level_str] + logger.setLevel(log_level) + + +def time(name): + def decorator(func): + def wrapper(*args, **kwargs): + if not logger.isEnabledFor(logging.DEBUG): + return func(*args, **kwargs) + + start = timeit.default_timer() + result = func(*args, **kwargs) + end = timeit.default_timer() + + logger.debug(f"{name} time (s): {end - start}") + return result + + return wrapper + + return decorator diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/nsys_constants.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/nsys_constants.py new file mode 100644 index 0000000000000000000000000000000000000000..014525614cdbb2b19acef5a85eda5adaa915d859 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/nsys_constants.py @@ -0,0 +1,72 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import os +import platform +import subprocess + + +def get_arm_target_dir(): + # TODO(DTSP-15164): Correct platform detection for containers on Jetson. + tegra_check = subprocess.run( + "find /proc/device-tree/ -maxdepth 1 -name 'tegra*'", + shell=True, + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL, + ) + desktop_check = subprocess.run( + "lsmod | grep 'nvidia'", + shell=True, + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL, + ) + + if tegra_check.returncode == 0: + return "target-linux-tegra-armv8" + elif desktop_check.returncode == 0: + return "target-linux-sbsa-armv8" + return None + + +NSYS_TARGET_DIR = None +if platform.system() == "Windows": + NSYS_EXE_NAME = "nsys.exe" + NSYS_HOST_DIR = "host-windows-x64" + NSYS_TARGET_DIR = "target-windows-x64" + NSYS_SQLITE_LIB = "sqlite3.dll" +elif platform.system() == "Linux": + NSYS_EXE_NAME = "nsys" + NSYS_SQLITE_LIB = "libsqlite3.so.0" + if platform.machine() == "x86_64": + NSYS_HOST_DIR = "host-linux-x64" + NSYS_TARGET_DIR = "target-linux-x64" + elif platform.machine() == "aarch64": + NSYS_HOST_DIR = "host-linux-armv8" + NSYS_TARGET_DIR = get_arm_target_dir() + +if NSYS_TARGET_DIR is None: + raise RuntimeError("Current platform is not supported.") + +NSYS_RULE_DIR = "rules" +NSYS_REPORT_DIR = "reports" +NSYS_PYTHON_DIR = "python" + +NSYS_PYTHON_LIB_DIR = os.path.join(NSYS_PYTHON_DIR, "lib") +NSYS_PYTHON_PKG_DIR = os.path.join(NSYS_PYTHON_DIR, "packages") + +NSYS_RECIPE_PATH = os.path.abspath(os.path.dirname(__file__)) +NSYS_RECIPE_INSTALL_PATH = os.path.join(NSYS_RECIPE_PATH, "install.py") +NSYS_RECIPE_REQ_PATH = os.path.join(NSYS_RECIPE_PATH, "requirements") +NSYS_RECIPE_THIRDPARTY_PATH = os.path.join(NSYS_RECIPE_PATH, "third_party") +NSYS_RECIPE_RECIPES_PATH = os.path.join(NSYS_RECIPE_PATH, "recipes") + +NSYS_RECIPE_REQ_COMMON_PATH = os.path.join(NSYS_RECIPE_REQ_PATH, "common.txt") +NSYS_RECIPE_REQ_DASK_PATH = os.path.join(NSYS_RECIPE_REQ_PATH, "dask.txt") +NSYS_RECIPE_REQ_JUPYTER_PATH = os.path.join(NSYS_RECIPE_REQ_PATH, "jupyter.txt") diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/pyproject.toml b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..8b65edef810926a424df9cf9e4d2338fe12bd875 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/pyproject.toml @@ -0,0 +1,8 @@ +[tool.black] +line-length = 88 +exclude = ''' +( + third_party + | .ipynb +) +''' diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_api_sum/cuda_api_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_api_sum/cuda_api_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..f2b3021a36fa32f67f248088463c98f5bb46efc0 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_api_sum/cuda_api_sum.py @@ -0,0 +1,149 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd + +from collections import OrderedDict +from datetime import datetime +from pathlib import Path + +from nsys_recipe import log +from nsys_recipe.data_service import StatsService +from nsys_recipe.lib import helpers, recipe +from nsys_recipe.lib.args import Option +from nsys_recipe.log import logger + + +class CudaApiSum(recipe.Recipe): + @staticmethod + def _mapper_func(report_path, parsed_args): + service = StatsService(report_path) + + df = service.read_sql_report("cuda_api_sum", "CudaApiSum", parsed_args) + if df is None: + return None + + if df.empty: + logger.info( + f"{report_path} was successfully processed, but no data was found." + ) + return None + + df["File"] = Path(report_path).stem + return df + + @log.time("Mapper") + def mapper_func(self, context): + return context.wait( + context.map( + self._mapper_func, + self._parsed_args.input, + parsed_args=self._parsed_args, + ) + ) + + def aggregate_stats(self, df): + grouped = df.groupby(df.index.name) + + d = OrderedDict() + total_time = grouped["Total Time"].sum() + d["Time"] = total_time / total_time.sum() * 100 + d["Total Time"] = total_time + d["Num Calls"] = grouped["Num Calls"].sum() + d["Avg"] = d["Total Time"] / d["Num Calls"] + d["Q1"] = grouped["Q1"].min() + d["Med"] = grouped["Med"].median() + d["Q3"] = grouped["Q3"].max() + d["Min"] = grouped["Min"].min() + d["Max"] = grouped["Max"].max() + d["StdDev"] = grouped.apply(lambda x: helpers.stddev(x, d, "Num Calls")) + min_value = grouped["Min"].min() + d["Min File"] = grouped.apply( + lambda x: ", ".join(x.loc[x["Min"] == min_value.loc[x.name], "File"]) + ) + max_value = grouped["Max"].max() + d["Max File"] = grouped.apply( + lambda x: ", ".join(x.loc[x["Max"] == max_value.loc[x.name], "File"]) + ) + + aggregated_df = pd.concat(d.values(), axis=1, keys=d.keys()).round(1) + return aggregated_df.sort_values(by=["Total Time"], ascending=False) + + @log.time("Reducer") + def reducer_func(self, dfs): + dfs = helpers.filter_none(dfs) + df = pd.concat(dfs) + + # Remove any tags or hidden columns that are for internal use. + df.columns = df.columns.str.replace("(:).*", "", regex=True) + df.columns = df.columns.str.lstrip("_") + + df = df.set_index("Name") + df = df[ + [ + "Time", + "Total Time", + "Num Calls", + "Avg", + "Q1", + "Med", + "Q3", + "Min", + "Max", + "StdDev", + "File", + ] + ] + + per_rank_df = df.sort_values(by=["File", "Total Time"], ascending=[True, False]) + all_ranks_df = self.aggregate_stats(df) + + per_rank_df.to_parquet(self.add_output_file("rank_stats.parquet")) + all_ranks_df.to_parquet(self.add_output_file("all_stats.parquet")) + + if self._parsed_args.csv: + per_rank_df.to_csv(self.add_output_file("rank_stats.csv")) + all_ranks_df.to_csv(self.add_output_file("all_stats.csv")) + + def save_notebook(self): + self.create_notebook("stats.ipynb") + self.add_notebook_helper_file("nsys_display.py") + + def save_analysis_file(self): + self._analysis_dict.update( + { + "EndTime": str(datetime.now()), + "InputFiles": self._parsed_args.input, + "Outputs": self._output_files, + } + ) + self.create_analysis_file() + + def run(self, context): + super().run(context) + + mapper_res = self.mapper_func(context) + self.reducer_func(mapper_res) + + self.save_notebook() + self.save_analysis_file() + + @classmethod + def get_argument_parser(cls): + parser = super().get_argument_parser() + + parser.add_recipe_argument(Option.INPUT) + parser.add_recipe_argument(Option.OUTPUT) + parser.add_recipe_argument(Option.FORCE_OVERWRITE) + parser.add_recipe_argument(Option.START) + parser.add_recipe_argument(Option.END) + parser.add_recipe_argument(Option.CSV) + + return parser diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_api_sum/metadata.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_api_sum/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..a1fa18eb80e1186a8d4eeb03b4ac40d9921df267 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_api_sum/metadata.json @@ -0,0 +1,6 @@ +{ + "module_name": "cuda_api_sum", + "display_name": "CUDA API Summary", + "description": "This recipe provides a summary of CUDA API functions and their execution times.", + "type": "stats" +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_api_sum/stats.ipynb b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_api_sum/stats.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..19c99670b76011a6ed3a1f7b49ea3c9dd77c342f --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_api_sum/stats.ipynb @@ -0,0 +1,137 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# CUDA API Summary" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This notebook provides a summary of CUDA API functions and their execution times." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import plotly.offline as pyo\n", + "\n", + "from IPython.display import display, HTML, Markdown\n", + "\n", + "import nsys_display\n", + "\n", + "display(HTML(\"\"))\n", + "pd.set_option('display.max_colwidth', None)\n", + "pd.set_option('display.max_rows', None)\n", + "pyo.init_notebook_mode()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Overall statistics" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The table shows the statistics across all ranks. Note that:\n", + "* All time values are in nanoseconds.\n", + "* Q1 is the 25th percentile of the data set. Approximated by the min of Q1 for each rank.\n", + "* Median is the 50th percentile of the data set. Approximated by the median of the medians for each rank.\n", + "* Q3 is the 75th percentile of the data set. Approximated by the max of Q3 for each rank.\n", + "* The 'Min File' column displays the names of the ranks that contain the minimum value.\n", + "* The 'Max File' column displays the names of the ranks that contain the maximum value.\n", + "* The 'Time' column is calculated using a summation of the \"Total Time\" column. It represents that function's percent of the execution time of the functions listed and not a percentage of the application wall or CPU execution time." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ranks_df = pd.read_parquet('all_stats.parquet')\n", + "display(ranks_df)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The diagram shows statistical box plots and line graphs for each operation across all ranks.\n", + "\n", + "To toggle the line traces on and off on the graph, click on their corresponding legend entries. When working with large data sets, consider using the .head() function to limit the number of displayed elements or zoom in on the diagram for better visibility." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "nsys_display.display_box(ranks_df, xaxis_title='Name', yaxis_title='Value (ns)')\n", + "nsys_display.display_stats_scatter(ranks_df, xaxis_title='Name', yaxis_title='Value (ns)')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Per-rank statistics" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The table and graphs show statistics of the operation selected from the drop-down menu, for each rank. Note that:\n", + "* All time values are in nanoseconds.\n", + "* 'Q1', 'Med', and 'Q3' are the 25th, 50th, and 75th percentiles of the data set, respectively.\n", + "* The 'Time' column is calculated using a summation of the \"Total Time\" column. It represents that function's percent of the execution time of the functions listed and not a percentage of the application wall or CPU execution time.\n", + "\n", + "To toggle the line traces on and off on the graph, click on their corresponding legend entries. When working with large data sets, consider using the .head() function to limit the number of displayed elements or zoom in on the diagram for better visibility." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "per_rank_df = pd.read_parquet('rank_stats.parquet')\n", + "nsys_display.display_stats_per_operation(per_rank_df, xaxis_title='File', yaxis_title='Value (ns)')" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "name": "python", + "version": "3.10.5" + }, + "orig_nbformat": 4, + "vscode": { + "interpreter": { + "hash": "7e1998ff7f8aa20ada591c520b972326324e5ea05489af9e422744c7c09f6dad" + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_api_sync/analysis.ipynb b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_api_sync/analysis.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..6a203ec4ba3a0fd79d968c5929255ec91027a333 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_api_sync/analysis.ipynb @@ -0,0 +1,81 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# CUDA Synchronization APIs" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This notebook identifies the following synchronization APIs that block the host until the issued CUDA calls are complete:\n", + "- cudaDeviceSynchronize()\n", + "- cudaStreamSynchronize()\n", + "\n", + "Suggestions:\n", + "1. Avoid excessive use of synchronization.\n", + "2. Use asynchronous CUDA event calls, such as cudaStreamWaitEvent() and cudaEventSynchronize(), to prevent host synchronization." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import plotly.offline as pyo\n", + "\n", + "from IPython.display import display, HTML, Markdown\n", + "\n", + "import nsys_display\n", + "\n", + "display(HTML(\"\"))\n", + "pd.set_option('display.max_colwidth', None)\n", + "pd.set_option('display.max_rows', None)\n", + "pyo.init_notebook_mode()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The table shows analysis results for each individual rank selected from the drop-down menu.\n", + "\n", + "All time values are in nanoseconds." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "df = pd.read_parquet('analysis.parquet')\n", + "nsys_display.display_table_per_rank(df)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "name": "python", + "version": "3.10.5" + }, + "orig_nbformat": 4, + "vscode": { + "interpreter": { + "hash": "7e1998ff7f8aa20ada591c520b972326324e5ea05489af9e422744c7c09f6dad" + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_api_sync/cuda_api_sync.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_api_sync/cuda_api_sync.py new file mode 100644 index 0000000000000000000000000000000000000000..5921502c5ac4456c953a31c64d3d3843fd9b6ee0 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_api_sync/cuda_api_sync.py @@ -0,0 +1,97 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd + +from datetime import datetime +from pathlib import Path + +from nsys_recipe import log +from nsys_recipe.data_service import StatsService +from nsys_recipe.lib import helpers, recipe +from nsys_recipe.lib.args import Option +from nsys_recipe.log import logger + + +class CudaApiSync(recipe.Recipe): + @staticmethod + def _mapper_func(report_path, parsed_args): + service = StatsService(report_path) + + df = service.read_sql_report("cuda_api_sync", "CudaApiSync", parsed_args) + if df is None: + return None + + if df.empty: + logger.info( + f"{report_path} was successfully processed, but no data was found." + ) + return None + + df["File"] = Path(report_path).stem + return df + + @log.time("Mapper") + def mapper_func(self, context): + return context.wait( + context.map( + self._mapper_func, + self._parsed_args.input, + parsed_args=self._parsed_args, + ) + ) + + @log.time("Reducer") + def reducer_func(self, dfs): + dfs = helpers.filter_none(dfs) + df = pd.concat(dfs) + + # Remove any tags or hidden columns that are for internal use. + df.columns = df.columns.str.replace("(:).*", "", regex=True) + df = df.loc[:, ~df.columns.str.startswith("_")] + + df.to_parquet(self.add_output_file("analysis.parquet")) + + def save_notebook(self): + self.create_notebook("analysis.ipynb") + self.add_notebook_helper_file("nsys_display.py") + + def save_analysis_file(self): + self._analysis_dict.update( + { + "EndTime": str(datetime.now()), + "InputFiles": self._parsed_args.input, + "Outputs": self._output_files, + } + ) + self.create_analysis_file() + + def run(self, context): + super().run(context) + + mapper_res = self.mapper_func(context) + self.reducer_func(mapper_res) + + self.save_notebook() + self.save_analysis_file() + + @classmethod + def get_argument_parser(cls): + parser = super().get_argument_parser() + + parser.add_recipe_argument(Option.INPUT) + parser.add_recipe_argument(Option.OUTPUT) + parser.add_recipe_argument(Option.FORCE_OVERWRITE) + parser.add_recipe_argument(Option.START) + parser.add_recipe_argument(Option.END) + parser.add_recipe_argument(Option.NVTX) + parser.add_recipe_argument(Option.ROWS) + + return parser diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_api_sync/metadata.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_api_sync/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..c04a9e808dbcc21f9cadbd79726dd071a21e3676 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_api_sync/metadata.json @@ -0,0 +1,10 @@ +{ + "module_name": "cuda_api_sync", + "display_name": "CUDA Synchronization APIs", + "description": [ + "This recipe identifies the following synchronization APIs that block the host", + " until the issued CUDA calls are complete:\n", + "- cudaDeviceSynchronize()\n", + "- cudaStreamSynchronize()" + ] +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_kern_pace/cuda_gpu_kern_pace.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_kern_pace/cuda_gpu_kern_pace.py new file mode 100644 index 0000000000000000000000000000000000000000..f72cc5615ab8a6e92bdb1fcf5a136748edef1038 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_kern_pace/cuda_gpu_kern_pace.py @@ -0,0 +1,130 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd + +from datetime import datetime +from pathlib import Path + +from nsys_recipe import log, data_service +from nsys_recipe.data_service import DataService +from nsys_recipe.lib import helpers, pace, recipe, summary +from nsys_recipe.lib.args import Option +from nsys_recipe.log import logger + + +class CudaGpuKernPace(recipe.Recipe): + @staticmethod + def _mapper_func(report_path, parsed_args): + service = DataService(report_path) + + name_column = "shortName" + table_column_dict = { + "StringIds": None, + "TARGET_INFO_SESSION_START_TIME": None, + "CUPTI_ACTIVITY_KIND_KERNEL": [name_column, "start", "end"], + } + + df_dict = service.read_tables(table_column_dict) + if df_dict is None: + return None + + kernel_df = df_dict["CUPTI_ACTIVITY_KIND_KERNEL"] + data_service.filter_by_time_range(kernel_df, parsed_args.start, parsed_args.end) + + kernel_df = data_service.replace_id_with_value( + kernel_df, df_dict["StringIds"], name_column + ) + if kernel_df.empty: + logger.info( + f"{report_path} was successfully processed, but no data was found." + ) + return None + + kernel_df = pace.filter_by_pace_name(kernel_df, name_column, parsed_args.name) + if kernel_df.empty: + logger.warning(f"{report_path} does not contain '{parsed_args.name}'.") + return None + + filename = Path(report_path).stem + session_start = pace.get_session_start_time( + df_dict["TARGET_INFO_SESSION_START_TIME"] + ) + pace_df, stats_df = pace.compute_pace_stats_dfs(kernel_df, name_column) + + return pace.PaceInfo(filename, pace_df, stats_df, session_start) + + @log.time("Mapper") + def mapper_func(self, context): + return context.wait( + context.map( + self._mapper_func, + self._parsed_args.input, + parsed_args=self._parsed_args, + ) + ) + + @log.time("Reducer") + def reducer_func(self, mapper_res): + pace_infos = helpers.filter_none(mapper_res) + pace_infos = sorted(pace_infos, key=lambda x: x.filename) + + filenames, pace_dfs, stats_dfs, session_starts = zip(*pace_infos) + pace.apply_time_offset(session_starts, pace_dfs) + + rank_file_df = pd.DataFrame(filenames, columns=["File"]) + rank_file_df.to_parquet(self.add_output_file("files.parquet"), index=False) + + stats_df = summary.aggregate_stats_dfs(stats_dfs) + stats_df.to_parquet(self.add_output_file("stats.parquet")) + + for name, df in pace.split_columns_as_dataframes(pace_dfs).items(): + df.to_parquet(self.add_output_file(f"pace_{name}.parquet"), index=False) + + def save_notebook(self): + self.create_notebook("pace.ipynb") + self.add_notebook_helper_file("nsys_pres.py") + + def save_analysis_file(self): + self._analysis_dict.update( + { + "EndTime": str(datetime.now()), + "InputFiles": self._parsed_args.input, + "Outputs": self._output_files, + } + ) + self.create_analysis_file() + + def run(self, context): + super().run(context) + + mapper_res = self.mapper_func(context) + self.reducer_func(mapper_res) + + self.save_notebook() + self.save_analysis_file() + + @classmethod + def get_argument_parser(cls): + parser = super().get_argument_parser() + + parser.add_recipe_argument(Option.INPUT) + parser.add_recipe_argument(Option.OUTPUT) + parser.add_recipe_argument(Option.FORCE_OVERWRITE) + parser.add_recipe_argument( + "--name", + type=str, + help="Name of the kernel used as delineator between iterations", + required=True, + ) + parser.add_recipe_argument(Option.START) + parser.add_recipe_argument(Option.END) + + return parser diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_kern_pace/metadata.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_kern_pace/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..245eb398e6031b8cd9e7ab8e1a503814223296b2 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_kern_pace/metadata.json @@ -0,0 +1,8 @@ +{ + "module_name": "cuda_gpu_kern_pace", + "display_name": "CUDA GPU Kernel Pacing", + "description": [ + "This recipe investigates the progress and consistency of a particular CUDA", + " kernel throughout the application." + ] +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_kern_pace/pace.ipynb b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_kern_pace/pace.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..63c4ea48c333cec296f64f3ad69d2c5defb147a0 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_kern_pace/pace.ipynb @@ -0,0 +1,324 @@ +{ + "cells": [ + { + "attachments": {}, + "cell_type": "markdown", + "id": "d47405aa-4e8c-4e8d-9e9f-5771f5eb0cd1", + "metadata": {}, + "source": [ + "# CUDA Kernel Iteration Analysis\n", + "Investigate the progress and consistency of an iteration based application. The target kernel is assumed to be a delineator between iterations. This report graphs when the application reaches this kernel(start), how long between kernels (delta), and how long the kernel took, encase it was behaving as a barrier, such as collective communication all-reduce. You will see how long each rank takes in comparison to eachother. The ranks that are taking longer to reach the end of the iteration(delta or kernel start) typically are preventing all the ranks from moving forward to the next iteration and so their performance should be investigated relative to the median or min. Identify the ranks and iterations here. Then investigate their cause by opening the 2-3 ranks (outlier plus median and/or min) in Nsight Systems as a multi-report view.\n", + "\n", + "All times are in nanoseconds." + ] + }, + { + "cell_type": "markdown", + "id": "5cbed268-3ac1-4b76-8be9-0c2b060f1c3a", + "metadata": { + "tags": [] + }, + "source": [ + "## Load Data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0425e7d7", + "metadata": { + "jupyter": { + "source_hidden": true + }, + "tags": [] + }, + "outputs": [], + "source": [ + "#General setup properties\n", + "import IPython.display\n", + "from IPython.display import display, HTML, Markdown\n", + "display(HTML(\"\"))\n", + "\n", + "import pickle\n", + "import importlib\n", + "import os\n", + "import glob\n", + "import math\n", + "import re\n", + "import time\n", + "from collections import deque\n", + "import pandas as pd\n", + "import numpy as np\n", + "import sqlite3\n", + "#!pip3 install plotly\n", + "\n", + "pd.options.plotting.backend = \"plotly\"\n", + "pd.set_option('display.max_rows', 100)\n", + "pd.set_option('display.width', 250)\n", + "\n", + "import nsys_pres" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8cfeaf53-9d41-4a8c-8b2f-82c89a5c2603", + "metadata": {}, + "outputs": [], + "source": [ + "#load the data\n", + "stats_df = pd.read_parquet(\"stats.parquet\")\n", + "files_df = pd.read_parquet(\"files.parquet\").rename_axis(\"Rank\",axis='index')\n", + "\n", + "pace_map_by_column=dict()\n", + "pace_map_by_column['start'] = pd.read_parquet(\"pace_start.parquet\").rename_axis(\"Iterations\",axis='index').rename_axis(\"Ranks\",axis='columns')\n", + "pace_map_by_column['end'] = pd.read_parquet(\"pace_end.parquet\").rename_axis(\"Iterations\",axis='index').rename_axis(\"Ranks\",axis='columns')\n", + "pace_map_by_column['duration'] = pd.read_parquet(\"pace_duration.parquet\").rename_axis(\"Iterations\",axis='index').rename_axis(\"Ranks\",axis='columns')\n", + "pace_map_by_column['duration_accum'] = pd.read_parquet(\"pace_duration_accum.parquet\").rename_axis(\"Iterations\",axis='index').rename_axis(\"Ranks\",axis='columns')\n", + "pace_map_by_column['delta'] = pd.read_parquet(\"pace_delta.parquet\").rename_axis(\"Iterations\",axis='index').rename_axis(\"Ranks\",axis='columns')\n", + "pace_map_by_column['delta_accum'] = pd.read_parquet(\"pace_delta_accum.parquet\").rename_axis(\"Iterations\",axis='index').rename_axis(\"Ranks\",axis='columns')\n", + "pace_map_by_column['delta_stats'] = pd.read_parquet(\"pace_delta_stats.parquet\").rename_axis(\"Iterations\",axis='index').rename_axis(\"Ranks\",axis='columns')\n" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "f330296f-74c5-4378-b982-d0fb95236972", + "metadata": {}, + "source": [ + "## Statistics for Target Operation\n", + "Overall statistics for the target kernel across all ranks.\n", + "* Q1(approx) is the 25th percentile of the dataset. Approximated by the min of Q1 for each rank.\n", + "* Median(approx) is the 50th percentile of the dataset. Approximated by the median of the medians for each rank.\n", + "* Q3(approx) is the 75th percentile of the dataset. Approximated by the max of Q3 for each rank.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ba5bde92-c6bd-4493-a829-4ae84d797bb3", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "display(stats_df.T)" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "2a196ce7-937a-4766-b6b4-e616f7c0dc7b", + "metadata": {}, + "source": [ + "## Start of Target Operation\n", + "Wall-clock time of when each rank reached this operation.\n", + "* The progress graph represents each rank as a line, the x-axis prepresents linear progress. \n", + "* The consistency graph transposes the data, showing a line for each iteration. Visually moving upward from the x-axis, this is when the rank reached this iteration." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "062dbf46-4432-4084-bdc3-0ac93086cc52", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "figs=list()\n", + "\n", + "nsys_pres.display_pace_graph(figs, pace_map_by_column, 'start')" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "5e264faa-63a8-4a14-beda-f51e81198623", + "metadata": { + "tags": [] + }, + "source": [ + "## Delta Between Targets\n", + "The time measured between the target range.\n", + "* A boxplot to understand the distribution of the rank timing per iteration \n", + "* The progress graph represents each rank as a line, the x-axis prepresents linear progress. \n", + "* The consistency graph transposes the data, showing a line for each iteration. Visually moving upward from the x-axis, this is how long each iteration tool. Search here for inconsistencies between ranks to investigate. If the lines are consistent horizontally then each rank completed their work at the same time." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3e075b96-106c-4ea1-bce6-9dc9e2947626", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "\n", + "delta_stats_df = pace_map_by_column['delta_stats']\n", + "\n", + "figs = nsys_pres.display_boxplots_df(None, delta_stats_df.loc[1:],\n", + " title=\"Delta boxplot per iteration (across ranks)\",\n", + " xaxis_title=\"Iteration\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3dc34bc3-5cc6-4c24-af9d-1d0f3e2f974d", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "figs=list()\n", + "nsys_pres.display_pace_graph(figs, pace_map_by_column, 'delta')" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "4f09ae70-fccf-4d54-a604-15fcd4baef4f", + "metadata": {}, + "source": [ + "## Variance in Delta between Targets\n", + "Similar \"Delta between Barriers\", the median time per-iteration is subtracted from the rank's value, typically making the ouliers more obvious if they were subtle above." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6bfd6537-c6c9-4c84-82bb-75f522815730", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "figs=list()\n", + "nsys_pres.display_pace_graph_delta_minus_median(figs, pace_map_by_column)" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "ecd47c77-1166-4257-aaeb-ed0868a2b7e5", + "metadata": { + "tags": [] + }, + "source": [ + "## Delta Accumulated\n", + "This is the accomulated time between the target kernels. This is relevant if the target kernel is a barrier, such as an all-reduce, which must wait for all participants. Assuming that the time in the target kernel is consistent, this may look similar to the graph of starts. If the target kernel is a barrier, it will provide a more accurate picture of how fast the rank is processing it's data overall. This can assist in identifying issues such inconsistent workload distribution, consistently giving a lighter load to a particular rank, or a hardware difference (distance from storage, NUMA setup, GPU or NIC bindings, throttling, etc) " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e5c4dddc-b861-4d1f-9e3c-ef0c0c99e3be", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "figs=list()\n", + "nsys_pres.display_pace_graph(figs, pace_map_by_column, 'delta_accum')" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "d197995f-fdc3-4f16-8ec9-a76d5c471cdb", + "metadata": {}, + "source": [ + "## Duration Accumuled\n", + "Similar to delta accumulation, how long are we spending in the target kernel so far in the application's progress through these iterations? If this is a barrier-like operation it is how long you are blocking." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b45347d0-5461-4d87-b311-f645c2571c0b", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "figs=list()\n", + "nsys_pres.display_pace_graph(figs, pace_map_by_column, 'duration_accum')" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "83b24ace-41f2-414a-ab56-d3e2c45590c0", + "metadata": {}, + "source": [ + "## Duration\n", + "The duration is not accumulated here, so outliers are more likely to stand out." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4a93e3f3-bddc-47c1-a621-2546fd36e8ef", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "figs=list()\n", + "nsys_pres.display_pace_graph(figs, pace_map_by_column, 'duration')" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "06a8af17-8a7e-4d48-9bd8-0fe1bdd979a5", + "metadata": { + "tags": [] + }, + "source": [ + "## Files\n", + "Ranks are assigned assuming that the file names include the rank and sort well. If they are not sufficiently padded with zeros, the real rank may differ from the assigned ID. This table allows you to identify the filename without the charts above having potentially very long label in the legend or x-axis." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "46978d5e-7fab-4b52-bb55-713d50c8eb40", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "display(files_df)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.10 (default, Nov 14 2022, 12:59:47) \n[GCC 9.4.0]" + }, + "vscode": { + "interpreter": { + "hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1" + } + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_kern_sum/cuda_gpu_kern_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_kern_sum/cuda_gpu_kern_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..96f4f66ba7bc76aed3cb49a3673b6b854106873a --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_kern_sum/cuda_gpu_kern_sum.py @@ -0,0 +1,151 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd + +from collections import OrderedDict +from datetime import datetime +from pathlib import Path + +from nsys_recipe import log +from nsys_recipe.data_service import StatsService +from nsys_recipe.lib import helpers, recipe +from nsys_recipe.lib.args import Option +from nsys_recipe.log import logger + + +class CudaGpuKernSum(recipe.Recipe): + @staticmethod + def _mapper_func(report_path, parsed_args): + service = StatsService(report_path) + + df = service.read_sql_report("cuda_gpu_kern_sum", "CudaGpuKernSum", parsed_args) + if df is None: + return None + + if df.empty: + logger.info( + f"{report_path} was successfully processed, but no data was found." + ) + return None + + df["File"] = Path(report_path).stem + return df + + @log.time("Mapper") + def mapper_func(self, context): + return context.wait( + context.map( + self._mapper_func, + self._parsed_args.input, + parsed_args=self._parsed_args, + ) + ) + + def aggregate_stats(self, df): + grouped = df.groupby(df.index.name) + + d = OrderedDict() + total_time = grouped["Total Time"].sum() + d["Time"] = total_time / total_time.sum() * 100 + d["Total Time"] = total_time + d["Instances"] = grouped["Instances"].sum() + d["Avg"] = d["Total Time"] / d["Instances"] + d["Q1"] = grouped["Q1"].min() + d["Med"] = grouped["Med"].median() + d["Q3"] = grouped["Q3"].max() + d["Min"] = grouped["Min"].min() + d["Max"] = grouped["Max"].max() + d["StdDev"] = grouped.apply(lambda x: helpers.stddev(x, d)) + min_value = grouped["Min"].min() + d["Min File"] = grouped.apply( + lambda x: ", ".join(x.loc[x["Min"] == min_value.loc[x.name], "File"]) + ) + max_value = grouped["Max"].max() + d["Max File"] = grouped.apply( + lambda x: ", ".join(x.loc[x["Max"] == max_value.loc[x.name], "File"]) + ) + + aggregated_df = pd.concat(d.values(), axis=1, keys=d.keys()).round(1) + return aggregated_df.sort_values(by=["Total Time"], ascending=False) + + @log.time("Reducer") + def reducer_func(self, dfs): + dfs = helpers.filter_none(dfs) + df = pd.concat(dfs) + + # Remove any tags or hidden columns that are for internal use. + df.columns = df.columns.str.replace("(:).*", "", regex=True) + df.columns = df.columns.str.lstrip("_") + + df = df.set_index("Name") + df = df[ + [ + "Time", + "Total Time", + "Instances", + "Avg", + "Q1", + "Med", + "Q3", + "Min", + "Max", + "StdDev", + "File", + ] + ] + + per_rank_df = df.sort_values(by=["File", "Total Time"], ascending=[True, False]) + all_ranks_df = self.aggregate_stats(df) + + per_rank_df.to_parquet(self.add_output_file("rank_stats.parquet")) + all_ranks_df.to_parquet(self.add_output_file("all_stats.parquet")) + + if self._parsed_args.csv: + per_rank_df.to_csv(self.add_output_file("rank_stats.csv")) + all_ranks_df.to_csv(self.add_output_file("all_stats.csv")) + + def save_notebook(self): + self.create_notebook("stats.ipynb") + self.add_notebook_helper_file("nsys_display.py") + + def save_analysis_file(self): + self._analysis_dict.update( + { + "EndTime": str(datetime.now()), + "InputFiles": self._parsed_args.input, + "Outputs": self._output_files, + } + ) + self.create_analysis_file() + + def run(self, context): + super().run(context) + + mapper_res = self.mapper_func(context) + self.reducer_func(mapper_res) + + self.save_notebook() + self.save_analysis_file() + + @classmethod + def get_argument_parser(cls): + parser = super().get_argument_parser() + + parser.add_recipe_argument(Option.INPUT) + parser.add_recipe_argument(Option.OUTPUT) + parser.add_recipe_argument(Option.FORCE_OVERWRITE) + parser.add_recipe_argument(Option.START) + parser.add_recipe_argument(Option.END) + parser.add_recipe_argument(Option.BASE) + parser.add_recipe_argument(Option.MANGLED) + parser.add_recipe_argument(Option.CSV) + + return parser diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_kern_sum/metadata.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_kern_sum/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..1b68db5161c6d2ffddc0034275a484807d117251 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_kern_sum/metadata.json @@ -0,0 +1,6 @@ +{ + "module_name": "cuda_gpu_kern_sum", + "display_name": "CUDA GPU Kernel Summary", + "description": "This recipe provides a summary of CUDA kernels and their execution times.", + "type": "stats" +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_kern_sum/stats.ipynb b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_kern_sum/stats.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..4c25956913bb25d6dcf92cee3c7594cd87a2c80a --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_kern_sum/stats.ipynb @@ -0,0 +1,136 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# CUDA GPU Kernel Summary" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This notebook provides a summary of CUDA kernels and their execution times." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import plotly.offline as pyo\n", + "\n", + "from IPython.display import display, HTML, Markdown\n", + "\n", + "import nsys_display\n", + "\n", + "display(HTML(\"\"))\n", + "pd.set_option('display.max_colwidth', None)\n", + "pd.set_option('display.max_rows', None)\n", + "pyo.init_notebook_mode()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Overall statistics" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The table shows the statistics across all ranks. Note that:\n", + "* All time values are in nanoseconds.\n", + "* Q1 is the 25th percentile of the data set. Approximated by the min of Q1 for each rank.\n", + "* Median is the 50th percentile of the data set. Approximated by the median of the medians for each rank.\n", + "* Q3 is the 75th percentile of the data set. Approximated by the max of Q3 for each rank.\n", + "* The 'Min File' column displays the names of the ranks that contain the minimum value.\n", + "* The 'Max File' column displays the names of the ranks that contain the maximum value.\n", + "* The 'Time' column is calculated using a summation of the \"Total Time\" column. It represents that function's percent of the execution time of the functions listed and not a percentage of the application wall or CPU execution time." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ranks_df = pd.read_parquet('all_stats.parquet')\n", + "display(ranks_df)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The diagram shows statistical box plots and line graphs for each operation across all ranks.\n", + "\n", + "To toggle the line traces on and off on the graph, click on their corresponding legend entries. When working with large data sets, consider using the .head() function to limit the number of displayed elements or zoom in on the diagram for better visibility." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "nsys_display.display_box(ranks_df, xaxis_title='Name', yaxis_title='Value (ns)')\n", + "nsys_display.display_stats_scatter(ranks_df, xaxis_title='Name', yaxis_title='Value (ns)')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Per-rank statistics" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The table and graphs show statistics of the operation selected from the drop-down menu, for each rank. Note that:\n", + "* All time values are in nanoseconds.\n", + "* 'Q1', 'Med', and 'Q3' are the 25th, 50th, and 75th percentiles of the data set, respectively.\n", + "* The 'Time' column is calculated using a summation of the \"Total Time\" column. It represents that function's percent of the execution time of the functions listed and not a percentage of the application wall or CPU execution time.\n", + "\n", + "To toggle the line traces on and off on the graph, click on their corresponding legend entries. When working with large data sets, consider using the .head() function to limit the number of displayed elements or zoom in on the diagram for better visibility." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "per_rank_df = pd.read_parquet('rank_stats.parquet')\n", + "nsys_display.display_stats_per_operation(per_rank_df, xaxis_title='File', yaxis_title='Value (ns)')" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "name": "python", + "version": "3.10.5" + }, + "orig_nbformat": 4, + "vscode": { + "interpreter": { + "hash": "7e1998ff7f8aa20ada591c520b972326324e5ea05489af9e422744c7c09f6dad" + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_mem_size_sum/cuda_gpu_mem_size_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_mem_size_sum/cuda_gpu_mem_size_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..18e602a0158087be6d34c338ecf37fe4e5aad2b9 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_mem_size_sum/cuda_gpu_mem_size_sum.py @@ -0,0 +1,137 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd + +from collections import OrderedDict +from datetime import datetime +from pathlib import Path + +from nsys_recipe import log +from nsys_recipe.data_service import StatsService +from nsys_recipe.lib import helpers, recipe +from nsys_recipe.lib.args import Option +from nsys_recipe.log import logger + + +class CudaGpuMemSizeSum(recipe.Recipe): + @staticmethod + def _mapper_func(report_path, parsed_args): + service = StatsService(report_path) + + df = service.read_sql_report( + "cuda_gpu_mem_size_sum", "CudaGpuMemSizeSum", parsed_args + ) + if df is None: + return None + + if df.empty: + logger.info( + f"{report_path} was successfully processed, but no data was found." + ) + return None + + df["File"] = Path(report_path).stem + return df + + @log.time("Mapper") + def mapper_func(self, context): + return context.wait( + context.map( + self._mapper_func, + self._parsed_args.input, + parsed_args=self._parsed_args, + ) + ) + + def aggregate_stats(self, df): + grouped = df.groupby(df.index.name) + + d = OrderedDict() + d["Total"] = grouped["Total"].sum() + d["Count"] = grouped["Count"].sum() + d["Avg"] = d["Total"] / d["Count"] + d["Q1"] = grouped["Q1"].min() + d["Med"] = grouped["Med"].median() + d["Q3"] = grouped["Q3"].max() + d["Min"] = grouped["Min"].min() + d["Max"] = grouped["Max"].max() + d["StdDev"] = grouped.apply(lambda x: helpers.stddev(x, d, "Count")) + min_value = grouped["Min"].min() + d["Min File"] = grouped.apply( + lambda x: ", ".join(x.loc[x["Min"] == min_value.loc[x.name], "File"]) + ) + max_value = grouped["Max"].max() + d["Max File"] = grouped.apply( + lambda x: ", ".join(x.loc[x["Max"] == max_value.loc[x.name], "File"]) + ) + + aggregated_df = pd.concat(d.values(), axis=1, keys=d.keys()).round(1) + return aggregated_df.sort_values(by=["Total"], ascending=False) + + @log.time("Reducer") + def reducer_func(self, dfs): + dfs = helpers.filter_none(dfs) + df = pd.concat(dfs) + + # Remove any tags or hidden columns that are for internal use. + df.columns = df.columns.str.replace("(:).*", "", regex=True) + df.columns = df.columns.str.lstrip("_") + + df = df.set_index("Operation") + df = df[ + ["Total", "Count", "Avg", "Q1", "Med", "Q3", "Min", "Max", "StdDev", "File"] + ] + + per_rank_df = df.sort_values(by=["File", "Total"], ascending=[True, False]) + all_ranks_df = self.aggregate_stats(df) + + per_rank_df.to_parquet(self.add_output_file("rank_stats.parquet")) + all_ranks_df.to_parquet(self.add_output_file("all_stats.parquet")) + + if self._parsed_args.csv: + per_rank_df.to_csv(self.add_output_file("rank_stats.csv")) + all_ranks_df.to_csv(self.add_output_file("all_stats.csv")) + + def save_notebook(self): + self.create_notebook("stats.ipynb") + self.add_notebook_helper_file("nsys_display.py") + + def save_analysis_file(self): + self._analysis_dict.update( + { + "EndTime": str(datetime.now()), + "InputFiles": self._parsed_args.input, + "Outputs": self._output_files, + } + ) + self.create_analysis_file() + + def run(self, context): + super().run(context) + + mapper_res = self.mapper_func(context) + self.reducer_func(mapper_res) + + self.save_notebook() + self.save_analysis_file() + + @classmethod + def get_argument_parser(cls): + parser = super().get_argument_parser() + + parser.add_recipe_argument(Option.INPUT) + parser.add_recipe_argument(Option.OUTPUT) + parser.add_recipe_argument(Option.FORCE_OVERWRITE) + parser.add_recipe_argument(Option.START) + parser.add_recipe_argument(Option.END) + parser.add_recipe_argument(Option.CSV) + + return parser diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_mem_size_sum/metadata.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_mem_size_sum/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..d6dd52dd31ed13da03a4ea2b969504f40c60b369 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_mem_size_sum/metadata.json @@ -0,0 +1,9 @@ +{ + "module_name": "cuda_gpu_mem_size_sum", + "display_name": "CUDA GPU MemOps Summary (by Size)", + "description": [ + "This recipe provides a summary of GPU memory operations and the amount of", + " memory they utilize." + ], + "type": "stats" +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_mem_size_sum/stats.ipynb b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_mem_size_sum/stats.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..fba190ff232a19080b3a2e5afa89e1c051d3d0f0 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_mem_size_sum/stats.ipynb @@ -0,0 +1,135 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# CUDA GPU Memory Operation Summary (by Size)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This notebook provides a summary of GPU memory operations and the amount of memory they utilize." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import plotly.offline as pyo\n", + "\n", + "from IPython.display import display, HTML, Markdown\n", + "\n", + "import nsys_display\n", + "\n", + "display(HTML(\"\"))\n", + "pd.set_option('display.max_colwidth', None)\n", + "pd.set_option('display.max_rows', None)\n", + "pyo.init_notebook_mode()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Overall statistics" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The table shows the statistics across all ranks. Note that:\n", + "* All time values are in nanoseconds.\n", + "* Q1 is the 25th percentile of the data set. Approximated by the min of Q1 for each rank.\n", + "* Median is the 50th percentile of the data set. Approximated by the median of the medians for each rank.\n", + "* Q3 is the 75th percentile of the data set. Approximated by the max of Q3 for each rank.\n", + "* The 'Min File' column displays the names of the ranks that contain the minimum value.\n", + "* The 'Max File' column displays the names of the ranks that contain the maximum value." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ranks_df = pd.read_parquet('all_stats.parquet')\n", + "display(ranks_df)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The diagram shows statistical box plots and line graphs for each operation across all ranks.\n", + "\n", + "To toggle the line traces on and off on the graph, click on their corresponding legend entries. When working with large data sets, consider using the .head() function to limit the number of displayed elements or zoom in on the diagram for better visibility." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "nsys_display.display_box(ranks_df, xaxis_title='Name', yaxis_title='Value (ns)')\n", + "nsys_display.display_stats_scatter(ranks_df, xaxis_title='Name', yaxis_title='Value (ns)')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Per-rank statistics" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The table and graphs show statistics of the operation selected from the drop-down menu, for each rank. Note that:\n", + "* All time values are in nanoseconds.\n", + "* 'Q1', 'Med', and 'Q3' are the 25th, 50th, and 75th percentiles of the data set, respectively.\n", + "\n", + "To toggle the line traces on and off on the graph, click on their corresponding legend entries. When working with large data sets, consider using the .head() function to limit the number of displayed elements or zoom in on the diagram for better visibility." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "per_rank_df = pd.read_parquet('rank_stats.parquet')\n", + "nsys_display.display_stats_per_operation(per_rank_df, xaxis_title='File', yaxis_title='Value (ns)')" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "name": "python", + "version": "3.10.5" + }, + "orig_nbformat": 4, + "vscode": { + "interpreter": { + "hash": "7e1998ff7f8aa20ada591c520b972326324e5ea05489af9e422744c7c09f6dad" + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_mem_time_sum/cuda_gpu_mem_time_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_mem_time_sum/cuda_gpu_mem_time_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..2cec48dcd865eb37aae6e87d7dbfd9027493c817 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_mem_time_sum/cuda_gpu_mem_time_sum.py @@ -0,0 +1,151 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd + +from collections import OrderedDict +from datetime import datetime +from pathlib import Path + +from nsys_recipe import log +from nsys_recipe.data_service import StatsService +from nsys_recipe.lib import helpers, recipe +from nsys_recipe.lib.args import Option +from nsys_recipe.log import logger + + +class CudaGpuMemTimeSum(recipe.Recipe): + @staticmethod + def _mapper_func(report_path, parsed_args): + service = StatsService(report_path) + + df = service.read_sql_report( + "cuda_gpu_mem_time_sum", "CudaGpuMemTimeSum", parsed_args + ) + if df is None: + return None + + if df.empty: + logger.info( + f"{report_path} was successfully processed, but no data was found." + ) + return None + + df["File"] = Path(report_path).stem + return df + + @log.time("Mapper") + def mapper_func(self, context): + return context.wait( + context.map( + self._mapper_func, + self._parsed_args.input, + parsed_args=self._parsed_args, + ) + ) + + def aggregate_stats(self, df): + grouped = df.groupby(df.index.name) + + d = OrderedDict() + total_time = grouped["Total Time"].sum() + d["Time"] = total_time / total_time.sum() * 100 + d["Total Time"] = total_time + d["Count"] = grouped["Count"].sum() + d["Avg"] = d["Total Time"] / d["Count"] + d["Q1"] = grouped["Q1"].min() + d["Med"] = grouped["Med"].median() + d["Q3"] = grouped["Q3"].max() + d["Min"] = grouped["Min"].min() + d["Max"] = grouped["Max"].max() + d["StdDev"] = grouped.apply(lambda x: helpers.stddev(x, d, "Count")) + min_value = grouped["Min"].min() + d["Min File"] = grouped.apply( + lambda x: ", ".join(x.loc[x["Min"] == min_value.loc[x.name], "File"]) + ) + max_value = grouped["Max"].max() + d["Max File"] = grouped.apply( + lambda x: ", ".join(x.loc[x["Max"] == max_value.loc[x.name], "File"]) + ) + + aggregated_df = pd.concat(d.values(), axis=1, keys=d.keys()).round(1) + return aggregated_df.sort_values(by=["Total Time"], ascending=False) + + @log.time("Reducer") + def reducer_func(self, dfs): + dfs = helpers.filter_none(dfs) + df = pd.concat(dfs) + + # Remove any tags or hidden columns that are for internal use. + df.columns = df.columns.str.replace("(:).*", "", regex=True) + df.columns = df.columns.str.lstrip("_") + + df = df.set_index("Operation") + df = df[ + [ + "Time", + "Total Time", + "Count", + "Avg", + "Q1", + "Med", + "Q3", + "Min", + "Max", + "StdDev", + "File", + ] + ] + + per_rank_df = df.sort_values(by=["File", "Total Time"], ascending=[True, False]) + all_ranks_df = self.aggregate_stats(df) + + per_rank_df.to_parquet(self.add_output_file("rank_stats.parquet")) + all_ranks_df.to_parquet(self.add_output_file("all_stats.parquet")) + + if self._parsed_args.csv: + per_rank_df.to_csv(self.add_output_file("rank_stats.csv")) + all_ranks_df.to_csv(self.add_output_file("all_stats.csv")) + + def save_notebook(self): + self.create_notebook("stats.ipynb") + self.add_notebook_helper_file("nsys_display.py") + + def save_analysis_file(self): + self._analysis_dict.update( + { + "EndTime": str(datetime.now()), + "InputFiles": self._parsed_args.input, + "Outputs": self._output_files, + } + ) + self.create_analysis_file() + + def run(self, context): + super().run(context) + + mapper_res = self.mapper_func(context) + self.reducer_func(mapper_res) + + self.save_notebook() + self.save_analysis_file() + + @classmethod + def get_argument_parser(cls): + parser = super().get_argument_parser() + + parser.add_recipe_argument(Option.INPUT) + parser.add_recipe_argument(Option.OUTPUT) + parser.add_recipe_argument(Option.FORCE_OVERWRITE) + parser.add_recipe_argument(Option.START) + parser.add_recipe_argument(Option.END) + parser.add_recipe_argument(Option.CSV) + + return parser diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_mem_time_sum/metadata.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_mem_time_sum/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..7121d9ab9a701b594ed00d41af1443208c2adf3d --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_mem_time_sum/metadata.json @@ -0,0 +1,9 @@ +{ + "module_name": "cuda_gpu_mem_time_sum", + "display_name": "CUDA GPU MemOps Summary (by Time)", + "description": [ + "This recipe provides a summary of GPU memory operations and their execution", + " times." + ], + "type": "stats" +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_mem_time_sum/stats.ipynb b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_mem_time_sum/stats.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..34406dc3b20c2578b95e06ec148eaf2b58645117 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_mem_time_sum/stats.ipynb @@ -0,0 +1,137 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# CUDA GPU Memory Operation Summary (by Time)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This notebook provides a summary of GPU memory operations and their execution times." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import plotly.offline as pyo\n", + "\n", + "from IPython.display import display, HTML, Markdown\n", + "\n", + "import nsys_display\n", + "\n", + "display(HTML(\"\"))\n", + "pd.set_option('display.max_colwidth', None)\n", + "pd.set_option('display.max_rows', None)\n", + "pyo.init_notebook_mode()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Overall statistics" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The table shows the statistics across all ranks. Note that:\n", + "* All time values are in nanoseconds.\n", + "* Q1 is the 25th percentile of the data set. Approximated by the min of Q1 for each rank.\n", + "* Median is the 50th percentile of the data set. Approximated by the median of the medians for each rank.\n", + "* Q3 is the 75th percentile of the data set. Approximated by the max of Q3 for each rank.\n", + "* The 'Min File' column displays the names of the ranks that contain the minimum value.\n", + "* The 'Max File' column displays the names of the ranks that contain the maximum value.\n", + "* The 'Time' column is calculated using a summation of the \"Total Time\" column. It represents that function's percent of the execution time of the functions listed and not a percentage of the application wall or CPU execution time." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ranks_df = pd.read_parquet('all_stats.parquet')\n", + "display(ranks_df)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The diagram shows statistical box plots and line graphs for each operation across all ranks.\n", + "\n", + "To toggle the line traces on and off on the graph, click on their corresponding legend entries. When working with large data sets, consider using the .head() function to limit the number of displayed elements or zoom in on the diagram for better visibility." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "nsys_display.display_box(ranks_df, xaxis_title='Name', yaxis_title='Value (ns)')\n", + "nsys_display.display_stats_scatter(ranks_df, xaxis_title='Name', yaxis_title='Value (ns)')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Per-rank statistics" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The table and graphs show statistics of the operation selected from the drop-down menu, for each rank. Note that:\n", + "* All time values are in nanoseconds.\n", + "* 'Q1', 'Med', and 'Q3' are the 25th, 50th, and 75th percentiles of the data set, respectively.\n", + "* The 'Time' column is calculated using a summation of the \"Total Time\" column. It represents that function's percent of the execution time of the functions listed and not a percentage of the application wall or CPU execution time.\n", + "\n", + "To toggle the line traces on and off on the graph, click on their corresponding legend entries. When working with large data sets, consider using the .head() function to limit the number of displayed elements or zoom in on the diagram for better visibility." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "per_rank_df = pd.read_parquet('rank_stats.parquet')\n", + "nsys_display.display_stats_per_operation(per_rank_df, xaxis_title='File', yaxis_title='Value (ns)')" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "name": "python", + "version": "3.10.5" + }, + "orig_nbformat": 4, + "vscode": { + "interpreter": { + "hash": "7e1998ff7f8aa20ada591c520b972326324e5ea05489af9e422744c7c09f6dad" + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_time_util_map/cuda_gpu_time_util_map.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_time_util_map/cuda_gpu_time_util_map.py new file mode 100644 index 0000000000000000000000000000000000000000..5e910ec11c4aad9d80d86da6e42e444914ea26e2 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_time_util_map/cuda_gpu_time_util_map.py @@ -0,0 +1,152 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd + +from pathlib import Path +from datetime import datetime + +from nsys_recipe import log, data_service +from nsys_recipe.data_service import DataService +from nsys_recipe.lib import helpers, recipe, heatmap +from nsys_recipe.lib.args import Option +from nsys_recipe.lib.collective_loader import ProfileInfo +from nsys_recipe.log import logger + + +class CudaGpuTimeUtilMap(recipe.Recipe): + @staticmethod + def _mapper_func(report_path, bin_size, min_session, parsed_args): + service = DataService(report_path) + + table_column_dict = { + "ANALYSIS_DETAILS": ["duration"], + "CUPTI_ACTIVITY_KIND_KERNEL": [ + "correlationId", + "globalPid", + "start", + "end", + "deviceId", + ], + "TARGET_INFO_SESSION_START_TIME": ["utcEpochNs"], + } + + df_dict = service.read_tables(table_column_dict) + if df_dict is None: + return None + + kernel_df = df_dict["CUPTI_ACTIVITY_KIND_KERNEL"] + session_offset, profile_duration = data_service.compute_session_duration( + df_dict["ANALYSIS_DETAILS"], + df_dict["TARGET_INFO_SESSION_START_TIME"], + min_session, + ) + + data_service.filter_by_time_range(kernel_df, parsed_args.start, parsed_args.end) + data_service.apply_time_offset(kernel_df, session_offset) + + if kernel_df.empty: + logger.info( + f"{report_path} was successfully processed, but no data was found." + ) + return None + + kernel_df["pid"] = data_service.extract_pid(kernel_df["globalPid"]) + kernel_grouped = kernel_df.groupby(["pid", "deviceId"]) + + results = [] + + for (pid, deviceId), group_df in kernel_grouped: + if not parsed_args.cumulative: + group_df = heatmap.consolidate_ranges(group_df) + + bin_pcts = heatmap.calculate_bin_pcts( + group_df, bin_size, parsed_args.bins, profile_duration, session_offset + ) + + data = { + "Duration": heatmap.generate_bin_list(parsed_args.bins, bin_size), + "Kernel": bin_pcts, + "PID": pid, + "Device ID": deviceId, + } + results.append(pd.DataFrame(data)) + + pct_df = pd.concat(results, ignore_index=True) + pct_df["File"] = Path(report_path).stem + + return pct_df + + @log.time("Mapper") + def mapper_func(self, context, filtered_dir, bin_size, min_session): + return context.wait( + context.map( + self._mapper_func, + filtered_dir, + bin_size=bin_size, + min_session=min_session, + parsed_args=self._parsed_args, + ) + ) + + @log.time("Reducer") + def reducer_func(self, dfs): + dfs = helpers.filter_none(dfs) + df = pd.concat(dfs) + + df.to_parquet(self.add_output_file("analysis.parquet")) + + def save_notebook(self): + self.create_notebook( + "heatmap.ipynb", replace_dict={"REPLACE_BIN": self._parsed_args.bins} + ) + self.add_notebook_helper_file("nsys_display.py") + + def save_analysis_file(self): + self._analysis_dict.update( + { + "EndTime": str(datetime.now()), + "InputFiles": self._parsed_args.input, + "Outputs": self._output_files, + } + ) + self.create_analysis_file() + + def run(self, context): + super().run(context) + + max_duration, min_session, filtered_dir = ProfileInfo.get_profile_info( + context, self._parsed_args.input + ) + bin_size = heatmap.get_bin_size(self._parsed_args.bins, max_duration) + + mapper_res = self.mapper_func(context, filtered_dir, bin_size, min_session) + self.reducer_func(mapper_res) + + self.save_notebook() + self.save_analysis_file() + + @classmethod + def get_argument_parser(cls): + parser = super().get_argument_parser() + + parser.add_recipe_argument(Option.INPUT) + parser.add_recipe_argument(Option.OUTPUT) + parser.add_recipe_argument(Option.FORCE_OVERWRITE) + parser.add_recipe_argument(Option.START) + parser.add_recipe_argument(Option.END) + parser.add_recipe_argument(Option.BINS) + parser.add_recipe_argument( + "--cumulative", + action="store_true", + help="Add up the utilization of all kernels within each bin.\n" + " The utilization can exceed 100%% if multiple kernels are running concurrently", + ) + return parser diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_time_util_map/heatmap.ipynb b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_time_util_map/heatmap.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..e0a9dc2504166942c25f2c51b915779a1628e940 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_time_util_map/heatmap.ipynb @@ -0,0 +1,93 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# CUDA GPU Time Utilization Heatmap" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import plotly.offline as pyo\n", + "\n", + "from IPython.display import display, HTML, Markdown\n", + "\n", + "import nsys_display\n", + "\n", + "display(HTML(''))\n", + "pd.set_option('display.max_colwidth', None)\n", + "pd.set_option('display.max_rows', None)\n", + "pyo.init_notebook_mode()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This line graph displays the summary GPU time utilization of CUDA kernels:\n", + "* x axis represents the rank duration, scaling from 0 to the maximum duration across all ranks.\n", + "* y axis represents the mean utilization value across all ranks." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "df = pd.read_parquet('analysis.parquet')\n", + "# Create unique name.\n", + "df['Name'] = df['File'] + '/' + df['Device ID'].astype(str) + '/' + df['PID'].astype(str)\n", + "# Convert ns to s.\n", + "df['Duration'] = df['Duration'] * 1e-9\n", + "\n", + "nsys_display.display_summary_graph(\n", + " df,\n", + " 'Kernel',\n", + " xaxis_title=\"Duration (s)\",\n", + " yaxis_title=\"Value (%)\",\n", + " title=\"Utilization Summary (bins=REPLACE_BIN)\"\n", + ")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This heatmap displays the GPU time utilization of CUDA kernels:\n", + "* x axis represents the rank duration, scaling from 0 to the maximum duration across all ranks.\n", + "* y axis represents the set of File/Device/PID for which utilization data was collected." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "nsys_display.display_heatmap(\n", + " df,\n", + " 'Kernel',\n", + " xaxis_title=\"Duration (s)\",\n", + " yaxis_title=\"File/Device/PID\",\n", + " zaxis_title=\"Value (%)\",\n", + " title=\"Utilization Summary (bins=REPLACE_BIN)\"\n", + ")" + ] + } + ], + "metadata": { + "language_info": { + "name": "python" + }, + "orig_nbformat": 4 + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_time_util_map/metadata.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_time_util_map/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..d89f67fd064ab8e3dfab74fb523a6e369c31ac67 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_gpu_time_util_map/metadata.json @@ -0,0 +1,11 @@ +{ + "module_name": "cuda_gpu_time_util_map", + "display_name": "CUDA GPU Time Utilization Heatmap", + "description": [ + "This recipe calculates the percentage of GPU utilization of CUDA kernels. Note", + " that the utilization refers to the 'time' utilization and not the 'resource'", + " utilization. By default, the recipe calculates consolidated utilization by", + " taking the minimum start time and maximum end time for each group of", + " overlapping kernel ranges when multiple kernels run concurrently." + ] +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_memcpy_async/analysis.ipynb b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_memcpy_async/analysis.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..e662936a843d9fc2deb5c817a6a04c45b4a62b09 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_memcpy_async/analysis.ipynb @@ -0,0 +1,77 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# CUDA Asynchronous Memcpy with Pageable Memory" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This notebook identifies APIs using PAGEABLE memory which causes asynchronous memory operations to block and be executed synchronously. This leads to low GPU utilization.\n", + "\n", + "Suggestion: If applicable, use PINNED memory instead." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import plotly.offline as pyo\n", + "\n", + "from IPython.display import display, HTML, Markdown\n", + "\n", + "import nsys_display\n", + "\n", + "display(HTML(\"\"))\n", + "pd.set_option('display.max_colwidth', None)\n", + "pd.set_option('display.max_rows', None)\n", + "pyo.init_notebook_mode()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The table shows analysis results for each individual rank selected from the drop-down menu.\n", + "\n", + "All time values are in nanoseconds." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "df = pd.read_parquet('analysis.parquet')\n", + "nsys_display.display_table_per_rank(df)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "name": "python", + "version": "3.10.5" + }, + "orig_nbformat": 4, + "vscode": { + "interpreter": { + "hash": "7e1998ff7f8aa20ada591c520b972326324e5ea05489af9e422744c7c09f6dad" + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_memcpy_async/cuda_memcpy_async.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_memcpy_async/cuda_memcpy_async.py new file mode 100644 index 0000000000000000000000000000000000000000..09873857a3c0ffb5c0575cf3b6dc163fdf8326e5 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_memcpy_async/cuda_memcpy_async.py @@ -0,0 +1,99 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd + +from datetime import datetime +from pathlib import Path + +from nsys_recipe import log +from nsys_recipe.data_service import StatsService +from nsys_recipe.lib import helpers, recipe +from nsys_recipe.lib.args import Option +from nsys_recipe.log import logger + + +class CudaMemcpyAsync(recipe.Recipe): + @staticmethod + def _mapper_func(report_path, parsed_args): + service = StatsService(report_path) + + df = service.read_sql_report( + "cuda_memcpy_async", "CudaMemcpyAsync", parsed_args + ) + if df is None: + return None + + if df.empty: + logger.info( + f"{report_path} was successfully processed, but no data was found." + ) + return None + + df["File"] = Path(report_path).stem + return df + + @log.time("Mapper") + def mapper_func(self, context): + return context.wait( + context.map( + self._mapper_func, + self._parsed_args.input, + parsed_args=self._parsed_args, + ) + ) + + @log.time("Reducer") + def reducer_func(self, dfs): + dfs = helpers.filter_none(dfs) + df = pd.concat(dfs) + + # Remove any tags or hidden columns that are for internal use. + df.columns = df.columns.str.replace("(:).*", "", regex=True) + df = df.loc[:, ~df.columns.str.startswith("_")] + + df.to_parquet(self.add_output_file("analysis.parquet")) + + def save_notebook(self): + self.create_notebook("analysis.ipynb") + self.add_notebook_helper_file("nsys_display.py") + + def save_analysis_file(self): + self._analysis_dict.update( + { + "EndTime": str(datetime.now()), + "InputFiles": self._parsed_args.input, + "Outputs": self._output_files, + } + ) + self.create_analysis_file() + + def run(self, context): + super().run(context) + + mapper_res = self.mapper_func(context) + self.reducer_func(mapper_res) + + self.save_notebook() + self.save_analysis_file() + + @classmethod + def get_argument_parser(cls): + parser = super().get_argument_parser() + + parser.add_recipe_argument(Option.INPUT) + parser.add_recipe_argument(Option.OUTPUT) + parser.add_recipe_argument(Option.FORCE_OVERWRITE) + parser.add_recipe_argument(Option.START) + parser.add_recipe_argument(Option.END) + parser.add_recipe_argument(Option.NVTX) + parser.add_recipe_argument(Option.ROWS) + + return parser diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_memcpy_async/metadata.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_memcpy_async/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..36b29317c7ff55a8bab057873c0097d60750c34d --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_memcpy_async/metadata.json @@ -0,0 +1,8 @@ +{ + "module_name": "cuda_memcpy_async", + "display_name": "CUDA Async Memcpy with Pageable Memory", + "description": [ + "This recipe identifies asynchronous memory transfers that end up becoming", + " synchronous if the memory is pageable." + ] +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_memcpy_sync/analysis.ipynb b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_memcpy_sync/analysis.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..721c80f1c5dca1930df78e431f7b58d35614fbab --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_memcpy_sync/analysis.ipynb @@ -0,0 +1,77 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# CUDA Synchronous Memcpy" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This notebook identifies synchronous memory transfers that block the host. It does not include cudaMemcpy*() (no Async suffix) occurred within the same device as well as H2D copy kind with a memory block of 64 KB or less.\n", + "\n", + "Suggestion: Use cudaMemcpy*Async() APIs instead." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import plotly.offline as pyo\n", + "\n", + "from IPython.display import display, HTML, Markdown\n", + "\n", + "import nsys_display\n", + "\n", + "display(HTML(\"\"))\n", + "pd.set_option('display.max_colwidth', None)\n", + "pd.set_option('display.max_rows', None)\n", + "pyo.init_notebook_mode()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The table shows analysis results for each individual rank selected from the drop-down menu.\n", + "\n", + "All time values are in nanoseconds." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "df = pd.read_parquet('analysis.parquet')\n", + "nsys_display.display_table_per_rank(df)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "name": "python", + "version": "3.10.5" + }, + "orig_nbformat": 4, + "vscode": { + "interpreter": { + "hash": "7e1998ff7f8aa20ada591c520b972326324e5ea05489af9e422744c7c09f6dad" + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_memcpy_sync/cuda_memcpy_sync.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_memcpy_sync/cuda_memcpy_sync.py new file mode 100644 index 0000000000000000000000000000000000000000..b7398d8c5bf8fa4b9b5468962540d47e54f8de78 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_memcpy_sync/cuda_memcpy_sync.py @@ -0,0 +1,97 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd + +from datetime import datetime +from pathlib import Path + +from nsys_recipe import log +from nsys_recipe.data_service import StatsService +from nsys_recipe.lib import helpers, recipe +from nsys_recipe.lib.args import Option +from nsys_recipe.log import logger + + +class CudaMemcpySync(recipe.Recipe): + @staticmethod + def _mapper_func(report_path, parsed_args): + service = StatsService(report_path) + + df = service.read_sql_report("cuda_memcpy_sync", "CudaMemcpySync", parsed_args) + if df is None: + return None + + if df.empty: + logger.info( + f"{report_path} was successfully processed, but no data was found." + ) + return None + + df["File"] = Path(report_path).stem + return df + + @log.time("Mapper") + def mapper_func(self, context): + return context.wait( + context.map( + self._mapper_func, + self._parsed_args.input, + parsed_args=self._parsed_args, + ) + ) + + @log.time("Reducer") + def reducer_func(self, dfs): + dfs = helpers.filter_none(dfs) + df = pd.concat(dfs) + + # Remove any tags or hidden columns that are for internal use. + df.columns = df.columns.str.replace("(:).*", "", regex=True) + df = df.loc[:, ~df.columns.str.startswith("_")] + + df.to_parquet(self.add_output_file("analysis.parquet")) + + def save_notebook(self): + self.create_notebook("analysis.ipynb") + self.add_notebook_helper_file("nsys_display.py") + + def save_analysis_file(self): + self._analysis_dict.update( + { + "EndTime": str(datetime.now()), + "InputFiles": self._parsed_args.input, + "Outputs": self._output_files, + } + ) + self.create_analysis_file() + + def run(self, context): + super().run(context) + + mapper_res = self.mapper_func(context) + self.reducer_func(mapper_res) + + self.save_notebook() + self.save_analysis_file() + + @classmethod + def get_argument_parser(cls): + parser = super().get_argument_parser() + + parser.add_recipe_argument(Option.INPUT) + parser.add_recipe_argument(Option.OUTPUT) + parser.add_recipe_argument(Option.FORCE_OVERWRITE) + parser.add_recipe_argument(Option.START) + parser.add_recipe_argument(Option.END) + parser.add_recipe_argument(Option.NVTX) + parser.add_recipe_argument(Option.ROWS) + + return parser diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_memcpy_sync/metadata.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_memcpy_sync/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..1dca66ffd4eb5f83e97248422679b4de8077865b --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_memcpy_sync/metadata.json @@ -0,0 +1,9 @@ +{ + "module_name": "cuda_memcpy_sync", + "display_name": "CUDA Synchronous Memcpy", + "description": [ + "This recipe identifies memory transfers that are synchronous. It does not", + " include cudaMemcpy*() (no Async suffix) occurred within the same device as", + " well as H2D copy kind with a memory block of 64 KB or less." + ] +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_memset_sync/analysis.ipynb b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_memset_sync/analysis.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..6b11890fe0f0081ede8a007d3a6029b9d001fd77 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_memset_sync/analysis.ipynb @@ -0,0 +1,79 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# CUDA Synchronous Memset" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This notebook identifies synchronous memset operations with pinned host memory or Unified Memory region, that block the host until all issued CUDA calls are complete.\n", + "\n", + "Suggestions:\n", + "1. Avoid excessive use of synchronization.\n", + "2. Use asynchronous CUDA event calls, such as cudaStreamWaitEvent() and cudaEventSynchronize(), to prevent host synchronization." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import plotly.offline as pyo\n", + "\n", + "from IPython.display import display, HTML, Markdown\n", + "\n", + "import nsys_display\n", + "\n", + "display(HTML(\"\"))\n", + "pd.set_option('display.max_colwidth', None)\n", + "pd.set_option('display.max_rows', None)\n", + "pyo.init_notebook_mode()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The table shows analysis results for each individual rank selected from the drop-down menu.\n", + "\n", + "All time values are in nanoseconds." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "df = pd.read_parquet('analysis.parquet')\n", + "nsys_display.display_table_per_rank(df)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "name": "python", + "version": "3.10.5" + }, + "orig_nbformat": 4, + "vscode": { + "interpreter": { + "hash": "7e1998ff7f8aa20ada591c520b972326324e5ea05489af9e422744c7c09f6dad" + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_memset_sync/cuda_memset_sync.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_memset_sync/cuda_memset_sync.py new file mode 100644 index 0000000000000000000000000000000000000000..e99b21c464efbbfcf411649f6adfc168ba3b1e9f --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_memset_sync/cuda_memset_sync.py @@ -0,0 +1,97 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd + +from datetime import datetime +from pathlib import Path + +from nsys_recipe import log +from nsys_recipe.data_service import StatsService +from nsys_recipe.lib import helpers, recipe +from nsys_recipe.lib.args import Option +from nsys_recipe.log import logger + + +class CudaMemsetSync(recipe.Recipe): + @staticmethod + def _mapper_func(report_path, parsed_args): + service = StatsService(report_path) + + df = service.read_sql_report("cuda_memset_sync", "CudaMemsetSync", parsed_args) + if df is None: + return None + + if df.empty: + logger.info( + f"{report_path} was successfully processed, but no data was found." + ) + return None + + df["File"] = Path(report_path).stem + return df + + @log.time("Mapper") + def mapper_func(self, context): + return context.wait( + context.map( + self._mapper_func, + self._parsed_args.input, + parsed_args=self._parsed_args, + ) + ) + + @log.time("Reducer") + def reducer_func(self, dfs): + dfs = helpers.filter_none(dfs) + df = pd.concat(dfs) + + # Remove any tags or hidden columns that are for internal use. + df.columns = df.columns.str.replace("(:).*", "", regex=True) + df = df.loc[:, ~df.columns.str.startswith("_")] + + df.to_parquet(self.add_output_file("analysis.parquet")) + + def save_notebook(self): + self.create_notebook("analysis.ipynb") + self.add_notebook_helper_file("nsys_display.py") + + def save_analysis_file(self): + self._analysis_dict.update( + { + "EndTime": str(datetime.now()), + "InputFiles": self._parsed_args.input, + "Outputs": self._output_files, + } + ) + self.create_analysis_file() + + def run(self, context): + super().run(context) + + mapper_res = self.mapper_func(context) + self.reducer_func(mapper_res) + + self.save_notebook() + self.save_analysis_file() + + @classmethod + def get_argument_parser(cls): + parser = super().get_argument_parser() + + parser.add_recipe_argument(Option.INPUT) + parser.add_recipe_argument(Option.OUTPUT) + parser.add_recipe_argument(Option.FORCE_OVERWRITE) + parser.add_recipe_argument(Option.START) + parser.add_recipe_argument(Option.END) + parser.add_recipe_argument(Option.NVTX) + parser.add_recipe_argument(Option.ROWS) + + return parser diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_memset_sync/metadata.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_memset_sync/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..1bdc676c4a0fc9bbda2f6ca8ff663ae0afb31003 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/cuda_memset_sync/metadata.json @@ -0,0 +1,8 @@ +{ + "module_name": "cuda_memset_sync", + "display_name": "CUDA Synchronous Memset", + "description": [ + "This recipe identifies synchronous memset operations with pinned host memory or", + " Unified Memory region." + ] +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/diff/diff.ipynb b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/diff/diff.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..2590e94b9f6e3968db81dd086c6215a7bdd65296 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/diff/diff.ipynb @@ -0,0 +1,132 @@ +{ + "cells": [ + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Statistics Diff" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This notebook compares results from two runs of the same recipe." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import plotly.offline as pyo\n", + "\n", + "from IPython.display import display, HTML, Markdown\n", + "\n", + "import nsys_display\n", + "\n", + "display(HTML(\"\"))\n", + "pd.set_option('display.max_colwidth', None)\n", + "pd.set_option('display.max_rows', None)\n", + "pyo.init_notebook_mode()" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Overall statistics diff" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The table shows the difference values for each operation. Note that:\n", + "* All time values are in nanoseconds.\n", + "* Q1 is the 25th percentile of the data set. Approximated by the min of Q1 for each rank.\n", + "* Median is the 50th percentile of the data set. Approximated by the median of the medians for each rank.\n", + "* Q3 is the 75th percentile of the data set. Approximated by the max of Q3 for each rank." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ranks_df = pd.read_parquet('all_stats.parquet')\n", + "display(ranks_df)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The line graphs shows the difference values for each operation.\n", + "\n", + "To toggle the line traces on and off on the graph, click on their corresponding legend entries." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "nsys_display.display_stats_scatter(ranks_df, xaxis_title='Name', yaxis_title='Diff Value (ns)')" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Per-rank statistics diff" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The table and graphs show the difference values of the operation selected from the drop-down menu, for each rank.\n", + "\n", + "To toggle the line traces on and off on the graph, click on their corresponding legend entries. When working with large data sets, consider using the .head() function to limit the number of displayed elements or zoom in on the diagram for better visibility." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "per_rank_df = pd.read_parquet('rank_stats.parquet')\n", + "nsys_display.display_stats_per_operation(per_rank_df, box=False, xaxis_title='File', yaxis_title='Diff Value (ns)')" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "name": "python", + "version": "3.10.5" + }, + "orig_nbformat": 4, + "vscode": { + "interpreter": { + "hash": "7e1998ff7f8aa20ada591c520b972326324e5ea05489af9e422744c7c09f6dad" + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/diff/diff.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/diff/diff.py new file mode 100644 index 0000000000000000000000000000000000000000..f4cc74ab2bd1448723a30e289ccfb86d8a2a660c --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/diff/diff.py @@ -0,0 +1,228 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd +import os +import json +import glob +import argparse + +from datetime import datetime +from pathlib import Path + +from nsys_recipe import log, nsys_constants +from nsys_recipe.lib import exceptions, recipe, recipe_loader +from nsys_recipe.lib.args import Option + + +def print_stats_recipes(): + print("\nThe following recipes are compatible:\n") + + recipe_names = os.listdir(nsys_constants.NSYS_RECIPE_RECIPES_PATH) + recipe_names.sort() + + for recipe_name in recipe_names: + metadata = recipe_loader.get_metadata_dict( + nsys_constants.NSYS_RECIPE_RECIPES_PATH, recipe_name + ) + if metadata is None: + continue + + if metadata.get("type") == "stats": + print(f" {recipe_name}") + + +def get_recipe_name_from_output(output_dir): + analysis_file = glob.glob(os.path.join(output_dir, "*.nsys-analysis")) + + if len(analysis_file) != 1: + raise exceptions.ValueError("The nsys-analysis file could not be found.") + + with open(analysis_file[0]) as f: + data = json.load(f) + + return data.get("RecipeName") + + +def process_input(path): + if not os.path.exists(path): + raise argparse.ArgumentTypeError(f"{path} does not exist.") + return os.path.abspath(path) + + +class Diff(recipe.Recipe): + @staticmethod + def _mapper_func(file_pair, parsed_args): + file1, file2 = file_pair + # file1 and file2 have the same basename. + df1 = pd.read_parquet(file1) + df2 = pd.read_parquet(file2) + + if not df1.columns.equals(df2.columns) or df1.index.name != df2.index.name: + raise exceptions.ValueError( + "Incompatible dataframes." + " Please verify that both directories were created using the same recipe version." + ) + + if Path(file1).stem == "rank_stats": + unique_ranks1 = df1["File"].unique() + unique_ranks2 = df2["File"].unique() + + if len(unique_ranks1) != len(unique_ranks2): + raise exceptions.ValueError( + "The dataframes to compare must contain the same number of ranks." + ) + + # Handle case where the two dataframes have different report file + # names for the same rank. We assume that the same rank in each + # dataframe will correspond to the same index. + mapping_dict = dict(zip(sorted(unique_ranks2), sorted(unique_ranks1))) + df2 = df2.replace({"File": mapping_dict}) + + df1 = df1.set_index("File", append=True) + df2 = df2.set_index("File", append=True) + + # Select only numerical columns of interest on df1 and df2. + df1 = df1.select_dtypes(include="number") + df2 = df2.select_dtypes(include="number") + + df2 = df2.reindex(df1.index) + + diff_df = df1.subtract(df2) + + if parsed_args.tolerance: + diff_df = diff_df.applymap( + lambda x: 0 if abs(x) <= parsed_args.tolerance else x + ) + + if parsed_args.drop: + diff_df = diff_df[(diff_df != 0).any(axis=1)] + + if Path(file1).stem == "rank_stats": + diff_df = diff_df.reset_index(level="File") + + return Path(file1).stem, diff_df + + @log.time("Mapper") + def mapper_func(self, context, file_pairs): + return context.wait( + context.map(self._mapper_func, file_pairs, parsed_args=self._parsed_args) + ) + + @log.time("Reducer") + def reducer_func(self, mapper_res): + # The order of the futures may not correspond to the order of inputs. + # Thus we use the basename of the mapper_res to save the diff df. + for basename, diff_df in mapper_res: + diff_df.to_parquet(self.add_output_file(f"{basename}.parquet")) + + if self._parsed_args.csv: + diff_df.to_csv(self.add_output_file(f"{basename}.csv")) + + def save_notebook(self): + self.create_notebook("diff.ipynb") + self.add_notebook_helper_file("nsys_display.py") + + def save_analysis_file(self): + self._analysis_dict.update( + { + "DisplayName": self.get_metadata("display_name") + " Diff", + "EndTime": str(datetime.now()), + "DiffDirs": self._parsed_args.input, + "Outputs": self._output_files, + } + ) + self.create_analysis_file() + + def get_stats_recipe_name(self): + df1, df2 = self._parsed_args.input + recipe_name1 = get_recipe_name_from_output(df1) + recipe_name2 = get_recipe_name_from_output(df2) + + if recipe_name1 != recipe_name2: + raise exceptions.ValueError( + "The two directories must be an output of the same recipe." + ) + elif recipe_name1 is None: + raise exceptions.ValueError( + "Could not find the recipe used to generate the output directories." + ) + + return recipe_name1 + + def pair_stats_files(self): + filepaths = [] + filenames = ("rank_stats.parquet", "all_stats.parquet") + + for output_dir in self._parsed_args.input: + file_set = [] + + for filename in filenames: + filepath = os.path.join(output_dir, filename) + + if not os.path.exists(filepath): + raise exceptions.ValueError(f"{filepath} could not be found.") + + file_set.append(filepath) + filepaths.append(file_set) + + return list(zip(*filepaths)) + + def run(self, context): + if self._parsed_args.print_compat_recipes: + print_stats_recipes() + return + + recipe_name = self.get_stats_recipe_name() + file_pairs = self.pair_stats_files() + + self.set_default_output_name(recipe_name + "-diff") + + mapper_res = self.mapper_func(context, file_pairs) + self.reducer_func(mapper_res) + + self.save_notebook() + self.save_analysis_file() + + @classmethod + def get_argument_parser(cls): + parser = super().get_argument_parser() + + mutually_exclusive_group = parser.recipe_group.add_mutually_exclusive_group( + required=True + ) + mutually_exclusive_group.add_argument( + "--input", + nargs=2, + type=process_input, + metavar=("DIR1", "DIR2"), + help="Paths to recipe output directories to compare", + ) + mutually_exclusive_group.add_argument( + "--print-compat-recipes", + action="store_true", + help="Print recipes that can be used to generate the outputs to diff", + ) + + parser.add_recipe_argument( + "--tolerance", + type=int, + default=0, + help="Replace values smaller than the specified tolerance with 0", + ) + parser.add_recipe_argument( + "--drop", + action="store_true", + help="Drop rows where all values are less than 0", + ) + + parser.add_recipe_argument(Option.CSV) + + return parser diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/diff/metadata.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/diff/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..bed5d1b771be1a118246b9e0c026779b342ab7d4 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/diff/metadata.json @@ -0,0 +1,5 @@ +{ + "module_name": "diff", + "display_name": "Statistics Diff", + "description": "This script compares outputs from two runs of the same statistical recipe." +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/dx12_mem_ops/analysis.ipynb b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/dx12_mem_ops/analysis.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..651db49c71bbe4de97220930cebbb205caa3f440 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/dx12_mem_ops/analysis.ipynb @@ -0,0 +1,108 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# DX12 Memory Operations" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This notebook identifies memory operations with the following warnings:\n", + "1. HEAP_CREATED_WITH_ZEROING: ID3D12Heap object created with zeroing.\n", + " Add D3D12_HEAP_FLAG_CREATE_NOT_ZEROED to pDesc->Flags to avoid overhead\n", + " of zeroing.\n", + "2. COMMITTED_RESOURCE_CREATED_WITH_ZEROING: Committed ID3D12Resource\n", + " object created with zeroing.\n", + " Add D3D12_HEAP_FLAG_CREATE_NOT_ZEROED to HeapFlags to avoid overhead of\n", + " zeroing.\n", + "3. NONEMPTY_MAP_FROM_UPLOAD_HEAP: Non-empty ID3D12Resource::Map from\n", + " upload heap.\n", + " Upload heaps are not optimized for reading data back to the CPU.\n", + "4. NONEMPTY_MAP_TO_WRITE_COMBINE_PAGE: Non-empty ID3D12Resource::Map to\n", + " write-combine CPU page.\n", + " Write-combine pages are not optimized for reading data back from the\n", + " GPU.\n", + "5. NONEMPTY_UNMAP_TO_READBACK_HEAP: Non-empty ID3D12Resource::Unmap to\n", + " readback heap.\n", + " Readback heaps are not optimized for uploading data from the CPU.\n", + "6. NONEMPTY_UNMAP_FROM_WRITE_BACK_PAGE: Non-empty ID3D12Resource::Unmap\n", + " from write-back CPU page.\n", + " Write-back pages are not optimized for uploading data to the GPU.\n", + "7. READ_FROM_UPLOAD_HEAP_SUBRESOURCE: ID3D12Resource::ReadFromSubresource\n", + " from upload heap.\n", + " Upload heaps are not optimized for reading data back to the CPU.\n", + "8. READ_FROM_SUBRESOURCE_TO_WRITE_COMBINE_PAGE:\n", + " ID3D12Resource::ReadFromSubresource to write-combine CPU page.\n", + " Write-combine pages are not optimized for reading data back from the\n", + " GPU.\n", + "9. WRITE_TO_READBACK_HEAP_SUBRESOURCE: ID3D12Resource::WriteToSubresource\n", + " to readback heap.\n", + " Readback heaps are not optimized for uploading data from the CPU.\n", + "10. WRITE_TO_SUBRESOURCE_FROM_WRITE_BACK_PAGE:\n", + " ID3D12Resource::WriteToSubresource from write-back CPU page.\n", + " Write-back pages are not optimized for uploading data to the GPU." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import plotly.offline as pyo\n", + "\n", + "from IPython.display import display, HTML, Markdown\n", + "\n", + "import nsys_display\n", + "\n", + "display(HTML(\"\"))\n", + "pd.set_option('display.max_colwidth', None)\n", + "pd.set_option('display.max_rows', None)\n", + "pyo.init_notebook_mode()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The table shows analysis results for each individual rank selected from the drop-down menu.\n", + "\n", + "All time values are in nanoseconds." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "df = pd.read_parquet('analysis.parquet')\n", + "nsys_display.display_table_per_rank(df)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "name": "python", + "version": "3.8.10" + }, + "orig_nbformat": 4, + "vscode": { + "interpreter": { + "hash": "7e1998ff7f8aa20ada591c520b972326324e5ea05489af9e422744c7c09f6dad" + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/dx12_mem_ops/dx12_mem_ops.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/dx12_mem_ops/dx12_mem_ops.py new file mode 100644 index 0000000000000000000000000000000000000000..5c8816288f31291f0daf5aa8ea572acd5d909acf --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/dx12_mem_ops/dx12_mem_ops.py @@ -0,0 +1,97 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd + +from datetime import datetime +from pathlib import Path + +from nsys_recipe import log +from nsys_recipe.data_service import StatsService +from nsys_recipe.lib import helpers, recipe +from nsys_recipe.lib.args import Option +from nsys_recipe.log import logger + + +class Dx12MemOps(recipe.Recipe): + @staticmethod + def _mapper_func(report_path, parsed_args): + service = StatsService(report_path) + + df = service.read_sql_report("dx12_mem_ops", "Dx12MemOps", parsed_args) + if df is None: + return None + + if df.empty: + logger.info( + f"{report_path} was successfully processed, but no data was found." + ) + return None + + df["File"] = Path(report_path).stem + return df + + @log.time("Mapper") + def mapper_func(self, context): + return context.wait( + context.map( + self._mapper_func, + self._parsed_args.input, + parsed_args=self._parsed_args, + ) + ) + + @log.time("Reducer") + def reducer_func(self, dfs): + dfs = helpers.filter_none(dfs) + df = pd.concat(dfs) + + # Remove any tags or hidden columns that are for internal use. + df.columns = df.columns.str.replace("(:).*", "", regex=True) + df = df.loc[:, ~df.columns.str.startswith("_")] + + df.to_parquet(self.add_output_file("analysis.parquet")) + + def save_notebook(self): + self.create_notebook("analysis.ipynb") + self.add_notebook_helper_file("nsys_display.py") + + def save_analysis_file(self): + self._analysis_dict.update( + { + "EndTime": str(datetime.now()), + "InputFiles": self._parsed_args.input, + "Outputs": self._output_files, + } + ) + self.create_analysis_file() + + def run(self, context): + super().run(context) + + mapper_res = self.mapper_func(context) + self.reducer_func(mapper_res) + + self.save_notebook() + self.save_analysis_file() + + @classmethod + def get_argument_parser(cls): + parser = super().get_argument_parser() + + parser.add_recipe_argument(Option.INPUT) + parser.add_recipe_argument(Option.OUTPUT) + parser.add_recipe_argument(Option.FORCE_OVERWRITE) + parser.add_recipe_argument(Option.START) + parser.add_recipe_argument(Option.END) + parser.add_recipe_argument(Option.NVTX) + parser.add_recipe_argument(Option.ROWS) + + return parser diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/dx12_mem_ops/metadata.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/dx12_mem_ops/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..2e046f058ceccf63bb5c1101b16635584be715d1 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/dx12_mem_ops/metadata.json @@ -0,0 +1,17 @@ +{ + "module_name": "dx12_mem_ops", + "display_name": "DX12 Memory Operations", + "description": [ + "This recipe identifies memory operations with the following warnings:\n", + "1. HEAP_CREATED_WITH_ZEROING\n", + "2. COMMITTED_RESOURCE_CREATED_WITH_ZEROING\n", + "3. NONEMPTY_MAP_FROM_UPLOAD_HEAP\n", + "4. NONEMPTY_MAP_TO_WRITE_COMBINE_PAGE\n", + "5. NONEMPTY_UNMAP_TO_READBACK_HEAP\n", + "6. NONEMPTY_UNMAP_FROM_WRITE_BACK_PAGE\n", + "7. READ_FROM_UPLOAD_HEAP_SUBRESOURCE\n", + "8. READ_FROM_SUBRESOURCE_TO_WRITE_COMBINE_PAGE\n", + "9. WRITE_TO_READBACK_HEAP_SUBRESOURCE\n", + "10. WRITE_TO_SUBRESOURCE_FROM_WRITE_BACK_PAGE" + ] +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/gpu_gaps/analysis.ipynb b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/gpu_gaps/analysis.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..82124345732d26becc000bf7620e577fe0aca34e --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/gpu_gaps/analysis.ipynb @@ -0,0 +1,77 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# GPU Gaps" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This notebook identifies time regions where a GPU is idle for longer than a set threshold.\n", + "\n", + "For each process, each GPU device is examined, and gaps are found within the time range that starts with the beginning of the first GPU operation on that device and ends with the end of the last GPU operation on that device. Profiling overheads are taken into account to exclude GPU gaps that cannot be addressed by the user." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import plotly.offline as pyo\n", + "\n", + "from IPython.display import display, HTML, Markdown\n", + "\n", + "import nsys_display\n", + "\n", + "display(HTML(\"\"))\n", + "pd.set_option('display.max_colwidth', None)\n", + "pd.set_option('display.max_rows', None)\n", + "pyo.init_notebook_mode()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The table shows analysis results for each individual rank selected from the drop-down menu.\n", + "\n", + "All time values are in nanoseconds." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "df = pd.read_parquet('analysis.parquet')\n", + "nsys_display.display_table_per_rank(df)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "name": "python", + "version": "3.10.5" + }, + "orig_nbformat": 4, + "vscode": { + "interpreter": { + "hash": "7e1998ff7f8aa20ada591c520b972326324e5ea05489af9e422744c7c09f6dad" + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/gpu_gaps/gpu_gaps.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/gpu_gaps/gpu_gaps.py new file mode 100644 index 0000000000000000000000000000000000000000..ed925a6f21b91cf4404018241339bb57ca6fe1bd --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/gpu_gaps/gpu_gaps.py @@ -0,0 +1,104 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd + +from datetime import datetime +from pathlib import Path + +from nsys_recipe import log +from nsys_recipe.data_service import StatsService +from nsys_recipe.lib import helpers, recipe +from nsys_recipe.lib.args import Option +from nsys_recipe.log import logger + + +class GpuGaps(recipe.Recipe): + @staticmethod + def _mapper_func(report_path, parsed_args): + service = StatsService(report_path) + + df = service.read_sql_report("gpu_gaps", "GpuGaps", parsed_args) + if df is None: + return None + + if df.empty: + logger.info( + f"{report_path} was successfully processed, but no data was found." + ) + return None + + df["File"] = Path(report_path).stem + return df + + @log.time("Mapper") + def mapper_func(self, context): + return context.wait( + context.map( + self._mapper_func, + self._parsed_args.input, + parsed_args=self._parsed_args, + ) + ) + + @log.time("Reducer") + def reducer_func(self, dfs): + dfs = helpers.filter_none(dfs) + df = pd.concat(dfs) + + # Remove any tags or hidden columns that are for internal use. + df.columns = df.columns.str.replace("(:).*", "", regex=True) + df = df.loc[:, ~df.columns.str.startswith("_")] + + df.to_parquet(self.add_output_file("analysis.parquet")) + + def save_notebook(self): + self.create_notebook("analysis.ipynb") + self.add_notebook_helper_file("nsys_display.py") + + def save_analysis_file(self): + self._analysis_dict.update( + { + "EndTime": str(datetime.now()), + "InputFiles": self._parsed_args.input, + "Outputs": self._output_files, + } + ) + self.create_analysis_file() + + def run(self, context): + super().run(context) + + mapper_res = self.mapper_func(context) + self.reducer_func(mapper_res) + + self.save_notebook() + self.save_analysis_file() + + @classmethod + def get_argument_parser(cls): + parser = super().get_argument_parser() + + parser.add_recipe_argument(Option.INPUT) + parser.add_recipe_argument(Option.OUTPUT) + parser.add_recipe_argument(Option.FORCE_OVERWRITE) + parser.add_recipe_argument(Option.START) + parser.add_recipe_argument(Option.END) + parser.add_recipe_argument(Option.NVTX) + parser.add_recipe_argument(Option.ROWS) + parser.add_recipe_argument( + "--gap", + metavar="threshold", + type=int, + default=500, + help="Minimum duration of GPU gaps in milliseconds", + ) + + return parser diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/gpu_gaps/metadata.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/gpu_gaps/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..aa7110587881d322cb353a3b33ac553d34dbd3dd --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/gpu_gaps/metadata.json @@ -0,0 +1,12 @@ +{ + "module_name": "gpu_gaps", + "display_name": "GPU Gaps", + "description": [ + "This recipe identifies time regions where a GPU is idle for longer than a set", + " threshold. For each process, each GPU device is examined, and gaps are found", + " within the time range that starts with the beginning of the first GPU", + " operation on that device and ends with the end of the last GPU operation on", + " that device. Profiling overheads are taken into account to exclude GPU gaps", + " that cannot be addressed by the user." + ] +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/gpu_metric_util_map/gpu_metric_util_map.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/gpu_metric_util_map/gpu_metric_util_map.py new file mode 100644 index 0000000000000000000000000000000000000000..e44ea72e95660892f27b6341e6bf9d9bb1690e12 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/gpu_metric_util_map/gpu_metric_util_map.py @@ -0,0 +1,151 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd +import json + +from pathlib import Path +from datetime import datetime + +from nsys_recipe import log, data_service +from nsys_recipe.data_service import DataService +from nsys_recipe.lib import heatmap, helpers, recipe +from nsys_recipe.lib.args import Option +from nsys_recipe.lib.collective_loader import ProfileInfo +from nsys_recipe.log import logger + + +class GpuMetricUtilMap(recipe.Recipe): + @staticmethod + def _mapper_func(report_path, bin_list, min_session, parsed_args): + service = DataService(report_path) + + table_column_dict = { + "ANALYSIS_DETAILS": ["duration"], + "GENERIC_EVENTS": ["rawTimestamp", "typeId", "data"], + "TARGET_INFO_SESSION_START_TIME": ["utcEpochNs"], + } + + df_dict = service.read_tables(table_column_dict) + if df_dict is None: + return None + + df = df_dict["GENERIC_EVENTS"] + session_offset, profile_duration = data_service.compute_session_duration( + df_dict["ANALYSIS_DETAILS"], + df_dict["TARGET_INFO_SESSION_START_TIME"], + min_session, + ) + + data_service.filter_by_time_range(df, parsed_args.start, parsed_args.end) + data_service.apply_time_offset(df, session_offset) + + if df.empty: + logger.info( + f"{report_path} was successfully processed, but no data was found." + ) + return None + + # Transform the 'data' column from JSON strings into individual columns. + df["data"] = df["data"].apply(json.loads) + df_json = pd.json_normalize(df["data"]) + df = pd.concat([df, df_json], axis=1) + + # Filter the DataFrame based on the profiling duration. + # TODO(DTSP-15842): Use 'timestamp' instead of 'rawTimestamp'. + df = df[ + (df["rawTimestamp"] >= session_offset) + & (df["rawTimestamp"] <= profile_duration) + ] + + # Extract GPU ID from type ID. + df["GPU"] = df["typeId"] & 0xFF + # Arrange the GPU metric sample points into their respective duration bins. + df["Duration"] = pd.cut(df["rawTimestamp"], bin_list, labels=bin_list[:-1]) + + # Convert the metrics to int type. + metric_cols = ["SM Active", "SM Issue", "Tensor Active"] + df[metric_cols] = df[metric_cols].astype(int) + + # Calculate the mean for the specified metrics per GPU and bin. + df = ( + df.groupby(["GPU", "Duration"], observed=True)[metric_cols] + .mean() + .round(1) + .reset_index() + ) + df["File"] = Path(report_path).stem + + return df[["Duration", *metric_cols, "GPU", "File"]] + + @log.time("Mapper") + def mapper_func(self, context, filtered_dir, bin_list, min_session): + return context.wait( + context.map( + self._mapper_func, + filtered_dir, + bin_list=bin_list, + min_session=min_session, + parsed_args=self._parsed_args, + ) + ) + + @log.time("Reducer") + def reducer_func(self, dfs): + dfs = helpers.filter_none(dfs) + df = pd.concat(dfs) + + df.to_parquet(self.add_output_file("analysis.parquet")) + + def save_notebook(self): + self.create_notebook( + "heatmap.ipynb", replace_dict={"REPLACE_BIN": self._parsed_args.bins} + ) + self.add_notebook_helper_file("nsys_display.py") + + def save_analysis_file(self): + self._analysis_dict.update( + { + "EndTime": str(datetime.now()), + "InputFiles": self._parsed_args.input, + "Outputs": self._output_files, + } + ) + self.create_analysis_file() + + def run(self, context): + super().run(context) + + max_duration, min_session, filtered_dir = ProfileInfo.get_profile_info( + context, self._parsed_args.input + ) + bin_size = heatmap.get_bin_size(self._parsed_args.bins, max_duration) + bin_list = heatmap.generate_bin_list( + self._parsed_args.bins, bin_size, include_last=True + ) + + mapper_res = self.mapper_func(context, filtered_dir, bin_list, min_session) + self.reducer_func(mapper_res) + + self.save_notebook() + self.save_analysis_file() + + @classmethod + def get_argument_parser(cls): + parser = super().get_argument_parser() + + parser.add_recipe_argument(Option.INPUT) + parser.add_recipe_argument(Option.OUTPUT) + parser.add_recipe_argument(Option.FORCE_OVERWRITE) + parser.add_recipe_argument(Option.START) + parser.add_recipe_argument(Option.END) + parser.add_recipe_argument(Option.BINS) + + return parser diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/gpu_metric_util_map/heatmap.ipynb b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/gpu_metric_util_map/heatmap.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..94144d3782123bafd006a677e0b4a941374172ea --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/gpu_metric_util_map/heatmap.ipynb @@ -0,0 +1,95 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# GPU Metric Utilization Heatmap" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import plotly.offline as pyo\n", + "\n", + "from IPython.display import display, HTML, Markdown\n", + "from plotly.subplots import make_subplots\n", + "\n", + "import nsys_display\n", + "\n", + "display(HTML(''))\n", + "pd.set_option('display.max_colwidth', None)\n", + "pd.set_option('display.max_rows', None)\n", + "pyo.init_notebook_mode()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This line graph displays the summary utilization of SM Active, SM Issue, and Tensor Active metrics.\n", + "* x axis represents the rank duration, scaling from 0 to the maximum duration across all ranks.\n", + "* y axis represents the mean utilization value across all ranks." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "df = pd.read_parquet('analysis.parquet')\n", + "# Create unique name.\n", + "df['Name'] = df['File'] + '/' + df['GPU'].astype(str)\n", + "# Convert ns to s.\n", + "df['Duration'] = df['Duration'] * 1e-9\n", + "\n", + "metrics = ['SM Active', 'SM Issue', 'Tensor Active']\n", + "nsys_display.display_summary_graph(\n", + " df,\n", + " metrics,\n", + " xaxis_title=\"Duration (s)\",\n", + " yaxis_title=\"Value (%)\",\n", + " title=\"Utilization Summary (bins=REPLACE_BIN)\"\n", + ")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This heatmap displays the utilization of SM Active, SM Issue, and Tensor Active metrics.\n", + "* x axis represents the rank duration, scaling from 0 to the maximum duration across all ranks.\n", + "* y axis represents the set of File/Device/PID for which utilization data was collected." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "nsys_display.display_heatmaps(\n", + " df,\n", + " metrics,\n", + " xaxis_title=\"Duration (s)\",\n", + " yaxis_title=\"File/Device/PID\",\n", + " zaxis_title=\"Value (%)\",\n", + " title=\"Utilization Summary (bins=REPLACE_BIN)\"\n", + ")" + ] + } + ], + "metadata": { + "language_info": { + "name": "python" + }, + "orig_nbformat": 4 + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/gpu_metric_util_map/metadata.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/gpu_metric_util_map/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..1f08fadd1a026fea9e87eb27e90c2c04a95a1b10 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/gpu_metric_util_map/metadata.json @@ -0,0 +1,8 @@ +{ + "module_name": "gpu_metric_util_map", + "display_name": "GPU Metric Utilization Heatmap", + "description": [ + "This recipe calculates the percentage of SM Active, SM Issue, and Tensor Active", + " metrics." + ] +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/gpu_time_util/analysis.ipynb b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/gpu_time_util/analysis.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..7d8412dcf7708d14e38d375dd2a2e010d949d288 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/gpu_time_util/analysis.ipynb @@ -0,0 +1,94 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# GPU Time Utilization" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This notebook identifies time regions with low GPU utilization. For each\n", + "process, each GPU device is examined, and a time range is created that\n", + "starts with the beginning of the first GPU operation on that device and\n", + "ends with the end of the last GPU operation on that device. This time range\n", + "is then divided into equal chunks, and the GPU utilization is calculated\n", + "for each chunk. The utilization includes all GPU operations as well as\n", + "profiling overheads that the user cannot address.\n", + "\n", + "Note that the utilization refers to the \"time\" utilization and not the\n", + "\"resource\" utilization. This script does not take into account how many GPU\n", + "resources are being used. Therefore, a single running memcpy is considered\n", + "the same amount of \"utilization\" as a huge kernel that takes over all the\n", + "cores. If multiple operations run concurrently in the same chunk, their\n", + "utilization will be added up and may exceed 100%.\n", + "\n", + "Chunks with an in-use percentage less than the threshold value are\n", + "displayed. If consecutive chunks have a low in-use percentage, the\n", + "individual chunks are coalesced into a single display record, keeping the\n", + "weighted average of percentages. This is why returned chunks may have\n", + "different durations." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import plotly.offline as pyo\n", + "\n", + "from IPython.display import display, HTML, Markdown\n", + "\n", + "import nsys_display\n", + "\n", + "display(HTML(\"\"))\n", + "pd.set_option('display.max_colwidth', None)\n", + "pd.set_option('display.max_rows', None)\n", + "pyo.init_notebook_mode()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The table shows analysis results for each individual rank selected from the drop-down menu.\n", + "\n", + "All time values are in nanoseconds." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "df = pd.read_parquet('analysis.parquet')\n", + "nsys_display.display_table_per_rank(df)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "name": "python", + "version": "3.10.5" + }, + "orig_nbformat": 4, + "vscode": { + "interpreter": { + "hash": "7e1998ff7f8aa20ada591c520b972326324e5ea05489af9e422744c7c09f6dad" + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/gpu_time_util/gpu_time_util.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/gpu_time_util/gpu_time_util.py new file mode 100644 index 0000000000000000000000000000000000000000..f45d05c609b831e8db1d9295e89fe2b9a361e5d0 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/gpu_time_util/gpu_time_util.py @@ -0,0 +1,111 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd + +from datetime import datetime +from pathlib import Path + +from nsys_recipe import log +from nsys_recipe.data_service import StatsService +from nsys_recipe.lib import helpers, recipe +from nsys_recipe.lib.args import Option +from nsys_recipe.log import logger + + +class GpuTimeUtil(recipe.Recipe): + @staticmethod + def _mapper_func(report_path, parsed_args): + service = StatsService(report_path) + + df = service.read_sql_report("gpu_time_util", "GpuTimeUtil", parsed_args) + if df is None: + return None + + if df.empty: + logger.info( + f"{report_path} was successfully processed, but no data was found." + ) + return None + + df["File"] = Path(report_path).stem + return df + + @log.time("Mapper") + def mapper_func(self, context): + return context.wait( + context.map( + self._mapper_func, + self._parsed_args.input, + parsed_args=self._parsed_args, + ) + ) + + @log.time("Reducer") + def reducer_func(self, dfs): + dfs = helpers.filter_none(dfs) + df = pd.concat(dfs) + + # Remove any tags or hidden columns that are for internal use. + df.columns = df.columns.str.replace("(:).*", "", regex=True) + df = df.loc[:, ~df.columns.str.startswith("_")] + + df.to_parquet(self.add_output_file("analysis.parquet")) + + def save_notebook(self): + self.create_notebook("analysis.ipynb") + self.add_notebook_helper_file("nsys_display.py") + + def save_analysis_file(self): + self._analysis_dict.update( + { + "EndTime": str(datetime.now()), + "InputFiles": self._parsed_args.input, + "Outputs": self._output_files, + } + ) + self.create_analysis_file() + + def run(self, context): + super().run(context) + + mapper_res = self.mapper_func(context) + self.reducer_func(mapper_res) + + self.save_notebook() + self.save_analysis_file() + + @classmethod + def get_argument_parser(cls): + parser = super().get_argument_parser() + + parser.add_recipe_argument(Option.INPUT) + parser.add_recipe_argument(Option.OUTPUT) + parser.add_recipe_argument(Option.FORCE_OVERWRITE) + parser.add_recipe_argument(Option.START) + parser.add_recipe_argument(Option.END) + parser.add_recipe_argument(Option.NVTX) + parser.add_recipe_argument(Option.ROWS) + parser.add_recipe_argument( + "--threshold", + metavar="percent", + type=int, + default=50, + help="Maximum percentage of time the GPU is being used", + ) + parser.add_recipe_argument( + "--chunks", + metavar="number", + type=int, + default=30, + help="Number of equal-duration chunks", + ) + + return parser diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/gpu_time_util/metadata.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/gpu_time_util/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..42cbbbf7b92b4b6c60a9c7a4388d8ba9e7a91071 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/gpu_time_util/metadata.json @@ -0,0 +1,25 @@ +{ + "module_name": "gpu_time_util", + "display_name": "GPU Time Utilization", + "description": [ + "This recipe identifies time regions with low GPU utilization. For each", + " process, each GPU device is examined, and a time range is created that starts", + " with the beginning of the first GPU operation on that device and ends with the", + " end of the last GPU operation on that device. This time range is then divided", + " into equal chunks, and the GPU utilization is calculated for each chunk. The", + " utilization includes all GPU operations as well as profiling overheads that the", + " user cannot address.\n\n", + + "Note that the utilization refers to the 'time' utilization and not the", + " 'resource' utilization. This script does not take into account how many GPU", + " resources are being used. Therefore, a single running memcpy is considered the", + " same amount of 'utilization' as a huge kernel that takes over all the cores.", + " If multiple operations run concurrently in the same chunk, their utilization", + " will be added up and may exceed 100%.\n\n", + + "Chunks with an in-use percentage less than the threshold value are displayed.", + " If consecutive chunks have a low in-use percentage, the individual chunks are", + " coalesced into a single display record, keeping the weighted average of", + " percentages. This is why returned chunks may have different durations." + ] +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/mpi_gpu_time_util_map/heatmap.ipynb b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/mpi_gpu_time_util_map/heatmap.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..4a6901b2787372b65c022e87a33f309fd485edcb --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/mpi_gpu_time_util_map/heatmap.ipynb @@ -0,0 +1,94 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# MPI GPU Time Utilization Heatmap" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import plotly.offline as pyo\n", + "\n", + "from IPython.display import display, HTML, Markdown\n", + "\n", + "import nsys_display\n", + "\n", + "display(HTML(''))\n", + "pd.set_option('display.max_colwidth', None)\n", + "pd.set_option('display.max_rows', None)\n", + "pyo.init_notebook_mode()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This line graph displays the summary of GPU, MPI, and their overlap utilizations:\n", + "* x axis represents the rank duration, scaling from 0 to the maximum duration across all ranks.\n", + "* y axis represents the mean utilization value across all ranks." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "df = pd.read_parquet('analysis.parquet')\n", + "# Create unique name.\n", + "df['Name'] = df['File'] + '/' + df['PID'].astype(str)\n", + "# Convert ns to s.\n", + "df['Duration'] = df['Duration'] * 1e-9\n", + "\n", + "types = ['Kernel', 'MPI', 'Overlap']\n", + "nsys_display.display_summary_graph(\n", + " df,\n", + " types,\n", + " xaxis_title=\"Duration (s)\",\n", + " yaxis_title=\"Value (%)\",\n", + " title=\"Utilization Summary (bins=REPLACE_BIN)\"\n", + ")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This line graph displays the GPU, MPI, and their overlap utilizations:\n", + "* x axis represents the rank duration, scaling from 0 to the maximum duration across all ranks.\n", + "* y axis represents the set of File/PID for which utilization data was collected." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "nsys_display.display_heatmaps(\n", + " df,\n", + " types,\n", + " xaxis_title=\"Duration (s)\",\n", + " yaxis_title=\"File/PID\",\n", + " zaxis_title=\"Value (%)\",\n", + " title=\"Utilization Summary (bins=REPLACE_BIN)\"\n", + ")" + ] + } + ], + "metadata": { + "language_info": { + "name": "python" + }, + "orig_nbformat": 4 + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/mpi_gpu_time_util_map/metadata.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/mpi_gpu_time_util_map/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..ba77bbcc4deb607d0cf7e95d545f28541e82198c --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/mpi_gpu_time_util_map/metadata.json @@ -0,0 +1,13 @@ +{ + "module_name": "mpi_gpu_time_util_map", + "display_name": "MPI and GPU Time Utilization Heatmap", + "description": [ + "This recipe calculates the percentage of GPU and MPI utilization and the overlap", + "between the two. Note that the utilization refers to 'time' utilization and not", + "the 'resource' utilization. All events are consolidated by taking the minimum", + "start time and maximum end time for each group of overlapping ranges when", + "multiple events run concurrently. The overlap percentage is calculated based on", + "the bin size, implying that the value will be less than 100% unless MPI and", + "kernel events overlap continuously throughout the entire bin duration." + ] +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/mpi_gpu_time_util_map/mpi_gpu_time_util_map.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/mpi_gpu_time_util_map/mpi_gpu_time_util_map.py new file mode 100644 index 0000000000000000000000000000000000000000..4a41734efb545b5d71bfe641b5176b5859ce97f2 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/mpi_gpu_time_util_map/mpi_gpu_time_util_map.py @@ -0,0 +1,192 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd + +from pathlib import Path +from datetime import datetime + +from nsys_recipe import log, data_service +from nsys_recipe.data_service import DataService +from nsys_recipe.lib import helpers, recipe, heatmap +from nsys_recipe.lib.args import Option +from nsys_recipe.lib.collective_loader import ProfileInfo +from nsys_recipe.log import logger + + +class MpiGpuTimeUtilMap(recipe.Recipe): + @staticmethod + def _mapper_func(report_path, bin_size, min_session, parsed_args): + service = DataService(report_path) + + table_column_dict = { + "ANALYSIS_DETAILS": ["duration"], + "TARGET_INFO_SESSION_START_TIME": ["utcEpochNs"], + "CUPTI_ACTIVITY_KIND_RUNTIME": [ + "correlationId", + "globalTid", + "start", + "end", + ], + "CUPTI_ACTIVITY_KIND_KERNEL": [ + "correlationId", + "globalPid", + "start", + "end", + ], + "MPI_P2P_EVENTS": ["globalTid", "start", "end"], + "MPI_START_WAIT_EVENTS": ["globalTid", "start", "end"], + "MPI_OTHER_EVENTS": ["globalTid", "start", "end"], + "MPI_COLLECTIVES_EVENTS": ["globalTid", "start", "end"], + } + + df_dict = service.read_tables(table_column_dict) + if df_dict is None: + return None + + mpi_p2p_df = df_dict["MPI_P2P_EVENTS"] + mpi_start_wait_df = df_dict["MPI_START_WAIT_EVENTS"] + mpi_other_df = df_dict["MPI_OTHER_EVENTS"] + mpi_collectives_df = df_dict["MPI_COLLECTIVES_EVENTS"] + + mpi_dfs = [mpi_p2p_df, mpi_start_wait_df, mpi_other_df, mpi_collectives_df] + kernel_df = df_dict["CUPTI_ACTIVITY_KIND_KERNEL"] + dfs = [*mpi_dfs, kernel_df] + + session_offset, profile_duration = data_service.compute_session_duration( + df_dict["ANALYSIS_DETAILS"], + df_dict["TARGET_INFO_SESSION_START_TIME"], + min_session, + ) + + data_service.filter_by_time_range(dfs, parsed_args.start, parsed_args.end) + data_service.apply_time_offset(dfs, session_offset) + + mpi_df = pd.concat(mpi_dfs).sort_values("start").reset_index() + if mpi_df.empty or kernel_df.empty: + logger.info( + f"{report_path} was successfully processed, but no data was found." + ) + return None + + kernel_df["pid"] = data_service.extract_pid(kernel_df["globalPid"]) + mpi_df["pid"] = data_service.extract_pid(mpi_df["globalTid"]) + + kernel_grouped = kernel_df.groupby("pid") + mpi_grouped = mpi_df.groupby("pid") + + unique_pids = set(kernel_grouped.groups.keys()) | set(mpi_grouped.groups.keys()) + results = [] + + for pid in unique_pids: + group_dfs = {} + bin_pcts = {} + + # Initialize the bins with zero values. + zero_bins = heatmap.get_zero_bin_pcts( + bin_size, parsed_args.bins, profile_duration, session_offset + ) + bin_pcts = {key: zero_bins for key in ("Kernel", "MPI", "Overlap")} + + groups_info = [("Kernel", kernel_grouped), ("MPI", mpi_grouped)] + for name, grouped in groups_info: + if pid in grouped.groups: + group_dfs[name] = heatmap.consolidate_ranges(grouped.get_group(pid)) + + # Calculate the overlap only if 'Kernel' and 'MPI' both exist for + # the given PID. + if "Kernel" in group_dfs and "MPI" in group_dfs: + overlap_range_df = heatmap.calculate_overlapping_ranges( + group_dfs["Kernel"], group_dfs["MPI"] + ) + group_dfs["Overlap"] = overlap_range_df + + # Calculate bin percentages for each dataframe. + for name, group_df in group_dfs.items(): + bin_pcts[name] = heatmap.calculate_bin_pcts( + group_df, + bin_size, + parsed_args.bins, + profile_duration, + session_offset, + ) + + data = { + "Duration": heatmap.generate_bin_list(parsed_args.bins, bin_size), + **bin_pcts, + "PID": pid, + } + results.append(pd.DataFrame(data)) + + pct_df = pd.concat(results, ignore_index=True) + pct_df["File"] = Path(report_path).stem + + return pct_df + + @log.time("Mapper") + def mapper_func(self, context, filtered_dir, bin_size, min_session): + return context.wait( + context.map( + self._mapper_func, + filtered_dir, + bin_size=bin_size, + min_session=min_session, + parsed_args=self._parsed_args, + ) + ) + + @log.time("Reducer") + def reducer_func(self, dfs): + dfs = helpers.filter_none(dfs) + df = pd.concat(dfs) + + df.to_parquet(self.add_output_file("analysis.parquet")) + + def save_notebook(self): + self.create_notebook( + "heatmap.ipynb", replace_dict={"REPLACE_BIN": self._parsed_args.bins} + ) + self.add_notebook_helper_file("nsys_display.py") + + def save_analysis_file(self): + self._analysis_dict.update( + { + "EndTime": str(datetime.now()), + "InputFiles": self._parsed_args.input, + "Outputs": self._output_files, + } + ) + self.create_analysis_file() + + def run(self, context): + super().run(context) + + max_duration, min_session, filtered_dir = ProfileInfo.get_profile_info( + context, self._parsed_args.input + ) + bin_size = heatmap.get_bin_size(self._parsed_args.bins, max_duration) + + mapper_res = self.mapper_func(context, filtered_dir, bin_size, min_session) + self.reducer_func(mapper_res) + + self.save_notebook() + self.save_analysis_file() + + @classmethod + def get_argument_parser(cls): + parser = super().get_argument_parser() + + parser.add_recipe_argument(Option.INPUT) + parser.add_recipe_argument(Option.OUTPUT) + parser.add_recipe_argument(Option.FORCE_OVERWRITE) + parser.add_recipe_argument(Option.START) + parser.add_recipe_argument(Option.END) + parser.add_recipe_argument(Option.BINS) + return parser diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/mpi_sum/metadata.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/mpi_sum/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..201029d1190d3703aa49ffd327b6b8aff238af7d --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/mpi_sum/metadata.json @@ -0,0 +1,6 @@ +{ + "module_name": "mpi_sum", + "display_name": "MPI Summary", + "description": "This recipe provides a summary of MPI functions and their execution times.", + "type": "stats" +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/mpi_sum/mpi_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/mpi_sum/mpi_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..49d597085aaf789551eb4553d2baab28324f9104 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/mpi_sum/mpi_sum.py @@ -0,0 +1,137 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd + +from datetime import datetime +from pathlib import Path + +from nsys_recipe import log, data_service +from nsys_recipe.data_service import DataService +from nsys_recipe.lib import helpers, recipe, summary +from nsys_recipe.lib.args import Option +from nsys_recipe.log import logger + + +class MpiSum(recipe.Recipe): + @staticmethod + def _mapper_func(report_path, parsed_args): + service = DataService(report_path) + + table_column_dict = { + "StringIds": None, + "MPI_P2P_EVENTS": ["start", "end", "textId"], + "MPI_START_WAIT_EVENTS": ["start", "end", "textId"], + "MPI_OTHER_EVENTS": ["start", "end", "textId"], + "MPI_COLLECTIVES_EVENTS": ["start", "end", "textId"], + } + + df_dict = service.read_tables(table_column_dict) + if df_dict is None: + return None + + mpi_p2p_df = df_dict["MPI_P2P_EVENTS"] + mpi_start_wait_df = df_dict["MPI_START_WAIT_EVENTS"] + mpi_other_df = df_dict["MPI_OTHER_EVENTS"] + mpi_collectives_df = df_dict["MPI_COLLECTIVES_EVENTS"] + + mpi_dfs = [mpi_p2p_df, mpi_start_wait_df, mpi_other_df, mpi_collectives_df] + data_service.filter_by_time_range(mpi_dfs, parsed_args.start, parsed_args.end) + + mpi_df = pd.concat(mpi_dfs) + if mpi_df.empty: + logger.info( + f"{report_path} was successfully processed, but no data was found." + ) + return None + + mpi_df = data_service.replace_id_with_value( + mpi_df, df_dict["StringIds"], "textId" + ) + mpi_df = mpi_df.rename(columns={"textId": "text"}) + + mpi_df["duration"] = mpi_df["end"] - mpi_df["start"] + mpi_df = mpi_df[mpi_df["duration"] > 0] + range_gdf = mpi_df[["text", "duration"]].groupby("text") + + filename = Path(report_path).stem + stats_df = summary.describe_duration(range_gdf["duration"]) + + return summary.StatsInfo(filename, stats_df) + + @log.time("Mapper") + def mapper_func(self, context): + return context.wait( + context.map( + self._mapper_func, + self._parsed_args.input, + parsed_args=self._parsed_args, + ) + ) + + @log.time("Reducer") + def reducer_func(self, mapper_res): + stats_infos = helpers.filter_none(mapper_res) + stats_infos = sorted(stats_infos, key=lambda x: x.filename) + + filenames, stats_dfs = zip(*stats_infos) + + rank_file_df = pd.DataFrame(filenames, columns=["File"]) + rank_file_df.to_parquet(self.add_output_file("files.parquet"), index=False) + + all_stats_df = summary.aggregate_stats_dfs(stats_dfs) + all_stats_df.to_parquet(self.add_output_file("all_stats.parquet")) + + rank_stats_dfs = [ + df.assign(Rank=rank, File=filenames[rank]) + for rank, df in enumerate(stats_dfs) + ] + rank_stats = pd.concat(rank_stats_dfs) + rank_stats.to_parquet(self.add_output_file("rank_stats.parquet")) + + if self._parsed_args.csv: + all_stats_df.to_csv(self.add_output_file("all_stats.csv")) + rank_stats.to_csv(self.add_output_file("rank_stats.csv")) + + def save_notebook(self): + self.create_notebook("stats.ipynb") + self.add_notebook_helper_file("nsys_pres.py") + + def save_analysis_file(self): + self._analysis_dict.update( + { + "EndTime": str(datetime.now()), + "InputFiles": self._parsed_args.input, + "Outputs": self._output_files, + } + ) + self.create_analysis_file() + + def run(self, context): + super().run(context) + + mapper_res = self.mapper_func(context) + self.reducer_func(mapper_res) + + self.save_notebook() + self.save_analysis_file() + + @classmethod + def get_argument_parser(cls): + parser = super().get_argument_parser() + + parser.add_recipe_argument(Option.INPUT) + parser.add_recipe_argument(Option.OUTPUT) + parser.add_recipe_argument(Option.FORCE_OVERWRITE) + parser.add_recipe_argument(Option.START) + parser.add_recipe_argument(Option.END) + parser.add_recipe_argument(Option.CSV) + + return parser diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/mpi_sum/stats.ipynb b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/mpi_sum/stats.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..d118669e48402d79df1554c873f7c266f4ac916b --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/mpi_sum/stats.ipynb @@ -0,0 +1,198 @@ +{ + "cells": [ + { + "attachments": {}, + "cell_type": "markdown", + "id": "4e3c0c43-b1a5-4ade-be51-bb54043441be", + "metadata": {}, + "source": [ + "# MPI Summary\n", + "Statistical analysis of MPI functions." + ] + }, + { + "cell_type": "markdown", + "id": "5cbed268-3ac1-4b76-8be9-0c2b060f1c3a", + "metadata": {}, + "source": [ + "## Loading" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0425e7d7", + "metadata": { + "jupyter": { + "source_hidden": true + }, + "tags": [] + }, + "outputs": [], + "source": [ + "from IPython.display import display, HTML, Markdown\n", + "display(HTML(\"\"))\n", + "\n", + "from ipywidgets import interact, Dropdown\n", + "import plotly.graph_objects as go\n", + "import plotly.offline as pyo\n", + "\n", + "def is_lab_notebook():\n", + " import re\n", + " import psutil\n", + " return any(re.search('jupyter-lab-script', x) for x in psutil.Process().parent().cmdline())\n", + "\n", + "if is_lab_notebook():\n", + " pyo.init_notebook_mode()\n", + " \n", + "\n", + "#!pip3 install plotly\n", + " \n", + "import pandas as pd\n", + "pd.options.plotting.backend = \"plotly\"\n", + "pd.set_option('display.max_rows', 100)\n", + "pd.set_option('display.width', 1000)\n", + "#pd.set_option('display.max_columns', 500)\n", + "#pd.options.display.width = 0\n", + "\n", + "from ipywidgets import IntProgress\n", + "\n", + "import pickle\n", + "import importlib\n", + "import os\n", + "import glob\n", + "import math\n", + "import re\n", + "from collections import deque\n", + "import numpy as np\n", + "import sqlite3\n", + "import time\n", + "\n", + "import nsys_pres" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "83e4c7bc", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "files_df = pd.read_parquet(\"files.parquet\").rename_axis(\"Rank\",axis='index')\n", + "all_stats_df = pd.read_parquet(\"all_stats.parquet\")\n", + "rank_stats_df = pd.read_parquet(\"rank_stats.parquet\")\n", + "#.rename_axis(\"Iterations\",axis='index').rename_axis(\"Ranks\",axis='columns')" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "d7a3ac1f", + "metadata": {}, + "source": [ + "## Statistics for all ranks\n", + "Overall statistics for the functions across all ranks.\n", + "* Q1(approx) is the 25th percentile of the dataset. Approximated by the min of Q1 for each rank.\n", + "* Median(approx) is the 50th percentile of the dataset. Approximated by the median of the medians for each rank.\n", + "* Q3(approx) is the 75th percentile of the dataset. Approximated by the max of Q3 for each rank." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ba5bde92-c6bd-4493-a829-4ae84d797bb3", + "metadata": { + "jupyter": { + "source_hidden": true + }, + "tags": [] + }, + "outputs": [], + "source": [ + "display(all_stats_df)\n", + "fig1=nsys_pres.display_boxplots_df(None, all_stats_df,xaxis_title=\"Range Names\")\n", + "fig2=nsys_pres.display_graph(None, all_stats_df.index, all_stats_df[['Q1 (approx)', 'Median (approx)', 'Q3 (approx)']], title=\"50% of Distribution\", xaxis_title=\"Range Names\")" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "3fc1d09d-99ae-4dcb-9cbd-dc39e4545b4f", + "metadata": {}, + "source": [ + "## Statistics for all ranks for a particular selected function\n", + "Please select a function name to see:\n", + "* Table of per-rank statistics\n", + " * Q1 is the 25th percentile of the dataset.\n", + " * Median is the 50th percentile of the dataset.\n", + " * Q3 is the 75th percentile of the dataset.\n", + "* Boxplot the the distribution of timing per-rank to support the investigation of outliers\n", + "* Graph of Q1, Median, & Q3 to see how close together the middle (50%) of the data is without outlier." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7758cd1e-b5a9-4a10-867b-18d5719cbd90", + "metadata": { + "jupyter": { + "source_hidden": true + }, + "tags": [] + }, + "outputs": [], + "source": [ + "rank_stats_gdf = rank_stats_df.groupby(rank_stats_df.index)\n", + "nsys_pres.display_stats_per_rank_groups_combobox(rank_stats_gdf)" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "910620c7", + "metadata": {}, + "source": [ + "## Files\n", + "Ranks are assigned assuming that the file names include the rank and sort well. If they are not sufficiently padded with zeros, the real rank may differ from the assigned ID. This table allows you to identify the filename without the charts above having potentially very long label in the legend or x-axis." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c3328573", + "metadata": {}, + "outputs": [], + "source": [ + "display(files_df)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.10 (default, Nov 14 2022, 12:59:47) \n[GCC 9.4.0]" + }, + "vscode": { + "interpreter": { + "hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1" + } + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nccl_gpu_proj_sum/metadata.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nccl_gpu_proj_sum/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..c0f76e37713e3954c3ad94bad738951040af50ca --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nccl_gpu_proj_sum/metadata.json @@ -0,0 +1,9 @@ +{ + "module_name": "nccl_gpu_proj_sum", + "display_name": "NCCL GPU Projection Summary", + "description": [ + "This recipe provides a summary of NCCL functions projected from the CPU onto the", + " GPU, and their execution times." + ], + "type": "stats" +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nccl_gpu_proj_sum/nccl_gpu_proj_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nccl_gpu_proj_sum/nccl_gpu_proj_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..88b7e0e9f36af4996ea0a57fd229fba8867b01a6 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nccl_gpu_proj_sum/nccl_gpu_proj_sum.py @@ -0,0 +1,174 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd + +from datetime import datetime +from pathlib import Path + +from nsys_recipe import log, data_service +from nsys_recipe.data_service import DataService +from nsys_recipe.lib import helpers, nvtx, recipe, summary +from nsys_recipe.lib.args import Option +from nsys_recipe.log import logger + + +class NcclGpuProjSum(recipe.Recipe): + @staticmethod + def _mapper_func(report_path, parsed_args): + service = DataService(report_path) + + table_column_dict = { + "StringIds": None, + "NVTX_EVENTS": [ + "text", + "start", + "end", + "textId", + "globalTid", + "endGlobalTid", + "domainId", + "eventType", + ], + "CUPTI_ACTIVITY_KIND_RUNTIME": [ + "correlationId", + "globalTid", + "start", + "end", + ], + "CUPTI_ACTIVITY_KIND_KERNEL": [ + "correlationId", + "globalPid", + "start", + "end", + ], + "CUPTI_ACTIVITY_KIND_MEMCPY": [ + "correlationId", + "globalPid", + "start", + "end", + ], + "CUPTI_ACTIVITY_KIND_MEMSET": [ + "correlationId", + "globalPid", + "start", + "end", + ], + } + + df_dict = service.read_tables(table_column_dict) + if df_dict is None: + return None + + kernel_df = df_dict["CUPTI_ACTIVITY_KIND_KERNEL"] + memcpy_df = df_dict["CUPTI_ACTIVITY_KIND_MEMCPY"] + memset_df = df_dict["CUPTI_ACTIVITY_KIND_MEMSET"] + + gpu_dfs = [kernel_df, memcpy_df, memset_df] + data_service.filter_by_time_range(gpu_dfs, parsed_args.start, parsed_args.end) + + gpu_df = pd.concat(gpu_dfs, ignore_index=True) + cuda_df = data_service.combine_api_gpu_dfs( + df_dict["CUPTI_ACTIVITY_KIND_RUNTIME"], gpu_df + ) + nccl_df = data_service.get_domain_range_df(df_dict["NVTX_EVENTS"], "NCCL") + + if nccl_df.empty or cuda_df.empty: + logger.info( + f"{report_path} was successfully processed, but no data was found." + ) + return None + + nccl_df = data_service.combine_text_fields(nccl_df, df_dict["StringIds"]) + nccl_gpu_df = nvtx.project_nvtx_onto_gpu(nccl_df, cuda_df) + if nccl_gpu_df.empty: + logger.info( + f"{report_path} does not contain any NCCL data that can be projected onto the GPU." + ) + return None + + nccl_gpu_df["duration"] = nccl_gpu_df["end"] - nccl_gpu_df["start"] + nccl_gpu_df = nccl_gpu_df[nccl_gpu_df["duration"] > 0] + range_gdf = nccl_gpu_df[["text", "duration"]].groupby("text") + + filename = Path(report_path).stem + stats_df = summary.describe_duration(range_gdf["duration"]) + + return summary.StatsInfo(filename, stats_df) + + @log.time("Mapper") + def mapper_func(self, context): + return context.wait( + context.map( + self._mapper_func, + self._parsed_args.input, + parsed_args=self._parsed_args, + ) + ) + + @log.time("Reducer") + def reducer_func(self, mapper_res): + stats_infos = helpers.filter_none(mapper_res) + stats_infos = sorted(stats_infos, key=lambda x: x.filename) + + filenames, stats_dfs = zip(*stats_infos) + + rank_file_df = pd.DataFrame(filenames, columns=["File"]) + rank_file_df.to_parquet(self.add_output_file("files.parquet"), index=False) + + all_stats_df = summary.aggregate_stats_dfs(stats_dfs) + all_stats_df.to_parquet(self.add_output_file("all_stats.parquet")) + + rank_stats_dfs = [ + df.assign(Rank=rank, File=filenames[rank]) + for rank, df in enumerate(stats_dfs) + ] + rank_stats = pd.concat(rank_stats_dfs) + rank_stats.to_parquet(self.add_output_file("rank_stats.parquet")) + + if self._parsed_args.csv: + all_stats_df.to_csv(self.add_output_file("all_stats.csv")) + rank_stats.to_csv(self.add_output_file("rank_stats.csv")) + + def save_notebook(self): + self.create_notebook("stats.ipynb") + self.add_notebook_helper_file("nsys_pres.py") + + def save_analysis_file(self): + self._analysis_dict.update( + { + "EndTime": str(datetime.now()), + "InputFiles": self._parsed_args.input, + "Outputs": self._output_files, + } + ) + self.create_analysis_file() + + def run(self, context): + super().run(context) + + mapper_res = self.mapper_func(context) + self.reducer_func(mapper_res) + + self.save_notebook() + self.save_analysis_file() + + @classmethod + def get_argument_parser(cls): + parser = super().get_argument_parser() + + parser.add_recipe_argument(Option.INPUT) + parser.add_recipe_argument(Option.OUTPUT) + parser.add_recipe_argument(Option.FORCE_OVERWRITE) + parser.add_recipe_argument(Option.START) + parser.add_recipe_argument(Option.END) + parser.add_recipe_argument(Option.CSV) + + return parser diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nccl_gpu_proj_sum/stats.ipynb b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nccl_gpu_proj_sum/stats.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..9cf88fc088c2019e6b6e4fca9c8f12e5e3f5900d --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nccl_gpu_proj_sum/stats.ipynb @@ -0,0 +1,199 @@ +{ + "cells": [ + { + "attachments": {}, + "cell_type": "markdown", + "id": "4e3c0c43-b1a5-4ade-be51-bb54043441be", + "metadata": {}, + "source": [ + "# NCCL Summary\n", + "Statistical analysis of NCCL functions projected onto the GPU.\n", + "\n", + "Some forms of MPI use CUDA. CUDA work launched within that function, on the same thread are projected. The projection refits the start and end time to tightly wrap the CUDA launches, memcopies and memsets invoked within it. The resulting duration (end-start) is then analyzed here. Note, in this mode, ranges not doing CUDA GPU work are discarded." + ] + }, + { + "cell_type": "markdown", + "id": "5cbed268-3ac1-4b76-8be9-0c2b060f1c3a", + "metadata": {}, + "source": [ + "## Loading" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0425e7d7", + "metadata": { + "jupyter": { + "source_hidden": true + }, + "tags": [] + }, + "outputs": [], + "source": [ + "from IPython.display import display, HTML, Markdown\n", + "display(HTML(\"\"))\n", + "\n", + "from ipywidgets import interact, Dropdown\n", + "import plotly.graph_objects as go\n", + "import plotly.offline as pyo\n", + "\n", + "def is_lab_notebook():\n", + " import re\n", + " import psutil\n", + " return any(re.search('jupyter-lab-script', x) for x in psutil.Process().parent().cmdline())\n", + "\n", + "if is_lab_notebook():\n", + " pyo.init_notebook_mode()\n", + " \n", + "\n", + "#!pip3 install plotly\n", + " \n", + "import pandas as pd\n", + "pd.options.plotting.backend = \"plotly\"\n", + "pd.set_option('display.max_rows', 100)\n", + "pd.set_option('display.width', 1000)\n", + "#pd.set_option('display.max_columns', 500)\n", + "#pd.options.display.width = 0\n", + "\n", + "from ipywidgets import IntProgress\n", + "\n", + "import pickle\n", + "import importlib\n", + "import os\n", + "import glob\n", + "import math\n", + "import re\n", + "from collections import deque\n", + "import numpy as np\n", + "import sqlite3\n", + "import time\n", + "\n", + "import nsys_pres" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "83e4c7bc", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "files_df = pd.read_parquet(\"files.parquet\").rename_axis(\"Rank\",axis='index')\n", + "all_stats_df = pd.read_parquet(\"all_stats.parquet\")\n", + "rank_stats_df = pd.read_parquet(\"rank_stats.parquet\")" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "d7a3ac1f", + "metadata": {}, + "source": [ + "## Statistics for all ranks\n", + "Overall statistics for the functions across all ranks.\n", + "* Q1(approx) is the 25th percentile of the dataset. Approximated by the min of Q1 for each rank.\n", + "* Median(approx) is the 50th percentile of the dataset. Approximated by the median of the medians for each rank.\n", + "* Q3(approx) is the 75th percentile of the dataset. Approximated by the max of Q3 for each rank." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ba5bde92-c6bd-4493-a829-4ae84d797bb3", + "metadata": { + "jupyter": { + "source_hidden": true + }, + "tags": [] + }, + "outputs": [], + "source": [ + "display(all_stats_df)\n", + "fig1=nsys_pres.display_boxplots_df(None, all_stats_df,xaxis_title=\"Range Names\")\n", + "fig2=nsys_pres.display_graph(None, all_stats_df.index, all_stats_df[['Q1 (approx)', 'Median (approx)', 'Q3 (approx)']], title=\"50% of Distribution\", xaxis_title=\"Range Names\")" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "3fc1d09d-99ae-4dcb-9cbd-dc39e4545b4f", + "metadata": {}, + "source": [ + "## Statistics for all ranks for a particular selected function\n", + "Please select a function name to see:\n", + "* Table of per-rank statistics\n", + " * Q1 is the 25th percentile of the dataset.\n", + " * Median is the 50th percentile of the dataset.\n", + " * Q3 is the 75th percentile of the dataset.\n", + "* Boxplot the the distribution of timing per-rank to support the investigation of outliers\n", + "* Graph of Q1, Median, & Q3 to see how close together the middle (50%) of the data is without outlier." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7758cd1e-b5a9-4a10-867b-18d5719cbd90", + "metadata": { + "jupyter": { + "source_hidden": true + }, + "tags": [] + }, + "outputs": [], + "source": [ + "rank_stats_gdf = rank_stats_df.groupby(rank_stats_df.index)\n", + "nsys_pres.display_stats_per_rank_groups_combobox(rank_stats_gdf)" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "910620c7", + "metadata": {}, + "source": [ + "## Files\n", + "Ranks are assigned assuming that the file names include the rank and sort well. If they are not sufficiently padded with zeros, the real rank may differ from the assigned ID. This table allows you to identify the filename without the charts above having potentially very long label in the legend or x-axis." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c3328573", + "metadata": {}, + "outputs": [], + "source": [ + "display(files_df)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.10 (default, Nov 14 2022, 12:59:47) \n[GCC 9.4.0]" + }, + "vscode": { + "interpreter": { + "hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1" + } + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nccl_gpu_time_util_map/heatmap.ipynb b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nccl_gpu_time_util_map/heatmap.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..89a20de91975dfc9f9392f08d8dbf58a55fbe624 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nccl_gpu_time_util_map/heatmap.ipynb @@ -0,0 +1,94 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# NCCL GPU Time Utilization Heatmap" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import plotly.offline as pyo\n", + "\n", + "from IPython.display import display, HTML, Markdown\n", + "\n", + "import nsys_display\n", + "\n", + "display(HTML(''))\n", + "pd.set_option('display.max_colwidth', None)\n", + "pd.set_option('display.max_rows', None)\n", + "pyo.init_notebook_mode()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This line graph displays the summary GPU time utilization of NCCL and compute kernels:\n", + "* x axis represents the rank duration, scaling from 0 to the maximum duration across all ranks.\n", + "* y axis represents the mean utilization value across all ranks." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "df = pd.read_parquet('analysis.parquet')\n", + "# Create unique name.\n", + "df['Name'] = df['File'] + '/' + df['Device ID'].astype(str) + '/' + df['PID'].astype(str)\n", + "# Convert ns to s.\n", + "df['Duration'] = df['Duration'] * 1e-9\n", + "\n", + "types = ['All', 'NCCL', 'Compute']\n", + "nsys_display.display_summary_graph(\n", + " df,\n", + " types,\n", + " xaxis_title=\"Duration (s)\",\n", + " yaxis_title=\"Value (%)\",\n", + " title=\"Utilization Summary (bins=REPLACE_BIN)\"\n", + ")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This heatmap displays the GPU time utilization of NCCL and compute kernels:\n", + "* x axis represents the rank duration, scaling from 0 to the maximum duration across all ranks.\n", + "* y axis represents the set of File/Device/PID for which utilization data was collected." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "nsys_display.display_heatmaps(\n", + " df,\n", + " types,\n", + " xaxis_title=\"Duration (s)\",\n", + " yaxis_title=\"File/Device/PID\",\n", + " zaxis_title=\"Value (%)\",\n", + " title=\"Utilization Summary (bins=REPLACE_BIN)\"\n", + ")" + ] + } + ], + "metadata": { + "language_info": { + "name": "python" + }, + "orig_nbformat": 4 + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nccl_gpu_time_util_map/metadata.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nccl_gpu_time_util_map/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..1ee7a8497829e542cdde3410bb703007082dbe28 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nccl_gpu_time_util_map/metadata.json @@ -0,0 +1,11 @@ +{ + "module_name": "nccl_gpu_time_util_map", + "display_name": "NCCL GPU Time Utilization Heatmap", + "description": [ + "This recipe calculates the percentage of GPU utilization of NCCL and compute", + " kernels. Note that the utilization refers to the 'time' utilization and not the", + " 'resource' utilization. By default, the recipe calculates consolidated", + " utilization by taking the minimum start time and maximum end time for each", + " group of overlapping kernel ranges when multiple kernels run concurrently." + ] +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nccl_gpu_time_util_map/nccl_gpu_time_util_map.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nccl_gpu_time_util_map/nccl_gpu_time_util_map.py new file mode 100644 index 0000000000000000000000000000000000000000..fbd566b2afc1537f1de07ab6039ac8eee432450a --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nccl_gpu_time_util_map/nccl_gpu_time_util_map.py @@ -0,0 +1,201 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd + +from pathlib import Path +from datetime import datetime + +from nsys_recipe import log, data_service +from nsys_recipe.data_service import DataService +from nsys_recipe.lib import helpers, nvtx, recipe, heatmap +from nsys_recipe.lib.args import Option +from nsys_recipe.lib.collective_loader import ProfileInfo +from nsys_recipe.log import logger + + +class NcclGpuTimeUtilMap(recipe.Recipe): + @staticmethod + def _mapper_func(report_path, bin_size, min_session, parsed_args): + service = DataService(report_path) + + table_column_dict = { + "ANALYSIS_DETAILS": ["duration"], + "TARGET_INFO_SESSION_START_TIME": ["utcEpochNs"], + "StringIds": None, + "NVTX_EVENTS": [ + "text", + "start", + "end", + "textId", + "globalTid", + "endGlobalTid", + "domainId", + "eventType", + ], + "CUPTI_ACTIVITY_KIND_RUNTIME": [ + "correlationId", + "globalTid", + "start", + "end", + ], + "CUPTI_ACTIVITY_KIND_KERNEL": [ + "correlationId", + "globalPid", + "start", + "end", + "deviceId", + ], + } + + df_dict = service.read_tables(table_column_dict) + if df_dict is None: + return None + + kernel_df = df_dict["CUPTI_ACTIVITY_KIND_KERNEL"] + session_offset, profile_duration = data_service.compute_session_duration( + df_dict["ANALYSIS_DETAILS"], + df_dict["TARGET_INFO_SESSION_START_TIME"], + min_session, + ) + + data_service.filter_by_time_range(kernel_df, parsed_args.start, parsed_args.end) + data_service.apply_time_offset(kernel_df, session_offset) + + cuda_df = data_service.combine_api_gpu_dfs( + df_dict["CUPTI_ACTIVITY_KIND_RUNTIME"], kernel_df + ) + nccl_df = data_service.get_domain_range_df(df_dict["NVTX_EVENTS"], "NCCL") + + if nccl_df.empty or cuda_df.empty: + logger.info( + f"{report_path} was successfully processed, but no data was found." + ) + return None + + # Project NCCL kernels onto GPU. + nccl_df = data_service.combine_text_fields(nccl_df, df_dict["StringIds"]) + nccl_gpu_df = nvtx.project_nvtx_onto_gpu(nccl_df, cuda_df) + if nccl_gpu_df.empty: + logger.info( + f"{report_path} does not contain any NCCL data that can be projected onto the GPU." + ) + return None + + # Merge the kernel dataframe with the projected NCCL dataframe. + # If a kernel exists in both dataframes, it is an NCCL kernel. + # Otherwise, it is a compute kernel. + merged_df = kernel_df.merge( + nccl_gpu_df, on=["start", "end"], how="left", indicator="merged" + ) + merged_df["pid"] = data_service.extract_pid(merged_df["globalPid"]) + + kernel_grouped = merged_df.groupby(["pid", "deviceId"]) + results = [] + + for (pid, deviceId), group_df in kernel_grouped: + type_dfs = { + "All": group_df, + "NCCL": group_df[group_df["merged"] == "both"], + "Compute": group_df[group_df["merged"] == "left_only"], + } + bin_pcts = {} + + for name, type_df in type_dfs.items(): + if not parsed_args.cumulative: + type_df = heatmap.consolidate_ranges(type_df) + + bin_pcts[name] = heatmap.calculate_bin_pcts( + type_df, + bin_size, + parsed_args.bins, + profile_duration, + session_offset, + ) + + data = { + "Duration": heatmap.generate_bin_list(parsed_args.bins, bin_size), + **bin_pcts, + "PID": pid, + "Device ID": deviceId, + } + results.append(pd.DataFrame(data)) + + pct_df = pd.concat(results, ignore_index=True) + pct_df["File"] = Path(report_path).stem + + return pct_df + + @log.time("Mapper") + def mapper_func(self, context, filtered_dir, bin_size, min_session): + return context.wait( + context.map( + self._mapper_func, + filtered_dir, + bin_size=bin_size, + min_session=min_session, + parsed_args=self._parsed_args, + ) + ) + + @log.time("Reducer") + def reducer_func(self, dfs): + dfs = helpers.filter_none(dfs) + df = pd.concat(dfs) + + df.to_parquet(self.add_output_file("analysis.parquet")) + + def save_notebook(self): + self.create_notebook( + "heatmap.ipynb", replace_dict={"REPLACE_BIN": self._parsed_args.bins} + ) + self.add_notebook_helper_file("nsys_display.py") + + def save_analysis_file(self): + self._analysis_dict.update( + { + "EndTime": str(datetime.now()), + "InputFiles": self._parsed_args.input, + "Outputs": self._output_files, + } + ) + self.create_analysis_file() + + def run(self, context): + super().run(context) + + max_duration, min_session, filtered_dir = ProfileInfo.get_profile_info( + context, self._parsed_args.input + ) + bin_size = heatmap.get_bin_size(self._parsed_args.bins, max_duration) + + mapper_res = self.mapper_func(context, filtered_dir, bin_size, min_session) + self.reducer_func(mapper_res) + + self.save_notebook() + self.save_analysis_file() + + @classmethod + def get_argument_parser(cls): + parser = super().get_argument_parser() + + parser.add_recipe_argument(Option.INPUT) + parser.add_recipe_argument(Option.OUTPUT) + parser.add_recipe_argument(Option.FORCE_OVERWRITE) + parser.add_recipe_argument(Option.START) + parser.add_recipe_argument(Option.END) + parser.add_recipe_argument(Option.BINS) + parser.add_recipe_argument( + "--cumulative", + action="store_true", + help="Add up the utilization of all kernels within each bin." + " The utilization can exceed 100%% if multiple kernels are running concurrently", + ) + return parser diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nccl_sum/metadata.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nccl_sum/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..98dbb11a0da5e5505da10f449710621869d8d518 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nccl_sum/metadata.json @@ -0,0 +1,6 @@ +{ + "module_name": "nccl_sum", + "display_name": "NCCL Summary", + "description": "This recipe provides a summary of NCCL functions and their execution times.", + "type": "stats" +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nccl_sum/nccl_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nccl_sum/nccl_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..71f08f1326b0f7c9368379b825a41076fe33169a --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nccl_sum/nccl_sum.py @@ -0,0 +1,134 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd + +from datetime import datetime +from functools import partial +from pathlib import Path + +from nsys_recipe import log, data_service +from nsys_recipe.data_service import DataService +from nsys_recipe.lib import helpers, nvtx, recipe, summary +from nsys_recipe.lib.args import Option +from nsys_recipe.log import logger + + +class NcclSum(recipe.Recipe): + @staticmethod + def _mapper_func(report_path, parsed_args): + service = DataService(report_path) + + table_column_dict = { + "StringIds": None, + "NVTX_EVENTS": [ + "text", + "start", + "end", + "textId", + "globalTid", + "endGlobalTid", + "domainId", + "eventType", + ], + } + + df_dict = service.read_tables(table_column_dict) + if df_dict is None: + return None + + nccl_df = data_service.get_domain_range_df(df_dict["NVTX_EVENTS"], "NCCL") + data_service.filter_by_time_range(nccl_df, parsed_args.start, parsed_args.end) + + if nccl_df.empty: + logger.info( + f"{report_path} was successfully processed, but no data was found." + ) + return None + + nccl_df = data_service.combine_text_fields(nccl_df, df_dict["StringIds"]) + nccl_df["duration"] = nccl_df["end"] - nccl_df["start"] + nccl_df = nccl_df[nccl_df["duration"] > 0] + range_gdf = nccl_df[["text", "duration"]].groupby("text") + + filename = Path(report_path).stem + stats_df = summary.describe_duration(range_gdf["duration"]) + + return summary.StatsInfo(filename, stats_df) + + @log.time("Mapper") + def mapper_func(self, context): + return context.wait( + context.map( + self._mapper_func, + self._parsed_args.input, + parsed_args=self._parsed_args, + ) + ) + + @log.time("Reducer") + def reducer_func(self, mapper_res): + stats_infos = helpers.filter_none(mapper_res) + stats_infos = sorted(stats_infos, key=lambda x: x.filename) + + filenames, stats_dfs = zip(*stats_infos) + + rank_file_df = pd.DataFrame(filenames, columns=["File"]) + rank_file_df.to_parquet(self.add_output_file("files.parquet"), index=False) + + all_stats_df = summary.aggregate_stats_dfs(stats_dfs) + all_stats_df.to_parquet(self.add_output_file("all_stats.parquet")) + + rank_stats_dfs = [ + df.assign(Rank=rank, File=filenames[rank]) + for rank, df in enumerate(stats_dfs) + ] + rank_stats = pd.concat(rank_stats_dfs) + rank_stats.to_parquet(self.add_output_file("rank_stats.parquet")) + + if self._parsed_args.csv: + all_stats_df.to_csv(self.add_output_file("all_stats.csv")) + rank_stats.to_csv(self.add_output_file("rank_stats.csv")) + + def save_notebook(self): + self.create_notebook("stats.ipynb") + self.add_notebook_helper_file("nsys_pres.py") + + def save_analysis_file(self): + self._analysis_dict.update( + { + "EndTime": str(datetime.now()), + "InputFiles": self._parsed_args.input, + "Outputs": self._output_files, + } + ) + self.create_analysis_file() + + def run(self, context): + super().run(context) + + mapper_res = self.mapper_func(context) + self.reducer_func(mapper_res) + + self.save_notebook() + self.save_analysis_file() + + @classmethod + def get_argument_parser(cls): + parser = super().get_argument_parser() + + parser.add_recipe_argument(Option.INPUT) + parser.add_recipe_argument(Option.OUTPUT) + parser.add_recipe_argument(Option.FORCE_OVERWRITE) + parser.add_recipe_argument(Option.START) + parser.add_recipe_argument(Option.END) + parser.add_recipe_argument(Option.CSV) + + return parser diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nccl_sum/stats.ipynb b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nccl_sum/stats.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..6056f561e279f6947700cb7688a61972df70c6e4 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nccl_sum/stats.ipynb @@ -0,0 +1,199 @@ +{ + "cells": [ + { + "attachments": {}, + "cell_type": "markdown", + "id": "4e3c0c43-b1a5-4ade-be51-bb54043441be", + "metadata": {}, + "source": [ + "# NCCL Summary\n", + "Statistical analysis of NCCL functions.\n", + "\n", + "Some forms of MPI use CUDA. CUDA work launched within that function, on the same thread are projected. The projection refits the start and end time to tightly wrap the CUDA launches, memcopies and memsets invoked within it. The resulting duration (end-start) is then analyzed here. Note, in this mode, ranges not doing CUDA GPU work are discarded." + ] + }, + { + "cell_type": "markdown", + "id": "5cbed268-3ac1-4b76-8be9-0c2b060f1c3a", + "metadata": {}, + "source": [ + "## Loading" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0425e7d7", + "metadata": { + "jupyter": { + "source_hidden": true + }, + "tags": [] + }, + "outputs": [], + "source": [ + "from IPython.display import display, HTML, Markdown\n", + "display(HTML(\"\"))\n", + "\n", + "from ipywidgets import interact, Dropdown\n", + "import plotly.graph_objects as go\n", + "import plotly.offline as pyo\n", + "\n", + "def is_lab_notebook():\n", + " import re\n", + " import psutil\n", + " return any(re.search('jupyter-lab-script', x) for x in psutil.Process().parent().cmdline())\n", + "\n", + "if is_lab_notebook():\n", + " pyo.init_notebook_mode()\n", + " \n", + "\n", + "#!pip3 install plotly\n", + " \n", + "import pandas as pd\n", + "pd.options.plotting.backend = \"plotly\"\n", + "pd.set_option('display.max_rows', 100)\n", + "pd.set_option('display.width', 1000)\n", + "#pd.set_option('display.max_columns', 500)\n", + "#pd.options.display.width = 0\n", + "\n", + "from ipywidgets import IntProgress\n", + "\n", + "import pickle\n", + "import importlib\n", + "import os\n", + "import glob\n", + "import math\n", + "import re\n", + "from collections import deque\n", + "import numpy as np\n", + "import sqlite3\n", + "import time\n", + "\n", + "import nsys_pres" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "83e4c7bc", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "files_df = pd.read_parquet(\"files.parquet\").rename_axis(\"Rank\",axis='index')\n", + "all_stats_df = pd.read_parquet(\"all_stats.parquet\")\n", + "rank_stats_df = pd.read_parquet(\"rank_stats.parquet\")" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "d7a3ac1f", + "metadata": {}, + "source": [ + "## Statistics for all ranks\n", + "Overall statistics for the functions across all ranks.\n", + "* Q1(approx) is the 25th percentile of the dataset. Approximated by the min of Q1 for each rank.\n", + "* Median(approx) is the 50th percentile of the dataset. Approximated by the median of the medians for each rank.\n", + "* Q3(approx) is the 75th percentile of the dataset. Approximated by the max of Q3 for each rank." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ba5bde92-c6bd-4493-a829-4ae84d797bb3", + "metadata": { + "jupyter": { + "source_hidden": true + }, + "tags": [] + }, + "outputs": [], + "source": [ + "display(all_stats_df)\n", + "fig1=nsys_pres.display_boxplots_df(None, all_stats_df,xaxis_title=\"Range Names\")\n", + "fig2=nsys_pres.display_graph(None, all_stats_df.index, all_stats_df[['Q1 (approx)', 'Median (approx)', 'Q3 (approx)']], title=\"50% of Distribution\", xaxis_title=\"Range Names\")" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "3fc1d09d-99ae-4dcb-9cbd-dc39e4545b4f", + "metadata": {}, + "source": [ + "## Statistics for all ranks for a particular selected function\n", + "Please select a function name to see:\n", + "* Table of per-rank statistics\n", + " * Q1 is the 25th percentile of the dataset.\n", + " * Median is the 50th percentile of the dataset.\n", + " * Q3 is the 75th percentile of the dataset.\n", + "* Boxplot the the distribution of timing per-rank to support the investigation of outliers\n", + "* Graph of Q1, Median, & Q3 to see how close together the middle (50%) of the data is without outlier." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7758cd1e-b5a9-4a10-867b-18d5719cbd90", + "metadata": { + "jupyter": { + "source_hidden": true + }, + "tags": [] + }, + "outputs": [], + "source": [ + "rank_stats_gdf = rank_stats_df.groupby(rank_stats_df.index)\n", + "nsys_pres.display_stats_per_rank_groups_combobox(rank_stats_gdf)" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "910620c7", + "metadata": {}, + "source": [ + "## Files\n", + "Ranks are assigned assuming that the file names include the rank and sort well. If they are not sufficiently padded with zeros, the real rank may differ from the assigned ID. This table allows you to identify the filename without the charts above having potentially very long label in the legend or x-axis." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c3328573", + "metadata": {}, + "outputs": [], + "source": [ + "display(files_df)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.10 (default, Nov 14 2022, 12:59:47) \n[GCC 9.4.0]" + }, + "vscode": { + "interpreter": { + "hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1" + } + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nic_metric_map/heatmap.ipynb b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nic_metric_map/heatmap.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..1fa9408bf466e7b16cdce90ccf88e360441a8f68 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nic_metric_map/heatmap.ipynb @@ -0,0 +1,120 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# NIC Metric Heatmap" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import plotly.express as px\n", + "import plotly.graph_objects as go\n", + "import plotly.offline as pyo\n", + "\n", + "from IPython.display import display, HTML, Markdown\n", + "from plotly.subplots import make_subplots\n", + "\n", + "import nsys_display\n", + "\n", + "display(HTML(\"\"))\n", + "pd.set_option('display.max_colwidth', None)\n", + "pd.set_option('display.max_rows', None)\n", + "pyo.init_notebook_mode()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "df = pd.read_parquet('analysis.parquet')\n", + "# Create unique name.\n", + "df['Name'] = df['File'] + '/' + df['GlobalId'].astype(str) + '/' + df['NIC ID'].astype(str)\n", + "# Convert ns to s.\n", + "df['Duration'] = df['Duration'] * 1e-9\n", + "# Convert bytes to MBytes and rate metrics from \"/ms\" to \"/s\"\n", + "df['MB Recv'] = (df['Bytes Recv'] * 1000) / (1024 * 1024)\n", + "df['MB Sent'] = (df['Bytes Sent'] * 1000) / (1024 * 1024)\n", + "df['Congestion'] = df['Congestion'] * 1000\n", + "\n", + "types = ['MB Recv', 'MB Sent', 'Congestion']" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "These heatmaps display NIC metrics values across all NIC interfaces on all ranks:\n", + "* x axis represents the rank duration, scaling from 0 to the maximum duration across all ranks.\n", + "* y axis represents the set of File/GlobalId/NIC for which metrics were collected.\n", + "\n", + "The heatmaps present:\n", + "* MB Recv present the rates of bytes received in MiB/s.\n", + "* MB Sent present the rates of bytes sent in MiB/s.\n", + "* Congestion presents the congestion reported by 'Send Waits' packets in ticks/s." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "for type in types:\n", + " fig = make_subplots(1, 1, subplot_titles=[type], vertical_spacing=0.1)\n", + " fig.add_trace(\n", + " go.Heatmap(\n", + " x=df['Duration'],\n", + " y=df['Name'],\n", + " z=df[type],\n", + " showscale=False,\n", + " zmax=df[type].max(),\n", + " zauto=False,\n", + " hovertemplate=('
'.join([\n", + " 'Duration (s): %{{x}}',\n", + " 'Name: %{{y}}',\n", + " '{} (Value): %{{z}}'])+'').format(type)),\n", + " 1, 1)\n", + " unique_name_count = df['Name'].nunique()\n", + " fig.update_layout(\n", + " height=nsys_display._get_heatmap_height(unique_name_count),\n", + " title='NIC Metric (bins=30)'\n", + " )\n", + " fig.update_xaxes(title_text='Duration (s)')\n", + " fig.update_yaxes(title_text='File/GlobalId/NIC', categoryorder=\"category descending\", nticks=df[\"Name\"].nunique())\n", + " fig.update_traces({'colorbar': {'title_text': 'Value'}}, showscale=True, row=0)\n", + "\n", + " fig.show()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.4" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nic_metric_map/metadata.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nic_metric_map/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..dbe5d8edb87154cac6132b0145cf11ec2a3c2aca --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nic_metric_map/metadata.json @@ -0,0 +1,7 @@ +{ + "module_name": "nic_metric_map", + "display_name": "NIC Metric Heatmap", + "description": [ + "This recipe displays heatmaps of NIC metrics" + ] +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nic_metric_map/nic_metric_map.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nic_metric_map/nic_metric_map.py new file mode 100644 index 0000000000000000000000000000000000000000..4a1d6ea651fe51f6b2fcc217bf90016599e711fe --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nic_metric_map/nic_metric_map.py @@ -0,0 +1,182 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd + +from pathlib import Path +from datetime import datetime + +from nsys_recipe import log, data_service +from nsys_recipe.data_service import DataService +from nsys_recipe.lib import helpers, nvtx, recipe, heatmap +from nsys_recipe.lib.args import Option +from nsys_recipe.lib.collective_loader import ProfileInfo +from nsys_recipe.log import logger + + +class NicMetricMap(recipe.Recipe): + @staticmethod + def _mapper_func(report_path, bin_size, min_session, parsed_args): + service = DataService(report_path) + + table_column_dict = { + "ANALYSIS_DETAILS": ["duration"], + "TARGET_INFO_SESSION_START_TIME": ["utcEpochNs"], + "StringIds": None, + "TARGET_INFO_NETWORK_METRICS": ["metricsListId", "metricsIdx", "name"], + "NIC_ID_MAP": ["globalId", "nicId"], + "NET_NIC_METRIC": [ + "start", + "end", + "globalId", + "metricsListId", + "metricsIdx", + "value", + ], + } + + df_dict = service.read_tables(table_column_dict) + if df_dict is None: + return None + + nic_metric_df = df_dict["NET_NIC_METRIC"].join( + df_dict["NIC_ID_MAP"].set_index("globalId"), on="globalId" + ) + session_offset, profile_duration = data_service.compute_session_duration( + df_dict["ANALYSIS_DETAILS"], + df_dict["TARGET_INFO_SESSION_START_TIME"], + min_session, + ) + + data_service.filter_by_time_range( + nic_metric_df, parsed_args.start, parsed_args.end + ) + data_service.apply_time_offset(nic_metric_df, session_offset) + + if nic_metric_df.empty: + logger.info( + f"{report_path} was successfully processed, but no data was found." + ) + return None + + nic_metric_grouped = nic_metric_df.groupby(["globalId", "nicId"]) + results = [] + network_metric_info_df = df_dict["TARGET_INFO_NETWORK_METRICS"] + + for (globalId, nicId), group_df in nic_metric_grouped: + bytes_received_id = network_metric_info_df.loc[ + network_metric_info_df["name"] == "IB: Bytes sent", "metricsIdx" + ].iloc[0] + df_recv = group_df.loc[ + group_df["metricsIdx"] == bytes_received_id + ].reset_index(drop=True) + bytes_sent_id = network_metric_info_df.loc[ + network_metric_info_df["name"] == "IB: Bytes received", "metricsIdx" + ].iloc[0] + df_sent = group_df.loc[group_df["metricsIdx"] == bytes_sent_id].reset_index( + drop=True + ) + congestion_id = network_metric_info_df.loc[ + network_metric_info_df["name"] == "IB: Send waits", "metricsIdx" + ].iloc[0] + type_dfs = { + "Bytes Recv": df_recv, + "Bytes Sent": df_sent, + "Congestion": group_df.loc[ + group_df["metricsIdx"] == congestion_id + ].reset_index(drop=True), + } + bin_pcts = {} + + for name, type_df in type_dfs.items(): + type_df = type_df.loc[type_df["value"] > 0].reset_index(drop=True) + bin_pcts[name] = heatmap.calculate_bin_pcts( + type_df, + bin_size, + parsed_args.bins, + profile_duration, + session_offset, + value_key="value", + ) + + data = { + "Duration": heatmap.generate_bin_list(parsed_args.bins, bin_size), + **bin_pcts, + "GlobalId": globalId, + "NIC ID": nicId, + } + results.append(pd.DataFrame(data)) + + pct_df = pd.concat(results, ignore_index=True) + pct_df["File"] = Path(report_path).stem + + return pct_df + + @log.time("Mapper") + def mapper_func(self, context, filtered_dir, bin_size, min_session): + return context.wait( + context.map( + self._mapper_func, + filtered_dir, + bin_size=bin_size, + min_session=min_session, + parsed_args=self._parsed_args, + ) + ) + + @log.time("Reducer") + def reducer_func(self, dfs): + dfs = helpers.filter_none(dfs) + df = pd.concat(dfs) + + df.to_parquet(self.add_output_file("analysis.parquet")) + + def save_notebook(self): + self.create_notebook( + "heatmap.ipynb", replace_dict={"REPLACE_BIN": self._parsed_args.bins} + ) + self.add_notebook_helper_file("nsys_display.py") + + def save_analysis_file(self): + self._analysis_dict.update( + { + "EndTime": str(datetime.now()), + "InputFiles": self._parsed_args.input, + "Outputs": self._output_files, + } + ) + self.create_analysis_file() + + def run(self, context): + super().run(context) + + max_duration, min_session, filtered_dir = ProfileInfo.get_profile_info( + context, self._parsed_args.input + ) + bin_size = heatmap.get_bin_size(self._parsed_args.bins, max_duration) + + mapper_res = self.mapper_func(context, filtered_dir, bin_size, min_session) + self.reducer_func(mapper_res) + + self.save_notebook() + self.save_analysis_file() + + @classmethod + def get_argument_parser(cls): + parser = super().get_argument_parser() + + parser.add_recipe_argument(Option.INPUT) + parser.add_recipe_argument(Option.OUTPUT) + parser.add_recipe_argument(Option.FORCE_OVERWRITE) + parser.add_recipe_argument(Option.START) + parser.add_recipe_argument(Option.END) + parser.add_recipe_argument(Option.BINS) + + return parser diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_gpu_proj_pace/metadata.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_gpu_proj_pace/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..4b633fb98eabacf255af512d08b8eea750284700 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_gpu_proj_pace/metadata.json @@ -0,0 +1,8 @@ +{ + "module_name": "nvtx_gpu_proj_pace", + "display_name": "NVTX GPU Projection Pacing", + "description": [ + "This recipe investigates the progress and consistency of a particular NVTX range", + " projected from the CPU onto the GPU, throughout the application." + ] +} \ No newline at end of file diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_gpu_proj_pace/nvtx_gpu_proj_pace.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_gpu_proj_pace/nvtx_gpu_proj_pace.py new file mode 100644 index 0000000000000000000000000000000000000000..a9d6110ad62a3d9b13ba7ba9e2458f032d200d98 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_gpu_proj_pace/nvtx_gpu_proj_pace.py @@ -0,0 +1,176 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd + +from datetime import datetime +from pathlib import Path + +from nsys_recipe import log, data_service +from nsys_recipe.data_service import DataService +from nsys_recipe.lib import helpers, nvtx, pace, recipe, summary +from nsys_recipe.lib.args import Option +from nsys_recipe.log import logger + + +class NvtxGpuProjPace(recipe.Recipe): + @staticmethod + def _mapper_func(report_path, parsed_args): + service = DataService(report_path) + + name_column = "text" + table_column_dict = { + "TARGET_INFO_SESSION_START_TIME": None, + "StringIds": None, + "NVTX_EVENTS": [ + name_column, + "start", + "end", + "textId", + "globalTid", + "endGlobalTid", + ], + "CUPTI_ACTIVITY_KIND_RUNTIME": [ + "correlationId", + "globalTid", + "start", + "end", + ], + "CUPTI_ACTIVITY_KIND_KERNEL": [ + "correlationId", + "globalPid", + "start", + "end", + ], + "CUPTI_ACTIVITY_KIND_MEMCPY": [ + "correlationId", + "globalPid", + "start", + "end", + ], + "CUPTI_ACTIVITY_KIND_MEMSET": [ + "correlationId", + "globalPid", + "start", + "end", + ], + } + + df_dict = service.read_tables(table_column_dict) + if df_dict is None: + return None + + nvtx_df = df_dict["NVTX_EVENTS"] + kernel_df = df_dict["CUPTI_ACTIVITY_KIND_KERNEL"] + memcpy_df = df_dict["CUPTI_ACTIVITY_KIND_MEMCPY"] + memset_df = df_dict["CUPTI_ACTIVITY_KIND_MEMSET"] + + gpu_dfs = [kernel_df, memcpy_df, memset_df] + data_service.filter_by_time_range(gpu_dfs, parsed_args.start, parsed_args.end) + + gpu_df = pd.concat(gpu_dfs, ignore_index=True) + cuda_df = data_service.combine_api_gpu_dfs( + df_dict["CUPTI_ACTIVITY_KIND_RUNTIME"], gpu_df + ) + + if cuda_df.empty or nvtx_df.empty: + logger.info( + f"{report_path} was successfully processed, but no data was found." + ) + return None + + nvtx_df = data_service.combine_text_fields(nvtx_df, df_dict["StringIds"]) + nvtx_df = pace.filter_by_pace_name(nvtx_df, name_column, parsed_args.name) + if nvtx_df.empty: + logger.warning(f"{report_path} does not contain '{parsed_args.name}'.") + return None + + nvtx_gpu_df = nvtx.project_nvtx_onto_gpu(nvtx_df, cuda_df) + if nvtx_gpu_df.empty: + logger.info( + f"{report_path} does not contain any NVTX data that can be projected onto the GPU." + ) + return None + + filename = Path(report_path).stem + session_start = pace.get_session_start_time( + df_dict["TARGET_INFO_SESSION_START_TIME"] + ) + pace_df, stats_df = pace.compute_pace_stats_dfs(nvtx_gpu_df, name_column) + + return pace.PaceInfo(filename, pace_df, stats_df, session_start) + + @log.time("Mapper") + def mapper_func(self, context): + return context.wait( + context.map( + self._mapper_func, + self._parsed_args.input, + parsed_args=self._parsed_args, + ) + ) + + @log.time("Reducer") + def reducer_func(self, mapper_res): + pace_infos = helpers.filter_none(mapper_res) + pace_infos = sorted(pace_infos, key=lambda x: x.filename) + + filenames, pace_dfs, stats_dfs, session_starts = zip(*pace_infos) + pace.apply_time_offset(session_starts, pace_dfs) + + rank_file_df = pd.DataFrame(filenames, columns=["File"]) + rank_file_df.to_parquet(self.add_output_file("files.parquet"), index=False) + + stats_df = summary.aggregate_stats_dfs(stats_dfs) + stats_df.to_parquet(self.add_output_file("stats.parquet")) + + for name, df in pace.split_columns_as_dataframes(pace_dfs).items(): + df.to_parquet(self.add_output_file(f"pace_{name}.parquet"), index=False) + + def save_notebook(self): + self.create_notebook("pace.ipynb") + self.add_notebook_helper_file("nsys_pres.py") + + def save_analysis_file(self): + self._analysis_dict.update( + { + "EndTime": str(datetime.now()), + "InputFiles": self._parsed_args.input, + "Outputs": self._output_files, + } + ) + self.create_analysis_file() + + def run(self, context): + super().run(context) + + mapper_res = self.mapper_func(context) + self.reducer_func(mapper_res) + + self.save_notebook() + self.save_analysis_file() + + @classmethod + def get_argument_parser(cls): + parser = super().get_argument_parser() + + parser.add_recipe_argument(Option.INPUT) + parser.add_recipe_argument(Option.OUTPUT) + parser.add_recipe_argument(Option.FORCE_OVERWRITE) + parser.add_recipe_argument( + "--name", + type=str, + help="Name of the NVTX range used as delineator between iterations", + required=True, + ) + parser.add_recipe_argument(Option.START) + parser.add_recipe_argument(Option.END) + + return parser diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_gpu_proj_pace/pace.ipynb b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_gpu_proj_pace/pace.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..13f1ad7d492eaf9e77156214de282abbad6f82b2 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_gpu_proj_pace/pace.ipynb @@ -0,0 +1,323 @@ +{ + "cells": [ + { + "attachments": {}, + "cell_type": "markdown", + "id": "d47405aa-4e8c-4e8d-9e9f-5771f5eb0cd1", + "metadata": {}, + "source": [ + "# NVTX Iteration Analysis\n", + "Investigate the progress and consistency of an iteration based application. The target range, chosen by name, is assumed to be a delineator between iterations. This report graphs when the application reaches this range's(start), how long between ranges (delta), and how long the range took, encase it was behaving as a barrier, such as collective communication all-reduce. You will see how long each rank takes in comparison to eachother. The ranks that are taking longer to reach the end of the iteration(delta or range start) typically are preventing all the ranks from moving forward to the next iteration and so their performance should be investigated relative to the median or min. Identify the ranks and iterations here. Then investigate their cause by opening the 2-3 ranks (outlier plus median and/or min) in Nsight Systems as a multi-report view.\n", + "\n", + "All times are in nanoseconds." + ] + }, + { + "cell_type": "markdown", + "id": "5cbed268-3ac1-4b76-8be9-0c2b060f1c3a", + "metadata": { + "tags": [] + }, + "source": [ + "## Load Data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0425e7d7", + "metadata": { + "jupyter": { + "source_hidden": true + }, + "tags": [] + }, + "outputs": [], + "source": [ + "#General setup properties\n", + "import IPython.display\n", + "from IPython.display import display, HTML, Markdown\n", + "display(HTML(\"\"))\n", + "\n", + "import pickle\n", + "import importlib\n", + "import os\n", + "import glob\n", + "import math\n", + "import re\n", + "import time\n", + "from collections import deque\n", + "import pandas as pd\n", + "import numpy as np\n", + "import sqlite3\n", + "#!pip3 install plotly\n", + "\n", + "pd.options.plotting.backend = \"plotly\"\n", + "pd.set_option('display.max_rows', 100)\n", + "pd.set_option('display.width', 250)\n", + "\n", + "import nsys_pres" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8cfeaf53-9d41-4a8c-8b2f-82c89a5c2603", + "metadata": {}, + "outputs": [], + "source": [ + "#load the data\n", + "stats_df = pd.read_parquet(\"stats.parquet\")\n", + "files_df = pd.read_parquet(\"files.parquet\").rename_axis(\"Rank\",axis='index')\n", + "\n", + "pace_map_by_column=dict()\n", + "pace_map_by_column['start'] = pd.read_parquet(\"pace_start.parquet\").rename_axis(\"Iterations\",axis='index').rename_axis(\"Ranks\",axis='columns')\n", + "pace_map_by_column['end'] = pd.read_parquet(\"pace_end.parquet\").rename_axis(\"Iterations\",axis='index').rename_axis(\"Ranks\",axis='columns')\n", + "pace_map_by_column['duration'] = pd.read_parquet(\"pace_duration.parquet\").rename_axis(\"Iterations\",axis='index').rename_axis(\"Ranks\",axis='columns')\n", + "pace_map_by_column['duration_accum'] = pd.read_parquet(\"pace_duration_accum.parquet\").rename_axis(\"Iterations\",axis='index').rename_axis(\"Ranks\",axis='columns')\n", + "pace_map_by_column['delta'] = pd.read_parquet(\"pace_delta.parquet\").rename_axis(\"Iterations\",axis='index').rename_axis(\"Ranks\",axis='columns')\n", + "pace_map_by_column['delta_accum'] = pd.read_parquet(\"pace_delta_accum.parquet\").rename_axis(\"Iterations\",axis='index').rename_axis(\"Ranks\",axis='columns')\n", + "pace_map_by_column['delta_stats'] = pd.read_parquet(\"pace_delta_stats.parquet\").rename_axis(\"Iterations\",axis='index').rename_axis(\"Ranks\",axis='columns')\n" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "f330296f-74c5-4378-b982-d0fb95236972", + "metadata": {}, + "source": [ + "## Statistics for Target Operation\n", + "Overall statistics for the target range across all ranks.\n", + "* Q1(approx) is the 25th percentile of the dataset. Approximated by the min of Q1 for each rank.\n", + "* Median(approx) is the 50th percentile of the dataset. Approximated by the median of the medians for each rank.\n", + "* Q3(approx) is the 75th percentile of the dataset. Approximated by the max of Q3 for each rank." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ba5bde92-c6bd-4493-a829-4ae84d797bb3", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "display(stats_df.T)" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "2a196ce7-937a-4766-b6b4-e616f7c0dc7b", + "metadata": {}, + "source": [ + "## Start of Target Operation\n", + "Wall-clock time of when each rank reached this operation.\n", + "* The progress graph represents each rank as a line, the x-axis prepresents linear progress. \n", + "* The consistency graph transposes the data, showing a line for each iteration. Visually moving upward from the x-axis, this is when the rank reached this iteration." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "062dbf46-4432-4084-bdc3-0ac93086cc52", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "figs=list()\n", + "nsys_pres.display_pace_graph(figs, pace_map_by_column, 'start')" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "5e264faa-63a8-4a14-beda-f51e81198623", + "metadata": { + "tags": [] + }, + "source": [ + "## Delta Between Targets\n", + "The time measured between the target range.\n", + "* A boxplot to understand the distribution of the rank timing per iteration \n", + "* The progress graph represents each rank as a line, the x-axis prepresents linear progress. \n", + "* The consistency graph transposes the data, showing a line for each iteration. Visually moving upward from the x-axis, this is how long each iteration tool. Search here for inconsistencies between ranks to investigate. If the lines are consistent horizontally then each rank completed their work at the same time." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3e075b96-106c-4ea1-bce6-9dc9e2947626", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "\n", + "delta_stats_df = pace_map_by_column['delta_stats']\n", + "\n", + "figs = nsys_pres.display_boxplots_df(None, delta_stats_df.loc[1:],\n", + " title=\"Delta boxplot per iteration (across ranks)\",\n", + " xaxis_title=\"Iteration\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3dc34bc3-5cc6-4c24-af9d-1d0f3e2f974d", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "figs=list()\n", + "nsys_pres.display_pace_graph(figs, pace_map_by_column, 'delta')" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "4f09ae70-fccf-4d54-a604-15fcd4baef4f", + "metadata": {}, + "source": [ + "## Variance in Delta between Targets\n", + "Similar \"Delta between Barriers\", the median time per-iteration is subtracted from the rank's value, typically making the ouliers more obvious if they were subtle above." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6bfd6537-c6c9-4c84-82bb-75f522815730", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "figs=list()\n", + "nsys_pres.display_pace_graph_delta_minus_median(figs, pace_map_by_column)" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "ecd47c77-1166-4257-aaeb-ed0868a2b7e5", + "metadata": { + "tags": [] + }, + "source": [ + "## Delta Accumulated\n", + "This is the accomulated time between the target ranges. This is more relevant if the target range is a barrier, such as an all-reduce, which must wait for all participants. Assuming that the time in the target range is consistent, this may look similar to the graph of starts. If the target range is a barrier, it will provide a more accurate picture of how fast the rank is processing it's data overall. This can assist in identifying issues such inconsistent workload distribution, consistently giving a lighter load to a particular rank, or a hardware difference (distance from storage, NUMA setup, GPU or NIC bindings, throttling, etc), or even other OS and software services interfering." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e5c4dddc-b861-4d1f-9e3c-ef0c0c99e3be", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "figs=list()\n", + "nsys_pres.display_pace_graph(figs, pace_map_by_column, 'delta_accum')" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "d197995f-fdc3-4f16-8ec9-a76d5c471cdb", + "metadata": {}, + "source": [ + "## Duration Accumuled\n", + "Similar to delta accumulation, how long are we spending in the target range so far in the application's progress through these iterations? If this is a barrier-like operation it is how long you are blocking." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b45347d0-5461-4d87-b311-f645c2571c0b", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "figs=list()\n", + "nsys_pres.display_pace_graph(figs, pace_map_by_column, 'duration_accum')" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "83b24ace-41f2-414a-ab56-d3e2c45590c0", + "metadata": {}, + "source": [ + "## Duration\n", + "The duration is not accumulated here, so outliers are more likely to stand out." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4a93e3f3-bddc-47c1-a621-2546fd36e8ef", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "figs=list()\n", + "nsys_pres.display_pace_graph(figs, pace_map_by_column, 'duration')" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "06a8af17-8a7e-4d48-9bd8-0fe1bdd979a5", + "metadata": { + "tags": [] + }, + "source": [ + "## Files\n", + "Ranks are assigned assuming that the file names include the rank and sort well. If they are not sufficiently padded with zeros, the real rank may differ from the assigned ID. This table allows you to identify the filename without the charts above having potentially very long label in the legend or x-axis." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "46978d5e-7fab-4b52-bb55-713d50c8eb40", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "display(files_df)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.10 (default, Nov 14 2022, 12:59:47) \n[GCC 9.4.0]" + }, + "vscode": { + "interpreter": { + "hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1" + } + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_gpu_proj_sum/metadata.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_gpu_proj_sum/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..a81284edf3b8375443fb603ce65875cc36c8893f --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_gpu_proj_sum/metadata.json @@ -0,0 +1,9 @@ +{ + "module_name": "nvtx_gpu_proj_sum", + "display_name": "NVTX GPU Projection Summary", + "description": [ + "This recipe provides a summary of NVTX time ranges projected from the CPU onto", + " the GPU, and their execution times." + ], + "type": "stats" +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_gpu_proj_sum/nvtx_gpu_proj_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_gpu_proj_sum/nvtx_gpu_proj_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..7ba526ad603fa5487a5fe5ae9cd1b3f363097f01 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_gpu_proj_sum/nvtx_gpu_proj_sum.py @@ -0,0 +1,173 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd + +from datetime import datetime +from pathlib import Path + +from nsys_recipe import log, data_service +from nsys_recipe.data_service import DataService +from nsys_recipe.lib import helpers, nvtx, recipe, summary +from nsys_recipe.lib.args import Option +from nsys_recipe.log import logger + + +class NvtxGpuProjSum(recipe.Recipe): + @staticmethod + def _mapper_func(report_path, parsed_args): + service = DataService(report_path) + + name_column = "text" + table_column_dict = { + "StringIds": None, + "NVTX_EVENTS": [ + name_column, + "start", + "end", + "textId", + "globalTid", + "endGlobalTid", + ], + "CUPTI_ACTIVITY_KIND_RUNTIME": [ + "correlationId", + "globalTid", + "start", + "end", + ], + "CUPTI_ACTIVITY_KIND_KERNEL": [ + "correlationId", + "globalPid", + "start", + "end", + ], + "CUPTI_ACTIVITY_KIND_MEMCPY": [ + "correlationId", + "globalPid", + "start", + "end", + ], + "CUPTI_ACTIVITY_KIND_MEMSET": [ + "correlationId", + "globalPid", + "start", + "end", + ], + } + + df_dict = service.read_tables(table_column_dict) + if df_dict is None: + return None + + nvtx_df = df_dict["NVTX_EVENTS"] + kernel_df = df_dict["CUPTI_ACTIVITY_KIND_KERNEL"] + memcpy_df = df_dict["CUPTI_ACTIVITY_KIND_MEMCPY"] + memset_df = df_dict["CUPTI_ACTIVITY_KIND_MEMSET"] + + gpu_dfs = [kernel_df, memcpy_df, memset_df] + data_service.filter_by_time_range(gpu_dfs, parsed_args.start, parsed_args.end) + + gpu_df = pd.concat(gpu_dfs, ignore_index=True) + cuda_df = data_service.combine_api_gpu_dfs( + df_dict["CUPTI_ACTIVITY_KIND_RUNTIME"], gpu_df + ) + + if cuda_df.empty or nvtx_df.empty: + logger.info( + f"{report_path} was successfully processed, but no data was found." + ) + return None + + nvtx_df = data_service.combine_text_fields(nvtx_df, df_dict["StringIds"]) + nvtx_gpu_df = nvtx.project_nvtx_onto_gpu(nvtx_df, cuda_df) + if nvtx_gpu_df.empty: + logger.info( + f"{report_path} does not contain any NVTX data that can be projected onto the GPU." + ) + return None + + nvtx_gpu_df["duration"] = nvtx_gpu_df["end"] - nvtx_gpu_df["start"] + nvtx_gpu_df = nvtx_gpu_df[nvtx_gpu_df["duration"] > 0] + range_gdf = nvtx_gpu_df[["text", "duration"]].groupby("text") + + filename = Path(report_path).stem + stats_df = summary.describe_duration(range_gdf["duration"]) + + return summary.StatsInfo(filename, stats_df) + + @log.time("Mapper") + def mapper_func(self, context): + return context.wait( + context.map( + self._mapper_func, + self._parsed_args.input, + parsed_args=self._parsed_args, + ) + ) + + @log.time("Reducer") + def reducer_func(self, mapper_res): + stats_infos = helpers.filter_none(mapper_res) + stats_infos = sorted(stats_infos, key=lambda x: x.filename) + + filenames, stats_dfs = zip(*stats_infos) + + rank_file_df = pd.DataFrame(filenames, columns=["File"]) + rank_file_df.to_parquet(self.add_output_file("files.parquet"), index=False) + + all_stats_df = summary.aggregate_stats_dfs(stats_dfs) + all_stats_df.to_parquet(self.add_output_file("all_stats.parquet")) + + rank_stats_dfs = [ + df.assign(Rank=rank, File=filenames[rank]) + for rank, df in enumerate(stats_dfs) + ] + rank_stats = pd.concat(rank_stats_dfs) + rank_stats.to_parquet(self.add_output_file("rank_stats.parquet")) + + if self._parsed_args.csv: + all_stats_df.to_csv(self.add_output_file("all_stats.csv")) + rank_stats.to_csv(self.add_output_file("rank_stats.csv")) + + def save_notebook(self): + self.create_notebook("stats.ipynb") + self.add_notebook_helper_file("nsys_pres.py") + + def save_analysis_file(self): + self._analysis_dict.update( + { + "EndTime": str(datetime.now()), + "InputFiles": self._parsed_args.input, + "Outputs": self._output_files, + } + ) + self.create_analysis_file() + + def run(self, context): + super().run(context) + + mapper_res = self.mapper_func(context) + self.reducer_func(mapper_res) + + self.save_notebook() + self.save_analysis_file() + + @classmethod + def get_argument_parser(cls): + parser = super().get_argument_parser() + + parser.add_recipe_argument(Option.INPUT) + parser.add_recipe_argument(Option.OUTPUT) + parser.add_recipe_argument(Option.FORCE_OVERWRITE) + parser.add_recipe_argument(Option.START) + parser.add_recipe_argument(Option.END) + parser.add_recipe_argument(Option.CSV) + + return parser diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_gpu_proj_sum/stats.ipynb b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_gpu_proj_sum/stats.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..073bc71fb5bbc9b9024a846769bf4d73607c4ebc --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_gpu_proj_sum/stats.ipynb @@ -0,0 +1,204 @@ +{ + "cells": [ + { + "attachments": {}, + "cell_type": "markdown", + "id": "4e3c0c43-b1a5-4ade-be51-bb54043441be", + "metadata": {}, + "source": [ + "# NVTX GPU Projection Summary\n", + "Statistical analysis of NVTX ranges projected onto the GPU via analysis of the CUDA work launched within that range, on the same thread. The projection refits the range's start and end time to tightly wrap the CUDA launches, memcopies and memsets invoked within it. The resulting duration (end-start) is then analyzed here.\n", + "\n", + "NOTES: \n", + "* CUDA work launched on threads other then the one which opened & closed the range are not counted towards the projection because they may be intended for other NVTX ranges or not intended to be tracked.\n", + "* NVTX ranges that start or end outside the scope the report being analyzed are discarded\n", + "* NVTX ranges that start and end on different ranges are discarded\n", + "* NVTX ranges with zero duration after GPU projection are discarded" + ] + }, + { + "cell_type": "markdown", + "id": "5cbed268-3ac1-4b76-8be9-0c2b060f1c3a", + "metadata": {}, + "source": [ + "## Loading" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0425e7d7", + "metadata": { + "jupyter": { + "source_hidden": true + }, + "tags": [] + }, + "outputs": [], + "source": [ + "from IPython.display import display, HTML, Markdown\n", + "display(HTML(\"\"))\n", + "\n", + "from ipywidgets import interact, Dropdown\n", + "import plotly.graph_objects as go\n", + "import plotly.offline as pyo\n", + "\n", + "def is_lab_notebook():\n", + " import re\n", + " import psutil\n", + " return any(re.search('jupyter-lab-script', x) for x in psutil.Process().parent().cmdline())\n", + "\n", + "if is_lab_notebook():\n", + " pyo.init_notebook_mode()\n", + " \n", + "\n", + "#!pip3 install plotly\n", + " \n", + "import pandas as pd\n", + "pd.options.plotting.backend = \"plotly\"\n", + "pd.set_option('display.max_rows', 100)\n", + "pd.set_option('display.width', 1000)\n", + "#pd.set_option('display.max_columns', 500)\n", + "#pd.options.display.width = 0\n", + "\n", + "from ipywidgets import IntProgress\n", + "\n", + "import pickle\n", + "import importlib\n", + "import os\n", + "import glob\n", + "import math\n", + "import re\n", + "from collections import deque\n", + "import numpy as np\n", + "import sqlite3\n", + "import time\n", + "\n", + "import nsys_pres" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "83e4c7bc", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "files_df = pd.read_parquet(\"files.parquet\").rename_axis(\"Rank\",axis='index')\n", + "all_stats_df = pd.read_parquet(\"all_stats.parquet\")\n", + "rank_stats_df = pd.read_parquet(\"rank_stats.parquet\")\n", + "#.rename_axis(\"Iterations\",axis='index').rename_axis(\"Ranks\",axis='columns')" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "d7a3ac1f", + "metadata": {}, + "source": [ + "## Statistics for all ranks\n", + "Overall statistics for the NVTX range across all ranks.\n", + "* Q1(approx) is the 25th percentile of the dataset. Approximated by the min of Q1 for each rank.\n", + "* Median(approx) is the 50th percentile of the dataset. Approximated by the median of the medians for each rank.\n", + "* Q3(approx) is the 75th percentile of the dataset. Approximated by the max of Q3 for each rank." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ba5bde92-c6bd-4493-a829-4ae84d797bb3", + "metadata": { + "jupyter": { + "source_hidden": true + }, + "tags": [] + }, + "outputs": [], + "source": [ + "display(all_stats_df)\n", + "fig1=nsys_pres.display_boxplots_df(None, all_stats_df,xaxis_title=\"Range Names\")\n", + "fig2=nsys_pres.display_graph(None, all_stats_df.index, all_stats_df[['Q1 (approx)', 'Median (approx)', 'Q3 (approx)']], title=\"50% of Distribution\", xaxis_title=\"Range Names\")" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "3fc1d09d-99ae-4dcb-9cbd-dc39e4545b4f", + "metadata": {}, + "source": [ + "## Statistics for all ranks for a particular selected range\n", + "Please select a range name to see:\n", + "* Table of per-rank statistics\n", + " * Q1 is the 25th percentile of the dataset.\n", + " * Median is the 50th percentile of the dataset.\n", + " * Q3 is the 75th percentile of the dataset.\n", + "* Boxplot the the distribution of timing per-rank to support the investigation of outliers\n", + "* Graph of Q1, Median, & Q3 to see how close together the middle (50%) of the data is without outlier." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7758cd1e-b5a9-4a10-867b-18d5719cbd90", + "metadata": { + "jupyter": { + "source_hidden": true + }, + "tags": [] + }, + "outputs": [], + "source": [ + "rank_stats_gdf = rank_stats_df.groupby(rank_stats_df.index)\n", + "nsys_pres.display_stats_per_rank_groups_combobox(rank_stats_gdf)" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "910620c7", + "metadata": {}, + "source": [ + "## Files\n", + "Ranks are assigned assuming that the file names include the rank and sort well. If they are not sufficiently padded with zeros, the real rank may differ from the assigned ID. This table allows you to identify the filename without the charts above having potentially very long label in the legend or x-axis." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c3328573", + "metadata": {}, + "outputs": [], + "source": [ + "display(files_df)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.10 (default, Nov 14 2022, 12:59:47) \n[GCC 9.4.0]" + }, + "vscode": { + "interpreter": { + "hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1" + } + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_gpu_proj_trace/metadata.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_gpu_proj_trace/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..f5011067b4d9565dee06f321318b93056e015c1d --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_gpu_proj_trace/metadata.json @@ -0,0 +1,15 @@ +{ + "module_name": "nvtx_gpu_proj_trace", + "display_name": "NVTX GPU Projection Trace", + "description": [ + "This recipe provides a trace of NVTX time ranges projected from the CPU onto", + " the GPU. Each NVTX range contains one or more GPU operations. A GPU operation", + " is considered to be 'contained' by an NVTX range if the CUDA API call used", + " to launch the operation is within the NVTX range. Only ranges that start and", + " end on the same thread are taken into account.\n\n", + + "The projected range will have the start timestamp of the first enclosed GPU", + " operation and the end timestamp of the last enclosed GPU operation, as well", + " as the stack state and relationship to other NVTX ranges." + ] +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_gpu_proj_trace/nvtx_gpu_proj_trace.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_gpu_proj_trace/nvtx_gpu_proj_trace.py new file mode 100644 index 0000000000000000000000000000000000000000..cd4270b33eb3d144bb031435692e05513eae748c --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_gpu_proj_trace/nvtx_gpu_proj_trace.py @@ -0,0 +1,98 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd + +from datetime import datetime +from pathlib import Path + +from nsys_recipe import log +from nsys_recipe.data_service import StatsService +from nsys_recipe.lib import helpers, recipe +from nsys_recipe.lib.args import Option +from nsys_recipe.log import logger + + +class NvtxGpuProjTrace(recipe.Recipe): + @staticmethod + def _mapper_func(report_path, parsed_args): + service = StatsService(report_path) + + df = service.read_sql_report( + "nvtx_gpu_proj_trace", "NvtxGpuProjTrace", parsed_args + ) + if df is None: + return None + + if df.empty: + logger.info( + f"{report_path} was successfully processed, but no data was found." + ) + return None + + df["File"] = Path(report_path).stem + return df + + @log.time("Mapper") + def mapper_func(self, context): + return context.wait( + context.map( + self._mapper_func, + self._parsed_args.input, + parsed_args=self._parsed_args, + ) + ) + + @log.time("Reducer") + def reducer_func(self, dfs): + dfs = helpers.filter_none(dfs) + df = pd.concat(dfs) + + # Remove any tags or hidden columns that are for internal use. + df.columns = df.columns.str.replace("(:).*", "", regex=True) + df = df.loc[:, ~df.columns.str.startswith("_")] + + df.to_parquet(self.add_output_file("trace.parquet")) + + def save_notebook(self): + self.create_notebook("trace.ipynb") + self.add_notebook_helper_file("nsys_display.py") + + def save_analysis_file(self): + self._analysis_dict.update( + { + "EndTime": str(datetime.now()), + "InputFiles": self._parsed_args.input, + "Outputs": self._output_files, + } + ) + self.create_analysis_file() + + def run(self, context): + super().run(context) + + mapper_res = self.mapper_func(context) + self.reducer_func(mapper_res) + + self.save_notebook() + self.save_analysis_file() + + @classmethod + def get_argument_parser(cls): + parser = super().get_argument_parser() + + parser.add_recipe_argument(Option.INPUT) + parser.add_recipe_argument(Option.OUTPUT) + parser.add_recipe_argument(Option.FORCE_OVERWRITE) + parser.add_recipe_argument(Option.START) + parser.add_recipe_argument(Option.END) + parser.add_recipe_argument(Option.NVTX) + + return parser diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_gpu_proj_trace/trace.ipynb b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_gpu_proj_trace/trace.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..b232fdef5f684a7dda9f7ca4fe9c9a8f8eda17bd --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_gpu_proj_trace/trace.ipynb @@ -0,0 +1,83 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# NVTX GPU Trace" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This notebook provides a trace of NVTX time ranges projected from the CPU\n", + "onto the GPU. Each NVTX range contains one or more GPU operations. A GPU\n", + "operation is considered to be \"contained\" by an NVTX range if the CUDA API\n", + "call used to launch the operation is within the NVTX range. Only ranges\n", + "that start and end on the same thread are taken into account.\n", + "\n", + "The projected range will have the start timestamp of the first enclosed GPU\n", + "operation and the end timestamp of the last enclosed GPU operation, as well\n", + "as the stack state and relationship to other NVTX ranges." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import plotly.offline as pyo\n", + "\n", + "from IPython.display import display, HTML, Markdown\n", + "\n", + "import nsys_display\n", + "\n", + "display(HTML(\"\"))\n", + "pd.set_option('display.max_colwidth', None)\n", + "pd.set_option('display.max_rows', None)\n", + "pyo.init_notebook_mode()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The table shows traces for each individual rank selected from the drop-down menu.\n", + "\n", + "All time values are in nanoseconds." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "df = pd.read_parquet('trace.parquet')\n", + "nsys_display.display_table_per_rank(df)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "name": "python", + "version": "3.10.5" + }, + "orig_nbformat": 4, + "vscode": { + "interpreter": { + "hash": "7e1998ff7f8aa20ada591c520b972326324e5ea05489af9e422744c7c09f6dad" + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_pace/metadata.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_pace/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..60b6aa9abec8d2c839f29ed3cab7d54dd5a9679c --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_pace/metadata.json @@ -0,0 +1,8 @@ +{ + "module_name": "nvtx_pace", + "display_name": "NVTX Pacing", + "description": [ + "This recipe investigates the progress and consistency of a particular NVTX range", + " throughout the application." + ] +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_pace/nvtx_pace.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_pace/nvtx_pace.py new file mode 100644 index 0000000000000000000000000000000000000000..bc2dc3a837a3a0e7ea7034930a3d0fed386c9698 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_pace/nvtx_pace.py @@ -0,0 +1,135 @@ +# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd + +from datetime import datetime +from pathlib import Path + +from nsys_recipe import log, data_service +from nsys_recipe.data_service import DataService +from nsys_recipe.lib import helpers, nvtx, pace, recipe, summary +from nsys_recipe.lib.args import Option +from nsys_recipe.log import logger + + +class NvtxPace(recipe.Recipe): + @staticmethod + def _mapper_func(report_path, parsed_args): + service = DataService(report_path) + + name_column = "text" + table_column_dict = { + "TARGET_INFO_SESSION_START_TIME": None, + "StringIds": None, + "NVTX_EVENTS": [ + name_column, + "start", + "end", + "textId", + "globalTid", + "endGlobalTid", + ], + } + + df_dict = service.read_tables(table_column_dict) + if df_dict is None: + return None + + nvtx_df = df_dict["NVTX_EVENTS"] + data_service.filter_by_time_range(nvtx_df, parsed_args.start, parsed_args.end) + + if nvtx_df.empty: + logger.info( + f"{report_path} was successfully processed, but no data was found." + ) + return None + + nvtx_df = data_service.combine_text_fields(nvtx_df, df_dict["StringIds"]) + nvtx_df = pace.filter_by_pace_name(nvtx_df, name_column, parsed_args.name) + if nvtx_df.empty: + logger.warning(f"{report_path} does not contain '{parsed_args.name}'.") + return None + + filename = Path(report_path).stem + session_start = pace.get_session_start_time( + df_dict["TARGET_INFO_SESSION_START_TIME"] + ) + pace_df, stats_df = pace.compute_pace_stats_dfs(nvtx_df, name_column) + + return pace.PaceInfo(filename, pace_df, stats_df, session_start) + + @log.time("Mapper") + def mapper_func(self, context): + return context.wait( + context.map( + self._mapper_func, + self._parsed_args.input, + parsed_args=self._parsed_args, + ) + ) + + @log.time("Reducer") + def reducer_func(self, mapper_res): + pace_infos = helpers.filter_none(mapper_res) + pace_infos = sorted(pace_infos, key=lambda x: x.filename) + + filenames, pace_dfs, stats_dfs, session_starts = zip(*pace_infos) + pace.apply_time_offset(session_starts, pace_dfs) + + rank_file_df = pd.DataFrame(filenames, columns=["File"]) + rank_file_df.to_parquet(self.add_output_file("files.parquet"), index=False) + + stats_df = summary.aggregate_stats_dfs(stats_dfs) + stats_df.to_parquet(self.add_output_file("stats.parquet")) + + for name, df in pace.split_columns_as_dataframes(pace_dfs).items(): + df.to_parquet(self.add_output_file(f"pace_{name}.parquet"), index=False) + + def save_notebook(self): + self.create_notebook("pace.ipynb") + self.add_notebook_helper_file("nsys_pres.py") + + def save_analysis_file(self): + self._analysis_dict.update( + { + "EndTime": str(datetime.now()), + "InputFiles": self._parsed_args.input, + "Outputs": self._output_files, + } + ) + self.create_analysis_file() + + def run(self, context): + super().run(context) + + mapper_res = self.mapper_func(context) + self.reducer_func(mapper_res) + + self.save_notebook() + self.save_analysis_file() + + @classmethod + def get_argument_parser(cls): + parser = super().get_argument_parser() + + parser.add_recipe_argument(Option.INPUT) + parser.add_recipe_argument(Option.OUTPUT) + parser.add_recipe_argument(Option.FORCE_OVERWRITE) + parser.add_recipe_argument( + "--name", + type=str, + help="Name of the NVTX range used as delineator between iterations", + required=True, + ) + parser.add_recipe_argument(Option.START) + parser.add_recipe_argument(Option.END) + + return parser diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_pace/pace.ipynb b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_pace/pace.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..13f1ad7d492eaf9e77156214de282abbad6f82b2 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_pace/pace.ipynb @@ -0,0 +1,323 @@ +{ + "cells": [ + { + "attachments": {}, + "cell_type": "markdown", + "id": "d47405aa-4e8c-4e8d-9e9f-5771f5eb0cd1", + "metadata": {}, + "source": [ + "# NVTX Iteration Analysis\n", + "Investigate the progress and consistency of an iteration based application. The target range, chosen by name, is assumed to be a delineator between iterations. This report graphs when the application reaches this range's(start), how long between ranges (delta), and how long the range took, encase it was behaving as a barrier, such as collective communication all-reduce. You will see how long each rank takes in comparison to eachother. The ranks that are taking longer to reach the end of the iteration(delta or range start) typically are preventing all the ranks from moving forward to the next iteration and so their performance should be investigated relative to the median or min. Identify the ranks and iterations here. Then investigate their cause by opening the 2-3 ranks (outlier plus median and/or min) in Nsight Systems as a multi-report view.\n", + "\n", + "All times are in nanoseconds." + ] + }, + { + "cell_type": "markdown", + "id": "5cbed268-3ac1-4b76-8be9-0c2b060f1c3a", + "metadata": { + "tags": [] + }, + "source": [ + "## Load Data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0425e7d7", + "metadata": { + "jupyter": { + "source_hidden": true + }, + "tags": [] + }, + "outputs": [], + "source": [ + "#General setup properties\n", + "import IPython.display\n", + "from IPython.display import display, HTML, Markdown\n", + "display(HTML(\"\"))\n", + "\n", + "import pickle\n", + "import importlib\n", + "import os\n", + "import glob\n", + "import math\n", + "import re\n", + "import time\n", + "from collections import deque\n", + "import pandas as pd\n", + "import numpy as np\n", + "import sqlite3\n", + "#!pip3 install plotly\n", + "\n", + "pd.options.plotting.backend = \"plotly\"\n", + "pd.set_option('display.max_rows', 100)\n", + "pd.set_option('display.width', 250)\n", + "\n", + "import nsys_pres" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8cfeaf53-9d41-4a8c-8b2f-82c89a5c2603", + "metadata": {}, + "outputs": [], + "source": [ + "#load the data\n", + "stats_df = pd.read_parquet(\"stats.parquet\")\n", + "files_df = pd.read_parquet(\"files.parquet\").rename_axis(\"Rank\",axis='index')\n", + "\n", + "pace_map_by_column=dict()\n", + "pace_map_by_column['start'] = pd.read_parquet(\"pace_start.parquet\").rename_axis(\"Iterations\",axis='index').rename_axis(\"Ranks\",axis='columns')\n", + "pace_map_by_column['end'] = pd.read_parquet(\"pace_end.parquet\").rename_axis(\"Iterations\",axis='index').rename_axis(\"Ranks\",axis='columns')\n", + "pace_map_by_column['duration'] = pd.read_parquet(\"pace_duration.parquet\").rename_axis(\"Iterations\",axis='index').rename_axis(\"Ranks\",axis='columns')\n", + "pace_map_by_column['duration_accum'] = pd.read_parquet(\"pace_duration_accum.parquet\").rename_axis(\"Iterations\",axis='index').rename_axis(\"Ranks\",axis='columns')\n", + "pace_map_by_column['delta'] = pd.read_parquet(\"pace_delta.parquet\").rename_axis(\"Iterations\",axis='index').rename_axis(\"Ranks\",axis='columns')\n", + "pace_map_by_column['delta_accum'] = pd.read_parquet(\"pace_delta_accum.parquet\").rename_axis(\"Iterations\",axis='index').rename_axis(\"Ranks\",axis='columns')\n", + "pace_map_by_column['delta_stats'] = pd.read_parquet(\"pace_delta_stats.parquet\").rename_axis(\"Iterations\",axis='index').rename_axis(\"Ranks\",axis='columns')\n" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "f330296f-74c5-4378-b982-d0fb95236972", + "metadata": {}, + "source": [ + "## Statistics for Target Operation\n", + "Overall statistics for the target range across all ranks.\n", + "* Q1(approx) is the 25th percentile of the dataset. Approximated by the min of Q1 for each rank.\n", + "* Median(approx) is the 50th percentile of the dataset. Approximated by the median of the medians for each rank.\n", + "* Q3(approx) is the 75th percentile of the dataset. Approximated by the max of Q3 for each rank." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ba5bde92-c6bd-4493-a829-4ae84d797bb3", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "display(stats_df.T)" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "2a196ce7-937a-4766-b6b4-e616f7c0dc7b", + "metadata": {}, + "source": [ + "## Start of Target Operation\n", + "Wall-clock time of when each rank reached this operation.\n", + "* The progress graph represents each rank as a line, the x-axis prepresents linear progress. \n", + "* The consistency graph transposes the data, showing a line for each iteration. Visually moving upward from the x-axis, this is when the rank reached this iteration." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "062dbf46-4432-4084-bdc3-0ac93086cc52", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "figs=list()\n", + "nsys_pres.display_pace_graph(figs, pace_map_by_column, 'start')" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "5e264faa-63a8-4a14-beda-f51e81198623", + "metadata": { + "tags": [] + }, + "source": [ + "## Delta Between Targets\n", + "The time measured between the target range.\n", + "* A boxplot to understand the distribution of the rank timing per iteration \n", + "* The progress graph represents each rank as a line, the x-axis prepresents linear progress. \n", + "* The consistency graph transposes the data, showing a line for each iteration. Visually moving upward from the x-axis, this is how long each iteration tool. Search here for inconsistencies between ranks to investigate. If the lines are consistent horizontally then each rank completed their work at the same time." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3e075b96-106c-4ea1-bce6-9dc9e2947626", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "\n", + "delta_stats_df = pace_map_by_column['delta_stats']\n", + "\n", + "figs = nsys_pres.display_boxplots_df(None, delta_stats_df.loc[1:],\n", + " title=\"Delta boxplot per iteration (across ranks)\",\n", + " xaxis_title=\"Iteration\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3dc34bc3-5cc6-4c24-af9d-1d0f3e2f974d", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "figs=list()\n", + "nsys_pres.display_pace_graph(figs, pace_map_by_column, 'delta')" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "4f09ae70-fccf-4d54-a604-15fcd4baef4f", + "metadata": {}, + "source": [ + "## Variance in Delta between Targets\n", + "Similar \"Delta between Barriers\", the median time per-iteration is subtracted from the rank's value, typically making the ouliers more obvious if they were subtle above." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6bfd6537-c6c9-4c84-82bb-75f522815730", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "figs=list()\n", + "nsys_pres.display_pace_graph_delta_minus_median(figs, pace_map_by_column)" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "ecd47c77-1166-4257-aaeb-ed0868a2b7e5", + "metadata": { + "tags": [] + }, + "source": [ + "## Delta Accumulated\n", + "This is the accomulated time between the target ranges. This is more relevant if the target range is a barrier, such as an all-reduce, which must wait for all participants. Assuming that the time in the target range is consistent, this may look similar to the graph of starts. If the target range is a barrier, it will provide a more accurate picture of how fast the rank is processing it's data overall. This can assist in identifying issues such inconsistent workload distribution, consistently giving a lighter load to a particular rank, or a hardware difference (distance from storage, NUMA setup, GPU or NIC bindings, throttling, etc), or even other OS and software services interfering." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e5c4dddc-b861-4d1f-9e3c-ef0c0c99e3be", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "figs=list()\n", + "nsys_pres.display_pace_graph(figs, pace_map_by_column, 'delta_accum')" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "d197995f-fdc3-4f16-8ec9-a76d5c471cdb", + "metadata": {}, + "source": [ + "## Duration Accumuled\n", + "Similar to delta accumulation, how long are we spending in the target range so far in the application's progress through these iterations? If this is a barrier-like operation it is how long you are blocking." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b45347d0-5461-4d87-b311-f645c2571c0b", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "figs=list()\n", + "nsys_pres.display_pace_graph(figs, pace_map_by_column, 'duration_accum')" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "83b24ace-41f2-414a-ab56-d3e2c45590c0", + "metadata": {}, + "source": [ + "## Duration\n", + "The duration is not accumulated here, so outliers are more likely to stand out." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4a93e3f3-bddc-47c1-a621-2546fd36e8ef", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "figs=list()\n", + "nsys_pres.display_pace_graph(figs, pace_map_by_column, 'duration')" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "06a8af17-8a7e-4d48-9bd8-0fe1bdd979a5", + "metadata": { + "tags": [] + }, + "source": [ + "## Files\n", + "Ranks are assigned assuming that the file names include the rank and sort well. If they are not sufficiently padded with zeros, the real rank may differ from the assigned ID. This table allows you to identify the filename without the charts above having potentially very long label in the legend or x-axis." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "46978d5e-7fab-4b52-bb55-713d50c8eb40", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "display(files_df)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.10 (default, Nov 14 2022, 12:59:47) \n[GCC 9.4.0]" + }, + "vscode": { + "interpreter": { + "hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1" + } + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_sum/metadata.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_sum/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..245ee4c465ac84ab0c4bbddf57b4f007ef47b7e2 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_sum/metadata.json @@ -0,0 +1,9 @@ +{ + "module_name": "nvtx_sum", + "display_name": "NVTX Range Summary", + "description": [ + "This recipe provides a summary of NVTX Start/End and Push/Pop Ranges,", + " and their execution times." + ], + "type": "stats" +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_sum/nvtx_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_sum/nvtx_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..a693dbc7c59f6bea99a46c1c9422dad666d69815 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_sum/nvtx_sum.py @@ -0,0 +1,134 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd + +from datetime import datetime +from pathlib import Path + +from nsys_recipe import log, data_service +from nsys_recipe.data_service import DataService +from nsys_recipe.lib import helpers, nvtx, recipe, summary +from nsys_recipe.lib.args import Option +from nsys_recipe.log import logger + + +class NvtxSum(recipe.Recipe): + @staticmethod + def _mapper_func(report_path, parsed_args): + service = DataService(report_path) + + table_column_dict = { + "StringIds": None, + "NVTX_EVENTS": [ + "text", + "start", + "end", + "textId", + "globalTid", + "endGlobalTid", + ], + } + + df_dict = service.read_tables(table_column_dict) + if df_dict is None: + return None + + nvtx_df = df_dict["NVTX_EVENTS"] + data_service.filter_by_time_range(nvtx_df, parsed_args.start, parsed_args.end) + + if nvtx_df.empty: + logger.info( + f"{report_path} was successfully processed, but no data was found." + ) + return None + + nvtx_df = data_service.combine_text_fields( + df_dict["NVTX_EVENTS"], df_dict["StringIds"] + ) + + nvtx_df["duration"] = nvtx_df["end"] - nvtx_df["start"] + nvtx_df = nvtx_df[nvtx_df["duration"] > 0] + nvtx_gdf = nvtx_df[["text", "duration"]].groupby("text") + + filename = Path(report_path).stem + stats_df = summary.describe_duration(nvtx_gdf["duration"]) + + return summary.StatsInfo(filename, stats_df) + + @log.time("Mapper") + def mapper_func(self, context): + return context.wait( + context.map( + self._mapper_func, + self._parsed_args.input, + parsed_args=self._parsed_args, + ) + ) + + @log.time("Reducer") + def reducer_func(self, mapper_res): + stats_infos = helpers.filter_none(mapper_res) + stats_infos = sorted(stats_infos, key=lambda x: x.filename) + + filenames, stats_dfs = zip(*stats_infos) + + rank_file_df = pd.DataFrame(filenames, columns=["File"]) + rank_file_df.to_parquet(self.add_output_file("files.parquet"), index=False) + + all_stats_df = summary.aggregate_stats_dfs(stats_dfs) + all_stats_df.to_parquet(self.add_output_file("all_stats.parquet")) + + rank_stats_dfs = [ + df.assign(Rank=rank, File=filenames[rank]) + for rank, df in enumerate(stats_dfs) + ] + rank_stats = pd.concat(rank_stats_dfs) + rank_stats.to_parquet(self.add_output_file("rank_stats.parquet")) + + if self._parsed_args.csv: + all_stats_df.to_csv(self.add_output_file("all_stats.csv")) + rank_stats.to_csv(self.add_output_file("rank_stats.csv")) + + def save_notebook(self): + self.create_notebook("stats.ipynb") + self.add_notebook_helper_file("nsys_pres.py") + + def save_analysis_file(self): + self._analysis_dict.update( + { + "EndTime": str(datetime.now()), + "InputFiles": self._parsed_args.input, + "Outputs": self._output_files, + } + ) + self.create_analysis_file() + + def run(self, context): + super().run(context) + + mapper_res = self.mapper_func(context) + self.reducer_func(mapper_res) + + self.save_notebook() + self.save_analysis_file() + + @classmethod + def get_argument_parser(cls): + parser = super().get_argument_parser() + + parser.add_recipe_argument(Option.INPUT) + parser.add_recipe_argument(Option.OUTPUT) + parser.add_recipe_argument(Option.FORCE_OVERWRITE) + parser.add_recipe_argument(Option.START) + parser.add_recipe_argument(Option.END) + parser.add_recipe_argument(Option.CSV) + + return parser diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_sum/stats.ipynb b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_sum/stats.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..936d0b8ce6f45d48a3d2d3c8b219bfa65f8fd9dd --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/nvtx_sum/stats.ipynb @@ -0,0 +1,202 @@ +{ + "cells": [ + { + "attachments": {}, + "cell_type": "markdown", + "id": "4e3c0c43-b1a5-4ade-be51-bb54043441be", + "metadata": {}, + "source": [ + "# NVTX GPU Projection Summary\n", + "Statistical analysis of NVTX ranges. The resulting duration (end-start) is then analyzed here.\n", + "\n", + "NOTES:\n", + "* NVTX ranges that start or end outside the scope the report being analyzed are discarded\n", + "* NVTX ranges with zero duration after GPU projection are discarded" + ] + }, + { + "cell_type": "markdown", + "id": "5cbed268-3ac1-4b76-8be9-0c2b060f1c3a", + "metadata": {}, + "source": [ + "## Loading" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0425e7d7", + "metadata": { + "jupyter": { + "source_hidden": true + }, + "tags": [] + }, + "outputs": [], + "source": [ + "from IPython.display import display, HTML, Markdown\n", + "display(HTML(\"\"))\n", + "\n", + "from ipywidgets import interact, Dropdown\n", + "import plotly.graph_objects as go\n", + "import plotly.offline as pyo\n", + "\n", + "def is_lab_notebook():\n", + " import re\n", + " import psutil\n", + " return any(re.search('jupyter-lab-script', x) for x in psutil.Process().parent().cmdline())\n", + "\n", + "if is_lab_notebook():\n", + " pyo.init_notebook_mode()\n", + " \n", + "\n", + "#!pip3 install plotly\n", + " \n", + "import pandas as pd\n", + "pd.options.plotting.backend = \"plotly\"\n", + "pd.set_option('display.max_rows', 100)\n", + "pd.set_option('display.width', 1000)\n", + "#pd.set_option('display.max_columns', 500)\n", + "#pd.options.display.width = 0\n", + "\n", + "from ipywidgets import IntProgress\n", + "\n", + "import pickle\n", + "import importlib\n", + "import os\n", + "import glob\n", + "import math\n", + "import re\n", + "from collections import deque\n", + "import numpy as np\n", + "import sqlite3\n", + "import time\n", + "\n", + "import nsys_pres" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "83e4c7bc", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "files_df = pd.read_parquet(\"files.parquet\").rename_axis(\"Rank\",axis='index')\n", + "all_stats_df = pd.read_parquet(\"all_stats.parquet\")\n", + "rank_stats_df = pd.read_parquet(\"rank_stats.parquet\")\n", + "#.rename_axis(\"Iterations\",axis='index').rename_axis(\"Ranks\",axis='columns')" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "d7a3ac1f", + "metadata": {}, + "source": [ + "## Statistics for all ranks\n", + "Overall statistics for the NVTX range across all ranks.\n", + "* Q1(approx) is the 25th percentile of the dataset. Approximated by the min of Q1 for each rank.\n", + "* Median(approx) is the 50th percentile of the dataset. Approximated by the median of the medians for each rank.\n", + "* Q3(approx) is the 75th percentile of the dataset. Approximated by the max of Q3 for each rank." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ba5bde92-c6bd-4493-a829-4ae84d797bb3", + "metadata": { + "jupyter": { + "source_hidden": true + }, + "tags": [] + }, + "outputs": [], + "source": [ + "display(all_stats_df)\n", + "fig1=nsys_pres.display_boxplots_df(None, all_stats_df,xaxis_title=\"Range Names\")\n", + "fig2=nsys_pres.display_graph(None, all_stats_df.index, all_stats_df[['Q1 (approx)', 'Median (approx)', 'Q3 (approx)']], title=\"50% of Distribution\", xaxis_title=\"Range Names\")" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "3fc1d09d-99ae-4dcb-9cbd-dc39e4545b4f", + "metadata": {}, + "source": [ + "## Statistics for all ranks for a particular selected range\n", + "Please select a range name to see:\n", + "* Table of per-rank statistics\n", + " * Q1 is the 25th percentile of the dataset.\n", + " * Median is the 50th percentile of the dataset.\n", + " * Q3 is the 75th percentile of the dataset.\n", + "* Boxplot the the distribution of timing per-rank to support the investigation of outliers\n", + "* Graph of Q1, Median, & Q3 to see how close together the middle (50%) of the data is without outlier." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7758cd1e-b5a9-4a10-867b-18d5719cbd90", + "metadata": { + "jupyter": { + "source_hidden": true + }, + "tags": [] + }, + "outputs": [], + "source": [ + "rank_stats_gdf = rank_stats_df.groupby(rank_stats_df.index)\n", + "nsys_pres.display_stats_per_rank_groups_combobox(rank_stats_gdf)" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "910620c7", + "metadata": {}, + "source": [ + "## Files\n", + "Ranks are assigned assuming that the file names include the rank and sort well. If they are not sufficiently padded with zeros, the real rank may differ from the assigned ID. This table allows you to identify the filename without the charts above having potentially very long label in the legend or x-axis." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c3328573", + "metadata": {}, + "outputs": [], + "source": [ + "display(files_df)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.10 (default, Nov 14 2022, 12:59:47) \n[GCC 9.4.0]" + }, + "vscode": { + "interpreter": { + "hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1" + } + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/osrt_sum/metadata.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/osrt_sum/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..2f624887649d2084402a6f61848b5782bb733ac7 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/osrt_sum/metadata.json @@ -0,0 +1,6 @@ +{ + "module_name": "osrt_sum", + "display_name": "OS Runtime Summary", + "description": "This recipe provides a summary of C library functions and their execution times.", + "type": "stats" +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/osrt_sum/osrt_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/osrt_sum/osrt_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..687d95d52d6ed46ea5a22b03b20aa506cf64c649 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/osrt_sum/osrt_sum.py @@ -0,0 +1,149 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd + +from collections import OrderedDict +from datetime import datetime +from pathlib import Path + +from nsys_recipe import log +from nsys_recipe.data_service import StatsService +from nsys_recipe.lib import helpers, recipe +from nsys_recipe.lib.args import Option +from nsys_recipe.log import logger + + +class OsrtSum(recipe.Recipe): + @staticmethod + def _mapper_func(report_path, parsed_args): + service = StatsService(report_path) + + df = service.read_sql_report("osrt_sum", "OsrtSum", parsed_args) + if df is None: + return None + + if df.empty: + logger.info( + f"{report_path} was successfully processed, but no data was found." + ) + return None + + df["File"] = Path(report_path).stem + return df + + def aggregate_stats(self, df): + grouped = df.groupby(df.index.name) + + d = OrderedDict() + total_time = grouped["Total Time"].sum() + d["Time"] = total_time / total_time.sum() * 100 + d["Total Time"] = total_time + d["Num Calls"] = grouped["Num Calls"].sum() + d["Avg"] = d["Total Time"] / d["Num Calls"] + d["Q1"] = grouped["Q1"].min() + d["Med"] = grouped["Med"].median() + d["Q3"] = grouped["Q3"].max() + d["Min"] = grouped["Min"].min() + d["Max"] = grouped["Max"].max() + d["StdDev"] = grouped.apply(lambda x: helpers.stddev(x, d, "Num Calls")) + min_value = grouped["Min"].min() + d["Min File"] = grouped.apply( + lambda x: ", ".join(x.loc[x["Min"] == min_value.loc[x.name], "File"]) + ) + max_value = grouped["Max"].max() + d["Max File"] = grouped.apply( + lambda x: ", ".join(x.loc[x["Max"] == max_value.loc[x.name], "File"]) + ) + + aggregated_df = pd.concat(d.values(), axis=1, keys=d.keys()).round(1) + return aggregated_df.sort_values(by=["Total Time"], ascending=False) + + @log.time("Mapper") + def mapper_func(self, context): + return context.wait( + context.map( + self._mapper_func, + self._parsed_args.input, + parsed_args=self._parsed_args, + ) + ) + + @log.time("Reducer") + def reducer_func(self, dfs): + dfs = helpers.filter_none(dfs) + df = pd.concat(dfs) + + # Remove any tags or hidden columns that are for internal use. + df.columns = df.columns.str.replace("(:).*", "", regex=True) + df.columns = df.columns.str.lstrip("_") + + df = df.set_index("Name") + df = df[ + [ + "Time", + "Total Time", + "Num Calls", + "Avg", + "Q1", + "Med", + "Q3", + "Min", + "Max", + "StdDev", + "File", + ] + ] + + per_rank_df = df.sort_values(by=["File", "Total Time"], ascending=[True, False]) + all_ranks_df = self.aggregate_stats(df) + + per_rank_df.to_parquet(self.add_output_file("rank_stats.parquet")) + all_ranks_df.to_parquet(self.add_output_file("all_stats.parquet")) + + if self._parsed_args.csv: + per_rank_df.to_csv(self.add_output_file("rank_stats.csv")) + all_ranks_df.to_csv(self.add_output_file("all_stats.csv")) + + def save_notebook(self): + self.create_notebook("stats.ipynb") + self.add_notebook_helper_file("nsys_display.py") + + def save_analysis_file(self): + self._analysis_dict.update( + { + "EndTime": str(datetime.now()), + "InputFiles": self._parsed_args.input, + "Outputs": self._output_files, + } + ) + self.create_analysis_file() + + def run(self, context): + super().run(context) + + mapper_res = self.mapper_func(context) + self.reducer_func(mapper_res) + + self.save_notebook() + self.save_analysis_file() + + @classmethod + def get_argument_parser(cls): + parser = super().get_argument_parser() + + parser.add_recipe_argument(Option.INPUT) + parser.add_recipe_argument(Option.OUTPUT) + parser.add_recipe_argument(Option.FORCE_OVERWRITE) + parser.add_recipe_argument(Option.START) + parser.add_recipe_argument(Option.END) + parser.add_recipe_argument(Option.CSV) + + return parser diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/osrt_sum/stats.ipynb b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/osrt_sum/stats.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..e64ec0d7deac64ae5733ef95d6ab48dc8bfd504f --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/osrt_sum/stats.ipynb @@ -0,0 +1,137 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# OS Runtime Summary" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This notebook provides a summary of C library functions and their execution times." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import plotly.offline as pyo\n", + "\n", + "from IPython.display import display, HTML, Markdown\n", + "\n", + "import nsys_display\n", + "\n", + "display(HTML(\"\"))\n", + "pd.set_option('display.max_colwidth', None)\n", + "pd.set_option('display.max_rows', None)\n", + "pyo.init_notebook_mode()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Overall statistics" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The table shows the statistics across all ranks. Note that:\n", + "* All time values are in nanoseconds.\n", + "* Q1 is the 25th percentile of the data set. Approximated by the min of Q1 for each rank.\n", + "* Median is the 50th percentile of the data set. Approximated by the median of the medians for each rank.\n", + "* Q3 is the 75th percentile of the data set. Approximated by the max of Q3 for each rank.\n", + "* The 'Min File' column displays the names of the ranks that contain the minimum value.\n", + "* The 'Max File' column displays the names of the ranks that contain the maximum value.\n", + "* The 'Time' column is calculated using a summation of the \"Total Time\" column. It represents that function's percent of the execution time of the functions listed and not a percentage of the application wall or CPU execution time." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ranks_df = pd.read_parquet('all_stats.parquet')\n", + "display(ranks_df)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The diagram shows statistical box plots and line graphs for each function across all ranks.\n", + "\n", + "To toggle the line traces on and off on the graph, click on their corresponding legend entries. When working with large data sets, consider using the .head() function to limit the number of displayed elements or zoom in on the diagram for better visibility." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "nsys_display.display_box(ranks_df, xaxis_title='Name', yaxis_title='Value (ns)')\n", + "nsys_display.display_stats_scatter(ranks_df, xaxis_title='Name', yaxis_title='Value (ns)')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Per-rank statistics" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The table and graphs show statistics of the function selected from the drop-down menu, for each rank. Note that:\n", + "* All time values are in nanoseconds.\n", + "* 'Q1', 'Med', and 'Q3' are the 25th, 50th, and 75th percentiles of the data set, respectively.\n", + "* The 'Time' column is calculated using a summation of the \"Total Time\" column. It represents that function's percent of the execution time of the functions listed and not a percentage of the application wall or CPU execution time.\n", + "\n", + "To toggle the line traces on and off on the graph, click on their corresponding legend entries. When working with large data sets, consider using the .head() function to limit the number of displayed elements or zoom in on the diagram for better visibility." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "per_rank_df = pd.read_parquet('rank_stats.parquet')\n", + "nsys_display.display_stats_per_operation(per_rank_df, xaxis_title='File', yaxis_title='Value (ns)')" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "name": "python", + "version": "3.10.5" + }, + "orig_nbformat": 4, + "vscode": { + "interpreter": { + "hash": "7e1998ff7f8aa20ada591c520b972326324e5ea05489af9e422744c7c09f6dad" + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/ucx_gpu_time_util_map/heatmap.ipynb b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/ucx_gpu_time_util_map/heatmap.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..0eee099de4b53e963b0d2de8695a38eb2dfea909 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/ucx_gpu_time_util_map/heatmap.ipynb @@ -0,0 +1,94 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# UCX GPU Time Utilization Heatmap" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import plotly.offline as pyo\n", + "\n", + "from IPython.display import display, HTML, Markdown\n", + "\n", + "import nsys_display\n", + "\n", + "display(HTML(''))\n", + "pd.set_option('display.max_colwidth', None)\n", + "pd.set_option('display.max_rows', None)\n", + "pyo.init_notebook_mode()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This line graph displays the summary of GPU, UCX, and their overlap utilizations:\n", + "* x axis represents the rank duration, scaling from 0 to the maximum duration across all ranks.\n", + "* y axis represents the mean utilization value across all ranks." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "df = pd.read_parquet('analysis.parquet')\n", + "# Create unique name.\n", + "df['Name'] = df['File'] + '/' + df['PID'].astype(str)\n", + "# Convert ns to s.\n", + "df['Duration'] = df['Duration'] * 1e-9\n", + "\n", + "types = ['Kernel', 'UCX', 'Overlap']\n", + "nsys_display.display_summary_graph(\n", + " df,\n", + " types,\n", + " xaxis_title=\"Duration (s)\",\n", + " yaxis_title=\"Value (%)\",\n", + " title=\"Utilization Summary (bins=REPLACE_BIN)\"\n", + ")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This line graph displays the GPU, UCX, and their overlap utilizations:\n", + "* x axis represents the rank duration, scaling from 0 to the maximum duration across all ranks.\n", + "* y axis represents the set of File/PID for which utilization data was collected." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "nsys_display.display_heatmaps(\n", + " df,\n", + " types,\n", + " xaxis_title=\"Duration (s)\",\n", + " yaxis_title=\"File/PID\",\n", + " zaxis_title=\"Value (%)\",\n", + " title=\"Utilization Summary (bins=REPLACE_BIN)\"\n", + ")" + ] + } + ], + "metadata": { + "language_info": { + "name": "python" + }, + "orig_nbformat": 4 + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/ucx_gpu_time_util_map/metadata.json b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/ucx_gpu_time_util_map/metadata.json new file mode 100644 index 0000000000000000000000000000000000000000..6f4a38ac983965cd3c7149c93a435ad69436d6c1 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/ucx_gpu_time_util_map/metadata.json @@ -0,0 +1,13 @@ +{ + "module_name": "ucx_gpu_time_util_map", + "display_name": "UCX and GPU Time Utilization Heatmap", + "description": [ + "This recipe calculates the percentage of GPU and UCX utilization and the overlap", + "between the two. Note that the utilization refers to 'time' utilization and not", + "the 'resource' utilization. All events are consolidated by taking the minimum", + "start time and maximum end time for each group of overlapping ranges when", + "multiple events run concurrently. The overlap percentage is calculated based on", + "the bin size, implying that the value will be less than 100% unless UCX and", + "kernel events overlap continuously throughout the entire bin duration." + ] +} diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/ucx_gpu_time_util_map/ucx_gpu_time_util_map.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/ucx_gpu_time_util_map/ucx_gpu_time_util_map.py new file mode 100644 index 0000000000000000000000000000000000000000..612bdd56098d9e08dc1047224546f2aa7a74098c --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/recipes/ucx_gpu_time_util_map/ucx_gpu_time_util_map.py @@ -0,0 +1,190 @@ +# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import pandas as pd + +from pathlib import Path +from datetime import datetime + +from nsys_recipe import log, data_service +from nsys_recipe.data_service import DataService +from nsys_recipe.lib import helpers, recipe, heatmap +from nsys_recipe.lib.args import Option +from nsys_recipe.lib.collective_loader import ProfileInfo +from nsys_recipe.log import logger + + +class UcxGpuTimeUtilMap(recipe.Recipe): + @staticmethod + def _mapper_func(report_path, bin_size, min_session, parsed_args): + service = DataService(report_path) + + table_column_dict = { + "ANALYSIS_DETAILS": ["duration"], + "TARGET_INFO_SESSION_START_TIME": ["utcEpochNs"], + "CUPTI_ACTIVITY_KIND_RUNTIME": [ + "correlationId", + "globalTid", + "start", + "end", + ], + "CUPTI_ACTIVITY_KIND_KERNEL": [ + "correlationId", + "globalPid", + "start", + "end", + ], + "UCP_SUBMIT_EVENTS": ["globalTid", "start", "end"], + "UCP_PROGRESS_EVENTS": ["globalTid", "start", "end"], + "UCP_EVENTS": ["globalTid", "start", "end"], + } + + df_dict = service.read_tables(table_column_dict) + if df_dict is None: + return None + + ucp_submit_df = df_dict["UCP_SUBMIT_EVENTS"] + ucp_progress_df = df_dict["UCP_PROGRESS_EVENTS"] + ucp_events_df = df_dict["UCP_EVENTS"] + + ucx_dfs = [ucp_submit_df, ucp_progress_df, ucp_events_df] + kernel_df = df_dict["CUPTI_ACTIVITY_KIND_KERNEL"] + dfs = [*ucx_dfs, kernel_df] + + session_offset, profile_duration = data_service.compute_session_duration( + df_dict["ANALYSIS_DETAILS"], + df_dict["TARGET_INFO_SESSION_START_TIME"], + min_session, + ) + + data_service.filter_by_time_range(dfs, parsed_args.start, parsed_args.end) + data_service.apply_time_offset(dfs, session_offset) + + ucx_df = pd.concat(ucx_dfs).sort_values("start").reset_index() + if ucx_df.empty or kernel_df.empty: + logger.info( + f"{report_path} was successfully processed, but no data was found." + ) + return None + + kernel_df["pid"] = data_service.extract_pid(kernel_df["globalPid"]) + ucx_df["pid"] = data_service.extract_pid(ucx_df["globalTid"]) + + kernel_grouped = kernel_df.groupby("pid") + ucx_grouped = ucx_df.groupby("pid") + + unique_pids = set(kernel_grouped.groups.keys()) | set(ucx_grouped.groups.keys()) + results = [] + + for pid in unique_pids: + group_dfs = {} + bin_pcts = {} + + # Initialize the bins with zero values. + zero_bins = heatmap.get_zero_bin_pcts( + bin_size, parsed_args.bins, profile_duration, session_offset + ) + bin_pcts = {key: zero_bins for key in ("Kernel", "UCX", "Overlap")} + + groups_info = [("Kernel", kernel_grouped), ("UCX", ucx_grouped)] + for name, grouped in groups_info: + if pid in grouped.groups: + group_dfs[name] = heatmap.consolidate_ranges(grouped.get_group(pid)) + + # Calculate the overlap only if 'Kernel' and 'UCX' both exist for + # the given PID. + if "Kernel" in group_dfs and "UCX" in group_dfs: + overlap_range_df = heatmap.calculate_overlapping_ranges( + group_dfs["Kernel"], group_dfs["UCX"] + ) + group_dfs["Overlap"] = overlap_range_df + + # Calculate bin percentages for each dataframe. + for name, group_df in group_dfs.items(): + bin_pcts[name] = heatmap.calculate_bin_pcts( + group_df, + bin_size, + parsed_args.bins, + profile_duration, + session_offset, + ) + + data = { + "Duration": heatmap.generate_bin_list(parsed_args.bins, bin_size), + **bin_pcts, + "PID": pid, + } + results.append(pd.DataFrame(data)) + + pct_df = pd.concat(results, ignore_index=True) + pct_df["File"] = Path(report_path).stem + + return pct_df + + @log.time("Mapper") + def mapper_func(self, context, filtered_dir, bin_size, min_session): + return context.wait( + context.map( + self._mapper_func, + filtered_dir, + bin_size=bin_size, + min_session=min_session, + parsed_args=self._parsed_args, + ) + ) + + @log.time("Reducer") + def reducer_func(self, dfs): + dfs = helpers.filter_none(dfs) + df = pd.concat(dfs) + + df.to_parquet(self.add_output_file("analysis.parquet")) + + def save_notebook(self): + self.create_notebook( + "heatmap.ipynb", replace_dict={"REPLACE_BIN": self._parsed_args.bins} + ) + self.add_notebook_helper_file("nsys_display.py") + + def save_analysis_file(self): + self._analysis_dict.update( + { + "EndTime": str(datetime.now()), + "InputFiles": self._parsed_args.input, + "Outputs": self._output_files, + } + ) + self.create_analysis_file() + + def run(self, context): + super().run(context) + + max_duration, min_session, filtered_dir = ProfileInfo.get_profile_info( + context, self._parsed_args.input + ) + bin_size = heatmap.get_bin_size(self._parsed_args.bins, max_duration) + + mapper_res = self.mapper_func(context, filtered_dir, bin_size, min_session) + self.reducer_func(mapper_res) + + self.save_notebook() + self.save_analysis_file() + + @classmethod + def get_argument_parser(cls): + parser = super().get_argument_parser() + + parser.add_recipe_argument(Option.INPUT) + parser.add_recipe_argument(Option.OUTPUT) + parser.add_recipe_argument(Option.FORCE_OVERWRITE) + parser.add_recipe_argument(Option.START) + parser.add_recipe_argument(Option.END) + parser.add_recipe_argument(Option.BINS) + return parser diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/requirements/common.txt b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/requirements/common.txt new file mode 100644 index 0000000000000000000000000000000000000000..e54baebbe0a86e329752f1afedfa29e1bedeebb4 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/requirements/common.txt @@ -0,0 +1,4 @@ +numpy +pandas +psutil +pyarrow diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/requirements/dask.txt b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/requirements/dask.txt new file mode 100644 index 0000000000000000000000000000000000000000..5f244151320d1e7210ff562597752f69fb77d4ba --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/requirements/dask.txt @@ -0,0 +1,2 @@ +dask +distributed diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/requirements/jupyter.txt b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/requirements/jupyter.txt new file mode 100644 index 0000000000000000000000000000000000000000..32403ea146257215d644b88415d0e24fd88cb423 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/requirements/jupyter.txt @@ -0,0 +1,3 @@ +ipywidgets +jupyterlab +plotly diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/third_party/sqlite3/__init__.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/third_party/sqlite3/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a906c83dbea2ff9cc5c8fb5023d662b533d8f90e --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/third_party/sqlite3/__init__.py @@ -0,0 +1,71 @@ +# pysqlite2/__init__.py: the pysqlite2 package. +# +# Copyright (C) 2005 Gerhard Häring +# +# This file is part of pysqlite. +# +# This software is provided 'as-is', without any express or implied +# warranty. In no event will the authors be held liable for any damages +# arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software +# in a product, an acknowledgment in the product documentation would be +# appreciated but is not required. +# 2. Altered source versions must be plainly marked as such, and must not be +# misrepresented as being the original software. +# 3. This notice may not be removed or altered from any source distribution. + +""" +The sqlite3 extension module provides a DB-API 2.0 (PEP 249) compliant +interface to the SQLite library, and requires SQLite 3.7.15 or newer. + +To use the module, start by creating a database Connection object: + + import sqlite3 + cx = sqlite3.connect("test.db") # test.db will be created or opened + +The special path name ":memory:" can be provided to connect to a transient +in-memory database: + + cx = sqlite3.connect(":memory:") # connect to a database in RAM + +Once a connection has been established, create a Cursor object and call +its execute() method to perform SQL queries: + + cu = cx.cursor() + + # create a table + cu.execute("create table lang(name, first_appeared)") + + # insert values into a table + cu.execute("insert into lang values (?, ?)", ("C", 1972)) + + # execute a query and iterate over the result + for row in cu.execute("select * from lang"): + print(row) + + cx.close() + +The sqlite3 module is written by Gerhard Häring . +""" + +from sqlite3.dbapi2 import * + + +# bpo-42264: OptimizedUnicode was deprecated in Python 3.10. It's scheduled +# for removal in Python 3.12. +def __getattr__(name): + if name == "OptimizedUnicode": + import warnings + msg = (""" + OptimizedUnicode is deprecated and will be removed in Python 3.12. + Since Python 3.3 it has simply been an alias for 'str'. + """) + warnings.warn(msg, DeprecationWarning, stacklevel=2) + return str + raise AttributeError(f"module 'sqlite3' has no attribute '{name}'") diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/third_party/sqlite3/dbapi2.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/third_party/sqlite3/dbapi2.py new file mode 100644 index 0000000000000000000000000000000000000000..9bf7660adbc7dfd39f9363f0fa589930e81210c6 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/third_party/sqlite3/dbapi2.py @@ -0,0 +1,103 @@ +# pysqlite2/dbapi2.py: the DB-API 2.0 interface +# +# Copyright (C) 2004-2005 Gerhard Häring +# +# This file is part of pysqlite. +# +# This software is provided 'as-is', without any express or implied +# warranty. In no event will the authors be held liable for any damages +# arising from the use of this software. +# +# Permission is granted to anyone to use this software for any purpose, +# including commercial applications, and to alter it and redistribute it +# freely, subject to the following restrictions: +# +# 1. The origin of this software must not be misrepresented; you must not +# claim that you wrote the original software. If you use this software +# in a product, an acknowledgment in the product documentation would be +# appreciated but is not required. +# 2. Altered source versions must be plainly marked as such, and must not be +# misrepresented as being the original software. +# 3. This notice may not be removed or altered from any source distribution. + +import datetime +import time +import collections.abc + +from _sqlite3 import * + +paramstyle = "qmark" + +threadsafety = 1 + +apilevel = "2.0" + +Date = datetime.date + +Time = datetime.time + +Timestamp = datetime.datetime + +def DateFromTicks(ticks): + return Date(*time.localtime(ticks)[:3]) + +def TimeFromTicks(ticks): + return Time(*time.localtime(ticks)[3:6]) + +def TimestampFromTicks(ticks): + return Timestamp(*time.localtime(ticks)[:6]) + +version_info = tuple([int(x) for x in version.split(".")]) +sqlite_version_info = tuple([int(x) for x in sqlite_version.split(".")]) + +Binary = memoryview +collections.abc.Sequence.register(Row) + +def register_adapters_and_converters(): + def adapt_date(val): + return val.isoformat() + + def adapt_datetime(val): + return val.isoformat(" ") + + def convert_date(val): + return datetime.date(*map(int, val.split(b"-"))) + + def convert_timestamp(val): + datepart, timepart = val.split(b" ") + year, month, day = map(int, datepart.split(b"-")) + timepart_full = timepart.split(b".") + hours, minutes, seconds = map(int, timepart_full[0].split(b":")) + if len(timepart_full) == 2: + microseconds = int('{:0<6.6}'.format(timepart_full[1].decode())) + else: + microseconds = 0 + + val = datetime.datetime(year, month, day, hours, minutes, seconds, microseconds) + return val + + + register_adapter(datetime.date, adapt_date) + register_adapter(datetime.datetime, adapt_datetime) + register_converter("date", convert_date) + register_converter("timestamp", convert_timestamp) + +register_adapters_and_converters() + +# bpo-24464: enable_shared_cache was deprecated in Python 3.10. It's +# scheduled for removal in Python 3.12. +def enable_shared_cache(enable): + from _sqlite3 import enable_shared_cache as _old_enable_shared_cache + import warnings + msg = ( + "enable_shared_cache is deprecated and will be removed in Python 3.12. " + "Shared cache is strongly discouraged by the SQLite 3 documentation. " + "If shared cache must be used, open the database in URI mode using" + "the cache=shared query parameter." + ) + warnings.warn(msg, DeprecationWarning, stacklevel=2) + return _old_enable_shared_cache(enable) + +# Clean up namespace + +del(register_adapters_and_converters) diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/third_party/sqlite3/dump.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/third_party/sqlite3/dump.py new file mode 100644 index 0000000000000000000000000000000000000000..6e0e3a8a9ac9e94a10a5c34ff9b367341bb1e82a --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/python/packages/nsys_recipe/third_party/sqlite3/dump.py @@ -0,0 +1,82 @@ +# Mimic the sqlite3 console shell's .dump command +# Author: Paul Kippes + +# Every identifier in sql is quoted based on a comment in sqlite +# documentation "SQLite adds new keywords from time to time when it +# takes on new features. So to prevent your code from being broken by +# future enhancements, you should normally quote any identifier that +# is an English language word, even if you do not have to." + +def _iterdump(connection): + """ + Returns an iterator to the dump of the database in an SQL text format. + + Used to produce an SQL dump of the database. Useful to save an in-memory + database for later restoration. This function should not be called + directly but instead called from the Connection method, iterdump(). + """ + + cu = connection.cursor() + yield('BEGIN TRANSACTION;') + + # sqlite_master table contains the SQL CREATE statements for the database. + q = """ + SELECT "name", "type", "sql" + FROM "sqlite_master" + WHERE "sql" NOT NULL AND + "type" == 'table' + ORDER BY "name" + """ + schema_res = cu.execute(q) + sqlite_sequence = [] + for table_name, type, sql in schema_res.fetchall(): + if table_name == 'sqlite_sequence': + rows = cu.execute('SELECT * FROM "sqlite_sequence";').fetchall() + sqlite_sequence = ['DELETE FROM "sqlite_sequence"'] + sqlite_sequence += [ + f'INSERT INTO "sqlite_sequence" VALUES(\'{row[0]}\',{row[1]})' + for row in rows + ] + continue + elif table_name == 'sqlite_stat1': + yield('ANALYZE "sqlite_master";') + elif table_name.startswith('sqlite_'): + continue + # NOTE: Virtual table support not implemented + #elif sql.startswith('CREATE VIRTUAL TABLE'): + # qtable = table_name.replace("'", "''") + # yield("INSERT INTO sqlite_master(type,name,tbl_name,rootpage,sql)"\ + # "VALUES('table','{0}','{0}',0,'{1}');".format( + # qtable, + # sql.replace("''"))) + else: + yield('{0};'.format(sql)) + + # Build the insert statement for each row of the current table + table_name_ident = table_name.replace('"', '""') + res = cu.execute('PRAGMA table_info("{0}")'.format(table_name_ident)) + column_names = [str(table_info[1]) for table_info in res.fetchall()] + q = """SELECT 'INSERT INTO "{0}" VALUES({1})' FROM "{0}";""".format( + table_name_ident, + ",".join("""'||quote("{0}")||'""".format(col.replace('"', '""')) for col in column_names)) + query_res = cu.execute(q) + for row in query_res: + yield("{0};".format(row[0])) + + # Now when the type is 'index', 'trigger', or 'view' + q = """ + SELECT "name", "type", "sql" + FROM "sqlite_master" + WHERE "sql" NOT NULL AND + "type" IN ('index', 'trigger', 'view') + """ + schema_res = cu.execute(q) + for name, type, sql in schema_res.fetchall(): + yield('{0};'.format(sql)) + + # gh-79009: Yield statements concerning the sqlite_sequence table at the + # end of the transaction. + for row in sqlite_sequence: + yield('{0};'.format(row)) + + yield('COMMIT;') diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/README.txt b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..e7e13b4760961cce3fde414ab004d015777ece4c --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/README.txt @@ -0,0 +1,56 @@ + +This Python code used by the Nsight Systems applications. This includes both +the "nsys" CLI application and the "nsys-ui" desktop application. + + +The "/reports" directory contains Python code used by the +stats and reporting feature. + +The "/rules" directory contains Python code used by the +expert system feature. + + +These Python files are designed to be used as plug-in modules for the Nsight +Systems applications. THESE FILES ARE NOT DESIGNED TO BE RUN AS STANDALONE +SCRIPTS. Although it is possible to run some of these Python files directly, +this use-case is for building and testing, and not supported for general +customer use. + + + +NSYS-UI DESKTOP APPLICATION +--------------------------- + +To utilize these reports and rules in the "nsys-ui" desktop application, +please utilize the drop-down menu in the lower-right section of the +application window to select either stats or expert systems. Once that +pane is visible, you an select a specific report or rule from the list +on the left side of the pane. The results will be displayed on the right +side of the pane. + + + +NSYS COMMAND LINE APPLICATION +----------------------------- + +To run a stats report, please use the command: + + $ nsys stats --report + +To run an expert systems rule, please use the command: + + $ nsys analyze --rule + +The or is the name of the Python script without +the ".py" extension. + +To get a full list of the available reports & rules, the following commands +can be used: + + $ nsys stats --help-reports + $ nsys analyze --help-rules + +For more detailed information about a specific report, use the commands: + + $ nsys stats --help-reports + $ nsys analyze --help-rules diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/_sql.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/_sql.py new file mode 100644 index 0000000000000000000000000000000000000000..b98712fc328a0825ad77df1a36986c64e3e6844e --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/_sql.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +# THIS SCRIPT FOR DEBUGGING AND TESTING ONLY +# THIS SCRIPT FOR DEBUGGING AND TESTING ONLY +# THIS SCRIPT FOR DEBUGGING AND TESTING ONLY +# THIS SCRIPT FOR DEBUGGING AND TESTING ONLY + +import nsysstats + +class TESTReportSQLStatement(nsysstats.StatsReport): + + DEFAULT_QUERY='SELECT 1' + + display_name = 'DEBUG: SQL Statement' + usage = f"""{{SCRIPT}}[:sql=] -- Run SQL Statement + + sql : Arbitrary SQLite statement + + Output defined by . + + This report accepts and executes an arbitrary SQL statement. + It is mostly for debugging/testing. If no is + given, the statement "{DEFAULT_QUERY}" is executed. +""" + + _arg_opts = [ + [['sql'], {'type': str, 'help': 'SQL stmt', 'default': DEFAULT_QUERY}], + ] + + def setup(self): + err = super().setup() + if err != None: + return err + + self.query = self.parsed_args.sql + +if __name__ == "__main__": + TESTReportSQLStatement.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/_sqlfile.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/_sqlfile.py new file mode 100644 index 0000000000000000000000000000000000000000..88730dc057e010175b0ddf67ae972c8966356f5b --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/_sqlfile.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +# THIS SCRIPT FOR DEBUGGING AND TESTING ONLY +# THIS SCRIPT FOR DEBUGGING AND TESTING ONLY +# THIS SCRIPT FOR DEBUGGING AND TESTING ONLY +# THIS SCRIPT FOR DEBUGGING AND TESTING ONLY + +import nsysstats + +class TESTReportSQLFile(nsysstats.StatsReport): + + display_name = 'DEBUG: SQL File' + usage = f"""{{SCRIPT}}:file= -- Run SQL statement from file + + file : File with SQL statement(s) + + Output defined by . + + This report executes an arbitrary SQL statement found in the given filename. + It is mostly for debugging/testing. If no file is given, or if the file + does not exist or cannot be opened, an error is returned. The file should + contain only a single SQL statement. +""" + + _arg_opts = [ + [['file'], {'type': str, 'help': 'SQL file'}], + ] + + query = "SELECT 1 AS 'ONE'" + + def setup(self): + err = super().setup() + if err != None: + return err + + if self.parsed_args.file == None: + return 'No filename given' + + filename = self.parsed_args.file + try: + with open(filename, "r") as file: + self.query = file.read() + except EnvironmentError: + return f"File {filename} could not be opened" + +if __name__ == "__main__": + TESTReportSQLFile.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/_tbl.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/_tbl.py new file mode 100644 index 0000000000000000000000000000000000000000..e5577de10c926ba2598efddae6f98a28a292e67a --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/_tbl.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +# THIS SCRIPT FOR DEBUGGING AND TESTING ONLY +# THIS SCRIPT FOR DEBUGGING AND TESTING ONLY +# THIS SCRIPT FOR DEBUGGING AND TESTING ONLY +# THIS SCRIPT FOR DEBUGGING AND TESTING ONLY + +import nsysstats + +class TESTReportSQLTable(nsysstats.StatsReport): + + DEFAULT_TABLE = 'TARGET_INFO_GPU' + + display_name = 'DEBUG: SQL Table' + usage = f"""{{SCRIPT}}[:table=] -- Return Table + + table : Name of an SQLite table + + Output defined by . + + This report accepts a database table (or view) name and + executes the statement "SELECT * FROM ". It is + mostly for debugging/testing. If no is given, + the table {DEFAULT_TABLE} will be used. +""" + + query_stub = "SELECT * FROM {TABLE}" + + _arg_opts = [ + [['table'], {'type': str, 'help': 'SQL table', 'default': DEFAULT_TABLE}], + ] + + def setup(self): + err = super().setup() + if err != None: + return err + + table_name = self.parsed_args.table + if not self.table_exists(table_name): + return f"{{DBFILE}} does not contain the table {table_name}" + self.query = self.query_stub.format(TABLE=table_name) + +if __name__ == "__main__": + TESTReportSQLTable.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/_values.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/_values.py new file mode 100644 index 0000000000000000000000000000000000000000..edaaf4461d710515d78122ae4d46294ab6bc15b4 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/_values.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +# THIS SCRIPT FOR DEBUGGING AND TESTING ONLY +# THIS SCRIPT FOR DEBUGGING AND TESTING ONLY +# THIS SCRIPT FOR DEBUGGING AND TESTING ONLY +# THIS SCRIPT FOR DEBUGGING AND TESTING ONLY + +import nsysstats + +class TESTReportSQLValues(nsysstats.StatsReport): + + DEFAULT_VALUE = [1] + + display_name = 'DEBUG: SQL Values' + usage = f"""{{SCRIPT}}[:[:]...] -- Return Provided Values + + : One or more values + + Output: + Value : Values passed in as + + This report accepts one or more values, and returns those + values as a single column data set. It is mostly for + debugging/testing. If no is given, the single value + "{DEFAULT_VALUE[0]}" will be used. The SQLite file is not + used or accessed, other than for verification. +""" + + query_stub = """ + WITH VAL_CTE (VALUE) AS ( VALUES {VALUES} ) + SELECT VALUE AS VALUE FROM VAL_CTE +""" + + _arg_opts = [ + [['+vals'], {'type': str, 'help': 'SQL values', 'nargs': '*'}], + ] + + def setup(self): + err = super().setup() + if err != None: + return err + + values = [] + if len(self.parsed_args.vals) == 0: + values = self.DEFAULT_VALUE + else: + values = self.parsed_args.vals + + self.query = self.query_stub.format(VALUES = ",".join(["('{v}')".format(v=val) for val in values])) + +if __name__ == "__main__": + TESTReportSQLValues.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/apigpusum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/apigpusum.py new file mode 100644 index 0000000000000000000000000000000000000000..5112aae05f3821cbe709eb86c6cd734da4fd7eee --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/apigpusum.py @@ -0,0 +1,153 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class CUDAAPIandGPUSummary(nsysstats.StatsReport): + + display_name = 'DEPRECATED - Use cuda_api_gpu_sum instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query_stub = """ +WITH + apigpu AS ( + {SUB_QUERY} + ), + summary AS ( + SELECT + name AS name, + category AS category, + sum(duration) AS total, + count(*) AS num, + avg(duration) AS avg, + median(duration) AS med, + min(duration) AS min, + max(duration) AS max, + stdev(duration) AS stddev + FROM + apigpu + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Instances", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + summary.category AS "Category", + summary.name AS "Operation" +FROM + summary +ORDER BY 2 DESC +; +""" + + query_runtime = """ + SELECT + CASE substr(str.value, -6, 2) + WHEN '_v' THEN substr(str.value, 1, length(str.value)-6) + ELSE str.value + END AS name, + rt.end - rt.start AS duration, + 'CUDA_API' AS category + FROM + CUPTI_ACTIVITY_KIND_RUNTIME AS rt + LEFT OUTER JOIN + StringIds AS str + ON str.id == rt.nameId +""" + + query_kernel = """ + SELECT + str.value AS name, + kern.end - kern.start AS duration, + 'CUDA_KERNEL' AS category + FROM + CUPTI_ACTIVITY_KIND_KERNEL AS kern + LEFT OUTER JOIN + StringIds AS str + ON str.id == coalesce(kern.{NAME_COL_NAME}, kern.demangledName) +""" + + query_memcpy = """ + SELECT + '[CUDA memcpy ' || mos.label || ']' AS name, + mcpy.end - mcpy.start AS duration, + 'MEMORY_OPER' AS category + FROM + CUPTI_ACTIVITY_KIND_MEMCPY as mcpy + JOIN + ENUM_CUDA_MEMCPY_OPER AS mos + ON mos.id == mcpy.copyKind +""" + + query_memset = """ + SELECT + '[CUDA memset]' AS name, + end - start AS duration, + 'MEMORY_OPER' AS category + FROM + CUPTI_ACTIVITY_KIND_MEMSET +""" + + query_union = """ + UNION ALL +""" + + _arg_opts = [ + [['base'], {'action': 'store_true'}], + [['mangled'], {'action': 'store_true'}], + ] + + def setup(self): + err = super().setup() + if err != None: + return err + + name_col_name = 'demangledName' + if self.parsed_args.base: + name_col_name = 'shortName' + elif (self.parsed_args.mangled and + self.table_col_exists('CUPTI_ACTIVITY_KIND_KERNEL', 'mangledName')): + name_col_name = 'mangledName' + + sub_queries = [] + + if self.table_exists('CUPTI_ACTIVITY_KIND_RUNTIME'): + sub_queries.append(self.query_runtime) + + if self.table_exists('CUPTI_ACTIVITY_KIND_KERNEL'): + sub_queries.append(self.query_kernel.format(NAME_COL_NAME = name_col_name)) + + if self.table_exists('CUPTI_ACTIVITY_KIND_MEMCPY'): + if not self.table_exists('ENUM_CUDA_MEMCPY_OPER'): + return '{DBFILE} does not contain ENUM_CUDA_MEMCPY_OPER table.' + sub_queries.append(self.query_memcpy) + + if self.table_exists('CUPTI_ACTIVITY_KIND_MEMSET'): + sub_queries.append(self.query_memset) + + if len(sub_queries) == 0: + return '{DBFILE} does not contain CUDA API, GPU kernel, nor memory operations data.' + + self.query = self.query_stub.format(SUB_QUERY = self.query_union.join(sub_queries)) + +if __name__ == "__main__": + CUDAAPIandGPUSummary.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_api_gpu_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_api_gpu_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..cd5e71718e30657e32fba56c2649f6ebe659846e --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_api_gpu_sum.py @@ -0,0 +1,191 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import kernel_helper +import nsysstats + +class CudaApiGpuSum(nsysstats.StatsReport): + + display_name = 'CUDA Summary (API/Kernels/MemOps)' + usage = f'''{{SCRIPT}}[:nvtx-name][:base|:mangled] -- {{DISPLAY_NAME}} + + nvtx-name - Optional argument, if given, will prefix the kernel name with + the name of the innermost enclosing NVTX range. + + base - Optional argument, if given, will cause summary to be over the + base name of the kernel, rather than the templated name. + + mangled - Optional argument, if given, will cause summary to be over the + raw mangled name of the kernel, rather than the templated name. + + Note: the ability to display mangled names is a recent addition to the + report file format, and requires that the profile data be captured with + a recent version of Nsys. Re-exporting an existing report file is not + sufficient. If the raw, mangled kernel name data is not available, the + default demangled names will be used. + + Output: All time values default to nanoseconds + Time : Percentage of "Total Time" + Total Time : Total time used by all executions of this kernel + Instances : Number of executions of this kernel + Avg : Average execution time of this kernel + Med : Median execution time of this kernel + Min : Smallest execution time of this kernel + Max : Largest execution time of this kernel + StdDev : Standard deviation of execution time of this kernel + Category : Category of the operation + Operation : Name of the kernel + + This report provides a summary of CUDA API calls, kernels and memory + operations, and their execution times. Note that the "Time" + column is calculated using a summation of the "Total Time" column, + and represents that API call's, kernel's, or memory operation's + percent of the execution time of the APIs, kernels and memory + operations listed, and not a percentage of the application wall or + CPU execution time. + + This report combines data from the "cuda_api_sum", "cuda_gpu_kern_sum", and + "cuda_gpu_mem_size_sum" reports. It is very similar to profile section of + "nvprof --dependency-analysis". +''' + + query_stub = """ +WITH + apigpu AS ( + {SUB_QUERY} + ), + summary AS ( + SELECT + name AS name, + category AS category, + sum(duration) AS total, + count(*) AS num, + avg(duration) AS avg, + median(duration) AS med, + min(duration) AS min, + max(duration) AS max, + stdev(duration) AS stddev + FROM + apigpu + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Instances", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + summary.category AS "Category", + summary.name AS "Operation" +FROM + summary +ORDER BY 2 DESC +; +""" + + query_runtime = """ + SELECT + CASE substr(str.value, -6, 2) + WHEN '_v' THEN substr(str.value, 1, length(str.value)-6) + ELSE str.value + END AS name, + rt.end - rt.start AS duration, + 'CUDA_API' AS category + FROM + CUPTI_ACTIVITY_KIND_RUNTIME AS rt + LEFT OUTER JOIN + StringIds AS str + ON str.id == rt.nameId +""" + + query_kernel = """ + SELECT + name, + end - start AS duration, + 'CUDA_KERNEL' AS category + FROM + CUPTI_ACTIVITY_KIND_KERNEL_NAMED +""" + + query_memcpy = """ + SELECT + '[CUDA memcpy ' || mos.label || ']' AS name, + mcpy.end - mcpy.start AS duration, + 'MEMORY_OPER' AS category + FROM + CUPTI_ACTIVITY_KIND_MEMCPY as mcpy + JOIN + ENUM_CUDA_MEMCPY_OPER AS mos + ON mos.id == mcpy.copyKind +""" + + query_memset = """ + SELECT + '[CUDA memset]' AS name, + end - start AS duration, + 'MEMORY_OPER' AS category + FROM + CUPTI_ACTIVITY_KIND_MEMSET +""" + + query_union = """ + UNION ALL +""" + + _arg_opts = [ + [['nvtx-name'], {'action': 'store_true'}], + [['base'], {'action': 'store_true'}], + [['mangled'], {'action': 'store_true'}], + ] + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.' + } + + def setup(self): + err = super().setup() + if err != None: + return err + + sub_queries = [] + + if self.table_exists('CUPTI_ACTIVITY_KIND_RUNTIME'): + sub_queries.append(self.query_runtime) + + if self.table_exists('CUPTI_ACTIVITY_KIND_KERNEL'): + err = kernel_helper.create_kernel_view(self) + if err != None: + return err + sub_queries.append(self.query_kernel) + + if self.table_exists('CUPTI_ACTIVITY_KIND_MEMCPY'): + if not self.table_exists('ENUM_CUDA_MEMCPY_OPER'): + return '{DBFILE} does not contain ENUM_CUDA_MEMCPY_OPER table.' + sub_queries.append(self.query_memcpy) + + if self.table_exists('CUPTI_ACTIVITY_KIND_MEMSET'): + sub_queries.append(self.query_memset) + + if len(sub_queries) == 0: + return '{DBFILE} does not contain CUDA API, GPU kernel, nor memory operations data.' + + self.query = self.query_stub.format(SUB_QUERY = self.query_union.join(sub_queries)) + +if __name__ == "__main__": + CudaApiGpuSum.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_api_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_api_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..cf8d63ab9aa35162949043a47fc45533cd13d1f0 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_api_sum.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class CudaApiSum(nsysstats.StatsReport): + + display_name = 'CUDA API Summary' + usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}} + + No arguments. + + Output: All time values default to nanoseconds + Time : Percentage of "Total Time" + Total Time : Total time used by all executions of this function + Num Calls : Number of calls to this function + Avg : Average execution time of this function + Med : Median execution time of this function + Min : Smallest execution time of this function + Max : Largest execution time of this function + StdDev : Standard deviation of the time of this function + Name : Name of the function + + This report provides a summary of CUDA API functions and their + execution times. Note that the "Time" column is calculated + using a summation of the "Total Time" column, and represents that + function's percent of the execution time of the functions listed, + and not a percentage of the application wall or CPU execution time. +""" + + query = """ +WITH + summary AS ( + SELECT + nameId AS nameId, + sum(end - start) AS total, + count(*) AS num, + avg(end - start) AS avg, + median(end - start) AS med, + min(end - start) AS min, + max(end - start) AS max, + stdev(end - start) AS stddev, + lower_quartile(end - start) AS q1, + upper_quartile(end - start) AS q3 + FROM + CUPTI_ACTIVITY_KIND_RUNTIME + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Num Calls", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + CASE substr(ids.value, -6, 2) + WHEN '_v' + THEN substr(ids.value, 1, length(value)-6) + ELSE ids.value + END AS "Name", + summary.q1 AS "_Q1", + summary.q3 AS "_Q3" +FROM + summary +LEFT JOIN + StringIds AS ids + ON ids.id == summary.nameId +ORDER BY 2 DESC +; +""" + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.', + 'CUPTI_ACTIVITY_KIND_RUNTIME': + '{DBFILE} does not contain CUDA trace data.' + } + +if __name__ == "__main__": + CudaApiSum.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_api_trace.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_api_trace.py new file mode 100644 index 0000000000000000000000000000000000000000..1cf08b9eda1c8f9e190ce74addbe1d387428991d --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_api_trace.py @@ -0,0 +1,76 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class CudaApiTrace(nsysstats.StatsReport): + + display_name = 'CUDA API Trace' + usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}} + + No arguments. + + Output: All time values default to nanoseconds + Start : Timestamp when API call was made + Duration : Length of API calls + Name : API function name + Result : Return value of API call + CorrID : Correlation used to map to other CUDA calls + Pid : Process ID that made the call + Tid : Tread ID that made the call + T-Pri : Run priority of call thread + Thread Name : Name of thread that called API function + + This report provides a trace record of CUDA API function calls and + their execution times. +""" + + query = """ +SELECT + api.start AS "Start:ts_ns", + api.end - api.start AS "Duration:dur_ns", + CASE substr(nstr.value, -6, 2) + WHEN '_v'THEN substr(nstr.value, 1, length(nstr.value)-6) + ELSE nstr.value + END AS "Name", + api.returnValue AS "Result", + api.correlationId AS "CorrID", + -- (api.globalTid >> 40) & 0xFF AS "HWid", + -- (api.globalTid >> 32) & 0xFF AS "VMid", + (api.globalTid >> 24) & 0xFFFFFF AS "Pid", + (api.globalTid ) & 0xFFFFFF AS "Tid", + tname.priority AS "T-Pri", + tstr.value AS "Thread Name" +FROM + CUPTI_ACTIVITY_KIND_RUNTIME AS api +LEFT OUTER JOIN + StringIds AS nstr + ON nstr.id == api.nameId +LEFT OUTER JOIN + ThreadNames AS tname + ON tname.globalTid == api.globalTid +LEFT OUTER JOIN + StringIds AS tstr + ON tstr.id == tname.nameId +ORDER BY 1 +; +""" + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.', + 'ThreadNames': '{DBFILE} file does not contain ThreadNames table.', + 'CUPTI_ACTIVITY_KIND_RUNTIME': + '{DBFILE} does not contain CUDA trace data.' + } + +if __name__ == "__main__": + CudaApiTrace.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_gpu_kern_gb_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_gpu_kern_gb_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..ae4764bb69fe811360bfbb8a1ae73e0425490ad7 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_gpu_kern_gb_sum.py @@ -0,0 +1,123 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import kernel_helper +import nsysstats + +class CudaGpuKernGBSum(nsysstats.StatsReport): + + display_name = 'CUDA GPU Kernel/Grid/Block Summary' + usage = f"""{{SCRIPT}}[:nvtx-name][:base|:mangled] -- {{DISPLAY_NAME}} + + nvtx-name - Optional argument, if given, will prefix the kernel name with + the name of the innermost enclosing NVTX range. + + base - Optional argument, if given, will cause summary to be over the + base name of the kernel, rather than the templated name. + + mangled - Optional argument, if given, will cause summary to be over the + raw mangled name of the kernel, rather than the templated name. + + Note: the ability to display mangled names is a recent addition to the + report file format, and requires that the profile data be captured with + a recent version of Nsys. Re-exporting an existing report file is not + sufficient. If the raw, mangled kernel name data is not available, the + default demangled names will be used. + + Output: All time values default to nanoseconds + Time : Percentage of "Total Time" + Total Time : Total time used by all executions of this kernel + Instances : Number of calls to this kernel + Avg : Average execution time of this kernel + Med : Median execution time of this kernel + Min : Smallest execution time of this kernel + Max : Largest execution time of this kernel + StdDev : Standard deviation of the time of this kernel + GridXYZ : Grid dimensions for kernel launch call + BlockXYZ : Block dimensions for kernel launch call + Name : Name of the kernel + + This report provides a summary of CUDA kernels and their execution times. + Kernels are sorted by grid dimensions, block dimensions, and kernel name. + Note that the "Time" column is calculated using a summation of the "Total + Time" column, and represents that kernel's percent of the execution time + of the kernels listed, and not a percentage of the application wall or + CPU execution time. +""" + + query = """ +WITH + summary AS ( + SELECT + name, + sum(end - start) AS total, + count(*) AS num, + avg(end - start) AS avg, + median(end - start) AS med, + min(end - start) AS min, + max(end - start) AS max, + stdev(end - start) AS stddev, + gridX, gridY, gridZ, + blockX, blockY, blockZ, + lower_quartile(end - start) AS q1, + upper_quartile(end - start) AS q3 + FROM + CUPTI_ACTIVITY_KIND_KERNEL_NAMED + GROUP BY 1, gridX, gridY, gridZ, blockX, blockY, blockZ + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Instances", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + printf('%4d %4d %4d', gridX, gridY, gridZ) AS "GridXYZ", + printf('%4d %4d %4d', blockX, blockY, blockZ) AS "BlockXYZ", + summary.name AS "Name", + summary.q1 AS "_Q1", + summary.q3 AS "_Q3" +FROM + summary +ORDER BY 2 DESC, 3, "Name" +; +""" + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.', + 'CUPTI_ACTIVITY_KIND_KERNEL': + '{DBFILE} does not contain CUDA kernel data.' + } + + _arg_opts = [ + [['nvtx-name'], {'action': 'store_true'}], + [['base'], {'action': 'store_true'}], + [['mangled'], {'action': 'store_true'}], + ] + + def setup(self): + err = super().setup() + if err != None: + return err + + err = kernel_helper.create_kernel_view(self) + if err != None: + return err + +if __name__ == "__main__": + CudaGpuKernGBSum.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_gpu_kern_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_gpu_kern_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..f0718d525ad066303f742ac97f35214db7023d01 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_gpu_kern_sum.py @@ -0,0 +1,125 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import kernel_helper +import nsysstats + +class CudaGpuKernSum(nsysstats.StatsReport): + + display_name = 'CUDA GPU Kernel Summary' + usage = f"""{{SCRIPT}}[:nvtx-name][:base|:mangled] -- {{DISPLAY_NAME}} + + PLEASE NOTE: In recent versions of Nsight Systems, this report was expanded + to include and sort by CUDA grid and block dimensions. This change was + made to accommodate developers doing a certain type of optimization work. + Unfortunately, this change caused an unexpected burden for developers doing + a different type of optimization work. In order to service both use-cases, + this report has been returned to the original form, without grid or block + information. A new report, called "cuda_gpu_kern_gb_sum", has been created + that retains the grid and block information. + + nvtx-name - Optional argument, if given, will prefix the kernel name with + the name of the innermost enclosing NVTX range. + + base - Optional argument, if given, will cause summary to be over the + base name of the kernel, rather than the templated name. + + mangled - Optional argument, if given, will cause summary to be over the + raw mangled name of the kernel, rather than the templated name. + + Note: the ability to display mangled names is a recent addition to the + report file format, and requires that the profile data be captured with + a recent version of Nsys. Re-exporting an existing report file is not + sufficient. If the raw, mangled kernel name data is not available, the + default demangled names will be used. + + Output: All time values default to nanoseconds + Time : Percentage of "Total Time" + Total Time : Total time used by all executions of this kernel + Instances : Number of calls to this kernel + Avg : Average execution time of this kernel + Med : Median execution time of this kernel + Min : Smallest execution time of this kernel + Max : Largest execution time of this kernel + StdDev : Standard deviation of the time of this kernel + Name : Name of the kernel + + This report provides a summary of CUDA kernels and their execution times. + Note that the "Time" column is calculated using a summation of the "Total + Time" column, and represents that kernel's percent of the execution time + of the kernels listed, and not a percentage of the application wall or + CPU execution time. +""" + + query = """ +WITH + summary AS ( + SELECT + name, + sum(end - start) AS total, + count(*) AS num, + avg(end - start) AS avg, + median(end - start) AS med, + min(end - start) AS min, + max(end - start) AS max, + stdev(end - start) AS stddev, + lower_quartile(end - start) AS q1, + upper_quartile(end - start) AS q3 + FROM + CUPTI_ACTIVITY_KIND_KERNEL_NAMED + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Instances", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + summary.name AS "Name", + summary.q1 AS "_Q1", + summary.q3 AS "_Q3" +FROM + summary +ORDER BY 2 DESC, 3, "Name" +; +""" + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.', + 'CUPTI_ACTIVITY_KIND_KERNEL': + '{DBFILE} does not contain CUDA kernel data.' + } + + _arg_opts = [ + [['nvtx-name'], {'action': 'store_true'}], + [['base'], {'action': 'store_true'}], + [['mangled'], {'action': 'store_true'}], + ] + + def setup(self): + err = super().setup() + if err != None: + return err + + err = kernel_helper.create_kernel_view(self) + if err != None: + return err + +if __name__ == "__main__": + CudaGpuKernSum.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_gpu_mem_size_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_gpu_mem_size_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..7769ed153ade4f752cc0d69056ebf6cdbc67741e --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_gpu_mem_size_sum.py @@ -0,0 +1,116 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats +class CudaGpuMemSizeSum(nsysstats.StatsReport): + + display_name = 'CUDA GPU MemOps Summary (by Size)' + usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}} + + No arguments. + + Output: + Total : Total memory utilized by this operation + Count : Number of executions of this operation + Avg : Average memory size of this operation + Med : Median memory size of this operation + Min : Smallest memory size of this operation + Max : Largest memory size of this operation + StdDev : Standard deviation of the memory size of this operation + Operation : Name of the operation + + This report provides a summary of GPU memory operations and + the amount of memory they utilize. +""" + + query_stub = """ +WITH + memops AS ( + {MEM_SUB_QUERY} + ), + summary AS ( + SELECT + name AS name, + sum(size) AS total, + count(*) AS num, + avg(size) AS avg, + median(size) AS med, + min(size) AS min, + max(size) AS max, + stdev(size) AS stddev, + lower_quartile(size) AS q1, + upper_quartile(size) AS q3 + FROM memops + GROUP BY 1 + ) +SELECT + summary.total AS "Total:mem_B", + summary.num AS "Count", + summary.avg AS "Avg:mem_B", + summary.med AS "Med:mem_B", + summary.min AS "Min:mem_B", + summary.max AS "Max:mem_B", + summary.stddev AS "StdDev:mem_B", + summary.name AS "Operation", + summary.q1 AS "_Q1", + summary.q3 AS "_Q3" +FROM + summary +ORDER BY 1 DESC +; +""" + + query_memcpy = """ + SELECT + '[CUDA memcpy ' || mos.label || ']' AS name, + mcpy.bytes AS size + FROM + CUPTI_ACTIVITY_KIND_MEMCPY as mcpy + INNER JOIN + ENUM_CUDA_MEMCPY_OPER AS mos + ON mos.id == mcpy.copyKind +""" + + query_memset = """ + SELECT + '[CUDA memset]' AS name, + bytes AS size + FROM + CUPTI_ACTIVITY_KIND_MEMSET +""" + + query_union = """ + UNION ALL +""" + + def setup(self): + err = super().setup() + if err != None: + return err + + sub_queries = [] + + if self.table_exists('CUPTI_ACTIVITY_KIND_MEMCPY'): + if not self.table_exists('ENUM_CUDA_MEMCPY_OPER'): + return '{DBFILE} does not contain ENUM_CUDA_MEMCPY_OPER table.' + sub_queries.append(self.query_memcpy) + + if self.table_exists('CUPTI_ACTIVITY_KIND_MEMSET'): + sub_queries.append(self.query_memset) + + if len(sub_queries) == 0: + return "{DBFILE} does not contain GPU memory data." + + self.query = self.query_stub.format(MEM_SUB_QUERY = self.query_union.join(sub_queries)) + +if __name__ == "__main__": + CudaGpuMemSizeSum.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_gpu_mem_time_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_gpu_mem_time_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..6f673990a334cef678f92f5aca68bee6708bb4cb --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_gpu_mem_time_sum.py @@ -0,0 +1,127 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class CudaGpuMemTimeSum(nsysstats.StatsReport): + + display_name = 'CUDA GPU MemOps Summary (by Time)' + usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}} + + No arguments. + + Output: All time values default to nanoseconds + Time : Percentage of "Total Time" + Total Time : Total time used by all executions of this operation + Count : Number of operations to this type + Avg : Average execution time of this operation + Med : Median execution time of this operation + Min : Smallest execution time of this operation + Max : Largest execution time of this operation + StdDev : Standard deviation of execution time of this operation + Operation : Name of the memory operation + + This report provides a summary of GPU memory operations and + their execution times. Note that the "Time" column is calculated + using a summation of the "Total Time" column, and represents that + operation's percent of the execution time of the operations listed, + and not a percentage of the application wall or CPU execution time. +""" + + query_stub = """ +WITH + memops AS ( + {MEM_SUB_QUERY} + ), + summary AS ( + SELECT + name AS name, + sum(duration) AS total, + count(*) AS num, + avg(duration) AS avg, + median(duration) AS med, + min(duration) AS min, + max(duration) AS max, + stdev(duration) AS stddev, + lower_quartile(duration) AS q1, + upper_quartile(duration) AS q3 + FROM + memops + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Count", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + summary.name AS "Operation", + summary.q1 AS "_Q1", + summary.q3 AS "_Q3" +FROM + summary +ORDER BY 2 DESC +; +""" + + query_memcpy = """ + SELECT + '[CUDA memcpy ' || mos.label || ']' AS name, + mcpy.end - mcpy.start AS duration + FROM + CUPTI_ACTIVITY_KIND_MEMCPY as mcpy + INNER JOIN + ENUM_CUDA_MEMCPY_OPER AS mos + ON mos.id == mcpy.copyKind +""" + + query_memset = """ + SELECT + '[CUDA memset]' AS name, + end - start AS duration + FROM + CUPTI_ACTIVITY_KIND_MEMSET +""" + + query_union = """ + UNION ALL +""" + + def setup(self): + err = super().setup() + if err != None: + return err + + sub_queries = [] + + if self.table_exists('CUPTI_ACTIVITY_KIND_MEMCPY'): + if not self.table_exists('ENUM_CUDA_MEMCPY_OPER'): + return '{DBFILE} does not contain ENUM_CUDA_MEMCPY_OPER table.' + sub_queries.append(self.query_memcpy) + + if self.table_exists('CUPTI_ACTIVITY_KIND_MEMSET'): + sub_queries.append(self.query_memset) + + if len(sub_queries) == 0: + return "{DBFILE} does not contain GPU memory data." + + self.query = self.query_stub.format(MEM_SUB_QUERY = self.query_union.join(sub_queries)) + +if __name__ == "__main__": + CudaGpuMemTimeSum.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_gpu_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_gpu_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..aee7bb1dd43446d48d54e70ac940bae61549f36e --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_gpu_sum.py @@ -0,0 +1,172 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import kernel_helper +import nsysstats + +class CudaGpuSum(nsysstats.StatsReport): + + display_name = 'CUDA GPU Summary (Kernels/MemOps)' + usage = f"""{{SCRIPT}}[:nvtx-name][:base|:mangled] -- {{DISPLAY_NAME}} + + nvtx-name - Optional argument, if given, will prefix the kernel name with + the name of the innermost enclosing NVTX range. + + base - Optional argument, if given, will cause summary to be over the + base name of the kernel, rather than the templated name. + + mangled - Optional argument, if given, will cause summary to be over the + raw mangled name of the kernel, rather than the templated name. + + Note: the ability to display mangled names is a recent addition to the + report file format, and requires that the profile data be captured with + a recent version of Nsys. Re-exporting an existing report file is not + sufficient. If the raw, mangled kernel name data is not available, the + default demangled names will be used. + + Output: All time values default to nanoseconds + Time : Percentage of "Total Time" + Total Time : Total time used by all executions of this kernel + Instances : Number of executions of this kernel + Avg : Average execution time of this kernel + Med : Median execution time of this kernel + Min : Smallest execution time of this kernel + Max : Largest execution time of this kernel + StdDev : Standard deviation of execution time of this kernel + Category : Category of the operation + Operation : Name of the kernel + + This report provides a summary of CUDA kernels and memory operations, + and their execution times. Note that the "Time" column is calculated + using a summation of the "Total Time" column, and represents that + kernel's or memory operation's percent of the execution time of the + kernels and memory operations listed, and not a percentage of the + application wall or CPU execution time. + + This report combines data from the "cuda_gpu_kern_sum" and + "cuda_gpu_mem_time_sum" reports. This report is very similar to output of + the command "nvprof --print-gpu-summary". +""" + + query_stub = """ +WITH + gpuops AS ( + {GPU_SUB_QUERY} + ), + summary AS ( + SELECT + name AS name, + category AS category, + sum(duration) AS total, + count(*) AS num, + avg(duration) AS avg, + median(duration) AS med, + min(duration) AS min, + max(duration) AS max, + stdev(duration) AS stddev + FROM + gpuops + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Instances", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + summary.category AS "Category", + summary.name AS "Operation" +FROM + summary +ORDER BY 2 DESC +; +""" + + query_kernel = """ + SELECT + name, + end - start AS duration, + 'CUDA_KERNEL' AS category + FROM + CUPTI_ACTIVITY_KIND_KERNEL_NAMED +""" + + query_memcpy = """ + SELECT + '[CUDA memcpy ' || mos.label || ']' AS name, + mcpy.end - mcpy.start AS duration, + 'MEMORY_OPER' AS category + FROM + CUPTI_ACTIVITY_KIND_MEMCPY as mcpy + JOIN + ENUM_CUDA_MEMCPY_OPER AS mos + ON mos.id == mcpy.copyKind +""" + + query_memset = """ + SELECT + '[CUDA memset]' AS name, + end - start AS duration, + 'MEMORY_OPER' AS category + FROM + CUPTI_ACTIVITY_KIND_MEMSET + """ + + query_union = """ + UNION ALL +""" + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.' + } + + _arg_opts = [ + [['nvtx-name'], {'action': 'store_true'}], + [['base'], {'action': 'store_true'}], + [['mangled'], {'action': 'store_true'}], + ] + + def setup(self): + err = super().setup() + if err != None: + return err + + sub_queries = [] + + if self.table_exists('CUPTI_ACTIVITY_KIND_KERNEL'): + err = kernel_helper.create_kernel_view(self) + if err != None: + return err + sub_queries.append(self.query_kernel) + + if self.table_exists('CUPTI_ACTIVITY_KIND_MEMCPY'): + if not self.table_exists('ENUM_CUDA_MEMCPY_OPER'): + return '{DBFILE} does not contain ENUM_CUDA_MEMCPY_OPER table.' + sub_queries.append(self.query_memcpy) + + if self.table_exists('CUPTI_ACTIVITY_KIND_MEMSET'): + sub_queries.append(self.query_memset) + + if len(sub_queries) == 0: + return "{DBFILE} does not contain GPU kernel/memory operations data." + + self.query = self.query_stub.format(GPU_SUB_QUERY = self.query_union.join(sub_queries)) + +if __name__ == "__main__": + CudaGpuSum.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_gpu_trace.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_gpu_trace.py new file mode 100644 index 0000000000000000000000000000000000000000..36b3a9749f09890a02335d2ce15e858b74ca3ce7 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_gpu_trace.py @@ -0,0 +1,257 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import kernel_helper +import nsysstats + +class CudaGpuTrace(nsysstats.StatsReport): + + display_name = 'CUDA GPU Trace' + usage = f"""{{SCRIPT}}[:nvtx-name][:base|:mangled] -- {{DISPLAY_NAME}} + + nvtx-name - Optional argument, if given, will prefix the kernel name with + the name of the innermost enclosing NVTX range. + + base - Optional argument, if given, will display the base name of the + kernel, rather than the templated name. + + mangled - Optional argument, if given, will display the raw mangled name + of the kernel, rather than the templated name. + + Note: the ability to display mangled names is a recent addition to the + report file format, and requires that the profile data be captured with + a recent version of Nsys. Re-exporting an existing report file is not + sufficient. If the raw, mangled kernel name data is not available, the + default demangled names will be used. + + Output: All time values default to nanoseconds + Start : Timestamp of start time + Duration : Length of event + CorrId : Correlation ID + GrdX, GrdY, GrdZ : Grid values + BlkX, BlkY, BlkZ : Block values + Reg/Trd : Registers per thread + StcSMem : Size of Static Shared Memory + DymSMem : Size of Dynamic Shared Memory + Bytes : Size of memory operation + Throughput : Memory throughput + SrcMemKd : Memcpy source memory kind or memset memory kind + DstMemKd : Memcpy destination memory kind + Device : GPU device name and ID + Ctx : Context ID + GreenCtx: Green context ID + Strm : Stream ID + Name : Trace event name + + This report displays a trace of CUDA kernels and memory operations. + Items are sorted by start time. +""" + + query_stub = """ +WITH + recs AS ( + {GPU_SUB_QUERY} + ) + SELECT + start AS "Start:ts_ns", + duration AS "Duration:dur_ns", + correlation AS "CorrId", + gridX AS "GrdX", + gridY AS "GrdY", + gridZ AS "GrdZ", + blockX AS "BlkX", + blockY AS "BlkY", + blockZ AS "BlkZ", + regsperthread AS "Reg/Trd", + ssmembytes AS "StcSMem:mem_B", + dsmembytes AS "DymSMem:mem_B", + bytes AS "Bytes:mem_B", + CASE + WHEN bytes IS NULL + THEN NULL + ELSE + bytes * (1000000000 / duration) + END AS "Throughput:thru_B", + srcmemkind AS "SrcMemKd", + dstmemkind AS "DstMemKd", + device AS "Device", + context AS "Ctx", + NULLIF(greenContext, 0) AS "GreenCtx", + stream AS "Strm", + name AS "Name" + FROM + recs + ORDER BY start; +""" + + query_kernel = """ + SELECT + start AS "start", + (end - start) AS "duration", + gridX AS "gridX", + gridY AS "gridY", + gridZ AS "gridZ", + blockX AS "blockX", + blockY AS "blockY", + blockZ AS "blockZ", + registersPerThread AS "regsperthread", + staticSharedMemory AS "ssmembytes", + dynamicSharedMemory AS "dsmembytes", + NULL AS "bytes", + NULL AS "srcmemkind", + NULL AS "dstmemkind", + NULL AS "memsetval", + printf('%s (%d)', gpu.name, deviceId) AS "device", + contextId AS "context", + greenContextId AS "greenContext", + streamId AS "stream", + kern.name AS "name", + correlationId AS "correlation" + FROM + CUPTI_ACTIVITY_KIND_KERNEL_NAMED AS kern + LEFT JOIN + TARGET_INFO_GPU AS gpu + ON gpu.id == kern.deviceId +""" + + query_memcpy = """ + SELECT + start AS "start", + (end - start) AS "duration", + NULL AS "gridX", + NULL AS "gridY", + NULL AS "gridZ", + NULL AS "blockX", + NULL AS "blockY", + NULL AS "blockZ", + NULL AS "regsperthread", + NULL AS "ssmembytes", + NULL AS "dsmembytes", + bytes AS "bytes", + msrck.label AS "srcmemkind", + mdstk.label AS "dstmemkind", + NULL AS "memsetval", + printf('%s (%d)', gpu.name, deviceId) AS "device", + contextId AS "context", + greenContextId AS "greenContext", + streamId AS "stream", + '[CUDA memcpy ' || memopstr.label || ']' AS "name", + correlationId AS "correlation" + FROM + CUPTI_ACTIVITY_KIND_MEMCPY AS memcpy + LEFT JOIN + ENUM_CUDA_MEMCPY_OPER AS memopstr + ON memcpy.copyKind == memopstr.id + LEFT JOIN + ENUM_CUDA_MEM_KIND AS msrck + ON memcpy.srcKind == msrck.id + LEFT JOIN + ENUM_CUDA_MEM_KIND AS mdstk + ON memcpy.dstKind == mdstk.id + LEFT JOIN + TARGET_INFO_GPU AS gpu + ON memcpy.deviceId == gpu.id +""" + + query_memset = """ + SELECT + start AS "start", + (end - start) AS "duration", + NULL AS "gridX", + NULL AS "gridY", + NULL AS "gridZ", + NULL AS "blockX", + NULL AS "blockY", + NULL AS "blockZ", + NULL AS "regsperthread", + NULL AS "ssmembytes", + NULL AS "dsmembytes", + bytes AS "bytes", + mk.label AS "srcmemkind", + NULL AS "dstmemkind", + value AS "memsetval", + printf('%s (%d)', gpu.name, deviceId) AS "device", + contextId AS "context", + greenContextId AS "greenContext", + streamId AS "stream", + '[CUDA memset]' AS "name", + correlationId AS "correlation" + FROM + CUPTI_ACTIVITY_KIND_MEMSET AS memset + LEFT JOIN + ENUM_CUDA_MEM_KIND AS mk + ON memset.memKind == mk.id + LEFT JOIN + TARGET_INFO_GPU AS gpu + ON memset.deviceId == gpu.id +""" + + query_union = """ + UNION ALL +""" + + _arg_opts = [ + [['nvtx-name'], {'action': 'store_true'}], + [['base'], {'action': 'store_true'}], + [['mangled'], {'action': 'store_true'}], + ] + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.', + 'TARGET_INFO_GPU': '{DBFILE} file does not contain TARGET_INFO_GPU table.' + } + + def setup(self): + err = super().setup() + if err != None: + return err + + col_checks = { + 'greenContextId': + "{DBFILE} does not contain 'greenContextId' column." + " Please re-export the report file with a recent version of Nsight Systems." + } + + sub_queries = [] + + if self.table_exists('CUPTI_ACTIVITY_KIND_KERNEL'): + self.table_col_checks['CUPTI_ACTIVITY_KIND_KERNEL'] = col_checks + err = kernel_helper.create_kernel_view(self) + if err != None: + return err + sub_queries.append(self.query_kernel) + + if self.table_exists('CUPTI_ACTIVITY_KIND_MEMCPY'): + self.table_col_checks['CUPTI_ACTIVITY_KIND_MEMCPY'] = col_checks + if not self.table_exists('ENUM_CUDA_MEMCPY_OPER'): + return '{DBFILE} does not contain ENUM_CUDA_MEMCPY_OPER table.' + if not self.table_exists('ENUM_CUDA_MEM_KIND'): + return '{DBFILE} does not contain ENUM_CUDA_MEM_KIND table.' + sub_queries.append(self.query_memcpy) + + if self.table_exists('CUPTI_ACTIVITY_KIND_MEMSET'): + self.table_col_checks['CUPTI_ACTIVITY_KIND_MEMSET'] = col_checks + if not self.table_exists('ENUM_CUDA_MEM_KIND'): + return '{DBFILE} does not contain ENUM_CUDA_MEM_KIND table.' + sub_queries.append(self.query_memset) + + if len(sub_queries) == 0: + return "{DBFILE} does not contain GPU trace data." + + err = self.check_columns() + if err != None: + return err + + self.query = self.query_stub.format(GPU_SUB_QUERY = self.query_union.join(sub_queries)) + +if __name__ == "__main__": + CudaGpuTrace.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_kern_exec_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_kern_exec_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..a4dd2f24c11513d24403e1a8a7c224664e3890c5 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_kern_exec_sum.py @@ -0,0 +1,170 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import kernel_helper +import nsysstats + +class CudaKernExecSum(nsysstats.StatsReport): + + display_name = 'CUDA Kernel Launch & Exec Time Summary' + usage = f"""{{SCRIPT}}[:nvtx-name][:base|:mangled] -- {{DISPLAY_NAME}} + + nvtx-name - Optional argument, if given, will prefix the kernel name with + the name of the innermost enclosing NVTX range. + + base - Optional argument, if given, will cause summary to be over the + base name of the kernel, rather than the templated name. + + mangled - Optional argument, if given, will cause summary to be over the + raw mangled name of the kernel, rather than the templated name. + + Note: the ability to display mangled names is a recent addition to the + report file format, and requires that the profile data be captured with + a recent version of Nsys. Re-exporting an existing report file is not + sufficient. If the raw, mangled kernel name data is not available, the + default demangled names will be used. + + Output: All time values default to nanoseconds + PID : Process ID that made kernel launch call + TID : Tread ID that made kernel launch call + DevId : CUDA Device ID that executed kernel (which GPU) + Count : Number of kernel records + QCount : Number of kernel records with positive queue time + Average, Median, Minimum, Maximum, and Standard Deviation for: + TAvg, TMed, TMin, TMax, TStdDev : Total time + AAvg, AMed, AMin, AMax, AStdDev : API time + QAvg, QMed, QMin, QMax, QStdDev : Queue time + KAvg, KMed, KMin, KMax, KStdDev : Kernel time + API Name : Name of CUDA API call used to launch kernel + Kernel Name : Name of CUDA Kernel + + This report provides a summary of the launch and execution times of CUDA + kernels. The launch and execution is broken down into three phases: "API + time," the execution time of the CUDA API call on the CPU used to launch the + kernel; "Queue time," the time between the launch call and the kernel + execution; and "Kernel time," the kernel execution time on the GPU. The + "total time" is not a just sum of the other times, as the phases sometimes + overlap. Rather, the total time runs from the start of the API call to end + of the API call or the end of the kernel execution, whichever is later. + + The reported queue time is measured from the end of the API call to the + start of the kernel execution. The actual queue time is slightly longer, as + the kernel is enqueue somewhere in the middle of the API call, and not in + the final nanosecond of function execution. Due to this delay, it is + possible for kernel execution to start before the CUDA launch call returns. + In these cases, no queue time will be reported. Only kernel launches with + positive queue times are included in the queue average, minimum, maximum, + and standard deviation calculations. The "QCount" column indicates how many + launches had positive queue times (and how many launches were involved in + calculating the queue time statistics). Subtracting "QCount" from "Count" + will indicate how many kernels had no queue time. + + Be aware that having a queue time is not inherently bad. Queue times + indicate that the GPU was busy running other tasks when the new kernel was + scheduled for launch. If every kernel launch is immediate, without any queue + time, that _may_ indicate an idle GPU with poor utilization. In terms of + performance optimization, it should not necessarily be a goal to eliminate + queue time. +""" + + query = """ +WITH + runkern AS ( + SELECT + (r.globalTid >> 24) & 0x00FFFFFF AS pid, + r.globalTid & 0x00FFFFFF AS tid, + k.deviceId AS deviceId, + r.end - r.start AS ApiDur, + iif(k.start - r.end >= 0, k.start - r.end, NULL) AS QueDur, + k.end - k.start AS KernDur, + max(r.end, k.end) - r.start AS totalDur, + CASE substr(rname.value, -6, 2) + WHEN '_v' + THEN substr(rname.value, 1, length(rname.value)-6) + ELSE rname.value + END AS apiName, + k.name AS kernName + FROM + CUPTI_ACTIVITY_KIND_KERNEL_NAMED AS k + JOIN + CUPTI_ACTIVITY_KIND_RUNTIME AS r + ON k.correlationId == r.correlationId + AND k.globalPid == (r.globalTid & 0xFFFFFFFFFF000000) + LEFT JOIN + StringIds AS rname + ON r.nameId == rname.id + ) + +SELECT + pid AS PID, -- 1 + tid AS TID, + deviceId AS DevId, + + count(*) AS Count, + count(QueDur) AS QCount, -- 5 + + round(avg(totalDur), 1) AS "TAvg:dur_ns", + round(median(totalDur), 1) AS "TMed:dur_ns", + min(totalDur) AS "TMin:dur_ns", + max(totalDur) AS "TMax:dur_ns", + round(stdev(totalDur), 1) AS "TStdDev:dur_ns", -- 10 + + round(avg(ApiDur), 1) AS "AAvg:dur_ns", + round(median(ApiDur), 1) AS "AMed:dur_ns", + min(ApiDur) AS "AMin:dur_ns", + max(ApiDur) AS "AMax:dur_ns", + round(stdev(ApiDur), 1) AS "AStdDev:dur_ns", -- 15 + + round(avg(QueDur), 1) AS "QAvg:dur_ns", + round(median(QueDur), 1) AS "QMed:dur_ns", + min(QueDur) AS "QMin:dur_ns", + max(QueDur) AS "QMax:dur_ns", + round(stdev(QueDur), 1) AS "QStdDev:dur_ns", -- 20 + + round(avg(KernDur), 1) AS "KAvg:dur_ns", + round(median(KernDur), 1) AS "KMed:dur_ns", + min(KernDur) AS "KMin:dur_ns", + max(KernDur) AS "KMax:dur_ns", + round(stdev(KernDur), 1) AS "KStdDev:dur_ns", -- 25 + + apiName AS "API Name", + kernName AS "Kernel Name" -- 27 +FROM runkern +GROUP BY 1, 2, 3, 26, 27 +ORDER BY 6 DESC +""" + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.', + 'CUPTI_ACTIVITY_KIND_KERNEL': + "{DBFILE} does not contain CUDA kernel data.", + 'CUPTI_ACTIVITY_KIND_RUNTIME': + "{DBFILE} does not contain CUDA API data.", + } + + _arg_opts = [ + [['nvtx-name'], {'action': 'store_true'}], + [['base'], {'action': 'store_true'}], + [['mangled'], {'action': 'store_true'}], + ] + + def setup(self): + err = super().setup() + if err != None: + return err + + err = kernel_helper.create_kernel_view(self) + if err != None: + return err + +if __name__ == "__main__": + CudaKernExecSum.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_kern_exec_trace.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_kern_exec_trace.py new file mode 100644 index 0000000000000000000000000000000000000000..94ae402bb71ad97ea8645ad4a5dde9fa9c87c38f --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cuda_kern_exec_trace.py @@ -0,0 +1,132 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import kernel_helper +import nsysstats + +class CudaKernExecTrace(nsysstats.StatsReport): + + display_name = 'CUDA Kernel Launch & Exec Time Trace' + usage = f"""{{SCRIPT}}[:nvtx-name][:base|:mangled] -- {{DISPLAY_NAME}} + + nvtx-name - Optional argument, if given, will prefix the kernel name with + the name of the innermost enclosing NVTX range. + + base - Optional argument, if given, will cause summary to be over the + base name of the kernel, rather than the templated name. + + mangled - Optional argument, if given, will cause summary to be over the + raw mangled name of the kernel, rather than the templated name. + + Note: the ability to display mangled names is a recent addition to the + report file format, and requires that the profile data be captured with + a recent version of Nsys. Re-exporting an existing report file is not + sufficient. If the raw, mangled kernel name data is not available, the + default demangled names will be used. + + Output: All time values default to nanoseconds + API Start : Start timestamp of CUDA API launch call + API Dur : Duration of CUDA API launch call + Queue Start : Start timestamp of queue wait time, if it exists + Queue Dur : Duration of queue wait time, if it exists + Kernel Start : Start timestamp of CUDA kernel + Kernel Dur : Duration of CUDA kernel + Total Dur : Duration from API start to kernel end + PID : Process ID that made kernel launch call + TID : Thread ID that made kernel launch call + DevId : CUDA Device ID that executed kernel (which GPU) + API Function : Name of CUDA API call used to launch kernel + GridXYZ : Grid dimensions for kernel launch call + BlockXYZ : Block dimensions for kernel launch call + Kernel Name : Name of CUDA Kernel + + This report provides a trace of the launch and execution time of each CUDA + kernel. The launch and execution is broken down into three phases: "API + time," the execution time of the CUDA API call on the CPU used to launch the + kernel; "Queue time," the time between the launch call and the kernel + execution; and "Kernel time," the kernel execution time on the GPU. The + "total time" is not a just sum of the other times, as the phases sometimes + overlap. Rather, the total time runs from the start of the API call to end + of the API call or the end of the kernel execution, whichever is later. + + The reported queue time is measured from the end of the API call to the + start of the kernel execution. The actual queue time is slightly longer, as + the kernel is enqueue somewhere in the middle of the API call, and not in + the final nanosecond of function execution. Due to this delay, it is + possible for kernel execution to start before the CUDA launch call returns. + In these cases, no queue times will be reported. + + Be aware that having a queue time is not inherently bad. Queue times + indicate that the GPU was busy running other tasks when the new kernel was + scheduled for launch. If every kernel launch is immediate, without any queue + time, that _may_ indicate an idle GPU with poor utilization. In terms of + performance optimization, it should not necessarily be a goal to eliminate + queue time. +""" + + query = """ +SELECT + r.start AS "API Start:ts_ns", + r.end - r.start AS "API Dur:dur_ns", + iif(k.start - r.end >= 0, r.end, NULL) AS "Queue Start:ts_ns", + iif(k.start - r.end >= 0, k.start - r.end, NULL) AS "Queue Dur:dur_ns", + k.start AS "Kernel Start:ts_ns", + k.end - k.start AS "Kernel Dur:dur_ns", + max(r.end, k.end) - r.start AS "Total Dur:dur_ns", + (r.globalTid >> 24) & 0x00FFFFFF AS PID, + r.globalTid & 0x00FFFFFF AS TID, + k.deviceId AS DevId, + CASE substr(rname.value, -6, 2) + WHEN '_v' + THEN substr(rname.value, 1, length(rname.value)-6) + ELSE rname.value + END AS "API Function", + printf('%4d %4d %4d', k.gridX, k.gridY, k.gridZ) AS "GridXYZ", + printf('%4d %4d %4d', k.blockX, k.blockY, k.blockZ) AS "BlockXYZ", + k.name AS "Kernel Name" +FROM + CUPTI_ACTIVITY_KIND_KERNEL_NAMED AS k +JOIN + CUPTI_ACTIVITY_KIND_RUNTIME AS r + ON k.correlationId == r.correlationId + AND k.globalPid == (r.globalTid & 0xFFFFFFFFFF000000) +LEFT JOIN + StringIds AS rname + ON r.nameId == rname.id +ORDER BY 1 +""" + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.', + 'CUPTI_ACTIVITY_KIND_KERNEL': + "{DBFILE} does not contain CUDA kernel data.", + 'CUPTI_ACTIVITY_KIND_RUNTIME': + "{DBFILE} does not contain CUDA API data.", + } + + _arg_opts = [ + [['nvtx-name'], {'action': 'store_true'}], + [['base'], {'action': 'store_true'}], + [['mangled'], {'action': 'store_true'}], + ] + + def setup(self): + err = super().setup() + if err != None: + return err + + err = kernel_helper.create_kernel_view(self) + if err != None: + return err + +if __name__ == "__main__": + CudaKernExecTrace.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cudaapisum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cudaapisum.py new file mode 100644 index 0000000000000000000000000000000000000000..01a242f988d317d1d03e85934fb4c3e4af1bb8cc --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cudaapisum.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class CUDAAPISummary(nsysstats.StatsReport): + + display_name = 'DEPRECATED - Use cuda_api_sum instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query = """ +WITH + summary AS ( + SELECT + nameId AS nameId, + sum(end - start) AS total, + count(*) AS num, + avg(end - start) AS avg, + median(end - start) AS med, + min(end - start) AS min, + max(end - start) AS max, + stdev(end - start) AS stddev + FROM + CUPTI_ACTIVITY_KIND_RUNTIME + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Num Calls", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + CASE substr(ids.value, -6, 2) + WHEN '_v' + THEN substr(ids.value, 1, length(value)-6) + ELSE ids.value + END AS "Name" +FROM + summary +LEFT JOIN + StringIds AS ids + ON ids.id == summary.nameId +ORDER BY 2 DESC +; +""" + + table_checks = { + 'CUPTI_ACTIVITY_KIND_RUNTIME': + '{DBFILE} does not contain CUDA trace data.' + } + +if __name__ == "__main__": + CUDAAPISummary.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cudaapitrace.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cudaapitrace.py new file mode 100644 index 0000000000000000000000000000000000000000..a046d0619f2ea76e18b2d0e55009fdbf487e9b18 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/cudaapitrace.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class CUDAAPITrace(nsysstats.StatsReport): + + display_name = 'DEPRECATED - Use cuda_api_trace instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query = """ +SELECT + api.start AS "Start:ts_ns", + api.end - api.start AS "Duration:dur_ns", + CASE substr(nstr.value, -6, 2) + WHEN '_v'THEN substr(nstr.value, 1, length(nstr.value)-6) + ELSE nstr.value + END AS "Name", + api.returnValue AS "Result", + api.correlationId AS "CorrID", + -- (api.globalTid >> 40) & 0xFF AS "HWid", + -- (api.globalTid >> 32) & 0xFF AS "VMid", + (api.globalTid >> 24) & 0xFFFFFF AS "Pid", + (api.globalTid ) & 0xFFFFFF AS "Tid", + tname.priority AS "T-Pri", + tstr.value AS "Thread Name" +FROM + CUPTI_ACTIVITY_KIND_RUNTIME AS api +LEFT OUTER JOIN + StringIds AS nstr + ON nstr.id == api.nameId +LEFT OUTER JOIN + ThreadNames AS tname + ON tname.globalTid == api.globalTid +LEFT OUTER JOIN + StringIds AS tstr + ON tstr.id == tname.nameId +ORDER BY 1 +; +""" + + table_checks = { + 'CUPTI_ACTIVITY_KIND_RUNTIME': + '{DBFILE} does not contain CUDA trace data.' + } + +if __name__ == "__main__": + CUDAAPITrace.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/dx11_pix_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/dx11_pix_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..20b1ca416e3b281ea0b9d08a2cab990fca2a25e9 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/dx11_pix_sum.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class Dx11PixSum(nsysstats.StatsReport): + + display_name = 'DX11 PIX Range Summary' + usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}} + + No arguments. + + Output: All time values default to nanoseconds + Time : Percentage of "Total Time" + Total Time : Total time used by all instances of this range + Instances : Number of instances of this range + Avg : Average execution time of this range + Med : Median execution time of this rage + Min : Smallest execution time of this range + Max : Largest execution time of this range + StdDev : Standard deviation of execution time of this range + Range : Name of the range + + This report provides a summary of D3D11 PIX CPU debug markers, + and their execution times. Note that the "Time" column + is calculated using a summation of the "Total Time" column, and represents + that range's percent of the execution time of the ranges listed, and not a + percentage of the application wall or CPU execution time. +""" + + query = f""" +WITH + summary AS ( + SELECT + begin.textId AS textId, + sum(end.start - begin.end) AS total, + count(*) AS num, + avg(end.start - begin.end) AS avg, + median(end.start - begin.end) AS med, + min(end.start - begin.end) AS min, + max(end.start - begin.end) AS max, + stdev(end.start - begin.end) AS stddev + FROM + D3D11_PIX_DEBUG_API AS begin + JOIN + D3D11_PIX_DEBUG_API AS end + ON begin.correlationId == end.correlationId + AND begin.globalTid == end.globalTid + WHERE begin.textId IS NOT NULL + AND end.textId IS NULL + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) + +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Instances", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + ids.value AS "Range" +FROM + summary +LEFT JOIN + StringIds AS ids + ON ids.id == summary.textId +WHERE summary.total > 0 +ORDER BY 2 DESC +; +""" + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.', + 'D3D11_PIX_DEBUG_API': + "{DBFILE} does not contain DX11 CPU debug markers." + } + +if __name__ == "__main__": + Dx11PixSum.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/dx11pixsum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/dx11pixsum.py new file mode 100644 index 0000000000000000000000000000000000000000..a761ec0f26c45466f55d9d4cf63548e9246f9b0a --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/dx11pixsum.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class D3D11PIXSummary(nsysstats.StatsReport): + + display_name = 'DEPRECATED - Use dx11_pix_sum instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query = f""" +WITH + summary AS ( + SELECT + begin.textId AS textId, + sum(end.start - begin.end) AS total, + count(*) AS num, + avg(end.start - begin.end) AS avg, + median(end.start - begin.end) AS med, + min(end.start - begin.end) AS min, + max(end.start - begin.end) AS max, + stdev(end.start - begin.end) AS stddev + FROM + D3D11_PIX_DEBUG_API AS begin + JOIN + D3D11_PIX_DEBUG_API AS end + ON begin.correlationId == end.correlationId + AND begin.globalTid == end.globalTid + WHERE begin.textId IS NOT NULL + AND end.textId IS NULL + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) + +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Instances", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + ids.value AS "Range" +FROM + summary +LEFT JOIN + StringIds AS ids + ON ids.id == summary.textId +WHERE summary.total > 0 +ORDER BY 2 DESC +; +""" + + table_checks = { + 'D3D11_PIX_DEBUG_API': + "{DBFILE} does not contain DX11 CPU debug markers." + } + +if __name__ == "__main__": + D3D11PIXSummary.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/dx12_gpu_marker_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/dx12_gpu_marker_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..a62b775cb9ba1420a51aba0011a4b2447aa00caf --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/dx12_gpu_marker_sum.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class Dx12GpuMarkerSum(nsysstats.StatsReport): + + display_name = 'DX12 GPU Command List PIX Ranges Summary' + usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}} + + No arguments. + + Output: All time values default to nanoseconds + Time : Percentage of "Total Time" + Total Time : Total time used by all instances of this range + Instances : Number of instances of this range + Avg : Average execution time of this range + Med : Median execution time of this range + Min : Smallest execution time of this range + Max : Largest execution time of this range + StdDev : Standard deviation of execution time of this range + Range : Name of the range + + This report provides a summary of DX12 PIX GPU command list debug markers, + and their execution times. Note that the "Time" column + is calculated using a summation of the "Total Time" column, and represents + that range's percent of the execution time of the ranges listed, and not a + percentage of the application wall or CPU execution time. +""" + + query = """ +WITH + summary AS ( + SELECT + wl.textId AS textId, + sum(wl.end - wl.start) AS total, + count(*) AS num, + avg(wl.end - wl.start) AS avg, + median(wl.end - wl.start) AS med, + min(wl.end - wl.start) AS min, + max(wl.end - wl.start) AS max, + stdev(wl.end - wl.start) AS stddev + FROM + DX12_WORKLOAD AS wl + WHERE wl.textId IS NOT NULL + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) + +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Instances", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + ids.value AS "Range" +FROM + summary +LEFT JOIN + StringIds AS ids + ON ids.id == summary.textId +WHERE summary.total > 0 +ORDER BY 2 DESC +; +""" + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.', + 'DX12_WORKLOAD': + "{DBFILE} does not contain DX12 GPU debug markers." + } + +if __name__ == "__main__": + Dx12GpuMarkerSum.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/dx12_pix_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/dx12_pix_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..bafa345705bd0d483837ec5a40dc221d1ba33fb8 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/dx12_pix_sum.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class Dx12PixSum(nsysstats.StatsReport): + + display_name = 'DX12 PIX Range Summary' + usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}} + + No arguments. + + Output: All time values default to nanoseconds + Time : Percentage of "Total Time" + Total Time : Total time used by all instances of this range + Instances : Number of instances of this range + Avg : Average execution time of this range + Med : Median execution time of this range + Min : Smallest execution time of this range + Max : Largest execution time of this range + StdDev : Standard deviation of execution time of this range + Range : Name of the range + + This report provides a summary of D3D12 PIX CPU debug markers, + and their execution times. Note that the "Time" column + is calculated using a summation of the "Total Time" column, and represents + that range's percent of the execution time of the ranges listed, and not a + percentage of the application wall or CPU execution time. +""" + + query = f""" +WITH + summary AS ( + SELECT + begin.textId AS textId, + sum(end.start - begin.end) AS total, + count(*) AS num, + avg(end.start - begin.end) AS avg, + median(end.start - begin.end) AS med, + min(end.start - begin.end) AS min, + max(end.start - begin.end) AS max, + stdev(end.start - begin.end) AS stddev + FROM + D3D12_PIX_DEBUG_API AS begin + JOIN + D3D12_PIX_DEBUG_API AS end + ON begin.correlationId == end.correlationId + AND begin.globalTid == end.globalTid + WHERE begin.textId IS NOT NULL + AND end.textId IS NULL + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) + +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Instances", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + ids.value AS "Range" +FROM + summary +LEFT JOIN + StringIds AS ids + ON ids.id == summary.textId +WHERE summary.total > 0 +ORDER BY 2 DESC +; +""" + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.', + 'D3D12_PIX_DEBUG_API': + "{DBFILE} does not contain DX12 CPU debug markers." + } + +if __name__ == "__main__": + Dx12PixSum.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/dx12gpumarkersum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/dx12gpumarkersum.py new file mode 100644 index 0000000000000000000000000000000000000000..c6ac24ea98af79ff59bd8190e349ad483ba74459 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/dx12gpumarkersum.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class DX12GpuMarkerSummary(nsysstats.StatsReport): + + display_name = 'DEPRECATED - Use dx12_gpu_marker_sum instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query = """ +WITH + summary AS ( + SELECT + wl.textId AS textId, + sum(wl.end - wl.start) AS total, + count(*) AS num, + avg(wl.end - wl.start) AS avg, + median(wl.end - wl.start) AS med, + min(wl.end - wl.start) AS min, + max(wl.end - wl.start) AS max, + stdev(wl.end - wl.start) AS stddev + FROM + DX12_WORKLOAD AS wl + WHERE wl.textId IS NOT NULL + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) + +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Instances", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + ids.value AS "Range" +FROM + summary +LEFT JOIN + StringIds AS ids + ON ids.id == summary.textId +WHERE summary.total > 0 +ORDER BY 2 DESC +; +""" + + table_checks = { + 'DX12_WORKLOAD': + "{DBFILE} does not contain DX12 GPU debug markers." + } + +if __name__ == "__main__": + DX12GpuMarkerSummary.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/dx12pixsum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/dx12pixsum.py new file mode 100644 index 0000000000000000000000000000000000000000..062de5ff56ef1676323043f7abe640d760d3c94f --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/dx12pixsum.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class D3D12PIXSummary(nsysstats.StatsReport): + + display_name = 'DEPRECATED - Use dx12_pix_sum instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query = f""" +WITH + summary AS ( + SELECT + begin.textId AS textId, + sum(end.start - begin.end) AS total, + count(*) AS num, + avg(end.start - begin.end) AS avg, + median(end.start - begin.end) AS med, + min(end.start - begin.end) AS min, + max(end.start - begin.end) AS max, + stdev(end.start - begin.end) AS stddev + FROM + D3D12_PIX_DEBUG_API AS begin + JOIN + D3D12_PIX_DEBUG_API AS end + ON begin.correlationId == end.correlationId + AND begin.globalTid == end.globalTid + WHERE begin.textId IS NOT NULL + AND end.textId IS NULL + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) + +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Instances", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + ids.value AS "Range" +FROM + summary +LEFT JOIN + StringIds AS ids + ON ids.id == summary.textId +WHERE summary.total > 0 +ORDER BY 2 DESC +; +""" + + table_checks = { + 'D3D12_PIX_DEBUG_API': + "{DBFILE} does not contain DX12 CPU debug markers." + } + +if __name__ == "__main__": + D3D12PIXSummary.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/gpukerngbsum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/gpukerngbsum.py new file mode 100644 index 0000000000000000000000000000000000000000..b9fd691d4b8792cfb0ddc871b88e2692f930d889 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/gpukerngbsum.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class CUDAGPUKernelGBSummary(nsysstats.StatsReport): + + display_name = 'DEPRECATED - Use cuda_gpu_kern_gb_sum instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query_stub = """ +WITH + summary AS ( + SELECT + coalesce({NAME_COL_NAME}, demangledName) AS nameId, + sum(end - start) AS total, + count(*) AS num, + avg(end - start) AS avg, + median(end - start) AS med, + min(end - start) AS min, + max(end - start) AS max, + stdev(end - start) AS stddev, + gridX, gridY, gridZ, + blockX, blockY, blockZ + FROM + CUPTI_ACTIVITY_KIND_KERNEL + GROUP BY 1, gridX, gridY, gridZ, blockX, blockY, blockZ + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Instances", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + printf('%4d %4d %4d', gridX, gridY, gridZ) AS "GridXYZ", + printf('%4d %4d %4d', blockX, blockY, blockZ) AS "BlockXYZ", + ids.value AS "Name" +FROM + summary +LEFT JOIN + StringIds AS ids + ON ids.id == summary.nameId +ORDER BY 2 DESC, 3, "Name" +; +""" + + table_checks = { + 'CUPTI_ACTIVITY_KIND_KERNEL': + '{DBFILE} does not contain CUDA kernel data.' + } + + _arg_opts = [ + [['base'], {'action': 'store_true'}], + [['mangled'], {'action': 'store_true'}], + ] + + def setup(self): + err = super().setup() + if err != None: + return err + + name_col_name = 'demangledName' + if self.parsed_args.base: + name_col_name = 'shortName' + elif (self.parsed_args.mangled and + self.table_col_exists('CUPTI_ACTIVITY_KIND_KERNEL', 'mangledName')): + name_col_name = 'mangledName' + + self.query = self.query_stub.format(NAME_COL_NAME = name_col_name) + +if __name__ == "__main__": + CUDAGPUKernelGBSummary.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/gpukernsum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/gpukernsum.py new file mode 100644 index 0000000000000000000000000000000000000000..f41ffe117d7c0a5805711884dedb16ad921f3372 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/gpukernsum.py @@ -0,0 +1,85 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class CUDAGPUKernelSummary(nsysstats.StatsReport): + + display_name = 'DEPRECATED - Use cuda_gpu_kern_sum instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query_stub = """ +WITH + summary AS ( + SELECT + coalesce({NAME_COL_NAME}, demangledName) AS nameId, + sum(end - start) AS total, + count(*) AS num, + avg(end - start) AS avg, + median(end - start) AS med, + min(end - start) AS min, + max(end - start) AS max, + stdev(end - start) AS stddev + FROM + CUPTI_ACTIVITY_KIND_KERNEL + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Instances", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + ids.value AS "Name" +FROM + summary +LEFT JOIN + StringIds AS ids + ON ids.id == summary.nameId +ORDER BY 2 DESC, 3, "Name" +; +""" + + table_checks = { + 'CUPTI_ACTIVITY_KIND_KERNEL': + '{DBFILE} does not contain CUDA kernel data.' + } + + _arg_opts = [ + [['base'], {'action': 'store_true'}], + [['mangled'], {'action': 'store_true'}], + ] + + def setup(self): + err = super().setup() + if err != None: + return err + + name_col_name = 'demangledName' + if self.parsed_args.base: + name_col_name = 'shortName' + elif (self.parsed_args.mangled and + self.table_col_exists('CUPTI_ACTIVITY_KIND_KERNEL', 'mangledName')): + name_col_name = 'mangledName' + + self.query = self.query_stub.format(NAME_COL_NAME = name_col_name) + +if __name__ == "__main__": + CUDAGPUKernelSummary.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/gpumemsizesum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/gpumemsizesum.py new file mode 100644 index 0000000000000000000000000000000000000000..0dd6323189d19b7f0af05af74467beb272e979fc --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/gpumemsizesum.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class CUDAGPUMemorySizeSummary(nsysstats.StatsReport): + + display_name = 'DEPRECATED - Use cuda_gpu_mem_size_sum instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query_stub = """ +WITH + memops AS ( + {MEM_SUB_QUERY} + ), + summary AS ( + SELECT + name AS name, + sum(size) AS total, + count(*) AS num, + avg(size) AS avg, + median(size) AS med, + min(size) AS min, + max(size) AS max, + stdev(size) AS stddev + FROM memops + GROUP BY 1 + ) +SELECT + summary.total AS "Total:mem_B", + summary.num AS "Count", + summary.avg AS "Avg:mem_B", + summary.med AS "Med:mem_B", + summary.min AS "Min:mem_B", + summary.max AS "Max:mem_B", + summary.stddev AS "StdDev:mem_B", + summary.name AS "Operation" +FROM + summary +ORDER BY 1 DESC +; +""" + + query_memcpy = """ + SELECT + '[CUDA memcpy ' || mos.label || ']' AS name, + mcpy.bytes AS size + FROM + CUPTI_ACTIVITY_KIND_MEMCPY as mcpy + INNER JOIN + ENUM_CUDA_MEMCPY_OPER AS mos + ON mos.id == mcpy.copyKind +""" + + query_memset = """ + SELECT + '[CUDA memset]' AS name, + bytes AS size + FROM + CUPTI_ACTIVITY_KIND_MEMSET +""" + + query_union = """ + UNION ALL +""" + + def setup(self): + err = super().setup() + if err != None: + return err + + sub_queries = [] + + if self.table_exists('CUPTI_ACTIVITY_KIND_MEMCPY'): + if not self.table_exists('ENUM_CUDA_MEMCPY_OPER'): + return '{DBFILE} does not contain ENUM_CUDA_MEMCPY_OPER table.' + sub_queries.append(self.query_memcpy) + + if self.table_exists('CUPTI_ACTIVITY_KIND_MEMSET'): + sub_queries.append(self.query_memset) + + if len(sub_queries) == 0: + return "{DBFILE} does not contain GPU memory data." + + self.query = self.query_stub.format(MEM_SUB_QUERY = self.query_union.join(sub_queries)) + +if __name__ == "__main__": + CUDAGPUMemorySizeSummary.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/gpumemtimesum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/gpumemtimesum.py new file mode 100644 index 0000000000000000000000000000000000000000..412501efeabc197b01826e22f15d7d8d84384d03 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/gpumemtimesum.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class CUDAGPUMemoryTimeSummary(nsysstats.StatsReport): + + display_name = 'DEPRECATED - Use cuda_gpu_mem_time_sum instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query_stub = """ +WITH + memops AS ( + {MEM_SUB_QUERY} + ), + summary AS ( + SELECT + name AS name, + sum(duration) AS total, + count(*) AS num, + avg(duration) AS avg, + median(duration) AS med, + min(duration) AS min, + max(duration) AS max, + stdev(duration)AS stddev + FROM + memops + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Count", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + summary.name AS "Operation" +FROM + summary +ORDER BY 2 DESC +; +""" + + query_memcpy = """ + SELECT + '[CUDA memcpy ' || mos.label || ']' AS name, + mcpy.end - mcpy.start AS duration + FROM + CUPTI_ACTIVITY_KIND_MEMCPY as mcpy + INNER JOIN + ENUM_CUDA_MEMCPY_OPER AS mos + ON mos.id == mcpy.copyKind +""" + + query_memset = """ + SELECT + '[CUDA memset]' AS name, + end - start AS duration + FROM + CUPTI_ACTIVITY_KIND_MEMSET +""" + + query_union = """ + UNION ALL +""" + + def setup(self): + err = super().setup() + if err != None: + return err + + sub_queries = [] + + if self.table_exists('CUPTI_ACTIVITY_KIND_MEMCPY'): + if not self.table_exists('ENUM_CUDA_MEMCPY_OPER'): + return '{DBFILE} does not contain ENUM_CUDA_MEMCPY_OPER table.' + sub_queries.append(self.query_memcpy) + + if self.table_exists('CUPTI_ACTIVITY_KIND_MEMSET'): + sub_queries.append(self.query_memset) + + if len(sub_queries) == 0: + return "{DBFILE} does not contain GPU memory data." + + self.query = self.query_stub.format(MEM_SUB_QUERY = self.query_union.join(sub_queries)) + +if __name__ == "__main__": + CUDAGPUMemoryTimeSummary.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/gpusum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/gpusum.py new file mode 100644 index 0000000000000000000000000000000000000000..4a8324533e03ce8275dd69b4ccf5159bea0f1baf --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/gpusum.py @@ -0,0 +1,135 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class CUDAGPUSummary(nsysstats.StatsReport): + + display_name = 'DEPRECATED - Use cuda_gpu_sum instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query_stub = """ +WITH + gpuops AS ( + {GPU_SUB_QUERY} + ), + summary AS ( + SELECT + name AS name, + category AS category, + sum(duration) AS total, + count(*) AS num, + avg(duration) AS avg, + median(duration) AS med, + min(duration) AS min, + max(duration) AS max, + stdev(duration) AS stddev + FROM + gpuops + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Instances", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + summary.category AS "Category", + summary.name AS "Operation" +FROM + summary +ORDER BY 2 DESC +; +""" + + query_kernel = """ + SELECT + str.value AS name, + kern.end - kern.start AS duration, + 'CUDA_KERNEL' AS category + FROM + CUPTI_ACTIVITY_KIND_KERNEL AS kern + LEFT OUTER JOIN + StringIds AS str + ON str.id == coalesce(kern.{NAME_COL_NAME}, kern.demangledName) + """ + + query_memcpy = """ + SELECT + '[CUDA memcpy ' || mos.label || ']' AS name, + mcpy.end - mcpy.start AS duration, + 'MEMORY_OPER' AS category + FROM + CUPTI_ACTIVITY_KIND_MEMCPY as mcpy + JOIN + ENUM_CUDA_MEMCPY_OPER AS mos + ON mos.id == mcpy.copyKind + """ + + query_memset = """ + SELECT + '[CUDA memset]' AS name, + end - start AS duration, + 'MEMORY_OPER' AS category + FROM + CUPTI_ACTIVITY_KIND_MEMSET + """ + + query_union = """ + UNION ALL +""" + + _arg_opts = [ + [['base'], {'action': 'store_true'}], + [['mangled'], {'action': 'store_true'}], + ] + + def setup(self): + err = super().setup() + if err != None: + return err + + name_col_name = 'demangledName' + if self.parsed_args.base: + name_col_name = 'shortName' + elif (self.parsed_args.mangled and + self.table_col_exists('CUPTI_ACTIVITY_KIND_KERNEL', 'mangledName')): + name_col_name = 'mangledName' + + sub_queries = [] + + if self.table_exists('CUPTI_ACTIVITY_KIND_KERNEL'): + sub_queries.append(self.query_kernel.format(NAME_COL_NAME = name_col_name)) + + if self.table_exists('CUPTI_ACTIVITY_KIND_MEMCPY'): + if not self.table_exists('ENUM_CUDA_MEMCPY_OPER'): + return '{DBFILE} does not contain ENUM_CUDA_MEMCPY_OPER table.' + sub_queries.append(self.query_memcpy) + + if self.table_exists('CUPTI_ACTIVITY_KIND_MEMSET'): + sub_queries.append(self.query_memset) + + if len(sub_queries) == 0: + return "{DBFILE} does not contain GPU kernel/memory operations data." + + self.query = self.query_stub.format(GPU_SUB_QUERY = self.query_union.join(sub_queries)) + +if __name__ == "__main__": + CUDAGPUSummary.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/gputrace.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/gputrace.py new file mode 100644 index 0000000000000000000000000000000000000000..67bdf2f4613a612b74599fa62e35512b41dcf99f --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/gputrace.py @@ -0,0 +1,203 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class CUDAGPUTrace(nsysstats.StatsReport): + + display_name = 'DEPRECATED - Use cuda_gpu_trace instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query_stub = """ +WITH + recs AS ( + {GPU_SUB_QUERY} + ) + SELECT + start AS "Start:ts_ns", + duration AS "Duration:dur_ns", + correlation AS "CorrId", + gridX AS "GrdX", + gridY AS "GrdY", + gridZ AS "GrdZ", + blockX AS "BlkX", + blockY AS "BlkY", + blockZ AS "BlkZ", + regsperthread AS "Reg/Trd", + ssmembytes AS "StcSMem:mem_B", + dsmembytes AS "DymSMem:mem_B", + bytes AS "Bytes:mem_B", + CASE + WHEN bytes IS NULL + THEN '' + ELSE + bytes * (1000000000 / duration) + END AS "Throughput:thru_B", + srcmemkind AS "SrcMemKd", + dstmemkind AS "DstMemKd", + device AS "Device", + context AS "Ctx", + stream AS "Strm", + name AS "Name" + FROM + recs + ORDER BY start; +""" + + query_kernel = """ + SELECT + start AS "start", + (end - start) AS "duration", + gridX AS "gridX", + gridY AS "gridY", + gridZ AS "gridZ", + blockX AS "blockX", + blockY AS "blockY", + blockZ AS "blockZ", + registersPerThread AS "regsperthread", + staticSharedMemory AS "ssmembytes", + dynamicSharedMemory AS "dsmembytes", + NULL AS "bytes", + NULL AS "srcmemkind", + NULL AS "dstmemkind", + NULL AS "memsetval", + printf('%s (%d)', gpu.name, deviceId) AS "device", + contextId AS "context", + streamId AS "stream", + name.value AS "name", + correlationId AS "correlation" + FROM + CUPTI_ACTIVITY_KIND_KERNEL AS kern + LEFT JOIN + StringIds AS name + ON name.id == coalesce(kern.{NAME_COL_NAME}, kern.demangledName) + LEFT JOIN + TARGET_INFO_GPU AS gpu + ON gpu.id == kern.deviceId +""" + + query_memcpy = """ + SELECT + start AS "start", + (end - start) AS "duration", + NULL AS "gridX", + NULL AS "gridY", + NULL AS "gridZ", + NULL AS "blockX", + NULL AS "blockY", + NULL AS "blockZ", + NULL AS "regsperthread", + NULL AS "ssmembytes", + NULL AS "dsmembytes", + bytes AS "bytes", + msrck.label AS "srcmemkind", + mdstk.label AS "dstmemkind", + NULL AS "memsetval", + printf('%s (%d)', gpu.name, deviceId) AS "device", + contextId AS "context", + streamId AS "stream", + '[CUDA memcpy ' || memopstr.label || ']' AS "name", + correlationId AS "correlation" + FROM + CUPTI_ACTIVITY_KIND_MEMCPY AS memcpy + LEFT JOIN + ENUM_CUDA_MEMCPY_OPER AS memopstr + ON memcpy.copyKind == memopstr.id + LEFT JOIN + ENUM_CUDA_MEM_KIND AS msrck + ON memcpy.srcKind == msrck.id + LEFT JOIN + ENUM_CUDA_MEM_KIND AS mdstk + ON memcpy.dstKind == mdstk.id + LEFT JOIN + TARGET_INFO_GPU AS gpu + ON memcpy.deviceId == gpu.id +""" + + query_memset = """ + SELECT + start AS "start", + (end - start) AS "duration", + NULL AS "gridX", + NULL AS "gridY", + NULL AS "gridZ", + NULL AS "blockX", + NULL AS "blockY", + NULL AS "blockZ", + NULL AS "regsperthread", + NULL AS "ssmembytes", + NULL AS "dsmembytes", + bytes AS "bytes", + mk.label AS "srcmemkind", + NULL AS "dstmemkind", + value AS "memsetval", + printf('%s (%d)', gpu.name, deviceId) AS "device", + contextId AS "context", + streamId AS "stream", + '[CUDA memset]' AS "name", + correlationId AS "correlation" + FROM + CUPTI_ACTIVITY_KIND_MEMSET AS memset + LEFT JOIN + ENUM_CUDA_MEM_KIND AS mk + ON memset.memKind == mk.id + LEFT JOIN + TARGET_INFO_GPU AS gpu + ON memset.deviceId == gpu.id +""" + + query_union = """ + UNION ALL +""" + + _arg_opts = [ + [['base'], {'action': 'store_true'}], + [['mangled'], {'action': 'store_true'}], + ] + + def setup(self): + err = super().setup() + if err != None: + return err + + name_col_name = 'demangledName' + if self.parsed_args.base: + name_col_name = 'shortName' + elif (self.parsed_args.mangled and + self.table_col_exists('CUPTI_ACTIVITY_KIND_KERNEL', 'mangledName')): + name_col_name = 'mangledName' + + sub_queries = [] + + if self.table_exists('CUPTI_ACTIVITY_KIND_KERNEL'): + sub_queries.append(self.query_kernel.format(NAME_COL_NAME = name_col_name)) + + if self.table_exists('CUPTI_ACTIVITY_KIND_MEMCPY'): + if not self.table_exists('ENUM_CUDA_MEMCPY_OPER'): + return '{DBFILE} does not contain ENUM_CUDA_MEMCPY_OPER table.' + if not self.table_exists('ENUM_CUDA_MEM_KIND'): + return '{DBFILE} does not contain ENUM_CUDA_MEM_KIND table.' + sub_queries.append(self.query_memcpy) + + if self.table_exists('CUPTI_ACTIVITY_KIND_MEMSET'): + if not self.table_exists('ENUM_CUDA_MEM_KIND'): + return '{DBFILE} does not contain ENUM_CUDA_MEM_KIND table.' + sub_queries.append(self.query_memset) + + if len(sub_queries) == 0: + return "{DBFILE} does not contain GPU trace data." + + self.query = self.query_stub.format(GPU_SUB_QUERY = self.query_union.join(sub_queries)) + +if __name__ == "__main__": + CUDAGPUTrace.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/kernexecsum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/kernexecsum.py new file mode 100644 index 0000000000000000000000000000000000000000..6178944519429dcbd3b88efdd1e9139a76b87d41 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/kernexecsum.py @@ -0,0 +1,118 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class CUDAKernelExecSummary(nsysstats.StatsReport): + + display_name = 'DEPRECATED - Use cuda_kern_exec_sum instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query_stub = """ +WITH + runkern AS ( + SELECT + (r.globalTid >> 24) & 0x00FFFFFF AS pid, + r.globalTid & 0x00FFFFFF AS tid, + k.deviceId AS deviceId, + r.end - r.start AS ApiDur, + iif(k.start - r.end >= 0, k.start - r.end, NULL) AS QueDur, + k.end - k.start AS KernDur, + max(r.end, k.end) - r.start AS totalDur, + CASE substr(rname.value, -6, 2) + WHEN '_v' + THEN substr(rname.value, 1, length(rname.value)-6) + ELSE rname.value + END AS apiName, + kname.value AS kernName + FROM + CUPTI_ACTIVITY_KIND_KERNEL AS k + JOIN + CUPTI_ACTIVITY_KIND_RUNTIME AS r + ON k.correlationId == r.correlationId + AND k.globalPid == (r.globalTid & 0xFFFFFFFFFF000000) + LEFT JOIN + StringIds AS rname + ON r.nameId == rname.id + LEFT JOIN + StringIds AS kname + ON kname.id == coalesce(k.{NAME_COL_NAME}, k.demangledName) + ) + +SELECT + pid AS PID, -- 1 + tid AS TID, + deviceId AS DevId, + + count(*) AS Count, + count(QueDur) AS QCount, -- 5 + + round(avg(totalDur), 1) AS "TAvg:dur_ns", + round(median(totalDur), 1) AS "TMed:dur_ns", + min(totalDur) AS "TMin:dur_ns", + max(totalDur) AS "TMax:dur_ns", + round(stdev(totalDur), 1) AS "TStdDev:dur_ns", -- 10 + + round(avg(ApiDur), 1) AS "AAvg:dur_ns", + round(median(ApiDur), 1) AS "AMed:dur_ns", + min(ApiDur) AS "AMin:dur_ns", + max(ApiDur) AS "AMax:dur_ns", + round(stdev(ApiDur), 1) AS "AStdDev:dur_ns", -- 15 + + round(avg(QueDur), 1) AS "QAvg:dur_ns", + round(median(QueDur), 1) AS "QMed:dur_ns", + min(QueDur) AS "QMin:dur_ns", + max(QueDur) AS "QMax:dur_ns", + round(stdev(QueDur), 1) AS "QStdDev:dur_ns", -- 20 + + round(avg(KernDur), 1) AS "KAvg:dur_ns", + round(median(KernDur), 1) AS "KMed:dur_ns", + min(KernDur) AS "KMin:dur_ns", + max(KernDur) AS "KMax:dur_ns", + round(stdev(KernDur), 1) AS "KStdDev:dur_ns", -- 25 + + apiName AS "API Name", + kernName AS "Kernel Name" -- 27 +FROM runkern +GROUP BY 1, 2, 3, 26, 27 +ORDER BY 6 DESC +""" + + table_checks = { + 'CUPTI_ACTIVITY_KIND_KERNEL': + "{DBFILE} does not contain CUDA kernel data.", + 'CUPTI_ACTIVITY_KIND_RUNTIME': + "{DBFILE} does not contain CUDA API data.", + } + + _arg_opts = [ + [['base'], {'action': 'store_true'}], + [['mangled'], {'action': 'store_true'}], + ] + + def setup(self): + err = super().setup() + if err != None: + return err + + name_col_name = 'demangledName' + if self.parsed_args.base: + name_col_name = 'shortName' + elif (self.parsed_args.mangled and + self.table_col_exists('CUPTI_ACTIVITY_KIND_KERNEL', 'mangledName')): + name_col_name = 'mangledName' + + self.query = self.query_stub.format(NAME_COL_NAME = name_col_name) + +if __name__ == "__main__": + CUDAKernelExecSummary.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/kernexectrace.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/kernexectrace.py new file mode 100644 index 0000000000000000000000000000000000000000..60883747a932e153892fac472354337d016fbbf4 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/kernexectrace.py @@ -0,0 +1,84 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class CUDAKernelExecTrace(nsysstats.StatsReport): + + display_name = 'DEPRECATED - Use cuda_kern_exec_trace instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query_stub = """ + +SELECT + r.start AS "API Start:ts_ns", + r.end - r.start AS "API Dur:dur_ns", + iif(k.start - r.end >= 0, r.end, NULL) AS "Queue Start:ts_ns", + iif(k.start - r.end >= 0, k.start - r.end, NULL) AS "Queue Dur:dur_ns", + k.start AS "Kernel Start:ts_ns", + k.end - k.start AS "Kernel Dur:dur_ns", + max(r.end, k.end) - r.start AS "Total Dur:dur_ns", + (r.globalTid >> 24) & 0x00FFFFFF AS PID, + r.globalTid & 0x00FFFFFF AS TID, + k.deviceId AS DevId, + CASE substr(rname.value, -6, 2) + WHEN '_v' + THEN substr(rname.value, 1, length(rname.value)-6) + ELSE rname.value + END AS "API Function", + printf('%4d %4d %4d', k.gridX, k.gridY, k.gridZ) AS "GridXYZ", + printf('%4d %4d %4d', k.blockX, k.blockY, k.blockZ) AS "BlockXYZ", + kname.value AS "Kernel Name" +FROM + CUPTI_ACTIVITY_KIND_KERNEL AS k +JOIN + CUPTI_ACTIVITY_KIND_RUNTIME AS r + ON k.correlationId == r.correlationId + AND k.globalPid == (r.globalTid & 0xFFFFFFFFFF000000) +LEFT JOIN + StringIds AS rname + ON r.nameId == rname.id +LEFT JOIN + StringIds AS kname + ON kname.id == coalesce(k.{NAME_COL_NAME}, k.demangledName) +ORDER BY 1 +""" + + table_checks = { + 'CUPTI_ACTIVITY_KIND_KERNEL': + "{DBFILE} does not contain CUDA kernel data.", + 'CUPTI_ACTIVITY_KIND_RUNTIME': + "{DBFILE} does not contain CUDA API data.", + } + + _arg_opts = [ + [['base'], {'action': 'store_true'}], + [['mangled'], {'action': 'store_true'}], + ] + + def setup(self): + err = super().setup() + if err != None: + return err + + name_col_name = 'demangledName' + if self.parsed_args.base: + name_col_name = 'shortName' + elif (self.parsed_args.mangled and + self.table_col_exists('CUPTI_ACTIVITY_KIND_KERNEL', 'mangledName')): + name_col_name = 'mangledName' + + self.query = self.query_stub.format(NAME_COL_NAME = name_col_name) + +if __name__ == "__main__": + CUDAKernelExecTrace.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/khrdebuggpusum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/khrdebuggpusum.py new file mode 100644 index 0000000000000000000000000000000000000000..559de665ff96e11a360c7e3eb980a9c79de1f248 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/khrdebuggpusum.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class KHRGpuPushPopSummary(nsysstats.StatsReport): + + EVENT_TYPE_KHR_DEBUG_GPU_PUSHPOP_RANGE = 63 + + display_name = 'DEPRECATED - Use opengl_khr_gpu_range_sum instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query = f""" +WITH + maxts AS( + SELECT max(max(start), max(end)) AS m + FROM KHR_DEBUG_EVENTS + ), + khrDebug AS ( + SELECT + coalesce(khrDebugEvents.end, (SELECT m FROM maxts)) - khrDebugEvents.start AS duration, + CASE + WHEN sid.value IS NOT NULL + THEN sid.value + ELSE khrDebugEvents.id + END AS tag + FROM + KHR_DEBUG_EVENTS AS khrDebugEvents + LEFT OUTER JOIN + StringIds AS sid + ON khrDebugEvents.textId == sid.id + WHERE + khrDebugEvents.eventClass == {EVENT_TYPE_KHR_DEBUG_GPU_PUSHPOP_RANGE} + ), + summary AS ( + SELECT + tag AS name, + sum(duration) AS total, + count(*) AS num, + avg(duration) AS avg, + median(duration) AS med, + min(duration) AS min, + max(duration) AS max, + stdev(duration) AS stddev + FROM + khrDebug + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) + +SELECT + round(total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + total AS "Total Time:dur_ns", + num AS "Instances", + round(avg, 1) AS "Avg:dur_ns", + round(med, 1) AS "Med:dur_ns", + min AS "Min:dur_ns", + max AS "Max:dur_ns", + round(stddev, 1) AS "StdDev:dur_ns", + name AS "Range" +FROM + summary +WHERE summary.total > 0 +ORDER BY 2 DESC +; +""" + table_checks = { + 'KHR_DEBUG_EVENTS': + "{DBFILE} does not contain GPU KHR Extension (KHR_DEBUG) data." + } + +if __name__ == "__main__": + KHRGpuPushPopSummary.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/khrdebugsum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/khrdebugsum.py new file mode 100644 index 0000000000000000000000000000000000000000..a4e298380a8e8af2da6698093eed0e091eb45c4f --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/khrdebugsum.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class KHRPushPopSummary(nsysstats.StatsReport): + + EVENT_TYPE_KHR_DEBUG_PUSHPOP_RANGE = 62 + + display_name = 'DEPRECATED - Use opengl_khr_range_sum instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query = f""" +WITH + maxts AS( + SELECT max(max(start), max(end)) AS m + FROM KHR_DEBUG_EVENTS + ), + khrDebug AS ( + SELECT + coalesce(khrDebugEvents.end, (SELECT m FROM maxts)) - khrDebugEvents.start AS duration, + CASE + WHEN sid.value IS NOT NULL + THEN sid.value + ELSE khrDebugEvents.id + END AS tag + FROM + KHR_DEBUG_EVENTS AS khrDebugEvents + LEFT OUTER JOIN + StringIds AS sid + ON khrDebugEvents.textId == sid.id + WHERE + khrDebugEvents.eventClass == {EVENT_TYPE_KHR_DEBUG_PUSHPOP_RANGE} + ), + summary AS ( + SELECT + tag AS name, + sum(duration) AS total, + count(*) AS num, + avg(duration) AS avg, + median(duration) AS med, + min(duration) AS min, + max(duration) AS max, + stdev(duration) AS stddev + FROM + khrDebug + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) + +SELECT + round(total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + total AS "Total Time:dur_ns", + num AS "Instances", + round(avg, 1) AS "Avg:dur_ns", + round(med, 1) AS "Med:dur_ns", + min AS "Min:dur_ns", + max AS "Max:dur_ns", + round(stddev, 1) AS "StdDev:dur_ns", + name AS "Range" +FROM + summary +WHERE summary.total > 0 +ORDER BY 2 DESC +; +""" + table_checks = { + 'KHR_DEBUG_EVENTS': + "{DBFILE} does not contain KHR Extension (KHR_DEBUG) data." + } + +if __name__ == "__main__": + KHRPushPopSummary.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/mpi_event_trace.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/mpi_event_trace.py new file mode 100644 index 0000000000000000000000000000000000000000..924da88c26a4cd6bda412345b8b93ae6bbf8d4ed --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/mpi_event_trace.py @@ -0,0 +1,174 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class MpiEventTrace(nsysstats.StatsReport): + + display_name = 'MPI Event Trace' + usage = f'''{{SCRIPT}} -- {{DISPLAY_NAME}} + + Output: All time values default to nanoseconds + + Start : Start timestamp of event + End : End timestamp of event + Duration : Duration of event + Event : Name of event type + Pid : Proccess Id that generated the event + Tid : Thread Id that generated the event + Tag : MPI message tag + Rank : MPI Rank that generated event + PeerRank : Other MPI rank of send or receive type events + RootRank : Root MPI rank for broadcast type events + Size : Size of message for uni-directional operations (send & recv) + CollSendSize : Size of sent message for collective operations + CollRecvSize : Size of received message for collective operations + + This report provides a trace record of all recorded MPI events. + + Note that MPI_Sendrecv events with different rank, tag, or size values + are broken up into two seperate report rows, one reporting the send, + and one reporting the receive. If only one row exists, the rank, + tag, and size can assumed to be the same. + +''' + + query_stub = """ +WITH + evts AS ( + {SUB_QUERY} + ) +SELECT + e.start AS "Start:ts_ns", + e.end AS "End:ts_ns", + e.end - e.start AS "Duration:dur_ns", + s.value AS "Event", + (e.globalTid >> 24) & 0x00FFFFFF AS "Pid", + e.globalTid & 0x00FFFFFF AS "Tid", + e.tag AS "Tag", + r.rank AS "Rank", + e.remoteRank AS "PeerRank", + e.rootRank AS "RootRank", + e.size AS "Size:mem_b", + e.collSendSize AS "CollSendSize:mem_b", + e.collRecvSize AS "CollRecvSize:mem_b" +FROM + evts AS e +LEFT JOIN + StringIds AS s + ON e.textId == s.id +LEFT JOIN + MPI_RANKS AS r + ON e.globalTid == r.globalTid +ORDER BY 1 +; +""" + + query_p2p = """ + SELECT + 'p2p' AS source, + start AS start, + end AS end, + globalTid AS globalTid, + textId AS textId, + size AS size, + NULL AS collSendSize, + NULL AS collRecvSize, + tag AS tag, + remoteRank AS remoteRank, + NULL AS rootRank + FROM + MPI_P2P_EVENTS +""" + + query_start = """ + SELECT + 'start-wait' AS source, + start AS start, + end AS end, + globalTid AS globalTid, + textId AS textId, + NULL AS size, + NULL AS collSendSize, + NULL AS collRecvSize, + NULL AS tag, + NULL AS remoteRank, + NULL AS rootRank + FROM + MPI_START_WAIT_EVENTS +""" + + query_other = """ + SELECT + 'other' AS source, + start AS start, + end AS end, + globalTid AS globalTid, + textId AS textId, + NULL AS size, + NULL AS collSendSize, + NULL AS collRecvSize, + NULL AS tag, + NULL AS remoteRank, + NULL AS rootRank + FROM + MPI_OTHER_EVENTS +""" + + query_coll = """ + SELECT + 'collectives' AS source, + start AS start, + end AS end, + globalTid AS globalTid, + textId AS textId, + NULL AS size, + size AS collSendSize, + recvSize AS collRecvSize, + NULL AS tag, + NULL AS remoteRank, + rootRank AS rootRank + FROM + MPI_COLLECTIVES_EVENTS +""" + + query_union = """ + UNION ALL +""" + + def setup(self): + err = super().setup() + if err != None: + return err + + sub_queries = [] + + if self.table_exists('MPI_P2P_EVENTS'): + sub_queries.append(self.query_p2p) + + if self.table_exists('MPI_START_WAIT_EVENTS'): + sub_queries.append(self.query_start) + + if self.table_exists('MPI_OTHER_EVENTS'): + sub_queries.append(self.query_other) + + if self.table_exists('MPI_COLLECTIVES_EVENTS'): + sub_queries.append(self.query_coll) + + if len(sub_queries) == 0: + return '{DBFILE} does not contain MPI event data.' + + self.query = self.query_stub.format( + SUB_QUERY = self.query_union.join(sub_queries)) + +if __name__ == "__main__": + MpiEventTrace.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/network_congestion.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/network_congestion.py new file mode 100644 index 0000000000000000000000000000000000000000..43383b431df939e0f235e41e8a652f5a16761fd1 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/network_congestion.py @@ -0,0 +1,185 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + + +class NetworkDevicesCongestion(nsysstats.StatsReport): + DEFAULT_TICKS_THRESHOLD = 10000 + + display_name = "Network Devices Congestion" + usage = f"""{{SCRIPT}}[:ticks_threshold=] -- {{DISPLAY_NAME}} + + ticks_threshold= - Threshold in ticks/ms above which we report + congestion. Default is {DEFAULT_TICKS_THRESHOLD}. + + Output: All time values default to nanoseconds + Start : Start timestamp of congestion interval + End : End timestamp of congestion interval + Duration : Duration of congestion interval + Send wait rate: Rate of congestion during the interval + GUID : The device GUID + Name : The device name + + This report displays congestion events with a high send wait rate. By + default, only events with a send wait rate above {DEFAULT_TICKS_THRESHOLD} ticks/ms are shown, + but a custom threshold value can be set. + + Each event defines a period of time when the device experienced some level + of congestion. The level of congestion is defined by the send wait rate, + given in time ticks per millisecond (ticks/ms). The specific duration of a + tick is device specific, but can be assumed to be nanoseconds in scale. + Congestion is measured by counting the number of ticks during which the port + had data to transmit, but no data was sent because of insufficient credits + or because of lack of arbitration. The presented value of send wait rate is + the amount of ticks counted during an event, normalized over the event's + duration. Higher send wait rate values indicate more congestion. + + Because the specific duration of a tick is device dependent, analysis + should focus on the relative send wait rates of events generated by the same + device. Comparing absolute send wait rates across devices is only meaningful + if the time tick duration is known to be similar. + + For IB Switch metrics, we do not present the device name, only the GUID. +""" + + query_stub = """ + WITH + recs AS ( + {NETWORKING_SUBQUERY} + ) + SELECT + start AS "Start:ts_ns", + end AS "End:ts_ns", + duration AS "Duration:dur_ns", + value AS "Send wait rate (ticks/ms)", + printf('%x', guid) AS "GUID", + label AS "Device name" + FROM + recs + ORDER BY start; +""" + + query_nics_congestion = """ + SELECT + nmetric.start AS start, + nmetric.end AS end, + nmetric.end - nmetric.start AS duration, + nmetric.value AS value, + nicinfo.GUID AS guid, + deviceid.label AS label + FROM + NET_NIC_METRIC AS nmetric + JOIN + NIC_ID_MAP + USING (globalId) + JOIN + TARGET_INFO_NIC_INFO AS nicinfo + USING (nicId) + JOIN + TARGET_INFO_NETWORK_METRICS AS netmetricsinfo + ON nmetric.metricsListId == netmetricsinfo.metricsListId + AND nmetric.metricsIdx == netmetricsinfo.metricsIdx + JOIN + ENUM_NET_DEVICE_ID AS deviceid + ON nicinfo.deviceId == deviceid.id + WHERE netmetricsinfo.name == 'IB: Send waits' + AND nmetric.value > {TICKS_THRESHOLD} +""" + + query_ib_switches_congestion = """ + SELECT + smetric.start AS start, + smetric.end AS end, + smetric.end - smetric.start AS duration, + smetric.value AS value, + smetric.globalId AS guid, + NULL AS label + FROM + NET_IB_SWITCH_METRIC as smetric + JOIN + TARGET_INFO_NETWORK_METRICS AS netmetricsinfo + ON smetric.metricsListId == netmetricsinfo.metricsListId + AND smetric.metricsIdx == netmetricsinfo.metricsIdx + WHERE netmetricsinfo.name == 'IB: Send waits' + AND smetric.value > {TICKS_THRESHOLD} +""" + + query_union = """ + UNION ALL +""" + + _arg_opts = [ + [ + ["ticks_threshold"], + { + "type": int, + "help": "ticks threshold", + "default": DEFAULT_TICKS_THRESHOLD, + }, + ], + ] + + def check_table_existence(self, tables): + for table_title, message in tables.items(): + if not self.table_exists(table_title): + return False, message + return True, "" + + def setup(self): + err = super().setup() + if err is not None: + return err + + sub_queries = [] + + if self.table_exists("NET_NIC_METRIC"): + table_checks = { + "ENUM_NET_DEVICE_ID": "{DBFILE} does not contain network device IDs.", + "NIC_ID_MAP": "{DBFILE} does not contain NIC ID map.", + "TARGET_INFO_NETWORK_METRICS": "{DBFILE} file does not contain network metrics information table.", + "TARGET_INFO_NIC_INFO": "{DBFILE} does not contain NIC info data.", + } + tables_exist, message = self.check_table_existence(table_checks) + if not tables_exist: + return message + + sub_queries.append( + self.query_nics_congestion.format( + TICKS_THRESHOLD=self.parsed_args.ticks_threshold + ) + ) + + if self.table_exists("NET_IB_SWITCH_METRIC"): + table_checks = { + "TARGET_INFO_NETWORK_METRICS": "{DBFILE} file does not contain network metrics information table." + } + tables_exist, message = self.check_table_existence(table_checks) + if not tables_exist: + return message + + sub_queries.append( + self.query_ib_switches_congestion.format( + TICKS_THRESHOLD=self.parsed_args.ticks_threshold + ) + ) + + if len(sub_queries) == 0: + return "{DBFILE} does not contain NIC or IB switch metrics." + + self.query = self.query_stub.format( + NETWORKING_SUBQUERY=self.query_union.join(sub_queries) + ) + + +if __name__ == "__main__": + NetworkDevicesCongestion.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtx_gpu_proj_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtx_gpu_proj_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..1315e76e08a8cbb9b4a36999ce7fdacc8f190f83 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtx_gpu_proj_sum.py @@ -0,0 +1,369 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +# This report is basically "nvtx_gpu_proj_trace" with a GROUP BY added to the end. + +import nsysstats + +class NvtxGpuProjSum(nsysstats.StatsReport): + + EVENT_TYPE_NVTX_DOMAIN_CREATE = 75 + EVENT_TYPE_NVTX_PUSHPOP_RANGE = 59 + EVENT_TYPE_NVTX_STARTEND_RANGE = 60 + EVENT_TYPE_NVTXT_PUSHPOP_RANGE = 70 + EVENT_TYPE_NVTXT_STARTEND_RANGE = 71 + + display_name = 'NVTX GPU Projection Summary' + usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}} + + No arguments. + + Output: All time values default to nanoseconds + Range : Name of the NVTX range + Style : Range style; Start/End or Push/Pop + Total Proj Time: Total projected time used by all instances + of this range name + Total Range Time: Total original NVTX range time used by + all instances of this range name + Range Instances : Number of instances of this range + Proj Avg : Average projected time for this range + Proj Med : Median projected time for this range + Proj Min : Minimum projected time for this range + Proj Max : Maximum projected time for this range + Proj StdDev : Standard deviation of projected times for this range + Total GPU Ops : Total number of GPU ops + Avg GPU Ops : Average number of GPU ops + Avg Range Lvl : Average range stack depth + Avg Num Child : Average number of children ranges + + This report provides a summary of NVTX time ranges projected from the + CPU to the GPU. Each NVTX range contains one or more GPU operations. A + GPU operation is considered to be "contained" by the NVTX range if the + CUDA API call used to launch the operation is within the NVTX range. + Only ranges that start and end on the same thread are taken into account. + + The projected range will have the start timestamp of the start of the + first enclosed GPU operation and the end timestamp of the end of the + last enclosed GPU operation. This report then summarizes all the range + instances by name and style. Note that in cases when one NVTX range + might enclose another, the time of the child(ren) range(s) is not + subtracted from the parent range. This is because the projected times + may not strictly overlap like the original NVTX range times do. As such, + the total projected time of all ranges might exceed the total sampling + duration. +""" + + statements = [ + +f""" +DROP TABLE IF EXISTS temp.NVTX_EVENTS_MINMAXTS +""", + +f""" +CREATE TEMP TABLE NVTX_EVENTS_MINMAXTS +AS SELECT + min(min(start), min(end)) AS min, + max(max(start), max(end)) AS max +FROM NVTX_EVENTS +WHERE + eventType == {EVENT_TYPE_NVTX_PUSHPOP_RANGE} + OR eventType == {EVENT_TYPE_NVTX_STARTEND_RANGE} + OR eventType == {EVENT_TYPE_NVTXT_PUSHPOP_RANGE} + OR eventType == {EVENT_TYPE_NVTXT_STARTEND_RANGE} +""", + +f""" +DROP TABLE IF EXISTS temp.NVTX_EVENTS_RIDX +""", + +f""" +CREATE VIRTUAL TABLE temp.NVTX_EVENTS_RIDX +USING rtree ( + rangeId, + startTS, + endTS, + +startNS INTEGER, + +endNS INTEGER, + +tid INTEGER, + +name TEXT, + +style TEXT +) +""", + +f""" +INSERT INTO temp.NVTX_EVENTS_RIDX + WITH + domains AS ( + SELECT + min(start), + domainId AS id, + globalTid AS globalTid, + text AS name + FROM + NVTX_EVENTS + WHERE + eventType == {EVENT_TYPE_NVTX_DOMAIN_CREATE} + GROUP BY 2, 3 + ) + SELECT + e.rowid AS rangeId, + rtree_scale(e.start, + (SELECT min FROM temp.NVTX_EVENTS_MINMAXTS), + (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)) AS startTS, + rtree_scale(ifnull(e.end, (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)), + (SELECT min FROM temp.NVTX_EVENTS_MINMAXTS), + (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)) AS endTS, + e.start AS startNS, + ifnull(e.end, (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)) AS endNS, + e.globalTid AS tid, + CASE + WHEN d.name NOT NULL AND sid.value IS NOT NULL + THEN d.name || ':' || sid.value + WHEN d.name NOT NULL AND sid.value IS NULL + THEN d.name || ':' || e.text + WHEN d.name IS NULL AND sid.value NOT NULL + THEN sid.value + ELSE e.text + END AS name, + CASE e.eventType + WHEN {EVENT_TYPE_NVTX_PUSHPOP_RANGE} + THEN 'PushPop' + WHEN {EVENT_TYPE_NVTX_STARTEND_RANGE} + THEN 'StartEnd' + WHEN {EVENT_TYPE_NVTXT_PUSHPOP_RANGE} + THEN 'PushPop' + WHEN {EVENT_TYPE_NVTXT_STARTEND_RANGE} + THEN 'StartEnd' + ELSE 'Unknown' + END AS style + FROM + NVTX_EVENTS AS e + LEFT JOIN + Domains AS d + ON e.domainId == d.id + AND (e.globalTid & 0x0000FFFFFF000000) == (d.globalTid & 0x0000FFFFFF000000) + LEFT JOIN + StringIds AS sid + ON e.textId == sid.id + WHERE + (e.eventType == {EVENT_TYPE_NVTX_PUSHPOP_RANGE} + OR e.eventType == {EVENT_TYPE_NVTX_STARTEND_RANGE} + OR e.eventType == {EVENT_TYPE_NVTXT_PUSHPOP_RANGE} + OR e.eventType == {EVENT_TYPE_NVTXT_STARTEND_RANGE}) + AND e.endGlobalTid IS NULL +""", + +f""" +CREATE TEMP TABLE NVTX_PARENT ( + rangeId INTEGER PRIMARY KEY NOT NULL, + parentId INTEGER, + tightness INTEGER +) +""", + +f""" +INSERT INTO temp.NVTX_PARENT + SELECT + cr.rangeId as cid, + pr.rangeId as pid, + min((cr.startNS - pr.startNS) + (pr.endNS - cr.EndNS)) as tightness + FROM + temp.NVTX_EVENTS_RIDX AS cr + LEFT JOIN + temp.NVTX_EVENTS_RIDX AS pr + ON + pr.rangeId != cr.rangeId + AND pr.startTS <= cr.startTS + AND pr.endTS >= cr.endTS + AND pr.startNS <= cr.startNS + AND pr.endNS >= cr.endNS + AND pr.tid == cr.tid + GROUP BY cid +""", + +f""" +CREATE INDEX IF NOT EXISTS temp.NVTX_PARENT__PARENTID + ON NVTX_PARENT (parentId) +""", + + ] + +# The statement that we technically want is two JOINs for the +# "projection" CTE. However, the optimizer chooses not to use the +# Rtree index without a LEFT JOIN in this query. +# Thus, a LEFT JOIN is used instead of the first JOIN. + query_stub = """ +WITH RECURSIVE + gpuops AS ( + {GPU_OPS_ALL} + ), + tree AS ( + SELECT + p.rangeId AS rangeId, + ':' || CAST(p.rangeId AS TEXT) AS rangeIdHier, + p.parentId AS parentId, + 0 AS level + FROM + temp.NVTX_PARENT AS p + WHERE p.parentId IS NULL + UNION ALL + SELECT + p.rangeId AS rangeId, + tree.rangeIdHier || ':' || CAST(p.rangeId AS TEXT) AS rangeIdHier, + p.parentId AS parentId, + tree.level + 1 AS level + FROM + tree + JOIN + temp.NVTX_PARENT AS p + ON p.parentId == tree.rangeId + ), + projection AS ( + SELECT + rt.name AS name, + rt.style AS style, + rt.rangeId AS rangeId, + rt.startNS AS nvtxStart, + rt.endNS - rt.startNS AS nvtxDuration, + min(op.start) AS projStart, + max(op.end) - min(op.start) AS projDuration, + count(DISTINCT r.correlationId) AS opNb, + (r.globalTid >> 24) & 0x00FFFFFF AS pid, + r.globalTid & 0x00FFFFFF AS tid + FROM + gpuops AS op + JOIN + CUPTI_ACTIVITY_KIND_RUNTIME AS r + ON op.correlationId == r.correlationId + AND op.globalPid == (r.globalTid & 0xFFFFFFFFFF000000) + LEFT JOIN + temp.NVTX_EVENTS_RIDX AS rt + ON rt.startTS <= rtree_scale(r.start, + (SELECT min FROM temp.NVTX_EVENTS_MINMAXTS), + (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)) + AND rt.endTS >= rtree_scale(r.end, + (SELECT min FROM temp.NVTX_EVENTS_MINMAXTS), + (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)) + AND rt.startNS <= r.start + AND rt.endNS >= r.end + AND rt.tid == r.globalTid + GROUP BY rt.rangeId + ), + child AS ( + SELECT + parentId, + count(parentId) AS childNb + FROM + projection AS proj + JOIN + temp.NVTX_PARENT AS parent + ON parent.rangeId == proj.rangeId + GROUP BY parentId + ), + trace AS ( + SELECT + p.name AS name, + -- p.projStart AS projStart, + p.projDuration AS projDuration, + -- p.nvtxStart AS nvtxStart, + p.nvtxDuration AS nvtxDuration, + p.style AS style, + -- p.pid AS pid, + -- p.tid AS tid, + p.opNb AS opNb, + t.level AS level, + ifnull(c.childNb, 0) AS childNb + -- p.rangeId AS rangeId, + -- t.parentId AS parentId, + -- t.rangeIdHier AS rangeIdHier + FROM + projection AS p + LEFT JOIN + tree AS t + ON t.rangeId == p.rangeId + LEFT JOIN + child AS c + ON c.parentId == p.rangeId + ) +SELECT + name AS "Range", + style AS "Style", + sum(projDuration) AS "Total Proj Time:dur_ns", + sum(nvtxDuration) AS "Total Range Time:dur_ns", + count(*) AS "Range Instances", + round(avg(projDuration), 1) AS "Proj Avg:dur_ns", + round(median(projDuration), 1) AS "Proj Med:dur_ns", + min(projDuration) AS "Proj Min:dur_ns", + max(projDuration) AS "Proj Max:dur_ns", + round(stdev(projDuration), 1) AS "Proj StdDev:dur_ns", + sum(opNb) AS "Total GPU Ops", + round(avg(opNb), 1) AS "Avg GPU Ops", + round(avg(level), 1) AS "Avg Range Lvl", + round(avg(childNb), 1) AS "Avg Num Child" +FROM + trace +WHERE name IS NOT NULL +GROUP BY 1, 2 +ORDER BY 3 DESC +""" + + query_select = """ +SELECT + start, + end, + correlationId, + globalPid +FROM + {GPU_OPERATION} +""" + + query_union = """ +UNION ALL +""" + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.', + 'NVTX_EVENTS': + "{DBFILE} does not contain NV Tools Extension (NVTX) data.", + 'CUPTI_ACTIVITY_KIND_RUNTIME': + "{DBFILE} does not contain CUDA API data." + } + + def setup(self): + err = super().setup() + if err != None: + return err + + sub_queries = [] + + kernel = 'CUPTI_ACTIVITY_KIND_KERNEL' + memcpy = 'CUPTI_ACTIVITY_KIND_MEMCPY' + memset = 'CUPTI_ACTIVITY_KIND_MEMSET' + + if self.table_exists(kernel): + sub_queries.append(self.query_select.format(GPU_OPERATION = kernel)) + + if self.table_exists(memcpy): + sub_queries.append(self.query_select.format(GPU_OPERATION = memcpy)) + + if self.table_exists(memset): + sub_queries.append(self.query_select.format(GPU_OPERATION = memset)) + + if len(sub_queries) == 0: + return "{DBFILE} does not contain GPU operation data." + + union = self.query_union.join(sub_queries) + + self.query = self.query_stub.format(GPU_OPS_ALL = union) + +if __name__ == "__main__": + NvtxGpuProjSum.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtx_gpu_proj_trace.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtx_gpu_proj_trace.py new file mode 100644 index 0000000000000000000000000000000000000000..bdc6c4e637c21530ec84d839d5722ab57979a02f --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtx_gpu_proj_trace.py @@ -0,0 +1,338 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class NvtxGpuProjTrace(nsysstats.StatsReport): + + EVENT_TYPE_NVTX_DOMAIN_CREATE = 75 + EVENT_TYPE_NVTX_PUSHPOP_RANGE = 59 + EVENT_TYPE_NVTX_STARTEND_RANGE = 60 + EVENT_TYPE_NVTXT_PUSHPOP_RANGE = 70 + EVENT_TYPE_NVTXT_STARTEND_RANGE = 71 + + display_name = 'NVTX GPU Projection Trace' + usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}} + + No arguments. + + Output: All time values default to nanoseconds + Name : Name of the NVTX range + Projected Start : Projected range start timestamp + Projected Duration : Projected range duration + Orig Start : Original NVTX range start timestamp + Orig Duration : Original NVTX range duration + Style : Range style; Start/End or Push/Pop + PID : Process ID + TID : Thread ID + NumGPUOps : Number of enclosed GPU operations + Lvl : Stack level, starts at 0 + NumChild : Number of children ranges + RangeId : Arbitrary ID for range + ParentId : Range ID of the enclosing range + RangeStack : Range IDs that make up the push/pop stack + + This report provides a trace of NVTX time ranges projected from the CPU + onto the GPU. Each NVTX range contains one or more GPU operations. A GPU + operation is considered to be "contained" by an NVTX range if the CUDA API + call used to launch the operation is within the NVTX range. Only ranges + that start and end on the same thread are taken into account. + + The projected range will have the start timestamp of the first enclosed GPU + operation and the end timestamp of the last enclosed GPU operation, as well + as the stack state and relationship to other NVTX ranges. +""" + + statements = [ + +f""" +DROP TABLE IF EXISTS temp.NVTX_EVENTS_MINMAXTS +""", + +f""" +CREATE TEMP TABLE NVTX_EVENTS_MINMAXTS +AS SELECT + min(min(start), min(end)) AS min, + max(max(start), max(end)) AS max +FROM NVTX_EVENTS +WHERE + eventType == {EVENT_TYPE_NVTX_PUSHPOP_RANGE} + OR eventType == {EVENT_TYPE_NVTX_STARTEND_RANGE} + OR eventType == {EVENT_TYPE_NVTXT_PUSHPOP_RANGE} + OR eventType == {EVENT_TYPE_NVTXT_STARTEND_RANGE} +""", + +f""" +DROP TABLE IF EXISTS temp.NVTX_EVENTS_RIDX +""", + +f""" +CREATE VIRTUAL TABLE temp.NVTX_EVENTS_RIDX +USING rtree ( + rangeId, + startTS, + endTS, + +startNS INTEGER, + +endNS INTEGER, + +tid INTEGER, + +name TEXT, + +style TEXT +) +""", + +f""" +INSERT INTO temp.NVTX_EVENTS_RIDX + WITH + domains AS ( + SELECT + min(start), + domainId AS id, + globalTid AS globalTid, + text AS name + FROM + NVTX_EVENTS + WHERE + eventType == {EVENT_TYPE_NVTX_DOMAIN_CREATE} + GROUP BY 2, 3 + ) + SELECT + e.rowid AS rangeId, + rtree_scale(e.start, + (SELECT min FROM temp.NVTX_EVENTS_MINMAXTS), + (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)) AS startTS, + rtree_scale(ifnull(e.end, (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)), + (SELECT min FROM temp.NVTX_EVENTS_MINMAXTS), + (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)) AS endTS, + e.start AS startNS, + ifnull(e.end, (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)) AS endNS, + e.globalTid AS tid, + CASE + WHEN d.name NOT NULL AND sid.value IS NOT NULL + THEN d.name || ':' || sid.value + WHEN d.name NOT NULL AND sid.value IS NULL + THEN d.name || ':' || e.text + WHEN d.name IS NULL AND sid.value NOT NULL + THEN sid.value + ELSE e.text + END AS name, + CASE e.eventType + WHEN {EVENT_TYPE_NVTX_PUSHPOP_RANGE} + THEN 'PushPop' + WHEN {EVENT_TYPE_NVTX_STARTEND_RANGE} + THEN 'StartEnd' + WHEN {EVENT_TYPE_NVTXT_PUSHPOP_RANGE} + THEN 'PushPop' + WHEN {EVENT_TYPE_NVTXT_STARTEND_RANGE} + THEN 'StartEnd' + ELSE 'Unknown' + END AS style + FROM + NVTX_EVENTS AS e + LEFT JOIN + Domains AS d + ON e.domainId == d.id + AND (e.globalTid & 0x0000FFFFFF000000) == (d.globalTid & 0x0000FFFFFF000000) + LEFT JOIN + StringIds AS sid + ON e.textId == sid.id + WHERE + (e.eventType == {EVENT_TYPE_NVTX_PUSHPOP_RANGE} + OR e.eventType == {EVENT_TYPE_NVTX_STARTEND_RANGE} + OR e.eventType == {EVENT_TYPE_NVTXT_PUSHPOP_RANGE} + OR e.eventType == {EVENT_TYPE_NVTXT_STARTEND_RANGE}) + AND e.endGlobalTid IS NULL +""", + +f""" +CREATE TEMP TABLE NVTX_PARENT ( + rangeId INTEGER PRIMARY KEY NOT NULL, + parentId INTEGER, + tightness INTEGER +) +""", + +f""" +INSERT INTO temp.NVTX_PARENT + SELECT + cr.rangeId as cid, + pr.rangeId as pid, + min((cr.startNS - pr.startNS) + (pr.endNS - cr.EndNS)) as tightness + FROM + temp.NVTX_EVENTS_RIDX AS cr + LEFT JOIN + temp.NVTX_EVENTS_RIDX AS pr + ON + pr.rangeId != cr.rangeId + AND pr.startTS <= cr.startTS + AND pr.endTS >= cr.endTS + AND pr.startNS <= cr.startNS + AND pr.endNS >= cr.endNS + AND pr.tid == cr.tid + GROUP BY cid +""", + +f""" +CREATE INDEX IF NOT EXISTS temp.NVTX_PARENT__PARENTID + ON NVTX_PARENT (parentId) +""", + + ] + +# The statement that we technically want is two JOINs for the +# "projection" CTE. However, the optimizer chooses not to use the +# Rtree index without a LEFT JOIN in this query. +# Thus, a LEFT JOIN is used instead of the first JOIN. + query_stub = """ +WITH RECURSIVE + gpuops AS ( + {GPU_OPS_ALL} + ), + tree AS ( + SELECT + p.rangeId AS rangeId, + ':' || CAST(p.rangeId AS TEXT) AS rangeIdHier, + p.parentId AS parentId, + 0 AS level + FROM + temp.NVTX_PARENT AS p + WHERE p.parentId IS NULL + UNION ALL + SELECT + p.rangeId AS rangeId, + tree.rangeIdHier || ':' || CAST(p.rangeId AS TEXT) AS rangeIdHier, + p.parentId AS parentId, + tree.level + 1 AS level + FROM + tree + JOIN + temp.NVTX_PARENT AS p + ON p.parentId == tree.rangeId + ), + projection AS ( + SELECT + rt.name AS name, + rt.style AS style, + rt.rangeId AS rangeId, + rt.startNS AS nvtxStart, + rt.endNS - rt.startNS AS nvtxDuration, + min(op.start) AS projStart, + max(op.end) - min(op.start) AS projDuration, + count(DISTINCT r.correlationId) AS opNb, + (r.globalTid >> 24) & 0x00FFFFFF AS pid, + r.globalTid & 0x00FFFFFF AS tid + FROM + gpuops AS op + JOIN + CUPTI_ACTIVITY_KIND_RUNTIME AS r + ON op.correlationId == r.correlationId + AND op.globalPid == (r.globalTid & 0xFFFFFFFFFF000000) + LEFT JOIN + temp.NVTX_EVENTS_RIDX AS rt + ON rt.startTS <= rtree_scale(r.start, + (SELECT min FROM temp.NVTX_EVENTS_MINMAXTS), + (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)) + AND rt.endTS >= rtree_scale(r.end, + (SELECT min FROM temp.NVTX_EVENTS_MINMAXTS), + (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)) + AND rt.startNS <= r.start + AND rt.endNS >= r.end + AND rt.tid == r.globalTid + GROUP BY rt.rangeId + ), + child AS ( + SELECT + parentId, + count(parentId) AS childNb + FROM + projection AS proj + JOIN + temp.NVTX_PARENT AS parent + ON parent.rangeId == proj.rangeId + GROUP BY parentId + ) +SELECT + p.name AS "Name", + p.projStart AS "Projected Start:ts_ns", + p.projDuration AS "Projected Duration:dur_ns", + p.nvtxStart AS "Orig Start:ts_ns", + p.nvtxDuration AS "Orig Duration:dur_ns", + p.style AS "Style", + p.pid AS "PID", + p.tid AS "TID", + p.opNb AS "NumGPUOps", + t.level AS "Lvl", + ifnull(c.childNb, 0) AS "NumChild", + p.rangeId AS "RangeId", + t.parentId AS "ParentId", + t.rangeIdHier AS "RangeStack" +FROM + projection AS p +LEFT JOIN + tree AS t + ON t.rangeId == p.rangeId +LEFT JOIN + child AS c + ON c.parentId == p.rangeId +ORDER BY "Projected Start", "Projected Duration" DESC +""" + + query_select = """ +SELECT + start, + end, + correlationId, + globalPid +FROM + {GPU_OPERATION} +""" + + query_union = """ +UNION ALL +""" + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.', + 'NVTX_EVENTS': + "{DBFILE} does not contain NV Tools Extension (NVTX) data.", + 'CUPTI_ACTIVITY_KIND_RUNTIME': + "{DBFILE} does not contain CUDA API data." + } + + def setup(self): + err = super().setup() + if err != None: + return err + + sub_queries = [] + + kernel = 'CUPTI_ACTIVITY_KIND_KERNEL' + memcpy = 'CUPTI_ACTIVITY_KIND_MEMCPY' + memset = 'CUPTI_ACTIVITY_KIND_MEMSET' + + if self.table_exists(kernel): + sub_queries.append(self.query_select.format(GPU_OPERATION = kernel)) + + if self.table_exists(memcpy): + sub_queries.append(self.query_select.format(GPU_OPERATION = memcpy)) + + if self.table_exists(memset): + sub_queries.append(self.query_select.format(GPU_OPERATION = memset)) + + if len(sub_queries) == 0: + return "{DBFILE} does not contain GPU operation data." + + union = self.query_union.join(sub_queries) + + self.query = self.query_stub.format(GPU_OPS_ALL = union) + +if __name__ == "__main__": + NvtxGpuProjTrace.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtx_kern_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtx_kern_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..efdee05859d92755a6001e706145941744809e96 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtx_kern_sum.py @@ -0,0 +1,259 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class NvtxKernSum(nsysstats.StatsReport): + + EVENT_TYPE_NVTX_DOMAIN_CREATE = 75 + EVENT_TYPE_NVTX_PUSHPOP_RANGE = 59 + EVENT_TYPE_NVTX_STARTEND_RANGE = 60 + EVENT_TYPE_NVTXT_PUSHPOP_RANGE = 70 + EVENT_TYPE_NVTXT_STARTEND_RANGE = 71 + + display_name = 'NVTX Range Kernel Summary' + usage = f"""{{SCRIPT}}[:base|:mangled] -- {{DISPLAY_NAME}} + + base - Optional argument, if given, will cause summary to be over the + base name of the CUDA kernel, rather than the templated name. + + mangled - Optional argument, if given, will cause summary to be over the + raw mangled name of the kernel, rather than the templated name. + + Note: the ability to display mangled names is a recent addition to the + report file format, and requires that the profile data be captured with + a recent version of Nsys. Re-exporting an existing report file is not + sufficient. If the raw, mangled kernel name data is not available, the + default demangled names will be used. + + Output: All time values default to nanoseconds + NVTX Range : Name of the range + Style : Range style; Start/End or Push/Pop + PID : Process ID for this set of ranges and kernels + TID : Thread ID for this set of ranges and kernels + NVTX Inst : Number of NVTX range instances + Kern Inst : Number of CUDA kernel instances + Total Time : Total time used by all kernel instances of this range + Avg : Average execution time of the kernel + Med : Median execution time of the kernel + Min : Smallest execution time of the kernel + Max : Largest execution time of the kernel + StdDev : Standard deviation of the execution time of the kernel + Kernel Name : Name of the kernel + + This report provides a summary of CUDA kernels, grouped by NVTX ranges. To + compute this summary, each kernel is matched to one or more containing NVTX + range in the same process and thread ID. A kernel is considered to be + "contained" by an NVTX range if the CUDA API call used to launch the kernel + is within the NVTX range. The actual execution of the kernel may last + longer than the NVTX range. A specific kernel instance may be associated + with more than one NVTX range if the ranges overlap. For example, if a + kernel is launched inside a stack of push/pop ranges, the kernel is + considered to be "contained" by all of the ranges on the stack, not just + the deepest range. This becomes very confusing if NVTX ranges appear inside + other NVTX ranges of the same name. + + Once each kernel is associated to one or more NVTX range(s), the list of + ranges and kernels grouped by range name, kernel name, and PID/TID. A + summary of the kernel instances and their execution times is then computed. + The "NVTX Inst" column indicates how many NVTX range instances contained + this kernel, while the "Kern Inst" column indicates the number of kernel + instances in the summary line. +""" + + statements = [ + +f""" +DROP TABLE IF EXISTS temp.NVTX_EVENTS_MINMAXTS +""", + +f""" +CREATE TEMP TABLE NVTX_EVENTS_MINMAXTS +AS SELECT + min(min(start), min(end)) AS min, + max(max(start), max(end)) AS max +FROM NVTX_EVENTS +WHERE + eventType == {EVENT_TYPE_NVTX_PUSHPOP_RANGE} + OR eventType == {EVENT_TYPE_NVTX_STARTEND_RANGE} + OR eventType == {EVENT_TYPE_NVTXT_PUSHPOP_RANGE} + OR eventType == {EVENT_TYPE_NVTXT_STARTEND_RANGE} +""", + +f""" +DROP TABLE IF EXISTS temp.NVTX_EVENTS_RIDX +""", + +f""" +CREATE VIRTUAL TABLE temp.NVTX_EVENTS_RIDX +USING rtree ( + rangeId, + startTS, + endTS, + +startNS INTEGER, + +endNS INTEGER, + +tid INTEGER, + +name TEXT, + +style TEXT +) +""", + +f""" +INSERT INTO temp.NVTX_EVENTS_RIDX + WITH + domains AS ( + SELECT + min(start), + domainId AS id, + globalTid AS globalTid, + text AS name + FROM + NVTX_EVENTS + WHERE + eventType == {EVENT_TYPE_NVTX_DOMAIN_CREATE} + GROUP BY 2, 3 + ) + SELECT + e.rowid AS rangeId, + rtree_scale(e.start, + (SELECT min FROM temp.NVTX_EVENTS_MINMAXTS), + (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)) AS startTS, + rtree_scale(ifnull(e.end, (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)), + (SELECT min FROM temp.NVTX_EVENTS_MINMAXTS), + (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)) AS endTS, + e.start AS startNS, + ifnull(e.end, (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)) AS endNS, + e.globalTid AS tid, + CASE + WHEN d.name NOT NULL AND sid.value IS NOT NULL + THEN d.name || ':' || sid.value + WHEN d.name NOT NULL AND sid.value IS NULL + THEN d.name || ':' || e.text + WHEN d.name IS NULL AND sid.value NOT NULL + THEN sid.value + ELSE e.text + END AS name, + CASE e.eventType + WHEN {EVENT_TYPE_NVTX_PUSHPOP_RANGE} + THEN 'PushPop' + WHEN {EVENT_TYPE_NVTX_STARTEND_RANGE} + THEN 'StartEnd' + WHEN {EVENT_TYPE_NVTXT_PUSHPOP_RANGE} + THEN 'PushPop' + WHEN {EVENT_TYPE_NVTXT_STARTEND_RANGE} + THEN 'StartEnd' + ELSE 'Unknown' + END AS style + FROM + NVTX_EVENTS AS e + LEFT JOIN + Domains AS d + ON e.domainId == d.id + AND (e.globalTid & 0x0000FFFFFF000000) == (d.globalTid & 0x0000FFFFFF000000) + LEFT JOIN + StringIds AS sid + ON e.textId == sid.id + WHERE ( + e.eventType == {EVENT_TYPE_NVTX_PUSHPOP_RANGE} + OR e.eventType == {EVENT_TYPE_NVTX_STARTEND_RANGE} + OR e.eventType == {EVENT_TYPE_NVTXT_PUSHPOP_RANGE} + OR e.eventType == {EVENT_TYPE_NVTXT_STARTEND_RANGE}) + AND e.endGlobalTid IS NULL +""", + ] + + query_stub = """ +WITH + combo AS ( + SELECT + rt.name AS name, + rt.style AS style, + rt.rangeId AS nvtxid, + k.rowid AS kernid, + k.end - k.start AS kduration, + (r.globalTid >> 24) & 0x00FFFFFF AS pid, + r.globalTid & 0x00FFFFFF AS tid, + namestr.value AS kernName + FROM + CUPTI_ACTIVITY_KIND_KERNEL AS k + LEFT JOIN + StringIds AS namestr + ON namestr.id == coalesce(k.{NAME_COL_NAME}, k.demangledName) + LEFT JOIN + CUPTI_ACTIVITY_KIND_RUNTIME AS r + ON k.correlationId == r.correlationId + AND k.globalPid == (r.globalTid & 0xFFFFFFFFFF000000) + LEFT JOIN + temp.NVTX_EVENTS_RIDX AS rt + ON rt.startTS <= rtree_scale(r.start, + (SELECT min FROM temp.NVTX_EVENTS_MINMAXTS), + (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)) + AND rt.endTS >= rtree_scale(r.end, + (SELECT min FROM temp.NVTX_EVENTS_MINMAXTS), + (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)) + AND rt.startNS <= r.start + AND rt.endNS >= r.end + AND rt.tid == r.globalTid + ) +SELECT + c.name AS "NVTX Range", -- 1 + c.style AS "Style", -- 2 + c.pid AS "PID", -- 3 + c.tid AS "TID", -- 4 + count(DISTINCT c.nvtxid) AS "NVTX Inst", -- 5 + count(DISTINCT c.kernid) AS "Kern Inst", -- 6 + sum(c.kduration) AS "Total Time:dur_ns", -- 7 + round(avg(c.kduration), 1) AS "Avg:dur_ns", -- 8 + round(median(c.kduration), 1) AS "Med:dur_ns", -- 9 + min(c.kduration) AS "Min:dur_ns", -- 10 + max(c.kduration) AS "Max:dur_ns", -- 11 + round(stdev(c.kduration), 1) AS "StdDev:dur_ns", -- 12 + c.kernName AS "Kernel Name" -- 13 +FROM + combo AS c +-- GROUP BY "PID", "TID", "NVTX Range", "Style", "Kernel Name" +GROUP BY 3, 4, 1, 2, 13 +-- ORDER BY "NVTX Range", "PID", "TID", "Total Time" DESC +ORDER BY 1, 3, 4, 7 DESC +""" + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.', + 'NVTX_EVENTS': + "{DBFILE} does not contain NV Tools Extension (NVTX) data.", + 'CUPTI_ACTIVITY_KIND_KERNEL': + "{DBFILE} does not contain CUDA kernel data.", + 'CUPTI_ACTIVITY_KIND_RUNTIME': + "{DBFILE} does not contain CUDA API data.", + } + + _arg_opts = [ + [['base'], {'action': 'store_true'}], + [['mangled'], {'action': 'store_true'}], + ] + + def setup(self): + err = super().setup() + if err != None: + return err + + name_col_name = 'demangledName' + if self.parsed_args.base: + name_col_name = 'shortName' + elif (self.parsed_args.mangled and + self.table_col_exists('CUPTI_ACTIVITY_KIND_KERNEL', 'mangledName')): + name_col_name = 'mangledName' + + self.query = self.query_stub.format(NAME_COL_NAME = name_col_name) + +if __name__ == "__main__": + NvtxKernSum.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtx_pushpop_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtx_pushpop_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..5aa45b75b50e78d5efec7f572f1eecbf9b67e203 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtx_pushpop_sum.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class NvtxPushPopSum(nsysstats.StatsReport): + + EVENT_TYPE_NVTX_DOMAIN_CREATE = 75 + EVENT_TYPE_NVTX_PUSHPOP_RANGE = 59 + EVENT_TYPE_NVTXT_PUSHPOP_RANGE = 70 + + display_name = 'NVTX Push/Pop Range Summary' + usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}} + + No arguments. + + Output: All time values given in nanoseconds + Time : Percentage of "Total Time" + Total Time : Total time used by all instances of this range + Instances : Number of instances of this range + Avg : Average execution time of this range + Med : Median execution time of this range + Min : Smallest execution time of this range + Max : Largest execution time of this range + StdDev : Standard deviation of execution time of this range + Range : Name of the range + + This report provides a summary of NV Tools Extensions Push/Pop Ranges and + their execution times. Note that the "Time" column is calculated + using a summation of the "Total Time" column, and represents that + range's percent of the execution time of the ranges listed, + and not a percentage of the application wall or CPU execution time. +""" + + query = f""" +WITH + domains AS ( + SELECT + min(start), + domainId AS id, + globalTid AS globalTid, + text AS name + FROM + NVTX_EVENTS + WHERE + eventType == {EVENT_TYPE_NVTX_DOMAIN_CREATE} + GROUP BY 2, 3 + ), + maxts AS( + SELECT max(max(start), max(end)) AS m + FROM NVTX_EVENTS + ), + nvtx AS ( + SELECT + coalesce(ne.end, (SELECT m FROM maxts)) - ne.start AS duration, + CASE + WHEN d.name NOT NULL AND sid.value IS NOT NULL + THEN d.name || ':' || sid.value + WHEN d.name NOT NULL AND sid.value IS NULL + THEN d.name || ':' || ne.text + WHEN d.name IS NULL AND sid.value NOT NULL + THEN sid.value + ELSE ne.text + END AS tag + FROM + NVTX_EVENTS AS ne + LEFT OUTER JOIN + domains AS d + ON ne.domainId == d.id + AND (ne.globalTid & 0x0000FFFFFF000000) == (d.globalTid & 0x0000FFFFFF000000) + LEFT OUTER JOIN + StringIds AS sid + ON ne.textId == sid.id + WHERE + ne.eventType == {EVENT_TYPE_NVTX_PUSHPOP_RANGE} + OR + ne.eventType == {EVENT_TYPE_NVTXT_PUSHPOP_RANGE} + ), + summary AS ( + SELECT + tag AS name, + sum(duration) AS total, + count(*) AS num, + avg(duration) AS avg, + median(duration) AS med, + min(duration) AS min, + max(duration) AS max, + stdev(duration) AS stddev + FROM + nvtx + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) + + SELECT + round(total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + total AS "Total Time:dur_ns", + num AS "Instances", + round(avg, 1) AS "Avg:dur_ns", + round(med, 1) AS "Med:dur_ns", + min AS "Min:dur_ns", + max AS "Max:dur_ns", + round(stddev, 1) AS "StdDev:dur_ns", + name AS "Range" + FROM + summary + ORDER BY 2 DESC +; +""" + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.', + 'NVTX_EVENTS': + "{DBFILE} does not contain NV Tools Extension (NVTX) data." + } + +if __name__ == "__main__": + NvtxPushPopSum.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtx_pushpop_trace.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtx_pushpop_trace.py new file mode 100644 index 0000000000000000000000000000000000000000..73aeddb28fae1e94c5819dd2a5fd04d62eb17cf2 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtx_pushpop_trace.py @@ -0,0 +1,303 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class NvtxPushPopTrace(nsysstats.StatsReport): + + EVENT_TYPE_NVTX_DOMAIN_CREATE = 75 + EVENT_TYPE_NVTX_PUSHPOP_RANGE = 59 + EVENT_TYPE_NVTXT_PUSHPOP_RANGE = 70 + + display_name = 'NVTX Push/Pop Range Trace' + usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}} + + No arguments. + + Output: All time values default to nanoseconds + Start : Range start timestamp + End : Range end timestamp + Duration : Range duration + DurChild : Duration of all child ranges + DurNonChild : Duration of this range minus child ranges + Name : Name of the NVTX range + PID : Process ID + TID : Thread ID + Lvl : Stack level, starts at 0 + NumChild : Number of children ranges + RangeId : Arbitrary ID for range + ParentId : Range ID of the enclosing range + RangeStack : Range IDs that make up the push/pop stack + NameTree : Range name prefixed with level indicator + + This report provides a trace of NV Tools Extensions Push/Pop Ranges, + their execution time, stack state, and relationship to other push/pop + ranges. +""" + +# These are the "setup" statements executed before the main query. +# These are not allowed to generate output, other than errors. + + statements = [ + +# First, create a 1D R-Tree index that will hold NVTX timestamps. This will +# be used to figure out which ranges are the children of other ranges. +# The R-Tree uses 32-bit floating point for its dimensional values, so +# we need two copies of the timestamps-- the indexed floating point values +# to get us close, and the exact values to do a final, detailed check. + +f""" +DROP TABLE IF EXISTS temp.NVTX_EVENTS_MINMAXTS +""", + +f""" +CREATE TEMP TABLE NVTX_EVENTS_MINMAXTS +AS SELECT + min(min(start), min(end)) AS min, + max(max(start), max(end)) AS max +FROM NVTX_EVENTS +WHERE + eventType == {EVENT_TYPE_NVTX_PUSHPOP_RANGE} + OR eventType == {EVENT_TYPE_NVTXT_PUSHPOP_RANGE} +""", + +f""" +DROP TABLE IF EXISTS temp.NVTX_EVENTS_RIDX +""", + +f""" +CREATE VIRTUAL TABLE temp.NVTX_EVENTS_RIDX +USING rtree +( + rangeId, + startTS, + endTS, + +startNS INTEGER, + +endNS INTEGER, + +tid INTEGER +) +""", + +# Insert NVTX push/pop range data into the R-Tree index +# Not all NVTX ranges have a valid "end" timestamp, so +# we have to play some games. + +f""" +INSERT INTO temp.NVTX_EVENTS_RIDX + SELECT + e.rowid AS rangeId, + rtree_scale(e.start, + (SELECT min FROM temp.NVTX_EVENTS_MINMAXTS), + (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)) AS startTS, + rtree_scale(ifnull(e.end, (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)), + (SELECT min FROM temp.NVTX_EVENTS_MINMAXTS), + (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)) AS endTS, + e.start AS startNS, + ifnull(e.end, (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)) AS endNS, + e.globalTid AS tid + FROM + NVTX_EVENTS AS e + WHERE + e.eventType == {EVENT_TYPE_NVTX_PUSHPOP_RANGE} + OR e.eventType == {EVENT_TYPE_NVTXT_PUSHPOP_RANGE} +""", + +# Create a temp table to hold the parent relationships. +# We're going to compute and hold some meta-data (such as +# number of children, durations, etc.) as well. + +f""" +CREATE TEMP TABLE NVTX_PARENT ( + rangeId INTEGER PRIMARY KEY NOT NULL, + parentId INTEGER, + duration INTEGER, + childDuration INTEGER, + childNumb INTEGER, + fullname TEXT +) +""", + +# Insert NVTX push/pop range data into the parent table. +# We do an initial insert of all data, and then run an +# update on the parent data, rather than just inserting +# it all at once, so that the table includes root nodes +# that don't have parents. It is easier to deal with it +# here than trying to do an OUTER JOIN with the update. + +f""" +INSERT INTO temp.NVTX_PARENT + WITH + domains AS ( + SELECT + min(start), + domainId AS id, + globalTid AS globalTid, + text AS name + FROM + NVTX_EVENTS + WHERE + eventType == {EVENT_TYPE_NVTX_DOMAIN_CREATE} + GROUP BY 2, 3 + ) + SELECT + e.rowid AS rangeId, + NULL AS parentId, + ifnull(e.end, (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)) - e.start AS duration, + 0 AS childDuration, + 0 AS childNumb, + CASE + WHEN d.name NOT NULL AND sid.value IS NOT NULL + THEN d.name || ':' || sid.value + WHEN d.name NOT NULL AND sid.value IS NULL + THEN d.name || ':' || e.text + WHEN d.name IS NULL AND sid.value NOT NULL + THEN sid.value + ELSE e.text + END AS fullname + FROM + NVTX_EVENTS AS e + LEFT JOIN + domains AS d + ON e.domainId == d.id + AND (e.globalTid & 0x0000FFFFFF000000) == (d.globalTid & 0x0000FFFFFF000000) + LEFT JOIN + StringIds AS sid + ON e.textId == sid.id + WHERE + e.eventType == {EVENT_TYPE_NVTX_PUSHPOP_RANGE} + OR e.eventType == {EVENT_TYPE_NVTXT_PUSHPOP_RANGE} +""", + +# Use the R-Tree to figure out which ranges are children of other ranges. +# This is done by figuring out which range timestamps are "inside" other +# ranges and extracting the "tightest" parent. This tightness is used +# to filter parents from grandparents. This query depends on a documented, +# but non-standard, behavior of SQLite where the min() aggregate call will +# return the whole row that triggers the minimum, including the corresponding +# event IDs. + +f""" +UPDATE temp.NVTX_PARENT SET parentId = child.pid +FROM ( + SELECT + cr.rangeId as cid, + pr.rangeId as pid, + min((cr.startNS - pr.startNS) + (pr.endNS - cr.EndNS)) as tightness + FROM + temp.NVTX_EVENTS_RIDX AS cr + JOIN + temp.NVTX_EVENTS_RIDX AS pr + ON + pr.rangeId != cr.rangeId + AND pr.startTS <= cr.startTS + AND pr.endTS >= cr.endTS + AND pr.startNS <= cr.startNS + AND pr.endNS >= cr.endNS + AND pr.tid == cr.tid + GROUP BY cid +) AS child +WHERE temp.NVTX_PARENT.rangeId = child.cid +""", + +# Update the child duration and count + +f""" +UPDATE temp.NVTX_PARENT + SET (childDuration, childNumb) = (totals.cDur, totals.cNum) +FROM ( + SELECT + parentId AS pId, + total(duration) AS cDur, + count(*) AS cNum + FROM + temp.NVTX_PARENT + GROUP BY 1 +) AS totals +WHERE temp.NVTX_PARENT.rangeId == totals.pId +""", + +# Now that we have our parent data, create an index over the parent ID value. +# When dealing with a fixed data set it is slightly more efficient to create +# the index after all the rows have been inserted. + +f""" +CREATE INDEX IF NOT EXISTS temp.NVTX_PARENT__PARENTID + ON NVTX_PARENT (parentId) +""", + +] # end of statements + +# The actual query uses the table of parents in a recursive CTE to build +# a tree-based query that is aware of what stack level we're on. + + query = f""" +WITH RECURSIVE + tree AS ( + SELECT + p.rangeId AS rangeId, + ':' || CAST(p.rangeId AS TEXT) AS rangeIdHier, + p.parentId AS parentId, + 0 AS level, + '' AS tab + FROM + temp.NVTX_PARENT AS p + WHERE p.parentId IS NULL + + UNION ALL + SELECT + p.rangeId AS rangeId, + tree.rangeIdHier || ':' || CAST(p.rangeId AS TEXT) AS rangeIdHier, + p.parentId AS parentId, + tree.level + 1 AS level, + tree.tab || '--' AS tab + FROM + tree + JOIN + temp.NVTX_PARENT AS p + ON p.parentId == tree.rangeId + + ORDER BY level DESC + ) +SELECT + ne.start AS "Start:ts_ns", + ne.start + p.duration AS "End:ts_ns", + p.duration AS "Duration:dur_ns", + ifnull(p.childDuration, 0) AS "DurChild:dur_ns", + p.duration - ifnull(p.childDuration, 0) AS "DurNonChild:dur_ns", + p.fullname AS "Name", + (ne.globalTid >> 24) & 0x00FFFFFF AS "PID", + ne.globalTid & 0x00FFFFFF AS "TID", + t.level AS "Lvl", + ifnull(p.childNumb, 0) AS "NumChild", + ne.rowid AS "RangeId", + t.parentId AS "ParentId", + t.rangeIdHier AS "RangeStack", + t.tab || p.fullname AS "NameTree" +FROM + NVTX_EVENTS AS ne +JOIN + temp.NVTX_PARENT AS p + ON p.rangeId == ne.rowid +JOIN + tree AS t + ON t.rangeId == ne.rowid +ORDER BY 1, 3 +""" + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.', + 'NVTX_EVENTS': + "{DBFILE} does not contain NV Tools Extension (NVTX) data." + } + +if __name__ == "__main__": + NvtxPushPopTrace.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtx_startend_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtx_startend_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..149e7a5a232b4f2fe38417c9cefd162229b11b26 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtx_startend_sum.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class NvtxStartEndSum(nsysstats.StatsReport): + + EVENT_TYPE_NVTX_DOMAIN_CREATE = 75 + EVENT_TYPE_NVTX_STARTEND_RANGE = 60 + EVENT_TYPE_NVTXT_STARTEND_RANGE = 71 + + display_name = 'NVTX Start/End Range Summary' + usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}} + + No arguments. + + Output: All time values default to nanoseconds + Time : Percentage of "Total Time" + Total Time : Total time used by all instances of this range + Instances : Number of instances of this range + Avg : Average execution time of this range + Med : Median execution time of this range + Min : Smallest execution time of this range + Max : Largest execution time of this range + StdDev : Standard deviation of execution time of this range + Range : Name of the range + + This report provides a summary of NV Tools Extensions Start/End Ranges + and their execution times. Note that the "Time" column is calculated + using a summation of the "Total Time" column, and represents that + range's percent of the execution time of the ranges listed, and not a + percentage of the application wall or CPU execution time. +""" + + query = f""" +WITH + domains AS ( + SELECT + min(start), + domainId AS id, + globalTid AS globalTid, + text AS name + FROM + NVTX_EVENTS + WHERE + eventType == {EVENT_TYPE_NVTX_DOMAIN_CREATE} + GROUP BY 2, 3 + ), + maxts AS( + SELECT max(max(start), max(end)) AS m + FROM NVTX_EVENTS + ), + nvtx AS ( + SELECT + coalesce(ne.end, (SELECT m FROM maxts)) - ne.start AS duration, + CASE + WHEN d.name NOT NULL AND sid.value IS NOT NULL + THEN d.name || ':' || sid.value + WHEN d.name NOT NULL AND sid.value IS NULL + THEN d.name || ':' || ne.text + WHEN d.name IS NULL AND sid.value NOT NULL + THEN sid.value + ELSE ne.text + END AS tag + FROM + NVTX_EVENTS AS ne + LEFT OUTER JOIN + domains AS d + ON ne.domainId == d.id + AND (ne.globalTid & 0x0000FFFFFF000000) == (d.globalTid & 0x0000FFFFFF000000) + LEFT OUTER JOIN + StringIds AS sid + ON ne.textId == sid.id + WHERE + ne.eventType == {EVENT_TYPE_NVTX_STARTEND_RANGE} + OR + ne.eventType == {EVENT_TYPE_NVTXT_STARTEND_RANGE} + ), + summary AS ( + SELECT + tag AS name, + sum(duration) AS total, + count(*) AS num, + avg(duration) AS avg, + median(duration) AS med, + min(duration) AS min, + max(duration) AS max, + stdev(duration) AS stddev + FROM + nvtx + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) + + SELECT + round(total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + total AS "Total Time:dur_ns", + num AS "Instances", + round(avg, 1) AS "Avg:dur_ns", + round(med, 1) AS "Med:dur_ns", + min AS "Min:dur_ns", + max AS "Max:dur_ns", + round(stddev, 1) AS "StdDev:dur_ns", + name AS "Range" + FROM + summary + ORDER BY 2 DESC +; +""" + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.', + 'NVTX_EVENTS': + "{DBFILE} does not contain NV Tools Extension (NVTX) data." + } + +if __name__ == "__main__": + NvtxStartEndSum.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtx_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtx_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..44d1351fb7e51580e93627ce689e93a8163c9e86 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtx_sum.py @@ -0,0 +1,154 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class NvtxSum(nsysstats.StatsReport): + + EVENT_TYPE_NVTX_DOMAIN_CREATE = 75 + EVENT_TYPE_NVTX_PUSHPOP_RANGE = 59 + EVENT_TYPE_NVTX_STARTEND_RANGE = 60 + EVENT_TYPE_NVTXT_PUSHPOP_RANGE = 70 + EVENT_TYPE_NVTXT_STARTEND_RANGE = 71 + + display_name = 'NVTX Range Summary' + usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}} + + No arguments. + + Output: All time values default to nanoseconds + Time : Percentage of "Total Time" + Total Time : Total time used by all instances of this range + Instances : Number of instances of this range + Avg : Average execution time of this range + Med : Median execution time of this range + Min : Smallest execution time of this range + Max : Largest execution time of this range + StdDev : Standard deviation of execution time of this range + Style : Range style; Start/End or Push/Pop + Range : Name of the range + + This report provides a summary of NV Tools Extensions Start/End and + Push/Pop Ranges, and their execution times. Note that the "Time" column + is calculated using a summation of the "Total Time" column, and represents + that range's percent of the execution time of the ranges listed, and not a + percentage of the application wall or CPU execution time. +""" + + query = f""" +WITH + domains AS ( + SELECT + min(start), + domainId AS id, + globalTid AS globalTid, + text AS name + FROM + NVTX_EVENTS + WHERE + eventType == {EVENT_TYPE_NVTX_DOMAIN_CREATE} + GROUP BY 2, 3 + ), + maxts AS( + SELECT max(max(start), max(end)) AS m + FROM NVTX_EVENTS + ), + nvtx AS ( + SELECT + coalesce(ne.end, (SELECT m FROM maxts)) - ne.start AS duration, + CASE + WHEN d.name NOT NULL AND sid.value IS NOT NULL + THEN d.name || ':' || sid.value + WHEN d.name NOT NULL AND sid.value IS NULL + THEN d.name || ':' || ne.text + WHEN d.name IS NULL AND sid.value NOT NULL + THEN sid.value + ELSE ne.text + END AS tag, + CASE ne.eventType + WHEN {EVENT_TYPE_NVTX_PUSHPOP_RANGE} + THEN 'PushPop' + WHEN {EVENT_TYPE_NVTX_STARTEND_RANGE} + THEN 'StartEnd' + WHEN {EVENT_TYPE_NVTXT_PUSHPOP_RANGE} + THEN 'PushPop' + WHEN {EVENT_TYPE_NVTXT_STARTEND_RANGE} + THEN 'StartEnd' + ELSE 'Unknown' + END AS style + FROM + NVTX_EVENTS AS ne + LEFT OUTER JOIN + domains AS d + ON ne.domainId == d.id + AND (ne.globalTid & 0x0000FFFFFF000000) == (d.globalTid & 0x0000FFFFFF000000) + LEFT OUTER JOIN + StringIds AS sid + ON ne.textId == sid.id + WHERE + ne.eventType == {EVENT_TYPE_NVTX_PUSHPOP_RANGE} + OR + ne.eventType == {EVENT_TYPE_NVTX_STARTEND_RANGE} + OR + ne.eventType == {EVENT_TYPE_NVTXT_PUSHPOP_RANGE} + OR + ne.eventType == {EVENT_TYPE_NVTXT_STARTEND_RANGE} + ), + summary AS ( + SELECT + tag AS name, + style AS style, + sum(duration) AS total, + count(*) AS num, + avg(duration) AS avg, + median(duration) AS med, + min(duration) AS min, + max(duration) AS max, + stdev(duration) AS stddev, + lower_quartile(duration) AS q1, + upper_quartile(duration) AS q3 + FROM + nvtx + GROUP BY 1, 2 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) + + SELECT + round(total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + total AS "Total Time:dur_ns", + num AS "Instances", + round(avg, 1) AS "Avg:dur_ns", + round(med, 1) AS "Med:dur_ns", + min AS "Min:dur_ns", + max AS "Max:dur_ns", + round(stddev, 1) AS "StdDev:dur_ns", + style AS "Style", + name AS "Range", + q1 AS "_Q1", + q3 AS "_Q3" + FROM + summary + ORDER BY 2 DESC +; +""" + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.', + 'NVTX_EVENTS': + "{DBFILE} does not contain NV Tools Extension (NVTX) data." + } + +if __name__ == "__main__": + NvtxSum.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtxgpuproj.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtxgpuproj.py new file mode 100644 index 0000000000000000000000000000000000000000..730109d2ac0481c2efd5ef800b5a9f6d233f121d --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtxgpuproj.py @@ -0,0 +1,306 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class NVTXGPUProjection(nsysstats.StatsReport): + + EVENT_TYPE_NVTX_DOMAIN_CREATE = 75 + EVENT_TYPE_NVTX_PUSHPOP_RANGE = 59 + EVENT_TYPE_NVTX_STARTEND_RANGE = 60 + EVENT_TYPE_NVTXT_PUSHPOP_RANGE = 70 + EVENT_TYPE_NVTXT_STARTEND_RANGE = 71 + + display_name = 'DEPRECATED - Use nvtx_gpu_proj_trace instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + statements = [ + +f""" +DROP TABLE IF EXISTS temp.NVTX_EVENTS_RIDX +""", + +f""" +CREATE VIRTUAL TABLE temp.NVTX_EVENTS_RIDX +USING rtree ( + rangeId, + startTS, + endTS, + +startNS INTEGER, + +endNS INTEGER, + +tid INTEGER, + +name TEXT, + +style TEXT +) +""", + +f""" +INSERT INTO temp.NVTX_EVENTS_RIDX + WITH + maxts AS( + SELECT max(max(start), max(end)) AS m + FROM NVTX_EVENTS + ), + domains AS ( + SELECT + min(start), + domainId AS id, + globalTid AS globalTid, + text AS name + FROM + NVTX_EVENTS + WHERE + eventType == {EVENT_TYPE_NVTX_DOMAIN_CREATE} + GROUP BY 2, 3 + ) + SELECT + e.rowid AS rangeId, + e.start AS startTS, + ifnull(e.end, (SELECT m FROM maxts)) AS endTS, + e.start AS startNS, + ifnull(e.end, (SELECT m FROM maxts)) AS endNS, + e.globalTid AS tid, + CASE + WHEN d.name NOT NULL AND sid.value IS NOT NULL + THEN d.name || ':' || sid.value + WHEN d.name NOT NULL AND sid.value IS NULL + THEN d.name || ':' || e.text + WHEN d.name IS NULL AND sid.value NOT NULL + THEN sid.value + ELSE e.text + END AS name, + CASE e.eventType + WHEN {EVENT_TYPE_NVTX_PUSHPOP_RANGE} + THEN 'PushPop' + WHEN {EVENT_TYPE_NVTX_STARTEND_RANGE} + THEN 'StartEnd' + WHEN {EVENT_TYPE_NVTXT_PUSHPOP_RANGE} + THEN 'PushPop' + WHEN {EVENT_TYPE_NVTXT_STARTEND_RANGE} + THEN 'StartEnd' + ELSE 'Unknown' + END AS style + FROM + NVTX_EVENTS AS e + LEFT JOIN + Domains AS d + ON e.domainId == d.id + AND (e.globalTid & 0x0000FFFFFF000000) == (d.globalTid & 0x0000FFFFFF000000) + LEFT JOIN + StringIds AS sid + ON e.textId == sid.id + WHERE + (e.eventType == {EVENT_TYPE_NVTX_PUSHPOP_RANGE} + OR e.eventType == {EVENT_TYPE_NVTX_STARTEND_RANGE} + OR e.eventType == {EVENT_TYPE_NVTXT_PUSHPOP_RANGE} + OR e.eventType == {EVENT_TYPE_NVTXT_STARTEND_RANGE}) + AND e.endGlobalTid IS NULL +""", + +f""" +CREATE TEMP TABLE NVTX_PARENT ( + rangeId INTEGER PRIMARY KEY NOT NULL, + parentId INTEGER +) +""", + +f""" +INSERT INTO temp.NVTX_PARENT + SELECT + e.rowid AS rangeId, + NULL AS parentId + FROM + NVTX_EVENTS AS e + WHERE ( + e.eventType == {EVENT_TYPE_NVTX_PUSHPOP_RANGE} + OR e.eventType == {EVENT_TYPE_NVTX_STARTEND_RANGE} + OR e.eventType == {EVENT_TYPE_NVTXT_PUSHPOP_RANGE} + OR e.eventType == {EVENT_TYPE_NVTXT_STARTEND_RANGE}) + AND e.endGlobalTid IS NULL +""", + +f""" +WITH + par AS ( + SELECT + cr.rangeId as cid, + pr.rangeId as pid, + min((cr.startNS - pr.startNS) + (pr.endNS - cr.EndNS)) as tightness + FROM + temp.NVTX_EVENTS_RIDX AS cr + JOIN + temp.NVTX_EVENTS_RIDX AS pr + ON + pr.rangeId != cr.rangeId + AND pr.startTS <= cr.startTS + AND pr.endTS >= cr.endTS + AND pr.startNS <= cr.startNS + AND pr.endNS >= cr.endNS + AND pr.tid == cr.tid + GROUP BY cid + ) +UPDATE temp.NVTX_PARENT + SET parentId == (SELECT pid FROM par WHERE rangeId == par.cid) +""", + +f""" +CREATE INDEX IF NOT EXISTS temp.NVTX_PARENT__PARENTID + ON NVTX_PARENT (parentId) +""", + + ] + +# The statement that we technically want is two JOINs for the +# "projection" CTE. However, the optimizer chooses not to use the +# Rtree index without a LEFT JOIN in this query. +# Thus, a LEFT JOIN is used instead of the first JOIN. + query_stub = """ +WITH RECURSIVE + gpuops AS ( + {GPU_OPS_ALL} + ), + tree AS ( + SELECT + p.rangeId AS rangeId, + ':' || CAST(p.rangeId AS TEXT) AS rangeIdHier, + p.parentId AS parentId, + 0 AS level + FROM + temp.NVTX_PARENT AS p + WHERE p.parentId IS NULL + UNION ALL + SELECT + p.rangeId AS rangeId, + tree.rangeIdHier || ':' || CAST(p.rangeId AS TEXT) AS rangeIdHier, + p.parentId AS parentId, + tree.level + 1 AS level + FROM + tree + JOIN + temp.NVTX_PARENT AS p + ON p.parentId == tree.rangeId + ), + projection AS ( + SELECT + rt.name AS name, + rt.style AS style, + rt.rangeId AS rangeId, + rt.startNS AS nvtxStart, + rt.endNS - rt.startNS AS nvtxDuration, + min(op.start) AS projStart, + max(op.end) - min(op.start) AS projDuration, + count(DISTINCT r.correlationId) AS opNb, + (r.globalTid >> 24) & 0x00FFFFFF AS pid, + r.globalTid & 0x00FFFFFF AS tid + FROM + gpuops AS op + LEFT JOIN + CUPTI_ACTIVITY_KIND_RUNTIME AS r + ON op.correlationId == r.correlationId + AND op.globalPid == (r.globalTid & 0xFFFFFFFFFF000000) + JOIN + temp.NVTX_EVENTS_RIDX AS rt + ON rt.startTS <= r.start + AND rt.endTS >= r.end + AND rt.startNS <= r.start + AND rt.endNS >= r.end + AND rt.tid == r.globalTid + GROUP BY rt.rangeId + ), + child AS ( + SELECT + parentId, + count(parentId) AS childNb + FROM + projection AS proj + JOIN + temp.NVTX_PARENT AS parent + ON parent.rangeId == proj.rangeId + GROUP BY parentId + ) +SELECT + p.name AS "Name", + p.projStart AS "Projected Start:ts_ns", + p.projDuration AS "Projected Duration:dur_ns", + p.nvtxStart AS "Orig Start:ts_ns", + p.nvtxDuration AS "Orig Duration:dur_ns", + p.style AS "Style", + p.pid AS "PID", + p.tid AS "TID", + p.opNb AS "NumGPUOps", + t.level AS "Lvl", + ifnull(c.childNb, 0) AS "NumChild", + p.rangeId AS "RangeId", + t.parentId AS "ParentId", + t.rangeIdHier AS "RangeStack" +FROM + projection AS p +LEFT JOIN + tree AS t + ON t.rangeId == p.rangeId +LEFT JOIN + child AS c + ON c.parentId == p.rangeId +ORDER BY "Projected Start", "Projected Duration" DESC +""" + + query_select = """ +SELECT + start, + end, + correlationId, + globalPid +FROM + {GPU_OPERATION} +""" + + query_union = """ +UNION ALL +""" + + table_checks = { + 'NVTX_EVENTS': + "{DBFILE} does not contain NV Tools Extension (NVTX) data.", + 'CUPTI_ACTIVITY_KIND_RUNTIME': + "{DBFILE} does not contain CUDA API data." + } + + def setup(self): + err = super().setup() + if err != None: + return err + + sub_queries = [] + + kernel = 'CUPTI_ACTIVITY_KIND_KERNEL' + memcpy = 'CUPTI_ACTIVITY_KIND_MEMCPY' + memset = 'CUPTI_ACTIVITY_KIND_MEMSET' + + if self.table_exists(kernel): + sub_queries.append(self.query_select.format(GPU_OPERATION = kernel)) + + if self.table_exists(memcpy): + sub_queries.append(self.query_select.format(GPU_OPERATION = memcpy)) + + if self.table_exists(memset): + sub_queries.append(self.query_select.format(GPU_OPERATION = memset)) + + if len(sub_queries) == 0: + return "{DBFILE} does not contain GPU operation data." + + union = self.query_union.join(sub_queries) + + self.query = self.query_stub.format(GPU_OPS_ALL = union) + +if __name__ == "__main__": + NVTXGPUProjection.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtxkernsum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtxkernsum.py new file mode 100644 index 0000000000000000000000000000000000000000..ad99d8917618b3e4412d77a623488ef0edb7cdd7 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtxkernsum.py @@ -0,0 +1,191 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class NVTXKernSummary(nsysstats.StatsReport): + + EVENT_TYPE_NVTX_DOMAIN_CREATE = 75 + EVENT_TYPE_NVTX_PUSHPOP_RANGE = 59 + EVENT_TYPE_NVTX_STARTEND_RANGE = 60 + EVENT_TYPE_NVTXT_PUSHPOP_RANGE = 70 + EVENT_TYPE_NVTXT_STARTEND_RANGE = 71 + + display_name = 'DEPRECATED - Use nvtx_kern_sum instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + statements = [ + +f""" +DROP TABLE IF EXISTS temp.NVTX_EVENTS_RIDX +""", + +f""" +CREATE VIRTUAL TABLE temp.NVTX_EVENTS_RIDX +USING rtree ( + rangeId, + startTS, + endTS, + +startNS INTEGER, + +endNS INTEGER, + +tid INTEGER, + +name TEXT, + +style TEXT +) +""", + +f""" +INSERT INTO temp.NVTX_EVENTS_RIDX + WITH + maxts AS( + SELECT max(max(start), max(end)) AS m + FROM NVTX_EVENTS + ), + domains AS ( + SELECT + min(start), + domainId AS id, + globalTid AS globalTid, + text AS name + FROM + NVTX_EVENTS + WHERE + eventType == {EVENT_TYPE_NVTX_DOMAIN_CREATE} + GROUP BY 2, 3 + ) + SELECT + e.rowid AS rangeId, + e.start AS startTS, + ifnull(e.end, (SELECT m FROM maxts)) AS endTS, + e.start AS startNS, + ifnull(e.end, (SELECT m FROM maxts)) AS endNS, + e.globalTid AS tid, + CASE + WHEN d.name NOT NULL AND sid.value IS NOT NULL + THEN d.name || ':' || sid.value + WHEN d.name NOT NULL AND sid.value IS NULL + THEN d.name || ':' || e.text + WHEN d.name IS NULL AND sid.value NOT NULL + THEN sid.value + ELSE e.text + END AS name, + CASE e.eventType + WHEN {EVENT_TYPE_NVTX_PUSHPOP_RANGE} + THEN 'PushPop' + WHEN {EVENT_TYPE_NVTX_STARTEND_RANGE} + THEN 'StartEnd' + WHEN {EVENT_TYPE_NVTXT_PUSHPOP_RANGE} + THEN 'PushPop' + WHEN {EVENT_TYPE_NVTXT_STARTEND_RANGE} + THEN 'StartEnd' + ELSE 'Unknown' + END AS style + FROM + NVTX_EVENTS AS e + LEFT JOIN + Domains AS d + ON e.domainId == d.id + AND (e.globalTid & 0x0000FFFFFF000000) == (d.globalTid & 0x0000FFFFFF000000) + LEFT JOIN + StringIds AS sid + ON e.textId == sid.id + WHERE ( + e.eventType == {EVENT_TYPE_NVTX_PUSHPOP_RANGE} + OR e.eventType == {EVENT_TYPE_NVTX_STARTEND_RANGE} + OR e.eventType == {EVENT_TYPE_NVTXT_PUSHPOP_RANGE} + OR e.eventType == {EVENT_TYPE_NVTXT_STARTEND_RANGE}) + AND e.endGlobalTid IS NULL +""", + ] + + query_stub = """ +WITH + combo AS ( + SELECT + rt.name AS name, + rt.style AS style, + rt.rangeId AS nvtxid, + k.rowid AS kernid, + k.end - k.start AS kduration, + (r.globalTid >> 24) & 0x00FFFFFF AS pid, + r.globalTid & 0x00FFFFFF AS tid, + namestr.value AS kernName + FROM + CUPTI_ACTIVITY_KIND_KERNEL AS k + LEFT JOIN + StringIds AS namestr + ON namestr.id == coalesce(k.{NAME_COL_NAME}, k.demangledName) + LEFT JOIN + CUPTI_ACTIVITY_KIND_RUNTIME AS r + ON k.correlationId == r.correlationId + AND k.globalPid == (r.globalTid & 0xFFFFFFFFFF000000) + LEFT JOIN + temp.NVTX_EVENTS_RIDX AS rt + ON rt.startTS <= r.start + AND rt.endTS >= r.end + AND rt.startNS <= r.start + AND rt.endNS >= r.end + AND rt.tid == r.globalTid + ) +SELECT + c.name AS "NVTX Range", -- 1 + c.style AS "Style", -- 2 + c.pid AS "PID", -- 3 + c.tid AS "TID", -- 4 + count(DISTINCT c.nvtxid) AS "NVTX Inst", -- 5 + count(DISTINCT c.kernid) AS "Kern Inst", -- 6 + sum(c.kduration) AS "Total Time:dur_ns", -- 7 + round(avg(c.kduration), 1) AS "Avg:dur_ns", -- 8 + round(median(c.kduration), 1) AS "Med:dur_ns", -- 9 + min(c.kduration) AS "Min:dur_ns", -- 10 + max(c.kduration) AS "Max:dur_ns", -- 11 + round(stdev(c.kduration), 1) AS "StdDev:dur_ns", -- 12 + c.kernName AS "Kernel Name" -- 13 +FROM + combo AS c +-- GROUP BY "PID", "TID", "NVTX Range", "Style", "Kernel Name" +GROUP BY 3, 4, 1, 2, 13 +-- ORDER BY "NVTX Range", "PID", "TID", "Total Time" DESC +ORDER BY 1, 3, 4, 7 DESC +""" + + table_checks = { + 'NVTX_EVENTS': + "{DBFILE} does not contain NV Tools Extension (NVTX) data.", + 'CUPTI_ACTIVITY_KIND_KERNEL': + "{DBFILE} does not contain CUDA kernel data.", + 'CUPTI_ACTIVITY_KIND_RUNTIME': + "{DBFILE} does not contain CUDA API data.", + } + + _arg_opts = [ + [['base'], {'action': 'store_true'}], + [['mangled'], {'action': 'store_true'}], + ] + + def setup(self): + err = super().setup() + if err != None: + return err + + name_col_name = 'demangledName' + if self.parsed_args.base: + name_col_name = 'shortName' + elif (self.parsed_args.mangled and + self.table_col_exists('CUPTI_ACTIVITY_KIND_KERNEL', 'mangledName')): + name_col_name = 'mangledName' + + self.query = self.query_stub.format(NAME_COL_NAME = name_col_name) + +if __name__ == "__main__": + NVTXKernSummary.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtxppsum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtxppsum.py new file mode 100644 index 0000000000000000000000000000000000000000..f730aabe2b5ff3777de277806aae8df991666518 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtxppsum.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class NVTXPushPopSummary(nsysstats.StatsReport): + + EVENT_TYPE_NVTX_DOMAIN_CREATE = 75 + EVENT_TYPE_NVTX_PUSHPOP_RANGE = 59 + EVENT_TYPE_NVTXT_PUSHPOP_RANGE = 70 + + display_name = 'DEPRECATED - Use nvtx_pushpop_sum instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query = f""" +WITH + domains AS ( + SELECT + min(start), + domainId AS id, + globalTid AS globalTid, + text AS name + FROM + NVTX_EVENTS + WHERE + eventType == {EVENT_TYPE_NVTX_DOMAIN_CREATE} + GROUP BY 2, 3 + ), + maxts AS( + SELECT max(max(start), max(end)) AS m + FROM NVTX_EVENTS + ), + nvtx AS ( + SELECT + coalesce(ne.end, (SELECT m FROM maxts)) - ne.start AS duration, + CASE + WHEN d.name NOT NULL AND sid.value IS NOT NULL + THEN d.name || ':' || sid.value + WHEN d.name NOT NULL AND sid.value IS NULL + THEN d.name || ':' || ne.text + WHEN d.name IS NULL AND sid.value NOT NULL + THEN sid.value + ELSE ne.text + END AS tag + FROM + NVTX_EVENTS AS ne + LEFT OUTER JOIN + domains AS d + ON ne.domainId == d.id + AND (ne.globalTid & 0x0000FFFFFF000000) == (d.globalTid & 0x0000FFFFFF000000) + LEFT OUTER JOIN + StringIds AS sid + ON ne.textId == sid.id + WHERE + ne.eventType == {EVENT_TYPE_NVTX_PUSHPOP_RANGE} + OR + ne.eventType == {EVENT_TYPE_NVTXT_PUSHPOP_RANGE} + ), + summary AS ( + SELECT + tag AS name, + sum(duration) AS total, + count(*) AS num, + avg(duration) AS avg, + median(duration) AS med, + min(duration) AS min, + max(duration) AS max, + stdev(duration) AS stddev + FROM + nvtx + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) + + SELECT + round(total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + total AS "Total Time:dur_ns", + num AS "Instances", + round(avg, 1) AS "Avg:dur_ns", + round(med, 1) AS "Med:dur_ns", + min AS "Min:dur_ns", + max AS "Max:dur_ns", + round(stddev, 1) AS "StdDev:dur_ns", + name AS "Range" + FROM + summary + ORDER BY 2 DESC +; +""" + + table_checks = { + 'NVTX_EVENTS': + "{DBFILE} does not contain NV Tools Extension (NVTX) data." + } + +if __name__ == "__main__": + NVTXPushPopSummary.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtxpptrace.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtxpptrace.py new file mode 100644 index 0000000000000000000000000000000000000000..0fadd432918ad7e6f8678a6924c71bfd7f42aa99 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtxpptrace.py @@ -0,0 +1,280 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class NVTXPushPopTrace(nsysstats.StatsReport): + + EVENT_TYPE_NVTX_DOMAIN_CREATE = 75 + EVENT_TYPE_NVTX_PUSHPOP_RANGE = 59 + EVENT_TYPE_NVTXT_PUSHPOP_RANGE = 70 + + display_name = 'DEPRECATED - Use nvtx_pushpop_trace instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + +# These are the "setup" statements executed before the main query. +# These are not allowed to generate output, other than errors. + + statements = [ + +# First, create a 1D R-Tree index that will hold NVTX timestamps. This will +# be used to figure out which ranges are the children of other ranges. +# The R-Tree uses 32-bit floating point for its dimensional values, so +# we need two copies of the timestamps-- the indexed floating point values +# to get us close, and the exact values to do a final, detailed check. + +f""" + CREATE VIRTUAL TABLE temp.NVTX_EVENTS_RIDX + USING rtree + ( + rangeId, + startTS, + endTS, + +startNS INTEGER, + +endNS INTEGER, + +tid INTEGER + ); +""", + +# Insert NVTX push/pop range data into the R-Tree index +# Not all NVTX ranges have a valid "end" timestamp, so +# we have to play some games. + +f""" + INSERT INTO temp.NVTX_EVENTS_RIDX + WITH + maxts AS( + SELECT max(max(start), max(end)) AS m + FROM NVTX_EVENTS + ) + SELECT + e.rowid AS rangeId, + e.start AS startTS, + ifnull(e.end, (SELECT m FROM maxts)) AS endTS, + e.start AS startNS, + ifnull(e.end, (SELECT m FROM maxts)) AS endNS, + e.globalTid AS tid + FROM + NVTX_EVENTS AS e + WHERE + e.eventType == {EVENT_TYPE_NVTX_PUSHPOP_RANGE} + OR + e.eventType == {EVENT_TYPE_NVTXT_PUSHPOP_RANGE} + ; +""", + +# Create a temp table to hold the parent relationships. +# We're going to compute and hold some meta-data (such as +# number of children, durations, etc.) as well. + +f""" + CREATE TEMP TABLE NVTX_PARENT ( + rangeId INTEGER PRIMARY KEY NOT NULL, + parentId INTEGER, + duration INTEGER, + childDuration INTEGER, + childNumb INTEGER, + fullname TEXT + ); +""", + +# Insert NVTX push/pop range data into the parent table. +# We do an initial insert of all data, and then run an +# update on the parent data, rather than just inserting +# it all at once, so that the table includes root nodes +# that don't have parents. It is easier to deal with it +# here than trying to do an OUTER JOIN with the update. + +f""" + INSERT INTO temp.NVTX_PARENT + WITH + domains AS ( + SELECT + min(start), + domainId AS id, + globalTid AS globalTid, + text AS name + FROM + NVTX_EVENTS + WHERE + eventType == {EVENT_TYPE_NVTX_DOMAIN_CREATE} + GROUP BY 2, 3 + ), + maxts AS( + SELECT max(max(start), max(end)) AS m + FROM NVTX_EVENTS + ) + SELECT + e.rowid AS rangeId, + NULL AS parentId, + ifnull(e.end, (SELECT m FROM maxts)) - e.start AS duration, + 0 AS childDuration, + 0 AS childNumb, + CASE + WHEN d.name NOT NULL AND sid.value IS NOT NULL + THEN d.name || ':' || sid.value + WHEN d.name NOT NULL AND sid.value IS NULL + THEN d.name || ':' || e.text + WHEN d.name IS NULL AND sid.value NOT NULL + THEN sid.value + ELSE e.text + END AS fullname + FROM + NVTX_EVENTS AS e + LEFT JOIN + domains AS d + ON e.domainId == d.id + AND (e.globalTid & 0x0000FFFFFF000000) == (d.globalTid & 0x0000FFFFFF000000) + LEFT JOIN + StringIds AS sid + ON e.textId == sid.id + WHERE + e.eventType == {EVENT_TYPE_NVTX_PUSHPOP_RANGE} + OR + e.eventType == {EVENT_TYPE_NVTXT_PUSHPOP_RANGE} + ; +""", + +# Use the R-Tree to figure out which ranges are children of other ranges. +# This is done by figuring out which range timestamps are "inside" other +# ranges and extracting the "tightest" parent. This tightness is used +# to filter parents from grandparents. This query depends on a documented, +# but non-standard, behavior of SQLite where the min() aggregate call will +# return the whole row that triggers the minimum, including the corresponding +# event IDs. + +f""" + WITH + par AS ( + SELECT + cr.rangeId as cid, + pr.rangeId as pid, + min((cr.startNS - pr.startNS) + (pr.endNS - cr.EndNS)) as tightness + FROM + temp.NVTX_EVENTS_RIDX AS cr + JOIN + temp.NVTX_EVENTS_RIDX AS pr + ON + pr.rangeId != cr.rangeId + AND pr.startTS <= cr.startTS + AND pr.endTS >= cr.endTS + AND pr.startNS <= cr.startNS + AND pr.endNS >= cr.endNS + AND pr.tid == cr.tid + GROUP BY cid + ) + UPDATE temp.NVTX_PARENT + SET parentId == (SELECT pid FROM par WHERE rangeId == par.cid) + ; +""", + +# Update the child duration and count + +f""" + WITH + totals AS ( + SELECT + parentId AS parentId, + total(duration) AS childDuration, + count(*) AS childNumb + FROM + NVTX_PARENT + GROUP BY 1 + ) + UPDATE temp.NVTX_PARENT + SET (childDuration, childNumb) == ( + SELECT + childDuration AS childDuration, + childNumb AS childNumb + FROM totals + WHERE totals.parentId == rangeId + ) + ; +""", + +# Now that we have our parent data, create an index over the parent ID value. +# When dealing with a fixed data set it is slightly more efficient to create +# the index after all the rows have been inserted. + +f""" + CREATE INDEX IF NOT EXISTS temp.NVTX_PARENT__PARENTID + ON NVTX_PARENT (parentId) + ; +""", + +] # end of statements + +# The actual query uses the table of parents in a recursive CTE to build +# a tree-based query that is aware of what stack level we're on. + + query = f""" +WITH RECURSIVE + tree AS ( + SELECT + p.rangeId AS rangeId, + ':' || CAST(p.rangeId AS TEXT) AS rangeIdHier, + p.parentId AS parentId, + 0 AS level, + '' AS tab + FROM + temp.NVTX_PARENT AS p + WHERE p.parentId IS NULL + + UNION ALL + SELECT + p.rangeId AS rangeId, + tree.rangeIdHier || ':' || CAST(p.rangeId AS TEXT) AS rangeIdHier, + p.parentId AS parentId, + tree.level + 1 AS level, + tree.tab || '--' AS tab + FROM + tree + JOIN + temp.NVTX_PARENT AS p + ON p.parentId == tree.rangeId + + ORDER BY level DESC + ) +SELECT + ne.start AS "Start:ts_ns", + ne.start + p.duration AS "End:ts_ns", + p.duration AS "Duration:dur_ns", + ifnull(p.childDuration, 0) AS "DurChild:dur_ns", + p.duration - ifnull(p.childDuration, 0) AS "DurNonChild:dur_ns", + p.fullname AS "Name", + (ne.globalTid >> 24) & 0x00FFFFFF AS "PID", + ne.globalTid & 0x00FFFFFF AS "TID", + t.level AS "Lvl", + ifnull(p.childNumb, 0) AS "NumChild", + ne.rowid AS "RangeId", + t.parentId AS "ParentId", + t.rangeIdHier AS "RangeStack", + t.tab || p.fullname AS "NameTree" +FROM + NVTX_EVENTS AS ne +JOIN + temp.NVTX_PARENT AS p + ON p.rangeId == ne.rowid +JOIN + tree AS t + ON t.rangeId == ne.rowid +; +""" + + table_checks = { + 'NVTX_EVENTS': + "{DBFILE} does not contain NV Tools Extension (NVTX) data." + } + +if __name__ == "__main__": + NVTXPushPopTrace.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtxsesum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtxsesum.py new file mode 100644 index 0000000000000000000000000000000000000000..147312016a5951a294a4d8b41c19ccc9cfc26f07 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtxsesum.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class NVTXStartEndSummary(nsysstats.StatsReport): + + EVENT_TYPE_NVTX_DOMAIN_CREATE = 75 + EVENT_TYPE_NVTX_STARTEND_RANGE = 60 + EVENT_TYPE_NVTXT_STARTEND_RANGE = 71 + + display_name = 'DEPRECATED - Use nvtx_startend_sum instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query = f""" +WITH + domains AS ( + SELECT + min(start), + domainId AS id, + globalTid AS globalTid, + text AS name + FROM + NVTX_EVENTS + WHERE + eventType == {EVENT_TYPE_NVTX_DOMAIN_CREATE} + GROUP BY 2, 3 + ), + maxts AS( + SELECT max(max(start), max(end)) AS m + FROM NVTX_EVENTS + ), + nvtx AS ( + SELECT + coalesce(ne.end, (SELECT m FROM maxts)) - ne.start AS duration, + CASE + WHEN d.name NOT NULL AND sid.value IS NOT NULL + THEN d.name || ':' || sid.value + WHEN d.name NOT NULL AND sid.value IS NULL + THEN d.name || ':' || ne.text + WHEN d.name IS NULL AND sid.value NOT NULL + THEN sid.value + ELSE ne.text + END AS tag + FROM + NVTX_EVENTS AS ne + LEFT OUTER JOIN + domains AS d + ON ne.domainId == d.id + AND (ne.globalTid & 0x0000FFFFFF000000) == (d.globalTid & 0x0000FFFFFF000000) + LEFT OUTER JOIN + StringIds AS sid + ON ne.textId == sid.id + WHERE + ne.eventType == {EVENT_TYPE_NVTX_STARTEND_RANGE} + OR + ne.eventType == {EVENT_TYPE_NVTXT_STARTEND_RANGE} + ), + summary AS ( + SELECT + tag AS name, + sum(duration) AS total, + count(*) AS num, + avg(duration) AS avg, + median(duration) AS med, + min(duration) AS min, + max(duration) AS max, + stdev(duration) AS stddev + FROM + nvtx + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) + + SELECT + round(total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + total AS "Total Time:dur_ns", + num AS "Instances", + round(avg, 1) AS "Avg:dur_ns", + round(med, 1) AS "Med:dur_ns", + min AS "Min:dur_ns", + max AS "Max:dur_ns", + round(stddev, 1) AS "StdDev:dur_ns", + name AS "Range" + FROM + summary + ORDER BY 2 DESC +; +""" + + table_checks = { + 'NVTX_EVENTS': + "{DBFILE} does not contain NV Tools Extension (NVTX) data." + } + +if __name__ == "__main__": + NVTXStartEndSummary.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtxsssum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtxsssum.py new file mode 100644 index 0000000000000000000000000000000000000000..12eb8307b2757b8bb606cb8bc64708e6f396606a --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtxsssum.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class NVTXStartStopSummary(nsysstats.StatsReport): + + EVENT_TYPE_NVTX_DOMAIN_CREATE = 75 + EVENT_TYPE_NVTX_STARTEND_RANGE = 60 + EVENT_TYPE_NVTXT_STARTEND_RANGE = 71 + + display_name = 'DEPRECATED - Use nvtx_startend_sum instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query = f""" +WITH + domains AS ( + SELECT + min(start), + domainId AS id, + globalTid AS globalTid, + text AS name + FROM + NVTX_EVENTS + WHERE + eventType == {EVENT_TYPE_NVTX_DOMAIN_CREATE} + GROUP BY 2, 3 + ), + maxts AS( + SELECT max(max(start), max(end)) AS m + FROM NVTX_EVENTS + ), + nvtx AS ( + SELECT + coalesce(ne.end, (SELECT m FROM maxts)) - ne.start AS duration, + CASE + WHEN d.name NOT NULL AND sid.value IS NOT NULL + THEN d.name || ':' || sid.value + WHEN d.name NOT NULL AND sid.value IS NULL + THEN d.name || ':' || ne.text + WHEN d.name IS NULL AND sid.value NOT NULL + THEN sid.value + ELSE ne.text + END AS tag + FROM + NVTX_EVENTS AS ne + LEFT OUTER JOIN + domains AS d + ON ne.domainId == d.id + AND (ne.globalTid & 0x0000FFFFFF000000) == (d.globalTid & 0x0000FFFFFF000000) + LEFT OUTER JOIN + StringIds AS sid + ON ne.textId == sid.id + WHERE + ne.eventType == {EVENT_TYPE_NVTX_STARTEND_RANGE} + OR + ne.eventType == {EVENT_TYPE_NVTXT_STARTEND_RANGE} + ), + summary AS ( + SELECT + tag AS name, + sum(duration) AS total, + count(*) AS num, + avg(duration) AS avg, + median(duration) AS med, + min(duration) AS min, + max(duration) AS max, + stdev(duration) AS stddev + FROM + nvtx + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) + + SELECT + round(total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + total AS "Total Time:dur_ns", + num AS "Instances", + round(avg, 1) AS "Avg:dur_ns", + round(med, 1) AS "Med:dur_ns", + min AS "Min:dur_ns", + max AS "Max:dur_ns", + round(stddev, 1) AS "StdDev:dur_ns", + name AS "Range" + FROM + summary + ORDER BY 2 DESC +; +""" + + table_checks = { + 'NVTX_EVENTS': + "{DBFILE} does not contain NV Tools Extension (NVTX) data." + } + +if __name__ == "__main__": + NVTXStartStopSummary.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtxsum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtxsum.py new file mode 100644 index 0000000000000000000000000000000000000000..da67eaafbe841ab1c62e3df79c8fa33da6677d74 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvtxsum.py @@ -0,0 +1,129 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class NVTXSummary(nsysstats.StatsReport): + + EVENT_TYPE_NVTX_DOMAIN_CREATE = 75 + EVENT_TYPE_NVTX_PUSHPOP_RANGE = 59 + EVENT_TYPE_NVTX_STARTEND_RANGE = 60 + EVENT_TYPE_NVTXT_PUSHPOP_RANGE = 70 + EVENT_TYPE_NVTXT_STARTEND_RANGE = 71 + + display_name = 'DEPRECATED - Use nvtx_sum instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query = f""" +WITH + domains AS ( + SELECT + min(start), + domainId AS id, + globalTid AS globalTid, + text AS name + FROM + NVTX_EVENTS + WHERE + eventType == {EVENT_TYPE_NVTX_DOMAIN_CREATE} + GROUP BY 2, 3 + ), + maxts AS( + SELECT max(max(start), max(end)) AS m + FROM NVTX_EVENTS + ), + nvtx AS ( + SELECT + coalesce(ne.end, (SELECT m FROM maxts)) - ne.start AS duration, + CASE + WHEN d.name NOT NULL AND sid.value IS NOT NULL + THEN d.name || ':' || sid.value + WHEN d.name NOT NULL AND sid.value IS NULL + THEN d.name || ':' || ne.text + WHEN d.name IS NULL AND sid.value NOT NULL + THEN sid.value + ELSE ne.text + END AS tag, + CASE ne.eventType + WHEN {EVENT_TYPE_NVTX_PUSHPOP_RANGE} + THEN 'PushPop' + WHEN {EVENT_TYPE_NVTX_STARTEND_RANGE} + THEN 'StartEnd' + WHEN {EVENT_TYPE_NVTXT_PUSHPOP_RANGE} + THEN 'PushPop' + WHEN {EVENT_TYPE_NVTXT_STARTEND_RANGE} + THEN 'StartEnd' + ELSE 'Unknown' + END AS style + FROM + NVTX_EVENTS AS ne + LEFT OUTER JOIN + domains AS d + ON ne.domainId == d.id + AND (ne.globalTid & 0x0000FFFFFF000000) == (d.globalTid & 0x0000FFFFFF000000) + LEFT OUTER JOIN + StringIds AS sid + ON ne.textId == sid.id + WHERE + ne.eventType == {EVENT_TYPE_NVTX_PUSHPOP_RANGE} + OR + ne.eventType == {EVENT_TYPE_NVTX_STARTEND_RANGE} + OR + ne.eventType == {EVENT_TYPE_NVTXT_PUSHPOP_RANGE} + OR + ne.eventType == {EVENT_TYPE_NVTXT_STARTEND_RANGE} + ), + summary AS ( + SELECT + tag AS name, + style AS style, + sum(duration) AS total, + count(*) AS num, + avg(duration) AS avg, + median(duration) AS med, + min(duration) AS min, + max(duration) AS max, + stdev(duration) AS stddev + FROM + nvtx + GROUP BY 1, 2 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) + + SELECT + round(total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + total AS "Total Time:dur_ns", + num AS "Instances", + round(avg, 1) AS "Avg:dur_ns", + round(med, 1) AS "Med:dur_ns", + min AS "Min:dur_ns", + max AS "Max:dur_ns", + round(stddev, 1) AS "StdDev:dur_ns", + style AS "Style", + name AS "Range" + FROM + summary + ORDER BY 2 DESC +; +""" + + table_checks = { + 'NVTX_EVENTS': + "{DBFILE} does not contain NV Tools Extension (NVTX) data." + } + +if __name__ == "__main__": + NVTXSummary.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvvideo_api_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvvideo_api_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..8ea022939f7b093c2c1291ef3f938bdc2cb32d9b --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/nvvideo_api_sum.py @@ -0,0 +1,123 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class NvVideoApiSum(nsysstats.StatsReport): + + display_name = 'NvVideo API Summary' + usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}} + + No arguments. + + Output: All time values default to nanoseconds + Time : Percentage of "Total Time" + Total Time : Total time used by all executions of this function + Num Calls : Number of calls to this function + Avg : Average execution time of this function + Med : Median execution time of this function + Min : Smallest execution time of this function + Max : Largest execution time of this function + StdDev : Standard deviation of the time of this function + Event Type : Which API this function belongs to + Name : Name of the function + + This report provides a summary of NvVideo API functions and their + execution times. Note that the "Time" column is calculated + using a summation of the "Total Time" column, and represents that + function's percent of the execution time of the functions listed, + and not a percentage of the application wall or CPU execution time. +""" + + summary_query_stub = """ + SELECT + nameId AS nameId, + '{TYPE}' AS eventType, + sum(end - start) AS total, + count(*) AS num, + avg(end - start) AS avg, + median(end - start) AS med, + min(end - start) AS min, + max(end - start) AS max, + stdev(end - start) AS stddev, + variance(end - start) AS var + FROM + {TABLE} + GROUP BY 1 +""" + + union_all = """ + UNION ALL +""" + + query_stub = """ +WITH + summary AS ( + {SUMMARY} + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Num Calls", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + summary.eventType AS "Event Type", + CASE substr(ids.value, -6, 2) + WHEN '_v' + THEN substr(ids.value, 1, length(value)-6) + ELSE ids.value + END AS "Name", + summary.var AS "_Var" +FROM + summary +LEFT JOIN + StringIds AS ids + ON ids.id == summary.nameId +ORDER BY 2 DESC +; +""" + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.', + } + + tables = [ + ['NVVIDEO_ENCODER_API', 'Encoder'], + ['NVVIDEO_DECODER_API', 'Decoder'], + ['NVVIDEO_JPEG_API', 'JPEG'] + ] + + def setup(self): + err = super().setup() + if err != None: + return err + + existent_tables = list(filter(lambda t: self.table_exists(t[0]), self.tables)) + + if len(existent_tables) == 0: + return '{DBFILE} does not contain NvVideo trace data.' + + summary_queries = [self.summary_query_stub.format(TABLE=t[0], TYPE=t[1]) for t in existent_tables] + + summary_query = self.union_all.join(summary_queries) + + self.query = self.query_stub.format(SUMMARY=summary_query) + +if __name__ == "__main__": + NvVideoApiSum.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/openacc_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/openacc_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..b39775c32879855b886a4d90eb325a1f3a2dbd91 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/openacc_sum.py @@ -0,0 +1,122 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class OpenaccSum(nsysstats.StatsReport): + + display_name = 'OpenACC Summary' + usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}} + + No arguments. + + Output: All time values default to nanoseconds + Time : Percentage of "Total Time" + Total Time : Total time used by all executions of event type + Count : Number of event type + Avg : Average execution time of event type + Med : Median execution time of event type + Min : Smallest execution time of event type + Max : Largest execution time of event type + StdDev : Standard deviation of execution time of event type + Name : Name of the event + + This report provides a summary of OpenACC events and their + execution times. Note that the "Time" column is calculated + using a summation of the "Total Time" column, and represents that + event type's percent of the execution time of the events listed, + and not a percentage of the application wall or CPU execution time. +""" + + query_stub = """ +WITH + openacc AS ( + {OPEN_ACC_UNION} + ), + summary AS ( + SELECT + CASE + WHEN srcFile NOT NULL + THEN nameIds.value || '@' || srcFileIds.value || ':' || lineNo + ELSE nameIds.value + END AS name, + sum(end - start) AS total, + count(*) AS num, + avg(end - start) AS avg, + median(end - start) AS med, + min(end - start) AS min, + max(end - start) AS max, + stdev(end - start) AS stddev + FROM + openacc + LEFT JOIN + StringIds AS srcFileIds + ON srcFileIds.id == srcFile + LEFT JOIN + StringIds AS nameIds + ON nameIds.id == nameId + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Num Calls", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + name AS "Name" +FROM + summary +ORDER BY 2 DESC +; +""" + + query_oacc = """ + SELECT + start, + end, + nameId, + eventKind, + lineNo, + srcFile + FROM + {TABLE} +""" + + query_union = """ + UNION ALL +""" + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.', + } + + def setup(self): + err = super().setup() + if err != None: + return err + + oacc_tables = self.search_tables(r'^CUPTI_ACTIVITY_KIND_OPENACC_.+$') + if len(oacc_tables) == 0: + return "{DBFILE} does not contain OpenACC event data." + + oacc_queries = list(self.query_oacc.format(TABLE=t) for t in oacc_tables) + self.query = self.query_stub.format(OPEN_ACC_UNION = self.query_union.join(oacc_queries)) + +if __name__ == "__main__": + OpenaccSum.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/openaccsum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/openaccsum.py new file mode 100644 index 0000000000000000000000000000000000000000..5d1e3a084e0028a9bd7f7a5ba52072f1e30501b0 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/openaccsum.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class OpenACCSummary(nsysstats.StatsReport): + + display_name = 'DEPRECATED - Use openacc_sum instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query_stub = """ +WITH + openacc AS ( + {OPEN_ACC_UNION} + ), + summary AS ( + SELECT + CASE + WHEN srcFile NOT NULL + THEN nameIds.value || '@' || srcFileIds.value || ':' || lineNo + ELSE nameIds.value + END AS name, + sum(end - start) AS total, + count(*) AS num, + avg(end - start) AS avg, + median(end - start) AS med, + min(end - start) AS min, + max(end - start) AS max, + stdev(end - start) AS stddev + FROM + openacc + LEFT JOIN + StringIds AS srcFileIds + ON srcFileIds.id == srcFile + LEFT JOIN + StringIds AS nameIds + ON nameIds.id == nameId + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time(%)", + summary.total AS "Total Time:dur_ns", + summary.num AS "Num Calls", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + name AS "Name" +FROM + summary +ORDER BY 2 DESC +; +""" + + query_oacc = """ + SELECT + start, + end, + nameId, + eventKind, + lineNo, + srcFile + FROM + {TABLE} +""" + + query_union = """ + UNION ALL +""" + + def setup(self): + err = super().setup() + if err != None: + return err + + oacc_tables = self.search_tables(r'^CUPTI_ACTIVITY_KIND_OPENACC_.+$') + if len(oacc_tables) == 0: + return "{DBFILE} does not contain OpenACC event data." + + oacc_queries = list(self.query_oacc.format(TABLE=t) for t in oacc_tables) + self.query = self.query_stub.format(OPEN_ACC_UNION = self.query_union.join(oacc_queries)) + +if __name__ == "__main__": + OpenACCSummary.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/opengl_khr_gpu_range_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/opengl_khr_gpu_range_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..7ac9f00342a067ab8b3d0bbec0cd42ccd3ba290d --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/opengl_khr_gpu_range_sum.py @@ -0,0 +1,107 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class OpenglKhrGpuRangeSum(nsysstats.StatsReport): + + EVENT_TYPE_KHR_DEBUG_GPU_PUSHPOP_RANGE = 63 + + display_name = 'OpenGL KHR_debug GPU Range Summary' + usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}} + + No arguments. + + Output: All time values default to nanoseconds + Time : Percentage of "Total Time" + Total Time : Total time used by all instances of this range + Instances : Number of instances of this range + Avg : Average execution time of this range + Med : Median execution time of this range + Min : Smallest execution time of this range + Max : Largest execution time of this range + StdDev : Standard deviation of execution time of this range + Range : Name of the range + + This report provides a summary of OpenGL KHR_debug GPU PUSH/POP debug Ranges, + and their execution times. Note that the "Time" column + is calculated using a summation of the "Total Time" column, and represents + that range's percent of the execution time of the ranges listed, and not a + percentage of the application wall or CPU execution time. +""" + + query = f""" +WITH + maxts AS( + SELECT max(max(start), max(end)) AS m + FROM KHR_DEBUG_EVENTS + ), + khrDebug AS ( + SELECT + coalesce(khrDebugEvents.end, (SELECT m FROM maxts)) - khrDebugEvents.start AS duration, + CASE + WHEN sid.value IS NOT NULL + THEN sid.value + ELSE khrDebugEvents.id + END AS tag + FROM + KHR_DEBUG_EVENTS AS khrDebugEvents + LEFT OUTER JOIN + StringIds AS sid + ON khrDebugEvents.textId == sid.id + WHERE + khrDebugEvents.eventClass == {EVENT_TYPE_KHR_DEBUG_GPU_PUSHPOP_RANGE} + ), + summary AS ( + SELECT + tag AS name, + sum(duration) AS total, + count(*) AS num, + avg(duration) AS avg, + median(duration) AS med, + min(duration) AS min, + max(duration) AS max, + stdev(duration) AS stddev + FROM + khrDebug + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) + +SELECT + round(total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + total AS "Total Time:dur_ns", + num AS "Instances", + round(avg, 1) AS "Avg:dur_ns", + round(med, 1) AS "Med:dur_ns", + min AS "Min:dur_ns", + max AS "Max:dur_ns", + round(stddev, 1) AS "StdDev:dur_ns", + name AS "Range" +FROM + summary +WHERE summary.total > 0 +ORDER BY 2 DESC +; +""" + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.', + 'KHR_DEBUG_EVENTS': + "{DBFILE} does not contain GPU KHR Extension (KHR_DEBUG) data." + } + +if __name__ == "__main__": + OpenglKhrGpuRangeSum.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/opengl_khr_range_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/opengl_khr_range_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..f1dde8b1f6e3df7bdc12445491271741814ed6dc --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/opengl_khr_range_sum.py @@ -0,0 +1,107 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class OpenglKhrRangeSum(nsysstats.StatsReport): + + EVENT_TYPE_KHR_DEBUG_PUSHPOP_RANGE = 62 + + display_name = 'OpenGL KHR_debug Range Summary' + usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}} + + No arguments. + + Output: All time values default to nanoseconds + Time : Percentage of "Total Time" + Total Time : Total time used by all instances of this range + Instances : Number of instances of this range + Avg : Average execution time of this range + Med : Median execution time of this range + Min : Smallest execution time of this range + Max : Largest execution time of this range + StdDev : Standard deviation of execution time of this range + Range : Name of the range + + This report provides a summary of OpenGL KHR_debug CPU PUSH/POP debug Ranges, + and their execution times. Note that the "Time" column + is calculated using a summation of the "Total Time" column, and represents + that range's percent of the execution time of the ranges listed, and not a + percentage of the application wall or CPU execution time. +""" + + query = f""" +WITH + maxts AS( + SELECT max(max(start), max(end)) AS m + FROM KHR_DEBUG_EVENTS + ), + khrDebug AS ( + SELECT + coalesce(khrDebugEvents.end, (SELECT m FROM maxts)) - khrDebugEvents.start AS duration, + CASE + WHEN sid.value IS NOT NULL + THEN sid.value + ELSE khrDebugEvents.id + END AS tag + FROM + KHR_DEBUG_EVENTS AS khrDebugEvents + LEFT OUTER JOIN + StringIds AS sid + ON khrDebugEvents.textId == sid.id + WHERE + khrDebugEvents.eventClass == {EVENT_TYPE_KHR_DEBUG_PUSHPOP_RANGE} + ), + summary AS ( + SELECT + tag AS name, + sum(duration) AS total, + count(*) AS num, + avg(duration) AS avg, + median(duration) AS med, + min(duration) AS min, + max(duration) AS max, + stdev(duration) AS stddev + FROM + khrDebug + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) + +SELECT + round(total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + total AS "Total Time:dur_ns", + num AS "Instances", + round(avg, 1) AS "Avg:dur_ns", + round(med, 1) AS "Med:dur_ns", + min AS "Min:dur_ns", + max AS "Max:dur_ns", + round(stddev, 1) AS "StdDev:dur_ns", + name AS "Range" +FROM + summary +WHERE summary.total > 0 +ORDER BY 2 DESC +; +""" + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.', + 'KHR_DEBUG_EVENTS': + "{DBFILE} does not contain KHR Extension (KHR_DEBUG) data." + } + +if __name__ == "__main__": + OpenglKhrRangeSum.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/openmp_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/openmp_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..46e567169b587bfac246f89ed381226e8540bee0 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/openmp_sum.py @@ -0,0 +1,103 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class OpenmpSum(nsysstats.StatsReport): + + display_name = 'OpenMP Summary' + usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}} + + No arguments. + + Output: All time values default to nanoseconds + Time : Percentage of "Total Time" + Total Time : Total time used by all executions of event type + Count : Number of event type + Avg : Average execution time of event type + Med : Median execution time of event type + Min : Smallest execution time of event type + Max : Largest execution time of event type + StdDev : Standard deviation of execution time of event type + Name : Name of the event + + This report provides a summary of OpenMP events and their + execution times. Note that the "Time" column is calculated + using a summation of the "Total Time" column, and represents that + event type's percent of the execution time of the events listed, + and not a percentage of the application wall or CPU execution time. +""" + + query_stub = """ +WITH + summary AS ( + {OPEN_MP_UNION} + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Count", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + ids.value AS "Name" +FROM + summary +LEFT JOIN + StringIds AS ids + ON ids.id == summary.nameId +ORDER BY 2 DESC +; +""" + + query_omp = """ + SELECT + nameId AS nameId, + count(*) AS num, + sum(end - start) AS total, + avg(end - start) AS avg, + median(end - start) AS med, + min(end - start) AS min, + max(end - start) AS max, + stdev(end - start) AS stddev + FROM {TABLE} + GROUP BY 1 +""" + + query_union = """ + UNION ALL +""" + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.', + } + + def setup(self): + err = super().setup() + if err != None: + return err + + omp_tables = self.search_tables(r'^OPENMP_EVENT_KIND_.+$') + if len(omp_tables) == 0: + return "{DBFILE} does not contain OpenMP event data." + + omp_queries = list(self.query_omp.format(TABLE=t) for t in omp_tables) + self.query = self.query_stub.format(OPEN_MP_UNION = self.query_union.join(omp_queries)) + +if __name__ == "__main__": + OpenmpSum.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/openmpevtsum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/openmpevtsum.py new file mode 100644 index 0000000000000000000000000000000000000000..03bc458a42409bae65cf719c790f6320a76451c6 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/openmpevtsum.py @@ -0,0 +1,80 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class OpenMPEventSummary(nsysstats.StatsReport): + + display_name = 'DEPRECATED - Use openmp_sum instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query_stub = """ +WITH + summary AS ( + {OPEN_MP_UNION} + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Count", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + ids.value AS "Name" +FROM + summary +LEFT JOIN + StringIds AS ids + ON ids.id == summary.nameId +ORDER BY 2 DESC +; +""" + + query_omp = """ + SELECT + nameId AS nameId, + count(*) AS num, + sum(end - start) AS total, + avg(end - start) AS avg, + median(end - start) AS med, + min(end - start) AS min, + max(end - start) AS max, + stdev(end - start) AS stddev + FROM {TABLE} + GROUP BY 1 +""" + + query_union = """ + UNION ALL +""" + + def setup(self): + err = super().setup() + if err != None: + return err + + omp_tables = self.search_tables(r'^OPENMP_EVENT_KIND_.+$') + if len(omp_tables) == 0: + return "{DBFILE} does not contain OpenMP event data." + + omp_queries = list(self.query_omp.format(TABLE=t) for t in omp_tables) + self.query = self.query_stub.format(OPEN_MP_UNION = self.query_union.join(omp_queries)) + +if __name__ == "__main__": + OpenMPEventSummary.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/osrt_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/osrt_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..3da3523ceaadb93ce3e2846a559cec8ade59453c --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/osrt_sum.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class OsrtSum(nsysstats.StatsReport): + + display_name = 'OS Runtime Summary' + usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}} + + No arguments. + + Output: All time values default to nanoseconds + Time : Percentage of "Total Time" + Total Time : Total time used by all executions of this function + Num Calls : Number of calls to this function + Avg : Average execution time of this function + Med : Median execution time of this function + Min : Smallest execution time of this function + Max : Largest execution time of this function + StdDev : Standard deviation of execution time of this function + Name : Name of the function + + This report provides a summary of operating system functions and + their execution times. Note that the "Time" column is calculated + using a summation of the "Total Time" column, and represents that + function's percent of the execution time of the functions listed, + and not a percentage of the application wall or CPU execution time. +""" + + query = """ +WITH + summary AS ( + SELECT + nameId AS nameId, + sum(end - start) AS total, + count(*) AS num, + avg(end - start) AS avg, + median(end - start) AS med, + min(end - start) AS min, + max(end - start) AS max, + stdev(end - start) AS stddev, + lower_quartile(end - start) AS q1, + upper_quartile(end - start) AS q3 + FROM + OSRT_API + WHERE + eventClass == 27 + GROUP BY 1 + ), + totals AS ( + SELECT + sum(total) AS total + FROM summary + ) +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Num Calls", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + ids.value AS "Name", + summary.q1 AS "_Q1", + summary.q3 AS "_Q3" +FROM + summary +LEFT JOIN + StringIds AS ids + ON ids.id == summary.nameId +ORDER BY 2 DESC +; +""" + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.', + 'OSRT_API': + '{DBFILE} does not contain OS Runtime trace data.' + } + +if __name__ == "__main__": + OsrtSum.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/osrtsum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/osrtsum.py new file mode 100644 index 0000000000000000000000000000000000000000..8eef3ef90ee354ef64d410eb8e44065ba80a2934 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/osrtsum.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class OSRTSummaryReport(nsysstats.StatsReport): + + display_name = 'DEPRECATED - Use osrt_sum instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query = """ +WITH + summary AS ( + SELECT + nameId AS nameId, + sum(end - start) AS total, + count(*) AS num, + avg(end - start) AS avg, + median(end - start) AS med, + min(end - start) AS min, + max(end - start) AS max, + stdev(end - start) AS stddev + FROM + OSRT_API + WHERE + eventClass == 27 + GROUP BY 1 + ), + totals AS ( + SELECT + sum(total) AS total + FROM summary + ) +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Num Calls", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + ids.value AS "Name" +FROM + summary +LEFT JOIN + StringIds AS ids + ON ids.id == summary.nameId +ORDER BY 2 DESC +; +""" + + table_checks = { + 'OSRT_API': + '{DBFILE} does not contain OS Runtime trace data.' + } + +if __name__ == "__main__": + OSRTSummaryReport.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/um_cpu_page_faults_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/um_cpu_page_faults_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..19e0f9474629e37ed39eec0dc933e3c8ae5ff496 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/um_cpu_page_faults_sum.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class UmCpuPageFaultsSum(nsysstats.StatsReport): + + display_name = 'Unified Memory CPU Page Faults Summary' + usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}} + + Output: + CPU Page Faults : Number of CPU page faults that occurred + CPU Instruction Address : Address of the CPU instruction that caused the CPU page faults + + This report provides a summary of CPU page faults for unified memory. +""" + + query = """ +WITH + summary AS ( + SELECT + CpuInstruction AS sourceId, + count(*) AS num + FROM + CUDA_UM_CPU_PAGE_FAULT_EVENTS + GROUP BY 1 + ) +SELECT + summary.num AS "CPU Page Faults", + ids.value AS "CPU Instruction Address" +FROM + summary +LEFT JOIN + StringIds AS ids + ON ids.id == summary.sourceId +ORDER BY 1 DESC -- CPU Page Faults +; +""" + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.', + 'CUDA_UM_CPU_PAGE_FAULT_EVENTS': + "{DBFILE} does not contain CUDA Unified Memory CPU page faults data." + } + +if __name__ == "__main__": + UmCpuPageFaultsSum.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/um_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/um_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..1ce1ed271a4bfbe1e2160c0964825174d3f474c1 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/um_sum.py @@ -0,0 +1,165 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class UmSum(nsysstats.StatsReport): + + DEFAULT_ROW_LIMIT = 10 + + display_name = 'Unified Memory Analysis Summary' + usage = f"""{{SCRIPT}}[:rows=] -- {{DISPLAY_NAME}} + + Options: + rows= - Maximum number of rows returned by the query. + Default is {DEFAULT_ROW_LIMIT}. + + Output: + Virtual Address : Virtual base address of the page(s) being transferred + HtoD Migration Size : Bytes transferred from Host to Device + DtoH Migration Size : Bytes transferred from Device to Host + CPU Page Faults : Number of CPU page faults that occurred for the virtual base address + GPU Page Faults : Number of GPU page faults that occurred for the virtual base address + Migration Throughput : Bytes transferred per second + + This report provides a summary of data migrations for unified memory. +""" + + query = """ +WITH + cpuSummary AS ( + SELECT + address AS virtualAddress, + count(*) AS num + FROM + CUDA_UM_CPU_PAGE_FAULT_EVENTS + GROUP BY 1 + ), + gpuSummary AS ( + SELECT + address AS virtualAddress, + sum(numberOfPageFaults) AS num + FROM + CUDA_UM_GPU_PAGE_FAULT_EVENTS + GROUP BY 1 + ), + d2hTransferSummary AS ( + SELECT + virtualAddress AS virtualAddress, + sum(end-start) AS transferDuration, + sum(bytes) AS D2H + FROM + CUPTI_ACTIVITY_KIND_MEMCPY + WHERE copyKind = 12 + GROUP BY 1 + ), + h2dTransferSummary AS ( + SELECT + virtualAddress AS virtualAddress, + sum(end-start) AS transferDuration, + sum(bytes) AS H2D + FROM + CUPTI_ACTIVITY_KIND_MEMCPY + WHERE copyKind = 11 + GROUP BY 1 + ), + PageFaults AS ( + SELECT + cpuSummary.virtualAddress AS address, + cpuSummary.num AS cpuPageFaults, + gpuSummary.num AS gpuPageFaults + FROM + cpuSummary + LEFT JOIN gpuSummary USING(virtualAddress) + UNION ALL + SELECT + gpuSummary.virtualAddress AS address, + cpuSummary.num AS cpuPageFaults, + gpuSummary.num AS gpuPageFaults + FROM + gpuSummary + LEFT JOIN cpuSummary USING(virtualAddress) + WHERE cpuSummary.virtualAddress IS NULL + ), + Migrations AS ( + SELECT + d2hTransferSummary.virtualAddress AS address, + d2hTransferSummary.D2H AS d2h, + h2dTransferSummary.H2D AS h2d, + (IFNULL(d2hTransferSummary.D2H, 0) + + IFNULL(h2dTransferSummary.H2D, 0)) * + (1000000000 / (IFNULL(d2hTransferSummary.transferDuration, 0) + + IFNULL(h2dTransferSummary.transferDuration, 0))) AS tput + FROM + d2hTransferSummary + LEFT JOIN h2dTransferSummary USING(virtualAddress) + UNION ALL + SELECT + h2dTransferSummary.virtualAddress AS address, + d2hTransferSummary.D2H AS d2h, + h2dTransferSummary.H2D AS h2d, + (IFNULL(d2hTransferSummary.D2H, 0) + + IFNULL(h2dTransferSummary.H2D, 0)) * + (1000000000 / (IFNULL(d2hTransferSummary.transferDuration, 0) + + IFNULL(h2dTransferSummary.transferDuration, 0))) AS tput + FROM + h2dTransferSummary + LEFT JOIN d2hTransferSummary USING(virtualAddress) + WHERE d2hTransferSummary.virtualAddress IS NULL + ) +SELECT + PageFaults.address AS "Virtual Address:addr_uint", + Migrations.h2d AS "HtoD Migration size:mem_B", + Migrations.d2h AS "DtoH Migration size:mem_B", + PageFaults.cpuPageFaults AS "CPU Page Faults", + PageFaults.gpuPageFaults AS " GPU Page Faults", + Migrations.tput AS "Migration Throughput:thru_B" +FROM PageFaults +LEFT JOIN Migrations USING(address) +UNION ALL +SELECT + Migrations.address AS "Virtual Address:addr_uint", + Migrations.h2d AS "HtoD Migration size:mem_B", + Migrations.d2h AS "DtoH Migration size:mem_B", + PageFaults.cpuPageFaults AS "CPU Page Faults", + PageFaults.gpuPageFaults AS " GPU Page Faults", + Migrations.tput AS "Migration Throughput:thru_B" +FROM Migrations +LEFT JOIN PageFaults USING(address) +WHERE PageFaults.address IS NULL +ORDER BY 6 DESC -- Migration Throughput +LIMIT {LIMIT_ROW} +; +""" + + table_checks = { + 'CUPTI_ACTIVITY_KIND_MEMCPY': + "{DBFILE} does not contain CUDA memory transfers data.", + 'CUDA_UM_CPU_PAGE_FAULT_EVENTS': + "{DBFILE} does not contain CUDA Unified Memory CPU page faults data.", + 'CUDA_UM_GPU_PAGE_FAULT_EVENTS': + "{DBFILE} does not contain CUDA Unified Memory GPU page faults data.", + } + + _arg_opts = [ + [['rows'], {'type': int, 'help': 'max rows', 'default': DEFAULT_ROW_LIMIT}], + ] + + def setup(self): + err = super().setup() + if err != None: + return err + + self.query = self.query.format(LIMIT_ROW = self.parsed_args.rows) + +if __name__ == "__main__": + UmSum.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/um_total_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/um_total_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..1940dba9a78ab46984670662d1ab9370489fed56 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/um_total_sum.py @@ -0,0 +1,103 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class UmTotalSum(nsysstats.StatsReport): + + display_name = 'Unified Memory Totals Summary' + usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}} + + Output: + Total HtoD Migration Size : Total bytes transferred from host to device + Total DtoH Migration Size : Total bytes transferred from device to host + Total CPU Page Faults : Total number of CPU page faults that occurred + Total GPU Page Faults : Total number of GPU page faults that occurred + Minimum Virtual Address : Minimum value of the virtual address range for the pages transferred + Maximum Virtual Address : Maximum value of the virtual address range for the pages transferred + + This report provides a summary of all the page faults for unified memory. +""" + + query = """ +WITH + cpuSummary AS ( + SELECT + min(address) AS minVirtualAddress, + max(address) AS maxVirtualAddress, + count(*) AS num + FROM + CUDA_UM_CPU_PAGE_FAULT_EVENTS + ), + gpuSummary AS ( + SELECT + min(address) AS minVirtualAddress, + max(address) AS maxVirtualAddress, + sum(numberOfPageFaults) AS num + FROM + CUDA_UM_GPU_PAGE_FAULT_EVENTS + ), + d2hTransferSummary AS ( + SELECT + min(virtualAddress) AS minVirtualAddress, + max(virtualAddress) AS maxVirtualAddress, + sum(end-start) AS transferDuration, + sum(bytes) AS D2H + FROM + CUPTI_ACTIVITY_KIND_MEMCPY + WHERE copyKind = 12 + ), + h2dTransferSummary AS ( + SELECT + min(virtualAddress) AS minVirtualAddress, + max(virtualAddress) AS maxVirtualAddress, + sum(end-start) AS transferDuration, + sum(bytes) AS H2D + FROM + CUPTI_ACTIVITY_KIND_MEMCPY + WHERE copyKind = 11 + ), + ranges AS ( + SELECT + min(cpu.minVirtualAddress, gpu.minVirtualAddress, + h2d.minVirtualAddress, d2h.minVirtualAddress) AS minAddr, + max(cpu.maxVirtualAddress, gpu.maxVirtualAddress, + h2d.maxVirtualAddress, d2h.maxVirtualAddress) AS maxAddr + FROM + cpuSummary AS cpu, + gpuSummary AS gpu, + h2dTransferSummary AS h2d, + d2hTransferSummary AS d2h + ) +SELECT + h2dTransferSummary.h2d AS "Total HtoD Migration Size:mem_B", + d2hTransferSummary.d2h AS "Total DtoH Migration Size:mem_B", + cpuSummary.num AS "Total CPU Page Faults", + gpuSummary.num AS "Total GPU PageFaults", + ranges.minAddr AS "Minimum Virtual Address:addr_uint", + ranges.maxAddr AS "Maximum Virtual Address:addr_uint" +FROM + ranges, cpuSummary, gpuSummary, d2hTransferSummary, h2dTransferSummary +; +""" + + table_checks = { + 'CUPTI_ACTIVITY_KIND_MEMCPY': + "{DBFILE} does not contain CUDA memory transfers data.", + 'CUDA_UM_CPU_PAGE_FAULT_EVENTS': + "{DBFILE} does not contain CUDA Unified Memory CPU page faults data.", + 'CUDA_UM_GPU_PAGE_FAULT_EVENTS': + "{DBFILE} does not contain CUDA Unified Memory GPU page faults data.", + } + +if __name__ == "__main__": + UmTotalSum.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/umcpupagefaults.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/umcpupagefaults.py new file mode 100644 index 0000000000000000000000000000000000000000..b6eb9ecefcce36e05fbc83609308789bc240d3bb --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/umcpupagefaults.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class UMCPUPageFaultsSummary(nsysstats.StatsReport): + + display_name = 'DEPRECATED - Use um_cpu_page_faults_sum instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query = """ +WITH + summary AS ( + SELECT + CpuInstruction AS sourceId, + count(*) AS num + FROM + CUDA_UM_CPU_PAGE_FAULT_EVENTS + GROUP BY 1 + ) +SELECT + summary.num AS "CPU Page Faults", + ids.value AS "CPU Instruction Address" +FROM + summary +LEFT JOIN + StringIds AS ids + ON ids.id == summary.sourceId +ORDER BY 1 DESC -- CPU Page Faults +; +""" + + table_checks = { + 'CUDA_UM_CPU_PAGE_FAULT_EVENTS': + "{DBFILE} does not contain CUDA Unified Memory CPU page faults data." + } + +if __name__ == "__main__": + UMCPUPageFaultsSummary.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/unifiedmemory.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/unifiedmemory.py new file mode 100644 index 0000000000000000000000000000000000000000..1b8e4ee0f1b051b7e8901bfe9e458bd49927b0f5 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/unifiedmemory.py @@ -0,0 +1,151 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class UnifiedMemorySummary(nsysstats.StatsReport): + + DEFAULT_ROW_LIMIT = 10 + + display_name = 'DEPRECATED - Use um_sum instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query = """ +WITH + cpuSummary AS ( + SELECT + address AS virtualAddress, + count(*) AS num + FROM + CUDA_UM_CPU_PAGE_FAULT_EVENTS + GROUP BY 1 + ), + gpuSummary AS ( + SELECT + address AS virtualAddress, + sum(numberOfPageFaults) AS num + FROM + CUDA_UM_GPU_PAGE_FAULT_EVENTS + GROUP BY 1 + ), + d2hTransferSummary AS ( + SELECT + virtualAddress AS virtualAddress, + sum(end-start) AS transferDuration, + sum(bytes) AS D2H + FROM + CUPTI_ACTIVITY_KIND_MEMCPY + WHERE copyKind = 12 + GROUP BY 1 + ), + h2dTransferSummary AS ( + SELECT + virtualAddress AS virtualAddress, + sum(end-start) AS transferDuration, + sum(bytes) AS H2D + FROM + CUPTI_ACTIVITY_KIND_MEMCPY + WHERE copyKind = 11 + GROUP BY 1 + ), + PageFaults AS ( + SELECT + cpuSummary.virtualAddress AS address, + cpuSummary.num AS cpuPageFaults, + gpuSummary.num AS gpuPageFaults + FROM + cpuSummary + LEFT JOIN gpuSummary USING(virtualAddress) + UNION ALL + SELECT + gpuSummary.virtualAddress AS address, + cpuSummary.num AS cpuPageFaults, + gpuSummary.num AS gpuPageFaults + FROM + gpuSummary + LEFT JOIN cpuSummary USING(virtualAddress) + WHERE cpuSummary.virtualAddress IS NULL + ), + Migrations AS ( + SELECT + d2hTransferSummary.virtualAddress AS address, + d2hTransferSummary.D2H AS d2h, + h2dTransferSummary.H2D AS h2d, + (IFNULL(d2hTransferSummary.D2H, 0) + + IFNULL(h2dTransferSummary.H2D, 0)) * + (1000000000 / (IFNULL(d2hTransferSummary.transferDuration, 0) + + IFNULL(h2dTransferSummary.transferDuration, 0))) AS tput + FROM + d2hTransferSummary + LEFT JOIN h2dTransferSummary USING(virtualAddress) + UNION ALL + SELECT + h2dTransferSummary.virtualAddress AS address, + d2hTransferSummary.D2H AS d2h, + h2dTransferSummary.H2D AS h2d, + (IFNULL(d2hTransferSummary.D2H, 0) + + IFNULL(h2dTransferSummary.H2D, 0)) * + (1000000000 / (IFNULL(d2hTransferSummary.transferDuration, 0) + + IFNULL(h2dTransferSummary.transferDuration, 0))) AS tput + FROM + h2dTransferSummary + LEFT JOIN d2hTransferSummary USING(virtualAddress) + WHERE d2hTransferSummary.virtualAddress IS NULL + ) +SELECT + PageFaults.address AS "Virtual Address:addr_uint", + Migrations.h2d AS "HtoD Migration size:mem_B", + Migrations.d2h AS "DtoH Migration size:mem_B", + PageFaults.cpuPageFaults AS "CPU Page Faults", + PageFaults.gpuPageFaults AS " GPU Page Faults", + Migrations.tput AS "Migration Throughput:thru_B" +FROM PageFaults +LEFT JOIN Migrations USING(address) +UNION ALL +SELECT + Migrations.address AS "Virtual Address:addr_uint", + Migrations.h2d AS "HtoD Migration size:mem_B", + Migrations.d2h AS "DtoH Migration size:mem_B", + PageFaults.cpuPageFaults AS "CPU Page Faults", + PageFaults.gpuPageFaults AS " GPU Page Faults", + Migrations.tput AS "Migration Throughput:thru_B" +FROM Migrations +LEFT JOIN PageFaults USING(address) +WHERE PageFaults.address IS NULL +ORDER BY 6 DESC -- Migration Throughput +LIMIT {LIMIT_ROW} +; +""" + + table_checks = { + 'CUPTI_ACTIVITY_KIND_MEMCPY': + "{DBFILE} does not contain CUDA memory transfers data.", + 'CUDA_UM_CPU_PAGE_FAULT_EVENTS': + "{DBFILE} does not contain CUDA Unified Memory CPU page faults data.", + 'CUDA_UM_GPU_PAGE_FAULT_EVENTS': + "{DBFILE} does not contain CUDA Unified Memory GPU page faults data.", + } + + _arg_opts = [ + [['rows'], {'type': int, 'help': 'max rows', 'default': DEFAULT_ROW_LIMIT}], + ] + + def setup(self): + err = super().setup() + if err != None: + return err + + self.query = self.query.format(LIMIT_ROW = self.parsed_args.rows) + +if __name__ == "__main__": + UnifiedMemorySummary.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/unifiedmemorytotals.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/unifiedmemorytotals.py new file mode 100644 index 0000000000000000000000000000000000000000..97eab7f1dd23276f3b1e5f4b362c946f1777ef32 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/unifiedmemorytotals.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class UMTotalsSummary(nsysstats.StatsReport): + + display_name = 'DEPRECATED - Use um_total_sum instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query = """ +WITH + cpuSummary AS ( + SELECT + min(address) AS minVirtualAddress, + max(address) AS maxVirtualAddress, + count(*) AS num + FROM + CUDA_UM_CPU_PAGE_FAULT_EVENTS + ), + gpuSummary AS ( + SELECT + min(address) AS minVirtualAddress, + max(address) AS maxVirtualAddress, + sum(numberOfPageFaults) AS num + FROM + CUDA_UM_GPU_PAGE_FAULT_EVENTS + ), + d2hTransferSummary AS ( + SELECT + min(virtualAddress) AS minVirtualAddress, + max(virtualAddress) AS maxVirtualAddress, + sum(end-start) AS transferDuration, + sum(bytes) AS D2H + FROM + CUPTI_ACTIVITY_KIND_MEMCPY + WHERE copyKind = 12 + ), + h2dTransferSummary AS ( + SELECT + min(virtualAddress) AS minVirtualAddress, + max(virtualAddress) AS maxVirtualAddress, + sum(end-start) AS transferDuration, + sum(bytes) AS H2D + FROM + CUPTI_ACTIVITY_KIND_MEMCPY + WHERE copyKind = 11 + ), + ranges AS ( + SELECT + min(cpu.minVirtualAddress, gpu.minVirtualAddress, + h2d.minVirtualAddress, d2h.minVirtualAddress) AS minAddr, + max(cpu.maxVirtualAddress, gpu.maxVirtualAddress, + h2d.maxVirtualAddress, d2h.maxVirtualAddress) AS maxAddr + FROM + cpuSummary AS cpu, + gpuSummary AS gpu, + h2dTransferSummary AS h2d, + d2hTransferSummary AS d2h + ) +SELECT + h2dTransferSummary.h2d AS "Total HtoD Migration Size:mem_B", + d2hTransferSummary.d2h AS "Total DtoH Migration Size:mem_B", + cpuSummary.num AS "Total CPU Page Faults", + gpuSummary.num AS "Total GPU PageFaults", + ranges.minAddr AS "Minimum Virtual Address:addr_uint", + ranges.maxAddr AS "Maximum Virtual Address:addr_uint" +FROM + ranges, cpuSummary, gpuSummary, d2hTransferSummary, h2dTransferSummary +; +""" + + table_checks = { + 'CUPTI_ACTIVITY_KIND_MEMCPY': + "{DBFILE} does not contain CUDA memory transfers data.", + 'CUDA_UM_CPU_PAGE_FAULT_EVENTS': + "{DBFILE} does not contain CUDA Unified Memory CPU page faults data.", + 'CUDA_UM_GPU_PAGE_FAULT_EVENTS': + "{DBFILE} does not contain CUDA Unified Memory GPU page faults data.", + } + +if __name__ == "__main__": + UMTotalsSummary.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/vulkan_api_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/vulkan_api_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..313c20db246b04a3ac33abd458908d77bbb42fd4 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/vulkan_api_sum.py @@ -0,0 +1,92 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class VulkanApiSum(nsysstats.StatsReport): + + display_name = 'Vulkan API Summary' + usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}} + + No arguments. + + Output: All time values default to nanoseconds + Time : Percentage of "Total Time" + Total Time : Total time used by all executions of this function + Num Calls: Number of calls to this function + Avg : Average execution time of this function + Med : Median execution time of this function + Min : Smallest execution time of this function + Max : Largest execution time of this function + StdDev : Standard deviation of the time of this function + Name : Name of the function + + This report provides a summary of Vulkan API functions and their + execution times. Note that the "Time" column is calculated + using a summation of the "Total Time" column, and represents that + function's percent of the execution time of the functions listed, + and not a percentage of the application wall or CPU execution time. +""" + + query = """ +WITH + summary AS ( + SELECT + nameId AS nameId, + sum(end - start) AS total, + count(*) AS num, + avg(end - start) AS avg, + median(end - start) AS med, + min(end - start) AS min, + max(end - start) AS max, + stdev(end - start) AS stddev + FROM + VULKAN_API + WHERE + eventClass = 53 -- TRACE_PROCESS_EVENT_VULKAN_API + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Num Calls", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + CASE substr(ids.value, -6, 2) + WHEN '_v' + THEN substr(ids.value, 1, length(value)-6) + ELSE ids.value + END AS "Name" +FROM + summary +LEFT JOIN + StringIds AS ids + ON ids.id == summary.nameId +ORDER BY 2 DESC +; +""" + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.', + 'VULKAN_API': + '{DBFILE} does not contain Vulkan API trace data.' + } + +if __name__ == "__main__": + VulkanApiSum.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/vulkan_api_trace.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/vulkan_api_trace.py new file mode 100644 index 0000000000000000000000000000000000000000..cd76de99e87f4415bfaabb38b37fdbb0525fd262 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/vulkan_api_trace.py @@ -0,0 +1,75 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class VulkanApiTrace(nsysstats.StatsReport): + + display_name = 'Vulkan API Trace' + usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}} + + No arguments. + + Output: All time values default to nanoseconds + Start : Timestamp when API call was made + Duration : Length of API calls + Name : API function name + Event Class : Vulkan trace event type + Context : Trace context ID + CorrID : Correlation used to map to other Vulkan calls + Pid : Process ID that made the call + Tid : Thread ID that made the call + T-Pri : Run priority of call thread + Thread Name : Name of thread that called API function + + This report provides a trace record of Vulkan API function calls and + their execution times. +""" + + query = """ +SELECT + api.start AS "Start:ts_ns", + api.end - api.start AS "Duration:dur_ns", + nstr.value AS "Name", + api.eventClass AS "Event Class", + api.contextId AS "Context", + api.correlationId AS "CorrID", + -- (api.globalTid >> 40) & 0xFF AS "HWid", + -- (api.globalTid >> 32) & 0xFF AS "VMid", + (api.globalTid >> 24) & 0xFFFFFF AS "Pid", + (api.globalTid ) & 0xFFFFFF AS "Tid", + tname.priority AS "T-Pri", + tstr.value AS "Thread Name" +FROM + VULKAN_API AS api +LEFT OUTER JOIN + StringIds AS nstr + ON nstr.id == api.nameId +LEFT OUTER JOIN + ThreadNames AS tname + ON tname.globalTid == api.globalTid +LEFT OUTER JOIN + StringIds AS tstr + ON tstr.id == tname.nameId +ORDER BY 1 +; +""" + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.', + 'ThreadNames': '{DBFILE} file does not contain ThreadNames table.', + 'VULKAN_API': + '{DBFILE} does not contain Vulkan API trace data.' + } + +if __name__ == "__main__": + VulkanApiTrace.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/vulkan_gpu_marker_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/vulkan_gpu_marker_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..7e7a07f1838c4eeba4a3c859652f67ff7972f3f5 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/vulkan_gpu_marker_sum.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class VulkanGpuMarkerSum(nsysstats.StatsReport): + + display_name = 'Vulkan GPU Range Summary' + usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}} + + No arguments. + + Output: All time values default to nanoseconds + Time : Percentage of "Total Time" + Total Time : Total time used by all instances of this range + Instances : Number of instances of this range + Avg : Average execution time of this range + Med : Median execution time of this range + Min : Smallest execution time of this range + Max : Largest execution time of this range + StdDev : Standard deviation of execution time of this range + Range : Name of the range + + This report provides a summary of Vulkan GPU debug markers, + and their execution times. Note that the "Time" column + is calculated using a summation of the "Total Time" column, and represents + that range's percent of the execution time of the ranges listed, and not a + percentage of the application wall or CPU execution time. +""" + + query = f""" +WITH + cmdDebugUtilsLabelEXTRanges AS ( + SELECT + * + FROM + VULKAN_WORKLOAD + WHERE textId IS NOT NULL + ), + summary AS ( + SELECT + cmdDebugUtilsLabelEXTRanges.textId AS textId, + sum(cmdDebugUtilsLabelEXTRanges.end - cmdDebugUtilsLabelEXTRanges.start) AS total, + count(*) AS num, + avg(cmdDebugUtilsLabelEXTRanges.end - cmdDebugUtilsLabelEXTRanges.start) AS avg, + median(cmdDebugUtilsLabelEXTRanges.end - cmdDebugUtilsLabelEXTRanges.start) AS med, + min(cmdDebugUtilsLabelEXTRanges.end - cmdDebugUtilsLabelEXTRanges.start) AS min, + max(cmdDebugUtilsLabelEXTRanges.end - cmdDebugUtilsLabelEXTRanges.start) AS max, + stdev(cmdDebugUtilsLabelEXTRanges.end - cmdDebugUtilsLabelEXTRanges.start) AS stddev + FROM + cmdDebugUtilsLabelEXTRanges + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) + +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Instances", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + ids.value AS "Range" +FROM + summary +LEFT JOIN + StringIds AS ids + ON ids.id == summary.textId +WHERE summary.total > 0 +ORDER BY 2 DESC +; +""" + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.', + 'VULKAN_WORKLOAD': + "{DBFILE} does not contain GPU Vulkan Debug Extension (GPU Vulkan Debug markers) data." + } + +if __name__ == "__main__": + VulkanGpuMarkerSum.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/vulkan_marker_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/vulkan_marker_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..82dfbfaed27fcc1afc47e65244b0aa84da9fd25c --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/vulkan_marker_sum.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class VulkanMarkerSum(nsysstats.StatsReport): + + display_name = 'Vulkan Range Summary' + usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}} + + No arguments. + + Output: All time values default to nanoseconds + Time : Percentage of "Total Time" + Total Time : Total time used by all instances of this range + Instances : Number of instances of this range + Avg : Average execution time of this range + Med : Median execution time of this range + Min : Smallest execution time of this range + Max : Largest execution time of this range + StdDev : Standard deviation of execution time of this range + Range : Name of the range + + This report provides a summary of Vulkan debug markers on the CPU, + and their execution times. Note that the "Time" column + is calculated using a summation of the "Total Time" column, and represents + that range's percent of the execution time of the ranges listed, and not a + percentage of the application wall or CPU execution time. +""" + + query = f""" +WITH + summary AS ( + SELECT + begin.textId AS textId, + sum(end.start - begin.end) AS total, + count(*) AS num, + avg(end.start - begin.end) AS avg, + median(end.start - begin.end) AS med, + min(end.start - begin.end) AS min, + max(end.start - begin.end) AS max, + stdev(end.start - begin.end) AS stddev + FROM + VULKAN_DEBUG_API AS begin + JOIN + VULKAN_DEBUG_API AS end + ON begin.correlationId == end.correlationId + AND begin.globalTid == end.globalTid + WHERE begin.textId IS NOT NULL + AND end.textId IS NULL + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Instances", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + ids.value AS "Range" +FROM + summary +LEFT JOIN + StringIds AS ids + ON ids.id == summary.textId +WHERE summary.total > 0 +ORDER BY 2 DESC +; +""" + + table_checks = { + 'StringIds': '{DBFILE} file does not contain StringIds table.', + 'VULKAN_DEBUG_API': + "{DBFILE} does not contain Vulkan Debug Extension (Vulkan Debug Util) data." + } + +if __name__ == "__main__": + VulkanMarkerSum.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/vulkanapisum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/vulkanapisum.py new file mode 100644 index 0000000000000000000000000000000000000000..95280a2bdef717e77088627c345993c1888a2fac --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/vulkanapisum.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class VulkanAPISummary(nsysstats.StatsReport): + + display_name = 'DEPRECATED - Use vulkan_api_sum instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query = """ +WITH + summary AS ( + SELECT + nameId AS nameId, + sum(end - start) AS total, + count(*) AS num, + avg(end - start) AS avg, + median(end - start) AS med, + min(end - start) AS min, + max(end - start) AS max, + stdev(end - start) AS stddev + FROM + VULKAN_API + WHERE + eventClass = 53 -- TRACE_PROCESS_EVENT_VULKAN_API + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Num Calls", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + CASE substr(ids.value, -6, 2) + WHEN '_v' + THEN substr(ids.value, 1, length(value)-6) + ELSE ids.value + END AS "Name" +FROM + summary +LEFT JOIN + StringIds AS ids + ON ids.id == summary.nameId +ORDER BY 2 DESC +; +""" + + table_checks = { + 'VULKAN_API': + '{DBFILE} does not contain Vulkan API trace data.' + } + +if __name__ == "__main__": + VulkanAPISummary.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/vulkanapitrace.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/vulkanapitrace.py new file mode 100644 index 0000000000000000000000000000000000000000..c6599bed733d4a005aecc365fef6ff789aa6fe96 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/vulkanapitrace.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class VulkanAPITrace(nsysstats.StatsReport): + + display_name = 'DEPRECATED - Use vulkan_api_trace instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query = """ +SELECT + api.start AS "Start:ts_ns", + api.end - api.start AS "Duration:dur_ns", + nstr.value AS "Name", + api.eventClass AS "Event Class", + api.contextId AS "Context", + api.correlationId AS "CorrID", + -- (api.globalTid >> 40) & 0xFF AS "HWid", + -- (api.globalTid >> 32) & 0xFF AS "VMid", + (api.globalTid >> 24) & 0xFFFFFF AS "Pid", + (api.globalTid ) & 0xFFFFFF AS "Tid", + tname.priority AS "T-Pri", + tstr.value AS "Thread Name" +FROM + VULKAN_API AS api +LEFT OUTER JOIN + StringIds AS nstr + ON nstr.id == api.nameId +LEFT OUTER JOIN + ThreadNames AS tname + ON tname.globalTid == api.globalTid +LEFT OUTER JOIN + StringIds AS tstr + ON tstr.id == tname.nameId +ORDER BY 1 +; +""" + + table_checks = { + 'VULKAN_API': + '{DBFILE} does not contain Vulkan API trace data.' + } + +if __name__ == "__main__": + VulkanAPITrace.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/vulkangpumarkersum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/vulkangpumarkersum.py new file mode 100644 index 0000000000000000000000000000000000000000..dceb27b65e3a68da2897148cd3d6c51606314d61 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/vulkangpumarkersum.py @@ -0,0 +1,75 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class VulkanGpuMarkerSummary(nsysstats.StatsReport): + + display_name = 'DEPRECATED - Use vulkan_gpu_marker_sum instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query = f""" +WITH + cmdDebugUtilsLabelEXTRanges AS ( + SELECT + * + FROM + VULKAN_WORKLOAD + WHERE textId IS NOT NULL + ), + summary AS ( + SELECT + cmdDebugUtilsLabelEXTRanges.textId AS textId, + sum(cmdDebugUtilsLabelEXTRanges.end - cmdDebugUtilsLabelEXTRanges.start) AS total, + count(*) AS num, + avg(cmdDebugUtilsLabelEXTRanges.end - cmdDebugUtilsLabelEXTRanges.start) AS avg, + median(cmdDebugUtilsLabelEXTRanges.end - cmdDebugUtilsLabelEXTRanges.start) AS med, + min(cmdDebugUtilsLabelEXTRanges.end - cmdDebugUtilsLabelEXTRanges.start) AS min, + max(cmdDebugUtilsLabelEXTRanges.end - cmdDebugUtilsLabelEXTRanges.start) AS max, + stdev(cmdDebugUtilsLabelEXTRanges.end - cmdDebugUtilsLabelEXTRanges.start) AS stddev + FROM + cmdDebugUtilsLabelEXTRanges + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) + +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Instances", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + ids.value AS "Range" +FROM + summary +LEFT JOIN + StringIds AS ids + ON ids.id == summary.textId +WHERE summary.total > 0 +ORDER BY 2 DESC +; +""" + + table_checks = { + 'VULKAN_WORKLOAD': + "{DBFILE} does not contain GPU Vulkan Debug Extension (GPU Vulkan Debug markers) data." + } + +if __name__ == "__main__": + VulkanGpuMarkerSummary.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/vulkanmarkerssum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/vulkanmarkerssum.py new file mode 100644 index 0000000000000000000000000000000000000000..5eeb8e3a4ed8cc0c2b01eee8ed9d63e526a7bd0a --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/vulkanmarkerssum.py @@ -0,0 +1,73 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class VulkanMarkerSummary(nsysstats.StatsReport): + + display_name = 'DEPRECATED - Use vulkan_marker_sum instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query = f""" +WITH + summary AS ( + SELECT + begin.textId AS textId, + sum(end.start - begin.end) AS total, + count(*) AS num, + avg(end.start - begin.end) AS avg, + median(end.start - begin.end) AS med, + min(end.start - begin.end) AS min, + max(end.start - begin.end) AS max, + stdev(end.start - begin.end) AS stddev + FROM + VULKAN_DEBUG_API AS begin + JOIN + VULKAN_DEBUG_API AS end + ON begin.correlationId == end.correlationId + AND begin.globalTid == end.globalTid + WHERE begin.textId IS NOT NULL + AND end.textId IS NULL + GROUP BY 1 + ), + totals AS ( + SELECT sum(total) AS total + FROM summary + ) +SELECT + round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%", + summary.total AS "Total Time:dur_ns", + summary.num AS "Instances", + round(summary.avg, 1) AS "Avg:dur_ns", + round(summary.med, 1) AS "Med:dur_ns", + summary.min AS "Min:dur_ns", + summary.max AS "Max:dur_ns", + round(summary.stddev, 1) AS "StdDev:dur_ns", + ids.value AS "Range" +FROM + summary +LEFT JOIN + StringIds AS ids + ON ids.id == summary.textId +WHERE summary.total > 0 +ORDER BY 2 DESC +; +""" + + table_checks = { + 'VULKAN_DEBUG_API': + "{DBFILE} does not contain Vulkan Debug Extension (Vulkan Debug Util) data." + } + +if __name__ == "__main__": + VulkanMarkerSummary.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/wddm_queue_sum.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/wddm_queue_sum.py new file mode 100644 index 0000000000000000000000000000000000000000..66f213829a06e6467f0b43c929d870c1c360e6e1 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/wddm_queue_sum.py @@ -0,0 +1,261 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class WddmQueueSum(nsysstats.StatsReport): + + display_name = 'WDDM Queue Utilization Summary' + usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}} + + No arguments. + + Output: All time values default to nanoseconds + Utilization : Percent of time when queue was not empty + Instances : Number of events + Avg : Average event duration + Med : Median event duration + Min : Minimum event duration + Max : Maximum event duration + StdDev : Standard deviation of event durations + Name : Event name + Q Type : Queue type ID + Q Name : Queue type name + PID : Process ID associated with event + GPU ID : GPU index + Context : WDDM context of queue + Engine : Engine type ID + Node Ord : WDDM node ordinal ID + + This report provides a summary of the WDDM queue utilization. The + utilization is calculated by comparing the amount of time when the queue had + one or more active events to total duration, as defined by the minimum and + maximum event time for a given Process ID (regardless of the queue context). +""" + + query_hw_queue_cte_table = """ + hw_queue_events AS ( + SELECT + parentDxgHwQueue AS parentContext, + context AS childContext + FROM + WDDM_HW_QUEUE_EVENTS + ), + hw_queue_child_count AS ( + SELECT + context AS childContext, + count(*) AS childCount + FROM + WDDM_HW_QUEUE_EVENTS + ), +""" + + query_hw_queue_cte_values = """ + hw_queue_events (parentContext, childContext) AS ( + VALUES (NULL, NULL) + ), + hw_queue_child_count (childContext, childCount) AS ( + VALUES (NULL, NULL) + ), +""" + + query_union_dma = """ + SELECT + 1 AS queueType, + 'dma' AS queueTypeName, + s.start AS start, + e.start AS end, + (s.globalTid >> 24) & 0x00FFFFFF AS pid, + s.gpu AS gpu, + s.context AS context, + s.engineType AS engineType + FROM + WDDM_DMA_PACKET_START_EVENTS AS s + JOIN + WDDM_DMA_PACKET_STOP_EVENTS AS e + ON s.context == e.context + AND s.uliSubmissionId == e.uliCompletionId + AND s.start <= e.start +""" + + query_union_queue = """ + SELECT + 0 AS queueType, + 'queue' AS queueTypeName, + s.start AS start, + e.start AS end, + (s.globalTid >> 24) & 0x00FFFFFF AS pid, + s.gpu AS gpu, + s.context AS context, + s.engineType AS engineType + FROM + WDDM_QUEUE_PACKET_START_EVENTS AS s + JOIN + WDDM_QUEUE_PACKET_STOP_EVENTS AS e + ON s.context == e.context + AND s.submitSequence == e.submitSequence + AND s.start <= e.start +""" + + query_union_paging = """ + SELECT + 2 AS queueType, + 'paging' AS queueTypeName, + s.start AS start, + e.start AS end, + (s.globalTid >> 24) & 0x00FFFFFF AS pid, + s.gpu AS gpu, + NULL AS context, + NULL AS engineType + FROM + WDDM_PAGING_QUEUE_PACKET_START_EVENTS AS s + JOIN + WDDM_PAGING_QUEUE_PACKET_STOP_EVENTS AS e + ON s.pagingQueue == e.pagingQueue + AND s.sequenceId == e.sequenceId + AND s.start <= e.start +""" + + query_union = """ + UNION ALL +""" + + query_stub = """ +WITH + engine_types (engineTypeId, engineTypeName) AS ( + VALUES + (0, 'Other'), + (1, '3D'), + (2, 'Video Decode'), + (3, 'Video Encode'), + (4, 'Video Processing'), + (5, 'Scene Assembly'), + (6, 'Copy'), + (7, 'Overlay'), + (8, 'Crypto') + ), + {HW_QUEUE_EVENTS_CTE} + events AS ( + {QUERY_UNION} + ), + times AS ( + SELECT + pid AS pid, + max(end) - min(start) AS duration + FROM + events + GROUP BY 1 + ), + groups AS ( + SELECT + unique_duration(start, end) AS duration, + count(*) AS count, + avg(end - start) AS avg, + median(end - start) AS med, + min(end - start) AS min, + max(end - start) AS max, + stdev(end - start) AS stddev, + queueType, + queueTypeName, + pid, + gpu, + context, + engineType + FROM + events + GROUP BY + pid, queueType, gpu, context, engineType + ) +SELECT + round(g.duration * 100.0 / t.duration, 1) AS "Utilization:ratio_%", + g.count AS "Instances", + round(g.avg, 1) AS "Avg:dur_ns", + round(g.med, 1) AS "Med:dur_ns", + g.min AS "Min:dur_ns", + g.max AS "Max:dur_ns", + round(g.stddev, 1) AS "StdDev:dur_ns", + CASE + WHEN hw.childContext != g.context AND g.engineType == 1 AND cc.childCount > 2 + THEN '3D/Comp' + WHEN g.engineType != 0 + THEN e.engineTypeName + WHEN c.friendlyName IS NOT NULL AND c.friendlyName != '' + THEN c.friendlyName + ELSE + 'Other' + END AS "Name", + g.queueType AS "Q Type", + g.queueTypeName AS "Q Name", + g.pid AS "PID", + g.gpu AS "GPU ID", + g.context AS "Context:addr_uint", + g.engineType AS "Engine", + coalesce(c.nodeOrdinal, 0) AS "Node Ord" +FROM + groups AS g +JOIN + times AS t + ON g.pid == t.pid +LEFT JOIN + TARGET_INFO_WDDM_CONTEXTS AS c + ON g.context == c.context +LEFT JOIN + hw_queue_events AS hw + ON g.context == hw.parentContext +LEFT JOIN + hw_queue_child_count AS cc + ON g.context == cc.childContext +LEFT JOIN + engine_types AS e + ON g.engineType == e.engineTypeId +ORDER BY + 1 DESC +""" + + table_checks = { + 'TARGET_INFO_WDDM_CONTEXTS': + "{DBFILE} does not contain WDDM context data." + } + + def setup(self): + err = super().setup() + if err != None: + return err + + hq_queue_cte = (self.query_hw_queue_cte_table if self.table_exists('WDDM_HW_QUEUE_EVENTS') + else self.query_hw_queue_cte_values) + + sub_queries = [] + + if (self.table_exists('WDDM_DMA_PACKET_START_EVENTS') and + self.table_exists('WDDM_DMA_PACKET_STOP_EVENTS')): + sub_queries.append(self.query_union_dma) + + if (self.table_exists('WDDM_QUEUE_PACKET_START_EVENTS') and + self.table_exists('WDDM_QUEUE_PACKET_STOP_EVENTS')): + sub_queries.append(self.query_union_queue) + + # Original script creates a table with this data but doesn't use it: + + # if (self.table_exists('WDDM_PAGING_QUEUE_PACKET_START_EVENTS') and + # self.table_exists('WDDM_PAGING_QUEUE_PACKET_STOP_EVENTS')): + # sub_queries.append(self.query_union_paging) + + if len(sub_queries) == 0: + return "{DBFILE} does not contain WDDM event data." + + self.query = self.query_stub.format( + HW_QUEUE_EVENTS_CTE = hq_queue_cte, + QUERY_UNION = self.query_union.join(sub_queries)) + +if __name__ == "__main__": + WddmQueueSum.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/wddmqueuesdetails.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/wddmqueuesdetails.py new file mode 100644 index 0000000000000000000000000000000000000000..749d2507bb3101ead1381e3c9866d5c8fa18af58 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/reports/wddmqueuesdetails.py @@ -0,0 +1,237 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class WddmQueuesSummary(nsysstats.StatsReport): + + display_name = 'DEPRECATED - Use wddm_queue_sum instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + query_hw_queue_cte_table = """ + hw_queue_events AS ( + SELECT + parentDxgHwQueue AS parentContext, + context AS childContext + FROM + WDDM_HW_QUEUE_EVENTS + ), + hw_queue_child_count AS ( + SELECT + context AS childContext, + count(*) AS childCount + FROM + WDDM_HW_QUEUE_EVENTS + ), +""" + + query_hw_queue_cte_values = """ + hw_queue_events (parentContext, childContext) AS ( + VALUES (NULL, NULL) + ), + hw_queue_child_count (childContext, childCount) AS ( + VALUES (NULL, NULL) + ), +""" + + query_union_dma = """ + SELECT + 1 AS queueType, + 'dma' AS queueTypeName, + s.start AS start, + e.start AS end, + (s.globalTid >> 24) & 0x00FFFFFF AS pid, + s.gpu AS gpu, + s.context AS context, + s.engineType AS engineType + FROM + WDDM_DMA_PACKET_START_EVENTS AS s + JOIN + WDDM_DMA_PACKET_STOP_EVENTS AS e + ON s.context == e.context + AND s.uliSubmissionId == e.uliCompletionId + AND s.start <= e.start +""" + + query_union_queue = """ + SELECT + 0 AS queueType, + 'queue' AS queueTypeName, + s.start AS start, + e.start AS end, + (s.globalTid >> 24) & 0x00FFFFFF AS pid, + s.gpu AS gpu, + s.context AS context, + s.engineType AS engineType + FROM + WDDM_QUEUE_PACKET_START_EVENTS AS s + JOIN + WDDM_QUEUE_PACKET_STOP_EVENTS AS e + ON s.context == e.context + AND s.submitSequence == e.submitSequence + AND s.start <= e.start +""" + + query_union_paging = """ + SELECT + 2 AS queueType, + 'paging' AS queueTypeName, + s.start AS start, + e.start AS end, + (s.globalTid >> 24) & 0x00FFFFFF AS pid, + s.gpu AS gpu, + NULL AS context, + NULL AS engineType + FROM + WDDM_PAGING_QUEUE_PACKET_START_EVENTS AS s + JOIN + WDDM_PAGING_QUEUE_PACKET_STOP_EVENTS AS e + ON s.pagingQueue == e.pagingQueue + AND s.sequenceId == e.sequenceId + AND s.start <= e.start +""" + + query_union = """ + UNION ALL +""" + + query_stub = """ +WITH + engine_types (engineTypeId, engineTypeName) AS ( + VALUES + (0, 'Other'), + (1, '3D'), + (2, 'Video Decode'), + (3, 'Video Encode'), + (4, 'Video Processing'), + (5, 'Scene Assembly'), + (6, 'Copy'), + (7, 'Overlay'), + (8, 'Crypto') + ), + {HW_QUEUE_EVENTS_CTE} + events AS ( + {QUERY_UNION} + ), + times AS ( + SELECT + pid AS pid, + max(end) - min(start) AS duration + FROM + events + GROUP BY 1 + ), + groups AS ( + SELECT + unique_duration(start, end) AS duration, + count(*) AS count, + avg(end - start) AS avg, + median(end - start) AS med, + min(end - start) AS min, + max(end - start) AS max, + stdev(end - start) AS stddev, + queueType, + queueTypeName, + pid, + gpu, + context, + engineType + FROM + events + GROUP BY + pid, queueType, gpu, context, engineType + ) +SELECT + round(g.duration * 100.0 / t.duration, 1) AS "Utilization:ratio_%", + g.count AS "Instances", + round(g.avg, 1) AS "Avg:dur_ns", + round(g.med, 1) AS "Med:dur_ns", + g.min AS "Min:dur_ns", + g.max AS "Max:dur_ns", + round(g.stddev, 1) AS "StdDev:dur_ns", + CASE + WHEN hw.childContext != g.context AND g.engineType == 1 AND cc.childCount > 2 + THEN '3D/Comp' + WHEN g.engineType != 0 + THEN e.engineTypeName + WHEN c.friendlyName IS NOT NULL AND c.friendlyName != '' + THEN c.friendlyName + ELSE + 'Other' + END AS "Name", + g.queueType AS "Q Type", + g.queueTypeName AS "Q Name", + g.pid AS "PID", + g.gpu AS "GPU ID", + g.context AS "Context:addr_uint", + g.engineType AS "Engine", + coalesce(c.nodeOrdinal, 0) AS "Node Ord" +FROM + groups AS g +JOIN + times AS t + ON g.pid == t.pid +LEFT JOIN + TARGET_INFO_WDDM_CONTEXTS AS c + ON g.context == c.context +LEFT JOIN + hw_queue_events AS hw + ON g.context == hw.parentContext +LEFT JOIN + hw_queue_child_count AS cc + ON g.context == cc.childContext +LEFT JOIN + engine_types AS e + ON g.engineType == e.engineTypeId +ORDER BY + 1 DESC +""" + + table_checks = { + 'TARGET_INFO_WDDM_CONTEXTS': + "{DBFILE} does not contain WDDM context data." + } + + def setup(self): + err = super().setup() + if err != None: + return err + + hq_queue_cte = (self.query_hw_queue_cte_table if self.table_exists('WDDM_HW_QUEUE_EVENTS') + else self.query_hw_queue_cte_values) + + sub_queries = [] + + if (self.table_exists('WDDM_DMA_PACKET_START_EVENTS') and + self.table_exists('WDDM_DMA_PACKET_STOP_EVENTS')): + sub_queries.append(self.query_union_dma) + + if (self.table_exists('WDDM_QUEUE_PACKET_START_EVENTS') and + self.table_exists('WDDM_QUEUE_PACKET_STOP_EVENTS')): + sub_queries.append(self.query_union_queue) + + # Original script creates a table with this data but doesn't use it: + + # if (self.table_exists('WDDM_PAGING_QUEUE_PACKET_START_EVENTS') and + # self.table_exists('WDDM_PAGING_QUEUE_PACKET_STOP_EVENTS')): + # sub_queries.append(self.query_union_paging) + + if len(sub_queries) == 0: + return "{DBFILE} does not contain WDDM event data." + + self.query = self.query_stub.format( + HW_QUEUE_EVENTS_CTE = hq_queue_cte, + QUERY_UNION = self.query_union.join(sub_queries)) + +if __name__ == "__main__": + WddmQueuesSummary.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/rules/README.txt b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/rules/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..e7e13b4760961cce3fde414ab004d015777ece4c --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/rules/README.txt @@ -0,0 +1,56 @@ + +This Python code used by the Nsight Systems applications. This includes both +the "nsys" CLI application and the "nsys-ui" desktop application. + + +The "/reports" directory contains Python code used by the +stats and reporting feature. + +The "/rules" directory contains Python code used by the +expert system feature. + + +These Python files are designed to be used as plug-in modules for the Nsight +Systems applications. THESE FILES ARE NOT DESIGNED TO BE RUN AS STANDALONE +SCRIPTS. Although it is possible to run some of these Python files directly, +this use-case is for building and testing, and not supported for general +customer use. + + + +NSYS-UI DESKTOP APPLICATION +--------------------------- + +To utilize these reports and rules in the "nsys-ui" desktop application, +please utilize the drop-down menu in the lower-right section of the +application window to select either stats or expert systems. Once that +pane is visible, you an select a specific report or rule from the list +on the left side of the pane. The results will be displayed on the right +side of the pane. + + + +NSYS COMMAND LINE APPLICATION +----------------------------- + +To run a stats report, please use the command: + + $ nsys stats --report + +To run an expert systems rule, please use the command: + + $ nsys analyze --rule + +The or is the name of the Python script without +the ".py" extension. + +To get a full list of the available reports & rules, the following commands +can be used: + + $ nsys stats --help-reports + $ nsys analyze --help-rules + +For more detailed information about a specific report, use the commands: + + $ nsys stats --help-reports + $ nsys analyze --help-rules diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/rules/cuda-async-memcpy.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/rules/cuda-async-memcpy.py new file mode 100644 index 0000000000000000000000000000000000000000..222bde9b99acfb008bac226d17b00348fe21f76e --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/rules/cuda-async-memcpy.py @@ -0,0 +1,100 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class AsyncMemcpyPageable(nsysstats.ExpertSystemsReport): + + display_name = 'DEPRECATED - Use cuda_memcpy_async instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + message_advice = ("The following APIs use PAGEABLE memory which causes" + " asynchronous CUDA memcpy operations to block and be executed" + " synchronously. This leads to low GPU utilization.\n\n" + "Suggestion: If applicable, use PINNED memory instead.") + + message_noresult = ("There were no problems detected related to memcpy" + " operations using pageable memory.") + + query_async_memcpy_pageable = """ + WITH + sid AS ( + SELECT + * + FROM + StringIds + WHERE + value LIKE 'cudaMemcpy%Async%' + ), + memcpy AS ( + SELECT + * + FROM + CUPTI_ACTIVITY_KIND_MEMCPY + WHERE + srcKind == 0 + OR dstKind == 0 + ) + SELECT + memcpy.end - memcpy.start AS "Duration:dur_ns", + memcpy.start AS "Start:ts_ns", + msrck.label AS "Src Kind", + mdstk.label AS "Dst Kind", + memcpy.bytes AS "Bytes:mem_B", + (memcpy.globalPid >> 24) & 0x00FFFFFF AS "PID", + memcpy.deviceId AS "Device ID", + memcpy.contextId AS "Context ID", + memcpy.streamId AS "Stream ID", + sid.value AS "API Name", + memcpy.globalPid AS "_Global ID", + memcpy.copyKind AS "_Copy Kind", + 'cuda' AS "_API" + FROM + memcpy + JOIN + sid + ON sid.id == runtime.nameId + JOIN + main.CUPTI_ACTIVITY_KIND_RUNTIME AS runtime + ON runtime.correlationId == memcpy.correlationId + LEFT JOIN + ENUM_CUDA_MEM_KIND AS msrck + ON srcKind == msrck.id + LEFT JOIN + ENUM_CUDA_MEM_KIND AS mdstk + ON dstKind == mdstk.id + ORDER BY + 1 DESC + LIMIT {ROW_LIMIT} +""" + + table_checks = { + 'CUPTI_ACTIVITY_KIND_RUNTIME': + "{DBFILE} could not be analyzed because it does not contain the required CUDA data." + " Does the application use CUDA runtime APIs?", + 'CUPTI_ACTIVITY_KIND_MEMCPY': + "{DBFILE} could not be analyzed because it does not contain the required CUDA data." + " Does the application use CUDA memcpy APIs?", + 'ENUM_CUDA_MEM_KIND': + "{DBFILE} does not contain ENUM_CUDA_MEM_KIND table." + } + + def setup(self): + err = super().setup() + if err != None: + return err + + self.query = self.query_async_memcpy_pageable.format(ROW_LIMIT = self._row_limit) + +if __name__ == "__main__": + AsyncMemcpyPageable.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/rules/cuda-sync-api.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/rules/cuda-sync-api.py new file mode 100644 index 0000000000000000000000000000000000000000..25f8de7360a40513782417305774bf5b4ddaf9a5 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/rules/cuda-sync-api.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class SyncAPI(nsysstats.ExpertSystemsReport): + + display_name = 'DEPRECATED - Use cuda_api_sync instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + message_advice = ("The following are synchronization APIs that block the" + " host until all issued CUDA calls are complete.\n\n" + "Suggestions:\n" + " 1. Avoid excessive use of synchronization.\n" + " 2. Use asynchronous CUDA event calls, such as cudaStreamWaitEvent()" + " and cudaEventSynchronize(), to prevent host synchronization.") + + message_noresult = ("There were no problems detected related to" + " synchronization APIs.") + + query_sync_api = """ + WITH + sid AS ( + SELECT + * + FROM + StringIds + WHERE + value like 'cudaDeviceSynchronize%' + OR value like 'cudaStreamSynchronize%' + ) + SELECT + runtime.end - runtime.start AS "Duration:dur_ns", + runtime.start AS "Start:ts_ns", + (runtime.globalTid >> 24) & 0x00FFFFFF AS "PID", + runtime.globalTid & 0xFFFFFF AS "TID", + sid.value AS "API Name", + runtime.globalTid AS "_Global ID", + 'cuda' AS "_API" + FROM + CUPTI_ACTIVITY_KIND_RUNTIME AS runtime + JOIN + sid + ON sid.id == runtime.nameId + ORDER BY + 1 DESC + LIMIT {ROW_LIMIT} +""" + + table_checks = { + 'CUPTI_ACTIVITY_KIND_RUNTIME': + "{DBFILE} could not be analyzed because it does not contain the required CUDA data." + " Does the application use CUDA runtime APIs?" + } + + def setup(self): + err = super().setup() + if err != None: + return err + + self.query = self.query_sync_api.format(ROW_LIMIT = self._row_limit) + +if __name__ == "__main__": + SyncAPI.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/rules/cuda-sync-memcpy.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/rules/cuda-sync-memcpy.py new file mode 100644 index 0000000000000000000000000000000000000000..fc9f078a442e954a36e32f357b962c08cfc79968 --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/rules/cuda-sync-memcpy.py @@ -0,0 +1,101 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class SyncMemcpy(nsysstats.ExpertSystemsReport): + + display_name = 'DEPRECATED - Use cuda_memcpy_sync instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + message_advice = ("The following are synchronous memory transfers that" + " block the host. This does not include host to device transfers of a" + " memory block of 64 KB or less.\n\n" + "Suggestion: Use cudaMemcpy*Async() APIs instead.") + + message_noresult = ("There were no problems detected related to" + " synchronous memcpy operations.") + + query_sync_memcpy = """ + WITH + sid AS ( + SELECT + * + FROM + StringIds + WHERE + value LIKE 'cudaMemcpy%' + AND value NOT LIKE '%Async%' + ), + memcpy AS ( + SELECT + * + FROM + CUPTI_ACTIVITY_KIND_MEMCPY + WHERE + NOT (bytes <= 64000 AND copyKind == 1) + AND NOT (srcDeviceId IS NOT NULL AND srcDeviceId == dstDeviceId) + ) + SELECT + memcpy.end - memcpy.start AS "Duration:dur_ns", + memcpy.start AS "Start:ts_ns", + msrck.label AS "Src Kind", + mdstk.label AS "Dst Kind", + memcpy.bytes AS "Bytes:mem_B", + (memcpy.globalPid >> 24) & 0x00FFFFFF AS "PID", + memcpy.deviceId AS "Device ID", + memcpy.contextId AS "Context ID", + memcpy.streamId AS "Stream ID", + sid.value AS "API Name", + memcpy.globalPid AS "_Global ID", + memcpy.copyKind AS "_Copy Kind", + 'cuda' AS "_API" + FROM + memcpy + JOIN + sid + ON sid.id == runtime.nameId + JOIN + main.CUPTI_ACTIVITY_KIND_RUNTIME AS runtime + ON runtime.correlationId == memcpy.correlationId + LEFT JOIN + ENUM_CUDA_MEM_KIND AS msrck + ON srcKind == msrck.id + LEFT JOIN + ENUM_CUDA_MEM_KIND AS mdstk + ON dstKind == mdstk.id + ORDER BY + 1 DESC + LIMIT {ROW_LIMIT} +""" + + table_checks = { + 'CUPTI_ACTIVITY_KIND_RUNTIME': + "{DBFILE} could not be analyzed because it does not contain the required CUDA data." + " Does the application use CUDA runtime APIs?", + 'CUPTI_ACTIVITY_KIND_MEMCPY': + "{DBFILE} could not be analyzed because it does not contain the required CUDA data." + " Does the application use CUDA memcpy APIs?", + 'ENUM_CUDA_MEM_KIND': + "{DBFILE} does not contain ENUM_CUDA_MEM_KIND table." + } + + def setup(self): + err = super().setup() + if err != None: + return err + + self.query = self.query_sync_memcpy.format(ROW_LIMIT = self._row_limit) + +if __name__ == "__main__": + SyncMemcpy.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/rules/cuda-sync-memset.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/rules/cuda-sync-memset.py new file mode 100644 index 0000000000000000000000000000000000000000..7a7ac39805f0d82a912c9073d6c83629fb24a64b --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/rules/cuda-sync-memset.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class SyncMemset(nsysstats.ExpertSystemsReport): + + display_name = 'DEPRECATED - Use cuda_memset_sync instead' + usage = '{SCRIPT} -- {{DISPLAY_NAME}}' + should_display = False + + message_advice = ("The following are synchronization APIs that block the" + " host until all issued CUDA calls are complete.\n\n" + "Suggestions:\n" + " 1. Avoid excessive use of synchronization.\n" + " 2. Use asynchronous CUDA event calls, such as cudaStreamWaitEvent()" + " and cudaEventSynchronize(), to prevent host synchronization.") + + message_noresult = ("There were no problems detected related to" + " synchronization APIs.") + + query_sync_memset = """ + WITH + sid AS ( + SELECT + * + FROM + StringIds + WHERE + value LIKE 'cudaMemset%' + AND value NOT LIKE '%async%' + ), + memset AS ( + SELECT + * + FROM + CUPTI_ACTIVITY_KIND_MEMSET + WHERE + memKind == 1 + OR memKind == 4 + ) + SELECT + memset.end - memset.start AS "Duration:dur_ns", + memset.start AS "Start:ts_ns", + mk.label AS "Memory Kind", + memset.bytes AS "Bytes:mem_B", + (memset.globalPid >> 24) & 0x00FFFFFF AS "PID", + memset.deviceId AS "Device ID", + memset.contextId AS "Context ID", + memset.streamId AS "Stream ID", + sid.value AS "API Name", + memset.globalPid AS "_Global ID", + 'cuda' AS "_API" + FROM + memset + JOIN + sid + ON sid.id == runtime.nameId + JOIN + main.CUPTI_ACTIVITY_KIND_RUNTIME AS runtime + ON runtime.correlationId == memset.correlationId + LEFT JOIN + ENUM_CUDA_MEM_KIND AS mk + ON memKind == mk.id + ORDER BY + 1 DESC + LIMIT {ROW_LIMIT} +""" + + table_checks = { + 'CUPTI_ACTIVITY_KIND_RUNTIME': + "{DBFILE} could not be analyzed because it does not contain the required CUDA data." + " Does the application use CUDA runtime APIs?", + 'CUPTI_ACTIVITY_KIND_MEMSET': + "{DBFILE} could not be analyzed because it does not contain the required CUDA data." + " Does the application use CUDA memset APIs?", + 'ENUM_CUDA_MEM_KIND': + "{DBFILE} does not contain ENUM_CUDA_MEM_KIND table." + } + + def setup(self): + err = super().setup() + if err != None: + return err + + self.query = self.query_sync_memset.format(ROW_LIMIT = self._row_limit) + +if __name__ == "__main__": + SyncMemset.Main() diff --git a/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/rules/cuda_api_sync.py b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/rules/cuda_api_sync.py new file mode 100644 index 0000000000000000000000000000000000000000..fc798659fefa98e046dbfb9cbc400a9cb90c7d6e --- /dev/null +++ b/cuda_toolkit/nsight-compute/nsight-compute/2024.1.1/host/target-windows-x64/rules/cuda_api_sync.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python + +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NvidiaProprietary +# +# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual +# property and proprietary rights in and to this material, related +# documentation and any modifications thereto. Any use, reproduction, +# disclosure or distribution of this material and related documentation +# without an express license agreement from NVIDIA CORPORATION or +# its affiliates is strictly prohibited. + +import nsysstats + +class CudaApiSync(nsysstats.ExpertSystemsReport): + + display_name = "CUDA Synchronization APIs" + usage = f"""{{SCRIPT}}[: