Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_cupti/include/Openacc/cupti_openacc.h +98 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_cupti/include/Openmp/cupti_openmp.h +100 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_cupti/include/Openmp/omp-tools.h +1083 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_cupti/include/generated_cuda_runtime_api_meta.h +2316 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_cupti/include/generated_cuda_vdpau_interop_meta.h +38 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_cupti/include/generated_cudart_removed_meta.h +162 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_cupti/include/generated_nvtx_meta.h +247 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_cupti/include/nvperf_common.h +393 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_cupti/include/nvperf_cuda_host.h +179 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_cupti/include/nvperf_host.h +1152 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_cupti/include/nvperf_target.h +595 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_cupti/lib/__init__.py +0 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_nvrtc/__init__.py +0 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_nvrtc/include/__init__.py +0 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_nvrtc/include/nvrtc.h +876 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_nvrtc/lib/__init__.py +0 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/__init__.py +0 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/__init__.py +0 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/builtin_types.h +64 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/channel_descriptor.h +588 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/common_functions.h +65 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups.h +1743 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/details/async.h +452 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/details/coalesced_reduce.h +95 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/details/coalesced_scan.h +174 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/details/driver_abi.h +99 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/details/functional.h +212 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/details/helpers.h +693 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/details/info.h +345 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/details/invoke.h +189 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/details/memory.h +136 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/details/partitioning.h +160 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/details/reduce.h +424 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/details/scan.h +320 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/details/sync.h +281 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/memcpy_async.h +62 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/reduce.h +63 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/scan.h +63 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cuComplex.h +348 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cuda.h +0 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cudaEGL.h +659 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cudaEGLTypedefs.h +96 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cudaGL.h +608 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cudaGLTypedefs.h +123 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cudaProfilerTypedefs.h +78 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cudaTypedefs.h +0 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cudaVDPAU.h +282 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cudaVDPAUTypedefs.h +90 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cuda_awbarrier.h +280 -0
- miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cuda_awbarrier_helpers.h +365 -0
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_cupti/include/Openacc/cupti_openacc.h
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2017 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO LICENSEE:
|
| 5 |
+
*
|
| 6 |
+
* This source code and/or documentation ("Licensed Deliverables") are
|
| 7 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 8 |
+
* international Copyright laws.
|
| 9 |
+
*
|
| 10 |
+
* These Licensed Deliverables contained herein is PROPRIETARY and
|
| 11 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and
|
| 12 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 13 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 14 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 15 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 16 |
+
* of the Licensed Deliverables to any third party without the express
|
| 17 |
+
* written consent of NVIDIA is prohibited.
|
| 18 |
+
*
|
| 19 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 20 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 21 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
|
| 22 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 23 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 24 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 25 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 26 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 27 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 28 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 29 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 30 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 31 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 32 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 33 |
+
*
|
| 34 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 35 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 36 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 37 |
+
* computer software documentation" as such terms are used in 48
|
| 38 |
+
* C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
|
| 39 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 40 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 41 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 42 |
+
* only those rights set forth herein.
|
| 43 |
+
*
|
| 44 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 45 |
+
* software must include, in the user documentation and internal
|
| 46 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 47 |
+
* Users Notice.
|
| 48 |
+
*/
|
| 49 |
+
|
| 50 |
+
#include <cuda_stdint.h>
|
| 51 |
+
|
| 52 |
+
#if !defined(_CUPTI_OPENACC_H_)
|
| 53 |
+
#define _CUPTI_OPENACC_H_
|
| 54 |
+
|
| 55 |
+
#ifndef CUPTIAPI
|
| 56 |
+
#ifdef _WIN32
|
| 57 |
+
#define CUPTIAPI __stdcall
|
| 58 |
+
#else
|
| 59 |
+
#define CUPTIAPI
|
| 60 |
+
#endif
|
| 61 |
+
#endif
|
| 62 |
+
|
| 63 |
+
#if defined(__LP64__)
|
| 64 |
+
#define CUPTILP64 1
|
| 65 |
+
#elif defined(_WIN64)
|
| 66 |
+
#define CUPTILP64 1
|
| 67 |
+
#else
|
| 68 |
+
#undef CUPTILP64
|
| 69 |
+
#endif
|
| 70 |
+
|
| 71 |
+
#if defined(__cplusplus)
|
| 72 |
+
extern "C" {
|
| 73 |
+
#endif
|
| 74 |
+
|
| 75 |
+
#if defined(__GNUC__) && defined(CUPTI_LIB)
|
| 76 |
+
#pragma GCC visibility push(default)
|
| 77 |
+
#endif
|
| 78 |
+
|
| 79 |
+
/**
|
| 80 |
+
* \brief Initialize OpenACC support
|
| 81 |
+
*
|
| 82 |
+
* \param profRegister function of type acc_prof_reg as obtained from acc_register_library
|
| 83 |
+
* \param profUnregister function of type acc_prof_reg as obtained from acc_register_library
|
| 84 |
+
* \param profLookup function of type acc_prof_lookup as obtained from acc_register_library
|
| 85 |
+
*/
|
| 86 |
+
CUptiResult CUPTIAPI
|
| 87 |
+
cuptiOpenACCInitialize(void *profRegister, void *profUnregister, void *profLookup);
|
| 88 |
+
|
| 89 |
+
#if defined(__GNUC__) && defined(CUPTI_LIB)
|
| 90 |
+
#pragma GCC visibility pop
|
| 91 |
+
#endif
|
| 92 |
+
|
| 93 |
+
#if defined(__cplusplus)
|
| 94 |
+
}
|
| 95 |
+
#endif
|
| 96 |
+
|
| 97 |
+
#endif /*_CUPTI_OPENACC_H_*/
|
| 98 |
+
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_cupti/include/Openmp/cupti_openmp.h
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2018 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO LICENSEE:
|
| 5 |
+
*
|
| 6 |
+
* This source code and/or documentation ("Licensed Deliverables") are
|
| 7 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 8 |
+
* international Copyright laws.
|
| 9 |
+
*
|
| 10 |
+
* These Licensed Deliverables contained herein is PROPRIETARY and
|
| 11 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and
|
| 12 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 13 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 14 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 15 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 16 |
+
* of the Licensed Deliverables to any third party without the express
|
| 17 |
+
* written consent of NVIDIA is prohibited.
|
| 18 |
+
*
|
| 19 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 20 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 21 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
|
| 22 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 23 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 24 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 25 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 26 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 27 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 28 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 29 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 30 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 31 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 32 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 33 |
+
*
|
| 34 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 35 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 36 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 37 |
+
* computer software documentation" as such terms are used in 48
|
| 38 |
+
* C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
|
| 39 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 40 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 41 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 42 |
+
* only those rights set forth herein.
|
| 43 |
+
*
|
| 44 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 45 |
+
* software must include, in the user documentation and internal
|
| 46 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 47 |
+
* Users Notice.
|
| 48 |
+
*/
|
| 49 |
+
|
| 50 |
+
#include <cuda_stdint.h>
|
| 51 |
+
#include "Openmp/omp-tools.h"
|
| 52 |
+
|
| 53 |
+
#if !defined(_CUPTI_OPENMP_H_)
|
| 54 |
+
#define _CUPTI_OPENMP_H_
|
| 55 |
+
|
| 56 |
+
#ifndef CUPTIAPI
|
| 57 |
+
#ifdef _WIN32
|
| 58 |
+
#define CUPTIAPI __stdcall
|
| 59 |
+
#else
|
| 60 |
+
#define CUPTIAPI
|
| 61 |
+
#endif
|
| 62 |
+
#endif
|
| 63 |
+
|
| 64 |
+
#if defined(__LP64__)
|
| 65 |
+
#define CUPTILP64 1
|
| 66 |
+
#elif defined(_WIN64)
|
| 67 |
+
#define CUPTILP64 1
|
| 68 |
+
#else
|
| 69 |
+
#undef CUPTILP64
|
| 70 |
+
#endif
|
| 71 |
+
|
| 72 |
+
#if defined(__cplusplus)
|
| 73 |
+
extern "C" {
|
| 74 |
+
#endif
|
| 75 |
+
|
| 76 |
+
#if defined(__GNUC__) && defined(CUPTI_LIB)
|
| 77 |
+
#pragma GCC visibility push(default)
|
| 78 |
+
#endif
|
| 79 |
+
|
| 80 |
+
/**
|
| 81 |
+
* \brief Initialize OPENMP support (deprecated, used before OpenMP 5.0)
|
| 82 |
+
*
|
| 83 |
+
*/
|
| 84 |
+
int CUPTIAPI cuptiOpenMpInitialize(ompt_function_lookup_t ompt_fn_lookup, const char *runtime_version, unsigned int ompt_version);
|
| 85 |
+
|
| 86 |
+
/**
|
| 87 |
+
* \brief Initialize OPENMP support
|
| 88 |
+
*
|
| 89 |
+
*/
|
| 90 |
+
int CUPTIAPI cuptiOpenMpInitialize_v2(ompt_function_lookup_t lookup, int initial_device_num, ompt_data_t *tool_data);
|
| 91 |
+
|
| 92 |
+
#if defined(__GNUC__) && defined(CUPTI_LIB)
|
| 93 |
+
#pragma GCC visibility pop
|
| 94 |
+
#endif
|
| 95 |
+
|
| 96 |
+
#if defined(__cplusplus)
|
| 97 |
+
}
|
| 98 |
+
#endif
|
| 99 |
+
|
| 100 |
+
#endif /*_CUPTI_OPENMP_H_*/
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_cupti/include/Openmp/omp-tools.h
ADDED
|
@@ -0,0 +1,1083 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* include/50/omp-tools.h.var
|
| 3 |
+
*/
|
| 4 |
+
|
| 5 |
+
//===----------------------------------------------------------------------===//
|
| 6 |
+
//
|
| 7 |
+
// The LLVM Compiler Infrastructure
|
| 8 |
+
//
|
| 9 |
+
// This file is dual licensed under the MIT and the University of Illinois Open
|
| 10 |
+
// Source Licenses. See LICENSE.txt for details.
|
| 11 |
+
//
|
| 12 |
+
//===----------------------------------------------------------------------===//
|
| 13 |
+
|
| 14 |
+
#ifndef __OMPT__
|
| 15 |
+
#define __OMPT__
|
| 16 |
+
|
| 17 |
+
/*****************************************************************************
|
| 18 |
+
* system include files
|
| 19 |
+
*****************************************************************************/
|
| 20 |
+
|
| 21 |
+
#include <stdint.h>
|
| 22 |
+
#include <stddef.h>
|
| 23 |
+
|
| 24 |
+
/*****************************************************************************
|
| 25 |
+
* iteration macros
|
| 26 |
+
*****************************************************************************/
|
| 27 |
+
|
| 28 |
+
#define FOREACH_OMPT_INQUIRY_FN(macro) \
|
| 29 |
+
macro (ompt_enumerate_states) \
|
| 30 |
+
macro (ompt_enumerate_mutex_impls) \
|
| 31 |
+
\
|
| 32 |
+
macro (ompt_set_callback) \
|
| 33 |
+
macro (ompt_get_callback) \
|
| 34 |
+
\
|
| 35 |
+
macro (ompt_get_state) \
|
| 36 |
+
\
|
| 37 |
+
macro (ompt_get_parallel_info) \
|
| 38 |
+
macro (ompt_get_task_info) \
|
| 39 |
+
macro (ompt_get_task_memory) \
|
| 40 |
+
macro (ompt_get_thread_data) \
|
| 41 |
+
macro (ompt_get_unique_id) \
|
| 42 |
+
macro (ompt_finalize_tool) \
|
| 43 |
+
\
|
| 44 |
+
macro(ompt_get_num_procs) \
|
| 45 |
+
macro(ompt_get_num_places) \
|
| 46 |
+
macro(ompt_get_place_proc_ids) \
|
| 47 |
+
macro(ompt_get_place_num) \
|
| 48 |
+
macro(ompt_get_partition_place_nums) \
|
| 49 |
+
macro(ompt_get_proc_id) \
|
| 50 |
+
\
|
| 51 |
+
macro(ompt_get_target_info) \
|
| 52 |
+
macro(ompt_get_num_devices)
|
| 53 |
+
|
| 54 |
+
#define FOREACH_OMPT_STATE(macro) \
|
| 55 |
+
\
|
| 56 |
+
/* first available state */ \
|
| 57 |
+
macro (ompt_state_undefined, 0x102) /* undefined thread state */ \
|
| 58 |
+
\
|
| 59 |
+
/* work states (0..15) */ \
|
| 60 |
+
macro (ompt_state_work_serial, 0x000) /* working outside parallel */ \
|
| 61 |
+
macro (ompt_state_work_parallel, 0x001) /* working within parallel */ \
|
| 62 |
+
macro (ompt_state_work_reduction, 0x002) /* performing a reduction */ \
|
| 63 |
+
\
|
| 64 |
+
/* barrier wait states (16..31) */ \
|
| 65 |
+
macro (ompt_state_wait_barrier, 0x010) /* waiting at a barrier */ \
|
| 66 |
+
macro (ompt_state_wait_barrier_implicit_parallel, 0x011) \
|
| 67 |
+
/* implicit barrier at the end of parallel region */\
|
| 68 |
+
macro (ompt_state_wait_barrier_implicit_workshare, 0x012) \
|
| 69 |
+
/* implicit barrier at the end of worksharing */ \
|
| 70 |
+
macro (ompt_state_wait_barrier_implicit, 0x013) /* implicit barrier */ \
|
| 71 |
+
macro (ompt_state_wait_barrier_explicit, 0x014) /* explicit barrier */ \
|
| 72 |
+
\
|
| 73 |
+
/* task wait states (32..63) */ \
|
| 74 |
+
macro (ompt_state_wait_taskwait, 0x020) /* waiting at a taskwait */ \
|
| 75 |
+
macro (ompt_state_wait_taskgroup, 0x021) /* waiting at a taskgroup */ \
|
| 76 |
+
\
|
| 77 |
+
/* mutex wait states (64..127) */ \
|
| 78 |
+
macro (ompt_state_wait_mutex, 0x040) \
|
| 79 |
+
macro (ompt_state_wait_lock, 0x041) /* waiting for lock */ \
|
| 80 |
+
macro (ompt_state_wait_critical, 0x042) /* waiting for critical */ \
|
| 81 |
+
macro (ompt_state_wait_atomic, 0x043) /* waiting for atomic */ \
|
| 82 |
+
macro (ompt_state_wait_ordered, 0x044) /* waiting for ordered */ \
|
| 83 |
+
\
|
| 84 |
+
/* target wait states (128..255) */ \
|
| 85 |
+
macro (ompt_state_wait_target, 0x080) /* waiting for target region */ \
|
| 86 |
+
macro (ompt_state_wait_target_map, 0x081) /* waiting for target data mapping operation */ \
|
| 87 |
+
macro (ompt_state_wait_target_update, 0x082) /* waiting for target update operation */ \
|
| 88 |
+
\
|
| 89 |
+
/* misc (256..511) */ \
|
| 90 |
+
macro (ompt_state_idle, 0x100) /* waiting for work */ \
|
| 91 |
+
macro (ompt_state_overhead, 0x101) /* overhead excluding wait states */ \
|
| 92 |
+
\
|
| 93 |
+
/* implementation-specific states (512..) */
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
#define FOREACH_KMP_MUTEX_IMPL(macro) \
|
| 97 |
+
macro (kmp_mutex_impl_none, 0) /* unknown implementation */ \
|
| 98 |
+
macro (kmp_mutex_impl_spin, 1) /* based on spin */ \
|
| 99 |
+
macro (kmp_mutex_impl_queuing, 2) /* based on some fair policy */ \
|
| 100 |
+
macro (kmp_mutex_impl_speculative, 3) /* based on HW-supported speculation */
|
| 101 |
+
|
| 102 |
+
#define FOREACH_OMPT_EVENT(macro) \
|
| 103 |
+
\
|
| 104 |
+
/*--- Mandatory Events ---*/ \
|
| 105 |
+
macro (ompt_callback_thread_begin, ompt_callback_thread_begin_t, 1) /* thread begin */ \
|
| 106 |
+
macro (ompt_callback_thread_end, ompt_callback_thread_end_t, 2) /* thread end */ \
|
| 107 |
+
\
|
| 108 |
+
macro (ompt_callback_parallel_begin, ompt_callback_parallel_begin_t, 3) /* parallel begin */ \
|
| 109 |
+
macro (ompt_callback_parallel_end, ompt_callback_parallel_end_t, 4) /* parallel end */ \
|
| 110 |
+
\
|
| 111 |
+
macro (ompt_callback_task_create, ompt_callback_task_create_t, 5) /* task begin */ \
|
| 112 |
+
macro (ompt_callback_task_schedule, ompt_callback_task_schedule_t, 6) /* task schedule */ \
|
| 113 |
+
macro (ompt_callback_implicit_task, ompt_callback_implicit_task_t, 7) /* implicit task */ \
|
| 114 |
+
\
|
| 115 |
+
macro (ompt_callback_target, ompt_callback_target_t, 8) /* target */ \
|
| 116 |
+
macro (ompt_callback_target_data_op, ompt_callback_target_data_op_t, 9) /* target data op */ \
|
| 117 |
+
macro (ompt_callback_target_submit, ompt_callback_target_submit_t, 10) /* target submit */ \
|
| 118 |
+
\
|
| 119 |
+
macro (ompt_callback_control_tool, ompt_callback_control_tool_t, 11) /* control tool */ \
|
| 120 |
+
\
|
| 121 |
+
macro (ompt_callback_device_initialize, ompt_callback_device_initialize_t, 12) /* device initialize */ \
|
| 122 |
+
macro (ompt_callback_device_finalize, ompt_callback_device_finalize_t, 13) /* device finalize */ \
|
| 123 |
+
\
|
| 124 |
+
macro (ompt_callback_device_load, ompt_callback_device_load_t, 14) /* device load */ \
|
| 125 |
+
macro (ompt_callback_device_unload, ompt_callback_device_unload_t, 15) /* device unload */ \
|
| 126 |
+
\
|
| 127 |
+
/* Optional Events */ \
|
| 128 |
+
macro (ompt_callback_sync_region_wait, ompt_callback_sync_region_t, 16) /* sync region wait begin or end */ \
|
| 129 |
+
\
|
| 130 |
+
macro (ompt_callback_mutex_released, ompt_callback_mutex_t, 17) /* mutex released */ \
|
| 131 |
+
\
|
| 132 |
+
macro (ompt_callback_dependences, ompt_callback_dependences_t, 18) /* report task dependences */ \
|
| 133 |
+
macro (ompt_callback_task_dependence, ompt_callback_task_dependence_t, 19) /* report task dependence */ \
|
| 134 |
+
\
|
| 135 |
+
macro (ompt_callback_work, ompt_callback_work_t, 20) /* task at work begin or end */ \
|
| 136 |
+
\
|
| 137 |
+
macro (ompt_callback_master, ompt_callback_master_t, 21) /* task at master begin or end */ \
|
| 138 |
+
\
|
| 139 |
+
macro (ompt_callback_target_map, ompt_callback_target_map_t, 22) /* target map */ \
|
| 140 |
+
\
|
| 141 |
+
macro (ompt_callback_sync_region, ompt_callback_sync_region_t, 23) /* sync region begin or end */ \
|
| 142 |
+
\
|
| 143 |
+
macro (ompt_callback_lock_init, ompt_callback_mutex_acquire_t, 24) /* lock init */ \
|
| 144 |
+
macro (ompt_callback_lock_destroy, ompt_callback_mutex_t, 25) /* lock destroy */ \
|
| 145 |
+
\
|
| 146 |
+
macro (ompt_callback_mutex_acquire, ompt_callback_mutex_acquire_t, 26) /* mutex acquire */ \
|
| 147 |
+
macro (ompt_callback_mutex_acquired, ompt_callback_mutex_t, 27) /* mutex acquired */ \
|
| 148 |
+
\
|
| 149 |
+
macro (ompt_callback_nest_lock, ompt_callback_nest_lock_t, 28) /* nest lock */ \
|
| 150 |
+
\
|
| 151 |
+
macro (ompt_callback_flush, ompt_callback_flush_t, 29) /* after executing flush */ \
|
| 152 |
+
\
|
| 153 |
+
macro (ompt_callback_cancel, ompt_callback_cancel_t, 30) /* cancel innermost binding region */ \
|
| 154 |
+
\
|
| 155 |
+
macro (ompt_callback_reduction, ompt_callback_sync_region_t, 31) /* reduction */ \
|
| 156 |
+
\
|
| 157 |
+
macro (ompt_callback_dispatch, ompt_callback_dispatch_t, 32) /* dispatch of work */
|
| 158 |
+
|
| 159 |
+
/*****************************************************************************
|
| 160 |
+
* implementation specific types
|
| 161 |
+
*****************************************************************************/
|
| 162 |
+
|
| 163 |
+
typedef enum kmp_mutex_impl_t {
|
| 164 |
+
#define kmp_mutex_impl_macro(impl, code) impl = code,
|
| 165 |
+
FOREACH_KMP_MUTEX_IMPL(kmp_mutex_impl_macro)
|
| 166 |
+
#undef kmp_mutex_impl_macro
|
| 167 |
+
} kmp_mutex_impl_t;
|
| 168 |
+
|
| 169 |
+
/*****************************************************************************
|
| 170 |
+
* definitions generated from spec
|
| 171 |
+
*****************************************************************************/
|
| 172 |
+
|
| 173 |
+
typedef enum ompt_callbacks_t {
|
| 174 |
+
ompt_callback_thread_begin = 1,
|
| 175 |
+
ompt_callback_thread_end = 2,
|
| 176 |
+
ompt_callback_parallel_begin = 3,
|
| 177 |
+
ompt_callback_parallel_end = 4,
|
| 178 |
+
ompt_callback_task_create = 5,
|
| 179 |
+
ompt_callback_task_schedule = 6,
|
| 180 |
+
ompt_callback_implicit_task = 7,
|
| 181 |
+
ompt_callback_target = 8,
|
| 182 |
+
ompt_callback_target_data_op = 9,
|
| 183 |
+
ompt_callback_target_submit = 10,
|
| 184 |
+
ompt_callback_control_tool = 11,
|
| 185 |
+
ompt_callback_device_initialize = 12,
|
| 186 |
+
ompt_callback_device_finalize = 13,
|
| 187 |
+
ompt_callback_device_load = 14,
|
| 188 |
+
ompt_callback_device_unload = 15,
|
| 189 |
+
ompt_callback_sync_region_wait = 16,
|
| 190 |
+
ompt_callback_mutex_released = 17,
|
| 191 |
+
ompt_callback_dependences = 18,
|
| 192 |
+
ompt_callback_task_dependence = 19,
|
| 193 |
+
ompt_callback_work = 20,
|
| 194 |
+
ompt_callback_master = 21,
|
| 195 |
+
ompt_callback_target_map = 22,
|
| 196 |
+
ompt_callback_sync_region = 23,
|
| 197 |
+
ompt_callback_lock_init = 24,
|
| 198 |
+
ompt_callback_lock_destroy = 25,
|
| 199 |
+
ompt_callback_mutex_acquire = 26,
|
| 200 |
+
ompt_callback_mutex_acquired = 27,
|
| 201 |
+
ompt_callback_nest_lock = 28,
|
| 202 |
+
ompt_callback_flush = 29,
|
| 203 |
+
ompt_callback_cancel = 30,
|
| 204 |
+
ompt_callback_reduction = 31,
|
| 205 |
+
ompt_callback_dispatch = 32
|
| 206 |
+
} ompt_callbacks_t;
|
| 207 |
+
|
| 208 |
+
typedef enum ompt_record_t {
|
| 209 |
+
ompt_record_ompt = 1,
|
| 210 |
+
ompt_record_native = 2,
|
| 211 |
+
ompt_record_invalid = 3
|
| 212 |
+
} ompt_record_t;
|
| 213 |
+
|
| 214 |
+
typedef enum ompt_record_native_t {
|
| 215 |
+
ompt_record_native_info = 1,
|
| 216 |
+
ompt_record_native_event = 2
|
| 217 |
+
} ompt_record_native_t;
|
| 218 |
+
|
| 219 |
+
typedef enum ompt_set_result_t {
|
| 220 |
+
ompt_set_error = 0,
|
| 221 |
+
ompt_set_never = 1,
|
| 222 |
+
ompt_set_impossible = 2,
|
| 223 |
+
ompt_set_sometimes = 3,
|
| 224 |
+
ompt_set_sometimes_paired = 4,
|
| 225 |
+
ompt_set_always = 5
|
| 226 |
+
} ompt_set_result_t;
|
| 227 |
+
|
| 228 |
+
typedef uint64_t ompt_id_t;
|
| 229 |
+
|
| 230 |
+
typedef uint64_t ompt_device_time_t;
|
| 231 |
+
|
| 232 |
+
typedef uint64_t ompt_buffer_cursor_t;
|
| 233 |
+
|
| 234 |
+
typedef enum ompt_thread_t {
|
| 235 |
+
ompt_thread_initial = 1,
|
| 236 |
+
ompt_thread_worker = 2,
|
| 237 |
+
ompt_thread_other = 3,
|
| 238 |
+
ompt_thread_unknown = 4
|
| 239 |
+
} ompt_thread_t;
|
| 240 |
+
|
| 241 |
+
typedef enum ompt_scope_endpoint_t {
|
| 242 |
+
ompt_scope_begin = 1,
|
| 243 |
+
ompt_scope_end = 2
|
| 244 |
+
} ompt_scope_endpoint_t;
|
| 245 |
+
|
| 246 |
+
typedef enum ompt_dispatch_t {
|
| 247 |
+
ompt_dispatch_iteration = 1,
|
| 248 |
+
ompt_dispatch_section = 2
|
| 249 |
+
} ompt_dispatch_t;
|
| 250 |
+
|
| 251 |
+
typedef enum ompt_sync_region_t {
|
| 252 |
+
ompt_sync_region_barrier = 1,
|
| 253 |
+
ompt_sync_region_barrier_implicit = 2,
|
| 254 |
+
ompt_sync_region_barrier_explicit = 3,
|
| 255 |
+
ompt_sync_region_barrier_implementation = 4,
|
| 256 |
+
ompt_sync_region_taskwait = 5,
|
| 257 |
+
ompt_sync_region_taskgroup = 6,
|
| 258 |
+
ompt_sync_region_reduction = 7
|
| 259 |
+
} ompt_sync_region_t;
|
| 260 |
+
|
| 261 |
+
typedef enum ompt_target_data_op_t {
|
| 262 |
+
ompt_target_data_alloc = 1,
|
| 263 |
+
ompt_target_data_transfer_to_device = 2,
|
| 264 |
+
ompt_target_data_transfer_from_device = 3,
|
| 265 |
+
ompt_target_data_delete = 4,
|
| 266 |
+
ompt_target_data_associate = 5,
|
| 267 |
+
ompt_target_data_disassociate = 6
|
| 268 |
+
} ompt_target_data_op_t;
|
| 269 |
+
|
| 270 |
+
typedef enum ompt_work_t {
|
| 271 |
+
ompt_work_loop = 1,
|
| 272 |
+
ompt_work_sections = 2,
|
| 273 |
+
ompt_work_single_executor = 3,
|
| 274 |
+
ompt_work_single_other = 4,
|
| 275 |
+
ompt_work_workshare = 5,
|
| 276 |
+
ompt_work_distribute = 6,
|
| 277 |
+
ompt_work_taskloop = 7
|
| 278 |
+
} ompt_work_t;
|
| 279 |
+
|
| 280 |
+
typedef enum ompt_mutex_t {
|
| 281 |
+
ompt_mutex_lock = 1,
|
| 282 |
+
ompt_mutex_test_lock = 2,
|
| 283 |
+
ompt_mutex_nest_lock = 3,
|
| 284 |
+
ompt_mutex_test_nest_lock = 4,
|
| 285 |
+
ompt_mutex_critical = 5,
|
| 286 |
+
ompt_mutex_atomic = 6,
|
| 287 |
+
ompt_mutex_ordered = 7
|
| 288 |
+
} ompt_mutex_t;
|
| 289 |
+
|
| 290 |
+
typedef enum ompt_native_mon_flag_t {
|
| 291 |
+
ompt_native_data_motion_explicit = 0x01,
|
| 292 |
+
ompt_native_data_motion_implicit = 0x02,
|
| 293 |
+
ompt_native_kernel_invocation = 0x04,
|
| 294 |
+
ompt_native_kernel_execution = 0x08,
|
| 295 |
+
ompt_native_driver = 0x10,
|
| 296 |
+
ompt_native_runtime = 0x20,
|
| 297 |
+
ompt_native_overhead = 0x40,
|
| 298 |
+
ompt_native_idleness = 0x80
|
| 299 |
+
} ompt_native_mon_flag_t;
|
| 300 |
+
|
| 301 |
+
typedef enum ompt_task_flag_t {
|
| 302 |
+
ompt_task_initial = 0x00000001,
|
| 303 |
+
ompt_task_implicit = 0x00000002,
|
| 304 |
+
ompt_task_explicit = 0x00000004,
|
| 305 |
+
ompt_task_target = 0x00000008,
|
| 306 |
+
ompt_task_undeferred = 0x08000000,
|
| 307 |
+
ompt_task_untied = 0x10000000,
|
| 308 |
+
ompt_task_final = 0x20000000,
|
| 309 |
+
ompt_task_mergeable = 0x40000000,
|
| 310 |
+
ompt_task_merged = 0x80000000
|
| 311 |
+
} ompt_task_flag_t;
|
| 312 |
+
|
| 313 |
+
typedef enum ompt_task_status_t {
|
| 314 |
+
ompt_task_complete = 1,
|
| 315 |
+
ompt_task_yield = 2,
|
| 316 |
+
ompt_task_cancel = 3,
|
| 317 |
+
ompt_task_detach = 4,
|
| 318 |
+
ompt_task_early_fulfill = 5,
|
| 319 |
+
ompt_task_late_fulfill = 6,
|
| 320 |
+
ompt_task_switch = 7
|
| 321 |
+
} ompt_task_status_t;
|
| 322 |
+
|
| 323 |
+
typedef enum ompt_target_t {
|
| 324 |
+
ompt_target = 1,
|
| 325 |
+
ompt_target_enter_data = 2,
|
| 326 |
+
ompt_target_exit_data = 3,
|
| 327 |
+
ompt_target_update = 4
|
| 328 |
+
} ompt_target_t;
|
| 329 |
+
|
| 330 |
+
typedef enum ompt_parallel_flag_t {
|
| 331 |
+
ompt_parallel_invoker_program = 0x00000001,
|
| 332 |
+
ompt_parallel_invoker_runtime = 0x00000002,
|
| 333 |
+
ompt_parallel_league = 0x40000000,
|
| 334 |
+
ompt_parallel_team = 0x80000000
|
| 335 |
+
} ompt_parallel_flag_t;
|
| 336 |
+
|
| 337 |
+
typedef enum ompt_target_map_flag_t {
|
| 338 |
+
ompt_target_map_flag_to = 0x01,
|
| 339 |
+
ompt_target_map_flag_from = 0x02,
|
| 340 |
+
ompt_target_map_flag_alloc = 0x04,
|
| 341 |
+
ompt_target_map_flag_release = 0x08,
|
| 342 |
+
ompt_target_map_flag_delete = 0x10,
|
| 343 |
+
ompt_target_map_flag_implicit = 0x20
|
| 344 |
+
} ompt_target_map_flag_t;
|
| 345 |
+
|
| 346 |
+
typedef enum ompt_dependence_type_t {
|
| 347 |
+
ompt_dependence_type_in = 1,
|
| 348 |
+
ompt_dependence_type_out = 2,
|
| 349 |
+
ompt_dependence_type_inout = 3,
|
| 350 |
+
ompt_dependence_type_mutexinoutset = 4,
|
| 351 |
+
ompt_dependence_type_source = 5,
|
| 352 |
+
ompt_dependence_type_sink = 6
|
| 353 |
+
} ompt_dependence_type_t;
|
| 354 |
+
|
| 355 |
+
typedef enum ompt_cancel_flag_t {
|
| 356 |
+
ompt_cancel_parallel = 0x01,
|
| 357 |
+
ompt_cancel_sections = 0x02,
|
| 358 |
+
ompt_cancel_loop = 0x04,
|
| 359 |
+
ompt_cancel_taskgroup = 0x08,
|
| 360 |
+
ompt_cancel_activated = 0x10,
|
| 361 |
+
ompt_cancel_detected = 0x20,
|
| 362 |
+
ompt_cancel_discarded_task = 0x40
|
| 363 |
+
} ompt_cancel_flag_t;
|
| 364 |
+
|
| 365 |
+
typedef uint64_t ompt_hwid_t;
|
| 366 |
+
|
| 367 |
+
typedef uint64_t ompt_wait_id_t;
|
| 368 |
+
|
| 369 |
+
typedef enum ompt_frame_flag_t {
|
| 370 |
+
ompt_frame_runtime = 0x00,
|
| 371 |
+
ompt_frame_application = 0x01,
|
| 372 |
+
ompt_frame_cfa = 0x10,
|
| 373 |
+
ompt_frame_framepointer = 0x20,
|
| 374 |
+
ompt_frame_stackaddress = 0x30
|
| 375 |
+
} ompt_frame_flag_t;
|
| 376 |
+
|
| 377 |
+
typedef enum ompt_state_t {
|
| 378 |
+
ompt_state_work_serial = 0x000,
|
| 379 |
+
ompt_state_work_parallel = 0x001,
|
| 380 |
+
ompt_state_work_reduction = 0x002,
|
| 381 |
+
|
| 382 |
+
ompt_state_wait_barrier = 0x010,
|
| 383 |
+
ompt_state_wait_barrier_implicit_parallel = 0x011,
|
| 384 |
+
ompt_state_wait_barrier_implicit_workshare = 0x012,
|
| 385 |
+
ompt_state_wait_barrier_implicit = 0x013,
|
| 386 |
+
ompt_state_wait_barrier_explicit = 0x014,
|
| 387 |
+
|
| 388 |
+
ompt_state_wait_taskwait = 0x020,
|
| 389 |
+
ompt_state_wait_taskgroup = 0x021,
|
| 390 |
+
|
| 391 |
+
ompt_state_wait_mutex = 0x040,
|
| 392 |
+
ompt_state_wait_lock = 0x041,
|
| 393 |
+
ompt_state_wait_critical = 0x042,
|
| 394 |
+
ompt_state_wait_atomic = 0x043,
|
| 395 |
+
ompt_state_wait_ordered = 0x044,
|
| 396 |
+
|
| 397 |
+
ompt_state_wait_target = 0x080,
|
| 398 |
+
ompt_state_wait_target_map = 0x081,
|
| 399 |
+
ompt_state_wait_target_update = 0x082,
|
| 400 |
+
|
| 401 |
+
ompt_state_idle = 0x100,
|
| 402 |
+
ompt_state_overhead = 0x101,
|
| 403 |
+
ompt_state_undefined = 0x102
|
| 404 |
+
} ompt_state_t;
|
| 405 |
+
|
| 406 |
+
typedef uint64_t (*ompt_get_unique_id_t) (void);
|
| 407 |
+
|
| 408 |
+
typedef uint64_t ompd_size_t;
|
| 409 |
+
|
| 410 |
+
typedef uint64_t ompd_wait_id_t;
|
| 411 |
+
|
| 412 |
+
typedef uint64_t ompd_addr_t;
|
| 413 |
+
typedef int64_t ompd_word_t;
|
| 414 |
+
typedef uint64_t ompd_seg_t;
|
| 415 |
+
|
| 416 |
+
typedef uint64_t ompd_device_t;
|
| 417 |
+
|
| 418 |
+
typedef uint64_t ompd_thread_id_t;
|
| 419 |
+
|
| 420 |
+
typedef enum ompd_scope_t {
|
| 421 |
+
ompd_scope_global = 1,
|
| 422 |
+
ompd_scope_address_space = 2,
|
| 423 |
+
ompd_scope_thread = 3,
|
| 424 |
+
ompd_scope_parallel = 4,
|
| 425 |
+
ompd_scope_implicit_task = 5,
|
| 426 |
+
ompd_scope_task = 6
|
| 427 |
+
} ompd_scope_t;
|
| 428 |
+
|
| 429 |
+
typedef uint64_t ompd_icv_id_t;
|
| 430 |
+
|
| 431 |
+
typedef enum ompd_rc_t {
|
| 432 |
+
ompd_rc_ok = 0,
|
| 433 |
+
ompd_rc_unavailable = 1,
|
| 434 |
+
ompd_rc_stale_handle = 2,
|
| 435 |
+
ompd_rc_bad_input = 3,
|
| 436 |
+
ompd_rc_error = 4,
|
| 437 |
+
ompd_rc_unsupported = 5,
|
| 438 |
+
ompd_rc_needs_state_tracking = 6,
|
| 439 |
+
ompd_rc_incompatible = 7,
|
| 440 |
+
ompd_rc_device_read_error = 8,
|
| 441 |
+
ompd_rc_device_write_error = 9,
|
| 442 |
+
ompd_rc_nomem = 10,
|
| 443 |
+
} ompd_rc_t;
|
| 444 |
+
|
| 445 |
+
typedef void (*ompt_interface_fn_t) (void);
|
| 446 |
+
|
| 447 |
+
typedef ompt_interface_fn_t (*ompt_function_lookup_t) (
|
| 448 |
+
const char *interface_function_name
|
| 449 |
+
);
|
| 450 |
+
|
| 451 |
+
typedef union ompt_data_t {
|
| 452 |
+
uint64_t value;
|
| 453 |
+
void *ptr;
|
| 454 |
+
} ompt_data_t;
|
| 455 |
+
|
| 456 |
+
typedef struct ompt_frame_t {
|
| 457 |
+
ompt_data_t exit_frame;
|
| 458 |
+
ompt_data_t enter_frame;
|
| 459 |
+
int exit_frame_flags;
|
| 460 |
+
int enter_frame_flags;
|
| 461 |
+
} ompt_frame_t;
|
| 462 |
+
|
| 463 |
+
typedef void (*ompt_callback_t) (void);
|
| 464 |
+
|
| 465 |
+
typedef void ompt_device_t;
|
| 466 |
+
|
| 467 |
+
typedef void ompt_buffer_t;
|
| 468 |
+
|
| 469 |
+
typedef void (*ompt_callback_buffer_request_t) (
|
| 470 |
+
int device_num,
|
| 471 |
+
ompt_buffer_t **buffer,
|
| 472 |
+
size_t *bytes
|
| 473 |
+
);
|
| 474 |
+
|
| 475 |
+
typedef void (*ompt_callback_buffer_complete_t) (
|
| 476 |
+
int device_num,
|
| 477 |
+
ompt_buffer_t *buffer,
|
| 478 |
+
size_t bytes,
|
| 479 |
+
ompt_buffer_cursor_t begin,
|
| 480 |
+
int buffer_owned
|
| 481 |
+
);
|
| 482 |
+
|
| 483 |
+
typedef void (*ompt_finalize_t) (
|
| 484 |
+
ompt_data_t *tool_data
|
| 485 |
+
);
|
| 486 |
+
|
| 487 |
+
typedef int (*ompt_initialize_t) (
|
| 488 |
+
ompt_function_lookup_t lookup,
|
| 489 |
+
int initial_device_num,
|
| 490 |
+
ompt_data_t *tool_data
|
| 491 |
+
);
|
| 492 |
+
|
| 493 |
+
typedef struct ompt_start_tool_result_t {
|
| 494 |
+
ompt_initialize_t initialize;
|
| 495 |
+
ompt_finalize_t finalize;
|
| 496 |
+
ompt_data_t tool_data;
|
| 497 |
+
} ompt_start_tool_result_t;
|
| 498 |
+
|
| 499 |
+
typedef struct ompt_record_abstract_t {
|
| 500 |
+
ompt_record_native_t rclass;
|
| 501 |
+
const char *type;
|
| 502 |
+
ompt_device_time_t start_time;
|
| 503 |
+
ompt_device_time_t end_time;
|
| 504 |
+
ompt_hwid_t hwid;
|
| 505 |
+
} ompt_record_abstract_t;
|
| 506 |
+
|
| 507 |
+
typedef struct ompt_dependence_t {
|
| 508 |
+
ompt_data_t variable;
|
| 509 |
+
ompt_dependence_type_t dependence_type;
|
| 510 |
+
} ompt_dependence_t;
|
| 511 |
+
|
| 512 |
+
typedef int (*ompt_enumerate_states_t) (
|
| 513 |
+
int current_state,
|
| 514 |
+
int *next_state,
|
| 515 |
+
const char **next_state_name
|
| 516 |
+
);
|
| 517 |
+
|
| 518 |
+
typedef int (*ompt_enumerate_mutex_impls_t) (
|
| 519 |
+
int current_impl,
|
| 520 |
+
int *next_impl,
|
| 521 |
+
const char **next_impl_name
|
| 522 |
+
);
|
| 523 |
+
|
| 524 |
+
typedef ompt_set_result_t (*ompt_set_callback_t) (
|
| 525 |
+
ompt_callbacks_t event,
|
| 526 |
+
ompt_callback_t callback
|
| 527 |
+
);
|
| 528 |
+
|
| 529 |
+
typedef int (*ompt_get_callback_t) (
|
| 530 |
+
ompt_callbacks_t event,
|
| 531 |
+
ompt_callback_t *callback
|
| 532 |
+
);
|
| 533 |
+
|
| 534 |
+
typedef ompt_data_t *(*ompt_get_thread_data_t) (void);
|
| 535 |
+
|
| 536 |
+
typedef int (*ompt_get_num_procs_t) (void);
|
| 537 |
+
|
| 538 |
+
typedef int (*ompt_get_num_places_t) (void);
|
| 539 |
+
|
| 540 |
+
typedef int (*ompt_get_place_proc_ids_t) (
|
| 541 |
+
int place_num,
|
| 542 |
+
int ids_size,
|
| 543 |
+
int *ids
|
| 544 |
+
);
|
| 545 |
+
|
| 546 |
+
typedef int (*ompt_get_place_num_t) (void);
|
| 547 |
+
|
| 548 |
+
typedef int (*ompt_get_partition_place_nums_t) (
|
| 549 |
+
int place_nums_size,
|
| 550 |
+
int *place_nums
|
| 551 |
+
);
|
| 552 |
+
|
| 553 |
+
typedef int (*ompt_get_proc_id_t) (void);
|
| 554 |
+
|
| 555 |
+
typedef int (*ompt_get_state_t) (
|
| 556 |
+
ompt_wait_id_t *wait_id
|
| 557 |
+
);
|
| 558 |
+
|
| 559 |
+
typedef int (*ompt_get_parallel_info_t) (
|
| 560 |
+
int ancestor_level,
|
| 561 |
+
ompt_data_t **parallel_data,
|
| 562 |
+
int *team_size
|
| 563 |
+
);
|
| 564 |
+
|
| 565 |
+
typedef int (*ompt_get_task_info_t) (
|
| 566 |
+
int ancestor_level,
|
| 567 |
+
int *flags,
|
| 568 |
+
ompt_data_t **task_data,
|
| 569 |
+
ompt_frame_t **task_frame,
|
| 570 |
+
ompt_data_t **parallel_data,
|
| 571 |
+
int *thread_num
|
| 572 |
+
);
|
| 573 |
+
|
| 574 |
+
typedef int (*ompt_get_task_memory_t)(
|
| 575 |
+
void **addr,
|
| 576 |
+
size_t *size,
|
| 577 |
+
int block
|
| 578 |
+
);
|
| 579 |
+
|
| 580 |
+
typedef int (*ompt_get_target_info_t) (
|
| 581 |
+
uint64_t *device_num,
|
| 582 |
+
ompt_id_t *target_id,
|
| 583 |
+
ompt_id_t *host_op_id
|
| 584 |
+
);
|
| 585 |
+
|
| 586 |
+
typedef int (*ompt_get_num_devices_t) (void);
|
| 587 |
+
|
| 588 |
+
typedef void (*ompt_finalize_tool_t) (void);
|
| 589 |
+
|
| 590 |
+
typedef int (*ompt_get_device_num_procs_t) (
|
| 591 |
+
ompt_device_t *device
|
| 592 |
+
);
|
| 593 |
+
|
| 594 |
+
typedef ompt_device_time_t (*ompt_get_device_time_t) (
|
| 595 |
+
ompt_device_t *device
|
| 596 |
+
);
|
| 597 |
+
|
| 598 |
+
typedef double (*ompt_translate_time_t) (
|
| 599 |
+
ompt_device_t *device,
|
| 600 |
+
ompt_device_time_t time
|
| 601 |
+
);
|
| 602 |
+
|
| 603 |
+
typedef ompt_set_result_t (*ompt_set_trace_ompt_t) (
|
| 604 |
+
ompt_device_t *device,
|
| 605 |
+
unsigned int enable,
|
| 606 |
+
unsigned int etype
|
| 607 |
+
);
|
| 608 |
+
|
| 609 |
+
typedef ompt_set_result_t (*ompt_set_trace_native_t) (
|
| 610 |
+
ompt_device_t *device,
|
| 611 |
+
int enable,
|
| 612 |
+
int flags
|
| 613 |
+
);
|
| 614 |
+
|
| 615 |
+
typedef int (*ompt_start_trace_t) (
|
| 616 |
+
ompt_device_t *device,
|
| 617 |
+
ompt_callback_buffer_request_t request,
|
| 618 |
+
ompt_callback_buffer_complete_t complete
|
| 619 |
+
);
|
| 620 |
+
|
| 621 |
+
typedef int (*ompt_pause_trace_t) (
|
| 622 |
+
ompt_device_t *device,
|
| 623 |
+
int begin_pause
|
| 624 |
+
);
|
| 625 |
+
|
| 626 |
+
typedef int (*ompt_flush_trace_t) (
|
| 627 |
+
ompt_device_t *device
|
| 628 |
+
);
|
| 629 |
+
|
| 630 |
+
typedef int (*ompt_stop_trace_t) (
|
| 631 |
+
ompt_device_t *device
|
| 632 |
+
);
|
| 633 |
+
|
| 634 |
+
typedef int (*ompt_advance_buffer_cursor_t) (
|
| 635 |
+
ompt_device_t *device,
|
| 636 |
+
ompt_buffer_t *buffer,
|
| 637 |
+
size_t size,
|
| 638 |
+
ompt_buffer_cursor_t current,
|
| 639 |
+
ompt_buffer_cursor_t *next
|
| 640 |
+
);
|
| 641 |
+
|
| 642 |
+
typedef ompt_record_t (*ompt_get_record_type_t) (
|
| 643 |
+
ompt_buffer_t *buffer,
|
| 644 |
+
ompt_buffer_cursor_t current
|
| 645 |
+
);
|
| 646 |
+
|
| 647 |
+
typedef void *(*ompt_get_record_native_t) (
|
| 648 |
+
ompt_buffer_t *buffer,
|
| 649 |
+
ompt_buffer_cursor_t current,
|
| 650 |
+
ompt_id_t *host_op_id
|
| 651 |
+
);
|
| 652 |
+
|
| 653 |
+
typedef ompt_record_abstract_t *
|
| 654 |
+
(*ompt_get_record_abstract_t) (
|
| 655 |
+
void *native_record
|
| 656 |
+
);
|
| 657 |
+
|
| 658 |
+
typedef void (*ompt_callback_thread_begin_t) (
|
| 659 |
+
ompt_thread_t thread_type,
|
| 660 |
+
ompt_data_t *thread_data
|
| 661 |
+
);
|
| 662 |
+
|
| 663 |
+
typedef struct ompt_record_thread_begin_t {
|
| 664 |
+
ompt_thread_t thread_type;
|
| 665 |
+
} ompt_record_thread_begin_t;
|
| 666 |
+
|
| 667 |
+
typedef void (*ompt_callback_thread_end_t) (
|
| 668 |
+
ompt_data_t *thread_data
|
| 669 |
+
);
|
| 670 |
+
|
| 671 |
+
typedef void (*ompt_callback_parallel_begin_t) (
|
| 672 |
+
ompt_data_t *encountering_task_data,
|
| 673 |
+
const ompt_frame_t *encountering_task_frame,
|
| 674 |
+
ompt_data_t *parallel_data,
|
| 675 |
+
unsigned int requested_parallelism,
|
| 676 |
+
int flags,
|
| 677 |
+
const void *codeptr_ra
|
| 678 |
+
);
|
| 679 |
+
|
| 680 |
+
typedef struct ompt_record_parallel_begin_t {
|
| 681 |
+
ompt_id_t encountering_task_id;
|
| 682 |
+
ompt_id_t parallel_id;
|
| 683 |
+
unsigned int requested_parallelism;
|
| 684 |
+
int flags;
|
| 685 |
+
const void *codeptr_ra;
|
| 686 |
+
} ompt_record_parallel_begin_t;
|
| 687 |
+
|
| 688 |
+
typedef void (*ompt_callback_parallel_end_t) (
|
| 689 |
+
ompt_data_t *parallel_data,
|
| 690 |
+
ompt_data_t *encountering_task_data,
|
| 691 |
+
int flags,
|
| 692 |
+
const void *codeptr_ra
|
| 693 |
+
);
|
| 694 |
+
|
| 695 |
+
typedef struct ompt_record_parallel_end_t {
|
| 696 |
+
ompt_id_t parallel_id;
|
| 697 |
+
ompt_id_t encountering_task_id;
|
| 698 |
+
int flags;
|
| 699 |
+
const void *codeptr_ra;
|
| 700 |
+
} ompt_record_parallel_end_t;
|
| 701 |
+
|
| 702 |
+
typedef void (*ompt_callback_work_t) (
|
| 703 |
+
ompt_work_t wstype,
|
| 704 |
+
ompt_scope_endpoint_t endpoint,
|
| 705 |
+
ompt_data_t *parallel_data,
|
| 706 |
+
ompt_data_t *task_data,
|
| 707 |
+
uint64_t count,
|
| 708 |
+
const void *codeptr_ra
|
| 709 |
+
);
|
| 710 |
+
|
| 711 |
+
typedef struct ompt_record_work_t {
|
| 712 |
+
ompt_work_t wstype;
|
| 713 |
+
ompt_scope_endpoint_t endpoint;
|
| 714 |
+
ompt_id_t parallel_id;
|
| 715 |
+
ompt_id_t task_id;
|
| 716 |
+
uint64_t count;
|
| 717 |
+
const void *codeptr_ra;
|
| 718 |
+
} ompt_record_work_t;
|
| 719 |
+
|
| 720 |
+
typedef void (*ompt_callback_dispatch_t) (
|
| 721 |
+
ompt_data_t *parallel_data,
|
| 722 |
+
ompt_data_t *task_data,
|
| 723 |
+
ompt_dispatch_t kind,
|
| 724 |
+
ompt_data_t instance
|
| 725 |
+
);
|
| 726 |
+
|
| 727 |
+
typedef struct ompt_record_dispatch_t {
|
| 728 |
+
ompt_id_t parallel_id;
|
| 729 |
+
ompt_id_t task_id;
|
| 730 |
+
ompt_dispatch_t kind;
|
| 731 |
+
ompt_data_t instance;
|
| 732 |
+
} ompt_record_dispatch_t;
|
| 733 |
+
|
| 734 |
+
typedef void (*ompt_callback_task_create_t) (
|
| 735 |
+
ompt_data_t *encountering_task_data,
|
| 736 |
+
const ompt_frame_t *encountering_task_frame,
|
| 737 |
+
ompt_data_t *new_task_data,
|
| 738 |
+
int flags,
|
| 739 |
+
int has_dependences,
|
| 740 |
+
const void *codeptr_ra
|
| 741 |
+
);
|
| 742 |
+
|
| 743 |
+
typedef struct ompt_record_task_create_t {
|
| 744 |
+
ompt_id_t encountering_task_id;
|
| 745 |
+
ompt_id_t new_task_id;
|
| 746 |
+
int flags;
|
| 747 |
+
int has_dependences;
|
| 748 |
+
const void *codeptr_ra;
|
| 749 |
+
} ompt_record_task_create_t;
|
| 750 |
+
|
| 751 |
+
typedef void (*ompt_callback_dependences_t) (
|
| 752 |
+
ompt_data_t *task_data,
|
| 753 |
+
const ompt_dependence_t *deps,
|
| 754 |
+
int ndeps
|
| 755 |
+
);
|
| 756 |
+
|
| 757 |
+
typedef struct ompt_record_dependences_t {
|
| 758 |
+
ompt_id_t task_id;
|
| 759 |
+
ompt_dependence_t dep;
|
| 760 |
+
int ndeps;
|
| 761 |
+
} ompt_record_dependences_t;
|
| 762 |
+
|
| 763 |
+
typedef void (*ompt_callback_task_dependence_t) (
|
| 764 |
+
ompt_data_t *src_task_data,
|
| 765 |
+
ompt_data_t *sink_task_data
|
| 766 |
+
);
|
| 767 |
+
|
| 768 |
+
typedef struct ompt_record_task_dependence_t {
|
| 769 |
+
ompt_id_t src_task_id;
|
| 770 |
+
ompt_id_t sink_task_id;
|
| 771 |
+
} ompt_record_task_dependence_t;
|
| 772 |
+
|
| 773 |
+
typedef void (*ompt_callback_task_schedule_t) (
|
| 774 |
+
ompt_data_t *prior_task_data,
|
| 775 |
+
ompt_task_status_t prior_task_status,
|
| 776 |
+
ompt_data_t *next_task_data
|
| 777 |
+
);
|
| 778 |
+
|
| 779 |
+
typedef struct ompt_record_task_schedule_t {
|
| 780 |
+
ompt_id_t prior_task_id;
|
| 781 |
+
ompt_task_status_t prior_task_status;
|
| 782 |
+
ompt_id_t next_task_id;
|
| 783 |
+
} ompt_record_task_schedule_t;
|
| 784 |
+
|
| 785 |
+
typedef void (*ompt_callback_implicit_task_t) (
|
| 786 |
+
ompt_scope_endpoint_t endpoint,
|
| 787 |
+
ompt_data_t *parallel_data,
|
| 788 |
+
ompt_data_t *task_data,
|
| 789 |
+
unsigned int actual_parallelism,
|
| 790 |
+
unsigned int index,
|
| 791 |
+
int flags
|
| 792 |
+
);
|
| 793 |
+
|
| 794 |
+
typedef struct ompt_record_implicit_task_t {
|
| 795 |
+
ompt_scope_endpoint_t endpoint;
|
| 796 |
+
ompt_id_t parallel_id;
|
| 797 |
+
ompt_id_t task_id;
|
| 798 |
+
unsigned int actual_parallelism;
|
| 799 |
+
unsigned int index;
|
| 800 |
+
int flags;
|
| 801 |
+
} ompt_record_implicit_task_t;
|
| 802 |
+
|
| 803 |
+
typedef void (*ompt_callback_master_t) (
|
| 804 |
+
ompt_scope_endpoint_t endpoint,
|
| 805 |
+
ompt_data_t *parallel_data,
|
| 806 |
+
ompt_data_t *task_data,
|
| 807 |
+
const void *codeptr_ra
|
| 808 |
+
);
|
| 809 |
+
|
| 810 |
+
typedef struct ompt_record_master_t {
|
| 811 |
+
ompt_scope_endpoint_t endpoint;
|
| 812 |
+
ompt_id_t parallel_id;
|
| 813 |
+
ompt_id_t task_id;
|
| 814 |
+
const void *codeptr_ra;
|
| 815 |
+
} ompt_record_master_t;
|
| 816 |
+
|
| 817 |
+
typedef void (*ompt_callback_sync_region_t) (
|
| 818 |
+
ompt_sync_region_t kind,
|
| 819 |
+
ompt_scope_endpoint_t endpoint,
|
| 820 |
+
ompt_data_t *parallel_data,
|
| 821 |
+
ompt_data_t *task_data,
|
| 822 |
+
const void *codeptr_ra
|
| 823 |
+
);
|
| 824 |
+
|
| 825 |
+
typedef struct ompt_record_sync_region_t {
|
| 826 |
+
ompt_sync_region_t kind;
|
| 827 |
+
ompt_scope_endpoint_t endpoint;
|
| 828 |
+
ompt_id_t parallel_id;
|
| 829 |
+
ompt_id_t task_id;
|
| 830 |
+
const void *codeptr_ra;
|
| 831 |
+
} ompt_record_sync_region_t;
|
| 832 |
+
|
| 833 |
+
typedef void (*ompt_callback_mutex_acquire_t) (
|
| 834 |
+
ompt_mutex_t kind,
|
| 835 |
+
unsigned int hint,
|
| 836 |
+
unsigned int impl,
|
| 837 |
+
ompt_wait_id_t wait_id,
|
| 838 |
+
const void *codeptr_ra
|
| 839 |
+
);
|
| 840 |
+
|
| 841 |
+
typedef struct ompt_record_mutex_acquire_t {
|
| 842 |
+
ompt_mutex_t kind;
|
| 843 |
+
unsigned int hint;
|
| 844 |
+
unsigned int impl;
|
| 845 |
+
ompt_wait_id_t wait_id;
|
| 846 |
+
const void *codeptr_ra;
|
| 847 |
+
} ompt_record_mutex_acquire_t;
|
| 848 |
+
|
| 849 |
+
typedef void (*ompt_callback_mutex_t) (
|
| 850 |
+
ompt_mutex_t kind,
|
| 851 |
+
ompt_wait_id_t wait_id,
|
| 852 |
+
const void *codeptr_ra
|
| 853 |
+
);
|
| 854 |
+
|
| 855 |
+
typedef struct ompt_record_mutex_t {
|
| 856 |
+
ompt_mutex_t kind;
|
| 857 |
+
ompt_wait_id_t wait_id;
|
| 858 |
+
const void *codeptr_ra;
|
| 859 |
+
} ompt_record_mutex_t;
|
| 860 |
+
|
| 861 |
+
typedef void (*ompt_callback_nest_lock_t) (
|
| 862 |
+
ompt_scope_endpoint_t endpoint,
|
| 863 |
+
ompt_wait_id_t wait_id,
|
| 864 |
+
const void *codeptr_ra
|
| 865 |
+
);
|
| 866 |
+
|
| 867 |
+
typedef struct ompt_record_nest_lock_t {
|
| 868 |
+
ompt_scope_endpoint_t endpoint;
|
| 869 |
+
ompt_wait_id_t wait_id;
|
| 870 |
+
const void *codeptr_ra;
|
| 871 |
+
} ompt_record_nest_lock_t;
|
| 872 |
+
|
| 873 |
+
typedef void (*ompt_callback_flush_t) (
|
| 874 |
+
ompt_data_t *thread_data,
|
| 875 |
+
const void *codeptr_ra
|
| 876 |
+
);
|
| 877 |
+
|
| 878 |
+
typedef struct ompt_record_flush_t {
|
| 879 |
+
const void *codeptr_ra;
|
| 880 |
+
} ompt_record_flush_t;
|
| 881 |
+
|
| 882 |
+
typedef void (*ompt_callback_cancel_t) (
|
| 883 |
+
ompt_data_t *task_data,
|
| 884 |
+
int flags,
|
| 885 |
+
const void *codeptr_ra
|
| 886 |
+
);
|
| 887 |
+
|
| 888 |
+
typedef struct ompt_record_cancel_t {
|
| 889 |
+
ompt_id_t task_id;
|
| 890 |
+
int flags;
|
| 891 |
+
const void *codeptr_ra;
|
| 892 |
+
} ompt_record_cancel_t;
|
| 893 |
+
|
| 894 |
+
typedef void (*ompt_callback_device_initialize_t) (
|
| 895 |
+
int device_num,
|
| 896 |
+
const char *type,
|
| 897 |
+
ompt_device_t *device,
|
| 898 |
+
ompt_function_lookup_t lookup,
|
| 899 |
+
const char *documentation
|
| 900 |
+
);
|
| 901 |
+
|
| 902 |
+
typedef void (*ompt_callback_device_finalize_t) (
|
| 903 |
+
int device_num
|
| 904 |
+
);
|
| 905 |
+
|
| 906 |
+
typedef void (*ompt_callback_device_load_t) (
|
| 907 |
+
int device_num,
|
| 908 |
+
const char *filename,
|
| 909 |
+
int64_t offset_in_file,
|
| 910 |
+
void *vma_in_file,
|
| 911 |
+
size_t bytes,
|
| 912 |
+
void *host_addr,
|
| 913 |
+
void *device_addr,
|
| 914 |
+
uint64_t module_id
|
| 915 |
+
);
|
| 916 |
+
|
| 917 |
+
typedef void (*ompt_callback_device_unload_t) (
|
| 918 |
+
int device_num,
|
| 919 |
+
uint64_t module_id
|
| 920 |
+
);
|
| 921 |
+
|
| 922 |
+
typedef void (*ompt_callback_target_data_op_t) (
|
| 923 |
+
ompt_id_t target_id,
|
| 924 |
+
ompt_id_t host_op_id,
|
| 925 |
+
ompt_target_data_op_t optype,
|
| 926 |
+
void *src_addr,
|
| 927 |
+
int src_device_num,
|
| 928 |
+
void *dest_addr,
|
| 929 |
+
int dest_device_num,
|
| 930 |
+
size_t bytes,
|
| 931 |
+
const void *codeptr_ra
|
| 932 |
+
);
|
| 933 |
+
|
| 934 |
+
typedef struct ompt_record_target_data_op_t {
|
| 935 |
+
ompt_id_t host_op_id;
|
| 936 |
+
ompt_target_data_op_t optype;
|
| 937 |
+
void *src_addr;
|
| 938 |
+
int src_device_num;
|
| 939 |
+
void *dest_addr;
|
| 940 |
+
int dest_device_num;
|
| 941 |
+
size_t bytes;
|
| 942 |
+
ompt_device_time_t end_time;
|
| 943 |
+
const void *codeptr_ra;
|
| 944 |
+
} ompt_record_target_data_op_t;
|
| 945 |
+
|
| 946 |
+
typedef void (*ompt_callback_target_t) (
|
| 947 |
+
ompt_target_t kind,
|
| 948 |
+
ompt_scope_endpoint_t endpoint,
|
| 949 |
+
int device_num,
|
| 950 |
+
ompt_data_t *task_data,
|
| 951 |
+
ompt_id_t target_id,
|
| 952 |
+
const void *codeptr_ra
|
| 953 |
+
);
|
| 954 |
+
|
| 955 |
+
typedef struct ompt_record_target_t {
|
| 956 |
+
ompt_target_t kind;
|
| 957 |
+
ompt_scope_endpoint_t endpoint;
|
| 958 |
+
int device_num;
|
| 959 |
+
ompt_id_t task_id;
|
| 960 |
+
ompt_id_t target_id;
|
| 961 |
+
const void *codeptr_ra;
|
| 962 |
+
} ompt_record_target_t;
|
| 963 |
+
|
| 964 |
+
typedef void (*ompt_callback_target_map_t) (
|
| 965 |
+
ompt_id_t target_id,
|
| 966 |
+
unsigned int nitems,
|
| 967 |
+
void **host_addr,
|
| 968 |
+
void **device_addr,
|
| 969 |
+
size_t *bytes,
|
| 970 |
+
unsigned int *mapping_flags,
|
| 971 |
+
const void *codeptr_ra
|
| 972 |
+
);
|
| 973 |
+
|
| 974 |
+
typedef struct ompt_record_target_map_t {
|
| 975 |
+
ompt_id_t target_id;
|
| 976 |
+
unsigned int nitems;
|
| 977 |
+
void **host_addr;
|
| 978 |
+
void **device_addr;
|
| 979 |
+
size_t *bytes;
|
| 980 |
+
unsigned int *mapping_flags;
|
| 981 |
+
const void *codeptr_ra;
|
| 982 |
+
} ompt_record_target_map_t;
|
| 983 |
+
|
| 984 |
+
typedef void (*ompt_callback_target_submit_t) (
|
| 985 |
+
ompt_id_t target_id,
|
| 986 |
+
ompt_id_t host_op_id,
|
| 987 |
+
unsigned int requested_num_teams
|
| 988 |
+
);
|
| 989 |
+
|
| 990 |
+
typedef struct ompt_record_target_kernel_t {
|
| 991 |
+
ompt_id_t host_op_id;
|
| 992 |
+
unsigned int requested_num_teams;
|
| 993 |
+
unsigned int granted_num_teams;
|
| 994 |
+
ompt_device_time_t end_time;
|
| 995 |
+
} ompt_record_target_kernel_t;
|
| 996 |
+
|
| 997 |
+
typedef int (*ompt_callback_control_tool_t) (
|
| 998 |
+
uint64_t command,
|
| 999 |
+
uint64_t modifier,
|
| 1000 |
+
void *arg,
|
| 1001 |
+
const void *codeptr_ra
|
| 1002 |
+
);
|
| 1003 |
+
|
| 1004 |
+
typedef struct ompt_record_control_tool_t {
|
| 1005 |
+
uint64_t command;
|
| 1006 |
+
uint64_t modifier;
|
| 1007 |
+
const void *codeptr_ra;
|
| 1008 |
+
} ompt_record_control_tool_t;
|
| 1009 |
+
|
| 1010 |
+
typedef struct ompd_address_t {
|
| 1011 |
+
ompd_seg_t segment;
|
| 1012 |
+
ompd_addr_t address;
|
| 1013 |
+
} ompd_address_t;
|
| 1014 |
+
|
| 1015 |
+
typedef struct ompd_frame_info_t {
|
| 1016 |
+
ompd_address_t frame_address;
|
| 1017 |
+
ompd_word_t frame_flag;
|
| 1018 |
+
} ompd_frame_info_t;
|
| 1019 |
+
|
| 1020 |
+
typedef struct _ompd_aspace_handle ompd_address_space_handle_t;
|
| 1021 |
+
typedef struct _ompd_thread_handle ompd_thread_handle_t;
|
| 1022 |
+
typedef struct _ompd_parallel_handle ompd_parallel_handle_t;
|
| 1023 |
+
typedef struct _ompd_task_handle ompd_task_handle_t;
|
| 1024 |
+
|
| 1025 |
+
typedef struct _ompd_aspace_cont ompd_address_space_context_t;
|
| 1026 |
+
typedef struct _ompd_thread_cont ompd_thread_context_t;
|
| 1027 |
+
|
| 1028 |
+
typedef struct ompd_device_type_sizes_t {
|
| 1029 |
+
uint8_t sizeof_char;
|
| 1030 |
+
uint8_t sizeof_short;
|
| 1031 |
+
uint8_t sizeof_int;
|
| 1032 |
+
uint8_t sizeof_long;
|
| 1033 |
+
uint8_t sizeof_long_long;
|
| 1034 |
+
uint8_t sizeof_pointer;
|
| 1035 |
+
} ompd_device_type_sizes_t;
|
| 1036 |
+
|
| 1037 |
+
typedef struct ompt_record_ompt_t {
|
| 1038 |
+
ompt_callbacks_t type;
|
| 1039 |
+
ompt_device_time_t time;
|
| 1040 |
+
ompt_id_t thread_id;
|
| 1041 |
+
ompt_id_t target_id;
|
| 1042 |
+
union {
|
| 1043 |
+
ompt_record_thread_begin_t thread_begin;
|
| 1044 |
+
ompt_record_parallel_begin_t parallel_begin;
|
| 1045 |
+
ompt_record_parallel_end_t parallel_end;
|
| 1046 |
+
ompt_record_work_t work;
|
| 1047 |
+
ompt_record_dispatch_t dispatch;
|
| 1048 |
+
ompt_record_task_create_t task_create;
|
| 1049 |
+
ompt_record_dependences_t dependences;
|
| 1050 |
+
ompt_record_task_dependence_t task_dependence;
|
| 1051 |
+
ompt_record_task_schedule_t task_schedule;
|
| 1052 |
+
ompt_record_implicit_task_t implicit_task;
|
| 1053 |
+
ompt_record_master_t master;
|
| 1054 |
+
ompt_record_sync_region_t sync_region;
|
| 1055 |
+
ompt_record_mutex_acquire_t mutex_acquire;
|
| 1056 |
+
ompt_record_mutex_t mutex;
|
| 1057 |
+
ompt_record_nest_lock_t nest_lock;
|
| 1058 |
+
ompt_record_flush_t flush;
|
| 1059 |
+
ompt_record_cancel_t cancel;
|
| 1060 |
+
ompt_record_target_t target;
|
| 1061 |
+
ompt_record_target_data_op_t target_data_op;
|
| 1062 |
+
ompt_record_target_map_t target_map;
|
| 1063 |
+
ompt_record_target_kernel_t target_kernel;
|
| 1064 |
+
ompt_record_control_tool_t control_tool;
|
| 1065 |
+
} record;
|
| 1066 |
+
} ompt_record_ompt_t;
|
| 1067 |
+
|
| 1068 |
+
typedef ompt_record_ompt_t *(*ompt_get_record_ompt_t) (
|
| 1069 |
+
ompt_buffer_t *buffer,
|
| 1070 |
+
ompt_buffer_cursor_t current
|
| 1071 |
+
);
|
| 1072 |
+
|
| 1073 |
+
#define ompt_id_none 0
|
| 1074 |
+
#define ompt_data_none {0}
|
| 1075 |
+
#define ompt_time_none 0
|
| 1076 |
+
#define ompt_hwid_none 0
|
| 1077 |
+
#define ompt_addr_none ~0
|
| 1078 |
+
#define ompt_mutex_impl_none 0
|
| 1079 |
+
#define ompt_wait_id_none 0
|
| 1080 |
+
|
| 1081 |
+
#define ompd_segment_none 0
|
| 1082 |
+
|
| 1083 |
+
#endif /* __OMPT__ */
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_cupti/include/generated_cuda_runtime_api_meta.h
ADDED
|
@@ -0,0 +1,2316 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is generated. Any changes you make will be lost during the next clean build.
|
| 2 |
+
|
| 3 |
+
// CUDA public interface, for type definitions and api function prototypes
|
| 4 |
+
#include "cuda_runtime_api.h"
|
| 5 |
+
|
| 6 |
+
// *************************************************************************
|
| 7 |
+
// Definitions of structs to hold parameters for each function
|
| 8 |
+
// *************************************************************************
|
| 9 |
+
|
| 10 |
+
// Currently used parameter trace structures
|
| 11 |
+
typedef struct cudaDeviceSetLimit_v3020_params_st {
|
| 12 |
+
enum cudaLimit limit;
|
| 13 |
+
size_t value;
|
| 14 |
+
} cudaDeviceSetLimit_v3020_params;
|
| 15 |
+
|
| 16 |
+
typedef struct cudaDeviceGetLimit_v3020_params_st {
|
| 17 |
+
size_t *pValue;
|
| 18 |
+
enum cudaLimit limit;
|
| 19 |
+
} cudaDeviceGetLimit_v3020_params;
|
| 20 |
+
|
| 21 |
+
typedef struct cudaDeviceGetTexture1DLinearMaxWidth_v11010_params_st {
|
| 22 |
+
size_t *maxWidthInElements;
|
| 23 |
+
const struct cudaChannelFormatDesc *fmtDesc;
|
| 24 |
+
int device;
|
| 25 |
+
} cudaDeviceGetTexture1DLinearMaxWidth_v11010_params;
|
| 26 |
+
|
| 27 |
+
typedef struct cudaDeviceGetCacheConfig_v3020_params_st {
|
| 28 |
+
enum cudaFuncCache *pCacheConfig;
|
| 29 |
+
} cudaDeviceGetCacheConfig_v3020_params;
|
| 30 |
+
|
| 31 |
+
typedef struct cudaDeviceGetStreamPriorityRange_v5050_params_st {
|
| 32 |
+
int *leastPriority;
|
| 33 |
+
int *greatestPriority;
|
| 34 |
+
} cudaDeviceGetStreamPriorityRange_v5050_params;
|
| 35 |
+
|
| 36 |
+
typedef struct cudaDeviceSetCacheConfig_v3020_params_st {
|
| 37 |
+
enum cudaFuncCache cacheConfig;
|
| 38 |
+
} cudaDeviceSetCacheConfig_v3020_params;
|
| 39 |
+
|
| 40 |
+
typedef struct cudaDeviceGetByPCIBusId_v4010_params_st {
|
| 41 |
+
int *device;
|
| 42 |
+
const char *pciBusId;
|
| 43 |
+
} cudaDeviceGetByPCIBusId_v4010_params;
|
| 44 |
+
|
| 45 |
+
typedef struct cudaDeviceGetPCIBusId_v4010_params_st {
|
| 46 |
+
char *pciBusId;
|
| 47 |
+
int len;
|
| 48 |
+
int device;
|
| 49 |
+
} cudaDeviceGetPCIBusId_v4010_params;
|
| 50 |
+
|
| 51 |
+
typedef struct cudaIpcGetEventHandle_v4010_params_st {
|
| 52 |
+
cudaIpcEventHandle_t *handle;
|
| 53 |
+
cudaEvent_t event;
|
| 54 |
+
} cudaIpcGetEventHandle_v4010_params;
|
| 55 |
+
|
| 56 |
+
typedef struct cudaIpcOpenEventHandle_v4010_params_st {
|
| 57 |
+
cudaEvent_t *event;
|
| 58 |
+
cudaIpcEventHandle_t handle;
|
| 59 |
+
} cudaIpcOpenEventHandle_v4010_params;
|
| 60 |
+
|
| 61 |
+
typedef struct cudaIpcGetMemHandle_v4010_params_st {
|
| 62 |
+
cudaIpcMemHandle_t *handle;
|
| 63 |
+
void *devPtr;
|
| 64 |
+
} cudaIpcGetMemHandle_v4010_params;
|
| 65 |
+
|
| 66 |
+
typedef struct cudaIpcOpenMemHandle_v4010_params_st {
|
| 67 |
+
void **devPtr;
|
| 68 |
+
cudaIpcMemHandle_t handle;
|
| 69 |
+
unsigned int flags;
|
| 70 |
+
} cudaIpcOpenMemHandle_v4010_params;
|
| 71 |
+
|
| 72 |
+
typedef struct cudaIpcCloseMemHandle_v4010_params_st {
|
| 73 |
+
void *devPtr;
|
| 74 |
+
} cudaIpcCloseMemHandle_v4010_params;
|
| 75 |
+
|
| 76 |
+
typedef struct cudaDeviceFlushGPUDirectRDMAWrites_v11030_params_st {
|
| 77 |
+
enum cudaFlushGPUDirectRDMAWritesTarget target;
|
| 78 |
+
enum cudaFlushGPUDirectRDMAWritesScope scope;
|
| 79 |
+
} cudaDeviceFlushGPUDirectRDMAWrites_v11030_params;
|
| 80 |
+
|
| 81 |
+
typedef struct cudaDeviceRegisterAsyncNotification_v12040_params_st {
|
| 82 |
+
int device;
|
| 83 |
+
cudaAsyncCallback callbackFunc;
|
| 84 |
+
void *userData;
|
| 85 |
+
cudaAsyncCallbackHandle_t *callback;
|
| 86 |
+
} cudaDeviceRegisterAsyncNotification_v12040_params;
|
| 87 |
+
|
| 88 |
+
typedef struct cudaDeviceUnregisterAsyncNotification_v12040_params_st {
|
| 89 |
+
int device;
|
| 90 |
+
cudaAsyncCallbackHandle_t callback;
|
| 91 |
+
} cudaDeviceUnregisterAsyncNotification_v12040_params;
|
| 92 |
+
|
| 93 |
+
typedef struct cudaDeviceGetSharedMemConfig_v4020_params_st {
|
| 94 |
+
enum cudaSharedMemConfig *pConfig;
|
| 95 |
+
} cudaDeviceGetSharedMemConfig_v4020_params;
|
| 96 |
+
|
| 97 |
+
typedef struct cudaDeviceSetSharedMemConfig_v4020_params_st {
|
| 98 |
+
enum cudaSharedMemConfig config;
|
| 99 |
+
} cudaDeviceSetSharedMemConfig_v4020_params;
|
| 100 |
+
|
| 101 |
+
typedef struct cudaGetErrorName_v6050_params_st {
|
| 102 |
+
cudaError_t error;
|
| 103 |
+
} cudaGetErrorName_v6050_params;
|
| 104 |
+
|
| 105 |
+
typedef struct cudaGetErrorString_v3020_params_st {
|
| 106 |
+
cudaError_t error;
|
| 107 |
+
} cudaGetErrorString_v3020_params;
|
| 108 |
+
|
| 109 |
+
typedef struct cudaGetDeviceCount_v3020_params_st {
|
| 110 |
+
int *count;
|
| 111 |
+
} cudaGetDeviceCount_v3020_params;
|
| 112 |
+
|
| 113 |
+
typedef struct cudaGetDeviceProperties_v2_v12000_params_st {
|
| 114 |
+
struct cudaDeviceProp *prop;
|
| 115 |
+
int device;
|
| 116 |
+
} cudaGetDeviceProperties_v2_v12000_params;
|
| 117 |
+
|
| 118 |
+
typedef struct cudaDeviceGetAttribute_v5000_params_st {
|
| 119 |
+
int *value;
|
| 120 |
+
enum cudaDeviceAttr attr;
|
| 121 |
+
int device;
|
| 122 |
+
} cudaDeviceGetAttribute_v5000_params;
|
| 123 |
+
|
| 124 |
+
typedef struct cudaDeviceGetDefaultMemPool_v11020_params_st {
|
| 125 |
+
cudaMemPool_t *memPool;
|
| 126 |
+
int device;
|
| 127 |
+
} cudaDeviceGetDefaultMemPool_v11020_params;
|
| 128 |
+
|
| 129 |
+
typedef struct cudaDeviceSetMemPool_v11020_params_st {
|
| 130 |
+
int device;
|
| 131 |
+
cudaMemPool_t memPool;
|
| 132 |
+
} cudaDeviceSetMemPool_v11020_params;
|
| 133 |
+
|
| 134 |
+
typedef struct cudaDeviceGetMemPool_v11020_params_st {
|
| 135 |
+
cudaMemPool_t *memPool;
|
| 136 |
+
int device;
|
| 137 |
+
} cudaDeviceGetMemPool_v11020_params;
|
| 138 |
+
|
| 139 |
+
typedef struct cudaDeviceGetNvSciSyncAttributes_v10020_params_st {
|
| 140 |
+
void *nvSciSyncAttrList;
|
| 141 |
+
int device;
|
| 142 |
+
int flags;
|
| 143 |
+
} cudaDeviceGetNvSciSyncAttributes_v10020_params;
|
| 144 |
+
|
| 145 |
+
typedef struct cudaDeviceGetP2PAttribute_v8000_params_st {
|
| 146 |
+
int *value;
|
| 147 |
+
enum cudaDeviceP2PAttr attr;
|
| 148 |
+
int srcDevice;
|
| 149 |
+
int dstDevice;
|
| 150 |
+
} cudaDeviceGetP2PAttribute_v8000_params;
|
| 151 |
+
|
| 152 |
+
typedef struct cudaChooseDevice_v3020_params_st {
|
| 153 |
+
int *device;
|
| 154 |
+
const struct cudaDeviceProp *prop;
|
| 155 |
+
} cudaChooseDevice_v3020_params;
|
| 156 |
+
|
| 157 |
+
typedef struct cudaInitDevice_v12000_params_st {
|
| 158 |
+
int device;
|
| 159 |
+
unsigned int deviceFlags;
|
| 160 |
+
unsigned int flags;
|
| 161 |
+
} cudaInitDevice_v12000_params;
|
| 162 |
+
|
| 163 |
+
typedef struct cudaSetDevice_v3020_params_st {
|
| 164 |
+
int device;
|
| 165 |
+
} cudaSetDevice_v3020_params;
|
| 166 |
+
|
| 167 |
+
typedef struct cudaGetDevice_v3020_params_st {
|
| 168 |
+
int *device;
|
| 169 |
+
} cudaGetDevice_v3020_params;
|
| 170 |
+
|
| 171 |
+
typedef struct cudaSetValidDevices_v3020_params_st {
|
| 172 |
+
int *device_arr;
|
| 173 |
+
int len;
|
| 174 |
+
} cudaSetValidDevices_v3020_params;
|
| 175 |
+
|
| 176 |
+
typedef struct cudaSetDeviceFlags_v3020_params_st {
|
| 177 |
+
unsigned int flags;
|
| 178 |
+
} cudaSetDeviceFlags_v3020_params;
|
| 179 |
+
|
| 180 |
+
typedef struct cudaGetDeviceFlags_v7000_params_st {
|
| 181 |
+
unsigned int *flags;
|
| 182 |
+
} cudaGetDeviceFlags_v7000_params;
|
| 183 |
+
|
| 184 |
+
typedef struct cudaStreamCreate_v3020_params_st {
|
| 185 |
+
cudaStream_t *pStream;
|
| 186 |
+
} cudaStreamCreate_v3020_params;
|
| 187 |
+
|
| 188 |
+
typedef struct cudaStreamCreateWithFlags_v5000_params_st {
|
| 189 |
+
cudaStream_t *pStream;
|
| 190 |
+
unsigned int flags;
|
| 191 |
+
} cudaStreamCreateWithFlags_v5000_params;
|
| 192 |
+
|
| 193 |
+
typedef struct cudaStreamCreateWithPriority_v5050_params_st {
|
| 194 |
+
cudaStream_t *pStream;
|
| 195 |
+
unsigned int flags;
|
| 196 |
+
int priority;
|
| 197 |
+
} cudaStreamCreateWithPriority_v5050_params;
|
| 198 |
+
|
| 199 |
+
typedef struct cudaStreamGetPriority_ptsz_v7000_params_st {
|
| 200 |
+
cudaStream_t hStream;
|
| 201 |
+
int *priority;
|
| 202 |
+
} cudaStreamGetPriority_ptsz_v7000_params;
|
| 203 |
+
|
| 204 |
+
typedef struct cudaStreamGetFlags_ptsz_v7000_params_st {
|
| 205 |
+
cudaStream_t hStream;
|
| 206 |
+
unsigned int *flags;
|
| 207 |
+
} cudaStreamGetFlags_ptsz_v7000_params;
|
| 208 |
+
|
| 209 |
+
typedef struct cudaStreamGetId_ptsz_v12000_params_st {
|
| 210 |
+
cudaStream_t hStream;
|
| 211 |
+
unsigned long long *streamId;
|
| 212 |
+
} cudaStreamGetId_ptsz_v12000_params;
|
| 213 |
+
|
| 214 |
+
typedef struct cudaStreamCopyAttributes_ptsz_v11000_params_st {
|
| 215 |
+
cudaStream_t dst;
|
| 216 |
+
cudaStream_t src;
|
| 217 |
+
} cudaStreamCopyAttributes_ptsz_v11000_params;
|
| 218 |
+
|
| 219 |
+
typedef struct cudaStreamGetAttribute_ptsz_v11000_params_st {
|
| 220 |
+
cudaStream_t hStream;
|
| 221 |
+
cudaStreamAttrID attr;
|
| 222 |
+
cudaStreamAttrValue *value_out;
|
| 223 |
+
} cudaStreamGetAttribute_ptsz_v11000_params;
|
| 224 |
+
|
| 225 |
+
typedef struct cudaStreamSetAttribute_ptsz_v11000_params_st {
|
| 226 |
+
cudaStream_t hStream;
|
| 227 |
+
cudaStreamAttrID attr;
|
| 228 |
+
const cudaStreamAttrValue *value;
|
| 229 |
+
} cudaStreamSetAttribute_ptsz_v11000_params;
|
| 230 |
+
|
| 231 |
+
typedef struct cudaStreamDestroy_v5050_params_st {
|
| 232 |
+
cudaStream_t stream;
|
| 233 |
+
} cudaStreamDestroy_v5050_params;
|
| 234 |
+
|
| 235 |
+
typedef struct cudaStreamWaitEvent_ptsz_v7000_params_st {
|
| 236 |
+
cudaStream_t stream;
|
| 237 |
+
cudaEvent_t event;
|
| 238 |
+
unsigned int flags;
|
| 239 |
+
} cudaStreamWaitEvent_ptsz_v7000_params;
|
| 240 |
+
|
| 241 |
+
typedef struct cudaStreamAddCallback_ptsz_v7000_params_st {
|
| 242 |
+
cudaStream_t stream;
|
| 243 |
+
cudaStreamCallback_t callback;
|
| 244 |
+
void *userData;
|
| 245 |
+
unsigned int flags;
|
| 246 |
+
} cudaStreamAddCallback_ptsz_v7000_params;
|
| 247 |
+
|
| 248 |
+
typedef struct cudaStreamSynchronize_ptsz_v7000_params_st {
|
| 249 |
+
cudaStream_t stream;
|
| 250 |
+
} cudaStreamSynchronize_ptsz_v7000_params;
|
| 251 |
+
|
| 252 |
+
typedef struct cudaStreamQuery_ptsz_v7000_params_st {
|
| 253 |
+
cudaStream_t stream;
|
| 254 |
+
} cudaStreamQuery_ptsz_v7000_params;
|
| 255 |
+
|
| 256 |
+
typedef struct cudaStreamAttachMemAsync_ptsz_v7000_params_st {
|
| 257 |
+
cudaStream_t stream;
|
| 258 |
+
void *devPtr;
|
| 259 |
+
size_t length;
|
| 260 |
+
unsigned int flags;
|
| 261 |
+
} cudaStreamAttachMemAsync_ptsz_v7000_params;
|
| 262 |
+
|
| 263 |
+
typedef struct cudaStreamBeginCapture_ptsz_v10000_params_st {
|
| 264 |
+
cudaStream_t stream;
|
| 265 |
+
enum cudaStreamCaptureMode mode;
|
| 266 |
+
} cudaStreamBeginCapture_ptsz_v10000_params;
|
| 267 |
+
|
| 268 |
+
typedef struct cudaStreamBeginCaptureToGraph_ptsz_v12030_params_st {
|
| 269 |
+
cudaStream_t stream;
|
| 270 |
+
cudaGraph_t graph;
|
| 271 |
+
const cudaGraphNode_t *dependencies;
|
| 272 |
+
const cudaGraphEdgeData *dependencyData;
|
| 273 |
+
size_t numDependencies;
|
| 274 |
+
enum cudaStreamCaptureMode mode;
|
| 275 |
+
} cudaStreamBeginCaptureToGraph_ptsz_v12030_params;
|
| 276 |
+
|
| 277 |
+
typedef struct cudaThreadExchangeStreamCaptureMode_v10010_params_st {
|
| 278 |
+
enum cudaStreamCaptureMode *mode;
|
| 279 |
+
} cudaThreadExchangeStreamCaptureMode_v10010_params;
|
| 280 |
+
|
| 281 |
+
typedef struct cudaStreamEndCapture_ptsz_v10000_params_st {
|
| 282 |
+
cudaStream_t stream;
|
| 283 |
+
cudaGraph_t *pGraph;
|
| 284 |
+
} cudaStreamEndCapture_ptsz_v10000_params;
|
| 285 |
+
|
| 286 |
+
typedef struct cudaStreamIsCapturing_ptsz_v10000_params_st {
|
| 287 |
+
cudaStream_t stream;
|
| 288 |
+
enum cudaStreamCaptureStatus *pCaptureStatus;
|
| 289 |
+
} cudaStreamIsCapturing_ptsz_v10000_params;
|
| 290 |
+
|
| 291 |
+
typedef struct cudaStreamGetCaptureInfo_v2_ptsz_v11030_params_st {
|
| 292 |
+
cudaStream_t stream;
|
| 293 |
+
enum cudaStreamCaptureStatus *captureStatus_out;
|
| 294 |
+
unsigned long long *id_out;
|
| 295 |
+
cudaGraph_t *graph_out;
|
| 296 |
+
const cudaGraphNode_t **dependencies_out;
|
| 297 |
+
size_t *numDependencies_out;
|
| 298 |
+
} cudaStreamGetCaptureInfo_v2_ptsz_v11030_params;
|
| 299 |
+
|
| 300 |
+
typedef struct cudaStreamGetCaptureInfo_v3_ptsz_v12030_params_st {
|
| 301 |
+
cudaStream_t stream;
|
| 302 |
+
enum cudaStreamCaptureStatus *captureStatus_out;
|
| 303 |
+
unsigned long long *id_out;
|
| 304 |
+
cudaGraph_t *graph_out;
|
| 305 |
+
const cudaGraphNode_t **dependencies_out;
|
| 306 |
+
const cudaGraphEdgeData **edgeData_out;
|
| 307 |
+
size_t *numDependencies_out;
|
| 308 |
+
} cudaStreamGetCaptureInfo_v3_ptsz_v12030_params;
|
| 309 |
+
|
| 310 |
+
typedef struct cudaStreamUpdateCaptureDependencies_ptsz_v11030_params_st {
|
| 311 |
+
cudaStream_t stream;
|
| 312 |
+
cudaGraphNode_t *dependencies;
|
| 313 |
+
size_t numDependencies;
|
| 314 |
+
unsigned int flags;
|
| 315 |
+
} cudaStreamUpdateCaptureDependencies_ptsz_v11030_params;
|
| 316 |
+
|
| 317 |
+
typedef struct cudaStreamUpdateCaptureDependencies_v2_ptsz_v12030_params_st {
|
| 318 |
+
cudaStream_t stream;
|
| 319 |
+
cudaGraphNode_t *dependencies;
|
| 320 |
+
const cudaGraphEdgeData *dependencyData;
|
| 321 |
+
size_t numDependencies;
|
| 322 |
+
unsigned int flags;
|
| 323 |
+
} cudaStreamUpdateCaptureDependencies_v2_ptsz_v12030_params;
|
| 324 |
+
|
| 325 |
+
typedef struct cudaEventCreate_v3020_params_st {
|
| 326 |
+
cudaEvent_t *event;
|
| 327 |
+
} cudaEventCreate_v3020_params;
|
| 328 |
+
|
| 329 |
+
typedef struct cudaEventCreateWithFlags_v3020_params_st {
|
| 330 |
+
cudaEvent_t *event;
|
| 331 |
+
unsigned int flags;
|
| 332 |
+
} cudaEventCreateWithFlags_v3020_params;
|
| 333 |
+
|
| 334 |
+
typedef struct cudaEventRecord_ptsz_v7000_params_st {
|
| 335 |
+
cudaEvent_t event;
|
| 336 |
+
cudaStream_t stream;
|
| 337 |
+
} cudaEventRecord_ptsz_v7000_params;
|
| 338 |
+
|
| 339 |
+
typedef struct cudaEventRecordWithFlags_ptsz_v11010_params_st {
|
| 340 |
+
cudaEvent_t event;
|
| 341 |
+
cudaStream_t stream;
|
| 342 |
+
unsigned int flags;
|
| 343 |
+
} cudaEventRecordWithFlags_ptsz_v11010_params;
|
| 344 |
+
|
| 345 |
+
typedef struct cudaEventQuery_v3020_params_st {
|
| 346 |
+
cudaEvent_t event;
|
| 347 |
+
} cudaEventQuery_v3020_params;
|
| 348 |
+
|
| 349 |
+
typedef struct cudaEventSynchronize_v3020_params_st {
|
| 350 |
+
cudaEvent_t event;
|
| 351 |
+
} cudaEventSynchronize_v3020_params;
|
| 352 |
+
|
| 353 |
+
typedef struct cudaEventDestroy_v3020_params_st {
|
| 354 |
+
cudaEvent_t event;
|
| 355 |
+
} cudaEventDestroy_v3020_params;
|
| 356 |
+
|
| 357 |
+
typedef struct cudaEventElapsedTime_v3020_params_st {
|
| 358 |
+
float *ms;
|
| 359 |
+
cudaEvent_t start;
|
| 360 |
+
cudaEvent_t end;
|
| 361 |
+
} cudaEventElapsedTime_v3020_params;
|
| 362 |
+
|
| 363 |
+
typedef struct cudaImportExternalMemory_v10000_params_st {
|
| 364 |
+
cudaExternalMemory_t *extMem_out;
|
| 365 |
+
const struct cudaExternalMemoryHandleDesc *memHandleDesc;
|
| 366 |
+
} cudaImportExternalMemory_v10000_params;
|
| 367 |
+
|
| 368 |
+
typedef struct cudaExternalMemoryGetMappedBuffer_v10000_params_st {
|
| 369 |
+
void **devPtr;
|
| 370 |
+
cudaExternalMemory_t extMem;
|
| 371 |
+
const struct cudaExternalMemoryBufferDesc *bufferDesc;
|
| 372 |
+
} cudaExternalMemoryGetMappedBuffer_v10000_params;
|
| 373 |
+
|
| 374 |
+
typedef struct cudaExternalMemoryGetMappedMipmappedArray_v10000_params_st {
|
| 375 |
+
cudaMipmappedArray_t *mipmap;
|
| 376 |
+
cudaExternalMemory_t extMem;
|
| 377 |
+
const struct cudaExternalMemoryMipmappedArrayDesc *mipmapDesc;
|
| 378 |
+
} cudaExternalMemoryGetMappedMipmappedArray_v10000_params;
|
| 379 |
+
|
| 380 |
+
typedef struct cudaDestroyExternalMemory_v10000_params_st {
|
| 381 |
+
cudaExternalMemory_t extMem;
|
| 382 |
+
} cudaDestroyExternalMemory_v10000_params;
|
| 383 |
+
|
| 384 |
+
typedef struct cudaImportExternalSemaphore_v10000_params_st {
|
| 385 |
+
cudaExternalSemaphore_t *extSem_out;
|
| 386 |
+
const struct cudaExternalSemaphoreHandleDesc *semHandleDesc;
|
| 387 |
+
} cudaImportExternalSemaphore_v10000_params;
|
| 388 |
+
|
| 389 |
+
typedef struct cudaSignalExternalSemaphoresAsync_v2_ptsz_v11020_params_st {
|
| 390 |
+
const cudaExternalSemaphore_t *extSemArray;
|
| 391 |
+
const struct cudaExternalSemaphoreSignalParams *paramsArray;
|
| 392 |
+
unsigned int numExtSems;
|
| 393 |
+
cudaStream_t stream;
|
| 394 |
+
} cudaSignalExternalSemaphoresAsync_v2_ptsz_v11020_params;
|
| 395 |
+
|
| 396 |
+
typedef struct cudaWaitExternalSemaphoresAsync_v2_ptsz_v11020_params_st {
|
| 397 |
+
const cudaExternalSemaphore_t *extSemArray;
|
| 398 |
+
const struct cudaExternalSemaphoreWaitParams *paramsArray;
|
| 399 |
+
unsigned int numExtSems;
|
| 400 |
+
cudaStream_t stream;
|
| 401 |
+
} cudaWaitExternalSemaphoresAsync_v2_ptsz_v11020_params;
|
| 402 |
+
|
| 403 |
+
typedef struct cudaDestroyExternalSemaphore_v10000_params_st {
|
| 404 |
+
cudaExternalSemaphore_t extSem;
|
| 405 |
+
} cudaDestroyExternalSemaphore_v10000_params;
|
| 406 |
+
|
| 407 |
+
typedef struct cudaLaunchKernel_ptsz_v7000_params_st {
|
| 408 |
+
const void *func;
|
| 409 |
+
dim3 gridDim;
|
| 410 |
+
dim3 blockDim;
|
| 411 |
+
void **args;
|
| 412 |
+
size_t sharedMem;
|
| 413 |
+
cudaStream_t stream;
|
| 414 |
+
} cudaLaunchKernel_ptsz_v7000_params;
|
| 415 |
+
|
| 416 |
+
typedef struct cudaLaunchKernelExC_ptsz_v11060_params_st {
|
| 417 |
+
const cudaLaunchConfig_t *config;
|
| 418 |
+
const void *func;
|
| 419 |
+
void **args;
|
| 420 |
+
} cudaLaunchKernelExC_ptsz_v11060_params;
|
| 421 |
+
|
| 422 |
+
typedef struct cudaLaunchCooperativeKernel_ptsz_v9000_params_st {
|
| 423 |
+
const void *func;
|
| 424 |
+
dim3 gridDim;
|
| 425 |
+
dim3 blockDim;
|
| 426 |
+
void **args;
|
| 427 |
+
size_t sharedMem;
|
| 428 |
+
cudaStream_t stream;
|
| 429 |
+
} cudaLaunchCooperativeKernel_ptsz_v9000_params;
|
| 430 |
+
|
| 431 |
+
typedef struct cudaLaunchCooperativeKernelMultiDevice_v9000_params_st {
|
| 432 |
+
struct cudaLaunchParams *launchParamsList;
|
| 433 |
+
unsigned int numDevices;
|
| 434 |
+
unsigned int flags;
|
| 435 |
+
} cudaLaunchCooperativeKernelMultiDevice_v9000_params;
|
| 436 |
+
|
| 437 |
+
typedef struct cudaFuncSetCacheConfig_v3020_params_st {
|
| 438 |
+
const void *func;
|
| 439 |
+
enum cudaFuncCache cacheConfig;
|
| 440 |
+
} cudaFuncSetCacheConfig_v3020_params;
|
| 441 |
+
|
| 442 |
+
typedef struct cudaFuncGetAttributes_v3020_params_st {
|
| 443 |
+
struct cudaFuncAttributes *attr;
|
| 444 |
+
const void *func;
|
| 445 |
+
} cudaFuncGetAttributes_v3020_params;
|
| 446 |
+
|
| 447 |
+
typedef struct cudaFuncSetAttribute_v9000_params_st {
|
| 448 |
+
const void *func;
|
| 449 |
+
enum cudaFuncAttribute attr;
|
| 450 |
+
int value;
|
| 451 |
+
} cudaFuncSetAttribute_v9000_params;
|
| 452 |
+
|
| 453 |
+
typedef struct cudaFuncGetName_v12030_params_st {
|
| 454 |
+
const char **name;
|
| 455 |
+
const void *func;
|
| 456 |
+
} cudaFuncGetName_v12030_params;
|
| 457 |
+
|
| 458 |
+
typedef struct cudaFuncGetParamInfo_v12040_params_st {
|
| 459 |
+
const void *func;
|
| 460 |
+
size_t paramIndex;
|
| 461 |
+
size_t *paramOffset;
|
| 462 |
+
size_t *paramSize;
|
| 463 |
+
} cudaFuncGetParamInfo_v12040_params;
|
| 464 |
+
|
| 465 |
+
typedef struct cudaLaunchHostFunc_ptsz_v10000_params_st {
|
| 466 |
+
cudaStream_t stream;
|
| 467 |
+
cudaHostFn_t fn;
|
| 468 |
+
void *userData;
|
| 469 |
+
} cudaLaunchHostFunc_ptsz_v10000_params;
|
| 470 |
+
|
| 471 |
+
typedef struct cudaFuncSetSharedMemConfig_v4020_params_st {
|
| 472 |
+
const void *func;
|
| 473 |
+
enum cudaSharedMemConfig config;
|
| 474 |
+
} cudaFuncSetSharedMemConfig_v4020_params;
|
| 475 |
+
|
| 476 |
+
typedef struct cudaOccupancyMaxActiveBlocksPerMultiprocessor_v6050_params_st {
|
| 477 |
+
int *numBlocks;
|
| 478 |
+
const void *func;
|
| 479 |
+
int blockSize;
|
| 480 |
+
size_t dynamicSMemSize;
|
| 481 |
+
} cudaOccupancyMaxActiveBlocksPerMultiprocessor_v6050_params;
|
| 482 |
+
|
| 483 |
+
typedef struct cudaOccupancyAvailableDynamicSMemPerBlock_v10200_params_st {
|
| 484 |
+
size_t *dynamicSmemSize;
|
| 485 |
+
const void *func;
|
| 486 |
+
int numBlocks;
|
| 487 |
+
int blockSize;
|
| 488 |
+
} cudaOccupancyAvailableDynamicSMemPerBlock_v10200_params;
|
| 489 |
+
|
| 490 |
+
typedef struct cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags_v7000_params_st {
|
| 491 |
+
int *numBlocks;
|
| 492 |
+
const void *func;
|
| 493 |
+
int blockSize;
|
| 494 |
+
size_t dynamicSMemSize;
|
| 495 |
+
unsigned int flags;
|
| 496 |
+
} cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags_v7000_params;
|
| 497 |
+
|
| 498 |
+
typedef struct cudaOccupancyMaxPotentialClusterSize_v11070_params_st {
|
| 499 |
+
int *clusterSize;
|
| 500 |
+
const void *func;
|
| 501 |
+
const cudaLaunchConfig_t *launchConfig;
|
| 502 |
+
} cudaOccupancyMaxPotentialClusterSize_v11070_params;
|
| 503 |
+
|
| 504 |
+
typedef struct cudaOccupancyMaxActiveClusters_v11070_params_st {
|
| 505 |
+
int *numClusters;
|
| 506 |
+
const void *func;
|
| 507 |
+
const cudaLaunchConfig_t *launchConfig;
|
| 508 |
+
} cudaOccupancyMaxActiveClusters_v11070_params;
|
| 509 |
+
|
| 510 |
+
typedef struct cudaMallocManaged_v6000_params_st {
|
| 511 |
+
void **devPtr;
|
| 512 |
+
size_t size;
|
| 513 |
+
unsigned int flags;
|
| 514 |
+
} cudaMallocManaged_v6000_params;
|
| 515 |
+
|
| 516 |
+
typedef struct cudaMalloc_v3020_params_st {
|
| 517 |
+
void **devPtr;
|
| 518 |
+
size_t size;
|
| 519 |
+
} cudaMalloc_v3020_params;
|
| 520 |
+
|
| 521 |
+
typedef struct cudaMallocHost_v3020_params_st {
|
| 522 |
+
void **ptr;
|
| 523 |
+
size_t size;
|
| 524 |
+
} cudaMallocHost_v3020_params;
|
| 525 |
+
|
| 526 |
+
typedef struct cudaMallocPitch_v3020_params_st {
|
| 527 |
+
void **devPtr;
|
| 528 |
+
size_t *pitch;
|
| 529 |
+
size_t width;
|
| 530 |
+
size_t height;
|
| 531 |
+
} cudaMallocPitch_v3020_params;
|
| 532 |
+
|
| 533 |
+
typedef struct cudaMallocArray_v3020_params_st {
|
| 534 |
+
cudaArray_t *array;
|
| 535 |
+
const struct cudaChannelFormatDesc *desc;
|
| 536 |
+
size_t width;
|
| 537 |
+
size_t height;
|
| 538 |
+
unsigned int flags;
|
| 539 |
+
} cudaMallocArray_v3020_params;
|
| 540 |
+
|
| 541 |
+
typedef struct cudaFree_v3020_params_st {
|
| 542 |
+
void *devPtr;
|
| 543 |
+
} cudaFree_v3020_params;
|
| 544 |
+
|
| 545 |
+
typedef struct cudaFreeHost_v3020_params_st {
|
| 546 |
+
void *ptr;
|
| 547 |
+
} cudaFreeHost_v3020_params;
|
| 548 |
+
|
| 549 |
+
typedef struct cudaFreeArray_v3020_params_st {
|
| 550 |
+
cudaArray_t array;
|
| 551 |
+
} cudaFreeArray_v3020_params;
|
| 552 |
+
|
| 553 |
+
typedef struct cudaFreeMipmappedArray_v5000_params_st {
|
| 554 |
+
cudaMipmappedArray_t mipmappedArray;
|
| 555 |
+
} cudaFreeMipmappedArray_v5000_params;
|
| 556 |
+
|
| 557 |
+
typedef struct cudaHostAlloc_v3020_params_st {
|
| 558 |
+
void **pHost;
|
| 559 |
+
size_t size;
|
| 560 |
+
unsigned int flags;
|
| 561 |
+
} cudaHostAlloc_v3020_params;
|
| 562 |
+
|
| 563 |
+
typedef struct cudaHostRegister_v4000_params_st {
|
| 564 |
+
void *ptr;
|
| 565 |
+
size_t size;
|
| 566 |
+
unsigned int flags;
|
| 567 |
+
} cudaHostRegister_v4000_params;
|
| 568 |
+
|
| 569 |
+
typedef struct cudaHostUnregister_v4000_params_st {
|
| 570 |
+
void *ptr;
|
| 571 |
+
} cudaHostUnregister_v4000_params;
|
| 572 |
+
|
| 573 |
+
typedef struct cudaHostGetDevicePointer_v3020_params_st {
|
| 574 |
+
void **pDevice;
|
| 575 |
+
void *pHost;
|
| 576 |
+
unsigned int flags;
|
| 577 |
+
} cudaHostGetDevicePointer_v3020_params;
|
| 578 |
+
|
| 579 |
+
typedef struct cudaHostGetFlags_v3020_params_st {
|
| 580 |
+
unsigned int *pFlags;
|
| 581 |
+
void *pHost;
|
| 582 |
+
} cudaHostGetFlags_v3020_params;
|
| 583 |
+
|
| 584 |
+
typedef struct cudaMalloc3D_v3020_params_st {
|
| 585 |
+
struct cudaPitchedPtr *pitchedDevPtr;
|
| 586 |
+
struct cudaExtent extent;
|
| 587 |
+
} cudaMalloc3D_v3020_params;
|
| 588 |
+
|
| 589 |
+
typedef struct cudaMalloc3DArray_v3020_params_st {
|
| 590 |
+
cudaArray_t *array;
|
| 591 |
+
const struct cudaChannelFormatDesc *desc;
|
| 592 |
+
struct cudaExtent extent;
|
| 593 |
+
unsigned int flags;
|
| 594 |
+
} cudaMalloc3DArray_v3020_params;
|
| 595 |
+
|
| 596 |
+
typedef struct cudaMallocMipmappedArray_v5000_params_st {
|
| 597 |
+
cudaMipmappedArray_t *mipmappedArray;
|
| 598 |
+
const struct cudaChannelFormatDesc *desc;
|
| 599 |
+
struct cudaExtent extent;
|
| 600 |
+
unsigned int numLevels;
|
| 601 |
+
unsigned int flags;
|
| 602 |
+
} cudaMallocMipmappedArray_v5000_params;
|
| 603 |
+
|
| 604 |
+
typedef struct cudaGetMipmappedArrayLevel_v5000_params_st {
|
| 605 |
+
cudaArray_t *levelArray;
|
| 606 |
+
cudaMipmappedArray_const_t mipmappedArray;
|
| 607 |
+
unsigned int level;
|
| 608 |
+
} cudaGetMipmappedArrayLevel_v5000_params;
|
| 609 |
+
|
| 610 |
+
typedef struct cudaMemcpy3D_ptds_v7000_params_st {
|
| 611 |
+
const struct cudaMemcpy3DParms *p;
|
| 612 |
+
} cudaMemcpy3D_ptds_v7000_params;
|
| 613 |
+
|
| 614 |
+
typedef struct cudaMemcpy3DPeer_ptds_v7000_params_st {
|
| 615 |
+
const struct cudaMemcpy3DPeerParms *p;
|
| 616 |
+
} cudaMemcpy3DPeer_ptds_v7000_params;
|
| 617 |
+
|
| 618 |
+
typedef struct cudaMemcpy3DAsync_ptsz_v7000_params_st {
|
| 619 |
+
const struct cudaMemcpy3DParms *p;
|
| 620 |
+
cudaStream_t stream;
|
| 621 |
+
} cudaMemcpy3DAsync_ptsz_v7000_params;
|
| 622 |
+
|
| 623 |
+
typedef struct cudaMemcpy3DPeerAsync_ptsz_v7000_params_st {
|
| 624 |
+
const struct cudaMemcpy3DPeerParms *p;
|
| 625 |
+
cudaStream_t stream;
|
| 626 |
+
} cudaMemcpy3DPeerAsync_ptsz_v7000_params;
|
| 627 |
+
|
| 628 |
+
typedef struct cudaMemGetInfo_v3020_params_st {
|
| 629 |
+
size_t *free;
|
| 630 |
+
size_t *total;
|
| 631 |
+
} cudaMemGetInfo_v3020_params;
|
| 632 |
+
|
| 633 |
+
typedef struct cudaArrayGetInfo_v4010_params_st {
|
| 634 |
+
struct cudaChannelFormatDesc *desc;
|
| 635 |
+
struct cudaExtent *extent;
|
| 636 |
+
unsigned int *flags;
|
| 637 |
+
cudaArray_t array;
|
| 638 |
+
} cudaArrayGetInfo_v4010_params;
|
| 639 |
+
|
| 640 |
+
typedef struct cudaArrayGetPlane_v11020_params_st {
|
| 641 |
+
cudaArray_t *pPlaneArray;
|
| 642 |
+
cudaArray_t hArray;
|
| 643 |
+
unsigned int planeIdx;
|
| 644 |
+
} cudaArrayGetPlane_v11020_params;
|
| 645 |
+
|
| 646 |
+
typedef struct cudaArrayGetMemoryRequirements_v11060_params_st {
|
| 647 |
+
struct cudaArrayMemoryRequirements *memoryRequirements;
|
| 648 |
+
cudaArray_t array;
|
| 649 |
+
int device;
|
| 650 |
+
} cudaArrayGetMemoryRequirements_v11060_params;
|
| 651 |
+
|
| 652 |
+
typedef struct cudaMipmappedArrayGetMemoryRequirements_v11060_params_st {
|
| 653 |
+
struct cudaArrayMemoryRequirements *memoryRequirements;
|
| 654 |
+
cudaMipmappedArray_t mipmap;
|
| 655 |
+
int device;
|
| 656 |
+
} cudaMipmappedArrayGetMemoryRequirements_v11060_params;
|
| 657 |
+
|
| 658 |
+
typedef struct cudaArrayGetSparseProperties_v11010_params_st {
|
| 659 |
+
struct cudaArraySparseProperties *sparseProperties;
|
| 660 |
+
cudaArray_t array;
|
| 661 |
+
} cudaArrayGetSparseProperties_v11010_params;
|
| 662 |
+
|
| 663 |
+
typedef struct cudaMipmappedArrayGetSparseProperties_v11010_params_st {
|
| 664 |
+
struct cudaArraySparseProperties *sparseProperties;
|
| 665 |
+
cudaMipmappedArray_t mipmap;
|
| 666 |
+
} cudaMipmappedArrayGetSparseProperties_v11010_params;
|
| 667 |
+
|
| 668 |
+
typedef struct cudaMemcpy_ptds_v7000_params_st {
|
| 669 |
+
void *dst;
|
| 670 |
+
const void *src;
|
| 671 |
+
size_t count;
|
| 672 |
+
enum cudaMemcpyKind kind;
|
| 673 |
+
} cudaMemcpy_ptds_v7000_params;
|
| 674 |
+
|
| 675 |
+
typedef struct cudaMemcpyPeer_v4000_params_st {
|
| 676 |
+
void *dst;
|
| 677 |
+
int dstDevice;
|
| 678 |
+
const void *src;
|
| 679 |
+
int srcDevice;
|
| 680 |
+
size_t count;
|
| 681 |
+
} cudaMemcpyPeer_v4000_params;
|
| 682 |
+
|
| 683 |
+
typedef struct cudaMemcpy2D_ptds_v7000_params_st {
|
| 684 |
+
void *dst;
|
| 685 |
+
size_t dpitch;
|
| 686 |
+
const void *src;
|
| 687 |
+
size_t spitch;
|
| 688 |
+
size_t width;
|
| 689 |
+
size_t height;
|
| 690 |
+
enum cudaMemcpyKind kind;
|
| 691 |
+
} cudaMemcpy2D_ptds_v7000_params;
|
| 692 |
+
|
| 693 |
+
typedef struct cudaMemcpy2DToArray_ptds_v7000_params_st {
|
| 694 |
+
cudaArray_t dst;
|
| 695 |
+
size_t wOffset;
|
| 696 |
+
size_t hOffset;
|
| 697 |
+
const void *src;
|
| 698 |
+
size_t spitch;
|
| 699 |
+
size_t width;
|
| 700 |
+
size_t height;
|
| 701 |
+
enum cudaMemcpyKind kind;
|
| 702 |
+
} cudaMemcpy2DToArray_ptds_v7000_params;
|
| 703 |
+
|
| 704 |
+
typedef struct cudaMemcpy2DFromArray_ptds_v7000_params_st {
|
| 705 |
+
void *dst;
|
| 706 |
+
size_t dpitch;
|
| 707 |
+
cudaArray_const_t src;
|
| 708 |
+
size_t wOffset;
|
| 709 |
+
size_t hOffset;
|
| 710 |
+
size_t width;
|
| 711 |
+
size_t height;
|
| 712 |
+
enum cudaMemcpyKind kind;
|
| 713 |
+
} cudaMemcpy2DFromArray_ptds_v7000_params;
|
| 714 |
+
|
| 715 |
+
typedef struct cudaMemcpy2DArrayToArray_ptds_v7000_params_st {
|
| 716 |
+
cudaArray_t dst;
|
| 717 |
+
size_t wOffsetDst;
|
| 718 |
+
size_t hOffsetDst;
|
| 719 |
+
cudaArray_const_t src;
|
| 720 |
+
size_t wOffsetSrc;
|
| 721 |
+
size_t hOffsetSrc;
|
| 722 |
+
size_t width;
|
| 723 |
+
size_t height;
|
| 724 |
+
enum cudaMemcpyKind kind;
|
| 725 |
+
} cudaMemcpy2DArrayToArray_ptds_v7000_params;
|
| 726 |
+
|
| 727 |
+
typedef struct cudaMemcpyToSymbol_ptds_v7000_params_st {
|
| 728 |
+
const void *symbol;
|
| 729 |
+
const void *src;
|
| 730 |
+
size_t count;
|
| 731 |
+
size_t offset;
|
| 732 |
+
enum cudaMemcpyKind kind;
|
| 733 |
+
} cudaMemcpyToSymbol_ptds_v7000_params;
|
| 734 |
+
|
| 735 |
+
typedef struct cudaMemcpyFromSymbol_ptds_v7000_params_st {
|
| 736 |
+
void *dst;
|
| 737 |
+
const void *symbol;
|
| 738 |
+
size_t count;
|
| 739 |
+
size_t offset;
|
| 740 |
+
enum cudaMemcpyKind kind;
|
| 741 |
+
} cudaMemcpyFromSymbol_ptds_v7000_params;
|
| 742 |
+
|
| 743 |
+
typedef struct cudaMemcpyAsync_ptsz_v7000_params_st {
|
| 744 |
+
void *dst;
|
| 745 |
+
const void *src;
|
| 746 |
+
size_t count;
|
| 747 |
+
enum cudaMemcpyKind kind;
|
| 748 |
+
cudaStream_t stream;
|
| 749 |
+
} cudaMemcpyAsync_ptsz_v7000_params;
|
| 750 |
+
|
| 751 |
+
typedef struct cudaMemcpyPeerAsync_v4000_params_st {
|
| 752 |
+
void *dst;
|
| 753 |
+
int dstDevice;
|
| 754 |
+
const void *src;
|
| 755 |
+
int srcDevice;
|
| 756 |
+
size_t count;
|
| 757 |
+
cudaStream_t stream;
|
| 758 |
+
} cudaMemcpyPeerAsync_v4000_params;
|
| 759 |
+
|
| 760 |
+
typedef struct cudaMemcpy2DAsync_ptsz_v7000_params_st {
|
| 761 |
+
void *dst;
|
| 762 |
+
size_t dpitch;
|
| 763 |
+
const void *src;
|
| 764 |
+
size_t spitch;
|
| 765 |
+
size_t width;
|
| 766 |
+
size_t height;
|
| 767 |
+
enum cudaMemcpyKind kind;
|
| 768 |
+
cudaStream_t stream;
|
| 769 |
+
} cudaMemcpy2DAsync_ptsz_v7000_params;
|
| 770 |
+
|
| 771 |
+
typedef struct cudaMemcpy2DToArrayAsync_ptsz_v7000_params_st {
|
| 772 |
+
cudaArray_t dst;
|
| 773 |
+
size_t wOffset;
|
| 774 |
+
size_t hOffset;
|
| 775 |
+
const void *src;
|
| 776 |
+
size_t spitch;
|
| 777 |
+
size_t width;
|
| 778 |
+
size_t height;
|
| 779 |
+
enum cudaMemcpyKind kind;
|
| 780 |
+
cudaStream_t stream;
|
| 781 |
+
} cudaMemcpy2DToArrayAsync_ptsz_v7000_params;
|
| 782 |
+
|
| 783 |
+
typedef struct cudaMemcpy2DFromArrayAsync_ptsz_v7000_params_st {
|
| 784 |
+
void *dst;
|
| 785 |
+
size_t dpitch;
|
| 786 |
+
cudaArray_const_t src;
|
| 787 |
+
size_t wOffset;
|
| 788 |
+
size_t hOffset;
|
| 789 |
+
size_t width;
|
| 790 |
+
size_t height;
|
| 791 |
+
enum cudaMemcpyKind kind;
|
| 792 |
+
cudaStream_t stream;
|
| 793 |
+
} cudaMemcpy2DFromArrayAsync_ptsz_v7000_params;
|
| 794 |
+
|
| 795 |
+
typedef struct cudaMemcpyToSymbolAsync_ptsz_v7000_params_st {
|
| 796 |
+
const void *symbol;
|
| 797 |
+
const void *src;
|
| 798 |
+
size_t count;
|
| 799 |
+
size_t offset;
|
| 800 |
+
enum cudaMemcpyKind kind;
|
| 801 |
+
cudaStream_t stream;
|
| 802 |
+
} cudaMemcpyToSymbolAsync_ptsz_v7000_params;
|
| 803 |
+
|
| 804 |
+
typedef struct cudaMemcpyFromSymbolAsync_ptsz_v7000_params_st {
|
| 805 |
+
void *dst;
|
| 806 |
+
const void *symbol;
|
| 807 |
+
size_t count;
|
| 808 |
+
size_t offset;
|
| 809 |
+
enum cudaMemcpyKind kind;
|
| 810 |
+
cudaStream_t stream;
|
| 811 |
+
} cudaMemcpyFromSymbolAsync_ptsz_v7000_params;
|
| 812 |
+
|
| 813 |
+
typedef struct cudaMemset_ptds_v7000_params_st {
|
| 814 |
+
void *devPtr;
|
| 815 |
+
int value;
|
| 816 |
+
size_t count;
|
| 817 |
+
} cudaMemset_ptds_v7000_params;
|
| 818 |
+
|
| 819 |
+
typedef struct cudaMemset2D_ptds_v7000_params_st {
|
| 820 |
+
void *devPtr;
|
| 821 |
+
size_t pitch;
|
| 822 |
+
int value;
|
| 823 |
+
size_t width;
|
| 824 |
+
size_t height;
|
| 825 |
+
} cudaMemset2D_ptds_v7000_params;
|
| 826 |
+
|
| 827 |
+
typedef struct cudaMemset3D_ptds_v7000_params_st {
|
| 828 |
+
struct cudaPitchedPtr pitchedDevPtr;
|
| 829 |
+
int value;
|
| 830 |
+
struct cudaExtent extent;
|
| 831 |
+
} cudaMemset3D_ptds_v7000_params;
|
| 832 |
+
|
| 833 |
+
typedef struct cudaMemsetAsync_ptsz_v7000_params_st {
|
| 834 |
+
void *devPtr;
|
| 835 |
+
int value;
|
| 836 |
+
size_t count;
|
| 837 |
+
cudaStream_t stream;
|
| 838 |
+
} cudaMemsetAsync_ptsz_v7000_params;
|
| 839 |
+
|
| 840 |
+
typedef struct cudaMemset2DAsync_ptsz_v7000_params_st {
|
| 841 |
+
void *devPtr;
|
| 842 |
+
size_t pitch;
|
| 843 |
+
int value;
|
| 844 |
+
size_t width;
|
| 845 |
+
size_t height;
|
| 846 |
+
cudaStream_t stream;
|
| 847 |
+
} cudaMemset2DAsync_ptsz_v7000_params;
|
| 848 |
+
|
| 849 |
+
typedef struct cudaMemset3DAsync_ptsz_v7000_params_st {
|
| 850 |
+
struct cudaPitchedPtr pitchedDevPtr;
|
| 851 |
+
int value;
|
| 852 |
+
struct cudaExtent extent;
|
| 853 |
+
cudaStream_t stream;
|
| 854 |
+
} cudaMemset3DAsync_ptsz_v7000_params;
|
| 855 |
+
|
| 856 |
+
typedef struct cudaGetSymbolAddress_v3020_params_st {
|
| 857 |
+
void **devPtr;
|
| 858 |
+
const void *symbol;
|
| 859 |
+
} cudaGetSymbolAddress_v3020_params;
|
| 860 |
+
|
| 861 |
+
typedef struct cudaGetSymbolSize_v3020_params_st {
|
| 862 |
+
size_t *size;
|
| 863 |
+
const void *symbol;
|
| 864 |
+
} cudaGetSymbolSize_v3020_params;
|
| 865 |
+
|
| 866 |
+
typedef struct cudaMemPrefetchAsync_ptsz_v8000_params_st {
|
| 867 |
+
const void *devPtr;
|
| 868 |
+
size_t count;
|
| 869 |
+
int dstDevice;
|
| 870 |
+
cudaStream_t stream;
|
| 871 |
+
} cudaMemPrefetchAsync_ptsz_v8000_params;
|
| 872 |
+
|
| 873 |
+
typedef struct cudaMemPrefetchAsync_v2_ptsz_v12020_params_st {
|
| 874 |
+
const void *devPtr;
|
| 875 |
+
size_t count;
|
| 876 |
+
struct cudaMemLocation location;
|
| 877 |
+
unsigned int flags;
|
| 878 |
+
cudaStream_t stream;
|
| 879 |
+
} cudaMemPrefetchAsync_v2_ptsz_v12020_params;
|
| 880 |
+
|
| 881 |
+
typedef struct cudaMemAdvise_v8000_params_st {
|
| 882 |
+
const void *devPtr;
|
| 883 |
+
size_t count;
|
| 884 |
+
enum cudaMemoryAdvise advice;
|
| 885 |
+
int device;
|
| 886 |
+
} cudaMemAdvise_v8000_params;
|
| 887 |
+
|
| 888 |
+
typedef struct cudaMemAdvise_v2_v12020_params_st {
|
| 889 |
+
const void *devPtr;
|
| 890 |
+
size_t count;
|
| 891 |
+
enum cudaMemoryAdvise advice;
|
| 892 |
+
struct cudaMemLocation location;
|
| 893 |
+
} cudaMemAdvise_v2_v12020_params;
|
| 894 |
+
|
| 895 |
+
typedef struct cudaMemRangeGetAttribute_v8000_params_st {
|
| 896 |
+
void *data;
|
| 897 |
+
size_t dataSize;
|
| 898 |
+
enum cudaMemRangeAttribute attribute;
|
| 899 |
+
const void *devPtr;
|
| 900 |
+
size_t count;
|
| 901 |
+
} cudaMemRangeGetAttribute_v8000_params;
|
| 902 |
+
|
| 903 |
+
typedef struct cudaMemRangeGetAttributes_v8000_params_st {
|
| 904 |
+
void **data;
|
| 905 |
+
size_t *dataSizes;
|
| 906 |
+
enum cudaMemRangeAttribute *attributes;
|
| 907 |
+
size_t numAttributes;
|
| 908 |
+
const void *devPtr;
|
| 909 |
+
size_t count;
|
| 910 |
+
} cudaMemRangeGetAttributes_v8000_params;
|
| 911 |
+
|
| 912 |
+
typedef struct cudaMemcpyToArray_ptds_v7000_params_st {
|
| 913 |
+
cudaArray_t dst;
|
| 914 |
+
size_t wOffset;
|
| 915 |
+
size_t hOffset;
|
| 916 |
+
const void *src;
|
| 917 |
+
size_t count;
|
| 918 |
+
enum cudaMemcpyKind kind;
|
| 919 |
+
} cudaMemcpyToArray_ptds_v7000_params;
|
| 920 |
+
|
| 921 |
+
typedef struct cudaMemcpyFromArray_ptds_v7000_params_st {
|
| 922 |
+
void *dst;
|
| 923 |
+
cudaArray_const_t src;
|
| 924 |
+
size_t wOffset;
|
| 925 |
+
size_t hOffset;
|
| 926 |
+
size_t count;
|
| 927 |
+
enum cudaMemcpyKind kind;
|
| 928 |
+
} cudaMemcpyFromArray_ptds_v7000_params;
|
| 929 |
+
|
| 930 |
+
typedef struct cudaMemcpyArrayToArray_ptds_v7000_params_st {
|
| 931 |
+
cudaArray_t dst;
|
| 932 |
+
size_t wOffsetDst;
|
| 933 |
+
size_t hOffsetDst;
|
| 934 |
+
cudaArray_const_t src;
|
| 935 |
+
size_t wOffsetSrc;
|
| 936 |
+
size_t hOffsetSrc;
|
| 937 |
+
size_t count;
|
| 938 |
+
enum cudaMemcpyKind kind;
|
| 939 |
+
} cudaMemcpyArrayToArray_ptds_v7000_params;
|
| 940 |
+
|
| 941 |
+
typedef struct cudaMemcpyToArrayAsync_ptsz_v7000_params_st {
|
| 942 |
+
cudaArray_t dst;
|
| 943 |
+
size_t wOffset;
|
| 944 |
+
size_t hOffset;
|
| 945 |
+
const void *src;
|
| 946 |
+
size_t count;
|
| 947 |
+
enum cudaMemcpyKind kind;
|
| 948 |
+
cudaStream_t stream;
|
| 949 |
+
} cudaMemcpyToArrayAsync_ptsz_v7000_params;
|
| 950 |
+
|
| 951 |
+
typedef struct cudaMemcpyFromArrayAsync_ptsz_v7000_params_st {
|
| 952 |
+
void *dst;
|
| 953 |
+
cudaArray_const_t src;
|
| 954 |
+
size_t wOffset;
|
| 955 |
+
size_t hOffset;
|
| 956 |
+
size_t count;
|
| 957 |
+
enum cudaMemcpyKind kind;
|
| 958 |
+
cudaStream_t stream;
|
| 959 |
+
} cudaMemcpyFromArrayAsync_ptsz_v7000_params;
|
| 960 |
+
|
| 961 |
+
typedef struct cudaMallocAsync_ptsz_v11020_params_st {
|
| 962 |
+
void **devPtr;
|
| 963 |
+
size_t size;
|
| 964 |
+
cudaStream_t hStream;
|
| 965 |
+
} cudaMallocAsync_ptsz_v11020_params;
|
| 966 |
+
|
| 967 |
+
typedef struct cudaFreeAsync_ptsz_v11020_params_st {
|
| 968 |
+
void *devPtr;
|
| 969 |
+
cudaStream_t hStream;
|
| 970 |
+
} cudaFreeAsync_ptsz_v11020_params;
|
| 971 |
+
|
| 972 |
+
typedef struct cudaMemPoolTrimTo_v11020_params_st {
|
| 973 |
+
cudaMemPool_t memPool;
|
| 974 |
+
size_t minBytesToKeep;
|
| 975 |
+
} cudaMemPoolTrimTo_v11020_params;
|
| 976 |
+
|
| 977 |
+
typedef struct cudaMemPoolSetAttribute_v11020_params_st {
|
| 978 |
+
cudaMemPool_t memPool;
|
| 979 |
+
enum cudaMemPoolAttr attr;
|
| 980 |
+
void *value;
|
| 981 |
+
} cudaMemPoolSetAttribute_v11020_params;
|
| 982 |
+
|
| 983 |
+
typedef struct cudaMemPoolGetAttribute_v11020_params_st {
|
| 984 |
+
cudaMemPool_t memPool;
|
| 985 |
+
enum cudaMemPoolAttr attr;
|
| 986 |
+
void *value;
|
| 987 |
+
} cudaMemPoolGetAttribute_v11020_params;
|
| 988 |
+
|
| 989 |
+
typedef struct cudaMemPoolSetAccess_v11020_params_st {
|
| 990 |
+
cudaMemPool_t memPool;
|
| 991 |
+
const struct cudaMemAccessDesc *descList;
|
| 992 |
+
size_t count;
|
| 993 |
+
} cudaMemPoolSetAccess_v11020_params;
|
| 994 |
+
|
| 995 |
+
typedef struct cudaMemPoolGetAccess_v11020_params_st {
|
| 996 |
+
enum cudaMemAccessFlags *flags;
|
| 997 |
+
cudaMemPool_t memPool;
|
| 998 |
+
struct cudaMemLocation *location;
|
| 999 |
+
} cudaMemPoolGetAccess_v11020_params;
|
| 1000 |
+
|
| 1001 |
+
typedef struct cudaMemPoolCreate_v11020_params_st {
|
| 1002 |
+
cudaMemPool_t *memPool;
|
| 1003 |
+
const struct cudaMemPoolProps *poolProps;
|
| 1004 |
+
} cudaMemPoolCreate_v11020_params;
|
| 1005 |
+
|
| 1006 |
+
typedef struct cudaMemPoolDestroy_v11020_params_st {
|
| 1007 |
+
cudaMemPool_t memPool;
|
| 1008 |
+
} cudaMemPoolDestroy_v11020_params;
|
| 1009 |
+
|
| 1010 |
+
typedef struct cudaMallocFromPoolAsync_ptsz_v11020_params_st {
|
| 1011 |
+
void **ptr;
|
| 1012 |
+
size_t size;
|
| 1013 |
+
cudaMemPool_t memPool;
|
| 1014 |
+
cudaStream_t stream;
|
| 1015 |
+
} cudaMallocFromPoolAsync_ptsz_v11020_params;
|
| 1016 |
+
|
| 1017 |
+
typedef struct cudaMemPoolExportToShareableHandle_v11020_params_st {
|
| 1018 |
+
void *shareableHandle;
|
| 1019 |
+
cudaMemPool_t memPool;
|
| 1020 |
+
enum cudaMemAllocationHandleType handleType;
|
| 1021 |
+
unsigned int flags;
|
| 1022 |
+
} cudaMemPoolExportToShareableHandle_v11020_params;
|
| 1023 |
+
|
| 1024 |
+
typedef struct cudaMemPoolImportFromShareableHandle_v11020_params_st {
|
| 1025 |
+
cudaMemPool_t *memPool;
|
| 1026 |
+
void *shareableHandle;
|
| 1027 |
+
enum cudaMemAllocationHandleType handleType;
|
| 1028 |
+
unsigned int flags;
|
| 1029 |
+
} cudaMemPoolImportFromShareableHandle_v11020_params;
|
| 1030 |
+
|
| 1031 |
+
typedef struct cudaMemPoolExportPointer_v11020_params_st {
|
| 1032 |
+
struct cudaMemPoolPtrExportData *exportData;
|
| 1033 |
+
void *ptr;
|
| 1034 |
+
} cudaMemPoolExportPointer_v11020_params;
|
| 1035 |
+
|
| 1036 |
+
typedef struct cudaMemPoolImportPointer_v11020_params_st {
|
| 1037 |
+
void **ptr;
|
| 1038 |
+
cudaMemPool_t memPool;
|
| 1039 |
+
struct cudaMemPoolPtrExportData *exportData;
|
| 1040 |
+
} cudaMemPoolImportPointer_v11020_params;
|
| 1041 |
+
|
| 1042 |
+
typedef struct cudaPointerGetAttributes_v4000_params_st {
|
| 1043 |
+
struct cudaPointerAttributes *attributes;
|
| 1044 |
+
const void *ptr;
|
| 1045 |
+
} cudaPointerGetAttributes_v4000_params;
|
| 1046 |
+
|
| 1047 |
+
typedef struct cudaDeviceCanAccessPeer_v4000_params_st {
|
| 1048 |
+
int *canAccessPeer;
|
| 1049 |
+
int device;
|
| 1050 |
+
int peerDevice;
|
| 1051 |
+
} cudaDeviceCanAccessPeer_v4000_params;
|
| 1052 |
+
|
| 1053 |
+
typedef struct cudaDeviceEnablePeerAccess_v4000_params_st {
|
| 1054 |
+
int peerDevice;
|
| 1055 |
+
unsigned int flags;
|
| 1056 |
+
} cudaDeviceEnablePeerAccess_v4000_params;
|
| 1057 |
+
|
| 1058 |
+
typedef struct cudaDeviceDisablePeerAccess_v4000_params_st {
|
| 1059 |
+
int peerDevice;
|
| 1060 |
+
} cudaDeviceDisablePeerAccess_v4000_params;
|
| 1061 |
+
|
| 1062 |
+
typedef struct cudaGraphicsUnregisterResource_v3020_params_st {
|
| 1063 |
+
cudaGraphicsResource_t resource;
|
| 1064 |
+
} cudaGraphicsUnregisterResource_v3020_params;
|
| 1065 |
+
|
| 1066 |
+
typedef struct cudaGraphicsResourceSetMapFlags_v3020_params_st {
|
| 1067 |
+
cudaGraphicsResource_t resource;
|
| 1068 |
+
unsigned int flags;
|
| 1069 |
+
} cudaGraphicsResourceSetMapFlags_v3020_params;
|
| 1070 |
+
|
| 1071 |
+
typedef struct cudaGraphicsMapResources_v3020_params_st {
|
| 1072 |
+
int count;
|
| 1073 |
+
cudaGraphicsResource_t *resources;
|
| 1074 |
+
cudaStream_t stream;
|
| 1075 |
+
} cudaGraphicsMapResources_v3020_params;
|
| 1076 |
+
|
| 1077 |
+
typedef struct cudaGraphicsUnmapResources_v3020_params_st {
|
| 1078 |
+
int count;
|
| 1079 |
+
cudaGraphicsResource_t *resources;
|
| 1080 |
+
cudaStream_t stream;
|
| 1081 |
+
} cudaGraphicsUnmapResources_v3020_params;
|
| 1082 |
+
|
| 1083 |
+
typedef struct cudaGraphicsResourceGetMappedPointer_v3020_params_st {
|
| 1084 |
+
void **devPtr;
|
| 1085 |
+
size_t *size;
|
| 1086 |
+
cudaGraphicsResource_t resource;
|
| 1087 |
+
} cudaGraphicsResourceGetMappedPointer_v3020_params;
|
| 1088 |
+
|
| 1089 |
+
typedef struct cudaGraphicsSubResourceGetMappedArray_v3020_params_st {
|
| 1090 |
+
cudaArray_t *array;
|
| 1091 |
+
cudaGraphicsResource_t resource;
|
| 1092 |
+
unsigned int arrayIndex;
|
| 1093 |
+
unsigned int mipLevel;
|
| 1094 |
+
} cudaGraphicsSubResourceGetMappedArray_v3020_params;
|
| 1095 |
+
|
| 1096 |
+
typedef struct cudaGraphicsResourceGetMappedMipmappedArray_v5000_params_st {
|
| 1097 |
+
cudaMipmappedArray_t *mipmappedArray;
|
| 1098 |
+
cudaGraphicsResource_t resource;
|
| 1099 |
+
} cudaGraphicsResourceGetMappedMipmappedArray_v5000_params;
|
| 1100 |
+
|
| 1101 |
+
typedef struct cudaGetChannelDesc_v3020_params_st {
|
| 1102 |
+
struct cudaChannelFormatDesc *desc;
|
| 1103 |
+
cudaArray_const_t array;
|
| 1104 |
+
} cudaGetChannelDesc_v3020_params;
|
| 1105 |
+
|
| 1106 |
+
typedef struct cudaCreateChannelDesc_v3020_params_st {
|
| 1107 |
+
int x;
|
| 1108 |
+
int y;
|
| 1109 |
+
int z;
|
| 1110 |
+
int w;
|
| 1111 |
+
enum cudaChannelFormatKind f;
|
| 1112 |
+
} cudaCreateChannelDesc_v3020_params;
|
| 1113 |
+
|
| 1114 |
+
typedef struct cudaCreateTextureObject_v5000_params_st {
|
| 1115 |
+
cudaTextureObject_t *pTexObject;
|
| 1116 |
+
const struct cudaResourceDesc *pResDesc;
|
| 1117 |
+
const struct cudaTextureDesc *pTexDesc;
|
| 1118 |
+
const struct cudaResourceViewDesc *pResViewDesc;
|
| 1119 |
+
} cudaCreateTextureObject_v5000_params;
|
| 1120 |
+
|
| 1121 |
+
typedef struct cudaDestroyTextureObject_v5000_params_st {
|
| 1122 |
+
cudaTextureObject_t texObject;
|
| 1123 |
+
} cudaDestroyTextureObject_v5000_params;
|
| 1124 |
+
|
| 1125 |
+
typedef struct cudaGetTextureObjectResourceDesc_v5000_params_st {
|
| 1126 |
+
struct cudaResourceDesc *pResDesc;
|
| 1127 |
+
cudaTextureObject_t texObject;
|
| 1128 |
+
} cudaGetTextureObjectResourceDesc_v5000_params;
|
| 1129 |
+
|
| 1130 |
+
typedef struct cudaGetTextureObjectTextureDesc_v5000_params_st {
|
| 1131 |
+
struct cudaTextureDesc *pTexDesc;
|
| 1132 |
+
cudaTextureObject_t texObject;
|
| 1133 |
+
} cudaGetTextureObjectTextureDesc_v5000_params;
|
| 1134 |
+
|
| 1135 |
+
typedef struct cudaGetTextureObjectResourceViewDesc_v5000_params_st {
|
| 1136 |
+
struct cudaResourceViewDesc *pResViewDesc;
|
| 1137 |
+
cudaTextureObject_t texObject;
|
| 1138 |
+
} cudaGetTextureObjectResourceViewDesc_v5000_params;
|
| 1139 |
+
|
| 1140 |
+
typedef struct cudaCreateSurfaceObject_v5000_params_st {
|
| 1141 |
+
cudaSurfaceObject_t *pSurfObject;
|
| 1142 |
+
const struct cudaResourceDesc *pResDesc;
|
| 1143 |
+
} cudaCreateSurfaceObject_v5000_params;
|
| 1144 |
+
|
| 1145 |
+
typedef struct cudaDestroySurfaceObject_v5000_params_st {
|
| 1146 |
+
cudaSurfaceObject_t surfObject;
|
| 1147 |
+
} cudaDestroySurfaceObject_v5000_params;
|
| 1148 |
+
|
| 1149 |
+
typedef struct cudaGetSurfaceObjectResourceDesc_v5000_params_st {
|
| 1150 |
+
struct cudaResourceDesc *pResDesc;
|
| 1151 |
+
cudaSurfaceObject_t surfObject;
|
| 1152 |
+
} cudaGetSurfaceObjectResourceDesc_v5000_params;
|
| 1153 |
+
|
| 1154 |
+
typedef struct cudaDriverGetVersion_v3020_params_st {
|
| 1155 |
+
int *driverVersion;
|
| 1156 |
+
} cudaDriverGetVersion_v3020_params;
|
| 1157 |
+
|
| 1158 |
+
typedef struct cudaRuntimeGetVersion_v3020_params_st {
|
| 1159 |
+
int *runtimeVersion;
|
| 1160 |
+
} cudaRuntimeGetVersion_v3020_params;
|
| 1161 |
+
|
| 1162 |
+
typedef struct cudaGraphCreate_v10000_params_st {
|
| 1163 |
+
cudaGraph_t *pGraph;
|
| 1164 |
+
unsigned int flags;
|
| 1165 |
+
} cudaGraphCreate_v10000_params;
|
| 1166 |
+
|
| 1167 |
+
typedef struct cudaGraphAddKernelNode_v10000_params_st {
|
| 1168 |
+
cudaGraphNode_t *pGraphNode;
|
| 1169 |
+
cudaGraph_t graph;
|
| 1170 |
+
const cudaGraphNode_t *pDependencies;
|
| 1171 |
+
size_t numDependencies;
|
| 1172 |
+
const struct cudaKernelNodeParams *pNodeParams;
|
| 1173 |
+
} cudaGraphAddKernelNode_v10000_params;
|
| 1174 |
+
|
| 1175 |
+
typedef struct cudaGraphKernelNodeGetParams_v10000_params_st {
|
| 1176 |
+
cudaGraphNode_t node;
|
| 1177 |
+
struct cudaKernelNodeParams *pNodeParams;
|
| 1178 |
+
} cudaGraphKernelNodeGetParams_v10000_params;
|
| 1179 |
+
|
| 1180 |
+
typedef struct cudaGraphKernelNodeSetParams_v10000_params_st {
|
| 1181 |
+
cudaGraphNode_t node;
|
| 1182 |
+
const struct cudaKernelNodeParams *pNodeParams;
|
| 1183 |
+
} cudaGraphKernelNodeSetParams_v10000_params;
|
| 1184 |
+
|
| 1185 |
+
typedef struct cudaGraphKernelNodeCopyAttributes_v11000_params_st {
|
| 1186 |
+
cudaGraphNode_t hSrc;
|
| 1187 |
+
cudaGraphNode_t hDst;
|
| 1188 |
+
} cudaGraphKernelNodeCopyAttributes_v11000_params;
|
| 1189 |
+
|
| 1190 |
+
typedef struct cudaGraphKernelNodeGetAttribute_v11000_params_st {
|
| 1191 |
+
cudaGraphNode_t hNode;
|
| 1192 |
+
cudaKernelNodeAttrID attr;
|
| 1193 |
+
cudaKernelNodeAttrValue *value_out;
|
| 1194 |
+
} cudaGraphKernelNodeGetAttribute_v11000_params;
|
| 1195 |
+
|
| 1196 |
+
typedef struct cudaGraphKernelNodeSetAttribute_v11000_params_st {
|
| 1197 |
+
cudaGraphNode_t hNode;
|
| 1198 |
+
cudaKernelNodeAttrID attr;
|
| 1199 |
+
const cudaKernelNodeAttrValue *value;
|
| 1200 |
+
} cudaGraphKernelNodeSetAttribute_v11000_params;
|
| 1201 |
+
|
| 1202 |
+
typedef struct cudaGraphAddMemcpyNode_v10000_params_st {
|
| 1203 |
+
cudaGraphNode_t *pGraphNode;
|
| 1204 |
+
cudaGraph_t graph;
|
| 1205 |
+
const cudaGraphNode_t *pDependencies;
|
| 1206 |
+
size_t numDependencies;
|
| 1207 |
+
const struct cudaMemcpy3DParms *pCopyParams;
|
| 1208 |
+
} cudaGraphAddMemcpyNode_v10000_params;
|
| 1209 |
+
|
| 1210 |
+
typedef struct cudaGraphAddMemcpyNodeToSymbol_v11010_params_st {
|
| 1211 |
+
cudaGraphNode_t *pGraphNode;
|
| 1212 |
+
cudaGraph_t graph;
|
| 1213 |
+
const cudaGraphNode_t *pDependencies;
|
| 1214 |
+
size_t numDependencies;
|
| 1215 |
+
const void *symbol;
|
| 1216 |
+
const void *src;
|
| 1217 |
+
size_t count;
|
| 1218 |
+
size_t offset;
|
| 1219 |
+
enum cudaMemcpyKind kind;
|
| 1220 |
+
} cudaGraphAddMemcpyNodeToSymbol_v11010_params;
|
| 1221 |
+
|
| 1222 |
+
typedef struct cudaGraphAddMemcpyNodeFromSymbol_v11010_params_st {
|
| 1223 |
+
cudaGraphNode_t *pGraphNode;
|
| 1224 |
+
cudaGraph_t graph;
|
| 1225 |
+
const cudaGraphNode_t *pDependencies;
|
| 1226 |
+
size_t numDependencies;
|
| 1227 |
+
void *dst;
|
| 1228 |
+
const void *symbol;
|
| 1229 |
+
size_t count;
|
| 1230 |
+
size_t offset;
|
| 1231 |
+
enum cudaMemcpyKind kind;
|
| 1232 |
+
} cudaGraphAddMemcpyNodeFromSymbol_v11010_params;
|
| 1233 |
+
|
| 1234 |
+
typedef struct cudaGraphAddMemcpyNode1D_v11010_params_st {
|
| 1235 |
+
cudaGraphNode_t *pGraphNode;
|
| 1236 |
+
cudaGraph_t graph;
|
| 1237 |
+
const cudaGraphNode_t *pDependencies;
|
| 1238 |
+
size_t numDependencies;
|
| 1239 |
+
void *dst;
|
| 1240 |
+
const void *src;
|
| 1241 |
+
size_t count;
|
| 1242 |
+
enum cudaMemcpyKind kind;
|
| 1243 |
+
} cudaGraphAddMemcpyNode1D_v11010_params;
|
| 1244 |
+
|
| 1245 |
+
typedef struct cudaGraphMemcpyNodeGetParams_v10000_params_st {
|
| 1246 |
+
cudaGraphNode_t node;
|
| 1247 |
+
struct cudaMemcpy3DParms *pNodeParams;
|
| 1248 |
+
} cudaGraphMemcpyNodeGetParams_v10000_params;
|
| 1249 |
+
|
| 1250 |
+
typedef struct cudaGraphMemcpyNodeSetParams_v10000_params_st {
|
| 1251 |
+
cudaGraphNode_t node;
|
| 1252 |
+
const struct cudaMemcpy3DParms *pNodeParams;
|
| 1253 |
+
} cudaGraphMemcpyNodeSetParams_v10000_params;
|
| 1254 |
+
|
| 1255 |
+
typedef struct cudaGraphMemcpyNodeSetParamsToSymbol_v11010_params_st {
|
| 1256 |
+
cudaGraphNode_t node;
|
| 1257 |
+
const void *symbol;
|
| 1258 |
+
const void *src;
|
| 1259 |
+
size_t count;
|
| 1260 |
+
size_t offset;
|
| 1261 |
+
enum cudaMemcpyKind kind;
|
| 1262 |
+
} cudaGraphMemcpyNodeSetParamsToSymbol_v11010_params;
|
| 1263 |
+
|
| 1264 |
+
typedef struct cudaGraphMemcpyNodeSetParamsFromSymbol_v11010_params_st {
|
| 1265 |
+
cudaGraphNode_t node;
|
| 1266 |
+
void *dst;
|
| 1267 |
+
const void *symbol;
|
| 1268 |
+
size_t count;
|
| 1269 |
+
size_t offset;
|
| 1270 |
+
enum cudaMemcpyKind kind;
|
| 1271 |
+
} cudaGraphMemcpyNodeSetParamsFromSymbol_v11010_params;
|
| 1272 |
+
|
| 1273 |
+
typedef struct cudaGraphMemcpyNodeSetParams1D_v11010_params_st {
|
| 1274 |
+
cudaGraphNode_t node;
|
| 1275 |
+
void *dst;
|
| 1276 |
+
const void *src;
|
| 1277 |
+
size_t count;
|
| 1278 |
+
enum cudaMemcpyKind kind;
|
| 1279 |
+
} cudaGraphMemcpyNodeSetParams1D_v11010_params;
|
| 1280 |
+
|
| 1281 |
+
typedef struct cudaGraphAddMemsetNode_v10000_params_st {
|
| 1282 |
+
cudaGraphNode_t *pGraphNode;
|
| 1283 |
+
cudaGraph_t graph;
|
| 1284 |
+
const cudaGraphNode_t *pDependencies;
|
| 1285 |
+
size_t numDependencies;
|
| 1286 |
+
const struct cudaMemsetParams *pMemsetParams;
|
| 1287 |
+
} cudaGraphAddMemsetNode_v10000_params;
|
| 1288 |
+
|
| 1289 |
+
typedef struct cudaGraphMemsetNodeGetParams_v10000_params_st {
|
| 1290 |
+
cudaGraphNode_t node;
|
| 1291 |
+
struct cudaMemsetParams *pNodeParams;
|
| 1292 |
+
} cudaGraphMemsetNodeGetParams_v10000_params;
|
| 1293 |
+
|
| 1294 |
+
typedef struct cudaGraphMemsetNodeSetParams_v10000_params_st {
|
| 1295 |
+
cudaGraphNode_t node;
|
| 1296 |
+
const struct cudaMemsetParams *pNodeParams;
|
| 1297 |
+
} cudaGraphMemsetNodeSetParams_v10000_params;
|
| 1298 |
+
|
| 1299 |
+
typedef struct cudaGraphAddHostNode_v10000_params_st {
|
| 1300 |
+
cudaGraphNode_t *pGraphNode;
|
| 1301 |
+
cudaGraph_t graph;
|
| 1302 |
+
const cudaGraphNode_t *pDependencies;
|
| 1303 |
+
size_t numDependencies;
|
| 1304 |
+
const struct cudaHostNodeParams *pNodeParams;
|
| 1305 |
+
} cudaGraphAddHostNode_v10000_params;
|
| 1306 |
+
|
| 1307 |
+
typedef struct cudaGraphHostNodeGetParams_v10000_params_st {
|
| 1308 |
+
cudaGraphNode_t node;
|
| 1309 |
+
struct cudaHostNodeParams *pNodeParams;
|
| 1310 |
+
} cudaGraphHostNodeGetParams_v10000_params;
|
| 1311 |
+
|
| 1312 |
+
typedef struct cudaGraphHostNodeSetParams_v10000_params_st {
|
| 1313 |
+
cudaGraphNode_t node;
|
| 1314 |
+
const struct cudaHostNodeParams *pNodeParams;
|
| 1315 |
+
} cudaGraphHostNodeSetParams_v10000_params;
|
| 1316 |
+
|
| 1317 |
+
typedef struct cudaGraphAddChildGraphNode_v10000_params_st {
|
| 1318 |
+
cudaGraphNode_t *pGraphNode;
|
| 1319 |
+
cudaGraph_t graph;
|
| 1320 |
+
const cudaGraphNode_t *pDependencies;
|
| 1321 |
+
size_t numDependencies;
|
| 1322 |
+
cudaGraph_t childGraph;
|
| 1323 |
+
} cudaGraphAddChildGraphNode_v10000_params;
|
| 1324 |
+
|
| 1325 |
+
typedef struct cudaGraphChildGraphNodeGetGraph_v10000_params_st {
|
| 1326 |
+
cudaGraphNode_t node;
|
| 1327 |
+
cudaGraph_t *pGraph;
|
| 1328 |
+
} cudaGraphChildGraphNodeGetGraph_v10000_params;
|
| 1329 |
+
|
| 1330 |
+
typedef struct cudaGraphAddEmptyNode_v10000_params_st {
|
| 1331 |
+
cudaGraphNode_t *pGraphNode;
|
| 1332 |
+
cudaGraph_t graph;
|
| 1333 |
+
const cudaGraphNode_t *pDependencies;
|
| 1334 |
+
size_t numDependencies;
|
| 1335 |
+
} cudaGraphAddEmptyNode_v10000_params;
|
| 1336 |
+
|
| 1337 |
+
typedef struct cudaGraphAddEventRecordNode_v11010_params_st {
|
| 1338 |
+
cudaGraphNode_t *pGraphNode;
|
| 1339 |
+
cudaGraph_t graph;
|
| 1340 |
+
const cudaGraphNode_t *pDependencies;
|
| 1341 |
+
size_t numDependencies;
|
| 1342 |
+
cudaEvent_t event;
|
| 1343 |
+
} cudaGraphAddEventRecordNode_v11010_params;
|
| 1344 |
+
|
| 1345 |
+
typedef struct cudaGraphEventRecordNodeGetEvent_v11010_params_st {
|
| 1346 |
+
cudaGraphNode_t node;
|
| 1347 |
+
cudaEvent_t *event_out;
|
| 1348 |
+
} cudaGraphEventRecordNodeGetEvent_v11010_params;
|
| 1349 |
+
|
| 1350 |
+
typedef struct cudaGraphEventRecordNodeSetEvent_v11010_params_st {
|
| 1351 |
+
cudaGraphNode_t node;
|
| 1352 |
+
cudaEvent_t event;
|
| 1353 |
+
} cudaGraphEventRecordNodeSetEvent_v11010_params;
|
| 1354 |
+
|
| 1355 |
+
typedef struct cudaGraphAddEventWaitNode_v11010_params_st {
|
| 1356 |
+
cudaGraphNode_t *pGraphNode;
|
| 1357 |
+
cudaGraph_t graph;
|
| 1358 |
+
const cudaGraphNode_t *pDependencies;
|
| 1359 |
+
size_t numDependencies;
|
| 1360 |
+
cudaEvent_t event;
|
| 1361 |
+
} cudaGraphAddEventWaitNode_v11010_params;
|
| 1362 |
+
|
| 1363 |
+
typedef struct cudaGraphEventWaitNodeGetEvent_v11010_params_st {
|
| 1364 |
+
cudaGraphNode_t node;
|
| 1365 |
+
cudaEvent_t *event_out;
|
| 1366 |
+
} cudaGraphEventWaitNodeGetEvent_v11010_params;
|
| 1367 |
+
|
| 1368 |
+
typedef struct cudaGraphEventWaitNodeSetEvent_v11010_params_st {
|
| 1369 |
+
cudaGraphNode_t node;
|
| 1370 |
+
cudaEvent_t event;
|
| 1371 |
+
} cudaGraphEventWaitNodeSetEvent_v11010_params;
|
| 1372 |
+
|
| 1373 |
+
typedef struct cudaGraphAddExternalSemaphoresSignalNode_v11020_params_st {
|
| 1374 |
+
cudaGraphNode_t *pGraphNode;
|
| 1375 |
+
cudaGraph_t graph;
|
| 1376 |
+
const cudaGraphNode_t *pDependencies;
|
| 1377 |
+
size_t numDependencies;
|
| 1378 |
+
const struct cudaExternalSemaphoreSignalNodeParams *nodeParams;
|
| 1379 |
+
} cudaGraphAddExternalSemaphoresSignalNode_v11020_params;
|
| 1380 |
+
|
| 1381 |
+
typedef struct cudaGraphExternalSemaphoresSignalNodeGetParams_v11020_params_st {
|
| 1382 |
+
cudaGraphNode_t hNode;
|
| 1383 |
+
struct cudaExternalSemaphoreSignalNodeParams *params_out;
|
| 1384 |
+
} cudaGraphExternalSemaphoresSignalNodeGetParams_v11020_params;
|
| 1385 |
+
|
| 1386 |
+
typedef struct cudaGraphExternalSemaphoresSignalNodeSetParams_v11020_params_st {
|
| 1387 |
+
cudaGraphNode_t hNode;
|
| 1388 |
+
const struct cudaExternalSemaphoreSignalNodeParams *nodeParams;
|
| 1389 |
+
} cudaGraphExternalSemaphoresSignalNodeSetParams_v11020_params;
|
| 1390 |
+
|
| 1391 |
+
typedef struct cudaGraphAddExternalSemaphoresWaitNode_v11020_params_st {
|
| 1392 |
+
cudaGraphNode_t *pGraphNode;
|
| 1393 |
+
cudaGraph_t graph;
|
| 1394 |
+
const cudaGraphNode_t *pDependencies;
|
| 1395 |
+
size_t numDependencies;
|
| 1396 |
+
const struct cudaExternalSemaphoreWaitNodeParams *nodeParams;
|
| 1397 |
+
} cudaGraphAddExternalSemaphoresWaitNode_v11020_params;
|
| 1398 |
+
|
| 1399 |
+
typedef struct cudaGraphExternalSemaphoresWaitNodeGetParams_v11020_params_st {
|
| 1400 |
+
cudaGraphNode_t hNode;
|
| 1401 |
+
struct cudaExternalSemaphoreWaitNodeParams *params_out;
|
| 1402 |
+
} cudaGraphExternalSemaphoresWaitNodeGetParams_v11020_params;
|
| 1403 |
+
|
| 1404 |
+
typedef struct cudaGraphExternalSemaphoresWaitNodeSetParams_v11020_params_st {
|
| 1405 |
+
cudaGraphNode_t hNode;
|
| 1406 |
+
const struct cudaExternalSemaphoreWaitNodeParams *nodeParams;
|
| 1407 |
+
} cudaGraphExternalSemaphoresWaitNodeSetParams_v11020_params;
|
| 1408 |
+
|
| 1409 |
+
typedef struct cudaGraphAddMemAllocNode_v11040_params_st {
|
| 1410 |
+
cudaGraphNode_t *pGraphNode;
|
| 1411 |
+
cudaGraph_t graph;
|
| 1412 |
+
const cudaGraphNode_t *pDependencies;
|
| 1413 |
+
size_t numDependencies;
|
| 1414 |
+
struct cudaMemAllocNodeParams *nodeParams;
|
| 1415 |
+
} cudaGraphAddMemAllocNode_v11040_params;
|
| 1416 |
+
|
| 1417 |
+
typedef struct cudaGraphMemAllocNodeGetParams_v11040_params_st {
|
| 1418 |
+
cudaGraphNode_t node;
|
| 1419 |
+
struct cudaMemAllocNodeParams *params_out;
|
| 1420 |
+
} cudaGraphMemAllocNodeGetParams_v11040_params;
|
| 1421 |
+
|
| 1422 |
+
typedef struct cudaGraphAddMemFreeNode_v11040_params_st {
|
| 1423 |
+
cudaGraphNode_t *pGraphNode;
|
| 1424 |
+
cudaGraph_t graph;
|
| 1425 |
+
const cudaGraphNode_t *pDependencies;
|
| 1426 |
+
size_t numDependencies;
|
| 1427 |
+
void *dptr;
|
| 1428 |
+
} cudaGraphAddMemFreeNode_v11040_params;
|
| 1429 |
+
|
| 1430 |
+
typedef struct cudaGraphMemFreeNodeGetParams_v11040_params_st {
|
| 1431 |
+
cudaGraphNode_t node;
|
| 1432 |
+
void *dptr_out;
|
| 1433 |
+
} cudaGraphMemFreeNodeGetParams_v11040_params;
|
| 1434 |
+
|
| 1435 |
+
typedef struct cudaDeviceGraphMemTrim_v11040_params_st {
|
| 1436 |
+
int device;
|
| 1437 |
+
} cudaDeviceGraphMemTrim_v11040_params;
|
| 1438 |
+
|
| 1439 |
+
typedef struct cudaDeviceGetGraphMemAttribute_v11040_params_st {
|
| 1440 |
+
int device;
|
| 1441 |
+
enum cudaGraphMemAttributeType attr;
|
| 1442 |
+
void *value;
|
| 1443 |
+
} cudaDeviceGetGraphMemAttribute_v11040_params;
|
| 1444 |
+
|
| 1445 |
+
typedef struct cudaDeviceSetGraphMemAttribute_v11040_params_st {
|
| 1446 |
+
int device;
|
| 1447 |
+
enum cudaGraphMemAttributeType attr;
|
| 1448 |
+
void *value;
|
| 1449 |
+
} cudaDeviceSetGraphMemAttribute_v11040_params;
|
| 1450 |
+
|
| 1451 |
+
typedef struct cudaGraphClone_v10000_params_st {
|
| 1452 |
+
cudaGraph_t *pGraphClone;
|
| 1453 |
+
cudaGraph_t originalGraph;
|
| 1454 |
+
} cudaGraphClone_v10000_params;
|
| 1455 |
+
|
| 1456 |
+
typedef struct cudaGraphNodeFindInClone_v10000_params_st {
|
| 1457 |
+
cudaGraphNode_t *pNode;
|
| 1458 |
+
cudaGraphNode_t originalNode;
|
| 1459 |
+
cudaGraph_t clonedGraph;
|
| 1460 |
+
} cudaGraphNodeFindInClone_v10000_params;
|
| 1461 |
+
|
| 1462 |
+
typedef struct cudaGraphNodeGetType_v10000_params_st {
|
| 1463 |
+
cudaGraphNode_t node;
|
| 1464 |
+
enum cudaGraphNodeType *pType;
|
| 1465 |
+
} cudaGraphNodeGetType_v10000_params;
|
| 1466 |
+
|
| 1467 |
+
typedef struct cudaGraphGetNodes_v10000_params_st {
|
| 1468 |
+
cudaGraph_t graph;
|
| 1469 |
+
cudaGraphNode_t *nodes;
|
| 1470 |
+
size_t *numNodes;
|
| 1471 |
+
} cudaGraphGetNodes_v10000_params;
|
| 1472 |
+
|
| 1473 |
+
typedef struct cudaGraphGetRootNodes_v10000_params_st {
|
| 1474 |
+
cudaGraph_t graph;
|
| 1475 |
+
cudaGraphNode_t *pRootNodes;
|
| 1476 |
+
size_t *pNumRootNodes;
|
| 1477 |
+
} cudaGraphGetRootNodes_v10000_params;
|
| 1478 |
+
|
| 1479 |
+
typedef struct cudaGraphGetEdges_v10000_params_st {
|
| 1480 |
+
cudaGraph_t graph;
|
| 1481 |
+
cudaGraphNode_t *from;
|
| 1482 |
+
cudaGraphNode_t *to;
|
| 1483 |
+
size_t *numEdges;
|
| 1484 |
+
} cudaGraphGetEdges_v10000_params;
|
| 1485 |
+
|
| 1486 |
+
typedef struct cudaGraphGetEdges_v2_v12030_params_st {
|
| 1487 |
+
cudaGraph_t graph;
|
| 1488 |
+
cudaGraphNode_t *from;
|
| 1489 |
+
cudaGraphNode_t *to;
|
| 1490 |
+
cudaGraphEdgeData *edgeData;
|
| 1491 |
+
size_t *numEdges;
|
| 1492 |
+
} cudaGraphGetEdges_v2_v12030_params;
|
| 1493 |
+
|
| 1494 |
+
typedef struct cudaGraphNodeGetDependencies_v10000_params_st {
|
| 1495 |
+
cudaGraphNode_t node;
|
| 1496 |
+
cudaGraphNode_t *pDependencies;
|
| 1497 |
+
size_t *pNumDependencies;
|
| 1498 |
+
} cudaGraphNodeGetDependencies_v10000_params;
|
| 1499 |
+
|
| 1500 |
+
typedef struct cudaGraphNodeGetDependencies_v2_v12030_params_st {
|
| 1501 |
+
cudaGraphNode_t node;
|
| 1502 |
+
cudaGraphNode_t *pDependencies;
|
| 1503 |
+
cudaGraphEdgeData *edgeData;
|
| 1504 |
+
size_t *pNumDependencies;
|
| 1505 |
+
} cudaGraphNodeGetDependencies_v2_v12030_params;
|
| 1506 |
+
|
| 1507 |
+
typedef struct cudaGraphNodeGetDependentNodes_v10000_params_st {
|
| 1508 |
+
cudaGraphNode_t node;
|
| 1509 |
+
cudaGraphNode_t *pDependentNodes;
|
| 1510 |
+
size_t *pNumDependentNodes;
|
| 1511 |
+
} cudaGraphNodeGetDependentNodes_v10000_params;
|
| 1512 |
+
|
| 1513 |
+
typedef struct cudaGraphNodeGetDependentNodes_v2_v12030_params_st {
|
| 1514 |
+
cudaGraphNode_t node;
|
| 1515 |
+
cudaGraphNode_t *pDependentNodes;
|
| 1516 |
+
cudaGraphEdgeData *edgeData;
|
| 1517 |
+
size_t *pNumDependentNodes;
|
| 1518 |
+
} cudaGraphNodeGetDependentNodes_v2_v12030_params;
|
| 1519 |
+
|
| 1520 |
+
typedef struct cudaGraphAddDependencies_v10000_params_st {
|
| 1521 |
+
cudaGraph_t graph;
|
| 1522 |
+
const cudaGraphNode_t *from;
|
| 1523 |
+
const cudaGraphNode_t *to;
|
| 1524 |
+
size_t numDependencies;
|
| 1525 |
+
} cudaGraphAddDependencies_v10000_params;
|
| 1526 |
+
|
| 1527 |
+
typedef struct cudaGraphAddDependencies_v2_v12030_params_st {
|
| 1528 |
+
cudaGraph_t graph;
|
| 1529 |
+
const cudaGraphNode_t *from;
|
| 1530 |
+
const cudaGraphNode_t *to;
|
| 1531 |
+
const cudaGraphEdgeData *edgeData;
|
| 1532 |
+
size_t numDependencies;
|
| 1533 |
+
} cudaGraphAddDependencies_v2_v12030_params;
|
| 1534 |
+
|
| 1535 |
+
typedef struct cudaGraphRemoveDependencies_v10000_params_st {
|
| 1536 |
+
cudaGraph_t graph;
|
| 1537 |
+
const cudaGraphNode_t *from;
|
| 1538 |
+
const cudaGraphNode_t *to;
|
| 1539 |
+
size_t numDependencies;
|
| 1540 |
+
} cudaGraphRemoveDependencies_v10000_params;
|
| 1541 |
+
|
| 1542 |
+
typedef struct cudaGraphRemoveDependencies_v2_v12030_params_st {
|
| 1543 |
+
cudaGraph_t graph;
|
| 1544 |
+
const cudaGraphNode_t *from;
|
| 1545 |
+
const cudaGraphNode_t *to;
|
| 1546 |
+
const cudaGraphEdgeData *edgeData;
|
| 1547 |
+
size_t numDependencies;
|
| 1548 |
+
} cudaGraphRemoveDependencies_v2_v12030_params;
|
| 1549 |
+
|
| 1550 |
+
typedef struct cudaGraphDestroyNode_v10000_params_st {
|
| 1551 |
+
cudaGraphNode_t node;
|
| 1552 |
+
} cudaGraphDestroyNode_v10000_params;
|
| 1553 |
+
|
| 1554 |
+
typedef struct cudaGraphInstantiate_v12000_params_st {
|
| 1555 |
+
cudaGraphExec_t *pGraphExec;
|
| 1556 |
+
cudaGraph_t graph;
|
| 1557 |
+
unsigned long long flags;
|
| 1558 |
+
} cudaGraphInstantiate_v12000_params;
|
| 1559 |
+
|
| 1560 |
+
typedef struct cudaGraphInstantiateWithFlags_v11040_params_st {
|
| 1561 |
+
cudaGraphExec_t *pGraphExec;
|
| 1562 |
+
cudaGraph_t graph;
|
| 1563 |
+
unsigned long long flags;
|
| 1564 |
+
} cudaGraphInstantiateWithFlags_v11040_params;
|
| 1565 |
+
|
| 1566 |
+
typedef struct cudaGraphInstantiateWithParams_ptsz_v12000_params_st {
|
| 1567 |
+
cudaGraphExec_t *pGraphExec;
|
| 1568 |
+
cudaGraph_t graph;
|
| 1569 |
+
cudaGraphInstantiateParams *instantiateParams;
|
| 1570 |
+
} cudaGraphInstantiateWithParams_ptsz_v12000_params;
|
| 1571 |
+
|
| 1572 |
+
typedef struct cudaGraphExecGetFlags_v12000_params_st {
|
| 1573 |
+
cudaGraphExec_t graphExec;
|
| 1574 |
+
unsigned long long *flags;
|
| 1575 |
+
} cudaGraphExecGetFlags_v12000_params;
|
| 1576 |
+
|
| 1577 |
+
typedef struct cudaGraphExecKernelNodeSetParams_v10010_params_st {
|
| 1578 |
+
cudaGraphExec_t hGraphExec;
|
| 1579 |
+
cudaGraphNode_t node;
|
| 1580 |
+
const struct cudaKernelNodeParams *pNodeParams;
|
| 1581 |
+
} cudaGraphExecKernelNodeSetParams_v10010_params;
|
| 1582 |
+
|
| 1583 |
+
typedef struct cudaGraphExecMemcpyNodeSetParams_v10020_params_st {
|
| 1584 |
+
cudaGraphExec_t hGraphExec;
|
| 1585 |
+
cudaGraphNode_t node;
|
| 1586 |
+
const struct cudaMemcpy3DParms *pNodeParams;
|
| 1587 |
+
} cudaGraphExecMemcpyNodeSetParams_v10020_params;
|
| 1588 |
+
|
| 1589 |
+
typedef struct cudaGraphExecMemcpyNodeSetParamsToSymbol_v11010_params_st {
|
| 1590 |
+
cudaGraphExec_t hGraphExec;
|
| 1591 |
+
cudaGraphNode_t node;
|
| 1592 |
+
const void *symbol;
|
| 1593 |
+
const void *src;
|
| 1594 |
+
size_t count;
|
| 1595 |
+
size_t offset;
|
| 1596 |
+
enum cudaMemcpyKind kind;
|
| 1597 |
+
} cudaGraphExecMemcpyNodeSetParamsToSymbol_v11010_params;
|
| 1598 |
+
|
| 1599 |
+
typedef struct cudaGraphExecMemcpyNodeSetParamsFromSymbol_v11010_params_st {
|
| 1600 |
+
cudaGraphExec_t hGraphExec;
|
| 1601 |
+
cudaGraphNode_t node;
|
| 1602 |
+
void *dst;
|
| 1603 |
+
const void *symbol;
|
| 1604 |
+
size_t count;
|
| 1605 |
+
size_t offset;
|
| 1606 |
+
enum cudaMemcpyKind kind;
|
| 1607 |
+
} cudaGraphExecMemcpyNodeSetParamsFromSymbol_v11010_params;
|
| 1608 |
+
|
| 1609 |
+
typedef struct cudaGraphExecMemcpyNodeSetParams1D_v11010_params_st {
|
| 1610 |
+
cudaGraphExec_t hGraphExec;
|
| 1611 |
+
cudaGraphNode_t node;
|
| 1612 |
+
void *dst;
|
| 1613 |
+
const void *src;
|
| 1614 |
+
size_t count;
|
| 1615 |
+
enum cudaMemcpyKind kind;
|
| 1616 |
+
} cudaGraphExecMemcpyNodeSetParams1D_v11010_params;
|
| 1617 |
+
|
| 1618 |
+
typedef struct cudaGraphExecMemsetNodeSetParams_v10020_params_st {
|
| 1619 |
+
cudaGraphExec_t hGraphExec;
|
| 1620 |
+
cudaGraphNode_t node;
|
| 1621 |
+
const struct cudaMemsetParams *pNodeParams;
|
| 1622 |
+
} cudaGraphExecMemsetNodeSetParams_v10020_params;
|
| 1623 |
+
|
| 1624 |
+
typedef struct cudaGraphExecHostNodeSetParams_v10020_params_st {
|
| 1625 |
+
cudaGraphExec_t hGraphExec;
|
| 1626 |
+
cudaGraphNode_t node;
|
| 1627 |
+
const struct cudaHostNodeParams *pNodeParams;
|
| 1628 |
+
} cudaGraphExecHostNodeSetParams_v10020_params;
|
| 1629 |
+
|
| 1630 |
+
typedef struct cudaGraphExecChildGraphNodeSetParams_v11010_params_st {
|
| 1631 |
+
cudaGraphExec_t hGraphExec;
|
| 1632 |
+
cudaGraphNode_t node;
|
| 1633 |
+
cudaGraph_t childGraph;
|
| 1634 |
+
} cudaGraphExecChildGraphNodeSetParams_v11010_params;
|
| 1635 |
+
|
| 1636 |
+
typedef struct cudaGraphExecEventRecordNodeSetEvent_v11010_params_st {
|
| 1637 |
+
cudaGraphExec_t hGraphExec;
|
| 1638 |
+
cudaGraphNode_t hNode;
|
| 1639 |
+
cudaEvent_t event;
|
| 1640 |
+
} cudaGraphExecEventRecordNodeSetEvent_v11010_params;
|
| 1641 |
+
|
| 1642 |
+
typedef struct cudaGraphExecEventWaitNodeSetEvent_v11010_params_st {
|
| 1643 |
+
cudaGraphExec_t hGraphExec;
|
| 1644 |
+
cudaGraphNode_t hNode;
|
| 1645 |
+
cudaEvent_t event;
|
| 1646 |
+
} cudaGraphExecEventWaitNodeSetEvent_v11010_params;
|
| 1647 |
+
|
| 1648 |
+
typedef struct cudaGraphExecExternalSemaphoresSignalNodeSetParams_v11020_params_st {
|
| 1649 |
+
cudaGraphExec_t hGraphExec;
|
| 1650 |
+
cudaGraphNode_t hNode;
|
| 1651 |
+
const struct cudaExternalSemaphoreSignalNodeParams *nodeParams;
|
| 1652 |
+
} cudaGraphExecExternalSemaphoresSignalNodeSetParams_v11020_params;
|
| 1653 |
+
|
| 1654 |
+
typedef struct cudaGraphExecExternalSemaphoresWaitNodeSetParams_v11020_params_st {
|
| 1655 |
+
cudaGraphExec_t hGraphExec;
|
| 1656 |
+
cudaGraphNode_t hNode;
|
| 1657 |
+
const struct cudaExternalSemaphoreWaitNodeParams *nodeParams;
|
| 1658 |
+
} cudaGraphExecExternalSemaphoresWaitNodeSetParams_v11020_params;
|
| 1659 |
+
|
| 1660 |
+
typedef struct cudaGraphNodeSetEnabled_v11060_params_st {
|
| 1661 |
+
cudaGraphExec_t hGraphExec;
|
| 1662 |
+
cudaGraphNode_t hNode;
|
| 1663 |
+
unsigned int isEnabled;
|
| 1664 |
+
} cudaGraphNodeSetEnabled_v11060_params;
|
| 1665 |
+
|
| 1666 |
+
typedef struct cudaGraphNodeGetEnabled_v11060_params_st {
|
| 1667 |
+
cudaGraphExec_t hGraphExec;
|
| 1668 |
+
cudaGraphNode_t hNode;
|
| 1669 |
+
unsigned int *isEnabled;
|
| 1670 |
+
} cudaGraphNodeGetEnabled_v11060_params;
|
| 1671 |
+
|
| 1672 |
+
typedef struct cudaGraphExecUpdate_v10020_params_st {
|
| 1673 |
+
cudaGraphExec_t hGraphExec;
|
| 1674 |
+
cudaGraph_t hGraph;
|
| 1675 |
+
cudaGraphExecUpdateResultInfo *resultInfo;
|
| 1676 |
+
} cudaGraphExecUpdate_v10020_params;
|
| 1677 |
+
|
| 1678 |
+
typedef struct cudaGraphUpload_ptsz_v10000_params_st {
|
| 1679 |
+
cudaGraphExec_t graphExec;
|
| 1680 |
+
cudaStream_t stream;
|
| 1681 |
+
} cudaGraphUpload_ptsz_v10000_params;
|
| 1682 |
+
|
| 1683 |
+
typedef struct cudaGraphLaunch_ptsz_v10000_params_st {
|
| 1684 |
+
cudaGraphExec_t graphExec;
|
| 1685 |
+
cudaStream_t stream;
|
| 1686 |
+
} cudaGraphLaunch_ptsz_v10000_params;
|
| 1687 |
+
|
| 1688 |
+
typedef struct cudaGraphExecDestroy_v10000_params_st {
|
| 1689 |
+
cudaGraphExec_t graphExec;
|
| 1690 |
+
} cudaGraphExecDestroy_v10000_params;
|
| 1691 |
+
|
| 1692 |
+
typedef struct cudaGraphDestroy_v10000_params_st {
|
| 1693 |
+
cudaGraph_t graph;
|
| 1694 |
+
} cudaGraphDestroy_v10000_params;
|
| 1695 |
+
|
| 1696 |
+
typedef struct cudaGraphDebugDotPrint_v11030_params_st {
|
| 1697 |
+
cudaGraph_t graph;
|
| 1698 |
+
const char *path;
|
| 1699 |
+
unsigned int flags;
|
| 1700 |
+
} cudaGraphDebugDotPrint_v11030_params;
|
| 1701 |
+
|
| 1702 |
+
typedef struct cudaUserObjectCreate_v11030_params_st {
|
| 1703 |
+
cudaUserObject_t *object_out;
|
| 1704 |
+
void *ptr;
|
| 1705 |
+
cudaHostFn_t destroy;
|
| 1706 |
+
unsigned int initialRefcount;
|
| 1707 |
+
unsigned int flags;
|
| 1708 |
+
} cudaUserObjectCreate_v11030_params;
|
| 1709 |
+
|
| 1710 |
+
typedef struct cudaUserObjectRetain_v11030_params_st {
|
| 1711 |
+
cudaUserObject_t object;
|
| 1712 |
+
unsigned int count;
|
| 1713 |
+
} cudaUserObjectRetain_v11030_params;
|
| 1714 |
+
|
| 1715 |
+
typedef struct cudaUserObjectRelease_v11030_params_st {
|
| 1716 |
+
cudaUserObject_t object;
|
| 1717 |
+
unsigned int count;
|
| 1718 |
+
} cudaUserObjectRelease_v11030_params;
|
| 1719 |
+
|
| 1720 |
+
typedef struct cudaGraphRetainUserObject_v11030_params_st {
|
| 1721 |
+
cudaGraph_t graph;
|
| 1722 |
+
cudaUserObject_t object;
|
| 1723 |
+
unsigned int count;
|
| 1724 |
+
unsigned int flags;
|
| 1725 |
+
} cudaGraphRetainUserObject_v11030_params;
|
| 1726 |
+
|
| 1727 |
+
typedef struct cudaGraphReleaseUserObject_v11030_params_st {
|
| 1728 |
+
cudaGraph_t graph;
|
| 1729 |
+
cudaUserObject_t object;
|
| 1730 |
+
unsigned int count;
|
| 1731 |
+
} cudaGraphReleaseUserObject_v11030_params;
|
| 1732 |
+
|
| 1733 |
+
typedef struct cudaGraphAddNode_v12020_params_st {
|
| 1734 |
+
cudaGraphNode_t *pGraphNode;
|
| 1735 |
+
cudaGraph_t graph;
|
| 1736 |
+
const cudaGraphNode_t *pDependencies;
|
| 1737 |
+
size_t numDependencies;
|
| 1738 |
+
struct cudaGraphNodeParams *nodeParams;
|
| 1739 |
+
} cudaGraphAddNode_v12020_params;
|
| 1740 |
+
|
| 1741 |
+
typedef struct cudaGraphAddNode_v2_v12030_params_st {
|
| 1742 |
+
cudaGraphNode_t *pGraphNode;
|
| 1743 |
+
cudaGraph_t graph;
|
| 1744 |
+
const cudaGraphNode_t *pDependencies;
|
| 1745 |
+
const cudaGraphEdgeData *dependencyData;
|
| 1746 |
+
size_t numDependencies;
|
| 1747 |
+
struct cudaGraphNodeParams *nodeParams;
|
| 1748 |
+
} cudaGraphAddNode_v2_v12030_params;
|
| 1749 |
+
|
| 1750 |
+
typedef struct cudaGraphNodeSetParams_v12020_params_st {
|
| 1751 |
+
cudaGraphNode_t node;
|
| 1752 |
+
struct cudaGraphNodeParams *nodeParams;
|
| 1753 |
+
} cudaGraphNodeSetParams_v12020_params;
|
| 1754 |
+
|
| 1755 |
+
typedef struct cudaGraphExecNodeSetParams_v12020_params_st {
|
| 1756 |
+
cudaGraphExec_t graphExec;
|
| 1757 |
+
cudaGraphNode_t node;
|
| 1758 |
+
struct cudaGraphNodeParams *nodeParams;
|
| 1759 |
+
} cudaGraphExecNodeSetParams_v12020_params;
|
| 1760 |
+
|
| 1761 |
+
typedef struct cudaGraphConditionalHandleCreate_v12030_params_st {
|
| 1762 |
+
cudaGraphConditionalHandle *pHandle_out;
|
| 1763 |
+
cudaGraph_t graph;
|
| 1764 |
+
unsigned int defaultLaunchValue;
|
| 1765 |
+
unsigned int flags;
|
| 1766 |
+
} cudaGraphConditionalHandleCreate_v12030_params;
|
| 1767 |
+
|
| 1768 |
+
typedef struct cudaGetDriverEntryPoint_ptsz_v11030_params_st {
|
| 1769 |
+
const char *symbol;
|
| 1770 |
+
void **funcPtr;
|
| 1771 |
+
unsigned long long flags;
|
| 1772 |
+
enum cudaDriverEntryPointQueryResult *driverStatus;
|
| 1773 |
+
} cudaGetDriverEntryPoint_ptsz_v11030_params;
|
| 1774 |
+
|
| 1775 |
+
typedef struct cudaGetDriverEntryPointByVersion_ptsz_v12050_params_st {
|
| 1776 |
+
const char *symbol;
|
| 1777 |
+
void **funcPtr;
|
| 1778 |
+
unsigned int cudaVersion;
|
| 1779 |
+
unsigned long long flags;
|
| 1780 |
+
enum cudaDriverEntryPointQueryResult *driverStatus;
|
| 1781 |
+
} cudaGetDriverEntryPointByVersion_ptsz_v12050_params;
|
| 1782 |
+
|
| 1783 |
+
typedef struct cudaGetFuncBySymbol_v11000_params_st {
|
| 1784 |
+
cudaFunction_t *functionPtr;
|
| 1785 |
+
const void *symbolPtr;
|
| 1786 |
+
} cudaGetFuncBySymbol_v11000_params;
|
| 1787 |
+
|
| 1788 |
+
typedef struct cudaGetKernel_v12000_params_st {
|
| 1789 |
+
cudaKernel_t *kernelPtr;
|
| 1790 |
+
const void *entryFuncAddr;
|
| 1791 |
+
} cudaGetKernel_v12000_params;
|
| 1792 |
+
|
| 1793 |
+
typedef struct cudaMemcpy_v3020_params_st {
|
| 1794 |
+
void *dst;
|
| 1795 |
+
const void *src;
|
| 1796 |
+
size_t count;
|
| 1797 |
+
enum cudaMemcpyKind kind;
|
| 1798 |
+
} cudaMemcpy_v3020_params;
|
| 1799 |
+
|
| 1800 |
+
typedef struct cudaMemcpyToSymbol_v3020_params_st {
|
| 1801 |
+
const void *symbol;
|
| 1802 |
+
const void *src;
|
| 1803 |
+
size_t count;
|
| 1804 |
+
size_t offset;
|
| 1805 |
+
enum cudaMemcpyKind kind;
|
| 1806 |
+
} cudaMemcpyToSymbol_v3020_params;
|
| 1807 |
+
|
| 1808 |
+
typedef struct cudaMemcpyFromSymbol_v3020_params_st {
|
| 1809 |
+
void *dst;
|
| 1810 |
+
const void *symbol;
|
| 1811 |
+
size_t count;
|
| 1812 |
+
size_t offset;
|
| 1813 |
+
enum cudaMemcpyKind kind;
|
| 1814 |
+
} cudaMemcpyFromSymbol_v3020_params;
|
| 1815 |
+
|
| 1816 |
+
typedef struct cudaMemcpy2D_v3020_params_st {
|
| 1817 |
+
void *dst;
|
| 1818 |
+
size_t dpitch;
|
| 1819 |
+
const void *src;
|
| 1820 |
+
size_t spitch;
|
| 1821 |
+
size_t width;
|
| 1822 |
+
size_t height;
|
| 1823 |
+
enum cudaMemcpyKind kind;
|
| 1824 |
+
} cudaMemcpy2D_v3020_params;
|
| 1825 |
+
|
| 1826 |
+
typedef struct cudaMemcpyToArray_v3020_params_st {
|
| 1827 |
+
cudaArray_t dst;
|
| 1828 |
+
size_t wOffset;
|
| 1829 |
+
size_t hOffset;
|
| 1830 |
+
const void *src;
|
| 1831 |
+
size_t count;
|
| 1832 |
+
enum cudaMemcpyKind kind;
|
| 1833 |
+
} cudaMemcpyToArray_v3020_params;
|
| 1834 |
+
|
| 1835 |
+
typedef struct cudaMemcpy2DToArray_v3020_params_st {
|
| 1836 |
+
cudaArray_t dst;
|
| 1837 |
+
size_t wOffset;
|
| 1838 |
+
size_t hOffset;
|
| 1839 |
+
const void *src;
|
| 1840 |
+
size_t spitch;
|
| 1841 |
+
size_t width;
|
| 1842 |
+
size_t height;
|
| 1843 |
+
enum cudaMemcpyKind kind;
|
| 1844 |
+
} cudaMemcpy2DToArray_v3020_params;
|
| 1845 |
+
|
| 1846 |
+
typedef struct cudaMemcpyFromArray_v3020_params_st {
|
| 1847 |
+
void *dst;
|
| 1848 |
+
cudaArray_const_t src;
|
| 1849 |
+
size_t wOffset;
|
| 1850 |
+
size_t hOffset;
|
| 1851 |
+
size_t count;
|
| 1852 |
+
enum cudaMemcpyKind kind;
|
| 1853 |
+
} cudaMemcpyFromArray_v3020_params;
|
| 1854 |
+
|
| 1855 |
+
typedef struct cudaMemcpy2DFromArray_v3020_params_st {
|
| 1856 |
+
void *dst;
|
| 1857 |
+
size_t dpitch;
|
| 1858 |
+
cudaArray_const_t src;
|
| 1859 |
+
size_t wOffset;
|
| 1860 |
+
size_t hOffset;
|
| 1861 |
+
size_t width;
|
| 1862 |
+
size_t height;
|
| 1863 |
+
enum cudaMemcpyKind kind;
|
| 1864 |
+
} cudaMemcpy2DFromArray_v3020_params;
|
| 1865 |
+
|
| 1866 |
+
typedef struct cudaMemcpyArrayToArray_v3020_params_st {
|
| 1867 |
+
cudaArray_t dst;
|
| 1868 |
+
size_t wOffsetDst;
|
| 1869 |
+
size_t hOffsetDst;
|
| 1870 |
+
cudaArray_const_t src;
|
| 1871 |
+
size_t wOffsetSrc;
|
| 1872 |
+
size_t hOffsetSrc;
|
| 1873 |
+
size_t count;
|
| 1874 |
+
enum cudaMemcpyKind kind;
|
| 1875 |
+
} cudaMemcpyArrayToArray_v3020_params;
|
| 1876 |
+
|
| 1877 |
+
typedef struct cudaMemcpy2DArrayToArray_v3020_params_st {
|
| 1878 |
+
cudaArray_t dst;
|
| 1879 |
+
size_t wOffsetDst;
|
| 1880 |
+
size_t hOffsetDst;
|
| 1881 |
+
cudaArray_const_t src;
|
| 1882 |
+
size_t wOffsetSrc;
|
| 1883 |
+
size_t hOffsetSrc;
|
| 1884 |
+
size_t width;
|
| 1885 |
+
size_t height;
|
| 1886 |
+
enum cudaMemcpyKind kind;
|
| 1887 |
+
} cudaMemcpy2DArrayToArray_v3020_params;
|
| 1888 |
+
|
| 1889 |
+
typedef struct cudaMemcpy3D_v3020_params_st {
|
| 1890 |
+
const struct cudaMemcpy3DParms *p;
|
| 1891 |
+
} cudaMemcpy3D_v3020_params;
|
| 1892 |
+
|
| 1893 |
+
typedef struct cudaMemcpy3DPeer_v4000_params_st {
|
| 1894 |
+
const struct cudaMemcpy3DPeerParms *p;
|
| 1895 |
+
} cudaMemcpy3DPeer_v4000_params;
|
| 1896 |
+
|
| 1897 |
+
typedef struct cudaMemset_v3020_params_st {
|
| 1898 |
+
void *devPtr;
|
| 1899 |
+
int value;
|
| 1900 |
+
size_t count;
|
| 1901 |
+
} cudaMemset_v3020_params;
|
| 1902 |
+
|
| 1903 |
+
typedef struct cudaMemset2D_v3020_params_st {
|
| 1904 |
+
void *devPtr;
|
| 1905 |
+
size_t pitch;
|
| 1906 |
+
int value;
|
| 1907 |
+
size_t width;
|
| 1908 |
+
size_t height;
|
| 1909 |
+
} cudaMemset2D_v3020_params;
|
| 1910 |
+
|
| 1911 |
+
typedef struct cudaMemset3D_v3020_params_st {
|
| 1912 |
+
struct cudaPitchedPtr pitchedDevPtr;
|
| 1913 |
+
int value;
|
| 1914 |
+
struct cudaExtent extent;
|
| 1915 |
+
} cudaMemset3D_v3020_params;
|
| 1916 |
+
|
| 1917 |
+
typedef struct cudaMemcpyAsync_v3020_params_st {
|
| 1918 |
+
void *dst;
|
| 1919 |
+
const void *src;
|
| 1920 |
+
size_t count;
|
| 1921 |
+
enum cudaMemcpyKind kind;
|
| 1922 |
+
cudaStream_t stream;
|
| 1923 |
+
} cudaMemcpyAsync_v3020_params;
|
| 1924 |
+
|
| 1925 |
+
typedef struct cudaMemcpyToSymbolAsync_v3020_params_st {
|
| 1926 |
+
const void *symbol;
|
| 1927 |
+
const void *src;
|
| 1928 |
+
size_t count;
|
| 1929 |
+
size_t offset;
|
| 1930 |
+
enum cudaMemcpyKind kind;
|
| 1931 |
+
cudaStream_t stream;
|
| 1932 |
+
} cudaMemcpyToSymbolAsync_v3020_params;
|
| 1933 |
+
|
| 1934 |
+
typedef struct cudaMemcpyFromSymbolAsync_v3020_params_st {
|
| 1935 |
+
void *dst;
|
| 1936 |
+
const void *symbol;
|
| 1937 |
+
size_t count;
|
| 1938 |
+
size_t offset;
|
| 1939 |
+
enum cudaMemcpyKind kind;
|
| 1940 |
+
cudaStream_t stream;
|
| 1941 |
+
} cudaMemcpyFromSymbolAsync_v3020_params;
|
| 1942 |
+
|
| 1943 |
+
typedef struct cudaMemcpy2DAsync_v3020_params_st {
|
| 1944 |
+
void *dst;
|
| 1945 |
+
size_t dpitch;
|
| 1946 |
+
const void *src;
|
| 1947 |
+
size_t spitch;
|
| 1948 |
+
size_t width;
|
| 1949 |
+
size_t height;
|
| 1950 |
+
enum cudaMemcpyKind kind;
|
| 1951 |
+
cudaStream_t stream;
|
| 1952 |
+
} cudaMemcpy2DAsync_v3020_params;
|
| 1953 |
+
|
| 1954 |
+
typedef struct cudaMemcpyToArrayAsync_v3020_params_st {
|
| 1955 |
+
cudaArray_t dst;
|
| 1956 |
+
size_t wOffset;
|
| 1957 |
+
size_t hOffset;
|
| 1958 |
+
const void *src;
|
| 1959 |
+
size_t count;
|
| 1960 |
+
enum cudaMemcpyKind kind;
|
| 1961 |
+
cudaStream_t stream;
|
| 1962 |
+
} cudaMemcpyToArrayAsync_v3020_params;
|
| 1963 |
+
|
| 1964 |
+
typedef struct cudaMemcpy2DToArrayAsync_v3020_params_st {
|
| 1965 |
+
cudaArray_t dst;
|
| 1966 |
+
size_t wOffset;
|
| 1967 |
+
size_t hOffset;
|
| 1968 |
+
const void *src;
|
| 1969 |
+
size_t spitch;
|
| 1970 |
+
size_t width;
|
| 1971 |
+
size_t height;
|
| 1972 |
+
enum cudaMemcpyKind kind;
|
| 1973 |
+
cudaStream_t stream;
|
| 1974 |
+
} cudaMemcpy2DToArrayAsync_v3020_params;
|
| 1975 |
+
|
| 1976 |
+
typedef struct cudaMemcpyFromArrayAsync_v3020_params_st {
|
| 1977 |
+
void *dst;
|
| 1978 |
+
cudaArray_const_t src;
|
| 1979 |
+
size_t wOffset;
|
| 1980 |
+
size_t hOffset;
|
| 1981 |
+
size_t count;
|
| 1982 |
+
enum cudaMemcpyKind kind;
|
| 1983 |
+
cudaStream_t stream;
|
| 1984 |
+
} cudaMemcpyFromArrayAsync_v3020_params;
|
| 1985 |
+
|
| 1986 |
+
typedef struct cudaMemcpy2DFromArrayAsync_v3020_params_st {
|
| 1987 |
+
void *dst;
|
| 1988 |
+
size_t dpitch;
|
| 1989 |
+
cudaArray_const_t src;
|
| 1990 |
+
size_t wOffset;
|
| 1991 |
+
size_t hOffset;
|
| 1992 |
+
size_t width;
|
| 1993 |
+
size_t height;
|
| 1994 |
+
enum cudaMemcpyKind kind;
|
| 1995 |
+
cudaStream_t stream;
|
| 1996 |
+
} cudaMemcpy2DFromArrayAsync_v3020_params;
|
| 1997 |
+
|
| 1998 |
+
typedef struct cudaMemcpy3DAsync_v3020_params_st {
|
| 1999 |
+
const struct cudaMemcpy3DParms *p;
|
| 2000 |
+
cudaStream_t stream;
|
| 2001 |
+
} cudaMemcpy3DAsync_v3020_params;
|
| 2002 |
+
|
| 2003 |
+
typedef struct cudaMemcpy3DPeerAsync_v4000_params_st {
|
| 2004 |
+
const struct cudaMemcpy3DPeerParms *p;
|
| 2005 |
+
cudaStream_t stream;
|
| 2006 |
+
} cudaMemcpy3DPeerAsync_v4000_params;
|
| 2007 |
+
|
| 2008 |
+
typedef struct cudaMemsetAsync_v3020_params_st {
|
| 2009 |
+
void *devPtr;
|
| 2010 |
+
int value;
|
| 2011 |
+
size_t count;
|
| 2012 |
+
cudaStream_t stream;
|
| 2013 |
+
} cudaMemsetAsync_v3020_params;
|
| 2014 |
+
|
| 2015 |
+
typedef struct cudaMemset2DAsync_v3020_params_st {
|
| 2016 |
+
void *devPtr;
|
| 2017 |
+
size_t pitch;
|
| 2018 |
+
int value;
|
| 2019 |
+
size_t width;
|
| 2020 |
+
size_t height;
|
| 2021 |
+
cudaStream_t stream;
|
| 2022 |
+
} cudaMemset2DAsync_v3020_params;
|
| 2023 |
+
|
| 2024 |
+
typedef struct cudaMemset3DAsync_v3020_params_st {
|
| 2025 |
+
struct cudaPitchedPtr pitchedDevPtr;
|
| 2026 |
+
int value;
|
| 2027 |
+
struct cudaExtent extent;
|
| 2028 |
+
cudaStream_t stream;
|
| 2029 |
+
} cudaMemset3DAsync_v3020_params;
|
| 2030 |
+
|
| 2031 |
+
typedef struct cudaStreamQuery_v3020_params_st {
|
| 2032 |
+
cudaStream_t stream;
|
| 2033 |
+
} cudaStreamQuery_v3020_params;
|
| 2034 |
+
|
| 2035 |
+
typedef struct cudaStreamGetFlags_v5050_params_st {
|
| 2036 |
+
cudaStream_t hStream;
|
| 2037 |
+
unsigned int *flags;
|
| 2038 |
+
} cudaStreamGetFlags_v5050_params;
|
| 2039 |
+
|
| 2040 |
+
typedef struct cudaStreamGetId_v12000_params_st {
|
| 2041 |
+
cudaStream_t hStream;
|
| 2042 |
+
unsigned long long *streamId;
|
| 2043 |
+
} cudaStreamGetId_v12000_params;
|
| 2044 |
+
|
| 2045 |
+
typedef struct cudaStreamGetPriority_v5050_params_st {
|
| 2046 |
+
cudaStream_t hStream;
|
| 2047 |
+
int *priority;
|
| 2048 |
+
} cudaStreamGetPriority_v5050_params;
|
| 2049 |
+
|
| 2050 |
+
typedef struct cudaEventRecord_v3020_params_st {
|
| 2051 |
+
cudaEvent_t event;
|
| 2052 |
+
cudaStream_t stream;
|
| 2053 |
+
} cudaEventRecord_v3020_params;
|
| 2054 |
+
|
| 2055 |
+
typedef struct cudaEventRecordWithFlags_v11010_params_st {
|
| 2056 |
+
cudaEvent_t event;
|
| 2057 |
+
cudaStream_t stream;
|
| 2058 |
+
unsigned int flags;
|
| 2059 |
+
} cudaEventRecordWithFlags_v11010_params;
|
| 2060 |
+
|
| 2061 |
+
typedef struct cudaStreamWaitEvent_v3020_params_st {
|
| 2062 |
+
cudaStream_t stream;
|
| 2063 |
+
cudaEvent_t event;
|
| 2064 |
+
unsigned int flags;
|
| 2065 |
+
} cudaStreamWaitEvent_v3020_params;
|
| 2066 |
+
|
| 2067 |
+
typedef struct cudaStreamAddCallback_v5000_params_st {
|
| 2068 |
+
cudaStream_t stream;
|
| 2069 |
+
cudaStreamCallback_t callback;
|
| 2070 |
+
void *userData;
|
| 2071 |
+
unsigned int flags;
|
| 2072 |
+
} cudaStreamAddCallback_v5000_params;
|
| 2073 |
+
|
| 2074 |
+
typedef struct cudaStreamAttachMemAsync_v6000_params_st {
|
| 2075 |
+
cudaStream_t stream;
|
| 2076 |
+
void *devPtr;
|
| 2077 |
+
size_t length;
|
| 2078 |
+
unsigned int flags;
|
| 2079 |
+
} cudaStreamAttachMemAsync_v6000_params;
|
| 2080 |
+
|
| 2081 |
+
typedef struct cudaStreamSynchronize_v3020_params_st {
|
| 2082 |
+
cudaStream_t stream;
|
| 2083 |
+
} cudaStreamSynchronize_v3020_params;
|
| 2084 |
+
|
| 2085 |
+
typedef struct cudaLaunchKernel_v7000_params_st {
|
| 2086 |
+
const void *func;
|
| 2087 |
+
dim3 gridDim;
|
| 2088 |
+
dim3 blockDim;
|
| 2089 |
+
void **args;
|
| 2090 |
+
size_t sharedMem;
|
| 2091 |
+
cudaStream_t stream;
|
| 2092 |
+
} cudaLaunchKernel_v7000_params;
|
| 2093 |
+
|
| 2094 |
+
typedef struct cudaLaunchKernelExC_v11060_params_st {
|
| 2095 |
+
const cudaLaunchConfig_t *config;
|
| 2096 |
+
const void *func;
|
| 2097 |
+
void **args;
|
| 2098 |
+
} cudaLaunchKernelExC_v11060_params;
|
| 2099 |
+
|
| 2100 |
+
typedef struct cudaLaunchCooperativeKernel_v9000_params_st {
|
| 2101 |
+
const void *func;
|
| 2102 |
+
dim3 gridDim;
|
| 2103 |
+
dim3 blockDim;
|
| 2104 |
+
void **args;
|
| 2105 |
+
size_t sharedMem;
|
| 2106 |
+
cudaStream_t stream;
|
| 2107 |
+
} cudaLaunchCooperativeKernel_v9000_params;
|
| 2108 |
+
|
| 2109 |
+
typedef struct cudaLaunchHostFunc_v10000_params_st {
|
| 2110 |
+
cudaStream_t stream;
|
| 2111 |
+
cudaHostFn_t fn;
|
| 2112 |
+
void *userData;
|
| 2113 |
+
} cudaLaunchHostFunc_v10000_params;
|
| 2114 |
+
|
| 2115 |
+
typedef struct cudaMemPrefetchAsync_v8000_params_st {
|
| 2116 |
+
const void *devPtr;
|
| 2117 |
+
size_t count;
|
| 2118 |
+
int dstDevice;
|
| 2119 |
+
cudaStream_t stream;
|
| 2120 |
+
} cudaMemPrefetchAsync_v8000_params;
|
| 2121 |
+
|
| 2122 |
+
typedef struct cudaMemPrefetchAsync_v2_v12020_params_st {
|
| 2123 |
+
const void *devPtr;
|
| 2124 |
+
size_t count;
|
| 2125 |
+
struct cudaMemLocation location;
|
| 2126 |
+
unsigned int flags;
|
| 2127 |
+
cudaStream_t stream;
|
| 2128 |
+
} cudaMemPrefetchAsync_v2_v12020_params;
|
| 2129 |
+
|
| 2130 |
+
typedef struct cudaSignalExternalSemaphoresAsync_v10000_params_st {
|
| 2131 |
+
const cudaExternalSemaphore_t *extSemArray;
|
| 2132 |
+
const struct cudaExternalSemaphoreSignalParams_v1 *paramsArray;
|
| 2133 |
+
unsigned int numExtSems;
|
| 2134 |
+
cudaStream_t stream;
|
| 2135 |
+
} cudaSignalExternalSemaphoresAsync_v10000_params;
|
| 2136 |
+
|
| 2137 |
+
typedef struct cudaSignalExternalSemaphoresAsync_ptsz_v10000_params_st {
|
| 2138 |
+
const cudaExternalSemaphore_t *extSemArray;
|
| 2139 |
+
const struct cudaExternalSemaphoreSignalParams_v1 *paramsArray;
|
| 2140 |
+
unsigned int numExtSems;
|
| 2141 |
+
cudaStream_t stream;
|
| 2142 |
+
} cudaSignalExternalSemaphoresAsync_ptsz_v10000_params;
|
| 2143 |
+
|
| 2144 |
+
typedef struct cudaSignalExternalSemaphoresAsync_v2_v11020_params_st {
|
| 2145 |
+
const cudaExternalSemaphore_t *extSemArray;
|
| 2146 |
+
const struct cudaExternalSemaphoreSignalParams *paramsArray;
|
| 2147 |
+
unsigned int numExtSems;
|
| 2148 |
+
cudaStream_t stream;
|
| 2149 |
+
} cudaSignalExternalSemaphoresAsync_v2_v11020_params;
|
| 2150 |
+
|
| 2151 |
+
typedef struct cudaWaitExternalSemaphoresAsync_v10000_params_st {
|
| 2152 |
+
const cudaExternalSemaphore_t *extSemArray;
|
| 2153 |
+
const struct cudaExternalSemaphoreWaitParams_v1 *paramsArray;
|
| 2154 |
+
unsigned int numExtSems;
|
| 2155 |
+
cudaStream_t stream;
|
| 2156 |
+
} cudaWaitExternalSemaphoresAsync_v10000_params;
|
| 2157 |
+
|
| 2158 |
+
typedef struct cudaWaitExternalSemaphoresAsync_ptsz_v10000_params_st {
|
| 2159 |
+
const cudaExternalSemaphore_t *extSemArray;
|
| 2160 |
+
const struct cudaExternalSemaphoreWaitParams_v1 *paramsArray;
|
| 2161 |
+
unsigned int numExtSems;
|
| 2162 |
+
cudaStream_t stream;
|
| 2163 |
+
} cudaWaitExternalSemaphoresAsync_ptsz_v10000_params;
|
| 2164 |
+
|
| 2165 |
+
typedef struct cudaWaitExternalSemaphoresAsync_v2_v11020_params_st {
|
| 2166 |
+
const cudaExternalSemaphore_t *extSemArray;
|
| 2167 |
+
const struct cudaExternalSemaphoreWaitParams *paramsArray;
|
| 2168 |
+
unsigned int numExtSems;
|
| 2169 |
+
cudaStream_t stream;
|
| 2170 |
+
} cudaWaitExternalSemaphoresAsync_v2_v11020_params;
|
| 2171 |
+
|
| 2172 |
+
typedef struct cudaGraphInstantiateWithParams_v12000_params_st {
|
| 2173 |
+
cudaGraphExec_t *pGraphExec;
|
| 2174 |
+
cudaGraph_t graph;
|
| 2175 |
+
cudaGraphInstantiateParams *instantiateParams;
|
| 2176 |
+
} cudaGraphInstantiateWithParams_v12000_params;
|
| 2177 |
+
|
| 2178 |
+
typedef struct cudaGraphUpload_v10000_params_st {
|
| 2179 |
+
cudaGraphExec_t graphExec;
|
| 2180 |
+
cudaStream_t stream;
|
| 2181 |
+
} cudaGraphUpload_v10000_params;
|
| 2182 |
+
|
| 2183 |
+
typedef struct cudaGraphLaunch_v10000_params_st {
|
| 2184 |
+
cudaGraphExec_t graphExec;
|
| 2185 |
+
cudaStream_t stream;
|
| 2186 |
+
} cudaGraphLaunch_v10000_params;
|
| 2187 |
+
|
| 2188 |
+
typedef struct cudaStreamBeginCapture_v10000_params_st {
|
| 2189 |
+
cudaStream_t stream;
|
| 2190 |
+
enum cudaStreamCaptureMode mode;
|
| 2191 |
+
} cudaStreamBeginCapture_v10000_params;
|
| 2192 |
+
|
| 2193 |
+
typedef struct cudaStreamBeginCaptureToGraph_v12030_params_st {
|
| 2194 |
+
cudaStream_t stream;
|
| 2195 |
+
cudaGraph_t graph;
|
| 2196 |
+
const cudaGraphNode_t *dependencies;
|
| 2197 |
+
const cudaGraphEdgeData *dependencyData;
|
| 2198 |
+
size_t numDependencies;
|
| 2199 |
+
enum cudaStreamCaptureMode mode;
|
| 2200 |
+
} cudaStreamBeginCaptureToGraph_v12030_params;
|
| 2201 |
+
|
| 2202 |
+
typedef struct cudaStreamEndCapture_v10000_params_st {
|
| 2203 |
+
cudaStream_t stream;
|
| 2204 |
+
cudaGraph_t *pGraph;
|
| 2205 |
+
} cudaStreamEndCapture_v10000_params;
|
| 2206 |
+
|
| 2207 |
+
typedef struct cudaStreamIsCapturing_v10000_params_st {
|
| 2208 |
+
cudaStream_t stream;
|
| 2209 |
+
enum cudaStreamCaptureStatus *pCaptureStatus;
|
| 2210 |
+
} cudaStreamIsCapturing_v10000_params;
|
| 2211 |
+
|
| 2212 |
+
typedef struct cudaStreamGetCaptureInfo_v10010_params_st {
|
| 2213 |
+
cudaStream_t stream;
|
| 2214 |
+
enum cudaStreamCaptureStatus *captureStatus_out;
|
| 2215 |
+
unsigned long long *id_out;
|
| 2216 |
+
} cudaStreamGetCaptureInfo_v10010_params;
|
| 2217 |
+
|
| 2218 |
+
typedef struct cudaStreamGetCaptureInfo_ptsz_v10010_params_st {
|
| 2219 |
+
cudaStream_t stream;
|
| 2220 |
+
enum cudaStreamCaptureStatus *captureStatus_out;
|
| 2221 |
+
unsigned long long *id_out;
|
| 2222 |
+
} cudaStreamGetCaptureInfo_ptsz_v10010_params;
|
| 2223 |
+
|
| 2224 |
+
typedef struct cudaStreamGetCaptureInfo_v2_v11030_params_st {
|
| 2225 |
+
cudaStream_t stream;
|
| 2226 |
+
enum cudaStreamCaptureStatus *captureStatus_out;
|
| 2227 |
+
unsigned long long *id_out;
|
| 2228 |
+
cudaGraph_t *graph_out;
|
| 2229 |
+
const cudaGraphNode_t **dependencies_out;
|
| 2230 |
+
size_t *numDependencies_out;
|
| 2231 |
+
} cudaStreamGetCaptureInfo_v2_v11030_params;
|
| 2232 |
+
|
| 2233 |
+
typedef struct cudaStreamGetCaptureInfo_v3_v12030_params_st {
|
| 2234 |
+
cudaStream_t stream;
|
| 2235 |
+
enum cudaStreamCaptureStatus *captureStatus_out;
|
| 2236 |
+
unsigned long long *id_out;
|
| 2237 |
+
cudaGraph_t *graph_out;
|
| 2238 |
+
const cudaGraphNode_t **dependencies_out;
|
| 2239 |
+
const cudaGraphEdgeData **edgeData_out;
|
| 2240 |
+
size_t *numDependencies_out;
|
| 2241 |
+
} cudaStreamGetCaptureInfo_v3_v12030_params;
|
| 2242 |
+
|
| 2243 |
+
typedef struct cudaStreamUpdateCaptureDependencies_v11030_params_st {
|
| 2244 |
+
cudaStream_t stream;
|
| 2245 |
+
cudaGraphNode_t *dependencies;
|
| 2246 |
+
size_t numDependencies;
|
| 2247 |
+
unsigned int flags;
|
| 2248 |
+
} cudaStreamUpdateCaptureDependencies_v11030_params;
|
| 2249 |
+
|
| 2250 |
+
typedef struct cudaStreamUpdateCaptureDependencies_v2_v12030_params_st {
|
| 2251 |
+
cudaStream_t stream;
|
| 2252 |
+
cudaGraphNode_t *dependencies;
|
| 2253 |
+
const cudaGraphEdgeData *dependencyData;
|
| 2254 |
+
size_t numDependencies;
|
| 2255 |
+
unsigned int flags;
|
| 2256 |
+
} cudaStreamUpdateCaptureDependencies_v2_v12030_params;
|
| 2257 |
+
|
| 2258 |
+
typedef struct cudaStreamCopyAttributes_v11000_params_st {
|
| 2259 |
+
cudaStream_t dstStream;
|
| 2260 |
+
cudaStream_t srcStream;
|
| 2261 |
+
} cudaStreamCopyAttributes_v11000_params;
|
| 2262 |
+
|
| 2263 |
+
typedef struct cudaStreamGetAttribute_v11000_params_st {
|
| 2264 |
+
cudaStream_t stream;
|
| 2265 |
+
cudaStreamAttrID attr;
|
| 2266 |
+
cudaStreamAttrValue *value;
|
| 2267 |
+
} cudaStreamGetAttribute_v11000_params;
|
| 2268 |
+
|
| 2269 |
+
typedef struct cudaStreamSetAttribute_v11000_params_st {
|
| 2270 |
+
cudaStream_t stream;
|
| 2271 |
+
cudaStreamAttrID attr;
|
| 2272 |
+
const cudaStreamAttrValue *param;
|
| 2273 |
+
} cudaStreamSetAttribute_v11000_params;
|
| 2274 |
+
|
| 2275 |
+
typedef struct cudaMallocAsync_v11020_params_st {
|
| 2276 |
+
void **devPtr;
|
| 2277 |
+
size_t size;
|
| 2278 |
+
cudaStream_t hStream;
|
| 2279 |
+
} cudaMallocAsync_v11020_params;
|
| 2280 |
+
|
| 2281 |
+
typedef struct cudaFreeAsync_v11020_params_st {
|
| 2282 |
+
void *devPtr;
|
| 2283 |
+
cudaStream_t hStream;
|
| 2284 |
+
} cudaFreeAsync_v11020_params;
|
| 2285 |
+
|
| 2286 |
+
typedef struct cudaMallocFromPoolAsync_v11020_params_st {
|
| 2287 |
+
void **ptr;
|
| 2288 |
+
size_t size;
|
| 2289 |
+
cudaMemPool_t memPool;
|
| 2290 |
+
cudaStream_t stream;
|
| 2291 |
+
} cudaMallocFromPoolAsync_v11020_params;
|
| 2292 |
+
|
| 2293 |
+
typedef struct cudaGetDriverEntryPoint_v11030_params_st {
|
| 2294 |
+
const char *symbol;
|
| 2295 |
+
void **funcPtr;
|
| 2296 |
+
unsigned long long flags;
|
| 2297 |
+
enum cudaDriverEntryPointQueryResult *driverStatus;
|
| 2298 |
+
} cudaGetDriverEntryPoint_v11030_params;
|
| 2299 |
+
|
| 2300 |
+
typedef struct cudaGetDriverEntryPointByVersion_v12050_params_st {
|
| 2301 |
+
const char *symbol;
|
| 2302 |
+
void **funcPtr;
|
| 2303 |
+
unsigned int cudaVersion;
|
| 2304 |
+
unsigned long long flags;
|
| 2305 |
+
enum cudaDriverEntryPointQueryResult *driverStatus;
|
| 2306 |
+
} cudaGetDriverEntryPointByVersion_v12050_params;
|
| 2307 |
+
|
| 2308 |
+
typedef struct cudaGetDeviceProperties_v3020_params_st {
|
| 2309 |
+
struct cudaDeviceProp *prop;
|
| 2310 |
+
int device;
|
| 2311 |
+
} cudaGetDeviceProperties_v3020_params;
|
| 2312 |
+
|
| 2313 |
+
// Parameter trace structures for removed functions
|
| 2314 |
+
|
| 2315 |
+
|
| 2316 |
+
// End of parameter trace structures
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_cupti/include/generated_cuda_vdpau_interop_meta.h
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is generated. Any changes you make will be lost during the next clean build.
|
| 2 |
+
|
| 3 |
+
// CUDA public interface, for type definitions and api function prototypes
|
| 4 |
+
#include "cuda_vdpau_interop.h"
|
| 5 |
+
|
| 6 |
+
// *************************************************************************
|
| 7 |
+
// Definitions of structs to hold parameters for each function
|
| 8 |
+
// *************************************************************************
|
| 9 |
+
|
| 10 |
+
// Currently used parameter trace structures
|
| 11 |
+
typedef struct cudaVDPAUGetDevice_v3020_params_st {
|
| 12 |
+
int *device;
|
| 13 |
+
VdpDevice vdpDevice;
|
| 14 |
+
VdpGetProcAddress *vdpGetProcAddress;
|
| 15 |
+
} cudaVDPAUGetDevice_v3020_params;
|
| 16 |
+
|
| 17 |
+
typedef struct cudaVDPAUSetVDPAUDevice_v3020_params_st {
|
| 18 |
+
int device;
|
| 19 |
+
VdpDevice vdpDevice;
|
| 20 |
+
VdpGetProcAddress *vdpGetProcAddress;
|
| 21 |
+
} cudaVDPAUSetVDPAUDevice_v3020_params;
|
| 22 |
+
|
| 23 |
+
typedef struct cudaGraphicsVDPAURegisterVideoSurface_v3020_params_st {
|
| 24 |
+
struct cudaGraphicsResource **resource;
|
| 25 |
+
VdpVideoSurface vdpSurface;
|
| 26 |
+
unsigned int flags;
|
| 27 |
+
} cudaGraphicsVDPAURegisterVideoSurface_v3020_params;
|
| 28 |
+
|
| 29 |
+
typedef struct cudaGraphicsVDPAURegisterOutputSurface_v3020_params_st {
|
| 30 |
+
struct cudaGraphicsResource **resource;
|
| 31 |
+
VdpOutputSurface vdpSurface;
|
| 32 |
+
unsigned int flags;
|
| 33 |
+
} cudaGraphicsVDPAURegisterOutputSurface_v3020_params;
|
| 34 |
+
|
| 35 |
+
// Parameter trace structures for removed functions
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
// End of parameter trace structures
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_cupti/include/generated_cudart_removed_meta.h
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// This file is generated. Any changes you make will be lost during the next clean build.
|
| 2 |
+
|
| 3 |
+
// CUDA public interface, for type definitions and api function prototypes
|
| 4 |
+
#include "cudart_removed.h"
|
| 5 |
+
|
| 6 |
+
// *************************************************************************
|
| 7 |
+
// Definitions of structs to hold parameters for each function
|
| 8 |
+
// *************************************************************************
|
| 9 |
+
|
| 10 |
+
// Currently used parameter trace structures
|
| 11 |
+
typedef struct cudaStreamDestroy_v3020_params_st {
|
| 12 |
+
cudaStream_t stream;
|
| 13 |
+
} cudaStreamDestroy_v3020_params;
|
| 14 |
+
|
| 15 |
+
typedef struct cudaOccupancyMaxActiveBlocksPerMultiprocessor_v6000_params_st {
|
| 16 |
+
int *numBlocks;
|
| 17 |
+
const void *func;
|
| 18 |
+
size_t numDynamicSmemBytes;
|
| 19 |
+
} cudaOccupancyMaxActiveBlocksPerMultiprocessor_v6000_params;
|
| 20 |
+
|
| 21 |
+
typedef struct cudaConfigureCall_v3020_params_st {
|
| 22 |
+
dim3 gridDim;
|
| 23 |
+
dim3 blockDim;
|
| 24 |
+
size_t sharedMem __dv;
|
| 25 |
+
cudaStream_t stream __dv;
|
| 26 |
+
} cudaConfigureCall_v3020_params;
|
| 27 |
+
|
| 28 |
+
typedef struct cudaSetupArgument_v3020_params_st {
|
| 29 |
+
const void *arg;
|
| 30 |
+
size_t size;
|
| 31 |
+
size_t offset;
|
| 32 |
+
} cudaSetupArgument_v3020_params;
|
| 33 |
+
|
| 34 |
+
typedef struct cudaLaunch_v3020_params_st {
|
| 35 |
+
const void *func;
|
| 36 |
+
} cudaLaunch_v3020_params;
|
| 37 |
+
|
| 38 |
+
typedef struct cudaLaunch_ptsz_v7000_params_st {
|
| 39 |
+
const void *func;
|
| 40 |
+
} cudaLaunch_ptsz_v7000_params;
|
| 41 |
+
|
| 42 |
+
typedef struct cudaStreamSetFlags_v10200_params_st {
|
| 43 |
+
cudaStream_t hStream;
|
| 44 |
+
unsigned int flags;
|
| 45 |
+
} cudaStreamSetFlags_v10200_params;
|
| 46 |
+
|
| 47 |
+
typedef struct cudaStreamSetFlags_ptsz_v10200_params_st {
|
| 48 |
+
cudaStream_t hStream;
|
| 49 |
+
unsigned int flags;
|
| 50 |
+
} cudaStreamSetFlags_ptsz_v10200_params;
|
| 51 |
+
|
| 52 |
+
typedef struct cudaProfilerInitialize_v4000_params_st {
|
| 53 |
+
const char *configFile;
|
| 54 |
+
const char *outputFile;
|
| 55 |
+
cudaOutputMode_t outputMode;
|
| 56 |
+
} cudaProfilerInitialize_v4000_params;
|
| 57 |
+
|
| 58 |
+
typedef struct cudaThreadSetLimit_v3020_params_st {
|
| 59 |
+
enum cudaLimit limit;
|
| 60 |
+
size_t value;
|
| 61 |
+
} cudaThreadSetLimit_v3020_params;
|
| 62 |
+
|
| 63 |
+
typedef struct cudaThreadGetLimit_v3020_params_st {
|
| 64 |
+
size_t *pValue;
|
| 65 |
+
enum cudaLimit limit;
|
| 66 |
+
} cudaThreadGetLimit_v3020_params;
|
| 67 |
+
|
| 68 |
+
typedef struct cudaThreadGetCacheConfig_v3020_params_st {
|
| 69 |
+
enum cudaFuncCache *pCacheConfig;
|
| 70 |
+
} cudaThreadGetCacheConfig_v3020_params;
|
| 71 |
+
|
| 72 |
+
typedef struct cudaThreadSetCacheConfig_v3020_params_st {
|
| 73 |
+
enum cudaFuncCache cacheConfig;
|
| 74 |
+
} cudaThreadSetCacheConfig_v3020_params;
|
| 75 |
+
|
| 76 |
+
typedef struct cudaSetDoubleForDevice_v3020_params_st {
|
| 77 |
+
double *d;
|
| 78 |
+
} cudaSetDoubleForDevice_v3020_params;
|
| 79 |
+
|
| 80 |
+
typedef struct cudaSetDoubleForHost_v3020_params_st {
|
| 81 |
+
double *d;
|
| 82 |
+
} cudaSetDoubleForHost_v3020_params;
|
| 83 |
+
|
| 84 |
+
typedef struct cudaCreateTextureObject_v2_v11080_params_st {
|
| 85 |
+
cudaTextureObject_t *pTexObject;
|
| 86 |
+
const struct cudaResourceDesc *pResDesc;
|
| 87 |
+
const struct cudaTextureDesc *pTexDesc;
|
| 88 |
+
const struct cudaResourceViewDesc *pResViewDesc;
|
| 89 |
+
} cudaCreateTextureObject_v2_v11080_params;
|
| 90 |
+
|
| 91 |
+
typedef struct cudaGetTextureObjectTextureDesc_v2_v11080_params_st {
|
| 92 |
+
struct cudaTextureDesc *pTexDesc;
|
| 93 |
+
cudaTextureObject_t texObject;
|
| 94 |
+
} cudaGetTextureObjectTextureDesc_v2_v11080_params;
|
| 95 |
+
|
| 96 |
+
typedef struct cudaBindTexture_v3020_params_st {
|
| 97 |
+
size_t *offset;
|
| 98 |
+
const struct textureReference *texref;
|
| 99 |
+
const void *devPtr;
|
| 100 |
+
const struct cudaChannelFormatDesc *desc;
|
| 101 |
+
size_t size __dv;
|
| 102 |
+
} cudaBindTexture_v3020_params;
|
| 103 |
+
|
| 104 |
+
typedef struct cudaBindTexture2D_v3020_params_st {
|
| 105 |
+
size_t *offset;
|
| 106 |
+
const struct textureReference *texref;
|
| 107 |
+
const void *devPtr;
|
| 108 |
+
const struct cudaChannelFormatDesc *desc;
|
| 109 |
+
size_t width;
|
| 110 |
+
size_t height;
|
| 111 |
+
size_t pitch;
|
| 112 |
+
} cudaBindTexture2D_v3020_params;
|
| 113 |
+
|
| 114 |
+
typedef struct cudaBindTextureToArray_v3020_params_st {
|
| 115 |
+
const struct textureReference *texref;
|
| 116 |
+
cudaArray_const_t array;
|
| 117 |
+
const struct cudaChannelFormatDesc *desc;
|
| 118 |
+
} cudaBindTextureToArray_v3020_params;
|
| 119 |
+
|
| 120 |
+
typedef struct cudaBindTextureToMipmappedArray_v5000_params_st {
|
| 121 |
+
const struct textureReference *texref;
|
| 122 |
+
cudaMipmappedArray_const_t mipmappedArray;
|
| 123 |
+
const struct cudaChannelFormatDesc *desc;
|
| 124 |
+
} cudaBindTextureToMipmappedArray_v5000_params;
|
| 125 |
+
|
| 126 |
+
typedef struct cudaUnbindTexture_v3020_params_st {
|
| 127 |
+
const struct textureReference *texref;
|
| 128 |
+
} cudaUnbindTexture_v3020_params;
|
| 129 |
+
|
| 130 |
+
typedef struct cudaGetTextureAlignmentOffset_v3020_params_st {
|
| 131 |
+
size_t *offset;
|
| 132 |
+
const struct textureReference *texref;
|
| 133 |
+
} cudaGetTextureAlignmentOffset_v3020_params;
|
| 134 |
+
|
| 135 |
+
typedef struct cudaGetTextureReference_v3020_params_st {
|
| 136 |
+
const struct textureReference **texref;
|
| 137 |
+
const void *symbol;
|
| 138 |
+
} cudaGetTextureReference_v3020_params;
|
| 139 |
+
|
| 140 |
+
typedef struct cudaBindSurfaceToArray_v3020_params_st {
|
| 141 |
+
const struct surfaceReference *surfref;
|
| 142 |
+
cudaArray_const_t array;
|
| 143 |
+
const struct cudaChannelFormatDesc *desc;
|
| 144 |
+
} cudaBindSurfaceToArray_v3020_params;
|
| 145 |
+
|
| 146 |
+
typedef struct cudaGetSurfaceReference_v3020_params_st {
|
| 147 |
+
const struct surfaceReference **surfref;
|
| 148 |
+
const void *symbol;
|
| 149 |
+
} cudaGetSurfaceReference_v3020_params;
|
| 150 |
+
|
| 151 |
+
typedef struct cudaGraphInstantiate_v10000_params_st {
|
| 152 |
+
cudaGraphExec_t *pGraphExec;
|
| 153 |
+
cudaGraph_t graph;
|
| 154 |
+
cudaGraphNode_t *pErrorNode;
|
| 155 |
+
char *pLogBuffer;
|
| 156 |
+
size_t bufferSize;
|
| 157 |
+
} cudaGraphInstantiate_v10000_params;
|
| 158 |
+
|
| 159 |
+
// Parameter trace structures for removed functions
|
| 160 |
+
|
| 161 |
+
|
| 162 |
+
// End of parameter trace structures
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_cupti/include/generated_nvtx_meta.h
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2013-2018 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO LICENSEE:
|
| 5 |
+
*
|
| 6 |
+
* This source code and/or documentation ("Licensed Deliverables") are
|
| 7 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 8 |
+
* international Copyright laws.
|
| 9 |
+
*
|
| 10 |
+
* These Licensed Deliverables contained herein is PROPRIETARY and
|
| 11 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and
|
| 12 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 13 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 14 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 15 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 16 |
+
* of the Licensed Deliverables to any third party without the express
|
| 17 |
+
* written consent of NVIDIA is prohibited.
|
| 18 |
+
*
|
| 19 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 20 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 21 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
|
| 22 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 23 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 24 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 25 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 26 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 27 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 28 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 29 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 30 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 31 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 32 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 33 |
+
*
|
| 34 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 35 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 36 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 37 |
+
* computer software documentation" as such terms are used in 48
|
| 38 |
+
* C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
|
| 39 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 40 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 41 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 42 |
+
* only those rights set forth herein.
|
| 43 |
+
*
|
| 44 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 45 |
+
* software must include, in the user documentation and internal
|
| 46 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 47 |
+
* Users Notice.
|
| 48 |
+
*/
|
| 49 |
+
|
| 50 |
+
#if defined(__GNUC__) && defined(CUPTI_LIB)
|
| 51 |
+
#pragma GCC visibility push(default)
|
| 52 |
+
#endif
|
| 53 |
+
|
| 54 |
+
// *************************************************************************
|
| 55 |
+
// Definitions of structs to hold parameters for each function
|
| 56 |
+
// *************************************************************************
|
| 57 |
+
|
| 58 |
+
typedef struct nvtxMarkEx_params_st {
|
| 59 |
+
const nvtxEventAttributes_t* eventAttrib;
|
| 60 |
+
} nvtxMarkEx_params;
|
| 61 |
+
|
| 62 |
+
typedef struct nvtxMarkA_params_st {
|
| 63 |
+
const char* message;
|
| 64 |
+
} nvtxMarkA_params;
|
| 65 |
+
|
| 66 |
+
typedef struct nvtxMarkW_params_st {
|
| 67 |
+
const wchar_t* message;
|
| 68 |
+
} nvtxMarkW_params;
|
| 69 |
+
|
| 70 |
+
typedef struct nvtxRangeStartEx_params_st {
|
| 71 |
+
const nvtxEventAttributes_t* eventAttrib;
|
| 72 |
+
} nvtxRangeStartEx_params;
|
| 73 |
+
|
| 74 |
+
typedef struct nvtxRangeStartA_params_st {
|
| 75 |
+
const char* message;
|
| 76 |
+
} nvtxRangeStartA_params;
|
| 77 |
+
|
| 78 |
+
typedef struct nvtxRangeStartW_params_st {
|
| 79 |
+
const wchar_t* message;
|
| 80 |
+
} nvtxRangeStartW_params;
|
| 81 |
+
|
| 82 |
+
typedef struct nvtxRangeEnd_params_st {
|
| 83 |
+
nvtxRangeId_t id;
|
| 84 |
+
} nvtxRangeEnd_params;
|
| 85 |
+
|
| 86 |
+
typedef struct nvtxRangePushEx_params_st {
|
| 87 |
+
const nvtxEventAttributes_t* eventAttrib;
|
| 88 |
+
} nvtxRangePushEx_params;
|
| 89 |
+
|
| 90 |
+
typedef struct nvtxRangePushA_params_st {
|
| 91 |
+
const char* message;
|
| 92 |
+
} nvtxRangePushA_params;
|
| 93 |
+
|
| 94 |
+
typedef struct nvtxRangePushW_params_st {
|
| 95 |
+
const wchar_t* message;
|
| 96 |
+
} nvtxRangePushW_params;
|
| 97 |
+
|
| 98 |
+
typedef struct nvtxRangePop_params_st {
|
| 99 |
+
/* WAR: Windows compiler doesn't allow empty structs */
|
| 100 |
+
/* This field shouldn't be used */
|
| 101 |
+
void *dummy;
|
| 102 |
+
} nvtxRangePop_params;
|
| 103 |
+
|
| 104 |
+
typedef struct nvtxNameCategoryA_params_st {
|
| 105 |
+
uint32_t category;
|
| 106 |
+
const char* name;
|
| 107 |
+
} nvtxNameCategoryA_params;
|
| 108 |
+
|
| 109 |
+
typedef struct nvtxNameCategoryW_params_st {
|
| 110 |
+
uint32_t category;
|
| 111 |
+
const wchar_t* name;
|
| 112 |
+
} nvtxNameCategoryW_params;
|
| 113 |
+
|
| 114 |
+
typedef struct nvtxNameOsThreadA_params_st {
|
| 115 |
+
uint32_t threadId;
|
| 116 |
+
const char* name;
|
| 117 |
+
} nvtxNameOsThreadA_params;
|
| 118 |
+
|
| 119 |
+
typedef struct nvtxNameOsThreadW_params_st {
|
| 120 |
+
uint32_t threadId;
|
| 121 |
+
const wchar_t* name;
|
| 122 |
+
} nvtxNameOsThreadW_params;
|
| 123 |
+
|
| 124 |
+
typedef struct nvtxNameCuDeviceA_params_st {
|
| 125 |
+
CUdevice device;
|
| 126 |
+
const char* name;
|
| 127 |
+
} nvtxNameCuDeviceA_params;
|
| 128 |
+
|
| 129 |
+
typedef struct nvtxNameCuDeviceW_params_st {
|
| 130 |
+
CUdevice device;
|
| 131 |
+
const wchar_t* name;
|
| 132 |
+
} nvtxNameCuDeviceW_params;
|
| 133 |
+
|
| 134 |
+
typedef struct nvtxNameCuContextA_params_st {
|
| 135 |
+
CUcontext context;
|
| 136 |
+
const char* name;
|
| 137 |
+
} nvtxNameCuContextA_params;
|
| 138 |
+
|
| 139 |
+
typedef struct nvtxNameCuContextW_params_st {
|
| 140 |
+
CUcontext context;
|
| 141 |
+
const wchar_t* name;
|
| 142 |
+
} nvtxNameCuContextW_params;
|
| 143 |
+
|
| 144 |
+
typedef struct nvtxNameCuStreamA_params_st {
|
| 145 |
+
CUstream stream;
|
| 146 |
+
const char* name;
|
| 147 |
+
} nvtxNameCuStreamA_params;
|
| 148 |
+
|
| 149 |
+
typedef struct nvtxNameCuStreamW_params_st {
|
| 150 |
+
CUstream stream;
|
| 151 |
+
const wchar_t* name;
|
| 152 |
+
} nvtxNameCuStreamW_params;
|
| 153 |
+
|
| 154 |
+
typedef struct nvtxNameCuEventA_params_st {
|
| 155 |
+
CUevent event;
|
| 156 |
+
const char* name;
|
| 157 |
+
} nvtxNameCuEventA_params;
|
| 158 |
+
|
| 159 |
+
typedef struct nvtxNameCuEventW_params_st {
|
| 160 |
+
CUevent event;
|
| 161 |
+
const wchar_t* name;
|
| 162 |
+
} nvtxNameCuEventW_params;
|
| 163 |
+
|
| 164 |
+
typedef struct nvtxNameCudaDeviceA_params_st {
|
| 165 |
+
int device;
|
| 166 |
+
const char* name;
|
| 167 |
+
} nvtxNameCudaDeviceA_params;
|
| 168 |
+
|
| 169 |
+
typedef struct nvtxNameCudaDeviceW_params_st {
|
| 170 |
+
int device;
|
| 171 |
+
const wchar_t* name;
|
| 172 |
+
} nvtxNameCudaDeviceW_params;
|
| 173 |
+
|
| 174 |
+
typedef struct nvtxNameCudaStreamA_params_st {
|
| 175 |
+
cudaStream_t stream;
|
| 176 |
+
const char* name;
|
| 177 |
+
} nvtxNameCudaStreamA_params;
|
| 178 |
+
|
| 179 |
+
typedef struct nvtxNameCudaStreamW_params_st {
|
| 180 |
+
cudaStream_t stream;
|
| 181 |
+
const wchar_t* name;
|
| 182 |
+
} nvtxNameCudaStreamW_params;
|
| 183 |
+
|
| 184 |
+
typedef struct nvtxNameCudaEventA_params_st {
|
| 185 |
+
cudaEvent_t event;
|
| 186 |
+
const char* name;
|
| 187 |
+
} nvtxNameCudaEventA_params;
|
| 188 |
+
|
| 189 |
+
typedef struct nvtxNameCudaEventW_params_st {
|
| 190 |
+
cudaEvent_t event;
|
| 191 |
+
const wchar_t* name;
|
| 192 |
+
} nvtxNameCudaEventW_params;
|
| 193 |
+
|
| 194 |
+
typedef struct nvtxDomainCreateA_params_st {
|
| 195 |
+
const char* name;
|
| 196 |
+
} nvtxDomainCreateA_params;
|
| 197 |
+
|
| 198 |
+
typedef struct nvtxDomainDestroy_params_st {
|
| 199 |
+
nvtxDomainHandle_t domain;
|
| 200 |
+
} nvtxDomainDestroy_params;
|
| 201 |
+
|
| 202 |
+
typedef struct nvtxDomainMarkEx_params_st {
|
| 203 |
+
nvtxDomainHandle_t domain;
|
| 204 |
+
nvtxMarkEx_params core;
|
| 205 |
+
} nvtxDomainMarkEx_params;
|
| 206 |
+
|
| 207 |
+
typedef struct nvtxDomainRangeStartEx_params_st {
|
| 208 |
+
nvtxDomainHandle_t domain;
|
| 209 |
+
nvtxRangeStartEx_params core;
|
| 210 |
+
} nvtxDomainRangeStartEx_params;
|
| 211 |
+
|
| 212 |
+
typedef struct nvtxDomainRangeEnd_params_st {
|
| 213 |
+
nvtxDomainHandle_t domain;
|
| 214 |
+
nvtxRangeEnd_params core;
|
| 215 |
+
} nvtxDomainRangeEnd_params;
|
| 216 |
+
|
| 217 |
+
typedef struct nvtxDomainRangePushEx_params_st {
|
| 218 |
+
nvtxDomainHandle_t domain;
|
| 219 |
+
nvtxRangePushEx_params core;
|
| 220 |
+
} nvtxDomainRangePushEx_params;
|
| 221 |
+
|
| 222 |
+
typedef struct nvtxDomainRangePop_params_st {
|
| 223 |
+
nvtxDomainHandle_t domain;
|
| 224 |
+
} nvtxDomainRangePop_params;
|
| 225 |
+
|
| 226 |
+
typedef struct nvtxSyncUserCreate_params_st {
|
| 227 |
+
nvtxDomainHandle_t domain;
|
| 228 |
+
const nvtxSyncUserAttributes_t* attribs;
|
| 229 |
+
} nvtxSyncUserCreate_params;
|
| 230 |
+
|
| 231 |
+
typedef struct nvtxSyncUserCommon_params_st {
|
| 232 |
+
nvtxSyncUser_t handle;
|
| 233 |
+
} nvtxSyncUserCommon_params;
|
| 234 |
+
|
| 235 |
+
typedef struct nvtxDomainRegisterStringA_params_st {
|
| 236 |
+
nvtxDomainHandle_t domain;
|
| 237 |
+
const char* string;
|
| 238 |
+
} nvtxDomainRegisterStringA_params;
|
| 239 |
+
|
| 240 |
+
typedef struct nvtxDomainRegisterStringW_params_st {
|
| 241 |
+
nvtxDomainHandle_t domain;
|
| 242 |
+
const char* string;
|
| 243 |
+
} nvtxDomainRegisterStringW_params;
|
| 244 |
+
|
| 245 |
+
#if defined(__GNUC__) && defined(CUPTI_LIB)
|
| 246 |
+
#pragma GCC visibility pop
|
| 247 |
+
#endif
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_cupti/include/nvperf_common.h
ADDED
|
@@ -0,0 +1,393 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#ifndef NVPERF_COMMON_H
|
| 2 |
+
#define NVPERF_COMMON_H
|
| 3 |
+
|
| 4 |
+
/*
|
| 5 |
+
* Copyright 2014-2024 NVIDIA Corporation. All rights reserved.
|
| 6 |
+
*
|
| 7 |
+
* NOTICE TO USER:
|
| 8 |
+
*
|
| 9 |
+
* This source code is subject to NVIDIA ownership rights under U.S. and
|
| 10 |
+
* international Copyright laws.
|
| 11 |
+
*
|
| 12 |
+
* This software and the information contained herein is PROPRIETARY and
|
| 13 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
| 14 |
+
* of a form of NVIDIA software license agreement.
|
| 15 |
+
*
|
| 16 |
+
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
| 17 |
+
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
| 18 |
+
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
| 19 |
+
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
| 20 |
+
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 21 |
+
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
| 22 |
+
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
| 23 |
+
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
| 24 |
+
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
| 25 |
+
* OR PERFORMANCE OF THIS SOURCE CODE.
|
| 26 |
+
*
|
| 27 |
+
* U.S. Government End Users. This source code is a "commercial item" as
|
| 28 |
+
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
| 29 |
+
* "commercial computer software" and "commercial computer software
|
| 30 |
+
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
| 31 |
+
* and is provided to the U.S. Government only as a commercial end item.
|
| 32 |
+
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
| 33 |
+
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
| 34 |
+
* source code with only those rights set forth herein.
|
| 35 |
+
*
|
| 36 |
+
* Any use of this source code in individual and commercial software must
|
| 37 |
+
* include, in the user documentation and internal comments to the code,
|
| 38 |
+
* the above Disclaimer and U.S. Government End Users Notice.
|
| 39 |
+
*/
|
| 40 |
+
|
| 41 |
+
#include <stddef.h>
|
| 42 |
+
#include <stdint.h>
|
| 43 |
+
|
| 44 |
+
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
| 45 |
+
#pragma GCC visibility push(default)
|
| 46 |
+
#if !defined(NVPW_LOCAL)
|
| 47 |
+
#define NVPW_LOCAL __attribute__ ((visibility ("hidden")))
|
| 48 |
+
#endif
|
| 49 |
+
#else
|
| 50 |
+
#if !defined(NVPW_LOCAL)
|
| 51 |
+
#define NVPW_LOCAL
|
| 52 |
+
#endif
|
| 53 |
+
#endif
|
| 54 |
+
|
| 55 |
+
#ifdef __cplusplus
|
| 56 |
+
extern "C" {
|
| 57 |
+
#endif
|
| 58 |
+
|
| 59 |
+
/**
|
| 60 |
+
* @file nvperf_common.h
|
| 61 |
+
*/
|
| 62 |
+
|
| 63 |
+
#ifndef NVPERF_NVPA_STATUS_DEFINED
|
| 64 |
+
#define NVPERF_NVPA_STATUS_DEFINED
|
| 65 |
+
|
| 66 |
+
/// Error codes.
|
| 67 |
+
typedef enum NVPA_Status
|
| 68 |
+
{
|
| 69 |
+
/// Success
|
| 70 |
+
NVPA_STATUS_SUCCESS = 0,
|
| 71 |
+
/// Generic error.
|
| 72 |
+
NVPA_STATUS_ERROR = 1,
|
| 73 |
+
/// Internal error. Please file a bug!
|
| 74 |
+
NVPA_STATUS_INTERNAL_ERROR = 2,
|
| 75 |
+
/// NVPW_InitializeTarget() or NVPW_InitializeHost() has not been called yet.
|
| 76 |
+
NVPA_STATUS_NOT_INITIALIZED = 3,
|
| 77 |
+
/// The NvPerf DLL/DSO could not be loaded during NVPW_Initialize*(). Please ensure they are placed in the
|
| 78 |
+
/// appropriate location that can be founder by a dynamic linker. And on Linux systems, confirm that the
|
| 79 |
+
/// LD_LIBRARY_PATH environment variable is set correctly. Alternatively, you may utilize
|
| 80 |
+
/// NVPW_SetLibraryLoadPaths() to define additional library search paths.
|
| 81 |
+
NVPA_STATUS_NOT_LOADED = 4,
|
| 82 |
+
/// The function was not found in this version of the NvPerf DLL/DSO. Or if you are directly calling
|
| 83 |
+
/// NVPA_GetProcAddress(), please ensure the function name is spelled correctly.
|
| 84 |
+
NVPA_STATUS_FUNCTION_NOT_FOUND = 5,
|
| 85 |
+
/// The request was intentionally not supported.
|
| 86 |
+
NVPA_STATUS_NOT_SUPPORTED = 6,
|
| 87 |
+
/// The request was not implemented by this version.
|
| 88 |
+
NVPA_STATUS_NOT_IMPLEMENTED = 7,
|
| 89 |
+
/// Invalid argument.
|
| 90 |
+
NVPA_STATUS_INVALID_ARGUMENT = 8,
|
| 91 |
+
/// UNUSED
|
| 92 |
+
NVPA_STATUS_INVALID_METRIC_ID = 9,
|
| 93 |
+
/// No driver has been loaded via NVPW_*_LoadDriver().
|
| 94 |
+
NVPA_STATUS_DRIVER_NOT_LOADED = 10,
|
| 95 |
+
/// Failed memory allocation.
|
| 96 |
+
NVPA_STATUS_OUT_OF_MEMORY = 11,
|
| 97 |
+
/// UNUSED
|
| 98 |
+
NVPA_STATUS_INVALID_THREAD_STATE = 12,
|
| 99 |
+
/// UNUSED
|
| 100 |
+
NVPA_STATUS_FAILED_CONTEXT_ALLOC = 13,
|
| 101 |
+
/// The specified GPU is not supported. It is recommended to call IsGpuSupported() for more information
|
| 102 |
+
NVPA_STATUS_UNSUPPORTED_GPU = 14,
|
| 103 |
+
/// The installed NVIDIA driver is too old.
|
| 104 |
+
NVPA_STATUS_INSUFFICIENT_DRIVER_VERSION = 15,
|
| 105 |
+
/// UNUSED
|
| 106 |
+
NVPA_STATUS_OBJECT_NOT_REGISTERED = 16,
|
| 107 |
+
/// Profiling permission not granted; see https://developer.nvidia.com/nvidia-development-tools-solutions-
|
| 108 |
+
/// ERR_NVGPUCTRPERM-permission-issue-performance-counters
|
| 109 |
+
NVPA_STATUS_INSUFFICIENT_PRIVILEGE = 17,
|
| 110 |
+
/// UNUSED
|
| 111 |
+
NVPA_STATUS_INVALID_CONTEXT_STATE = 18,
|
| 112 |
+
/// UNUSED
|
| 113 |
+
NVPA_STATUS_INVALID_OBJECT_STATE = 19,
|
| 114 |
+
/// The request could not be fulfilled because a system resource is already in use.
|
| 115 |
+
NVPA_STATUS_RESOURCE_UNAVAILABLE = 20,
|
| 116 |
+
/// UNUSED
|
| 117 |
+
NVPA_STATUS_DRIVER_LOADED_TOO_LATE = 21,
|
| 118 |
+
/// The provided buffer is not large enough.
|
| 119 |
+
NVPA_STATUS_INSUFFICIENT_SPACE = 22,
|
| 120 |
+
/// UNUSED
|
| 121 |
+
NVPA_STATUS_OBJECT_MISMATCH = 23,
|
| 122 |
+
/// Virtualized GPU (vGPU) is not supported.
|
| 123 |
+
NVPA_STATUS_VIRTUALIZED_DEVICE_NOT_SUPPORTED = 24,
|
| 124 |
+
/// Profiling permission was not granted or the device was disabled.
|
| 125 |
+
NVPA_STATUS_PROFILING_NOT_ALLOWED = 25,
|
| 126 |
+
NVPA_STATUS__COUNT
|
| 127 |
+
} NVPA_Status;
|
| 128 |
+
|
| 129 |
+
|
| 130 |
+
inline void NVPW_NVPAStatusToString(NVPA_Status status, const char** ppStatusStr, const char** ppCommentStr)
|
| 131 |
+
{
|
| 132 |
+
switch (status)
|
| 133 |
+
{
|
| 134 |
+
case NVPA_STATUS_SUCCESS:
|
| 135 |
+
*ppStatusStr = "NVPA_STATUS_SUCCESS";
|
| 136 |
+
*ppCommentStr = "Success";
|
| 137 |
+
return;
|
| 138 |
+
case NVPA_STATUS_ERROR:
|
| 139 |
+
*ppStatusStr = "NVPA_STATUS_ERROR";
|
| 140 |
+
*ppCommentStr = "Generic error.";
|
| 141 |
+
return;
|
| 142 |
+
case NVPA_STATUS_INTERNAL_ERROR:
|
| 143 |
+
*ppStatusStr = "NVPA_STATUS_INTERNAL_ERROR";
|
| 144 |
+
*ppCommentStr = "Internal error. Please file a bug!";
|
| 145 |
+
return;
|
| 146 |
+
case NVPA_STATUS_NOT_INITIALIZED:
|
| 147 |
+
*ppStatusStr = "NVPA_STATUS_NOT_INITIALIZED";
|
| 148 |
+
*ppCommentStr = "NVPW_InitializeTarget() or NVPW_InitializeHost() has not been called yet.";
|
| 149 |
+
return;
|
| 150 |
+
case NVPA_STATUS_NOT_LOADED:
|
| 151 |
+
*ppStatusStr = "NVPA_STATUS_NOT_LOADED";
|
| 152 |
+
*ppCommentStr = "The NvPerf DLL/DSO could not be loaded during NVPW_Initialize*(). Please ensure they are placed in the appropriate location that can be founder by a dynamic linker. And on Linux systems, confirm that the LD_LIBRARY_PATH environment variable is set correctly. Alternatively, you may utilize NVPW_SetLibraryLoadPaths() to define additional library search paths.";
|
| 153 |
+
return;
|
| 154 |
+
case NVPA_STATUS_FUNCTION_NOT_FOUND:
|
| 155 |
+
*ppStatusStr = "NVPA_STATUS_FUNCTION_NOT_FOUND";
|
| 156 |
+
*ppCommentStr = "The function was not found in this version of the NvPerf DLL/DSO. Or if you are directly calling NVPA_GetProcAddress(), please ensure the function name is spelled correctly.";
|
| 157 |
+
return;
|
| 158 |
+
case NVPA_STATUS_NOT_SUPPORTED:
|
| 159 |
+
*ppStatusStr = "NVPA_STATUS_NOT_SUPPORTED";
|
| 160 |
+
*ppCommentStr = "The request was intentionally not supported.";
|
| 161 |
+
return;
|
| 162 |
+
case NVPA_STATUS_NOT_IMPLEMENTED:
|
| 163 |
+
*ppStatusStr = "NVPA_STATUS_NOT_IMPLEMENTED";
|
| 164 |
+
*ppCommentStr = "The request was not implemented by this version.";
|
| 165 |
+
return;
|
| 166 |
+
case NVPA_STATUS_INVALID_ARGUMENT:
|
| 167 |
+
*ppStatusStr = "NVPA_STATUS_INVALID_ARGUMENT";
|
| 168 |
+
*ppCommentStr = "Invalid argument.";
|
| 169 |
+
return;
|
| 170 |
+
case NVPA_STATUS_INVALID_METRIC_ID:
|
| 171 |
+
*ppStatusStr = "NVPA_STATUS_INVALID_METRIC_ID";
|
| 172 |
+
*ppCommentStr = "UNUSED";
|
| 173 |
+
return;
|
| 174 |
+
case NVPA_STATUS_DRIVER_NOT_LOADED:
|
| 175 |
+
*ppStatusStr = "NVPA_STATUS_DRIVER_NOT_LOADED";
|
| 176 |
+
*ppCommentStr = "No driver has been loaded via NVPW_*_LoadDriver().";
|
| 177 |
+
return;
|
| 178 |
+
case NVPA_STATUS_OUT_OF_MEMORY:
|
| 179 |
+
*ppStatusStr = "NVPA_STATUS_OUT_OF_MEMORY";
|
| 180 |
+
*ppCommentStr = "Failed memory allocation.";
|
| 181 |
+
return;
|
| 182 |
+
case NVPA_STATUS_INVALID_THREAD_STATE:
|
| 183 |
+
*ppStatusStr = "NVPA_STATUS_INVALID_THREAD_STATE";
|
| 184 |
+
*ppCommentStr = "UNUSED";
|
| 185 |
+
return;
|
| 186 |
+
case NVPA_STATUS_FAILED_CONTEXT_ALLOC:
|
| 187 |
+
*ppStatusStr = "NVPA_STATUS_FAILED_CONTEXT_ALLOC";
|
| 188 |
+
*ppCommentStr = "UNUSED";
|
| 189 |
+
return;
|
| 190 |
+
case NVPA_STATUS_UNSUPPORTED_GPU:
|
| 191 |
+
*ppStatusStr = "NVPA_STATUS_UNSUPPORTED_GPU";
|
| 192 |
+
*ppCommentStr = "The specified GPU is not supported. It is recommended to call IsGpuSupported() for more information";
|
| 193 |
+
return;
|
| 194 |
+
case NVPA_STATUS_INSUFFICIENT_DRIVER_VERSION:
|
| 195 |
+
*ppStatusStr = "NVPA_STATUS_INSUFFICIENT_DRIVER_VERSION";
|
| 196 |
+
*ppCommentStr = "The installed NVIDIA driver is too old.";
|
| 197 |
+
return;
|
| 198 |
+
case NVPA_STATUS_OBJECT_NOT_REGISTERED:
|
| 199 |
+
*ppStatusStr = "NVPA_STATUS_OBJECT_NOT_REGISTERED";
|
| 200 |
+
*ppCommentStr = "UNUSED";
|
| 201 |
+
return;
|
| 202 |
+
case NVPA_STATUS_INSUFFICIENT_PRIVILEGE:
|
| 203 |
+
*ppStatusStr = "NVPA_STATUS_INSUFFICIENT_PRIVILEGE";
|
| 204 |
+
*ppCommentStr = "Profiling permission not granted; see https://developer.nvidia.com/nvidia-development-tools-solutions-ERR_NVGPUCTRPERM-permission-issue-performance-counters";
|
| 205 |
+
return;
|
| 206 |
+
case NVPA_STATUS_INVALID_CONTEXT_STATE:
|
| 207 |
+
*ppStatusStr = "NVPA_STATUS_INVALID_CONTEXT_STATE";
|
| 208 |
+
*ppCommentStr = "UNUSED";
|
| 209 |
+
return;
|
| 210 |
+
case NVPA_STATUS_INVALID_OBJECT_STATE:
|
| 211 |
+
*ppStatusStr = "NVPA_STATUS_INVALID_OBJECT_STATE";
|
| 212 |
+
*ppCommentStr = "UNUSED";
|
| 213 |
+
return;
|
| 214 |
+
case NVPA_STATUS_RESOURCE_UNAVAILABLE:
|
| 215 |
+
*ppStatusStr = "NVPA_STATUS_RESOURCE_UNAVAILABLE";
|
| 216 |
+
*ppCommentStr = "The request could not be fulfilled because a system resource is already in use.";
|
| 217 |
+
return;
|
| 218 |
+
case NVPA_STATUS_DRIVER_LOADED_TOO_LATE:
|
| 219 |
+
*ppStatusStr = "NVPA_STATUS_DRIVER_LOADED_TOO_LATE";
|
| 220 |
+
*ppCommentStr = "UNUSED";
|
| 221 |
+
return;
|
| 222 |
+
case NVPA_STATUS_INSUFFICIENT_SPACE:
|
| 223 |
+
*ppStatusStr = "NVPA_STATUS_INSUFFICIENT_SPACE";
|
| 224 |
+
*ppCommentStr = "The provided buffer is not large enough.";
|
| 225 |
+
return;
|
| 226 |
+
case NVPA_STATUS_OBJECT_MISMATCH:
|
| 227 |
+
*ppStatusStr = "NVPA_STATUS_OBJECT_MISMATCH";
|
| 228 |
+
*ppCommentStr = "UNUSED";
|
| 229 |
+
return;
|
| 230 |
+
case NVPA_STATUS_VIRTUALIZED_DEVICE_NOT_SUPPORTED:
|
| 231 |
+
*ppStatusStr = "NVPA_STATUS_VIRTUALIZED_DEVICE_NOT_SUPPORTED";
|
| 232 |
+
*ppCommentStr = "Virtualized GPU (vGPU) is not supported.";
|
| 233 |
+
return;
|
| 234 |
+
case NVPA_STATUS_PROFILING_NOT_ALLOWED:
|
| 235 |
+
*ppStatusStr = "NVPA_STATUS_PROFILING_NOT_ALLOWED";
|
| 236 |
+
*ppCommentStr = "Profiling permission was not granted or the device was disabled.";
|
| 237 |
+
return;
|
| 238 |
+
default:
|
| 239 |
+
*ppStatusStr = "Unrecognized status";
|
| 240 |
+
*ppCommentStr = "This status is unrecognized. Is it coming from a newer version of NvPerf library?";
|
| 241 |
+
return;
|
| 242 |
+
}
|
| 243 |
+
}
|
| 244 |
+
|
| 245 |
+
|
| 246 |
+
#endif // NVPERF_NVPA_STATUS_DEFINED
|
| 247 |
+
|
| 248 |
+
|
| 249 |
+
#ifndef NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
| 250 |
+
#define NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
| 251 |
+
|
| 252 |
+
/// The configuration's activity-kind dictates which types of data may be collected.
|
| 253 |
+
typedef enum NVPA_ActivityKind
|
| 254 |
+
{
|
| 255 |
+
/// Invalid value.
|
| 256 |
+
NVPA_ACTIVITY_KIND_INVALID = 0,
|
| 257 |
+
/// A workload-centric activity for serialized and pipelined collection.
|
| 258 |
+
///
|
| 259 |
+
/// Profiler is capable of collecting both serialized and pipelined metrics. The library introduces any
|
| 260 |
+
/// synchronization required to collect serialized metrics.
|
| 261 |
+
NVPA_ACTIVITY_KIND_PROFILER,
|
| 262 |
+
/// A realtime activity for sampling counters from the CPU or GPU.
|
| 263 |
+
NVPA_ACTIVITY_KIND_REALTIME_SAMPLED,
|
| 264 |
+
/// A realtime activity for profiling counters from the CPU or GPU without CPU/GPU synchronizations.
|
| 265 |
+
NVPA_ACTIVITY_KIND_REALTIME_PROFILER,
|
| 266 |
+
NVPA_ACTIVITY_KIND__COUNT
|
| 267 |
+
} NVPA_ActivityKind;
|
| 268 |
+
|
| 269 |
+
|
| 270 |
+
#endif // NVPERF_NVPA_ACTIVITY_KIND_DEFINED
|
| 271 |
+
|
| 272 |
+
|
| 273 |
+
#ifndef NVPERF_NVPA_BOOL_DEFINED
|
| 274 |
+
#define NVPERF_NVPA_BOOL_DEFINED
|
| 275 |
+
/// The type used for boolean values.
|
| 276 |
+
typedef uint8_t NVPA_Bool;
|
| 277 |
+
#endif // NVPERF_NVPA_BOOL_DEFINED
|
| 278 |
+
|
| 279 |
+
#ifndef NVPA_STRUCT_SIZE
|
| 280 |
+
#define NVPA_STRUCT_SIZE(type_, lastfield_) (offsetof(type_, lastfield_) + sizeof(((type_*)0)->lastfield_))
|
| 281 |
+
#endif // NVPA_STRUCT_SIZE
|
| 282 |
+
|
| 283 |
+
#ifndef NVPW_FIELD_EXISTS
|
| 284 |
+
#define NVPW_FIELD_EXISTS(pParams_, name_) \
|
| 285 |
+
((pParams_)->structSize >= (size_t)((const uint8_t*)(&(pParams_)->name_) + sizeof(pParams_)->name_ - (const uint8_t*)(pParams_)))
|
| 286 |
+
#endif // NVPW_FIELD_EXISTS
|
| 287 |
+
|
| 288 |
+
|
| 289 |
+
#ifndef NVPERF_NVPA_GETPROCADDRESS_DEFINED
|
| 290 |
+
#define NVPERF_NVPA_GETPROCADDRESS_DEFINED
|
| 291 |
+
|
| 292 |
+
typedef NVPA_Status (*NVPA_GenericFn)(void);
|
| 293 |
+
|
| 294 |
+
|
| 295 |
+
///
|
| 296 |
+
/// Gets the address of an NvPerf API function.
|
| 297 |
+
///
|
| 298 |
+
/// \return A function pointer to the function, or NULL if the function is not available.
|
| 299 |
+
///
|
| 300 |
+
/// \param pFunctionName [in] Name of the function to retrieve.
|
| 301 |
+
NVPA_GenericFn NVPA_GetProcAddress(const char* pFunctionName);
|
| 302 |
+
|
| 303 |
+
#endif
|
| 304 |
+
|
| 305 |
+
#ifndef NVPERF_NVPW_SETLIBRARYLOADPATHS_DEFINED
|
| 306 |
+
#define NVPERF_NVPW_SETLIBRARYLOADPATHS_DEFINED
|
| 307 |
+
|
| 308 |
+
|
| 309 |
+
typedef struct NVPW_SetLibraryLoadPaths_Params
|
| 310 |
+
{
|
| 311 |
+
/// [in]
|
| 312 |
+
size_t structSize;
|
| 313 |
+
/// [in] assign to NULL
|
| 314 |
+
void* pPriv;
|
| 315 |
+
/// [in] number of paths in ppPaths
|
| 316 |
+
size_t numPaths;
|
| 317 |
+
/// [in] array of null-terminated paths
|
| 318 |
+
const char** ppPaths;
|
| 319 |
+
} NVPW_SetLibraryLoadPaths_Params;
|
| 320 |
+
#define NVPW_SetLibraryLoadPaths_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_SetLibraryLoadPaths_Params, ppPaths)
|
| 321 |
+
|
| 322 |
+
/// Sets library search path for \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget().
|
| 323 |
+
/// \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget load the NvPerf DLL/DSO. This function sets
|
| 324 |
+
/// ordered paths that will be searched with the LoadLibrary() or dlopen() call.
|
| 325 |
+
/// If load paths are set by this function, the default set of load paths
|
| 326 |
+
/// will not be attempted.
|
| 327 |
+
/// Each path must point at a directory (not a file name).
|
| 328 |
+
/// This function is not thread-safe.
|
| 329 |
+
/// Example Usage:
|
| 330 |
+
/// \code
|
| 331 |
+
/// const char* paths[] = {
|
| 332 |
+
/// "path1", "path2", etc
|
| 333 |
+
/// };
|
| 334 |
+
/// NVPW_SetLibraryLoadPaths_Params params{NVPW_SetLibraryLoadPaths_Params_STRUCT_SIZE};
|
| 335 |
+
/// params.numPaths = sizeof(paths)/sizeof(paths[0]);
|
| 336 |
+
/// params.ppPaths = paths;
|
| 337 |
+
/// NVPW_SetLibraryLoadPaths(¶ms);
|
| 338 |
+
/// NVPW_InitializeHost();
|
| 339 |
+
/// params.numPaths = 0;
|
| 340 |
+
/// params.ppPaths = NULL;
|
| 341 |
+
/// NVPW_SetLibraryLoadPaths(¶ms);
|
| 342 |
+
/// \endcode
|
| 343 |
+
NVPA_Status NVPW_SetLibraryLoadPaths(NVPW_SetLibraryLoadPaths_Params* pParams);
|
| 344 |
+
|
| 345 |
+
typedef struct NVPW_SetLibraryLoadPathsW_Params
|
| 346 |
+
{
|
| 347 |
+
/// [in]
|
| 348 |
+
size_t structSize;
|
| 349 |
+
/// [in] assign to NULL
|
| 350 |
+
void* pPriv;
|
| 351 |
+
/// [in] number of paths in ppwPaths
|
| 352 |
+
size_t numPaths;
|
| 353 |
+
/// [in] array of null-terminated paths
|
| 354 |
+
const wchar_t** ppwPaths;
|
| 355 |
+
} NVPW_SetLibraryLoadPathsW_Params;
|
| 356 |
+
#define NVPW_SetLibraryLoadPathsW_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_SetLibraryLoadPathsW_Params, ppwPaths)
|
| 357 |
+
|
| 358 |
+
/// Sets library search path for \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget().
|
| 359 |
+
/// \ref NVPW_InitializeHost() and \ref NVPW_InitializeTarget load the NvPerf DLL/DSO. This function sets
|
| 360 |
+
/// ordered paths that will be searched with the LoadLibrary() or dlopen() call.
|
| 361 |
+
/// If load paths are set by this function, the default set of load paths
|
| 362 |
+
/// will not be attempted.
|
| 363 |
+
/// Each path must point at a directory (not a file name).
|
| 364 |
+
/// This function is not thread-safe.
|
| 365 |
+
/// Example Usage:
|
| 366 |
+
/// \code
|
| 367 |
+
/// const wchar_t* wpaths[] = {
|
| 368 |
+
/// L"path1", L"path2", etc
|
| 369 |
+
/// };
|
| 370 |
+
/// NVPW_SetLibraryLoadPathsW_Params params{NVPW_SetLibraryLoadPathsW_Params_STRUCT_SIZE};
|
| 371 |
+
/// params.numPaths = sizeof(wpaths)/sizeof(wpaths[0]);
|
| 372 |
+
/// params.ppwPaths = wpaths;
|
| 373 |
+
/// NVPW_SetLibraryLoadPathsW(¶ms);
|
| 374 |
+
/// NVPW_InitializeHost();
|
| 375 |
+
/// params.numPaths = 0;
|
| 376 |
+
/// params.ppwPaths = NULL;
|
| 377 |
+
/// NVPW_SetLibraryLoadPathsW(¶ms);
|
| 378 |
+
/// \endcode
|
| 379 |
+
NVPA_Status NVPW_SetLibraryLoadPathsW(NVPW_SetLibraryLoadPathsW_Params* pParams);
|
| 380 |
+
|
| 381 |
+
#endif
|
| 382 |
+
|
| 383 |
+
|
| 384 |
+
|
| 385 |
+
#ifdef __cplusplus
|
| 386 |
+
} // extern "C"
|
| 387 |
+
#endif
|
| 388 |
+
|
| 389 |
+
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
| 390 |
+
#pragma GCC visibility pop
|
| 391 |
+
#endif
|
| 392 |
+
|
| 393 |
+
#endif // NVPERF_COMMON_H
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_cupti/include/nvperf_cuda_host.h
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#ifndef NVPERF_CUDA_HOST_H
|
| 2 |
+
#define NVPERF_CUDA_HOST_H
|
| 3 |
+
|
| 4 |
+
/*
|
| 5 |
+
* Copyright 2014-2024 NVIDIA Corporation. All rights reserved.
|
| 6 |
+
*
|
| 7 |
+
* NOTICE TO USER:
|
| 8 |
+
*
|
| 9 |
+
* This source code is subject to NVIDIA ownership rights under U.S. and
|
| 10 |
+
* international Copyright laws.
|
| 11 |
+
*
|
| 12 |
+
* This software and the information contained herein is PROPRIETARY and
|
| 13 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
| 14 |
+
* of a form of NVIDIA software license agreement.
|
| 15 |
+
*
|
| 16 |
+
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
| 17 |
+
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
| 18 |
+
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
| 19 |
+
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
| 20 |
+
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 21 |
+
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
| 22 |
+
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
| 23 |
+
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
| 24 |
+
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
| 25 |
+
* OR PERFORMANCE OF THIS SOURCE CODE.
|
| 26 |
+
*
|
| 27 |
+
* U.S. Government End Users. This source code is a "commercial item" as
|
| 28 |
+
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
| 29 |
+
* "commercial computer software" and "commercial computer software
|
| 30 |
+
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
| 31 |
+
* and is provided to the U.S. Government only as a commercial end item.
|
| 32 |
+
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
| 33 |
+
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
| 34 |
+
* source code with only those rights set forth herein.
|
| 35 |
+
*
|
| 36 |
+
* Any use of this source code in individual and commercial software must
|
| 37 |
+
* include, in the user documentation and internal comments to the code,
|
| 38 |
+
* the above Disclaimer and U.S. Government End Users Notice.
|
| 39 |
+
*/
|
| 40 |
+
|
| 41 |
+
#include <stddef.h>
|
| 42 |
+
#include <stdint.h>
|
| 43 |
+
#include "nvperf_common.h"
|
| 44 |
+
#include "nvperf_host.h"
|
| 45 |
+
|
| 46 |
+
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
| 47 |
+
#pragma GCC visibility push(default)
|
| 48 |
+
#if !defined(NVPW_LOCAL)
|
| 49 |
+
#define NVPW_LOCAL __attribute__ ((visibility ("hidden")))
|
| 50 |
+
#endif
|
| 51 |
+
#else
|
| 52 |
+
#if !defined(NVPW_LOCAL)
|
| 53 |
+
#define NVPW_LOCAL
|
| 54 |
+
#endif
|
| 55 |
+
#endif
|
| 56 |
+
|
| 57 |
+
#ifdef __cplusplus
|
| 58 |
+
extern "C" {
|
| 59 |
+
#endif
|
| 60 |
+
|
| 61 |
+
/**
|
| 62 |
+
* @file nvperf_cuda_host.h
|
| 63 |
+
*/
|
| 64 |
+
|
| 65 |
+
typedef struct NVPW_CUDA_RawMetricsConfig_Create_Params
|
| 66 |
+
{
|
| 67 |
+
/// [in]
|
| 68 |
+
size_t structSize;
|
| 69 |
+
/// [in] assign to NULL
|
| 70 |
+
void* pPriv;
|
| 71 |
+
/// [in]
|
| 72 |
+
NVPA_ActivityKind activityKind;
|
| 73 |
+
/// [in]
|
| 74 |
+
const char* pChipName;
|
| 75 |
+
/// [out] new NVPA_RawMetricsConfig object
|
| 76 |
+
struct NVPA_RawMetricsConfig* pRawMetricsConfig;
|
| 77 |
+
} NVPW_CUDA_RawMetricsConfig_Create_Params;
|
| 78 |
+
#define NVPW_CUDA_RawMetricsConfig_Create_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_CUDA_RawMetricsConfig_Create_Params, pRawMetricsConfig)
|
| 79 |
+
|
| 80 |
+
NVPA_Status NVPW_CUDA_RawMetricsConfig_Create(NVPW_CUDA_RawMetricsConfig_Create_Params* pParams);
|
| 81 |
+
|
| 82 |
+
typedef struct NVPW_CUDA_RawMetricsConfig_Create_V2_Params
|
| 83 |
+
{
|
| 84 |
+
/// [in]
|
| 85 |
+
size_t structSize;
|
| 86 |
+
/// [in] assign to NULL
|
| 87 |
+
void* pPriv;
|
| 88 |
+
/// [in]
|
| 89 |
+
NVPA_ActivityKind activityKind;
|
| 90 |
+
/// [in] accepted for chips supported at the time-of-release.
|
| 91 |
+
const char* pChipName;
|
| 92 |
+
/// [in] buffer with counter availability image - required for future chip support
|
| 93 |
+
const uint8_t* pCounterAvailabilityImage;
|
| 94 |
+
/// [out] new NVPA_RawMetricsConfig object
|
| 95 |
+
struct NVPA_RawMetricsConfig* pRawMetricsConfig;
|
| 96 |
+
} NVPW_CUDA_RawMetricsConfig_Create_V2_Params;
|
| 97 |
+
#define NVPW_CUDA_RawMetricsConfig_Create_V2_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_CUDA_RawMetricsConfig_Create_V2_Params, pRawMetricsConfig)
|
| 98 |
+
|
| 99 |
+
/// Use either 'pChipName' or 'pCounterAvailabilityImage'.
|
| 100 |
+
NVPA_Status NVPW_CUDA_RawMetricsConfig_Create_V2(NVPW_CUDA_RawMetricsConfig_Create_V2_Params* pParams);
|
| 101 |
+
|
| 102 |
+
typedef struct NVPW_CUDA_CounterDataBuilder_Create_Params
|
| 103 |
+
{
|
| 104 |
+
/// [in]
|
| 105 |
+
size_t structSize;
|
| 106 |
+
/// [in] assign to NULL
|
| 107 |
+
void* pPriv;
|
| 108 |
+
/// [in] accepted for chips supported at the time-of-release.
|
| 109 |
+
const char* pChipName;
|
| 110 |
+
/// [in] buffer with counter availability image - required for future chip support
|
| 111 |
+
const uint8_t* pCounterAvailabilityImage;
|
| 112 |
+
/// [out] new NVPA_CounterDataBuilder object
|
| 113 |
+
struct NVPA_CounterDataBuilder* pCounterDataBuilder;
|
| 114 |
+
} NVPW_CUDA_CounterDataBuilder_Create_Params;
|
| 115 |
+
#define NVPW_CUDA_CounterDataBuilder_Create_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_CUDA_CounterDataBuilder_Create_Params, pCounterDataBuilder)
|
| 116 |
+
|
| 117 |
+
/// Use either 'pChipName' or 'pCounterAvailabilityImage'.
|
| 118 |
+
NVPA_Status NVPW_CUDA_CounterDataBuilder_Create(NVPW_CUDA_CounterDataBuilder_Create_Params* pParams);
|
| 119 |
+
|
| 120 |
+
typedef struct NVPW_MetricsEvaluator NVPW_MetricsEvaluator;
|
| 121 |
+
|
| 122 |
+
typedef struct NVPW_CUDA_MetricsEvaluator_CalculateScratchBufferSize_Params
|
| 123 |
+
{
|
| 124 |
+
/// [in]
|
| 125 |
+
size_t structSize;
|
| 126 |
+
/// [in] assign to NULL
|
| 127 |
+
void* pPriv;
|
| 128 |
+
/// [in] accepted for chips supported at the time-of-release.
|
| 129 |
+
const char* pChipName;
|
| 130 |
+
/// [in] buffer with counter availability image - required for future chip support
|
| 131 |
+
const uint8_t* pCounterAvailabilityImage;
|
| 132 |
+
/// [out]
|
| 133 |
+
size_t scratchBufferSize;
|
| 134 |
+
} NVPW_CUDA_MetricsEvaluator_CalculateScratchBufferSize_Params;
|
| 135 |
+
#define NVPW_CUDA_MetricsEvaluator_CalculateScratchBufferSize_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_CUDA_MetricsEvaluator_CalculateScratchBufferSize_Params, scratchBufferSize)
|
| 136 |
+
|
| 137 |
+
/// Use either 'pChipName' or 'pCounterAvailabilityImage'.
|
| 138 |
+
NVPA_Status NVPW_CUDA_MetricsEvaluator_CalculateScratchBufferSize(NVPW_CUDA_MetricsEvaluator_CalculateScratchBufferSize_Params* pParams);
|
| 139 |
+
|
| 140 |
+
typedef struct NVPW_CUDA_MetricsEvaluator_Initialize_Params
|
| 141 |
+
{
|
| 142 |
+
/// [in]
|
| 143 |
+
size_t structSize;
|
| 144 |
+
/// [in] assign to NULL
|
| 145 |
+
void* pPriv;
|
| 146 |
+
/// [in]
|
| 147 |
+
uint8_t* pScratchBuffer;
|
| 148 |
+
/// [in] the size of the 'pScratchBuffer' array, should be at least the size of the 'scratchBufferSize' returned
|
| 149 |
+
/// by 'NVPW_CUDA_MetricsEvaluator_CalculateScratchBufferSize'
|
| 150 |
+
size_t scratchBufferSize;
|
| 151 |
+
/// [in] accepted for chips supported at the time-of-release.
|
| 152 |
+
const char* pChipName;
|
| 153 |
+
/// [in] buffer with counter availability image - required for future chip support
|
| 154 |
+
const uint8_t* pCounterAvailabilityImage;
|
| 155 |
+
/// [in]
|
| 156 |
+
const uint8_t* pCounterDataImage;
|
| 157 |
+
/// [in] must be provided if 'pCounterDataImage' is not NULL
|
| 158 |
+
size_t counterDataImageSize;
|
| 159 |
+
/// [out]
|
| 160 |
+
struct NVPW_MetricsEvaluator* pMetricsEvaluator;
|
| 161 |
+
} NVPW_CUDA_MetricsEvaluator_Initialize_Params;
|
| 162 |
+
#define NVPW_CUDA_MetricsEvaluator_Initialize_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_CUDA_MetricsEvaluator_Initialize_Params, pMetricsEvaluator)
|
| 163 |
+
|
| 164 |
+
/// Use one of 'pChipName', 'pCounterAvailabilityImage', or 'pCounterDataImage'. 'pChipName' or
|
| 165 |
+
/// 'pCounterAvailabilityImage' will create a metrics evaluator based on a virtual device while 'pCounterDataImage'
|
| 166 |
+
/// will create a metrics evaluator based on the actual device.
|
| 167 |
+
NVPA_Status NVPW_CUDA_MetricsEvaluator_Initialize(NVPW_CUDA_MetricsEvaluator_Initialize_Params* pParams);
|
| 168 |
+
|
| 169 |
+
|
| 170 |
+
|
| 171 |
+
#ifdef __cplusplus
|
| 172 |
+
} // extern "C"
|
| 173 |
+
#endif
|
| 174 |
+
|
| 175 |
+
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
| 176 |
+
#pragma GCC visibility pop
|
| 177 |
+
#endif
|
| 178 |
+
|
| 179 |
+
#endif // NVPERF_CUDA_HOST_H
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_cupti/include/nvperf_host.h
ADDED
|
@@ -0,0 +1,1152 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#ifndef NVPERF_HOST_H
|
| 2 |
+
#define NVPERF_HOST_H
|
| 3 |
+
|
| 4 |
+
/*
|
| 5 |
+
* Copyright 2014-2024 NVIDIA Corporation. All rights reserved.
|
| 6 |
+
*
|
| 7 |
+
* NOTICE TO USER:
|
| 8 |
+
*
|
| 9 |
+
* This source code is subject to NVIDIA ownership rights under U.S. and
|
| 10 |
+
* international Copyright laws.
|
| 11 |
+
*
|
| 12 |
+
* This software and the information contained herein is PROPRIETARY and
|
| 13 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
| 14 |
+
* of a form of NVIDIA software license agreement.
|
| 15 |
+
*
|
| 16 |
+
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
| 17 |
+
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
| 18 |
+
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
| 19 |
+
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
| 20 |
+
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 21 |
+
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
| 22 |
+
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
| 23 |
+
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
| 24 |
+
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
| 25 |
+
* OR PERFORMANCE OF THIS SOURCE CODE.
|
| 26 |
+
*
|
| 27 |
+
* U.S. Government End Users. This source code is a "commercial item" as
|
| 28 |
+
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
| 29 |
+
* "commercial computer software" and "commercial computer software
|
| 30 |
+
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
| 31 |
+
* and is provided to the U.S. Government only as a commercial end item.
|
| 32 |
+
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
| 33 |
+
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
| 34 |
+
* source code with only those rights set forth herein.
|
| 35 |
+
*
|
| 36 |
+
* Any use of this source code in individual and commercial software must
|
| 37 |
+
* include, in the user documentation and internal comments to the code,
|
| 38 |
+
* the above Disclaimer and U.S. Government End Users Notice.
|
| 39 |
+
*/
|
| 40 |
+
|
| 41 |
+
#include <stddef.h>
|
| 42 |
+
#include <stdint.h>
|
| 43 |
+
#include "nvperf_common.h"
|
| 44 |
+
|
| 45 |
+
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
| 46 |
+
#pragma GCC visibility push(default)
|
| 47 |
+
#if !defined(NVPW_LOCAL)
|
| 48 |
+
#define NVPW_LOCAL __attribute__ ((visibility ("hidden")))
|
| 49 |
+
#endif
|
| 50 |
+
#else
|
| 51 |
+
#if !defined(NVPW_LOCAL)
|
| 52 |
+
#define NVPW_LOCAL
|
| 53 |
+
#endif
|
| 54 |
+
#endif
|
| 55 |
+
|
| 56 |
+
#ifdef __cplusplus
|
| 57 |
+
extern "C" {
|
| 58 |
+
#endif
|
| 59 |
+
|
| 60 |
+
/**
|
| 61 |
+
* @file nvperf_host.h
|
| 62 |
+
*/
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
// Guard against multiple definition of NvPerf host types
|
| 66 |
+
#ifndef NVPERF_HOST_API_DEFINED
|
| 67 |
+
#define NVPERF_HOST_API_DEFINED
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
/***************************************************************************//**
|
| 71 |
+
* @name Host Configuration
|
| 72 |
+
* @{
|
| 73 |
+
*/
|
| 74 |
+
|
| 75 |
+
typedef struct NVPW_InitializeHost_Params
|
| 76 |
+
{
|
| 77 |
+
/// [in]
|
| 78 |
+
size_t structSize;
|
| 79 |
+
/// [in] assign to NULL
|
| 80 |
+
void* pPriv;
|
| 81 |
+
} NVPW_InitializeHost_Params;
|
| 82 |
+
#define NVPW_InitializeHost_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_InitializeHost_Params, pPriv)
|
| 83 |
+
|
| 84 |
+
/// Load the host library.
|
| 85 |
+
NVPA_Status NVPW_InitializeHost(NVPW_InitializeHost_Params* pParams);
|
| 86 |
+
|
| 87 |
+
typedef struct NVPW_CounterData_CalculateCounterDataImageCopySize_Params
|
| 88 |
+
{
|
| 89 |
+
/// [in]
|
| 90 |
+
size_t structSize;
|
| 91 |
+
/// [in] assign to NULL
|
| 92 |
+
void* pPriv;
|
| 93 |
+
/// The CounterDataPrefix generated from e.g. nvperf2 initdata or
|
| 94 |
+
/// NVPW_CounterDataBuilder_GetCounterDataPrefix(). Must be align(8).
|
| 95 |
+
const uint8_t* pCounterDataPrefix;
|
| 96 |
+
size_t counterDataPrefixSize;
|
| 97 |
+
/// max number of ranges that can be profiled
|
| 98 |
+
uint32_t maxNumRanges;
|
| 99 |
+
/// max number of RangeTree nodes; must be >= maxNumRanges
|
| 100 |
+
uint32_t maxNumRangeTreeNodes;
|
| 101 |
+
/// max string length of each RangeName, including the trailing NUL character
|
| 102 |
+
uint32_t maxRangeNameLength;
|
| 103 |
+
const uint8_t* pCounterDataSrc;
|
| 104 |
+
/// [out] required size of the copy buffer
|
| 105 |
+
size_t copyDataImageCounterSize;
|
| 106 |
+
} NVPW_CounterData_CalculateCounterDataImageCopySize_Params;
|
| 107 |
+
#define NVPW_CounterData_CalculateCounterDataImageCopySize_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_CounterData_CalculateCounterDataImageCopySize_Params, copyDataImageCounterSize)
|
| 108 |
+
|
| 109 |
+
NVPA_Status NVPW_CounterData_CalculateCounterDataImageCopySize(NVPW_CounterData_CalculateCounterDataImageCopySize_Params* pParams);
|
| 110 |
+
|
| 111 |
+
typedef struct NVPW_CounterData_InitializeCounterDataImageCopy_Params
|
| 112 |
+
{
|
| 113 |
+
/// [in]
|
| 114 |
+
size_t structSize;
|
| 115 |
+
/// [in] assign to NULL
|
| 116 |
+
void* pPriv;
|
| 117 |
+
/// The CounterDataPrefix generated from e.g. nvperf2 initdata or
|
| 118 |
+
/// NVPW_CounterDataBuilder_GetCounterDataPrefix(). Must be align(8).
|
| 119 |
+
const uint8_t* pCounterDataPrefix;
|
| 120 |
+
size_t counterDataPrefixSize;
|
| 121 |
+
/// max number of ranges that can be profiled
|
| 122 |
+
uint32_t maxNumRanges;
|
| 123 |
+
/// max number of RangeTree nodes; must be >= maxNumRanges
|
| 124 |
+
uint32_t maxNumRangeTreeNodes;
|
| 125 |
+
/// max string length of each RangeName, including the trailing NUL character
|
| 126 |
+
uint32_t maxRangeNameLength;
|
| 127 |
+
const uint8_t* pCounterDataSrc;
|
| 128 |
+
uint8_t* pCounterDataDst;
|
| 129 |
+
} NVPW_CounterData_InitializeCounterDataImageCopy_Params;
|
| 130 |
+
#define NVPW_CounterData_InitializeCounterDataImageCopy_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_CounterData_InitializeCounterDataImageCopy_Params, pCounterDataDst)
|
| 131 |
+
|
| 132 |
+
NVPA_Status NVPW_CounterData_InitializeCounterDataImageCopy(NVPW_CounterData_InitializeCounterDataImageCopy_Params* pParams);
|
| 133 |
+
|
| 134 |
+
typedef struct NVPW_CounterData_ExtractCounterDataPrefix_Params
|
| 135 |
+
{
|
| 136 |
+
/// [in]
|
| 137 |
+
size_t structSize;
|
| 138 |
+
/// [in] assign to NULL
|
| 139 |
+
void* pPriv;
|
| 140 |
+
/// The source buffer to extract the prefix from.
|
| 141 |
+
const uint8_t* pCounterDataSrc;
|
| 142 |
+
size_t counterDataSrcSize;
|
| 143 |
+
/// [in] If not NULL, the prefix will be copied into this buffer.
|
| 144 |
+
uint8_t* pCounterDataPrefix;
|
| 145 |
+
/// [inout] if 'pCounterDataPrefix' is NULL, size of counter data prefix will be returned; otherwise it should
|
| 146 |
+
/// be set to the size of buffer allocated for 'pCounterDataPrefix'.
|
| 147 |
+
size_t counterDataPrefixSize;
|
| 148 |
+
} NVPW_CounterData_ExtractCounterDataPrefix_Params;
|
| 149 |
+
#define NVPW_CounterData_ExtractCounterDataPrefix_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_CounterData_ExtractCounterDataPrefix_Params, counterDataPrefixSize)
|
| 150 |
+
|
| 151 |
+
NVPA_Status NVPW_CounterData_ExtractCounterDataPrefix(NVPW_CounterData_ExtractCounterDataPrefix_Params* pParams);
|
| 152 |
+
|
| 153 |
+
typedef struct NVPA_CounterDataCombiner NVPA_CounterDataCombiner;
|
| 154 |
+
|
| 155 |
+
typedef struct NVPW_CounterDataCombiner_Create_Params
|
| 156 |
+
{
|
| 157 |
+
/// [in]
|
| 158 |
+
size_t structSize;
|
| 159 |
+
/// [in] assign to NULL
|
| 160 |
+
void* pPriv;
|
| 161 |
+
/// The destination counter data into which the source datas will be combined
|
| 162 |
+
uint8_t* pCounterDataDst;
|
| 163 |
+
/// [out] The created counter data combiner
|
| 164 |
+
NVPA_CounterDataCombiner* pCounterDataCombiner;
|
| 165 |
+
} NVPW_CounterDataCombiner_Create_Params;
|
| 166 |
+
#define NVPW_CounterDataCombiner_Create_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_CounterDataCombiner_Create_Params, pCounterDataCombiner)
|
| 167 |
+
|
| 168 |
+
NVPA_Status NVPW_CounterDataCombiner_Create(NVPW_CounterDataCombiner_Create_Params* pParams);
|
| 169 |
+
|
| 170 |
+
typedef struct NVPW_CounterDataCombiner_Destroy_Params
|
| 171 |
+
{
|
| 172 |
+
/// [in]
|
| 173 |
+
size_t structSize;
|
| 174 |
+
/// [in] assign to NULL
|
| 175 |
+
void* pPriv;
|
| 176 |
+
NVPA_CounterDataCombiner* pCounterDataCombiner;
|
| 177 |
+
} NVPW_CounterDataCombiner_Destroy_Params;
|
| 178 |
+
#define NVPW_CounterDataCombiner_Destroy_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_CounterDataCombiner_Destroy_Params, pCounterDataCombiner)
|
| 179 |
+
|
| 180 |
+
NVPA_Status NVPW_CounterDataCombiner_Destroy(NVPW_CounterDataCombiner_Destroy_Params* pParams);
|
| 181 |
+
|
| 182 |
+
typedef struct NVPW_CounterDataCombiner_CreateRange_Params
|
| 183 |
+
{
|
| 184 |
+
/// [in]
|
| 185 |
+
size_t structSize;
|
| 186 |
+
/// [in] assign to NULL
|
| 187 |
+
void* pPriv;
|
| 188 |
+
NVPA_CounterDataCombiner* pCounterDataCombiner;
|
| 189 |
+
size_t numDescriptions;
|
| 190 |
+
const char* const* ppDescriptions;
|
| 191 |
+
/// [out]
|
| 192 |
+
size_t rangeIndexDst;
|
| 193 |
+
} NVPW_CounterDataCombiner_CreateRange_Params;
|
| 194 |
+
#define NVPW_CounterDataCombiner_CreateRange_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_CounterDataCombiner_CreateRange_Params, rangeIndexDst)
|
| 195 |
+
|
| 196 |
+
NVPA_Status NVPW_CounterDataCombiner_CreateRange(NVPW_CounterDataCombiner_CreateRange_Params* pParams);
|
| 197 |
+
|
| 198 |
+
typedef struct NVPW_CounterDataCombiner_CopyIntoRange_Params
|
| 199 |
+
{
|
| 200 |
+
/// [in]
|
| 201 |
+
size_t structSize;
|
| 202 |
+
/// [in] assign to NULL
|
| 203 |
+
void* pPriv;
|
| 204 |
+
/// [in]
|
| 205 |
+
NVPA_CounterDataCombiner* pCounterDataCombiner;
|
| 206 |
+
/// [in]
|
| 207 |
+
size_t rangeIndexDst;
|
| 208 |
+
/// [in]
|
| 209 |
+
const uint8_t* pCounterDataSrc;
|
| 210 |
+
/// [in]
|
| 211 |
+
size_t rangeIndexSrc;
|
| 212 |
+
} NVPW_CounterDataCombiner_CopyIntoRange_Params;
|
| 213 |
+
#define NVPW_CounterDataCombiner_CopyIntoRange_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_CounterDataCombiner_CopyIntoRange_Params, rangeIndexSrc)
|
| 214 |
+
|
| 215 |
+
/// In order to use this API, the source counter data and the destination counter data must have identical counters
|
| 216 |
+
NVPA_Status NVPW_CounterDataCombiner_CopyIntoRange(NVPW_CounterDataCombiner_CopyIntoRange_Params* pParams);
|
| 217 |
+
|
| 218 |
+
typedef struct NVPW_CounterDataCombiner_AccumulateIntoRange_Params
|
| 219 |
+
{
|
| 220 |
+
/// [in]
|
| 221 |
+
size_t structSize;
|
| 222 |
+
/// [in] assign to NULL
|
| 223 |
+
void* pPriv;
|
| 224 |
+
NVPA_CounterDataCombiner* pCounterDataCombiner;
|
| 225 |
+
size_t rangeIndexDst;
|
| 226 |
+
uint32_t dstMultiplier;
|
| 227 |
+
const uint8_t* pCounterDataSrc;
|
| 228 |
+
size_t rangeIndexSrc;
|
| 229 |
+
uint32_t srcMultiplier;
|
| 230 |
+
} NVPW_CounterDataCombiner_AccumulateIntoRange_Params;
|
| 231 |
+
#define NVPW_CounterDataCombiner_AccumulateIntoRange_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_CounterDataCombiner_AccumulateIntoRange_Params, srcMultiplier)
|
| 232 |
+
|
| 233 |
+
NVPA_Status NVPW_CounterDataCombiner_AccumulateIntoRange(NVPW_CounterDataCombiner_AccumulateIntoRange_Params* pParams);
|
| 234 |
+
|
| 235 |
+
typedef struct NVPW_CounterDataCombiner_SumIntoRange_Params
|
| 236 |
+
{
|
| 237 |
+
/// [in]
|
| 238 |
+
size_t structSize;
|
| 239 |
+
/// [in] assign to NULL
|
| 240 |
+
void* pPriv;
|
| 241 |
+
NVPA_CounterDataCombiner* pCounterDataCombiner;
|
| 242 |
+
size_t rangeIndexDst;
|
| 243 |
+
const uint8_t* pCounterDataSrc;
|
| 244 |
+
size_t rangeIndexSrc;
|
| 245 |
+
} NVPW_CounterDataCombiner_SumIntoRange_Params;
|
| 246 |
+
#define NVPW_CounterDataCombiner_SumIntoRange_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_CounterDataCombiner_SumIntoRange_Params, rangeIndexSrc)
|
| 247 |
+
|
| 248 |
+
NVPA_Status NVPW_CounterDataCombiner_SumIntoRange(NVPW_CounterDataCombiner_SumIntoRange_Params* pParams);
|
| 249 |
+
|
| 250 |
+
typedef struct NVPW_CounterDataCombiner_WeightedSumIntoRange_Params
|
| 251 |
+
{
|
| 252 |
+
/// [in]
|
| 253 |
+
size_t structSize;
|
| 254 |
+
/// [in] assign to NULL
|
| 255 |
+
void* pPriv;
|
| 256 |
+
NVPA_CounterDataCombiner* pCounterDataCombiner;
|
| 257 |
+
size_t rangeIndexDst;
|
| 258 |
+
double dstMultiplier;
|
| 259 |
+
const uint8_t* pCounterDataSrc;
|
| 260 |
+
size_t rangeIndexSrc;
|
| 261 |
+
double srcMultiplier;
|
| 262 |
+
} NVPW_CounterDataCombiner_WeightedSumIntoRange_Params;
|
| 263 |
+
#define NVPW_CounterDataCombiner_WeightedSumIntoRange_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_CounterDataCombiner_WeightedSumIntoRange_Params, srcMultiplier)
|
| 264 |
+
|
| 265 |
+
NVPA_Status NVPW_CounterDataCombiner_WeightedSumIntoRange(NVPW_CounterDataCombiner_WeightedSumIntoRange_Params* pParams);
|
| 266 |
+
|
| 267 |
+
/**
|
| 268 |
+
* @}
|
| 269 |
+
******************************************************************************/
|
| 270 |
+
|
| 271 |
+
/***************************************************************************//**
|
| 272 |
+
* @name Metrics Configuration
|
| 273 |
+
* @{
|
| 274 |
+
*/
|
| 275 |
+
|
| 276 |
+
typedef struct NVPA_RawMetricsConfig NVPA_RawMetricsConfig;
|
| 277 |
+
|
| 278 |
+
typedef struct NVPA_RawMetricRequest
|
| 279 |
+
{
|
| 280 |
+
/// [in]
|
| 281 |
+
size_t structSize;
|
| 282 |
+
/// [in] assign to NULL
|
| 283 |
+
void* pPriv;
|
| 284 |
+
/// in
|
| 285 |
+
const char* pMetricName;
|
| 286 |
+
/// in
|
| 287 |
+
NVPA_Bool isolated;
|
| 288 |
+
/// in; ignored by AddMetric but observed by CounterData initialization
|
| 289 |
+
NVPA_Bool keepInstances;
|
| 290 |
+
} NVPA_RawMetricRequest;
|
| 291 |
+
#define NVPA_RAW_METRIC_REQUEST_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPA_RawMetricRequest, keepInstances)
|
| 292 |
+
|
| 293 |
+
typedef struct NVPW_GetSupportedChipNames_Params
|
| 294 |
+
{
|
| 295 |
+
/// [in]
|
| 296 |
+
size_t structSize;
|
| 297 |
+
/// [in] assign to NULL
|
| 298 |
+
void* pPriv;
|
| 299 |
+
/// [out]
|
| 300 |
+
const char* const* ppChipNames;
|
| 301 |
+
/// [out]
|
| 302 |
+
size_t numChipNames;
|
| 303 |
+
} NVPW_GetSupportedChipNames_Params;
|
| 304 |
+
#define NVPW_GetSupportedChipNames_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_GetSupportedChipNames_Params, numChipNames)
|
| 305 |
+
|
| 306 |
+
NVPA_Status NVPW_GetSupportedChipNames(NVPW_GetSupportedChipNames_Params* pParams);
|
| 307 |
+
|
| 308 |
+
typedef struct NVPW_RawMetricsConfig_Destroy_Params
|
| 309 |
+
{
|
| 310 |
+
/// [in]
|
| 311 |
+
size_t structSize;
|
| 312 |
+
/// [in] assign to NULL
|
| 313 |
+
void* pPriv;
|
| 314 |
+
NVPA_RawMetricsConfig* pRawMetricsConfig;
|
| 315 |
+
} NVPW_RawMetricsConfig_Destroy_Params;
|
| 316 |
+
#define NVPW_RawMetricsConfig_Destroy_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_RawMetricsConfig_Destroy_Params, pRawMetricsConfig)
|
| 317 |
+
|
| 318 |
+
NVPA_Status NVPW_RawMetricsConfig_Destroy(NVPW_RawMetricsConfig_Destroy_Params* pParams);
|
| 319 |
+
|
| 320 |
+
typedef struct NVPW_RawMetricsConfig_SetCounterAvailability_Params
|
| 321 |
+
{
|
| 322 |
+
/// [in]
|
| 323 |
+
size_t structSize;
|
| 324 |
+
/// [in] assign to NULL
|
| 325 |
+
void* pPriv;
|
| 326 |
+
NVPA_RawMetricsConfig* pRawMetricsConfig;
|
| 327 |
+
/// [in] buffer with counter availability image
|
| 328 |
+
const uint8_t* pCounterAvailabilityImage;
|
| 329 |
+
} NVPW_RawMetricsConfig_SetCounterAvailability_Params;
|
| 330 |
+
#define NVPW_RawMetricsConfig_SetCounterAvailability_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_RawMetricsConfig_SetCounterAvailability_Params, pCounterAvailabilityImage)
|
| 331 |
+
|
| 332 |
+
NVPA_Status NVPW_RawMetricsConfig_SetCounterAvailability(NVPW_RawMetricsConfig_SetCounterAvailability_Params* pParams);
|
| 333 |
+
|
| 334 |
+
typedef struct NVPW_RawMetricsConfig_BeginPassGroup_Params
|
| 335 |
+
{
|
| 336 |
+
/// [in]
|
| 337 |
+
size_t structSize;
|
| 338 |
+
/// [in] assign to NULL
|
| 339 |
+
void* pPriv;
|
| 340 |
+
NVPA_RawMetricsConfig* pRawMetricsConfig;
|
| 341 |
+
size_t maxPassCount;
|
| 342 |
+
} NVPW_RawMetricsConfig_BeginPassGroup_Params;
|
| 343 |
+
#define NVPW_RawMetricsConfig_BeginPassGroup_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_RawMetricsConfig_BeginPassGroup_Params, maxPassCount)
|
| 344 |
+
|
| 345 |
+
NVPA_Status NVPW_RawMetricsConfig_BeginPassGroup(NVPW_RawMetricsConfig_BeginPassGroup_Params* pParams);
|
| 346 |
+
|
| 347 |
+
typedef struct NVPW_RawMetricsConfig_EndPassGroup_Params
|
| 348 |
+
{
|
| 349 |
+
/// [in]
|
| 350 |
+
size_t structSize;
|
| 351 |
+
/// [in] assign to NULL
|
| 352 |
+
void* pPriv;
|
| 353 |
+
NVPA_RawMetricsConfig* pRawMetricsConfig;
|
| 354 |
+
} NVPW_RawMetricsConfig_EndPassGroup_Params;
|
| 355 |
+
#define NVPW_RawMetricsConfig_EndPassGroup_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_RawMetricsConfig_EndPassGroup_Params, pRawMetricsConfig)
|
| 356 |
+
|
| 357 |
+
NVPA_Status NVPW_RawMetricsConfig_EndPassGroup(NVPW_RawMetricsConfig_EndPassGroup_Params* pParams);
|
| 358 |
+
|
| 359 |
+
typedef struct NVPW_RawMetricsConfig_GetNumMetrics_Params
|
| 360 |
+
{
|
| 361 |
+
/// [in]
|
| 362 |
+
size_t structSize;
|
| 363 |
+
/// [in] assign to NULL
|
| 364 |
+
void* pPriv;
|
| 365 |
+
const NVPA_RawMetricsConfig* pRawMetricsConfig;
|
| 366 |
+
/// [out]
|
| 367 |
+
size_t numMetrics;
|
| 368 |
+
} NVPW_RawMetricsConfig_GetNumMetrics_Params;
|
| 369 |
+
#define NVPW_RawMetricsConfig_GetNumMetrics_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_RawMetricsConfig_GetNumMetrics_Params, numMetrics)
|
| 370 |
+
|
| 371 |
+
NVPA_Status NVPW_RawMetricsConfig_GetNumMetrics(NVPW_RawMetricsConfig_GetNumMetrics_Params* pParams);
|
| 372 |
+
|
| 373 |
+
typedef struct NVPW_RawMetricsConfig_GetMetricProperties_Params
|
| 374 |
+
{
|
| 375 |
+
/// [in]
|
| 376 |
+
size_t structSize;
|
| 377 |
+
/// [in] assign to NULL
|
| 378 |
+
void* pPriv;
|
| 379 |
+
const NVPA_RawMetricsConfig* pRawMetricsConfig;
|
| 380 |
+
size_t metricIndex;
|
| 381 |
+
/// [out]
|
| 382 |
+
const char* pMetricName;
|
| 383 |
+
/// [out]
|
| 384 |
+
NVPA_Bool supportsPipelined;
|
| 385 |
+
/// [out]
|
| 386 |
+
NVPA_Bool supportsIsolated;
|
| 387 |
+
} NVPW_RawMetricsConfig_GetMetricProperties_Params;
|
| 388 |
+
#define NVPW_RawMetricsConfig_GetMetricProperties_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_RawMetricsConfig_GetMetricProperties_Params, supportsIsolated)
|
| 389 |
+
|
| 390 |
+
NVPA_Status NVPW_RawMetricsConfig_GetMetricProperties(NVPW_RawMetricsConfig_GetMetricProperties_Params* pParams);
|
| 391 |
+
|
| 392 |
+
typedef struct NVPW_RawMetricsConfig_GetMetricProperties_V2_Params
|
| 393 |
+
{
|
| 394 |
+
/// [in]
|
| 395 |
+
size_t structSize;
|
| 396 |
+
/// [in] assign to NULL
|
| 397 |
+
void* pPriv;
|
| 398 |
+
const NVPA_RawMetricsConfig* pRawMetricsConfig;
|
| 399 |
+
size_t metricIndex;
|
| 400 |
+
/// [out]
|
| 401 |
+
const char* pMetricName;
|
| 402 |
+
} NVPW_RawMetricsConfig_GetMetricProperties_V2_Params;
|
| 403 |
+
#define NVPW_RawMetricsConfig_GetMetricProperties_V2_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_RawMetricsConfig_GetMetricProperties_V2_Params, pMetricName)
|
| 404 |
+
|
| 405 |
+
NVPA_Status NVPW_RawMetricsConfig_GetMetricProperties_V2(NVPW_RawMetricsConfig_GetMetricProperties_V2_Params* pParams);
|
| 406 |
+
|
| 407 |
+
typedef struct NVPW_RawMetricsConfig_AddMetrics_Params
|
| 408 |
+
{
|
| 409 |
+
/// [in]
|
| 410 |
+
size_t structSize;
|
| 411 |
+
/// [in] assign to NULL
|
| 412 |
+
void* pPriv;
|
| 413 |
+
NVPA_RawMetricsConfig* pRawMetricsConfig;
|
| 414 |
+
const NVPA_RawMetricRequest* pRawMetricRequests;
|
| 415 |
+
size_t numMetricRequests;
|
| 416 |
+
} NVPW_RawMetricsConfig_AddMetrics_Params;
|
| 417 |
+
#define NVPW_RawMetricsConfig_AddMetrics_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_RawMetricsConfig_AddMetrics_Params, numMetricRequests)
|
| 418 |
+
|
| 419 |
+
NVPA_Status NVPW_RawMetricsConfig_AddMetrics(NVPW_RawMetricsConfig_AddMetrics_Params* pParams);
|
| 420 |
+
|
| 421 |
+
typedef struct NVPW_RawMetricsConfig_IsAddMetricsPossible_Params
|
| 422 |
+
{
|
| 423 |
+
/// [in]
|
| 424 |
+
size_t structSize;
|
| 425 |
+
/// [in] assign to NULL
|
| 426 |
+
void* pPriv;
|
| 427 |
+
const NVPA_RawMetricsConfig* pRawMetricsConfig;
|
| 428 |
+
const NVPA_RawMetricRequest* pRawMetricRequests;
|
| 429 |
+
size_t numMetricRequests;
|
| 430 |
+
/// [out]
|
| 431 |
+
NVPA_Bool isPossible;
|
| 432 |
+
} NVPW_RawMetricsConfig_IsAddMetricsPossible_Params;
|
| 433 |
+
#define NVPW_RawMetricsConfig_IsAddMetricsPossible_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_RawMetricsConfig_IsAddMetricsPossible_Params, isPossible)
|
| 434 |
+
|
| 435 |
+
NVPA_Status NVPW_RawMetricsConfig_IsAddMetricsPossible(NVPW_RawMetricsConfig_IsAddMetricsPossible_Params* pParams);
|
| 436 |
+
|
| 437 |
+
typedef struct NVPW_RawMetricsConfig_GenerateConfigImage_Params
|
| 438 |
+
{
|
| 439 |
+
/// [in]
|
| 440 |
+
size_t structSize;
|
| 441 |
+
/// [in] assign to NULL
|
| 442 |
+
void* pPriv;
|
| 443 |
+
NVPA_RawMetricsConfig* pRawMetricsConfig;
|
| 444 |
+
/// [in] If true, all existing pass groups may be merged to reduce number of passes.
|
| 445 |
+
/// If merge was successful, distribution of counters in passes may be updated as a side-effect. The effects
|
| 446 |
+
/// will be persistent in pRawMetricsConfig.
|
| 447 |
+
NVPA_Bool mergeAllPassGroups;
|
| 448 |
+
} NVPW_RawMetricsConfig_GenerateConfigImage_Params;
|
| 449 |
+
#define NVPW_RawMetricsConfig_GenerateConfigImage_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_RawMetricsConfig_GenerateConfigImage_Params, mergeAllPassGroups)
|
| 450 |
+
|
| 451 |
+
/// This API may fail if called inside a pass group with `mergeAllPassGroups` = true.
|
| 452 |
+
NVPA_Status NVPW_RawMetricsConfig_GenerateConfigImage(NVPW_RawMetricsConfig_GenerateConfigImage_Params* pParams);
|
| 453 |
+
|
| 454 |
+
typedef struct NVPW_RawMetricsConfig_GetConfigImage_Params
|
| 455 |
+
{
|
| 456 |
+
/// [in]
|
| 457 |
+
size_t structSize;
|
| 458 |
+
/// [in] assign to NULL
|
| 459 |
+
void* pPriv;
|
| 460 |
+
const NVPA_RawMetricsConfig* pRawMetricsConfig;
|
| 461 |
+
/// [in] Number of bytes allocated for pBuffer
|
| 462 |
+
size_t bytesAllocated;
|
| 463 |
+
/// [out] [optional] Buffer receiving the config image
|
| 464 |
+
uint8_t* pBuffer;
|
| 465 |
+
/// [out] Count of bytes that would be copied into pBuffer
|
| 466 |
+
size_t bytesCopied;
|
| 467 |
+
} NVPW_RawMetricsConfig_GetConfigImage_Params;
|
| 468 |
+
#define NVPW_RawMetricsConfig_GetConfigImage_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_RawMetricsConfig_GetConfigImage_Params, bytesCopied)
|
| 469 |
+
|
| 470 |
+
NVPA_Status NVPW_RawMetricsConfig_GetConfigImage(NVPW_RawMetricsConfig_GetConfigImage_Params* pParams);
|
| 471 |
+
|
| 472 |
+
typedef struct NVPW_RawMetricsConfig_GetNumPasses_Params
|
| 473 |
+
{
|
| 474 |
+
/// [in]
|
| 475 |
+
size_t structSize;
|
| 476 |
+
/// [in] assign to NULL
|
| 477 |
+
void* pPriv;
|
| 478 |
+
const NVPA_RawMetricsConfig* pRawMetricsConfig;
|
| 479 |
+
/// [out]
|
| 480 |
+
size_t numPipelinedPasses;
|
| 481 |
+
/// [out]
|
| 482 |
+
size_t numIsolatedPasses;
|
| 483 |
+
} NVPW_RawMetricsConfig_GetNumPasses_Params;
|
| 484 |
+
#define NVPW_RawMetricsConfig_GetNumPasses_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_RawMetricsConfig_GetNumPasses_Params, numIsolatedPasses)
|
| 485 |
+
|
| 486 |
+
/// Total num passes = numPipelinedPasses + numIsolatedPasses * numNestingLevels
|
| 487 |
+
NVPA_Status NVPW_RawMetricsConfig_GetNumPasses(NVPW_RawMetricsConfig_GetNumPasses_Params* pParams);
|
| 488 |
+
|
| 489 |
+
typedef struct NVPW_RawMetricsConfig_GetNumPasses_V2_Params
|
| 490 |
+
{
|
| 491 |
+
/// [in]
|
| 492 |
+
size_t structSize;
|
| 493 |
+
/// [in] assign to NULL
|
| 494 |
+
void* pPriv;
|
| 495 |
+
/// [in]
|
| 496 |
+
const NVPA_RawMetricsConfig* pRawMetricsConfig;
|
| 497 |
+
/// [out]
|
| 498 |
+
size_t numPasses;
|
| 499 |
+
} NVPW_RawMetricsConfig_GetNumPasses_V2_Params;
|
| 500 |
+
#define NVPW_RawMetricsConfig_GetNumPasses_V2_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_RawMetricsConfig_GetNumPasses_V2_Params, numPasses)
|
| 501 |
+
|
| 502 |
+
/// Total num passes = numPasses * numNestingLevels
|
| 503 |
+
NVPA_Status NVPW_RawMetricsConfig_GetNumPasses_V2(NVPW_RawMetricsConfig_GetNumPasses_V2_Params* pParams);
|
| 504 |
+
|
| 505 |
+
typedef struct NVPW_PeriodicSampler_Config_GetSocEstimatedSampleSize_Params
|
| 506 |
+
{
|
| 507 |
+
/// [in]
|
| 508 |
+
size_t structSize;
|
| 509 |
+
/// [in] assign to NULL
|
| 510 |
+
void* pPriv;
|
| 511 |
+
/// [in] Typically created by e.g. NVPW_RawMetricsConfig_GetConfigImage(), must be align(8).
|
| 512 |
+
const uint8_t* pConfig;
|
| 513 |
+
/// [in]
|
| 514 |
+
size_t configSize;
|
| 515 |
+
/// [out]
|
| 516 |
+
size_t sampleSize;
|
| 517 |
+
} NVPW_PeriodicSampler_Config_GetSocEstimatedSampleSize_Params;
|
| 518 |
+
#define NVPW_PeriodicSampler_Config_GetSocEstimatedSampleSize_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_PeriodicSampler_Config_GetSocEstimatedSampleSize_Params, sampleSize)
|
| 519 |
+
|
| 520 |
+
/// Estimate per sample records size based on a virtual device
|
| 521 |
+
NVPA_Status NVPW_PeriodicSampler_Config_GetSocEstimatedSampleSize(NVPW_PeriodicSampler_Config_GetSocEstimatedSampleSize_Params* pParams);
|
| 522 |
+
|
| 523 |
+
typedef struct NVPW_PeriodicSampler_Config_GetGpuEstimatedSampleSize_Params
|
| 524 |
+
{
|
| 525 |
+
/// [in]
|
| 526 |
+
size_t structSize;
|
| 527 |
+
/// [in] assign to NULL
|
| 528 |
+
void* pPriv;
|
| 529 |
+
/// [in] Typically created by e.g. NVPW_RawMetricsConfig_GetConfigImage(), must be align(8).
|
| 530 |
+
const uint8_t* pConfig;
|
| 531 |
+
/// [in]
|
| 532 |
+
size_t configSize;
|
| 533 |
+
/// [out]
|
| 534 |
+
size_t sampleSize;
|
| 535 |
+
} NVPW_PeriodicSampler_Config_GetGpuEstimatedSampleSize_Params;
|
| 536 |
+
#define NVPW_PeriodicSampler_Config_GetGpuEstimatedSampleSize_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_PeriodicSampler_Config_GetGpuEstimatedSampleSize_Params, sampleSize)
|
| 537 |
+
|
| 538 |
+
/// Estimate per sample records size based on a virtual device
|
| 539 |
+
NVPA_Status NVPW_PeriodicSampler_Config_GetGpuEstimatedSampleSize(NVPW_PeriodicSampler_Config_GetGpuEstimatedSampleSize_Params* pParams);
|
| 540 |
+
|
| 541 |
+
/**
|
| 542 |
+
* @}
|
| 543 |
+
******************************************************************************/
|
| 544 |
+
|
| 545 |
+
typedef struct NVPW_Config_GetRawCounterInfo_Params
|
| 546 |
+
{
|
| 547 |
+
/// [in]
|
| 548 |
+
size_t structSize;
|
| 549 |
+
/// [in] assign to NULL
|
| 550 |
+
void* pPriv;
|
| 551 |
+
/// [in]
|
| 552 |
+
const uint8_t* pConfig;
|
| 553 |
+
/// [in]
|
| 554 |
+
size_t configSize;
|
| 555 |
+
/// [in]
|
| 556 |
+
const char* pRawCounterName;
|
| 557 |
+
/// [inout] array containing indices of passes the counter resides in. 'pPassIndices' is in, '*pPassIndices' is
|
| 558 |
+
/// out.
|
| 559 |
+
size_t* pPassIndices;
|
| 560 |
+
/// [inout] if 'pPassIndices' is NULL, the count of passes this counter resides in will be returned; otherwise
|
| 561 |
+
/// it should be set to the capacity of 'pPassIndices' array, and on return, it will be overwritten to reflect
|
| 562 |
+
/// the actual count filled into 'pPassIndices'
|
| 563 |
+
size_t numPassIndices;
|
| 564 |
+
} NVPW_Config_GetRawCounterInfo_Params;
|
| 565 |
+
#define NVPW_Config_GetRawCounterInfo_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_Config_GetRawCounterInfo_Params, numPassIndices)
|
| 566 |
+
|
| 567 |
+
NVPA_Status NVPW_Config_GetRawCounterInfo(NVPW_Config_GetRawCounterInfo_Params* pParams);
|
| 568 |
+
|
| 569 |
+
typedef struct NVPW_Config_GetRawCounters_Params
|
| 570 |
+
{
|
| 571 |
+
/// [in]
|
| 572 |
+
size_t structSize;
|
| 573 |
+
/// [in] assign to NULL
|
| 574 |
+
void* pPriv;
|
| 575 |
+
/// [in]
|
| 576 |
+
const uint8_t* pConfig;
|
| 577 |
+
/// [in]
|
| 578 |
+
size_t configSize;
|
| 579 |
+
/// [in]
|
| 580 |
+
size_t passIndex;
|
| 581 |
+
/// [inout] array containing raw counter names. 'ppRawCounterNames' is in, '*ppRawCounterNames' is out.
|
| 582 |
+
const char** ppRawCounterNames;
|
| 583 |
+
/// [inout] if 'ppRawCounterNames' is NULL, the count of raw counters will be returned; otherwise it should be
|
| 584 |
+
/// set to the capacity of 'ppRawCounterNames' array, and on return, it will be overwritten to reflect the
|
| 585 |
+
/// actual count filled into 'ppRawCounterNames'
|
| 586 |
+
size_t numRawCounters;
|
| 587 |
+
} NVPW_Config_GetRawCounters_Params;
|
| 588 |
+
#define NVPW_Config_GetRawCounters_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_Config_GetRawCounters_Params, numRawCounters)
|
| 589 |
+
|
| 590 |
+
NVPA_Status NVPW_Config_GetRawCounters(NVPW_Config_GetRawCounters_Params* pParams);
|
| 591 |
+
|
| 592 |
+
/***************************************************************************//**
|
| 593 |
+
* @name CounterData Creation
|
| 594 |
+
* @{
|
| 595 |
+
*/
|
| 596 |
+
|
| 597 |
+
typedef struct NVPA_CounterDataBuilder NVPA_CounterDataBuilder;
|
| 598 |
+
|
| 599 |
+
typedef struct NVPW_CounterDataBuilder_Create_Params
|
| 600 |
+
{
|
| 601 |
+
/// [in]
|
| 602 |
+
size_t structSize;
|
| 603 |
+
/// [in] assign to NULL
|
| 604 |
+
void* pPriv;
|
| 605 |
+
/// [out]
|
| 606 |
+
NVPA_CounterDataBuilder* pCounterDataBuilder;
|
| 607 |
+
const char* pChipName;
|
| 608 |
+
} NVPW_CounterDataBuilder_Create_Params;
|
| 609 |
+
#define NVPW_CounterDataBuilder_Create_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_CounterDataBuilder_Create_Params, pChipName)
|
| 610 |
+
|
| 611 |
+
NVPA_Status NVPW_CounterDataBuilder_Create(NVPW_CounterDataBuilder_Create_Params* pParams);
|
| 612 |
+
|
| 613 |
+
typedef struct NVPW_CounterDataBuilder_Destroy_Params
|
| 614 |
+
{
|
| 615 |
+
/// [in]
|
| 616 |
+
size_t structSize;
|
| 617 |
+
/// [in] assign to NULL
|
| 618 |
+
void* pPriv;
|
| 619 |
+
NVPA_CounterDataBuilder* pCounterDataBuilder;
|
| 620 |
+
} NVPW_CounterDataBuilder_Destroy_Params;
|
| 621 |
+
#define NVPW_CounterDataBuilder_Destroy_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_CounterDataBuilder_Destroy_Params, pCounterDataBuilder)
|
| 622 |
+
|
| 623 |
+
NVPA_Status NVPW_CounterDataBuilder_Destroy(NVPW_CounterDataBuilder_Destroy_Params* pParams);
|
| 624 |
+
|
| 625 |
+
typedef struct NVPW_CounterDataBuilder_AddMetrics_Params
|
| 626 |
+
{
|
| 627 |
+
/// [in]
|
| 628 |
+
size_t structSize;
|
| 629 |
+
/// [in] assign to NULL
|
| 630 |
+
void* pPriv;
|
| 631 |
+
NVPA_CounterDataBuilder* pCounterDataBuilder;
|
| 632 |
+
const NVPA_RawMetricRequest* pRawMetricRequests;
|
| 633 |
+
size_t numMetricRequests;
|
| 634 |
+
} NVPW_CounterDataBuilder_AddMetrics_Params;
|
| 635 |
+
#define NVPW_CounterDataBuilder_AddMetrics_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_CounterDataBuilder_AddMetrics_Params, numMetricRequests)
|
| 636 |
+
|
| 637 |
+
NVPA_Status NVPW_CounterDataBuilder_AddMetrics(NVPW_CounterDataBuilder_AddMetrics_Params* pParams);
|
| 638 |
+
|
| 639 |
+
typedef struct NVPW_CounterDataBuilder_GetCounterDataPrefix_Params
|
| 640 |
+
{
|
| 641 |
+
/// [in]
|
| 642 |
+
size_t structSize;
|
| 643 |
+
/// [in] assign to NULL
|
| 644 |
+
void* pPriv;
|
| 645 |
+
NVPA_CounterDataBuilder* pCounterDataBuilder;
|
| 646 |
+
/// [in] Number of bytes allocated for pBuffer
|
| 647 |
+
size_t bytesAllocated;
|
| 648 |
+
/// [out] [optional] Buffer receiving the counter data prefix
|
| 649 |
+
uint8_t* pBuffer;
|
| 650 |
+
/// [out] Count of bytes that would be copied to pBuffer
|
| 651 |
+
size_t bytesCopied;
|
| 652 |
+
} NVPW_CounterDataBuilder_GetCounterDataPrefix_Params;
|
| 653 |
+
#define NVPW_CounterDataBuilder_GetCounterDataPrefix_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_CounterDataBuilder_GetCounterDataPrefix_Params, bytesCopied)
|
| 654 |
+
|
| 655 |
+
NVPA_Status NVPW_CounterDataBuilder_GetCounterDataPrefix(NVPW_CounterDataBuilder_GetCounterDataPrefix_Params* pParams);
|
| 656 |
+
|
| 657 |
+
/**
|
| 658 |
+
* @}
|
| 659 |
+
******************************************************************************/
|
| 660 |
+
|
| 661 |
+
/***************************************************************************//**
|
| 662 |
+
* @name Metrics Evaluator
|
| 663 |
+
* @{
|
| 664 |
+
*/
|
| 665 |
+
|
| 666 |
+
typedef struct NVPW_MetricsEvaluator NVPW_MetricsEvaluator;
|
| 667 |
+
|
| 668 |
+
#ifndef NVPW_DIM_UNIT_DEFINED
|
| 669 |
+
#define NVPW_DIM_UNIT_DEFINED
|
| 670 |
+
typedef enum NVPW_DimUnitName
|
| 671 |
+
{
|
| 672 |
+
NVPW_DIM_UNIT_INVALID = 3518299157,
|
| 673 |
+
NVPW_DIM_UNIT_UNITLESS = 2126137902,
|
| 674 |
+
NVPW_DIM_UNIT_ATTRIBUTES = 3776338729,
|
| 675 |
+
NVPW_DIM_UNIT_BYTES = 3797850191,
|
| 676 |
+
NVPW_DIM_UNIT_CTAS = 1960564139,
|
| 677 |
+
NVPW_DIM_UNIT_CTC_CYCLES = 2224883873,
|
| 678 |
+
NVPW_DIM_UNIT_DRAM_CYCLES = 2650981327,
|
| 679 |
+
NVPW_DIM_UNIT_FBP_CYCLES = 1785238957,
|
| 680 |
+
NVPW_DIM_UNIT_FE_OPS = 2919159083,
|
| 681 |
+
NVPW_DIM_UNIT_GPC_CYCLES = 1222631184,
|
| 682 |
+
NVPW_DIM_UNIT_IDC_REQUESTS = 2012649669,
|
| 683 |
+
NVPW_DIM_UNIT_INSTRUCTIONS = 1418625543,
|
| 684 |
+
NVPW_DIM_UNIT_KILOBYTES = 1335980302,
|
| 685 |
+
NVPW_DIM_UNIT_L1DATA_BANK_ACCESSES = 1479493682,
|
| 686 |
+
NVPW_DIM_UNIT_L1DATA_BANK_CONFLICTS = 3433170787,
|
| 687 |
+
NVPW_DIM_UNIT_L1TEX_REQUESTS = 1306473767,
|
| 688 |
+
NVPW_DIM_UNIT_L1TEX_TAGS = 26573010,
|
| 689 |
+
NVPW_DIM_UNIT_L1TEX_WAVEFRONTS = 129373765,
|
| 690 |
+
NVPW_DIM_UNIT_L2_REQUESTS = 1143695106,
|
| 691 |
+
NVPW_DIM_UNIT_L2_SECTORS = 3424101564,
|
| 692 |
+
NVPW_DIM_UNIT_L2_TAGS = 3755612781,
|
| 693 |
+
NVPW_DIM_UNIT_MCC_CYCLES = 1826685787,
|
| 694 |
+
NVPW_DIM_UNIT_NANOSECONDS = 3047500672,
|
| 695 |
+
NVPW_DIM_UNIT_NVLRX_CYCLES = 4059934930,
|
| 696 |
+
NVPW_DIM_UNIT_NVLTX_CYCLES = 1814350488,
|
| 697 |
+
NVPW_DIM_UNIT_PCIE_CYCLES = 1230450943,
|
| 698 |
+
NVPW_DIM_UNIT_PERCENT = 1284354694,
|
| 699 |
+
NVPW_DIM_UNIT_PIXELS = 4227616663,
|
| 700 |
+
NVPW_DIM_UNIT_PIXEL_SHADER_BARRIERS = 3705502518,
|
| 701 |
+
NVPW_DIM_UNIT_PRIMITIVES = 2373084002,
|
| 702 |
+
NVPW_DIM_UNIT_QUADS = 1539753497,
|
| 703 |
+
NVPW_DIM_UNIT_REGISTERS = 2837260947,
|
| 704 |
+
NVPW_DIM_UNIT_SAMPLES = 746046551,
|
| 705 |
+
NVPW_DIM_UNIT_SECONDS = 1164825258,
|
| 706 |
+
NVPW_DIM_UNIT_SYS_CYCLES = 3310821688,
|
| 707 |
+
NVPW_DIM_UNIT_TEXELS = 1293214069,
|
| 708 |
+
NVPW_DIM_UNIT_THREADS = 164261907,
|
| 709 |
+
NVPW_DIM_UNIT_VERTICES = 1873662209,
|
| 710 |
+
NVPW_DIM_UNIT_WARPS = 97951949,
|
| 711 |
+
NVPW_DIM_UNIT_WORKLOADS = 1728142656
|
| 712 |
+
} NVPW_DimUnitName;
|
| 713 |
+
#endif //NVPW_DIM_UNIT_DEFINED
|
| 714 |
+
|
| 715 |
+
#ifndef NVPW_HW_UNIT_DEFINED
|
| 716 |
+
#define NVPW_HW_UNIT_DEFINED
|
| 717 |
+
typedef enum NVPW_HwUnit
|
| 718 |
+
{
|
| 719 |
+
NVPW_HW_UNIT_INVALID = 3498035701,
|
| 720 |
+
NVPW_HW_UNIT_CROP = 2872137846,
|
| 721 |
+
NVPW_HW_UNIT_DRAM = 1662616918,
|
| 722 |
+
NVPW_HW_UNIT_DRAMC = 1401232876,
|
| 723 |
+
NVPW_HW_UNIT_FBP = 2947194306,
|
| 724 |
+
NVPW_HW_UNIT_FBPA = 690045803,
|
| 725 |
+
NVPW_HW_UNIT_FE = 2204924321,
|
| 726 |
+
NVPW_HW_UNIT_GPC = 1911735839,
|
| 727 |
+
NVPW_HW_UNIT_GPU = 1014363534,
|
| 728 |
+
NVPW_HW_UNIT_GR = 2933618517,
|
| 729 |
+
NVPW_HW_UNIT_IDC = 842765289,
|
| 730 |
+
NVPW_HW_UNIT_L1TEX = 893940957,
|
| 731 |
+
NVPW_HW_UNIT_LTS = 2333266697,
|
| 732 |
+
NVPW_HW_UNIT_MCC = 3980130194,
|
| 733 |
+
NVPW_HW_UNIT_NVLRX = 3091684901,
|
| 734 |
+
NVPW_HW_UNIT_NVLTX = 869679659,
|
| 735 |
+
NVPW_HW_UNIT_PCIE = 3433264174,
|
| 736 |
+
NVPW_HW_UNIT_PDA = 345193251,
|
| 737 |
+
NVPW_HW_UNIT_PES = 804128425,
|
| 738 |
+
NVPW_HW_UNIT_PROP = 3339255507,
|
| 739 |
+
NVPW_HW_UNIT_RASTER = 187932504,
|
| 740 |
+
NVPW_HW_UNIT_SM = 724224710,
|
| 741 |
+
NVPW_HW_UNIT_SMSP = 2837616917,
|
| 742 |
+
NVPW_HW_UNIT_SYS = 768990063,
|
| 743 |
+
NVPW_HW_UNIT_TPC = 1889024613,
|
| 744 |
+
NVPW_HW_UNIT_VAF = 753670509,
|
| 745 |
+
NVPW_HW_UNIT_VPC = 275561583,
|
| 746 |
+
NVPW_HW_UNIT_ZROP = 979500456
|
| 747 |
+
} NVPW_HwUnit;
|
| 748 |
+
#endif //NVPW_HW_UNIT_DEFINED
|
| 749 |
+
|
| 750 |
+
typedef enum NVPW_RollupOp
|
| 751 |
+
{
|
| 752 |
+
NVPW_ROLLUP_OP_AVG = 0,
|
| 753 |
+
NVPW_ROLLUP_OP_MAX,
|
| 754 |
+
NVPW_ROLLUP_OP_MIN,
|
| 755 |
+
NVPW_ROLLUP_OP_SUM,
|
| 756 |
+
NVPW_ROLLUP_OP__COUNT
|
| 757 |
+
} NVPW_RollupOp;
|
| 758 |
+
|
| 759 |
+
typedef enum NVPW_MetricType
|
| 760 |
+
{
|
| 761 |
+
NVPW_METRIC_TYPE_COUNTER = 0,
|
| 762 |
+
NVPW_METRIC_TYPE_RATIO,
|
| 763 |
+
NVPW_METRIC_TYPE_THROUGHPUT,
|
| 764 |
+
NVPW_METRIC_TYPE__COUNT
|
| 765 |
+
} NVPW_MetricType;
|
| 766 |
+
|
| 767 |
+
typedef enum NVPW_Submetric
|
| 768 |
+
{
|
| 769 |
+
NVPW_SUBMETRIC_NONE = 0,
|
| 770 |
+
NVPW_SUBMETRIC_PEAK_SUSTAINED = 1,
|
| 771 |
+
NVPW_SUBMETRIC_PEAK_SUSTAINED_ACTIVE = 2,
|
| 772 |
+
NVPW_SUBMETRIC_PEAK_SUSTAINED_ACTIVE_PER_SECOND = 3,
|
| 773 |
+
NVPW_SUBMETRIC_PEAK_SUSTAINED_ELAPSED = 4,
|
| 774 |
+
NVPW_SUBMETRIC_PEAK_SUSTAINED_ELAPSED_PER_SECOND = 5,
|
| 775 |
+
NVPW_SUBMETRIC_PEAK_SUSTAINED_FRAME = 6,
|
| 776 |
+
NVPW_SUBMETRIC_PEAK_SUSTAINED_FRAME_PER_SECOND = 7,
|
| 777 |
+
NVPW_SUBMETRIC_PEAK_SUSTAINED_REGION = 8,
|
| 778 |
+
NVPW_SUBMETRIC_PEAK_SUSTAINED_REGION_PER_SECOND = 9,
|
| 779 |
+
NVPW_SUBMETRIC_PER_CYCLE_ACTIVE = 10,
|
| 780 |
+
NVPW_SUBMETRIC_PER_CYCLE_ELAPSED = 11,
|
| 781 |
+
NVPW_SUBMETRIC_PER_CYCLE_IN_FRAME = 12,
|
| 782 |
+
NVPW_SUBMETRIC_PER_CYCLE_IN_REGION = 13,
|
| 783 |
+
NVPW_SUBMETRIC_PER_SECOND = 14,
|
| 784 |
+
NVPW_SUBMETRIC_PCT_OF_PEAK_SUSTAINED_ACTIVE = 15,
|
| 785 |
+
NVPW_SUBMETRIC_PCT_OF_PEAK_SUSTAINED_ELAPSED = 16,
|
| 786 |
+
NVPW_SUBMETRIC_PCT_OF_PEAK_SUSTAINED_FRAME = 17,
|
| 787 |
+
NVPW_SUBMETRIC_PCT_OF_PEAK_SUSTAINED_REGION = 18,
|
| 788 |
+
NVPW_SUBMETRIC_MAX_RATE = 19,
|
| 789 |
+
NVPW_SUBMETRIC_PCT = 20,
|
| 790 |
+
NVPW_SUBMETRIC_RATIO = 21,
|
| 791 |
+
NVPW_SUBMETRIC__COUNT
|
| 792 |
+
} NVPW_Submetric;
|
| 793 |
+
|
| 794 |
+
typedef struct NVPW_MetricEvalRequest
|
| 795 |
+
{
|
| 796 |
+
/// the metric index as in 'NVPW_MetricsEvaluator_GetMetricNames'
|
| 797 |
+
size_t metricIndex;
|
| 798 |
+
/// one of 'NVPW_MetricType'
|
| 799 |
+
uint8_t metricType;
|
| 800 |
+
/// one of 'NVPW_RollupOp', required for Counter and Throughput, doesn't apply to Ratio
|
| 801 |
+
uint8_t rollupOp;
|
| 802 |
+
/// one of 'NVPW_Submetric', required for Ratio and Throughput, optional for Counter
|
| 803 |
+
uint16_t submetric;
|
| 804 |
+
} NVPW_MetricEvalRequest;
|
| 805 |
+
#define NVPW_MetricEvalRequest_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_MetricEvalRequest, submetric)
|
| 806 |
+
|
| 807 |
+
typedef struct NVPW_DimUnitFactor
|
| 808 |
+
{
|
| 809 |
+
/// one of 'NVPW_DimUnitName'
|
| 810 |
+
uint32_t dimUnit;
|
| 811 |
+
int8_t exponent;
|
| 812 |
+
} NVPW_DimUnitFactor;
|
| 813 |
+
#define NVPW_DimUnitFactor_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_DimUnitFactor, exponent)
|
| 814 |
+
|
| 815 |
+
typedef struct NVPW_MetricsEvaluator_Destroy_Params
|
| 816 |
+
{
|
| 817 |
+
/// [in]
|
| 818 |
+
size_t structSize;
|
| 819 |
+
/// [in] assign to NULL
|
| 820 |
+
void* pPriv;
|
| 821 |
+
/// [in]
|
| 822 |
+
struct NVPW_MetricsEvaluator* pMetricsEvaluator;
|
| 823 |
+
} NVPW_MetricsEvaluator_Destroy_Params;
|
| 824 |
+
#define NVPW_MetricsEvaluator_Destroy_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_Destroy_Params, pMetricsEvaluator)
|
| 825 |
+
|
| 826 |
+
NVPA_Status NVPW_MetricsEvaluator_Destroy(NVPW_MetricsEvaluator_Destroy_Params* pParams);
|
| 827 |
+
|
| 828 |
+
typedef struct NVPW_MetricsEvaluator_GetMetricNames_Params
|
| 829 |
+
{
|
| 830 |
+
/// [in]
|
| 831 |
+
size_t structSize;
|
| 832 |
+
/// [in] assign to NULL
|
| 833 |
+
void* pPriv;
|
| 834 |
+
/// [in]
|
| 835 |
+
struct NVPW_MetricsEvaluator* pMetricsEvaluator;
|
| 836 |
+
/// [in] one of 'NVPW_MetricType'
|
| 837 |
+
uint8_t metricType;
|
| 838 |
+
/// [out]
|
| 839 |
+
const char* pMetricNames;
|
| 840 |
+
/// [out]
|
| 841 |
+
const size_t* pMetricNameBeginIndices;
|
| 842 |
+
/// [out]
|
| 843 |
+
size_t numMetrics;
|
| 844 |
+
} NVPW_MetricsEvaluator_GetMetricNames_Params;
|
| 845 |
+
#define NVPW_MetricsEvaluator_GetMetricNames_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_GetMetricNames_Params, numMetrics)
|
| 846 |
+
|
| 847 |
+
NVPA_Status NVPW_MetricsEvaluator_GetMetricNames(NVPW_MetricsEvaluator_GetMetricNames_Params* pParams);
|
| 848 |
+
|
| 849 |
+
typedef struct NVPW_MetricsEvaluator_GetMetricTypeAndIndex_Params
|
| 850 |
+
{
|
| 851 |
+
/// [in]
|
| 852 |
+
size_t structSize;
|
| 853 |
+
/// [in] assign to NULL
|
| 854 |
+
void* pPriv;
|
| 855 |
+
/// [in]
|
| 856 |
+
struct NVPW_MetricsEvaluator* pMetricsEvaluator;
|
| 857 |
+
/// [in] can be either a base metric or a metric
|
| 858 |
+
const char* pMetricName;
|
| 859 |
+
/// [out] one of 'NVPW_MetricType'
|
| 860 |
+
uint8_t metricType;
|
| 861 |
+
/// [out] the metric index as in 'NVPW_MetricsEvaluator_GetMetricNames'
|
| 862 |
+
size_t metricIndex;
|
| 863 |
+
} NVPW_MetricsEvaluator_GetMetricTypeAndIndex_Params;
|
| 864 |
+
#define NVPW_MetricsEvaluator_GetMetricTypeAndIndex_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_GetMetricTypeAndIndex_Params, metricIndex)
|
| 865 |
+
|
| 866 |
+
NVPA_Status NVPW_MetricsEvaluator_GetMetricTypeAndIndex(NVPW_MetricsEvaluator_GetMetricTypeAndIndex_Params* pParams);
|
| 867 |
+
|
| 868 |
+
typedef struct NVPW_MetricsEvaluator_ConvertMetricNameToMetricEvalRequest_Params
|
| 869 |
+
{
|
| 870 |
+
/// [in]
|
| 871 |
+
size_t structSize;
|
| 872 |
+
/// [in] assign to NULL
|
| 873 |
+
void* pPriv;
|
| 874 |
+
/// [in]
|
| 875 |
+
struct NVPW_MetricsEvaluator* pMetricsEvaluator;
|
| 876 |
+
/// [in]
|
| 877 |
+
const char* pMetricName;
|
| 878 |
+
/// [inout] 'pMetricEvalRequest' is in, '*pMetricEvalRequest' is out
|
| 879 |
+
struct NVPW_MetricEvalRequest* pMetricEvalRequest;
|
| 880 |
+
/// [in] set to 'NVPW_MetricEvalRequest_STRUCT_SIZE'
|
| 881 |
+
size_t metricEvalRequestStructSize;
|
| 882 |
+
} NVPW_MetricsEvaluator_ConvertMetricNameToMetricEvalRequest_Params;
|
| 883 |
+
#define NVPW_MetricsEvaluator_ConvertMetricNameToMetricEvalRequest_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_ConvertMetricNameToMetricEvalRequest_Params, metricEvalRequestStructSize)
|
| 884 |
+
|
| 885 |
+
NVPA_Status NVPW_MetricsEvaluator_ConvertMetricNameToMetricEvalRequest(NVPW_MetricsEvaluator_ConvertMetricNameToMetricEvalRequest_Params* pParams);
|
| 886 |
+
|
| 887 |
+
typedef struct NVPW_MetricsEvaluator_HwUnitToString_Params
|
| 888 |
+
{
|
| 889 |
+
/// [in]
|
| 890 |
+
size_t structSize;
|
| 891 |
+
/// [in] assign to NULL
|
| 892 |
+
void* pPriv;
|
| 893 |
+
/// [in]
|
| 894 |
+
struct NVPW_MetricsEvaluator* pMetricsEvaluator;
|
| 895 |
+
/// [in] one of 'NVPW_HwUnit'
|
| 896 |
+
uint32_t hwUnit;
|
| 897 |
+
/// [out]
|
| 898 |
+
const char* pHwUnitName;
|
| 899 |
+
} NVPW_MetricsEvaluator_HwUnitToString_Params;
|
| 900 |
+
#define NVPW_MetricsEvaluator_HwUnitToString_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_HwUnitToString_Params, pHwUnitName)
|
| 901 |
+
|
| 902 |
+
NVPA_Status NVPW_MetricsEvaluator_HwUnitToString(NVPW_MetricsEvaluator_HwUnitToString_Params* pParams);
|
| 903 |
+
|
| 904 |
+
typedef struct NVPW_MetricsEvaluator_GetCounterProperties_Params
|
| 905 |
+
{
|
| 906 |
+
/// [in]
|
| 907 |
+
size_t structSize;
|
| 908 |
+
/// [in] assign to NULL
|
| 909 |
+
void* pPriv;
|
| 910 |
+
/// [in]
|
| 911 |
+
struct NVPW_MetricsEvaluator* pMetricsEvaluator;
|
| 912 |
+
/// [in] the metric index as in 'NVPW_MetricsEvaluator_GetMetricNames'
|
| 913 |
+
size_t counterIndex;
|
| 914 |
+
/// [out]
|
| 915 |
+
const char* pDescription;
|
| 916 |
+
/// [out] one of 'NVPW_HwUnit'
|
| 917 |
+
uint32_t hwUnit;
|
| 918 |
+
} NVPW_MetricsEvaluator_GetCounterProperties_Params;
|
| 919 |
+
#define NVPW_MetricsEvaluator_GetCounterProperties_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_GetCounterProperties_Params, hwUnit)
|
| 920 |
+
|
| 921 |
+
NVPA_Status NVPW_MetricsEvaluator_GetCounterProperties(NVPW_MetricsEvaluator_GetCounterProperties_Params* pParams);
|
| 922 |
+
|
| 923 |
+
typedef struct NVPW_MetricsEvaluator_GetRatioMetricProperties_Params
|
| 924 |
+
{
|
| 925 |
+
/// [in]
|
| 926 |
+
size_t structSize;
|
| 927 |
+
/// [in] assign to NULL
|
| 928 |
+
void* pPriv;
|
| 929 |
+
/// [in]
|
| 930 |
+
struct NVPW_MetricsEvaluator* pMetricsEvaluator;
|
| 931 |
+
/// [in] the metric index as in 'NVPW_MetricsEvaluator_GetMetricNames'
|
| 932 |
+
size_t ratioMetricIndex;
|
| 933 |
+
/// [out]
|
| 934 |
+
const char* pDescription;
|
| 935 |
+
/// [out]
|
| 936 |
+
uint64_t hwUnit;
|
| 937 |
+
} NVPW_MetricsEvaluator_GetRatioMetricProperties_Params;
|
| 938 |
+
#define NVPW_MetricsEvaluator_GetRatioMetricProperties_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_GetRatioMetricProperties_Params, hwUnit)
|
| 939 |
+
|
| 940 |
+
NVPA_Status NVPW_MetricsEvaluator_GetRatioMetricProperties(NVPW_MetricsEvaluator_GetRatioMetricProperties_Params* pParams);
|
| 941 |
+
|
| 942 |
+
typedef struct NVPW_MetricsEvaluator_GetThroughputMetricProperties_Params
|
| 943 |
+
{
|
| 944 |
+
/// [in]
|
| 945 |
+
size_t structSize;
|
| 946 |
+
/// [in] assign to NULL
|
| 947 |
+
void* pPriv;
|
| 948 |
+
/// [in]
|
| 949 |
+
struct NVPW_MetricsEvaluator* pMetricsEvaluator;
|
| 950 |
+
/// [in] the metric index as in 'NVPW_MetricsEvaluator_GetMetricNames'
|
| 951 |
+
size_t throughputMetricIndex;
|
| 952 |
+
/// [out]
|
| 953 |
+
const char* pDescription;
|
| 954 |
+
/// [out]
|
| 955 |
+
uint32_t hwUnit;
|
| 956 |
+
/// [out] number of constituent counters for the throughput metric
|
| 957 |
+
size_t numCounters;
|
| 958 |
+
/// [out] metric indices as in 'NVPW_MetricsEvaluator_GetMetricNames', valid if 'numCounters' > 0, otherwise
|
| 959 |
+
/// returned as nullptr
|
| 960 |
+
const size_t* pCounterIndices;
|
| 961 |
+
/// [out] number of constituent sub-throughputs for the throughput metric
|
| 962 |
+
size_t numSubThroughputs;
|
| 963 |
+
/// [out] metric indices as in 'NVPW_MetricsEvaluator_GetMetricNames', valid if 'numSubThroughputs' > 0,
|
| 964 |
+
/// otherwise returned as nullptr
|
| 965 |
+
const size_t* pSubThroughputIndices;
|
| 966 |
+
} NVPW_MetricsEvaluator_GetThroughputMetricProperties_Params;
|
| 967 |
+
#define NVPW_MetricsEvaluator_GetThroughputMetricProperties_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_GetThroughputMetricProperties_Params, pSubThroughputIndices)
|
| 968 |
+
|
| 969 |
+
NVPA_Status NVPW_MetricsEvaluator_GetThroughputMetricProperties(NVPW_MetricsEvaluator_GetThroughputMetricProperties_Params* pParams);
|
| 970 |
+
|
| 971 |
+
typedef struct NVPW_MetricsEvaluator_GetSupportedSubmetrics_Params
|
| 972 |
+
{
|
| 973 |
+
/// [in]
|
| 974 |
+
size_t structSize;
|
| 975 |
+
/// [in] assign to NULL
|
| 976 |
+
void* pPriv;
|
| 977 |
+
/// [in]
|
| 978 |
+
struct NVPW_MetricsEvaluator* pMetricsEvaluator;
|
| 979 |
+
/// [in] one of 'NVPW_MetricType'
|
| 980 |
+
uint8_t metricType;
|
| 981 |
+
/// [out] an array of 'NVPW_Submetric'
|
| 982 |
+
const uint16_t* pSupportedSubmetrics;
|
| 983 |
+
/// [out]
|
| 984 |
+
size_t numSupportedSubmetrics;
|
| 985 |
+
} NVPW_MetricsEvaluator_GetSupportedSubmetrics_Params;
|
| 986 |
+
#define NVPW_MetricsEvaluator_GetSupportedSubmetrics_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_GetSupportedSubmetrics_Params, numSupportedSubmetrics)
|
| 987 |
+
|
| 988 |
+
NVPA_Status NVPW_MetricsEvaluator_GetSupportedSubmetrics(NVPW_MetricsEvaluator_GetSupportedSubmetrics_Params* pParams);
|
| 989 |
+
|
| 990 |
+
typedef struct NVPW_MetricsEvaluator_GetMetricRawDependencies_Params
|
| 991 |
+
{
|
| 992 |
+
/// [in]
|
| 993 |
+
size_t structSize;
|
| 994 |
+
/// [in] assign to NULL
|
| 995 |
+
void* pPriv;
|
| 996 |
+
/// [in]
|
| 997 |
+
struct NVPW_MetricsEvaluator* pMetricsEvaluator;
|
| 998 |
+
/// [in]
|
| 999 |
+
const struct NVPW_MetricEvalRequest* pMetricEvalRequests;
|
| 1000 |
+
/// [in]
|
| 1001 |
+
size_t numMetricEvalRequests;
|
| 1002 |
+
/// [in] set to 'NVPW_MetricEvalRequest_STRUCT_SIZE'
|
| 1003 |
+
size_t metricEvalRequestStructSize;
|
| 1004 |
+
/// [in] set to sizeof('NVPW_MetricEvalRequest')
|
| 1005 |
+
size_t metricEvalRequestStrideSize;
|
| 1006 |
+
/// [inout] 'ppRawDependencies' is in, '*ppRawDependencies' is out
|
| 1007 |
+
const char** ppRawDependencies;
|
| 1008 |
+
/// [inout] if 'ppRawDependencies' is NULL, number of raw dependencies available will be returned; otherwise it
|
| 1009 |
+
/// should be set to the number of elements allocated for 'ppRawDependencies', and on return, it will be
|
| 1010 |
+
/// overwritten by number of elements copied to 'ppRawDependencies'
|
| 1011 |
+
size_t numRawDependencies;
|
| 1012 |
+
/// [inout] 'ppOptionalRawDependencies' is in, '*ppOptionalRawDependencies' is out
|
| 1013 |
+
const char** ppOptionalRawDependencies;
|
| 1014 |
+
/// [inout] if 'ppOptionalRawDependencies' is NULL, number of optional raw dependencies available will be
|
| 1015 |
+
/// returned; otherwise it should be set to the number of elements allocated for 'ppOptionalRawDependencies',
|
| 1016 |
+
/// and on return, it will be overwritten by number of elements copied to 'ppOptionalRawDependencies'
|
| 1017 |
+
size_t numOptionalRawDependencies;
|
| 1018 |
+
} NVPW_MetricsEvaluator_GetMetricRawDependencies_Params;
|
| 1019 |
+
#define NVPW_MetricsEvaluator_GetMetricRawDependencies_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_GetMetricRawDependencies_Params, numOptionalRawDependencies)
|
| 1020 |
+
|
| 1021 |
+
NVPA_Status NVPW_MetricsEvaluator_GetMetricRawDependencies(NVPW_MetricsEvaluator_GetMetricRawDependencies_Params* pParams);
|
| 1022 |
+
|
| 1023 |
+
typedef struct NVPW_MetricsEvaluator_DimUnitToString_Params
|
| 1024 |
+
{
|
| 1025 |
+
/// [in]
|
| 1026 |
+
size_t structSize;
|
| 1027 |
+
/// [in] assign to NULL
|
| 1028 |
+
void* pPriv;
|
| 1029 |
+
/// [in]
|
| 1030 |
+
struct NVPW_MetricsEvaluator* pMetricsEvaluator;
|
| 1031 |
+
/// [in] one of 'NVPW_DimUnitName'
|
| 1032 |
+
uint32_t dimUnit;
|
| 1033 |
+
/// [out]
|
| 1034 |
+
const char* pSingularName;
|
| 1035 |
+
/// [out]
|
| 1036 |
+
const char* pPluralName;
|
| 1037 |
+
} NVPW_MetricsEvaluator_DimUnitToString_Params;
|
| 1038 |
+
#define NVPW_MetricsEvaluator_DimUnitToString_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_DimUnitToString_Params, pPluralName)
|
| 1039 |
+
|
| 1040 |
+
NVPA_Status NVPW_MetricsEvaluator_DimUnitToString(NVPW_MetricsEvaluator_DimUnitToString_Params* pParams);
|
| 1041 |
+
|
| 1042 |
+
typedef struct NVPW_MetricsEvaluator_GetMetricDimUnits_Params
|
| 1043 |
+
{
|
| 1044 |
+
/// [in]
|
| 1045 |
+
size_t structSize;
|
| 1046 |
+
/// [in] assign to NULL
|
| 1047 |
+
void* pPriv;
|
| 1048 |
+
/// [in]
|
| 1049 |
+
struct NVPW_MetricsEvaluator* pMetricsEvaluator;
|
| 1050 |
+
/// [in]
|
| 1051 |
+
const struct NVPW_MetricEvalRequest* pMetricEvalRequest;
|
| 1052 |
+
/// [in] set to 'NVPW_MetricEvalRequest_STRUCT_SIZE'
|
| 1053 |
+
size_t metricEvalRequestStructSize;
|
| 1054 |
+
/// [inout] 'pDimUnits' is in, '*pDimUnits' is out
|
| 1055 |
+
NVPW_DimUnitFactor* pDimUnits;
|
| 1056 |
+
/// [inout] if 'pDimUnits' is NULL, number of dim-units available will be returned; otherwise it should be set
|
| 1057 |
+
/// to the number of elements allocated for 'pDimUnits', and on return, it will be overwritten by number of
|
| 1058 |
+
/// elements copied to 'pDimUnits'
|
| 1059 |
+
size_t numDimUnits;
|
| 1060 |
+
/// [in] set to 'NVPW_DimUnitFactor_STRUCT_SIZE'
|
| 1061 |
+
size_t dimUnitFactorStructSize;
|
| 1062 |
+
} NVPW_MetricsEvaluator_GetMetricDimUnits_Params;
|
| 1063 |
+
#define NVPW_MetricsEvaluator_GetMetricDimUnits_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_GetMetricDimUnits_Params, dimUnitFactorStructSize)
|
| 1064 |
+
|
| 1065 |
+
NVPA_Status NVPW_MetricsEvaluator_GetMetricDimUnits(NVPW_MetricsEvaluator_GetMetricDimUnits_Params* pParams);
|
| 1066 |
+
|
| 1067 |
+
typedef struct NVPW_MetricsEvaluator_SetUserData_Params
|
| 1068 |
+
{
|
| 1069 |
+
/// [in]
|
| 1070 |
+
size_t structSize;
|
| 1071 |
+
/// [in] assign to NULL
|
| 1072 |
+
void* pPriv;
|
| 1073 |
+
/// [in]
|
| 1074 |
+
struct NVPW_MetricsEvaluator* pMetricsEvaluator;
|
| 1075 |
+
/// [in] duration in ns of user defined frame
|
| 1076 |
+
double frameDuration;
|
| 1077 |
+
/// [in] duration in ns of user defined region
|
| 1078 |
+
double regionDuration;
|
| 1079 |
+
/// [in]
|
| 1080 |
+
NVPA_Bool isolated;
|
| 1081 |
+
} NVPW_MetricsEvaluator_SetUserData_Params;
|
| 1082 |
+
#define NVPW_MetricsEvaluator_SetUserData_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_SetUserData_Params, isolated)
|
| 1083 |
+
|
| 1084 |
+
NVPA_Status NVPW_MetricsEvaluator_SetUserData(NVPW_MetricsEvaluator_SetUserData_Params* pParams);
|
| 1085 |
+
|
| 1086 |
+
typedef struct NVPW_MetricsEvaluator_EvaluateToGpuValues_Params
|
| 1087 |
+
{
|
| 1088 |
+
/// [in]
|
| 1089 |
+
size_t structSize;
|
| 1090 |
+
/// [in] assign to NULL
|
| 1091 |
+
void* pPriv;
|
| 1092 |
+
/// [in]
|
| 1093 |
+
struct NVPW_MetricsEvaluator* pMetricsEvaluator;
|
| 1094 |
+
/// [in]
|
| 1095 |
+
const struct NVPW_MetricEvalRequest* pMetricEvalRequests;
|
| 1096 |
+
/// [in]
|
| 1097 |
+
size_t numMetricEvalRequests;
|
| 1098 |
+
/// [in] set to 'NVPW_MetricEvalRequest_STRUCT_SIZE'
|
| 1099 |
+
size_t metricEvalRequestStructSize;
|
| 1100 |
+
/// [in] set to sizeof('NVPW_MetricEvalRequest')
|
| 1101 |
+
size_t metricEvalRequestStrideSize;
|
| 1102 |
+
/// [in]
|
| 1103 |
+
const uint8_t* pCounterDataImage;
|
| 1104 |
+
/// [in]
|
| 1105 |
+
size_t counterDataImageSize;
|
| 1106 |
+
/// [in]
|
| 1107 |
+
size_t rangeIndex;
|
| 1108 |
+
/// [in]
|
| 1109 |
+
NVPA_Bool isolated;
|
| 1110 |
+
/// [inout] 'pMetricValues' is in, '*pMetricValues' is out
|
| 1111 |
+
double* pMetricValues;
|
| 1112 |
+
} NVPW_MetricsEvaluator_EvaluateToGpuValues_Params;
|
| 1113 |
+
#define NVPW_MetricsEvaluator_EvaluateToGpuValues_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_EvaluateToGpuValues_Params, pMetricValues)
|
| 1114 |
+
|
| 1115 |
+
NVPA_Status NVPW_MetricsEvaluator_EvaluateToGpuValues(NVPW_MetricsEvaluator_EvaluateToGpuValues_Params* pParams);
|
| 1116 |
+
|
| 1117 |
+
typedef struct NVPW_MetricsEvaluator_SetDeviceAttributes_Params
|
| 1118 |
+
{
|
| 1119 |
+
/// [in]
|
| 1120 |
+
size_t structSize;
|
| 1121 |
+
/// [in] assign to NULL
|
| 1122 |
+
void* pPriv;
|
| 1123 |
+
/// [in]
|
| 1124 |
+
struct NVPW_MetricsEvaluator* pMetricsEvaluator;
|
| 1125 |
+
/// [in]
|
| 1126 |
+
const uint8_t* pCounterDataImage;
|
| 1127 |
+
/// [in]
|
| 1128 |
+
size_t counterDataImageSize;
|
| 1129 |
+
} NVPW_MetricsEvaluator_SetDeviceAttributes_Params;
|
| 1130 |
+
#define NVPW_MetricsEvaluator_SetDeviceAttributes_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_MetricsEvaluator_SetDeviceAttributes_Params, counterDataImageSize)
|
| 1131 |
+
|
| 1132 |
+
NVPA_Status NVPW_MetricsEvaluator_SetDeviceAttributes(NVPW_MetricsEvaluator_SetDeviceAttributes_Params* pParams);
|
| 1133 |
+
|
| 1134 |
+
/**
|
| 1135 |
+
* @}
|
| 1136 |
+
******************************************************************************/
|
| 1137 |
+
|
| 1138 |
+
|
| 1139 |
+
#endif // NVPERF_HOST_API_DEFINED
|
| 1140 |
+
|
| 1141 |
+
|
| 1142 |
+
|
| 1143 |
+
|
| 1144 |
+
#ifdef __cplusplus
|
| 1145 |
+
} // extern "C"
|
| 1146 |
+
#endif
|
| 1147 |
+
|
| 1148 |
+
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
| 1149 |
+
#pragma GCC visibility pop
|
| 1150 |
+
#endif
|
| 1151 |
+
|
| 1152 |
+
#endif // NVPERF_HOST_H
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_cupti/include/nvperf_target.h
ADDED
|
@@ -0,0 +1,595 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#ifndef NVPERF_TARGET_H
|
| 2 |
+
#define NVPERF_TARGET_H
|
| 3 |
+
|
| 4 |
+
/*
|
| 5 |
+
* Copyright 2014-2024 NVIDIA Corporation. All rights reserved.
|
| 6 |
+
*
|
| 7 |
+
* NOTICE TO USER:
|
| 8 |
+
*
|
| 9 |
+
* This source code is subject to NVIDIA ownership rights under U.S. and
|
| 10 |
+
* international Copyright laws.
|
| 11 |
+
*
|
| 12 |
+
* This software and the information contained herein is PROPRIETARY and
|
| 13 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
|
| 14 |
+
* of a form of NVIDIA software license agreement.
|
| 15 |
+
*
|
| 16 |
+
* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
|
| 17 |
+
* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
|
| 18 |
+
* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
|
| 19 |
+
* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
|
| 20 |
+
* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 21 |
+
* IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
|
| 22 |
+
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
| 23 |
+
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
| 24 |
+
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
| 25 |
+
* OR PERFORMANCE OF THIS SOURCE CODE.
|
| 26 |
+
*
|
| 27 |
+
* U.S. Government End Users. This source code is a "commercial item" as
|
| 28 |
+
* that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
|
| 29 |
+
* "commercial computer software" and "commercial computer software
|
| 30 |
+
* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
|
| 31 |
+
* and is provided to the U.S. Government only as a commercial end item.
|
| 32 |
+
* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
|
| 33 |
+
* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
|
| 34 |
+
* source code with only those rights set forth herein.
|
| 35 |
+
*
|
| 36 |
+
* Any use of this source code in individual and commercial software must
|
| 37 |
+
* include, in the user documentation and internal comments to the code,
|
| 38 |
+
* the above Disclaimer and U.S. Government End Users Notice.
|
| 39 |
+
*/
|
| 40 |
+
|
| 41 |
+
#include <stddef.h>
|
| 42 |
+
#include <stdint.h>
|
| 43 |
+
#include "nvperf_common.h"
|
| 44 |
+
|
| 45 |
+
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
| 46 |
+
#pragma GCC visibility push(default)
|
| 47 |
+
#if !defined(NVPW_LOCAL)
|
| 48 |
+
#define NVPW_LOCAL __attribute__ ((visibility ("hidden")))
|
| 49 |
+
#endif
|
| 50 |
+
#else
|
| 51 |
+
#if !defined(NVPW_LOCAL)
|
| 52 |
+
#define NVPW_LOCAL
|
| 53 |
+
#endif
|
| 54 |
+
#endif
|
| 55 |
+
|
| 56 |
+
#ifdef __cplusplus
|
| 57 |
+
extern "C" {
|
| 58 |
+
#endif
|
| 59 |
+
|
| 60 |
+
/**
|
| 61 |
+
* @file nvperf_target.h
|
| 62 |
+
*/
|
| 63 |
+
|
| 64 |
+
#ifndef NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_DEFINED
|
| 65 |
+
#define NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_DEFINED
|
| 66 |
+
/// GPU architecture support level
|
| 67 |
+
typedef enum NVPW_GpuArchitectureSupportLevel
|
| 68 |
+
{
|
| 69 |
+
NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_UNKNOWN = 0,
|
| 70 |
+
NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_UNSUPPORTED,
|
| 71 |
+
NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_SUPPORTED
|
| 72 |
+
} NVPW_GpuArchitectureSupportLevel;
|
| 73 |
+
#endif //NVPW_GPU_ARCHITECTURE_SUPPORT_LEVEL_DEFINED
|
| 74 |
+
|
| 75 |
+
#ifndef NVPW_SLI_SUPPORT_LEVEL_DEFINED
|
| 76 |
+
#define NVPW_SLI_SUPPORT_LEVEL_DEFINED
|
| 77 |
+
/// SLI configuration support level
|
| 78 |
+
typedef enum NVPW_SliSupportLevel
|
| 79 |
+
{
|
| 80 |
+
NVPW_SLI_SUPPORT_LEVEL_UNKNOWN = 0,
|
| 81 |
+
NVPW_SLI_SUPPORT_LEVEL_UNSUPPORTED,
|
| 82 |
+
/// Only Non-SLI configurations are supported.
|
| 83 |
+
NVPW_SLI_SUPPORT_LEVEL_SUPPORTED_NON_SLI_CONFIGURATION
|
| 84 |
+
} NVPW_SliSupportLevel;
|
| 85 |
+
#endif //NVPW_SLI_SUPPORT_LEVEL_DEFINED
|
| 86 |
+
|
| 87 |
+
#ifndef NVPW_VGPU_SUPPORT_LEVEL_DEFINED
|
| 88 |
+
#define NVPW_VGPU_SUPPORT_LEVEL_DEFINED
|
| 89 |
+
/// Virtualized GPU configuration support level
|
| 90 |
+
typedef enum NVPW_VGpuSupportLevel
|
| 91 |
+
{
|
| 92 |
+
NVPW_VGPU_SUPPORT_LEVEL_UNKNOWN = 0,
|
| 93 |
+
NVPW_VGPU_SUPPORT_LEVEL_UNSUPPORTED,
|
| 94 |
+
/// Supported but not allowed by system admin.
|
| 95 |
+
NVPW_VGPU_SUPPORT_LEVEL_SUPPORTED_DISALLOWED,
|
| 96 |
+
NVPW_VGPU_SUPPORT_LEVEL_SUPPORTED_ALLOWED,
|
| 97 |
+
NVPW_VGPU_SUPPORT_LEVEL_SUPPORTED_NON_VGPU_CONFIGURATION
|
| 98 |
+
} NVPW_VGpuSupportLevel;
|
| 99 |
+
#endif //NVPW_VGPU_SUPPORT_LEVEL_DEFINED
|
| 100 |
+
|
| 101 |
+
#ifndef NVPW_CONF_COMPUTE_SUPPORT_LEVEL_DEFINED
|
| 102 |
+
#define NVPW_CONF_COMPUTE_SUPPORT_LEVEL_DEFINED
|
| 103 |
+
/// Confidential Compute mode support level
|
| 104 |
+
typedef enum NVPW_ConfidentialComputeSupportLevel
|
| 105 |
+
{
|
| 106 |
+
NVPW_CONF_COMPUTE_SUPPORT_LEVEL_UNKNOWN = 0,
|
| 107 |
+
NVPW_CONF_COMPUTE_SUPPORT_LEVEL_UNSUPPORTED,
|
| 108 |
+
NVPW_CONF_COMPUTE_SUPPORT_LEVEL_SUPPORTED_NON_CONF_COMPUTE_CONFIGURATION,
|
| 109 |
+
NVPW_CONF_COMPUTE_SUPPORT_LEVEL_SUPPORTED_CONF_COMPUTE_DEVTOOLS_MODE
|
| 110 |
+
} NVPW_ConfidentialComputeSupportLevel;
|
| 111 |
+
#endif //NVPW_CONF_COMPUTE_SUPPORT_LEVEL_DEFINED
|
| 112 |
+
|
| 113 |
+
#ifndef NVPW_CMP_SUPPORT_LEVEL_DEFINED
|
| 114 |
+
#define NVPW_CMP_SUPPORT_LEVEL_DEFINED
|
| 115 |
+
/// CMP support level
|
| 116 |
+
typedef enum NVPW_CmpSupportLevel
|
| 117 |
+
{
|
| 118 |
+
NVPW_CMP_SUPPORT_LEVEL_UNKNOWN = 0,
|
| 119 |
+
NVPW_CMP_SUPPORT_LEVEL_UNSUPPORTED,
|
| 120 |
+
NVPW_CMP_SUPPORT_LEVEL_SUPPORTED_NON_CMP_CONFIGURATON
|
| 121 |
+
} NVPW_CmpSupportLevel;
|
| 122 |
+
#endif //NVPW_CMP_SUPPORT_LEVEL_DEFINED
|
| 123 |
+
|
| 124 |
+
#ifndef NVPW_WSL_SUPPORT_LEVEL_DEFINED
|
| 125 |
+
#define NVPW_WSL_SUPPORT_LEVEL_DEFINED
|
| 126 |
+
/// WSL support level
|
| 127 |
+
typedef enum NVPW_WslSupportLevel
|
| 128 |
+
{
|
| 129 |
+
NVPW_WSL_SUPPORT_LEVEL_UNKNOWN = 0,
|
| 130 |
+
NVPW_WSL_SUPPORT_LEVEL_UNSUPPORTED_INSUFFICIENT_DRIVER_VERSION,
|
| 131 |
+
NVPW_WSL_SUPPORT_LEVEL_SUPPORTED,
|
| 132 |
+
NVPW_WSL_SUPPORT_LEVEL_SUPPORTED_NON_WSL_CONFIGURATION
|
| 133 |
+
} NVPW_WslSupportLevel;
|
| 134 |
+
#endif //NVPW_WSL_SUPPORT_LEVEL_DEFINED
|
| 135 |
+
|
| 136 |
+
typedef struct NVPW_InitializeTarget_Params
|
| 137 |
+
{
|
| 138 |
+
/// [in]
|
| 139 |
+
size_t structSize;
|
| 140 |
+
/// [in] assign to NULL
|
| 141 |
+
void* pPriv;
|
| 142 |
+
} NVPW_InitializeTarget_Params;
|
| 143 |
+
#define NVPW_InitializeTarget_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_InitializeTarget_Params, pPriv)
|
| 144 |
+
|
| 145 |
+
/// Load the target library.
|
| 146 |
+
NVPA_Status NVPW_InitializeTarget(NVPW_InitializeTarget_Params* pParams);
|
| 147 |
+
|
| 148 |
+
typedef struct NVPW_GetDeviceCount_Params
|
| 149 |
+
{
|
| 150 |
+
/// [in]
|
| 151 |
+
size_t structSize;
|
| 152 |
+
/// [in] assign to NULL
|
| 153 |
+
void* pPriv;
|
| 154 |
+
size_t numDevices;
|
| 155 |
+
} NVPW_GetDeviceCount_Params;
|
| 156 |
+
#define NVPW_GetDeviceCount_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_GetDeviceCount_Params, numDevices)
|
| 157 |
+
|
| 158 |
+
NVPA_Status NVPW_GetDeviceCount(NVPW_GetDeviceCount_Params* pParams);
|
| 159 |
+
|
| 160 |
+
typedef struct NVPW_Device_GetNames_Params
|
| 161 |
+
{
|
| 162 |
+
/// [in]
|
| 163 |
+
size_t structSize;
|
| 164 |
+
/// [in] assign to NULL
|
| 165 |
+
void* pPriv;
|
| 166 |
+
size_t deviceIndex;
|
| 167 |
+
const char* pDeviceName;
|
| 168 |
+
const char* pChipName;
|
| 169 |
+
} NVPW_Device_GetNames_Params;
|
| 170 |
+
#define NVPW_Device_GetNames_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_Device_GetNames_Params, pChipName)
|
| 171 |
+
|
| 172 |
+
NVPA_Status NVPW_Device_GetNames(NVPW_Device_GetNames_Params* pParams);
|
| 173 |
+
|
| 174 |
+
typedef struct NVPW_PciBusId
|
| 175 |
+
{
|
| 176 |
+
/// The PCI domain on which the device bus resides.
|
| 177 |
+
uint32_t domain;
|
| 178 |
+
/// The bus on which the device resides.
|
| 179 |
+
uint16_t bus;
|
| 180 |
+
/// device ID.
|
| 181 |
+
uint16_t device;
|
| 182 |
+
} NVPW_PciBusId;
|
| 183 |
+
#define NVPW_PciBusId_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_PciBusId, device)
|
| 184 |
+
|
| 185 |
+
typedef struct NVPW_Device_GetPciBusIds_Params
|
| 186 |
+
{
|
| 187 |
+
/// [in]
|
| 188 |
+
size_t structSize;
|
| 189 |
+
/// [in] assign to NULL
|
| 190 |
+
void* pPriv;
|
| 191 |
+
/// [in] caller-allocated array of NVPW_PciBusId, indexed by NVPW deviceIndex
|
| 192 |
+
NVPW_PciBusId* pBusIds;
|
| 193 |
+
/// [in] size of the pBusIDs array; use result from NVPW_GetDeviceCount
|
| 194 |
+
size_t numDevices;
|
| 195 |
+
} NVPW_Device_GetPciBusIds_Params;
|
| 196 |
+
#define NVPW_Device_GetPciBusIds_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_Device_GetPciBusIds_Params, numDevices)
|
| 197 |
+
|
| 198 |
+
NVPA_Status NVPW_Device_GetPciBusIds(NVPW_Device_GetPciBusIds_Params* pParams);
|
| 199 |
+
|
| 200 |
+
|
| 201 |
+
#define NVPW_DEVICE_MIG_GPU_INSTANCE_ID_INVALID 0xFFFFFFFFu
|
| 202 |
+
#define NVPW_DEVICE_MIG_GPU_INSTANCE_ID_FULLCHIP 0xFFFFFFFEu
|
| 203 |
+
|
| 204 |
+
|
| 205 |
+
typedef struct NVPW_Device_GetMigAttributes_Params
|
| 206 |
+
{
|
| 207 |
+
/// [in]
|
| 208 |
+
size_t structSize;
|
| 209 |
+
/// [in] assign to NULL
|
| 210 |
+
void* pPriv;
|
| 211 |
+
/// [in]
|
| 212 |
+
size_t deviceIndex;
|
| 213 |
+
/// [out]
|
| 214 |
+
NVPA_Bool isMigPartition;
|
| 215 |
+
/// [out]
|
| 216 |
+
uint32_t gpuInstanceId;
|
| 217 |
+
/// [out]
|
| 218 |
+
uint32_t computeInstanceId;
|
| 219 |
+
} NVPW_Device_GetMigAttributes_Params;
|
| 220 |
+
#define NVPW_Device_GetMigAttributes_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_Device_GetMigAttributes_Params, computeInstanceId)
|
| 221 |
+
|
| 222 |
+
NVPA_Status NVPW_Device_GetMigAttributes(NVPW_Device_GetMigAttributes_Params* pParams);
|
| 223 |
+
|
| 224 |
+
typedef struct NVPW_Adapter_GetDeviceIndex_Params
|
| 225 |
+
{
|
| 226 |
+
/// [in]
|
| 227 |
+
size_t structSize;
|
| 228 |
+
/// [in] assign to NULL
|
| 229 |
+
void* pPriv;
|
| 230 |
+
/// [in]
|
| 231 |
+
struct IDXGIAdapter* pAdapter;
|
| 232 |
+
/// [in]
|
| 233 |
+
size_t sliIndex;
|
| 234 |
+
/// [out]
|
| 235 |
+
size_t deviceIndex;
|
| 236 |
+
} NVPW_Adapter_GetDeviceIndex_Params;
|
| 237 |
+
#define NVPW_Adapter_GetDeviceIndex_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_Adapter_GetDeviceIndex_Params, deviceIndex)
|
| 238 |
+
|
| 239 |
+
NVPA_Status NVPW_Adapter_GetDeviceIndex(NVPW_Adapter_GetDeviceIndex_Params* pParams);
|
| 240 |
+
|
| 241 |
+
typedef struct NVPW_CounterData_GetNumRanges_Params
|
| 242 |
+
{
|
| 243 |
+
/// [in]
|
| 244 |
+
size_t structSize;
|
| 245 |
+
/// [in] assign to NULL
|
| 246 |
+
void* pPriv;
|
| 247 |
+
const uint8_t* pCounterDataImage;
|
| 248 |
+
size_t numRanges;
|
| 249 |
+
} NVPW_CounterData_GetNumRanges_Params;
|
| 250 |
+
#define NVPW_CounterData_GetNumRanges_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_CounterData_GetNumRanges_Params, numRanges)
|
| 251 |
+
|
| 252 |
+
NVPA_Status NVPW_CounterData_GetNumRanges(NVPW_CounterData_GetNumRanges_Params* pParams);
|
| 253 |
+
|
| 254 |
+
typedef struct NVPW_CounterData_GetChipName_Params
|
| 255 |
+
{
|
| 256 |
+
/// [in]
|
| 257 |
+
size_t structSize;
|
| 258 |
+
/// [in] assign to NULL
|
| 259 |
+
void* pPriv;
|
| 260 |
+
/// [in]
|
| 261 |
+
const uint8_t* pCounterDataImage;
|
| 262 |
+
/// [in]
|
| 263 |
+
size_t counterDataImageSize;
|
| 264 |
+
/// [out]
|
| 265 |
+
const char* pChipName;
|
| 266 |
+
} NVPW_CounterData_GetChipName_Params;
|
| 267 |
+
#define NVPW_CounterData_GetChipName_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_CounterData_GetChipName_Params, pChipName)
|
| 268 |
+
|
| 269 |
+
NVPA_Status NVPW_CounterData_GetChipName(NVPW_CounterData_GetChipName_Params* pParams);
|
| 270 |
+
|
| 271 |
+
typedef struct NVPW_Config_GetNumPasses_Params
|
| 272 |
+
{
|
| 273 |
+
/// [in]
|
| 274 |
+
size_t structSize;
|
| 275 |
+
/// [in] assign to NULL
|
| 276 |
+
void* pPriv;
|
| 277 |
+
/// [in]
|
| 278 |
+
const uint8_t* pConfig;
|
| 279 |
+
/// [out]
|
| 280 |
+
size_t numPipelinedPasses;
|
| 281 |
+
/// [out]
|
| 282 |
+
size_t numIsolatedPasses;
|
| 283 |
+
} NVPW_Config_GetNumPasses_Params;
|
| 284 |
+
#define NVPW_Config_GetNumPasses_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_Config_GetNumPasses_Params, numIsolatedPasses)
|
| 285 |
+
|
| 286 |
+
/// Total num passes = numPipelinedPasses + numIsolatedPasses * numNestingLevels
|
| 287 |
+
NVPA_Status NVPW_Config_GetNumPasses(NVPW_Config_GetNumPasses_Params* pParams);
|
| 288 |
+
|
| 289 |
+
typedef struct NVPW_Config_GetNumPasses_V2_Params
|
| 290 |
+
{
|
| 291 |
+
/// [in]
|
| 292 |
+
size_t structSize;
|
| 293 |
+
/// [in] assign to NULL
|
| 294 |
+
void* pPriv;
|
| 295 |
+
/// [in]
|
| 296 |
+
const uint8_t* pConfig;
|
| 297 |
+
/// [out]
|
| 298 |
+
size_t numPasses;
|
| 299 |
+
} NVPW_Config_GetNumPasses_V2_Params;
|
| 300 |
+
#define NVPW_Config_GetNumPasses_V2_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_Config_GetNumPasses_V2_Params, numPasses)
|
| 301 |
+
|
| 302 |
+
/// Total num passes = numPasses * numNestingLevels
|
| 303 |
+
NVPA_Status NVPW_Config_GetNumPasses_V2(NVPW_Config_GetNumPasses_V2_Params* pParams);
|
| 304 |
+
|
| 305 |
+
#define NVPW_API_SET_CUDA_PROFILER 0x18209d0775b2f89dULL
|
| 306 |
+
|
| 307 |
+
#define NVPW_API_SET_D3D11_PROFILER 0xca55c6738445db2bULL
|
| 308 |
+
|
| 309 |
+
#define NVPW_API_SET_D3D12_PROFILER 0xc0c2d46dd7c7ad78ULL
|
| 310 |
+
|
| 311 |
+
#define NVPW_API_SET_EGL_PROFILER 0x3c3747dae1f9565cULL
|
| 312 |
+
|
| 313 |
+
#define NVPW_API_SET_GPU_PERIODICSAMPLER 0x9f4c2571fc0b2e8aULL
|
| 314 |
+
|
| 315 |
+
#define NVPW_API_SET_METRICSEVALUATOR 0x0368a8768d811af9ULL
|
| 316 |
+
|
| 317 |
+
#define NVPW_API_SET_METRICS_AD10X_COMP 0xbe57278e12cb5288ULL
|
| 318 |
+
|
| 319 |
+
#define NVPW_API_SET_METRICS_AD10X_GRFX 0x5cbf0774f81bf491ULL
|
| 320 |
+
|
| 321 |
+
#define NVPW_API_SET_METRICS_GA100_COMP 0x16b7d8c20d8b4915ULL
|
| 322 |
+
|
| 323 |
+
#define NVPW_API_SET_METRICS_GA100_GRFX 0xc94eaabec04a94faULL
|
| 324 |
+
|
| 325 |
+
#define NVPW_API_SET_METRICS_GA10X_COMP 0xb5d6391c2e299ab5ULL
|
| 326 |
+
|
| 327 |
+
#define NVPW_API_SET_METRICS_GA10X_GRFX 0x6ebc121178b5ce0bULL
|
| 328 |
+
|
| 329 |
+
#define NVPW_API_SET_METRICS_GV100_COMP 0x863705cc57919f72ULL
|
| 330 |
+
|
| 331 |
+
#define NVPW_API_SET_METRICS_GV100_GRFX 0x9900da75d164fecfULL
|
| 332 |
+
|
| 333 |
+
#define NVPW_API_SET_METRICS_GV11B_COMP 0xd3f79a859235848fULL
|
| 334 |
+
|
| 335 |
+
#define NVPW_API_SET_METRICS_GV11B_GRFX 0xeb8e26220106e227ULL
|
| 336 |
+
|
| 337 |
+
#define NVPW_API_SET_METRICS_TU10X_COMP 0x70f40be0afd35da8ULL
|
| 338 |
+
|
| 339 |
+
#define NVPW_API_SET_METRICS_TU10X_GRFX 0xdf219cb838db6968ULL
|
| 340 |
+
|
| 341 |
+
#define NVPW_API_SET_METRICS_TU11X_COMP 0xeb0069d7d0956678ULL
|
| 342 |
+
|
| 343 |
+
#define NVPW_API_SET_METRICS_TU11X_GRFX 0x0977d9342bd62743ULL
|
| 344 |
+
|
| 345 |
+
#define NVPW_API_SET_OPENGL_PROFILER 0xe4cd9ea40f2ee777ULL
|
| 346 |
+
|
| 347 |
+
#define NVPW_API_SET_VULKAN_PROFILER 0x8c56b6a03d779689ULL
|
| 348 |
+
|
| 349 |
+
#define NVPW_SDK_VERSION 0x1e128b6f001423fcULL
|
| 350 |
+
|
| 351 |
+
typedef struct NVPW_QueryVersionNumber_Params
|
| 352 |
+
{
|
| 353 |
+
/// [in]
|
| 354 |
+
size_t structSize;
|
| 355 |
+
/// [in] assign to NULL
|
| 356 |
+
void* pPriv;
|
| 357 |
+
/// [in]
|
| 358 |
+
uint64_t apiSet;
|
| 359 |
+
/// [out]
|
| 360 |
+
uint32_t major;
|
| 361 |
+
/// [out]
|
| 362 |
+
uint32_t minor;
|
| 363 |
+
/// [out]
|
| 364 |
+
uint32_t patch;
|
| 365 |
+
/// [out]
|
| 366 |
+
uint32_t relMajor;
|
| 367 |
+
/// [out]
|
| 368 |
+
uint32_t relMinor;
|
| 369 |
+
/// [out]
|
| 370 |
+
uint32_t relPatch;
|
| 371 |
+
} NVPW_QueryVersionNumber_Params;
|
| 372 |
+
#define NVPW_QueryVersionNumber_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_QueryVersionNumber_Params, relPatch)
|
| 373 |
+
|
| 374 |
+
/// Query version number of an API set
|
| 375 |
+
NVPA_Status NVPW_QueryVersionNumber(NVPW_QueryVersionNumber_Params* pParams);
|
| 376 |
+
|
| 377 |
+
typedef enum NVPW_Device_ClockStatus
|
| 378 |
+
{
|
| 379 |
+
/// clock status is unknown
|
| 380 |
+
NVPW_DEVICE_CLOCK_STATUS_UNKNOWN,
|
| 381 |
+
/// clocks are locked to rated tdp values
|
| 382 |
+
NVPW_DEVICE_CLOCK_STATUS_LOCKED_TO_RATED_TDP,
|
| 383 |
+
/// clocks are not locked and can boost above rated tdp
|
| 384 |
+
NVPW_DEVICE_CLOCK_STATUS_BOOST_ENABLED,
|
| 385 |
+
/// clocks are not locked and will not go above rated tdp
|
| 386 |
+
NVPW_DEVICE_CLOCK_STATUS_BOOST_DISABLED,
|
| 387 |
+
NVPW_DEVICE_CLOCK_STATUS__COUNT
|
| 388 |
+
} NVPW_Device_ClockStatus;
|
| 389 |
+
|
| 390 |
+
typedef struct NVPW_Device_GetClockStatus_Params
|
| 391 |
+
{
|
| 392 |
+
/// [in]
|
| 393 |
+
size_t structSize;
|
| 394 |
+
/// [in] assign to NULL
|
| 395 |
+
void* pPriv;
|
| 396 |
+
size_t deviceIndex;
|
| 397 |
+
/// [in]
|
| 398 |
+
NVPW_Device_ClockStatus clockStatus;
|
| 399 |
+
} NVPW_Device_GetClockStatus_Params;
|
| 400 |
+
#define NVPW_Device_GetClockStatus_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_Device_GetClockStatus_Params, clockStatus)
|
| 401 |
+
|
| 402 |
+
NVPA_Status NVPW_Device_GetClockStatus(NVPW_Device_GetClockStatus_Params* pParams);
|
| 403 |
+
|
| 404 |
+
typedef enum NVPW_Device_ClockSetting
|
| 405 |
+
{
|
| 406 |
+
/// invalid op, specify valid clocks operation during profiling
|
| 407 |
+
NVPW_DEVICE_CLOCK_SETTING_INVALID,
|
| 408 |
+
/// default to driver/application config (normally unlocked and not boosted, but could be unlocked boosted, or
|
| 409 |
+
/// locked to rated TDP)
|
| 410 |
+
NVPW_DEVICE_CLOCK_SETTING_DEFAULT,
|
| 411 |
+
/// lock clocks at rated tdp base values
|
| 412 |
+
NVPW_DEVICE_CLOCK_SETTING_LOCK_TO_RATED_TDP,
|
| 413 |
+
NVPW_DEVICE_CLOCK_SETTING__COUNT
|
| 414 |
+
} NVPW_Device_ClockSetting;
|
| 415 |
+
|
| 416 |
+
typedef struct NVPW_Device_SetClockSetting_Params
|
| 417 |
+
{
|
| 418 |
+
/// [in]
|
| 419 |
+
size_t structSize;
|
| 420 |
+
/// [in] assign to NULL
|
| 421 |
+
void* pPriv;
|
| 422 |
+
size_t deviceIndex;
|
| 423 |
+
/// [in]
|
| 424 |
+
NVPW_Device_ClockSetting clockSetting;
|
| 425 |
+
} NVPW_Device_SetClockSetting_Params;
|
| 426 |
+
#define NVPW_Device_SetClockSetting_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_Device_SetClockSetting_Params, clockSetting)
|
| 427 |
+
|
| 428 |
+
NVPA_Status NVPW_Device_SetClockSetting(NVPW_Device_SetClockSetting_Params* pParams);
|
| 429 |
+
|
| 430 |
+
typedef struct NVPW_CounterData_GetRangeDescriptions_Params
|
| 431 |
+
{
|
| 432 |
+
/// [in]
|
| 433 |
+
size_t structSize;
|
| 434 |
+
/// [in] assign to NULL
|
| 435 |
+
void* pPriv;
|
| 436 |
+
const uint8_t* pCounterDataImage;
|
| 437 |
+
size_t rangeIndex;
|
| 438 |
+
/// [inout] Number of descriptions allocated in ppDescriptions
|
| 439 |
+
size_t numDescriptions;
|
| 440 |
+
const char** ppDescriptions;
|
| 441 |
+
} NVPW_CounterData_GetRangeDescriptions_Params;
|
| 442 |
+
#define NVPW_CounterData_GetRangeDescriptions_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_CounterData_GetRangeDescriptions_Params, ppDescriptions)
|
| 443 |
+
|
| 444 |
+
NVPA_Status NVPW_CounterData_GetRangeDescriptions(NVPW_CounterData_GetRangeDescriptions_Params* pParams);
|
| 445 |
+
|
| 446 |
+
typedef struct NVPW_Profiler_CounterData_GetRangeDescriptions_Params
|
| 447 |
+
{
|
| 448 |
+
/// [in]
|
| 449 |
+
size_t structSize;
|
| 450 |
+
/// [in] assign to NULL
|
| 451 |
+
void* pPriv;
|
| 452 |
+
const uint8_t* pCounterDataImage;
|
| 453 |
+
size_t rangeIndex;
|
| 454 |
+
/// [inout] Number of descriptions allocated in ppDescriptions
|
| 455 |
+
size_t numDescriptions;
|
| 456 |
+
const char** ppDescriptions;
|
| 457 |
+
} NVPW_Profiler_CounterData_GetRangeDescriptions_Params;
|
| 458 |
+
#define NVPW_Profiler_CounterData_GetRangeDescriptions_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_Profiler_CounterData_GetRangeDescriptions_Params, ppDescriptions)
|
| 459 |
+
|
| 460 |
+
NVPA_Status NVPW_Profiler_CounterData_GetRangeDescriptions(NVPW_Profiler_CounterData_GetRangeDescriptions_Params* pParams);
|
| 461 |
+
|
| 462 |
+
#ifndef NVPW_PERIODIC_SAMPLER_COUNTER_DATA_APPEND_MODE_DEFINED
|
| 463 |
+
#define NVPW_PERIODIC_SAMPLER_COUNTER_DATA_APPEND_MODE_DEFINED
|
| 464 |
+
typedef enum NVPW_PeriodicSampler_CounterData_AppendMode
|
| 465 |
+
{
|
| 466 |
+
NVPW_PERIODIC_SAMPLER_COUNTER_DATA_APPEND_MODE_LINEAR = 0,
|
| 467 |
+
NVPW_PERIODIC_SAMPLER_COUNTER_DATA_APPEND_MODE_CIRCULAR = 1,
|
| 468 |
+
NVPW_PERIODIC_SAMPLER_COUNTER_DATA_APPEND_MODE__COUNT
|
| 469 |
+
} NVPW_PeriodicSampler_CounterData_AppendMode;
|
| 470 |
+
#endif //NVPW_PERIODIC_SAMPLER_COUNTER_DATA_APPEND_MODE_DEFINED
|
| 471 |
+
|
| 472 |
+
typedef struct NVPW_PeriodicSampler_CounterData_GetSampleTime_Params
|
| 473 |
+
{
|
| 474 |
+
/// [in]
|
| 475 |
+
size_t structSize;
|
| 476 |
+
/// [in] assign to NULL
|
| 477 |
+
void* pPriv;
|
| 478 |
+
/// [in]
|
| 479 |
+
const uint8_t* pCounterDataImage;
|
| 480 |
+
/// [in]
|
| 481 |
+
size_t rangeIndex;
|
| 482 |
+
/// [out]
|
| 483 |
+
uint64_t timestampStart;
|
| 484 |
+
/// [out]
|
| 485 |
+
uint64_t timestampEnd;
|
| 486 |
+
} NVPW_PeriodicSampler_CounterData_GetSampleTime_Params;
|
| 487 |
+
#define NVPW_PeriodicSampler_CounterData_GetSampleTime_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_PeriodicSampler_CounterData_GetSampleTime_Params, timestampEnd)
|
| 488 |
+
|
| 489 |
+
NVPA_Status NVPW_PeriodicSampler_CounterData_GetSampleTime(NVPW_PeriodicSampler_CounterData_GetSampleTime_Params* pParams);
|
| 490 |
+
|
| 491 |
+
typedef struct NVPW_PeriodicSampler_CounterData_TrimInPlace_Params
|
| 492 |
+
{
|
| 493 |
+
/// [in]
|
| 494 |
+
size_t structSize;
|
| 495 |
+
/// [in] assign to NULL
|
| 496 |
+
void* pPriv;
|
| 497 |
+
/// [in]
|
| 498 |
+
uint8_t* pCounterDataImage;
|
| 499 |
+
/// [in]
|
| 500 |
+
size_t counterDataImageSize;
|
| 501 |
+
/// [out]
|
| 502 |
+
size_t counterDataImageTrimmedSize;
|
| 503 |
+
} NVPW_PeriodicSampler_CounterData_TrimInPlace_Params;
|
| 504 |
+
#define NVPW_PeriodicSampler_CounterData_TrimInPlace_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_PeriodicSampler_CounterData_TrimInPlace_Params, counterDataImageTrimmedSize)
|
| 505 |
+
|
| 506 |
+
NVPA_Status NVPW_PeriodicSampler_CounterData_TrimInPlace(NVPW_PeriodicSampler_CounterData_TrimInPlace_Params* pParams);
|
| 507 |
+
|
| 508 |
+
typedef struct NVPW_PeriodicSampler_CounterData_GetInfo_Params
|
| 509 |
+
{
|
| 510 |
+
/// [in]
|
| 511 |
+
size_t structSize;
|
| 512 |
+
/// [in] assign to NULL
|
| 513 |
+
void* pPriv;
|
| 514 |
+
/// [in]
|
| 515 |
+
const uint8_t* pCounterDataImage;
|
| 516 |
+
/// [in]
|
| 517 |
+
size_t counterDataImageSize;
|
| 518 |
+
/// [out] total number of ranges in the counter data
|
| 519 |
+
size_t numTotalRanges;
|
| 520 |
+
/// [out] if in "linear" mode, this API returns the number of "populated" ranges; if it's in "circular" mode,
|
| 521 |
+
/// then it returns the last "populated" range index + 1, when there is no such range, it returns 0.
|
| 522 |
+
size_t numPopulatedRanges;
|
| 523 |
+
/// [out] if in "linear" mode, this API returns the number of "completed" ranges; if it's in "circular" mode,
|
| 524 |
+
/// then it returns the last "completed" range index + 1, when there is no such range, it returns 0.
|
| 525 |
+
size_t numCompletedRanges;
|
| 526 |
+
} NVPW_PeriodicSampler_CounterData_GetInfo_Params;
|
| 527 |
+
#define NVPW_PeriodicSampler_CounterData_GetInfo_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_PeriodicSampler_CounterData_GetInfo_Params, numCompletedRanges)
|
| 528 |
+
|
| 529 |
+
/// In periodic sampler, a range in counter data stores exactly one sample's data. For better performance, periodic
|
| 530 |
+
/// sampler may operate in an out-of-order fashion when populating sample data, i.e. it may not fully populate all
|
| 531 |
+
/// counters of a sample/range before starting to populate the next sample/range. As a result, we have two concepts
|
| 532 |
+
/// here, "populated" & "completed": a range is considered "populated" even if only partial counters have been
|
| 533 |
+
/// written; on the other hand, a range is only considered "completed" if all the collecting counters have been
|
| 534 |
+
/// written.
|
| 535 |
+
NVPA_Status NVPW_PeriodicSampler_CounterData_GetInfo(NVPW_PeriodicSampler_CounterData_GetInfo_Params* pParams);
|
| 536 |
+
|
| 537 |
+
typedef struct NVPW_PeriodicSampler_CounterData_GetTriggerCount_Params
|
| 538 |
+
{
|
| 539 |
+
/// [in]
|
| 540 |
+
size_t structSize;
|
| 541 |
+
/// [in] assign to NULL
|
| 542 |
+
void* pPriv;
|
| 543 |
+
/// [in]
|
| 544 |
+
const uint8_t* pCounterDataImage;
|
| 545 |
+
/// [in]
|
| 546 |
+
size_t counterDataImageSize;
|
| 547 |
+
/// [in]
|
| 548 |
+
size_t rangeIndex;
|
| 549 |
+
/// [out]
|
| 550 |
+
uint32_t triggerCount;
|
| 551 |
+
} NVPW_PeriodicSampler_CounterData_GetTriggerCount_Params;
|
| 552 |
+
#define NVPW_PeriodicSampler_CounterData_GetTriggerCount_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_PeriodicSampler_CounterData_GetTriggerCount_Params, triggerCount)
|
| 553 |
+
|
| 554 |
+
NVPA_Status NVPW_PeriodicSampler_CounterData_GetTriggerCount(NVPW_PeriodicSampler_CounterData_GetTriggerCount_Params* pParams);
|
| 555 |
+
|
| 556 |
+
typedef struct NVPW_PeriodicSampler_CounterData_IsDataComplete_Params
|
| 557 |
+
{
|
| 558 |
+
/// [in]
|
| 559 |
+
size_t structSize;
|
| 560 |
+
/// [in] assign to NULL
|
| 561 |
+
void* pPriv;
|
| 562 |
+
/// [in]
|
| 563 |
+
const uint8_t* pCounterDataImage;
|
| 564 |
+
/// [in]
|
| 565 |
+
size_t counterDataImageSize;
|
| 566 |
+
/// [in]
|
| 567 |
+
size_t rangeIndex;
|
| 568 |
+
/// [out]
|
| 569 |
+
NVPA_Bool isComplete;
|
| 570 |
+
} NVPW_PeriodicSampler_CounterData_IsDataComplete_Params;
|
| 571 |
+
#define NVPW_PeriodicSampler_CounterData_IsDataComplete_Params_STRUCT_SIZE NVPA_STRUCT_SIZE(NVPW_PeriodicSampler_CounterData_IsDataComplete_Params, isComplete)
|
| 572 |
+
|
| 573 |
+
/// Checks whether a given sample's data is complete. See also 'NVPW_PeriodicSampler_CounterData_GetInfo'
|
| 574 |
+
NVPA_Status NVPW_PeriodicSampler_CounterData_IsDataComplete(NVPW_PeriodicSampler_CounterData_IsDataComplete_Params* pParams);
|
| 575 |
+
|
| 576 |
+
|
| 577 |
+
typedef struct NVPW_TimestampReport
|
| 578 |
+
{
|
| 579 |
+
uint32_t payload;
|
| 580 |
+
uint8_t reserved0004[4];
|
| 581 |
+
uint64_t timestamp;
|
| 582 |
+
} NVPW_TimestampReport;
|
| 583 |
+
|
| 584 |
+
|
| 585 |
+
|
| 586 |
+
|
| 587 |
+
#ifdef __cplusplus
|
| 588 |
+
} // extern "C"
|
| 589 |
+
#endif
|
| 590 |
+
|
| 591 |
+
#if defined(__GNUC__) && defined(NVPA_SHARED_LIB)
|
| 592 |
+
#pragma GCC visibility pop
|
| 593 |
+
#endif
|
| 594 |
+
|
| 595 |
+
#endif // NVPERF_TARGET_H
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_cupti/lib/__init__.py
ADDED
|
File without changes
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_nvrtc/__init__.py
ADDED
|
File without changes
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_nvrtc/include/__init__.py
ADDED
|
File without changes
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_nvrtc/include/nvrtc.h
ADDED
|
@@ -0,0 +1,876 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//
|
| 2 |
+
// NVIDIA_COPYRIGHT_BEGIN
|
| 3 |
+
//
|
| 4 |
+
// Copyright (c) 2014-2024, NVIDIA CORPORATION. All rights reserved.
|
| 5 |
+
//
|
| 6 |
+
// NVIDIA CORPORATION and its licensors retain all intellectual property
|
| 7 |
+
// and proprietary rights in and to this software, related documentation
|
| 8 |
+
// and any modifications thereto. Any use, reproduction, disclosure or
|
| 9 |
+
// distribution of this software and related documentation without an express
|
| 10 |
+
// license agreement from NVIDIA CORPORATION is strictly prohibited.
|
| 11 |
+
//
|
| 12 |
+
// NVIDIA_COPYRIGHT_END
|
| 13 |
+
//
|
| 14 |
+
|
| 15 |
+
#ifndef __NVRTC_H__
|
| 16 |
+
#define __NVRTC_H__
|
| 17 |
+
|
| 18 |
+
#ifdef __cplusplus
|
| 19 |
+
extern "C" {
|
| 20 |
+
#endif /* __cplusplus */
|
| 21 |
+
|
| 22 |
+
#include <stdlib.h>
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
/*************************************************************************//**
|
| 26 |
+
*
|
| 27 |
+
* \defgroup error Error Handling
|
| 28 |
+
*
|
| 29 |
+
* NVRTC defines the following enumeration type and function for API call
|
| 30 |
+
* error handling.
|
| 31 |
+
*
|
| 32 |
+
****************************************************************************/
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
/**
|
| 36 |
+
* \ingroup error
|
| 37 |
+
* \brief The enumerated type nvrtcResult defines API call result codes.
|
| 38 |
+
* NVRTC API functions return nvrtcResult to indicate the call
|
| 39 |
+
* result.
|
| 40 |
+
*/
|
| 41 |
+
typedef enum {
|
| 42 |
+
NVRTC_SUCCESS = 0,
|
| 43 |
+
NVRTC_ERROR_OUT_OF_MEMORY = 1,
|
| 44 |
+
NVRTC_ERROR_PROGRAM_CREATION_FAILURE = 2,
|
| 45 |
+
NVRTC_ERROR_INVALID_INPUT = 3,
|
| 46 |
+
NVRTC_ERROR_INVALID_PROGRAM = 4,
|
| 47 |
+
NVRTC_ERROR_INVALID_OPTION = 5,
|
| 48 |
+
NVRTC_ERROR_COMPILATION = 6,
|
| 49 |
+
NVRTC_ERROR_BUILTIN_OPERATION_FAILURE = 7,
|
| 50 |
+
NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION = 8,
|
| 51 |
+
NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION = 9,
|
| 52 |
+
NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID = 10,
|
| 53 |
+
NVRTC_ERROR_INTERNAL_ERROR = 11,
|
| 54 |
+
NVRTC_ERROR_TIME_FILE_WRITE_FAILED = 12
|
| 55 |
+
} nvrtcResult;
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
/**
|
| 59 |
+
* \ingroup error
|
| 60 |
+
* \brief nvrtcGetErrorString is a helper function that returns a string
|
| 61 |
+
* describing the given nvrtcResult code, e.g., NVRTC_SUCCESS to
|
| 62 |
+
* \c "NVRTC_SUCCESS".
|
| 63 |
+
* For unrecognized enumeration values, it returns
|
| 64 |
+
* \c "NVRTC_ERROR unknown".
|
| 65 |
+
*
|
| 66 |
+
* \param [in] result CUDA Runtime Compilation API result code.
|
| 67 |
+
* \return Message string for the given #nvrtcResult code.
|
| 68 |
+
*/
|
| 69 |
+
const char *nvrtcGetErrorString(nvrtcResult result);
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
/*************************************************************************//**
|
| 73 |
+
*
|
| 74 |
+
* \defgroup query General Information Query
|
| 75 |
+
*
|
| 76 |
+
* NVRTC defines the following function for general information query.
|
| 77 |
+
*
|
| 78 |
+
****************************************************************************/
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
/**
|
| 82 |
+
* \ingroup query
|
| 83 |
+
* \brief nvrtcVersion sets the output parameters \p major and \p minor
|
| 84 |
+
* with the CUDA Runtime Compilation version number.
|
| 85 |
+
*
|
| 86 |
+
* \param [out] major CUDA Runtime Compilation major version number.
|
| 87 |
+
* \param [out] minor CUDA Runtime Compilation minor version number.
|
| 88 |
+
* \return
|
| 89 |
+
* - \link #nvrtcResult NVRTC_SUCCESS \endlink
|
| 90 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
|
| 91 |
+
*
|
| 92 |
+
*/
|
| 93 |
+
nvrtcResult nvrtcVersion(int *major, int *minor);
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
/**
|
| 97 |
+
* \ingroup query
|
| 98 |
+
* \brief nvrtcGetNumSupportedArchs sets the output parameter \p numArchs
|
| 99 |
+
* with the number of architectures supported by NVRTC. This can
|
| 100 |
+
* then be used to pass an array to ::nvrtcGetSupportedArchs to
|
| 101 |
+
* get the supported architectures.
|
| 102 |
+
*
|
| 103 |
+
* \param [out] numArchs number of supported architectures.
|
| 104 |
+
* \return
|
| 105 |
+
* - \link #nvrtcResult NVRTC_SUCCESS \endlink
|
| 106 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
|
| 107 |
+
*
|
| 108 |
+
* see ::nvrtcGetSupportedArchs
|
| 109 |
+
*/
|
| 110 |
+
nvrtcResult nvrtcGetNumSupportedArchs(int* numArchs);
|
| 111 |
+
|
| 112 |
+
|
| 113 |
+
/**
|
| 114 |
+
* \ingroup query
|
| 115 |
+
* \brief nvrtcGetSupportedArchs populates the array passed via the output parameter
|
| 116 |
+
* \p supportedArchs with the architectures supported by NVRTC. The array is
|
| 117 |
+
* sorted in the ascending order. The size of the array to be passed can be
|
| 118 |
+
* determined using ::nvrtcGetNumSupportedArchs.
|
| 119 |
+
*
|
| 120 |
+
* \param [out] supportedArchs sorted array of supported architectures.
|
| 121 |
+
* \return
|
| 122 |
+
* - \link #nvrtcResult NVRTC_SUCCESS \endlink
|
| 123 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
|
| 124 |
+
*
|
| 125 |
+
* see ::nvrtcGetNumSupportedArchs
|
| 126 |
+
*/
|
| 127 |
+
nvrtcResult nvrtcGetSupportedArchs(int* supportedArchs);
|
| 128 |
+
|
| 129 |
+
|
| 130 |
+
/*************************************************************************//**
|
| 131 |
+
*
|
| 132 |
+
* \defgroup compilation Compilation
|
| 133 |
+
*
|
| 134 |
+
* NVRTC defines the following type and functions for actual compilation.
|
| 135 |
+
*
|
| 136 |
+
****************************************************************************/
|
| 137 |
+
|
| 138 |
+
|
| 139 |
+
/**
|
| 140 |
+
* \ingroup compilation
|
| 141 |
+
* \brief nvrtcProgram is the unit of compilation, and an opaque handle for
|
| 142 |
+
* a program.
|
| 143 |
+
*
|
| 144 |
+
* To compile a CUDA program string, an instance of nvrtcProgram must be
|
| 145 |
+
* created first with ::nvrtcCreateProgram, then compiled with
|
| 146 |
+
* ::nvrtcCompileProgram.
|
| 147 |
+
*/
|
| 148 |
+
typedef struct _nvrtcProgram *nvrtcProgram;
|
| 149 |
+
|
| 150 |
+
|
| 151 |
+
/**
|
| 152 |
+
* \ingroup compilation
|
| 153 |
+
* \brief nvrtcCreateProgram creates an instance of nvrtcProgram with the
|
| 154 |
+
* given input parameters, and sets the output parameter \p prog with
|
| 155 |
+
* it.
|
| 156 |
+
*
|
| 157 |
+
* \param [out] prog CUDA Runtime Compilation program.
|
| 158 |
+
* \param [in] src CUDA program source.
|
| 159 |
+
* \param [in] name CUDA program name.\n
|
| 160 |
+
* \p name can be \c NULL; \c "default_program" is
|
| 161 |
+
* used when \p name is \c NULL or "".
|
| 162 |
+
* \param [in] numHeaders Number of headers used.\n
|
| 163 |
+
* \p numHeaders must be greater than or equal to 0.
|
| 164 |
+
* \param [in] headers Sources of the headers.\n
|
| 165 |
+
* \p headers can be \c NULL when \p numHeaders is
|
| 166 |
+
* 0.
|
| 167 |
+
* \param [in] includeNames Name of each header by which they can be
|
| 168 |
+
* included in the CUDA program source.\n
|
| 169 |
+
* \p includeNames can be \c NULL when \p numHeaders
|
| 170 |
+
* is 0. These headers must be included with the exact
|
| 171 |
+
* names specified here.
|
| 172 |
+
* \return
|
| 173 |
+
* - \link #nvrtcResult NVRTC_SUCCESS \endlink
|
| 174 |
+
* - \link #nvrtcResult NVRTC_ERROR_OUT_OF_MEMORY \endlink
|
| 175 |
+
* - \link #nvrtcResult NVRTC_ERROR_PROGRAM_CREATION_FAILURE \endlink
|
| 176 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
|
| 177 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
|
| 178 |
+
*
|
| 179 |
+
* \see ::nvrtcDestroyProgram
|
| 180 |
+
*/
|
| 181 |
+
nvrtcResult nvrtcCreateProgram(nvrtcProgram *prog,
|
| 182 |
+
const char *src,
|
| 183 |
+
const char *name,
|
| 184 |
+
int numHeaders,
|
| 185 |
+
const char * const *headers,
|
| 186 |
+
const char * const *includeNames);
|
| 187 |
+
|
| 188 |
+
|
| 189 |
+
/**
|
| 190 |
+
* \ingroup compilation
|
| 191 |
+
* \brief nvrtcDestroyProgram destroys the given program.
|
| 192 |
+
*
|
| 193 |
+
* \param [in] prog CUDA Runtime Compilation program.
|
| 194 |
+
* \return
|
| 195 |
+
* - \link #nvrtcResult NVRTC_SUCCESS \endlink
|
| 196 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
|
| 197 |
+
*
|
| 198 |
+
* \see ::nvrtcCreateProgram
|
| 199 |
+
*/
|
| 200 |
+
nvrtcResult nvrtcDestroyProgram(nvrtcProgram *prog);
|
| 201 |
+
|
| 202 |
+
|
| 203 |
+
/**
|
| 204 |
+
* \ingroup compilation
|
| 205 |
+
* \brief nvrtcCompileProgram compiles the given program.
|
| 206 |
+
*
|
| 207 |
+
* \param [in] prog CUDA Runtime Compilation program.
|
| 208 |
+
* \param [in] numOptions Number of compiler options passed.
|
| 209 |
+
* \param [in] options Compiler options in the form of C string array.\n
|
| 210 |
+
* \p options can be \c NULL when \p numOptions is 0.
|
| 211 |
+
*
|
| 212 |
+
* \return
|
| 213 |
+
* - \link #nvrtcResult NVRTC_SUCCESS \endlink
|
| 214 |
+
* - \link #nvrtcResult NVRTC_ERROR_OUT_OF_MEMORY \endlink
|
| 215 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
|
| 216 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
|
| 217 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_OPTION \endlink
|
| 218 |
+
* - \link #nvrtcResult NVRTC_ERROR_COMPILATION \endlink
|
| 219 |
+
* - \link #nvrtcResult NVRTC_ERROR_BUILTIN_OPERATION_FAILURE \endlink
|
| 220 |
+
* - \link #nvrtcResult NVRTC_ERROR_TIME_FILE_WRITE_FAILED \endlink
|
| 221 |
+
*
|
| 222 |
+
* It supports compile options listed in \ref options.
|
| 223 |
+
*/
|
| 224 |
+
nvrtcResult nvrtcCompileProgram(nvrtcProgram prog,
|
| 225 |
+
int numOptions, const char * const *options);
|
| 226 |
+
|
| 227 |
+
|
| 228 |
+
/**
|
| 229 |
+
* \ingroup compilation
|
| 230 |
+
* \brief nvrtcGetPTXSize sets the value of \p ptxSizeRet with the size of the PTX
|
| 231 |
+
* generated by the previous compilation of \p prog (including the
|
| 232 |
+
* trailing \c NULL).
|
| 233 |
+
*
|
| 234 |
+
* \param [in] prog CUDA Runtime Compilation program.
|
| 235 |
+
* \param [out] ptxSizeRet Size of the generated PTX (including the trailing
|
| 236 |
+
* \c NULL).
|
| 237 |
+
* \return
|
| 238 |
+
* - \link #nvrtcResult NVRTC_SUCCESS \endlink
|
| 239 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
|
| 240 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
|
| 241 |
+
*
|
| 242 |
+
* \see ::nvrtcGetPTX
|
| 243 |
+
*/
|
| 244 |
+
nvrtcResult nvrtcGetPTXSize(nvrtcProgram prog, size_t *ptxSizeRet);
|
| 245 |
+
|
| 246 |
+
|
| 247 |
+
/**
|
| 248 |
+
* \ingroup compilation
|
| 249 |
+
* \brief nvrtcGetPTX stores the PTX generated by the previous compilation
|
| 250 |
+
* of \p prog in the memory pointed by \p ptx.
|
| 251 |
+
*
|
| 252 |
+
* \param [in] prog CUDA Runtime Compilation program.
|
| 253 |
+
* \param [out] ptx Compiled result.
|
| 254 |
+
* \return
|
| 255 |
+
* - \link #nvrtcResult NVRTC_SUCCESS \endlink
|
| 256 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
|
| 257 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
|
| 258 |
+
*
|
| 259 |
+
* \see ::nvrtcGetPTXSize
|
| 260 |
+
*/
|
| 261 |
+
nvrtcResult nvrtcGetPTX(nvrtcProgram prog, char *ptx);
|
| 262 |
+
|
| 263 |
+
|
| 264 |
+
/**
|
| 265 |
+
* \ingroup compilation
|
| 266 |
+
* \brief nvrtcGetCUBINSize sets the value of \p cubinSizeRet with the size of the cubin
|
| 267 |
+
* generated by the previous compilation of \p prog. The value of
|
| 268 |
+
* cubinSizeRet is set to 0 if the value specified to \c -arch is a
|
| 269 |
+
* virtual architecture instead of an actual architecture.
|
| 270 |
+
*
|
| 271 |
+
* \param [in] prog CUDA Runtime Compilation program.
|
| 272 |
+
* \param [out] cubinSizeRet Size of the generated cubin.
|
| 273 |
+
* \return
|
| 274 |
+
* - \link #nvrtcResult NVRTC_SUCCESS \endlink
|
| 275 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
|
| 276 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
|
| 277 |
+
*
|
| 278 |
+
* \see ::nvrtcGetCUBIN
|
| 279 |
+
*/
|
| 280 |
+
nvrtcResult nvrtcGetCUBINSize(nvrtcProgram prog, size_t *cubinSizeRet);
|
| 281 |
+
|
| 282 |
+
|
| 283 |
+
/**
|
| 284 |
+
* \ingroup compilation
|
| 285 |
+
* \brief nvrtcGetCUBIN stores the cubin generated by the previous compilation
|
| 286 |
+
* of \p prog in the memory pointed by \p cubin. No cubin is available
|
| 287 |
+
* if the value specified to \c -arch is a virtual architecture instead
|
| 288 |
+
* of an actual architecture.
|
| 289 |
+
*
|
| 290 |
+
* \param [in] prog CUDA Runtime Compilation program.
|
| 291 |
+
* \param [out] cubin Compiled and assembled result.
|
| 292 |
+
* \return
|
| 293 |
+
* - \link #nvrtcResult NVRTC_SUCCESS \endlink
|
| 294 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
|
| 295 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
|
| 296 |
+
*
|
| 297 |
+
* \see ::nvrtcGetCUBINSize
|
| 298 |
+
*/
|
| 299 |
+
nvrtcResult nvrtcGetCUBIN(nvrtcProgram prog, char *cubin);
|
| 300 |
+
|
| 301 |
+
|
| 302 |
+
#if defined(_WIN32)
|
| 303 |
+
# define __DEPRECATED__(msg) __declspec(deprecated(msg))
|
| 304 |
+
#elif (defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5 && !defined(__clang__))))
|
| 305 |
+
# define __DEPRECATED__(msg) __attribute__((deprecated))
|
| 306 |
+
#elif (defined(__GNUC__))
|
| 307 |
+
# define __DEPRECATED__(msg) __attribute__((deprecated(msg)))
|
| 308 |
+
#else
|
| 309 |
+
# define __DEPRECATED__(msg)
|
| 310 |
+
#endif
|
| 311 |
+
|
| 312 |
+
/**
|
| 313 |
+
* \ingroup compilation
|
| 314 |
+
* \brief
|
| 315 |
+
* DEPRECATION NOTICE: This function will be removed in a future release. Please use
|
| 316 |
+
* nvrtcGetLTOIRSize (and nvrtcGetLTOIR) instead.
|
| 317 |
+
*/
|
| 318 |
+
__DEPRECATED__("This function will be removed in a future release. Please use nvrtcGetLTOIRSize instead")
|
| 319 |
+
nvrtcResult nvrtcGetNVVMSize(nvrtcProgram prog, size_t *nvvmSizeRet);
|
| 320 |
+
|
| 321 |
+
/**
|
| 322 |
+
* \ingroup compilation
|
| 323 |
+
* \brief
|
| 324 |
+
* DEPRECATION NOTICE: This function will be removed in a future release. Please use
|
| 325 |
+
* nvrtcGetLTOIR (and nvrtcGetLTOIRSize) instead.
|
| 326 |
+
*/
|
| 327 |
+
__DEPRECATED__("This function will be removed in a future release. Please use nvrtcGetLTOIR instead")
|
| 328 |
+
nvrtcResult nvrtcGetNVVM(nvrtcProgram prog, char *nvvm);
|
| 329 |
+
|
| 330 |
+
#undef __DEPRECATED__
|
| 331 |
+
|
| 332 |
+
/**
|
| 333 |
+
* \ingroup compilation
|
| 334 |
+
* \brief nvrtcGetLTOIRSize sets the value of \p LTOIRSizeRet with the size of the LTO IR
|
| 335 |
+
* generated by the previous compilation of \p prog. The value of
|
| 336 |
+
* LTOIRSizeRet is set to 0 if the program was not compiled with
|
| 337 |
+
* \c -dlto.
|
| 338 |
+
*
|
| 339 |
+
* \param [in] prog CUDA Runtime Compilation program.
|
| 340 |
+
* \param [out] LTOIRSizeRet Size of the generated LTO IR.
|
| 341 |
+
* \return
|
| 342 |
+
* - \link #nvrtcResult NVRTC_SUCCESS \endlink
|
| 343 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
|
| 344 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
|
| 345 |
+
*
|
| 346 |
+
* \see ::nvrtcGetLTOIR
|
| 347 |
+
*/
|
| 348 |
+
nvrtcResult nvrtcGetLTOIRSize(nvrtcProgram prog, size_t *LTOIRSizeRet);
|
| 349 |
+
|
| 350 |
+
|
| 351 |
+
/**
|
| 352 |
+
* \ingroup compilation
|
| 353 |
+
* \brief nvrtcGetLTOIR stores the LTO IR generated by the previous compilation
|
| 354 |
+
* of \p prog in the memory pointed by \p LTOIR. No LTO IR is available
|
| 355 |
+
* if the program was compiled without \c -dlto.
|
| 356 |
+
*
|
| 357 |
+
* \param [in] prog CUDA Runtime Compilation program.
|
| 358 |
+
* \param [out] LTOIR Compiled result.
|
| 359 |
+
* \return
|
| 360 |
+
* - \link #nvrtcResult NVRTC_SUCCESS \endlink
|
| 361 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
|
| 362 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
|
| 363 |
+
*
|
| 364 |
+
* \see ::nvrtcGetLTOIRSize
|
| 365 |
+
*/
|
| 366 |
+
nvrtcResult nvrtcGetLTOIR(nvrtcProgram prog, char *LTOIR);
|
| 367 |
+
|
| 368 |
+
|
| 369 |
+
/**
|
| 370 |
+
* \ingroup compilation
|
| 371 |
+
* \brief nvrtcGetOptiXIRSize sets the value of \p optixirSizeRet with the size of the OptiX IR
|
| 372 |
+
* generated by the previous compilation of \p prog. The value of
|
| 373 |
+
* nvrtcGetOptiXIRSize is set to 0 if the program was compiled with
|
| 374 |
+
* options incompatible with OptiX IR generation.
|
| 375 |
+
*
|
| 376 |
+
* \param [in] prog CUDA Runtime Compilation program.
|
| 377 |
+
* \param [out] optixirSizeRet Size of the generated LTO IR.
|
| 378 |
+
* \return
|
| 379 |
+
* - \link #nvrtcResult NVRTC_SUCCESS \endlink
|
| 380 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
|
| 381 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
|
| 382 |
+
*
|
| 383 |
+
* \see ::nvrtcGetOptiXIR
|
| 384 |
+
*/
|
| 385 |
+
nvrtcResult nvrtcGetOptiXIRSize(nvrtcProgram prog, size_t *optixirSizeRet);
|
| 386 |
+
|
| 387 |
+
|
| 388 |
+
/**
|
| 389 |
+
* \ingroup compilation
|
| 390 |
+
* \brief nvrtcGetOptiXIR stores the OptiX IR generated by the previous compilation
|
| 391 |
+
* of \p prog in the memory pointed by \p optixir. No OptiX IR is available
|
| 392 |
+
* if the program was compiled with options incompatible with OptiX IR generation.
|
| 393 |
+
*
|
| 394 |
+
* \param [in] prog CUDA Runtime Compilation program.
|
| 395 |
+
* \param [out] Optix IR Compiled result.
|
| 396 |
+
* \return
|
| 397 |
+
* - \link #nvrtcResult NVRTC_SUCCESS \endlink
|
| 398 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
|
| 399 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
|
| 400 |
+
*
|
| 401 |
+
* \see ::nvrtcGetOptiXIRSize
|
| 402 |
+
*/
|
| 403 |
+
nvrtcResult nvrtcGetOptiXIR(nvrtcProgram prog, char *optixir);
|
| 404 |
+
|
| 405 |
+
/**
|
| 406 |
+
* \ingroup compilation
|
| 407 |
+
* \brief nvrtcGetProgramLogSize sets \p logSizeRet with the size of the
|
| 408 |
+
* log generated by the previous compilation of \p prog (including the
|
| 409 |
+
* trailing \c NULL).
|
| 410 |
+
*
|
| 411 |
+
* Note that compilation log may be generated with warnings and informative
|
| 412 |
+
* messages, even when the compilation of \p prog succeeds.
|
| 413 |
+
*
|
| 414 |
+
* \param [in] prog CUDA Runtime Compilation program.
|
| 415 |
+
* \param [out] logSizeRet Size of the compilation log
|
| 416 |
+
* (including the trailing \c NULL).
|
| 417 |
+
* \return
|
| 418 |
+
* - \link #nvrtcResult NVRTC_SUCCESS \endlink
|
| 419 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
|
| 420 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
|
| 421 |
+
*
|
| 422 |
+
* \see ::nvrtcGetProgramLog
|
| 423 |
+
*/
|
| 424 |
+
nvrtcResult nvrtcGetProgramLogSize(nvrtcProgram prog, size_t *logSizeRet);
|
| 425 |
+
|
| 426 |
+
|
| 427 |
+
/**
|
| 428 |
+
* \ingroup compilation
|
| 429 |
+
* \brief nvrtcGetProgramLog stores the log generated by the previous
|
| 430 |
+
* compilation of \p prog in the memory pointed by \p log.
|
| 431 |
+
*
|
| 432 |
+
* \param [in] prog CUDA Runtime Compilation program.
|
| 433 |
+
* \param [out] log Compilation log.
|
| 434 |
+
* \return
|
| 435 |
+
* - \link #nvrtcResult NVRTC_SUCCESS \endlink
|
| 436 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
|
| 437 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
|
| 438 |
+
*
|
| 439 |
+
* \see ::nvrtcGetProgramLogSize
|
| 440 |
+
*/
|
| 441 |
+
nvrtcResult nvrtcGetProgramLog(nvrtcProgram prog, char *log);
|
| 442 |
+
|
| 443 |
+
|
| 444 |
+
/**
|
| 445 |
+
* \ingroup compilation
|
| 446 |
+
* \brief nvrtcAddNameExpression notes the given name expression
|
| 447 |
+
* denoting the address of a __global__ function
|
| 448 |
+
* or __device__/__constant__ variable.
|
| 449 |
+
*
|
| 450 |
+
* The identical name expression string must be provided on a subsequent
|
| 451 |
+
* call to nvrtcGetLoweredName to extract the lowered name.
|
| 452 |
+
* \param [in] prog CUDA Runtime Compilation program.
|
| 453 |
+
* \param [in] name_expression constant expression denoting the address of
|
| 454 |
+
* a __global__ function or __device__/__constant__ variable.
|
| 455 |
+
* \return
|
| 456 |
+
* - \link #nvrtcResult NVRTC_SUCCESS \endlink
|
| 457 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
|
| 458 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
|
| 459 |
+
* - \link #nvrtcResult NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION \endlink
|
| 460 |
+
*
|
| 461 |
+
* \see ::nvrtcGetLoweredName
|
| 462 |
+
*/
|
| 463 |
+
nvrtcResult nvrtcAddNameExpression(nvrtcProgram prog,
|
| 464 |
+
const char * const name_expression);
|
| 465 |
+
|
| 466 |
+
/**
|
| 467 |
+
* \ingroup compilation
|
| 468 |
+
* \brief nvrtcGetLoweredName extracts the lowered (mangled) name
|
| 469 |
+
* for a __global__ function or __device__/__constant__ variable,
|
| 470 |
+
* and updates *lowered_name to point to it. The memory containing
|
| 471 |
+
* the name is released when the NVRTC program is destroyed by
|
| 472 |
+
* nvrtcDestroyProgram.
|
| 473 |
+
* The identical name expression must have been previously
|
| 474 |
+
* provided to nvrtcAddNameExpression.
|
| 475 |
+
*
|
| 476 |
+
* \param [in] prog CUDA Runtime Compilation program.
|
| 477 |
+
* \param [in] name_expression constant expression denoting the address of
|
| 478 |
+
* a __global__ function or __device__/__constant__ variable.
|
| 479 |
+
* \param [out] lowered_name initialized by the function to point to a
|
| 480 |
+
* C string containing the lowered (mangled)
|
| 481 |
+
* name corresponding to the provided name expression.
|
| 482 |
+
* \return
|
| 483 |
+
* - \link #nvrtcResult NVRTC_SUCCESS \endlink
|
| 484 |
+
* - \link #nvrtcResult NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION \endlink
|
| 485 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
|
| 486 |
+
* - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
|
| 487 |
+
* - \link #nvrtcResult NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID \endlink
|
| 488 |
+
*
|
| 489 |
+
* \see ::nvrtcAddNameExpression
|
| 490 |
+
*/
|
| 491 |
+
nvrtcResult nvrtcGetLoweredName(nvrtcProgram prog,
|
| 492 |
+
const char *const name_expression,
|
| 493 |
+
const char** lowered_name);
|
| 494 |
+
|
| 495 |
+
|
| 496 |
+
/**
|
| 497 |
+
* \defgroup options Supported Compile Options
|
| 498 |
+
*
|
| 499 |
+
* NVRTC supports the compile options below.
|
| 500 |
+
* Option names with two preceding dashs (\c --) are long option names and
|
| 501 |
+
* option names with one preceding dash (\c -) are short option names.
|
| 502 |
+
* Short option names can be used instead of long option names.
|
| 503 |
+
* When a compile option takes an argument, an assignment operator (\c =)
|
| 504 |
+
* is used to separate the compile option argument from the compile option
|
| 505 |
+
* name, e.g., \c "--gpu-architecture=compute_60".
|
| 506 |
+
* Alternatively, the compile option name and the argument can be specified in
|
| 507 |
+
* separate strings without an assignment operator, .e.g,
|
| 508 |
+
* \c "--gpu-architecture" \c "compute_60".
|
| 509 |
+
* Single-character short option names, such as \c -D, \c -U, and \c -I, do
|
| 510 |
+
* not require an assignment operator, and the compile option name and the
|
| 511 |
+
* argument can be present in the same string with or without spaces between
|
| 512 |
+
* them.
|
| 513 |
+
* For instance, \c "-D=<def>", \c "-D<def>", and \c "-D <def>" are all
|
| 514 |
+
* supported.
|
| 515 |
+
*
|
| 516 |
+
* The valid compiler options are:
|
| 517 |
+
*
|
| 518 |
+
* - Compilation targets
|
| 519 |
+
* - \c --gpu-architecture=\<arch\> (\c -arch)\n
|
| 520 |
+
* Specify the name of the class of GPU architectures for which the
|
| 521 |
+
* input must be compiled.\n
|
| 522 |
+
* - Valid <c>\<arch\></c>s:
|
| 523 |
+
* - \c compute_50
|
| 524 |
+
* - \c compute_52
|
| 525 |
+
* - \c compute_53
|
| 526 |
+
* - \c compute_60
|
| 527 |
+
* - \c compute_61
|
| 528 |
+
* - \c compute_62
|
| 529 |
+
* - \c compute_70
|
| 530 |
+
* - \c compute_72
|
| 531 |
+
* - \c compute_75
|
| 532 |
+
* - \c compute_80
|
| 533 |
+
* - \c compute_87
|
| 534 |
+
* - \c compute_89
|
| 535 |
+
* - \c compute_90
|
| 536 |
+
* - \c compute_90a
|
| 537 |
+
* - \c sm_50
|
| 538 |
+
* - \c sm_52
|
| 539 |
+
* - \c sm_53
|
| 540 |
+
* - \c sm_60
|
| 541 |
+
* - \c sm_61
|
| 542 |
+
* - \c sm_62
|
| 543 |
+
* - \c sm_70
|
| 544 |
+
* - \c sm_72
|
| 545 |
+
* - \c sm_75
|
| 546 |
+
* - \c sm_80
|
| 547 |
+
* - \c sm_87
|
| 548 |
+
* - \c sm_89
|
| 549 |
+
* - \c sm_90
|
| 550 |
+
* - \c sm_90a
|
| 551 |
+
* - Default: \c compute_52
|
| 552 |
+
* - Separate compilation / whole-program compilation
|
| 553 |
+
* - \c --device-c (\c -dc)\n
|
| 554 |
+
* Generate relocatable code that can be linked with other relocatable
|
| 555 |
+
* device code. It is equivalent to --relocatable-device-code=true.
|
| 556 |
+
* - \c --device-w (\c -dw)\n
|
| 557 |
+
* Generate non-relocatable code. It is equivalent to
|
| 558 |
+
* \c --relocatable-device-code=false.
|
| 559 |
+
* - \c --relocatable-device-code={true|false} (\c -rdc)\n
|
| 560 |
+
* Enable (disable) the generation of relocatable device code.
|
| 561 |
+
* - Default: \c false
|
| 562 |
+
* - \c --extensible-whole-program (\c -ewp)\n
|
| 563 |
+
* Do extensible whole program compilation of device code.
|
| 564 |
+
* - Default: \c false
|
| 565 |
+
* - Debugging support
|
| 566 |
+
* - \c --device-debug (\c -G)\n
|
| 567 |
+
* Generate debug information. If --dopt is not specified,
|
| 568 |
+
* then turns off all optimizations.
|
| 569 |
+
* - \c --generate-line-info (\c -lineinfo)\n
|
| 570 |
+
* Generate line-number information.
|
| 571 |
+
* - Code generation
|
| 572 |
+
* - \c --dopt on (\c -dopt)\n
|
| 573 |
+
* - \c --dopt=on \n
|
| 574 |
+
* Enable device code optimization. When specified along with '-G', enables
|
| 575 |
+
* limited debug information generation for optimized device code (currently,
|
| 576 |
+
* only line number information).
|
| 577 |
+
* When '-G' is not specified, '-dopt=on' is implicit.
|
| 578 |
+
* - \c --ptxas-options \<options\> (\c -Xptxas)\n
|
| 579 |
+
* - \c --ptxas-options=\<options\> \n
|
| 580 |
+
* Specify options directly to ptxas, the PTX optimizing assembler.
|
| 581 |
+
* - \c --maxrregcount=\<N\> (\c -maxrregcount)\n
|
| 582 |
+
* Specify the maximum amount of registers that GPU functions can use.
|
| 583 |
+
* Until a function-specific limit, a higher value will generally
|
| 584 |
+
* increase the performance of individual GPU threads that execute this
|
| 585 |
+
* function. However, because thread registers are allocated from a
|
| 586 |
+
* global register pool on each GPU, a higher value of this option will
|
| 587 |
+
* also reduce the maximum thread block size, thereby reducing the amount
|
| 588 |
+
* of thread parallelism. Hence, a good maxrregcount value is the result
|
| 589 |
+
* of a trade-off. If this option is not specified, then no maximum is
|
| 590 |
+
* assumed. Value less than the minimum registers required by ABI will
|
| 591 |
+
* be bumped up by the compiler to ABI minimum limit.
|
| 592 |
+
* - \c --ftz={true|false} (\c -ftz)\n
|
| 593 |
+
* When performing single-precision floating-point operations, flush
|
| 594 |
+
* denormal values to zero or preserve denormal values.
|
| 595 |
+
* \c --use_fast_math implies \c --ftz=true.
|
| 596 |
+
* - Default: \c false
|
| 597 |
+
* - \c --prec-sqrt={true|false} (\c -prec-sqrt)\n
|
| 598 |
+
* For single-precision floating-point square root, use IEEE
|
| 599 |
+
* round-to-nearest mode or use a faster approximation.
|
| 600 |
+
* \c --use_fast_math implies \c --prec-sqrt=false.
|
| 601 |
+
* - Default: \c true
|
| 602 |
+
* - \c --prec-div={true|false} (\c -prec-div)\n
|
| 603 |
+
* For single-precision floating-point division and reciprocals, use IEEE
|
| 604 |
+
* round-to-nearest mode or use a faster approximation.
|
| 605 |
+
* \c --use_fast_math implies \c --prec-div=false.
|
| 606 |
+
* - Default: \c true
|
| 607 |
+
* - \c --fmad={true|false} (\c -fmad)\n
|
| 608 |
+
* Enables (disables) the contraction of floating-point multiplies and
|
| 609 |
+
* adds/subtracts into floating-point multiply-add operations (FMAD,
|
| 610 |
+
* FFMA, or DFMA). \c --use_fast_math implies \c --fmad=true.
|
| 611 |
+
* - Default: \c true
|
| 612 |
+
* - \c --use_fast_math (\c -use_fast_math)\n
|
| 613 |
+
* Make use of fast math operations.
|
| 614 |
+
* \c --use_fast_math implies \c --ftz=true \c --prec-div=false
|
| 615 |
+
* \c --prec-sqrt=false \c --fmad=true.
|
| 616 |
+
* - \c --extra-device-vectorization (\c -extra-device-vectorization)\n
|
| 617 |
+
* Enables more aggressive device code vectorization in the NVVM optimizer.
|
| 618 |
+
* - \c --modify-stack-limit={true|false} (\c -modify-stack-limit)\n
|
| 619 |
+
* On Linux, during compilation, use \c setrlimit() to increase stack size
|
| 620 |
+
* to maximum allowed. The limit is reset to the previous value at the
|
| 621 |
+
* end of compilation.
|
| 622 |
+
* Note: \c setrlimit() changes the value for the entire process.
|
| 623 |
+
* - Default: \c true
|
| 624 |
+
* - \c --dlink-time-opt (\c -dlto)\n
|
| 625 |
+
* Generate intermediate code for later link-time optimization.
|
| 626 |
+
* It implies \c -rdc=true.
|
| 627 |
+
* Note: when this option is used the nvrtcGetLTOIR API should be used,
|
| 628 |
+
* as PTX or Cubin will not be generated.
|
| 629 |
+
* - \c --gen-opt-lto (\c -gen-opt-lto)\n
|
| 630 |
+
* Run the optimizer passes before generating the LTO IR.
|
| 631 |
+
* - \c --optix-ir (\c -optix-ir)\n
|
| 632 |
+
* Generate OptiX IR. The Optix IR is only intended for consumption by OptiX
|
| 633 |
+
* through appropriate APIs. This feature is not supported with
|
| 634 |
+
* link-time-optimization (\c -dlto)\n.
|
| 635 |
+
* Note: when this option is used the nvrtcGetOptiX API should be used,
|
| 636 |
+
* as PTX or Cubin will not be generated.
|
| 637 |
+
* - \c --jump-table-density=[0-101] (\c -jtd)\n
|
| 638 |
+
* Specify the case density percentage in switch statements, and use it as
|
| 639 |
+
* a minimal threshold to determine whether jump table(brx.idx instruction)
|
| 640 |
+
* will be used to implement a switch statement. Default value is 101. The
|
| 641 |
+
* percentage ranges from 0 to 101 inclusively.
|
| 642 |
+
* - \c --device-stack-protector={true|false} (\c -device-stack-protector)\n
|
| 643 |
+
* Enable (disable) the generation of stack canaries in device code.\n
|
| 644 |
+
* - Default: \c false
|
| 645 |
+
* - Preprocessing
|
| 646 |
+
* - \c --define-macro=\<def\> (\c -D)\n
|
| 647 |
+
* \c \<def\> can be either \c \<name\> or \c \<name=definitions\>.
|
| 648 |
+
* - \c \<name\> \n
|
| 649 |
+
* Predefine \c \<name\> as a macro with definition \c 1.
|
| 650 |
+
* - \c \<name\>=\<definition\> \n
|
| 651 |
+
* The contents of \c \<definition\> are tokenized and preprocessed
|
| 652 |
+
* as if they appeared during translation phase three in a \c \#define
|
| 653 |
+
* directive. In particular, the definition will be truncated by
|
| 654 |
+
* embedded new line characters.
|
| 655 |
+
* - \c --undefine-macro=\<def\> (\c -U)\n
|
| 656 |
+
* Cancel any previous definition of \c \<def\>.
|
| 657 |
+
* - \c --include-path=\<dir\> (\c -I)\n
|
| 658 |
+
* Add the directory \c \<dir\> to the list of directories to be
|
| 659 |
+
* searched for headers. These paths are searched after the list of
|
| 660 |
+
* headers given to ::nvrtcCreateProgram.
|
| 661 |
+
* - \c --pre-include=\<header\> (\c -include)\n
|
| 662 |
+
* Preinclude \c \<header\> during preprocessing.
|
| 663 |
+
* - \c --no-source-include (\c -no-source-include)
|
| 664 |
+
* The preprocessor by default adds the directory of each input sources
|
| 665 |
+
* to the include path. This option disables this feature and only
|
| 666 |
+
* considers the path specified explicitly.
|
| 667 |
+
* - Language Dialect
|
| 668 |
+
* - \c --std={c++03|c++11|c++14|c++17|c++20}
|
| 669 |
+
* (\c -std={c++11|c++14|c++17|c++20})\n
|
| 670 |
+
* Set language dialect to C++03, C++11, C++14, C++17 or C++20
|
| 671 |
+
* - Default: \c c++17
|
| 672 |
+
* - \c --builtin-move-forward={true|false} (\c -builtin-move-forward)\n
|
| 673 |
+
* Provide builtin definitions of \c std::move and \c std::forward,
|
| 674 |
+
* when C++11 or later language dialect is selected.
|
| 675 |
+
* - Default: \c true
|
| 676 |
+
* - \c --builtin-initializer-list={true|false}
|
| 677 |
+
* (\c -builtin-initializer-list)\n
|
| 678 |
+
* Provide builtin definitions of \c std::initializer_list class and
|
| 679 |
+
* member functions when C++11 or later language dialect is selected.
|
| 680 |
+
* - Default: \c true
|
| 681 |
+
* - Misc.
|
| 682 |
+
* - \c --disable-warnings (\c -w)\n
|
| 683 |
+
* Inhibit all warning messages.
|
| 684 |
+
* - \c --restrict (\c -restrict)\n
|
| 685 |
+
* Programmer assertion that all kernel pointer parameters are restrict
|
| 686 |
+
* pointers.
|
| 687 |
+
* - \c --device-as-default-execution-space
|
| 688 |
+
* (\c -default-device)\n
|
| 689 |
+
* Treat entities with no execution space annotation as \c __device__
|
| 690 |
+
* entities.
|
| 691 |
+
* - \c --device-int128 (\c -device-int128)\n
|
| 692 |
+
* Allow the \c __int128 type in device code. Also causes the macro \c __CUDACC_RTC_INT128__
|
| 693 |
+
* to be defined.
|
| 694 |
+
* - \c --optimization-info=\<kind\> (\c -opt-info)\n
|
| 695 |
+
* Provide optimization reports for the specified kind of optimization.
|
| 696 |
+
* The following kind tags are supported:
|
| 697 |
+
* - \c inline : emit a remark when a function is inlined.
|
| 698 |
+
* - \c --display-error-number (\c -err-no)\n
|
| 699 |
+
* Display diagnostic number for warning messages. (Default)
|
| 700 |
+
* - \c --no-display-error-number (\c -no-err-no)\n
|
| 701 |
+
* Disables the display of a diagnostic number for warning messages.
|
| 702 |
+
* - \c --diag-error=<error-number>,... (\c -diag-error)\n
|
| 703 |
+
* Emit error for specified diagnostic message number(s). Message numbers can be separated by comma.
|
| 704 |
+
* - \c --diag-suppress=<error-number>,... (\c -diag-suppress)\n
|
| 705 |
+
* Suppress specified diagnostic message number(s). Message numbers can be separated by comma.
|
| 706 |
+
* - \c --diag-warn=<error-number>,... (\c -diag-warn)\n
|
| 707 |
+
* Emit warning for specified diagnostic message number(s). Message numbers can be separated by comma.
|
| 708 |
+
* - \c --brief-diagnostics={true|false} (\c -brief-diag)\n
|
| 709 |
+
* This option disables or enables showing source line and column info
|
| 710 |
+
* in a diagnostic.
|
| 711 |
+
* The --brief-diagnostics=true will not show the source line and column info.
|
| 712 |
+
* - Default: \c false
|
| 713 |
+
* - \c --time=<file-name> (\c -time)\n
|
| 714 |
+
* Generate a comma separated value table with the time taken by each compilation
|
| 715 |
+
* phase, and append it at the end of the file given as the option argument.
|
| 716 |
+
* If the file does not exist, the column headings are generated in the first row
|
| 717 |
+
* of the table. If the file name is '-', the timing data is written to the compilation log.
|
| 718 |
+
* - \c --split-compile=<number of threads> (\c -split-compile=<number of threads>)\n
|
| 719 |
+
* Perform compiler optimizations in parallel.
|
| 720 |
+
* Split compilation attempts to reduce compile time by enabling the compiler to run certain
|
| 721 |
+
* optimization passes concurrently. This option accepts a numerical value that specifies the
|
| 722 |
+
* maximum number of threads the compiler can use. One can also allow the compiler to use the maximum
|
| 723 |
+
* threads available on the system by setting --split-compile=0.
|
| 724 |
+
* Setting --split-compile=1 will cause this option to be ignored.
|
| 725 |
+
* - \c --fdevice-syntax-only (\c -fdevice-syntax-only)\n
|
| 726 |
+
* Ends device compilation after front-end syntax checking. This option does not generate valid
|
| 727 |
+
* device code.
|
| 728 |
+
* - \c --minimal (\c -minimal)\n
|
| 729 |
+
* Omit certain language features to reduce compile time for small programs.
|
| 730 |
+
* In particular, the following are omitted:
|
| 731 |
+
* - Texture and surface functions and associated types, e.g., \c cudaTextureObject_t.
|
| 732 |
+
* - CUDA Runtime Functions that are provided by the cudadevrt device code library,
|
| 733 |
+
* typically named with prefix "cuda", e.g., \c cudaMalloc.
|
| 734 |
+
* - Kernel launch from device code.
|
| 735 |
+
* - Types and macros associated with CUDA Runtime and Driver APIs,
|
| 736 |
+
* provided by cuda/tools/cudart/driver_types.h, typically named with prefix "cuda", e.g., \c cudaError_t.
|
| 737 |
+
* - \c --device-stack-protector (\c -device-stack-protector)\n
|
| 738 |
+
* Enable stack canaries in device code.
|
| 739 |
+
* Stack canaries make it more difficult to exploit certain types of memory safety bugs involving stack-local variables.
|
| 740 |
+
* The compiler uses heuristics to assess the risk of such a bug in each function. Only those functions which are deemed high-risk make use of a stack canary.
|
| 741 |
+
*
|
| 742 |
+
*/
|
| 743 |
+
|
| 744 |
+
#ifdef __cplusplus
|
| 745 |
+
}
|
| 746 |
+
#endif /* __cplusplus */
|
| 747 |
+
|
| 748 |
+
|
| 749 |
+
/* The utility function 'nvrtcGetTypeName' is not available by default. Define
|
| 750 |
+
the macro 'NVRTC_GET_TYPE_NAME' to a non-zero value to make it available.
|
| 751 |
+
*/
|
| 752 |
+
|
| 753 |
+
#if NVRTC_GET_TYPE_NAME || __DOXYGEN_ONLY__
|
| 754 |
+
|
| 755 |
+
#if NVRTC_USE_CXXABI || __clang__ || __GNUC__ || __DOXYGEN_ONLY__
|
| 756 |
+
#include <cxxabi.h>
|
| 757 |
+
#include <cstdlib>
|
| 758 |
+
|
| 759 |
+
#elif defined(_WIN32)
|
| 760 |
+
#include <Windows.h>
|
| 761 |
+
#include <DbgHelp.h>
|
| 762 |
+
#endif /* NVRTC_USE_CXXABI || __clang__ || __GNUC__ */
|
| 763 |
+
|
| 764 |
+
|
| 765 |
+
#include <string>
|
| 766 |
+
#include <typeinfo>
|
| 767 |
+
|
| 768 |
+
template <typename T> struct __nvrtcGetTypeName_helper_t { };
|
| 769 |
+
|
| 770 |
+
/*************************************************************************//**
|
| 771 |
+
*
|
| 772 |
+
* \defgroup hosthelper Host Helper
|
| 773 |
+
*
|
| 774 |
+
* NVRTC defines the following functions for easier interaction with host code.
|
| 775 |
+
*
|
| 776 |
+
****************************************************************************/
|
| 777 |
+
|
| 778 |
+
/**
|
| 779 |
+
* \ingroup hosthelper
|
| 780 |
+
* \brief nvrtcGetTypeName stores the source level name of a type in the given
|
| 781 |
+
* std::string location.
|
| 782 |
+
*
|
| 783 |
+
* This function is only provided when the macro NVRTC_GET_TYPE_NAME is
|
| 784 |
+
* defined with a non-zero value. It uses abi::__cxa_demangle or UnDecorateSymbolName
|
| 785 |
+
* function calls to extract the type name, when using gcc/clang or cl.exe compilers,
|
| 786 |
+
* respectively. If the name extraction fails, it will return NVRTC_INTERNAL_ERROR,
|
| 787 |
+
* otherwise *result is initialized with the extracted name.
|
| 788 |
+
*
|
| 789 |
+
* Windows-specific notes:
|
| 790 |
+
* - nvrtcGetTypeName() is not multi-thread safe because it calls UnDecorateSymbolName(),
|
| 791 |
+
* which is not multi-thread safe.
|
| 792 |
+
* - The returned string may contain Microsoft-specific keywords such as __ptr64 and __cdecl.
|
| 793 |
+
*
|
| 794 |
+
* \param [in] tinfo: reference to object of type std::type_info for a given type.
|
| 795 |
+
* \param [in] result: pointer to std::string in which to store the type name.
|
| 796 |
+
* \return
|
| 797 |
+
* - \link #nvrtcResult NVRTC_SUCCESS \endlink
|
| 798 |
+
* - \link #nvrtcResult NVRTC_ERROR_INTERNAL_ERROR \endlink
|
| 799 |
+
*
|
| 800 |
+
*/
|
| 801 |
+
inline nvrtcResult nvrtcGetTypeName(const std::type_info &tinfo, std::string *result)
|
| 802 |
+
{
|
| 803 |
+
#if USE_CXXABI || __clang__ || __GNUC__
|
| 804 |
+
const char *name = tinfo.name();
|
| 805 |
+
int status;
|
| 806 |
+
char *undecorated_name = abi::__cxa_demangle(name, 0, 0, &status);
|
| 807 |
+
if (status == 0) {
|
| 808 |
+
*result = undecorated_name;
|
| 809 |
+
free(undecorated_name);
|
| 810 |
+
return NVRTC_SUCCESS;
|
| 811 |
+
}
|
| 812 |
+
#elif defined(_WIN32)
|
| 813 |
+
const char *name = tinfo.raw_name();
|
| 814 |
+
if (!name || *name != '.') {
|
| 815 |
+
return NVRTC_ERROR_INTERNAL_ERROR;
|
| 816 |
+
}
|
| 817 |
+
char undecorated_name[4096];
|
| 818 |
+
//name+1 skips over the '.' prefix
|
| 819 |
+
if(UnDecorateSymbolName(name+1, undecorated_name,
|
| 820 |
+
sizeof(undecorated_name) / sizeof(*undecorated_name),
|
| 821 |
+
//note: doesn't seem to work correctly without UNDNAME_NO_ARGUMENTS.
|
| 822 |
+
UNDNAME_NO_ARGUMENTS | UNDNAME_NAME_ONLY ) ) {
|
| 823 |
+
*result = undecorated_name;
|
| 824 |
+
return NVRTC_SUCCESS;
|
| 825 |
+
}
|
| 826 |
+
#endif /* USE_CXXABI || __clang__ || __GNUC__ */
|
| 827 |
+
|
| 828 |
+
return NVRTC_ERROR_INTERNAL_ERROR;
|
| 829 |
+
}
|
| 830 |
+
|
| 831 |
+
/**
|
| 832 |
+
* \ingroup hosthelper
|
| 833 |
+
* \brief nvrtcGetTypeName stores the source level name of the template type argument
|
| 834 |
+
* T in the given std::string location.
|
| 835 |
+
*
|
| 836 |
+
* This function is only provided when the macro NVRTC_GET_TYPE_NAME is
|
| 837 |
+
* defined with a non-zero value. It uses abi::__cxa_demangle or UnDecorateSymbolName
|
| 838 |
+
* function calls to extract the type name, when using gcc/clang or cl.exe compilers,
|
| 839 |
+
* respectively. If the name extraction fails, it will return NVRTC_INTERNAL_ERROR,
|
| 840 |
+
* otherwise *result is initialized with the extracted name.
|
| 841 |
+
*
|
| 842 |
+
* Windows-specific notes:
|
| 843 |
+
* - nvrtcGetTypeName() is not multi-thread safe because it calls UnDecorateSymbolName(),
|
| 844 |
+
* which is not multi-thread safe.
|
| 845 |
+
* - The returned string may contain Microsoft-specific keywords such as __ptr64 and __cdecl.
|
| 846 |
+
*
|
| 847 |
+
* \param [in] result: pointer to std::string in which to store the type name.
|
| 848 |
+
* \return
|
| 849 |
+
* - \link #nvrtcResult NVRTC_SUCCESS \endlink
|
| 850 |
+
* - \link #nvrtcResult NVRTC_ERROR_INTERNAL_ERROR \endlink
|
| 851 |
+
*
|
| 852 |
+
*/
|
| 853 |
+
|
| 854 |
+
template <typename T>
|
| 855 |
+
nvrtcResult nvrtcGetTypeName(std::string *result)
|
| 856 |
+
{
|
| 857 |
+
nvrtcResult res = nvrtcGetTypeName(typeid(__nvrtcGetTypeName_helper_t<T>),
|
| 858 |
+
result);
|
| 859 |
+
if (res != NVRTC_SUCCESS)
|
| 860 |
+
return res;
|
| 861 |
+
|
| 862 |
+
std::string repr = *result;
|
| 863 |
+
std::size_t idx = repr.find("__nvrtcGetTypeName_helper_t");
|
| 864 |
+
idx = (idx != std::string::npos) ? repr.find("<", idx) : idx;
|
| 865 |
+
std::size_t last_idx = repr.find_last_of('>');
|
| 866 |
+
if (idx == std::string::npos || last_idx == std::string::npos) {
|
| 867 |
+
return NVRTC_ERROR_INTERNAL_ERROR;
|
| 868 |
+
}
|
| 869 |
+
++idx;
|
| 870 |
+
*result = repr.substr(idx, last_idx - idx);
|
| 871 |
+
return NVRTC_SUCCESS;
|
| 872 |
+
}
|
| 873 |
+
|
| 874 |
+
#endif /* NVRTC_GET_TYPE_NAME */
|
| 875 |
+
|
| 876 |
+
#endif /* __NVRTC_H__ */
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_nvrtc/lib/__init__.py
ADDED
|
File without changes
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/__init__.py
ADDED
|
File without changes
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/__init__.py
ADDED
|
File without changes
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/builtin_types.h
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1993-2014 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO LICENSEE:
|
| 5 |
+
*
|
| 6 |
+
* This source code and/or documentation ("Licensed Deliverables") are
|
| 7 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 8 |
+
* international Copyright laws.
|
| 9 |
+
*
|
| 10 |
+
* These Licensed Deliverables contained herein is PROPRIETARY and
|
| 11 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and
|
| 12 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 13 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 14 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 15 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 16 |
+
* of the Licensed Deliverables to any third party without the express
|
| 17 |
+
* written consent of NVIDIA is prohibited.
|
| 18 |
+
*
|
| 19 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 20 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 21 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
|
| 22 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 23 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 24 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 25 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 26 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 27 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 28 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 29 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 30 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 31 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 32 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 33 |
+
*
|
| 34 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 35 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 36 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 37 |
+
* computer software documentation" as such terms are used in 48
|
| 38 |
+
* C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
|
| 39 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 40 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 41 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 42 |
+
* only those rights set forth herein.
|
| 43 |
+
*
|
| 44 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 45 |
+
* software must include, in the user documentation and internal
|
| 46 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 47 |
+
* Users Notice.
|
| 48 |
+
*/
|
| 49 |
+
|
| 50 |
+
/*******************************************************************************
|
| 51 |
+
* *
|
| 52 |
+
* *
|
| 53 |
+
* *
|
| 54 |
+
*******************************************************************************/
|
| 55 |
+
|
| 56 |
+
#include "device_types.h"
|
| 57 |
+
#if !defined(__CUDACC_RTC__)
|
| 58 |
+
#define EXCLUDE_FROM_RTC
|
| 59 |
+
#include "driver_types.h"
|
| 60 |
+
#undef EXCLUDE_FROM_RTC
|
| 61 |
+
#endif /* !__CUDACC_RTC__ */
|
| 62 |
+
#include "surface_types.h"
|
| 63 |
+
#include "texture_types.h"
|
| 64 |
+
#include "vector_types.h"
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/channel_descriptor.h
ADDED
|
@@ -0,0 +1,588 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1993-2012 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO LICENSEE:
|
| 5 |
+
*
|
| 6 |
+
* This source code and/or documentation ("Licensed Deliverables") are
|
| 7 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 8 |
+
* international Copyright laws.
|
| 9 |
+
*
|
| 10 |
+
* These Licensed Deliverables contained herein is PROPRIETARY and
|
| 11 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and
|
| 12 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 13 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 14 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 15 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 16 |
+
* of the Licensed Deliverables to any third party without the express
|
| 17 |
+
* written consent of NVIDIA is prohibited.
|
| 18 |
+
*
|
| 19 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 20 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 21 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
|
| 22 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 23 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 24 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 25 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 26 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 27 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 28 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 29 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 30 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 31 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 32 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 33 |
+
*
|
| 34 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 35 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 36 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 37 |
+
* computer software documentation" as such terms are used in 48
|
| 38 |
+
* C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
|
| 39 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 40 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 41 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 42 |
+
* only those rights set forth herein.
|
| 43 |
+
*
|
| 44 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 45 |
+
* software must include, in the user documentation and internal
|
| 46 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 47 |
+
* Users Notice.
|
| 48 |
+
*/
|
| 49 |
+
|
| 50 |
+
#if !defined(__CHANNEL_DESCRIPTOR_H__)
|
| 51 |
+
#define __CHANNEL_DESCRIPTOR_H__
|
| 52 |
+
|
| 53 |
+
#if defined(__cplusplus)
|
| 54 |
+
|
| 55 |
+
/*******************************************************************************
|
| 56 |
+
* *
|
| 57 |
+
* *
|
| 58 |
+
* *
|
| 59 |
+
*******************************************************************************/
|
| 60 |
+
|
| 61 |
+
#include "cuda_runtime_api.h"
|
| 62 |
+
|
| 63 |
+
/*******************************************************************************
|
| 64 |
+
* *
|
| 65 |
+
* *
|
| 66 |
+
* *
|
| 67 |
+
*******************************************************************************/
|
| 68 |
+
|
| 69 |
+
/**
|
| 70 |
+
* \addtogroup CUDART_HIGHLEVEL
|
| 71 |
+
*
|
| 72 |
+
* @{
|
| 73 |
+
*/
|
| 74 |
+
|
| 75 |
+
/**
|
| 76 |
+
* \brief \hl Returns a channel descriptor using the specified format
|
| 77 |
+
*
|
| 78 |
+
* Returns a channel descriptor with format \p f and number of bits of each
|
| 79 |
+
* component \p x, \p y, \p z, and \p w. The ::cudaChannelFormatDesc is
|
| 80 |
+
* defined as:
|
| 81 |
+
* \code
|
| 82 |
+
struct cudaChannelFormatDesc {
|
| 83 |
+
int x, y, z, w;
|
| 84 |
+
enum cudaChannelFormatKind f;
|
| 85 |
+
};
|
| 86 |
+
* \endcode
|
| 87 |
+
*
|
| 88 |
+
* where ::cudaChannelFormatKind is one of ::cudaChannelFormatKindSigned,
|
| 89 |
+
* ::cudaChannelFormatKindUnsigned, cudaChannelFormatKindFloat,
|
| 90 |
+
* ::cudaChannelFormatKindSignedNormalized8X1, ::cudaChannelFormatKindSignedNormalized8X2,
|
| 91 |
+
* ::cudaChannelFormatKindSignedNormalized8X4,
|
| 92 |
+
* ::cudaChannelFormatKindUnsignedNormalized8X1, ::cudaChannelFormatKindUnsignedNormalized8X2,
|
| 93 |
+
* ::cudaChannelFormatKindUnsignedNormalized8X4,
|
| 94 |
+
* ::cudaChannelFormatKindSignedNormalized16X1, ::cudaChannelFormatKindSignedNormalized16X2,
|
| 95 |
+
* ::cudaChannelFormatKindSignedNormalized16X4,
|
| 96 |
+
* ::cudaChannelFormatKindUnsignedNormalized16X1, ::cudaChannelFormatKindUnsignedNormalized16X2,
|
| 97 |
+
* ::cudaChannelFormatKindUnsignedNormalized16X4
|
| 98 |
+
* or ::cudaChannelFormatKindNV12.
|
| 99 |
+
*
|
| 100 |
+
* The format is specified by the template specialization.
|
| 101 |
+
*
|
| 102 |
+
* The template function specializes for the following scalar types:
|
| 103 |
+
* char, signed char, unsigned char, short, unsigned short, int, unsigned int, long, unsigned long, and float.
|
| 104 |
+
* The template function specializes for the following vector types:
|
| 105 |
+
* char{1|2|4}, uchar{1|2|4}, short{1|2|4}, ushort{1|2|4}, int{1|2|4}, uint{1|2|4}, long{1|2|4}, ulong{1|2|4}, float{1|2|4}.
|
| 106 |
+
* The template function specializes for following cudaChannelFormatKind enum values:
|
| 107 |
+
* ::cudaChannelFormatKind{Uns|S}ignedNormalized{8|16}X{1|2|4}, and ::cudaChannelFormatKindNV12.
|
| 108 |
+
*
|
| 109 |
+
* Invoking the function on a type without a specialization defaults to creating a channel format of kind ::cudaChannelFormatKindNone
|
| 110 |
+
*
|
| 111 |
+
* \return
|
| 112 |
+
* Channel descriptor with format \p f
|
| 113 |
+
*
|
| 114 |
+
* \sa \ref ::cudaCreateChannelDesc(int,int,int,int,cudaChannelFormatKind) "cudaCreateChannelDesc (Low level)",
|
| 115 |
+
* ::cudaGetChannelDesc,
|
| 116 |
+
*/
|
| 117 |
+
template<class T> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc(void)
|
| 118 |
+
{
|
| 119 |
+
return cudaCreateChannelDesc(0, 0, 0, 0, cudaChannelFormatKindNone);
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
static __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDescHalf(void)
|
| 123 |
+
{
|
| 124 |
+
int e = (int)sizeof(unsigned short) * 8;
|
| 125 |
+
|
| 126 |
+
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindFloat);
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
static __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDescHalf1(void)
|
| 130 |
+
{
|
| 131 |
+
int e = (int)sizeof(unsigned short) * 8;
|
| 132 |
+
|
| 133 |
+
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindFloat);
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
static __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDescHalf2(void)
|
| 137 |
+
{
|
| 138 |
+
int e = (int)sizeof(unsigned short) * 8;
|
| 139 |
+
|
| 140 |
+
return cudaCreateChannelDesc(e, e, 0, 0, cudaChannelFormatKindFloat);
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
static __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDescHalf4(void)
|
| 144 |
+
{
|
| 145 |
+
int e = (int)sizeof(unsigned short) * 8;
|
| 146 |
+
|
| 147 |
+
return cudaCreateChannelDesc(e, e, e, e, cudaChannelFormatKindFloat);
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<char>(void)
|
| 151 |
+
{
|
| 152 |
+
int e = (int)sizeof(char) * 8;
|
| 153 |
+
|
| 154 |
+
#if defined(_CHAR_UNSIGNED) || defined(__CHAR_UNSIGNED__)
|
| 155 |
+
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindUnsigned);
|
| 156 |
+
#else /* _CHAR_UNSIGNED || __CHAR_UNSIGNED__ */
|
| 157 |
+
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindSigned);
|
| 158 |
+
#endif /* _CHAR_UNSIGNED || __CHAR_UNSIGNED__ */
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<signed char>(void)
|
| 162 |
+
{
|
| 163 |
+
int e = (int)sizeof(signed char) * 8;
|
| 164 |
+
|
| 165 |
+
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindSigned);
|
| 166 |
+
}
|
| 167 |
+
|
| 168 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<unsigned char>(void)
|
| 169 |
+
{
|
| 170 |
+
int e = (int)sizeof(unsigned char) * 8;
|
| 171 |
+
|
| 172 |
+
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindUnsigned);
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<char1>(void)
|
| 176 |
+
{
|
| 177 |
+
int e = (int)sizeof(signed char) * 8;
|
| 178 |
+
|
| 179 |
+
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindSigned);
|
| 180 |
+
}
|
| 181 |
+
|
| 182 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<uchar1>(void)
|
| 183 |
+
{
|
| 184 |
+
int e = (int)sizeof(unsigned char) * 8;
|
| 185 |
+
|
| 186 |
+
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindUnsigned);
|
| 187 |
+
}
|
| 188 |
+
|
| 189 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<char2>(void)
|
| 190 |
+
{
|
| 191 |
+
int e = (int)sizeof(signed char) * 8;
|
| 192 |
+
|
| 193 |
+
return cudaCreateChannelDesc(e, e, 0, 0, cudaChannelFormatKindSigned);
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<uchar2>(void)
|
| 197 |
+
{
|
| 198 |
+
int e = (int)sizeof(unsigned char) * 8;
|
| 199 |
+
|
| 200 |
+
return cudaCreateChannelDesc(e, e, 0, 0, cudaChannelFormatKindUnsigned);
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<char4>(void)
|
| 204 |
+
{
|
| 205 |
+
int e = (int)sizeof(signed char) * 8;
|
| 206 |
+
|
| 207 |
+
return cudaCreateChannelDesc(e, e, e, e, cudaChannelFormatKindSigned);
|
| 208 |
+
}
|
| 209 |
+
|
| 210 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<uchar4>(void)
|
| 211 |
+
{
|
| 212 |
+
int e = (int)sizeof(unsigned char) * 8;
|
| 213 |
+
|
| 214 |
+
return cudaCreateChannelDesc(e, e, e, e, cudaChannelFormatKindUnsigned);
|
| 215 |
+
}
|
| 216 |
+
|
| 217 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<short>(void)
|
| 218 |
+
{
|
| 219 |
+
int e = (int)sizeof(short) * 8;
|
| 220 |
+
|
| 221 |
+
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindSigned);
|
| 222 |
+
}
|
| 223 |
+
|
| 224 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<unsigned short>(void)
|
| 225 |
+
{
|
| 226 |
+
int e = (int)sizeof(unsigned short) * 8;
|
| 227 |
+
|
| 228 |
+
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindUnsigned);
|
| 229 |
+
}
|
| 230 |
+
|
| 231 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<short1>(void)
|
| 232 |
+
{
|
| 233 |
+
int e = (int)sizeof(short) * 8;
|
| 234 |
+
|
| 235 |
+
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindSigned);
|
| 236 |
+
}
|
| 237 |
+
|
| 238 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<ushort1>(void)
|
| 239 |
+
{
|
| 240 |
+
int e = (int)sizeof(unsigned short) * 8;
|
| 241 |
+
|
| 242 |
+
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindUnsigned);
|
| 243 |
+
}
|
| 244 |
+
|
| 245 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<short2>(void)
|
| 246 |
+
{
|
| 247 |
+
int e = (int)sizeof(short) * 8;
|
| 248 |
+
|
| 249 |
+
return cudaCreateChannelDesc(e, e, 0, 0, cudaChannelFormatKindSigned);
|
| 250 |
+
}
|
| 251 |
+
|
| 252 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<ushort2>(void)
|
| 253 |
+
{
|
| 254 |
+
int e = (int)sizeof(unsigned short) * 8;
|
| 255 |
+
|
| 256 |
+
return cudaCreateChannelDesc(e, e, 0, 0, cudaChannelFormatKindUnsigned);
|
| 257 |
+
}
|
| 258 |
+
|
| 259 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<short4>(void)
|
| 260 |
+
{
|
| 261 |
+
int e = (int)sizeof(short) * 8;
|
| 262 |
+
|
| 263 |
+
return cudaCreateChannelDesc(e, e, e, e, cudaChannelFormatKindSigned);
|
| 264 |
+
}
|
| 265 |
+
|
| 266 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<ushort4>(void)
|
| 267 |
+
{
|
| 268 |
+
int e = (int)sizeof(unsigned short) * 8;
|
| 269 |
+
|
| 270 |
+
return cudaCreateChannelDesc(e, e, e, e, cudaChannelFormatKindUnsigned);
|
| 271 |
+
}
|
| 272 |
+
|
| 273 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<int>(void)
|
| 274 |
+
{
|
| 275 |
+
int e = (int)sizeof(int) * 8;
|
| 276 |
+
|
| 277 |
+
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindSigned);
|
| 278 |
+
}
|
| 279 |
+
|
| 280 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<unsigned int>(void)
|
| 281 |
+
{
|
| 282 |
+
int e = (int)sizeof(unsigned int) * 8;
|
| 283 |
+
|
| 284 |
+
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindUnsigned);
|
| 285 |
+
}
|
| 286 |
+
|
| 287 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<int1>(void)
|
| 288 |
+
{
|
| 289 |
+
int e = (int)sizeof(int) * 8;
|
| 290 |
+
|
| 291 |
+
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindSigned);
|
| 292 |
+
}
|
| 293 |
+
|
| 294 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<uint1>(void)
|
| 295 |
+
{
|
| 296 |
+
int e = (int)sizeof(unsigned int) * 8;
|
| 297 |
+
|
| 298 |
+
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindUnsigned);
|
| 299 |
+
}
|
| 300 |
+
|
| 301 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<int2>(void)
|
| 302 |
+
{
|
| 303 |
+
int e = (int)sizeof(int) * 8;
|
| 304 |
+
|
| 305 |
+
return cudaCreateChannelDesc(e, e, 0, 0, cudaChannelFormatKindSigned);
|
| 306 |
+
}
|
| 307 |
+
|
| 308 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<uint2>(void)
|
| 309 |
+
{
|
| 310 |
+
int e = (int)sizeof(unsigned int) * 8;
|
| 311 |
+
|
| 312 |
+
return cudaCreateChannelDesc(e, e, 0, 0, cudaChannelFormatKindUnsigned);
|
| 313 |
+
}
|
| 314 |
+
|
| 315 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<int4>(void)
|
| 316 |
+
{
|
| 317 |
+
int e = (int)sizeof(int) * 8;
|
| 318 |
+
|
| 319 |
+
return cudaCreateChannelDesc(e, e, e, e, cudaChannelFormatKindSigned);
|
| 320 |
+
}
|
| 321 |
+
|
| 322 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<uint4>(void)
|
| 323 |
+
{
|
| 324 |
+
int e = (int)sizeof(unsigned int) * 8;
|
| 325 |
+
|
| 326 |
+
return cudaCreateChannelDesc(e, e, e, e, cudaChannelFormatKindUnsigned);
|
| 327 |
+
}
|
| 328 |
+
|
| 329 |
+
#if !defined(__LP64__)
|
| 330 |
+
|
| 331 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<long>(void)
|
| 332 |
+
{
|
| 333 |
+
int e = (int)sizeof(long) * 8;
|
| 334 |
+
|
| 335 |
+
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindSigned);
|
| 336 |
+
}
|
| 337 |
+
|
| 338 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<unsigned long>(void)
|
| 339 |
+
{
|
| 340 |
+
int e = (int)sizeof(unsigned long) * 8;
|
| 341 |
+
|
| 342 |
+
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindUnsigned);
|
| 343 |
+
}
|
| 344 |
+
|
| 345 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<long1>(void)
|
| 346 |
+
{
|
| 347 |
+
int e = (int)sizeof(long) * 8;
|
| 348 |
+
|
| 349 |
+
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindSigned);
|
| 350 |
+
}
|
| 351 |
+
|
| 352 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<ulong1>(void)
|
| 353 |
+
{
|
| 354 |
+
int e = (int)sizeof(unsigned long) * 8;
|
| 355 |
+
|
| 356 |
+
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindUnsigned);
|
| 357 |
+
}
|
| 358 |
+
|
| 359 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<long2>(void)
|
| 360 |
+
{
|
| 361 |
+
int e = (int)sizeof(long) * 8;
|
| 362 |
+
|
| 363 |
+
return cudaCreateChannelDesc(e, e, 0, 0, cudaChannelFormatKindSigned);
|
| 364 |
+
}
|
| 365 |
+
|
| 366 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<ulong2>(void)
|
| 367 |
+
{
|
| 368 |
+
int e = (int)sizeof(unsigned long) * 8;
|
| 369 |
+
|
| 370 |
+
return cudaCreateChannelDesc(e, e, 0, 0, cudaChannelFormatKindUnsigned);
|
| 371 |
+
}
|
| 372 |
+
|
| 373 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<long4>(void)
|
| 374 |
+
{
|
| 375 |
+
int e = (int)sizeof(long) * 8;
|
| 376 |
+
|
| 377 |
+
return cudaCreateChannelDesc(e, e, e, e, cudaChannelFormatKindSigned);
|
| 378 |
+
}
|
| 379 |
+
|
| 380 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<ulong4>(void)
|
| 381 |
+
{
|
| 382 |
+
int e = (int)sizeof(unsigned long) * 8;
|
| 383 |
+
|
| 384 |
+
return cudaCreateChannelDesc(e, e, e, e, cudaChannelFormatKindUnsigned);
|
| 385 |
+
}
|
| 386 |
+
|
| 387 |
+
#endif /* !__LP64__ */
|
| 388 |
+
|
| 389 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<float>(void)
|
| 390 |
+
{
|
| 391 |
+
int e = (int)sizeof(float) * 8;
|
| 392 |
+
|
| 393 |
+
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindFloat);
|
| 394 |
+
}
|
| 395 |
+
|
| 396 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<float1>(void)
|
| 397 |
+
{
|
| 398 |
+
int e = (int)sizeof(float) * 8;
|
| 399 |
+
|
| 400 |
+
return cudaCreateChannelDesc(e, 0, 0, 0, cudaChannelFormatKindFloat);
|
| 401 |
+
}
|
| 402 |
+
|
| 403 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<float2>(void)
|
| 404 |
+
{
|
| 405 |
+
int e = (int)sizeof(float) * 8;
|
| 406 |
+
|
| 407 |
+
return cudaCreateChannelDesc(e, e, 0, 0, cudaChannelFormatKindFloat);
|
| 408 |
+
}
|
| 409 |
+
|
| 410 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<float4>(void)
|
| 411 |
+
{
|
| 412 |
+
int e = (int)sizeof(float) * 8;
|
| 413 |
+
|
| 414 |
+
return cudaCreateChannelDesc(e, e, e, e, cudaChannelFormatKindFloat);
|
| 415 |
+
}
|
| 416 |
+
|
| 417 |
+
static __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDescNV12(void)
|
| 418 |
+
{
|
| 419 |
+
int e = (int)sizeof(char) * 8;
|
| 420 |
+
|
| 421 |
+
return cudaCreateChannelDesc(e, e, e, 0, cudaChannelFormatKindNV12);
|
| 422 |
+
}
|
| 423 |
+
|
| 424 |
+
template<cudaChannelFormatKind> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc(void)
|
| 425 |
+
{
|
| 426 |
+
return cudaCreateChannelDesc(0, 0, 0, 0, cudaChannelFormatKindNone);
|
| 427 |
+
}
|
| 428 |
+
|
| 429 |
+
/* Signed 8-bit normalized integer formats */
|
| 430 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<cudaChannelFormatKindSignedNormalized8X1>(void)
|
| 431 |
+
{
|
| 432 |
+
return cudaCreateChannelDesc(8, 0, 0, 0, cudaChannelFormatKindSignedNormalized8X1);
|
| 433 |
+
}
|
| 434 |
+
|
| 435 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<cudaChannelFormatKindSignedNormalized8X2>(void)
|
| 436 |
+
{
|
| 437 |
+
return cudaCreateChannelDesc(8, 8, 0, 0, cudaChannelFormatKindSignedNormalized8X2);
|
| 438 |
+
}
|
| 439 |
+
|
| 440 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<cudaChannelFormatKindSignedNormalized8X4>(void)
|
| 441 |
+
{
|
| 442 |
+
return cudaCreateChannelDesc(8, 8, 8, 8, cudaChannelFormatKindSignedNormalized8X4);
|
| 443 |
+
}
|
| 444 |
+
|
| 445 |
+
/* Unsigned 8-bit normalized integer formats */
|
| 446 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<cudaChannelFormatKindUnsignedNormalized8X1>(void)
|
| 447 |
+
{
|
| 448 |
+
return cudaCreateChannelDesc(8, 0, 0, 0, cudaChannelFormatKindUnsignedNormalized8X1);
|
| 449 |
+
}
|
| 450 |
+
|
| 451 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<cudaChannelFormatKindUnsignedNormalized8X2>(void)
|
| 452 |
+
{
|
| 453 |
+
return cudaCreateChannelDesc(8, 8, 0, 0, cudaChannelFormatKindUnsignedNormalized8X2);
|
| 454 |
+
}
|
| 455 |
+
|
| 456 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<cudaChannelFormatKindUnsignedNormalized8X4>(void)
|
| 457 |
+
{
|
| 458 |
+
return cudaCreateChannelDesc(8, 8, 8, 8, cudaChannelFormatKindUnsignedNormalized8X4);
|
| 459 |
+
}
|
| 460 |
+
|
| 461 |
+
/* Signed 16-bit normalized integer formats */
|
| 462 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<cudaChannelFormatKindSignedNormalized16X1>(void)
|
| 463 |
+
{
|
| 464 |
+
return cudaCreateChannelDesc(16, 0, 0, 0, cudaChannelFormatKindSignedNormalized16X1);
|
| 465 |
+
}
|
| 466 |
+
|
| 467 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<cudaChannelFormatKindSignedNormalized16X2>(void)
|
| 468 |
+
{
|
| 469 |
+
return cudaCreateChannelDesc(16, 16, 0, 0, cudaChannelFormatKindSignedNormalized16X2);
|
| 470 |
+
}
|
| 471 |
+
|
| 472 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<cudaChannelFormatKindSignedNormalized16X4>(void)
|
| 473 |
+
{
|
| 474 |
+
return cudaCreateChannelDesc(16, 16, 16, 16, cudaChannelFormatKindSignedNormalized16X4);
|
| 475 |
+
}
|
| 476 |
+
|
| 477 |
+
/* Unsigned 16-bit normalized integer formats */
|
| 478 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<cudaChannelFormatKindUnsignedNormalized16X1>(void)
|
| 479 |
+
{
|
| 480 |
+
return cudaCreateChannelDesc(16, 0, 0, 0, cudaChannelFormatKindUnsignedNormalized16X1);
|
| 481 |
+
}
|
| 482 |
+
|
| 483 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<cudaChannelFormatKindUnsignedNormalized16X2>(void)
|
| 484 |
+
{
|
| 485 |
+
return cudaCreateChannelDesc(16, 16, 0, 0, cudaChannelFormatKindUnsignedNormalized16X2);
|
| 486 |
+
}
|
| 487 |
+
|
| 488 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<cudaChannelFormatKindUnsignedNormalized16X4>(void)
|
| 489 |
+
{
|
| 490 |
+
return cudaCreateChannelDesc(16, 16, 16, 16, cudaChannelFormatKindUnsignedNormalized16X4);
|
| 491 |
+
}
|
| 492 |
+
|
| 493 |
+
/* NV12 format */
|
| 494 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<cudaChannelFormatKindNV12>(void)
|
| 495 |
+
{
|
| 496 |
+
return cudaCreateChannelDesc(8, 8, 8, 0, cudaChannelFormatKindNV12);
|
| 497 |
+
}
|
| 498 |
+
|
| 499 |
+
/* BC1 format */
|
| 500 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<cudaChannelFormatKindUnsignedBlockCompressed1>(void)
|
| 501 |
+
{
|
| 502 |
+
return cudaCreateChannelDesc(8, 8, 8, 8, cudaChannelFormatKindUnsignedBlockCompressed1);
|
| 503 |
+
}
|
| 504 |
+
|
| 505 |
+
/* BC1sRGB format */
|
| 506 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<cudaChannelFormatKindUnsignedBlockCompressed1SRGB>(void)
|
| 507 |
+
{
|
| 508 |
+
return cudaCreateChannelDesc(8, 8, 8, 8, cudaChannelFormatKindUnsignedBlockCompressed1SRGB);
|
| 509 |
+
}
|
| 510 |
+
|
| 511 |
+
/* BC2 format */
|
| 512 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<cudaChannelFormatKindUnsignedBlockCompressed2>(void)
|
| 513 |
+
{
|
| 514 |
+
return cudaCreateChannelDesc(8, 8, 8, 8, cudaChannelFormatKindUnsignedBlockCompressed2);
|
| 515 |
+
}
|
| 516 |
+
|
| 517 |
+
/* BC2sRGB format */
|
| 518 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<cudaChannelFormatKindUnsignedBlockCompressed2SRGB>(void)
|
| 519 |
+
{
|
| 520 |
+
return cudaCreateChannelDesc(8, 8, 8, 8, cudaChannelFormatKindUnsignedBlockCompressed2SRGB);
|
| 521 |
+
}
|
| 522 |
+
|
| 523 |
+
/* BC3 format */
|
| 524 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<cudaChannelFormatKindUnsignedBlockCompressed3>(void)
|
| 525 |
+
{
|
| 526 |
+
return cudaCreateChannelDesc(8, 8, 8, 8, cudaChannelFormatKindUnsignedBlockCompressed3);
|
| 527 |
+
}
|
| 528 |
+
|
| 529 |
+
/* BC3sRGB format */
|
| 530 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<cudaChannelFormatKindUnsignedBlockCompressed3SRGB>(void)
|
| 531 |
+
{
|
| 532 |
+
return cudaCreateChannelDesc(8, 8, 8, 8, cudaChannelFormatKindUnsignedBlockCompressed3SRGB);
|
| 533 |
+
}
|
| 534 |
+
|
| 535 |
+
/* BC4 unsigned format */
|
| 536 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<cudaChannelFormatKindUnsignedBlockCompressed4>(void)
|
| 537 |
+
{
|
| 538 |
+
return cudaCreateChannelDesc(8, 0, 0, 0, cudaChannelFormatKindUnsignedBlockCompressed4);
|
| 539 |
+
}
|
| 540 |
+
|
| 541 |
+
/* BC4 signed format */
|
| 542 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<cudaChannelFormatKindSignedBlockCompressed4>(void)
|
| 543 |
+
{
|
| 544 |
+
return cudaCreateChannelDesc(8, 0, 0, 0, cudaChannelFormatKindSignedBlockCompressed4);
|
| 545 |
+
}
|
| 546 |
+
|
| 547 |
+
/* BC5 unsigned format */
|
| 548 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<cudaChannelFormatKindUnsignedBlockCompressed5>(void)
|
| 549 |
+
{
|
| 550 |
+
return cudaCreateChannelDesc(8, 8, 0, 0, cudaChannelFormatKindUnsignedBlockCompressed5);
|
| 551 |
+
}
|
| 552 |
+
|
| 553 |
+
/* BC5 signed format */
|
| 554 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<cudaChannelFormatKindSignedBlockCompressed5>(void)
|
| 555 |
+
{
|
| 556 |
+
return cudaCreateChannelDesc(8, 8, 0, 0, cudaChannelFormatKindSignedBlockCompressed5);
|
| 557 |
+
}
|
| 558 |
+
|
| 559 |
+
/* BC6H unsigned format */
|
| 560 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<cudaChannelFormatKindUnsignedBlockCompressed6H>(void)
|
| 561 |
+
{
|
| 562 |
+
return cudaCreateChannelDesc(16, 16, 16, 0, cudaChannelFormatKindUnsignedBlockCompressed6H);
|
| 563 |
+
}
|
| 564 |
+
|
| 565 |
+
/* BC6H signed format */
|
| 566 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<cudaChannelFormatKindSignedBlockCompressed6H>(void)
|
| 567 |
+
{
|
| 568 |
+
return cudaCreateChannelDesc(16, 16, 16, 0, cudaChannelFormatKindSignedBlockCompressed6H);
|
| 569 |
+
}
|
| 570 |
+
|
| 571 |
+
/* BC7 format */
|
| 572 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<cudaChannelFormatKindUnsignedBlockCompressed7>(void)
|
| 573 |
+
{
|
| 574 |
+
return cudaCreateChannelDesc(8, 8, 8, 8, cudaChannelFormatKindUnsignedBlockCompressed7);
|
| 575 |
+
}
|
| 576 |
+
|
| 577 |
+
/* BC7sRGB format */
|
| 578 |
+
template<> __inline__ __host__ cudaChannelFormatDesc cudaCreateChannelDesc<cudaChannelFormatKindUnsignedBlockCompressed7SRGB>(void)
|
| 579 |
+
{
|
| 580 |
+
return cudaCreateChannelDesc(8, 8, 8, 8, cudaChannelFormatKindUnsignedBlockCompressed7SRGB);
|
| 581 |
+
}
|
| 582 |
+
|
| 583 |
+
#endif /* __cplusplus */
|
| 584 |
+
|
| 585 |
+
/** @} */
|
| 586 |
+
/** @} */ /* END CUDART_TEXTURE_HL */
|
| 587 |
+
|
| 588 |
+
#endif /* !__CHANNEL_DESCRIPTOR_H__ */
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/common_functions.h
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1993-2018 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO LICENSEE:
|
| 5 |
+
*
|
| 6 |
+
* This source code and/or documentation ("Licensed Deliverables") are
|
| 7 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 8 |
+
* international Copyright laws.
|
| 9 |
+
*
|
| 10 |
+
* These Licensed Deliverables contained herein is PROPRIETARY and
|
| 11 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and
|
| 12 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 13 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 14 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 15 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 16 |
+
* of the Licensed Deliverables to any third party without the express
|
| 17 |
+
* written consent of NVIDIA is prohibited.
|
| 18 |
+
*
|
| 19 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 20 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 21 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
|
| 22 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 23 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 24 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 25 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 26 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 27 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 28 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 29 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 30 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 31 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 32 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 33 |
+
*
|
| 34 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 35 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 36 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 37 |
+
* computer software documentation" as such terms are used in 48
|
| 38 |
+
* C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
|
| 39 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 40 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 41 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 42 |
+
* only those rights set forth herein.
|
| 43 |
+
*
|
| 44 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 45 |
+
* software must include, in the user documentation and internal
|
| 46 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 47 |
+
* Users Notice.
|
| 48 |
+
*/
|
| 49 |
+
|
| 50 |
+
#if !defined(__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__)
|
| 51 |
+
#if defined(_MSC_VER)
|
| 52 |
+
#pragma message("common_functions.h is an internal header file and must not be used directly. This file will be removed in a future CUDA release. Please use cuda_runtime_api.h or cuda_runtime.h instead.")
|
| 53 |
+
#else
|
| 54 |
+
#warning "common_functions.h is an internal header file and must not be used directly. This file will be removed in a future CUDA release. Please use cuda_runtime_api.h or cuda_runtime.h instead."
|
| 55 |
+
#endif
|
| 56 |
+
#define __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__
|
| 57 |
+
#define __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_COMMON_FUNCTIONS_H_WRAPPER__
|
| 58 |
+
#endif
|
| 59 |
+
|
| 60 |
+
#include "crt/common_functions.h"
|
| 61 |
+
|
| 62 |
+
#if defined(__UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_COMMON_FUNCTIONS_H_WRAPPER__)
|
| 63 |
+
#undef __CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__
|
| 64 |
+
#undef __UNDEF_CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS_COMMON_FUNCTIONS_H_WRAPPER__
|
| 65 |
+
#endif
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups.h
ADDED
|
@@ -0,0 +1,1743 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1993-2021 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO LICENSEE:
|
| 5 |
+
*
|
| 6 |
+
* This source code and/or documentation ("Licensed Deliverables") are
|
| 7 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 8 |
+
* international Copyright laws.
|
| 9 |
+
*
|
| 10 |
+
* These Licensed Deliverables contained herein is PROPRIETARY and
|
| 11 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and
|
| 12 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 13 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 14 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 15 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 16 |
+
* of the Licensed Deliverables to any third party without the express
|
| 17 |
+
* written consent of NVIDIA is prohibited.
|
| 18 |
+
*
|
| 19 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 20 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 21 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
|
| 22 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 23 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 24 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 25 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 26 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 27 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 28 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 29 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 30 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 31 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 32 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 33 |
+
*
|
| 34 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 35 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 36 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 37 |
+
* computer software documentation" as such terms are used in 48
|
| 38 |
+
* C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
|
| 39 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 40 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 41 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 42 |
+
* only those rights set forth herein.
|
| 43 |
+
*
|
| 44 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 45 |
+
* software must include, in the user documentation and internal
|
| 46 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 47 |
+
* Users Notice.
|
| 48 |
+
*/
|
| 49 |
+
|
| 50 |
+
#ifndef _COOPERATIVE_GROUPS_H_
|
| 51 |
+
#define _COOPERATIVE_GROUPS_H_
|
| 52 |
+
|
| 53 |
+
#if defined(__cplusplus) && defined(__CUDACC__)
|
| 54 |
+
|
| 55 |
+
#include "cooperative_groups/details/info.h"
|
| 56 |
+
#include "cooperative_groups/details/driver_abi.h"
|
| 57 |
+
#include "cooperative_groups/details/helpers.h"
|
| 58 |
+
#include "cooperative_groups/details/memory.h"
|
| 59 |
+
|
| 60 |
+
#if defined(_CG_HAS_STL_ATOMICS)
|
| 61 |
+
#include <cuda/atomic>
|
| 62 |
+
#define _CG_THREAD_SCOPE(scope) _CG_STATIC_CONST_DECL cuda::thread_scope thread_scope = scope;
|
| 63 |
+
#else
|
| 64 |
+
#define _CG_THREAD_SCOPE(scope)
|
| 65 |
+
#endif
|
| 66 |
+
|
| 67 |
+
_CG_BEGIN_NAMESPACE
|
| 68 |
+
|
| 69 |
+
namespace details {
|
| 70 |
+
_CG_CONST_DECL unsigned int coalesced_group_id = 1;
|
| 71 |
+
_CG_CONST_DECL unsigned int multi_grid_group_id = 2;
|
| 72 |
+
_CG_CONST_DECL unsigned int grid_group_id = 3;
|
| 73 |
+
_CG_CONST_DECL unsigned int thread_block_id = 4;
|
| 74 |
+
_CG_CONST_DECL unsigned int multi_tile_group_id = 5;
|
| 75 |
+
_CG_CONST_DECL unsigned int cluster_group_id = 6;
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
/**
|
| 79 |
+
* class thread_group;
|
| 80 |
+
*
|
| 81 |
+
* Generic thread group type, into which all groups are convertible.
|
| 82 |
+
* It acts as a container for all storage necessary for the derived groups,
|
| 83 |
+
* and will dispatch the API calls to the correct derived group. This means
|
| 84 |
+
* that all derived groups must implement the same interface as thread_group.
|
| 85 |
+
*/
|
| 86 |
+
class thread_group
|
| 87 |
+
{
|
| 88 |
+
protected:
|
| 89 |
+
struct group_data {
|
| 90 |
+
unsigned int _unused : 1;
|
| 91 |
+
unsigned int type : 7, : 0;
|
| 92 |
+
};
|
| 93 |
+
|
| 94 |
+
struct gg_data {
|
| 95 |
+
details::grid_workspace *gridWs;
|
| 96 |
+
};
|
| 97 |
+
|
| 98 |
+
#if defined(_CG_CPP11_FEATURES) && defined(_CG_ABI_EXPERIMENTAL)
|
| 99 |
+
struct mg_data {
|
| 100 |
+
unsigned long long _unused : 1;
|
| 101 |
+
unsigned long long type : 7;
|
| 102 |
+
unsigned long long handle : 56;
|
| 103 |
+
const details::multi_grid::multi_grid_functions *functions;
|
| 104 |
+
};
|
| 105 |
+
#endif
|
| 106 |
+
|
| 107 |
+
struct tg_data {
|
| 108 |
+
unsigned int is_tiled : 1;
|
| 109 |
+
unsigned int type : 7;
|
| 110 |
+
unsigned int size : 24;
|
| 111 |
+
// packed to 4b
|
| 112 |
+
unsigned int metaGroupSize : 16;
|
| 113 |
+
unsigned int metaGroupRank : 16;
|
| 114 |
+
// packed to 8b
|
| 115 |
+
unsigned int mask;
|
| 116 |
+
// packed to 12b
|
| 117 |
+
unsigned int _res;
|
| 118 |
+
};
|
| 119 |
+
|
| 120 |
+
friend _CG_QUALIFIER thread_group tiled_partition(const thread_group& parent, unsigned int tilesz);
|
| 121 |
+
friend class thread_block;
|
| 122 |
+
|
| 123 |
+
union __align__(8) {
|
| 124 |
+
group_data group;
|
| 125 |
+
tg_data coalesced;
|
| 126 |
+
gg_data grid;
|
| 127 |
+
#if defined(_CG_CPP11_FEATURES) && defined(_CG_ABI_EXPERIMENTAL)
|
| 128 |
+
mg_data multi_grid;
|
| 129 |
+
#endif
|
| 130 |
+
} _data;
|
| 131 |
+
|
| 132 |
+
_CG_QUALIFIER thread_group operator=(const thread_group& src);
|
| 133 |
+
|
| 134 |
+
_CG_QUALIFIER thread_group(unsigned int type) {
|
| 135 |
+
_data.group.type = type;
|
| 136 |
+
_data.group._unused = false;
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
+
#ifdef _CG_CPP11_FEATURES
|
| 140 |
+
static_assert(sizeof(tg_data) <= 16, "Failed size check");
|
| 141 |
+
static_assert(sizeof(gg_data) <= 16, "Failed size check");
|
| 142 |
+
# ifdef _CG_ABI_EXPERIMENTAL
|
| 143 |
+
static_assert(sizeof(mg_data) <= 16, "Failed size check");
|
| 144 |
+
# endif
|
| 145 |
+
#endif
|
| 146 |
+
|
| 147 |
+
public:
|
| 148 |
+
_CG_THREAD_SCOPE(cuda::thread_scope::thread_scope_device)
|
| 149 |
+
|
| 150 |
+
_CG_QUALIFIER unsigned long long size() const;
|
| 151 |
+
_CG_QUALIFIER unsigned long long num_threads() const;
|
| 152 |
+
_CG_QUALIFIER unsigned long long thread_rank() const;
|
| 153 |
+
_CG_QUALIFIER void sync() const;
|
| 154 |
+
_CG_QUALIFIER unsigned int get_type() const {
|
| 155 |
+
return _data.group.type;
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
};
|
| 159 |
+
|
| 160 |
+
template <unsigned int TyId>
|
| 161 |
+
struct thread_group_base : public thread_group {
|
| 162 |
+
_CG_QUALIFIER thread_group_base() : thread_group(TyId) {}
|
| 163 |
+
_CG_STATIC_CONST_DECL unsigned int id = TyId;
|
| 164 |
+
};
|
| 165 |
+
|
| 166 |
+
#if defined(_CG_HAS_MULTI_GRID_GROUP)
|
| 167 |
+
|
| 168 |
+
/**
|
| 169 |
+
* class multi_grid_group;
|
| 170 |
+
*
|
| 171 |
+
* Threads within this this group are guaranteed to be co-resident on the
|
| 172 |
+
* same system, on multiple devices within the same launched kernels.
|
| 173 |
+
* To use this group, the kernel must have been launched with
|
| 174 |
+
* cuLaunchCooperativeKernelMultiDevice (or the CUDA Runtime equivalent),
|
| 175 |
+
* and the device must support it (queryable device attribute).
|
| 176 |
+
*
|
| 177 |
+
* Constructed via this_multi_grid();
|
| 178 |
+
*/
|
| 179 |
+
|
| 180 |
+
|
| 181 |
+
# if defined(_CG_CPP11_FEATURES) && defined(_CG_ABI_EXPERIMENTAL)
|
| 182 |
+
class multi_grid_group;
|
| 183 |
+
|
| 184 |
+
// Multi grid group requires these functions to be templated to prevent ptxas from trying to use CG syscalls
|
| 185 |
+
template <typename = void>
|
| 186 |
+
__device__ _CG_DEPRECATED multi_grid_group this_multi_grid();
|
| 187 |
+
|
| 188 |
+
class multi_grid_group : public thread_group_base<details::multi_grid_group_id>
|
| 189 |
+
{
|
| 190 |
+
private:
|
| 191 |
+
template <typename = void>
|
| 192 |
+
_CG_QUALIFIER multi_grid_group() {
|
| 193 |
+
_data.multi_grid.functions = details::multi_grid::load_grid_intrinsics();
|
| 194 |
+
_data.multi_grid.handle = _data.multi_grid.functions->get_intrinsic_handle();
|
| 195 |
+
}
|
| 196 |
+
|
| 197 |
+
friend multi_grid_group this_multi_grid<void>();
|
| 198 |
+
|
| 199 |
+
public:
|
| 200 |
+
_CG_THREAD_SCOPE(cuda::thread_scope::thread_scope_system)
|
| 201 |
+
|
| 202 |
+
_CG_QUALIFIER bool is_valid() const {
|
| 203 |
+
return (_data.multi_grid.handle != 0);
|
| 204 |
+
}
|
| 205 |
+
|
| 206 |
+
_CG_QUALIFIER void sync() const {
|
| 207 |
+
if (!is_valid()) {
|
| 208 |
+
_CG_ABORT();
|
| 209 |
+
}
|
| 210 |
+
_data.multi_grid.functions->sync(_data.multi_grid.handle);
|
| 211 |
+
}
|
| 212 |
+
|
| 213 |
+
_CG_QUALIFIER unsigned long long num_threads() const {
|
| 214 |
+
_CG_ASSERT(is_valid());
|
| 215 |
+
return _data.multi_grid.functions->size(_data.multi_grid.handle);
|
| 216 |
+
}
|
| 217 |
+
|
| 218 |
+
_CG_QUALIFIER unsigned long long size() const {
|
| 219 |
+
return num_threads();
|
| 220 |
+
}
|
| 221 |
+
|
| 222 |
+
_CG_QUALIFIER unsigned long long thread_rank() const {
|
| 223 |
+
_CG_ASSERT(is_valid());
|
| 224 |
+
return _data.multi_grid.functions->thread_rank(_data.multi_grid.handle);
|
| 225 |
+
}
|
| 226 |
+
|
| 227 |
+
_CG_QUALIFIER unsigned int grid_rank() const {
|
| 228 |
+
_CG_ASSERT(is_valid());
|
| 229 |
+
return (_data.multi_grid.functions->grid_rank(_data.multi_grid.handle));
|
| 230 |
+
}
|
| 231 |
+
|
| 232 |
+
_CG_QUALIFIER unsigned int num_grids() const {
|
| 233 |
+
_CG_ASSERT(is_valid());
|
| 234 |
+
return (_data.multi_grid.functions->num_grids(_data.multi_grid.handle));
|
| 235 |
+
}
|
| 236 |
+
};
|
| 237 |
+
# else
|
| 238 |
+
class multi_grid_group
|
| 239 |
+
{
|
| 240 |
+
private:
|
| 241 |
+
unsigned long long _handle;
|
| 242 |
+
unsigned int _size;
|
| 243 |
+
unsigned int _rank;
|
| 244 |
+
|
| 245 |
+
friend _CG_QUALIFIER multi_grid_group this_multi_grid();
|
| 246 |
+
|
| 247 |
+
_CG_QUALIFIER multi_grid_group() {
|
| 248 |
+
_handle = details::multi_grid::get_intrinsic_handle();
|
| 249 |
+
_size = details::multi_grid::size(_handle);
|
| 250 |
+
_rank = details::multi_grid::thread_rank(_handle);
|
| 251 |
+
}
|
| 252 |
+
|
| 253 |
+
public:
|
| 254 |
+
_CG_THREAD_SCOPE(cuda::thread_scope::thread_scope_system)
|
| 255 |
+
|
| 256 |
+
_CG_QUALIFIER _CG_DEPRECATED bool is_valid() const {
|
| 257 |
+
return (_handle != 0);
|
| 258 |
+
}
|
| 259 |
+
|
| 260 |
+
_CG_QUALIFIER _CG_DEPRECATED void sync() const {
|
| 261 |
+
if (!is_valid()) {
|
| 262 |
+
_CG_ABORT();
|
| 263 |
+
}
|
| 264 |
+
details::multi_grid::sync(_handle);
|
| 265 |
+
}
|
| 266 |
+
|
| 267 |
+
_CG_QUALIFIER _CG_DEPRECATED unsigned long long num_threads() const {
|
| 268 |
+
_CG_ASSERT(is_valid());
|
| 269 |
+
return _size;
|
| 270 |
+
}
|
| 271 |
+
|
| 272 |
+
_CG_QUALIFIER _CG_DEPRECATED unsigned long long size() const {
|
| 273 |
+
return num_threads();
|
| 274 |
+
}
|
| 275 |
+
|
| 276 |
+
_CG_QUALIFIER _CG_DEPRECATED unsigned long long thread_rank() const {
|
| 277 |
+
_CG_ASSERT(is_valid());
|
| 278 |
+
return _rank;
|
| 279 |
+
}
|
| 280 |
+
|
| 281 |
+
_CG_QUALIFIER _CG_DEPRECATED unsigned int grid_rank() const {
|
| 282 |
+
_CG_ASSERT(is_valid());
|
| 283 |
+
return (details::multi_grid::grid_rank(_handle));
|
| 284 |
+
}
|
| 285 |
+
|
| 286 |
+
_CG_QUALIFIER _CG_DEPRECATED unsigned int num_grids() const {
|
| 287 |
+
_CG_ASSERT(is_valid());
|
| 288 |
+
return (details::multi_grid::num_grids(_handle));
|
| 289 |
+
}
|
| 290 |
+
};
|
| 291 |
+
# endif
|
| 292 |
+
|
| 293 |
+
/**
|
| 294 |
+
* multi_grid_group this_multi_grid()
|
| 295 |
+
*
|
| 296 |
+
* Constructs a multi_grid_group
|
| 297 |
+
*/
|
| 298 |
+
# if defined(_CG_CPP11_FEATURES) && defined(_CG_ABI_EXPERIMENTAL)
|
| 299 |
+
template <typename>
|
| 300 |
+
__device__
|
| 301 |
+
#else
|
| 302 |
+
_CG_QUALIFIER
|
| 303 |
+
# endif
|
| 304 |
+
_CG_DEPRECATED
|
| 305 |
+
multi_grid_group this_multi_grid()
|
| 306 |
+
{
|
| 307 |
+
return multi_grid_group();
|
| 308 |
+
}
|
| 309 |
+
#endif
|
| 310 |
+
|
| 311 |
+
/**
|
| 312 |
+
* class grid_group;
|
| 313 |
+
*
|
| 314 |
+
* Threads within this this group are guaranteed to be co-resident on the
|
| 315 |
+
* same device within the same launched kernel. To use this group, the kernel
|
| 316 |
+
* must have been launched with cuLaunchCooperativeKernel (or the CUDA Runtime equivalent),
|
| 317 |
+
* and the device must support it (queryable device attribute).
|
| 318 |
+
*
|
| 319 |
+
* Constructed via this_grid();
|
| 320 |
+
*/
|
| 321 |
+
class grid_group : public thread_group_base<details::grid_group_id>
|
| 322 |
+
{
|
| 323 |
+
_CG_STATIC_CONST_DECL unsigned int _group_id = details::grid_group_id;
|
| 324 |
+
friend _CG_QUALIFIER grid_group this_grid();
|
| 325 |
+
|
| 326 |
+
private:
|
| 327 |
+
_CG_QUALIFIER grid_group(details::grid_workspace *gridWs) {
|
| 328 |
+
_data.grid.gridWs = gridWs;
|
| 329 |
+
}
|
| 330 |
+
|
| 331 |
+
public:
|
| 332 |
+
_CG_THREAD_SCOPE(cuda::thread_scope::thread_scope_device)
|
| 333 |
+
|
| 334 |
+
_CG_QUALIFIER bool is_valid() const {
|
| 335 |
+
return (_data.grid.gridWs != NULL);
|
| 336 |
+
}
|
| 337 |
+
|
| 338 |
+
_CG_QUALIFIER void sync() const {
|
| 339 |
+
if (!is_valid()) {
|
| 340 |
+
_CG_ABORT();
|
| 341 |
+
}
|
| 342 |
+
details::grid::sync(&_data.grid.gridWs->barrier);
|
| 343 |
+
}
|
| 344 |
+
|
| 345 |
+
#if defined(_CG_CPP11_FEATURES)
|
| 346 |
+
using arrival_token = unsigned int;
|
| 347 |
+
|
| 348 |
+
_CG_QUALIFIER arrival_token barrier_arrive() const {
|
| 349 |
+
if (!is_valid()) {
|
| 350 |
+
_CG_ABORT();
|
| 351 |
+
}
|
| 352 |
+
return details::grid::barrier_arrive(&_data.grid.gridWs->barrier);
|
| 353 |
+
}
|
| 354 |
+
|
| 355 |
+
_CG_QUALIFIER void barrier_wait(arrival_token&& token) const {
|
| 356 |
+
details::grid::barrier_wait(token, &_data.grid.gridWs->barrier);
|
| 357 |
+
}
|
| 358 |
+
#endif
|
| 359 |
+
|
| 360 |
+
_CG_STATIC_QUALIFIER unsigned long long size() {
|
| 361 |
+
return details::grid::size();
|
| 362 |
+
}
|
| 363 |
+
|
| 364 |
+
_CG_STATIC_QUALIFIER dim3 group_dim() {
|
| 365 |
+
return details::grid::grid_dim();
|
| 366 |
+
}
|
| 367 |
+
|
| 368 |
+
_CG_STATIC_QUALIFIER dim3 dim_threads() {
|
| 369 |
+
return details::grid::dim_threads();
|
| 370 |
+
}
|
| 371 |
+
|
| 372 |
+
_CG_STATIC_QUALIFIER unsigned long long num_threads() {
|
| 373 |
+
return details::grid::num_threads();
|
| 374 |
+
}
|
| 375 |
+
|
| 376 |
+
_CG_STATIC_QUALIFIER dim3 thread_index() {
|
| 377 |
+
return details::grid::thread_index();
|
| 378 |
+
}
|
| 379 |
+
|
| 380 |
+
_CG_STATIC_QUALIFIER unsigned long long thread_rank() {
|
| 381 |
+
return details::grid::thread_rank();
|
| 382 |
+
}
|
| 383 |
+
|
| 384 |
+
_CG_STATIC_QUALIFIER dim3 dim_blocks() {
|
| 385 |
+
return details::grid::dim_blocks();
|
| 386 |
+
}
|
| 387 |
+
|
| 388 |
+
_CG_STATIC_QUALIFIER unsigned long long num_blocks() {
|
| 389 |
+
return details::grid::num_blocks();
|
| 390 |
+
}
|
| 391 |
+
|
| 392 |
+
_CG_STATIC_QUALIFIER dim3 block_index() {
|
| 393 |
+
return details::grid::block_index();
|
| 394 |
+
}
|
| 395 |
+
|
| 396 |
+
_CG_STATIC_QUALIFIER unsigned long long block_rank() {
|
| 397 |
+
return details::grid::block_rank();
|
| 398 |
+
}
|
| 399 |
+
|
| 400 |
+
# if defined(_CG_HAS_CLUSTER_GROUP)
|
| 401 |
+
_CG_STATIC_QUALIFIER dim3 dim_clusters() {
|
| 402 |
+
return details::grid::dim_clusters();
|
| 403 |
+
}
|
| 404 |
+
|
| 405 |
+
_CG_STATIC_QUALIFIER unsigned long long num_clusters() {
|
| 406 |
+
return details::grid::num_clusters();
|
| 407 |
+
}
|
| 408 |
+
|
| 409 |
+
_CG_STATIC_QUALIFIER dim3 cluster_index() {
|
| 410 |
+
return details::grid::cluster_index();
|
| 411 |
+
}
|
| 412 |
+
|
| 413 |
+
_CG_STATIC_QUALIFIER unsigned long long cluster_rank() {
|
| 414 |
+
return details::grid::cluster_rank();
|
| 415 |
+
}
|
| 416 |
+
# endif
|
| 417 |
+
};
|
| 418 |
+
|
| 419 |
+
_CG_QUALIFIER grid_group this_grid() {
|
| 420 |
+
// Load a workspace from the driver
|
| 421 |
+
grid_group gg(details::get_grid_workspace());
|
| 422 |
+
#ifdef _CG_DEBUG
|
| 423 |
+
// *all* threads must be available to synchronize
|
| 424 |
+
gg.sync();
|
| 425 |
+
#endif // _CG_DEBUG
|
| 426 |
+
return gg;
|
| 427 |
+
}
|
| 428 |
+
|
| 429 |
+
#if defined(_CG_HAS_CLUSTER_GROUP)
|
| 430 |
+
/**
|
| 431 |
+
* class cluster_group
|
| 432 |
+
*
|
| 433 |
+
* Every GPU kernel is executed by a grid of thread blocks. A grid can be evenly
|
| 434 |
+
* divided along all dimensions to form groups of blocks, each group of which is
|
| 435 |
+
* a block cluster. Clustered grids are subject to various restrictions and
|
| 436 |
+
* limitations. Primarily, a cluster consists of at most 8 blocks by default
|
| 437 |
+
* (although the user is allowed to opt-in to non-standard sizes,) and clustered
|
| 438 |
+
* grids are subject to additional occupancy limitations due to per-cluster
|
| 439 |
+
* hardware resource consumption. In exchange, a block cluster is guaranteed to
|
| 440 |
+
* be a cooperative group, with access to all cooperative group capabilities, as
|
| 441 |
+
* well as cluster specific capabilities and accelerations. A cluster_group
|
| 442 |
+
* represents a block cluster.
|
| 443 |
+
*
|
| 444 |
+
* Constructed via this_cluster_group();
|
| 445 |
+
*/
|
| 446 |
+
class cluster_group : public thread_group_base<details::cluster_group_id>
|
| 447 |
+
{
|
| 448 |
+
// Friends
|
| 449 |
+
friend _CG_QUALIFIER cluster_group this_cluster();
|
| 450 |
+
|
| 451 |
+
// Disable constructor
|
| 452 |
+
_CG_QUALIFIER cluster_group()
|
| 453 |
+
{
|
| 454 |
+
}
|
| 455 |
+
|
| 456 |
+
public:
|
| 457 |
+
//_CG_THREAD_SCOPE(cuda::thread_scope::thread_scope_cluster)
|
| 458 |
+
|
| 459 |
+
using arrival_token = struct {};
|
| 460 |
+
|
| 461 |
+
// Functionality exposed by the group
|
| 462 |
+
_CG_STATIC_QUALIFIER void sync()
|
| 463 |
+
{
|
| 464 |
+
return details::cluster::sync();
|
| 465 |
+
}
|
| 466 |
+
|
| 467 |
+
_CG_STATIC_QUALIFIER arrival_token barrier_arrive()
|
| 468 |
+
{
|
| 469 |
+
details::cluster::barrier_arrive();
|
| 470 |
+
return arrival_token();
|
| 471 |
+
}
|
| 472 |
+
|
| 473 |
+
_CG_STATIC_QUALIFIER void barrier_wait()
|
| 474 |
+
{
|
| 475 |
+
return details::cluster::barrier_wait();
|
| 476 |
+
}
|
| 477 |
+
|
| 478 |
+
_CG_STATIC_QUALIFIER void barrier_wait(arrival_token&&)
|
| 479 |
+
{
|
| 480 |
+
return details::cluster::barrier_wait();
|
| 481 |
+
}
|
| 482 |
+
|
| 483 |
+
_CG_STATIC_QUALIFIER unsigned int query_shared_rank(const void *addr)
|
| 484 |
+
{
|
| 485 |
+
return details::cluster::query_shared_rank(addr);
|
| 486 |
+
}
|
| 487 |
+
|
| 488 |
+
template <typename T>
|
| 489 |
+
_CG_STATIC_QUALIFIER T* map_shared_rank(T *addr, int rank)
|
| 490 |
+
{
|
| 491 |
+
return details::cluster::map_shared_rank(addr, rank);
|
| 492 |
+
}
|
| 493 |
+
|
| 494 |
+
_CG_STATIC_QUALIFIER dim3 block_index()
|
| 495 |
+
{
|
| 496 |
+
return details::cluster::block_index();
|
| 497 |
+
}
|
| 498 |
+
|
| 499 |
+
_CG_STATIC_QUALIFIER unsigned int block_rank()
|
| 500 |
+
{
|
| 501 |
+
return details::cluster::block_rank();
|
| 502 |
+
}
|
| 503 |
+
|
| 504 |
+
_CG_STATIC_QUALIFIER dim3 thread_index()
|
| 505 |
+
{
|
| 506 |
+
return details::cluster::thread_index();
|
| 507 |
+
}
|
| 508 |
+
|
| 509 |
+
_CG_STATIC_QUALIFIER unsigned int thread_rank()
|
| 510 |
+
{
|
| 511 |
+
return details::cluster::thread_rank();
|
| 512 |
+
}
|
| 513 |
+
|
| 514 |
+
_CG_STATIC_QUALIFIER dim3 dim_blocks()
|
| 515 |
+
{
|
| 516 |
+
return details::cluster::dim_blocks();
|
| 517 |
+
}
|
| 518 |
+
|
| 519 |
+
_CG_STATIC_QUALIFIER unsigned int num_blocks()
|
| 520 |
+
{
|
| 521 |
+
return details::cluster::num_blocks();
|
| 522 |
+
}
|
| 523 |
+
|
| 524 |
+
_CG_STATIC_QUALIFIER dim3 dim_threads()
|
| 525 |
+
{
|
| 526 |
+
return details::cluster::dim_threads();
|
| 527 |
+
}
|
| 528 |
+
|
| 529 |
+
_CG_STATIC_QUALIFIER unsigned int num_threads()
|
| 530 |
+
{
|
| 531 |
+
return details::cluster::num_threads();
|
| 532 |
+
}
|
| 533 |
+
|
| 534 |
+
// Legacy aliases
|
| 535 |
+
_CG_STATIC_QUALIFIER unsigned int size()
|
| 536 |
+
{
|
| 537 |
+
return num_threads();
|
| 538 |
+
}
|
| 539 |
+
};
|
| 540 |
+
|
| 541 |
+
/*
|
| 542 |
+
* cluster_group this_cluster()
|
| 543 |
+
*
|
| 544 |
+
* Constructs a cluster_group
|
| 545 |
+
*/
|
| 546 |
+
_CG_QUALIFIER cluster_group this_cluster()
|
| 547 |
+
{
|
| 548 |
+
cluster_group cg;
|
| 549 |
+
#ifdef _CG_DEBUG
|
| 550 |
+
cg.sync();
|
| 551 |
+
#endif
|
| 552 |
+
return cg;
|
| 553 |
+
}
|
| 554 |
+
#endif
|
| 555 |
+
|
| 556 |
+
#if defined(_CG_CPP11_FEATURES)
|
| 557 |
+
class thread_block;
|
| 558 |
+
template <unsigned int MaxBlockSize>
|
| 559 |
+
_CG_QUALIFIER thread_block this_thread_block(block_tile_memory<MaxBlockSize>& scratch);
|
| 560 |
+
#endif
|
| 561 |
+
|
| 562 |
+
/**
|
| 563 |
+
* class thread_block
|
| 564 |
+
*
|
| 565 |
+
* Every GPU kernel is executed by a grid of thread blocks, and threads within
|
| 566 |
+
* each block are guaranteed to reside on the same streaming multiprocessor.
|
| 567 |
+
* A thread_block represents a thread block whose dimensions are not known until runtime.
|
| 568 |
+
*
|
| 569 |
+
* Constructed via this_thread_block();
|
| 570 |
+
*/
|
| 571 |
+
class thread_block : public thread_group_base<details::thread_block_id>
|
| 572 |
+
{
|
| 573 |
+
// Friends
|
| 574 |
+
friend _CG_QUALIFIER thread_block this_thread_block();
|
| 575 |
+
friend _CG_QUALIFIER thread_group tiled_partition(const thread_group& parent, unsigned int tilesz);
|
| 576 |
+
friend _CG_QUALIFIER thread_group tiled_partition(const thread_block& parent, unsigned int tilesz);
|
| 577 |
+
|
| 578 |
+
#if defined(_CG_CPP11_FEATURES)
|
| 579 |
+
template <unsigned int MaxBlockSize>
|
| 580 |
+
friend _CG_QUALIFIER thread_block this_thread_block(block_tile_memory<MaxBlockSize>& scratch);
|
| 581 |
+
template <unsigned int Size>
|
| 582 |
+
friend class __static_size_multi_warp_tile_base;
|
| 583 |
+
|
| 584 |
+
details::multi_warp_scratch* const tile_memory;
|
| 585 |
+
|
| 586 |
+
template <unsigned int MaxBlockSize>
|
| 587 |
+
_CG_QUALIFIER thread_block(block_tile_memory<MaxBlockSize>& scratch) :
|
| 588 |
+
tile_memory(details::get_scratch_ptr(&scratch)) {
|
| 589 |
+
#ifdef _CG_DEBUG
|
| 590 |
+
if (num_threads() > MaxBlockSize) {
|
| 591 |
+
details::abort();
|
| 592 |
+
}
|
| 593 |
+
#endif
|
| 594 |
+
|
| 595 |
+
|
| 596 |
+
#if defined(_CG_USER_PROVIDED_SHARED_MEMORY)
|
| 597 |
+
#define _CG_SKIP_BARRIER_INIT_TARGET NV_NO_TARGET
|
| 598 |
+
#else
|
| 599 |
+
#define _CG_SKIP_BARRIER_INIT_TARGET NV_PROVIDES_SM_80
|
| 600 |
+
#endif
|
| 601 |
+
NV_IF_ELSE_TARGET(
|
| 602 |
+
_CG_SKIP_BARRIER_INIT_TARGET,
|
| 603 |
+
// skip if clause
|
| 604 |
+
,
|
| 605 |
+
(tile_memory->init_barriers(thread_rank());
|
| 606 |
+
sync();)
|
| 607 |
+
)
|
| 608 |
+
}
|
| 609 |
+
#endif
|
| 610 |
+
#undef _CG_SKIP_BARRIER_INIT_TARGET
|
| 611 |
+
|
| 612 |
+
// Disable constructor
|
| 613 |
+
_CG_QUALIFIER thread_block()
|
| 614 |
+
#if defined(_CG_CPP11_FEATURES)
|
| 615 |
+
: tile_memory(details::get_scratch_ptr(NULL))
|
| 616 |
+
#endif
|
| 617 |
+
{ }
|
| 618 |
+
|
| 619 |
+
// Internal Use
|
| 620 |
+
_CG_QUALIFIER thread_group _get_tiled_threads(unsigned int tilesz) const {
|
| 621 |
+
const bool pow2_tilesz = ((tilesz & (tilesz - 1)) == 0);
|
| 622 |
+
|
| 623 |
+
// Invalid, immediately fail
|
| 624 |
+
if (tilesz == 0 || (tilesz > 32) || !pow2_tilesz) {
|
| 625 |
+
details::abort();
|
| 626 |
+
return (thread_block());
|
| 627 |
+
}
|
| 628 |
+
|
| 629 |
+
unsigned int mask;
|
| 630 |
+
unsigned int base_offset = thread_rank() & (~(tilesz - 1));
|
| 631 |
+
unsigned int masklength = min((unsigned int)size() - base_offset, tilesz);
|
| 632 |
+
|
| 633 |
+
mask = (unsigned int)(-1) >> (32 - masklength);
|
| 634 |
+
mask <<= (details::laneid() & ~(tilesz - 1));
|
| 635 |
+
thread_group tile = thread_group(details::coalesced_group_id);
|
| 636 |
+
tile._data.coalesced.mask = mask;
|
| 637 |
+
tile._data.coalesced.size = __popc(mask);
|
| 638 |
+
tile._data.coalesced.metaGroupSize = (details::cta::size() + tilesz - 1) / tilesz;
|
| 639 |
+
tile._data.coalesced.metaGroupRank = details::cta::thread_rank() / tilesz;
|
| 640 |
+
tile._data.coalesced.is_tiled = true;
|
| 641 |
+
return (tile);
|
| 642 |
+
}
|
| 643 |
+
|
| 644 |
+
public:
|
| 645 |
+
_CG_STATIC_CONST_DECL unsigned int _group_id = details::thread_block_id;
|
| 646 |
+
_CG_THREAD_SCOPE(cuda::thread_scope::thread_scope_block)
|
| 647 |
+
|
| 648 |
+
_CG_STATIC_QUALIFIER void sync() {
|
| 649 |
+
details::cta::sync();
|
| 650 |
+
}
|
| 651 |
+
|
| 652 |
+
#if defined(_CG_CPP11_FEATURES)
|
| 653 |
+
struct arrival_token {};
|
| 654 |
+
|
| 655 |
+
_CG_QUALIFIER arrival_token barrier_arrive() const {
|
| 656 |
+
return arrival_token();
|
| 657 |
+
}
|
| 658 |
+
|
| 659 |
+
_CG_QUALIFIER void barrier_wait(arrival_token&&) const {
|
| 660 |
+
details::cta::sync();
|
| 661 |
+
}
|
| 662 |
+
#endif
|
| 663 |
+
|
| 664 |
+
_CG_STATIC_QUALIFIER unsigned int size() {
|
| 665 |
+
return details::cta::size();
|
| 666 |
+
}
|
| 667 |
+
|
| 668 |
+
_CG_STATIC_QUALIFIER unsigned int thread_rank() {
|
| 669 |
+
return details::cta::thread_rank();
|
| 670 |
+
}
|
| 671 |
+
|
| 672 |
+
// Additional functionality exposed by the group
|
| 673 |
+
_CG_STATIC_QUALIFIER dim3 group_index() {
|
| 674 |
+
return details::cta::group_index();
|
| 675 |
+
}
|
| 676 |
+
|
| 677 |
+
_CG_STATIC_QUALIFIER dim3 thread_index() {
|
| 678 |
+
return details::cta::thread_index();
|
| 679 |
+
}
|
| 680 |
+
|
| 681 |
+
_CG_STATIC_QUALIFIER dim3 group_dim() {
|
| 682 |
+
return details::cta::block_dim();
|
| 683 |
+
}
|
| 684 |
+
|
| 685 |
+
_CG_STATIC_QUALIFIER dim3 dim_threads() {
|
| 686 |
+
return details::cta::dim_threads();
|
| 687 |
+
}
|
| 688 |
+
|
| 689 |
+
_CG_STATIC_QUALIFIER unsigned int num_threads() {
|
| 690 |
+
return details::cta::num_threads();
|
| 691 |
+
}
|
| 692 |
+
|
| 693 |
+
};
|
| 694 |
+
|
| 695 |
+
/**
|
| 696 |
+
* thread_block this_thread_block()
|
| 697 |
+
*
|
| 698 |
+
* Constructs a thread_block group
|
| 699 |
+
*/
|
| 700 |
+
_CG_QUALIFIER thread_block this_thread_block()
|
| 701 |
+
{
|
| 702 |
+
return (thread_block());
|
| 703 |
+
}
|
| 704 |
+
|
| 705 |
+
#if defined(_CG_CPP11_FEATURES)
|
| 706 |
+
template <unsigned int MaxBlockSize>
|
| 707 |
+
_CG_QUALIFIER thread_block this_thread_block(block_tile_memory<MaxBlockSize>& scratch) {
|
| 708 |
+
return (thread_block(scratch));
|
| 709 |
+
}
|
| 710 |
+
#endif
|
| 711 |
+
|
| 712 |
+
/**
|
| 713 |
+
* class coalesced_group
|
| 714 |
+
*
|
| 715 |
+
* A group representing the current set of converged threads in a warp.
|
| 716 |
+
* The size of the group is not guaranteed and it may return a group of
|
| 717 |
+
* only one thread (itself).
|
| 718 |
+
*
|
| 719 |
+
* This group exposes warp-synchronous builtins.
|
| 720 |
+
* Constructed via coalesced_threads();
|
| 721 |
+
*/
|
| 722 |
+
class coalesced_group : public thread_group_base<details::coalesced_group_id>
|
| 723 |
+
{
|
| 724 |
+
private:
|
| 725 |
+
friend _CG_QUALIFIER coalesced_group coalesced_threads();
|
| 726 |
+
friend _CG_QUALIFIER thread_group tiled_partition(const thread_group& parent, unsigned int tilesz);
|
| 727 |
+
friend _CG_QUALIFIER coalesced_group tiled_partition(const coalesced_group& parent, unsigned int tilesz);
|
| 728 |
+
friend class details::_coalesced_group_data_access;
|
| 729 |
+
|
| 730 |
+
_CG_QUALIFIER unsigned int _packLanes(unsigned laneMask) const {
|
| 731 |
+
unsigned int member_pack = 0;
|
| 732 |
+
unsigned int member_rank = 0;
|
| 733 |
+
for (int bit_idx = 0; bit_idx < 32; bit_idx++) {
|
| 734 |
+
unsigned int lane_bit = _data.coalesced.mask & (1 << bit_idx);
|
| 735 |
+
if (lane_bit) {
|
| 736 |
+
if (laneMask & lane_bit)
|
| 737 |
+
member_pack |= 1 << member_rank;
|
| 738 |
+
member_rank++;
|
| 739 |
+
}
|
| 740 |
+
}
|
| 741 |
+
return (member_pack);
|
| 742 |
+
}
|
| 743 |
+
|
| 744 |
+
// Internal Use
|
| 745 |
+
_CG_QUALIFIER coalesced_group _get_tiled_threads(unsigned int tilesz) const {
|
| 746 |
+
const bool pow2_tilesz = ((tilesz & (tilesz - 1)) == 0);
|
| 747 |
+
|
| 748 |
+
// Invalid, immediately fail
|
| 749 |
+
if (tilesz == 0 || (tilesz > 32) || !pow2_tilesz) {
|
| 750 |
+
details::abort();
|
| 751 |
+
return (coalesced_group(0));
|
| 752 |
+
}
|
| 753 |
+
if (size() <= tilesz) {
|
| 754 |
+
return (*this);
|
| 755 |
+
}
|
| 756 |
+
|
| 757 |
+
if ((_data.coalesced.is_tiled == true) && pow2_tilesz) {
|
| 758 |
+
unsigned int base_offset = (thread_rank() & (~(tilesz - 1)));
|
| 759 |
+
unsigned int masklength = min((unsigned int)size() - base_offset, tilesz);
|
| 760 |
+
unsigned int mask = (unsigned int)(-1) >> (32 - masklength);
|
| 761 |
+
|
| 762 |
+
mask <<= (details::laneid() & ~(tilesz - 1));
|
| 763 |
+
coalesced_group coalesced_tile = coalesced_group(mask);
|
| 764 |
+
coalesced_tile._data.coalesced.metaGroupSize = size() / tilesz;
|
| 765 |
+
coalesced_tile._data.coalesced.metaGroupRank = thread_rank() / tilesz;
|
| 766 |
+
coalesced_tile._data.coalesced.is_tiled = true;
|
| 767 |
+
return (coalesced_tile);
|
| 768 |
+
}
|
| 769 |
+
else if ((_data.coalesced.is_tiled == false) && pow2_tilesz) {
|
| 770 |
+
unsigned int mask = 0;
|
| 771 |
+
unsigned int member_rank = 0;
|
| 772 |
+
int seen_lanes = (thread_rank() / tilesz) * tilesz;
|
| 773 |
+
for (unsigned int bit_idx = 0; bit_idx < 32; bit_idx++) {
|
| 774 |
+
unsigned int lane_bit = _data.coalesced.mask & (1 << bit_idx);
|
| 775 |
+
if (lane_bit) {
|
| 776 |
+
if (seen_lanes <= 0 && member_rank < tilesz) {
|
| 777 |
+
mask |= lane_bit;
|
| 778 |
+
member_rank++;
|
| 779 |
+
}
|
| 780 |
+
seen_lanes--;
|
| 781 |
+
}
|
| 782 |
+
}
|
| 783 |
+
coalesced_group coalesced_tile = coalesced_group(mask);
|
| 784 |
+
// Override parent with the size of this group
|
| 785 |
+
coalesced_tile._data.coalesced.metaGroupSize = (size() + tilesz - 1) / tilesz;
|
| 786 |
+
coalesced_tile._data.coalesced.metaGroupRank = thread_rank() / tilesz;
|
| 787 |
+
return coalesced_tile;
|
| 788 |
+
}
|
| 789 |
+
else {
|
| 790 |
+
// None in _CG_VERSION 1000
|
| 791 |
+
details::abort();
|
| 792 |
+
}
|
| 793 |
+
|
| 794 |
+
return (coalesced_group(0));
|
| 795 |
+
}
|
| 796 |
+
|
| 797 |
+
protected:
|
| 798 |
+
_CG_QUALIFIER coalesced_group(unsigned int mask) {
|
| 799 |
+
_data.coalesced.mask = mask;
|
| 800 |
+
_data.coalesced.size = __popc(mask);
|
| 801 |
+
_data.coalesced.metaGroupRank = 0;
|
| 802 |
+
_data.coalesced.metaGroupSize = 1;
|
| 803 |
+
_data.coalesced.is_tiled = false;
|
| 804 |
+
}
|
| 805 |
+
|
| 806 |
+
_CG_QUALIFIER unsigned int get_mask() const {
|
| 807 |
+
return (_data.coalesced.mask);
|
| 808 |
+
}
|
| 809 |
+
|
| 810 |
+
public:
|
| 811 |
+
_CG_STATIC_CONST_DECL unsigned int _group_id = details::coalesced_group_id;
|
| 812 |
+
_CG_THREAD_SCOPE(cuda::thread_scope::thread_scope_block)
|
| 813 |
+
|
| 814 |
+
_CG_QUALIFIER unsigned int num_threads() const {
|
| 815 |
+
return _data.coalesced.size;
|
| 816 |
+
}
|
| 817 |
+
|
| 818 |
+
_CG_QUALIFIER unsigned int size() const {
|
| 819 |
+
return num_threads();
|
| 820 |
+
}
|
| 821 |
+
|
| 822 |
+
_CG_QUALIFIER unsigned int thread_rank() const {
|
| 823 |
+
return (__popc(_data.coalesced.mask & details::lanemask32_lt()));
|
| 824 |
+
}
|
| 825 |
+
|
| 826 |
+
// Rank of this group in the upper level of the hierarchy
|
| 827 |
+
_CG_QUALIFIER unsigned int meta_group_rank() const {
|
| 828 |
+
return _data.coalesced.metaGroupRank;
|
| 829 |
+
}
|
| 830 |
+
|
| 831 |
+
// Total num partitions created out of all CTAs when the group was created
|
| 832 |
+
_CG_QUALIFIER unsigned int meta_group_size() const {
|
| 833 |
+
return _data.coalesced.metaGroupSize;
|
| 834 |
+
}
|
| 835 |
+
|
| 836 |
+
_CG_QUALIFIER void sync() const {
|
| 837 |
+
__syncwarp(_data.coalesced.mask);
|
| 838 |
+
}
|
| 839 |
+
|
| 840 |
+
#ifdef _CG_CPP11_FEATURES
|
| 841 |
+
template <typename TyElem, typename TyRet = details::remove_qual<TyElem>>
|
| 842 |
+
_CG_QUALIFIER TyRet shfl(TyElem&& elem, int srcRank) const {
|
| 843 |
+
unsigned int lane = (srcRank == 0) ? __ffs(_data.coalesced.mask) - 1 :
|
| 844 |
+
(size() == 32) ? srcRank : __fns(_data.coalesced.mask, 0, (srcRank + 1));
|
| 845 |
+
|
| 846 |
+
return details::tile::shuffle_dispatch<TyElem>::shfl(
|
| 847 |
+
_CG_STL_NAMESPACE::forward<TyElem>(elem), _data.coalesced.mask, lane, 32);
|
| 848 |
+
}
|
| 849 |
+
|
| 850 |
+
template <typename TyElem, typename TyRet = details::remove_qual<TyElem>>
|
| 851 |
+
_CG_QUALIFIER TyRet shfl_down(TyElem&& elem, unsigned int delta) const {
|
| 852 |
+
if (size() == 32) {
|
| 853 |
+
return details::tile::shuffle_dispatch<TyElem>::shfl_down(
|
| 854 |
+
_CG_STL_NAMESPACE::forward<TyElem>(elem), 0xFFFFFFFF, delta, 32);
|
| 855 |
+
}
|
| 856 |
+
|
| 857 |
+
unsigned int lane = __fns(_data.coalesced.mask, details::laneid(), delta + 1);
|
| 858 |
+
|
| 859 |
+
if (lane >= 32)
|
| 860 |
+
lane = details::laneid();
|
| 861 |
+
|
| 862 |
+
return details::tile::shuffle_dispatch<TyElem>::shfl(
|
| 863 |
+
_CG_STL_NAMESPACE::forward<TyElem>(elem), _data.coalesced.mask, lane, 32);
|
| 864 |
+
}
|
| 865 |
+
|
| 866 |
+
template <typename TyElem, typename TyRet = details::remove_qual<TyElem>>
|
| 867 |
+
_CG_QUALIFIER TyRet shfl_up(TyElem&& elem, int delta) const {
|
| 868 |
+
if (size() == 32) {
|
| 869 |
+
return details::tile::shuffle_dispatch<TyElem>::shfl_up(
|
| 870 |
+
_CG_STL_NAMESPACE::forward<TyElem>(elem), 0xFFFFFFFF, delta, 32);
|
| 871 |
+
}
|
| 872 |
+
|
| 873 |
+
unsigned lane = __fns(_data.coalesced.mask, details::laneid(), -(delta + 1));
|
| 874 |
+
if (lane >= 32)
|
| 875 |
+
lane = details::laneid();
|
| 876 |
+
|
| 877 |
+
return details::tile::shuffle_dispatch<TyElem>::shfl(
|
| 878 |
+
_CG_STL_NAMESPACE::forward<TyElem>(elem), _data.coalesced.mask, lane, 32);
|
| 879 |
+
}
|
| 880 |
+
#else
|
| 881 |
+
template <typename TyIntegral>
|
| 882 |
+
_CG_QUALIFIER TyIntegral shfl(TyIntegral var, unsigned int src_rank) const {
|
| 883 |
+
details::assert_if_not_arithmetic<TyIntegral>();
|
| 884 |
+
unsigned int lane = (src_rank == 0) ? __ffs(_data.coalesced.mask) - 1 :
|
| 885 |
+
(size() == 32) ? src_rank : __fns(_data.coalesced.mask, 0, (src_rank + 1));
|
| 886 |
+
return (__shfl_sync(_data.coalesced.mask, var, lane, 32));
|
| 887 |
+
}
|
| 888 |
+
|
| 889 |
+
template <typename TyIntegral>
|
| 890 |
+
_CG_QUALIFIER TyIntegral shfl_up(TyIntegral var, int delta) const {
|
| 891 |
+
details::assert_if_not_arithmetic<TyIntegral>();
|
| 892 |
+
if (size() == 32) {
|
| 893 |
+
return (__shfl_up_sync(0xFFFFFFFF, var, delta, 32));
|
| 894 |
+
}
|
| 895 |
+
unsigned lane = __fns(_data.coalesced.mask, details::laneid(), -(delta + 1));
|
| 896 |
+
if (lane >= 32) lane = details::laneid();
|
| 897 |
+
return (__shfl_sync(_data.coalesced.mask, var, lane, 32));
|
| 898 |
+
}
|
| 899 |
+
|
| 900 |
+
template <typename TyIntegral>
|
| 901 |
+
_CG_QUALIFIER TyIntegral shfl_down(TyIntegral var, int delta) const {
|
| 902 |
+
details::assert_if_not_arithmetic<TyIntegral>();
|
| 903 |
+
if (size() == 32) {
|
| 904 |
+
return (__shfl_down_sync(0xFFFFFFFF, var, delta, 32));
|
| 905 |
+
}
|
| 906 |
+
unsigned int lane = __fns(_data.coalesced.mask, details::laneid(), delta + 1);
|
| 907 |
+
if (lane >= 32) lane = details::laneid();
|
| 908 |
+
return (__shfl_sync(_data.coalesced.mask, var, lane, 32));
|
| 909 |
+
}
|
| 910 |
+
#endif
|
| 911 |
+
|
| 912 |
+
_CG_QUALIFIER int any(int predicate) const {
|
| 913 |
+
return (__ballot_sync(_data.coalesced.mask, predicate) != 0);
|
| 914 |
+
}
|
| 915 |
+
_CG_QUALIFIER int all(int predicate) const {
|
| 916 |
+
return (__ballot_sync(_data.coalesced.mask, predicate) == _data.coalesced.mask);
|
| 917 |
+
}
|
| 918 |
+
_CG_QUALIFIER unsigned int ballot(int predicate) const {
|
| 919 |
+
if (size() == 32) {
|
| 920 |
+
return (__ballot_sync(0xFFFFFFFF, predicate));
|
| 921 |
+
}
|
| 922 |
+
unsigned int lane_ballot = __ballot_sync(_data.coalesced.mask, predicate);
|
| 923 |
+
return (_packLanes(lane_ballot));
|
| 924 |
+
}
|
| 925 |
+
|
| 926 |
+
#ifdef _CG_HAS_MATCH_COLLECTIVE
|
| 927 |
+
|
| 928 |
+
template <typename TyIntegral>
|
| 929 |
+
_CG_QUALIFIER unsigned int match_any(TyIntegral val) const {
|
| 930 |
+
details::assert_if_not_arithmetic<TyIntegral>();
|
| 931 |
+
if (size() == 32) {
|
| 932 |
+
return (__match_any_sync(0xFFFFFFFF, val));
|
| 933 |
+
}
|
| 934 |
+
unsigned int lane_match = __match_any_sync(_data.coalesced.mask, val);
|
| 935 |
+
return (_packLanes(lane_match));
|
| 936 |
+
}
|
| 937 |
+
|
| 938 |
+
template <typename TyIntegral>
|
| 939 |
+
_CG_QUALIFIER unsigned int match_all(TyIntegral val, int &pred) const {
|
| 940 |
+
details::assert_if_not_arithmetic<TyIntegral>();
|
| 941 |
+
if (size() == 32) {
|
| 942 |
+
return (__match_all_sync(0xFFFFFFFF, val, &pred));
|
| 943 |
+
}
|
| 944 |
+
unsigned int lane_match = __match_all_sync(_data.coalesced.mask, val, &pred);
|
| 945 |
+
return (_packLanes(lane_match));
|
| 946 |
+
}
|
| 947 |
+
|
| 948 |
+
#endif /* !_CG_HAS_MATCH_COLLECTIVE */
|
| 949 |
+
|
| 950 |
+
};
|
| 951 |
+
|
| 952 |
+
_CG_QUALIFIER coalesced_group coalesced_threads()
|
| 953 |
+
{
|
| 954 |
+
return (coalesced_group(__activemask()));
|
| 955 |
+
}
|
| 956 |
+
|
| 957 |
+
namespace details {
|
| 958 |
+
template <unsigned int Size> struct verify_thread_block_tile_size;
|
| 959 |
+
template <> struct verify_thread_block_tile_size<32> { typedef void OK; };
|
| 960 |
+
template <> struct verify_thread_block_tile_size<16> { typedef void OK; };
|
| 961 |
+
template <> struct verify_thread_block_tile_size<8> { typedef void OK; };
|
| 962 |
+
template <> struct verify_thread_block_tile_size<4> { typedef void OK; };
|
| 963 |
+
template <> struct verify_thread_block_tile_size<2> { typedef void OK; };
|
| 964 |
+
template <> struct verify_thread_block_tile_size<1> { typedef void OK; };
|
| 965 |
+
|
| 966 |
+
#ifdef _CG_CPP11_FEATURES
|
| 967 |
+
template <unsigned int Size>
|
| 968 |
+
using _is_power_of_2 = _CG_STL_NAMESPACE::integral_constant<bool, (Size & (Size - 1)) == 0>;
|
| 969 |
+
|
| 970 |
+
template <unsigned int Size>
|
| 971 |
+
using _is_single_warp = _CG_STL_NAMESPACE::integral_constant<bool, Size <= 32>;
|
| 972 |
+
template <unsigned int Size>
|
| 973 |
+
using _is_multi_warp =
|
| 974 |
+
_CG_STL_NAMESPACE::integral_constant<bool, (Size > 32) && (Size <= 1024)>;
|
| 975 |
+
|
| 976 |
+
template <unsigned int Size>
|
| 977 |
+
using _is_valid_single_warp_tile =
|
| 978 |
+
_CG_STL_NAMESPACE::integral_constant<bool, _is_power_of_2<Size>::value && _is_single_warp<Size>::value>;
|
| 979 |
+
template <unsigned int Size>
|
| 980 |
+
using _is_valid_multi_warp_tile =
|
| 981 |
+
_CG_STL_NAMESPACE::integral_constant<bool, _is_power_of_2<Size>::value && _is_multi_warp<Size>::value>;
|
| 982 |
+
#else
|
| 983 |
+
template <unsigned int Size>
|
| 984 |
+
struct _is_multi_warp {
|
| 985 |
+
static const bool value = false;
|
| 986 |
+
};
|
| 987 |
+
#endif
|
| 988 |
+
}
|
| 989 |
+
|
| 990 |
+
template <unsigned int Size>
|
| 991 |
+
class __static_size_tile_base
|
| 992 |
+
{
|
| 993 |
+
protected:
|
| 994 |
+
_CG_STATIC_CONST_DECL unsigned int numThreads = Size;
|
| 995 |
+
|
| 996 |
+
public:
|
| 997 |
+
_CG_THREAD_SCOPE(cuda::thread_scope::thread_scope_block)
|
| 998 |
+
|
| 999 |
+
// Rank of thread within tile
|
| 1000 |
+
_CG_STATIC_QUALIFIER unsigned int thread_rank() {
|
| 1001 |
+
return (details::cta::thread_rank() & (numThreads - 1));
|
| 1002 |
+
}
|
| 1003 |
+
|
| 1004 |
+
// Number of threads within tile
|
| 1005 |
+
_CG_STATIC_CONSTEXPR_QUALIFIER unsigned int num_threads() {
|
| 1006 |
+
return numThreads;
|
| 1007 |
+
}
|
| 1008 |
+
|
| 1009 |
+
_CG_STATIC_CONSTEXPR_QUALIFIER unsigned int size() {
|
| 1010 |
+
return num_threads();
|
| 1011 |
+
}
|
| 1012 |
+
};
|
| 1013 |
+
|
| 1014 |
+
template <unsigned int Size>
|
| 1015 |
+
class __static_size_thread_block_tile_base : public __static_size_tile_base<Size>
|
| 1016 |
+
{
|
| 1017 |
+
friend class details::_coalesced_group_data_access;
|
| 1018 |
+
typedef details::tile::tile_helpers<Size> th;
|
| 1019 |
+
|
| 1020 |
+
#ifdef _CG_CPP11_FEATURES
|
| 1021 |
+
static_assert(details::_is_valid_single_warp_tile<Size>::value, "Size must be one of 1/2/4/8/16/32");
|
| 1022 |
+
#else
|
| 1023 |
+
typedef typename details::verify_thread_block_tile_size<Size>::OK valid;
|
| 1024 |
+
#endif
|
| 1025 |
+
using __static_size_tile_base<Size>::numThreads;
|
| 1026 |
+
_CG_STATIC_CONST_DECL unsigned int fullMask = 0xFFFFFFFF;
|
| 1027 |
+
|
| 1028 |
+
protected:
|
| 1029 |
+
_CG_STATIC_QUALIFIER unsigned int build_mask() {
|
| 1030 |
+
unsigned int mask = fullMask;
|
| 1031 |
+
if (numThreads != 32) {
|
| 1032 |
+
// [0,31] representing the current active thread in the warp
|
| 1033 |
+
unsigned int laneId = details::laneid();
|
| 1034 |
+
// shift mask according to the partition it belongs to
|
| 1035 |
+
mask = th::tileMask << (laneId & ~(th::laneMask));
|
| 1036 |
+
}
|
| 1037 |
+
return (mask);
|
| 1038 |
+
}
|
| 1039 |
+
|
| 1040 |
+
public:
|
| 1041 |
+
_CG_STATIC_CONST_DECL unsigned int _group_id = details::coalesced_group_id;
|
| 1042 |
+
|
| 1043 |
+
_CG_STATIC_QUALIFIER void sync() {
|
| 1044 |
+
__syncwarp(build_mask());
|
| 1045 |
+
}
|
| 1046 |
+
|
| 1047 |
+
#ifdef _CG_CPP11_FEATURES
|
| 1048 |
+
// PTX supported collectives
|
| 1049 |
+
template <typename TyElem, typename TyRet = details::remove_qual<TyElem>>
|
| 1050 |
+
_CG_QUALIFIER TyRet shfl(TyElem&& elem, int srcRank) const {
|
| 1051 |
+
return details::tile::shuffle_dispatch<TyElem>::shfl(
|
| 1052 |
+
_CG_STL_NAMESPACE::forward<TyElem>(elem), build_mask(), srcRank, numThreads);
|
| 1053 |
+
}
|
| 1054 |
+
|
| 1055 |
+
template <typename TyElem, typename TyRet = details::remove_qual<TyElem>>
|
| 1056 |
+
_CG_QUALIFIER TyRet shfl_down(TyElem&& elem, unsigned int delta) const {
|
| 1057 |
+
return details::tile::shuffle_dispatch<TyElem>::shfl_down(
|
| 1058 |
+
_CG_STL_NAMESPACE::forward<TyElem>(elem), build_mask(), delta, numThreads);
|
| 1059 |
+
}
|
| 1060 |
+
|
| 1061 |
+
template <typename TyElem, typename TyRet = details::remove_qual<TyElem>>
|
| 1062 |
+
_CG_QUALIFIER TyRet shfl_up(TyElem&& elem, unsigned int delta) const {
|
| 1063 |
+
return details::tile::shuffle_dispatch<TyElem>::shfl_up(
|
| 1064 |
+
_CG_STL_NAMESPACE::forward<TyElem>(elem), build_mask(), delta, numThreads);
|
| 1065 |
+
}
|
| 1066 |
+
|
| 1067 |
+
template <typename TyElem, typename TyRet = details::remove_qual<TyElem>>
|
| 1068 |
+
_CG_QUALIFIER TyRet shfl_xor(TyElem&& elem, unsigned int laneMask) const {
|
| 1069 |
+
return details::tile::shuffle_dispatch<TyElem>::shfl_xor(
|
| 1070 |
+
_CG_STL_NAMESPACE::forward<TyElem>(elem), build_mask(), laneMask, numThreads);
|
| 1071 |
+
}
|
| 1072 |
+
#else
|
| 1073 |
+
template <typename TyIntegral>
|
| 1074 |
+
_CG_QUALIFIER TyIntegral shfl(TyIntegral var, int srcRank) const {
|
| 1075 |
+
details::assert_if_not_arithmetic<TyIntegral>();
|
| 1076 |
+
return (__shfl_sync(build_mask(), var, srcRank, numThreads));
|
| 1077 |
+
}
|
| 1078 |
+
|
| 1079 |
+
template <typename TyIntegral>
|
| 1080 |
+
_CG_QUALIFIER TyIntegral shfl_down(TyIntegral var, unsigned int delta) const {
|
| 1081 |
+
details::assert_if_not_arithmetic<TyIntegral>();
|
| 1082 |
+
return (__shfl_down_sync(build_mask(), var, delta, numThreads));
|
| 1083 |
+
}
|
| 1084 |
+
|
| 1085 |
+
template <typename TyIntegral>
|
| 1086 |
+
_CG_QUALIFIER TyIntegral shfl_up(TyIntegral var, unsigned int delta) const {
|
| 1087 |
+
details::assert_if_not_arithmetic<TyIntegral>();
|
| 1088 |
+
return (__shfl_up_sync(build_mask(), var, delta, numThreads));
|
| 1089 |
+
}
|
| 1090 |
+
|
| 1091 |
+
template <typename TyIntegral>
|
| 1092 |
+
_CG_QUALIFIER TyIntegral shfl_xor(TyIntegral var, unsigned int laneMask) const {
|
| 1093 |
+
details::assert_if_not_arithmetic<TyIntegral>();
|
| 1094 |
+
return (__shfl_xor_sync(build_mask(), var, laneMask, numThreads));
|
| 1095 |
+
}
|
| 1096 |
+
#endif //_CG_CPP11_FEATURES
|
| 1097 |
+
|
| 1098 |
+
_CG_QUALIFIER int any(int predicate) const {
|
| 1099 |
+
unsigned int lane_ballot = __ballot_sync(build_mask(), predicate);
|
| 1100 |
+
return (lane_ballot != 0);
|
| 1101 |
+
}
|
| 1102 |
+
_CG_QUALIFIER int all(int predicate) const {
|
| 1103 |
+
unsigned int lane_ballot = __ballot_sync(build_mask(), predicate);
|
| 1104 |
+
return (lane_ballot == build_mask());
|
| 1105 |
+
}
|
| 1106 |
+
_CG_QUALIFIER unsigned int ballot(int predicate) const {
|
| 1107 |
+
unsigned int lane_ballot = __ballot_sync(build_mask(), predicate);
|
| 1108 |
+
return (lane_ballot >> (details::laneid() & (~(th::laneMask))));
|
| 1109 |
+
}
|
| 1110 |
+
|
| 1111 |
+
#ifdef _CG_HAS_MATCH_COLLECTIVE
|
| 1112 |
+
template <typename TyIntegral>
|
| 1113 |
+
_CG_QUALIFIER unsigned int match_any(TyIntegral val) const {
|
| 1114 |
+
details::assert_if_not_arithmetic<TyIntegral>();
|
| 1115 |
+
unsigned int lane_match = __match_any_sync(build_mask(), val);
|
| 1116 |
+
return (lane_match >> (details::laneid() & (~(th::laneMask))));
|
| 1117 |
+
}
|
| 1118 |
+
|
| 1119 |
+
template <typename TyIntegral>
|
| 1120 |
+
_CG_QUALIFIER unsigned int match_all(TyIntegral val, int &pred) const {
|
| 1121 |
+
details::assert_if_not_arithmetic<TyIntegral>();
|
| 1122 |
+
unsigned int lane_match = __match_all_sync(build_mask(), val, &pred);
|
| 1123 |
+
return (lane_match >> (details::laneid() & (~(th::laneMask))));
|
| 1124 |
+
}
|
| 1125 |
+
#endif
|
| 1126 |
+
|
| 1127 |
+
};
|
| 1128 |
+
|
| 1129 |
+
template <unsigned int Size, typename ParentT>
|
| 1130 |
+
class __static_parent_thread_block_tile_base
|
| 1131 |
+
{
|
| 1132 |
+
public:
|
| 1133 |
+
// Rank of this group in the upper level of the hierarchy
|
| 1134 |
+
_CG_STATIC_QUALIFIER unsigned int meta_group_rank() {
|
| 1135 |
+
return ParentT::thread_rank() / Size;
|
| 1136 |
+
}
|
| 1137 |
+
|
| 1138 |
+
// Total num partitions created out of all CTAs when the group was created
|
| 1139 |
+
_CG_STATIC_QUALIFIER unsigned int meta_group_size() {
|
| 1140 |
+
return (ParentT::size() + Size - 1) / Size;
|
| 1141 |
+
}
|
| 1142 |
+
};
|
| 1143 |
+
|
| 1144 |
+
/**
|
| 1145 |
+
* class thread_block_tile<unsigned int Size, ParentT = void>
|
| 1146 |
+
*
|
| 1147 |
+
* Statically-sized group type, representing one tile of a thread block.
|
| 1148 |
+
* The only specializations currently supported are those with native
|
| 1149 |
+
* hardware support (1/2/4/8/16/32)
|
| 1150 |
+
*
|
| 1151 |
+
* This group exposes warp-synchronous builtins.
|
| 1152 |
+
* Can only be constructed via tiled_partition<Size>(ParentT&)
|
| 1153 |
+
*/
|
| 1154 |
+
|
| 1155 |
+
template <unsigned int Size, typename ParentT = void>
|
| 1156 |
+
class __single_warp_thread_block_tile :
|
| 1157 |
+
public __static_size_thread_block_tile_base<Size>,
|
| 1158 |
+
public __static_parent_thread_block_tile_base<Size, ParentT>
|
| 1159 |
+
{
|
| 1160 |
+
typedef __static_parent_thread_block_tile_base<Size, ParentT> staticParentBaseT;
|
| 1161 |
+
friend class details::_coalesced_group_data_access;
|
| 1162 |
+
|
| 1163 |
+
protected:
|
| 1164 |
+
_CG_QUALIFIER __single_warp_thread_block_tile() { };
|
| 1165 |
+
_CG_QUALIFIER __single_warp_thread_block_tile(unsigned int, unsigned int) { };
|
| 1166 |
+
|
| 1167 |
+
_CG_STATIC_QUALIFIER unsigned int get_mask() {
|
| 1168 |
+
return __static_size_thread_block_tile_base<Size>::build_mask();
|
| 1169 |
+
}
|
| 1170 |
+
};
|
| 1171 |
+
|
| 1172 |
+
template <unsigned int Size>
|
| 1173 |
+
class __single_warp_thread_block_tile<Size, void> :
|
| 1174 |
+
public __static_size_thread_block_tile_base<Size>,
|
| 1175 |
+
public thread_group_base<details::coalesced_group_id>
|
| 1176 |
+
{
|
| 1177 |
+
_CG_STATIC_CONST_DECL unsigned int numThreads = Size;
|
| 1178 |
+
|
| 1179 |
+
template <unsigned int, typename ParentT> friend class __single_warp_thread_block_tile;
|
| 1180 |
+
friend class details::_coalesced_group_data_access;
|
| 1181 |
+
|
| 1182 |
+
typedef __static_size_thread_block_tile_base<numThreads> staticSizeBaseT;
|
| 1183 |
+
|
| 1184 |
+
protected:
|
| 1185 |
+
_CG_QUALIFIER __single_warp_thread_block_tile(unsigned int meta_group_rank = 0, unsigned int meta_group_size = 1) {
|
| 1186 |
+
_data.coalesced.mask = staticSizeBaseT::build_mask();
|
| 1187 |
+
_data.coalesced.size = numThreads;
|
| 1188 |
+
_data.coalesced.metaGroupRank = meta_group_rank;
|
| 1189 |
+
_data.coalesced.metaGroupSize = meta_group_size;
|
| 1190 |
+
_data.coalesced.is_tiled = true;
|
| 1191 |
+
}
|
| 1192 |
+
|
| 1193 |
+
_CG_QUALIFIER unsigned int get_mask() const {
|
| 1194 |
+
return (_data.coalesced.mask);
|
| 1195 |
+
}
|
| 1196 |
+
|
| 1197 |
+
public:
|
| 1198 |
+
using staticSizeBaseT::sync;
|
| 1199 |
+
using staticSizeBaseT::size;
|
| 1200 |
+
using staticSizeBaseT::num_threads;
|
| 1201 |
+
using staticSizeBaseT::thread_rank;
|
| 1202 |
+
|
| 1203 |
+
_CG_QUALIFIER unsigned int meta_group_rank() const {
|
| 1204 |
+
return _data.coalesced.metaGroupRank;
|
| 1205 |
+
}
|
| 1206 |
+
|
| 1207 |
+
_CG_QUALIFIER unsigned int meta_group_size() const {
|
| 1208 |
+
return _data.coalesced.metaGroupSize;
|
| 1209 |
+
}
|
| 1210 |
+
};
|
| 1211 |
+
|
| 1212 |
+
/**
|
| 1213 |
+
* Outer level API calls
|
| 1214 |
+
* void sync(GroupT) - see <group_type>.sync()
|
| 1215 |
+
* void thread_rank(GroupT) - see <group_type>.thread_rank()
|
| 1216 |
+
* void group_size(GroupT) - see <group_type>.size()
|
| 1217 |
+
*/
|
| 1218 |
+
template <class GroupT>
|
| 1219 |
+
_CG_QUALIFIER void sync(GroupT const &g)
|
| 1220 |
+
{
|
| 1221 |
+
g.sync();
|
| 1222 |
+
}
|
| 1223 |
+
|
| 1224 |
+
// TODO: Use a static dispatch to determine appropriate return type
|
| 1225 |
+
// C++03 is stuck with unsigned long long for now
|
| 1226 |
+
#ifdef _CG_CPP11_FEATURES
|
| 1227 |
+
template <class GroupT>
|
| 1228 |
+
_CG_QUALIFIER auto thread_rank(GroupT const& g) -> decltype(g.thread_rank()) {
|
| 1229 |
+
return g.thread_rank();
|
| 1230 |
+
}
|
| 1231 |
+
|
| 1232 |
+
|
| 1233 |
+
template <class GroupT>
|
| 1234 |
+
_CG_QUALIFIER auto group_size(GroupT const &g) -> decltype(g.num_threads()) {
|
| 1235 |
+
return g.num_threads();
|
| 1236 |
+
}
|
| 1237 |
+
#else
|
| 1238 |
+
template <class GroupT>
|
| 1239 |
+
_CG_QUALIFIER unsigned long long thread_rank(GroupT const& g) {
|
| 1240 |
+
return static_cast<unsigned long long>(g.thread_rank());
|
| 1241 |
+
}
|
| 1242 |
+
|
| 1243 |
+
|
| 1244 |
+
template <class GroupT>
|
| 1245 |
+
_CG_QUALIFIER unsigned long long group_size(GroupT const &g) {
|
| 1246 |
+
return static_cast<unsigned long long>(g.num_threads());
|
| 1247 |
+
}
|
| 1248 |
+
#endif
|
| 1249 |
+
|
| 1250 |
+
|
| 1251 |
+
/**
|
| 1252 |
+
* tiled_partition
|
| 1253 |
+
*
|
| 1254 |
+
* The tiled_partition(parent, tilesz) method is a collective operation that
|
| 1255 |
+
* partitions the parent group into a one-dimensional, row-major, tiling of subgroups.
|
| 1256 |
+
*
|
| 1257 |
+
* A total of ((size(parent)+tilesz-1)/tilesz) subgroups will
|
| 1258 |
+
* be created where threads having identical k = (thread_rank(parent)/tilesz)
|
| 1259 |
+
* will be members of the same subgroup.
|
| 1260 |
+
*
|
| 1261 |
+
* The implementation may cause the calling thread to wait until all the members
|
| 1262 |
+
* of the parent group have invoked the operation before resuming execution.
|
| 1263 |
+
*
|
| 1264 |
+
* Functionality is limited to power-of-two sized subgorup instances of at most
|
| 1265 |
+
* 32 threads. Only thread_block, thread_block_tile<>, and their subgroups can be
|
| 1266 |
+
* tiled_partition() in _CG_VERSION 1000.
|
| 1267 |
+
*/
|
| 1268 |
+
_CG_QUALIFIER thread_group tiled_partition(const thread_group& parent, unsigned int tilesz)
|
| 1269 |
+
{
|
| 1270 |
+
if (parent.get_type() == details::coalesced_group_id) {
|
| 1271 |
+
const coalesced_group *_cg = static_cast<const coalesced_group*>(&parent);
|
| 1272 |
+
return _cg->_get_tiled_threads(tilesz);
|
| 1273 |
+
}
|
| 1274 |
+
else {
|
| 1275 |
+
const thread_block *_tb = static_cast<const thread_block*>(&parent);
|
| 1276 |
+
return _tb->_get_tiled_threads(tilesz);
|
| 1277 |
+
}
|
| 1278 |
+
}
|
| 1279 |
+
|
| 1280 |
+
// Thread block type overload: returns a basic thread_group for now (may be specialized later)
|
| 1281 |
+
_CG_QUALIFIER thread_group tiled_partition(const thread_block& parent, unsigned int tilesz)
|
| 1282 |
+
{
|
| 1283 |
+
return (parent._get_tiled_threads(tilesz));
|
| 1284 |
+
}
|
| 1285 |
+
|
| 1286 |
+
// Coalesced group type overload: retains its ability to stay coalesced
|
| 1287 |
+
_CG_QUALIFIER coalesced_group tiled_partition(const coalesced_group& parent, unsigned int tilesz)
|
| 1288 |
+
{
|
| 1289 |
+
return (parent._get_tiled_threads(tilesz));
|
| 1290 |
+
}
|
| 1291 |
+
|
| 1292 |
+
namespace details {
|
| 1293 |
+
template <unsigned int Size, typename ParentT>
|
| 1294 |
+
class internal_thread_block_tile : public __single_warp_thread_block_tile<Size, ParentT> {};
|
| 1295 |
+
|
| 1296 |
+
template <unsigned int Size, typename ParentT>
|
| 1297 |
+
_CG_QUALIFIER internal_thread_block_tile<Size, ParentT> tiled_partition_internal() {
|
| 1298 |
+
return internal_thread_block_tile<Size, ParentT>();
|
| 1299 |
+
}
|
| 1300 |
+
|
| 1301 |
+
template <typename TyVal, typename GroupT, typename WarpLambda, typename InterWarpLambda>
|
| 1302 |
+
_CG_QUALIFIER TyVal multi_warp_collectives_helper(
|
| 1303 |
+
const GroupT& group,
|
| 1304 |
+
WarpLambda warp_lambda,
|
| 1305 |
+
InterWarpLambda inter_warp_lambda) {
|
| 1306 |
+
return group.template collectives_scheme<TyVal>(warp_lambda, inter_warp_lambda);
|
| 1307 |
+
}
|
| 1308 |
+
|
| 1309 |
+
template <typename T, typename GroupT>
|
| 1310 |
+
_CG_QUALIFIER T* multi_warp_scratch_location_getter(const GroupT& group, unsigned int warp_id) {
|
| 1311 |
+
return group.template get_scratch_location<T>(warp_id);
|
| 1312 |
+
}
|
| 1313 |
+
|
| 1314 |
+
template <typename GroupT>
|
| 1315 |
+
_CG_QUALIFIER details::barrier_t* multi_warp_sync_location_getter(const GroupT& group) {
|
| 1316 |
+
return group.get_sync_location();
|
| 1317 |
+
}
|
| 1318 |
+
|
| 1319 |
+
}
|
| 1320 |
+
/**
|
| 1321 |
+
* tiled_partition<tilesz>
|
| 1322 |
+
*
|
| 1323 |
+
* The tiled_partition<tilesz>(parent) method is a collective operation that
|
| 1324 |
+
* partitions the parent group into a one-dimensional, row-major, tiling of subgroups.
|
| 1325 |
+
*
|
| 1326 |
+
* A total of ((size(parent)/tilesz) subgroups will be created,
|
| 1327 |
+
* therefore the parent group size must be evenly divisible by the tilesz.
|
| 1328 |
+
* The allow parent groups are thread_block or thread_block_tile<size>.
|
| 1329 |
+
*
|
| 1330 |
+
* The implementation may cause the calling thread to wait until all the members
|
| 1331 |
+
* of the parent group have invoked the operation before resuming execution.
|
| 1332 |
+
*
|
| 1333 |
+
* Functionality is limited to native hardware sizes, 1/2/4/8/16/32.
|
| 1334 |
+
* The size(parent) must be greater than the template Size parameter
|
| 1335 |
+
* otherwise the results are undefined.
|
| 1336 |
+
*/
|
| 1337 |
+
|
| 1338 |
+
#if defined(_CG_CPP11_FEATURES)
|
| 1339 |
+
template <unsigned int Size>
|
| 1340 |
+
class __static_size_multi_warp_tile_base : public __static_size_tile_base<Size>
|
| 1341 |
+
{
|
| 1342 |
+
static_assert(details::_is_valid_multi_warp_tile<Size>::value, "Size must be one of 64/128/256/512");
|
| 1343 |
+
|
| 1344 |
+
template <typename TyVal, typename GroupT, typename WarpLambda, typename InterWarpLambda>
|
| 1345 |
+
friend __device__ TyVal details::multi_warp_collectives_helper(
|
| 1346 |
+
const GroupT& group,
|
| 1347 |
+
WarpLambda warp_lambda,
|
| 1348 |
+
InterWarpLambda inter_warp_lambda);
|
| 1349 |
+
template <typename T, typename GroupT>
|
| 1350 |
+
friend __device__ T* details::multi_warp_scratch_location_getter(const GroupT& group, unsigned int warp_id);
|
| 1351 |
+
template <typename GroupT>
|
| 1352 |
+
friend __device__ details::barrier_t* details::multi_warp_sync_location_getter(const GroupT& group);
|
| 1353 |
+
template <unsigned int OtherSize>
|
| 1354 |
+
friend class __static_size_multi_warp_tile_base;
|
| 1355 |
+
using WarpType = details::internal_thread_block_tile<32, __static_size_multi_warp_tile_base<Size>>;
|
| 1356 |
+
using ThisType = __static_size_multi_warp_tile_base<Size>;
|
| 1357 |
+
_CG_STATIC_CONST_DECL int numWarps = Size / 32;
|
| 1358 |
+
|
| 1359 |
+
protected:
|
| 1360 |
+
details::multi_warp_scratch* const tile_memory;
|
| 1361 |
+
|
| 1362 |
+
template <typename GroupT>
|
| 1363 |
+
_CG_QUALIFIER __static_size_multi_warp_tile_base(const GroupT& g) : tile_memory(g.tile_memory) {
|
| 1364 |
+
#if !defined(_CG_USER_PROVIDED_SHARED_MEMORY)
|
| 1365 |
+
NV_IF_TARGET(NV_PROVIDES_SM_80,
|
| 1366 |
+
details::sync_warps_reset(get_sync_location(), details::cta::thread_rank());
|
| 1367 |
+
g.sync();
|
| 1368 |
+
)
|
| 1369 |
+
#endif
|
| 1370 |
+
}
|
| 1371 |
+
|
| 1372 |
+
|
| 1373 |
+
private:
|
| 1374 |
+
_CG_QUALIFIER details::barrier_t* get_sync_location() const {
|
| 1375 |
+
// Different group sizes use different barriers, all groups of a given size share one barrier.
|
| 1376 |
+
unsigned int sync_id = details::log2(Size / 64);
|
| 1377 |
+
return &tile_memory->barriers[sync_id];
|
| 1378 |
+
}
|
| 1379 |
+
|
| 1380 |
+
template <typename T>
|
| 1381 |
+
_CG_QUALIFIER T* get_scratch_location(unsigned int warp_id) const {
|
| 1382 |
+
unsigned int scratch_id = (details::cta::thread_rank() - thread_rank()) / 32 + warp_id;
|
| 1383 |
+
return reinterpret_cast<T*>(&tile_memory->communication_memory[scratch_id]);
|
| 1384 |
+
}
|
| 1385 |
+
|
| 1386 |
+
template <typename T>
|
| 1387 |
+
_CG_QUALIFIER T* get_scratch_location() const {
|
| 1388 |
+
unsigned int scratch_id = details::cta::thread_rank() / 32;
|
| 1389 |
+
return reinterpret_cast<T*>(&tile_memory->communication_memory[scratch_id]);
|
| 1390 |
+
}
|
| 1391 |
+
|
| 1392 |
+
template <typename TyVal>
|
| 1393 |
+
_CG_QUALIFIER TyVal shfl_impl(TyVal val, unsigned int src) const {
|
| 1394 |
+
unsigned int src_warp = src / 32;
|
| 1395 |
+
auto warp = details::tiled_partition_internal<32, ThisType>();
|
| 1396 |
+
details::barrier_t* sync_location = get_sync_location();
|
| 1397 |
+
|
| 1398 |
+
// Get warp slot of the source threads warp.
|
| 1399 |
+
TyVal* warp_scratch_location = get_scratch_location<TyVal>(src_warp);
|
| 1400 |
+
|
| 1401 |
+
if (warp.meta_group_rank() == src_warp) {
|
| 1402 |
+
warp.sync();
|
| 1403 |
+
// Put shuffled value into my warp slot and let my warp arrive at the barrier.
|
| 1404 |
+
if (thread_rank() == src) {
|
| 1405 |
+
*warp_scratch_location = val;
|
| 1406 |
+
}
|
| 1407 |
+
details::sync_warps_arrive(sync_location, details::cta::thread_rank(), numWarps);
|
| 1408 |
+
TyVal result = *warp_scratch_location;
|
| 1409 |
+
details::sync_warps_wait(sync_location, details::cta::thread_rank());
|
| 1410 |
+
return result;
|
| 1411 |
+
}
|
| 1412 |
+
else {
|
| 1413 |
+
// Wait for the source warp to arrive on the barrier.
|
| 1414 |
+
details::sync_warps_wait_for_specific_warp(sync_location,
|
| 1415 |
+
(details::cta::thread_rank() / 32 - warp.meta_group_rank() + src_warp));
|
| 1416 |
+
TyVal result = *warp_scratch_location;
|
| 1417 |
+
details::sync_warps(sync_location, details::cta::thread_rank(), numWarps);
|
| 1418 |
+
return result;
|
| 1419 |
+
}
|
| 1420 |
+
}
|
| 1421 |
+
|
| 1422 |
+
template <typename TyVal, typename WarpLambda, typename InterWarpLambda>
|
| 1423 |
+
_CG_QUALIFIER TyVal collectives_scheme(const WarpLambda& warp_lambda, const InterWarpLambda& inter_warp_lambda) const {
|
| 1424 |
+
static_assert(sizeof(TyVal) <= details::multi_warp_scratch::communication_size,
|
| 1425 |
+
"Collectives with tiles larger than 32 threads are limited to types smaller then 8 bytes");
|
| 1426 |
+
auto warp = details::tiled_partition_internal<32, ThisType>();
|
| 1427 |
+
details::barrier_t* sync_location = get_sync_location();
|
| 1428 |
+
TyVal* warp_scratch_location = get_scratch_location<TyVal>();
|
| 1429 |
+
|
| 1430 |
+
warp_lambda(warp, warp_scratch_location);
|
| 1431 |
+
|
| 1432 |
+
if (details::sync_warps_last_releases(sync_location, details::cta::thread_rank(), numWarps)) {
|
| 1433 |
+
auto subwarp = details::tiled_partition_internal<numWarps, decltype(warp)>();
|
| 1434 |
+
if (subwarp.meta_group_rank() == 0) {
|
| 1435 |
+
TyVal* thread_scratch_location = get_scratch_location<TyVal>(subwarp.thread_rank());
|
| 1436 |
+
inter_warp_lambda(subwarp, thread_scratch_location);
|
| 1437 |
+
}
|
| 1438 |
+
warp.sync();
|
| 1439 |
+
details::sync_warps_release(sync_location, warp.thread_rank() == 0, details::cta::thread_rank(), numWarps);
|
| 1440 |
+
}
|
| 1441 |
+
TyVal result = *warp_scratch_location;
|
| 1442 |
+
return result;
|
| 1443 |
+
}
|
| 1444 |
+
|
| 1445 |
+
public:
|
| 1446 |
+
_CG_STATIC_CONST_DECL unsigned int _group_id = details::multi_tile_group_id;
|
| 1447 |
+
|
| 1448 |
+
using __static_size_tile_base<Size>::thread_rank;
|
| 1449 |
+
|
| 1450 |
+
template <typename TyVal>
|
| 1451 |
+
_CG_QUALIFIER TyVal shfl(TyVal val, unsigned int src) const {
|
| 1452 |
+
static_assert(sizeof(TyVal) <= details::multi_warp_scratch::communication_size,
|
| 1453 |
+
"Collectives with tiles larger than 32 threads are limited to types smaller then 8 bytes");
|
| 1454 |
+
return shfl_impl(val, src);
|
| 1455 |
+
}
|
| 1456 |
+
|
| 1457 |
+
_CG_QUALIFIER void sync() const {
|
| 1458 |
+
details::sync_warps(get_sync_location(), details::cta::thread_rank(), numWarps);
|
| 1459 |
+
}
|
| 1460 |
+
|
| 1461 |
+
_CG_QUALIFIER int any(int predicate) const {
|
| 1462 |
+
auto warp_lambda = [=] (WarpType& warp, int* warp_scratch_location) {
|
| 1463 |
+
*warp_scratch_location = __any_sync(0xFFFFFFFF, predicate);
|
| 1464 |
+
};
|
| 1465 |
+
auto inter_warp_lambda =
|
| 1466 |
+
[] (details::internal_thread_block_tile<numWarps, WarpType>& subwarp, int* thread_scratch_location) {
|
| 1467 |
+
*thread_scratch_location = __any_sync(0xFFFFFFFFU >> (32 - numWarps), *thread_scratch_location);
|
| 1468 |
+
};
|
| 1469 |
+
return collectives_scheme<int>(warp_lambda, inter_warp_lambda);
|
| 1470 |
+
}
|
| 1471 |
+
|
| 1472 |
+
_CG_QUALIFIER int all(int predicate) const {
|
| 1473 |
+
auto warp_lambda = [=] (WarpType& warp, int* warp_scratch_location) {
|
| 1474 |
+
*warp_scratch_location = __all_sync(0xFFFFFFFF, predicate);
|
| 1475 |
+
};
|
| 1476 |
+
auto inter_warp_lambda =
|
| 1477 |
+
[] (details::internal_thread_block_tile<numWarps, WarpType>& subwarp, int* thread_scratch_location) {
|
| 1478 |
+
*thread_scratch_location = __all_sync(0xFFFFFFFFU >> (32 - numWarps), *thread_scratch_location);
|
| 1479 |
+
};
|
| 1480 |
+
return collectives_scheme<int>(warp_lambda, inter_warp_lambda);
|
| 1481 |
+
}
|
| 1482 |
+
};
|
| 1483 |
+
|
| 1484 |
+
|
| 1485 |
+
template <unsigned int Size, typename ParentT = void>
|
| 1486 |
+
class __multi_warp_thread_block_tile :
|
| 1487 |
+
public __static_size_multi_warp_tile_base<Size>,
|
| 1488 |
+
public __static_parent_thread_block_tile_base<Size, ParentT>
|
| 1489 |
+
{
|
| 1490 |
+
typedef __static_parent_thread_block_tile_base<Size, ParentT> staticParentBaseT;
|
| 1491 |
+
typedef __static_size_multi_warp_tile_base<Size> staticTileBaseT;
|
| 1492 |
+
protected:
|
| 1493 |
+
_CG_QUALIFIER __multi_warp_thread_block_tile(const ParentT& g) :
|
| 1494 |
+
__static_size_multi_warp_tile_base<Size>(g) {}
|
| 1495 |
+
};
|
| 1496 |
+
|
| 1497 |
+
template <unsigned int Size>
|
| 1498 |
+
class __multi_warp_thread_block_tile<Size, void> : public __static_size_multi_warp_tile_base<Size>
|
| 1499 |
+
{
|
| 1500 |
+
const unsigned int metaGroupRank;
|
| 1501 |
+
const unsigned int metaGroupSize;
|
| 1502 |
+
|
| 1503 |
+
protected:
|
| 1504 |
+
template <unsigned int OtherSize, typename ParentT>
|
| 1505 |
+
_CG_QUALIFIER __multi_warp_thread_block_tile(const __multi_warp_thread_block_tile<OtherSize, ParentT>& g) :
|
| 1506 |
+
__static_size_multi_warp_tile_base<Size>(g), metaGroupRank(g.meta_group_rank()), metaGroupSize(g.meta_group_size()) {}
|
| 1507 |
+
|
| 1508 |
+
public:
|
| 1509 |
+
_CG_QUALIFIER unsigned int meta_group_rank() const {
|
| 1510 |
+
return metaGroupRank;
|
| 1511 |
+
}
|
| 1512 |
+
|
| 1513 |
+
_CG_QUALIFIER unsigned int meta_group_size() const {
|
| 1514 |
+
return metaGroupSize;
|
| 1515 |
+
}
|
| 1516 |
+
};
|
| 1517 |
+
#endif
|
| 1518 |
+
|
| 1519 |
+
template <unsigned int Size, typename ParentT = void>
|
| 1520 |
+
class thread_block_tile;
|
| 1521 |
+
|
| 1522 |
+
namespace details {
|
| 1523 |
+
template <unsigned int Size, typename ParentT, bool IsMultiWarp>
|
| 1524 |
+
class thread_block_tile_impl;
|
| 1525 |
+
|
| 1526 |
+
template <unsigned int Size, typename ParentT>
|
| 1527 |
+
class thread_block_tile_impl<Size, ParentT, false>: public __single_warp_thread_block_tile<Size, ParentT>
|
| 1528 |
+
{
|
| 1529 |
+
protected:
|
| 1530 |
+
template <unsigned int OtherSize, typename OtherParentT, bool OtherIsMultiWarp>
|
| 1531 |
+
_CG_QUALIFIER thread_block_tile_impl(const thread_block_tile_impl<OtherSize, OtherParentT, OtherIsMultiWarp>& g) :
|
| 1532 |
+
__single_warp_thread_block_tile<Size, ParentT>(g.meta_group_rank(), g.meta_group_size()) {}
|
| 1533 |
+
|
| 1534 |
+
_CG_QUALIFIER thread_block_tile_impl(const thread_block& g) :
|
| 1535 |
+
__single_warp_thread_block_tile<Size, ParentT>() {}
|
| 1536 |
+
};
|
| 1537 |
+
|
| 1538 |
+
#if defined(_CG_CPP11_FEATURES)
|
| 1539 |
+
template <unsigned int Size, typename ParentT>
|
| 1540 |
+
class thread_block_tile_impl<Size, ParentT, true> : public __multi_warp_thread_block_tile<Size, ParentT>
|
| 1541 |
+
{
|
| 1542 |
+
protected:
|
| 1543 |
+
template <typename GroupT>
|
| 1544 |
+
_CG_QUALIFIER thread_block_tile_impl(const GroupT& g) :
|
| 1545 |
+
__multi_warp_thread_block_tile<Size, ParentT>(g) {}
|
| 1546 |
+
};
|
| 1547 |
+
#else
|
| 1548 |
+
template <unsigned int Size, typename ParentT>
|
| 1549 |
+
class thread_block_tile_impl<Size, ParentT, true>
|
| 1550 |
+
{
|
| 1551 |
+
protected:
|
| 1552 |
+
template <typename GroupT>
|
| 1553 |
+
_CG_QUALIFIER thread_block_tile_impl(const GroupT& g) {}
|
| 1554 |
+
};
|
| 1555 |
+
#endif
|
| 1556 |
+
}
|
| 1557 |
+
|
| 1558 |
+
template <unsigned int Size, typename ParentT>
|
| 1559 |
+
class thread_block_tile : public details::thread_block_tile_impl<Size, ParentT, details::_is_multi_warp<Size>::value>
|
| 1560 |
+
{
|
| 1561 |
+
friend _CG_QUALIFIER thread_block_tile<1, void> this_thread();
|
| 1562 |
+
|
| 1563 |
+
protected:
|
| 1564 |
+
_CG_QUALIFIER thread_block_tile(const ParentT& g) :
|
| 1565 |
+
details::thread_block_tile_impl<Size, ParentT, details::_is_multi_warp<Size>::value>(g) {}
|
| 1566 |
+
|
| 1567 |
+
public:
|
| 1568 |
+
_CG_QUALIFIER operator thread_block_tile<Size, void>() const {
|
| 1569 |
+
return thread_block_tile<Size, void>(*this);
|
| 1570 |
+
}
|
| 1571 |
+
};
|
| 1572 |
+
|
| 1573 |
+
template <unsigned int Size>
|
| 1574 |
+
class thread_block_tile<Size, void> : public details::thread_block_tile_impl<Size, void, details::_is_multi_warp<Size>::value>
|
| 1575 |
+
{
|
| 1576 |
+
template <unsigned int, typename ParentT>
|
| 1577 |
+
friend class thread_block_tile;
|
| 1578 |
+
|
| 1579 |
+
protected:
|
| 1580 |
+
template <unsigned int OtherSize, typename OtherParentT>
|
| 1581 |
+
_CG_QUALIFIER thread_block_tile(const thread_block_tile<OtherSize, OtherParentT>& g) :
|
| 1582 |
+
details::thread_block_tile_impl<Size, void, details::_is_multi_warp<Size>::value>(g) {}
|
| 1583 |
+
|
| 1584 |
+
public:
|
| 1585 |
+
template <typename ParentT>
|
| 1586 |
+
_CG_QUALIFIER thread_block_tile(const thread_block_tile<Size, ParentT>& g) :
|
| 1587 |
+
details::thread_block_tile_impl<Size, void, details::_is_multi_warp<Size>::value>(g) {}
|
| 1588 |
+
};
|
| 1589 |
+
|
| 1590 |
+
namespace details {
|
| 1591 |
+
template <unsigned int Size, typename ParentT>
|
| 1592 |
+
struct tiled_partition_impl;
|
| 1593 |
+
|
| 1594 |
+
template <unsigned int Size>
|
| 1595 |
+
struct tiled_partition_impl<Size, thread_block> : public thread_block_tile<Size, thread_block> {
|
| 1596 |
+
_CG_QUALIFIER tiled_partition_impl(const thread_block& g) :
|
| 1597 |
+
thread_block_tile<Size, thread_block>(g) {}
|
| 1598 |
+
};
|
| 1599 |
+
|
| 1600 |
+
// ParentT = static thread_block_tile<ParentSize, GrandParent> specialization
|
| 1601 |
+
template <unsigned int Size, unsigned int ParentSize, typename GrandParent>
|
| 1602 |
+
struct tiled_partition_impl<Size, thread_block_tile<ParentSize, GrandParent> > :
|
| 1603 |
+
public thread_block_tile<Size, thread_block_tile<ParentSize, GrandParent> > {
|
| 1604 |
+
#ifdef _CG_CPP11_FEATURES
|
| 1605 |
+
static_assert(Size < ParentSize, "Tile size bigger or equal to the parent group size");
|
| 1606 |
+
#endif
|
| 1607 |
+
_CG_QUALIFIER tiled_partition_impl(const thread_block_tile<ParentSize, GrandParent>& g) :
|
| 1608 |
+
thread_block_tile<Size, thread_block_tile<ParentSize, GrandParent> >(g) {}
|
| 1609 |
+
};
|
| 1610 |
+
|
| 1611 |
+
}
|
| 1612 |
+
|
| 1613 |
+
template <unsigned int Size, typename ParentT>
|
| 1614 |
+
_CG_QUALIFIER thread_block_tile<Size, ParentT> tiled_partition(const ParentT& g)
|
| 1615 |
+
{
|
| 1616 |
+
return details::tiled_partition_impl<Size, ParentT>(g);
|
| 1617 |
+
}
|
| 1618 |
+
|
| 1619 |
+
/**
|
| 1620 |
+
* thread_group this_thread()
|
| 1621 |
+
*
|
| 1622 |
+
* Constructs a generic thread_group containing only the calling thread
|
| 1623 |
+
*/
|
| 1624 |
+
_CG_QUALIFIER thread_block_tile<1, void> this_thread()
|
| 1625 |
+
{
|
| 1626 |
+
// Make thread_block_tile<1, thread_block> parent of the returned group, so it will have its
|
| 1627 |
+
// meta group rank and size set to 0 and 1 respectively.
|
| 1628 |
+
return thread_block_tile<1, thread_block_tile<1, thread_block> >(this_thread_block());
|
| 1629 |
+
}
|
| 1630 |
+
|
| 1631 |
+
/**
|
| 1632 |
+
* <group_type>.sync()
|
| 1633 |
+
*
|
| 1634 |
+
* Executes a barrier across the group
|
| 1635 |
+
*
|
| 1636 |
+
* Implements both a compiler fence and an architectural fence to prevent,
|
| 1637 |
+
* memory reordering around the barrier.
|
| 1638 |
+
*/
|
| 1639 |
+
_CG_QUALIFIER void thread_group::sync() const
|
| 1640 |
+
{
|
| 1641 |
+
switch (_data.group.type) {
|
| 1642 |
+
case details::coalesced_group_id:
|
| 1643 |
+
cooperative_groups::sync(*static_cast<const coalesced_group*>(this));
|
| 1644 |
+
break;
|
| 1645 |
+
case details::thread_block_id:
|
| 1646 |
+
cooperative_groups::sync(*static_cast<const thread_block*>(this));
|
| 1647 |
+
break;
|
| 1648 |
+
case details::grid_group_id:
|
| 1649 |
+
cooperative_groups::sync(*static_cast<const grid_group*>(this));
|
| 1650 |
+
break;
|
| 1651 |
+
#if defined(_CG_HAS_MULTI_GRID_GROUP) && defined(_CG_CPP11_FEATURES) && defined(_CG_ABI_EXPERIMENTAL)
|
| 1652 |
+
case details::multi_grid_group_id:
|
| 1653 |
+
cooperative_groups::sync(*static_cast<const multi_grid_group*>(this));
|
| 1654 |
+
break;
|
| 1655 |
+
#endif
|
| 1656 |
+
#if defined(_CG_HAS_CLUSTER_GROUP)
|
| 1657 |
+
case details::cluster_group_id:
|
| 1658 |
+
cooperative_groups::sync(*static_cast<const cluster_group*>(this));
|
| 1659 |
+
break;
|
| 1660 |
+
#endif
|
| 1661 |
+
default:
|
| 1662 |
+
break;
|
| 1663 |
+
}
|
| 1664 |
+
}
|
| 1665 |
+
|
| 1666 |
+
/**
|
| 1667 |
+
* <group_type>.size()
|
| 1668 |
+
*
|
| 1669 |
+
* Returns the total number of threads in the group.
|
| 1670 |
+
*/
|
| 1671 |
+
_CG_QUALIFIER unsigned long long thread_group::size() const
|
| 1672 |
+
{
|
| 1673 |
+
unsigned long long size = 0;
|
| 1674 |
+
switch (_data.group.type) {
|
| 1675 |
+
case details::coalesced_group_id:
|
| 1676 |
+
size = cooperative_groups::group_size(*static_cast<const coalesced_group*>(this));
|
| 1677 |
+
break;
|
| 1678 |
+
case details::thread_block_id:
|
| 1679 |
+
size = cooperative_groups::group_size(*static_cast<const thread_block*>(this));
|
| 1680 |
+
break;
|
| 1681 |
+
case details::grid_group_id:
|
| 1682 |
+
size = cooperative_groups::group_size(*static_cast<const grid_group*>(this));
|
| 1683 |
+
break;
|
| 1684 |
+
#if defined(_CG_HAS_MULTI_GRID_GROUP) && defined(_CG_CPP11_FEATURES) && defined(_CG_ABI_EXPERIMENTAL)
|
| 1685 |
+
case details::multi_grid_group_id:
|
| 1686 |
+
size = cooperative_groups::group_size(*static_cast<const multi_grid_group*>(this));
|
| 1687 |
+
break;
|
| 1688 |
+
#endif
|
| 1689 |
+
#if defined(_CG_HAS_CLUSTER_GROUP)
|
| 1690 |
+
case details::cluster_group_id:
|
| 1691 |
+
size = cooperative_groups::group_size(*static_cast<const cluster_group*>(this));
|
| 1692 |
+
break;
|
| 1693 |
+
#endif
|
| 1694 |
+
default:
|
| 1695 |
+
break;
|
| 1696 |
+
}
|
| 1697 |
+
return size;
|
| 1698 |
+
}
|
| 1699 |
+
|
| 1700 |
+
/**
|
| 1701 |
+
* <group_type>.thread_rank()
|
| 1702 |
+
*
|
| 1703 |
+
* Returns the linearized rank of the calling thread along the interval [0, size()).
|
| 1704 |
+
*/
|
| 1705 |
+
_CG_QUALIFIER unsigned long long thread_group::thread_rank() const
|
| 1706 |
+
{
|
| 1707 |
+
unsigned long long rank = 0;
|
| 1708 |
+
switch (_data.group.type) {
|
| 1709 |
+
case details::coalesced_group_id:
|
| 1710 |
+
rank = cooperative_groups::thread_rank(*static_cast<const coalesced_group*>(this));
|
| 1711 |
+
break;
|
| 1712 |
+
case details::thread_block_id:
|
| 1713 |
+
rank = cooperative_groups::thread_rank(*static_cast<const thread_block*>(this));
|
| 1714 |
+
break;
|
| 1715 |
+
case details::grid_group_id:
|
| 1716 |
+
rank = cooperative_groups::thread_rank(*static_cast<const grid_group*>(this));
|
| 1717 |
+
break;
|
| 1718 |
+
#if defined(_CG_HAS_MULTI_GRID_GROUP) && defined(_CG_CPP11_FEATURES) && defined(_CG_ABI_EXPERIMENTAL)
|
| 1719 |
+
case details::multi_grid_group_id:
|
| 1720 |
+
rank = cooperative_groups::thread_rank(*static_cast<const multi_grid_group*>(this));
|
| 1721 |
+
break;
|
| 1722 |
+
#endif
|
| 1723 |
+
#if defined(_CG_HAS_CLUSTER_GROUP)
|
| 1724 |
+
case details::cluster_group_id:
|
| 1725 |
+
rank = cooperative_groups::thread_rank(*static_cast<const cluster_group*>(this));
|
| 1726 |
+
break;
|
| 1727 |
+
#endif
|
| 1728 |
+
default:
|
| 1729 |
+
break;
|
| 1730 |
+
}
|
| 1731 |
+
return rank;
|
| 1732 |
+
}
|
| 1733 |
+
|
| 1734 |
+
_CG_END_NAMESPACE
|
| 1735 |
+
|
| 1736 |
+
#include <cooperative_groups/details/partitioning.h>
|
| 1737 |
+
#if (!defined(_MSC_VER) || defined(_WIN64))
|
| 1738 |
+
# include <cooperative_groups/details/invoke.h>
|
| 1739 |
+
#endif
|
| 1740 |
+
|
| 1741 |
+
# endif /* ! (__cplusplus, __CUDACC__) */
|
| 1742 |
+
|
| 1743 |
+
#endif /* !_COOPERATIVE_GROUPS_H_ */
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/details/async.h
ADDED
|
@@ -0,0 +1,452 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* Copyright 1993-2016 NVIDIA Corporation. All rights reserved.
|
| 2 |
+
*
|
| 3 |
+
* NOTICE TO LICENSEE:
|
| 4 |
+
*
|
| 5 |
+
* The source code and/or documentation ("Licensed Deliverables") are
|
| 6 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 7 |
+
* international Copyright laws.
|
| 8 |
+
*
|
| 9 |
+
* The Licensed Deliverables contained herein are PROPRIETARY and
|
| 10 |
+
* CONFIDENTIAL to NVIDIA and are being provided under the terms and
|
| 11 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 12 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 13 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 14 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 15 |
+
* of the Licensed Deliverables to any third party without the express
|
| 16 |
+
* written consent of NVIDIA is prohibited.
|
| 17 |
+
*
|
| 18 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 19 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 20 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. THEY ARE
|
| 21 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 22 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 23 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 24 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 25 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 26 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 27 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 28 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 29 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 30 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 31 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 32 |
+
*
|
| 33 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 34 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 35 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 36 |
+
* computer software documentation" as such terms are used in 48
|
| 37 |
+
* C.F.R. 12.212 (SEPT 1995) and are provided to the U.S. Government
|
| 38 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 39 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 40 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 41 |
+
* only those rights set forth herein.
|
| 42 |
+
*
|
| 43 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 44 |
+
* software must include, in the user documentation and internal
|
| 45 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 46 |
+
* Users Notice.
|
| 47 |
+
*/
|
| 48 |
+
|
| 49 |
+
#ifndef _CG_ASYNC_H
|
| 50 |
+
#define _CG_ASYNC_H
|
| 51 |
+
|
| 52 |
+
#include "helpers.h"
|
| 53 |
+
#include "info.h"
|
| 54 |
+
|
| 55 |
+
#include <cuda_pipeline.h>
|
| 56 |
+
|
| 57 |
+
_CG_BEGIN_NAMESPACE
|
| 58 |
+
|
| 59 |
+
namespace details {
|
| 60 |
+
// Groups supported by memcpy_async
|
| 61 |
+
template <class TyGroup>
|
| 62 |
+
struct _async_copy_group_supported : public _CG_STL_NAMESPACE::false_type {};
|
| 63 |
+
|
| 64 |
+
template <unsigned int Sz, typename TyPar>
|
| 65 |
+
struct _async_copy_group_supported<cooperative_groups::thread_block_tile<Sz, TyPar>>
|
| 66 |
+
: public _CG_STL_NAMESPACE::true_type {};
|
| 67 |
+
template <>
|
| 68 |
+
struct _async_copy_group_supported<cooperative_groups::coalesced_group> : public _CG_STL_NAMESPACE::true_type {};
|
| 69 |
+
template <>
|
| 70 |
+
struct _async_copy_group_supported<cooperative_groups::thread_block> : public _CG_STL_NAMESPACE::true_type {};
|
| 71 |
+
|
| 72 |
+
template <class TyGroup>
|
| 73 |
+
using async_copy_group_supported = _async_copy_group_supported<details::remove_qual<TyGroup>>;
|
| 74 |
+
|
| 75 |
+
// Groups that require optimization
|
| 76 |
+
template <class TyGroup>
|
| 77 |
+
struct _async_copy_optimize_tile : public _CG_STL_NAMESPACE::false_type {};
|
| 78 |
+
|
| 79 |
+
template <typename TyPar>
|
| 80 |
+
struct _async_copy_optimize_tile<cooperative_groups::thread_block_tile<1, TyPar>>
|
| 81 |
+
: public _CG_STL_NAMESPACE::false_type {};
|
| 82 |
+
|
| 83 |
+
template <unsigned int Sz, typename TyPar>
|
| 84 |
+
struct _async_copy_optimize_tile<cooperative_groups::thread_block_tile<Sz, TyPar>>
|
| 85 |
+
: public _CG_STL_NAMESPACE::true_type {};
|
| 86 |
+
|
| 87 |
+
template <class TyGroup>
|
| 88 |
+
using async_copy_optimize_tile = _async_copy_optimize_tile<details::remove_qual<TyGroup>>;
|
| 89 |
+
|
| 90 |
+
// SFINAE helpers for tile optimizations
|
| 91 |
+
template <class TyGroup>
|
| 92 |
+
using enable_tile_optimization =
|
| 93 |
+
typename _CG_STL_NAMESPACE::enable_if<async_copy_optimize_tile<TyGroup>::value, void *>::type;
|
| 94 |
+
|
| 95 |
+
template <class TyGroup>
|
| 96 |
+
using disable_tile_optimization =
|
| 97 |
+
typename _CG_STL_NAMESPACE::enable_if<!async_copy_optimize_tile<TyGroup>::value, void *>::type;
|
| 98 |
+
|
| 99 |
+
// Segment for punning to aligned types
|
| 100 |
+
template <unsigned int N>
|
| 101 |
+
struct _Segment {
|
| 102 |
+
int _seg[N];
|
| 103 |
+
};
|
| 104 |
+
|
| 105 |
+
// Trivial layout guaranteed-aligned copy-async compatible segments
|
| 106 |
+
template <unsigned int N>
|
| 107 |
+
struct Segment;
|
| 108 |
+
template <>
|
| 109 |
+
struct __align__(4) Segment<1> : public _Segment<1>{};
|
| 110 |
+
template <>
|
| 111 |
+
struct __align__(8) Segment<2> : public _Segment<2>{};
|
| 112 |
+
template <>
|
| 113 |
+
struct __align__(16) Segment<4> : public _Segment<4>{};
|
| 114 |
+
|
| 115 |
+
// Interleaved element by element copies from source to dest
|
| 116 |
+
template <typename TyGroup, typename TyElem>
|
| 117 |
+
_CG_STATIC_QUALIFIER void inline_copy(TyGroup &group, TyElem *__restrict__ dst, const TyElem *__restrict__ src,
|
| 118 |
+
size_t count) {
|
| 119 |
+
const unsigned int rank = group.thread_rank();
|
| 120 |
+
const unsigned int stride = group.size();
|
| 121 |
+
|
| 122 |
+
for (size_t idx = rank; idx < count; idx += stride) {
|
| 123 |
+
dst[idx] = src[idx];
|
| 124 |
+
}
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
template <typename TyGroup, typename TyElem, enable_tile_optimization<TyGroup> = nullptr>
|
| 128 |
+
_CG_STATIC_QUALIFIER void accelerated_async_copy(TyGroup &group, TyElem *__restrict__ dst,
|
| 129 |
+
const TyElem *__restrict__ src, size_t count) {
|
| 130 |
+
static_assert(async_copy_group_supported<TyGroup>::value,
|
| 131 |
+
"Async copy is only supported for groups that represent private shared memory");
|
| 132 |
+
|
| 133 |
+
if (count == 0) {
|
| 134 |
+
return;
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
const bool dstIsNotShared = !__isShared(dst);
|
| 138 |
+
const bool srcIsNotGlobal = !__isGlobal(src);
|
| 139 |
+
|
| 140 |
+
if (dstIsNotShared || srcIsNotGlobal) {
|
| 141 |
+
inline_copy(group, dst, src, count);
|
| 142 |
+
return;
|
| 143 |
+
}
|
| 144 |
+
|
| 145 |
+
const unsigned int stride = group.size();
|
| 146 |
+
const unsigned int rank = group.thread_rank();
|
| 147 |
+
// Efficient copies require warps to operate on the same amount of work at each step.
|
| 148 |
+
// remainders are handled in a separate stage to prevent branching
|
| 149 |
+
const unsigned int subWarpMask = (stride - 1);
|
| 150 |
+
const unsigned int subwarpCopies = (subWarpMask & (unsigned int)count);
|
| 151 |
+
const unsigned int maxSubwarpRank = min(rank, subwarpCopies - 1);
|
| 152 |
+
|
| 153 |
+
const size_t warpCopies = (count & (~subWarpMask));
|
| 154 |
+
|
| 155 |
+
for (size_t idx = 0; idx < warpCopies; idx += stride) {
|
| 156 |
+
size_t _srcIdx = rank + idx;
|
| 157 |
+
size_t _dstIdx = rank + idx;
|
| 158 |
+
__pipeline_memcpy_async(dst + _dstIdx, src + _srcIdx, sizeof(TyElem));
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
+
if (subwarpCopies) {
|
| 162 |
+
size_t _srcIdx = warpCopies + maxSubwarpRank;
|
| 163 |
+
size_t _dstIdx = warpCopies + maxSubwarpRank;
|
| 164 |
+
__pipeline_memcpy_async(dst + _dstIdx, src + _srcIdx, sizeof(TyElem));
|
| 165 |
+
}
|
| 166 |
+
}
|
| 167 |
+
|
| 168 |
+
template <typename TyGroup, typename TyElem, disable_tile_optimization<TyGroup> = nullptr>
|
| 169 |
+
_CG_STATIC_QUALIFIER void accelerated_async_copy(TyGroup &group, TyElem *__restrict__ dst,
|
| 170 |
+
const TyElem *__restrict__ src, size_t count) {
|
| 171 |
+
static_assert(async_copy_group_supported<TyGroup>::value,
|
| 172 |
+
"Async copy is only supported for groups that represent private shared memory");
|
| 173 |
+
|
| 174 |
+
const bool dstIsNotShared = !__isShared(dst);
|
| 175 |
+
const bool srcIsNotGlobal = !__isGlobal(src);
|
| 176 |
+
|
| 177 |
+
if (dstIsNotShared || srcIsNotGlobal) {
|
| 178 |
+
inline_copy(group, dst, src, count);
|
| 179 |
+
return;
|
| 180 |
+
}
|
| 181 |
+
|
| 182 |
+
unsigned int stride = group.size();
|
| 183 |
+
unsigned int rank = group.thread_rank();
|
| 184 |
+
|
| 185 |
+
for (size_t idx = rank; idx < count; idx += stride) {
|
| 186 |
+
size_t _srcIdx = idx;
|
| 187 |
+
size_t _dstIdx = idx;
|
| 188 |
+
__pipeline_memcpy_async(dst + _dstIdx, src + _srcIdx, sizeof(TyElem));
|
| 189 |
+
}
|
| 190 |
+
}
|
| 191 |
+
|
| 192 |
+
// Determine best possible alignment given an input and initial conditions
|
| 193 |
+
// Attempts to generate as little code as possible, most likely should only be used with 1 and 2 byte alignments
|
| 194 |
+
template <unsigned int MinAlignment, unsigned int MaxAlignment>
|
| 195 |
+
_CG_STATIC_QUALIFIER uint32_t find_best_alignment(void *__restrict__ dst, const void *__restrict__ src) {
|
| 196 |
+
// Narrowing conversion intentional
|
| 197 |
+
uint32_t base1 = (uint32_t) reinterpret_cast<uintptr_t>(src);
|
| 198 |
+
uint32_t base2 = (uint32_t) reinterpret_cast<uintptr_t>(dst);
|
| 199 |
+
|
| 200 |
+
uint32_t diff = ((base1) ^ (base2)) & (MaxAlignment - 1);
|
| 201 |
+
|
| 202 |
+
// range [MaxAlignment, alignof(elem)], step: x >> 1
|
| 203 |
+
// over range of possible alignments, choose best available out of range
|
| 204 |
+
uint32_t out = MaxAlignment;
|
| 205 |
+
#pragma unroll
|
| 206 |
+
for (uint32_t alignment = (MaxAlignment >> 1); alignment >= MinAlignment; alignment >>= 1) {
|
| 207 |
+
if (alignment & diff)
|
| 208 |
+
out = alignment;
|
| 209 |
+
}
|
| 210 |
+
|
| 211 |
+
return out;
|
| 212 |
+
}
|
| 213 |
+
|
| 214 |
+
// Determine best possible alignment given an input and initial conditions
|
| 215 |
+
// Attempts to generate as little code as possible, most likely should only be used with 1 and 2 byte alignments
|
| 216 |
+
template <typename TyType, typename TyGroup>
|
| 217 |
+
_CG_STATIC_QUALIFIER void copy_like(const TyGroup &group, void *__restrict__ _dst, const void *__restrict__ _src,
|
| 218 |
+
size_t count) {
|
| 219 |
+
const char *src = reinterpret_cast<const char *>(_src);
|
| 220 |
+
char *dst = reinterpret_cast<char *>(_dst);
|
| 221 |
+
|
| 222 |
+
constexpr uint32_t targetAlignment = (uint32_t)alignof(TyType);
|
| 223 |
+
|
| 224 |
+
uint32_t base = (uint32_t) reinterpret_cast<uintptr_t>(src);
|
| 225 |
+
uint32_t alignOffset = ((~base) + 1) & (targetAlignment - 1);
|
| 226 |
+
|
| 227 |
+
inline_copy(group, dst, src, alignOffset);
|
| 228 |
+
count -= alignOffset;
|
| 229 |
+
src += alignOffset;
|
| 230 |
+
dst += alignOffset;
|
| 231 |
+
|
| 232 |
+
// Copy using the best available alignment, async_copy expects n-datums, not bytes
|
| 233 |
+
size_t asyncCount = count / sizeof(TyType);
|
| 234 |
+
accelerated_async_copy(group, reinterpret_cast<TyType *>(dst), reinterpret_cast<const TyType *>(src), asyncCount);
|
| 235 |
+
asyncCount *= sizeof(TyType);
|
| 236 |
+
|
| 237 |
+
count -= asyncCount;
|
| 238 |
+
src += asyncCount;
|
| 239 |
+
dst += asyncCount;
|
| 240 |
+
inline_copy(group, dst, src, count);
|
| 241 |
+
}
|
| 242 |
+
|
| 243 |
+
// We must determine alignment and manually align src/dst ourselves
|
| 244 |
+
template <size_t AlignHint>
|
| 245 |
+
struct _memcpy_async_align_dispatch {
|
| 246 |
+
template <typename TyGroup>
|
| 247 |
+
_CG_STATIC_QUALIFIER void copy(TyGroup &group, void *__restrict__ dst, const void *__restrict__ src, size_t count) {
|
| 248 |
+
uint32_t alignment = find_best_alignment<AlignHint, 16>(dst, src);
|
| 249 |
+
|
| 250 |
+
// Avoid copying the extra bytes if desired copy count is smaller
|
| 251 |
+
alignment = count < alignment ? AlignHint : alignment;
|
| 252 |
+
|
| 253 |
+
switch (alignment) {
|
| 254 |
+
default:
|
| 255 |
+
case 1:
|
| 256 |
+
inline_copy(group, reinterpret_cast<char *>(dst), reinterpret_cast<const char *>(src), count);
|
| 257 |
+
break;
|
| 258 |
+
case 2:
|
| 259 |
+
inline_copy(group, reinterpret_cast<short *>(dst), reinterpret_cast<const short *>(src), count >> 1);
|
| 260 |
+
break;
|
| 261 |
+
case 4:
|
| 262 |
+
copy_like<Segment<1>>(group, dst, src, count);
|
| 263 |
+
break;
|
| 264 |
+
case 8:
|
| 265 |
+
copy_like<Segment<2>>(group, dst, src, count);
|
| 266 |
+
break;
|
| 267 |
+
case 16:
|
| 268 |
+
copy_like<Segment<4>>(group, dst, src, count);
|
| 269 |
+
break;
|
| 270 |
+
}
|
| 271 |
+
}
|
| 272 |
+
};
|
| 273 |
+
|
| 274 |
+
// Specialization for 4 byte alignments
|
| 275 |
+
template <>
|
| 276 |
+
struct _memcpy_async_align_dispatch<4> {
|
| 277 |
+
template <typename TyGroup>
|
| 278 |
+
_CG_STATIC_QUALIFIER void copy(TyGroup &group, void *__restrict__ _dst, const void *__restrict__ _src,
|
| 279 |
+
size_t count) {
|
| 280 |
+
const Segment<1> *src = reinterpret_cast<const Segment<1> *>(_src);
|
| 281 |
+
Segment<1> *dst = reinterpret_cast<Segment<1> *>(_dst);
|
| 282 |
+
|
| 283 |
+
// Dispatch straight to aligned LDGSTS calls
|
| 284 |
+
accelerated_async_copy(group, dst, src, count / sizeof(*dst));
|
| 285 |
+
}
|
| 286 |
+
};
|
| 287 |
+
|
| 288 |
+
// Specialization for 8 byte alignments
|
| 289 |
+
template <>
|
| 290 |
+
struct _memcpy_async_align_dispatch<8> {
|
| 291 |
+
template <typename TyGroup>
|
| 292 |
+
_CG_STATIC_QUALIFIER void copy(TyGroup &group, void *__restrict__ _dst, const void *__restrict__ _src,
|
| 293 |
+
size_t count) {
|
| 294 |
+
const Segment<2> *src = reinterpret_cast<const Segment<2> *>(_src);
|
| 295 |
+
Segment<2> *dst = reinterpret_cast<Segment<2> *>(_dst);
|
| 296 |
+
|
| 297 |
+
// Dispatch straight to aligned LDGSTS calls
|
| 298 |
+
accelerated_async_copy(group, dst, src, count / sizeof(*dst));
|
| 299 |
+
}
|
| 300 |
+
};
|
| 301 |
+
|
| 302 |
+
// Alignments over 16 are truncated to 16 and bypass alignment
|
| 303 |
+
// This is the highest performing memcpy available
|
| 304 |
+
template <>
|
| 305 |
+
struct _memcpy_async_align_dispatch<16> {
|
| 306 |
+
template <typename TyGroup>
|
| 307 |
+
_CG_STATIC_QUALIFIER void copy(TyGroup &group, void *__restrict__ _dst, const void *__restrict__ _src,
|
| 308 |
+
size_t count) {
|
| 309 |
+
const Segment<4> *src = reinterpret_cast<const Segment<4> *>(_src);
|
| 310 |
+
Segment<4> *dst = reinterpret_cast<Segment<4> *>(_dst);
|
| 311 |
+
|
| 312 |
+
// Dispatch straight to aligned LDGSTS calls
|
| 313 |
+
accelerated_async_copy(group, dst, src, count / sizeof(*dst));
|
| 314 |
+
}
|
| 315 |
+
};
|
| 316 |
+
|
| 317 |
+
// byte-wide API
|
| 318 |
+
template <size_t Alignment, class TyGroup>
|
| 319 |
+
_CG_STATIC_QUALIFIER void _memcpy_async_dispatch_to_aligned_copy(const TyGroup &group, void *__restrict__ _dst,
|
| 320 |
+
const void *__restrict__ _src, size_t count) {
|
| 321 |
+
static_assert(!(Alignment & (Alignment - 1)), "Known static alignment dispatch must be a power of 2");
|
| 322 |
+
details::_memcpy_async_align_dispatch<Alignment>::copy(group, _dst, _src, count);
|
| 323 |
+
}
|
| 324 |
+
|
| 325 |
+
// Internal dispatch APIs
|
| 326 |
+
// These deduce the alignments and sizes necessary to invoke the underlying copy engine
|
| 327 |
+
template <typename Ty>
|
| 328 |
+
using is_void = _CG_STL_NAMESPACE::is_same<Ty, void>;
|
| 329 |
+
|
| 330 |
+
template <typename Ty>
|
| 331 |
+
using enable_if_not_void = typename _CG_STL_NAMESPACE::enable_if<!is_void<Ty>::value, void *>::type;
|
| 332 |
+
|
| 333 |
+
template <typename Ty>
|
| 334 |
+
using enable_if_void = typename _CG_STL_NAMESPACE::enable_if<is_void<Ty>::value, void *>::type;
|
| 335 |
+
|
| 336 |
+
template <typename Ty>
|
| 337 |
+
using enable_if_integral =
|
| 338 |
+
typename _CG_STL_NAMESPACE::enable_if<_CG_STL_NAMESPACE::is_integral<Ty>::value, void *>::type;
|
| 339 |
+
|
| 340 |
+
// byte-wide API using aligned_sized_t
|
| 341 |
+
template <class TyGroup, template <size_t> typename Alignment, size_t Hint>
|
| 342 |
+
_CG_STATIC_QUALIFIER void _memcpy_async_bytes(const TyGroup &group, void *__restrict__ _dst,
|
| 343 |
+
const void *__restrict__ _src, const Alignment<Hint> &count) {
|
| 344 |
+
constexpr size_t _align = (Hint > 16) ? 16 : Hint;
|
| 345 |
+
|
| 346 |
+
details::_memcpy_async_dispatch_to_aligned_copy<_align>(group, _dst, _src, (size_t)count);
|
| 347 |
+
}
|
| 348 |
+
|
| 349 |
+
// byte-wide API using type for aligment
|
| 350 |
+
template <class TyGroup, typename TyElem, typename TySize, size_t Hint = alignof(TyElem),
|
| 351 |
+
enable_if_not_void<TyElem> = nullptr, enable_if_integral<TySize> = nullptr>
|
| 352 |
+
_CG_STATIC_QUALIFIER void _memcpy_async_bytes(const TyGroup &group, TyElem *__restrict__ _dst,
|
| 353 |
+
const TyElem *__restrict__ _src, const TySize& count) {
|
| 354 |
+
constexpr size_t _align = (Hint > 16) ? 16 : Hint;
|
| 355 |
+
|
| 356 |
+
details::_memcpy_async_dispatch_to_aligned_copy<_align>(group, _dst, _src, count);
|
| 357 |
+
}
|
| 358 |
+
|
| 359 |
+
// byte-wide API with full alignment deduction required
|
| 360 |
+
template <class TyGroup, typename TyElem, typename TySize, enable_if_void<TyElem> = nullptr,
|
| 361 |
+
enable_if_integral<TySize> = nullptr>
|
| 362 |
+
_CG_STATIC_QUALIFIER void _memcpy_async_bytes(const TyGroup &group, TyElem *__restrict__ _dst,
|
| 363 |
+
const TyElem *__restrict__ _src, const TySize& count) {
|
| 364 |
+
details::_memcpy_async_dispatch_to_aligned_copy<1>(group, _dst, _src, count);
|
| 365 |
+
}
|
| 366 |
+
|
| 367 |
+
// 1d-datum API
|
| 368 |
+
template <class TyGroup, typename TyElem, size_t Hint = alignof(TyElem)>
|
| 369 |
+
_CG_STATIC_QUALIFIER void _memcpy_async_datum(const TyGroup &group, TyElem *__restrict__ dst, const size_t dstCount,
|
| 370 |
+
const TyElem *__restrict__ src, const size_t srcCount) {
|
| 371 |
+
constexpr unsigned int _align = Hint;
|
| 372 |
+
const size_t totalCount = min(dstCount, srcCount) * sizeof(TyElem);
|
| 373 |
+
|
| 374 |
+
details::_memcpy_async_dispatch_to_aligned_copy<_align>(group, dst, src, totalCount);
|
| 375 |
+
}
|
| 376 |
+
|
| 377 |
+
// 1d-datum API using aligned_size_t
|
| 378 |
+
template <class TyGroup, typename TyElem, template <size_t> typename Alignment, size_t Hint>
|
| 379 |
+
_CG_STATIC_QUALIFIER void _memcpy_async_datum(const TyGroup &group, TyElem *__restrict__ dst, const Alignment<Hint> &dstCount,
|
| 380 |
+
const TyElem *__restrict__ src, const Alignment<Hint> &srcCount) {
|
| 381 |
+
constexpr unsigned int _align = Hint;
|
| 382 |
+
const size_t totalCount = min((size_t)dstCount, (size_t)srcCount) * sizeof(TyElem);
|
| 383 |
+
|
| 384 |
+
details::_memcpy_async_dispatch_to_aligned_copy<_align>(group, dst, src, totalCount);
|
| 385 |
+
}
|
| 386 |
+
|
| 387 |
+
} // namespace details
|
| 388 |
+
|
| 389 |
+
/*
|
| 390 |
+
* Group submit batch of async-copy to cover contiguous 1D array
|
| 391 |
+
* and commit that batch to eventually wait for completion.
|
| 392 |
+
*/
|
| 393 |
+
template <class TyGroup, typename TyElem, typename TySizeT>
|
| 394 |
+
_CG_STATIC_QUALIFIER void memcpy_async(const TyGroup &group, TyElem *__restrict__ _dst, const TyElem *__restrict__ _src,
|
| 395 |
+
const TySizeT &count) {
|
| 396 |
+
details::_memcpy_async_bytes(group, _dst, _src, count);
|
| 397 |
+
__pipeline_commit();
|
| 398 |
+
}
|
| 399 |
+
|
| 400 |
+
/*
|
| 401 |
+
* Group submit batch of async-copy to cover contiguous 1D array
|
| 402 |
+
* and commit that batch to eventually wait for completion.
|
| 403 |
+
* Object counts are in datum sized chunks, not bytes.
|
| 404 |
+
*/
|
| 405 |
+
template <class TyGroup, class TyElem, typename DstLayout, typename SrcLayout>
|
| 406 |
+
_CG_STATIC_QUALIFIER void memcpy_async(const TyGroup &group, TyElem *__restrict__ dst, const DstLayout &dstLayout,
|
| 407 |
+
const TyElem *__restrict__ src, const SrcLayout &srcLayout) {
|
| 408 |
+
details::_memcpy_async_datum(group, dst, dstLayout, src, srcLayout);
|
| 409 |
+
__pipeline_commit();
|
| 410 |
+
}
|
| 411 |
+
|
| 412 |
+
/* Group wait for prior Nth stage of memcpy_async to complete. */
|
| 413 |
+
template <unsigned int Stage, class TyGroup>
|
| 414 |
+
_CG_STATIC_QUALIFIER void wait_prior(const TyGroup &group) {
|
| 415 |
+
__pipeline_wait_prior(Stage);
|
| 416 |
+
group.sync();
|
| 417 |
+
}
|
| 418 |
+
|
| 419 |
+
/* Group wait all previously submitted memcpy_async to complete. */
|
| 420 |
+
template <class TyGroup>
|
| 421 |
+
_CG_STATIC_QUALIFIER void wait(const TyGroup &group) {
|
| 422 |
+
__pipeline_wait_prior(0);
|
| 423 |
+
group.sync();
|
| 424 |
+
}
|
| 425 |
+
|
| 426 |
+
/***************** CG APIs including pipeline are deprecated *****************/
|
| 427 |
+
|
| 428 |
+
/* Group submit batch of async-copy to cover of contiguous 1D array
|
| 429 |
+
to a pipeline and commit the batch*/
|
| 430 |
+
template <class TyGroup, class TyElem>
|
| 431 |
+
_CG_DEPRECATED _CG_STATIC_QUALIFIER void memcpy_async(TyGroup &group, TyElem *dst, size_t dstCount, const TyElem *src, size_t srcCount,
|
| 432 |
+
nvcuda::experimental::pipeline &pipe) {
|
| 433 |
+
details::_memcpy_async_datum(group, dst, dstCount, src, srcCount);
|
| 434 |
+
pipe.commit();
|
| 435 |
+
}
|
| 436 |
+
|
| 437 |
+
/* Group wait for prior Nth stage of memcpy_async to complete. */
|
| 438 |
+
template <unsigned int Stage, class TyGroup>
|
| 439 |
+
_CG_DEPRECATED _CG_STATIC_QUALIFIER void wait_prior(TyGroup &group, nvcuda::experimental::pipeline &pipe) {
|
| 440 |
+
pipe.wait_prior<Stage>();
|
| 441 |
+
group.sync();
|
| 442 |
+
}
|
| 443 |
+
|
| 444 |
+
/* Group wait for stage-S of memcpy_async to complete. */
|
| 445 |
+
template <class TyGroup>
|
| 446 |
+
_CG_DEPRECATED _CG_STATIC_QUALIFIER void wait(TyGroup &group, nvcuda::experimental::pipeline &pipe, size_t stage) {
|
| 447 |
+
pipe.wait(stage);
|
| 448 |
+
group.sync();
|
| 449 |
+
}
|
| 450 |
+
_CG_END_NAMESPACE
|
| 451 |
+
|
| 452 |
+
#endif // _CG_ASYNC_H
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/details/coalesced_reduce.h
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* Copyright 1993-2016 NVIDIA Corporation. All rights reserved.
|
| 2 |
+
*
|
| 3 |
+
* NOTICE TO LICENSEE:
|
| 4 |
+
*
|
| 5 |
+
* The source code and/or documentation ("Licensed Deliverables") are
|
| 6 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 7 |
+
* international Copyright laws.
|
| 8 |
+
*
|
| 9 |
+
* The Licensed Deliverables contained herein are PROPRIETARY and
|
| 10 |
+
* CONFIDENTIAL to NVIDIA and are being provided under the terms and
|
| 11 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 12 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 13 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 14 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 15 |
+
* of the Licensed Deliverables to any third party without the express
|
| 16 |
+
* written consent of NVIDIA is prohibited.
|
| 17 |
+
*
|
| 18 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 19 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 20 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. THEY ARE
|
| 21 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 22 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 23 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 24 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 25 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 26 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 27 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 28 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 29 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 30 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 31 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 32 |
+
*
|
| 33 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 34 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 35 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 36 |
+
* computer software documentation" as such terms are used in 48
|
| 37 |
+
* C.F.R. 12.212 (SEPT 1995) and are provided to the U.S. Government
|
| 38 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 39 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 40 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 41 |
+
* only those rights set forth herein.
|
| 42 |
+
*
|
| 43 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 44 |
+
* software must include, in the user documentation and internal
|
| 45 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 46 |
+
* Users Notice.
|
| 47 |
+
*/
|
| 48 |
+
|
| 49 |
+
#ifndef _CG_COALESCED_REDUCE_H_
|
| 50 |
+
#define _CG_COALESCED_REDUCE_H_
|
| 51 |
+
|
| 52 |
+
#include "info.h"
|
| 53 |
+
#include "helpers.h"
|
| 54 |
+
#include "cooperative_groups.h"
|
| 55 |
+
#include "partitioning.h"
|
| 56 |
+
#include "coalesced_scan.h"
|
| 57 |
+
|
| 58 |
+
_CG_BEGIN_NAMESPACE
|
| 59 |
+
|
| 60 |
+
namespace details {
|
| 61 |
+
|
| 62 |
+
template <typename TyVal, typename TyOp, unsigned int TySize, typename ParentT>
|
| 63 |
+
_CG_QUALIFIER auto coalesced_reduce(const __single_warp_thread_block_tile<TySize, ParentT>& group,
|
| 64 |
+
TyVal&& val,
|
| 65 |
+
TyOp&& op) -> decltype(op(val, val)) {
|
| 66 |
+
auto out = val;
|
| 67 |
+
for (int mask = TySize >> 1; mask > 0; mask >>= 1) {
|
| 68 |
+
out = op(out, group.shfl_xor(out, mask));
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
return out;
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
template <typename TyVal, typename TyOp>
|
| 75 |
+
_CG_QUALIFIER auto coalesced_reduce(const coalesced_group& group, TyVal&& val, TyOp&& op) -> decltype(op(val, val)) {
|
| 76 |
+
if (group.size() == 32) {
|
| 77 |
+
// Full coalesced group can go through faster path by being treated as a tile of size 32
|
| 78 |
+
auto tile = details::tiled_partition_internal<32, void>();
|
| 79 |
+
return coalesced_reduce(tile, _CG_STL_NAMESPACE::forward<TyVal>(val), _CG_STL_NAMESPACE::forward<TyOp>(op));
|
| 80 |
+
}
|
| 81 |
+
else {
|
| 82 |
+
auto scan_result =
|
| 83 |
+
inclusive_scan_non_contiguous(group, _CG_STL_NAMESPACE::forward<TyVal>(val), _CG_STL_NAMESPACE::forward<TyOp>(op));
|
| 84 |
+
unsigned int group_mask = _coalesced_group_data_access::get_mask(group);
|
| 85 |
+
unsigned int last_thread_id = 31 - __clz(group_mask);
|
| 86 |
+
return details::tile::shuffle_dispatch<TyVal>::shfl(
|
| 87 |
+
_CG_STL_NAMESPACE::forward<TyVal>(scan_result), group_mask, last_thread_id, 32);
|
| 88 |
+
}
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
} // details
|
| 92 |
+
|
| 93 |
+
_CG_END_NAMESPACE
|
| 94 |
+
|
| 95 |
+
#endif // _CG_COALESCED_REDUCE_H_
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/details/coalesced_scan.h
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* Copyright 1993-2016 NVIDIA Corporation. All rights reserved.
|
| 2 |
+
*
|
| 3 |
+
* NOTICE TO LICENSEE:
|
| 4 |
+
*
|
| 5 |
+
* The source code and/or documentation ("Licensed Deliverables") are
|
| 6 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 7 |
+
* international Copyright laws.
|
| 8 |
+
*
|
| 9 |
+
* The Licensed Deliverables contained herein are PROPRIETARY and
|
| 10 |
+
* CONFIDENTIAL to NVIDIA and are being provided under the terms and
|
| 11 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 12 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 13 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 14 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 15 |
+
* of the Licensed Deliverables to any third party without the express
|
| 16 |
+
* written consent of NVIDIA is prohibited.
|
| 17 |
+
*
|
| 18 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 19 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 20 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. THEY ARE
|
| 21 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 22 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 23 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 24 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 25 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 26 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 27 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 28 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 29 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 30 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 31 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 32 |
+
*
|
| 33 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 34 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 35 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 36 |
+
* computer software documentation" as such terms are used in 48
|
| 37 |
+
* C.F.R. 12.212 (SEPT 1995) and are provided to the U.S. Government
|
| 38 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 39 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 40 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 41 |
+
* only those rights set forth herein.
|
| 42 |
+
*
|
| 43 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 44 |
+
* software must include, in the user documentation and internal
|
| 45 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 46 |
+
* Users Notice.
|
| 47 |
+
*/
|
| 48 |
+
|
| 49 |
+
#ifndef _CG_COALESCED_SCAN_H_
|
| 50 |
+
#define _CG_COALESCED_SCAN_H_
|
| 51 |
+
|
| 52 |
+
#include "info.h"
|
| 53 |
+
#include "helpers.h"
|
| 54 |
+
#include "cooperative_groups.h"
|
| 55 |
+
#include "partitioning.h"
|
| 56 |
+
#include "functional.h"
|
| 57 |
+
|
| 58 |
+
_CG_BEGIN_NAMESPACE
|
| 59 |
+
|
| 60 |
+
namespace details {
|
| 61 |
+
|
| 62 |
+
template <typename TyGroup, typename TyVal, typename TyOp>
|
| 63 |
+
_CG_QUALIFIER auto inclusive_scan_contiguous(const TyGroup& group, TyVal&& val, TyOp&& op) -> decltype(op(val, val)) {
|
| 64 |
+
auto out = val;
|
| 65 |
+
for (int mask = 1; mask < group.size(); mask <<= 1) {
|
| 66 |
+
auto tmp = group.shfl_up(out, mask);
|
| 67 |
+
if (mask <= group.thread_rank()) {
|
| 68 |
+
out = op(out, tmp);
|
| 69 |
+
}
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
return out;
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
template <typename TyGroup, typename TyVal, typename TyOp>
|
| 76 |
+
_CG_QUALIFIER auto inclusive_scan_non_contiguous(const TyGroup& group, TyVal&& val, TyOp&& op) -> decltype(op(val, val)) {
|
| 77 |
+
const unsigned int groupSize = group.size();
|
| 78 |
+
auto out = val;
|
| 79 |
+
|
| 80 |
+
const unsigned int mask = details::_coalesced_group_data_access::get_mask(group);
|
| 81 |
+
unsigned int lanemask = details::lanemask32_lt() & mask;
|
| 82 |
+
unsigned int srcLane = details::laneid();
|
| 83 |
+
|
| 84 |
+
const unsigned int base = __ffs(mask)-1; /* lane with rank == 0 */
|
| 85 |
+
const unsigned int rank = __popc(lanemask);
|
| 86 |
+
|
| 87 |
+
for (unsigned int i = 1, j = 1; i < groupSize; i <<= 1) {
|
| 88 |
+
if (i <= rank) {
|
| 89 |
+
srcLane -= j;
|
| 90 |
+
j = i; /* maximum possible lane */
|
| 91 |
+
|
| 92 |
+
unsigned int begLane = base + rank - i; /* minimum possible lane */
|
| 93 |
+
|
| 94 |
+
/* Next source lane is in the range [ begLane .. srcLane ]
|
| 95 |
+
* If begLane < srcLane then do a binary search.
|
| 96 |
+
*/
|
| 97 |
+
while (begLane < srcLane) {
|
| 98 |
+
const unsigned int halfLane = (begLane + srcLane) >> 1;
|
| 99 |
+
const unsigned int halfMask = lanemask >> halfLane;
|
| 100 |
+
const unsigned int d = __popc(halfMask);
|
| 101 |
+
if (d < i) {
|
| 102 |
+
srcLane = halfLane - 1; /* halfLane too large */
|
| 103 |
+
}
|
| 104 |
+
else if ((i < d) || !(halfMask & 0x01)) {
|
| 105 |
+
begLane = halfLane + 1; /* halfLane too small */
|
| 106 |
+
}
|
| 107 |
+
else {
|
| 108 |
+
begLane = srcLane = halfLane; /* happen to hit */
|
| 109 |
+
}
|
| 110 |
+
}
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
auto tmp = details::tile::shuffle_dispatch<TyVal>::shfl(out, mask, srcLane, 32);
|
| 114 |
+
if (i <= rank) {
|
| 115 |
+
out = op(out, tmp);
|
| 116 |
+
}
|
| 117 |
+
}
|
| 118 |
+
return out;
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
template <unsigned int TySize, typename ParentT, typename TyVal, typename TyOp>
|
| 122 |
+
_CG_QUALIFIER auto coalesced_inclusive_scan(const __single_warp_thread_block_tile<TySize, ParentT>& group,
|
| 123 |
+
TyVal&& val,
|
| 124 |
+
TyOp&& op) -> decltype(op(val, val)) {
|
| 125 |
+
return inclusive_scan_contiguous(group, _CG_STL_NAMESPACE::forward<TyVal>(val), _CG_STL_NAMESPACE::forward<TyOp>(op));
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
template <typename TyVal, typename TyOp>
|
| 129 |
+
_CG_QUALIFIER auto coalesced_inclusive_scan(const coalesced_group& group, TyVal&& val, TyOp&& op) -> decltype(op(val, val)) {
|
| 130 |
+
if (group.size() == 32) {
|
| 131 |
+
return inclusive_scan_contiguous(group, _CG_STL_NAMESPACE::forward<TyVal>(val), _CG_STL_NAMESPACE::forward<TyOp>(op));
|
| 132 |
+
}
|
| 133 |
+
else {
|
| 134 |
+
return inclusive_scan_non_contiguous(group, _CG_STL_NAMESPACE::forward<TyVal>(val), _CG_STL_NAMESPACE::forward<TyOp>(op));
|
| 135 |
+
}
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
template <bool IntegralOptimized>
|
| 139 |
+
struct scan_choose_convertion;
|
| 140 |
+
|
| 141 |
+
template<>
|
| 142 |
+
struct scan_choose_convertion<true> {
|
| 143 |
+
template <typename TyGroup, typename TyRes, typename TyVal>
|
| 144 |
+
_CG_STATIC_QUALIFIER details::remove_qual<TyVal> convert_inclusive_to_exclusive(const TyGroup& group, TyRes& result, TyVal&& val) {
|
| 145 |
+
return result - val;
|
| 146 |
+
}
|
| 147 |
+
};
|
| 148 |
+
|
| 149 |
+
template<>
|
| 150 |
+
struct scan_choose_convertion<false> {
|
| 151 |
+
template <typename TyGroup, typename TyRes, typename TyVal>
|
| 152 |
+
_CG_STATIC_QUALIFIER details::remove_qual<TyVal> convert_inclusive_to_exclusive(const TyGroup& group, TyRes& result, TyVal&& val) {
|
| 153 |
+
auto ret = group.shfl_up(result, 1);
|
| 154 |
+
if (group.thread_rank() == 0) {
|
| 155 |
+
return {};
|
| 156 |
+
}
|
| 157 |
+
else {
|
| 158 |
+
return ret;
|
| 159 |
+
}
|
| 160 |
+
}
|
| 161 |
+
};
|
| 162 |
+
|
| 163 |
+
template <typename TyGroup, typename TyRes, typename TyVal, typename TyFn>
|
| 164 |
+
_CG_QUALIFIER auto convert_inclusive_to_exclusive(const TyGroup& group, TyRes& result, TyVal&& val, TyFn&& op) -> decltype(op(val, val)) {
|
| 165 |
+
using conversion = scan_choose_convertion<_CG_STL_NAMESPACE::is_same<remove_qual<TyFn>, cooperative_groups::plus<remove_qual<TyVal>>>::value
|
| 166 |
+
&& _CG_STL_NAMESPACE::is_integral<remove_qual<TyVal>>::value>;
|
| 167 |
+
return conversion::convert_inclusive_to_exclusive(group, result, _CG_STL_NAMESPACE::forward<TyVal>(val));
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
+
} // details
|
| 171 |
+
|
| 172 |
+
_CG_END_NAMESPACE
|
| 173 |
+
|
| 174 |
+
#endif // _CG_COALESCED_SCAN_H_
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/details/driver_abi.h
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* Copyright 1993-2016 NVIDIA Corporation. All rights reserved.
|
| 2 |
+
*
|
| 3 |
+
* NOTICE TO LICENSEE:
|
| 4 |
+
*
|
| 5 |
+
* The source code and/or documentation ("Licensed Deliverables") are
|
| 6 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 7 |
+
* international Copyright laws.
|
| 8 |
+
*
|
| 9 |
+
* The Licensed Deliverables contained herein are PROPRIETARY and
|
| 10 |
+
* CONFIDENTIAL to NVIDIA and are being provided under the terms and
|
| 11 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 12 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 13 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 14 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 15 |
+
* of the Licensed Deliverables to any third party without the express
|
| 16 |
+
* written consent of NVIDIA is prohibited.
|
| 17 |
+
*
|
| 18 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 19 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 20 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. THEY ARE
|
| 21 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 22 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 23 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 24 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 25 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 26 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 27 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 28 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 29 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 30 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 31 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 32 |
+
*
|
| 33 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 34 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 35 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 36 |
+
* computer software documentation" as such terms are used in 48
|
| 37 |
+
* C.F.R. 12.212 (SEPT 1995) and are provided to the U.S. Government
|
| 38 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 39 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 40 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 41 |
+
* only those rights set forth herein.
|
| 42 |
+
*
|
| 43 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 44 |
+
* software must include, in the user documentation and internal
|
| 45 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 46 |
+
* Users Notice.
|
| 47 |
+
*/
|
| 48 |
+
|
| 49 |
+
#ifndef _CG_DRIVER_API_H
|
| 50 |
+
#define _CG_DRIVER_API_H
|
| 51 |
+
|
| 52 |
+
#include "info.h"
|
| 53 |
+
|
| 54 |
+
_CG_BEGIN_NAMESPACE
|
| 55 |
+
|
| 56 |
+
namespace details {
|
| 57 |
+
template <unsigned int RegId>
|
| 58 |
+
_CG_QUALIFIER unsigned int load_env_reg() {
|
| 59 |
+
// Abort by default
|
| 60 |
+
_CG_ABORT();
|
| 61 |
+
return 0;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
template <unsigned int HiReg, unsigned int LoReg>
|
| 65 |
+
_CG_QUALIFIER unsigned long long load_env_reg64() {
|
| 66 |
+
unsigned long long registerLo = load_env_reg<LoReg>();
|
| 67 |
+
unsigned long long registerHi = load_env_reg<HiReg>();
|
| 68 |
+
|
| 69 |
+
return (registerHi << 32) | registerLo;
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
// inline PTX for accessing registers requires an immediate for the special reg
|
| 73 |
+
# define LOAD_ENVREG(NUMBER) \
|
| 74 |
+
template <> _CG_QUALIFIER unsigned int load_env_reg<NUMBER>() { \
|
| 75 |
+
unsigned int r; \
|
| 76 |
+
asm ("mov.u32 %0, %%envreg" #NUMBER ";" : "=r"(r)); \
|
| 77 |
+
return r; \
|
| 78 |
+
}
|
| 79 |
+
|
| 80 |
+
// Instantiate loaders for registers used
|
| 81 |
+
LOAD_ENVREG(0);
|
| 82 |
+
LOAD_ENVREG(1);
|
| 83 |
+
LOAD_ENVREG(2);
|
| 84 |
+
# undef LOAD_ENVREG
|
| 85 |
+
|
| 86 |
+
struct grid_workspace {
|
| 87 |
+
unsigned int wsSize;
|
| 88 |
+
unsigned int barrier;
|
| 89 |
+
};
|
| 90 |
+
|
| 91 |
+
_CG_QUALIFIER grid_workspace* get_grid_workspace() {
|
| 92 |
+
unsigned long long gridWsAbiAddress = load_env_reg64<1, 2>();
|
| 93 |
+
// Interpret the address from envreg 1 and 2 as the driver's grid workspace
|
| 94 |
+
return (reinterpret_cast<grid_workspace*>(gridWsAbiAddress));
|
| 95 |
+
}
|
| 96 |
+
}
|
| 97 |
+
_CG_END_NAMESPACE
|
| 98 |
+
|
| 99 |
+
#endif // _CG_DRIVER_API_H
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/details/functional.h
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* Copyright 1993-2016 NVIDIA Corporation. All rights reserved.
|
| 2 |
+
*
|
| 3 |
+
* NOTICE TO LICENSEE:
|
| 4 |
+
*
|
| 5 |
+
* The source code and/or documentation ("Licensed Deliverables") are
|
| 6 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 7 |
+
* international Copyright laws.
|
| 8 |
+
*
|
| 9 |
+
* The Licensed Deliverables contained herein are PROPRIETARY and
|
| 10 |
+
* CONFIDENTIAL to NVIDIA and are being provided under the terms and
|
| 11 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 12 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 13 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 14 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 15 |
+
* of the Licensed Deliverables to any third party without the express
|
| 16 |
+
* written consent of NVIDIA is prohibited.
|
| 17 |
+
*
|
| 18 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 19 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 20 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. THEY ARE
|
| 21 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 22 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 23 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 24 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 25 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 26 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 27 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 28 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 29 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 30 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 31 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 32 |
+
*
|
| 33 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 34 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 35 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 36 |
+
* computer software documentation" as such terms are used in 48
|
| 37 |
+
* C.F.R. 12.212 (SEPT 1995) and are provided to the U.S. Government
|
| 38 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 39 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 40 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 41 |
+
* only those rights set forth herein.
|
| 42 |
+
*
|
| 43 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 44 |
+
* software must include, in the user documentation and internal
|
| 45 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 46 |
+
* Users Notice.
|
| 47 |
+
*/
|
| 48 |
+
|
| 49 |
+
#ifndef _CG_FUNCTIONAL_H
|
| 50 |
+
#define _CG_FUNCTIONAL_H
|
| 51 |
+
|
| 52 |
+
#include "info.h"
|
| 53 |
+
#include "helpers.h"
|
| 54 |
+
|
| 55 |
+
#ifdef _CG_CPP11_FEATURES
|
| 56 |
+
#ifdef _CG_USE_CUDA_STL
|
| 57 |
+
# include <cuda/std/functional>
|
| 58 |
+
#endif
|
| 59 |
+
|
| 60 |
+
_CG_BEGIN_NAMESPACE
|
| 61 |
+
|
| 62 |
+
namespace details {
|
| 63 |
+
#ifdef _CG_USE_CUDA_STL
|
| 64 |
+
using cuda::std::plus;
|
| 65 |
+
using cuda::std::bit_and;
|
| 66 |
+
using cuda::std::bit_xor;
|
| 67 |
+
using cuda::std::bit_or;
|
| 68 |
+
#else
|
| 69 |
+
template <typename Ty> struct plus {__device__ __forceinline__ Ty operator()(Ty arg1, Ty arg2) const {return arg1 + arg2;}};
|
| 70 |
+
template <typename Ty> struct bit_and {__device__ __forceinline__ Ty operator()(Ty arg1, Ty arg2) const {return arg1 & arg2;}};
|
| 71 |
+
template <typename Ty> struct bit_xor {__device__ __forceinline__ Ty operator()(Ty arg1, Ty arg2) const {return arg1 ^ arg2;}};
|
| 72 |
+
template <typename Ty> struct bit_or {__device__ __forceinline__ Ty operator()(Ty arg1, Ty arg2) const {return arg1 | arg2;}};
|
| 73 |
+
#endif // _CG_USE_PLATFORM_STL
|
| 74 |
+
} // details
|
| 75 |
+
|
| 76 |
+
template <typename Ty>
|
| 77 |
+
struct plus : public details::plus<Ty> {};
|
| 78 |
+
|
| 79 |
+
template <typename Ty>
|
| 80 |
+
struct less {
|
| 81 |
+
__device__ __forceinline__ Ty operator()(Ty arg1, Ty arg2) const {
|
| 82 |
+
return (arg2 < arg1) ? arg2 : arg1;
|
| 83 |
+
}
|
| 84 |
+
};
|
| 85 |
+
|
| 86 |
+
template <typename Ty>
|
| 87 |
+
struct greater {
|
| 88 |
+
__device__ __forceinline__ Ty operator()(Ty arg1, Ty arg2) const {
|
| 89 |
+
return (arg1 < arg2) ? arg2 : arg1;
|
| 90 |
+
}
|
| 91 |
+
};
|
| 92 |
+
|
| 93 |
+
template <typename Ty>
|
| 94 |
+
struct bit_and : public details::bit_and<Ty> {};
|
| 95 |
+
|
| 96 |
+
template <typename Ty>
|
| 97 |
+
struct bit_xor : public details::bit_xor<Ty> {};
|
| 98 |
+
|
| 99 |
+
template <typename Ty>
|
| 100 |
+
struct bit_or : public details::bit_or<Ty> {};
|
| 101 |
+
|
| 102 |
+
#if defined(_CG_HAS_STL_ATOMICS)
|
| 103 |
+
namespace details {
|
| 104 |
+
template <class Ty>
|
| 105 |
+
using _atomic_is_type_supported = _CG_STL_NAMESPACE::integral_constant<bool,
|
| 106 |
+
_CG_STL_NAMESPACE::is_integral<Ty>::value && (sizeof(Ty) == 4 || sizeof(Ty) == 8)>;
|
| 107 |
+
|
| 108 |
+
template <typename TyOp> struct _atomic_op_supported : public _CG_STL_NAMESPACE::false_type {};
|
| 109 |
+
template <typename Ty> struct _atomic_op_supported<cooperative_groups::plus<Ty>> : public _atomic_is_type_supported<Ty> {};
|
| 110 |
+
template <typename Ty> struct _atomic_op_supported<cooperative_groups::less<Ty>> : public _atomic_is_type_supported<Ty> {};
|
| 111 |
+
template <typename Ty> struct _atomic_op_supported<cooperative_groups::greater<Ty>> : public _atomic_is_type_supported<Ty> {};
|
| 112 |
+
template <typename Ty> struct _atomic_op_supported<cooperative_groups::bit_and<Ty>> : public _atomic_is_type_supported<Ty> {};
|
| 113 |
+
template <typename Ty> struct _atomic_op_supported<cooperative_groups::bit_or<Ty>> : public _atomic_is_type_supported<Ty> {};
|
| 114 |
+
template <typename Ty> struct _atomic_op_supported<cooperative_groups::bit_xor<Ty>> : public _atomic_is_type_supported<Ty> {};
|
| 115 |
+
|
| 116 |
+
template<typename TyAtomic, typename TyVal, typename TyOp>
|
| 117 |
+
_CG_QUALIFIER remove_qual<TyVal> atomic_cas_fallback(TyAtomic&& atomic, TyVal&& val, TyOp&& op) {
|
| 118 |
+
auto old = atomic.load(cuda::std::memory_order_relaxed);
|
| 119 |
+
while(!atomic.compare_exchange_weak(old, op(old, val), cuda::std::memory_order_relaxed));
|
| 120 |
+
return old;
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
template<typename TyOp>
|
| 124 |
+
struct op_picker;
|
| 125 |
+
|
| 126 |
+
template<typename TyVal>
|
| 127 |
+
struct op_picker<cooperative_groups::plus<TyVal>> {
|
| 128 |
+
template<typename TyAtomic>
|
| 129 |
+
_CG_STATIC_QUALIFIER TyVal atomic_update(TyAtomic& atomic, TyVal val) {
|
| 130 |
+
return atomic.fetch_add(val, cuda::std::memory_order_relaxed);
|
| 131 |
+
}
|
| 132 |
+
};
|
| 133 |
+
|
| 134 |
+
template<typename TyVal>
|
| 135 |
+
struct op_picker<cooperative_groups::less<TyVal>> {
|
| 136 |
+
template<typename TyAtomic>
|
| 137 |
+
_CG_STATIC_QUALIFIER TyVal atomic_update(TyAtomic& atomic, TyVal val) {
|
| 138 |
+
return atomic.fetch_min(val, cuda::std::memory_order_relaxed);
|
| 139 |
+
}
|
| 140 |
+
};
|
| 141 |
+
|
| 142 |
+
template<typename TyVal>
|
| 143 |
+
struct op_picker<cooperative_groups::greater<TyVal>> {
|
| 144 |
+
template<typename TyAtomic>
|
| 145 |
+
_CG_STATIC_QUALIFIER TyVal atomic_update(TyAtomic& atomic, TyVal val) {
|
| 146 |
+
return atomic.fetch_max(val, cuda::std::memory_order_relaxed);
|
| 147 |
+
}
|
| 148 |
+
};
|
| 149 |
+
|
| 150 |
+
template<typename TyVal>
|
| 151 |
+
struct op_picker<cooperative_groups::bit_and<TyVal>> {
|
| 152 |
+
template<typename TyAtomic>
|
| 153 |
+
_CG_STATIC_QUALIFIER TyVal atomic_update(TyAtomic& atomic, TyVal val) {
|
| 154 |
+
return atomic.fetch_and(val, cuda::std::memory_order_relaxed);
|
| 155 |
+
}
|
| 156 |
+
};
|
| 157 |
+
|
| 158 |
+
template<typename TyVal>
|
| 159 |
+
struct op_picker<cooperative_groups::bit_xor<TyVal>> {
|
| 160 |
+
template<typename TyAtomic>
|
| 161 |
+
_CG_STATIC_QUALIFIER TyVal atomic_update(TyAtomic& atomic, TyVal val) {
|
| 162 |
+
return atomic.fetch_xor(val, cuda::std::memory_order_relaxed);
|
| 163 |
+
}
|
| 164 |
+
};
|
| 165 |
+
|
| 166 |
+
template<typename TyVal>
|
| 167 |
+
struct op_picker<cooperative_groups::bit_or<TyVal>> {
|
| 168 |
+
template<typename TyAtomic>
|
| 169 |
+
_CG_STATIC_QUALIFIER TyVal atomic_update(TyAtomic& atomic, TyVal val) {
|
| 170 |
+
return atomic.fetch_or(val, cuda::std::memory_order_relaxed);
|
| 171 |
+
}
|
| 172 |
+
};
|
| 173 |
+
|
| 174 |
+
template<bool atomic_supported>
|
| 175 |
+
struct atomic_update_dispatch {};
|
| 176 |
+
|
| 177 |
+
template<>
|
| 178 |
+
struct atomic_update_dispatch<false> {
|
| 179 |
+
template<typename TyAtomic, typename TyVal, typename TyOp>
|
| 180 |
+
_CG_STATIC_QUALIFIER remove_qual<TyVal> atomic_update(TyAtomic& atomic, TyVal&& val, TyOp&& op) {
|
| 181 |
+
return atomic_cas_fallback(atomic, _CG_STL_NAMESPACE::forward<TyVal>(val), _CG_STL_NAMESPACE::forward<TyOp>(op));
|
| 182 |
+
}
|
| 183 |
+
};
|
| 184 |
+
|
| 185 |
+
template<>
|
| 186 |
+
struct atomic_update_dispatch<true> {
|
| 187 |
+
template<typename TyAtomic, typename TyVal, typename TyOp>
|
| 188 |
+
_CG_STATIC_QUALIFIER TyVal atomic_update(TyAtomic& atomic, TyVal val, TyOp&& op) {
|
| 189 |
+
using dispatch = op_picker<details::remove_qual<TyOp>>;
|
| 190 |
+
|
| 191 |
+
return dispatch::atomic_update(atomic, val);
|
| 192 |
+
}
|
| 193 |
+
};
|
| 194 |
+
|
| 195 |
+
template<typename TyAtomic, typename TyVal, typename TyOp>
|
| 196 |
+
_CG_QUALIFIER remove_qual<TyVal> atomic_update(TyAtomic& atomic, TyVal&& val, TyOp&& op) {
|
| 197 |
+
using dispatch = atomic_update_dispatch<_atomic_op_supported<details::remove_qual<TyOp>>::value>;
|
| 198 |
+
|
| 199 |
+
return dispatch::atomic_update(atomic, _CG_STL_NAMESPACE::forward<TyVal>(val), _CG_STL_NAMESPACE::forward<TyOp>(op));
|
| 200 |
+
}
|
| 201 |
+
|
| 202 |
+
template<typename TyAtomic, typename TyVal>
|
| 203 |
+
_CG_QUALIFIER void atomic_store(TyAtomic& atomic, TyVal&& val) {
|
| 204 |
+
atomic.store(val, cuda::std::memory_order_relaxed);
|
| 205 |
+
}
|
| 206 |
+
}
|
| 207 |
+
#endif
|
| 208 |
+
|
| 209 |
+
_CG_END_NAMESPACE
|
| 210 |
+
|
| 211 |
+
#endif
|
| 212 |
+
#endif //_CG_FUNCTIONAL_H
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/details/helpers.h
ADDED
|
@@ -0,0 +1,693 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* Copyright 1993-2021 NVIDIA Corporation. All rights reserved.
|
| 2 |
+
*
|
| 3 |
+
* NOTICE TO LICENSEE:
|
| 4 |
+
*
|
| 5 |
+
* The source code and/or documentation ("Licensed Deliverables") are
|
| 6 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 7 |
+
* international Copyright laws.
|
| 8 |
+
*
|
| 9 |
+
* The Licensed Deliverables contained herein are PROPRIETARY and
|
| 10 |
+
* CONFIDENTIAL to NVIDIA and are being provided under the terms and
|
| 11 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 12 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 13 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 14 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 15 |
+
* of the Licensed Deliverables to any third party without the express
|
| 16 |
+
* written consent of NVIDIA is prohibited.
|
| 17 |
+
*
|
| 18 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 19 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 20 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. THEY ARE
|
| 21 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 22 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 23 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 24 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 25 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 26 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 27 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 28 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 29 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 30 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 31 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 32 |
+
*
|
| 33 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 34 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 35 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 36 |
+
* computer software documentation" as such terms are used in 48
|
| 37 |
+
* C.F.R. 12.212 (SEPT 1995) and are provided to the U.S. Government
|
| 38 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 39 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 40 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 41 |
+
* only those rights set forth herein.
|
| 42 |
+
*
|
| 43 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 44 |
+
* software must include, in the user documentation and internal
|
| 45 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 46 |
+
* Users Notice.
|
| 47 |
+
*/
|
| 48 |
+
|
| 49 |
+
#ifndef _COOPERATIVE_GROUPS_HELPERS_H_
|
| 50 |
+
# define _COOPERATIVE_GROUPS_HELPERS_H_
|
| 51 |
+
|
| 52 |
+
#include "info.h"
|
| 53 |
+
#include "sync.h"
|
| 54 |
+
|
| 55 |
+
_CG_BEGIN_NAMESPACE
|
| 56 |
+
|
| 57 |
+
namespace details {
|
| 58 |
+
#ifdef _CG_CPP11_FEATURES
|
| 59 |
+
template <typename Ty> struct _is_float_or_half : public _CG_STL_NAMESPACE::is_floating_point<Ty> {};
|
| 60 |
+
# ifdef _CG_HAS_FP16_COLLECTIVE
|
| 61 |
+
template <> struct _is_float_or_half<__half> : public _CG_STL_NAMESPACE::true_type {};
|
| 62 |
+
template <> struct _is_float_or_half<__half2> : public _CG_STL_NAMESPACE::true_type {};
|
| 63 |
+
# endif
|
| 64 |
+
template <typename Ty>
|
| 65 |
+
using is_float_or_half = _is_float_or_half<typename _CG_STL_NAMESPACE::remove_cv<Ty>::type>;
|
| 66 |
+
|
| 67 |
+
// Non-STL utility templates
|
| 68 |
+
template <typename Ty>
|
| 69 |
+
using remove_qual = typename _CG_STL_NAMESPACE::remove_cv<typename _CG_STL_NAMESPACE::remove_reference<Ty>::type>::type;
|
| 70 |
+
|
| 71 |
+
template <typename TyLhs, typename TyRhs>
|
| 72 |
+
using is_op_type_same = _CG_STL_NAMESPACE::is_same<remove_qual<TyLhs>, remove_qual<TyRhs>
|
| 73 |
+
>;
|
| 74 |
+
#endif
|
| 75 |
+
|
| 76 |
+
template <typename TyTrunc>
|
| 77 |
+
_CG_STATIC_QUALIFIER TyTrunc vec3_to_linear(dim3 index, dim3 nIndex) {
|
| 78 |
+
return ((TyTrunc)index.z * nIndex.y * nIndex.x) +
|
| 79 |
+
((TyTrunc)index.y * nIndex.x) +
|
| 80 |
+
(TyTrunc)index.x;
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
namespace cta {
|
| 84 |
+
|
| 85 |
+
_CG_STATIC_QUALIFIER void sync()
|
| 86 |
+
{
|
| 87 |
+
__barrier_sync(0);
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
_CG_STATIC_QUALIFIER unsigned int num_threads()
|
| 91 |
+
{
|
| 92 |
+
return static_cast<unsigned int>(blockDim.x * blockDim.y * blockDim.z);
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
_CG_STATIC_QUALIFIER unsigned int thread_rank()
|
| 96 |
+
{
|
| 97 |
+
return vec3_to_linear<unsigned int>(threadIdx, blockDim);
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
_CG_STATIC_QUALIFIER dim3 group_index()
|
| 101 |
+
{
|
| 102 |
+
return dim3(blockIdx.x, blockIdx.y, blockIdx.z);
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
_CG_STATIC_QUALIFIER dim3 thread_index()
|
| 106 |
+
{
|
| 107 |
+
return dim3(threadIdx.x, threadIdx.y, threadIdx.z);
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
_CG_STATIC_QUALIFIER dim3 dim_threads()
|
| 111 |
+
{
|
| 112 |
+
return dim3(blockDim.x, blockDim.y, blockDim.z);
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
// Legacy aliases
|
| 116 |
+
_CG_STATIC_QUALIFIER unsigned int size()
|
| 117 |
+
{
|
| 118 |
+
return num_threads();
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
_CG_STATIC_QUALIFIER dim3 block_dim()
|
| 122 |
+
{
|
| 123 |
+
return dim_threads();
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
};
|
| 127 |
+
|
| 128 |
+
class _coalesced_group_data_access {
|
| 129 |
+
public:
|
| 130 |
+
// Retrieve mask of coalesced groups and tiles
|
| 131 |
+
template <typename TyGroup>
|
| 132 |
+
_CG_STATIC_QUALIFIER unsigned int get_mask(const TyGroup &group) {
|
| 133 |
+
return group.get_mask();
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
template <typename TyGroup>
|
| 137 |
+
_CG_STATIC_QUALIFIER TyGroup construct_from_mask(unsigned int mask) {
|
| 138 |
+
return TyGroup(mask);
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
template <typename TyGroup>
|
| 142 |
+
_CG_STATIC_QUALIFIER void modify_meta_group(TyGroup &group, unsigned int mgRank, unsigned int mgSize) {
|
| 143 |
+
group._data.coalesced.metaGroupRank = mgRank;
|
| 144 |
+
group._data.coalesced.metaGroupSize = mgSize;
|
| 145 |
+
}
|
| 146 |
+
};
|
| 147 |
+
|
| 148 |
+
namespace tile {
|
| 149 |
+
template <unsigned int TileCount, unsigned int TileMask, unsigned int LaneMask, unsigned int ShiftCount>
|
| 150 |
+
struct _tile_helpers{
|
| 151 |
+
_CG_STATIC_CONST_DECL unsigned int tileCount = TileCount;
|
| 152 |
+
_CG_STATIC_CONST_DECL unsigned int tileMask = TileMask;
|
| 153 |
+
_CG_STATIC_CONST_DECL unsigned int laneMask = LaneMask;
|
| 154 |
+
_CG_STATIC_CONST_DECL unsigned int shiftCount = ShiftCount;
|
| 155 |
+
};
|
| 156 |
+
|
| 157 |
+
template <unsigned int> struct tile_helpers;
|
| 158 |
+
template <> struct tile_helpers<32> : public _tile_helpers<1, 0xFFFFFFFF, 0x1F, 5> {};
|
| 159 |
+
template <> struct tile_helpers<16> : public _tile_helpers<2, 0x0000FFFF, 0x0F, 4> {};
|
| 160 |
+
template <> struct tile_helpers<8> : public _tile_helpers<4, 0x000000FF, 0x07, 3> {};
|
| 161 |
+
template <> struct tile_helpers<4> : public _tile_helpers<8, 0x0000000F, 0x03, 2> {};
|
| 162 |
+
template <> struct tile_helpers<2> : public _tile_helpers<16, 0x00000003, 0x01, 1> {};
|
| 163 |
+
template <> struct tile_helpers<1> : public _tile_helpers<32, 0x00000001, 0x00, 0> {};
|
| 164 |
+
|
| 165 |
+
#ifdef _CG_CPP11_FEATURES
|
| 166 |
+
namespace shfl {
|
| 167 |
+
/***********************************************************************************
|
| 168 |
+
* Recursively Sliced Shuffle
|
| 169 |
+
* Purpose:
|
| 170 |
+
* Slices an input type a number of times into integral types so that shuffles
|
| 171 |
+
* are well defined
|
| 172 |
+
* Expectations:
|
| 173 |
+
* This object *should not* be used from a reinterpret_cast pointer unless
|
| 174 |
+
* some alignment guarantees can be met. Use a memcpy to guarantee that loads
|
| 175 |
+
* from the integral types stored within are aligned and correct.
|
| 176 |
+
**********************************************************************************/
|
| 177 |
+
template <unsigned int count, bool intSized = (count <= sizeof(int))>
|
| 178 |
+
struct recursive_sliced_shuffle_helper;
|
| 179 |
+
|
| 180 |
+
template <unsigned int count>
|
| 181 |
+
struct recursive_sliced_shuffle_helper<count, true> {
|
| 182 |
+
int val;
|
| 183 |
+
|
| 184 |
+
template <typename TyFn>
|
| 185 |
+
_CG_QUALIFIER void invoke_shuffle(const TyFn &shfl) {
|
| 186 |
+
val = shfl(val);
|
| 187 |
+
}
|
| 188 |
+
};
|
| 189 |
+
|
| 190 |
+
template <unsigned int count>
|
| 191 |
+
struct recursive_sliced_shuffle_helper<count, false> {
|
| 192 |
+
int val;
|
| 193 |
+
recursive_sliced_shuffle_helper<count - sizeof(int)> next;
|
| 194 |
+
|
| 195 |
+
template <typename TyFn>
|
| 196 |
+
_CG_QUALIFIER void invoke_shuffle(const TyFn &shfl) {
|
| 197 |
+
val = shfl(val);
|
| 198 |
+
next.invoke_shuffle(shfl);
|
| 199 |
+
}
|
| 200 |
+
};
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
struct _memory_shuffle {
|
| 204 |
+
template <typename TyElem, typename TyShflFn>
|
| 205 |
+
_CG_STATIC_QUALIFIER TyElem _shfl_internal(TyElem elem, const TyShflFn& fn) {
|
| 206 |
+
static_assert(sizeof(TyElem) <= 32, "Cooperative groups collectives are limited to types smaller than 32B");
|
| 207 |
+
return TyElem{};
|
| 208 |
+
}
|
| 209 |
+
|
| 210 |
+
template <typename TyElem, typename TyRet = remove_qual<TyElem>>
|
| 211 |
+
_CG_STATIC_QUALIFIER TyRet shfl(TyElem&& elem, unsigned int gMask, unsigned int srcRank, unsigned int threads) {
|
| 212 |
+
auto shfl = [=](int val) -> int {
|
| 213 |
+
return 0;
|
| 214 |
+
};
|
| 215 |
+
|
| 216 |
+
return _shfl_internal<TyRet>(_CG_STL_NAMESPACE::forward<TyElem>(elem), shfl);
|
| 217 |
+
}
|
| 218 |
+
|
| 219 |
+
template <typename TyElem, typename TyRet = remove_qual<TyElem>>
|
| 220 |
+
_CG_STATIC_QUALIFIER TyRet shfl_down(TyElem&& elem, unsigned int gMask, unsigned int delta, unsigned int threads) {
|
| 221 |
+
auto shfl = [=](int val) -> int {
|
| 222 |
+
return 0;
|
| 223 |
+
};
|
| 224 |
+
|
| 225 |
+
return _shfl_internal<TyRet>(_CG_STL_NAMESPACE::forward<TyElem>(elem), shfl);
|
| 226 |
+
}
|
| 227 |
+
|
| 228 |
+
template <typename TyElem, typename TyRet = remove_qual<TyElem>>
|
| 229 |
+
_CG_STATIC_QUALIFIER TyRet shfl_up(TyElem&& elem, unsigned int gMask, unsigned int delta, unsigned int threads) {
|
| 230 |
+
auto shfl = [=](int val) -> int {
|
| 231 |
+
return 0;
|
| 232 |
+
};
|
| 233 |
+
|
| 234 |
+
return _shfl_internal<TyRet>(_CG_STL_NAMESPACE::forward<TyElem>(elem), shfl);
|
| 235 |
+
}
|
| 236 |
+
|
| 237 |
+
template <typename TyElem, typename TyRet = remove_qual<TyElem>>
|
| 238 |
+
_CG_STATIC_QUALIFIER TyRet shfl_xor(TyElem&& elem, unsigned int gMask, unsigned int lMask, unsigned int threads) {
|
| 239 |
+
auto shfl = [=](int val) -> int {
|
| 240 |
+
return 0;
|
| 241 |
+
};
|
| 242 |
+
|
| 243 |
+
return _shfl_internal<TyRet>(_CG_STL_NAMESPACE::forward<TyElem>(elem), shfl);
|
| 244 |
+
}
|
| 245 |
+
};
|
| 246 |
+
|
| 247 |
+
/***********************************************************************************
|
| 248 |
+
* Intrinsic Device Function Shuffle
|
| 249 |
+
* Purpose:
|
| 250 |
+
* Uses a shuffle helper that has characteristics best suited for moving
|
| 251 |
+
* elements between threads
|
| 252 |
+
* Expectations:
|
| 253 |
+
* Object given will be forced into an l-value type so that it can be used
|
| 254 |
+
* with a helper structure that reinterprets the data into intrinsic compatible
|
| 255 |
+
* types
|
| 256 |
+
* Notes:
|
| 257 |
+
* !! TyRet is required so that objects are returned by value and not as
|
| 258 |
+
* dangling references depending on the value category of the passed object
|
| 259 |
+
**********************************************************************************/
|
| 260 |
+
struct _intrinsic_compat_shuffle {
|
| 261 |
+
template <unsigned int count>
|
| 262 |
+
using shfl_helper = shfl::recursive_sliced_shuffle_helper<count>;
|
| 263 |
+
|
| 264 |
+
template <typename TyElem, typename TyShflFn>
|
| 265 |
+
_CG_STATIC_QUALIFIER TyElem _shfl_internal(TyElem elem, const TyShflFn& fn) {
|
| 266 |
+
static_assert(__is_trivially_copyable(TyElem), "Type is not compatible with device shuffle");
|
| 267 |
+
shfl_helper<sizeof(TyElem)> helper;
|
| 268 |
+
memcpy(&helper, &elem, sizeof(TyElem));
|
| 269 |
+
helper.invoke_shuffle(fn);
|
| 270 |
+
memcpy(&elem, &helper, sizeof(TyElem));
|
| 271 |
+
return elem;
|
| 272 |
+
}
|
| 273 |
+
|
| 274 |
+
template <typename TyElem, typename TyRet = remove_qual<TyElem>>
|
| 275 |
+
_CG_STATIC_QUALIFIER TyRet shfl(TyElem&& elem, unsigned int gMask, unsigned int srcRank, unsigned int threads) {
|
| 276 |
+
auto shfl = [=](int val) -> int {
|
| 277 |
+
return __shfl_sync(gMask, val, srcRank, threads);
|
| 278 |
+
};
|
| 279 |
+
|
| 280 |
+
return _shfl_internal<TyRet>(_CG_STL_NAMESPACE::forward<TyElem>(elem), shfl);
|
| 281 |
+
}
|
| 282 |
+
|
| 283 |
+
template <typename TyElem, typename TyRet = remove_qual<TyElem>>
|
| 284 |
+
_CG_STATIC_QUALIFIER TyRet shfl_down(TyElem&& elem, unsigned int gMask, unsigned int delta, unsigned int threads) {
|
| 285 |
+
auto shfl = [=](int val) -> int {
|
| 286 |
+
return __shfl_down_sync(gMask, val, delta, threads);
|
| 287 |
+
};
|
| 288 |
+
|
| 289 |
+
return _shfl_internal<TyRet>(_CG_STL_NAMESPACE::forward<TyElem>(elem), shfl);
|
| 290 |
+
}
|
| 291 |
+
|
| 292 |
+
template <typename TyElem, typename TyRet = remove_qual<TyElem>>
|
| 293 |
+
_CG_STATIC_QUALIFIER TyRet shfl_up(TyElem&& elem, unsigned int gMask, unsigned int delta, unsigned int threads) {
|
| 294 |
+
auto shfl = [=](int val) -> int {
|
| 295 |
+
return __shfl_up_sync(gMask, val, delta, threads);
|
| 296 |
+
};
|
| 297 |
+
|
| 298 |
+
return _shfl_internal<TyRet>(_CG_STL_NAMESPACE::forward<TyElem>(elem), shfl);
|
| 299 |
+
}
|
| 300 |
+
|
| 301 |
+
template <typename TyElem, typename TyRet = remove_qual<TyElem>>
|
| 302 |
+
_CG_STATIC_QUALIFIER TyRet shfl_xor(TyElem&& elem, unsigned int gMask, unsigned int lMask, unsigned int threads) {
|
| 303 |
+
auto shfl = [=](int val) -> int {
|
| 304 |
+
return __shfl_xor_sync(gMask, val, lMask, threads);
|
| 305 |
+
};
|
| 306 |
+
|
| 307 |
+
return _shfl_internal<TyRet>(_CG_STL_NAMESPACE::forward<TyElem>(elem), shfl);
|
| 308 |
+
}
|
| 309 |
+
};
|
| 310 |
+
|
| 311 |
+
struct _native_shuffle {
|
| 312 |
+
template <typename TyElem>
|
| 313 |
+
_CG_STATIC_QUALIFIER TyElem shfl(
|
| 314 |
+
TyElem elem, unsigned int gMask, unsigned int srcRank, unsigned int threads) {
|
| 315 |
+
return static_cast<TyElem>(__shfl_sync(gMask, elem, srcRank, threads));
|
| 316 |
+
}
|
| 317 |
+
|
| 318 |
+
template <typename TyElem>
|
| 319 |
+
_CG_STATIC_QUALIFIER TyElem shfl_down(
|
| 320 |
+
TyElem elem, unsigned int gMask, unsigned int delta, unsigned int threads) {
|
| 321 |
+
return static_cast<TyElem>(__shfl_down_sync(gMask, elem, delta, threads));
|
| 322 |
+
}
|
| 323 |
+
|
| 324 |
+
template <typename TyElem>
|
| 325 |
+
_CG_STATIC_QUALIFIER TyElem shfl_up(
|
| 326 |
+
TyElem elem, unsigned int gMask, unsigned int delta, unsigned int threads) {
|
| 327 |
+
return static_cast<TyElem>(__shfl_up_sync(gMask, elem, delta, threads));
|
| 328 |
+
}
|
| 329 |
+
|
| 330 |
+
template <typename TyElem>
|
| 331 |
+
_CG_STATIC_QUALIFIER TyElem shfl_xor(
|
| 332 |
+
TyElem elem, unsigned int gMask, unsigned int lMask, unsigned int threads) {
|
| 333 |
+
return static_cast<TyElem>(__shfl_xor_sync(gMask, elem, lMask, threads));
|
| 334 |
+
}
|
| 335 |
+
};
|
| 336 |
+
|
| 337 |
+
// Almost all arithmetic types are supported by native shuffle
|
| 338 |
+
// Vector types are the exception
|
| 339 |
+
template <typename TyElem>
|
| 340 |
+
using use_native_shuffle = _CG_STL_NAMESPACE::integral_constant<
|
| 341 |
+
bool,
|
| 342 |
+
_CG_STL_NAMESPACE::is_integral<
|
| 343 |
+
remove_qual<TyElem>>::value ||
|
| 344 |
+
details::is_float_or_half<
|
| 345 |
+
remove_qual<TyElem>>::value
|
| 346 |
+
>;
|
| 347 |
+
|
| 348 |
+
constexpr unsigned long long _MemoryShuffleCutoff = 32;
|
| 349 |
+
|
| 350 |
+
template <typename TyElem,
|
| 351 |
+
bool IsNative = use_native_shuffle<TyElem>::value,
|
| 352 |
+
bool InMem = (sizeof(TyElem) > _MemoryShuffleCutoff)>
|
| 353 |
+
struct shuffle_dispatch;
|
| 354 |
+
|
| 355 |
+
template <typename TyElem>
|
| 356 |
+
struct shuffle_dispatch<TyElem, true, false> : public _native_shuffle {};
|
| 357 |
+
|
| 358 |
+
template <typename TyElem>
|
| 359 |
+
struct shuffle_dispatch<TyElem, false, false> : public _intrinsic_compat_shuffle {};
|
| 360 |
+
|
| 361 |
+
template <typename TyElem>
|
| 362 |
+
struct shuffle_dispatch<TyElem, false, true> : public _memory_shuffle {};
|
| 363 |
+
|
| 364 |
+
#endif //_CG_CPP11_FEATURES
|
| 365 |
+
};
|
| 366 |
+
|
| 367 |
+
namespace multi_grid {
|
| 368 |
+
struct multi_grid_functions;
|
| 369 |
+
};
|
| 370 |
+
|
| 371 |
+
namespace grid {
|
| 372 |
+
_CG_STATIC_QUALIFIER unsigned int barrier_arrive(unsigned int *bar) {
|
| 373 |
+
return details::sync_grids_arrive(bar);
|
| 374 |
+
}
|
| 375 |
+
|
| 376 |
+
_CG_STATIC_QUALIFIER void barrier_wait(unsigned int token, unsigned int *bar) {
|
| 377 |
+
details::sync_grids_wait(token, bar);
|
| 378 |
+
}
|
| 379 |
+
|
| 380 |
+
_CG_STATIC_QUALIFIER void sync(unsigned int *bar) {
|
| 381 |
+
unsigned int token = details::sync_grids_arrive(bar);
|
| 382 |
+
details::sync_grids_wait(token, bar);
|
| 383 |
+
}
|
| 384 |
+
|
| 385 |
+
_CG_STATIC_QUALIFIER unsigned long long num_blocks()
|
| 386 |
+
{
|
| 387 |
+
// grid.y * grid.z -> [max(65535) * max(65535)] fits within 4b, promote after multiplication
|
| 388 |
+
// grid.x * (grid.y * grid.z) -> [max(2^31-1) * max(65535 * 65535)] exceeds 4b, promote before multiplication
|
| 389 |
+
return (unsigned long long)gridDim.x * (gridDim.y * gridDim.z);
|
| 390 |
+
}
|
| 391 |
+
|
| 392 |
+
_CG_STATIC_QUALIFIER unsigned long long num_threads()
|
| 393 |
+
{
|
| 394 |
+
return num_blocks() * cta::num_threads();
|
| 395 |
+
}
|
| 396 |
+
|
| 397 |
+
_CG_STATIC_QUALIFIER unsigned long long block_rank()
|
| 398 |
+
{
|
| 399 |
+
return vec3_to_linear<unsigned long long>(blockIdx, gridDim);
|
| 400 |
+
}
|
| 401 |
+
|
| 402 |
+
_CG_STATIC_QUALIFIER unsigned long long thread_rank()
|
| 403 |
+
{
|
| 404 |
+
return block_rank() * cta::num_threads() + cta::thread_rank();
|
| 405 |
+
}
|
| 406 |
+
|
| 407 |
+
_CG_STATIC_QUALIFIER dim3 dim_blocks()
|
| 408 |
+
{
|
| 409 |
+
return dim3(gridDim.x, gridDim.y, gridDim.z);
|
| 410 |
+
}
|
| 411 |
+
|
| 412 |
+
_CG_STATIC_QUALIFIER dim3 block_index()
|
| 413 |
+
{
|
| 414 |
+
return dim3(blockIdx.x, blockIdx.y, blockIdx.z);
|
| 415 |
+
}
|
| 416 |
+
|
| 417 |
+
_CG_STATIC_QUALIFIER dim3 dim_threads()
|
| 418 |
+
{
|
| 419 |
+
return dim3(gridDim.x * blockDim.x, gridDim.y * blockDim.y, gridDim.z * blockDim.z);
|
| 420 |
+
}
|
| 421 |
+
|
| 422 |
+
_CG_STATIC_QUALIFIER dim3 thread_index()
|
| 423 |
+
{
|
| 424 |
+
return dim3(blockIdx.x * blockDim.x + threadIdx.x,
|
| 425 |
+
blockIdx.y * blockDim.y + threadIdx.y,
|
| 426 |
+
blockIdx.z * blockDim.z + threadIdx.z);
|
| 427 |
+
}
|
| 428 |
+
|
| 429 |
+
#if defined(_CG_HAS_CLUSTER_GROUP)
|
| 430 |
+
_CG_STATIC_QUALIFIER dim3 dim_clusters() {
|
| 431 |
+
return __clusterGridDimInClusters();
|
| 432 |
+
}
|
| 433 |
+
|
| 434 |
+
_CG_STATIC_QUALIFIER unsigned long long num_clusters() {
|
| 435 |
+
const dim3 dimClusters = dim_clusters();
|
| 436 |
+
return dimClusters.x * dimClusters.y * dimClusters.z;
|
| 437 |
+
}
|
| 438 |
+
|
| 439 |
+
_CG_STATIC_QUALIFIER dim3 cluster_index() {
|
| 440 |
+
return __clusterIdx();
|
| 441 |
+
}
|
| 442 |
+
|
| 443 |
+
_CG_STATIC_QUALIFIER unsigned long long cluster_rank() {
|
| 444 |
+
return vec3_to_linear<unsigned long long>(cluster_index(), dim_clusters());
|
| 445 |
+
}
|
| 446 |
+
#endif
|
| 447 |
+
|
| 448 |
+
// Legacy aliases
|
| 449 |
+
_CG_STATIC_QUALIFIER unsigned long long size()
|
| 450 |
+
{
|
| 451 |
+
return num_threads();
|
| 452 |
+
}
|
| 453 |
+
|
| 454 |
+
_CG_STATIC_QUALIFIER dim3 grid_dim()
|
| 455 |
+
{
|
| 456 |
+
return dim_blocks();
|
| 457 |
+
}
|
| 458 |
+
};
|
| 459 |
+
|
| 460 |
+
|
| 461 |
+
#if defined(_CG_HAS_MULTI_GRID_GROUP)
|
| 462 |
+
|
| 463 |
+
namespace multi_grid {
|
| 464 |
+
_CG_STATIC_QUALIFIER unsigned long long get_intrinsic_handle()
|
| 465 |
+
{
|
| 466 |
+
#if defined(__CUDACC_RDC__) || defined(__CUDACC_EWP__)
|
| 467 |
+
//this function is defined in device runtime library
|
| 468 |
+
//which requires separate compilation mode (__CUDACC_RDC__)
|
| 469 |
+
//or extended whole program mode (__CUDACC_EWP__)
|
| 470 |
+
return (cudaCGGetIntrinsicHandle(cudaCGScopeMultiGrid));
|
| 471 |
+
#else /* !(__CUDACC_RDC__ || __CUDACC_EWP__) */
|
| 472 |
+
return 0;
|
| 473 |
+
#endif /* __CUDACC_RDC__ || __CUDACC_EWP__ */
|
| 474 |
+
}
|
| 475 |
+
|
| 476 |
+
_CG_STATIC_QUALIFIER void sync(const unsigned long long handle)
|
| 477 |
+
{
|
| 478 |
+
#if defined(__CUDACC_RDC__) || defined(__CUDACC_EWP__)
|
| 479 |
+
//this function is defined in device runtime library
|
| 480 |
+
//which requires separate compilation mode (__CUDACC_RDC__)
|
| 481 |
+
//or extended whole program mode (__CUDACC_EWP__)
|
| 482 |
+
cudaError_t err = cudaCGSynchronize(handle, 0);
|
| 483 |
+
#endif /* __CUDACC_RDC__ || __CUDACC_EWP__ */
|
| 484 |
+
}
|
| 485 |
+
|
| 486 |
+
_CG_STATIC_QUALIFIER unsigned int size(const unsigned long long handle)
|
| 487 |
+
{
|
| 488 |
+
unsigned int numThreads = 0;
|
| 489 |
+
#if defined(__CUDACC_RDC__) || defined(__CUDACC_EWP__)
|
| 490 |
+
//this function is defined in device runtime library
|
| 491 |
+
//which requires separate compilation mode (__CUDACC_RDC__)
|
| 492 |
+
//or extended whole program mode (__CUDACC_EWP__)
|
| 493 |
+
cudaCGGetSize(&numThreads, NULL, handle);
|
| 494 |
+
#endif /* __CUDACC_RDC__ || __CUDACC_EWP__ */
|
| 495 |
+
return numThreads;
|
| 496 |
+
}
|
| 497 |
+
|
| 498 |
+
_CG_STATIC_QUALIFIER unsigned int thread_rank(const unsigned long long handle)
|
| 499 |
+
{
|
| 500 |
+
unsigned int threadRank = 0;
|
| 501 |
+
#if defined(__CUDACC_RDC__) || defined(__CUDACC_EWP__)
|
| 502 |
+
//this function is defined in device runtime library
|
| 503 |
+
//which requires separate compilation mode (__CUDACC_RDC__)
|
| 504 |
+
//or extended whole program mode (__CUDACC_EWP__)
|
| 505 |
+
cudaCGGetRank(&threadRank, NULL, handle);
|
| 506 |
+
#endif /* __CUDACC_RDC__ || __CUDACC_EWP__ */
|
| 507 |
+
return threadRank;
|
| 508 |
+
}
|
| 509 |
+
|
| 510 |
+
_CG_STATIC_QUALIFIER unsigned int grid_rank(const unsigned long long handle)
|
| 511 |
+
{
|
| 512 |
+
unsigned int gridRank = 0;
|
| 513 |
+
#if defined(__CUDACC_RDC__) || defined(__CUDACC_EWP__)
|
| 514 |
+
//this function is defined in device runtime library
|
| 515 |
+
//which requires separate compilation mode (__CUDACC_RDC__)
|
| 516 |
+
//or extended whole program mode (__CUDACC_EWP__)
|
| 517 |
+
cudaCGGetRank(NULL, &gridRank, handle);
|
| 518 |
+
#endif /* __CUDACC_RDC__ || __CUDACC_EWP__ */
|
| 519 |
+
return gridRank;
|
| 520 |
+
}
|
| 521 |
+
|
| 522 |
+
_CG_STATIC_QUALIFIER unsigned int num_grids(const unsigned long long handle)
|
| 523 |
+
{
|
| 524 |
+
unsigned int numGrids = 0;
|
| 525 |
+
#if defined(__CUDACC_RDC__) || defined(__CUDACC_EWP__)
|
| 526 |
+
//this function is defined in device runtime library
|
| 527 |
+
//which requires separate compilation mode (__CUDACC_RDC__)
|
| 528 |
+
//or extended whole program mode (__CUDACC_EWP__)
|
| 529 |
+
cudaCGGetSize(NULL, &numGrids, handle);
|
| 530 |
+
#endif /* __CUDACC_RDC__ || __CUDACC_EWP__ */
|
| 531 |
+
return numGrids;
|
| 532 |
+
}
|
| 533 |
+
|
| 534 |
+
# ifdef _CG_CPP11_FEATURES
|
| 535 |
+
struct multi_grid_functions {
|
| 536 |
+
decltype(multi_grid::get_intrinsic_handle) *get_intrinsic_handle;
|
| 537 |
+
decltype(multi_grid::sync) *sync;
|
| 538 |
+
decltype(multi_grid::size) *size;
|
| 539 |
+
decltype(multi_grid::thread_rank) *thread_rank;
|
| 540 |
+
decltype(multi_grid::grid_rank) *grid_rank;
|
| 541 |
+
decltype(multi_grid::num_grids) *num_grids;
|
| 542 |
+
};
|
| 543 |
+
|
| 544 |
+
template <typename = void>
|
| 545 |
+
_CG_STATIC_QUALIFIER const multi_grid_functions* load_grid_intrinsics() {
|
| 546 |
+
__constant__ static const multi_grid_functions mgf {
|
| 547 |
+
&multi_grid::get_intrinsic_handle,
|
| 548 |
+
&multi_grid::sync,
|
| 549 |
+
&multi_grid::size,
|
| 550 |
+
&multi_grid::thread_rank,
|
| 551 |
+
&multi_grid::grid_rank,
|
| 552 |
+
&multi_grid::num_grids
|
| 553 |
+
};
|
| 554 |
+
|
| 555 |
+
return &mgf;
|
| 556 |
+
}
|
| 557 |
+
# endif
|
| 558 |
+
};
|
| 559 |
+
#endif
|
| 560 |
+
|
| 561 |
+
#if defined(_CG_HAS_CLUSTER_GROUP)
|
| 562 |
+
namespace cluster {
|
| 563 |
+
|
| 564 |
+
_CG_STATIC_QUALIFIER bool isReal()
|
| 565 |
+
{
|
| 566 |
+
return __clusterDimIsSpecified();
|
| 567 |
+
}
|
| 568 |
+
|
| 569 |
+
_CG_STATIC_QUALIFIER void barrier_arrive()
|
| 570 |
+
{
|
| 571 |
+
__cluster_barrier_arrive();
|
| 572 |
+
}
|
| 573 |
+
|
| 574 |
+
_CG_STATIC_QUALIFIER void barrier_wait()
|
| 575 |
+
{
|
| 576 |
+
__cluster_barrier_wait();
|
| 577 |
+
}
|
| 578 |
+
|
| 579 |
+
_CG_STATIC_QUALIFIER void sync()
|
| 580 |
+
{
|
| 581 |
+
barrier_arrive();
|
| 582 |
+
barrier_wait();
|
| 583 |
+
}
|
| 584 |
+
|
| 585 |
+
_CG_STATIC_QUALIFIER unsigned int query_shared_rank(const void *addr)
|
| 586 |
+
{
|
| 587 |
+
return __cluster_query_shared_rank(addr);
|
| 588 |
+
}
|
| 589 |
+
|
| 590 |
+
template <typename T>
|
| 591 |
+
_CG_STATIC_QUALIFIER T* map_shared_rank(T *addr, int rank)
|
| 592 |
+
{
|
| 593 |
+
return static_cast<T*>(__cluster_map_shared_rank(addr, rank));
|
| 594 |
+
}
|
| 595 |
+
|
| 596 |
+
_CG_STATIC_QUALIFIER dim3 block_index()
|
| 597 |
+
{
|
| 598 |
+
return __clusterRelativeBlockIdx();
|
| 599 |
+
}
|
| 600 |
+
|
| 601 |
+
_CG_STATIC_QUALIFIER unsigned int block_rank()
|
| 602 |
+
{
|
| 603 |
+
return __clusterRelativeBlockRank();
|
| 604 |
+
}
|
| 605 |
+
|
| 606 |
+
_CG_STATIC_QUALIFIER dim3 thread_index()
|
| 607 |
+
{
|
| 608 |
+
const dim3 blockIndex = block_index();
|
| 609 |
+
return dim3(blockIndex.x * blockDim.x + threadIdx.x,
|
| 610 |
+
blockIndex.y * blockDim.y + threadIdx.y,
|
| 611 |
+
blockIndex.z * blockDim.z + threadIdx.z);
|
| 612 |
+
}
|
| 613 |
+
|
| 614 |
+
_CG_STATIC_QUALIFIER unsigned int thread_rank()
|
| 615 |
+
{
|
| 616 |
+
return block_rank() * cta::num_threads() + cta::thread_rank();
|
| 617 |
+
}
|
| 618 |
+
|
| 619 |
+
_CG_STATIC_QUALIFIER dim3 dim_blocks()
|
| 620 |
+
{
|
| 621 |
+
return __clusterDim();
|
| 622 |
+
}
|
| 623 |
+
|
| 624 |
+
_CG_STATIC_QUALIFIER unsigned int num_blocks()
|
| 625 |
+
{
|
| 626 |
+
return __clusterSizeInBlocks();
|
| 627 |
+
}
|
| 628 |
+
|
| 629 |
+
_CG_STATIC_QUALIFIER dim3 dim_threads()
|
| 630 |
+
{
|
| 631 |
+
const dim3 dimBlocks = dim_blocks();
|
| 632 |
+
const unsigned int x = dimBlocks.x * blockDim.x;
|
| 633 |
+
const unsigned int y = dimBlocks.y * blockDim.y;
|
| 634 |
+
const unsigned int z = dimBlocks.z * blockDim.z;
|
| 635 |
+
return dim3(x, y, z);
|
| 636 |
+
}
|
| 637 |
+
|
| 638 |
+
_CG_STATIC_QUALIFIER unsigned int num_threads()
|
| 639 |
+
{
|
| 640 |
+
return num_blocks() * cta::num_threads();
|
| 641 |
+
}
|
| 642 |
+
|
| 643 |
+
};
|
| 644 |
+
#endif
|
| 645 |
+
|
| 646 |
+
_CG_STATIC_QUALIFIER unsigned int laneid()
|
| 647 |
+
{
|
| 648 |
+
unsigned int laneid;
|
| 649 |
+
asm ("mov.u32 %0, %%laneid;" : "=r"(laneid));
|
| 650 |
+
return laneid;
|
| 651 |
+
}
|
| 652 |
+
|
| 653 |
+
_CG_STATIC_QUALIFIER unsigned int lanemask32_eq()
|
| 654 |
+
{
|
| 655 |
+
unsigned int lanemask32_eq;
|
| 656 |
+
asm ("mov.u32 %0, %%lanemask_eq;" : "=r"(lanemask32_eq));
|
| 657 |
+
return (lanemask32_eq);
|
| 658 |
+
}
|
| 659 |
+
|
| 660 |
+
_CG_STATIC_QUALIFIER unsigned int lanemask32_lt()
|
| 661 |
+
{
|
| 662 |
+
unsigned int lanemask32_lt;
|
| 663 |
+
asm ("mov.u32 %0, %%lanemask_lt;" : "=r"(lanemask32_lt));
|
| 664 |
+
return (lanemask32_lt);
|
| 665 |
+
}
|
| 666 |
+
|
| 667 |
+
_CG_STATIC_QUALIFIER void abort()
|
| 668 |
+
{
|
| 669 |
+
_CG_ABORT();
|
| 670 |
+
}
|
| 671 |
+
|
| 672 |
+
template <typename Ty>
|
| 673 |
+
_CG_QUALIFIER void assert_if_not_arithmetic() {
|
| 674 |
+
#ifdef _CG_CPP11_FEATURES
|
| 675 |
+
static_assert(
|
| 676 |
+
_CG_STL_NAMESPACE::is_integral<Ty>::value ||
|
| 677 |
+
details::is_float_or_half<Ty>::value,
|
| 678 |
+
"Error: Ty is neither integer or float"
|
| 679 |
+
);
|
| 680 |
+
#endif //_CG_CPP11_FEATURES
|
| 681 |
+
}
|
| 682 |
+
|
| 683 |
+
#ifdef _CG_CPP11_FEATURES
|
| 684 |
+
_CG_STATIC_QUALIFIER constexpr unsigned int log2(unsigned int x) {
|
| 685 |
+
return x == 1 ? 0 : 1 + log2(x / 2);
|
| 686 |
+
}
|
| 687 |
+
#endif //_CG_CPP11_FEATURES
|
| 688 |
+
|
| 689 |
+
}; // !Namespace internal
|
| 690 |
+
|
| 691 |
+
_CG_END_NAMESPACE
|
| 692 |
+
|
| 693 |
+
#endif /* !_COOPERATIVE_GROUPS_HELPERS_H_ */
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/details/info.h
ADDED
|
@@ -0,0 +1,345 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* Copyright 1993-2021 NVIDIA Corporation. All rights reserved.
|
| 2 |
+
*
|
| 3 |
+
* NOTICE TO LICENSEE:
|
| 4 |
+
*
|
| 5 |
+
* The source code and/or documentation ("Licensed Deliverables") are
|
| 6 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 7 |
+
* international Copyright laws.
|
| 8 |
+
*
|
| 9 |
+
* The Licensed Deliverables contained herein are PROPRIETARY and
|
| 10 |
+
* CONFIDENTIAL to NVIDIA and are being provided under the terms and
|
| 11 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 12 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 13 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 14 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 15 |
+
* of the Licensed Deliverables to any third party without the express
|
| 16 |
+
* written consent of NVIDIA is prohibited.
|
| 17 |
+
*
|
| 18 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 19 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 20 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. THEY ARE
|
| 21 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 22 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 23 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 24 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 25 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 26 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 27 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 28 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 29 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 30 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 31 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 32 |
+
*
|
| 33 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 34 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 35 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 36 |
+
* computer software documentation" as such terms are used in 48
|
| 37 |
+
* C.F.R. 12.212 (SEPT 1995) and are provided to the U.S. Government
|
| 38 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 39 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 40 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 41 |
+
* only those rights set forth herein.
|
| 42 |
+
*
|
| 43 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 44 |
+
* software must include, in the user documentation and internal
|
| 45 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 46 |
+
* Users Notice.
|
| 47 |
+
*/
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
#include <nv/target>
|
| 51 |
+
|
| 52 |
+
#ifndef _CG_INFO_H_
|
| 53 |
+
#define _CG_INFO_H_
|
| 54 |
+
/*
|
| 55 |
+
** Define: _CG_VERSION
|
| 56 |
+
*/
|
| 57 |
+
#define _CG_VERSION 1000
|
| 58 |
+
|
| 59 |
+
/*
|
| 60 |
+
** Define: _CG_ABI_VERSION
|
| 61 |
+
*/
|
| 62 |
+
#ifndef _CG_ABI_VERSION
|
| 63 |
+
# define _CG_ABI_VERSION 1
|
| 64 |
+
#endif
|
| 65 |
+
|
| 66 |
+
/*
|
| 67 |
+
** Define: _CG_ABI_EXPERIMENTAL
|
| 68 |
+
** Desc: If enabled, sets all features enabled (ABI-breaking or experimental)
|
| 69 |
+
*/
|
| 70 |
+
#if defined(_CG_ABI_EXPERIMENTAL)
|
| 71 |
+
#endif
|
| 72 |
+
|
| 73 |
+
#define _CG_CONCAT_INNER(x, y) x ## y
|
| 74 |
+
#define _CG_CONCAT_OUTER(x, y) _CG_CONCAT_INNER(x, y)
|
| 75 |
+
#define _CG_NAMESPACE _CG_CONCAT_OUTER(__v, _CG_ABI_VERSION)
|
| 76 |
+
|
| 77 |
+
#define _CG_BEGIN_NAMESPACE \
|
| 78 |
+
namespace cooperative_groups { namespace _CG_NAMESPACE {
|
| 79 |
+
#define _CG_END_NAMESPACE \
|
| 80 |
+
}; using namespace _CG_NAMESPACE; };
|
| 81 |
+
|
| 82 |
+
#if (defined(__cplusplus) && (__cplusplus >= 201103L)) || (defined(_MSC_VER) && (_MSC_VER >= 1900))
|
| 83 |
+
# define _CG_CPP11_FEATURES
|
| 84 |
+
#endif
|
| 85 |
+
|
| 86 |
+
#if !defined(_CG_QUALIFIER)
|
| 87 |
+
# define _CG_QUALIFIER __forceinline__ __device__
|
| 88 |
+
#endif
|
| 89 |
+
#if !defined(_CG_STATIC_QUALIFIER)
|
| 90 |
+
# define _CG_STATIC_QUALIFIER static __forceinline__ __device__
|
| 91 |
+
#endif
|
| 92 |
+
#if !defined(_CG_CONSTEXPR_QUALIFIER)
|
| 93 |
+
# if defined(_CG_CPP11_FEATURES)
|
| 94 |
+
# define _CG_CONSTEXPR_QUALIFIER constexpr __forceinline__ __device__
|
| 95 |
+
# else
|
| 96 |
+
# define _CG_CONSTEXPR_QUALIFIER _CG_QUALIFIER
|
| 97 |
+
# endif
|
| 98 |
+
#endif
|
| 99 |
+
#if !defined(_CG_STATIC_CONSTEXPR_QUALIFIER)
|
| 100 |
+
# if defined(_CG_CPP11_FEATURES)
|
| 101 |
+
# define _CG_STATIC_CONSTEXPR_QUALIFIER static constexpr __forceinline__ __device__
|
| 102 |
+
# else
|
| 103 |
+
# define _CG_STATIC_CONSTEXPR_QUALIFIER _CG_STATIC_QUALIFIER
|
| 104 |
+
# endif
|
| 105 |
+
#endif
|
| 106 |
+
|
| 107 |
+
#if defined(_MSC_VER)
|
| 108 |
+
# define _CG_DEPRECATED __declspec(deprecated)
|
| 109 |
+
#else
|
| 110 |
+
# define _CG_DEPRECATED __attribute__((deprecated))
|
| 111 |
+
#endif
|
| 112 |
+
|
| 113 |
+
#if defined(__CUDA_MINIMUM_ARCH__)
|
| 114 |
+
# define _CG_CUDA_ARCH __CUDA_MINIMUM_ARCH__
|
| 115 |
+
#elif defined(__CUDA_ARCH__)
|
| 116 |
+
# define _CG_CUDA_ARCH __CUDA_ARCH__
|
| 117 |
+
#endif
|
| 118 |
+
|
| 119 |
+
#if (_CG_CUDA_ARCH >= 600) || !defined(_CG_CUDA_ARCH)
|
| 120 |
+
# define _CG_HAS_GRID_GROUP
|
| 121 |
+
#endif
|
| 122 |
+
#if (_CG_CUDA_ARCH >= 600) || !defined(_CG_CUDA_ARCH)
|
| 123 |
+
# define _CG_HAS_MULTI_GRID_GROUP
|
| 124 |
+
#endif
|
| 125 |
+
#if (_CG_CUDA_ARCH >= 700) || !defined(_CG_CUDA_ARCH)
|
| 126 |
+
# define _CG_HAS_MATCH_COLLECTIVE
|
| 127 |
+
#endif
|
| 128 |
+
|
| 129 |
+
#if ((_CG_CUDA_ARCH >= 800) || !defined(_CG_CUDA_ARCH)) && !defined(_CG_USER_PROVIDED_SHARED_MEMORY)
|
| 130 |
+
# define _CG_HAS_RESERVED_SHARED
|
| 131 |
+
#endif
|
| 132 |
+
|
| 133 |
+
#if ((_CG_CUDA_ARCH >= 900) || !defined(_CG_CUDA_ARCH)) && \
|
| 134 |
+
(defined(__NVCC__) || defined(__CUDACC_RTC__) || defined(_CG_CLUSTER_INTRINSICS_AVAILABLE)) && \
|
| 135 |
+
defined(_CG_CPP11_FEATURES)
|
| 136 |
+
# define _CG_HAS_CLUSTER_GROUP
|
| 137 |
+
#endif
|
| 138 |
+
|
| 139 |
+
#if (_CG_CUDA_ARCH >= 900) || !defined(_CG_CUDA_ARCH)
|
| 140 |
+
# define _CG_HAS_INSTR_ELECT
|
| 141 |
+
#endif
|
| 142 |
+
|
| 143 |
+
// Has __half and __half2
|
| 144 |
+
// Only usable if you include the cuda_fp16.h extension, and
|
| 145 |
+
// _before_ including cooperative_groups.h
|
| 146 |
+
#ifdef __CUDA_FP16_TYPES_EXIST__
|
| 147 |
+
# define _CG_HAS_FP16_COLLECTIVE
|
| 148 |
+
#endif
|
| 149 |
+
|
| 150 |
+
// Include libcu++ where supported.
|
| 151 |
+
#if defined(_CG_CPP11_FEATURES) && !defined(__ibmxl__) && (!defined(_MSC_VER) || defined(_WIN64)) && \
|
| 152 |
+
!defined(_CG_LIMIT_INCLUDED_DEPENDENCIES)
|
| 153 |
+
# define _CG_USE_CUDA_STL
|
| 154 |
+
#else
|
| 155 |
+
# define _CG_USE_OWN_TRAITS
|
| 156 |
+
#endif
|
| 157 |
+
|
| 158 |
+
#if defined(_CG_USE_CUDA_STL) && !defined(__QNX__) && (!defined(__CUDA_ARCH__) || \
|
| 159 |
+
((!defined(_MSC_VER) && __CUDA_ARCH__ >= 600) || (defined(_MSC_VER) && __CUDA_ARCH__ >= 700)))
|
| 160 |
+
# define _CG_HAS_STL_ATOMICS
|
| 161 |
+
#endif
|
| 162 |
+
|
| 163 |
+
#ifdef _CG_CPP11_FEATURES
|
| 164 |
+
// Use cuda::std:: for type_traits
|
| 165 |
+
# if defined(_CG_USE_CUDA_STL)
|
| 166 |
+
# define _CG_STL_NAMESPACE cuda::std
|
| 167 |
+
# include <cuda/std/type_traits>
|
| 168 |
+
// Use CG's implementation of type traits
|
| 169 |
+
# else
|
| 170 |
+
# define _CG_STL_NAMESPACE cooperative_groups::details::templates
|
| 171 |
+
# endif
|
| 172 |
+
#endif
|
| 173 |
+
|
| 174 |
+
#ifdef _CG_CPP11_FEATURES
|
| 175 |
+
# define _CG_STATIC_CONST_DECL static constexpr
|
| 176 |
+
# define _CG_CONST_DECL constexpr
|
| 177 |
+
#else
|
| 178 |
+
# define _CG_STATIC_CONST_DECL static const
|
| 179 |
+
# define _CG_CONST_DECL const
|
| 180 |
+
#endif
|
| 181 |
+
|
| 182 |
+
#if (defined(_MSC_VER) && !defined(_WIN64)) || defined(__arm__)
|
| 183 |
+
# define _CG_ASM_PTR_CONSTRAINT "r"
|
| 184 |
+
#else
|
| 185 |
+
# define _CG_ASM_PTR_CONSTRAINT "l"
|
| 186 |
+
#endif
|
| 187 |
+
|
| 188 |
+
/*
|
| 189 |
+
** Define: CG_DEBUG
|
| 190 |
+
** What: Enables various runtime safety checks
|
| 191 |
+
*/
|
| 192 |
+
#if defined(__CUDACC_DEBUG__) && defined(CG_DEBUG) && !defined(NDEBUG)
|
| 193 |
+
# define _CG_DEBUG
|
| 194 |
+
#endif
|
| 195 |
+
|
| 196 |
+
#if defined(_CG_DEBUG)
|
| 197 |
+
# include <assert.h>
|
| 198 |
+
# define _CG_ASSERT(x) assert((x));
|
| 199 |
+
# define _CG_ABORT() assert(0);
|
| 200 |
+
#else
|
| 201 |
+
# define _CG_ASSERT(x)
|
| 202 |
+
# define _CG_ABORT() __trap();
|
| 203 |
+
#endif
|
| 204 |
+
|
| 205 |
+
_CG_BEGIN_NAMESPACE
|
| 206 |
+
|
| 207 |
+
namespace details {
|
| 208 |
+
_CG_STATIC_CONST_DECL unsigned int default_max_block_size = 1024;
|
| 209 |
+
|
| 210 |
+
#if defined(_CG_CPP11_FEATURES) && !defined(_CG_USE_CUDA_STL)
|
| 211 |
+
namespace templates {
|
| 212 |
+
|
| 213 |
+
/**
|
| 214 |
+
* Integral constants
|
| 215 |
+
**/
|
| 216 |
+
template <typename Ty, Ty Val>
|
| 217 |
+
struct integral_constant {
|
| 218 |
+
static constexpr Ty value = Val;
|
| 219 |
+
typedef Ty type;
|
| 220 |
+
|
| 221 |
+
_CG_QUALIFIER constexpr operator type() const noexcept { return value; }
|
| 222 |
+
_CG_QUALIFIER constexpr type operator()() const noexcept { return value; }
|
| 223 |
+
};
|
| 224 |
+
|
| 225 |
+
typedef integral_constant<bool, true> true_type;
|
| 226 |
+
typedef integral_constant<bool, false> false_type;
|
| 227 |
+
|
| 228 |
+
/**
|
| 229 |
+
* CV Qualifiers
|
| 230 |
+
**/
|
| 231 |
+
template <class Ty> struct is_lvalue_reference : public details::templates::false_type {};
|
| 232 |
+
template <class Ty> struct is_lvalue_reference<Ty&> : public details::templates::true_type {};
|
| 233 |
+
|
| 234 |
+
template <class Ty> struct remove_reference {typedef Ty type;};
|
| 235 |
+
template <class Ty> struct remove_reference<Ty&> {typedef Ty type;};
|
| 236 |
+
template <class Ty> struct remove_reference<Ty&&> {typedef Ty type;};
|
| 237 |
+
|
| 238 |
+
template <class Ty>
|
| 239 |
+
using remove_reference_t = typename details::templates::remove_reference<Ty>::type;
|
| 240 |
+
|
| 241 |
+
template <class Ty> struct remove_const {typedef Ty type;};
|
| 242 |
+
template <class Ty> struct remove_const<const Ty> {typedef Ty type;};
|
| 243 |
+
|
| 244 |
+
template <class Ty> struct remove_volatile {typedef Ty type;};
|
| 245 |
+
template <class Ty> struct remove_volatile<volatile Ty> {typedef Ty type;};
|
| 246 |
+
|
| 247 |
+
template <class Ty> struct remove_cv {typedef typename details::templates::remove_volatile<typename details::templates::remove_const<Ty>::type>::type type;};
|
| 248 |
+
|
| 249 |
+
template <class Ty>
|
| 250 |
+
using remove_cv_t = typename details::templates::remove_cv<Ty>::type;
|
| 251 |
+
|
| 252 |
+
template <class Ty>
|
| 253 |
+
_CG_QUALIFIER Ty&& forward(remove_reference_t<Ty> &t) noexcept {
|
| 254 |
+
return static_cast<Ty&&>(t);
|
| 255 |
+
}
|
| 256 |
+
|
| 257 |
+
template <class Ty>
|
| 258 |
+
_CG_QUALIFIER Ty&& forward(remove_reference_t<Ty> &&t) noexcept {
|
| 259 |
+
static_assert(!details::templates::is_lvalue_reference<Ty>::value, "Forwarding an rvalue as an lvalue is not allowed.");
|
| 260 |
+
return static_cast<Ty&&>(t);
|
| 261 |
+
}
|
| 262 |
+
|
| 263 |
+
/**
|
| 264 |
+
* is_integral
|
| 265 |
+
**/
|
| 266 |
+
template <class Ty> struct _is_integral : public details::templates::false_type {};
|
| 267 |
+
template <> struct _is_integral<bool> : public details::templates::true_type {};
|
| 268 |
+
template <> struct _is_integral<char> : public details::templates::true_type {};
|
| 269 |
+
template <> struct _is_integral<unsigned char> : public details::templates::true_type {};
|
| 270 |
+
template <> struct _is_integral<short> : public details::templates::true_type {};
|
| 271 |
+
template <> struct _is_integral<unsigned short> : public details::templates::true_type {};
|
| 272 |
+
template <> struct _is_integral<int> : public details::templates::true_type {};
|
| 273 |
+
template <> struct _is_integral<unsigned int> : public details::templates::true_type {};
|
| 274 |
+
template <> struct _is_integral<long> : public details::templates::true_type {};
|
| 275 |
+
template <> struct _is_integral<long long> : public details::templates::true_type {};
|
| 276 |
+
template <> struct _is_integral<unsigned long> : public details::templates::true_type {};
|
| 277 |
+
template <> struct _is_integral<unsigned long long> : public details::templates::true_type {};
|
| 278 |
+
//Vector type support?
|
| 279 |
+
|
| 280 |
+
template <typename Ty>
|
| 281 |
+
struct is_integral : public details::templates::_is_integral<typename details::templates::remove_cv<Ty>::type> {};
|
| 282 |
+
|
| 283 |
+
/**
|
| 284 |
+
* is_floating_point
|
| 285 |
+
**/
|
| 286 |
+
template <class Ty> struct _is_floating_point : public details::templates::false_type {};
|
| 287 |
+
template <> struct _is_floating_point<float> : public details::templates::true_type {};
|
| 288 |
+
template <> struct _is_floating_point<double> : public details::templates::true_type {};
|
| 289 |
+
template <> struct _is_floating_point<long double> : public details::templates::true_type {};
|
| 290 |
+
# ifdef __CUDA_FP16_TYPES_EXIST__
|
| 291 |
+
template <> struct _is_floating_point<__half> : public details::templates::true_type {};
|
| 292 |
+
template <> struct _is_floating_point<__half2> : public details::templates::true_type {};
|
| 293 |
+
# endif
|
| 294 |
+
//Vector type support?
|
| 295 |
+
|
| 296 |
+
template <typename Ty>
|
| 297 |
+
struct is_floating_point : public details::templates::_is_floating_point<typename details::templates::remove_cv<Ty>::type> {};
|
| 298 |
+
|
| 299 |
+
template <class T>
|
| 300 |
+
struct is_arithmetic : details::templates::integral_constant<
|
| 301 |
+
bool,
|
| 302 |
+
details::templates::is_integral<T>::value ||
|
| 303 |
+
details::templates::is_floating_point<T>::value> {};
|
| 304 |
+
|
| 305 |
+
template <typename Ty, bool = details::templates::is_arithmetic<Ty>::value>
|
| 306 |
+
struct _is_unsigned : details::templates::integral_constant<bool, Ty(0) < Ty(-1)> {};
|
| 307 |
+
|
| 308 |
+
template <typename Ty>
|
| 309 |
+
struct _is_unsigned<Ty,false> : details::templates::false_type {};
|
| 310 |
+
|
| 311 |
+
template <typename Ty>
|
| 312 |
+
struct is_unsigned : _is_unsigned<typename details::templates::remove_cv<Ty>::type> {};
|
| 313 |
+
|
| 314 |
+
template <typename Ty> struct _is_pointer : public details::templates::false_type {};
|
| 315 |
+
template <typename Ty> struct _is_pointer<Ty*> : public details::templates::true_type {};
|
| 316 |
+
|
| 317 |
+
template <typename Ty>
|
| 318 |
+
struct is_pointer : _is_pointer<typename details::templates::remove_cv<Ty>::type> {};
|
| 319 |
+
|
| 320 |
+
/**
|
| 321 |
+
* programmatic type traits
|
| 322 |
+
**/
|
| 323 |
+
template<bool B, class Ty = void>
|
| 324 |
+
struct enable_if {};
|
| 325 |
+
|
| 326 |
+
template<class Ty>
|
| 327 |
+
struct enable_if<true, Ty> { typedef Ty type; };
|
| 328 |
+
|
| 329 |
+
template<bool Cond, typename Ty = void>
|
| 330 |
+
using enable_if_t = typename details::templates::enable_if<Cond, Ty>::type;
|
| 331 |
+
|
| 332 |
+
template<class Ty1, class Ty2>
|
| 333 |
+
struct is_same : details::templates::false_type {};
|
| 334 |
+
|
| 335 |
+
template<class Ty>
|
| 336 |
+
struct is_same<Ty, Ty> : details::templates::true_type {};
|
| 337 |
+
|
| 338 |
+
} // templates
|
| 339 |
+
#endif // _CG_CPP11_FEATURES
|
| 340 |
+
|
| 341 |
+
} // details
|
| 342 |
+
_CG_END_NAMESPACE
|
| 343 |
+
|
| 344 |
+
|
| 345 |
+
#endif // _CG_INFO_H_
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/details/invoke.h
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1993-2022 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO LICENSEE:
|
| 5 |
+
*
|
| 6 |
+
* This source code and/or documentation ("Licensed Deliverables") are
|
| 7 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 8 |
+
* international Copyright laws.
|
| 9 |
+
*
|
| 10 |
+
* These Licensed Deliverables contained herein is PROPRIETARY and
|
| 11 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and
|
| 12 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 13 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 14 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 15 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 16 |
+
* of the Licensed Deliverables to any third party without the express
|
| 17 |
+
* written consent of NVIDIA is prohibited.
|
| 18 |
+
*
|
| 19 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 20 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 21 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
|
| 22 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 23 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 24 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 25 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 26 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 27 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 28 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 29 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 30 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 31 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 32 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 33 |
+
*
|
| 34 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 35 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 36 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 37 |
+
* computer software documentation" as such terms are used in 48
|
| 38 |
+
* C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
|
| 39 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 40 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 41 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 42 |
+
* only those rights set forth herein.
|
| 43 |
+
*
|
| 44 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 45 |
+
* software must include, in the user documentation and internal
|
| 46 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 47 |
+
* Users Notice.
|
| 48 |
+
*/
|
| 49 |
+
|
| 50 |
+
#ifndef _CG_INVOKE_H
|
| 51 |
+
#define _CG_INVOKE_H
|
| 52 |
+
|
| 53 |
+
#include "info.h"
|
| 54 |
+
#include "helpers.h"
|
| 55 |
+
|
| 56 |
+
#if defined(_CG_CPP11_FEATURES)
|
| 57 |
+
|
| 58 |
+
_CG_BEGIN_NAMESPACE
|
| 59 |
+
|
| 60 |
+
namespace details {
|
| 61 |
+
|
| 62 |
+
template <typename Group>
|
| 63 |
+
struct _elect_group_supported : _CG_STL_NAMESPACE::false_type {};
|
| 64 |
+
#ifdef _CG_HAS_INSTR_ELECT
|
| 65 |
+
template<>
|
| 66 |
+
struct _elect_group_supported<coalesced_group> : _CG_STL_NAMESPACE::true_type {};
|
| 67 |
+
template<unsigned int Size, typename Parent>
|
| 68 |
+
struct _elect_group_supported<thread_block_tile<Size, Parent>> :
|
| 69 |
+
_CG_STL_NAMESPACE::integral_constant<bool, (Size <= 32)> {};
|
| 70 |
+
#endif
|
| 71 |
+
|
| 72 |
+
template <typename Group>
|
| 73 |
+
struct elect_group_supported : public _elect_group_supported<details::remove_qual<Group>> {};
|
| 74 |
+
|
| 75 |
+
template<typename Group>
|
| 76 |
+
_CG_STATIC_QUALIFIER bool elect_one(const Group& group, unsigned int mask, unsigned int& leader_lane) {
|
| 77 |
+
int is_leader = 0;
|
| 78 |
+
#ifdef _CG_HAS_INSTR_ELECT
|
| 79 |
+
asm("{\n\t"
|
| 80 |
+
" .reg .pred p;\n\t"
|
| 81 |
+
" elect.sync %0|p, %2;\n\t"
|
| 82 |
+
" @p mov.s32 %1, 1;\n\t"
|
| 83 |
+
"}"
|
| 84 |
+
: "+r"(leader_lane), "+r"(is_leader) : "r" (mask));
|
| 85 |
+
#endif
|
| 86 |
+
return is_leader;
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
template<bool UseElect>
|
| 90 |
+
struct invoke_one_impl {};
|
| 91 |
+
|
| 92 |
+
template<>
|
| 93 |
+
struct invoke_one_impl<true> {
|
| 94 |
+
template<typename Group, typename Fn, typename... Args>
|
| 95 |
+
_CG_STATIC_QUALIFIER void invoke_one(const Group& group, Fn&& fn, Args&&... args) {
|
| 96 |
+
auto mask = details::_coalesced_group_data_access::get_mask(group);
|
| 97 |
+
unsigned int leader_lane = 0;
|
| 98 |
+
|
| 99 |
+
if (elect_one(group, mask, leader_lane)) {
|
| 100 |
+
_CG_STL_NAMESPACE::forward<Fn>(fn)(_CG_STL_NAMESPACE::forward<Args>(args)...);
|
| 101 |
+
}
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
template<typename Group, typename Fn, typename... Args>
|
| 105 |
+
_CG_STATIC_QUALIFIER auto invoke_one_broadcast(const Group& group, Fn&& fn, Args&&... args)
|
| 106 |
+
-> typename _CG_STL_NAMESPACE::remove_reference<
|
| 107 |
+
decltype(_CG_STL_NAMESPACE::forward<Fn>(fn)(_CG_STL_NAMESPACE::forward<Args>(args)...))>::type {
|
| 108 |
+
|
| 109 |
+
using ResultType = decltype(_CG_STL_NAMESPACE::forward<Fn>(fn)(_CG_STL_NAMESPACE::forward<Args>(args)...));
|
| 110 |
+
details::remove_qual<ResultType> result;
|
| 111 |
+
auto mask = details::_coalesced_group_data_access::get_mask(group);
|
| 112 |
+
unsigned int leader_lane = 0;
|
| 113 |
+
|
| 114 |
+
if (elect_one(group, mask, leader_lane)) {
|
| 115 |
+
result = _CG_STL_NAMESPACE::forward<Fn>(fn)(_CG_STL_NAMESPACE::forward<Args>(args)...);
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
// Need to use low level api instead of group.shfl, because elect_one returns lane id, not group rank.
|
| 119 |
+
return tile::shuffle_dispatch<ResultType>::shfl(result, mask, leader_lane, 32);
|
| 120 |
+
}
|
| 121 |
+
};
|
| 122 |
+
|
| 123 |
+
template<>
|
| 124 |
+
struct invoke_one_impl<false> {
|
| 125 |
+
template<typename Group, typename Fn, typename... Args>
|
| 126 |
+
_CG_STATIC_QUALIFIER void invoke_one(const Group& group, Fn&& fn, Args&&... args) {
|
| 127 |
+
if (group.thread_rank() == 0) {
|
| 128 |
+
_CG_STL_NAMESPACE::forward<Fn>(fn)(_CG_STL_NAMESPACE::forward<Args>(args)...);
|
| 129 |
+
}
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
template<typename Group, typename Fn, typename... Args>
|
| 133 |
+
_CG_STATIC_QUALIFIER auto invoke_one_broadcast(const Group& group, Fn&& fn, Args&&... args)
|
| 134 |
+
-> typename _CG_STL_NAMESPACE::remove_reference<
|
| 135 |
+
decltype(_CG_STL_NAMESPACE::forward<Fn>(fn)(_CG_STL_NAMESPACE::forward<Args>(args)...))>::type {
|
| 136 |
+
|
| 137 |
+
using ResultType = decltype(_CG_STL_NAMESPACE::forward<Fn>(fn)(_CG_STL_NAMESPACE::forward<Args>(args)...));
|
| 138 |
+
details::remove_qual<ResultType> result;
|
| 139 |
+
|
| 140 |
+
if (group.thread_rank() == 0) {
|
| 141 |
+
result = _CG_STL_NAMESPACE::forward<Fn>(fn)(_CG_STL_NAMESPACE::forward<Args>(args)...);
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
return group.shfl(result, 0);
|
| 145 |
+
}
|
| 146 |
+
};
|
| 147 |
+
|
| 148 |
+
|
| 149 |
+
}; // namespace details
|
| 150 |
+
|
| 151 |
+
template<typename Group, typename Fn, typename... Args>
|
| 152 |
+
_CG_QUALIFIER void invoke_one(const Group& group, Fn&& fn, Args&&... args) {
|
| 153 |
+
using impl = details::invoke_one_impl<details::elect_group_supported<Group>::value>;
|
| 154 |
+
impl::invoke_one(group, _CG_STL_NAMESPACE::forward<Fn>(fn), _CG_STL_NAMESPACE::forward<Args>(args)...);
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
template<typename Fn, typename... Args>
|
| 158 |
+
_CG_QUALIFIER auto invoke_one_broadcast(const coalesced_group& group, Fn&& fn, Args&&... args)
|
| 159 |
+
-> typename _CG_STL_NAMESPACE::remove_reference<
|
| 160 |
+
decltype(_CG_STL_NAMESPACE::forward<Fn>(fn)(_CG_STL_NAMESPACE::forward<Args>(args)...))>::type {
|
| 161 |
+
|
| 162 |
+
using ResultType = decltype(_CG_STL_NAMESPACE::forward<Fn>(fn)(_CG_STL_NAMESPACE::forward<Args>(args)...));
|
| 163 |
+
static_assert(!_CG_STL_NAMESPACE::is_same<ResultType, void>::value,
|
| 164 |
+
"For invocables returning void invoke_one should be used instead");
|
| 165 |
+
using impl = details::invoke_one_impl<details::elect_group_supported<coalesced_group>::value>;
|
| 166 |
+
return impl::invoke_one_broadcast(group,
|
| 167 |
+
_CG_STL_NAMESPACE::forward<Fn>(fn),
|
| 168 |
+
_CG_STL_NAMESPACE::forward<Args>(args)...);
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
+
template<unsigned int Size, typename Parent, typename Fn, typename... Args>
|
| 172 |
+
_CG_QUALIFIER auto invoke_one_broadcast(const thread_block_tile<Size, Parent>& group, Fn&& fn, Args&&... args)
|
| 173 |
+
-> typename _CG_STL_NAMESPACE::remove_reference<
|
| 174 |
+
decltype(_CG_STL_NAMESPACE::forward<Fn>(fn)(_CG_STL_NAMESPACE::forward<Args>(args)...))>::type {
|
| 175 |
+
|
| 176 |
+
using ResultType = decltype(_CG_STL_NAMESPACE::forward<Fn>(fn)(_CG_STL_NAMESPACE::forward<Args>(args)...));
|
| 177 |
+
static_assert(!_CG_STL_NAMESPACE::is_same<ResultType, void>::value,
|
| 178 |
+
"For invocables returning void invoke_one should be used instead");
|
| 179 |
+
using impl = details::invoke_one_impl<details::elect_group_supported<thread_block_tile<Size, Parent>>::value>;
|
| 180 |
+
return impl::invoke_one_broadcast(group,
|
| 181 |
+
_CG_STL_NAMESPACE::forward<Fn>(fn),
|
| 182 |
+
_CG_STL_NAMESPACE::forward<Args>(args)...);
|
| 183 |
+
}
|
| 184 |
+
|
| 185 |
+
_CG_END_NAMESPACE
|
| 186 |
+
|
| 187 |
+
#endif //_CG_CPP11_FEATURES
|
| 188 |
+
|
| 189 |
+
#endif // _CG_INVOKE_H
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/details/memory.h
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* Copyright 1993-2022 NVIDIA Corporation. All rights reserved.
|
| 2 |
+
*
|
| 3 |
+
* NOTICE TO LICENSEE:
|
| 4 |
+
*
|
| 5 |
+
* The source code and/or documentation ("Licensed Deliverables") are
|
| 6 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 7 |
+
* international Copyright laws.
|
| 8 |
+
*
|
| 9 |
+
* The Licensed Deliverables contained herein are PROPRIETARY and
|
| 10 |
+
* CONFIDENTIAL to NVIDIA and are being provided under the terms and
|
| 11 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 12 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 13 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 14 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 15 |
+
* of the Licensed Deliverables to any third party without the express
|
| 16 |
+
* written consent of NVIDIA is prohibited.
|
| 17 |
+
*
|
| 18 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 19 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 20 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. THEY ARE
|
| 21 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 22 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 23 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 24 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 25 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 26 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 27 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 28 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 29 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 30 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 31 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 32 |
+
*
|
| 33 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 34 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 35 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 36 |
+
* computer software documentation" as such terms are used in 48
|
| 37 |
+
* C.F.R. 12.212 (SEPT 1995) and are provided to the U.S. Government
|
| 38 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 39 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 40 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 41 |
+
* only those rights set forth herein.
|
| 42 |
+
*
|
| 43 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 44 |
+
* software must include, in the user documentation and internal
|
| 45 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 46 |
+
* Users Notice.
|
| 47 |
+
*/
|
| 48 |
+
|
| 49 |
+
#ifndef _COOPERATIVE_GROUPS_MEMORY_H_
|
| 50 |
+
# define _COOPERATIVE_GROUPS_MEMORY_H_
|
| 51 |
+
|
| 52 |
+
#include "info.h"
|
| 53 |
+
|
| 54 |
+
_CG_BEGIN_NAMESPACE
|
| 55 |
+
|
| 56 |
+
#if defined(_CG_CPP11_FEATURES)
|
| 57 |
+
namespace details {
|
| 58 |
+
_CG_STATIC_CONST_DECL int scratch_num_reserved_bytes = 12;
|
| 59 |
+
|
| 60 |
+
// Should only be called for SM80+
|
| 61 |
+
_CG_STATIC_QUALIFIER void* reserved_shared_ptr()
|
| 62 |
+
{
|
| 63 |
+
unsigned long long ptr = 0;
|
| 64 |
+
NV_IF_TARGET(NV_PROVIDES_SM_80,
|
| 65 |
+
(asm ("{\n\t"
|
| 66 |
+
" .reg .u32 start;\n\t"
|
| 67 |
+
" .reg .u64 extended;\n\t"
|
| 68 |
+
" mov.u32 start, %%reserved_smem_offset_1;\n\t"
|
| 69 |
+
" cvt.u64.u32 extended, start;\n\t"
|
| 70 |
+
" cvta.shared.u64 %0, extended;\n\t"
|
| 71 |
+
"}"
|
| 72 |
+
: "=l"(ptr));)
|
| 73 |
+
)
|
| 74 |
+
return reinterpret_cast<void*>(ptr);
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
struct multi_warp_scratch {
|
| 78 |
+
// One barrier per possible size of the group.
|
| 79 |
+
_CG_STATIC_CONST_DECL unsigned int memory_barriers_count = 5;
|
| 80 |
+
_CG_STATIC_CONST_DECL size_t sync_memory_size = memory_barriers_count * sizeof(barrier_t);
|
| 81 |
+
|
| 82 |
+
using communication_type = unsigned long long;
|
| 83 |
+
_CG_STATIC_CONST_DECL size_t communication_size = sizeof(communication_type);
|
| 84 |
+
|
| 85 |
+
// Layout of the scratch space:
|
| 86 |
+
barrier_t barriers[memory_barriers_count];
|
| 87 |
+
char reserved[scratch_num_reserved_bytes]; // Reserve 12 bytes for future use
|
| 88 |
+
communication_type communication_memory[default_max_block_size / 32];
|
| 89 |
+
|
| 90 |
+
_CG_STATIC_CONSTEXPR_QUALIFIER unsigned int scratch_size_needed(unsigned int max_block_size) {
|
| 91 |
+
// One slot of collectives memory per warp.
|
| 92 |
+
return scratch_num_reserved_bytes + (unsigned int)sync_memory_size + max_block_size / 32 * (unsigned int)communication_size;
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
_CG_QUALIFIER void init_barriers(unsigned int thread_rank) {
|
| 96 |
+
if (thread_rank < memory_barriers_count) {
|
| 97 |
+
barriers[thread_rank] = 0;
|
| 98 |
+
}
|
| 99 |
+
}
|
| 100 |
+
};
|
| 101 |
+
|
| 102 |
+
#if defined(_CG_HAS_RESERVED_SHARED)
|
| 103 |
+
// CG can expect at least 288 bytes available in reserved shared
|
| 104 |
+
static_assert(sizeof(multi_warp_scratch) <= 288, "multi-warp scratch size is too large");
|
| 105 |
+
#endif
|
| 106 |
+
|
| 107 |
+
// Make sure the structure can fit into the user provided memory
|
| 108 |
+
static_assert(sizeof(multi_warp_scratch) <= multi_warp_scratch::scratch_size_needed(default_max_block_size),
|
| 109 |
+
"multi-warp scratch size is too large");
|
| 110 |
+
|
| 111 |
+
|
| 112 |
+
_CG_QUALIFIER multi_warp_scratch* get_scratch_ptr(void* user_scratch) {
|
| 113 |
+
void *ptr;
|
| 114 |
+
NV_IF_ELSE_TARGET(NV_PROVIDES_SM_80,
|
| 115 |
+
(ptr = reserved_shared_ptr();)
|
| 116 |
+
,
|
| 117 |
+
(ptr = user_scratch;)
|
| 118 |
+
)
|
| 119 |
+
return static_cast<multi_warp_scratch*>(ptr);
|
| 120 |
+
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
template <unsigned int MaxBlockSize = details::default_max_block_size>
|
| 126 |
+
struct __align__(details::multi_warp_scratch::communication_size) block_tile_memory {
|
| 127 |
+
private:
|
| 128 |
+
#if !defined(_CG_HAS_RESERVED_SHARED)
|
| 129 |
+
char scratch[details::multi_warp_scratch::scratch_size_needed(MaxBlockSize)];
|
| 130 |
+
#endif
|
| 131 |
+
};
|
| 132 |
+
#endif
|
| 133 |
+
|
| 134 |
+
_CG_END_NAMESPACE
|
| 135 |
+
|
| 136 |
+
#endif /* !_COOPERATIVE_GROUPS_MEMORY_H_ */
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/details/partitioning.h
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1993-2016 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO LICENSEE:
|
| 5 |
+
*
|
| 6 |
+
* This source code and/or documentation ("Licensed Deliverables") are
|
| 7 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 8 |
+
* international Copyright laws.
|
| 9 |
+
*
|
| 10 |
+
* These Licensed Deliverables contained herein is PROPRIETARY and
|
| 11 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and
|
| 12 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 13 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 14 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 15 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 16 |
+
* of the Licensed Deliverables to any third party without the express
|
| 17 |
+
* written consent of NVIDIA is prohibited.
|
| 18 |
+
*
|
| 19 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 20 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 21 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
|
| 22 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 23 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 24 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 25 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 26 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 27 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 28 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 29 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 30 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 31 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 32 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 33 |
+
*
|
| 34 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 35 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 36 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 37 |
+
* computer software documentation" as such terms are used in 48
|
| 38 |
+
* C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
|
| 39 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 40 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 41 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 42 |
+
* only those rights set forth herein.
|
| 43 |
+
*
|
| 44 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 45 |
+
* software must include, in the user documentation and internal
|
| 46 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 47 |
+
* Users Notice.
|
| 48 |
+
*/
|
| 49 |
+
|
| 50 |
+
#ifndef _CG_PARTITIONING_H
|
| 51 |
+
#define _CG_PARTITIONING_H
|
| 52 |
+
|
| 53 |
+
#include "info.h"
|
| 54 |
+
#include "helpers.h"
|
| 55 |
+
|
| 56 |
+
_CG_BEGIN_NAMESPACE
|
| 57 |
+
|
| 58 |
+
namespace details {
|
| 59 |
+
|
| 60 |
+
template <typename TyGroup>
|
| 61 |
+
_CG_STATIC_QUALIFIER coalesced_group _binary_partition(const TyGroup &tile, bool pred) {
|
| 62 |
+
const unsigned int fullMask = ~0u;
|
| 63 |
+
|
| 64 |
+
unsigned int thisMask = _coalesced_group_data_access::get_mask(tile);
|
| 65 |
+
unsigned int predMask = pred ? 0 : fullMask;
|
| 66 |
+
unsigned int setMask = __ballot_sync(thisMask, pred);
|
| 67 |
+
|
| 68 |
+
if (setMask == thisMask || setMask == 0) {
|
| 69 |
+
coalesced_group subTile = _coalesced_group_data_access::construct_from_mask<coalesced_group>(thisMask);
|
| 70 |
+
_coalesced_group_data_access::modify_meta_group(subTile, 0, 1);
|
| 71 |
+
return subTile;
|
| 72 |
+
}
|
| 73 |
+
else {
|
| 74 |
+
unsigned int subMask = thisMask & (setMask ^ predMask);
|
| 75 |
+
coalesced_group subTile = _coalesced_group_data_access::construct_from_mask<coalesced_group>(subMask);
|
| 76 |
+
_coalesced_group_data_access::modify_meta_group(subTile, pred, 2);
|
| 77 |
+
return subTile;
|
| 78 |
+
}
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
#if defined(_CG_HAS_MATCH_COLLECTIVE) && defined(_CG_CPP11_FEATURES)
|
| 82 |
+
template <typename TyPredicate>
|
| 83 |
+
struct _labeled_partition_dispatch {
|
| 84 |
+
template <typename TyGroup>
|
| 85 |
+
_CG_QUALIFIER coalesced_group operator()(const TyGroup &tile, TyPredicate pred) {
|
| 86 |
+
unsigned int thisMask = _coalesced_group_data_access::get_mask(tile);
|
| 87 |
+
unsigned int subMask = __match_any_sync(thisMask, pred);
|
| 88 |
+
unsigned int laneId = details::laneid();
|
| 89 |
+
|
| 90 |
+
coalesced_group subTile = _coalesced_group_data_access::construct_from_mask<coalesced_group>(subMask);
|
| 91 |
+
|
| 92 |
+
int leaderLaneId = __ffs(subMask) - 1;
|
| 93 |
+
bool isLeader = leaderLaneId == laneId;
|
| 94 |
+
unsigned int leaderMask = __ballot_sync(thisMask, isLeader);
|
| 95 |
+
|
| 96 |
+
// Count leaders with lower laneid, that will be the meta rank of this tile
|
| 97 |
+
unsigned int tileRank = __popc(leaderMask & ((1 << leaderLaneId) - 1));
|
| 98 |
+
|
| 99 |
+
_coalesced_group_data_access::modify_meta_group(subTile, tileRank, __popc(leaderMask));
|
| 100 |
+
|
| 101 |
+
return subTile;
|
| 102 |
+
}
|
| 103 |
+
};
|
| 104 |
+
|
| 105 |
+
template <>
|
| 106 |
+
struct _labeled_partition_dispatch<bool> {
|
| 107 |
+
template <typename TyGroup>
|
| 108 |
+
_CG_QUALIFIER coalesced_group operator()(const TyGroup &tile, bool pred) {
|
| 109 |
+
return _binary_partition(tile, pred);
|
| 110 |
+
}
|
| 111 |
+
};
|
| 112 |
+
|
| 113 |
+
template <typename TyPredicate>
|
| 114 |
+
struct _labeled_partition_dispatch<TyPredicate*> {
|
| 115 |
+
template <typename TyGroup>
|
| 116 |
+
_CG_QUALIFIER coalesced_group operator()(const TyGroup &tile, TyPredicate* pred) {
|
| 117 |
+
auto impl = _labeled_partition_dispatch<unsigned long long>();
|
| 118 |
+
return impl(tile, reinterpret_cast<unsigned long long>(pred));
|
| 119 |
+
}
|
| 120 |
+
};
|
| 121 |
+
#endif
|
| 122 |
+
}; // namespace details
|
| 123 |
+
|
| 124 |
+
_CG_STATIC_QUALIFIER coalesced_group binary_partition(const coalesced_group &tile, bool pred) {
|
| 125 |
+
return details::_binary_partition(tile, pred);
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
template <unsigned int Size, typename ParentT>
|
| 129 |
+
_CG_STATIC_QUALIFIER coalesced_group binary_partition(const thread_block_tile<Size, ParentT> &tile, bool pred) {
|
| 130 |
+
#ifdef _CG_CPP11_FEATURES
|
| 131 |
+
static_assert(Size <= 32, "Binary partition is available only for tiles of size smaller or equal to 32");
|
| 132 |
+
#endif
|
| 133 |
+
return details::_binary_partition(tile, pred);
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
|
| 137 |
+
#if defined(_CG_HAS_MATCH_COLLECTIVE) && defined(_CG_CPP11_FEATURES)
|
| 138 |
+
template <typename TyPredicate>
|
| 139 |
+
_CG_STATIC_QUALIFIER coalesced_group labeled_partition(const coalesced_group &tile, TyPredicate pred) {
|
| 140 |
+
static_assert(_CG_STL_NAMESPACE::is_integral<TyPredicate>::value ||
|
| 141 |
+
_CG_STL_NAMESPACE::is_pointer<TyPredicate>::value,
|
| 142 |
+
"labeled_partition predicate must be an integral or pointer type");
|
| 143 |
+
auto dispatch = details::_labeled_partition_dispatch<details::remove_qual<TyPredicate>>();
|
| 144 |
+
return dispatch(tile, pred);
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
template <typename TyPredicate, unsigned int Size, typename ParentT>
|
| 148 |
+
_CG_STATIC_QUALIFIER coalesced_group labeled_partition(const thread_block_tile<Size, ParentT> &tile, TyPredicate pred) {
|
| 149 |
+
static_assert(_CG_STL_NAMESPACE::is_integral<TyPredicate>::value ||
|
| 150 |
+
_CG_STL_NAMESPACE::is_pointer<TyPredicate>::value,
|
| 151 |
+
"labeled_partition predicate must be an integral or pointer type");
|
| 152 |
+
static_assert(Size <= 32, "Labeled partition is available only for tiles of size smaller or equal to 32");
|
| 153 |
+
auto dispatch = details::_labeled_partition_dispatch<details::remove_qual<TyPredicate>>();
|
| 154 |
+
return dispatch(tile, pred);
|
| 155 |
+
}
|
| 156 |
+
#endif
|
| 157 |
+
|
| 158 |
+
_CG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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* Copyright 1993-2016 NVIDIA Corporation. All rights reserved.
|
| 2 |
+
*
|
| 3 |
+
* NOTICE TO LICENSEE:
|
| 4 |
+
*
|
| 5 |
+
* The source code and/or documentation ("Licensed Deliverables") are
|
| 6 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 7 |
+
* international Copyright laws.
|
| 8 |
+
*
|
| 9 |
+
* The Licensed Deliverables contained herein are PROPRIETARY and
|
| 10 |
+
* CONFIDENTIAL to NVIDIA and are being provided under the terms and
|
| 11 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 12 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 13 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 14 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 15 |
+
* of the Licensed Deliverables to any third party without the express
|
| 16 |
+
* written consent of NVIDIA is prohibited.
|
| 17 |
+
*
|
| 18 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 19 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 20 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. THEY ARE
|
| 21 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 22 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 23 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 24 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 25 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 26 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 27 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 28 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 29 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 30 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 31 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 32 |
+
*
|
| 33 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 34 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 35 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 36 |
+
* computer software documentation" as such terms are used in 48
|
| 37 |
+
* C.F.R. 12.212 (SEPT 1995) and are provided to the U.S. Government
|
| 38 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 39 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 40 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 41 |
+
* only those rights set forth herein.
|
| 42 |
+
*
|
| 43 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 44 |
+
* software must include, in the user documentation and internal
|
| 45 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 46 |
+
* Users Notice.
|
| 47 |
+
*/
|
| 48 |
+
|
| 49 |
+
#ifndef _CG_REDUCE_H_
|
| 50 |
+
#define _CG_REDUCE_H_
|
| 51 |
+
|
| 52 |
+
#include "info.h"
|
| 53 |
+
#include "helpers.h"
|
| 54 |
+
#include "coalesced_reduce.h"
|
| 55 |
+
#include "functional.h"
|
| 56 |
+
#include "cooperative_groups.h"
|
| 57 |
+
|
| 58 |
+
_CG_BEGIN_NAMESPACE
|
| 59 |
+
|
| 60 |
+
namespace details {
|
| 61 |
+
|
| 62 |
+
template <class Ty>
|
| 63 |
+
using _redux_is_add_supported = _CG_STL_NAMESPACE::integral_constant<
|
| 64 |
+
bool,
|
| 65 |
+
_CG_STL_NAMESPACE::is_integral<Ty>::value && (sizeof(Ty) <= 4)>;
|
| 66 |
+
|
| 67 |
+
template <class Ty>
|
| 68 |
+
using redux_is_add_supported = _redux_is_add_supported<Ty>;
|
| 69 |
+
|
| 70 |
+
// A specialization for 64 bit logical operations is possible
|
| 71 |
+
// but for now only accelerate 32 bit bitwise ops
|
| 72 |
+
template <class Ty>
|
| 73 |
+
using redux_is_logical_supported = redux_is_add_supported<Ty>;
|
| 74 |
+
|
| 75 |
+
// Base operator support case
|
| 76 |
+
template <class TyOp, class Ty> struct _redux_op_supported : public _CG_STL_NAMESPACE::false_type {};
|
| 77 |
+
template <class Ty> struct _redux_op_supported<cooperative_groups::plus<Ty>, Ty> : public redux_is_add_supported<Ty> {};
|
| 78 |
+
template <class Ty> struct _redux_op_supported<cooperative_groups::less<Ty>, Ty> : public redux_is_add_supported<Ty> {};
|
| 79 |
+
template <class Ty> struct _redux_op_supported<cooperative_groups::greater<Ty>, Ty> : public redux_is_add_supported<Ty> {};
|
| 80 |
+
template <class Ty> struct _redux_op_supported<cooperative_groups::bit_and<Ty>, Ty> : public redux_is_logical_supported<Ty> {};
|
| 81 |
+
template <class Ty> struct _redux_op_supported<cooperative_groups::bit_or<Ty>, Ty> : public redux_is_logical_supported<Ty> {};
|
| 82 |
+
template <class Ty> struct _redux_op_supported<cooperative_groups::bit_xor<Ty>, Ty> : public redux_is_logical_supported<Ty> {};
|
| 83 |
+
|
| 84 |
+
template <class Ty, template <class> class TyOp>
|
| 85 |
+
using redux_op_supported = _redux_op_supported<
|
| 86 |
+
typename details::remove_qual<TyOp<Ty>>,
|
| 87 |
+
Ty>;
|
| 88 |
+
|
| 89 |
+
// Groups smaller than 16 actually have worse performance characteristics when used with redux
|
| 90 |
+
// tiles of size 16 and 32 perform the same or better and have better code generation profiles
|
| 91 |
+
template <class TyGroup> struct _redux_group_optimized : public _CG_STL_NAMESPACE::false_type {};
|
| 92 |
+
|
| 93 |
+
template <unsigned int Sz, typename TyPar>
|
| 94 |
+
struct _redux_group_optimized<cooperative_groups::thread_block_tile<Sz, TyPar>> : public _CG_STL_NAMESPACE::integral_constant<
|
| 95 |
+
bool,
|
| 96 |
+
(Sz >= 16)> {};
|
| 97 |
+
template <unsigned int Sz, typename TyPar>
|
| 98 |
+
struct _redux_group_optimized<internal_thread_block_tile<Sz, TyPar>> : public _CG_STL_NAMESPACE::integral_constant<
|
| 99 |
+
bool,
|
| 100 |
+
(Sz >= 16)> {};
|
| 101 |
+
template <>
|
| 102 |
+
struct _redux_group_optimized<cooperative_groups::coalesced_group> : public _CG_STL_NAMESPACE::true_type {};
|
| 103 |
+
|
| 104 |
+
template <typename TyGroup>
|
| 105 |
+
using redux_group_optimized = _redux_group_optimized<details::remove_qual<TyGroup>>;
|
| 106 |
+
|
| 107 |
+
template <template <class> class TyOp>
|
| 108 |
+
_CG_STATIC_QUALIFIER int pick_redux(int mask, int val);
|
| 109 |
+
template <template <class> class TyOp>
|
| 110 |
+
_CG_STATIC_QUALIFIER unsigned int pick_redux(int mask, unsigned int val);
|
| 111 |
+
|
| 112 |
+
template <> _CG_QUALIFIER int pick_redux<cooperative_groups::plus>(int mask, int val) {
|
| 113 |
+
NV_IF_ELSE_TARGET(NV_PROVIDES_SM_80, (return __reduce_add_sync(mask, val);), return 0;)
|
| 114 |
+
}
|
| 115 |
+
template <> _CG_QUALIFIER int pick_redux<cooperative_groups::less>(int mask, int val) {
|
| 116 |
+
NV_IF_ELSE_TARGET(NV_PROVIDES_SM_80, (return __reduce_min_sync(mask, val);), return 0;)
|
| 117 |
+
}
|
| 118 |
+
template <> _CG_QUALIFIER int pick_redux<cooperative_groups::greater>(int mask, int val) {
|
| 119 |
+
NV_IF_ELSE_TARGET(NV_PROVIDES_SM_80, (return __reduce_max_sync(mask, val);), return 0;)
|
| 120 |
+
}
|
| 121 |
+
template <> _CG_QUALIFIER int pick_redux<cooperative_groups::bit_and>(int mask, int val) {
|
| 122 |
+
NV_IF_ELSE_TARGET(NV_PROVIDES_SM_80, (return static_cast<int>(__reduce_and_sync(mask, val));), return 0;)
|
| 123 |
+
}
|
| 124 |
+
template <> _CG_QUALIFIER int pick_redux<cooperative_groups::bit_xor>(int mask, int val) {
|
| 125 |
+
NV_IF_ELSE_TARGET(NV_PROVIDES_SM_80, (return static_cast<int>(__reduce_xor_sync(mask, val));), return 0;)
|
| 126 |
+
}
|
| 127 |
+
template <> _CG_QUALIFIER int pick_redux<cooperative_groups::bit_or>(int mask, int val) {
|
| 128 |
+
NV_IF_ELSE_TARGET(NV_PROVIDES_SM_80, (return static_cast<int>(__reduce_or_sync(mask, val));), return 0;)
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
template <> _CG_QUALIFIER unsigned int pick_redux<cooperative_groups::plus>(int mask, unsigned int val) {
|
| 132 |
+
NV_IF_ELSE_TARGET(NV_PROVIDES_SM_80, (return __reduce_add_sync(mask, val);), return 0;)
|
| 133 |
+
}
|
| 134 |
+
template <> _CG_QUALIFIER unsigned int pick_redux<cooperative_groups::less>(int mask, unsigned int val) {
|
| 135 |
+
NV_IF_ELSE_TARGET(NV_PROVIDES_SM_80, (return __reduce_min_sync(mask, val);), return 0;)
|
| 136 |
+
}
|
| 137 |
+
template <> _CG_QUALIFIER unsigned int pick_redux<cooperative_groups::greater>(int mask, unsigned int val) {
|
| 138 |
+
NV_IF_ELSE_TARGET(NV_PROVIDES_SM_80, (return __reduce_max_sync(mask, val);), return 0;)
|
| 139 |
+
}
|
| 140 |
+
template <> _CG_QUALIFIER unsigned int pick_redux<cooperative_groups::bit_and>(int mask, unsigned int val) {
|
| 141 |
+
NV_IF_ELSE_TARGET(NV_PROVIDES_SM_80, (return __reduce_and_sync(mask, val);), return 0;)
|
| 142 |
+
}
|
| 143 |
+
template <> _CG_QUALIFIER unsigned int pick_redux<cooperative_groups::bit_xor>(int mask, unsigned int val) {
|
| 144 |
+
NV_IF_ELSE_TARGET(NV_PROVIDES_SM_80, (return __reduce_xor_sync(mask, val);), return 0;)
|
| 145 |
+
}
|
| 146 |
+
template <> _CG_QUALIFIER unsigned int pick_redux<cooperative_groups::bit_or>(int mask, unsigned int val) {
|
| 147 |
+
NV_IF_ELSE_TARGET(NV_PROVIDES_SM_80, (return __reduce_or_sync(mask, val);), return 0;)
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
template <typename TyVal, bool = _CG_STL_NAMESPACE::is_unsigned<TyVal>::value>
|
| 151 |
+
struct _accelerated_op;
|
| 152 |
+
|
| 153 |
+
// Signed type redux intrinsic dispatch
|
| 154 |
+
template <typename TyVal>
|
| 155 |
+
struct _accelerated_op<TyVal, false> {
|
| 156 |
+
template <template <class> class TyOp>
|
| 157 |
+
_CG_STATIC_QUALIFIER TyVal redux(int mask, TyVal val) {
|
| 158 |
+
return static_cast<TyVal>(pick_redux<TyOp>(mask, static_cast<int>(val)));
|
| 159 |
+
}
|
| 160 |
+
};
|
| 161 |
+
|
| 162 |
+
// Unsigned type redux intrinsic dispatch
|
| 163 |
+
template <typename TyVal>
|
| 164 |
+
struct _accelerated_op<TyVal, true> {
|
| 165 |
+
template <template <class> class TyOp>
|
| 166 |
+
_CG_STATIC_QUALIFIER TyVal redux(int mask, TyVal val) {
|
| 167 |
+
return static_cast<TyVal>(pick_redux<TyOp>(mask, static_cast<unsigned int>(val)));
|
| 168 |
+
}
|
| 169 |
+
};
|
| 170 |
+
|
| 171 |
+
template <typename TyVal>
|
| 172 |
+
using accelerated_op = _accelerated_op<TyVal>;
|
| 173 |
+
|
| 174 |
+
|
| 175 |
+
template <typename TyVal, typename TyFnInput, typename TyGroup>
|
| 176 |
+
class _redux_dispatch {
|
| 177 |
+
template <class Ty, template <class> class TyOp>
|
| 178 |
+
using _redux_is_usable = _CG_STL_NAMESPACE::integral_constant<bool,
|
| 179 |
+
redux_op_supported<Ty, TyOp>::value &&
|
| 180 |
+
redux_group_optimized<TyGroup>::value>;
|
| 181 |
+
|
| 182 |
+
template <class Ty, template <class> class TyOp>
|
| 183 |
+
using redux_is_usable = typename _CG_STL_NAMESPACE::enable_if<_redux_is_usable<Ty, TyOp>::value, void>::type*;
|
| 184 |
+
|
| 185 |
+
template <class Ty, template <class> class TyOp>
|
| 186 |
+
using redux_is_not_usable = typename _CG_STL_NAMESPACE::enable_if<!_redux_is_usable<Ty, TyOp>::value, void>::type*;
|
| 187 |
+
|
| 188 |
+
public:
|
| 189 |
+
// Dispatch to redux if the combination of op and args are supported
|
| 190 |
+
template<
|
| 191 |
+
template <class> class TyOp,
|
| 192 |
+
redux_is_usable<TyFnInput, TyOp> = nullptr>
|
| 193 |
+
_CG_STATIC_QUALIFIER auto reduce(const TyGroup& group, TyVal&& val, TyOp<TyFnInput>&& op) -> decltype(op(val, val)) {
|
| 194 |
+
NV_IF_ELSE_TARGET(NV_PROVIDES_SM_80,
|
| 195 |
+
// Retrieve the mask for the group and dispatch to redux
|
| 196 |
+
return accelerated_op<TyFnInput>::template redux<TyOp>(_coalesced_group_data_access::get_mask(group), _CG_STL_NAMESPACE::forward<TyVal>(val));
|
| 197 |
+
,
|
| 198 |
+
// Arch does not support redux, fallback to shuffles
|
| 199 |
+
return coalesced_reduce(group, _CG_STL_NAMESPACE::forward<TyVal>(val), _CG_STL_NAMESPACE::forward<TyOp<TyFnInput>>(op));
|
| 200 |
+
)
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
template<
|
| 204 |
+
template <class> class TyOp,
|
| 205 |
+
redux_is_usable<TyFnInput, TyOp> = nullptr>
|
| 206 |
+
_CG_STATIC_QUALIFIER auto reduce(const TyGroup& group, TyVal&& val, TyOp<TyFnInput>& op) -> decltype(op(val, val)) {
|
| 207 |
+
NV_IF_ELSE_TARGET(NV_PROVIDES_SM_80,
|
| 208 |
+
// Retrieve the mask for the group and dispatch to redux
|
| 209 |
+
return accelerated_op<TyFnInput>::template redux<TyOp>(_coalesced_group_data_access::get_mask(group), _CG_STL_NAMESPACE::forward<TyVal>(val));
|
| 210 |
+
,
|
| 211 |
+
// Arch does not support redux, fallback to shuffles
|
| 212 |
+
return coalesced_reduce(group, _CG_STL_NAMESPACE::forward<TyVal>(val), _CG_STL_NAMESPACE::forward<TyOp<TyFnInput>>(op));
|
| 213 |
+
)
|
| 214 |
+
}
|
| 215 |
+
|
| 216 |
+
// Fallback shuffle sync reduction
|
| 217 |
+
template <
|
| 218 |
+
template <class> class TyOp,
|
| 219 |
+
redux_is_not_usable<TyFnInput, TyOp> = nullptr>
|
| 220 |
+
_CG_STATIC_QUALIFIER auto reduce(const TyGroup& group, TyVal&& val, TyOp<TyFnInput>&& op) -> decltype(op(val, val)) {
|
| 221 |
+
//Dispatch to fallback shuffle sync accelerated reduction
|
| 222 |
+
return coalesced_reduce(group, _CG_STL_NAMESPACE::forward<TyVal>(val), _CG_STL_NAMESPACE::forward<TyOp<TyFnInput>>(op));
|
| 223 |
+
}
|
| 224 |
+
|
| 225 |
+
};
|
| 226 |
+
|
| 227 |
+
// Group support for reduce.
|
| 228 |
+
template <class TyGroup> struct _reduce_group_supported : public _CG_STL_NAMESPACE::false_type {};
|
| 229 |
+
|
| 230 |
+
template <unsigned int Sz, typename TyPar>
|
| 231 |
+
struct _reduce_group_supported<cooperative_groups::thread_block_tile<Sz, TyPar>> : public _CG_STL_NAMESPACE::true_type {};
|
| 232 |
+
template <unsigned int Sz, typename TyPar>
|
| 233 |
+
struct _reduce_group_supported<internal_thread_block_tile<Sz, TyPar>> : public _CG_STL_NAMESPACE::true_type {};
|
| 234 |
+
template <>
|
| 235 |
+
struct _reduce_group_supported<cooperative_groups::coalesced_group> : public _CG_STL_NAMESPACE::true_type {};
|
| 236 |
+
|
| 237 |
+
template <typename TyGroup>
|
| 238 |
+
using reduce_group_supported = _reduce_group_supported<details::remove_qual<TyGroup>>;
|
| 239 |
+
|
| 240 |
+
template <typename TyVal, typename TyFnInput, template <class> class TyOp, typename TyGroup>
|
| 241 |
+
_CG_QUALIFIER auto reduce(const TyGroup& group, TyVal&& val, TyOp<TyFnInput>&& op) -> decltype(op(val, val)) {
|
| 242 |
+
static_assert(details::is_op_type_same<TyFnInput, TyVal>::value, "Operator and argument types differ");
|
| 243 |
+
|
| 244 |
+
using dispatch = details::_redux_dispatch<TyVal, TyFnInput, TyGroup>;
|
| 245 |
+
return dispatch::reduce(group, _CG_STL_NAMESPACE::forward<TyVal>(val), _CG_STL_NAMESPACE::forward<TyOp<TyFnInput>>(op));
|
| 246 |
+
}
|
| 247 |
+
|
| 248 |
+
template <typename TyVal, typename TyFnInput, template <class> class TyOp, typename TyGroup>
|
| 249 |
+
_CG_QUALIFIER auto reduce(const TyGroup& group, TyVal&& val, TyOp<TyFnInput>& op) -> decltype(op(val, val)) {
|
| 250 |
+
static_assert(details::is_op_type_same<TyFnInput, TyVal>::value, "Operator and argument types differ");
|
| 251 |
+
|
| 252 |
+
using dispatch = details::_redux_dispatch<TyVal, TyFnInput, TyGroup>;
|
| 253 |
+
return dispatch::reduce(group, _CG_STL_NAMESPACE::forward<TyVal>(val), _CG_STL_NAMESPACE::forward<TyOp<TyFnInput>>(op));
|
| 254 |
+
}
|
| 255 |
+
|
| 256 |
+
|
| 257 |
+
template <typename TyVal, typename TyOp, typename TyGroup>
|
| 258 |
+
_CG_QUALIFIER auto reduce(const TyGroup& group, TyVal&& val, TyOp&& op) -> decltype(op(val, val)) {
|
| 259 |
+
return details::coalesced_reduce(group, _CG_STL_NAMESPACE::forward<TyVal>(val), _CG_STL_NAMESPACE::forward<TyOp>(op));
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
template <unsigned int GroupId>
|
| 263 |
+
struct tile_reduce_dispatch;
|
| 264 |
+
|
| 265 |
+
template <>
|
| 266 |
+
struct tile_reduce_dispatch<details::coalesced_group_id> {
|
| 267 |
+
template <typename TyGroup, typename TyVal, typename TyFn>
|
| 268 |
+
_CG_STATIC_QUALIFIER auto reduce(const TyGroup& group, TyVal&& val, TyFn&& op) -> decltype(op(val, val)) {
|
| 269 |
+
return details::reduce(group, _CG_STL_NAMESPACE::forward<TyVal>(val), _CG_STL_NAMESPACE::forward<TyFn>(op));
|
| 270 |
+
}
|
| 271 |
+
};
|
| 272 |
+
|
| 273 |
+
#if defined(_CG_CPP11_FEATURES)
|
| 274 |
+
template <>
|
| 275 |
+
struct tile_reduce_dispatch<details::multi_tile_group_id> {
|
| 276 |
+
template <unsigned int Size, typename ParentT, typename TyVal, typename TyFn>
|
| 277 |
+
_CG_STATIC_QUALIFIER auto reduce(const thread_block_tile<Size, ParentT>& group, TyVal&& val, TyFn&& op) -> decltype(op(val, val)) {
|
| 278 |
+
using warpType = details::internal_thread_block_tile<32, __static_size_multi_warp_tile_base<Size>>;
|
| 279 |
+
using TyRet = details::remove_qual<TyVal>;
|
| 280 |
+
const unsigned int num_warps = Size / 32;
|
| 281 |
+
|
| 282 |
+
auto warp_lambda = [&] (const warpType& warp, TyRet* warp_scratch_location) {
|
| 283 |
+
*warp_scratch_location =
|
| 284 |
+
details::reduce(warp, _CG_STL_NAMESPACE::forward<TyVal>(val), op);
|
| 285 |
+
};
|
| 286 |
+
auto inter_warp_lambda =
|
| 287 |
+
[&] (const details::internal_thread_block_tile<num_warps, warpType>& subwarp, TyRet* thread_scratch_location) {
|
| 288 |
+
*thread_scratch_location =
|
| 289 |
+
details::reduce(subwarp, *thread_scratch_location, _CG_STL_NAMESPACE::forward<TyFn>(op));
|
| 290 |
+
};
|
| 291 |
+
return details::multi_warp_collectives_helper<TyRet>(group, warp_lambda, inter_warp_lambda);
|
| 292 |
+
}
|
| 293 |
+
};
|
| 294 |
+
|
| 295 |
+
template <unsigned int GroupId>
|
| 296 |
+
struct tile_async_reduce_dispatch;
|
| 297 |
+
|
| 298 |
+
template <>
|
| 299 |
+
struct tile_async_reduce_dispatch<details::coalesced_group_id> {
|
| 300 |
+
template <typename GroupT, typename TyDst, typename TyVal, typename TyFn, typename TyResHandler>
|
| 301 |
+
_CG_STATIC_QUALIFIER void reduce(const GroupT& group, TyDst& dst, TyVal&& val, TyFn&& op, TyResHandler& res_handler) {
|
| 302 |
+
// Do regular, in group reduction
|
| 303 |
+
auto result = details::reduce(group, _CG_STL_NAMESPACE::forward<TyVal>(val), op);
|
| 304 |
+
|
| 305 |
+
// One thread stores/updates the destination
|
| 306 |
+
if (group.thread_rank() == 0) {
|
| 307 |
+
res_handler(result);
|
| 308 |
+
}
|
| 309 |
+
}
|
| 310 |
+
};
|
| 311 |
+
|
| 312 |
+
template <>
|
| 313 |
+
struct tile_async_reduce_dispatch<details::multi_tile_group_id> {
|
| 314 |
+
template <unsigned int TySize, typename ParentT, typename TyDst, typename TyInputVal, typename TyFn, typename TyResHandler>
|
| 315 |
+
_CG_STATIC_QUALIFIER void reduce(const thread_block_tile<TySize, ParentT>& group, TyDst& dst, TyInputVal&& val, TyFn&& op, TyResHandler& res_handler) {
|
| 316 |
+
using TyVal = remove_qual<TyInputVal>;
|
| 317 |
+
const unsigned int num_warps = TySize / 32;
|
| 318 |
+
details::barrier_t* sync_location = multi_warp_sync_location_getter(group);
|
| 319 |
+
auto warp_scratch_location = multi_warp_scratch_location_getter<TyVal>(group, group.thread_rank() / 32);
|
| 320 |
+
|
| 321 |
+
// Do in warp reduce
|
| 322 |
+
auto warp = details::tiled_partition_internal<32, thread_block_tile<TySize, ParentT>>();
|
| 323 |
+
*warp_scratch_location = details::reduce(warp, _CG_STL_NAMESPACE::forward<TyInputVal>(val), op);
|
| 324 |
+
|
| 325 |
+
// Tile of size num_warps from the last warp to arrive does final reduction step
|
| 326 |
+
if (details::sync_warps_last_releases(sync_location, details::cta::thread_rank(), num_warps)) {
|
| 327 |
+
auto subwarp = details::tiled_partition_internal<num_warps, decltype(warp)>();
|
| 328 |
+
if (subwarp.meta_group_rank() == 0) {
|
| 329 |
+
auto thread_scratch_location = multi_warp_scratch_location_getter<TyVal>(group, subwarp.thread_rank());
|
| 330 |
+
auto thread_val = *thread_scratch_location;
|
| 331 |
+
// Release other warps, we read their contribution already.
|
| 332 |
+
subwarp.sync();
|
| 333 |
+
details::sync_warps_release(sync_location, subwarp.thread_rank() == 0, details::cta::thread_rank(), num_warps);
|
| 334 |
+
TyVal result = details::reduce(subwarp, thread_val, op);
|
| 335 |
+
// One thread stores the result or updates the atomic
|
| 336 |
+
if (subwarp.thread_rank() == 0) {
|
| 337 |
+
res_handler(result);
|
| 338 |
+
}
|
| 339 |
+
}
|
| 340 |
+
warp.sync();
|
| 341 |
+
}
|
| 342 |
+
}
|
| 343 |
+
};
|
| 344 |
+
#endif
|
| 345 |
+
|
| 346 |
+
template <typename TyGroup, typename TyInputVal, typename TyRetVal>
|
| 347 |
+
_CG_QUALIFIER void check_reduce_params() {
|
| 348 |
+
static_assert(details::is_op_type_same<TyInputVal, TyRetVal>::value, "Operator input and output types differ");
|
| 349 |
+
static_assert(details::reduce_group_supported<TyGroup>::value, "This group does not exclusively represent a tile");
|
| 350 |
+
};
|
| 351 |
+
|
| 352 |
+
template <typename TyGroup, typename TyDstVal, typename TyInputVal, typename TyRetVal>
|
| 353 |
+
_CG_QUALIFIER void check_async_reduce_params() {
|
| 354 |
+
check_reduce_params<TyGroup, TyInputVal, TyRetVal>();
|
| 355 |
+
static_assert(details::is_op_type_same<TyDstVal, TyInputVal>::value, "Destination and input types differ");
|
| 356 |
+
}
|
| 357 |
+
} // details
|
| 358 |
+
|
| 359 |
+
template <typename TyGroup, typename TyVal, typename TyFn>
|
| 360 |
+
_CG_QUALIFIER auto reduce(const TyGroup& group, TyVal&& val, TyFn&& op) -> decltype(op(val, val)) {
|
| 361 |
+
details::check_reduce_params<TyGroup, details::remove_qual<TyVal>, decltype(op(val, val))>();
|
| 362 |
+
|
| 363 |
+
using dispatch = details::tile_reduce_dispatch<TyGroup::_group_id>;
|
| 364 |
+
return dispatch::reduce(group, _CG_STL_NAMESPACE::forward<TyVal>(val), _CG_STL_NAMESPACE::forward<TyFn>(op));
|
| 365 |
+
}
|
| 366 |
+
|
| 367 |
+
#if defined(_CG_CPP11_FEATURES)
|
| 368 |
+
|
| 369 |
+
# if defined(_CG_HAS_STL_ATOMICS)
|
| 370 |
+
template<typename TyGroup, typename TyVal, cuda::thread_scope Sco, typename TyInputVal, typename TyFn>
|
| 371 |
+
void _CG_QUALIFIER reduce_update_async(const TyGroup& group, cuda::atomic<TyVal, Sco>& dst, TyInputVal&& val, TyFn&& op) {
|
| 372 |
+
details::check_async_reduce_params<TyGroup, TyVal, details::remove_qual<TyInputVal>, decltype(op(val, val))>();
|
| 373 |
+
auto update_lambda = [&] (TyVal& result) {
|
| 374 |
+
details::atomic_update(dst, result, op);
|
| 375 |
+
};
|
| 376 |
+
using dispatch = details::tile_async_reduce_dispatch<TyGroup::_group_id>;
|
| 377 |
+
dispatch::reduce(group, dst, _CG_STL_NAMESPACE::forward<TyInputVal>(val), _CG_STL_NAMESPACE::forward<TyFn>(op), update_lambda);
|
| 378 |
+
}
|
| 379 |
+
|
| 380 |
+
template<typename TyGroup, typename TyVal, cuda::thread_scope Sco, typename TyInputVal, typename TyFn>
|
| 381 |
+
void _CG_QUALIFIER reduce_update_async(const TyGroup& group, const cuda::atomic_ref<TyVal, Sco>& dst, TyInputVal&& val, TyFn&& op) {
|
| 382 |
+
details::check_async_reduce_params<TyGroup, TyVal, details::remove_qual<TyInputVal>, decltype(op(val, val))>();
|
| 383 |
+
auto update_lambda = [&] (TyVal& result) {
|
| 384 |
+
details::atomic_update(dst, result, op);
|
| 385 |
+
};
|
| 386 |
+
using dispatch = details::tile_async_reduce_dispatch<TyGroup::_group_id>;
|
| 387 |
+
dispatch::reduce(group, dst, _CG_STL_NAMESPACE::forward<TyInputVal>(val), _CG_STL_NAMESPACE::forward<TyFn>(op), update_lambda);
|
| 388 |
+
}
|
| 389 |
+
|
| 390 |
+
template<typename TyGroup, typename TyVal, cuda::thread_scope Sco, typename TyInputVal, typename TyFn>
|
| 391 |
+
void _CG_QUALIFIER reduce_store_async(const TyGroup& group, cuda::atomic<TyVal, Sco>& dst, TyInputVal&& val, TyFn&& op) {
|
| 392 |
+
details::check_async_reduce_params<TyGroup, TyVal, details::remove_qual<TyInputVal>, decltype(op(val, val))>();
|
| 393 |
+
auto store_lambda = [&] (TyVal& result) {
|
| 394 |
+
details::atomic_store(dst, result);
|
| 395 |
+
};
|
| 396 |
+
using dispatch = details::tile_async_reduce_dispatch<TyGroup::_group_id>;
|
| 397 |
+
dispatch::reduce(group, dst, _CG_STL_NAMESPACE::forward<TyInputVal>(val), _CG_STL_NAMESPACE::forward<TyFn>(op), store_lambda);
|
| 398 |
+
}
|
| 399 |
+
|
| 400 |
+
template<typename TyGroup, typename TyVal, cuda::thread_scope Sco, typename TyInputVal, typename TyFn>
|
| 401 |
+
void _CG_QUALIFIER reduce_store_async(const TyGroup& group, const cuda::atomic_ref<TyVal, Sco>& dst, TyInputVal&& val, TyFn&& op) {
|
| 402 |
+
details::check_async_reduce_params<TyGroup, TyVal, details::remove_qual<TyInputVal>, decltype(op(val, val))>();
|
| 403 |
+
auto store_lambda = [&] (TyVal& result) {
|
| 404 |
+
details::atomic_store(dst, result);
|
| 405 |
+
};
|
| 406 |
+
using dispatch = details::tile_async_reduce_dispatch<TyGroup::_group_id>;
|
| 407 |
+
dispatch::reduce(group, dst, _CG_STL_NAMESPACE::forward<TyInputVal>(val), _CG_STL_NAMESPACE::forward<TyFn>(op), store_lambda);
|
| 408 |
+
}
|
| 409 |
+
# endif
|
| 410 |
+
|
| 411 |
+
template<typename TyGroup, typename TyVal, typename TyInputVal, typename TyFn>
|
| 412 |
+
void _CG_QUALIFIER reduce_store_async(const TyGroup& group, TyVal* dst, TyInputVal&& val, TyFn&& op) {
|
| 413 |
+
details::check_async_reduce_params<TyGroup, TyVal, details::remove_qual<TyInputVal>, decltype(op(val, val))>();
|
| 414 |
+
auto store_lambda = [&] (TyVal& result) {
|
| 415 |
+
*dst = result;
|
| 416 |
+
};
|
| 417 |
+
using dispatch = details::tile_async_reduce_dispatch<TyGroup::_group_id>;
|
| 418 |
+
dispatch::reduce(group, dst, _CG_STL_NAMESPACE::forward<TyInputVal>(val), _CG_STL_NAMESPACE::forward<TyFn>(op), store_lambda);
|
| 419 |
+
}
|
| 420 |
+
#endif
|
| 421 |
+
|
| 422 |
+
_CG_END_NAMESPACE
|
| 423 |
+
|
| 424 |
+
#endif // _CG_REDUCE_H_
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/details/scan.h
ADDED
|
@@ -0,0 +1,320 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* Copyright 1993-2016 NVIDIA Corporation. All rights reserved.
|
| 2 |
+
*
|
| 3 |
+
* NOTICE TO LICENSEE:
|
| 4 |
+
*
|
| 5 |
+
* The source code and/or documentation ("Licensed Deliverables") are
|
| 6 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 7 |
+
* international Copyright laws.
|
| 8 |
+
*
|
| 9 |
+
* The Licensed Deliverables contained herein are PROPRIETARY and
|
| 10 |
+
* CONFIDENTIAL to NVIDIA and are being provided under the terms and
|
| 11 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 12 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 13 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 14 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 15 |
+
* of the Licensed Deliverables to any third party without the express
|
| 16 |
+
* written consent of NVIDIA is prohibited.
|
| 17 |
+
*
|
| 18 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 19 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 20 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. THEY ARE
|
| 21 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 22 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 23 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 24 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 25 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 26 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 27 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 28 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 29 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 30 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 31 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 32 |
+
*
|
| 33 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 34 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 35 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 36 |
+
* computer software documentation" as such terms are used in 48
|
| 37 |
+
* C.F.R. 12.212 (SEPT 1995) and are provided to the U.S. Government
|
| 38 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 39 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 40 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 41 |
+
* only those rights set forth herein.
|
| 42 |
+
*
|
| 43 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 44 |
+
* software must include, in the user documentation and internal
|
| 45 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 46 |
+
* Users Notice.
|
| 47 |
+
*/
|
| 48 |
+
|
| 49 |
+
#ifndef _CG_SCAN_H_
|
| 50 |
+
#define _CG_SCAN_H_
|
| 51 |
+
|
| 52 |
+
#include "info.h"
|
| 53 |
+
#include "helpers.h"
|
| 54 |
+
#include "functional.h"
|
| 55 |
+
#include "coalesced_scan.h"
|
| 56 |
+
|
| 57 |
+
_CG_BEGIN_NAMESPACE
|
| 58 |
+
|
| 59 |
+
namespace details {
|
| 60 |
+
|
| 61 |
+
// Group support for scan.
|
| 62 |
+
template <class TyGroup> struct _scan_group_supported : public _CG_STL_NAMESPACE::false_type {};
|
| 63 |
+
|
| 64 |
+
template <unsigned int Sz, typename TyPar>
|
| 65 |
+
struct _scan_group_supported<cooperative_groups::thread_block_tile<Sz, TyPar>> : public _CG_STL_NAMESPACE::true_type {};
|
| 66 |
+
template <unsigned int Sz, typename TyPar>
|
| 67 |
+
struct _scan_group_supported<internal_thread_block_tile<Sz, TyPar>> : public _CG_STL_NAMESPACE::true_type {};
|
| 68 |
+
template <>
|
| 69 |
+
struct _scan_group_supported<cooperative_groups::coalesced_group> : public _CG_STL_NAMESPACE::true_type {};
|
| 70 |
+
|
| 71 |
+
template <typename TyGroup>
|
| 72 |
+
using scan_group_supported = _scan_group_supported<details::remove_qual<TyGroup>>;
|
| 73 |
+
|
| 74 |
+
template <bool IsIntegralPlus>
|
| 75 |
+
struct integral_optimized_scan;
|
| 76 |
+
|
| 77 |
+
enum class ScanType { exclusive, inclusive };
|
| 78 |
+
|
| 79 |
+
template <unsigned int GroupId, ScanType TyScan>
|
| 80 |
+
struct scan_dispatch;
|
| 81 |
+
|
| 82 |
+
template <ScanType TyScan>
|
| 83 |
+
struct scan_dispatch<details::coalesced_group_id, TyScan> {
|
| 84 |
+
template <typename TyGroup, typename TyVal, typename TyFn>
|
| 85 |
+
_CG_STATIC_QUALIFIER auto scan(const TyGroup& group, TyVal&& val, TyFn&& op) -> decltype(op(val, val)) {
|
| 86 |
+
auto scan_result = coalesced_inclusive_scan(group, val, op);
|
| 87 |
+
if (TyScan == ScanType::exclusive) {
|
| 88 |
+
scan_result = convert_inclusive_to_exclusive(group,
|
| 89 |
+
scan_result,
|
| 90 |
+
_CG_STL_NAMESPACE::forward<TyVal>(val),
|
| 91 |
+
_CG_STL_NAMESPACE::forward<TyFn>(op));
|
| 92 |
+
}
|
| 93 |
+
return scan_result;
|
| 94 |
+
}
|
| 95 |
+
};
|
| 96 |
+
|
| 97 |
+
#if defined(_CG_CPP11_FEATURES)
|
| 98 |
+
template <ScanType TyScan>
|
| 99 |
+
struct scan_dispatch<details::multi_tile_group_id, TyScan> {
|
| 100 |
+
template <unsigned int Size, typename ParentT, typename TyVal, typename TyFn>
|
| 101 |
+
_CG_STATIC_QUALIFIER auto scan(const thread_block_tile<Size, ParentT>& group, TyVal&& val, TyFn&& op) -> decltype(op(val, val)) {
|
| 102 |
+
using warpType = details::internal_thread_block_tile<32, __static_size_multi_warp_tile_base<Size>>;
|
| 103 |
+
using TyRet = details::remove_qual<TyVal>;
|
| 104 |
+
const unsigned int num_warps = Size / 32;
|
| 105 |
+
// In warp scan result, calculated in warp_lambda
|
| 106 |
+
TyRet warp_scan;
|
| 107 |
+
|
| 108 |
+
// In warp scan, put sum in the warp_scratch_location
|
| 109 |
+
auto warp_lambda = [&] (const warpType& warp, TyRet* warp_scratch_location) {
|
| 110 |
+
warp_scan =
|
| 111 |
+
details::coalesced_inclusive_scan(warp, _CG_STL_NAMESPACE::forward<TyVal>(val), op);
|
| 112 |
+
if (warp.thread_rank() + 1 == warp.size()) {
|
| 113 |
+
*warp_scratch_location = warp_scan;
|
| 114 |
+
}
|
| 115 |
+
if (TyScan == ScanType::exclusive) {
|
| 116 |
+
warp_scan = warp.shfl_up(warp_scan, 1);
|
| 117 |
+
}
|
| 118 |
+
};
|
| 119 |
+
|
| 120 |
+
// Tile of size num_warps performing the final scan part (exclusive scan of warp sums), other threads will add it
|
| 121 |
+
// to its in-warp scan result
|
| 122 |
+
auto inter_warp_lambda =
|
| 123 |
+
[&] (const details::internal_thread_block_tile<num_warps, warpType>& subwarp, TyRet* thread_scratch_location) {
|
| 124 |
+
auto thread_val = *thread_scratch_location;
|
| 125 |
+
auto result = coalesced_inclusive_scan(subwarp, thread_val, op);
|
| 126 |
+
*thread_scratch_location = convert_inclusive_to_exclusive(subwarp, result, thread_val, op);
|
| 127 |
+
};
|
| 128 |
+
|
| 129 |
+
TyRet previous_warps_sum = details::multi_warp_collectives_helper<TyRet>(group, warp_lambda, inter_warp_lambda);
|
| 130 |
+
if (TyScan == ScanType::exclusive && warpType::thread_rank() == 0) {
|
| 131 |
+
return previous_warps_sum;
|
| 132 |
+
}
|
| 133 |
+
if (warpType::meta_group_rank() == 0) {
|
| 134 |
+
return warp_scan;
|
| 135 |
+
}
|
| 136 |
+
else {
|
| 137 |
+
return op(warp_scan, previous_warps_sum);
|
| 138 |
+
}
|
| 139 |
+
}
|
| 140 |
+
};
|
| 141 |
+
|
| 142 |
+
#if defined(_CG_HAS_STL_ATOMICS)
|
| 143 |
+
template <unsigned int GroupId, ScanType TyScan>
|
| 144 |
+
struct scan_update_dispatch;
|
| 145 |
+
|
| 146 |
+
template <ScanType TyScan>
|
| 147 |
+
struct scan_update_dispatch<details::coalesced_group_id, TyScan> {
|
| 148 |
+
template <typename TyGroup, typename TyAtomic, typename TyVal, typename TyFn>
|
| 149 |
+
_CG_STATIC_QUALIFIER auto scan(const TyGroup& group, TyAtomic& dst, TyVal&& val, TyFn&& op) -> decltype(op(val, val)) {
|
| 150 |
+
details::remove_qual<TyVal> old;
|
| 151 |
+
|
| 152 |
+
// Do regular in group scan
|
| 153 |
+
auto scan_result = details::coalesced_inclusive_scan(group, val, op);
|
| 154 |
+
|
| 155 |
+
// Last thread updates the atomic and distributes its old value to other threads
|
| 156 |
+
if (group.thread_rank() == group.size() - 1) {
|
| 157 |
+
old = atomic_update(dst, scan_result, _CG_STL_NAMESPACE::forward<TyFn>(op));
|
| 158 |
+
}
|
| 159 |
+
old = group.shfl(old, group.size() - 1);
|
| 160 |
+
if (TyScan == ScanType::exclusive) {
|
| 161 |
+
scan_result = convert_inclusive_to_exclusive(group, scan_result, _CG_STL_NAMESPACE::forward<TyVal>(val), op);
|
| 162 |
+
}
|
| 163 |
+
scan_result = op(old, scan_result);
|
| 164 |
+
return scan_result;
|
| 165 |
+
}
|
| 166 |
+
};
|
| 167 |
+
|
| 168 |
+
template <ScanType TyScan>
|
| 169 |
+
struct scan_update_dispatch<details::multi_tile_group_id, TyScan> {
|
| 170 |
+
template <unsigned int Size, typename ParentT, typename TyAtomic, typename TyVal, typename TyFn>
|
| 171 |
+
_CG_STATIC_QUALIFIER auto scan(const thread_block_tile<Size, ParentT>& group, TyAtomic& dst, TyVal&& val, TyFn&& op) -> decltype(op(val, val)) {
|
| 172 |
+
using warpType = details::internal_thread_block_tile<32, __static_size_multi_warp_tile_base<Size>>;
|
| 173 |
+
using TyRet = details::remove_qual<TyVal>;
|
| 174 |
+
const unsigned int num_warps = Size / 32;
|
| 175 |
+
// In warp scan result, calculated in warp_lambda
|
| 176 |
+
TyRet warp_scan;
|
| 177 |
+
|
| 178 |
+
// In warp scan, put sum in the warp_scratch_location
|
| 179 |
+
auto warp_lambda = [&] (const warpType& warp, TyRet* warp_scratch_location) {
|
| 180 |
+
warp_scan =
|
| 181 |
+
details::coalesced_inclusive_scan(warp, _CG_STL_NAMESPACE::forward<TyVal>(val), op);
|
| 182 |
+
if (warp.thread_rank() + 1 == warp.size()) {
|
| 183 |
+
*warp_scratch_location = warp_scan;
|
| 184 |
+
}
|
| 185 |
+
if (TyScan == ScanType::exclusive) {
|
| 186 |
+
warp_scan = warp.shfl_up(warp_scan, 1);
|
| 187 |
+
}
|
| 188 |
+
};
|
| 189 |
+
|
| 190 |
+
// Tile of size num_warps performing the final scan part (exclusive scan of warp sums), other threads will add it
|
| 191 |
+
// to its in-warp scan result
|
| 192 |
+
auto inter_warp_lambda =
|
| 193 |
+
[&] (const details::internal_thread_block_tile<num_warps, warpType>& subwarp, TyRet* thread_scratch_location) {
|
| 194 |
+
auto thread_val = *thread_scratch_location;
|
| 195 |
+
auto scan_result = details::coalesced_inclusive_scan(subwarp, thread_val, op);
|
| 196 |
+
TyRet offset;
|
| 197 |
+
// Single thread does the atomic update with sum of all contributions and reads the old value.
|
| 198 |
+
if (subwarp.thread_rank() == subwarp.size() - 1) {
|
| 199 |
+
offset = details::atomic_update(dst, scan_result, op);
|
| 200 |
+
}
|
| 201 |
+
offset = subwarp.shfl(offset, subwarp.size() - 1);
|
| 202 |
+
scan_result = convert_inclusive_to_exclusive(subwarp, scan_result, thread_val, op);
|
| 203 |
+
// Add offset read from the atomic to the scanned warp sum.
|
| 204 |
+
// Skipping first thread, since it got defautly constructed value from the conversion,
|
| 205 |
+
// it should just return the offset received from the thread that did the atomic update.
|
| 206 |
+
if (subwarp.thread_rank() != 0) {
|
| 207 |
+
offset = op(scan_result, offset);
|
| 208 |
+
}
|
| 209 |
+
*thread_scratch_location = offset;
|
| 210 |
+
};
|
| 211 |
+
|
| 212 |
+
TyRet previous_warps_sum = details::multi_warp_collectives_helper<TyRet>(group, warp_lambda, inter_warp_lambda);
|
| 213 |
+
if (TyScan == ScanType::exclusive && warpType::thread_rank() == 0) {
|
| 214 |
+
return previous_warps_sum;
|
| 215 |
+
}
|
| 216 |
+
return op(warp_scan, previous_warps_sum);
|
| 217 |
+
}
|
| 218 |
+
};
|
| 219 |
+
#endif
|
| 220 |
+
#endif
|
| 221 |
+
|
| 222 |
+
template <typename TyGroup, typename TyInputVal, typename TyRetVal>
|
| 223 |
+
_CG_QUALIFIER void check_scan_params() {
|
| 224 |
+
static_assert(details::is_op_type_same<TyInputVal, TyRetVal>::value, "Operator input and output types differ");
|
| 225 |
+
static_assert(details::scan_group_supported<TyGroup>::value, "This group does not exclusively represent a tile");
|
| 226 |
+
}
|
| 227 |
+
|
| 228 |
+
#if defined(_CG_HAS_STL_ATOMICS)
|
| 229 |
+
template <typename TyGroup, typename TyDstVal, typename TyInputVal, typename TyRetVal>
|
| 230 |
+
_CG_QUALIFIER void check_scan_update_params() {
|
| 231 |
+
check_scan_params<TyGroup, TyInputVal, TyRetVal>();
|
| 232 |
+
static_assert(details::is_op_type_same<TyDstVal, TyInputVal>::value, "Destination and input types differ");
|
| 233 |
+
}
|
| 234 |
+
#endif
|
| 235 |
+
|
| 236 |
+
} // details
|
| 237 |
+
|
| 238 |
+
template <typename TyGroup, typename TyVal, typename TyFn>
|
| 239 |
+
_CG_QUALIFIER auto inclusive_scan(const TyGroup& group, TyVal&& val, TyFn&& op) -> decltype(op(val, val)) {
|
| 240 |
+
details::check_scan_params<TyGroup, TyVal, decltype(op(val, val))>();
|
| 241 |
+
|
| 242 |
+
using dispatch = details::scan_dispatch<TyGroup::_group_id, details::ScanType::inclusive>;
|
| 243 |
+
return dispatch::scan(group, _CG_STL_NAMESPACE::forward<TyVal>(val), _CG_STL_NAMESPACE::forward<TyFn>(op));
|
| 244 |
+
}
|
| 245 |
+
|
| 246 |
+
template <typename TyGroup, typename TyVal>
|
| 247 |
+
_CG_QUALIFIER details::remove_qual<TyVal> inclusive_scan(const TyGroup& group, TyVal&& val) {
|
| 248 |
+
return inclusive_scan(group, _CG_STL_NAMESPACE::forward<TyVal>(val), cooperative_groups::plus<details::remove_qual<TyVal>>());
|
| 249 |
+
}
|
| 250 |
+
|
| 251 |
+
template <typename TyGroup, typename TyVal, typename TyFn>
|
| 252 |
+
_CG_QUALIFIER auto exclusive_scan(const TyGroup& group, TyVal&& val, TyFn&& op) -> decltype(op(val, val)) {
|
| 253 |
+
details::check_scan_params<TyGroup, TyVal, decltype(op(val, val))>();
|
| 254 |
+
|
| 255 |
+
using dispatch = details::scan_dispatch<TyGroup::_group_id, details::ScanType::exclusive>;
|
| 256 |
+
return dispatch::scan(group, _CG_STL_NAMESPACE::forward<TyVal>(val), _CG_STL_NAMESPACE::forward<TyFn>(op));
|
| 257 |
+
}
|
| 258 |
+
|
| 259 |
+
template <typename TyGroup, typename TyVal>
|
| 260 |
+
_CG_QUALIFIER details::remove_qual<TyVal> exclusive_scan(const TyGroup& group, TyVal&& val) {
|
| 261 |
+
return exclusive_scan(group, _CG_STL_NAMESPACE::forward<TyVal>(val), cooperative_groups::plus<details::remove_qual<TyVal>>());
|
| 262 |
+
}
|
| 263 |
+
|
| 264 |
+
#if defined(_CG_HAS_STL_ATOMICS)
|
| 265 |
+
template<typename TyGroup, typename TyVal, typename TyInputVal, cuda::thread_scope Sco, typename TyFn>
|
| 266 |
+
_CG_QUALIFIER auto inclusive_scan_update(const TyGroup& group, cuda::atomic<TyVal, Sco>& dst, TyInputVal&& val, TyFn&& op) -> decltype(op(val, val)) {
|
| 267 |
+
details::check_scan_update_params<TyGroup, TyVal, details::remove_qual<TyInputVal>, decltype(op(val, val))>();
|
| 268 |
+
|
| 269 |
+
using dispatch = details::scan_update_dispatch<TyGroup::_group_id, details::ScanType::inclusive>;
|
| 270 |
+
return dispatch::scan(group, dst, _CG_STL_NAMESPACE::forward<TyInputVal>(val), _CG_STL_NAMESPACE::forward<TyFn>(op));
|
| 271 |
+
}
|
| 272 |
+
|
| 273 |
+
template<typename TyGroup, typename TyVal, typename TyInputVal, cuda::thread_scope Sco>
|
| 274 |
+
_CG_QUALIFIER TyVal inclusive_scan_update(const TyGroup& group, cuda::atomic<TyVal, Sco> & dst, TyInputVal&& val) {
|
| 275 |
+
return inclusive_scan_update(group, dst, _CG_STL_NAMESPACE::forward<TyInputVal>(val), cooperative_groups::plus<TyVal>());
|
| 276 |
+
}
|
| 277 |
+
|
| 278 |
+
template<typename TyGroup, typename TyVal, typename TyInputVal, cuda::thread_scope Sco, typename TyFn>
|
| 279 |
+
_CG_QUALIFIER auto exclusive_scan_update(const TyGroup& group, cuda::atomic<TyVal, Sco>& dst, TyInputVal&& val, TyFn&& op) -> decltype(op(val, val)) {
|
| 280 |
+
details::check_scan_update_params<TyGroup, TyVal, details::remove_qual<TyInputVal>, decltype(op(val, val))>();
|
| 281 |
+
|
| 282 |
+
using dispatch = details::scan_update_dispatch<TyGroup::_group_id, details::ScanType::exclusive>;
|
| 283 |
+
return dispatch::scan(group, dst, _CG_STL_NAMESPACE::forward<TyInputVal>(val), _CG_STL_NAMESPACE::forward<TyFn>(op));
|
| 284 |
+
}
|
| 285 |
+
|
| 286 |
+
template<typename TyGroup, typename TyVal, typename TyInputVal, cuda::thread_scope Sco>
|
| 287 |
+
_CG_QUALIFIER TyVal exclusive_scan_update(const TyGroup& group, cuda::atomic<TyVal, Sco>& dst, TyInputVal&& val) {
|
| 288 |
+
return exclusive_scan_update(group, dst, _CG_STL_NAMESPACE::forward<TyInputVal>(val), cooperative_groups::plus<TyVal>());
|
| 289 |
+
}
|
| 290 |
+
|
| 291 |
+
template<typename TyGroup, typename TyVal, typename TyInputVal, cuda::thread_scope Sco, typename TyFn>
|
| 292 |
+
_CG_QUALIFIER auto inclusive_scan_update(const TyGroup& group, const cuda::atomic_ref<TyVal, Sco>& dst, TyInputVal&& val, TyFn&& op) -> decltype(op(val, val)) {
|
| 293 |
+
details::check_scan_update_params<TyGroup, TyVal, details::remove_qual<TyInputVal>, decltype(op(val, val))>();
|
| 294 |
+
|
| 295 |
+
using dispatch = details::scan_update_dispatch<TyGroup::_group_id, details::ScanType::inclusive>;
|
| 296 |
+
return dispatch::scan(group, dst, _CG_STL_NAMESPACE::forward<TyInputVal>(val), _CG_STL_NAMESPACE::forward<TyFn>(op));
|
| 297 |
+
}
|
| 298 |
+
|
| 299 |
+
template<typename TyGroup, typename TyVal, typename TyInputVal, cuda::thread_scope Sco>
|
| 300 |
+
_CG_QUALIFIER TyVal inclusive_scan_update(const TyGroup& group, const cuda::atomic_ref<TyVal, Sco> & dst, TyInputVal&& val) {
|
| 301 |
+
return inclusive_scan_update(group, dst, _CG_STL_NAMESPACE::forward<TyInputVal>(val), cooperative_groups::plus<TyVal>());
|
| 302 |
+
}
|
| 303 |
+
|
| 304 |
+
template<typename TyGroup, typename TyVal, typename TyInputVal, cuda::thread_scope Sco, typename TyFn>
|
| 305 |
+
_CG_QUALIFIER auto exclusive_scan_update(const TyGroup& group, const cuda::atomic_ref<TyVal, Sco>& dst, TyInputVal&& val, TyFn&& op) -> decltype(op(val, val)) {
|
| 306 |
+
details::check_scan_update_params<TyGroup, TyVal, details::remove_qual<TyInputVal>, decltype(op(val, val))>();
|
| 307 |
+
|
| 308 |
+
using dispatch = details::scan_update_dispatch<TyGroup::_group_id, details::ScanType::exclusive>;
|
| 309 |
+
return dispatch::scan(group, dst, _CG_STL_NAMESPACE::forward<TyInputVal>(val), _CG_STL_NAMESPACE::forward<TyFn>(op));
|
| 310 |
+
}
|
| 311 |
+
|
| 312 |
+
template<typename TyGroup, typename TyVal, typename TyInputVal, cuda::thread_scope Sco>
|
| 313 |
+
_CG_QUALIFIER TyVal exclusive_scan_update(const TyGroup& group, const cuda::atomic_ref<TyVal, Sco>& dst, TyInputVal&& val) {
|
| 314 |
+
return exclusive_scan_update(group, dst, _CG_STL_NAMESPACE::forward<TyInputVal>(val), cooperative_groups::plus<TyVal>());
|
| 315 |
+
}
|
| 316 |
+
#endif
|
| 317 |
+
|
| 318 |
+
_CG_END_NAMESPACE
|
| 319 |
+
|
| 320 |
+
#endif // _CG_SCAN_H_
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/details/sync.h
ADDED
|
@@ -0,0 +1,281 @@
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* Copyright 1993-2016 NVIDIA Corporation. All rights reserved.
|
| 2 |
+
*
|
| 3 |
+
* NOTICE TO LICENSEE:
|
| 4 |
+
*
|
| 5 |
+
* The source code and/or documentation ("Licensed Deliverables") are
|
| 6 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 7 |
+
* international Copyright laws.
|
| 8 |
+
*
|
| 9 |
+
* The Licensed Deliverables contained herein are PROPRIETARY and
|
| 10 |
+
* CONFIDENTIAL to NVIDIA and are being provided under the terms and
|
| 11 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 12 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 13 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 14 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 15 |
+
* of the Licensed Deliverables to any third party without the express
|
| 16 |
+
* written consent of NVIDIA is prohibited.
|
| 17 |
+
*
|
| 18 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 19 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 20 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. THEY ARE
|
| 21 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 22 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 23 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 24 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 25 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 26 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 27 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 28 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 29 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 30 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 31 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 32 |
+
*
|
| 33 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 34 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 35 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 36 |
+
* computer software documentation" as such terms are used in 48
|
| 37 |
+
* C.F.R. 12.212 (SEPT 1995) and are provided to the U.S. Government
|
| 38 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 39 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 40 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 41 |
+
* only those rights set forth herein.
|
| 42 |
+
*
|
| 43 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 44 |
+
* software must include, in the user documentation and internal
|
| 45 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 46 |
+
* Users Notice.
|
| 47 |
+
*/
|
| 48 |
+
|
| 49 |
+
#ifndef _CG_GRID_H
|
| 50 |
+
#define _CG_GRID_H
|
| 51 |
+
|
| 52 |
+
#include "info.h"
|
| 53 |
+
|
| 54 |
+
_CG_BEGIN_NAMESPACE
|
| 55 |
+
|
| 56 |
+
namespace details
|
| 57 |
+
{
|
| 58 |
+
typedef unsigned int barrier_t;
|
| 59 |
+
|
| 60 |
+
_CG_STATIC_QUALIFIER bool bar_has_flipped(unsigned int old_arrive, unsigned int current_arrive) {
|
| 61 |
+
return (((old_arrive ^ current_arrive) & 0x80000000) != 0);
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
_CG_STATIC_QUALIFIER bool is_cta_master() {
|
| 65 |
+
return (threadIdx.x + threadIdx.y + threadIdx.z == 0);
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
_CG_STATIC_QUALIFIER unsigned int sync_grids_arrive(volatile barrier_t *arrived) {
|
| 69 |
+
unsigned int oldArrive = 0;
|
| 70 |
+
|
| 71 |
+
__barrier_sync(0);
|
| 72 |
+
|
| 73 |
+
if (is_cta_master()) {
|
| 74 |
+
unsigned int expected = gridDim.x * gridDim.y * gridDim.z;
|
| 75 |
+
bool gpu_master = (blockIdx.x + blockIdx.y + blockIdx.z == 0);
|
| 76 |
+
unsigned int nb = 1;
|
| 77 |
+
|
| 78 |
+
if (gpu_master) {
|
| 79 |
+
nb = 0x80000000 - (expected - 1);
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
NV_IF_ELSE_TARGET(NV_PROVIDES_SM_70,
|
| 83 |
+
// Barrier update with release; polling with acquire
|
| 84 |
+
asm volatile("atom.add.release.gpu.u32 %0,[%1],%2;" : "=r"(oldArrive) : _CG_ASM_PTR_CONSTRAINT((unsigned int*)arrived), "r"(nb) : "memory");
|
| 85 |
+
,
|
| 86 |
+
// Fence; barrier update; volatile polling; fence
|
| 87 |
+
__threadfence();
|
| 88 |
+
oldArrive = atomicAdd((unsigned int*)arrived, nb);
|
| 89 |
+
);
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
return oldArrive;
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
_CG_STATIC_QUALIFIER void sync_grids_wait(unsigned int oldArrive, volatile barrier_t *arrived) {
|
| 97 |
+
if (is_cta_master()) {
|
| 98 |
+
NV_IF_ELSE_TARGET(NV_PROVIDES_SM_70,
|
| 99 |
+
unsigned int current_arrive;
|
| 100 |
+
do {
|
| 101 |
+
asm volatile("ld.acquire.gpu.u32 %0,[%1];" : "=r"(current_arrive) : _CG_ASM_PTR_CONSTRAINT((unsigned int *)arrived) : "memory");
|
| 102 |
+
} while (!bar_has_flipped(oldArrive, current_arrive));
|
| 103 |
+
,
|
| 104 |
+
while (!bar_has_flipped(oldArrive, *arrived));
|
| 105 |
+
__threadfence();
|
| 106 |
+
);
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
__barrier_sync(0);
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
/* - Multi warp groups synchronization routines - */
|
| 113 |
+
|
| 114 |
+
#ifdef _CG_CPP11_FEATURES
|
| 115 |
+
// Need both acquire and release for the last warp, since it won't be able to acquire with red.and
|
| 116 |
+
_CG_STATIC_QUALIFIER unsigned int atom_or_acq_rel_cta(unsigned int *addr, unsigned int val) {
|
| 117 |
+
unsigned int old;
|
| 118 |
+
NV_IF_ELSE_TARGET(NV_PROVIDES_SM_70,
|
| 119 |
+
(asm volatile("atom.or.acq_rel.cta.b32 %0,[%1],%2;" : "=r"(old) : _CG_ASM_PTR_CONSTRAINT(addr), "r"(val) : "memory");)
|
| 120 |
+
,
|
| 121 |
+
(__threadfence_block();
|
| 122 |
+
old = atomicOr(addr, val);)
|
| 123 |
+
);
|
| 124 |
+
return old;
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
// Special case where barrier is arrived, but not waited on
|
| 128 |
+
_CG_STATIC_QUALIFIER void red_or_release_cta(unsigned int *addr, unsigned int val) {
|
| 129 |
+
NV_IF_ELSE_TARGET(NV_PROVIDES_SM_70,
|
| 130 |
+
(asm volatile("red.or.release.cta.b32 [%0],%1;" :: _CG_ASM_PTR_CONSTRAINT(addr), "r"(val) : "memory");)
|
| 131 |
+
,
|
| 132 |
+
(__threadfence_block();
|
| 133 |
+
atomicOr(addr, val);)
|
| 134 |
+
);
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
// Usually called by last arriving warp to released other warps, can be relaxed, since or was already acq_rel
|
| 138 |
+
_CG_STATIC_QUALIFIER void red_and_relaxed_cta(unsigned int *addr, unsigned int val) {
|
| 139 |
+
NV_IF_ELSE_TARGET(NV_PROVIDES_SM_70,
|
| 140 |
+
(asm volatile("red.and.relaxed.cta.b32 [%0],%1;" :: _CG_ASM_PTR_CONSTRAINT(addr), "r"(val) : "memory");)
|
| 141 |
+
,
|
| 142 |
+
(atomicAnd(addr, val);)
|
| 143 |
+
);
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
// Special case of release, where last warp was doing extra work before releasing others, need to be release
|
| 147 |
+
// to ensure that extra work is visible
|
| 148 |
+
_CG_STATIC_QUALIFIER void red_and_release_cta(unsigned int *addr, unsigned int val) {
|
| 149 |
+
NV_IF_ELSE_TARGET(NV_PROVIDES_SM_70,
|
| 150 |
+
(asm volatile("red.and.release.cta.b32 [%0],%1;" :: _CG_ASM_PTR_CONSTRAINT(addr), "r"(val) : "memory");)
|
| 151 |
+
,
|
| 152 |
+
(__threadfence_block();
|
| 153 |
+
atomicAnd(addr, val);)
|
| 154 |
+
);
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
// Read the barrier, acquire to ensure all memory operations following the sync are correctly performed after it is released
|
| 158 |
+
_CG_STATIC_QUALIFIER unsigned int ld_acquire_cta(unsigned int *addr) {
|
| 159 |
+
unsigned int val;
|
| 160 |
+
NV_IF_ELSE_TARGET(NV_PROVIDES_SM_70,
|
| 161 |
+
(asm volatile("ld.acquire.cta.u32 %0,[%1];" : "=r"(val) : _CG_ASM_PTR_CONSTRAINT(addr) : "memory");)
|
| 162 |
+
,
|
| 163 |
+
(val = *((volatile unsigned int*) addr);
|
| 164 |
+
__threadfence_block();)
|
| 165 |
+
);
|
| 166 |
+
return val;
|
| 167 |
+
}
|
| 168 |
+
|
| 169 |
+
// Get synchronization bit mask of my thread_block_tile of size num_warps. Thread ranks 0..31 have the first bit assigned to them,
|
| 170 |
+
// thread ranks 32..63 second etc
|
| 171 |
+
// Bit masks are unique for each group, groups of the same size will have the same number of bits set, but on different positions
|
| 172 |
+
_CG_STATIC_QUALIFIER unsigned int get_group_mask(unsigned int thread_rank, unsigned int num_warps) {
|
| 173 |
+
return num_warps == 32 ? ~0 : ((1 << num_warps) - 1) << (num_warps * (thread_rank / (num_warps * 32)));
|
| 174 |
+
}
|
| 175 |
+
|
| 176 |
+
_CG_STATIC_QUALIFIER void barrier_wait(barrier_t *arrived, unsigned int warp_bit) {
|
| 177 |
+
while(ld_acquire_cta(arrived) & warp_bit);
|
| 178 |
+
}
|
| 179 |
+
|
| 180 |
+
// Default blocking sync.
|
| 181 |
+
_CG_STATIC_QUALIFIER void sync_warps(barrier_t *arrived, unsigned int thread_rank, unsigned int num_warps) {
|
| 182 |
+
unsigned int warp_id = thread_rank / 32;
|
| 183 |
+
bool warp_master = (thread_rank % 32 == 0);
|
| 184 |
+
unsigned int warp_bit = 1 << warp_id;
|
| 185 |
+
unsigned int group_mask = get_group_mask(thread_rank, num_warps);
|
| 186 |
+
|
| 187 |
+
__syncwarp(0xFFFFFFFF);
|
| 188 |
+
|
| 189 |
+
if (warp_master) {
|
| 190 |
+
unsigned int old = atom_or_acq_rel_cta(arrived, warp_bit);
|
| 191 |
+
if (((old | warp_bit) & group_mask) == group_mask) {
|
| 192 |
+
red_and_relaxed_cta(arrived, ~group_mask);
|
| 193 |
+
}
|
| 194 |
+
else {
|
| 195 |
+
barrier_wait(arrived, warp_bit);
|
| 196 |
+
}
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
__syncwarp(0xFFFFFFFF);
|
| 200 |
+
}
|
| 201 |
+
|
| 202 |
+
// Blocking sync, except the last arriving warp, that releases other warps, returns to do other stuff first.
|
| 203 |
+
// Warp returning true from this function needs to call sync_warps_release.
|
| 204 |
+
_CG_STATIC_QUALIFIER bool sync_warps_last_releases(barrier_t *arrived, unsigned int thread_rank, unsigned int num_warps) {
|
| 205 |
+
unsigned int warp_id = thread_rank / 32;
|
| 206 |
+
bool warp_master = (thread_rank % 32 == 0);
|
| 207 |
+
unsigned int warp_bit = 1 << warp_id;
|
| 208 |
+
unsigned int group_mask = get_group_mask(thread_rank, num_warps);
|
| 209 |
+
|
| 210 |
+
__syncwarp(0xFFFFFFFF);
|
| 211 |
+
|
| 212 |
+
unsigned int old = 0;
|
| 213 |
+
if (warp_master) {
|
| 214 |
+
old = atom_or_acq_rel_cta(arrived, warp_bit);
|
| 215 |
+
}
|
| 216 |
+
old = __shfl_sync(0xFFFFFFFF, old, 0);
|
| 217 |
+
if (((old | warp_bit) & group_mask) == group_mask) {
|
| 218 |
+
return true;
|
| 219 |
+
}
|
| 220 |
+
barrier_wait(arrived, warp_bit);
|
| 221 |
+
|
| 222 |
+
return false;
|
| 223 |
+
}
|
| 224 |
+
|
| 225 |
+
// Release my group from the barrier.
|
| 226 |
+
_CG_STATIC_QUALIFIER void sync_warps_release(barrier_t *arrived, bool is_master, unsigned int thread_rank, unsigned int num_warps) {
|
| 227 |
+
unsigned int group_mask = get_group_mask(thread_rank, num_warps);
|
| 228 |
+
if (is_master) {
|
| 229 |
+
red_and_release_cta(arrived, ~group_mask);
|
| 230 |
+
}
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
// Arrive at my group barrier, but don't block or release the barrier, even if every one arrives.
|
| 234 |
+
// sync_warps_release needs to be called by some warp after this one to reset the barrier.
|
| 235 |
+
_CG_STATIC_QUALIFIER void sync_warps_arrive(barrier_t *arrived, unsigned int thread_rank, unsigned int num_warps) {
|
| 236 |
+
unsigned int warp_id = thread_rank / 32;
|
| 237 |
+
bool warp_master = (thread_rank % 32 == 0);
|
| 238 |
+
unsigned int warp_bit = 1 << warp_id;
|
| 239 |
+
unsigned int group_mask = get_group_mask(thread_rank, num_warps);
|
| 240 |
+
|
| 241 |
+
__syncwarp(0xFFFFFFFF);
|
| 242 |
+
|
| 243 |
+
if (warp_master) {
|
| 244 |
+
red_or_release_cta(arrived, warp_bit);
|
| 245 |
+
}
|
| 246 |
+
}
|
| 247 |
+
|
| 248 |
+
// Wait for my warp to be released from the barrier. Warp must have arrived first.
|
| 249 |
+
_CG_STATIC_QUALIFIER void sync_warps_wait(barrier_t *arrived, unsigned int thread_rank) {
|
| 250 |
+
unsigned int warp_id = thread_rank / 32;
|
| 251 |
+
unsigned int warp_bit = 1 << warp_id;
|
| 252 |
+
|
| 253 |
+
barrier_wait(arrived, warp_bit);
|
| 254 |
+
}
|
| 255 |
+
|
| 256 |
+
// Wait for specific warp to arrive at the barrier
|
| 257 |
+
_CG_QUALIFIER void sync_warps_wait_for_specific_warp(barrier_t *arrived, unsigned int wait_warp_id) {
|
| 258 |
+
unsigned int wait_mask = 1 << wait_warp_id;
|
| 259 |
+
while((ld_acquire_cta(arrived) & wait_mask) != wait_mask);
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
// Initialize the bit corresponding to my warp in the barrier
|
| 263 |
+
_CG_QUALIFIER void sync_warps_reset(barrier_t *arrived, unsigned int thread_rank) {
|
| 264 |
+
unsigned int warp_id = thread_rank / 32;
|
| 265 |
+
unsigned int warp_bit = 1 << warp_id;
|
| 266 |
+
|
| 267 |
+
__syncwarp(0xFFFFFFFF);
|
| 268 |
+
|
| 269 |
+
if (thread_rank % 32 == 0) {
|
| 270 |
+
red_and_release_cta(arrived, ~warp_bit);
|
| 271 |
+
}
|
| 272 |
+
// No need to sync after the atomic, there will be a sync of the group that is being partitioned right after this.
|
| 273 |
+
}
|
| 274 |
+
|
| 275 |
+
#endif
|
| 276 |
+
|
| 277 |
+
} // details
|
| 278 |
+
|
| 279 |
+
_CG_END_NAMESPACE
|
| 280 |
+
|
| 281 |
+
#endif // _CG_GRID_H
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/memcpy_async.h
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* Copyright 1993-2016 NVIDIA Corporation. All rights reserved.
|
| 2 |
+
*
|
| 3 |
+
* NOTICE TO LICENSEE:
|
| 4 |
+
*
|
| 5 |
+
* The source code and/or documentation ("Licensed Deliverables") are
|
| 6 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 7 |
+
* international Copyright laws.
|
| 8 |
+
*
|
| 9 |
+
* The Licensed Deliverables contained herein are PROPRIETARY and
|
| 10 |
+
* CONFIDENTIAL to NVIDIA and are being provided under the terms and
|
| 11 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 12 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 13 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 14 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 15 |
+
* of the Licensed Deliverables to any third party without the express
|
| 16 |
+
* written consent of NVIDIA is prohibited.
|
| 17 |
+
*
|
| 18 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 19 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 20 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. THEY ARE
|
| 21 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 22 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 23 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 24 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 25 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 26 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 27 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 28 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 29 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 30 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 31 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 32 |
+
*
|
| 33 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 34 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 35 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 36 |
+
* computer software documentation" as such terms are used in 48
|
| 37 |
+
* C.F.R. 12.212 (SEPT 1995) and are provided to the U.S. Government
|
| 38 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 39 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 40 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 41 |
+
* only those rights set forth herein.
|
| 42 |
+
*
|
| 43 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 44 |
+
* software must include, in the user documentation and internal
|
| 45 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 46 |
+
* Users Notice.
|
| 47 |
+
*/
|
| 48 |
+
|
| 49 |
+
#ifndef _COOPERATIVE_GROUPS_MEMCPY_ASYNC
|
| 50 |
+
#define _COOPERATIVE_GROUPS_MEMCPY_ASYNC
|
| 51 |
+
|
| 52 |
+
#include "../cooperative_groups.h"
|
| 53 |
+
#include "details/info.h"
|
| 54 |
+
|
| 55 |
+
#ifdef _CG_CPP11_FEATURES
|
| 56 |
+
# include "details/async.h"
|
| 57 |
+
#else
|
| 58 |
+
# error This file requires compiler support for the ISO C++ 2011 standard. This support must be enabled with the \
|
| 59 |
+
-std=c++11 compiler option.
|
| 60 |
+
#endif
|
| 61 |
+
|
| 62 |
+
#endif // _COOPERATIVE_GROUPS_MEMCPY_ASYNC
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/reduce.h
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* Copyright 1993-2016 NVIDIA Corporation. All rights reserved.
|
| 2 |
+
*
|
| 3 |
+
* NOTICE TO LICENSEE:
|
| 4 |
+
*
|
| 5 |
+
* The source code and/or documentation ("Licensed Deliverables") are
|
| 6 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 7 |
+
* international Copyright laws.
|
| 8 |
+
*
|
| 9 |
+
* The Licensed Deliverables contained herein are PROPRIETARY and
|
| 10 |
+
* CONFIDENTIAL to NVIDIA and are being provided under the terms and
|
| 11 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 12 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 13 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 14 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 15 |
+
* of the Licensed Deliverables to any third party without the express
|
| 16 |
+
* written consent of NVIDIA is prohibited.
|
| 17 |
+
*
|
| 18 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 19 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 20 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. THEY ARE
|
| 21 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 22 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 23 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 24 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 25 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 26 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 27 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 28 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 29 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 30 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 31 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 32 |
+
*
|
| 33 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 34 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 35 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 36 |
+
* computer software documentation" as such terms are used in 48
|
| 37 |
+
* C.F.R. 12.212 (SEPT 1995) and are provided to the U.S. Government
|
| 38 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 39 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 40 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 41 |
+
* only those rights set forth herein.
|
| 42 |
+
*
|
| 43 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 44 |
+
* software must include, in the user documentation and internal
|
| 45 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 46 |
+
* Users Notice.
|
| 47 |
+
*/
|
| 48 |
+
|
| 49 |
+
#ifndef _COOPERATIVE_GROUPS_REDUCE_H
|
| 50 |
+
#define _COOPERATIVE_GROUPS_REDUCE_H
|
| 51 |
+
|
| 52 |
+
#include "../cooperative_groups.h"
|
| 53 |
+
#include "details/info.h"
|
| 54 |
+
|
| 55 |
+
#ifdef _CG_CPP11_FEATURES
|
| 56 |
+
# include "details/reduce.h"
|
| 57 |
+
#else
|
| 58 |
+
# error This file requires compiler support for the ISO C++ 2011 standard. This support must be enabled with the \
|
| 59 |
+
-std=c++11 compiler option.
|
| 60 |
+
#endif
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
#endif //_COOPERATIVE_GROUPS_REDUCE_H
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cooperative_groups/scan.h
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* Copyright 1993-2016 NVIDIA Corporation. All rights reserved.
|
| 2 |
+
*
|
| 3 |
+
* NOTICE TO LICENSEE:
|
| 4 |
+
*
|
| 5 |
+
* The source code and/or documentation ("Licensed Deliverables") are
|
| 6 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 7 |
+
* international Copyright laws.
|
| 8 |
+
*
|
| 9 |
+
* The Licensed Deliverables contained herein are PROPRIETARY and
|
| 10 |
+
* CONFIDENTIAL to NVIDIA and are being provided under the terms and
|
| 11 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 12 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 13 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 14 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 15 |
+
* of the Licensed Deliverables to any third party without the express
|
| 16 |
+
* written consent of NVIDIA is prohibited.
|
| 17 |
+
*
|
| 18 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 19 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 20 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. THEY ARE
|
| 21 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 22 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 23 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 24 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 25 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 26 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 27 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 28 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 29 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 30 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 31 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 32 |
+
*
|
| 33 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 34 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 35 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 36 |
+
* computer software documentation" as such terms are used in 48
|
| 37 |
+
* C.F.R. 12.212 (SEPT 1995) and are provided to the U.S. Government
|
| 38 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 39 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 40 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 41 |
+
* only those rights set forth herein.
|
| 42 |
+
*
|
| 43 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 44 |
+
* software must include, in the user documentation and internal
|
| 45 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 46 |
+
* Users Notice.
|
| 47 |
+
*/
|
| 48 |
+
|
| 49 |
+
#ifndef _COOPERATIVE_GROUPS_SCAN_H
|
| 50 |
+
#define _COOPERATIVE_GROUPS_SCAN_H
|
| 51 |
+
|
| 52 |
+
#include "../cooperative_groups.h"
|
| 53 |
+
#include "details/info.h"
|
| 54 |
+
|
| 55 |
+
#ifdef _CG_CPP11_FEATURES
|
| 56 |
+
# include "details/scan.h"
|
| 57 |
+
#else
|
| 58 |
+
# error This file requires compiler support for the ISO C++ 2011 standard. This support must be enabled with the \
|
| 59 |
+
-std=c++11 compiler option.
|
| 60 |
+
#endif
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
#endif //_COOPERATIVE_GROUPS_SCAN_H
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cuComplex.h
ADDED
|
@@ -0,0 +1,348 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1993-2012 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO LICENSEE:
|
| 5 |
+
*
|
| 6 |
+
* This source code and/or documentation ("Licensed Deliverables") are
|
| 7 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 8 |
+
* international Copyright laws.
|
| 9 |
+
*
|
| 10 |
+
* These Licensed Deliverables contained herein is PROPRIETARY and
|
| 11 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and
|
| 12 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 13 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 14 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 15 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 16 |
+
* of the Licensed Deliverables to any third party without the express
|
| 17 |
+
* written consent of NVIDIA is prohibited.
|
| 18 |
+
*
|
| 19 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 20 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 21 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
|
| 22 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 23 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 24 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 25 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 26 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 27 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 28 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 29 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 30 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 31 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 32 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 33 |
+
*
|
| 34 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 35 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 36 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 37 |
+
* computer software documentation" as such terms are used in 48
|
| 38 |
+
* C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
|
| 39 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 40 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 41 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 42 |
+
* only those rights set forth herein.
|
| 43 |
+
*
|
| 44 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 45 |
+
* software must include, in the user documentation and internal
|
| 46 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 47 |
+
* Users Notice.
|
| 48 |
+
*/
|
| 49 |
+
|
| 50 |
+
#if !defined(CU_COMPLEX_H_)
|
| 51 |
+
#define CU_COMPLEX_H_
|
| 52 |
+
|
| 53 |
+
#if !defined(__CUDACC_RTC__)
|
| 54 |
+
#if defined(__GNUC__)
|
| 55 |
+
#if defined(__clang__) || (!defined(__PGIC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)))
|
| 56 |
+
#pragma GCC diagnostic ignored "-Wunused-function"
|
| 57 |
+
#endif
|
| 58 |
+
#endif
|
| 59 |
+
#endif
|
| 60 |
+
|
| 61 |
+
/* When trying to include C header file in C++ Code extern "C" is required
|
| 62 |
+
* But the Standard QNX headers already have ifdef extern in them when compiling C++ Code
|
| 63 |
+
* extern "C" cannot be nested
|
| 64 |
+
* Hence keep the header out of extern "C" block
|
| 65 |
+
*/
|
| 66 |
+
|
| 67 |
+
#if !defined(__CUDACC__)
|
| 68 |
+
#include <math.h> /* import fabsf, sqrt */
|
| 69 |
+
#endif /* !defined(__CUDACC__) */
|
| 70 |
+
|
| 71 |
+
#if defined(__cplusplus)
|
| 72 |
+
extern "C" {
|
| 73 |
+
#endif /* __cplusplus */
|
| 74 |
+
|
| 75 |
+
#include "vector_types.h"
|
| 76 |
+
|
| 77 |
+
typedef float2 cuFloatComplex;
|
| 78 |
+
|
| 79 |
+
__host__ __device__ static __inline__ float cuCrealf (cuFloatComplex x)
|
| 80 |
+
{
|
| 81 |
+
return x.x;
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
__host__ __device__ static __inline__ float cuCimagf (cuFloatComplex x)
|
| 85 |
+
{
|
| 86 |
+
return x.y;
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
__host__ __device__ static __inline__ cuFloatComplex make_cuFloatComplex
|
| 90 |
+
(float r, float i)
|
| 91 |
+
{
|
| 92 |
+
cuFloatComplex res;
|
| 93 |
+
res.x = r;
|
| 94 |
+
res.y = i;
|
| 95 |
+
return res;
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
__host__ __device__ static __inline__ cuFloatComplex cuConjf (cuFloatComplex x)
|
| 99 |
+
{
|
| 100 |
+
return make_cuFloatComplex (cuCrealf(x), -cuCimagf(x));
|
| 101 |
+
}
|
| 102 |
+
__host__ __device__ static __inline__ cuFloatComplex cuCaddf (cuFloatComplex x,
|
| 103 |
+
cuFloatComplex y)
|
| 104 |
+
{
|
| 105 |
+
return make_cuFloatComplex (cuCrealf(x) + cuCrealf(y),
|
| 106 |
+
cuCimagf(x) + cuCimagf(y));
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
__host__ __device__ static __inline__ cuFloatComplex cuCsubf (cuFloatComplex x,
|
| 110 |
+
cuFloatComplex y)
|
| 111 |
+
{
|
| 112 |
+
return make_cuFloatComplex (cuCrealf(x) - cuCrealf(y),
|
| 113 |
+
cuCimagf(x) - cuCimagf(y));
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
/* This implementation could suffer from intermediate overflow even though
|
| 117 |
+
* the final result would be in range. However, various implementations do
|
| 118 |
+
* not guard against this (presumably to avoid losing performance), so we
|
| 119 |
+
* don't do it either to stay competitive.
|
| 120 |
+
*/
|
| 121 |
+
__host__ __device__ static __inline__ cuFloatComplex cuCmulf (cuFloatComplex x,
|
| 122 |
+
cuFloatComplex y)
|
| 123 |
+
{
|
| 124 |
+
cuFloatComplex prod;
|
| 125 |
+
prod = make_cuFloatComplex ((cuCrealf(x) * cuCrealf(y)) -
|
| 126 |
+
(cuCimagf(x) * cuCimagf(y)),
|
| 127 |
+
(cuCrealf(x) * cuCimagf(y)) +
|
| 128 |
+
(cuCimagf(x) * cuCrealf(y)));
|
| 129 |
+
return prod;
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
/* This implementation guards against intermediate underflow and overflow
|
| 133 |
+
* by scaling. Such guarded implementations are usually the default for
|
| 134 |
+
* complex library implementations, with some also offering an unguarded,
|
| 135 |
+
* faster version.
|
| 136 |
+
*/
|
| 137 |
+
__host__ __device__ static __inline__ cuFloatComplex cuCdivf (cuFloatComplex x,
|
| 138 |
+
cuFloatComplex y)
|
| 139 |
+
{
|
| 140 |
+
cuFloatComplex quot;
|
| 141 |
+
float s = fabsf(cuCrealf(y)) + fabsf(cuCimagf(y));
|
| 142 |
+
float oos = 1.0f / s;
|
| 143 |
+
float ars = cuCrealf(x) * oos;
|
| 144 |
+
float ais = cuCimagf(x) * oos;
|
| 145 |
+
float brs = cuCrealf(y) * oos;
|
| 146 |
+
float bis = cuCimagf(y) * oos;
|
| 147 |
+
s = (brs * brs) + (bis * bis);
|
| 148 |
+
oos = 1.0f / s;
|
| 149 |
+
quot = make_cuFloatComplex (((ars * brs) + (ais * bis)) * oos,
|
| 150 |
+
((ais * brs) - (ars * bis)) * oos);
|
| 151 |
+
return quot;
|
| 152 |
+
}
|
| 153 |
+
|
| 154 |
+
/*
|
| 155 |
+
* We would like to call hypotf(), but it's not available on all platforms.
|
| 156 |
+
* This discrete implementation guards against intermediate underflow and
|
| 157 |
+
* overflow by scaling. Otherwise we would lose half the exponent range.
|
| 158 |
+
* There are various ways of doing guarded computation. For now chose the
|
| 159 |
+
* simplest and fastest solution, however this may suffer from inaccuracies
|
| 160 |
+
* if sqrt and division are not IEEE compliant.
|
| 161 |
+
*/
|
| 162 |
+
__host__ __device__ static __inline__ float cuCabsf (cuFloatComplex x)
|
| 163 |
+
{
|
| 164 |
+
float a = cuCrealf(x);
|
| 165 |
+
float b = cuCimagf(x);
|
| 166 |
+
float v, w, t;
|
| 167 |
+
a = fabsf(a);
|
| 168 |
+
b = fabsf(b);
|
| 169 |
+
if (a > b) {
|
| 170 |
+
v = a;
|
| 171 |
+
w = b;
|
| 172 |
+
} else {
|
| 173 |
+
v = b;
|
| 174 |
+
w = a;
|
| 175 |
+
}
|
| 176 |
+
t = w / v;
|
| 177 |
+
t = 1.0f + t * t;
|
| 178 |
+
t = v * sqrtf(t);
|
| 179 |
+
if ((v == 0.0f) || (v > 3.402823466e38f) || (w > 3.402823466e38f)) {
|
| 180 |
+
t = v + w;
|
| 181 |
+
}
|
| 182 |
+
return t;
|
| 183 |
+
}
|
| 184 |
+
|
| 185 |
+
/* Double precision */
|
| 186 |
+
typedef double2 cuDoubleComplex;
|
| 187 |
+
|
| 188 |
+
__host__ __device__ static __inline__ double cuCreal (cuDoubleComplex x)
|
| 189 |
+
{
|
| 190 |
+
return x.x;
|
| 191 |
+
}
|
| 192 |
+
|
| 193 |
+
__host__ __device__ static __inline__ double cuCimag (cuDoubleComplex x)
|
| 194 |
+
{
|
| 195 |
+
return x.y;
|
| 196 |
+
}
|
| 197 |
+
|
| 198 |
+
__host__ __device__ static __inline__ cuDoubleComplex make_cuDoubleComplex
|
| 199 |
+
(double r, double i)
|
| 200 |
+
{
|
| 201 |
+
cuDoubleComplex res;
|
| 202 |
+
res.x = r;
|
| 203 |
+
res.y = i;
|
| 204 |
+
return res;
|
| 205 |
+
}
|
| 206 |
+
|
| 207 |
+
__host__ __device__ static __inline__ cuDoubleComplex cuConj(cuDoubleComplex x)
|
| 208 |
+
{
|
| 209 |
+
return make_cuDoubleComplex (cuCreal(x), -cuCimag(x));
|
| 210 |
+
}
|
| 211 |
+
|
| 212 |
+
__host__ __device__ static __inline__ cuDoubleComplex cuCadd(cuDoubleComplex x,
|
| 213 |
+
cuDoubleComplex y)
|
| 214 |
+
{
|
| 215 |
+
return make_cuDoubleComplex (cuCreal(x) + cuCreal(y),
|
| 216 |
+
cuCimag(x) + cuCimag(y));
|
| 217 |
+
}
|
| 218 |
+
|
| 219 |
+
__host__ __device__ static __inline__ cuDoubleComplex cuCsub(cuDoubleComplex x,
|
| 220 |
+
cuDoubleComplex y)
|
| 221 |
+
{
|
| 222 |
+
return make_cuDoubleComplex (cuCreal(x) - cuCreal(y),
|
| 223 |
+
cuCimag(x) - cuCimag(y));
|
| 224 |
+
}
|
| 225 |
+
|
| 226 |
+
/* This implementation could suffer from intermediate overflow even though
|
| 227 |
+
* the final result would be in range. However, various implementations do
|
| 228 |
+
* not guard against this (presumably to avoid losing performance), so we
|
| 229 |
+
* don't do it either to stay competitive.
|
| 230 |
+
*/
|
| 231 |
+
__host__ __device__ static __inline__ cuDoubleComplex cuCmul(cuDoubleComplex x,
|
| 232 |
+
cuDoubleComplex y)
|
| 233 |
+
{
|
| 234 |
+
cuDoubleComplex prod;
|
| 235 |
+
prod = make_cuDoubleComplex ((cuCreal(x) * cuCreal(y)) -
|
| 236 |
+
(cuCimag(x) * cuCimag(y)),
|
| 237 |
+
(cuCreal(x) * cuCimag(y)) +
|
| 238 |
+
(cuCimag(x) * cuCreal(y)));
|
| 239 |
+
return prod;
|
| 240 |
+
}
|
| 241 |
+
|
| 242 |
+
/* This implementation guards against intermediate underflow and overflow
|
| 243 |
+
* by scaling. Such guarded implementations are usually the default for
|
| 244 |
+
* complex library implementations, with some also offering an unguarded,
|
| 245 |
+
* faster version.
|
| 246 |
+
*/
|
| 247 |
+
__host__ __device__ static __inline__ cuDoubleComplex cuCdiv(cuDoubleComplex x,
|
| 248 |
+
cuDoubleComplex y)
|
| 249 |
+
{
|
| 250 |
+
cuDoubleComplex quot;
|
| 251 |
+
double s = (fabs(cuCreal(y))) + (fabs(cuCimag(y)));
|
| 252 |
+
double oos = 1.0 / s;
|
| 253 |
+
double ars = cuCreal(x) * oos;
|
| 254 |
+
double ais = cuCimag(x) * oos;
|
| 255 |
+
double brs = cuCreal(y) * oos;
|
| 256 |
+
double bis = cuCimag(y) * oos;
|
| 257 |
+
s = (brs * brs) + (bis * bis);
|
| 258 |
+
oos = 1.0 / s;
|
| 259 |
+
quot = make_cuDoubleComplex (((ars * brs) + (ais * bis)) * oos,
|
| 260 |
+
((ais * brs) - (ars * bis)) * oos);
|
| 261 |
+
return quot;
|
| 262 |
+
}
|
| 263 |
+
|
| 264 |
+
/* This implementation guards against intermediate underflow and overflow
|
| 265 |
+
* by scaling. Otherwise we would lose half the exponent range. There are
|
| 266 |
+
* various ways of doing guarded computation. For now chose the simplest
|
| 267 |
+
* and fastest solution, however this may suffer from inaccuracies if sqrt
|
| 268 |
+
* and division are not IEEE compliant.
|
| 269 |
+
*/
|
| 270 |
+
__host__ __device__ static __inline__ double cuCabs (cuDoubleComplex x)
|
| 271 |
+
{
|
| 272 |
+
double a = cuCreal(x);
|
| 273 |
+
double b = cuCimag(x);
|
| 274 |
+
double v, w, t;
|
| 275 |
+
a = fabs(a);
|
| 276 |
+
b = fabs(b);
|
| 277 |
+
if (a > b) {
|
| 278 |
+
v = a;
|
| 279 |
+
w = b;
|
| 280 |
+
} else {
|
| 281 |
+
v = b;
|
| 282 |
+
w = a;
|
| 283 |
+
}
|
| 284 |
+
t = w / v;
|
| 285 |
+
t = 1.0 + t * t;
|
| 286 |
+
t = v * sqrt(t);
|
| 287 |
+
if ((v == 0.0) ||
|
| 288 |
+
(v > 1.79769313486231570e+308) || (w > 1.79769313486231570e+308)) {
|
| 289 |
+
t = v + w;
|
| 290 |
+
}
|
| 291 |
+
return t;
|
| 292 |
+
}
|
| 293 |
+
|
| 294 |
+
#if defined(__cplusplus)
|
| 295 |
+
}
|
| 296 |
+
#endif /* __cplusplus */
|
| 297 |
+
|
| 298 |
+
/* aliases */
|
| 299 |
+
typedef cuFloatComplex cuComplex;
|
| 300 |
+
__host__ __device__ static __inline__ cuComplex make_cuComplex (float x,
|
| 301 |
+
float y)
|
| 302 |
+
{
|
| 303 |
+
return make_cuFloatComplex (x, y);
|
| 304 |
+
}
|
| 305 |
+
|
| 306 |
+
/* float-to-double promotion */
|
| 307 |
+
__host__ __device__ static __inline__ cuDoubleComplex cuComplexFloatToDouble
|
| 308 |
+
(cuFloatComplex c)
|
| 309 |
+
{
|
| 310 |
+
return make_cuDoubleComplex ((double)cuCrealf(c), (double)cuCimagf(c));
|
| 311 |
+
}
|
| 312 |
+
|
| 313 |
+
__host__ __device__ static __inline__ cuFloatComplex cuComplexDoubleToFloat
|
| 314 |
+
(cuDoubleComplex c)
|
| 315 |
+
{
|
| 316 |
+
return make_cuFloatComplex ((float)cuCreal(c), (float)cuCimag(c));
|
| 317 |
+
}
|
| 318 |
+
|
| 319 |
+
|
| 320 |
+
__host__ __device__ static __inline__ cuComplex cuCfmaf( cuComplex x, cuComplex y, cuComplex d)
|
| 321 |
+
{
|
| 322 |
+
float real_res;
|
| 323 |
+
float imag_res;
|
| 324 |
+
|
| 325 |
+
real_res = (cuCrealf(x) * cuCrealf(y)) + cuCrealf(d);
|
| 326 |
+
imag_res = (cuCrealf(x) * cuCimagf(y)) + cuCimagf(d);
|
| 327 |
+
|
| 328 |
+
real_res = -(cuCimagf(x) * cuCimagf(y)) + real_res;
|
| 329 |
+
imag_res = (cuCimagf(x) * cuCrealf(y)) + imag_res;
|
| 330 |
+
|
| 331 |
+
return make_cuComplex(real_res, imag_res);
|
| 332 |
+
}
|
| 333 |
+
|
| 334 |
+
__host__ __device__ static __inline__ cuDoubleComplex cuCfma( cuDoubleComplex x, cuDoubleComplex y, cuDoubleComplex d)
|
| 335 |
+
{
|
| 336 |
+
double real_res;
|
| 337 |
+
double imag_res;
|
| 338 |
+
|
| 339 |
+
real_res = (cuCreal(x) * cuCreal(y)) + cuCreal(d);
|
| 340 |
+
imag_res = (cuCreal(x) * cuCimag(y)) + cuCimag(d);
|
| 341 |
+
|
| 342 |
+
real_res = -(cuCimag(x) * cuCimag(y)) + real_res;
|
| 343 |
+
imag_res = (cuCimag(x) * cuCreal(y)) + imag_res;
|
| 344 |
+
|
| 345 |
+
return make_cuDoubleComplex(real_res, imag_res);
|
| 346 |
+
}
|
| 347 |
+
|
| 348 |
+
#endif /* !defined(CU_COMPLEX_H_) */
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cuda.h
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cudaEGL.h
ADDED
|
@@ -0,0 +1,659 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2014 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO LICENSEE:
|
| 5 |
+
*
|
| 6 |
+
* This source code and/or documentation ("Licensed Deliverables") are
|
| 7 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 8 |
+
* international Copyright laws.
|
| 9 |
+
*
|
| 10 |
+
* These Licensed Deliverables contained herein is PROPRIETARY and
|
| 11 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and
|
| 12 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 13 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 14 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 15 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 16 |
+
* of the Licensed Deliverables to any third party without the express
|
| 17 |
+
* written consent of NVIDIA is prohibited.
|
| 18 |
+
*
|
| 19 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 20 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 21 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
|
| 22 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 23 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 24 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 25 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 26 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 27 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 28 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 29 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 30 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 31 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 32 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 33 |
+
*
|
| 34 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 35 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 36 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 37 |
+
* computer software documentation" as such terms are used in 48
|
| 38 |
+
* C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
|
| 39 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 40 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 41 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 42 |
+
* only those rights set forth herein.
|
| 43 |
+
*
|
| 44 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 45 |
+
* software must include, in the user documentation and internal
|
| 46 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 47 |
+
* Users Notice.
|
| 48 |
+
*/
|
| 49 |
+
|
| 50 |
+
#ifndef CUDAEGL_H
|
| 51 |
+
#define CUDAEGL_H
|
| 52 |
+
|
| 53 |
+
#include "cuda.h"
|
| 54 |
+
#include "EGL/egl.h"
|
| 55 |
+
#include "EGL/eglext.h"
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
#ifdef CUDA_FORCE_API_VERSION
|
| 59 |
+
#error "CUDA_FORCE_API_VERSION is no longer supported."
|
| 60 |
+
#endif
|
| 61 |
+
|
| 62 |
+
#ifdef __cplusplus
|
| 63 |
+
extern "C" {
|
| 64 |
+
#endif
|
| 65 |
+
|
| 66 |
+
/**
|
| 67 |
+
* \addtogroup CUDA_TYPES
|
| 68 |
+
* @{
|
| 69 |
+
*/
|
| 70 |
+
|
| 71 |
+
/**
|
| 72 |
+
* Maximum number of planes per frame
|
| 73 |
+
*/
|
| 74 |
+
#define MAX_PLANES 3
|
| 75 |
+
|
| 76 |
+
/**
|
| 77 |
+
* CUDA EglFrame type - array or pointer
|
| 78 |
+
*/
|
| 79 |
+
typedef enum CUeglFrameType_enum {
|
| 80 |
+
CU_EGL_FRAME_TYPE_ARRAY = 0, /**< Frame type CUDA array */
|
| 81 |
+
CU_EGL_FRAME_TYPE_PITCH = 1, /**< Frame type pointer */
|
| 82 |
+
} CUeglFrameType;
|
| 83 |
+
|
| 84 |
+
/**
|
| 85 |
+
* Indicates that timeout for ::cuEGLStreamConsumerAcquireFrame is infinite.
|
| 86 |
+
*/
|
| 87 |
+
#define CUDA_EGL_INFINITE_TIMEOUT 0xFFFFFFFF
|
| 88 |
+
|
| 89 |
+
/**
|
| 90 |
+
* Resource location flags- sysmem or vidmem
|
| 91 |
+
*
|
| 92 |
+
* For CUDA context on iGPU, since video and system memory are equivalent -
|
| 93 |
+
* these flags will not have an effect on the execution.
|
| 94 |
+
*
|
| 95 |
+
* For CUDA context on dGPU, applications can use the flag ::CUeglResourceLocationFlags
|
| 96 |
+
* to give a hint about the desired location.
|
| 97 |
+
*
|
| 98 |
+
* ::CU_EGL_RESOURCE_LOCATION_SYSMEM - the frame data is made resident on the system memory
|
| 99 |
+
* to be accessed by CUDA.
|
| 100 |
+
*
|
| 101 |
+
* ::CU_EGL_RESOURCE_LOCATION_VIDMEM - the frame data is made resident on the dedicated
|
| 102 |
+
* video memory to be accessed by CUDA.
|
| 103 |
+
*
|
| 104 |
+
* There may be an additional latency due to new allocation and data migration,
|
| 105 |
+
* if the frame is produced on a different memory.
|
| 106 |
+
|
| 107 |
+
*/
|
| 108 |
+
typedef enum CUeglResourceLocationFlags_enum {
|
| 109 |
+
CU_EGL_RESOURCE_LOCATION_SYSMEM = 0x00, /**< Resource location sysmem */
|
| 110 |
+
CU_EGL_RESOURCE_LOCATION_VIDMEM = 0x01 /**< Resource location vidmem */
|
| 111 |
+
} CUeglResourceLocationFlags;
|
| 112 |
+
|
| 113 |
+
/**
|
| 114 |
+
* CUDA EGL Color Format - The different planar and multiplanar formats currently supported for CUDA_EGL interops.
|
| 115 |
+
* Three channel formats are currently not supported for ::CU_EGL_FRAME_TYPE_ARRAY
|
| 116 |
+
*/
|
| 117 |
+
typedef enum CUeglColorFormat_enum {
|
| 118 |
+
CU_EGL_COLOR_FORMAT_YUV420_PLANAR = 0x00, /**< Y, U, V in three surfaces, each in a separate surface, U/V width = 1/2 Y width, U/V height = 1/2 Y height. */
|
| 119 |
+
CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR = 0x01, /**< Y, UV in two surfaces (UV as one surface) with VU byte ordering, width, height ratio same as YUV420Planar. */
|
| 120 |
+
CU_EGL_COLOR_FORMAT_YUV422_PLANAR = 0x02, /**< Y, U, V each in a separate surface, U/V width = 1/2 Y width, U/V height = Y height. */
|
| 121 |
+
CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR = 0x03, /**< Y, UV in two surfaces with VU byte ordering, width, height ratio same as YUV422Planar. */
|
| 122 |
+
CU_EGL_COLOR_FORMAT_RGB = 0x04, /**< R/G/B three channels in one surface with BGR byte ordering. Only pitch linear format supported. */
|
| 123 |
+
CU_EGL_COLOR_FORMAT_BGR = 0x05, /**< R/G/B three channels in one surface with RGB byte ordering. Only pitch linear format supported. */
|
| 124 |
+
CU_EGL_COLOR_FORMAT_ARGB = 0x06, /**< R/G/B/A four channels in one surface with BGRA byte ordering. */
|
| 125 |
+
CU_EGL_COLOR_FORMAT_RGBA = 0x07, /**< R/G/B/A four channels in one surface with ABGR byte ordering. */
|
| 126 |
+
CU_EGL_COLOR_FORMAT_L = 0x08, /**< single luminance channel in one surface. */
|
| 127 |
+
CU_EGL_COLOR_FORMAT_R = 0x09, /**< single color channel in one surface. */
|
| 128 |
+
CU_EGL_COLOR_FORMAT_YUV444_PLANAR = 0x0A, /**< Y, U, V in three surfaces, each in a separate surface, U/V width = Y width, U/V height = Y height. */
|
| 129 |
+
CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR = 0x0B, /**< Y, UV in two surfaces (UV as one surface) with VU byte ordering, width, height ratio same as YUV444Planar. */
|
| 130 |
+
CU_EGL_COLOR_FORMAT_YUYV_422 = 0x0C, /**< Y, U, V in one surface, interleaved as UYVY in one channel. */
|
| 131 |
+
CU_EGL_COLOR_FORMAT_UYVY_422 = 0x0D, /**< Y, U, V in one surface, interleaved as YUYV in one channel. */
|
| 132 |
+
CU_EGL_COLOR_FORMAT_ABGR = 0x0E, /**< R/G/B/A four channels in one surface with RGBA byte ordering. */
|
| 133 |
+
CU_EGL_COLOR_FORMAT_BGRA = 0x0F, /**< R/G/B/A four channels in one surface with ARGB byte ordering. */
|
| 134 |
+
CU_EGL_COLOR_FORMAT_A = 0x10, /**< Alpha color format - one channel in one surface. */
|
| 135 |
+
CU_EGL_COLOR_FORMAT_RG = 0x11, /**< R/G color format - two channels in one surface with GR byte ordering */
|
| 136 |
+
CU_EGL_COLOR_FORMAT_AYUV = 0x12, /**< Y, U, V, A four channels in one surface, interleaved as VUYA. */
|
| 137 |
+
CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR = 0x13, /**< Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width = Y width, U/V height = Y height. */
|
| 138 |
+
CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR = 0x14, /**< Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width = 1/2 Y width, U/V height = Y height. */
|
| 139 |
+
CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR = 0x15, /**< Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width = 1/2 Y width, U/V height = 1/2 Y height. */
|
| 140 |
+
CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR = 0x16, /**< Y10, V10U10 in two surfaces (VU as one surface) with UV byte ordering, U/V width = Y width, U/V height = Y height. */
|
| 141 |
+
CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR = 0x17, /**< Y10, V10U10 in two surfaces (VU as one surface) with UV byte ordering, U/V width = 1/2 Y width, U/V height = 1/2 Y height. */
|
| 142 |
+
CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR = 0x18, /**< Y12, V12U12 in two surfaces (VU as one surface) with UV byte ordering, U/V width = Y width, U/V height = Y height. */
|
| 143 |
+
CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR = 0x19, /**< Y12, V12U12 in two surfaces (VU as one surface) with UV byte ordering, U/V width = 1/2 Y width, U/V height = 1/2 Y height. */
|
| 144 |
+
CU_EGL_COLOR_FORMAT_VYUY_ER = 0x1A, /**< Extended Range Y, U, V in one surface, interleaved as YVYU in one channel. */
|
| 145 |
+
CU_EGL_COLOR_FORMAT_UYVY_ER = 0x1B, /**< Extended Range Y, U, V in one surface, interleaved as YUYV in one channel. */
|
| 146 |
+
CU_EGL_COLOR_FORMAT_YUYV_ER = 0x1C, /**< Extended Range Y, U, V in one surface, interleaved as UYVY in one channel. */
|
| 147 |
+
CU_EGL_COLOR_FORMAT_YVYU_ER = 0x1D, /**< Extended Range Y, U, V in one surface, interleaved as VYUY in one channel. */
|
| 148 |
+
CU_EGL_COLOR_FORMAT_YUV_ER = 0x1E, /**< Extended Range Y, U, V three channels in one surface, interleaved as VUY. Only pitch linear format supported. */
|
| 149 |
+
CU_EGL_COLOR_FORMAT_YUVA_ER = 0x1F, /**< Extended Range Y, U, V, A four channels in one surface, interleaved as AVUY. */
|
| 150 |
+
CU_EGL_COLOR_FORMAT_AYUV_ER = 0x20, /**< Extended Range Y, U, V, A four channels in one surface, interleaved as VUYA. */
|
| 151 |
+
CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER = 0x21, /**< Extended Range Y, U, V in three surfaces, U/V width = Y width, U/V height = Y height. */
|
| 152 |
+
CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER = 0x22, /**< Extended Range Y, U, V in three surfaces, U/V width = 1/2 Y width, U/V height = Y height. */
|
| 153 |
+
CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER = 0x23, /**< Extended Range Y, U, V in three surfaces, U/V width = 1/2 Y width, U/V height = 1/2 Y height. */
|
| 154 |
+
CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER = 0x24, /**< Extended Range Y, UV in two surfaces (UV as one surface) with VU byte ordering, U/V width = Y width, U/V height = Y height. */
|
| 155 |
+
CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER = 0x25, /**< Extended Range Y, UV in two surfaces (UV as one surface) with VU byte ordering, U/V width = 1/2 Y width, U/V height = Y height. */
|
| 156 |
+
CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER = 0x26, /**< Extended Range Y, UV in two surfaces (UV as one surface) with VU byte ordering, U/V width = 1/2 Y width, U/V height = 1/2 Y height. */
|
| 157 |
+
CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER = 0x27, /**< Extended Range Y, V, U in three surfaces, U/V width = Y width, U/V height = Y height. */
|
| 158 |
+
CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER = 0x28, /**< Extended Range Y, V, U in three surfaces, U/V width = 1/2 Y width, U/V height = Y height. */
|
| 159 |
+
CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER = 0x29, /**< Extended Range Y, V, U in three surfaces, U/V width = 1/2 Y width, U/V height = 1/2 Y height. */
|
| 160 |
+
CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER = 0x2A, /**< Extended Range Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width = Y width, U/V height = Y height. */
|
| 161 |
+
CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER = 0x2B, /**< Extended Range Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width = 1/2 Y width, U/V height = Y height. */
|
| 162 |
+
CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER = 0x2C, /**< Extended Range Y, VU in two surfaces (VU as one surface) with UV byte ordering, U/V width = 1/2 Y width, U/V height = 1/2 Y height. */
|
| 163 |
+
CU_EGL_COLOR_FORMAT_BAYER_RGGB = 0x2D, /**< Bayer format - one channel in one surface with interleaved RGGB ordering. */
|
| 164 |
+
CU_EGL_COLOR_FORMAT_BAYER_BGGR = 0x2E, /**< Bayer format - one channel in one surface with interleaved BGGR ordering. */
|
| 165 |
+
CU_EGL_COLOR_FORMAT_BAYER_GRBG = 0x2F, /**< Bayer format - one channel in one surface with interleaved GRBG ordering. */
|
| 166 |
+
CU_EGL_COLOR_FORMAT_BAYER_GBRG = 0x30, /**< Bayer format - one channel in one surface with interleaved GBRG ordering. */
|
| 167 |
+
CU_EGL_COLOR_FORMAT_BAYER10_RGGB = 0x31, /**< Bayer10 format - one channel in one surface with interleaved RGGB ordering. Out of 16 bits, 10 bits used 6 bits No-op. */
|
| 168 |
+
CU_EGL_COLOR_FORMAT_BAYER10_BGGR = 0x32, /**< Bayer10 format - one channel in one surface with interleaved BGGR ordering. Out of 16 bits, 10 bits used 6 bits No-op. */
|
| 169 |
+
CU_EGL_COLOR_FORMAT_BAYER10_GRBG = 0x33, /**< Bayer10 format - one channel in one surface with interleaved GRBG ordering. Out of 16 bits, 10 bits used 6 bits No-op. */
|
| 170 |
+
CU_EGL_COLOR_FORMAT_BAYER10_GBRG = 0x34, /**< Bayer10 format - one channel in one surface with interleaved GBRG ordering. Out of 16 bits, 10 bits used 6 bits No-op. */
|
| 171 |
+
CU_EGL_COLOR_FORMAT_BAYER12_RGGB = 0x35, /**< Bayer12 format - one channel in one surface with interleaved RGGB ordering. Out of 16 bits, 12 bits used 4 bits No-op. */
|
| 172 |
+
CU_EGL_COLOR_FORMAT_BAYER12_BGGR = 0x36, /**< Bayer12 format - one channel in one surface with interleaved BGGR ordering. Out of 16 bits, 12 bits used 4 bits No-op. */
|
| 173 |
+
CU_EGL_COLOR_FORMAT_BAYER12_GRBG = 0x37, /**< Bayer12 format - one channel in one surface with interleaved GRBG ordering. Out of 16 bits, 12 bits used 4 bits No-op. */
|
| 174 |
+
CU_EGL_COLOR_FORMAT_BAYER12_GBRG = 0x38, /**< Bayer12 format - one channel in one surface with interleaved GBRG ordering. Out of 16 bits, 12 bits used 4 bits No-op. */
|
| 175 |
+
CU_EGL_COLOR_FORMAT_BAYER14_RGGB = 0x39, /**< Bayer14 format - one channel in one surface with interleaved RGGB ordering. Out of 16 bits, 14 bits used 2 bits No-op. */
|
| 176 |
+
CU_EGL_COLOR_FORMAT_BAYER14_BGGR = 0x3A, /**< Bayer14 format - one channel in one surface with interleaved BGGR ordering. Out of 16 bits, 14 bits used 2 bits No-op. */
|
| 177 |
+
CU_EGL_COLOR_FORMAT_BAYER14_GRBG = 0x3B, /**< Bayer14 format - one channel in one surface with interleaved GRBG ordering. Out of 16 bits, 14 bits used 2 bits No-op. */
|
| 178 |
+
CU_EGL_COLOR_FORMAT_BAYER14_GBRG = 0x3C, /**< Bayer14 format - one channel in one surface with interleaved GBRG ordering. Out of 16 bits, 14 bits used 2 bits No-op. */
|
| 179 |
+
CU_EGL_COLOR_FORMAT_BAYER20_RGGB = 0x3D, /**< Bayer20 format - one channel in one surface with interleaved RGGB ordering. Out of 32 bits, 20 bits used 12 bits No-op. */
|
| 180 |
+
CU_EGL_COLOR_FORMAT_BAYER20_BGGR = 0x3E, /**< Bayer20 format - one channel in one surface with interleaved BGGR ordering. Out of 32 bits, 20 bits used 12 bits No-op. */
|
| 181 |
+
CU_EGL_COLOR_FORMAT_BAYER20_GRBG = 0x3F, /**< Bayer20 format - one channel in one surface with interleaved GRBG ordering. Out of 32 bits, 20 bits used 12 bits No-op. */
|
| 182 |
+
CU_EGL_COLOR_FORMAT_BAYER20_GBRG = 0x40, /**< Bayer20 format - one channel in one surface with interleaved GBRG ordering. Out of 32 bits, 20 bits used 12 bits No-op. */
|
| 183 |
+
CU_EGL_COLOR_FORMAT_YVU444_PLANAR = 0x41, /**< Y, V, U in three surfaces, each in a separate surface, U/V width = Y width, U/V height = Y height. */
|
| 184 |
+
CU_EGL_COLOR_FORMAT_YVU422_PLANAR = 0x42, /**< Y, V, U in three surfaces, each in a separate surface, U/V width = 1/2 Y width, U/V height = Y height. */
|
| 185 |
+
CU_EGL_COLOR_FORMAT_YVU420_PLANAR = 0x43, /**< Y, V, U in three surfaces, each in a separate surface, U/V width = 1/2 Y width, U/V height = 1/2 Y height. */
|
| 186 |
+
CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB = 0x44, /**< Nvidia proprietary Bayer ISP format - one channel in one surface with interleaved RGGB ordering and mapped to opaque integer datatype. */
|
| 187 |
+
CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR = 0x45, /**< Nvidia proprietary Bayer ISP format - one channel in one surface with interleaved BGGR ordering and mapped to opaque integer datatype. */
|
| 188 |
+
CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG = 0x46, /**< Nvidia proprietary Bayer ISP format - one channel in one surface with interleaved GRBG ordering and mapped to opaque integer datatype. */
|
| 189 |
+
CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG = 0x47, /**< Nvidia proprietary Bayer ISP format - one channel in one surface with interleaved GBRG ordering and mapped to opaque integer datatype. */
|
| 190 |
+
CU_EGL_COLOR_FORMAT_BAYER_BCCR = 0x48, /**< Bayer format - one channel in one surface with interleaved BCCR ordering. */
|
| 191 |
+
CU_EGL_COLOR_FORMAT_BAYER_RCCB = 0x49, /**< Bayer format - one channel in one surface with interleaved RCCB ordering. */
|
| 192 |
+
CU_EGL_COLOR_FORMAT_BAYER_CRBC = 0x4A, /**< Bayer format - one channel in one surface with interleaved CRBC ordering. */
|
| 193 |
+
CU_EGL_COLOR_FORMAT_BAYER_CBRC = 0x4B, /**< Bayer format - one channel in one surface with interleaved CBRC ordering. */
|
| 194 |
+
CU_EGL_COLOR_FORMAT_BAYER10_CCCC = 0x4C, /**< Bayer10 format - one channel in one surface with interleaved CCCC ordering. Out of 16 bits, 10 bits used 6 bits No-op. */
|
| 195 |
+
CU_EGL_COLOR_FORMAT_BAYER12_BCCR = 0x4D, /**< Bayer12 format - one channel in one surface with interleaved BCCR ordering. Out of 16 bits, 12 bits used 4 bits No-op. */
|
| 196 |
+
CU_EGL_COLOR_FORMAT_BAYER12_RCCB = 0x4E, /**< Bayer12 format - one channel in one surface with interleaved RCCB ordering. Out of 16 bits, 12 bits used 4 bits No-op. */
|
| 197 |
+
CU_EGL_COLOR_FORMAT_BAYER12_CRBC = 0x4F, /**< Bayer12 format - one channel in one surface with interleaved CRBC ordering. Out of 16 bits, 12 bits used 4 bits No-op. */
|
| 198 |
+
CU_EGL_COLOR_FORMAT_BAYER12_CBRC = 0x50, /**< Bayer12 format - one channel in one surface with interleaved CBRC ordering. Out of 16 bits, 12 bits used 4 bits No-op. */
|
| 199 |
+
CU_EGL_COLOR_FORMAT_BAYER12_CCCC = 0x51, /**< Bayer12 format - one channel in one surface with interleaved CCCC ordering. Out of 16 bits, 12 bits used 4 bits No-op. */
|
| 200 |
+
CU_EGL_COLOR_FORMAT_Y = 0x52, /**< Color format for single Y plane. */
|
| 201 |
+
CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020 = 0x53, /**< Y, UV in two surfaces (UV as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. */
|
| 202 |
+
CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020 = 0x54, /**< Y, VU in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. */
|
| 203 |
+
CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020 = 0x55, /**< Y, U, V each in a separate surface, U/V width = 1/2 Y width, U/V height= 1/2 Y height. */
|
| 204 |
+
CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020 = 0x56, /**< Y, V, U each in a separate surface, U/V width = 1/2 Y width, U/V height
|
| 205 |
+
= 1/2 Y height. */
|
| 206 |
+
CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709 = 0x57, /**< Y, UV in two surfaces (UV as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. */
|
| 207 |
+
CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709 = 0x58, /**< Y, VU in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. */
|
| 208 |
+
CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709 = 0x59, /**< Y, U, V each in a separate surface, U/V width = 1/2 Y width, U/V height
|
| 209 |
+
= 1/2 Y height. */
|
| 210 |
+
CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709 = 0x5A, /**< Y, V, U each in a separate surface, U/V width = 1/2 Y width, U/V height = 1/2 Y height. */
|
| 211 |
+
CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 = 0x5B, /**< Y10, V10U10 in two surfaces (VU as one surface), U/V width = 1/2 Y width, U/V height = 1/2 Y height. */
|
| 212 |
+
CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 = 0x5C, /**< Y10, V10U10 in two surfaces (VU as one surface), U/V width = 1/2 Y width, U/V height = 1/2 Y height. */
|
| 213 |
+
CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020 = 0x5D, /**< Y10, V10U10 in two surfaces(VU as one surface) U/V width = 1/2 Y width, U/V height = Y height. */
|
| 214 |
+
CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR = 0x5E, /**< Y10, V10U10 in two surfaces(VU as one surface) U/V width = 1/2 Y width, U/V height = Y height. */
|
| 215 |
+
CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709 = 0x5F, /**< Y10, V10U10 in two surfaces(VU as one surface) U/V width = 1/2 Y width, U/V height = Y height. */
|
| 216 |
+
CU_EGL_COLOR_FORMAT_Y_ER = 0x60, /**< Extended Range Color format for single Y plane. */
|
| 217 |
+
CU_EGL_COLOR_FORMAT_Y_709_ER = 0x61, /**< Extended Range Color format for single Y plane. */
|
| 218 |
+
CU_EGL_COLOR_FORMAT_Y10_ER = 0x62, /**< Extended Range Color format for single Y10 plane. */
|
| 219 |
+
CU_EGL_COLOR_FORMAT_Y10_709_ER = 0x63, /**< Extended Range Color format for single Y10 plane. */
|
| 220 |
+
CU_EGL_COLOR_FORMAT_Y12_ER = 0x64, /**< Extended Range Color format for single Y12 plane. */
|
| 221 |
+
CU_EGL_COLOR_FORMAT_Y12_709_ER = 0x65, /**< Extended Range Color format for single Y12 plane. */
|
| 222 |
+
CU_EGL_COLOR_FORMAT_YUVA = 0x66, /**< Y, U, V, A four channels in one surface, interleaved as AVUY. */
|
| 223 |
+
CU_EGL_COLOR_FORMAT_YUV = 0x67, /**< Y, U, V three channels in one surface, interleaved as VUY. Only pitch linear format supported. */
|
| 224 |
+
CU_EGL_COLOR_FORMAT_YVYU = 0x68, /**< Y, U, V in one surface, interleaved as YVYU in one channel. */
|
| 225 |
+
CU_EGL_COLOR_FORMAT_VYUY = 0x69, /**< Y, U, V in one surface, interleaved as VYUY in one channel. */
|
| 226 |
+
CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER = 0x6A, /**< Extended Range Y10, V10U10 in two surfaces(VU as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. */
|
| 227 |
+
CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER = 0x6B, /**< Extended Range Y10, V10U10 in two surfaces(VU as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. */
|
| 228 |
+
CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER = 0x6C, /**< Extended Range Y10, V10U10 in two surfaces (VU as one surface) U/V width = Y width, U/V height = Y height. */
|
| 229 |
+
CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER = 0x6D, /**< Extended Range Y10, V10U10 in two surfaces (VU as one surface) U/V width = Y width, U/V height = Y height. */
|
| 230 |
+
CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER = 0x6E, /**< Extended Range Y12, V12U12 in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. */
|
| 231 |
+
CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER = 0x6F, /**< Extended Range Y12, V12U12 in two surfaces (VU as one surface) U/V width = 1/2 Y width, U/V height = 1/2 Y height. */
|
| 232 |
+
CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER = 0x70, /**< Extended Range Y12, V12U12 in two surfaces (VU as one surface) U/V width = Y width, U/V height = Y height. */
|
| 233 |
+
CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER = 0x71, /**< Extended Range Y12, V12U12 in two surfaces (VU as one surface) U/V width = Y width, U/V height = Y height. */
|
| 234 |
+
CU_EGL_COLOR_FORMAT_MAX
|
| 235 |
+
} CUeglColorFormat;
|
| 236 |
+
|
| 237 |
+
/**
|
| 238 |
+
* CUDA EGLFrame structure Descriptor - structure defining one frame of EGL.
|
| 239 |
+
*
|
| 240 |
+
* Each frame may contain one or more planes depending on whether the surface * is Multiplanar or not.
|
| 241 |
+
*/
|
| 242 |
+
typedef struct CUeglFrame_st {
|
| 243 |
+
union {
|
| 244 |
+
CUarray pArray[MAX_PLANES]; /**< Array of CUarray corresponding to each plane*/
|
| 245 |
+
void* pPitch[MAX_PLANES]; /**< Array of Pointers corresponding to each plane*/
|
| 246 |
+
} frame;
|
| 247 |
+
unsigned int width; /**< Width of first plane */
|
| 248 |
+
unsigned int height; /**< Height of first plane */
|
| 249 |
+
unsigned int depth; /**< Depth of first plane */
|
| 250 |
+
unsigned int pitch; /**< Pitch of first plane */
|
| 251 |
+
unsigned int planeCount; /**< Number of planes */
|
| 252 |
+
unsigned int numChannels; /**< Number of channels for the plane */
|
| 253 |
+
CUeglFrameType frameType; /**< Array or Pitch */
|
| 254 |
+
CUeglColorFormat eglColorFormat; /**< CUDA EGL Color Format*/
|
| 255 |
+
CUarray_format cuFormat; /**< CUDA Array Format*/
|
| 256 |
+
} CUeglFrame_v1;
|
| 257 |
+
typedef CUeglFrame_v1 CUeglFrame;
|
| 258 |
+
|
| 259 |
+
/**
|
| 260 |
+
* CUDA EGLSream Connection
|
| 261 |
+
*/
|
| 262 |
+
typedef struct CUeglStreamConnection_st* CUeglStreamConnection;
|
| 263 |
+
|
| 264 |
+
/** @} */ /* END CUDA_TYPES */
|
| 265 |
+
|
| 266 |
+
/**
|
| 267 |
+
* \file cudaEGL.h
|
| 268 |
+
* \brief Header file for the EGL interoperability functions of the
|
| 269 |
+
* low-level CUDA driver application programming interface.
|
| 270 |
+
*/
|
| 271 |
+
|
| 272 |
+
/**
|
| 273 |
+
* \defgroup CUDA_EGL EGL Interoperability
|
| 274 |
+
* \ingroup CUDA_DRIVER
|
| 275 |
+
*
|
| 276 |
+
* ___MANBRIEF___ EGL interoperability functions of the low-level CUDA
|
| 277 |
+
* driver API (___CURRENT_FILE___) ___ENDMANBRIEF___
|
| 278 |
+
*
|
| 279 |
+
* This section describes the EGL interoperability functions of the
|
| 280 |
+
* low-level CUDA driver application programming interface.
|
| 281 |
+
*
|
| 282 |
+
* @{
|
| 283 |
+
*/
|
| 284 |
+
|
| 285 |
+
/**
|
| 286 |
+
* \brief Registers an EGL image
|
| 287 |
+
*
|
| 288 |
+
* Registers the EGLImageKHR specified by \p image for access by
|
| 289 |
+
* CUDA. A handle to the registered object is returned as \p pCudaResource.
|
| 290 |
+
* Additional Mapping/Unmapping is not required for the registered resource and
|
| 291 |
+
* ::cuGraphicsResourceGetMappedEglFrame can be directly called on the \p pCudaResource.
|
| 292 |
+
*
|
| 293 |
+
* The application will be responsible for synchronizing access to shared objects.
|
| 294 |
+
* The application must ensure that any pending operation which access the objects have completed
|
| 295 |
+
* before passing control to CUDA. This may be accomplished by issuing and waiting for
|
| 296 |
+
* glFinish command on all GLcontexts (for OpenGL and likewise for other APIs).
|
| 297 |
+
* The application will be also responsible for ensuring that any pending operation on the
|
| 298 |
+
* registered CUDA resource has completed prior to executing subsequent commands in other APIs
|
| 299 |
+
* accesing the same memory objects.
|
| 300 |
+
* This can be accomplished by calling cuCtxSynchronize or cuEventSynchronize (preferably).
|
| 301 |
+
*
|
| 302 |
+
* The surface's intended usage is specified using \p flags, as follows:
|
| 303 |
+
*
|
| 304 |
+
* - ::CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE: Specifies no hints about how this
|
| 305 |
+
* resource will be used. It is therefore assumed that this resource will be
|
| 306 |
+
* read from and written to by CUDA. This is the default value.
|
| 307 |
+
* - ::CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY: Specifies that CUDA
|
| 308 |
+
* will not write to this resource.
|
| 309 |
+
* - ::CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD: Specifies that
|
| 310 |
+
* CUDA will not read from this resource and will write over the
|
| 311 |
+
* entire contents of the resource, so none of the data previously
|
| 312 |
+
* stored in the resource will be preserved.
|
| 313 |
+
*
|
| 314 |
+
* The EGLImageKHR is an object which can be used to create EGLImage target resource. It is defined as a void pointer.
|
| 315 |
+
* typedef void* EGLImageKHR
|
| 316 |
+
*
|
| 317 |
+
* \param pCudaResource - Pointer to the returned object handle
|
| 318 |
+
* \param image - An EGLImageKHR image which can be used to create target resource.
|
| 319 |
+
* \param flags - Map flags
|
| 320 |
+
*
|
| 321 |
+
* \return
|
| 322 |
+
* ::CUDA_SUCCESS,
|
| 323 |
+
* ::CUDA_ERROR_INVALID_HANDLE,
|
| 324 |
+
* ::CUDA_ERROR_ALREADY_MAPPED,
|
| 325 |
+
* ::CUDA_ERROR_INVALID_CONTEXT,
|
| 326 |
+
*
|
| 327 |
+
* \sa ::cuGraphicsEGLRegisterImage, ::cuGraphicsUnregisterResource,
|
| 328 |
+
* ::cuGraphicsResourceSetMapFlags, ::cuGraphicsMapResources,
|
| 329 |
+
* ::cuGraphicsUnmapResources,
|
| 330 |
+
* ::cudaGraphicsEGLRegisterImage
|
| 331 |
+
*/
|
| 332 |
+
CUresult CUDAAPI cuGraphicsEGLRegisterImage(CUgraphicsResource *pCudaResource, EGLImageKHR image, unsigned int flags);
|
| 333 |
+
|
| 334 |
+
/**
|
| 335 |
+
* \brief Connect CUDA to EGLStream as a consumer.
|
| 336 |
+
*
|
| 337 |
+
* Connect CUDA as a consumer to EGLStreamKHR specified by \p stream.
|
| 338 |
+
*
|
| 339 |
+
* The EGLStreamKHR is an EGL object that transfers a sequence of image frames from one
|
| 340 |
+
* API to another.
|
| 341 |
+
*
|
| 342 |
+
* \param conn - Pointer to the returned connection handle
|
| 343 |
+
* \param stream - EGLStreamKHR handle
|
| 344 |
+
*
|
| 345 |
+
* \return
|
| 346 |
+
* ::CUDA_SUCCESS,
|
| 347 |
+
* ::CUDA_ERROR_INVALID_HANDLE,
|
| 348 |
+
* ::CUDA_ERROR_INVALID_CONTEXT,
|
| 349 |
+
*
|
| 350 |
+
* \sa ::cuEGLStreamConsumerConnect, ::cuEGLStreamConsumerDisconnect,
|
| 351 |
+
* ::cuEGLStreamConsumerAcquireFrame, ::cuEGLStreamConsumerReleaseFrame,
|
| 352 |
+
* ::cudaEGLStreamConsumerConnect
|
| 353 |
+
*/
|
| 354 |
+
CUresult CUDAAPI cuEGLStreamConsumerConnect(CUeglStreamConnection *conn, EGLStreamKHR stream);
|
| 355 |
+
|
| 356 |
+
/**
|
| 357 |
+
* \brief Connect CUDA to EGLStream as a consumer with given flags.
|
| 358 |
+
*
|
| 359 |
+
* Connect CUDA as a consumer to EGLStreamKHR specified by \p stream with specified \p flags defined by CUeglResourceLocationFlags.
|
| 360 |
+
*
|
| 361 |
+
* The flags specify whether the consumer wants to access frames from system memory or video memory.
|
| 362 |
+
* Default is ::CU_EGL_RESOURCE_LOCATION_VIDMEM.
|
| 363 |
+
*
|
| 364 |
+
* \param conn - Pointer to the returned connection handle
|
| 365 |
+
* \param stream - EGLStreamKHR handle
|
| 366 |
+
* \param flags - Flags denote intended location - system or video.
|
| 367 |
+
*
|
| 368 |
+
* \return
|
| 369 |
+
* ::CUDA_SUCCESS,
|
| 370 |
+
* ::CUDA_ERROR_INVALID_HANDLE,
|
| 371 |
+
* ::CUDA_ERROR_INVALID_CONTEXT,
|
| 372 |
+
*
|
| 373 |
+
* \sa ::cuEGLStreamConsumerConnect, ::cuEGLStreamConsumerDisconnect,
|
| 374 |
+
* ::cuEGLStreamConsumerAcquireFrame, ::cuEGLStreamConsumerReleaseFrame,
|
| 375 |
+
* ::cudaEGLStreamConsumerConnectWithFlags
|
| 376 |
+
*/
|
| 377 |
+
|
| 378 |
+
CUresult CUDAAPI cuEGLStreamConsumerConnectWithFlags(CUeglStreamConnection *conn, EGLStreamKHR stream, unsigned int flags);
|
| 379 |
+
|
| 380 |
+
/**
|
| 381 |
+
* \brief Disconnect CUDA as a consumer to EGLStream .
|
| 382 |
+
*
|
| 383 |
+
* Disconnect CUDA as a consumer to EGLStreamKHR.
|
| 384 |
+
*
|
| 385 |
+
* \param conn - Conection to disconnect.
|
| 386 |
+
*
|
| 387 |
+
* \return
|
| 388 |
+
* ::CUDA_SUCCESS,
|
| 389 |
+
* ::CUDA_ERROR_INVALID_HANDLE,
|
| 390 |
+
* ::CUDA_ERROR_INVALID_CONTEXT,
|
| 391 |
+
*
|
| 392 |
+
* \sa ::cuEGLStreamConsumerConnect, ::cuEGLStreamConsumerDisconnect,
|
| 393 |
+
* ::cuEGLStreamConsumerAcquireFrame, ::cuEGLStreamConsumerReleaseFrame,
|
| 394 |
+
* ::cudaEGLStreamConsumerDisconnect
|
| 395 |
+
*/
|
| 396 |
+
CUresult CUDAAPI cuEGLStreamConsumerDisconnect(CUeglStreamConnection *conn);
|
| 397 |
+
|
| 398 |
+
/**
|
| 399 |
+
* \brief Acquire an image frame from the EGLStream with CUDA as a consumer.
|
| 400 |
+
*
|
| 401 |
+
* Acquire an image frame from EGLStreamKHR. This API can also acquire an old frame presented
|
| 402 |
+
* by the producer unless explicitly disabled by setting EGL_SUPPORT_REUSE_NV flag to EGL_FALSE
|
| 403 |
+
* during stream initialization. By default, EGLStream is created with this flag set to EGL_TRUE.
|
| 404 |
+
* ::cuGraphicsResourceGetMappedEglFrame can be called on \p pCudaResource to get
|
| 405 |
+
* ::CUeglFrame.
|
| 406 |
+
*
|
| 407 |
+
* \param conn - Connection on which to acquire
|
| 408 |
+
* \param pCudaResource - CUDA resource on which the stream frame will be mapped for use.
|
| 409 |
+
* \param pStream - CUDA stream for synchronization and any data migrations
|
| 410 |
+
* implied by ::CUeglResourceLocationFlags.
|
| 411 |
+
* \param timeout - Desired timeout in usec for a new frame to be acquired.
|
| 412 |
+
* If set as ::CUDA_EGL_INFINITE_TIMEOUT, acquire waits infinitely.
|
| 413 |
+
* After timeout occurs CUDA consumer tries to acquire an old frame
|
| 414 |
+
* if available and EGL_SUPPORT_REUSE_NV flag is set.
|
| 415 |
+
*
|
| 416 |
+
* \return
|
| 417 |
+
* ::CUDA_SUCCESS,
|
| 418 |
+
* ::CUDA_ERROR_INVALID_HANDLE,
|
| 419 |
+
* ::CUDA_ERROR_LAUNCH_TIMEOUT,
|
| 420 |
+
*
|
| 421 |
+
* \sa ::cuEGLStreamConsumerConnect, ::cuEGLStreamConsumerDisconnect,
|
| 422 |
+
* ::cuEGLStreamConsumerAcquireFrame, ::cuEGLStreamConsumerReleaseFrame,
|
| 423 |
+
* ::cudaEGLStreamConsumerAcquireFrame
|
| 424 |
+
*/
|
| 425 |
+
CUresult CUDAAPI cuEGLStreamConsumerAcquireFrame(CUeglStreamConnection *conn,
|
| 426 |
+
CUgraphicsResource *pCudaResource, CUstream *pStream, unsigned int timeout);
|
| 427 |
+
/**
|
| 428 |
+
* \brief Releases the last frame acquired from the EGLStream.
|
| 429 |
+
*
|
| 430 |
+
* Release the acquired image frame specified by \p pCudaResource to EGLStreamKHR.
|
| 431 |
+
* If EGL_SUPPORT_REUSE_NV flag is set to EGL_TRUE, at the time of EGL creation
|
| 432 |
+
* this API doesn't release the last frame acquired on the EGLStream.
|
| 433 |
+
* By default, EGLStream is created with this flag set to EGL_TRUE.
|
| 434 |
+
*
|
| 435 |
+
* \param conn - Connection on which to release
|
| 436 |
+
* \param pCudaResource - CUDA resource whose corresponding frame is to be released
|
| 437 |
+
* \param pStream - CUDA stream on which release will be done.
|
| 438 |
+
*
|
| 439 |
+
* \return
|
| 440 |
+
* ::CUDA_SUCCESS,
|
| 441 |
+
* ::CUDA_ERROR_INVALID_HANDLE,
|
| 442 |
+
*
|
| 443 |
+
* \sa ::cuEGLStreamConsumerConnect, ::cuEGLStreamConsumerDisconnect,
|
| 444 |
+
* ::cuEGLStreamConsumerAcquireFrame, ::cuEGLStreamConsumerReleaseFrame,
|
| 445 |
+
* ::cudaEGLStreamConsumerReleaseFrame
|
| 446 |
+
*/
|
| 447 |
+
CUresult CUDAAPI cuEGLStreamConsumerReleaseFrame(CUeglStreamConnection *conn,
|
| 448 |
+
CUgraphicsResource pCudaResource, CUstream *pStream);
|
| 449 |
+
|
| 450 |
+
/**
|
| 451 |
+
* \brief Connect CUDA to EGLStream as a producer.
|
| 452 |
+
*
|
| 453 |
+
* Connect CUDA as a producer to EGLStreamKHR specified by \p stream.
|
| 454 |
+
*
|
| 455 |
+
* The EGLStreamKHR is an EGL object that transfers a sequence of image frames from one
|
| 456 |
+
* API to another.
|
| 457 |
+
*
|
| 458 |
+
* \param conn - Pointer to the returned connection handle
|
| 459 |
+
* \param stream - EGLStreamKHR handle
|
| 460 |
+
* \param width - width of the image to be submitted to the stream
|
| 461 |
+
* \param height - height of the image to be submitted to the stream
|
| 462 |
+
*
|
| 463 |
+
* \return
|
| 464 |
+
* ::CUDA_SUCCESS,
|
| 465 |
+
* ::CUDA_ERROR_INVALID_HANDLE,
|
| 466 |
+
* ::CUDA_ERROR_INVALID_CONTEXT,
|
| 467 |
+
*
|
| 468 |
+
* \sa ::cuEGLStreamProducerConnect, ::cuEGLStreamProducerDisconnect,
|
| 469 |
+
* ::cuEGLStreamProducerPresentFrame,
|
| 470 |
+
* ::cudaEGLStreamProducerConnect
|
| 471 |
+
*/
|
| 472 |
+
CUresult CUDAAPI cuEGLStreamProducerConnect(CUeglStreamConnection *conn, EGLStreamKHR stream,
|
| 473 |
+
EGLint width, EGLint height);
|
| 474 |
+
|
| 475 |
+
/**
|
| 476 |
+
* \brief Disconnect CUDA as a producer to EGLStream .
|
| 477 |
+
*
|
| 478 |
+
* Disconnect CUDA as a producer to EGLStreamKHR.
|
| 479 |
+
*
|
| 480 |
+
* \param conn - Conection to disconnect.
|
| 481 |
+
*
|
| 482 |
+
* \return
|
| 483 |
+
* ::CUDA_SUCCESS,
|
| 484 |
+
* ::CUDA_ERROR_INVALID_HANDLE,
|
| 485 |
+
* ::CUDA_ERROR_INVALID_CONTEXT,
|
| 486 |
+
*
|
| 487 |
+
* \sa ::cuEGLStreamProducerConnect, ::cuEGLStreamProducerDisconnect,
|
| 488 |
+
* ::cuEGLStreamProducerPresentFrame,
|
| 489 |
+
* ::cudaEGLStreamProducerDisconnect
|
| 490 |
+
*/
|
| 491 |
+
CUresult CUDAAPI cuEGLStreamProducerDisconnect(CUeglStreamConnection *conn);
|
| 492 |
+
|
| 493 |
+
/**
|
| 494 |
+
* \brief Present a CUDA eglFrame to the EGLStream with CUDA as a producer.
|
| 495 |
+
*
|
| 496 |
+
* When a frame is presented by the producer, it gets associated with the EGLStream
|
| 497 |
+
* and thus it is illegal to free the frame before the producer is disconnected.
|
| 498 |
+
* If a frame is freed and reused it may lead to undefined behavior.
|
| 499 |
+
*
|
| 500 |
+
* If producer and consumer are on different GPUs (iGPU and dGPU) then frametype
|
| 501 |
+
* ::CU_EGL_FRAME_TYPE_ARRAY is not supported. ::CU_EGL_FRAME_TYPE_PITCH can be used for
|
| 502 |
+
* such cross-device applications.
|
| 503 |
+
*
|
| 504 |
+
* The ::CUeglFrame is defined as:
|
| 505 |
+
* \code
|
| 506 |
+
* typedef struct CUeglFrame_st {
|
| 507 |
+
* union {
|
| 508 |
+
* CUarray pArray[MAX_PLANES];
|
| 509 |
+
* void* pPitch[MAX_PLANES];
|
| 510 |
+
* } frame;
|
| 511 |
+
* unsigned int width;
|
| 512 |
+
* unsigned int height;
|
| 513 |
+
* unsigned int depth;
|
| 514 |
+
* unsigned int pitch;
|
| 515 |
+
* unsigned int planeCount;
|
| 516 |
+
* unsigned int numChannels;
|
| 517 |
+
* CUeglFrameType frameType;
|
| 518 |
+
* CUeglColorFormat eglColorFormat;
|
| 519 |
+
* CUarray_format cuFormat;
|
| 520 |
+
* } CUeglFrame;
|
| 521 |
+
* \endcode
|
| 522 |
+
*
|
| 523 |
+
* For ::CUeglFrame of type ::CU_EGL_FRAME_TYPE_PITCH, the application may present sub-region of a memory
|
| 524 |
+
* allocation. In that case, the pitched pointer will specify the start address of the sub-region in
|
| 525 |
+
* the allocation and corresponding ::CUeglFrame fields will specify the dimensions of the sub-region.
|
| 526 |
+
*
|
| 527 |
+
* \param conn - Connection on which to present the CUDA array
|
| 528 |
+
* \param eglframe - CUDA Eglstream Proucer Frame handle to be sent to the consumer over EglStream.
|
| 529 |
+
* \param pStream - CUDA stream on which to present the frame.
|
| 530 |
+
*
|
| 531 |
+
* \return
|
| 532 |
+
* ::CUDA_SUCCESS,
|
| 533 |
+
* ::CUDA_ERROR_INVALID_HANDLE,
|
| 534 |
+
*
|
| 535 |
+
* \sa ::cuEGLStreamProducerConnect, ::cuEGLStreamProducerDisconnect,
|
| 536 |
+
* ::cuEGLStreamProducerReturnFrame,
|
| 537 |
+
* ::cudaEGLStreamProducerPresentFrame
|
| 538 |
+
*/
|
| 539 |
+
CUresult CUDAAPI cuEGLStreamProducerPresentFrame(CUeglStreamConnection *conn,
|
| 540 |
+
CUeglFrame eglframe, CUstream *pStream);
|
| 541 |
+
|
| 542 |
+
/**
|
| 543 |
+
* \brief Return the CUDA eglFrame to the EGLStream released by the consumer.
|
| 544 |
+
*
|
| 545 |
+
* This API can potentially return CUDA_ERROR_LAUNCH_TIMEOUT if the consumer has not
|
| 546 |
+
* returned a frame to EGL stream. If timeout is returned the application can retry.
|
| 547 |
+
*
|
| 548 |
+
* \param conn - Connection on which to return
|
| 549 |
+
* \param eglframe - CUDA Eglstream Proucer Frame handle returned from the consumer over EglStream.
|
| 550 |
+
* \param pStream - CUDA stream on which to return the frame.
|
| 551 |
+
*
|
| 552 |
+
* \return
|
| 553 |
+
* ::CUDA_SUCCESS,
|
| 554 |
+
* ::CUDA_ERROR_INVALID_HANDLE,
|
| 555 |
+
* ::CUDA_ERROR_LAUNCH_TIMEOUT
|
| 556 |
+
*
|
| 557 |
+
* \sa ::cuEGLStreamProducerConnect, ::cuEGLStreamProducerDisconnect,
|
| 558 |
+
* ::cuEGLStreamProducerPresentFrame,
|
| 559 |
+
* ::cudaEGLStreamProducerReturnFrame
|
| 560 |
+
*/
|
| 561 |
+
CUresult CUDAAPI cuEGLStreamProducerReturnFrame(CUeglStreamConnection *conn,
|
| 562 |
+
CUeglFrame *eglframe, CUstream *pStream);
|
| 563 |
+
|
| 564 |
+
/**
|
| 565 |
+
* \brief Get an eglFrame through which to access a registered EGL graphics resource.
|
| 566 |
+
*
|
| 567 |
+
* Returns in \p *eglFrame an eglFrame pointer through which the registered graphics resource
|
| 568 |
+
* \p resource may be accessed.
|
| 569 |
+
* This API can only be called for registered EGL graphics resources.
|
| 570 |
+
*
|
| 571 |
+
* The ::CUeglFrame is defined as:
|
| 572 |
+
* \code
|
| 573 |
+
* typedef struct CUeglFrame_st {
|
| 574 |
+
* union {
|
| 575 |
+
* CUarray pArray[MAX_PLANES];
|
| 576 |
+
* void* pPitch[MAX_PLANES];
|
| 577 |
+
* } frame;
|
| 578 |
+
* unsigned int width;
|
| 579 |
+
* unsigned int height;
|
| 580 |
+
* unsigned int depth;
|
| 581 |
+
* unsigned int pitch;
|
| 582 |
+
* unsigned int planeCount;
|
| 583 |
+
* unsigned int numChannels;
|
| 584 |
+
* CUeglFrameType frameType;
|
| 585 |
+
* CUeglColorFormat eglColorFormat;
|
| 586 |
+
* CUarray_format cuFormat;
|
| 587 |
+
* } CUeglFrame;
|
| 588 |
+
* \endcode
|
| 589 |
+
*
|
| 590 |
+
* If \p resource is not registered then ::CUDA_ERROR_NOT_MAPPED is returned.
|
| 591 |
+
* *
|
| 592 |
+
* \param eglFrame - Returned eglFrame.
|
| 593 |
+
* \param resource - Registered resource to access.
|
| 594 |
+
* \param index - Index for cubemap surfaces.
|
| 595 |
+
* \param mipLevel - Mipmap level for the subresource to access.
|
| 596 |
+
*
|
| 597 |
+
* \return
|
| 598 |
+
* ::CUDA_SUCCESS,
|
| 599 |
+
* ::CUDA_ERROR_DEINITIALIZED,
|
| 600 |
+
* ::CUDA_ERROR_NOT_INITIALIZED,
|
| 601 |
+
* ::CUDA_ERROR_INVALID_CONTEXT,
|
| 602 |
+
* ::CUDA_ERROR_INVALID_VALUE,
|
| 603 |
+
* ::CUDA_ERROR_INVALID_HANDLE,
|
| 604 |
+
* ::CUDA_ERROR_NOT_MAPPED
|
| 605 |
+
*
|
| 606 |
+
* \sa
|
| 607 |
+
* ::cuGraphicsMapResources,
|
| 608 |
+
* ::cuGraphicsSubResourceGetMappedArray,
|
| 609 |
+
* ::cuGraphicsResourceGetMappedPointer,
|
| 610 |
+
* ::cudaGraphicsResourceGetMappedEglFrame
|
| 611 |
+
*/
|
| 612 |
+
CUresult CUDAAPI cuGraphicsResourceGetMappedEglFrame(CUeglFrame* eglFrame, CUgraphicsResource resource, unsigned int index, unsigned int mipLevel);
|
| 613 |
+
|
| 614 |
+
/**
|
| 615 |
+
* \brief Creates an event from EGLSync object
|
| 616 |
+
*
|
| 617 |
+
* Creates an event *phEvent from an EGLSyncKHR eglSync with the flags specified
|
| 618 |
+
* via \p flags. Valid flags include:
|
| 619 |
+
* - ::CU_EVENT_DEFAULT: Default event creation flag.
|
| 620 |
+
* - ::CU_EVENT_BLOCKING_SYNC: Specifies that the created event should use blocking
|
| 621 |
+
* synchronization. A CPU thread that uses ::cuEventSynchronize() to wait on
|
| 622 |
+
* an event created with this flag will block until the event has actually
|
| 623 |
+
* been completed.
|
| 624 |
+
*
|
| 625 |
+
* Once the \p eglSync gets destroyed, ::cuEventDestroy is the only API
|
| 626 |
+
* that can be invoked on the event.
|
| 627 |
+
*
|
| 628 |
+
* ::cuEventRecord and TimingData are not supported for events created from EGLSync.
|
| 629 |
+
*
|
| 630 |
+
* The EGLSyncKHR is an opaque handle to an EGL sync object.
|
| 631 |
+
* typedef void* EGLSyncKHR
|
| 632 |
+
*
|
| 633 |
+
* \param phEvent - Returns newly created event
|
| 634 |
+
* \param eglSync - Opaque handle to EGLSync object
|
| 635 |
+
* \param flags - Event creation flags
|
| 636 |
+
*
|
| 637 |
+
* \return
|
| 638 |
+
* ::CUDA_SUCCESS,
|
| 639 |
+
* ::CUDA_ERROR_DEINITIALIZED,
|
| 640 |
+
* ::CUDA_ERROR_NOT_INITIALIZED,
|
| 641 |
+
* ::CUDA_ERROR_INVALID_CONTEXT,
|
| 642 |
+
* ::CUDA_ERROR_INVALID_VALUE,
|
| 643 |
+
* ::CUDA_ERROR_OUT_OF_MEMORY
|
| 644 |
+
*
|
| 645 |
+
* \sa
|
| 646 |
+
* ::cuEventQuery,
|
| 647 |
+
* ::cuEventSynchronize,
|
| 648 |
+
* ::cuEventDestroy
|
| 649 |
+
*/
|
| 650 |
+
CUresult CUDAAPI cuEventCreateFromEGLSync(CUevent *phEvent, EGLSyncKHR eglSync, unsigned int flags);
|
| 651 |
+
|
| 652 |
+
/** @} */ /* END CUDA_EGL */
|
| 653 |
+
|
| 654 |
+
#ifdef __cplusplus
|
| 655 |
+
};
|
| 656 |
+
#endif
|
| 657 |
+
|
| 658 |
+
#endif
|
| 659 |
+
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cudaEGLTypedefs.h
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2020-2021 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO LICENSEE:
|
| 5 |
+
*
|
| 6 |
+
* This source code and/or documentation ("Licensed Deliverables") are
|
| 7 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 8 |
+
* international Copyright laws.
|
| 9 |
+
*
|
| 10 |
+
* These Licensed Deliverables contained herein is PROPRIETARY and
|
| 11 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and
|
| 12 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 13 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 14 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 15 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 16 |
+
* of the Licensed Deliverables to any third party without the express
|
| 17 |
+
* written consent of NVIDIA is prohibited.
|
| 18 |
+
*
|
| 19 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 20 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 21 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
|
| 22 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 23 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 24 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 25 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 26 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 27 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 28 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 29 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 30 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 31 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 32 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 33 |
+
*
|
| 34 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 35 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 36 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 37 |
+
* computer software documentation" as such terms are used in 48
|
| 38 |
+
* C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
|
| 39 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 40 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 41 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 42 |
+
* only those rights set forth herein.
|
| 43 |
+
*
|
| 44 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 45 |
+
* software must include, in the user documentation and internal
|
| 46 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 47 |
+
* Users Notice.
|
| 48 |
+
*/
|
| 49 |
+
|
| 50 |
+
#ifndef CUDAEGLTYPEDEFS_H
|
| 51 |
+
#define CUDAEGLTYPEDEFS_H
|
| 52 |
+
|
| 53 |
+
#include <cudaEGL.h>
|
| 54 |
+
|
| 55 |
+
#ifdef __cplusplus
|
| 56 |
+
extern "C" {
|
| 57 |
+
#endif // __cplusplus
|
| 58 |
+
|
| 59 |
+
/*
|
| 60 |
+
* Macros for the latest version for each driver function in cudaEGL.h
|
| 61 |
+
*/
|
| 62 |
+
#define PFN_cuGraphicsEGLRegisterImage PFN_cuGraphicsEGLRegisterImage_v7000
|
| 63 |
+
#define PFN_cuEGLStreamConsumerConnect PFN_cuEGLStreamConsumerConnect_v7000
|
| 64 |
+
#define PFN_cuEGLStreamConsumerConnectWithFlags PFN_cuEGLStreamConsumerConnectWithFlags_v8000
|
| 65 |
+
#define PFN_cuEGLStreamConsumerDisconnect PFN_cuEGLStreamConsumerDisconnect_v7000
|
| 66 |
+
#define PFN_cuEGLStreamConsumerAcquireFrame PFN_cuEGLStreamConsumerAcquireFrame_v7000
|
| 67 |
+
#define PFN_cuEGLStreamConsumerReleaseFrame PFN_cuEGLStreamConsumerReleaseFrame_v7000
|
| 68 |
+
#define PFN_cuEGLStreamProducerConnect PFN_cuEGLStreamProducerConnect_v7000
|
| 69 |
+
#define PFN_cuEGLStreamProducerDisconnect PFN_cuEGLStreamProducerDisconnect_v7000
|
| 70 |
+
#define PFN_cuEGLStreamProducerPresentFrame PFN_cuEGLStreamProducerPresentFrame_v7000
|
| 71 |
+
#define PFN_cuEGLStreamProducerReturnFrame PFN_cuEGLStreamProducerReturnFrame_v7000
|
| 72 |
+
#define PFN_cuGraphicsResourceGetMappedEglFrame PFN_cuGraphicsResourceGetMappedEglFrame_v7000
|
| 73 |
+
#define PFN_cuEventCreateFromEGLSync PFN_cuEventCreateFromEGLSync_v9000
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
/**
|
| 77 |
+
* Type definitions for functions defined in cudaEGL.h
|
| 78 |
+
*/
|
| 79 |
+
typedef CUresult (CUDAAPI *PFN_cuGraphicsEGLRegisterImage_v7000)(CUgraphicsResource CUDAAPI *pCudaResource, EGLImageKHR image, unsigned int flags);
|
| 80 |
+
typedef CUresult (CUDAAPI *PFN_cuEGLStreamConsumerConnect_v7000)(CUeglStreamConnection CUDAAPI *conn, EGLStreamKHR stream);
|
| 81 |
+
typedef CUresult (CUDAAPI *PFN_cuEGLStreamConsumerConnectWithFlags_v8000)(CUeglStreamConnection CUDAAPI *conn, EGLStreamKHR stream, unsigned int flags);
|
| 82 |
+
typedef CUresult (CUDAAPI *PFN_cuEGLStreamConsumerDisconnect_v7000)(CUeglStreamConnection CUDAAPI *conn);
|
| 83 |
+
typedef CUresult (CUDAAPI *PFN_cuEGLStreamConsumerAcquireFrame_v7000)(CUeglStreamConnection CUDAAPI *conn, CUgraphicsResource CUDAAPI *pCudaResource, CUstream CUDAAPI *pStream, unsigned int timeout);
|
| 84 |
+
typedef CUresult (CUDAAPI *PFN_cuEGLStreamConsumerReleaseFrame_v7000)(CUeglStreamConnection CUDAAPI *conn, CUgraphicsResource pCudaResource, CUstream CUDAAPI *pStream);
|
| 85 |
+
typedef CUresult (CUDAAPI *PFN_cuEGLStreamProducerConnect_v7000)(CUeglStreamConnection CUDAAPI *conn, EGLStreamKHR stream, EGLint width, EGLint height);
|
| 86 |
+
typedef CUresult (CUDAAPI *PFN_cuEGLStreamProducerDisconnect_v7000)(CUeglStreamConnection CUDAAPI *conn);
|
| 87 |
+
typedef CUresult (CUDAAPI *PFN_cuEGLStreamProducerPresentFrame_v7000)(CUeglStreamConnection CUDAAPI *conn, CUeglFrame_v1 eglframe, CUstream CUDAAPI *pStream);
|
| 88 |
+
typedef CUresult (CUDAAPI *PFN_cuEGLStreamProducerReturnFrame_v7000)(CUeglStreamConnection CUDAAPI *conn, CUeglFrame_v1 CUDAAPI *eglframe, CUstream CUDAAPI *pStream);
|
| 89 |
+
typedef CUresult (CUDAAPI *PFN_cuGraphicsResourceGetMappedEglFrame_v7000)(CUeglFrame_v1 CUDAAPI *eglFrame, CUgraphicsResource resource, unsigned int index, unsigned int mipLevel);
|
| 90 |
+
typedef CUresult (CUDAAPI *PFN_cuEventCreateFromEGLSync_v9000)(CUevent CUDAAPI *phEvent, EGLSyncKHR eglSync, unsigned int flags);
|
| 91 |
+
|
| 92 |
+
#ifdef __cplusplus
|
| 93 |
+
}
|
| 94 |
+
#endif // __cplusplus
|
| 95 |
+
|
| 96 |
+
#endif // file guard
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cudaGL.h
ADDED
|
@@ -0,0 +1,608 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1993-2014 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO LICENSEE:
|
| 5 |
+
*
|
| 6 |
+
* This source code and/or documentation ("Licensed Deliverables") are
|
| 7 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 8 |
+
* international Copyright laws.
|
| 9 |
+
*
|
| 10 |
+
* These Licensed Deliverables contained herein is PROPRIETARY and
|
| 11 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and
|
| 12 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 13 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 14 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 15 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 16 |
+
* of the Licensed Deliverables to any third party without the express
|
| 17 |
+
* written consent of NVIDIA is prohibited.
|
| 18 |
+
*
|
| 19 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 20 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 21 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
|
| 22 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 23 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 24 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 25 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 26 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 27 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 28 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 29 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 30 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 31 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 32 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 33 |
+
*
|
| 34 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 35 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 36 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 37 |
+
* computer software documentation" as such terms are used in 48
|
| 38 |
+
* C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
|
| 39 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 40 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 41 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 42 |
+
* only those rights set forth herein.
|
| 43 |
+
*
|
| 44 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 45 |
+
* software must include, in the user documentation and internal
|
| 46 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 47 |
+
* Users Notice.
|
| 48 |
+
*/
|
| 49 |
+
|
| 50 |
+
#ifndef CUDAGL_H
|
| 51 |
+
#define CUDAGL_H
|
| 52 |
+
|
| 53 |
+
#include <cuda.h>
|
| 54 |
+
#include <GL/gl.h>
|
| 55 |
+
|
| 56 |
+
#if defined(__CUDA_API_VERSION_INTERNAL) || defined(__DOXYGEN_ONLY__) || defined(CUDA_ENABLE_DEPRECATED)
|
| 57 |
+
#define __CUDA_DEPRECATED
|
| 58 |
+
#elif defined(_MSC_VER)
|
| 59 |
+
#define __CUDA_DEPRECATED __declspec(deprecated)
|
| 60 |
+
#elif defined(__GNUC__)
|
| 61 |
+
#define __CUDA_DEPRECATED __attribute__((deprecated))
|
| 62 |
+
#else
|
| 63 |
+
#define __CUDA_DEPRECATED
|
| 64 |
+
#endif
|
| 65 |
+
|
| 66 |
+
#ifdef CUDA_FORCE_API_VERSION
|
| 67 |
+
#error "CUDA_FORCE_API_VERSION is no longer supported."
|
| 68 |
+
#endif
|
| 69 |
+
|
| 70 |
+
#if defined(__CUDA_API_VERSION_INTERNAL) || defined(CUDA_API_PER_THREAD_DEFAULT_STREAM)
|
| 71 |
+
#define __CUDA_API_PER_THREAD_DEFAULT_STREAM
|
| 72 |
+
#define __CUDA_API_PTDS(api) api ## _ptds
|
| 73 |
+
#define __CUDA_API_PTSZ(api) api ## _ptsz
|
| 74 |
+
#else
|
| 75 |
+
#define __CUDA_API_PTDS(api) api
|
| 76 |
+
#define __CUDA_API_PTSZ(api) api
|
| 77 |
+
#endif
|
| 78 |
+
|
| 79 |
+
#define cuGLCtxCreate cuGLCtxCreate_v2
|
| 80 |
+
#define cuGLMapBufferObject __CUDA_API_PTDS(cuGLMapBufferObject_v2)
|
| 81 |
+
#define cuGLMapBufferObjectAsync __CUDA_API_PTSZ(cuGLMapBufferObjectAsync_v2)
|
| 82 |
+
#define cuGLGetDevices cuGLGetDevices_v2
|
| 83 |
+
|
| 84 |
+
#ifdef __cplusplus
|
| 85 |
+
extern "C" {
|
| 86 |
+
#endif
|
| 87 |
+
|
| 88 |
+
/**
|
| 89 |
+
* \file cudaGL.h
|
| 90 |
+
* \brief Header file for the OpenGL interoperability functions of the
|
| 91 |
+
* low-level CUDA driver application programming interface.
|
| 92 |
+
*/
|
| 93 |
+
|
| 94 |
+
/**
|
| 95 |
+
* \defgroup CUDA_GL OpenGL Interoperability
|
| 96 |
+
* \ingroup CUDA_DRIVER
|
| 97 |
+
*
|
| 98 |
+
* ___MANBRIEF___ OpenGL interoperability functions of the low-level CUDA
|
| 99 |
+
* driver API (___CURRENT_FILE___) ___ENDMANBRIEF___
|
| 100 |
+
*
|
| 101 |
+
* This section describes the OpenGL interoperability functions of the
|
| 102 |
+
* low-level CUDA driver application programming interface. Note that mapping
|
| 103 |
+
* of OpenGL resources is performed with the graphics API agnostic, resource
|
| 104 |
+
* mapping interface described in \ref CUDA_GRAPHICS "Graphics Interoperability".
|
| 105 |
+
*
|
| 106 |
+
* @{
|
| 107 |
+
*/
|
| 108 |
+
|
| 109 |
+
#if defined(_WIN32)
|
| 110 |
+
#if !defined(WGL_NV_gpu_affinity)
|
| 111 |
+
typedef void* HGPUNV;
|
| 112 |
+
#endif
|
| 113 |
+
#endif /* _WIN32 */
|
| 114 |
+
|
| 115 |
+
/**
|
| 116 |
+
* \brief Registers an OpenGL buffer object
|
| 117 |
+
*
|
| 118 |
+
* Registers the buffer object specified by \p buffer for access by
|
| 119 |
+
* CUDA. A handle to the registered object is returned as \p
|
| 120 |
+
* pCudaResource. The register flags \p Flags specify the intended usage,
|
| 121 |
+
* as follows:
|
| 122 |
+
*
|
| 123 |
+
* - ::CU_GRAPHICS_REGISTER_FLAGS_NONE: Specifies no hints about how this
|
| 124 |
+
* resource will be used. It is therefore assumed that this resource will be
|
| 125 |
+
* read from and written to by CUDA. This is the default value.
|
| 126 |
+
* - ::CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY: Specifies that CUDA
|
| 127 |
+
* will not write to this resource.
|
| 128 |
+
* - ::CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD: Specifies that
|
| 129 |
+
* CUDA will not read from this resource and will write over the
|
| 130 |
+
* entire contents of the resource, so none of the data previously
|
| 131 |
+
* stored in the resource will be preserved.
|
| 132 |
+
*
|
| 133 |
+
* \param pCudaResource - Pointer to the returned object handle
|
| 134 |
+
* \param buffer - name of buffer object to be registered
|
| 135 |
+
* \param Flags - Register flags
|
| 136 |
+
*
|
| 137 |
+
* \return
|
| 138 |
+
* ::CUDA_SUCCESS,
|
| 139 |
+
* ::CUDA_ERROR_INVALID_HANDLE,
|
| 140 |
+
* ::CUDA_ERROR_ALREADY_MAPPED,
|
| 141 |
+
* ::CUDA_ERROR_INVALID_CONTEXT,
|
| 142 |
+
* ::CUDA_ERROR_OPERATING_SYSTEM
|
| 143 |
+
* \notefnerr
|
| 144 |
+
*
|
| 145 |
+
* \sa
|
| 146 |
+
* ::cuGraphicsUnregisterResource,
|
| 147 |
+
* ::cuGraphicsMapResources,
|
| 148 |
+
* ::cuGraphicsResourceGetMappedPointer,
|
| 149 |
+
* ::cudaGraphicsGLRegisterBuffer
|
| 150 |
+
*/
|
| 151 |
+
CUresult CUDAAPI cuGraphicsGLRegisterBuffer(CUgraphicsResource *pCudaResource, GLuint buffer, unsigned int Flags);
|
| 152 |
+
|
| 153 |
+
/**
|
| 154 |
+
* \brief Register an OpenGL texture or renderbuffer object
|
| 155 |
+
*
|
| 156 |
+
* Registers the texture or renderbuffer object specified by \p image for access by CUDA.
|
| 157 |
+
* A handle to the registered object is returned as \p pCudaResource.
|
| 158 |
+
*
|
| 159 |
+
* \p target must match the type of the object, and must be one of ::GL_TEXTURE_2D,
|
| 160 |
+
* ::GL_TEXTURE_RECTANGLE, ::GL_TEXTURE_CUBE_MAP, ::GL_TEXTURE_3D, ::GL_TEXTURE_2D_ARRAY,
|
| 161 |
+
* or ::GL_RENDERBUFFER.
|
| 162 |
+
*
|
| 163 |
+
* The register flags \p Flags specify the intended usage, as follows:
|
| 164 |
+
*
|
| 165 |
+
* - ::CU_GRAPHICS_REGISTER_FLAGS_NONE: Specifies no hints about how this
|
| 166 |
+
* resource will be used. It is therefore assumed that this resource will be
|
| 167 |
+
* read from and written to by CUDA. This is the default value.
|
| 168 |
+
* - ::CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY: Specifies that CUDA
|
| 169 |
+
* will not write to this resource.
|
| 170 |
+
* - ::CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD: Specifies that
|
| 171 |
+
* CUDA will not read from this resource and will write over the
|
| 172 |
+
* entire contents of the resource, so none of the data previously
|
| 173 |
+
* stored in the resource will be preserved.
|
| 174 |
+
* - ::CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST: Specifies that CUDA will
|
| 175 |
+
* bind this resource to a surface reference.
|
| 176 |
+
* - ::CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER: Specifies that CUDA will perform
|
| 177 |
+
* texture gather operations on this resource.
|
| 178 |
+
*
|
| 179 |
+
* The following image formats are supported. For brevity's sake, the list is abbreviated.
|
| 180 |
+
* For ex., {GL_R, GL_RG} X {8, 16} would expand to the following 4 formats
|
| 181 |
+
* {GL_R8, GL_R16, GL_RG8, GL_RG16} :
|
| 182 |
+
* - GL_RED, GL_RG, GL_RGBA, GL_LUMINANCE, GL_ALPHA, GL_LUMINANCE_ALPHA, GL_INTENSITY
|
| 183 |
+
* - {GL_R, GL_RG, GL_RGBA} X {8, 16, 16F, 32F, 8UI, 16UI, 32UI, 8I, 16I, 32I}
|
| 184 |
+
* - {GL_LUMINANCE, GL_ALPHA, GL_LUMINANCE_ALPHA, GL_INTENSITY} X
|
| 185 |
+
* {8, 16, 16F_ARB, 32F_ARB, 8UI_EXT, 16UI_EXT, 32UI_EXT, 8I_EXT, 16I_EXT, 32I_EXT}
|
| 186 |
+
*
|
| 187 |
+
* The following image classes are currently disallowed:
|
| 188 |
+
* - Textures with borders
|
| 189 |
+
* - Multisampled renderbuffers
|
| 190 |
+
*
|
| 191 |
+
* \param pCudaResource - Pointer to the returned object handle
|
| 192 |
+
* \param image - name of texture or renderbuffer object to be registered
|
| 193 |
+
* \param target - Identifies the type of object specified by \p image
|
| 194 |
+
* \param Flags - Register flags
|
| 195 |
+
*
|
| 196 |
+
* \return
|
| 197 |
+
* ::CUDA_SUCCESS,
|
| 198 |
+
* ::CUDA_ERROR_INVALID_HANDLE,
|
| 199 |
+
* ::CUDA_ERROR_ALREADY_MAPPED,
|
| 200 |
+
* ::CUDA_ERROR_INVALID_CONTEXT,
|
| 201 |
+
* ::CUDA_ERROR_OPERATING_SYSTEM
|
| 202 |
+
* \notefnerr
|
| 203 |
+
*
|
| 204 |
+
* \sa
|
| 205 |
+
* ::cuGraphicsUnregisterResource,
|
| 206 |
+
* ::cuGraphicsMapResources,
|
| 207 |
+
* ::cuGraphicsSubResourceGetMappedArray,
|
| 208 |
+
* ::cudaGraphicsGLRegisterImage
|
| 209 |
+
*/
|
| 210 |
+
CUresult CUDAAPI cuGraphicsGLRegisterImage(CUgraphicsResource *pCudaResource, GLuint image, GLenum target, unsigned int Flags);
|
| 211 |
+
|
| 212 |
+
#ifdef _WIN32
|
| 213 |
+
/**
|
| 214 |
+
* \brief Gets the CUDA device associated with hGpu
|
| 215 |
+
*
|
| 216 |
+
* Returns in \p *pDevice the CUDA device associated with a \p hGpu, if
|
| 217 |
+
* applicable.
|
| 218 |
+
*
|
| 219 |
+
* \param pDevice - Device associated with hGpu
|
| 220 |
+
* \param hGpu - Handle to a GPU, as queried via ::WGL_NV_gpu_affinity()
|
| 221 |
+
*
|
| 222 |
+
* \return
|
| 223 |
+
* ::CUDA_SUCCESS,
|
| 224 |
+
* ::CUDA_ERROR_DEINITIALIZED,
|
| 225 |
+
* ::CUDA_ERROR_NOT_INITIALIZED,
|
| 226 |
+
* ::CUDA_ERROR_INVALID_CONTEXT,
|
| 227 |
+
* ::CUDA_ERROR_INVALID_VALUE
|
| 228 |
+
* \notefnerr
|
| 229 |
+
*
|
| 230 |
+
* \sa ::cuGLMapBufferObject,
|
| 231 |
+
* ::cuGLRegisterBufferObject, ::cuGLUnmapBufferObject,
|
| 232 |
+
* ::cuGLUnregisterBufferObject, ::cuGLUnmapBufferObjectAsync,
|
| 233 |
+
* ::cuGLSetBufferObjectMapFlags,
|
| 234 |
+
* ::cudaWGLGetDevice
|
| 235 |
+
*/
|
| 236 |
+
CUresult CUDAAPI cuWGLGetDevice(CUdevice *pDevice, HGPUNV hGpu);
|
| 237 |
+
#endif /* _WIN32 */
|
| 238 |
+
|
| 239 |
+
/**
|
| 240 |
+
* CUDA devices corresponding to an OpenGL device
|
| 241 |
+
*/
|
| 242 |
+
typedef enum CUGLDeviceList_enum {
|
| 243 |
+
CU_GL_DEVICE_LIST_ALL = 0x01, /**< The CUDA devices for all GPUs used by the current OpenGL context */
|
| 244 |
+
CU_GL_DEVICE_LIST_CURRENT_FRAME = 0x02, /**< The CUDA devices for the GPUs used by the current OpenGL context in its currently rendering frame */
|
| 245 |
+
CU_GL_DEVICE_LIST_NEXT_FRAME = 0x03, /**< The CUDA devices for the GPUs to be used by the current OpenGL context in the next frame */
|
| 246 |
+
} CUGLDeviceList;
|
| 247 |
+
|
| 248 |
+
/**
|
| 249 |
+
* \brief Gets the CUDA devices associated with the current OpenGL context
|
| 250 |
+
*
|
| 251 |
+
* Returns in \p *pCudaDeviceCount the number of CUDA-compatible devices
|
| 252 |
+
* corresponding to the current OpenGL context. Also returns in \p *pCudaDevices
|
| 253 |
+
* at most cudaDeviceCount of the CUDA-compatible devices corresponding to
|
| 254 |
+
* the current OpenGL context. If any of the GPUs being used by the current OpenGL
|
| 255 |
+
* context are not CUDA capable then the call will return CUDA_ERROR_NO_DEVICE.
|
| 256 |
+
*
|
| 257 |
+
* The \p deviceList argument may be any of the following:
|
| 258 |
+
* - ::CU_GL_DEVICE_LIST_ALL: Query all devices used by the current OpenGL context.
|
| 259 |
+
* - ::CU_GL_DEVICE_LIST_CURRENT_FRAME: Query the devices used by the current OpenGL context to
|
| 260 |
+
* render the current frame (in SLI).
|
| 261 |
+
* - ::CU_GL_DEVICE_LIST_NEXT_FRAME: Query the devices used by the current OpenGL context to
|
| 262 |
+
* render the next frame (in SLI). Note that this is a prediction, it can't be guaranteed that
|
| 263 |
+
* this is correct in all cases.
|
| 264 |
+
*
|
| 265 |
+
* \param pCudaDeviceCount - Returned number of CUDA devices.
|
| 266 |
+
* \param pCudaDevices - Returned CUDA devices.
|
| 267 |
+
* \param cudaDeviceCount - The size of the output device array pCudaDevices.
|
| 268 |
+
* \param deviceList - The set of devices to return.
|
| 269 |
+
*
|
| 270 |
+
* \return
|
| 271 |
+
* ::CUDA_SUCCESS,
|
| 272 |
+
* ::CUDA_ERROR_NO_DEVICE,
|
| 273 |
+
* ::CUDA_ERROR_INVALID_VALUE,
|
| 274 |
+
* ::CUDA_ERROR_INVALID_CONTEXT,
|
| 275 |
+
* ::CUDA_ERROR_INVALID_GRAPHICS_CONTEXT,
|
| 276 |
+
* ::CUDA_ERROR_OPERATING_SYSTEM
|
| 277 |
+
*
|
| 278 |
+
* \notefnerr
|
| 279 |
+
*
|
| 280 |
+
* \sa
|
| 281 |
+
* ::cuWGLGetDevice,
|
| 282 |
+
* ::cudaGLGetDevices
|
| 283 |
+
*/
|
| 284 |
+
CUresult CUDAAPI cuGLGetDevices(unsigned int *pCudaDeviceCount, CUdevice *pCudaDevices, unsigned int cudaDeviceCount, CUGLDeviceList deviceList);
|
| 285 |
+
|
| 286 |
+
/**
|
| 287 |
+
* \defgroup CUDA_GL_DEPRECATED OpenGL Interoperability [DEPRECATED]
|
| 288 |
+
*
|
| 289 |
+
* ___MANBRIEF___ deprecated OpenGL interoperability functions of the low-level
|
| 290 |
+
* CUDA driver API (___CURRENT_FILE___) ___ENDMANBRIEF___
|
| 291 |
+
*
|
| 292 |
+
* This section describes deprecated OpenGL interoperability functionality.
|
| 293 |
+
*
|
| 294 |
+
* @{
|
| 295 |
+
*/
|
| 296 |
+
|
| 297 |
+
/** Flags to map or unmap a resource */
|
| 298 |
+
typedef enum CUGLmap_flags_enum {
|
| 299 |
+
CU_GL_MAP_RESOURCE_FLAGS_NONE = 0x00,
|
| 300 |
+
CU_GL_MAP_RESOURCE_FLAGS_READ_ONLY = 0x01,
|
| 301 |
+
CU_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD = 0x02,
|
| 302 |
+
} CUGLmap_flags;
|
| 303 |
+
|
| 304 |
+
/**
|
| 305 |
+
* \brief Create a CUDA context for interoperability with OpenGL
|
| 306 |
+
*
|
| 307 |
+
* \deprecated This function is deprecated as of Cuda 5.0.
|
| 308 |
+
*
|
| 309 |
+
* This function is deprecated and should no longer be used. It is
|
| 310 |
+
* no longer necessary to associate a CUDA context with an OpenGL
|
| 311 |
+
* context in order to achieve maximum interoperability performance.
|
| 312 |
+
*
|
| 313 |
+
* \param pCtx - Returned CUDA context
|
| 314 |
+
* \param Flags - Options for CUDA context creation
|
| 315 |
+
* \param device - Device on which to create the context
|
| 316 |
+
*
|
| 317 |
+
* \return
|
| 318 |
+
* ::CUDA_SUCCESS,
|
| 319 |
+
* ::CUDA_ERROR_DEINITIALIZED,
|
| 320 |
+
* ::CUDA_ERROR_NOT_INITIALIZED,
|
| 321 |
+
* ::CUDA_ERROR_INVALID_CONTEXT,
|
| 322 |
+
* ::CUDA_ERROR_INVALID_VALUE,
|
| 323 |
+
* ::CUDA_ERROR_OUT_OF_MEMORY
|
| 324 |
+
* \notefnerr
|
| 325 |
+
*
|
| 326 |
+
* \sa ::cuCtxCreate, ::cuGLInit, ::cuGLMapBufferObject,
|
| 327 |
+
* ::cuGLRegisterBufferObject, ::cuGLUnmapBufferObject,
|
| 328 |
+
* ::cuGLUnregisterBufferObject, ::cuGLMapBufferObjectAsync,
|
| 329 |
+
* ::cuGLUnmapBufferObjectAsync, ::cuGLSetBufferObjectMapFlags,
|
| 330 |
+
* ::cuWGLGetDevice
|
| 331 |
+
*/
|
| 332 |
+
__CUDA_DEPRECATED CUresult CUDAAPI cuGLCtxCreate(CUcontext *pCtx, unsigned int Flags, CUdevice device );
|
| 333 |
+
|
| 334 |
+
/**
|
| 335 |
+
* \brief Initializes OpenGL interoperability
|
| 336 |
+
*
|
| 337 |
+
* \deprecated This function is deprecated as of Cuda 3.0.
|
| 338 |
+
*
|
| 339 |
+
* Initializes OpenGL interoperability. This function is deprecated
|
| 340 |
+
* and calling it is no longer required. It may fail if the needed
|
| 341 |
+
* OpenGL driver facilities are not available.
|
| 342 |
+
*
|
| 343 |
+
* \return
|
| 344 |
+
* ::CUDA_SUCCESS,
|
| 345 |
+
* ::CUDA_ERROR_DEINITIALIZED,
|
| 346 |
+
* ::CUDA_ERROR_NOT_INITIALIZED,
|
| 347 |
+
* ::CUDA_ERROR_INVALID_CONTEXT,
|
| 348 |
+
* ::CUDA_ERROR_UNKNOWN
|
| 349 |
+
* \notefnerr
|
| 350 |
+
*
|
| 351 |
+
* \sa ::cuGLMapBufferObject,
|
| 352 |
+
* ::cuGLRegisterBufferObject, ::cuGLUnmapBufferObject,
|
| 353 |
+
* ::cuGLUnregisterBufferObject, ::cuGLMapBufferObjectAsync,
|
| 354 |
+
* ::cuGLUnmapBufferObjectAsync, ::cuGLSetBufferObjectMapFlags,
|
| 355 |
+
* ::cuWGLGetDevice
|
| 356 |
+
*/
|
| 357 |
+
__CUDA_DEPRECATED CUresult CUDAAPI cuGLInit(void);
|
| 358 |
+
|
| 359 |
+
/**
|
| 360 |
+
* \brief Registers an OpenGL buffer object
|
| 361 |
+
*
|
| 362 |
+
* \deprecated This function is deprecated as of Cuda 3.0.
|
| 363 |
+
*
|
| 364 |
+
* Registers the buffer object specified by \p buffer for access by
|
| 365 |
+
* CUDA. This function must be called before CUDA can map the buffer
|
| 366 |
+
* object. There must be a valid OpenGL context bound to the current
|
| 367 |
+
* thread when this function is called, and the buffer name is
|
| 368 |
+
* resolved by that context.
|
| 369 |
+
*
|
| 370 |
+
* \param buffer - The name of the buffer object to register.
|
| 371 |
+
*
|
| 372 |
+
* \return
|
| 373 |
+
* ::CUDA_SUCCESS,
|
| 374 |
+
* ::CUDA_ERROR_DEINITIALIZED,
|
| 375 |
+
* ::CUDA_ERROR_NOT_INITIALIZED,
|
| 376 |
+
* ::CUDA_ERROR_INVALID_CONTEXT,
|
| 377 |
+
* ::CUDA_ERROR_ALREADY_MAPPED
|
| 378 |
+
* \notefnerr
|
| 379 |
+
*
|
| 380 |
+
* \sa ::cuGraphicsGLRegisterBuffer
|
| 381 |
+
*/
|
| 382 |
+
__CUDA_DEPRECATED CUresult CUDAAPI cuGLRegisterBufferObject(GLuint buffer);
|
| 383 |
+
|
| 384 |
+
/**
|
| 385 |
+
* \brief Maps an OpenGL buffer object
|
| 386 |
+
*
|
| 387 |
+
* \deprecated This function is deprecated as of Cuda 3.0.
|
| 388 |
+
*
|
| 389 |
+
* Maps the buffer object specified by \p buffer into the address space of the
|
| 390 |
+
* current CUDA context and returns in \p *dptr and \p *size the base pointer
|
| 391 |
+
* and size of the resulting mapping.
|
| 392 |
+
*
|
| 393 |
+
* There must be a valid OpenGL context bound to the current thread
|
| 394 |
+
* when this function is called. This must be the same context, or a
|
| 395 |
+
* member of the same shareGroup, as the context that was bound when
|
| 396 |
+
* the buffer was registered.
|
| 397 |
+
*
|
| 398 |
+
* All streams in the current CUDA context are synchronized with the
|
| 399 |
+
* current GL context.
|
| 400 |
+
*
|
| 401 |
+
* \param dptr - Returned mapped base pointer
|
| 402 |
+
* \param size - Returned size of mapping
|
| 403 |
+
* \param buffer - The name of the buffer object to map
|
| 404 |
+
*
|
| 405 |
+
* \return
|
| 406 |
+
* ::CUDA_SUCCESS,
|
| 407 |
+
* ::CUDA_ERROR_DEINITIALIZED,
|
| 408 |
+
* ::CUDA_ERROR_NOT_INITIALIZED,
|
| 409 |
+
* ::CUDA_ERROR_INVALID_CONTEXT,
|
| 410 |
+
* ::CUDA_ERROR_INVALID_VALUE,
|
| 411 |
+
* ::CUDA_ERROR_MAP_FAILED
|
| 412 |
+
* \notefnerr
|
| 413 |
+
*
|
| 414 |
+
* \sa ::cuGraphicsMapResources
|
| 415 |
+
*/
|
| 416 |
+
__CUDA_DEPRECATED CUresult CUDAAPI cuGLMapBufferObject(CUdeviceptr *dptr, size_t *size, GLuint buffer);
|
| 417 |
+
|
| 418 |
+
/**
|
| 419 |
+
* \brief Unmaps an OpenGL buffer object
|
| 420 |
+
*
|
| 421 |
+
* \deprecated This function is deprecated as of Cuda 3.0.
|
| 422 |
+
*
|
| 423 |
+
* Unmaps the buffer object specified by \p buffer for access by CUDA.
|
| 424 |
+
*
|
| 425 |
+
* There must be a valid OpenGL context bound to the current thread
|
| 426 |
+
* when this function is called. This must be the same context, or a
|
| 427 |
+
* member of the same shareGroup, as the context that was bound when
|
| 428 |
+
* the buffer was registered.
|
| 429 |
+
*
|
| 430 |
+
* All streams in the current CUDA context are synchronized with the
|
| 431 |
+
* current GL context.
|
| 432 |
+
*
|
| 433 |
+
* \param buffer - Buffer object to unmap
|
| 434 |
+
*
|
| 435 |
+
* \return
|
| 436 |
+
* ::CUDA_SUCCESS,
|
| 437 |
+
* ::CUDA_ERROR_DEINITIALIZED,
|
| 438 |
+
* ::CUDA_ERROR_NOT_INITIALIZED,
|
| 439 |
+
* ::CUDA_ERROR_INVALID_CONTEXT,
|
| 440 |
+
* ::CUDA_ERROR_INVALID_VALUE
|
| 441 |
+
* \notefnerr
|
| 442 |
+
*
|
| 443 |
+
* \sa ::cuGraphicsUnmapResources
|
| 444 |
+
*/
|
| 445 |
+
__CUDA_DEPRECATED CUresult CUDAAPI cuGLUnmapBufferObject(GLuint buffer);
|
| 446 |
+
|
| 447 |
+
/**
|
| 448 |
+
* \brief Unregister an OpenGL buffer object
|
| 449 |
+
*
|
| 450 |
+
* \deprecated This function is deprecated as of Cuda 3.0.
|
| 451 |
+
*
|
| 452 |
+
* Unregisters the buffer object specified by \p buffer. This
|
| 453 |
+
* releases any resources associated with the registered buffer.
|
| 454 |
+
* After this call, the buffer may no longer be mapped for access by
|
| 455 |
+
* CUDA.
|
| 456 |
+
*
|
| 457 |
+
* There must be a valid OpenGL context bound to the current thread
|
| 458 |
+
* when this function is called. This must be the same context, or a
|
| 459 |
+
* member of the same shareGroup, as the context that was bound when
|
| 460 |
+
* the buffer was registered.
|
| 461 |
+
*
|
| 462 |
+
* \param buffer - Name of the buffer object to unregister
|
| 463 |
+
*
|
| 464 |
+
* \return
|
| 465 |
+
* ::CUDA_SUCCESS,
|
| 466 |
+
* ::CUDA_ERROR_DEINITIALIZED,
|
| 467 |
+
* ::CUDA_ERROR_NOT_INITIALIZED,
|
| 468 |
+
* ::CUDA_ERROR_INVALID_CONTEXT,
|
| 469 |
+
* ::CUDA_ERROR_INVALID_VALUE
|
| 470 |
+
* \notefnerr
|
| 471 |
+
*
|
| 472 |
+
* \sa ::cuGraphicsUnregisterResource
|
| 473 |
+
*/
|
| 474 |
+
__CUDA_DEPRECATED CUresult CUDAAPI cuGLUnregisterBufferObject(GLuint buffer);
|
| 475 |
+
|
| 476 |
+
/**
|
| 477 |
+
* \brief Set the map flags for an OpenGL buffer object
|
| 478 |
+
*
|
| 479 |
+
* \deprecated This function is deprecated as of Cuda 3.0.
|
| 480 |
+
*
|
| 481 |
+
* Sets the map flags for the buffer object specified by \p buffer.
|
| 482 |
+
*
|
| 483 |
+
* Changes to \p Flags will take effect the next time \p buffer is mapped.
|
| 484 |
+
* The \p Flags argument may be any of the following:
|
| 485 |
+
* - ::CU_GL_MAP_RESOURCE_FLAGS_NONE: Specifies no hints about how this
|
| 486 |
+
* resource will be used. It is therefore assumed that this resource will be
|
| 487 |
+
* read from and written to by CUDA kernels. This is the default value.
|
| 488 |
+
* - ::CU_GL_MAP_RESOURCE_FLAGS_READ_ONLY: Specifies that CUDA kernels which
|
| 489 |
+
* access this resource will not write to this resource.
|
| 490 |
+
* - ::CU_GL_MAP_RESOURCE_FLAGS_WRITE_DISCARD: Specifies that CUDA kernels
|
| 491 |
+
* which access this resource will not read from this resource and will
|
| 492 |
+
* write over the entire contents of the resource, so none of the data
|
| 493 |
+
* previously stored in the resource will be preserved.
|
| 494 |
+
*
|
| 495 |
+
* If \p buffer has not been registered for use with CUDA, then
|
| 496 |
+
* ::CUDA_ERROR_INVALID_HANDLE is returned. If \p buffer is presently
|
| 497 |
+
* mapped for access by CUDA, then ::CUDA_ERROR_ALREADY_MAPPED is returned.
|
| 498 |
+
*
|
| 499 |
+
* There must be a valid OpenGL context bound to the current thread
|
| 500 |
+
* when this function is called. This must be the same context, or a
|
| 501 |
+
* member of the same shareGroup, as the context that was bound when
|
| 502 |
+
* the buffer was registered.
|
| 503 |
+
*
|
| 504 |
+
* \param buffer - Buffer object to unmap
|
| 505 |
+
* \param Flags - Map flags
|
| 506 |
+
*
|
| 507 |
+
* \return
|
| 508 |
+
* ::CUDA_SUCCESS,
|
| 509 |
+
* ::CUDA_ERROR_NOT_INITIALIZED,
|
| 510 |
+
* ::CUDA_ERROR_INVALID_HANDLE,
|
| 511 |
+
* ::CUDA_ERROR_ALREADY_MAPPED,
|
| 512 |
+
* ::CUDA_ERROR_INVALID_CONTEXT,
|
| 513 |
+
* \notefnerr
|
| 514 |
+
*
|
| 515 |
+
* \sa ::cuGraphicsResourceSetMapFlags
|
| 516 |
+
*/
|
| 517 |
+
__CUDA_DEPRECATED CUresult CUDAAPI cuGLSetBufferObjectMapFlags(GLuint buffer, unsigned int Flags);
|
| 518 |
+
|
| 519 |
+
/**
|
| 520 |
+
* \brief Maps an OpenGL buffer object
|
| 521 |
+
*
|
| 522 |
+
* \deprecated This function is deprecated as of Cuda 3.0.
|
| 523 |
+
*
|
| 524 |
+
* Maps the buffer object specified by \p buffer into the address space of the
|
| 525 |
+
* current CUDA context and returns in \p *dptr and \p *size the base pointer
|
| 526 |
+
* and size of the resulting mapping.
|
| 527 |
+
*
|
| 528 |
+
* There must be a valid OpenGL context bound to the current thread
|
| 529 |
+
* when this function is called. This must be the same context, or a
|
| 530 |
+
* member of the same shareGroup, as the context that was bound when
|
| 531 |
+
* the buffer was registered.
|
| 532 |
+
*
|
| 533 |
+
* Stream \p hStream in the current CUDA context is synchronized with
|
| 534 |
+
* the current GL context.
|
| 535 |
+
*
|
| 536 |
+
* \param dptr - Returned mapped base pointer
|
| 537 |
+
* \param size - Returned size of mapping
|
| 538 |
+
* \param buffer - The name of the buffer object to map
|
| 539 |
+
* \param hStream - Stream to synchronize
|
| 540 |
+
*
|
| 541 |
+
* \return
|
| 542 |
+
* ::CUDA_SUCCESS,
|
| 543 |
+
* ::CUDA_ERROR_DEINITIALIZED,
|
| 544 |
+
* ::CUDA_ERROR_NOT_INITIALIZED,
|
| 545 |
+
* ::CUDA_ERROR_INVALID_CONTEXT,
|
| 546 |
+
* ::CUDA_ERROR_INVALID_VALUE,
|
| 547 |
+
* ::CUDA_ERROR_MAP_FAILED
|
| 548 |
+
* \notefnerr
|
| 549 |
+
*
|
| 550 |
+
* \sa ::cuGraphicsMapResources
|
| 551 |
+
*/
|
| 552 |
+
__CUDA_DEPRECATED CUresult CUDAAPI cuGLMapBufferObjectAsync(CUdeviceptr *dptr, size_t *size, GLuint buffer, CUstream hStream);
|
| 553 |
+
|
| 554 |
+
/**
|
| 555 |
+
* \brief Unmaps an OpenGL buffer object
|
| 556 |
+
*
|
| 557 |
+
* \deprecated This function is deprecated as of Cuda 3.0.
|
| 558 |
+
*
|
| 559 |
+
* Unmaps the buffer object specified by \p buffer for access by CUDA.
|
| 560 |
+
*
|
| 561 |
+
* There must be a valid OpenGL context bound to the current thread
|
| 562 |
+
* when this function is called. This must be the same context, or a
|
| 563 |
+
* member of the same shareGroup, as the context that was bound when
|
| 564 |
+
* the buffer was registered.
|
| 565 |
+
*
|
| 566 |
+
* Stream \p hStream in the current CUDA context is synchronized with
|
| 567 |
+
* the current GL context.
|
| 568 |
+
*
|
| 569 |
+
* \param buffer - Name of the buffer object to unmap
|
| 570 |
+
* \param hStream - Stream to synchronize
|
| 571 |
+
*
|
| 572 |
+
* \return
|
| 573 |
+
* ::CUDA_SUCCESS,
|
| 574 |
+
* ::CUDA_ERROR_DEINITIALIZED,
|
| 575 |
+
* ::CUDA_ERROR_NOT_INITIALIZED,
|
| 576 |
+
* ::CUDA_ERROR_INVALID_CONTEXT,
|
| 577 |
+
* ::CUDA_ERROR_INVALID_VALUE
|
| 578 |
+
* \notefnerr
|
| 579 |
+
*
|
| 580 |
+
* \sa ::cuGraphicsUnmapResources
|
| 581 |
+
*/
|
| 582 |
+
__CUDA_DEPRECATED CUresult CUDAAPI cuGLUnmapBufferObjectAsync(GLuint buffer, CUstream hStream);
|
| 583 |
+
|
| 584 |
+
/** @} */ /* END CUDA_GL_DEPRECATED */
|
| 585 |
+
/** @} */ /* END CUDA_GL */
|
| 586 |
+
|
| 587 |
+
|
| 588 |
+
#if defined(__CUDA_API_VERSION_INTERNAL)
|
| 589 |
+
#undef cuGLCtxCreate
|
| 590 |
+
#undef cuGLMapBufferObject
|
| 591 |
+
#undef cuGLMapBufferObjectAsync
|
| 592 |
+
#undef cuGLGetDevices
|
| 593 |
+
|
| 594 |
+
CUresult CUDAAPI cuGLGetDevices(unsigned int *pCudaDeviceCount, CUdevice *pCudaDevices, unsigned int cudaDeviceCount, CUGLDeviceList deviceList);
|
| 595 |
+
CUresult CUDAAPI cuGLMapBufferObject_v2(CUdeviceptr *dptr, size_t *size, GLuint buffer);
|
| 596 |
+
CUresult CUDAAPI cuGLMapBufferObjectAsync_v2(CUdeviceptr *dptr, size_t *size, GLuint buffer, CUstream hStream);
|
| 597 |
+
CUresult CUDAAPI cuGLCtxCreate(CUcontext *pCtx, unsigned int Flags, CUdevice device );
|
| 598 |
+
CUresult CUDAAPI cuGLMapBufferObject(CUdeviceptr_v1 *dptr, unsigned int *size, GLuint buffer);
|
| 599 |
+
CUresult CUDAAPI cuGLMapBufferObjectAsync(CUdeviceptr_v1 *dptr, unsigned int *size, GLuint buffer, CUstream hStream);
|
| 600 |
+
#endif /* __CUDA_API_VERSION_INTERNAL */
|
| 601 |
+
|
| 602 |
+
#ifdef __cplusplus
|
| 603 |
+
};
|
| 604 |
+
#endif
|
| 605 |
+
|
| 606 |
+
#undef __CUDA_DEPRECATED
|
| 607 |
+
|
| 608 |
+
#endif
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cudaGLTypedefs.h
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2020-2021 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO LICENSEE:
|
| 5 |
+
*
|
| 6 |
+
* This source code and/or documentation ("Licensed Deliverables") are
|
| 7 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 8 |
+
* international Copyright laws.
|
| 9 |
+
*
|
| 10 |
+
* These Licensed Deliverables contained herein is PROPRIETARY and
|
| 11 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and
|
| 12 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 13 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 14 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 15 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 16 |
+
* of the Licensed Deliverables to any third party without the express
|
| 17 |
+
* written consent of NVIDIA is prohibited.
|
| 18 |
+
*
|
| 19 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 20 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 21 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
|
| 22 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 23 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 24 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 25 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 26 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 27 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 28 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 29 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 30 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 31 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 32 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 33 |
+
*
|
| 34 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 35 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 36 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 37 |
+
* computer software documentation" as such terms are used in 48
|
| 38 |
+
* C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
|
| 39 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 40 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 41 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 42 |
+
* only those rights set forth herein.
|
| 43 |
+
*
|
| 44 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 45 |
+
* software must include, in the user documentation and internal
|
| 46 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 47 |
+
* Users Notice.
|
| 48 |
+
*/
|
| 49 |
+
|
| 50 |
+
#ifndef CUDAGLTYPEDEFS_H
|
| 51 |
+
#define CUDAGLTYPEDEFS_H
|
| 52 |
+
|
| 53 |
+
// Dependent includes for cudagl.h
|
| 54 |
+
#include <GL/gl.h>
|
| 55 |
+
|
| 56 |
+
#include <cudaGL.h>
|
| 57 |
+
|
| 58 |
+
#if defined(CUDA_API_PER_THREAD_DEFAULT_STREAM)
|
| 59 |
+
#define __API_TYPEDEF_PTDS(api, default_version, ptds_version) api ## _v ## ptds_version ## _ptds
|
| 60 |
+
#define __API_TYPEDEF_PTSZ(api, default_version, ptds_version) api ## _v ## ptds_version ## _ptsz
|
| 61 |
+
#else
|
| 62 |
+
#define __API_TYPEDEF_PTDS(api, default_version, ptds_version) api ## _v ## default_version
|
| 63 |
+
#define __API_TYPEDEF_PTSZ(api, default_version, ptds_version) api ## _v ## default_version
|
| 64 |
+
#endif
|
| 65 |
+
|
| 66 |
+
#ifdef __cplusplus
|
| 67 |
+
extern "C" {
|
| 68 |
+
#endif // __cplusplus
|
| 69 |
+
|
| 70 |
+
/*
|
| 71 |
+
* Macros for the latest version for each driver function in cudaGL.h
|
| 72 |
+
*/
|
| 73 |
+
#define PFN_cuGraphicsGLRegisterBuffer PFN_cuGraphicsGLRegisterBuffer_v3000
|
| 74 |
+
#define PFN_cuGraphicsGLRegisterImage PFN_cuGraphicsGLRegisterImage_v3000
|
| 75 |
+
#define PFN_cuWGLGetDevice PFN_cuWGLGetDevice_v2020
|
| 76 |
+
#define PFN_cuGLGetDevices PFN_cuGLGetDevices_v6050
|
| 77 |
+
#define PFN_cuGLCtxCreate PFN_cuGLCtxCreate_v3020
|
| 78 |
+
#define PFN_cuGLInit PFN_cuGLInit_v2000
|
| 79 |
+
#define PFN_cuGLRegisterBufferObject PFN_cuGLRegisterBufferObject_v2000
|
| 80 |
+
#define PFN_cuGLMapBufferObject __API_TYPEDEF_PTDS(PFN_cuGLMapBufferObject, 3020, 7000)
|
| 81 |
+
#define PFN_cuGLUnmapBufferObject PFN_cuGLUnmapBufferObject_v2000
|
| 82 |
+
#define PFN_cuGLUnregisterBufferObject PFN_cuGLUnregisterBufferObject_v2000
|
| 83 |
+
#define PFN_cuGLSetBufferObjectMapFlags PFN_cuGLSetBufferObjectMapFlags_v2030
|
| 84 |
+
#define PFN_cuGLMapBufferObjectAsync __API_TYPEDEF_PTSZ(PFN_cuGLMapBufferObjectAsync, 3020, 7000)
|
| 85 |
+
#define PFN_cuGLUnmapBufferObjectAsync PFN_cuGLUnmapBufferObjectAsync_v2030
|
| 86 |
+
|
| 87 |
+
|
| 88 |
+
/**
|
| 89 |
+
* Type definitions for functions defined in cudaGL.h
|
| 90 |
+
*/
|
| 91 |
+
typedef CUresult (CUDAAPI *PFN_cuGraphicsGLRegisterBuffer_v3000)(CUgraphicsResource *pCudaResource, GLuint buffer, unsigned int Flags);
|
| 92 |
+
typedef CUresult (CUDAAPI *PFN_cuGraphicsGLRegisterImage_v3000)(CUgraphicsResource *pCudaResource, GLuint image, GLenum target, unsigned int Flags);
|
| 93 |
+
#ifdef _WIN32
|
| 94 |
+
typedef CUresult (CUDAAPI *PFN_cuWGLGetDevice_v2020)(CUdevice_v1 *pDevice, HGPUNV hGpu);
|
| 95 |
+
#endif
|
| 96 |
+
typedef CUresult (CUDAAPI *PFN_cuGLGetDevices_v6050)(unsigned int *pCudaDeviceCount, CUdevice_v1 *pCudaDevices, unsigned int cudaDeviceCount, CUGLDeviceList deviceList);
|
| 97 |
+
typedef CUresult (CUDAAPI *PFN_cuGLCtxCreate_v3020)(CUcontext *pCtx, unsigned int Flags, CUdevice_v1 device);
|
| 98 |
+
typedef CUresult (CUDAAPI *PFN_cuGLInit_v2000)(void);
|
| 99 |
+
typedef CUresult (CUDAAPI *PFN_cuGLRegisterBufferObject_v2000)(GLuint buffer);
|
| 100 |
+
typedef CUresult (CUDAAPI *PFN_cuGLMapBufferObject_v7000_ptds)(CUdeviceptr_v2 *dptr, size_t *size, GLuint buffer);
|
| 101 |
+
typedef CUresult (CUDAAPI *PFN_cuGLUnmapBufferObject_v2000)(GLuint buffer);
|
| 102 |
+
typedef CUresult (CUDAAPI *PFN_cuGLUnregisterBufferObject_v2000)(GLuint buffer);
|
| 103 |
+
typedef CUresult (CUDAAPI *PFN_cuGLSetBufferObjectMapFlags_v2030)(GLuint buffer, unsigned int Flags);
|
| 104 |
+
typedef CUresult (CUDAAPI *PFN_cuGLMapBufferObjectAsync_v7000_ptsz)(CUdeviceptr_v2 *dptr, size_t *size, GLuint buffer, CUstream hStream);
|
| 105 |
+
typedef CUresult (CUDAAPI *PFN_cuGLUnmapBufferObjectAsync_v2030)(GLuint buffer, CUstream hStream);
|
| 106 |
+
typedef CUresult (CUDAAPI *PFN_cuGLMapBufferObject_v3020)(CUdeviceptr_v2 *dptr, size_t *size, GLuint buffer);
|
| 107 |
+
typedef CUresult (CUDAAPI *PFN_cuGLMapBufferObjectAsync_v3020)(CUdeviceptr_v2 *dptr, size_t *size, GLuint buffer, CUstream hStream);
|
| 108 |
+
|
| 109 |
+
/*
|
| 110 |
+
* Type definitions for older versioned functions in cuda.h
|
| 111 |
+
*/
|
| 112 |
+
#if defined(__CUDA_API_VERSION_INTERNAL)
|
| 113 |
+
typedef CUresult (CUDAAPI *PFN_cuGLGetDevices_v4010)(unsigned int *pCudaDeviceCount, CUdevice_v1 *pCudaDevices, unsigned int cudaDeviceCount, CUGLDeviceList deviceList);
|
| 114 |
+
typedef CUresult (CUDAAPI *PFN_cuGLMapBufferObject_v2000)(CUdeviceptr_v1 *dptr, unsigned int *size, GLuint buffer);
|
| 115 |
+
typedef CUresult (CUDAAPI *PFN_cuGLMapBufferObjectAsync_v2030)(CUdeviceptr_v1 *dptr, unsigned int *size, GLuint buffer, CUstream hStream);
|
| 116 |
+
typedef CUresult (CUDAAPI *PFN_cuGLCtxCreate_v2000)(CUcontext *pCtx, unsigned int Flags, CUdevice_v1 device);
|
| 117 |
+
#endif
|
| 118 |
+
|
| 119 |
+
#ifdef __cplusplus
|
| 120 |
+
}
|
| 121 |
+
#endif // __cplusplus
|
| 122 |
+
|
| 123 |
+
#endif // file guard
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cudaProfilerTypedefs.h
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2020-2021 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO LICENSEE:
|
| 5 |
+
*
|
| 6 |
+
* This source code and/or documentation ("Licensed Deliverables") are
|
| 7 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 8 |
+
* international Copyright laws.
|
| 9 |
+
*
|
| 10 |
+
* These Licensed Deliverables contained herein is PROPRIETARY and
|
| 11 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and
|
| 12 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 13 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 14 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 15 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 16 |
+
* of the Licensed Deliverables to any third party without the express
|
| 17 |
+
* written consent of NVIDIA is prohibited.
|
| 18 |
+
*
|
| 19 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 20 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 21 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
|
| 22 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 23 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 24 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 25 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 26 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 27 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 28 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 29 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 30 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 31 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 32 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 33 |
+
*
|
| 34 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 35 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 36 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 37 |
+
* computer software documentation" as such terms are used in 48
|
| 38 |
+
* C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
|
| 39 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 40 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 41 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 42 |
+
* only those rights set forth herein.
|
| 43 |
+
*
|
| 44 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 45 |
+
* software must include, in the user documentation and internal
|
| 46 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 47 |
+
* Users Notice.
|
| 48 |
+
*/
|
| 49 |
+
|
| 50 |
+
#ifndef CUDAPROFILERTYPEDEFS_H
|
| 51 |
+
#define CUDAPROFILERTYPEDEFS_H
|
| 52 |
+
|
| 53 |
+
#include <cudaProfiler.h>
|
| 54 |
+
|
| 55 |
+
#ifdef __cplusplus
|
| 56 |
+
extern "C" {
|
| 57 |
+
#endif // __cplusplus
|
| 58 |
+
|
| 59 |
+
/*
|
| 60 |
+
* Macros for the latest version for each driver function in cudaProfiler.h
|
| 61 |
+
*/
|
| 62 |
+
#define PFN_cuProfilerInitialize PFN_cuProfilerInitialize_v4000
|
| 63 |
+
#define PFN_cuProfilerStart PFN_cuProfilerStart_v4000
|
| 64 |
+
#define PFN_cuProfilerStop PFN_cuProfilerStop_v4000
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
/**
|
| 68 |
+
* Type definitions for functions defined in cudaProfiler.h
|
| 69 |
+
*/
|
| 70 |
+
typedef CUresult (CUDAAPI *PFN_cuProfilerInitialize_v4000)(const char *configFile, const char *outputFile, CUoutput_mode outputMode);
|
| 71 |
+
typedef CUresult (CUDAAPI *PFN_cuProfilerStart_v4000)(void);
|
| 72 |
+
typedef CUresult (CUDAAPI *PFN_cuProfilerStop_v4000)(void);
|
| 73 |
+
|
| 74 |
+
#ifdef __cplusplus
|
| 75 |
+
}
|
| 76 |
+
#endif // __cplusplus
|
| 77 |
+
|
| 78 |
+
#endif // file guard
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cudaTypedefs.h
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cudaVDPAU.h
ADDED
|
@@ -0,0 +1,282 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2010-2014 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO LICENSEE:
|
| 5 |
+
*
|
| 6 |
+
* This source code and/or documentation ("Licensed Deliverables") are
|
| 7 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 8 |
+
* international Copyright laws.
|
| 9 |
+
*
|
| 10 |
+
* These Licensed Deliverables contained herein is PROPRIETARY and
|
| 11 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and
|
| 12 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 13 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 14 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 15 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 16 |
+
* of the Licensed Deliverables to any third party without the express
|
| 17 |
+
* written consent of NVIDIA is prohibited.
|
| 18 |
+
*
|
| 19 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 20 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 21 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
|
| 22 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 23 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 24 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 25 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 26 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 27 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 28 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 29 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 30 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 31 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 32 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 33 |
+
*
|
| 34 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 35 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 36 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 37 |
+
* computer software documentation" as such terms are used in 48
|
| 38 |
+
* C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
|
| 39 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 40 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 41 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 42 |
+
* only those rights set forth herein.
|
| 43 |
+
*
|
| 44 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 45 |
+
* software must include, in the user documentation and internal
|
| 46 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 47 |
+
* Users Notice.
|
| 48 |
+
*/
|
| 49 |
+
|
| 50 |
+
#ifndef CUDAVDPAU_H
|
| 51 |
+
#define CUDAVDPAU_H
|
| 52 |
+
|
| 53 |
+
#ifdef CUDA_FORCE_API_VERSION
|
| 54 |
+
#error "CUDA_FORCE_API_VERSION is no longer supported."
|
| 55 |
+
#endif
|
| 56 |
+
|
| 57 |
+
#define cuVDPAUCtxCreate cuVDPAUCtxCreate_v2
|
| 58 |
+
|
| 59 |
+
#ifdef __cplusplus
|
| 60 |
+
extern "C" {
|
| 61 |
+
#endif
|
| 62 |
+
|
| 63 |
+
/**
|
| 64 |
+
* \defgroup CUDA_VDPAU VDPAU Interoperability
|
| 65 |
+
* \ingroup CUDA_DRIVER
|
| 66 |
+
*
|
| 67 |
+
* ___MANBRIEF___ VDPAU interoperability functions of the low-level CUDA driver
|
| 68 |
+
* API (___CURRENT_FILE___) ___ENDMANBRIEF___
|
| 69 |
+
*
|
| 70 |
+
* This section describes the VDPAU interoperability functions of the
|
| 71 |
+
* low-level CUDA driver application programming interface.
|
| 72 |
+
*
|
| 73 |
+
* @{
|
| 74 |
+
*/
|
| 75 |
+
|
| 76 |
+
/**
|
| 77 |
+
* \brief Gets the CUDA device associated with a VDPAU device
|
| 78 |
+
*
|
| 79 |
+
* Returns in \p *pDevice the CUDA device associated with a \p vdpDevice, if
|
| 80 |
+
* applicable.
|
| 81 |
+
*
|
| 82 |
+
* \param pDevice - Device associated with vdpDevice
|
| 83 |
+
* \param vdpDevice - A VdpDevice handle
|
| 84 |
+
* \param vdpGetProcAddress - VDPAU's VdpGetProcAddress function pointer
|
| 85 |
+
*
|
| 86 |
+
* \return
|
| 87 |
+
* ::CUDA_SUCCESS,
|
| 88 |
+
* ::CUDA_ERROR_DEINITIALIZED,
|
| 89 |
+
* ::CUDA_ERROR_NOT_INITIALIZED,
|
| 90 |
+
* ::CUDA_ERROR_INVALID_CONTEXT,
|
| 91 |
+
* ::CUDA_ERROR_INVALID_VALUE
|
| 92 |
+
* \notefnerr
|
| 93 |
+
*
|
| 94 |
+
* \sa ::cuCtxCreate, ::cuVDPAUCtxCreate, ::cuGraphicsVDPAURegisterVideoSurface,
|
| 95 |
+
* ::cuGraphicsVDPAURegisterOutputSurface, ::cuGraphicsUnregisterResource,
|
| 96 |
+
* ::cuGraphicsResourceSetMapFlags, ::cuGraphicsMapResources,
|
| 97 |
+
* ::cuGraphicsUnmapResources, ::cuGraphicsSubResourceGetMappedArray,
|
| 98 |
+
* ::cudaVDPAUGetDevice
|
| 99 |
+
*/
|
| 100 |
+
CUresult CUDAAPI cuVDPAUGetDevice(CUdevice *pDevice, VdpDevice vdpDevice, VdpGetProcAddress *vdpGetProcAddress);
|
| 101 |
+
|
| 102 |
+
/**
|
| 103 |
+
* \brief Create a CUDA context for interoperability with VDPAU
|
| 104 |
+
*
|
| 105 |
+
* Creates a new CUDA context, initializes VDPAU interoperability, and
|
| 106 |
+
* associates the CUDA context with the calling thread. It must be called
|
| 107 |
+
* before performing any other VDPAU interoperability operations. It may fail
|
| 108 |
+
* if the needed VDPAU driver facilities are not available. For usage of the
|
| 109 |
+
* \p flags parameter, see ::cuCtxCreate().
|
| 110 |
+
*
|
| 111 |
+
* \param pCtx - Returned CUDA context
|
| 112 |
+
* \param flags - Options for CUDA context creation
|
| 113 |
+
* \param device - Device on which to create the context
|
| 114 |
+
* \param vdpDevice - The VdpDevice to interop with
|
| 115 |
+
* \param vdpGetProcAddress - VDPAU's VdpGetProcAddress function pointer
|
| 116 |
+
*
|
| 117 |
+
* \return
|
| 118 |
+
* ::CUDA_SUCCESS,
|
| 119 |
+
* ::CUDA_ERROR_DEINITIALIZED,
|
| 120 |
+
* ::CUDA_ERROR_NOT_INITIALIZED,
|
| 121 |
+
* ::CUDA_ERROR_INVALID_CONTEXT,
|
| 122 |
+
* ::CUDA_ERROR_INVALID_VALUE,
|
| 123 |
+
* ::CUDA_ERROR_OUT_OF_MEMORY
|
| 124 |
+
* \notefnerr
|
| 125 |
+
*
|
| 126 |
+
* \sa ::cuCtxCreate, ::cuGraphicsVDPAURegisterVideoSurface,
|
| 127 |
+
* ::cuGraphicsVDPAURegisterOutputSurface, ::cuGraphicsUnregisterResource,
|
| 128 |
+
* ::cuGraphicsResourceSetMapFlags, ::cuGraphicsMapResources,
|
| 129 |
+
* ::cuGraphicsUnmapResources, ::cuGraphicsSubResourceGetMappedArray,
|
| 130 |
+
* ::cuVDPAUGetDevice
|
| 131 |
+
*/
|
| 132 |
+
CUresult CUDAAPI cuVDPAUCtxCreate(CUcontext *pCtx, unsigned int flags, CUdevice device, VdpDevice vdpDevice, VdpGetProcAddress *vdpGetProcAddress);
|
| 133 |
+
|
| 134 |
+
/**
|
| 135 |
+
* \brief Registers a VDPAU VdpVideoSurface object
|
| 136 |
+
*
|
| 137 |
+
* Registers the VdpVideoSurface specified by \p vdpSurface for access by
|
| 138 |
+
* CUDA. A handle to the registered object is returned as \p pCudaResource.
|
| 139 |
+
* The surface's intended usage is specified using \p flags, as follows:
|
| 140 |
+
*
|
| 141 |
+
* - ::CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE: Specifies no hints about how this
|
| 142 |
+
* resource will be used. It is therefore assumed that this resource will be
|
| 143 |
+
* read from and written to by CUDA. This is the default value.
|
| 144 |
+
* - ::CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY: Specifies that CUDA
|
| 145 |
+
* will not write to this resource.
|
| 146 |
+
* - ::CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD: Specifies that
|
| 147 |
+
* CUDA will not read from this resource and will write over the
|
| 148 |
+
* entire contents of the resource, so none of the data previously
|
| 149 |
+
* stored in the resource will be preserved.
|
| 150 |
+
*
|
| 151 |
+
* The VdpVideoSurface is presented as an array of subresources that may be
|
| 152 |
+
* accessed using pointers returned by ::cuGraphicsSubResourceGetMappedArray.
|
| 153 |
+
* The exact number of valid \p arrayIndex values depends on the VDPAU surface
|
| 154 |
+
* format. The mapping is shown in the table below. \p mipLevel must be 0.
|
| 155 |
+
*
|
| 156 |
+
* \htmlonly
|
| 157 |
+
* <table>
|
| 158 |
+
* <tr><th>VdpChromaType </th><th>arrayIndex</th><th>Size </th><th>Format</th><th>Content </th></tr>
|
| 159 |
+
* <tr><td rowspan="4" valign="top">VDP_CHROMA_TYPE_420</td><td>0 </td><td>w x h/2</td><td>R8 </td><td>Top-field luma </td></tr>
|
| 160 |
+
* <tr> <td>1 </td><td>w x h/2</td><td>R8 </td><td>Bottom-field luma </td></tr>
|
| 161 |
+
* <tr> <td>2 </td><td>w/2 x h/4</td><td>R8G8 </td><td>Top-field chroma </td></tr>
|
| 162 |
+
* <tr> <td>3 </td><td>w/2 x h/4</td><td>R8G8 </td><td>Bottom-field chroma</td></tr>
|
| 163 |
+
* <tr><td rowspan="4" valign="top">VDP_CHROMA_TYPE_422</td><td>0 </td><td>w x h/2</td><td>R8 </td><td>Top-field luma </td></tr>
|
| 164 |
+
* <tr> <td>1 </td><td>w x h/2</td><td>R8 </td><td>Bottom-field luma </td></tr>
|
| 165 |
+
* <tr> <td>2 </td><td>w/2 x h/2</td><td>R8G8 </td><td>Top-field chroma </td></tr>
|
| 166 |
+
* <tr> <td>3 </td><td>w/2 x h/2</td><td>R8G8 </td><td>Bottom-field chroma</td></tr>
|
| 167 |
+
* </table>
|
| 168 |
+
* \endhtmlonly
|
| 169 |
+
*
|
| 170 |
+
* \latexonly
|
| 171 |
+
* \begin{tabular}{|l|l|l|l|l|}
|
| 172 |
+
* \hline
|
| 173 |
+
* VdpChromaType & arrayIndex & Size & Format & Content \\
|
| 174 |
+
* \hline
|
| 175 |
+
* VDP\_CHROMA\_TYPE\_420 & 0 & w x h/2 & R8 & Top-field luma \\
|
| 176 |
+
* & 1 & w x h/2 & R8 & Bottom-field luma \\
|
| 177 |
+
* & 2 & w/2 x h/4 & R8G8 & Top-field chroma \\
|
| 178 |
+
* & 3 & w/2 x h/4 & R8G8 & Bottom-field chroma \\
|
| 179 |
+
* \hline
|
| 180 |
+
* VDP\_CHROMA\_TYPE\_422 & 0 & w x h/2 & R8 & Top-field luma \\
|
| 181 |
+
* & 1 & w x h/2 & R8 & Bottom-field luma \\
|
| 182 |
+
* & 2 & w/2 x h/2 & R8G8 & Top-field chroma \\
|
| 183 |
+
* & 3 & w/2 x h/2 & R8G8 & Bottom-field chroma \\
|
| 184 |
+
* \hline
|
| 185 |
+
* \end{tabular}
|
| 186 |
+
* \endlatexonly
|
| 187 |
+
*
|
| 188 |
+
* \param pCudaResource - Pointer to the returned object handle
|
| 189 |
+
* \param vdpSurface - The VdpVideoSurface to be registered
|
| 190 |
+
* \param flags - Map flags
|
| 191 |
+
*
|
| 192 |
+
* \return
|
| 193 |
+
* ::CUDA_SUCCESS,
|
| 194 |
+
* ::CUDA_ERROR_INVALID_HANDLE,
|
| 195 |
+
* ::CUDA_ERROR_ALREADY_MAPPED,
|
| 196 |
+
* ::CUDA_ERROR_INVALID_CONTEXT,
|
| 197 |
+
* \notefnerr
|
| 198 |
+
*
|
| 199 |
+
* \sa ::cuCtxCreate, ::cuVDPAUCtxCreate,
|
| 200 |
+
* ::cuGraphicsVDPAURegisterOutputSurface, ::cuGraphicsUnregisterResource,
|
| 201 |
+
* ::cuGraphicsResourceSetMapFlags, ::cuGraphicsMapResources,
|
| 202 |
+
* ::cuGraphicsUnmapResources, ::cuGraphicsSubResourceGetMappedArray,
|
| 203 |
+
* ::cuVDPAUGetDevice,
|
| 204 |
+
* ::cudaGraphicsVDPAURegisterVideoSurface
|
| 205 |
+
*/
|
| 206 |
+
CUresult CUDAAPI cuGraphicsVDPAURegisterVideoSurface(CUgraphicsResource *pCudaResource, VdpVideoSurface vdpSurface, unsigned int flags);
|
| 207 |
+
|
| 208 |
+
/**
|
| 209 |
+
* \brief Registers a VDPAU VdpOutputSurface object
|
| 210 |
+
*
|
| 211 |
+
* Registers the VdpOutputSurface specified by \p vdpSurface for access by
|
| 212 |
+
* CUDA. A handle to the registered object is returned as \p pCudaResource.
|
| 213 |
+
* The surface's intended usage is specified using \p flags, as follows:
|
| 214 |
+
*
|
| 215 |
+
* - ::CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE: Specifies no hints about how this
|
| 216 |
+
* resource will be used. It is therefore assumed that this resource will be
|
| 217 |
+
* read from and written to by CUDA. This is the default value.
|
| 218 |
+
* - ::CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY: Specifies that CUDA
|
| 219 |
+
* will not write to this resource.
|
| 220 |
+
* - ::CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD: Specifies that
|
| 221 |
+
* CUDA will not read from this resource and will write over the
|
| 222 |
+
* entire contents of the resource, so none of the data previously
|
| 223 |
+
* stored in the resource will be preserved.
|
| 224 |
+
*
|
| 225 |
+
* The VdpOutputSurface is presented as an array of subresources that may be
|
| 226 |
+
* accessed using pointers returned by ::cuGraphicsSubResourceGetMappedArray.
|
| 227 |
+
* The exact number of valid \p arrayIndex values depends on the VDPAU surface
|
| 228 |
+
* format. The mapping is shown in the table below. \p mipLevel must be 0.
|
| 229 |
+
*
|
| 230 |
+
* \htmlonly
|
| 231 |
+
* <table>
|
| 232 |
+
* <tr><th>VdpRGBAFormat </th><th>arrayIndex</th><th>Size </th><th>Format </th><th>Content </th></tr>
|
| 233 |
+
* <tr><td>VDP_RGBA_FORMAT_B8G8R8A8 </td><td>0 </td><td>w x h</td><td>ARGB8 </td><td>Entire surface</td></tr>
|
| 234 |
+
* <tr><td>VDP_RGBA_FORMAT_R10G10B10A2</td><td>0 </td><td>w x h</td><td>A2BGR10</td><td>Entire surface</td></tr>
|
| 235 |
+
* </table>
|
| 236 |
+
* \endhtmlonly
|
| 237 |
+
*
|
| 238 |
+
* \latexonly
|
| 239 |
+
* \begin{tabular}{|l|l|l|l|l|}
|
| 240 |
+
* \hline
|
| 241 |
+
* VdpRGBAFormat & arrayIndex & Size & Format & Content \\
|
| 242 |
+
* \hline
|
| 243 |
+
* VDP\_RGBA\_FORMAT\_B8G8R8A8 & 0 & w x h & ARGB8 & Entire surface \\
|
| 244 |
+
* VDP\_RGBA\_FORMAT\_R10G10B10A2 & 0 & w x h & A2BGR10 & Entire surface \\
|
| 245 |
+
* \hline
|
| 246 |
+
* \end{tabular}
|
| 247 |
+
* \endlatexonly
|
| 248 |
+
*
|
| 249 |
+
* \param pCudaResource - Pointer to the returned object handle
|
| 250 |
+
* \param vdpSurface - The VdpOutputSurface to be registered
|
| 251 |
+
* \param flags - Map flags
|
| 252 |
+
*
|
| 253 |
+
* \return
|
| 254 |
+
* ::CUDA_SUCCESS,
|
| 255 |
+
* ::CUDA_ERROR_INVALID_HANDLE,
|
| 256 |
+
* ::CUDA_ERROR_ALREADY_MAPPED,
|
| 257 |
+
* ::CUDA_ERROR_INVALID_CONTEXT,
|
| 258 |
+
* \notefnerr
|
| 259 |
+
*
|
| 260 |
+
* \sa ::cuCtxCreate, ::cuVDPAUCtxCreate,
|
| 261 |
+
* ::cuGraphicsVDPAURegisterVideoSurface, ::cuGraphicsUnregisterResource,
|
| 262 |
+
* ::cuGraphicsResourceSetMapFlags, ::cuGraphicsMapResources,
|
| 263 |
+
* ::cuGraphicsUnmapResources, ::cuGraphicsSubResourceGetMappedArray,
|
| 264 |
+
* ::cuVDPAUGetDevice,
|
| 265 |
+
* ::cudaGraphicsVDPAURegisterOutputSurface
|
| 266 |
+
*/
|
| 267 |
+
CUresult CUDAAPI cuGraphicsVDPAURegisterOutputSurface(CUgraphicsResource *pCudaResource, VdpOutputSurface vdpSurface, unsigned int flags);
|
| 268 |
+
|
| 269 |
+
/** @} */ /* END CUDA_VDPAU */
|
| 270 |
+
|
| 271 |
+
|
| 272 |
+
#if defined(__CUDA_API_VERSION_INTERNAL)
|
| 273 |
+
#undef cuVDPAUCtxCreate
|
| 274 |
+
|
| 275 |
+
CUresult CUDAAPI cuVDPAUCtxCreate(CUcontext *pCtx, unsigned int flags, CUdevice device, VdpDevice vdpDevice, VdpGetProcAddress *vdpGetProcAddress);
|
| 276 |
+
#endif /* __CUDA_API_VERSION_INTERNAL */
|
| 277 |
+
|
| 278 |
+
#ifdef __cplusplus
|
| 279 |
+
};
|
| 280 |
+
#endif
|
| 281 |
+
|
| 282 |
+
#endif
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cudaVDPAUTypedefs.h
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 2020-2021 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO LICENSEE:
|
| 5 |
+
*
|
| 6 |
+
* This source code and/or documentation ("Licensed Deliverables") are
|
| 7 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 8 |
+
* international Copyright laws.
|
| 9 |
+
*
|
| 10 |
+
* These Licensed Deliverables contained herein is PROPRIETARY and
|
| 11 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and
|
| 12 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 13 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 14 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 15 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 16 |
+
* of the Licensed Deliverables to any third party without the express
|
| 17 |
+
* written consent of NVIDIA is prohibited.
|
| 18 |
+
*
|
| 19 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 20 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 21 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
|
| 22 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 23 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 24 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 25 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 26 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 27 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 28 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 29 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 30 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 31 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 32 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 33 |
+
*
|
| 34 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 35 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 36 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 37 |
+
* computer software documentation" as such terms are used in 48
|
| 38 |
+
* C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
|
| 39 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 40 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 41 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 42 |
+
* only those rights set forth herein.
|
| 43 |
+
*
|
| 44 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 45 |
+
* software must include, in the user documentation and internal
|
| 46 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 47 |
+
* Users Notice.
|
| 48 |
+
*/
|
| 49 |
+
|
| 50 |
+
#ifndef CUDAVDPAUTYPEDEFS_H
|
| 51 |
+
#define CUDAVDPAUTYPEDEFS_H
|
| 52 |
+
|
| 53 |
+
// Dependent includes for cudavdpau.h
|
| 54 |
+
#include <vdpau/vdpau.h>
|
| 55 |
+
|
| 56 |
+
#include <cudaVDPAU.h>
|
| 57 |
+
|
| 58 |
+
#ifdef __cplusplus
|
| 59 |
+
extern "C" {
|
| 60 |
+
#endif // __cplusplus
|
| 61 |
+
|
| 62 |
+
/*
|
| 63 |
+
* Macros for the latest version for each driver function in cudaVDPAU.h
|
| 64 |
+
*/
|
| 65 |
+
#define PFN_cuVDPAUGetDevice PFN_cuVDPAUGetDevice_v3010
|
| 66 |
+
#define PFN_cuVDPAUCtxCreate PFN_cuVDPAUCtxCreate_v3020
|
| 67 |
+
#define PFN_cuGraphicsVDPAURegisterVideoSurface PFN_cuGraphicsVDPAURegisterVideoSurface_v3010
|
| 68 |
+
#define PFN_cuGraphicsVDPAURegisterOutputSurface PFN_cuGraphicsVDPAURegisterOutputSurface_v3010
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
/**
|
| 72 |
+
* Type definitions for functions defined in cudaVDPAU.h
|
| 73 |
+
*/
|
| 74 |
+
typedef CUresult (CUDAAPI *PFN_cuVDPAUGetDevice_v3010)(CUdevice_v1 *pDevice, VdpDevice vdpDevice, VdpGetProcAddress *vdpGetProcAddress);
|
| 75 |
+
typedef CUresult (CUDAAPI *PFN_cuVDPAUCtxCreate_v3020)(CUcontext *pCtx, unsigned int flags, CUdevice_v1 device, VdpDevice vdpDevice, VdpGetProcAddress *vdpGetProcAddress);
|
| 76 |
+
typedef CUresult (CUDAAPI *PFN_cuGraphicsVDPAURegisterVideoSurface_v3010)(CUgraphicsResource *pCudaResource, VdpVideoSurface vdpSurface, unsigned int flags);
|
| 77 |
+
typedef CUresult (CUDAAPI *PFN_cuGraphicsVDPAURegisterOutputSurface_v3010)(CUgraphicsResource *pCudaResource, VdpOutputSurface vdpSurface, unsigned int flags);
|
| 78 |
+
|
| 79 |
+
/*
|
| 80 |
+
* Type definitions for older versioned functions in cudaVDPAU.h
|
| 81 |
+
*/
|
| 82 |
+
#if defined(__CUDA_API_VERSION_INTERNAL)
|
| 83 |
+
typedef CUresult (CUDAAPI *PFN_cuVDPAUCtxCreate_v3010)(CUcontext *pCtx, unsigned int flags, CUdevice_v1 device, VdpDevice vdpDevice, VdpGetProcAddress *vdpGetProcAddress);
|
| 84 |
+
#endif
|
| 85 |
+
|
| 86 |
+
#ifdef __cplusplus
|
| 87 |
+
}
|
| 88 |
+
#endif // __cplusplus
|
| 89 |
+
|
| 90 |
+
#endif // file guard
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cuda_awbarrier.h
ADDED
|
@@ -0,0 +1,280 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1993-2019 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO LICENSEE:
|
| 5 |
+
*
|
| 6 |
+
* This source code and/or documentation ("Licensed Deliverables") are
|
| 7 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 8 |
+
* international Copyright laws.
|
| 9 |
+
*
|
| 10 |
+
* These Licensed Deliverables contained herein is PROPRIETARY and
|
| 11 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and
|
| 12 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 13 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 14 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 15 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 16 |
+
* of the Licensed Deliverables to any third party without the express
|
| 17 |
+
* written consent of NVIDIA is prohibited.
|
| 18 |
+
*
|
| 19 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 20 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 21 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
|
| 22 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 23 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 24 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 25 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 26 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 27 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 28 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 29 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 30 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 31 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 32 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 33 |
+
*
|
| 34 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 35 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 36 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 37 |
+
* computer software documentation" as such terms are used in 48
|
| 38 |
+
* C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
|
| 39 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 40 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 41 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 42 |
+
* only those rights set forth herein.
|
| 43 |
+
*
|
| 44 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 45 |
+
* software must include, in the user documentation and internal
|
| 46 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 47 |
+
* Users Notice.
|
| 48 |
+
*/
|
| 49 |
+
|
| 50 |
+
#ifndef _CUDA_AWBARRIER_H_
|
| 51 |
+
# define _CUDA_AWBARRIER_H_
|
| 52 |
+
|
| 53 |
+
# include "cuda_awbarrier_primitives.h"
|
| 54 |
+
|
| 55 |
+
# if !defined(_CUDA_AWBARRIER_SM_TARGET)
|
| 56 |
+
# error This file requires compute capability 7.0 or greater.
|
| 57 |
+
# endif
|
| 58 |
+
|
| 59 |
+
# if !defined(_CUDA_AWBARRIER_CPLUSPLUS_11_OR_LATER)
|
| 60 |
+
# error This file requires compiler support for the ISO C++ 2011 standard. This support must be enabled with the \
|
| 61 |
+
-std=c++11 compiler option.
|
| 62 |
+
# endif
|
| 63 |
+
|
| 64 |
+
_CUDA_AWBARRIER_BEGIN_NAMESPACE
|
| 65 |
+
|
| 66 |
+
class awbarrier {
|
| 67 |
+
public:
|
| 68 |
+
class arrival_token {
|
| 69 |
+
public:
|
| 70 |
+
arrival_token() = default;
|
| 71 |
+
~arrival_token() = default;
|
| 72 |
+
_CUDA_AWBARRIER_QUALIFIER uint32_t pending_count() const;
|
| 73 |
+
private:
|
| 74 |
+
_CUDA_AWBARRIER_QUALIFIER arrival_token(uint64_t token);
|
| 75 |
+
uint64_t token;
|
| 76 |
+
friend awbarrier;
|
| 77 |
+
};
|
| 78 |
+
awbarrier() = default;
|
| 79 |
+
awbarrier(const awbarrier&) = delete;
|
| 80 |
+
awbarrier& operator=(const awbarrier&) = delete;
|
| 81 |
+
~awbarrier() = default;
|
| 82 |
+
|
| 83 |
+
_CUDA_AWBARRIER_QUALIFIER arrival_token arrive();
|
| 84 |
+
_CUDA_AWBARRIER_QUALIFIER arrival_token arrive_and_drop();
|
| 85 |
+
_CUDA_AWBARRIER_QUALIFIER bool timed_wait(arrival_token token, uint32_t hint_cycles);
|
| 86 |
+
_CUDA_AWBARRIER_QUALIFIER bool timed_wait_parity(bool phase, uint32_t hint_cycles);
|
| 87 |
+
_CUDA_AWBARRIER_QUALIFIER void wait(arrival_token token);
|
| 88 |
+
_CUDA_AWBARRIER_QUALIFIER void arrive_and_wait();
|
| 89 |
+
_CUDA_AWBARRIER_QUALIFIER bool try_wait(arrival_token token, uint32_t maxSleepNanosec);
|
| 90 |
+
_CUDA_AWBARRIER_QUALIFIER bool try_wait_parity(bool phase, uint32_t maxSleepNanosec);
|
| 91 |
+
_CUDA_AWBARRIER_STATIC_QUALIFIER __host__ constexpr uint32_t max();
|
| 92 |
+
|
| 93 |
+
private:
|
| 94 |
+
uint64_t barrier;
|
| 95 |
+
friend _CUDA_AWBARRIER_QUALIFIER void init(awbarrier* barrier, uint32_t expected_count);
|
| 96 |
+
friend _CUDA_AWBARRIER_QUALIFIER void inval(awbarrier* barrier);
|
| 97 |
+
friend class pipeline;
|
| 98 |
+
};
|
| 99 |
+
|
| 100 |
+
_CUDA_AWBARRIER_QUALIFIER
|
| 101 |
+
uint32_t awbarrier::arrival_token::pending_count() const
|
| 102 |
+
{
|
| 103 |
+
const uint32_t pending_count = _CUDA_AWBARRIER_INTERNAL_NAMESPACE::awbarrier_token_pending_count(this->token);
|
| 104 |
+
#if (__CUDA_ARCH__ >= 900)
|
| 105 |
+
return pending_count;
|
| 106 |
+
#else
|
| 107 |
+
return (pending_count >> 15);
|
| 108 |
+
#endif
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
_CUDA_AWBARRIER_QUALIFIER
|
| 112 |
+
awbarrier::arrival_token::arrival_token(uint64_t token)
|
| 113 |
+
: token(token)
|
| 114 |
+
{
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
_CUDA_AWBARRIER_QUALIFIER
|
| 118 |
+
void init(awbarrier* barrier, uint32_t expected_count)
|
| 119 |
+
{
|
| 120 |
+
_CUDA_AWBARRIER_ASSERT(__isShared(barrier));
|
| 121 |
+
_CUDA_AWBARRIER_ASSERT(expected_count > 0 && expected_count <= _CUDA_AWBARRIER_MAX_COUNT);
|
| 122 |
+
|
| 123 |
+
#if (__CUDA_ARCH__ >= 900)
|
| 124 |
+
const uint32_t init_count = expected_count;
|
| 125 |
+
#else
|
| 126 |
+
const uint32_t init_count = (expected_count << 15) + expected_count;
|
| 127 |
+
#endif
|
| 128 |
+
|
| 129 |
+
_CUDA_AWBARRIER_INTERNAL_NAMESPACE::awbarrier_init(&barrier->barrier, init_count);
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
_CUDA_AWBARRIER_QUALIFIER
|
| 133 |
+
void inval(awbarrier* barrier)
|
| 134 |
+
{
|
| 135 |
+
_CUDA_AWBARRIER_ASSERT(__isShared(barrier));
|
| 136 |
+
|
| 137 |
+
_CUDA_AWBARRIER_INTERNAL_NAMESPACE::awbarrier_inval(&barrier->barrier);
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
_CUDA_AWBARRIER_QUALIFIER
|
| 141 |
+
awbarrier::arrival_token awbarrier::arrive()
|
| 142 |
+
{
|
| 143 |
+
_CUDA_AWBARRIER_ASSERT(__isShared(&this->barrier));
|
| 144 |
+
|
| 145 |
+
#if (__CUDA_ARCH__ < 900)
|
| 146 |
+
const uint32_t arrive_count = 1 << 15;
|
| 147 |
+
const uint64_t token = _CUDA_AWBARRIER_INTERNAL_NAMESPACE::awbarrier_arrive_drop_no_complete<false>(&this->barrier, arrive_count);
|
| 148 |
+
(void)
|
| 149 |
+
#else
|
| 150 |
+
const uint64_t token =
|
| 151 |
+
#endif
|
| 152 |
+
_CUDA_AWBARRIER_INTERNAL_NAMESPACE::awbarrier_arrive_drop<false>(&this->barrier);
|
| 153 |
+
|
| 154 |
+
return arrival_token(token);
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
_CUDA_AWBARRIER_QUALIFIER
|
| 158 |
+
awbarrier::arrival_token awbarrier::arrive_and_drop()
|
| 159 |
+
{
|
| 160 |
+
_CUDA_AWBARRIER_ASSERT(__isShared(&this->barrier));
|
| 161 |
+
|
| 162 |
+
#if (__CUDA_ARCH__ < 900)
|
| 163 |
+
const uint32_t arrive_count = 1 << 15;
|
| 164 |
+
const uint64_t token = _CUDA_AWBARRIER_INTERNAL_NAMESPACE::awbarrier_arrive_drop_no_complete<true>(&this->barrier, arrive_count);
|
| 165 |
+
(void)
|
| 166 |
+
#else
|
| 167 |
+
const uint64_t token =
|
| 168 |
+
#endif
|
| 169 |
+
_CUDA_AWBARRIER_INTERNAL_NAMESPACE::awbarrier_arrive_drop<true>(&this->barrier);
|
| 170 |
+
|
| 171 |
+
return arrival_token(token);
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
_CUDA_AWBARRIER_QUALIFIER
|
| 175 |
+
bool awbarrier::timed_wait(arrival_token token, uint32_t hint_cycles)
|
| 176 |
+
{
|
| 177 |
+
constexpr uint64_t max_busy_wait_cycles = 1024;
|
| 178 |
+
constexpr uint32_t max_sleep_ns = 1 << 20;
|
| 179 |
+
|
| 180 |
+
_CUDA_AWBARRIER_ASSERT(__isShared(&this->barrier));
|
| 181 |
+
|
| 182 |
+
if (_CUDA_AWBARRIER_INTERNAL_NAMESPACE::awbarrier_test_wait(&this->barrier, token.token)) {
|
| 183 |
+
return true;
|
| 184 |
+
}
|
| 185 |
+
|
| 186 |
+
uint64_t start_cycles = clock64();
|
| 187 |
+
uint64_t elapsed_cycles = 0;
|
| 188 |
+
uint32_t sleep_ns = 32;
|
| 189 |
+
while (elapsed_cycles < hint_cycles) {
|
| 190 |
+
if (_CUDA_AWBARRIER_INTERNAL_NAMESPACE::awbarrier_test_wait(&this->barrier, token.token)) {
|
| 191 |
+
return true;
|
| 192 |
+
}
|
| 193 |
+
|
| 194 |
+
if (elapsed_cycles > max_busy_wait_cycles) {
|
| 195 |
+
__nanosleep(sleep_ns);
|
| 196 |
+
if (sleep_ns < max_sleep_ns) {
|
| 197 |
+
sleep_ns *= 2;
|
| 198 |
+
}
|
| 199 |
+
}
|
| 200 |
+
|
| 201 |
+
elapsed_cycles = clock64() - start_cycles;
|
| 202 |
+
}
|
| 203 |
+
|
| 204 |
+
return false;
|
| 205 |
+
}
|
| 206 |
+
|
| 207 |
+
_CUDA_AWBARRIER_QUALIFIER
|
| 208 |
+
bool awbarrier::timed_wait_parity(bool phase, uint32_t hint_cycles)
|
| 209 |
+
{
|
| 210 |
+
constexpr uint64_t max_busy_wait_cycles = 1024;
|
| 211 |
+
constexpr uint32_t max_sleep_ns = 1 << 20;
|
| 212 |
+
|
| 213 |
+
_CUDA_AWBARRIER_ASSERT(__isShared(&this->barrier));
|
| 214 |
+
|
| 215 |
+
if (_CUDA_AWBARRIER_INTERNAL_NAMESPACE::awbarrier_test_wait_parity(&this->barrier, phase)) {
|
| 216 |
+
return true;
|
| 217 |
+
}
|
| 218 |
+
|
| 219 |
+
uint64_t start_cycles = clock64();
|
| 220 |
+
uint64_t elapsed_cycles = 0;
|
| 221 |
+
uint32_t sleep_ns = 32;
|
| 222 |
+
while (elapsed_cycles < hint_cycles) {
|
| 223 |
+
if (_CUDA_AWBARRIER_INTERNAL_NAMESPACE::awbarrier_test_wait_parity(&this->barrier, phase)) {
|
| 224 |
+
return true;
|
| 225 |
+
}
|
| 226 |
+
|
| 227 |
+
if (elapsed_cycles > max_busy_wait_cycles) {
|
| 228 |
+
__nanosleep(sleep_ns);
|
| 229 |
+
if (sleep_ns < max_sleep_ns) {
|
| 230 |
+
sleep_ns *= 2;
|
| 231 |
+
}
|
| 232 |
+
}
|
| 233 |
+
|
| 234 |
+
elapsed_cycles = clock64() - start_cycles;
|
| 235 |
+
}
|
| 236 |
+
|
| 237 |
+
return false;
|
| 238 |
+
}
|
| 239 |
+
|
| 240 |
+
_CUDA_AWBARRIER_QUALIFIER
|
| 241 |
+
bool awbarrier::try_wait(arrival_token token, uint32_t maxSleepNanosec)
|
| 242 |
+
{
|
| 243 |
+
_CUDA_AWBARRIER_ASSERT(__isShared(&this->barrier));
|
| 244 |
+
|
| 245 |
+
return _CUDA_AWBARRIER_INTERNAL_NAMESPACE::awbarrier_try_wait(&this->barrier, token.token, maxSleepNanosec);
|
| 246 |
+
}
|
| 247 |
+
|
| 248 |
+
_CUDA_AWBARRIER_QUALIFIER
|
| 249 |
+
bool awbarrier::try_wait_parity(bool phase, uint32_t maxSleepNanosec)
|
| 250 |
+
{
|
| 251 |
+
_CUDA_AWBARRIER_ASSERT(__isShared(&this->barrier));
|
| 252 |
+
|
| 253 |
+
return _CUDA_AWBARRIER_INTERNAL_NAMESPACE::awbarrier_try_wait_parity(&this->barrier, phase, maxSleepNanosec);
|
| 254 |
+
}
|
| 255 |
+
|
| 256 |
+
_CUDA_AWBARRIER_QUALIFIER
|
| 257 |
+
void awbarrier::wait(arrival_token token)
|
| 258 |
+
{
|
| 259 |
+
_CUDA_AWBARRIER_ASSERT(__isShared(&this->barrier));
|
| 260 |
+
|
| 261 |
+
while (!timed_wait(token, ~0u));
|
| 262 |
+
}
|
| 263 |
+
|
| 264 |
+
_CUDA_AWBARRIER_QUALIFIER
|
| 265 |
+
void awbarrier::arrive_and_wait()
|
| 266 |
+
{
|
| 267 |
+
_CUDA_AWBARRIER_ASSERT(__isShared(&this->barrier));
|
| 268 |
+
|
| 269 |
+
this->wait(this->arrive());
|
| 270 |
+
}
|
| 271 |
+
|
| 272 |
+
_CUDA_AWBARRIER_QUALIFIER __host__
|
| 273 |
+
constexpr uint32_t awbarrier::max()
|
| 274 |
+
{
|
| 275 |
+
return _CUDA_AWBARRIER_MAX_COUNT;
|
| 276 |
+
}
|
| 277 |
+
|
| 278 |
+
_CUDA_AWBARRIER_END_NAMESPACE
|
| 279 |
+
|
| 280 |
+
#endif /* !_CUDA_AWBARRIER_H_ */
|
miniconda3/envs/ladir/lib/python3.10/site-packages/nvidia/cuda_runtime/include/cuda_awbarrier_helpers.h
ADDED
|
@@ -0,0 +1,365 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Copyright 1993-2019 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE TO LICENSEE:
|
| 5 |
+
*
|
| 6 |
+
* This source code and/or documentation ("Licensed Deliverables") are
|
| 7 |
+
* subject to NVIDIA intellectual property rights under U.S. and
|
| 8 |
+
* international Copyright laws.
|
| 9 |
+
*
|
| 10 |
+
* These Licensed Deliverables contained herein is PROPRIETARY and
|
| 11 |
+
* CONFIDENTIAL to NVIDIA and is being provided under the terms and
|
| 12 |
+
* conditions of a form of NVIDIA software license agreement by and
|
| 13 |
+
* between NVIDIA and Licensee ("License Agreement") or electronically
|
| 14 |
+
* accepted by Licensee. Notwithstanding any terms or conditions to
|
| 15 |
+
* the contrary in the License Agreement, reproduction or disclosure
|
| 16 |
+
* of the Licensed Deliverables to any third party without the express
|
| 17 |
+
* written consent of NVIDIA is prohibited.
|
| 18 |
+
*
|
| 19 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 20 |
+
* LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
|
| 21 |
+
* SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
|
| 22 |
+
* PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
|
| 23 |
+
* NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
|
| 24 |
+
* DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
|
| 25 |
+
* NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 26 |
+
* NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
|
| 27 |
+
* LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
|
| 28 |
+
* SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
|
| 29 |
+
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
| 30 |
+
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
|
| 31 |
+
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
| 32 |
+
* OF THESE LICENSED DELIVERABLES.
|
| 33 |
+
*
|
| 34 |
+
* U.S. Government End Users. These Licensed Deliverables are a
|
| 35 |
+
* "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
|
| 36 |
+
* 1995), consisting of "commercial computer software" and "commercial
|
| 37 |
+
* computer software documentation" as such terms are used in 48
|
| 38 |
+
* C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
|
| 39 |
+
* only as a commercial end item. Consistent with 48 C.F.R.12.212 and
|
| 40 |
+
* 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
|
| 41 |
+
* U.S. Government End Users acquire the Licensed Deliverables with
|
| 42 |
+
* only those rights set forth herein.
|
| 43 |
+
*
|
| 44 |
+
* Any use of the Licensed Deliverables in individual and commercial
|
| 45 |
+
* software must include, in the user documentation and internal
|
| 46 |
+
* comments to the code, the above Disclaimer and U.S. Government End
|
| 47 |
+
* Users Notice.
|
| 48 |
+
*/
|
| 49 |
+
|
| 50 |
+
#ifndef _CUDA_AWBARRIER_HELPERS_H_
|
| 51 |
+
#define _CUDA_AWBARRIER_HELPERS_H_
|
| 52 |
+
|
| 53 |
+
#define _CUDA_AWBARRIER_NAMESPACE nvcuda::experimental
|
| 54 |
+
#define _CUDA_AWBARRIER_BEGIN_NAMESPACE namespace nvcuda { namespace experimental {
|
| 55 |
+
#define _CUDA_AWBARRIER_END_NAMESPACE } }
|
| 56 |
+
|
| 57 |
+
#define _CUDA_AWBARRIER_INTERNAL_NAMESPACE _CUDA_AWBARRIER_NAMESPACE::__awbarrier_internal
|
| 58 |
+
#define _CUDA_AWBARRIER_BEGIN_INTERNAL_NAMESPACE _CUDA_AWBARRIER_BEGIN_NAMESPACE namespace __awbarrier_internal {
|
| 59 |
+
#define _CUDA_AWBARRIER_END_INTERNAL_NAMESPACE } _CUDA_AWBARRIER_END_NAMESPACE
|
| 60 |
+
|
| 61 |
+
# if !defined(_CUDA_AWBARRIER_QUALIFIER)
|
| 62 |
+
# define _CUDA_AWBARRIER_QUALIFIER inline __device__
|
| 63 |
+
# endif
|
| 64 |
+
# if !defined(_CUDA_AWBARRIER_STATIC_QUALIFIER)
|
| 65 |
+
# define _CUDA_AWBARRIER_STATIC_QUALIFIER static inline __device__
|
| 66 |
+
#endif
|
| 67 |
+
|
| 68 |
+
#if defined(__CUDA_ARCH__)
|
| 69 |
+
#if (__CUDA_ARCH__ >= 900)
|
| 70 |
+
# define _CUDA_AWBARRIER_SM_TARGET _CUDA_AWBARRIER_SM_90
|
| 71 |
+
#elif (__CUDA_ARCH__ >= 800)
|
| 72 |
+
# define _CUDA_AWBARRIER_SM_TARGET _CUDA_AWBARRIER_SM_80
|
| 73 |
+
#elif (__CUDA_ARCH__ >= 700)
|
| 74 |
+
# define _CUDA_AWBARRIER_SM_TARGET _CUDA_AWBARRIER_SM_70
|
| 75 |
+
#endif
|
| 76 |
+
#else
|
| 77 |
+
# define _CUDA_AWBARRIER_SM_TARGET _CUDA_AWBARRIER_SM_70
|
| 78 |
+
#endif
|
| 79 |
+
|
| 80 |
+
#define _CUDA_AWBARRIER_MAX_COUNT ((1 << 14) - 1)
|
| 81 |
+
|
| 82 |
+
#if defined(__cplusplus) && ((__cplusplus >= 201103L) || (defined(_MSC_VER) && (_MSC_VER >= 1900)))
|
| 83 |
+
# define _CUDA_AWBARRIER_CPLUSPLUS_11_OR_LATER
|
| 84 |
+
#endif
|
| 85 |
+
|
| 86 |
+
#if !defined(_CUDA_AWBARRIER_DEBUG)
|
| 87 |
+
# if defined(__CUDACC_DEBUG__)
|
| 88 |
+
# define _CUDA_AWBARRIER_DEBUG 1
|
| 89 |
+
# else
|
| 90 |
+
# define _CUDA_AWBARRIER_DEBUG 0
|
| 91 |
+
# endif
|
| 92 |
+
#endif
|
| 93 |
+
|
| 94 |
+
#if defined(_CUDA_AWBARRIER_DEBUG) && (_CUDA_AWBARRIER_DEBUG == 1) && !defined(NDEBUG)
|
| 95 |
+
# if !defined(__CUDACC_RTC__)
|
| 96 |
+
# include <cassert>
|
| 97 |
+
# endif
|
| 98 |
+
# define _CUDA_AWBARRIER_ASSERT(x) assert((x));
|
| 99 |
+
# define _CUDA_AWBARRIER_ABORT() assert(0);
|
| 100 |
+
#else
|
| 101 |
+
# define _CUDA_AWBARRIER_ASSERT(x)
|
| 102 |
+
# define _CUDA_AWBARRIER_ABORT() __trap();
|
| 103 |
+
#endif
|
| 104 |
+
|
| 105 |
+
#if defined(__CUDACC_RTC__)
|
| 106 |
+
typedef unsigned short uint16_t;
|
| 107 |
+
typedef unsigned int uint32_t;
|
| 108 |
+
typedef unsigned long long uint64_t;
|
| 109 |
+
typedef uint64_t uintptr_t;
|
| 110 |
+
#else
|
| 111 |
+
# include <stdint.h>
|
| 112 |
+
#endif
|
| 113 |
+
|
| 114 |
+
// implicitly provided by NVRTC
|
| 115 |
+
#ifndef __CUDACC_RTC__
|
| 116 |
+
#include <nv/target>
|
| 117 |
+
#endif /* !defined(__CUDACC_RTC__) */
|
| 118 |
+
|
| 119 |
+
typedef uint64_t __mbarrier_t;
|
| 120 |
+
typedef uint64_t __mbarrier_token_t;
|
| 121 |
+
|
| 122 |
+
_CUDA_AWBARRIER_BEGIN_INTERNAL_NAMESPACE
|
| 123 |
+
|
| 124 |
+
extern "C" __device__ uint32_t __nvvm_get_smem_pointer(void *);
|
| 125 |
+
|
| 126 |
+
union AWBarrier {
|
| 127 |
+
struct {
|
| 128 |
+
uint32_t expected;
|
| 129 |
+
uint32_t pending;
|
| 130 |
+
} split;
|
| 131 |
+
uint64_t raw;
|
| 132 |
+
};
|
| 133 |
+
|
| 134 |
+
_CUDA_AWBARRIER_STATIC_QUALIFIER
|
| 135 |
+
void awbarrier_init(uint64_t* barrier, uint32_t expected_count) {
|
| 136 |
+
_CUDA_AWBARRIER_ASSERT(__isShared(barrier));
|
| 137 |
+
_CUDA_AWBARRIER_ASSERT(expected_count > 0 && expected_count < (1 << 29));
|
| 138 |
+
|
| 139 |
+
NV_IF_TARGET(NV_PROVIDES_SM_80,
|
| 140 |
+
asm volatile ("mbarrier.init.shared.b64 [%0], %1;"
|
| 141 |
+
:
|
| 142 |
+
: "r"(__nvvm_get_smem_pointer(barrier)), "r"(expected_count)
|
| 143 |
+
: "memory");
|
| 144 |
+
return;
|
| 145 |
+
)
|
| 146 |
+
NV_IF_TARGET(NV_PROVIDES_SM_70,
|
| 147 |
+
AWBarrier* awbarrier = reinterpret_cast<AWBarrier*>(barrier);
|
| 148 |
+
|
| 149 |
+
awbarrier->split.expected = 0x40000000 - expected_count;
|
| 150 |
+
awbarrier->split.pending = 0x80000000 - expected_count;
|
| 151 |
+
return;
|
| 152 |
+
)
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
_CUDA_AWBARRIER_STATIC_QUALIFIER
|
| 156 |
+
void awbarrier_inval(uint64_t* barrier) {
|
| 157 |
+
_CUDA_AWBARRIER_ASSERT(__isShared(barrier));
|
| 158 |
+
|
| 159 |
+
NV_IF_TARGET(NV_PROVIDES_SM_80,
|
| 160 |
+
asm volatile ("mbarrier.inval.shared.b64 [%0];"
|
| 161 |
+
:
|
| 162 |
+
: "r"(__nvvm_get_smem_pointer(barrier))
|
| 163 |
+
: "memory");
|
| 164 |
+
return;
|
| 165 |
+
)
|
| 166 |
+
return;
|
| 167 |
+
}
|
| 168 |
+
|
| 169 |
+
_CUDA_AWBARRIER_STATIC_QUALIFIER
|
| 170 |
+
uint32_t awbarrier_token_pending_count(uint64_t token) {
|
| 171 |
+
NV_IF_TARGET(NV_PROVIDES_SM_80,
|
| 172 |
+
uint32_t __pending_count;
|
| 173 |
+
|
| 174 |
+
asm ("mbarrier.pending_count.b64 %0, %1;"
|
| 175 |
+
: "=r"(__pending_count)
|
| 176 |
+
: "l"(token));
|
| 177 |
+
return __pending_count;
|
| 178 |
+
)
|
| 179 |
+
NV_IF_TARGET(NV_PROVIDES_SM_70,
|
| 180 |
+
const uint32_t pending = token >> 32;
|
| 181 |
+
return 0x80000000 - (pending & 0x7fffffff);
|
| 182 |
+
)
|
| 183 |
+
}
|
| 184 |
+
|
| 185 |
+
template<bool _Drop>
|
| 186 |
+
_CUDA_AWBARRIER_STATIC_QUALIFIER
|
| 187 |
+
uint64_t awbarrier_arrive_drop(uint64_t* barrier) {
|
| 188 |
+
_CUDA_AWBARRIER_ASSERT(__isShared(barrier));
|
| 189 |
+
|
| 190 |
+
NV_IF_TARGET(NV_PROVIDES_SM_80,
|
| 191 |
+
uint64_t token;
|
| 192 |
+
|
| 193 |
+
if (_Drop) {
|
| 194 |
+
asm volatile ("mbarrier.arrive_drop.shared.b64 %0, [%1];"
|
| 195 |
+
: "=l"(token)
|
| 196 |
+
: "r"(__nvvm_get_smem_pointer(barrier))
|
| 197 |
+
: "memory");
|
| 198 |
+
} else {
|
| 199 |
+
asm volatile ("mbarrier.arrive.shared.b64 %0, [%1];"
|
| 200 |
+
: "=l"(token)
|
| 201 |
+
: "r"(__nvvm_get_smem_pointer(barrier))
|
| 202 |
+
: "memory");
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
return token;
|
| 206 |
+
)
|
| 207 |
+
NV_IF_TARGET(NV_PROVIDES_SM_70,
|
| 208 |
+
AWBarrier* awbarrier = reinterpret_cast<AWBarrier*>(barrier);
|
| 209 |
+
|
| 210 |
+
while ((*reinterpret_cast<volatile uint32_t*>(&awbarrier->split.pending) & 0x7fffffff) == 0);
|
| 211 |
+
|
| 212 |
+
if (_Drop) {
|
| 213 |
+
(void)atomicAdd_block(&awbarrier->split.expected, 1);
|
| 214 |
+
}
|
| 215 |
+
|
| 216 |
+
__threadfence_block();
|
| 217 |
+
|
| 218 |
+
const uint32_t old_pending = atomicAdd_block(&awbarrier->split.pending, 1);
|
| 219 |
+
const uint32_t new_pending = old_pending + 1;
|
| 220 |
+
const bool reset = (old_pending ^ new_pending) & 0x80000000;
|
| 221 |
+
|
| 222 |
+
if (reset) {
|
| 223 |
+
__threadfence_block();
|
| 224 |
+
|
| 225 |
+
uint32_t new_expected = *reinterpret_cast<volatile uint32_t*>(&awbarrier->split.expected);
|
| 226 |
+
new_expected &= ~0x40000000;
|
| 227 |
+
if (new_expected & 0x20000000) {
|
| 228 |
+
new_expected |= 0x40000000;
|
| 229 |
+
}
|
| 230 |
+
atomicAdd_block(&awbarrier->split.pending, new_expected);
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
return static_cast<uint64_t>(old_pending) << 32;
|
| 234 |
+
)
|
| 235 |
+
}
|
| 236 |
+
|
| 237 |
+
template<bool _Drop>
|
| 238 |
+
_CUDA_AWBARRIER_STATIC_QUALIFIER
|
| 239 |
+
uint64_t awbarrier_arrive_drop_no_complete(uint64_t* barrier, uint32_t count) {
|
| 240 |
+
_CUDA_AWBARRIER_ASSERT(__isShared(barrier));
|
| 241 |
+
_CUDA_AWBARRIER_ASSERT(count > 0 && count < (1 << 29));
|
| 242 |
+
|
| 243 |
+
NV_IF_TARGET(NV_PROVIDES_SM_80,
|
| 244 |
+
uint64_t token;
|
| 245 |
+
|
| 246 |
+
if (_Drop) {
|
| 247 |
+
asm volatile ("mbarrier.arrive_drop.noComplete.shared.b64 %0, [%1], %2;"
|
| 248 |
+
: "=l"(token)
|
| 249 |
+
: "r"(__nvvm_get_smem_pointer(barrier)), "r"(count)
|
| 250 |
+
: "memory");
|
| 251 |
+
} else {
|
| 252 |
+
asm volatile ("mbarrier.arrive.noComplete.shared.b64 %0, [%1], %2;"
|
| 253 |
+
: "=l"(token)
|
| 254 |
+
: "r"(__nvvm_get_smem_pointer(barrier)), "r"(count)
|
| 255 |
+
: "memory");
|
| 256 |
+
}
|
| 257 |
+
|
| 258 |
+
return token;
|
| 259 |
+
)
|
| 260 |
+
NV_IF_TARGET(NV_PROVIDES_SM_70,
|
| 261 |
+
AWBarrier* awbarrier = reinterpret_cast<AWBarrier*>(barrier);
|
| 262 |
+
|
| 263 |
+
while ((*reinterpret_cast<volatile uint32_t*>(&awbarrier->split.pending) & 0x7fffffff) == 0);
|
| 264 |
+
|
| 265 |
+
if (_Drop) {
|
| 266 |
+
(void)atomicAdd_block(&awbarrier->split.expected, count);
|
| 267 |
+
}
|
| 268 |
+
|
| 269 |
+
return static_cast<uint64_t>(atomicAdd_block(&awbarrier->split.pending, count)) << 32;
|
| 270 |
+
)
|
| 271 |
+
}
|
| 272 |
+
|
| 273 |
+
_CUDA_AWBARRIER_STATIC_QUALIFIER
|
| 274 |
+
bool awbarrier_test_wait(uint64_t* barrier, uint64_t token) {
|
| 275 |
+
_CUDA_AWBARRIER_ASSERT(__isShared(barrier));
|
| 276 |
+
|
| 277 |
+
NV_IF_TARGET(NV_PROVIDES_SM_80,
|
| 278 |
+
uint32_t __wait_complete;
|
| 279 |
+
|
| 280 |
+
asm volatile ("{"
|
| 281 |
+
" .reg .pred %%p;"
|
| 282 |
+
" mbarrier.test_wait.shared.b64 %%p, [%1], %2;"
|
| 283 |
+
" selp.b32 %0, 1, 0, %%p;"
|
| 284 |
+
"}"
|
| 285 |
+
: "=r"(__wait_complete)
|
| 286 |
+
: "r"(__nvvm_get_smem_pointer(barrier)), "l"(token)
|
| 287 |
+
: "memory");
|
| 288 |
+
return bool(__wait_complete);
|
| 289 |
+
)
|
| 290 |
+
NV_IF_TARGET(NV_PROVIDES_SM_70,
|
| 291 |
+
volatile AWBarrier* awbarrier = reinterpret_cast<volatile AWBarrier*>(barrier);
|
| 292 |
+
|
| 293 |
+
return ((token >> 32) ^ awbarrier->split.pending) & 0x80000000;
|
| 294 |
+
)
|
| 295 |
+
}
|
| 296 |
+
|
| 297 |
+
_CUDA_AWBARRIER_STATIC_QUALIFIER
|
| 298 |
+
bool awbarrier_test_wait_parity(uint64_t* barrier, bool phase_parity) {
|
| 299 |
+
_CUDA_AWBARRIER_ASSERT(__isShared(barrier));
|
| 300 |
+
|
| 301 |
+
NV_IF_TARGET(NV_PROVIDES_SM_90,
|
| 302 |
+
uint32_t __wait_complete = 0;
|
| 303 |
+
|
| 304 |
+
asm volatile ("{"
|
| 305 |
+
".reg .pred %%p;"
|
| 306 |
+
"mbarrier.test_wait.parity.shared.b64 %%p, [%1], %2;"
|
| 307 |
+
"selp.b32 %0, 1, 0, %%p;"
|
| 308 |
+
"}"
|
| 309 |
+
: "=r"(__wait_complete)
|
| 310 |
+
: "r"(__nvvm_get_smem_pointer(barrier)), "r"(static_cast<uint32_t>(phase_parity))
|
| 311 |
+
: "memory");
|
| 312 |
+
|
| 313 |
+
return __wait_complete;
|
| 314 |
+
)
|
| 315 |
+
_CUDA_AWBARRIER_ABORT()
|
| 316 |
+
return false;
|
| 317 |
+
}
|
| 318 |
+
|
| 319 |
+
_CUDA_AWBARRIER_STATIC_QUALIFIER
|
| 320 |
+
bool awbarrier_try_wait(uint64_t* barrier, uint64_t token, uint32_t max_sleep_nanosec) {
|
| 321 |
+
_CUDA_AWBARRIER_ASSERT(__isShared(barrier));
|
| 322 |
+
|
| 323 |
+
NV_IF_TARGET(NV_PROVIDES_SM_90,
|
| 324 |
+
uint32_t __wait_complete = 0;
|
| 325 |
+
|
| 326 |
+
asm volatile ("{\n\t"
|
| 327 |
+
".reg .pred p;\n\t"
|
| 328 |
+
"mbarrier.try_wait.shared.b64 p, [%1], %2, %3;\n\t"
|
| 329 |
+
"selp.b32 %0, 1, 0, p;\n\t"
|
| 330 |
+
"}"
|
| 331 |
+
: "=r"(__wait_complete)
|
| 332 |
+
: "r"(__nvvm_get_smem_pointer(barrier)), "l"(token), "r"(max_sleep_nanosec)
|
| 333 |
+
: "memory");
|
| 334 |
+
|
| 335 |
+
return __wait_complete;
|
| 336 |
+
)
|
| 337 |
+
_CUDA_AWBARRIER_ABORT()
|
| 338 |
+
return false;
|
| 339 |
+
}
|
| 340 |
+
|
| 341 |
+
_CUDA_AWBARRIER_STATIC_QUALIFIER
|
| 342 |
+
bool awbarrier_try_wait_parity(uint64_t* barrier, bool phase_parity, uint32_t max_sleep_nanosec) {
|
| 343 |
+
_CUDA_AWBARRIER_ASSERT(__isShared(barrier));
|
| 344 |
+
|
| 345 |
+
NV_IF_TARGET(NV_PROVIDES_SM_90,
|
| 346 |
+
uint32_t __wait_complete = 0;
|
| 347 |
+
|
| 348 |
+
asm volatile ("{\n\t"
|
| 349 |
+
".reg .pred p;\n\t"
|
| 350 |
+
"mbarrier.try_wait.parity.shared.b64 p, [%1], %2, %3;\n\t"
|
| 351 |
+
"selp.b32 %0, 1, 0, p;\n\t"
|
| 352 |
+
"}"
|
| 353 |
+
: "=r"(__wait_complete)
|
| 354 |
+
: "r"(__nvvm_get_smem_pointer(barrier)), "r"(static_cast<uint32_t>(phase_parity)), "r"(max_sleep_nanosec)
|
| 355 |
+
: "memory");
|
| 356 |
+
|
| 357 |
+
return __wait_complete;
|
| 358 |
+
)
|
| 359 |
+
_CUDA_AWBARRIER_ABORT()
|
| 360 |
+
return false;
|
| 361 |
+
}
|
| 362 |
+
|
| 363 |
+
_CUDA_AWBARRIER_END_INTERNAL_NAMESPACE
|
| 364 |
+
|
| 365 |
+
#endif /* !_CUDA_AWBARRIER_HELPERS_H_ */
|