Skip to content

5.4 C/C++ Language Extensions ​

待翻译

本节已建立目录框架,正文尚未翻译。

5.4.1 Function and Variable Annotations ​

5.4.1.1 Execution Space Specifiers ​

5.4.1.2 Memory Space Specifiers ​

5.4.1.2.1 shared Memory ​

5.4.1.2.2 managed Memory ​

5.4.1.2.3 tile Variables ​

5.4.1.3 Inlining Specifiers ​

5.4.1.4 restrict Pointers ​

5.4.1.5 grid_constant Parameters ​

5.4.1.6 Annotation Summary ​

5.4.2 Built-in Types and Variables ​

5.4.2.1 Host Compiler Type Extensions ​

5.4.2.2 Built-in Variables ​

5.4.2.3 Built-in Types ​

5.4.3 Kernel Configuration ​

5.4.3.1 Thread Block Cluster ​

5.4.3.2 Launch Bounds ​

5.4.3.3 Maximum Number of Registers per Thread ​

5.4.4 Synchronization Primitives ​

5.4.4.1 Thread Block Synchronization Functions ​

5.4.4.2 Warp Synchronization Function ​

5.4.4.3 Memory Fence Functions ​

5.4.5 Atomic Functions ​

5.4.5.1 Legacy Atomic Functions ​

5.4.5.1.1 atomicAdd() ​

5.4.5.1.2 atomicSub() ​

5.4.5.1.3 atomicInc() ​

5.4.5.1.4 atomicDec() ​

5.4.5.1.5 atomicAnd() ​

5.4.5.1.6 atomicOr() ​

5.4.5.1.7 atomicXor() ​

5.4.5.1.8 atomicMin() ​

5.4.5.1.9 atomicMax() ​

5.4.5.1.10 atomicExch() ​

5.4.5.1.11 atomicCAS() ​

5.4.5.2 Built-in Atomic Functions ​

5.4.5.2.1 __nv_atomic_fetch_add(), __nv_atomic_add() ​

5.4.5.2.2 __nv_atomic_fetch_sub(), __nv_atomic_sub() ​

5.4.5.2.3 __nv_atomic_fetch_and(), __nv_atomic_and() ​

5.4.5.2.4 __nv_atomic_fetch_or(), __nv_atomic_or() ​

5.4.5.2.5 __nv_atomic_fetch_xor(), __nv_atomic_xor() ​

5.4.5.2.6 __nv_atomic_fetch_min(), __nv_atomic_min() ​

5.4.5.2.7 __nv_atomic_fetch_max(), __nv_atomic_max() ​

5.4.5.2.8 __nv_atomic_exchange(), __nv_atomic_exchange_n() ​

5.4.5.2.9 __nv_atomic_compare_exchange(), __nv_atomic_compare_exchange_n() ​

5.4.5.2.10 __nv_atomic_load(), __nv_atomic_load_n() ​

5.4.5.2.11 __nv_atomic_store(), __nv_atomic_store_n() ​

5.4.5.2.12 __nv_atomic_thread_fence() ​

5.4.6 Warp Functions ​

5.4.6.1 Warp Active Mask ​

5.4.6.2 Warp Vote Functions ​

5.4.6.3 Warp Match Functions ​

5.4.6.4 Warp Reduce Functions ​

5.4.6.5 Warp Shuffle Functions ​

5.4.6.6 Warp __sync Intrinsic Constraints ​

5.4.7 CUDA-Specific Macros ​

5.4.7.1 CUDA_ARCH ​

5.4.7.2 CUDA_ARCH_SPECIFIC and CUDA_ARCH_FAMILY_SPECIFIC ​

5.4.7.3 CUDA Feature Testing Macros ​

5.4.7.4 nv_pure Attribute ​

5.4.8 CUDA-Specific Functions ​

5.4.8.1 Address Space Predicate Functions ​

5.4.8.2 Address Space Conversion Functions ​

5.4.8.3 Low-Level Load and Store Functions ​

5.4.8.4 __trap() ​

5.4.8.5 __nanosleep() ​

5.4.8.6 Dynamic Programming eXtension (DPX) Instructions ​

5.4.9 Compiler Optimization Hints ​

5.4.9.1 #pragma unroll ​

5.4.9.2 __builtin_assume_aligned() ​

5.4.9.3 __builtin_assume() and __assume() ​

5.4.9.4 __builtin_constant_p() ​

5.4.9.5 __builtin_expect() ​

5.4.9.6 __builtin_unreachable() ​

5.4.9.7 Custom ABI Pragmas ​

5.4.9.8 MMA Throughput Pragma ​

5.4.10 Debugging and Diagnostics ​

5.4.10.1 Assertion ​

5.4.10.2 Breakpoint Function ​

5.4.10.3 Diagnostic Pragmas ​

5.4.11 Warp Matrix Functions ​

5.4.11.1 Description ​

5.4.11.2 Alternate Floating Point ​

5.4.11.3 Double Precision ​

5.4.11.4 Sub-byte Operations ​

5.4.11.5 Restrictions ​

5.4.11.6 Element Types and Matrix Sizes ​

5.4.11.7 Example ​