Skip to main content

singe_cuda_sys/
driver_sys_13040.rs

1/* automatically generated by rust-bindgen 0.72.1 */
2
3/// CUDA API version number.
4pub const CUDA_VERSION: u32 = 13040;
5/// CUDA IPC handle size.
6pub const CU_IPC_HANDLE_SIZE: u32 = 64;
7/// Indicates that compute device class supports accelerated features.
8pub const CU_COMPUTE_ACCELERATED_TARGET_BASE: u32 = 65536;
9/// Indicates that compute device class supports family features.
10pub const CU_COMPUTE_FAMILY_TARGET_BASE: u32 = 131072;
11/// Conditional node handle flags.
12///
13/// Default value is applied when graph is launched.
14pub const CU_GRAPH_COND_ASSIGN_DEFAULT: u32 = 1;
15/// This port activates when the kernel has finished executing.
16pub const CU_GRAPH_KERNEL_NODE_PORT_DEFAULT: u32 = 0;
17/// This port activates when all blocks of the kernel have performed cudaTriggerProgrammaticLaunchCompletion() or have terminated.
18///
19/// It must be used with edge type [`CUgraphDependencyType_enum::CU_GRAPH_DEPENDENCY_TYPE_PROGRAMMATIC`]. See also [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT`].
20pub const CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC: u32 = 1;
21/// This port activates when all blocks of the kernel have begun execution.
22///
23/// See also [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT`].
24pub const CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER: u32 = 2;
25/// If set, host memory is portable between CUDA contexts.
26///
27/// Flag for [`cuMemHostAlloc`].
28pub const CU_MEMHOSTALLOC_PORTABLE: u32 = 1;
29/// If set, host memory is mapped into CUDA address space and cuMemHostGetDevicePointer() may be called on the host pointer.
30///
31/// Flag for [`cuMemHostAlloc`].
32pub const CU_MEMHOSTALLOC_DEVICEMAP: u32 = 2;
33/// If set, host memory is allocated as write-combined - fast to write, faster to DMA, slow to read except via SSE4 streaming load instruction (MOVNTDQA).
34///
35/// Flag for [`cuMemHostAlloc`].
36pub const CU_MEMHOSTALLOC_WRITECOMBINED: u32 = 4;
37/// If set, host memory is portable between CUDA contexts.
38///
39/// Flag for cuMemHostRegister().
40pub const CU_MEMHOSTREGISTER_PORTABLE: u32 = 1;
41/// If set, host memory is mapped into CUDA address space and cuMemHostGetDevicePointer() may be called on the host pointer.
42///
43/// Flag for cuMemHostRegister().
44pub const CU_MEMHOSTREGISTER_DEVICEMAP: u32 = 2;
45/// If set, the passed memory pointer is treated as pointing to some memory-mapped I/O space, e.g.
46///
47/// belonging to a third-party PCIe device. On Windows the flag is a no-op. On Linux that memory is marked as non cache-coherent for the GPU and is expected to be physically contiguous. It may return [`cudaError_enum::CUDA_ERROR_NOT_PERMITTED`] if run as an unprivileged user, [`cudaError_enum::CUDA_ERROR_NOT_SUPPORTED`] on older Linux kernel versions. On all other platforms, it is not supported and [`cudaError_enum::CUDA_ERROR_NOT_SUPPORTED`] is returned. Flag for cuMemHostRegister().
48pub const CU_MEMHOSTREGISTER_IOMEMORY: u32 = 4;
49/// If set, the passed memory pointer is treated as pointing to memory that is considered read-only by the device.
50///
51/// On platforms without [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES`], this flag is required in order to register memory mapped to the CPU as read-only. Support for the use of this flag can be queried from the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_READ_ONLY_HOST_REGISTER_SUPPORTED`]. Using this flag with a current context associated with a device that does not have this attribute set will cause cuMemHostRegister to error with [`cudaError_enum::CUDA_ERROR_NOT_SUPPORTED`].
52pub const CU_MEMHOSTREGISTER_READ_ONLY: u32 = 8;
53/// Indicates that the layered sparse CUDA array or CUDA mipmapped array has a single mip tail region for all layers.
54pub const CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL: u32 = 1;
55/// Size of tensor map descriptor.
56pub const CU_TENSOR_MAP_NUM_QWORDS: u32 = 16;
57/// Indicates that the external memory object is a dedicated resource.
58pub const CUDA_EXTERNAL_MEMORY_DEDICATED: u32 = 1;
59/// When the `flags` parameter of CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS contains this flag, it indicates that signaling an external semaphore object should skip performing appropriate memory synchronization operations over all the external memory objects that are imported as [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF`], which otherwise are performed by default to ensure data coherency with other importers of the same NvSciBuf memory objects.
60pub const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC: u32 = 1;
61/// When the `flags` parameter of CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS contains this flag, it indicates that waiting on an external semaphore object should skip performing appropriate memory synchronization operations over all the external memory objects that are imported as [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF`], which otherwise are performed by default to ensure data coherency with other importers of the same NvSciBuf memory objects.
62pub const CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC: u32 = 2;
63/// When `flags` of [`cuDeviceGetNvSciSyncAttributes`] is set to this, it indicates that application needs signaler specific NvSciSyncAttr to be filled by [`cuDeviceGetNvSciSyncAttributes`].
64pub const CUDA_NVSCISYNC_ATTR_SIGNAL: u32 = 1;
65/// When `flags` of [`cuDeviceGetNvSciSyncAttributes`] is set to this, it indicates that application needs waiter specific NvSciSyncAttr to be filled by [`cuDeviceGetNvSciSyncAttributes`].
66pub const CUDA_NVSCISYNC_ATTR_WAIT: u32 = 2;
67/// This flag if set indicates that the memory will be used as a tile pool.
68pub const CU_MEM_CREATE_USAGE_TILE_POOL: u32 = 1;
69/// This flag, if set, indicates that the memory will be used as a buffer for hardware accelerated decompression.
70pub const CU_MEM_CREATE_USAGE_HW_DECOMPRESS: u32 = 2;
71/// Setting this flag forces GPUDirect RDMA on a locality-domain-localized allocation to use the PCIe (BAR1) path, allowing the allocation to remain locality-domain localized on platforms where the platform-coherent RDMA path does not support localized allocations.
72///
73/// Because on some platforms the PCIe bandwidth is limited, using this flag may result in lower RDMA bandwidth than the default RDMA mapping link. Note that this flag does not itself force PCIe to be used, and that this must be done when creating the RDMA export. [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WITH_LOCALIZED_MEMORY_SUPPORTED`] indicates whether this flag is needed to create GPUDirect RDMA capable localized memory allocations. This flag is only valid if gpuDirectRDMACapable is set.
74pub const CU_MEM_CREATE_USAGE_GPU_DIRECT_RDMA_OVER_PCIE: u32 = 4;
75/// This flag, if set, indicates that the memory will be used as a buffer for hardware accelerated decompression.
76pub const CU_MEM_POOL_CREATE_USAGE_HW_DECOMPRESS: u32 = 2;
77/// If set, each kernel launched as part of [`cuLaunchCooperativeKernelMultiDevice`] only waits for prior work in the stream corresponding to that GPU to complete before the kernel begins execution.
78pub const CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_PRE_LAUNCH_SYNC: u32 = 1;
79/// If set, any subsequent work pushed in a stream that participated in a call to [`cuLaunchCooperativeKernelMultiDevice`] will only wait for the kernel launched on the GPU corresponding to that stream to complete before it begins execution.
80pub const CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_POST_LAUNCH_SYNC: u32 = 2;
81/// If set, the CUDA array is a collection of layers, where each layer is either a 1D or a 2D array and the Depth member of CUDA_ARRAY3D_DESCRIPTOR specifies the number of layers, not the depth of a 3D array.
82pub const CUDA_ARRAY3D_LAYERED: u32 = 1;
83/// use [`CUDA_ARRAY3D_LAYERED`].
84#[deprecated]
85pub const CUDA_ARRAY3D_2DARRAY: u32 = 1;
86/// This flag must be set in order to bind a surface reference to the CUDA array.
87pub const CUDA_ARRAY3D_SURFACE_LDST: u32 = 2;
88/// If set, the CUDA array is a collection of six 2D arrays, representing faces of a cube.
89///
90/// The width of such a CUDA array must be equal to its height, and Depth must be six. If [`CUDA_ARRAY3D_LAYERED`] flag is also set, then the CUDA array is a collection of cubemaps and Depth must be a multiple of six.
91pub const CUDA_ARRAY3D_CUBEMAP: u32 = 4;
92/// This flag must be set in order to perform texture gather operations on a CUDA array.
93pub const CUDA_ARRAY3D_TEXTURE_GATHER: u32 = 8;
94/// This flag if set indicates that the CUDA array is a DEPTH_TEXTURE.
95pub const CUDA_ARRAY3D_DEPTH_TEXTURE: u32 = 16;
96/// This flag indicates that the CUDA array may be bound as a color target in an external graphics API.
97pub const CUDA_ARRAY3D_COLOR_ATTACHMENT: u32 = 32;
98/// This flag if set indicates that the CUDA array or CUDA mipmapped array is a sparse CUDA array or CUDA mipmapped array respectively.
99pub const CUDA_ARRAY3D_SPARSE: u32 = 64;
100/// This flag if set indicates that the CUDA array or CUDA mipmapped array will allow deferred memory mapping.
101pub const CUDA_ARRAY3D_DEFERRED_MAPPING: u32 = 128;
102/// This flag indicates that the CUDA array will be used for hardware accelerated video encode/decode operations.
103pub const CUDA_ARRAY3D_VIDEO_ENCODE_DECODE: u32 = 256;
104/// Override the texref format with a format inferred from the array.
105///
106/// Flag for [`cuTexRefSetArray`].
107pub const CU_TRSA_OVERRIDE_FORMAT: u32 = 1;
108/// Read the texture as integers rather than promoting the values to floats in the range \[0,1\].
109///
110/// Flag for [`cuTexRefSetFlags`] and [`cuTexObjectCreate`].
111pub const CU_TRSF_READ_AS_INTEGER: u32 = 1;
112/// Use normalized texture coordinates in the range [0,1) instead of [0,dim).
113///
114/// Flag for [`cuTexRefSetFlags`] and [`cuTexObjectCreate`].
115pub const CU_TRSF_NORMALIZED_COORDINATES: u32 = 2;
116/// Perform sRGB->linear conversion during texture read.
117///
118/// Flag for [`cuTexRefSetFlags`] and [`cuTexObjectCreate`].
119pub const CU_TRSF_SRGB: u32 = 16;
120/// Disable any trilinear filtering optimizations.
121///
122/// Flag for [`cuTexRefSetFlags`] and [`cuTexObjectCreate`].
123pub const CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION: u32 = 32;
124/// Enable seamless cube map filtering.
125///
126/// Flag for [`cuTexObjectCreate`].
127pub const CU_TRSF_SEAMLESS_CUBEMAP: u32 = 64;
128/// Launch with the required block dimension.
129pub const CU_LAUNCH_KERNEL_REQUIRED_BLOCK_DIM: u32 = 1;
130/// C++ compile time constant for CU_LAUNCH_PARAM_END.
131pub const CU_LAUNCH_PARAM_END_AS_INT: u32 = 0;
132/// C++ compile time constant for CU_LAUNCH_PARAM_BUFFER_POINTER.
133pub const CU_LAUNCH_PARAM_BUFFER_POINTER_AS_INT: u32 = 1;
134/// C++ compile time constant for CU_LAUNCH_PARAM_BUFFER_SIZE.
135pub const CU_LAUNCH_PARAM_BUFFER_SIZE_AS_INT: u32 = 2;
136/// For texture references loaded into the module, use default texunit from texture reference.
137pub const CU_PARAM_TR_DEFAULT: i32 = -1;
138/// Unsigned C `size_t`, used for byte counts and object sizes in the native ABI.
139pub type size_t = ::core::ffi::c_ulong;
140/// An ID that represents a logical endpoint.
141pub type cuuint32_t = u32;
142/// CUDA graph conditional handle.
143pub type cuuint64_t = u64;
144/// CUDA device pointer CUdeviceptr is defined as an unsigned integer type whose size matches the size of a pointer on the target platform.
145pub type CUdeviceptr_v2 = ::core::ffi::c_ulonglong;
146/// CUDA device pointer.
147pub type CUdeviceptr = CUdeviceptr_v2;
148/// CUDA device.
149pub type CUdevice_v1 = ::core::ffi::c_int;
150/// CUDA device.
151pub type CUdevice = CUdevice_v1;
152/// Incomplete native type used by [`CUcontext`] handles. The native API owns its layout.
153#[repr(C)]
154#[derive(Debug, Copy, Clone)]
155pub struct CUctx_st {
156    _unused: [u8; 0],
157}
158/// A regular context handle.
159pub type CUcontext = *mut CUctx_st;
160/// Incomplete native type used by [`CUmodule`] handles. The native API owns its layout.
161#[repr(C)]
162#[derive(Debug, Copy, Clone)]
163pub struct CUmod_st {
164    _unused: [u8; 0],
165}
166/// CUDA module.
167pub type CUmodule = *mut CUmod_st;
168/// Incomplete native type used by [`CUfunction`] handles. The native API owns its layout.
169#[repr(C)]
170#[derive(Debug, Copy, Clone)]
171pub struct CUfunc_st {
172    _unused: [u8; 0],
173}
174/// CUDA function.
175pub type CUfunction = *mut CUfunc_st;
176/// Incomplete native type used by [`CUlibrary`] handles. The native API owns its layout.
177#[repr(C)]
178#[derive(Debug, Copy, Clone)]
179pub struct CUlib_st {
180    _unused: [u8; 0],
181}
182/// CUDA library.
183pub type CUlibrary = *mut CUlib_st;
184/// Incomplete native type used by [`CUkernel`] handles. The native API owns its layout.
185#[repr(C)]
186#[derive(Debug, Copy, Clone)]
187pub struct CUkern_st {
188    _unused: [u8; 0],
189}
190/// CUDA kernel.
191pub type CUkernel = *mut CUkern_st;
192/// Incomplete native type used by [`CUarray`] handles. The native API owns its layout.
193#[repr(C)]
194#[derive(Debug, Copy, Clone)]
195pub struct CUarray_st {
196    _unused: [u8; 0],
197}
198/// CUDA array.
199pub type CUarray = *mut CUarray_st;
200/// Incomplete native type used by [`CUmipmappedArray`] handles. The native API owns its layout.
201#[repr(C)]
202#[derive(Debug, Copy, Clone)]
203pub struct CUmipmappedArray_st {
204    _unused: [u8; 0],
205}
206/// CUDA mipmapped array.
207pub type CUmipmappedArray = *mut CUmipmappedArray_st;
208/// Incomplete native type used by [`CUtexref`] handles. The native API owns its layout.
209#[repr(C)]
210#[derive(Debug, Copy, Clone)]
211pub struct CUtexref_st {
212    _unused: [u8; 0],
213}
214/// CUDA texture reference.
215pub type CUtexref = *mut CUtexref_st;
216/// Incomplete native type used by [`CUsurfref`] handles. The native API owns its layout.
217#[repr(C)]
218#[derive(Debug, Copy, Clone)]
219pub struct CUsurfref_st {
220    _unused: [u8; 0],
221}
222/// CUDA surface reference.
223pub type CUsurfref = *mut CUsurfref_st;
224/// Incomplete CUDA event object. CUDA owns its native representation; use a CUDA event handle to access it.
225#[repr(C)]
226#[derive(Debug, Copy, Clone)]
227pub struct CUevent_st {
228    _unused: [u8; 0],
229}
230/// CUDA event.
231pub type CUevent = *mut CUevent_st;
232/// Incomplete CUDA driver stream type. Use a native stream handle; its layout is owned by the CUDA driver.
233#[repr(C)]
234#[derive(Debug, Copy, Clone)]
235pub struct CUstream_st {
236    _unused: [u8; 0],
237}
238/// CUDA stream.
239pub type CUstream = *mut CUstream_st;
240/// Incomplete native type used by [`CUgraphicsResource`] handles. The native API owns its layout.
241#[repr(C)]
242#[derive(Debug, Copy, Clone)]
243pub struct CUgraphicsResource_st {
244    _unused: [u8; 0],
245}
246/// CUDA graphics interop resource.
247pub type CUgraphicsResource = *mut CUgraphicsResource_st;
248/// An opaque value that represents a CUDA texture object.
249pub type CUtexObject_v1 = ::core::ffi::c_ulonglong;
250/// An opaque value that represents a CUDA texture object.
251pub type CUtexObject = CUtexObject_v1;
252/// An opaque value that represents a CUDA surface object.
253pub type CUsurfObject_v1 = ::core::ffi::c_ulonglong;
254/// An opaque value that represents a CUDA surface object.
255pub type CUsurfObject = CUsurfObject_v1;
256/// Incomplete native type used by [`CUexternalMemory`] handles. The native API owns its layout.
257#[repr(C)]
258#[derive(Debug, Copy, Clone)]
259pub struct CUextMemory_st {
260    _unused: [u8; 0],
261}
262/// CUDA external memory.
263pub type CUexternalMemory = *mut CUextMemory_st;
264/// Incomplete native type used by [`CUexternalSemaphore`] handles. The native API owns its layout.
265#[repr(C)]
266#[derive(Debug, Copy, Clone)]
267pub struct CUextSemaphore_st {
268    _unused: [u8; 0],
269}
270/// CUDA external semaphore.
271pub type CUexternalSemaphore = *mut CUextSemaphore_st;
272/// Incomplete CUDA graph type. Graph creation and destruction are provided by the CUDA API.
273#[repr(C)]
274#[derive(Debug, Copy, Clone)]
275pub struct CUgraph_st {
276    _unused: [u8; 0],
277}
278/// CUDA graph.
279pub type CUgraph = *mut CUgraph_st;
280/// Incomplete native type used by [`CUgraphNode`] handles. The native API owns its layout.
281#[repr(C)]
282#[derive(Debug, Copy, Clone)]
283pub struct CUgraphNode_st {
284    _unused: [u8; 0],
285}
286/// CUDA graph node.
287pub type CUgraphNode = *mut CUgraphNode_st;
288/// Incomplete native type used by [`CUgraphExec`] handles. The native API owns its layout.
289#[repr(C)]
290#[derive(Debug, Copy, Clone)]
291pub struct CUgraphExec_st {
292    _unused: [u8; 0],
293}
294/// CUDA executable graph.
295pub type CUgraphExec = *mut CUgraphExec_st;
296/// Incomplete native type used by [`CUmemoryPool`] handles. The native API owns its layout.
297#[repr(C)]
298#[derive(Debug, Copy, Clone)]
299pub struct CUmemPoolHandle_st {
300    _unused: [u8; 0],
301}
302/// CUDA memory pool.
303pub type CUmemoryPool = *mut CUmemPoolHandle_st;
304/// Incomplete native type used by [`CUuserObject`] handles. The native API owns its layout.
305#[repr(C)]
306#[derive(Debug, Copy, Clone)]
307pub struct CUuserObject_st {
308    _unused: [u8; 0],
309}
310/// CUDA user object for graphs.
311pub type CUuserObject = *mut CUuserObject_st;
312/// CUDA graph conditional handle.
313pub type CUgraphConditionalHandle = cuuint64_t;
314/// Incomplete native type used by [`CUgraphDeviceNode`] handles. The native API owns its layout.
315#[repr(C)]
316#[derive(Debug, Copy, Clone)]
317pub struct CUgraphDeviceUpdatableNode_st {
318    _unused: [u8; 0],
319}
320/// CUDA graph device node handle.
321pub type CUgraphDeviceNode = *mut CUgraphDeviceUpdatableNode_st;
322/// Incomplete native type used by [`CUasyncCallbackHandle`] handles. The native API owns its layout.
323#[repr(C)]
324#[derive(Debug, Copy, Clone)]
325pub struct CUasyncCallbackEntry_st {
326    _unused: [u8; 0],
327}
328/// CUDA async notification callback handle.
329pub type CUasyncCallbackHandle = *mut CUasyncCallbackEntry_st;
330/// Incomplete native type used by [`CUgreenCtx`] handles. The native API owns its layout.
331#[repr(C)]
332#[derive(Debug, Copy, Clone)]
333pub struct CUgreenCtx_st {
334    _unused: [u8; 0],
335}
336/// A green context handle. This handle can be used safely from only one CPU thread at a time. Created via [`cuGreenCtxCreate`].
337pub type CUgreenCtx = *mut CUgreenCtx_st;
338/// CUDA UUID stored as 16 bytes. The bytes are an identifier, not a null-terminated string.
339#[repr(C)]
340#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
341pub struct CUuuid_st {
342    /// < CUDA definition of UUID.
343    pub bytes: [::core::ffi::c_char; 16usize],
344}
345/// CUDA UUID stored as 16 bytes. The bytes are an identifier, not a null-terminated string.
346pub type CUuuid = CUuuid_st;
347/// Fabric handle - An opaque handle representing a memory allocation that can be exported to processes in same or different nodes.
348///
349/// For IPC between processes on different nodes they must be connected via the NVSwitch fabric.
350#[repr(C)]
351#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
352pub struct CUmemFabricHandle_st {
353    /// Opaque fabric-handle bytes produced by CUDA and passed unchanged when importing the allocation.
354    pub data: [::core::ffi::c_uchar; 64usize],
355}
356impl Default for CUmemFabricHandle_st {
357    fn default() -> Self {
358        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
359        unsafe {
360            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
361            s.assume_init()
362        }
363    }
364}
365/// Fabric handle - An opaque handle representing a memory allocation that can be exported to processes in same or different nodes.
366///
367/// For IPC between processes on different nodes they must be connected via the NVSwitch fabric.
368pub type CUmemFabricHandle_v1 = CUmemFabricHandle_st;
369/// Fabric handle - An opaque handle representing a memory allocation that can be exported to processes in same or different nodes. For IPC between processes on different nodes they must be connected via the NVSwitch fabric.
370pub type CUmemFabricHandle = CUmemFabricHandle_v1;
371/// CUDA IPC event handle.
372#[repr(C)]
373#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
374pub struct CUipcEventHandle_st {
375    /// Opaque event-handle bytes produced by CUDA and passed unchanged when opening the handle in another process.
376    pub reserved: [::core::ffi::c_char; 64usize],
377}
378impl Default for CUipcEventHandle_st {
379    fn default() -> Self {
380        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
381        unsafe {
382            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
383            s.assume_init()
384        }
385    }
386}
387/// CUDA IPC event handle.
388pub type CUipcEventHandle_v1 = CUipcEventHandle_st;
389/// CUDA IPC event handle
390pub type CUipcEventHandle = CUipcEventHandle_v1;
391/// CUDA IPC mem handle.
392#[repr(C)]
393#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
394pub struct CUipcMemHandle_st {
395    /// Opaque memory-handle bytes produced by CUDA and passed unchanged when opening the handle in another process.
396    pub reserved: [::core::ffi::c_char; 64usize],
397}
398impl Default for CUipcMemHandle_st {
399    fn default() -> Self {
400        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
401        unsafe {
402            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
403            s.assume_init()
404        }
405    }
406}
407/// CUDA IPC mem handle.
408pub type CUipcMemHandle_v1 = CUipcMemHandle_st;
409/// CUDA IPC mem handle
410pub type CUipcMemHandle = CUipcMemHandle_v1;
411impl CUipcMem_flags_enum {
412    /// Automatically enable peer access between remote devices as needed.
413    pub const CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS: CUipcMem_flags_enum = CUipcMem_flags_enum(
414        1,
415    );
416}
417/// CUDA Ipc Mem Flags.
418#[repr(transparent)]
419#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
420pub struct CUipcMem_flags_enum(pub ::core::ffi::c_uint);
421pub use self::CUipcMem_flags_enum as CUipcMem_flags;
422impl CUmemAttach_flags_enum {
423    /// Memory can be accessed by any stream on any device.
424    pub const CU_MEM_ATTACH_GLOBAL: CUmemAttach_flags_enum = CUmemAttach_flags_enum(1);
425    /// Memory cannot be accessed by any stream on any device.
426    pub const CU_MEM_ATTACH_HOST: CUmemAttach_flags_enum = CUmemAttach_flags_enum(2);
427    /// Memory can only be accessed by a single stream on the associated device.
428    pub const CU_MEM_ATTACH_SINGLE: CUmemAttach_flags_enum = CUmemAttach_flags_enum(4);
429}
430/// CUDA Mem Attach Flags.
431#[repr(transparent)]
432#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
433pub struct CUmemAttach_flags_enum(pub ::core::ffi::c_uint);
434pub use self::CUmemAttach_flags_enum as CUmemAttach_flags;
435impl CUctx_flags_enum {
436    /// Automatic scheduling.
437    pub const CU_CTX_SCHED_AUTO: CUctx_flags_enum = CUctx_flags_enum(0);
438    /// Set spin as default scheduling.
439    pub const CU_CTX_SCHED_SPIN: CUctx_flags_enum = CUctx_flags_enum(1);
440    /// Set yield as default scheduling.
441    pub const CU_CTX_SCHED_YIELD: CUctx_flags_enum = CUctx_flags_enum(2);
442    /// Set blocking synchronization as default scheduling.
443    pub const CU_CTX_SCHED_BLOCKING_SYNC: CUctx_flags_enum = CUctx_flags_enum(4);
444    /// Set blocking synchronization as default scheduling.
445    ///
446    /// Deprecated: This flag was deprecated as of CUDA 4.0 and was replaced with [`CUctx_flags_enum::CU_CTX_SCHED_BLOCKING_SYNC`].
447    #[deprecated]
448    pub const CU_CTX_BLOCKING_SYNC: CUctx_flags_enum = CUctx_flags_enum(4);
449    /// Mask of the context scheduling-policy bits.
450    pub const CU_CTX_SCHED_MASK: CUctx_flags_enum = CUctx_flags_enum(7);
451    /// Deprecated: This flag was deprecated as of CUDA 11.0 and it no longer has any effect. All contexts as of CUDA 3.2 behave as though the flag is enabled.
452    #[deprecated]
453    pub const CU_CTX_MAP_HOST: CUctx_flags_enum = CUctx_flags_enum(8);
454    /// Keep local memory allocation after launch.
455    pub const CU_CTX_LMEM_RESIZE_TO_MAX: CUctx_flags_enum = CUctx_flags_enum(16);
456    /// Trigger coredumps from exceptions in this context.
457    pub const CU_CTX_COREDUMP_ENABLE: CUctx_flags_enum = CUctx_flags_enum(32);
458    /// Enable user pipe to trigger coredumps in this context.
459    pub const CU_CTX_USER_COREDUMP_ENABLE: CUctx_flags_enum = CUctx_flags_enum(64);
460    /// Ensure synchronous memory operations on this context will synchronize.
461    pub const CU_CTX_SYNC_MEMOPS: CUctx_flags_enum = CUctx_flags_enum(128);
462    /// Mask of the context flag bits defined by this ABI.
463    pub const CU_CTX_FLAGS_MASK: CUctx_flags_enum = CUctx_flags_enum(255);
464}
465/// Context creation flags.
466#[repr(transparent)]
467#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
468pub struct CUctx_flags_enum(pub ::core::ffi::c_uint);
469pub use self::CUctx_flags_enum as CUctx_flags;
470impl CUevent_sched_flags_enum {
471    /// Automatic scheduling.
472    pub const CU_EVENT_SCHED_AUTO: CUevent_sched_flags_enum = CUevent_sched_flags_enum(
473        0,
474    );
475    /// Set spin as default scheduling.
476    pub const CU_EVENT_SCHED_SPIN: CUevent_sched_flags_enum = CUevent_sched_flags_enum(
477        1,
478    );
479    /// Set yield as default scheduling.
480    pub const CU_EVENT_SCHED_YIELD: CUevent_sched_flags_enum = CUevent_sched_flags_enum(
481        2,
482    );
483    /// Set blocking synchronization as default scheduling.
484    pub const CU_EVENT_SCHED_BLOCKING_SYNC: CUevent_sched_flags_enum = CUevent_sched_flags_enum(
485        4,
486    );
487}
488/// Event sched flags.
489#[repr(transparent)]
490#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
491pub struct CUevent_sched_flags_enum(pub ::core::ffi::c_uint);
492pub use self::CUevent_sched_flags_enum as CUevent_sched_flags;
493impl CUhostTaskSyncMode_enum {
494    /// The execution thread will block until new host tasks are ready to run.
495    pub const CU_HOST_TASK_BLOCKING: CUhostTaskSyncMode_enum = CUhostTaskSyncMode_enum(
496        0,
497    );
498    /// The execution thread will spin wait until new host tasks are ready to run.
499    pub const CU_HOST_TASK_SPINWAIT: CUhostTaskSyncMode_enum = CUhostTaskSyncMode_enum(
500        1,
501    );
502}
503/// Host task synchronization mode
504#[repr(transparent)]
505#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
506pub struct CUhostTaskSyncMode_enum(pub ::core::ffi::c_uint);
507pub use self::CUhostTaskSyncMode_enum as CUhostTaskSyncMode;
508impl CUstream_flags_enum {
509    /// Default stream flag.
510    pub const CU_STREAM_DEFAULT: CUstream_flags_enum = CUstream_flags_enum(0);
511    /// Stream does not synchronize with stream 0 (the NULL stream).
512    pub const CU_STREAM_NON_BLOCKING: CUstream_flags_enum = CUstream_flags_enum(1);
513}
514/// Stream creation flags.
515#[repr(transparent)]
516#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
517pub struct CUstream_flags_enum(pub ::core::ffi::c_uint);
518pub use self::CUstream_flags_enum as CUstream_flags;
519impl CUevent_flags_enum {
520    /// Default event flag.
521    pub const CU_EVENT_DEFAULT: CUevent_flags_enum = CUevent_flags_enum(0);
522    /// Event uses blocking synchronization.
523    pub const CU_EVENT_BLOCKING_SYNC: CUevent_flags_enum = CUevent_flags_enum(1);
524    /// Event will not record timing data.
525    pub const CU_EVENT_DISABLE_TIMING: CUevent_flags_enum = CUevent_flags_enum(2);
526    /// Event is suitable for interprocess use.
527    ///
528    /// [`CUevent_flags::CU_EVENT_DISABLE_TIMING`] must be set.
529    pub const CU_EVENT_INTERPROCESS: CUevent_flags_enum = CUevent_flags_enum(4);
530}
531/// Event creation flags.
532#[repr(transparent)]
533#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
534pub struct CUevent_flags_enum(pub ::core::ffi::c_uint);
535pub use self::CUevent_flags_enum as CUevent_flags;
536impl CUevent_record_flags_enum {
537    /// Default event record flag.
538    pub const CU_EVENT_RECORD_DEFAULT: CUevent_record_flags_enum = CUevent_record_flags_enum(
539        0,
540    );
541    /// When using stream capture, create an event record node instead of the default behavior.
542    ///
543    /// This flag is invalid when used outside of capture.
544    pub const CU_EVENT_RECORD_EXTERNAL: CUevent_record_flags_enum = CUevent_record_flags_enum(
545        1,
546    );
547}
548/// Event record flags.
549#[repr(transparent)]
550#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
551pub struct CUevent_record_flags_enum(pub ::core::ffi::c_uint);
552pub use self::CUevent_record_flags_enum as CUevent_record_flags;
553impl CUevent_wait_flags_enum {
554    /// Default event wait flag.
555    pub const CU_EVENT_WAIT_DEFAULT: CUevent_wait_flags_enum = CUevent_wait_flags_enum(
556        0,
557    );
558    /// When using stream capture, create an event wait node instead of the default behavior.
559    ///
560    /// This flag is invalid when used outside of capture.
561    pub const CU_EVENT_WAIT_EXTERNAL: CUevent_wait_flags_enum = CUevent_wait_flags_enum(
562        1,
563    );
564}
565/// Event wait flags.
566#[repr(transparent)]
567#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
568pub struct CUevent_wait_flags_enum(pub ::core::ffi::c_uint);
569pub use self::CUevent_wait_flags_enum as CUevent_wait_flags;
570impl CUatomicOperation_enum {
571    /// Atomic integer addition.
572    pub const CU_ATOMIC_OPERATION_INTEGER_ADD: CUatomicOperation_enum = CUatomicOperation_enum(
573        0,
574    );
575    /// Atomic integer minimum.
576    pub const CU_ATOMIC_OPERATION_INTEGER_MIN: CUatomicOperation_enum = CUatomicOperation_enum(
577        1,
578    );
579    /// Atomic integer maximum.
580    pub const CU_ATOMIC_OPERATION_INTEGER_MAX: CUatomicOperation_enum = CUatomicOperation_enum(
581        2,
582    );
583    /// Atomic integer increment.
584    pub const CU_ATOMIC_OPERATION_INTEGER_INCREMENT: CUatomicOperation_enum = CUatomicOperation_enum(
585        3,
586    );
587    /// Atomic integer decrement.
588    pub const CU_ATOMIC_OPERATION_INTEGER_DECREMENT: CUatomicOperation_enum = CUatomicOperation_enum(
589        4,
590    );
591    /// Atomic bitwise AND.
592    pub const CU_ATOMIC_OPERATION_AND: CUatomicOperation_enum = CUatomicOperation_enum(
593        5,
594    );
595    /// Atomic bitwise OR.
596    pub const CU_ATOMIC_OPERATION_OR: CUatomicOperation_enum = CUatomicOperation_enum(6);
597    /// Atomic bitwise exclusive OR.
598    pub const CU_ATOMIC_OPERATION_XOR: CUatomicOperation_enum = CUatomicOperation_enum(
599        7,
600    );
601    /// Atomic exchange of the stored value.
602    pub const CU_ATOMIC_OPERATION_EXCHANGE: CUatomicOperation_enum = CUatomicOperation_enum(
603        8,
604    );
605    /// Atomic compare-and-swap.
606    pub const CU_ATOMIC_OPERATION_CAS: CUatomicOperation_enum = CUatomicOperation_enum(
607        9,
608    );
609    /// Atomic floating-point addition.
610    pub const CU_ATOMIC_OPERATION_FLOAT_ADD: CUatomicOperation_enum = CUatomicOperation_enum(
611        10,
612    );
613    /// Atomic floating-point minimum.
614    pub const CU_ATOMIC_OPERATION_FLOAT_MIN: CUatomicOperation_enum = CUatomicOperation_enum(
615        11,
616    );
617    /// Atomic floating-point maximum.
618    pub const CU_ATOMIC_OPERATION_FLOAT_MAX: CUatomicOperation_enum = CUatomicOperation_enum(
619        12,
620    );
621    /// End marker for the native atomic-operation identifiers.
622    pub const CU_ATOMIC_OPERATION_MAX: CUatomicOperation_enum = CUatomicOperation_enum(
623        13,
624    );
625}
626/// CUDA-valid Atomic Operations.
627#[repr(transparent)]
628#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
629pub struct CUatomicOperation_enum(pub ::core::ffi::c_uint);
630pub use self::CUatomicOperation_enum as CUatomicOperation;
631impl CUatomicOperationCapability_enum {
632    /// Supports signed integer operands.
633    pub const CU_ATOMIC_CAPABILITY_SIGNED: CUatomicOperationCapability_enum = CUatomicOperationCapability_enum(
634        1,
635    );
636    /// Supports unsigned integer operands.
637    pub const CU_ATOMIC_CAPABILITY_UNSIGNED: CUatomicOperationCapability_enum = CUatomicOperationCapability_enum(
638        2,
639    );
640    /// Supports reduction operations.
641    pub const CU_ATOMIC_CAPABILITY_REDUCTION: CUatomicOperationCapability_enum = CUatomicOperationCapability_enum(
642        4,
643    );
644    /// Supports 32-bit scalar operands.
645    pub const CU_ATOMIC_CAPABILITY_SCALAR_32: CUatomicOperationCapability_enum = CUatomicOperationCapability_enum(
646        8,
647    );
648    /// Supports 64-bit scalar operands.
649    pub const CU_ATOMIC_CAPABILITY_SCALAR_64: CUatomicOperationCapability_enum = CUatomicOperationCapability_enum(
650        16,
651    );
652    /// Supports 128-bit scalar operands.
653    pub const CU_ATOMIC_CAPABILITY_SCALAR_128: CUatomicOperationCapability_enum = CUatomicOperationCapability_enum(
654        32,
655    );
656    /// Supports vectors of four 32-bit components.
657    pub const CU_ATOMIC_CAPABILITY_VECTOR_32x4: CUatomicOperationCapability_enum = CUatomicOperationCapability_enum(
658        64,
659    );
660}
661/// CUDA-valid Atomic Operation capabilities.
662#[repr(transparent)]
663#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
664pub struct CUatomicOperationCapability_enum(pub ::core::ffi::c_uint);
665pub use self::CUatomicOperationCapability_enum as CUatomicOperationCapability;
666impl CUstreamWaitValue_flags_enum {
667    /// Wait until (int32_t)(\*addr - value) >= 0 (or int64_t for 64 bit values).
668    ///
669    /// Note this is a cyclic comparison which ignores wraparound. (Default behavior.)
670    pub const CU_STREAM_WAIT_VALUE_GEQ: CUstreamWaitValue_flags_enum = CUstreamWaitValue_flags_enum(
671        0,
672    );
673    /// Wait until \*addr == value.
674    pub const CU_STREAM_WAIT_VALUE_EQ: CUstreamWaitValue_flags_enum = CUstreamWaitValue_flags_enum(
675        1,
676    );
677    /// Wait until (\*addr & value) != 0.
678    pub const CU_STREAM_WAIT_VALUE_AND: CUstreamWaitValue_flags_enum = CUstreamWaitValue_flags_enum(
679        2,
680    );
681    /// Wait until ~(\*addr | value) != 0.
682    ///
683    /// Support for this operation can be queried with [`cuDeviceGetAttribute`] and [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR`].
684    pub const CU_STREAM_WAIT_VALUE_NOR: CUstreamWaitValue_flags_enum = CUstreamWaitValue_flags_enum(
685        3,
686    );
687    /// Follow the wait operation with a flush of outstanding remote writes.
688    ///
689    /// This means that, if a remote write operation is guaranteed to have reached the device before the wait can be satisfied, that write is guaranteed to be visible to downstream device work. The device is permitted to reorder remote writes internally. For example, this flag would be required if two remote writes arrive in a defined order, the wait is satisfied by the second write, and downstream work needs to observe the first write. Support for this operation is restricted to selected platforms and can be queried with [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CAN_FLUSH_REMOTE_WRITES`].
690    pub const CU_STREAM_WAIT_VALUE_FLUSH: CUstreamWaitValue_flags_enum = CUstreamWaitValue_flags_enum(
691        1073741824,
692    );
693}
694/// Flags for cuStreamWaitValue32 and cuStreamWaitValue64.
695#[repr(transparent)]
696#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
697pub struct CUstreamWaitValue_flags_enum(pub ::core::ffi::c_uint);
698pub use self::CUstreamWaitValue_flags_enum as CUstreamWaitValue_flags;
699impl CUstreamWriteValue_flags_enum {
700    /// Default behavior.
701    pub const CU_STREAM_WRITE_VALUE_DEFAULT: CUstreamWriteValue_flags_enum = CUstreamWriteValue_flags_enum(
702        0,
703    );
704    /// Permits the write to be reordered with writes which were issued before it, as a performance optimization.
705    ///
706    /// Normally, cuStreamWriteValue32 will provide a memory fence before the write, which has similar semantics to __threadfence_system() but is scoped to the stream rather than a CUDA thread. This flag is not supported in the v2 API.
707    pub const CU_STREAM_WRITE_VALUE_NO_MEMORY_BARRIER: CUstreamWriteValue_flags_enum = CUstreamWriteValue_flags_enum(
708        1,
709    );
710}
711/// Flags for cuStreamWriteValue32.
712#[repr(transparent)]
713#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
714pub struct CUstreamWriteValue_flags_enum(pub ::core::ffi::c_uint);
715pub use self::CUstreamWriteValue_flags_enum as CUstreamWriteValue_flags;
716impl CUstreamBatchMemOpType_enum {
717    /// Represents a cuStreamWaitValue32 operation.
718    pub const CU_STREAM_MEM_OP_WAIT_VALUE_32: CUstreamBatchMemOpType_enum = CUstreamBatchMemOpType_enum(
719        1,
720    );
721    /// Represents a cuStreamWriteValue32 operation.
722    pub const CU_STREAM_MEM_OP_WRITE_VALUE_32: CUstreamBatchMemOpType_enum = CUstreamBatchMemOpType_enum(
723        2,
724    );
725    /// Represents a cuStreamWaitValue64 operation.
726    pub const CU_STREAM_MEM_OP_WAIT_VALUE_64: CUstreamBatchMemOpType_enum = CUstreamBatchMemOpType_enum(
727        4,
728    );
729    /// Represents a cuStreamWriteValue64 operation.
730    pub const CU_STREAM_MEM_OP_WRITE_VALUE_64: CUstreamBatchMemOpType_enum = CUstreamBatchMemOpType_enum(
731        5,
732    );
733    /// Insert a memory barrier of the specified type.
734    pub const CU_STREAM_MEM_OP_BARRIER: CUstreamBatchMemOpType_enum = CUstreamBatchMemOpType_enum(
735        6,
736    );
737    /// Perform a atomic reduction.
738    ///
739    /// See CUstreamBatchMemOpParams::atomicReduction.
740    pub const CU_STREAM_MEM_OP_ATOMIC_REDUCTION: CUstreamBatchMemOpType_enum = CUstreamBatchMemOpType_enum(
741        8,
742    );
743    /// This has the same effect as [`CUstreamWaitValue_flags_enum::CU_STREAM_WAIT_VALUE_FLUSH`], but as a standalone operation.
744    pub const CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES: CUstreamBatchMemOpType_enum = CUstreamBatchMemOpType_enum(
745        3,
746    );
747}
748/// Operations for cuStreamBatchMemOp.
749#[repr(transparent)]
750#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
751pub struct CUstreamBatchMemOpType_enum(pub ::core::ffi::c_uint);
752pub use self::CUstreamBatchMemOpType_enum as CUstreamBatchMemOpType;
753impl CUstreamMemoryBarrier_flags_enum {
754    /// System-wide memory barrier.
755    pub const CU_STREAM_MEMORY_BARRIER_TYPE_SYS: CUstreamMemoryBarrier_flags_enum = CUstreamMemoryBarrier_flags_enum(
756        0,
757    );
758    /// Limit memory barrier scope to the GPU.
759    pub const CU_STREAM_MEMORY_BARRIER_TYPE_GPU: CUstreamMemoryBarrier_flags_enum = CUstreamMemoryBarrier_flags_enum(
760        1,
761    );
762}
763/// Flags for [`CUstreamBatchMemOpParams::memoryBarrier`](CUstreamBatchMemOpParams_union::memoryBarrier).
764#[repr(transparent)]
765#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
766pub struct CUstreamMemoryBarrier_flags_enum(pub ::core::ffi::c_uint);
767pub use self::CUstreamMemoryBarrier_flags_enum as CUstreamMemoryBarrier_flags;
768impl CUstreamAtomicReductionOpType_enum {
769    /// Performs an atomic OR: \*(address) = \*(address) | value.
770    pub const CU_STREAM_ATOMIC_REDUCTION_OP_OR: CUstreamAtomicReductionOpType_enum = CUstreamAtomicReductionOpType_enum(
771        6,
772    );
773    /// Performs an atomic AND: \*(address) = \*(address) & value.
774    pub const CU_STREAM_ATOMIC_REDUCTION_OP_AND: CUstreamAtomicReductionOpType_enum = CUstreamAtomicReductionOpType_enum(
775        5,
776    );
777    /// Performs an atomic ADD: \*(address) = \*(address) + value.
778    pub const CU_STREAM_ATOMIC_REDUCTION_OP_ADD: CUstreamAtomicReductionOpType_enum = CUstreamAtomicReductionOpType_enum(
779        0,
780    );
781}
782/// Atomic reduction operation types for `CUstreamBatchMemOpParams::atomicReduction::reductionOp`.
783#[repr(transparent)]
784#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
785pub struct CUstreamAtomicReductionOpType_enum(pub ::core::ffi::c_uint);
786pub use self::CUstreamAtomicReductionOpType_enum as CUstreamAtomicReductionOpType;
787impl CUstreamAtomicReductionDataType_enum {
788    /// Unsigned 32-bit scalar reduction operands.
789    pub const CU_STREAM_ATOMIC_REDUCTION_UNSIGNED_32: CUstreamAtomicReductionDataType_enum = CUstreamAtomicReductionDataType_enum(
790        14,
791    );
792    /// Unsigned 64-bit scalar reduction operands.
793    pub const CU_STREAM_ATOMIC_REDUCTION_UNSIGNED_64: CUstreamAtomicReductionDataType_enum = CUstreamAtomicReductionDataType_enum(
794        22,
795    );
796}
797/// Atomic reduction data types for `CUstreamBatchMemOpParams::atomicReduction::dataType`.
798#[repr(transparent)]
799#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
800pub struct CUstreamAtomicReductionDataType_enum(pub ::core::ffi::c_uint);
801pub use self::CUstreamAtomicReductionDataType_enum as CUstreamAtomicReductionDataType;
802/// Per-operation parameters for cuStreamBatchMemOp.
803#[repr(C)]
804#[derive(Copy, Clone)]
805pub union CUstreamBatchMemOpParams_union {
806    /// Operation. This is the first field of all the union elemets and acts as a TAG to determine which union member is valid.
807    pub operation: CUstreamBatchMemOpType,
808    /// Params for [`CUstreamBatchMemOpType_enum::CU_STREAM_MEM_OP_WAIT_VALUE_32`] and [`CUstreamBatchMemOpType_enum::CU_STREAM_MEM_OP_WAIT_VALUE_64`] operations.
809    pub waitValue: CUstreamBatchMemOpParams_union_CUstreamMemOpWaitValueParams_st,
810    /// Params for [`CUstreamBatchMemOpType_enum::CU_STREAM_MEM_OP_WRITE_VALUE_32`] and [`CUstreamBatchMemOpType_enum::CU_STREAM_MEM_OP_WRITE_VALUE_64`] operations.
811    pub writeValue: CUstreamBatchMemOpParams_union_CUstreamMemOpWriteValueParams_st,
812    /// Params for [`CUstreamBatchMemOpType_enum::CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES`] operations.
813    pub flushRemoteWrites: CUstreamBatchMemOpParams_union_CUstreamMemOpFlushRemoteWritesParams_st,
814    /// Params for [`CUstreamBatchMemOpType_enum::CU_STREAM_MEM_OP_BARRIER`] operations.
815    pub memoryBarrier: CUstreamBatchMemOpParams_union_CUstreamMemOpMemoryBarrierParams_st,
816    /// Parameters of a stream-ordered atomic reduction.
817    pub atomicReduction: CUstreamBatchMemOpParams_union_CUstreamMemOpAtomicReductionParams_st,
818    /// Storage that fixes the native batch-operation union to six 64-bit words.
819    pub pad: [cuuint64_t; 6usize],
820}
821/// Native layout of the `waitValue` member of [`CUstreamBatchMemOpParams_union`].
822///
823/// Params for [`CUstreamBatchMemOpType_enum::CU_STREAM_MEM_OP_WAIT_VALUE_32`] and [`CUstreamBatchMemOpType_enum::CU_STREAM_MEM_OP_WAIT_VALUE_64`] operations.
824#[repr(C)]
825#[derive(Copy, Clone)]
826pub struct CUstreamBatchMemOpParams_union_CUstreamMemOpWaitValueParams_st {
827    /// Selects [`CUstreamBatchMemOpType_enum::CU_STREAM_MEM_OP_WAIT_VALUE_32`] or [`CUstreamBatchMemOpType_enum::CU_STREAM_MEM_OP_WAIT_VALUE_64`].
828    pub operation: CUstreamBatchMemOpType,
829    /// Device address of the memory word used by this stream operation.
830    pub address: CUdeviceptr,
831    /// Anonymous native member. See [`CUstreamBatchMemOpParams_union_CUstreamMemOpWaitValueParams_st__bindgen_ty_1`] for its fields.
832    pub __bindgen_anon_1: CUstreamBatchMemOpParams_union_CUstreamMemOpWaitValueParams_st__bindgen_ty_1,
833    /// See [`CUstreamWaitValue_flags`].
834    pub flags: ::core::ffi::c_uint,
835    /// For driver internal use. Initial value is unimportant.
836    pub alias: CUdeviceptr,
837}
838/// Anonymous native union in [`CUstreamBatchMemOpParams_union_CUstreamMemOpWaitValueParams_st`]. Its members share the same storage.
839#[repr(C)]
840#[derive(Copy, Clone)]
841pub union CUstreamBatchMemOpParams_union_CUstreamMemOpWaitValueParams_st__bindgen_ty_1 {
842    /// 32-bit operand compared against memory while the stream waits.
843    pub value: cuuint32_t,
844    /// 64-bit operand compared against memory while the stream waits.
845    pub value64: cuuint64_t,
846}
847impl Default
848for CUstreamBatchMemOpParams_union_CUstreamMemOpWaitValueParams_st__bindgen_ty_1 {
849    fn default() -> Self {
850        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
851        unsafe {
852            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
853            s.assume_init()
854        }
855    }
856}
857impl Default for CUstreamBatchMemOpParams_union_CUstreamMemOpWaitValueParams_st {
858    fn default() -> Self {
859        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
860        unsafe {
861            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
862            s.assume_init()
863        }
864    }
865}
866/// Native layout of the `writeValue` member of [`CUstreamBatchMemOpParams_union`].
867///
868/// Params for [`CUstreamBatchMemOpType_enum::CU_STREAM_MEM_OP_WRITE_VALUE_32`] and [`CUstreamBatchMemOpType_enum::CU_STREAM_MEM_OP_WRITE_VALUE_64`] operations.
869#[repr(C)]
870#[derive(Copy, Clone)]
871pub struct CUstreamBatchMemOpParams_union_CUstreamMemOpWriteValueParams_st {
872    /// Selects [`CUstreamBatchMemOpType_enum::CU_STREAM_MEM_OP_WRITE_VALUE_32`] or [`CUstreamBatchMemOpType_enum::CU_STREAM_MEM_OP_WRITE_VALUE_64`].
873    pub operation: CUstreamBatchMemOpType,
874    /// Device address of the memory word used by this stream operation.
875    pub address: CUdeviceptr,
876    /// Anonymous native member. See [`CUstreamBatchMemOpParams_union_CUstreamMemOpWriteValueParams_st__bindgen_ty_1`] for its fields.
877    pub __bindgen_anon_1: CUstreamBatchMemOpParams_union_CUstreamMemOpWriteValueParams_st__bindgen_ty_1,
878    /// See [`CUstreamWriteValue_flags`].
879    pub flags: ::core::ffi::c_uint,
880    /// For driver internal use. Initial value is unimportant.
881    pub alias: CUdeviceptr,
882}
883/// Anonymous native union in [`CUstreamBatchMemOpParams_union_CUstreamMemOpWriteValueParams_st`]. Its members share the same storage.
884#[repr(C)]
885#[derive(Copy, Clone)]
886pub union CUstreamBatchMemOpParams_union_CUstreamMemOpWriteValueParams_st__bindgen_ty_1 {
887    /// 32-bit operand written to memory in stream order.
888    pub value: cuuint32_t,
889    /// 64-bit operand written to memory in stream order.
890    pub value64: cuuint64_t,
891}
892impl Default
893for CUstreamBatchMemOpParams_union_CUstreamMemOpWriteValueParams_st__bindgen_ty_1 {
894    fn default() -> Self {
895        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
896        unsafe {
897            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
898            s.assume_init()
899        }
900    }
901}
902impl Default for CUstreamBatchMemOpParams_union_CUstreamMemOpWriteValueParams_st {
903    fn default() -> Self {
904        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
905        unsafe {
906            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
907            s.assume_init()
908        }
909    }
910}
911/// Native layout of the `flushRemoteWrites` member of [`CUstreamBatchMemOpParams_union`].
912///
913/// Params for [`CUstreamBatchMemOpType_enum::CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES`] operations.
914#[repr(C)]
915#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
916pub struct CUstreamBatchMemOpParams_union_CUstreamMemOpFlushRemoteWritesParams_st {
917    /// Operation tag selecting [`CUstreamBatchMemOpType_enum::CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES`].
918    pub operation: CUstreamBatchMemOpType,
919    /// Must be 0.
920    pub flags: ::core::ffi::c_uint,
921}
922impl Default for CUstreamBatchMemOpParams_union_CUstreamMemOpFlushRemoteWritesParams_st {
923    fn default() -> Self {
924        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
925        unsafe {
926            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
927            s.assume_init()
928        }
929    }
930}
931/// Native layout of the `memoryBarrier` member of [`CUstreamBatchMemOpParams_union`].
932///
933/// Params for [`CUstreamBatchMemOpType_enum::CU_STREAM_MEM_OP_BARRIER`] operations.
934#[repr(C)]
935#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
936pub struct CUstreamBatchMemOpParams_union_CUstreamMemOpMemoryBarrierParams_st {
937    /// Operation tag selecting [`CUstreamBatchMemOpType_enum::CU_STREAM_MEM_OP_BARRIER`].
938    pub operation: CUstreamBatchMemOpType,
939    /// See [`CUstreamMemoryBarrier_flags`]
940    pub flags: ::core::ffi::c_uint,
941}
942impl Default for CUstreamBatchMemOpParams_union_CUstreamMemOpMemoryBarrierParams_st {
943    fn default() -> Self {
944        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
945        unsafe {
946            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
947            s.assume_init()
948        }
949    }
950}
951/// Native layout of the `atomicReduction` member of [`CUstreamBatchMemOpParams_union`].
952#[repr(C)]
953#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
954pub struct CUstreamBatchMemOpParams_union_CUstreamMemOpAtomicReductionParams_st {
955    /// Operation tag selecting [`CUstreamBatchMemOpType_enum::CU_STREAM_MEM_OP_ATOMIC_REDUCTION`].
956    pub operation: CUstreamBatchMemOpType,
957    /// Must be 0
958    pub flags: ::core::ffi::c_uint,
959    /// See [`CUstreamAtomicReductionOpType`]
960    pub reductionOp: CUstreamAtomicReductionOpType,
961    /// See [`CUstreamAtomicReductionDataType`]
962    pub dataType: CUstreamAtomicReductionDataType,
963    /// The address the atomic operation will be operated on
964    pub address: CUdeviceptr,
965    /// The operand value the atomic operation will operate with
966    pub value: cuuint64_t,
967    /// For driver internal use. Initial value is unimportant.
968    pub alias: CUdeviceptr,
969}
970impl Default for CUstreamBatchMemOpParams_union_CUstreamMemOpAtomicReductionParams_st {
971    fn default() -> Self {
972        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
973        unsafe {
974            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
975            s.assume_init()
976        }
977    }
978}
979impl Default for CUstreamBatchMemOpParams_union {
980    fn default() -> Self {
981        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
982        unsafe {
983            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
984            s.assume_init()
985        }
986    }
987}
988/// Per-operation parameters for cuStreamBatchMemOp.
989pub type CUstreamBatchMemOpParams_v1 = CUstreamBatchMemOpParams_union;
990/// Per-operation parameters for [`cuStreamBatchMemOp`]
991pub type CUstreamBatchMemOpParams = CUstreamBatchMemOpParams_v1;
992/// Batch memory operation node parameters.
993///
994/// Used in the legacy [`cuGraphAddBatchMemOpNode`] api. New code should use cuGraphAddNode().
995#[repr(C)]
996#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
997pub struct CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st {
998    /// CUDA context used for the batch of stream memory operations.
999    pub ctx: CUcontext,
1000    /// Number of entries in `paramArray`.
1001    pub count: ::core::ffi::c_uint,
1002    /// Array of `count` batch memory-operation descriptions.
1003    pub paramArray: *mut CUstreamBatchMemOpParams,
1004    /// Node behavior flags passed to the native batch-memory-operation API.
1005    pub flags: ::core::ffi::c_uint,
1006}
1007impl Default for CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st {
1008    fn default() -> Self {
1009        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1010        unsafe {
1011            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1012            s.assume_init()
1013        }
1014    }
1015}
1016/// Batch memory operation node parameters.
1017///
1018/// Used in the legacy [`cuGraphAddBatchMemOpNode`] api. New code should use cuGraphAddNode().
1019pub type CUDA_BATCH_MEM_OP_NODE_PARAMS_v1 = CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st;
1020/// Batch memory operation node parameters
1021///
1022/// Used in the legacy [`cuGraphAddBatchMemOpNode`] api. New code should use [`cuGraphAddNode`]
1023pub type CUDA_BATCH_MEM_OP_NODE_PARAMS = CUDA_BATCH_MEM_OP_NODE_PARAMS_v1;
1024/// Batch memory operation node parameters.
1025#[repr(C)]
1026#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
1027pub struct CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st {
1028    /// Context to use for the operations.
1029    pub ctx: CUcontext,
1030    /// Number of operations in paramArray.
1031    pub count: ::core::ffi::c_uint,
1032    /// Array of batch memory operations.
1033    pub paramArray: *mut CUstreamBatchMemOpParams,
1034    /// Flags to control the node.
1035    pub flags: ::core::ffi::c_uint,
1036}
1037impl Default for CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st {
1038    fn default() -> Self {
1039        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1040        unsafe {
1041            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1042            s.assume_init()
1043        }
1044    }
1045}
1046/// Batch memory operation node parameters.
1047pub type CUDA_BATCH_MEM_OP_NODE_PARAMS_v2 = CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st;
1048impl CUoccupancy_flags_enum {
1049    /// Default behavior.
1050    pub const CU_OCCUPANCY_DEFAULT: CUoccupancy_flags_enum = CUoccupancy_flags_enum(0);
1051    /// Assume global caching is enabled and cannot be automatically turned off.
1052    pub const CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE: CUoccupancy_flags_enum = CUoccupancy_flags_enum(
1053        1,
1054    );
1055}
1056/// Occupancy calculator flag.
1057#[repr(transparent)]
1058#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
1059pub struct CUoccupancy_flags_enum(pub ::core::ffi::c_uint);
1060pub use self::CUoccupancy_flags_enum as CUoccupancy_flags;
1061impl CUstreamUpdateCaptureDependencies_flags_enum {
1062    /// Add new nodes to the dependency set.
1063    pub const CU_STREAM_ADD_CAPTURE_DEPENDENCIES: CUstreamUpdateCaptureDependencies_flags_enum = CUstreamUpdateCaptureDependencies_flags_enum(
1064        0,
1065    );
1066    /// Replace the dependency set with the new nodes.
1067    pub const CU_STREAM_SET_CAPTURE_DEPENDENCIES: CUstreamUpdateCaptureDependencies_flags_enum = CUstreamUpdateCaptureDependencies_flags_enum(
1068        1,
1069    );
1070}
1071/// Flags for cuStreamUpdateCaptureDependencies.
1072#[repr(transparent)]
1073#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
1074pub struct CUstreamUpdateCaptureDependencies_flags_enum(pub ::core::ffi::c_uint);
1075pub use self::CUstreamUpdateCaptureDependencies_flags_enum as CUstreamUpdateCaptureDependencies_flags;
1076impl CUasyncNotificationType_enum {
1077    /// Sent when the process has exceeded its device memory budget.
1078    pub const CU_ASYNC_NOTIFICATION_TYPE_OVER_BUDGET: CUasyncNotificationType_enum = CUasyncNotificationType_enum(
1079        1,
1080    );
1081}
1082/// Types of async notification that can be sent.
1083#[repr(transparent)]
1084#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
1085pub struct CUasyncNotificationType_enum(pub ::core::ffi::c_uint);
1086pub use self::CUasyncNotificationType_enum as CUasyncNotificationType;
1087/// Information passed to the user via the async notification callback.
1088#[repr(C)]
1089#[derive(Copy, Clone)]
1090pub struct CUasyncNotificationInfo_st {
1091    /// The type of notification being sent.
1092    pub type_: CUasyncNotificationType,
1093    /// Information about the notification.
1094    ///
1095    /// `type` must be checked in order to interpret this field.
1096    pub info: CUasyncNotificationInfo_st__bindgen_ty_1,
1097}
1098/// Native layout of the `info` member of [`CUasyncNotificationInfo_st`].
1099///
1100/// Information about the notification. `type` must be checked in order to interpret this field.
1101#[repr(C)]
1102#[derive(Copy, Clone)]
1103pub union CUasyncNotificationInfo_st__bindgen_ty_1 {
1104    /// Information about notifications of type [`CUasyncNotificationType_enum::CU_ASYNC_NOTIFICATION_TYPE_OVER_BUDGET`]
1105    pub overBudget: CUasyncNotificationInfo_st__bindgen_ty_1__bindgen_ty_1,
1106}
1107/// Native layout of the `overBudget` member of [`CUasyncNotificationInfo_st__bindgen_ty_1`].
1108///
1109/// Information about notifications of type [`CUasyncNotificationType_enum::CU_ASYNC_NOTIFICATION_TYPE_OVER_BUDGET`]
1110#[repr(C)]
1111#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
1112pub struct CUasyncNotificationInfo_st__bindgen_ty_1__bindgen_ty_1 {
1113    /// The number of bytes that the process has allocated above its device memory budget
1114    pub bytesOverBudget: ::core::ffi::c_ulonglong,
1115}
1116impl Default for CUasyncNotificationInfo_st__bindgen_ty_1 {
1117    fn default() -> Self {
1118        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1119        unsafe {
1120            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1121            s.assume_init()
1122        }
1123    }
1124}
1125impl Default for CUasyncNotificationInfo_st {
1126    fn default() -> Self {
1127        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1128        unsafe {
1129            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1130            s.assume_init()
1131        }
1132    }
1133}
1134/// Information passed to the user via the async notification callback.
1135pub type CUasyncNotificationInfo = CUasyncNotificationInfo_st;
1136/// CUDA async notification callback.
1137pub type CUasyncCallback = ::core::option::Option<
1138    unsafe extern "C" fn(
1139        info: *mut CUasyncNotificationInfo,
1140        userData: *mut ::core::ffi::c_void,
1141        callback: CUasyncCallbackHandle,
1142    ),
1143>;
1144impl CUarray_format_enum {
1145    /// Unsigned 8-bit integers.
1146    pub const CU_AD_FORMAT_UNSIGNED_INT8: CUarray_format_enum = CUarray_format_enum(1);
1147    /// Unsigned 16-bit integers.
1148    pub const CU_AD_FORMAT_UNSIGNED_INT16: CUarray_format_enum = CUarray_format_enum(2);
1149    /// Unsigned 32-bit integers.
1150    pub const CU_AD_FORMAT_UNSIGNED_INT32: CUarray_format_enum = CUarray_format_enum(3);
1151    /// Signed 8-bit integers.
1152    pub const CU_AD_FORMAT_SIGNED_INT8: CUarray_format_enum = CUarray_format_enum(8);
1153    /// Signed 16-bit integers.
1154    pub const CU_AD_FORMAT_SIGNED_INT16: CUarray_format_enum = CUarray_format_enum(9);
1155    /// Signed 32-bit integers.
1156    pub const CU_AD_FORMAT_SIGNED_INT32: CUarray_format_enum = CUarray_format_enum(10);
1157    /// 16-bit floating point.
1158    pub const CU_AD_FORMAT_HALF: CUarray_format_enum = CUarray_format_enum(16);
1159    /// 32-bit floating point.
1160    pub const CU_AD_FORMAT_FLOAT: CUarray_format_enum = CUarray_format_enum(32);
1161    /// 8-bit YUV planar format, with 4:2:0 sampling.
1162    pub const CU_AD_FORMAT_NV12: CUarray_format_enum = CUarray_format_enum(176);
1163    /// 1 channel unsigned 8-bit normalized integer.
1164    pub const CU_AD_FORMAT_UNORM_INT8X1: CUarray_format_enum = CUarray_format_enum(192);
1165    /// 2 channel unsigned 8-bit normalized integer.
1166    pub const CU_AD_FORMAT_UNORM_INT8X2: CUarray_format_enum = CUarray_format_enum(193);
1167    /// 4 channel unsigned 8-bit normalized integer.
1168    pub const CU_AD_FORMAT_UNORM_INT8X4: CUarray_format_enum = CUarray_format_enum(194);
1169    /// 1 channel unsigned 16-bit normalized integer.
1170    pub const CU_AD_FORMAT_UNORM_INT16X1: CUarray_format_enum = CUarray_format_enum(195);
1171    /// 2 channel unsigned 16-bit normalized integer.
1172    pub const CU_AD_FORMAT_UNORM_INT16X2: CUarray_format_enum = CUarray_format_enum(196);
1173    /// 4 channel unsigned 16-bit normalized integer.
1174    pub const CU_AD_FORMAT_UNORM_INT16X4: CUarray_format_enum = CUarray_format_enum(197);
1175    /// 1 channel signed 8-bit normalized integer.
1176    pub const CU_AD_FORMAT_SNORM_INT8X1: CUarray_format_enum = CUarray_format_enum(198);
1177    /// 2 channel signed 8-bit normalized integer.
1178    pub const CU_AD_FORMAT_SNORM_INT8X2: CUarray_format_enum = CUarray_format_enum(199);
1179    /// 4 channel signed 8-bit normalized integer.
1180    pub const CU_AD_FORMAT_SNORM_INT8X4: CUarray_format_enum = CUarray_format_enum(200);
1181    /// 1 channel signed 16-bit normalized integer.
1182    pub const CU_AD_FORMAT_SNORM_INT16X1: CUarray_format_enum = CUarray_format_enum(201);
1183    /// 2 channel signed 16-bit normalized integer.
1184    pub const CU_AD_FORMAT_SNORM_INT16X2: CUarray_format_enum = CUarray_format_enum(202);
1185    /// 4 channel signed 16-bit normalized integer.
1186    pub const CU_AD_FORMAT_SNORM_INT16X4: CUarray_format_enum = CUarray_format_enum(203);
1187    /// 4 channel unsigned normalized block-compressed (BC1 compression) format.
1188    pub const CU_AD_FORMAT_BC1_UNORM: CUarray_format_enum = CUarray_format_enum(145);
1189    /// 4 channel unsigned normalized block-compressed (BC1 compression) format with sRGB encoding.
1190    pub const CU_AD_FORMAT_BC1_UNORM_SRGB: CUarray_format_enum = CUarray_format_enum(
1191        146,
1192    );
1193    /// 4 channel unsigned normalized block-compressed (BC2 compression) format.
1194    pub const CU_AD_FORMAT_BC2_UNORM: CUarray_format_enum = CUarray_format_enum(147);
1195    /// 4 channel unsigned normalized block-compressed (BC2 compression) format with sRGB encoding.
1196    pub const CU_AD_FORMAT_BC2_UNORM_SRGB: CUarray_format_enum = CUarray_format_enum(
1197        148,
1198    );
1199    /// 4 channel unsigned normalized block-compressed (BC3 compression) format.
1200    pub const CU_AD_FORMAT_BC3_UNORM: CUarray_format_enum = CUarray_format_enum(149);
1201    /// 4 channel unsigned normalized block-compressed (BC3 compression) format with sRGB encoding.
1202    pub const CU_AD_FORMAT_BC3_UNORM_SRGB: CUarray_format_enum = CUarray_format_enum(
1203        150,
1204    );
1205    /// 1 channel unsigned normalized block-compressed (BC4 compression) format.
1206    pub const CU_AD_FORMAT_BC4_UNORM: CUarray_format_enum = CUarray_format_enum(151);
1207    /// 1 channel signed normalized block-compressed (BC4 compression) format.
1208    pub const CU_AD_FORMAT_BC4_SNORM: CUarray_format_enum = CUarray_format_enum(152);
1209    /// 2 channel unsigned normalized block-compressed (BC5 compression) format.
1210    pub const CU_AD_FORMAT_BC5_UNORM: CUarray_format_enum = CUarray_format_enum(153);
1211    /// 2 channel signed normalized block-compressed (BC5 compression) format.
1212    pub const CU_AD_FORMAT_BC5_SNORM: CUarray_format_enum = CUarray_format_enum(154);
1213    /// 3 channel unsigned half-float block-compressed (BC6H compression) format.
1214    pub const CU_AD_FORMAT_BC6H_UF16: CUarray_format_enum = CUarray_format_enum(155);
1215    /// 3 channel signed half-float block-compressed (BC6H compression) format.
1216    pub const CU_AD_FORMAT_BC6H_SF16: CUarray_format_enum = CUarray_format_enum(156);
1217    /// 4 channel unsigned normalized block-compressed (BC7 compression) format.
1218    pub const CU_AD_FORMAT_BC7_UNORM: CUarray_format_enum = CUarray_format_enum(157);
1219    /// 4 channel unsigned normalized block-compressed (BC7 compression) format with sRGB encoding.
1220    pub const CU_AD_FORMAT_BC7_UNORM_SRGB: CUarray_format_enum = CUarray_format_enum(
1221        158,
1222    );
1223    /// 10-bit YUV planar format, with 4:2:0 sampling.
1224    pub const CU_AD_FORMAT_P010: CUarray_format_enum = CUarray_format_enum(159);
1225    /// 16-bit YUV planar format, with 4:2:0 sampling.
1226    pub const CU_AD_FORMAT_P016: CUarray_format_enum = CUarray_format_enum(161);
1227    /// 8-bit YUV planar format, with 4:2:2 sampling.
1228    pub const CU_AD_FORMAT_NV16: CUarray_format_enum = CUarray_format_enum(162);
1229    /// 10-bit YUV planar format, with 4:2:2 sampling.
1230    pub const CU_AD_FORMAT_P210: CUarray_format_enum = CUarray_format_enum(163);
1231    /// 16-bit YUV planar format, with 4:2:2 sampling.
1232    pub const CU_AD_FORMAT_P216: CUarray_format_enum = CUarray_format_enum(164);
1233    /// 2 channel, 8-bit YUV packed planar format, with 4:2:2 sampling.
1234    pub const CU_AD_FORMAT_YUY2: CUarray_format_enum = CUarray_format_enum(165);
1235    /// 2 channel, 10-bit YUV packed planar format, with 4:2:2 sampling.
1236    pub const CU_AD_FORMAT_Y210: CUarray_format_enum = CUarray_format_enum(166);
1237    /// 2 channel, 16-bit YUV packed planar format, with 4:2:2 sampling.
1238    pub const CU_AD_FORMAT_Y216: CUarray_format_enum = CUarray_format_enum(167);
1239    /// 4 channel, 8-bit YUV packed planar format, with 4:4:4 sampling.
1240    pub const CU_AD_FORMAT_AYUV: CUarray_format_enum = CUarray_format_enum(168);
1241    /// 10-bit YUV packed planar format, with 4:4:4 sampling.
1242    pub const CU_AD_FORMAT_Y410: CUarray_format_enum = CUarray_format_enum(169);
1243    /// 4 channel, 12-bit YUV packed planar format, with 4:4:4 sampling.
1244    pub const CU_AD_FORMAT_Y416: CUarray_format_enum = CUarray_format_enum(177);
1245    /// 3 channel 8-bit YUV planar format, with 4:4:4 sampling.
1246    pub const CU_AD_FORMAT_Y444_PLANAR8: CUarray_format_enum = CUarray_format_enum(178);
1247    /// 3 channel 10-bit YUV planar format, with 4:4:4 sampling.
1248    pub const CU_AD_FORMAT_Y444_PLANAR10: CUarray_format_enum = CUarray_format_enum(179);
1249    /// 3 channel 8-bit YUV semi-planar format, with 4:4:4 sampling.
1250    pub const CU_AD_FORMAT_YUV444_8bit_SemiPlanar: CUarray_format_enum = CUarray_format_enum(
1251        180,
1252    );
1253    /// 3 channel 16-bit YUV semi-planar format, with 4:4:4 sampling.
1254    pub const CU_AD_FORMAT_YUV444_16bit_SemiPlanar: CUarray_format_enum = CUarray_format_enum(
1255        181,
1256    );
1257    /// 4 channel unorm R10G10B10A2 RGB format.
1258    pub const CU_AD_FORMAT_UNORM_INT_101010_2: CUarray_format_enum = CUarray_format_enum(
1259        80,
1260    );
1261    /// 4 channel unsigned 8-bit YUV packed format, with 4:2:2 sampling.
1262    pub const CU_AD_FORMAT_UINT8_PACKED_422: CUarray_format_enum = CUarray_format_enum(
1263        81,
1264    );
1265    /// 4 channel unsigned 8-bit YUV packed format, with 4:4:4 sampling.
1266    pub const CU_AD_FORMAT_UINT8_PACKED_444: CUarray_format_enum = CUarray_format_enum(
1267        82,
1268    );
1269    /// 3 channel unsigned 8-bit YUV semi-planar format, with 4:2:0 sampling.
1270    pub const CU_AD_FORMAT_UINT8_SEMIPLANAR_420: CUarray_format_enum = CUarray_format_enum(
1271        83,
1272    );
1273    /// 3 channel unsigned 16-bit YUV semi-planar format, with 4:2:0 sampling.
1274    pub const CU_AD_FORMAT_UINT16_SEMIPLANAR_420: CUarray_format_enum = CUarray_format_enum(
1275        84,
1276    );
1277    /// 3 channel unsigned 8-bit YUV semi-planar format, with 4:2:2 sampling.
1278    pub const CU_AD_FORMAT_UINT8_SEMIPLANAR_422: CUarray_format_enum = CUarray_format_enum(
1279        85,
1280    );
1281    /// 3 channel unsigned 16-bit YUV semi-planar format, with 4:2:2 sampling.
1282    pub const CU_AD_FORMAT_UINT16_SEMIPLANAR_422: CUarray_format_enum = CUarray_format_enum(
1283        86,
1284    );
1285    /// 3 channel unsigned 8-bit YUV semi-planar format, with 4:4:4 sampling.
1286    pub const CU_AD_FORMAT_UINT8_SEMIPLANAR_444: CUarray_format_enum = CUarray_format_enum(
1287        87,
1288    );
1289    /// 3 channel unsigned 16-bit YUV semi-planar format, with 4:4:4 sampling.
1290    pub const CU_AD_FORMAT_UINT16_SEMIPLANAR_444: CUarray_format_enum = CUarray_format_enum(
1291        88,
1292    );
1293    /// 3 channel unsigned 8-bit YUV planar format, with 4:2:0 sampling.
1294    pub const CU_AD_FORMAT_UINT8_PLANAR_420: CUarray_format_enum = CUarray_format_enum(
1295        89,
1296    );
1297    /// 3 channel unsigned 16-bit YUV planar format, with 4:2:0 sampling.
1298    pub const CU_AD_FORMAT_UINT16_PLANAR_420: CUarray_format_enum = CUarray_format_enum(
1299        90,
1300    );
1301    /// 3 channel unsigned 8-bit YUV planar format, with 4:2:2 sampling.
1302    pub const CU_AD_FORMAT_UINT8_PLANAR_422: CUarray_format_enum = CUarray_format_enum(
1303        91,
1304    );
1305    /// 3 channel unsigned 16-bit YUV planar format, with 4:2:2 sampling.
1306    pub const CU_AD_FORMAT_UINT16_PLANAR_422: CUarray_format_enum = CUarray_format_enum(
1307        92,
1308    );
1309    /// 3 channel unsigned 8-bit YUV planar format, with 4:4:4 sampling.
1310    pub const CU_AD_FORMAT_UINT8_PLANAR_444: CUarray_format_enum = CUarray_format_enum(
1311        93,
1312    );
1313    /// 3 channel unsigned 16-bit YUV planar format, with 4:4:4 sampling.
1314    pub const CU_AD_FORMAT_UINT16_PLANAR_444: CUarray_format_enum = CUarray_format_enum(
1315        94,
1316    );
1317    /// Reserved upper-bound sentinel for native array formats.
1318    pub const CU_AD_FORMAT_MAX: CUarray_format_enum = CUarray_format_enum(2147483647);
1319}
1320/// Array formats.
1321#[repr(transparent)]
1322#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
1323pub struct CUarray_format_enum(pub ::core::ffi::c_uint);
1324pub use self::CUarray_format_enum as CUarray_format;
1325impl CUaddress_mode_enum {
1326    /// Wrapping address mode.
1327    pub const CU_TR_ADDRESS_MODE_WRAP: CUaddress_mode_enum = CUaddress_mode_enum(0);
1328    /// Clamp to edge address mode.
1329    pub const CU_TR_ADDRESS_MODE_CLAMP: CUaddress_mode_enum = CUaddress_mode_enum(1);
1330    /// Mirror address mode.
1331    pub const CU_TR_ADDRESS_MODE_MIRROR: CUaddress_mode_enum = CUaddress_mode_enum(2);
1332    /// Border address mode.
1333    pub const CU_TR_ADDRESS_MODE_BORDER: CUaddress_mode_enum = CUaddress_mode_enum(3);
1334}
1335/// Texture reference addressing modes.
1336#[repr(transparent)]
1337#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
1338pub struct CUaddress_mode_enum(pub ::core::ffi::c_uint);
1339pub use self::CUaddress_mode_enum as CUaddress_mode;
1340impl CUfilter_mode_enum {
1341    /// Point filter mode.
1342    pub const CU_TR_FILTER_MODE_POINT: CUfilter_mode_enum = CUfilter_mode_enum(0);
1343    /// Linear filter mode.
1344    pub const CU_TR_FILTER_MODE_LINEAR: CUfilter_mode_enum = CUfilter_mode_enum(1);
1345}
1346/// Texture reference filtering modes.
1347#[repr(transparent)]
1348#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
1349pub struct CUfilter_mode_enum(pub ::core::ffi::c_uint);
1350pub use self::CUfilter_mode_enum as CUfilter_mode;
1351impl CUdevice_attribute_enum {
1352    /// Maximum number of threads per block.
1353    pub const CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK: CUdevice_attribute_enum = CUdevice_attribute_enum(
1354        1,
1355    );
1356    /// Maximum block dimension X.
1357    pub const CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X: CUdevice_attribute_enum = CUdevice_attribute_enum(
1358        2,
1359    );
1360    /// Maximum block dimension Y.
1361    pub const CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y: CUdevice_attribute_enum = CUdevice_attribute_enum(
1362        3,
1363    );
1364    /// Maximum block dimension Z.
1365    pub const CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z: CUdevice_attribute_enum = CUdevice_attribute_enum(
1366        4,
1367    );
1368    /// Maximum grid dimension X.
1369    pub const CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X: CUdevice_attribute_enum = CUdevice_attribute_enum(
1370        5,
1371    );
1372    /// Maximum grid dimension Y.
1373    pub const CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y: CUdevice_attribute_enum = CUdevice_attribute_enum(
1374        6,
1375    );
1376    /// Maximum grid dimension Z.
1377    pub const CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z: CUdevice_attribute_enum = CUdevice_attribute_enum(
1378        7,
1379    );
1380    /// Maximum shared memory available per block in bytes.
1381    pub const CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK: CUdevice_attribute_enum = CUdevice_attribute_enum(
1382        8,
1383    );
1384    /// use [`CUdevice_attribute::CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK`].
1385    #[deprecated]
1386    pub const CU_DEVICE_ATTRIBUTE_SHARED_MEMORY_PER_BLOCK: CUdevice_attribute_enum = CUdevice_attribute_enum(
1387        8,
1388    );
1389    /// Memory available on device for **constant** variables in a CUDA C kernel in bytes.
1390    pub const CU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY: CUdevice_attribute_enum = CUdevice_attribute_enum(
1391        9,
1392    );
1393    /// Warp size in threads.
1394    pub const CU_DEVICE_ATTRIBUTE_WARP_SIZE: CUdevice_attribute_enum = CUdevice_attribute_enum(
1395        10,
1396    );
1397    /// Maximum pitch in bytes allowed by memory copies.
1398    pub const CU_DEVICE_ATTRIBUTE_MAX_PITCH: CUdevice_attribute_enum = CUdevice_attribute_enum(
1399        11,
1400    );
1401    /// Maximum number of 32-bit registers available per block.
1402    pub const CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK: CUdevice_attribute_enum = CUdevice_attribute_enum(
1403        12,
1404    );
1405    /// use [`CUdevice_attribute::CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK`].
1406    #[deprecated]
1407    pub const CU_DEVICE_ATTRIBUTE_REGISTERS_PER_BLOCK: CUdevice_attribute_enum = CUdevice_attribute_enum(
1408        12,
1409    );
1410    /// Typical clock frequency in kilohertz.
1411    pub const CU_DEVICE_ATTRIBUTE_CLOCK_RATE: CUdevice_attribute_enum = CUdevice_attribute_enum(
1412        13,
1413    );
1414    /// Alignment requirement for textures.
1415    pub const CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT: CUdevice_attribute_enum = CUdevice_attribute_enum(
1416        14,
1417    );
1418    /// Device can possibly copy memory and execute a kernel concurrently.
1419    ///
1420    /// Deprecated. Use instead [`CUdevice_attribute::CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT`].
1421    #[deprecated]
1422    pub const CU_DEVICE_ATTRIBUTE_GPU_OVERLAP: CUdevice_attribute_enum = CUdevice_attribute_enum(
1423        15,
1424    );
1425    /// Number of multiprocessors on device.
1426    pub const CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT: CUdevice_attribute_enum = CUdevice_attribute_enum(
1427        16,
1428    );
1429    /// Specifies whether there is a run time limit on kernels.
1430    pub const CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT: CUdevice_attribute_enum = CUdevice_attribute_enum(
1431        17,
1432    );
1433    /// Device is integrated with host memory.
1434    pub const CU_DEVICE_ATTRIBUTE_INTEGRATED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1435        18,
1436    );
1437    /// Device can map host memory into CUDA address space.
1438    pub const CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY: CUdevice_attribute_enum = CUdevice_attribute_enum(
1439        19,
1440    );
1441    /// Compute mode (See [`CUcomputemode`] for details).
1442    pub const CU_DEVICE_ATTRIBUTE_COMPUTE_MODE: CUdevice_attribute_enum = CUdevice_attribute_enum(
1443        20,
1444    );
1445    /// Maximum 1D texture width.
1446    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum(
1447        21,
1448    );
1449    /// Maximum 2D texture width.
1450    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum(
1451        22,
1452    );
1453    /// Maximum 2D texture height.
1454    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT: CUdevice_attribute_enum = CUdevice_attribute_enum(
1455        23,
1456    );
1457    /// Maximum 3D texture width.
1458    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum(
1459        24,
1460    );
1461    /// Maximum 3D texture height.
1462    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT: CUdevice_attribute_enum = CUdevice_attribute_enum(
1463        25,
1464    );
1465    /// Maximum 3D texture depth.
1466    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH: CUdevice_attribute_enum = CUdevice_attribute_enum(
1467        26,
1468    );
1469    /// Maximum 2D layered texture width.
1470    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum(
1471        27,
1472    );
1473    /// Maximum 2D layered texture height.
1474    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT: CUdevice_attribute_enum = CUdevice_attribute_enum(
1475        28,
1476    );
1477    /// Maximum layers in a 2D layered texture.
1478    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS: CUdevice_attribute_enum = CUdevice_attribute_enum(
1479        29,
1480    );
1481    /// use [`CUdevice_attribute::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH`].
1482    #[deprecated]
1483    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum(
1484        27,
1485    );
1486    /// use [`CUdevice_attribute::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT`].
1487    #[deprecated]
1488    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_HEIGHT: CUdevice_attribute_enum = CUdevice_attribute_enum(
1489        28,
1490    );
1491    /// use [`CUdevice_attribute::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS`].
1492    #[deprecated]
1493    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_NUMSLICES: CUdevice_attribute_enum = CUdevice_attribute_enum(
1494        29,
1495    );
1496    /// Alignment requirement for surfaces.
1497    pub const CU_DEVICE_ATTRIBUTE_SURFACE_ALIGNMENT: CUdevice_attribute_enum = CUdevice_attribute_enum(
1498        30,
1499    );
1500    /// Device can possibly execute multiple kernels concurrently.
1501    pub const CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS: CUdevice_attribute_enum = CUdevice_attribute_enum(
1502        31,
1503    );
1504    /// Device has ECC support enabled.
1505    pub const CU_DEVICE_ATTRIBUTE_ECC_ENABLED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1506        32,
1507    );
1508    /// PCI bus ID of the device.
1509    pub const CU_DEVICE_ATTRIBUTE_PCI_BUS_ID: CUdevice_attribute_enum = CUdevice_attribute_enum(
1510        33,
1511    );
1512    /// PCI device ID of the device.
1513    pub const CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID: CUdevice_attribute_enum = CUdevice_attribute_enum(
1514        34,
1515    );
1516    /// Device is using TCC driver model.
1517    pub const CU_DEVICE_ATTRIBUTE_TCC_DRIVER: CUdevice_attribute_enum = CUdevice_attribute_enum(
1518        35,
1519    );
1520    /// Peak memory clock frequency in kilohertz.
1521    pub const CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE: CUdevice_attribute_enum = CUdevice_attribute_enum(
1522        36,
1523    );
1524    /// Global memory bus width in bits.
1525    pub const CU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum(
1526        37,
1527    );
1528    /// Size of L2 cache in bytes.
1529    pub const CU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE: CUdevice_attribute_enum = CUdevice_attribute_enum(
1530        38,
1531    );
1532    /// Maximum resident threads per multiprocessor.
1533    pub const CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR: CUdevice_attribute_enum = CUdevice_attribute_enum(
1534        39,
1535    );
1536    /// Number of asynchronous engines.
1537    pub const CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT: CUdevice_attribute_enum = CUdevice_attribute_enum(
1538        40,
1539    );
1540    /// Device shares a unified address space with the host.
1541    pub const CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING: CUdevice_attribute_enum = CUdevice_attribute_enum(
1542        41,
1543    );
1544    /// Maximum 1D layered texture width.
1545    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum(
1546        42,
1547    );
1548    /// Maximum layers in a 1D layered texture.
1549    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS: CUdevice_attribute_enum = CUdevice_attribute_enum(
1550        43,
1551    );
1552    /// do not use.
1553    #[deprecated]
1554    pub const CU_DEVICE_ATTRIBUTE_CAN_TEX2D_GATHER: CUdevice_attribute_enum = CUdevice_attribute_enum(
1555        44,
1556    );
1557    /// Maximum 2D texture width if CUDA_ARRAY3D_TEXTURE_GATHER is set.
1558    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum(
1559        45,
1560    );
1561    /// Maximum 2D texture height if CUDA_ARRAY3D_TEXTURE_GATHER is set.
1562    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT: CUdevice_attribute_enum = CUdevice_attribute_enum(
1563        46,
1564    );
1565    /// Alternate maximum 3D texture width.
1566    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE: CUdevice_attribute_enum = CUdevice_attribute_enum(
1567        47,
1568    );
1569    /// Alternate maximum 3D texture height.
1570    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE: CUdevice_attribute_enum = CUdevice_attribute_enum(
1571        48,
1572    );
1573    /// Alternate maximum 3D texture depth.
1574    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE: CUdevice_attribute_enum = CUdevice_attribute_enum(
1575        49,
1576    );
1577    /// PCI domain ID of the device.
1578    pub const CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID: CUdevice_attribute_enum = CUdevice_attribute_enum(
1579        50,
1580    );
1581    /// Pitch alignment requirement for textures.
1582    pub const CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT: CUdevice_attribute_enum = CUdevice_attribute_enum(
1583        51,
1584    );
1585    /// Maximum cubemap texture width/height.
1586    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum(
1587        52,
1588    );
1589    /// Maximum cubemap layered texture width/height.
1590    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum(
1591        53,
1592    );
1593    /// Maximum layers in a cubemap layered texture.
1594    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS: CUdevice_attribute_enum = CUdevice_attribute_enum(
1595        54,
1596    );
1597    /// Maximum 1D surface width.
1598    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum(
1599        55,
1600    );
1601    /// Maximum 2D surface width.
1602    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum(
1603        56,
1604    );
1605    /// Maximum 2D surface height.
1606    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT: CUdevice_attribute_enum = CUdevice_attribute_enum(
1607        57,
1608    );
1609    /// Maximum 3D surface width.
1610    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum(
1611        58,
1612    );
1613    /// Maximum 3D surface height.
1614    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT: CUdevice_attribute_enum = CUdevice_attribute_enum(
1615        59,
1616    );
1617    /// Maximum 3D surface depth.
1618    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH: CUdevice_attribute_enum = CUdevice_attribute_enum(
1619        60,
1620    );
1621    /// Maximum 1D layered surface width.
1622    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum(
1623        61,
1624    );
1625    /// Maximum layers in a 1D layered surface.
1626    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERS: CUdevice_attribute_enum = CUdevice_attribute_enum(
1627        62,
1628    );
1629    /// Maximum 2D layered surface width.
1630    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum(
1631        63,
1632    );
1633    /// Maximum 2D layered surface height.
1634    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT: CUdevice_attribute_enum = CUdevice_attribute_enum(
1635        64,
1636    );
1637    /// Maximum layers in a 2D layered surface.
1638    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERS: CUdevice_attribute_enum = CUdevice_attribute_enum(
1639        65,
1640    );
1641    /// Maximum cubemap surface width.
1642    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum(
1643        66,
1644    );
1645    /// Maximum cubemap layered surface width.
1646    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum(
1647        67,
1648    );
1649    /// Maximum layers in a cubemap layered surface.
1650    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS: CUdevice_attribute_enum = CUdevice_attribute_enum(
1651        68,
1652    );
1653    /// do not use.
1654    ///
1655    /// Use cudaDeviceGetTexture1DLinearMaxWidth() or [`cuDeviceGetTexture1DLinearMaxWidth`] instead.
1656    #[deprecated]
1657    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum(
1658        69,
1659    );
1660    /// Maximum 2D linear texture width.
1661    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum(
1662        70,
1663    );
1664    /// Maximum 2D linear texture height.
1665    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT: CUdevice_attribute_enum = CUdevice_attribute_enum(
1666        71,
1667    );
1668    /// Maximum 2D linear texture pitch in bytes.
1669    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH: CUdevice_attribute_enum = CUdevice_attribute_enum(
1670        72,
1671    );
1672    /// Maximum mipmapped 2D texture width.
1673    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum(
1674        73,
1675    );
1676    /// Maximum mipmapped 2D texture height.
1677    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT: CUdevice_attribute_enum = CUdevice_attribute_enum(
1678        74,
1679    );
1680    /// Major compute capability version number.
1681    pub const CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR: CUdevice_attribute_enum = CUdevice_attribute_enum(
1682        75,
1683    );
1684    /// Minor compute capability version number.
1685    pub const CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR: CUdevice_attribute_enum = CUdevice_attribute_enum(
1686        76,
1687    );
1688    /// Maximum mipmapped 1D texture width.
1689    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum(
1690        77,
1691    );
1692    /// Device supports stream priorities.
1693    pub const CU_DEVICE_ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1694        78,
1695    );
1696    /// Device supports caching globals in L1.
1697    pub const CU_DEVICE_ATTRIBUTE_GLOBAL_L1_CACHE_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1698        79,
1699    );
1700    /// Device supports caching locals in L1.
1701    pub const CU_DEVICE_ATTRIBUTE_LOCAL_L1_CACHE_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1702        80,
1703    );
1704    /// Maximum shared memory available per multiprocessor in bytes.
1705    pub const CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR: CUdevice_attribute_enum = CUdevice_attribute_enum(
1706        81,
1707    );
1708    /// Maximum number of 32-bit registers available per multiprocessor.
1709    pub const CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR: CUdevice_attribute_enum = CUdevice_attribute_enum(
1710        82,
1711    );
1712    /// Device can allocate managed memory on this system.
1713    pub const CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY: CUdevice_attribute_enum = CUdevice_attribute_enum(
1714        83,
1715    );
1716    /// Device is on a multi-GPU board.
1717    pub const CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD: CUdevice_attribute_enum = CUdevice_attribute_enum(
1718        84,
1719    );
1720    /// Unique id for a group of devices on the same multi-GPU board.
1721    pub const CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID: CUdevice_attribute_enum = CUdevice_attribute_enum(
1722        85,
1723    );
1724    /// Link between the device and the host supports all native atomic operations.
1725    pub const CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1726        86,
1727    );
1728    /// Ratio of single precision performance (in floating-point operations per second) to double precision performance.
1729    pub const CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO: CUdevice_attribute_enum = CUdevice_attribute_enum(
1730        87,
1731    );
1732    /// Device supports coherently accessing pageable memory without calling cudaHostRegister on it.
1733    pub const CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS: CUdevice_attribute_enum = CUdevice_attribute_enum(
1734        88,
1735    );
1736    /// Device can coherently access managed memory concurrently with the CPU.
1737    pub const CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS: CUdevice_attribute_enum = CUdevice_attribute_enum(
1738        89,
1739    );
1740    /// Device supports compute preemption.
1741    pub const CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1742        90,
1743    );
1744    /// Device can access host registered memory at the same virtual address as the CPU.
1745    pub const CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM: CUdevice_attribute_enum = CUdevice_attribute_enum(
1746        91,
1747    );
1748    /// along with v1 MemOps API, cuStreamBatchMemOp and related APIs are supported.
1749    #[deprecated]
1750    pub const CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_MEM_OPS_V1: CUdevice_attribute_enum = CUdevice_attribute_enum(
1751        92,
1752    );
1753    /// along with v1 MemOps API, 64-bit operations are supported in cuStreamBatchMemOp and related APIs.
1754    #[deprecated]
1755    pub const CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS_V1: CUdevice_attribute_enum = CUdevice_attribute_enum(
1756        93,
1757    );
1758    /// along with v1 MemOps API, [`CUstreamWaitValue_flags_enum::CU_STREAM_WAIT_VALUE_NOR`] is supported.
1759    #[deprecated]
1760    pub const CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR_V1: CUdevice_attribute_enum = CUdevice_attribute_enum(
1761        94,
1762    );
1763    /// Device supports launching cooperative kernels via [`cuLaunchCooperativeKernel`].
1764    pub const CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH: CUdevice_attribute_enum = CUdevice_attribute_enum(
1765        95,
1766    );
1767    /// [`cuLaunchCooperativeKernelMultiDevice`] is deprecated.
1768    #[deprecated]
1769    pub const CU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH: CUdevice_attribute_enum = CUdevice_attribute_enum(
1770        96,
1771    );
1772    /// Maximum optin shared memory per block.
1773    ///
1774    /// That is shared memory that is available for dynamic allocation or static allocation (including architecture specific static shared memory) on this device but is not guaranteed to be portable.
1775    pub const CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN: CUdevice_attribute_enum = CUdevice_attribute_enum(
1776        97,
1777    );
1778    /// The [`CUstreamWaitValue_flags_enum::CU_STREAM_WAIT_VALUE_FLUSH`] flag and the [`CUstreamBatchMemOpType_enum::CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES`] MemOp are supported on the device.
1779    ///
1780    /// See [Stream Memory Operations](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__MEMOP.html#group__cuda__memop) for additional details.
1781    pub const CU_DEVICE_ATTRIBUTE_CAN_FLUSH_REMOTE_WRITES: CUdevice_attribute_enum = CUdevice_attribute_enum(
1782        98,
1783    );
1784    /// Device supports host memory registration via `cudaHostRegister`.
1785    pub const CU_DEVICE_ATTRIBUTE_HOST_REGISTER_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1786        99,
1787    );
1788    /// Device accesses pageable memory via the host’s page tables.
1789    pub const CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES: CUdevice_attribute_enum = CUdevice_attribute_enum(
1790        100,
1791    );
1792    /// The host can directly access managed memory on the device without migration.
1793    pub const CU_DEVICE_ATTRIBUTE_DIRECT_MANAGED_MEM_ACCESS_FROM_HOST: CUdevice_attribute_enum = CUdevice_attribute_enum(
1794        101,
1795    );
1796    /// Use [`CUdevice_attribute::CU_DEVICE_ATTRIBUTE_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED`].
1797    #[deprecated]
1798    pub const CU_DEVICE_ATTRIBUTE_VIRTUAL_ADDRESS_MANAGEMENT_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1799        102,
1800    );
1801    /// Device supports virtual memory management APIs like [`cuMemAddressReserve`], [`cuMemCreate`], [`cuMemMap`] and related APIs.
1802    pub const CU_DEVICE_ATTRIBUTE_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1803        102,
1804    );
1805    /// Device supports exporting memory to a posix file descriptor with [`cuMemExportToShareableHandle`], if requested via [`cuMemCreate`].
1806    pub const CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1807        103,
1808    );
1809    /// Device supports exporting memory to a Win32 NT handle with [`cuMemExportToShareableHandle`], if requested via [`cuMemCreate`].
1810    pub const CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_HANDLE_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1811        104,
1812    );
1813    /// Device supports exporting memory to a Win32 KMT handle with [`cuMemExportToShareableHandle`], if requested via [`cuMemCreate`].
1814    pub const CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_KMT_HANDLE_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1815        105,
1816    );
1817    /// Maximum number of blocks per multiprocessor.
1818    pub const CU_DEVICE_ATTRIBUTE_MAX_BLOCKS_PER_MULTIPROCESSOR: CUdevice_attribute_enum = CUdevice_attribute_enum(
1819        106,
1820    );
1821    /// Device supports compression of memory.
1822    pub const CU_DEVICE_ATTRIBUTE_GENERIC_COMPRESSION_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1823        107,
1824    );
1825    /// Maximum L2 persisting lines capacity setting in bytes.
1826    pub const CU_DEVICE_ATTRIBUTE_MAX_PERSISTING_L2_CACHE_SIZE: CUdevice_attribute_enum = CUdevice_attribute_enum(
1827        108,
1828    );
1829    /// Maximum value of [`CUaccessPolicyWindow::num_bytes`](CUaccessPolicyWindow_st::num_bytes).
1830    pub const CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE: CUdevice_attribute_enum = CUdevice_attribute_enum(
1831        109,
1832    );
1833    /// Device supports specifying the GPUDirect RDMA flag with [`cuMemCreate`].
1834    pub const CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WITH_CUDA_VMM_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1835        110,
1836    );
1837    /// Shared memory reserved by CUDA driver per block in bytes.
1838    pub const CU_DEVICE_ATTRIBUTE_RESERVED_SHARED_MEMORY_PER_BLOCK: CUdevice_attribute_enum = CUdevice_attribute_enum(
1839        111,
1840    );
1841    /// Device supports sparse CUDA arrays and sparse CUDA mipmapped arrays.
1842    pub const CU_DEVICE_ATTRIBUTE_SPARSE_CUDA_ARRAY_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1843        112,
1844    );
1845    /// Device supports using the cuMemHostRegister flag `CU_MEMHOSTERGISTER_READ_ONLY` to register memory that must be mapped as read-only to the GPU.
1846    pub const CU_DEVICE_ATTRIBUTE_READ_ONLY_HOST_REGISTER_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1847        113,
1848    );
1849    /// External timeline semaphore interop is supported on the device.
1850    pub const CU_DEVICE_ATTRIBUTE_TIMELINE_SEMAPHORE_INTEROP_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1851        114,
1852    );
1853    /// Device supports using the [`cuMemAllocAsync`] and `cuMemPool` family of APIs.
1854    pub const CU_DEVICE_ATTRIBUTE_MEMORY_POOLS_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1855        115,
1856    );
1857    /// Device supports GPUDirect RDMA APIs, like nvidia_p2p_get_pages (see <https://docs.nvidia.com/cuda/gpudirect-rdma> for more information).
1858    pub const CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1859        116,
1860    );
1861    /// The returned attribute shall be interpreted as a bitmask, where the individual bits are described by the [`CUflushGPUDirectRDMAWritesOptions`] enum.
1862    pub const CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_FLUSH_WRITES_OPTIONS: CUdevice_attribute_enum = CUdevice_attribute_enum(
1863        117,
1864    );
1865    /// GPUDirect RDMA writes to the device do not need to be flushed for consumers within the scope indicated by the returned attribute.
1866    ///
1867    /// See [`CUGPUDirectRDMAWritesOrdering`] for the numerical values returned here.
1868    pub const CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WRITES_ORDERING: CUdevice_attribute_enum = CUdevice_attribute_enum(
1869        118,
1870    );
1871    /// Handle types supported with mempool based IPC.
1872    pub const CU_DEVICE_ATTRIBUTE_MEMPOOL_SUPPORTED_HANDLE_TYPES: CUdevice_attribute_enum = CUdevice_attribute_enum(
1873        119,
1874    );
1875    /// Indicates device supports cluster launch.
1876    pub const CU_DEVICE_ATTRIBUTE_CLUSTER_LAUNCH: CUdevice_attribute_enum = CUdevice_attribute_enum(
1877        120,
1878    );
1879    /// Device supports deferred mapping CUDA arrays and CUDA mipmapped arrays.
1880    pub const CU_DEVICE_ATTRIBUTE_DEFERRED_MAPPING_CUDA_ARRAY_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1881        121,
1882    );
1883    /// 64-bit operations are supported in cuStreamBatchMemOp and related MemOp APIs.
1884    pub const CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS: CUdevice_attribute_enum = CUdevice_attribute_enum(
1885        122,
1886    );
1887    /// [`CUstreamWaitValue_flags_enum::CU_STREAM_WAIT_VALUE_NOR`] is supported by MemOp APIs.
1888    pub const CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR: CUdevice_attribute_enum = CUdevice_attribute_enum(
1889        123,
1890    );
1891    /// Device supports buffer sharing with dma_buf mechanism.
1892    pub const CU_DEVICE_ATTRIBUTE_DMA_BUF_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1893        124,
1894    );
1895    /// Device supports IPC Events.
1896    pub const CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1897        125,
1898    );
1899    /// Number of memory domains the device supports.
1900    pub const CU_DEVICE_ATTRIBUTE_MEM_SYNC_DOMAIN_COUNT: CUdevice_attribute_enum = CUdevice_attribute_enum(
1901        126,
1902    );
1903    /// Device supports accessing memory using Tensor Map.
1904    pub const CU_DEVICE_ATTRIBUTE_TENSOR_MAP_ACCESS_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1905        127,
1906    );
1907    /// Device supports exporting memory to a fabric handle with [`cuMemExportToShareableHandle`] or requested with [`cuMemCreate`].
1908    pub const CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_FABRIC_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1909        128,
1910    );
1911    /// Device supports unified function pointers.
1912    pub const CU_DEVICE_ATTRIBUTE_UNIFIED_FUNCTION_POINTERS: CUdevice_attribute_enum = CUdevice_attribute_enum(
1913        129,
1914    );
1915    /// NUMA configuration of a device: value is of type [`CUdeviceNumaConfig`] enum.
1916    pub const CU_DEVICE_ATTRIBUTE_NUMA_CONFIG: CUdevice_attribute_enum = CUdevice_attribute_enum(
1917        130,
1918    );
1919    /// NUMA node ID of the GPU memory.
1920    pub const CU_DEVICE_ATTRIBUTE_NUMA_ID: CUdevice_attribute_enum = CUdevice_attribute_enum(
1921        131,
1922    );
1923    /// Device supports switch multicast and reduction operations.
1924    pub const CU_DEVICE_ATTRIBUTE_MULTICAST_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1925        132,
1926    );
1927    /// Indicates if contexts created on this device will be shared via MPS.
1928    pub const CU_DEVICE_ATTRIBUTE_MPS_ENABLED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1929        133,
1930    );
1931    /// NUMA ID of the host node closest to the device.
1932    ///
1933    /// Returns -1 when system does not support NUMA.
1934    pub const CU_DEVICE_ATTRIBUTE_HOST_NUMA_ID: CUdevice_attribute_enum = CUdevice_attribute_enum(
1935        134,
1936    );
1937    /// Device supports CIG with D3D12.
1938    pub const CU_DEVICE_ATTRIBUTE_D3D12_CIG_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1939        135,
1940    );
1941    /// The returned valued shall be interpreted as a bitmask, where the individual bits are described by the [`CUmemDecompressAlgorithm`] enum.
1942    pub const CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_ALGORITHM_MASK: CUdevice_attribute_enum = CUdevice_attribute_enum(
1943        136,
1944    );
1945    /// The returned valued is the maximum length in bytes of a single decompress operation that is allowed.
1946    pub const CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_MAXIMUM_LENGTH: CUdevice_attribute_enum = CUdevice_attribute_enum(
1947        137,
1948    );
1949    /// Device supports CIG with Vulkan.
1950    pub const CU_DEVICE_ATTRIBUTE_VULKAN_CIG_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1951        138,
1952    );
1953    /// The combined 16-bit PCI device ID and 16-bit PCI vendor ID.
1954    pub const CU_DEVICE_ATTRIBUTE_GPU_PCI_DEVICE_ID: CUdevice_attribute_enum = CUdevice_attribute_enum(
1955        139,
1956    );
1957    /// The combined 16-bit PCI subsystem ID and 16-bit PCI subsystem vendor ID.
1958    pub const CU_DEVICE_ATTRIBUTE_GPU_PCI_SUBSYSTEM_ID: CUdevice_attribute_enum = CUdevice_attribute_enum(
1959        140,
1960    );
1961    /// Device supports HOST_NUMA location with the virtual memory management APIs like [`cuMemCreate`], [`cuMemMap`] and related APIs.
1962    pub const CU_DEVICE_ATTRIBUTE_HOST_NUMA_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1963        141,
1964    );
1965    /// Device supports HOST_NUMA location with the [`cuMemAllocAsync`] and `cuMemPool` family of APIs.
1966    pub const CU_DEVICE_ATTRIBUTE_HOST_NUMA_MEMORY_POOLS_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1967        142,
1968    );
1969    /// Device supports HOST_NUMA location IPC between nodes in a multi-node system.
1970    pub const CU_DEVICE_ATTRIBUTE_HOST_NUMA_MULTINODE_IPC_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1971        143,
1972    );
1973    /// Device suports HOST location with the [`cuMemAllocAsync`] and `cuMemPool` family of APIs.
1974    pub const CU_DEVICE_ATTRIBUTE_HOST_MEMORY_POOLS_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1975        144,
1976    );
1977    /// Device supports HOST location with the virtual memory management APIs like [`cuMemCreate`], [`cuMemMap`] and related APIs.
1978    pub const CU_DEVICE_ATTRIBUTE_HOST_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1979        145,
1980    );
1981    /// Device supports page-locked host memory buffer sharing with dma_buf mechanism.
1982    pub const CU_DEVICE_ATTRIBUTE_HOST_ALLOC_DMA_BUF_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1983        146,
1984    );
1985    /// Link between the device and the host supports only some native atomic operations.
1986    pub const CU_DEVICE_ATTRIBUTE_ONLY_PARTIAL_HOST_NATIVE_ATOMIC_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1987        147,
1988    );
1989    /// Device supports atomic reduction operations in stream batch memory operations.
1990    pub const CU_DEVICE_ATTRIBUTE_ATOMIC_REDUCTION_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
1991        148,
1992    );
1993    /// Number of locality domains.
1994    pub const CU_DEVICE_ATTRIBUTE_LOCALITY_DOMAIN_COUNT: CUdevice_attribute_enum = CUdevice_attribute_enum(
1995        149,
1996    );
1997    /// Maximum oversized shared memory per block.
1998    pub const CU_DEVICE_ATTRIBUTE_MAX_OVERSIZED_SHARED_MEMORY_PER_BLOCK: CUdevice_attribute_enum = CUdevice_attribute_enum(
1999        150,
2000    );
2001    /// Device supports CIG streams with D3D12.
2002    pub const CU_DEVICE_ATTRIBUTE_D3D12_CIG_STREAMS_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
2003        151,
2004    );
2005    /// Device supports mmap() of dmabuf file descriptors for CUDA device memory allocations.
2006    pub const CU_DEVICE_ATTRIBUTE_DMA_BUF_MMAP_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
2007        152,
2008    );
2009    /// Device supports unicast logical endpoints.
2010    pub const CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_UNICAST_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
2011        153,
2012    );
2013    /// Device supports multicast logical endpoints.
2014    pub const CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_MULTICAST_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
2015        154,
2016    );
2017    /// Device supports counted operations via logical endpoints.
2018    pub const CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_COUNTED_OPS_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
2019        155,
2020    );
2021    /// Device supports unicast logical endpoint access on the owner device.
2022    pub const CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_UNICAST_ACCESS_ON_OWNER_DEVICE_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
2023        156,
2024    );
2025    /// Number of multiprocessors on each locality domain.
2026    pub const CU_DEVICE_ATTRIBUTE_LOCALITY_DOMAIN_MULTIPROCESSOR_COUNT: CUdevice_attribute_enum = CUdevice_attribute_enum(
2027        157,
2028    );
2029    /// Handle types supported with logical endpoint IPC.
2030    pub const CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_SUPPORTED_HANDLE_TYPES: CUdevice_attribute_enum = CUdevice_attribute_enum(
2031        158,
2032    );
2033    /// Device supports GPUDirect RDMA with localized memory using the default RDMA mapping link.
2034    pub const CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WITH_LOCALIZED_MEMORY_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum(
2035        161,
2036    );
2037    /// End marker for the native device-attribute identifiers.
2038    pub const CU_DEVICE_ATTRIBUTE_MAX: CUdevice_attribute_enum = CUdevice_attribute_enum(
2039        162,
2040    );
2041}
2042/// Device properties.
2043#[repr(transparent)]
2044#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
2045pub struct CUdevice_attribute_enum(pub ::core::ffi::c_uint);
2046pub use self::CUdevice_attribute_enum as CUdevice_attribute;
2047/// Legacy device properties.
2048#[repr(C)]
2049#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
2050pub struct CUdevprop_st {
2051    /// Maximum number of threads per block.
2052    pub maxThreadsPerBlock: ::core::ffi::c_int,
2053    /// Maximum size of each dimension of a block.
2054    pub maxThreadsDim: [::core::ffi::c_int; 3usize],
2055    /// Maximum size of each dimension of a grid.
2056    pub maxGridSize: [::core::ffi::c_int; 3usize],
2057    /// Shared memory available per block in bytes.
2058    pub sharedMemPerBlock: ::core::ffi::c_int,
2059    /// Constant memory available on device in bytes.
2060    pub totalConstantMemory: ::core::ffi::c_int,
2061    /// Warp size in threads.
2062    pub SIMDWidth: ::core::ffi::c_int,
2063    /// Maximum pitch in bytes allowed by memory copies.
2064    pub memPitch: ::core::ffi::c_int,
2065    /// 32-bit registers available per block.
2066    pub regsPerBlock: ::core::ffi::c_int,
2067    /// Clock frequency in kilohertz.
2068    pub clockRate: ::core::ffi::c_int,
2069    /// Alignment requirement for textures.
2070    pub textureAlign: ::core::ffi::c_int,
2071}
2072/// Legacy device properties.
2073pub type CUdevprop_v1 = CUdevprop_st;
2074/// Legacy device properties
2075pub type CUdevprop = CUdevprop_v1;
2076impl CUpointer_attribute_enum {
2077    /// The [`CUcontext`] on which a pointer was allocated or registered.
2078    pub const CU_POINTER_ATTRIBUTE_CONTEXT: CUpointer_attribute_enum = CUpointer_attribute_enum(
2079        1,
2080    );
2081    /// The [`CUmemorytype`] describing the physical location of a pointer.
2082    pub const CU_POINTER_ATTRIBUTE_MEMORY_TYPE: CUpointer_attribute_enum = CUpointer_attribute_enum(
2083        2,
2084    );
2085    /// The address at which a pointer’s memory may be accessed on the device.
2086    pub const CU_POINTER_ATTRIBUTE_DEVICE_POINTER: CUpointer_attribute_enum = CUpointer_attribute_enum(
2087        3,
2088    );
2089    /// The address at which a pointer’s memory may be accessed on the host.
2090    pub const CU_POINTER_ATTRIBUTE_HOST_POINTER: CUpointer_attribute_enum = CUpointer_attribute_enum(
2091        4,
2092    );
2093    /// A pair of tokens for use with the nv-p2p.h Linux kernel interface.
2094    pub const CU_POINTER_ATTRIBUTE_P2P_TOKENS: CUpointer_attribute_enum = CUpointer_attribute_enum(
2095        5,
2096    );
2097    /// Synchronize every synchronous memory operation initiated on this region.
2098    pub const CU_POINTER_ATTRIBUTE_SYNC_MEMOPS: CUpointer_attribute_enum = CUpointer_attribute_enum(
2099        6,
2100    );
2101    /// A process-wide unique ID for an allocated memory region.
2102    pub const CU_POINTER_ATTRIBUTE_BUFFER_ID: CUpointer_attribute_enum = CUpointer_attribute_enum(
2103        7,
2104    );
2105    /// Indicates if the pointer points to managed memory.
2106    pub const CU_POINTER_ATTRIBUTE_IS_MANAGED: CUpointer_attribute_enum = CUpointer_attribute_enum(
2107        8,
2108    );
2109    /// A device ordinal of a device on which a pointer was allocated or registered.
2110    pub const CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL: CUpointer_attribute_enum = CUpointer_attribute_enum(
2111        9,
2112    );
2113    /// 1 if this pointer maps to an allocation that is suitable for `cudaIpcGetMemHandle`, 0 otherwise.
2114    pub const CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE: CUpointer_attribute_enum = CUpointer_attribute_enum(
2115        10,
2116    );
2117    /// Starting address for this requested pointer.
2118    pub const CU_POINTER_ATTRIBUTE_RANGE_START_ADDR: CUpointer_attribute_enum = CUpointer_attribute_enum(
2119        11,
2120    );
2121    /// Size of the address range for this requested pointer.
2122    pub const CU_POINTER_ATTRIBUTE_RANGE_SIZE: CUpointer_attribute_enum = CUpointer_attribute_enum(
2123        12,
2124    );
2125    /// 1 if this pointer is in a valid address range that is mapped to a backing allocation, 0 otherwise.
2126    pub const CU_POINTER_ATTRIBUTE_MAPPED: CUpointer_attribute_enum = CUpointer_attribute_enum(
2127        13,
2128    );
2129    /// Bitmask of allowed [`CUmemAllocationHandleType`] for this allocation.
2130    pub const CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES: CUpointer_attribute_enum = CUpointer_attribute_enum(
2131        14,
2132    );
2133    /// 1 if the memory this pointer is referencing can be used with the GPUDirect RDMA API.
2134    pub const CU_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE: CUpointer_attribute_enum = CUpointer_attribute_enum(
2135        15,
2136    );
2137    /// Returns the access flags the device associated with the current context has on the corresponding memory referenced by the pointer given.
2138    pub const CU_POINTER_ATTRIBUTE_ACCESS_FLAGS: CUpointer_attribute_enum = CUpointer_attribute_enum(
2139        16,
2140    );
2141    /// Returns the mempool handle for the allocation if it was allocated from a mempool.
2142    ///
2143    /// Otherwise returns NULL.
2144    pub const CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE: CUpointer_attribute_enum = CUpointer_attribute_enum(
2145        17,
2146    );
2147    /// Size of the actual underlying mapping that the pointer belongs to.
2148    pub const CU_POINTER_ATTRIBUTE_MAPPING_SIZE: CUpointer_attribute_enum = CUpointer_attribute_enum(
2149        18,
2150    );
2151    /// The start address of the mapping that the pointer belongs to.
2152    pub const CU_POINTER_ATTRIBUTE_MAPPING_BASE_ADDR: CUpointer_attribute_enum = CUpointer_attribute_enum(
2153        19,
2154    );
2155    /// A process-wide unique id corresponding to the physical allocation the pointer belongs to.
2156    pub const CU_POINTER_ATTRIBUTE_MEMORY_BLOCK_ID: CUpointer_attribute_enum = CUpointer_attribute_enum(
2157        20,
2158    );
2159    /// Returns in `*data` a boolean that indicates whether the pointer points to memory that is capable to be used for hardware accelerated decompression.
2160    pub const CU_POINTER_ATTRIBUTE_IS_HW_DECOMPRESS_CAPABLE: CUpointer_attribute_enum = CUpointer_attribute_enum(
2161        21,
2162    );
2163    /// Returns in `*data` an integer representing the locality domain ordinal of the memory allocation, or -1 if the allocation is not localized to a locality domain.
2164    pub const CU_POINTER_ATTRIBUTE_LOCALITY_DOMAIN_ORDINAL: CUpointer_attribute_enum = CUpointer_attribute_enum(
2165        22,
2166    );
2167}
2168/// Pointer information.
2169#[repr(transparent)]
2170#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
2171pub struct CUpointer_attribute_enum(pub ::core::ffi::c_uint);
2172pub use self::CUpointer_attribute_enum as CUpointer_attribute;
2173impl CUfunction_attribute_enum {
2174    /// The maximum number of threads per block, beyond which a launch of the function would fail.
2175    ///
2176    /// This number depends on both the function and the device on which the function is currently loaded.
2177    pub const CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK: CUfunction_attribute_enum = CUfunction_attribute_enum(
2178        0,
2179    );
2180    /// The size in bytes of statically-allocated shared memory required by this function.
2181    ///
2182    /// This does not include dynamically-allocated shared memory requested by the user at runtime.
2183    pub const CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES: CUfunction_attribute_enum = CUfunction_attribute_enum(
2184        1,
2185    );
2186    /// The size in bytes of user-allocated constant memory required by this function.
2187    pub const CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES: CUfunction_attribute_enum = CUfunction_attribute_enum(
2188        2,
2189    );
2190    /// The size in bytes of local memory used by each thread of this function.
2191    pub const CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES: CUfunction_attribute_enum = CUfunction_attribute_enum(
2192        3,
2193    );
2194    /// The number of registers used by each thread of this function.
2195    pub const CU_FUNC_ATTRIBUTE_NUM_REGS: CUfunction_attribute_enum = CUfunction_attribute_enum(
2196        4,
2197    );
2198    /// The PTX virtual architecture version for which the function was compiled.
2199    ///
2200    /// This value is the major PTX version \* 10 + the minor PTX version, so a PTX version 1.3 function would return the value 13. Note that this may return the undefined value of 0 for cubins compiled prior to CUDA 3.0.
2201    pub const CU_FUNC_ATTRIBUTE_PTX_VERSION: CUfunction_attribute_enum = CUfunction_attribute_enum(
2202        5,
2203    );
2204    /// The binary architecture version for which the function was compiled.
2205    ///
2206    /// This value is the major binary version \* 10 + the minor binary version, so a binary version 1.3 function would return the value 13. Note that this will return a value of 10 for legacy cubins that do not have a properly-encoded binary architecture version.
2207    pub const CU_FUNC_ATTRIBUTE_BINARY_VERSION: CUfunction_attribute_enum = CUfunction_attribute_enum(
2208        6,
2209    );
2210    /// The attribute to indicate whether the function has been compiled with user specified option “-Xptxas –dlcm=ca” set .
2211    pub const CU_FUNC_ATTRIBUTE_CACHE_MODE_CA: CUfunction_attribute_enum = CUfunction_attribute_enum(
2212        7,
2213    );
2214    /// The maximum size in bytes of dynamically-allocated shared memory that can be used by this function.
2215    ///
2216    /// If the user-specified dynamic shared memory size is larger than this value, the launch will fail.
2217    ///
2218    /// The default value of this attribute is [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK`] - [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES`], except when [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES`] is greater than [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK`], then the default value of this attribute is 0. The value can be increased to [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN`] - [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES`].
2219    ///
2220    /// This attribute is ignored if [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_SHARED_MEMORY_MODE`] or [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE`] is set.
2221    ///
2222    /// This attribute cannot be used to access oversized shared memory. Oversized shared memory can only be accessed by setting [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_SHARED_MEMORY_MODE`] or [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE`].
2223    ///
2224    /// See [`cuFuncSetAttribute`], [`cuKernelSetAttribute`].
2225    pub const CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES: CUfunction_attribute_enum = CUfunction_attribute_enum(
2226        8,
2227    );
2228    /// On devices where the L1 cache and shared memory use the same hardware resources, this sets the shared memory carveout preference, in percent of the total shared memory.
2229    ///
2230    /// Refer to [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR`]. This is only a hint, and the driver can choose a different ratio if required to execute the function.
2231    ///
2232    /// See [`cuFuncSetAttribute`], [`cuKernelSetAttribute`].
2233    pub const CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT: CUfunction_attribute_enum = CUfunction_attribute_enum(
2234        9,
2235    );
2236    /// If this attribute is set, the kernel must launch with a valid cluster size specified.
2237    ///
2238    /// See [`cuFuncSetAttribute`], [`cuKernelSetAttribute`].
2239    pub const CU_FUNC_ATTRIBUTE_CLUSTER_SIZE_MUST_BE_SET: CUfunction_attribute_enum = CUfunction_attribute_enum(
2240        10,
2241    );
2242    /// The required cluster width in blocks.
2243    ///
2244    /// The values must either all be 0 or all be positive. The validity of the cluster dimensions is otherwise checked at launch time.
2245    ///
2246    /// If the value is set during compile time, it cannot be set at runtime. Setting it at runtime will return [`CUresult::CUDA_ERROR_NOT_PERMITTED`].
2247    ///
2248    /// See [`cuFuncSetAttribute`], [`cuKernelSetAttribute`].
2249    pub const CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH: CUfunction_attribute_enum = CUfunction_attribute_enum(
2250        11,
2251    );
2252    /// The required cluster height in blocks.
2253    ///
2254    /// The values must either all be 0 or all be positive. The validity of the cluster dimensions is otherwise checked at launch time.
2255    ///
2256    /// If the value is set during compile time, it cannot be set at runtime. Setting it at runtime should return [`CUresult::CUDA_ERROR_NOT_PERMITTED`].
2257    ///
2258    /// See [`cuFuncSetAttribute`], [`cuKernelSetAttribute`].
2259    pub const CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT: CUfunction_attribute_enum = CUfunction_attribute_enum(
2260        12,
2261    );
2262    /// The required cluster depth in blocks.
2263    ///
2264    /// The values must either all be 0 or all be positive. The validity of the cluster dimensions is otherwise checked at launch time.
2265    ///
2266    /// If the value is set during compile time, it cannot be set at runtime. Setting it at runtime should return [`CUresult::CUDA_ERROR_NOT_PERMITTED`].
2267    ///
2268    /// See [`cuFuncSetAttribute`], [`cuKernelSetAttribute`].
2269    pub const CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH: CUfunction_attribute_enum = CUfunction_attribute_enum(
2270        13,
2271    );
2272    /// Whether the function can be launched with non-portable cluster size.
2273    ///
2274    /// 1 is allowed, 0 is disallowed. A non-portable cluster size may only function on the specific SKUs the program is tested on. The launch might fail if the program is run on a different hardware platform.
2275    ///
2276    /// CUDA API provides cudaOccupancyMaxActiveClusters to assist with checking whether the desired size can be launched on the current device.
2277    ///
2278    /// Portable Cluster Size
2279    ///
2280    /// A portable cluster size is guaranteed to be functional on all compute capabilities higher than the target compute capability. The portable cluster size for sm_90 is 8 blocks per cluster. This value may increase for future compute capabilities.
2281    ///
2282    /// The specific hardware unit may support higher cluster sizes that’s not guaranteed to be portable.
2283    ///
2284    /// See [`cuFuncSetAttribute`], [`cuKernelSetAttribute`].
2285    pub const CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED: CUfunction_attribute_enum = CUfunction_attribute_enum(
2286        14,
2287    );
2288    /// The block scheduling policy of a function.
2289    ///
2290    /// The value type is CUclusterSchedulingPolicy / cudaClusterSchedulingPolicy.
2291    ///
2292    /// See [`cuFuncSetAttribute`], [`cuKernelSetAttribute`].
2293    pub const CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE: CUfunction_attribute_enum = CUfunction_attribute_enum(
2294        15,
2295    );
2296    /// Whether the function can be updated on device.
2297    ///
2298    /// 1 means device node update is supported, 0 is unsupported.
2299    ///
2300    /// See [`cuFuncGetAttribute`].
2301    pub const CU_FUNC_ATTRIBUTE_DEVICE_NODE_UPDATE_SUPPORTED: CUfunction_attribute_enum = CUfunction_attribute_enum(
2302        16,
2303    );
2304    /// The shared memory mode of a function.
2305    ///
2306    /// The value type is CUsharedMemoryMode / cudaSharedMemoryMode.
2307    ///
2308    /// See [`cuFuncSetAttribute`], [`cuKernelSetAttribute`].
2309    pub const CU_FUNC_ATTRIBUTE_SHARED_MEMORY_MODE: CUfunction_attribute_enum = CUfunction_attribute_enum(
2310        17,
2311    );
2312    /// Upper-bound sentinel for CUDA function attribute selectors.
2313    pub const CU_FUNC_ATTRIBUTE_MAX: CUfunction_attribute_enum = CUfunction_attribute_enum(
2314        18,
2315    );
2316}
2317/// Function properties.
2318#[repr(transparent)]
2319#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
2320pub struct CUfunction_attribute_enum(pub ::core::ffi::c_uint);
2321pub use self::CUfunction_attribute_enum as CUfunction_attribute;
2322impl CUfunc_cache_enum {
2323    /// no preference for shared memory or L1 (default).
2324    pub const CU_FUNC_CACHE_PREFER_NONE: CUfunc_cache_enum = CUfunc_cache_enum(0);
2325    /// prefer larger shared memory and smaller L1 cache.
2326    pub const CU_FUNC_CACHE_PREFER_SHARED: CUfunc_cache_enum = CUfunc_cache_enum(1);
2327    /// prefer larger L1 cache and smaller shared memory.
2328    pub const CU_FUNC_CACHE_PREFER_L1: CUfunc_cache_enum = CUfunc_cache_enum(2);
2329    /// prefer equal sized L1 cache and shared memory.
2330    pub const CU_FUNC_CACHE_PREFER_EQUAL: CUfunc_cache_enum = CUfunc_cache_enum(3);
2331}
2332/// Function cache configurations.
2333#[repr(transparent)]
2334#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
2335pub struct CUfunc_cache_enum(pub ::core::ffi::c_uint);
2336pub use self::CUfunc_cache_enum as CUfunc_cache;
2337impl CUsharedconfig_enum {
2338    /// set default shared memory bank size.
2339    #[deprecated]
2340    pub const CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE: CUsharedconfig_enum = CUsharedconfig_enum(
2341        0,
2342    );
2343    /// set shared memory bank width to four bytes.
2344    #[deprecated]
2345    pub const CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE: CUsharedconfig_enum = CUsharedconfig_enum(
2346        1,
2347    );
2348    /// set shared memory bank width to eight bytes.
2349    #[deprecated]
2350    pub const CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE: CUsharedconfig_enum = CUsharedconfig_enum(
2351        2,
2352    );
2353}
2354/// Shared memory configurations.
2355#[deprecated]
2356#[repr(transparent)]
2357#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
2358pub struct CUsharedconfig_enum(pub ::core::ffi::c_uint);
2359pub use self::CUsharedconfig_enum as CUsharedconfig;
2360impl CUshared_carveout_enum {
2361    /// No preference for shared memory or L1 (default).
2362    pub const CU_SHAREDMEM_CARVEOUT_DEFAULT: CUshared_carveout_enum = CUshared_carveout_enum(
2363        -1,
2364    );
2365    /// Prefer maximum available shared memory, minimum L1 cache.
2366    pub const CU_SHAREDMEM_CARVEOUT_MAX_SHARED: CUshared_carveout_enum = CUshared_carveout_enum(
2367        100,
2368    );
2369    /// Prefer maximum available L1 cache, minimum shared memory.
2370    pub const CU_SHAREDMEM_CARVEOUT_MAX_L1: CUshared_carveout_enum = CUshared_carveout_enum(
2371        0,
2372    );
2373}
2374/// Shared memory carveout configurations.
2375///
2376/// These may be passed to [`cuFuncSetAttribute`] or [`cuKernelSetAttribute`].
2377#[repr(transparent)]
2378#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
2379pub struct CUshared_carveout_enum(pub ::core::ffi::c_int);
2380pub use self::CUshared_carveout_enum as CUshared_carveout;
2381impl CUmemorytype_enum {
2382    /// Host memory.
2383    pub const CU_MEMORYTYPE_HOST: CUmemorytype_enum = CUmemorytype_enum(1);
2384    /// Device memory.
2385    pub const CU_MEMORYTYPE_DEVICE: CUmemorytype_enum = CUmemorytype_enum(2);
2386    /// Array memory.
2387    pub const CU_MEMORYTYPE_ARRAY: CUmemorytype_enum = CUmemorytype_enum(3);
2388    /// Unified device or host memory.
2389    pub const CU_MEMORYTYPE_UNIFIED: CUmemorytype_enum = CUmemorytype_enum(4);
2390}
2391/// Memory types.
2392#[repr(transparent)]
2393#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
2394pub struct CUmemorytype_enum(pub ::core::ffi::c_uint);
2395pub use self::CUmemorytype_enum as CUmemorytype;
2396impl CUcomputemode_enum {
2397    /// Default compute mode (Multiple contexts allowed per device).
2398    pub const CU_COMPUTEMODE_DEFAULT: CUcomputemode_enum = CUcomputemode_enum(0);
2399    /// Compute-prohibited mode (No contexts can be created on this device at this time).
2400    pub const CU_COMPUTEMODE_PROHIBITED: CUcomputemode_enum = CUcomputemode_enum(2);
2401    /// Compute-exclusive-process mode (Only one context used by a single process can be present on this device at a time).
2402    pub const CU_COMPUTEMODE_EXCLUSIVE_PROCESS: CUcomputemode_enum = CUcomputemode_enum(
2403        3,
2404    );
2405}
2406/// Compute Modes.
2407#[repr(transparent)]
2408#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
2409pub struct CUcomputemode_enum(pub ::core::ffi::c_uint);
2410pub use self::CUcomputemode_enum as CUcomputemode;
2411impl CUmem_advise_enum {
2412    /// Data will mostly be read and only occasionally be written to.
2413    pub const CU_MEM_ADVISE_SET_READ_MOSTLY: CUmem_advise_enum = CUmem_advise_enum(1);
2414    /// Undo the effect of [`CUmem_advise_enum::CU_MEM_ADVISE_SET_READ_MOSTLY`].
2415    pub const CU_MEM_ADVISE_UNSET_READ_MOSTLY: CUmem_advise_enum = CUmem_advise_enum(2);
2416    /// Set the preferred location for the data as the specified device.
2417    pub const CU_MEM_ADVISE_SET_PREFERRED_LOCATION: CUmem_advise_enum = CUmem_advise_enum(
2418        3,
2419    );
2420    /// Clear the preferred location for the data.
2421    pub const CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION: CUmem_advise_enum = CUmem_advise_enum(
2422        4,
2423    );
2424    /// Data will be accessed by the specified device, so prevent page faults as much as possible.
2425    pub const CU_MEM_ADVISE_SET_ACCESSED_BY: CUmem_advise_enum = CUmem_advise_enum(5);
2426    /// Let the Unified Memory subsystem decide on the page faulting policy for the specified device.
2427    pub const CU_MEM_ADVISE_UNSET_ACCESSED_BY: CUmem_advise_enum = CUmem_advise_enum(6);
2428}
2429/// Memory advise values.
2430#[repr(transparent)]
2431#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
2432pub struct CUmem_advise_enum(pub ::core::ffi::c_uint);
2433pub use self::CUmem_advise_enum as CUmem_advise;
2434impl CUmem_range_attribute_enum {
2435    /// Whether the range will mostly be read and only occasionally be written to.
2436    pub const CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY: CUmem_range_attribute_enum = CUmem_range_attribute_enum(
2437        1,
2438    );
2439    /// The preferred location of the range.
2440    pub const CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION: CUmem_range_attribute_enum = CUmem_range_attribute_enum(
2441        2,
2442    );
2443    /// Memory range has [`CUmem_advise_enum::CU_MEM_ADVISE_SET_ACCESSED_BY`] set for specified device.
2444    pub const CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY: CUmem_range_attribute_enum = CUmem_range_attribute_enum(
2445        3,
2446    );
2447    /// The last location to which the range was prefetched.
2448    pub const CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION: CUmem_range_attribute_enum = CUmem_range_attribute_enum(
2449        4,
2450    );
2451    /// The preferred location type of the range.
2452    pub const CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_TYPE: CUmem_range_attribute_enum = CUmem_range_attribute_enum(
2453        5,
2454    );
2455    /// The preferred location id of the range.
2456    pub const CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_ID: CUmem_range_attribute_enum = CUmem_range_attribute_enum(
2457        6,
2458    );
2459    /// The last location type to which the range was prefetched.
2460    pub const CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_TYPE: CUmem_range_attribute_enum = CUmem_range_attribute_enum(
2461        7,
2462    );
2463    /// The last location id to which the range was prefetched.
2464    pub const CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_ID: CUmem_range_attribute_enum = CUmem_range_attribute_enum(
2465        8,
2466    );
2467}
2468/// Attribute queried for a managed-memory address range.
2469#[repr(transparent)]
2470#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
2471pub struct CUmem_range_attribute_enum(pub ::core::ffi::c_uint);
2472pub use self::CUmem_range_attribute_enum as CUmem_range_attribute;
2473impl CUjit_option_enum {
2474    /// Max number of registers that a thread may use.
2475    ///
2476    /// Option type: unsigned int
2477    ///
2478    /// Applies to: compiler only.
2479    pub const CU_JIT_MAX_REGISTERS: CUjit_option_enum = CUjit_option_enum(0);
2480    /// IN: Specifies minimum number of threads per block to target compilation for
2481    ///
2482    /// OUT: Returns the number of threads the compiler actually targeted.
2483    ///
2484    /// This restricts the resource utilization of the compiler (e.g. max registers) such that a block with the given number of threads should be able to launch based on register limitations. Note, this option does not currently take into account any other resource limitations, such as shared memory utilization.
2485    ///
2486    /// Cannot be combined with
2487    ///
2488    /// CU_JIT_TARGET
2489    ///
2490    /// .
2491    ///
2492    /// Option type: unsigned int
2493    ///
2494    /// Applies to: compiler only.
2495    pub const CU_JIT_THREADS_PER_BLOCK: CUjit_option_enum = CUjit_option_enum(1);
2496    /// Overwrites the option value with the total wall clock time, in milliseconds, spent in the compiler and linker
2497    ///
2498    /// Option type: float
2499    ///
2500    /// Applies to: compiler and linker.
2501    pub const CU_JIT_WALL_TIME: CUjit_option_enum = CUjit_option_enum(2);
2502    /// Pointer to a buffer in which to print any log messages that are informational in nature (the buffer size is specified via option [`CUjit_option_enum::CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES`]
2503    ///
2504    /// )
2505    ///
2506    /// Option type: char \*
2507    ///
2508    /// Applies to: compiler and linker.
2509    pub const CU_JIT_INFO_LOG_BUFFER: CUjit_option_enum = CUjit_option_enum(3);
2510    /// IN: Log buffer size in bytes.
2511    ///
2512    /// Log messages will be capped at this size (including null terminator)
2513    ///
2514    /// OUT: Amount of log buffer filled with messages
2515    ///
2516    /// Option type: unsigned int
2517    ///
2518    /// Applies to: compiler and linker.
2519    pub const CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES: CUjit_option_enum = CUjit_option_enum(
2520        4,
2521    );
2522    /// Pointer to a buffer in which to print any log messages that reflect errors (the buffer size is specified via option [`CUjit_option_enum::CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES`]
2523    ///
2524    /// )
2525    ///
2526    /// Option type: char \*
2527    ///
2528    /// Applies to: compiler and linker.
2529    pub const CU_JIT_ERROR_LOG_BUFFER: CUjit_option_enum = CUjit_option_enum(5);
2530    /// IN: Log buffer size in bytes.
2531    ///
2532    /// Log messages will be capped at this size (including null terminator)
2533    ///
2534    /// OUT: Amount of log buffer filled with messages
2535    ///
2536    /// Option type: unsigned int
2537    ///
2538    /// Applies to: compiler and linker.
2539    pub const CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES: CUjit_option_enum = CUjit_option_enum(
2540        6,
2541    );
2542    /// Level of optimizations to apply to generated code (0 - 4), with 4 being the default and highest level of optimizations.
2543    ///
2544    /// Option type: unsigned int
2545    ///
2546    /// Applies to: compiler only.
2547    pub const CU_JIT_OPTIMIZATION_LEVEL: CUjit_option_enum = CUjit_option_enum(7);
2548    /// No option value required.
2549    ///
2550    /// Determines the target based on the current attached context (default)
2551    ///
2552    /// Option type: No option value needed
2553    ///
2554    /// Applies to: compiler and linker.
2555    pub const CU_JIT_TARGET_FROM_CUCONTEXT: CUjit_option_enum = CUjit_option_enum(8);
2556    /// Target is chosen based on supplied [`CUjit_target`].
2557    ///
2558    /// Cannot be combined with [`CUjit_option_enum::CU_JIT_THREADS_PER_BLOCK`]
2559    ///
2560    /// .
2561    ///
2562    /// Option type: unsigned int for enumerated type
2563    ///
2564    /// CUjit_target Applies to: compiler and linker.
2565    pub const CU_JIT_TARGET: CUjit_option_enum = CUjit_option_enum(9);
2566    /// Specifies choice of fallback strategy if matching cubin is not found.
2567    ///
2568    /// Choice is based on supplied [`CUjit_fallback`]
2569    ///
2570    /// . This option cannot be used with cuLink\* APIs as the linker requires exact matches.
2571    ///
2572    /// Option type: unsigned int for enumerated type
2573    ///
2574    /// CUjit_fallback Applies to: compiler only.
2575    pub const CU_JIT_FALLBACK_STRATEGY: CUjit_option_enum = CUjit_option_enum(10);
2576    /// Specifies whether to create debug information in output (-g) (0: false, default)
2577    ///
2578    /// Option type: int
2579    ///
2580    /// Applies to: compiler and linker.
2581    pub const CU_JIT_GENERATE_DEBUG_INFO: CUjit_option_enum = CUjit_option_enum(11);
2582    /// Generate verbose log messages (0: false, default)
2583    ///
2584    /// Option type: int
2585    ///
2586    /// Applies to: compiler and linker.
2587    pub const CU_JIT_LOG_VERBOSE: CUjit_option_enum = CUjit_option_enum(12);
2588    /// Generate line number information (-lineinfo) (0: false, default)
2589    ///
2590    /// Option type: int
2591    ///
2592    /// Applies to: compiler only.
2593    pub const CU_JIT_GENERATE_LINE_INFO: CUjit_option_enum = CUjit_option_enum(13);
2594    /// Specifies whether to enable caching explicitly (-dlcm)
2595    ///
2596    /// Choice is based on supplied [`CUjit_cacheMode_enum`].
2597    ///
2598    /// Option type: unsigned int for enumerated type [`CUjit_cacheMode_enum`]
2599    ///
2600    /// Applies to: compiler only.
2601    pub const CU_JIT_CACHE_MODE: CUjit_option_enum = CUjit_option_enum(14);
2602    /// Deprecated: This jit option is deprecated and should not be used.
2603    #[deprecated]
2604    pub const CU_JIT_NEW_SM3X_OPT: CUjit_option_enum = CUjit_option_enum(15);
2605    /// This jit option is used for internal purpose only.
2606    pub const CU_JIT_FAST_COMPILE: CUjit_option_enum = CUjit_option_enum(16);
2607    /// Array of device symbol names that will be relocated to the corresponding host addresses stored in [`CUjit_option_enum::CU_JIT_GLOBAL_SYMBOL_ADDRESSES`].
2608    ///
2609    /// Must contain [`CUjit_option_enum::CU_JIT_GLOBAL_SYMBOL_COUNT`]
2610    ///
2611    /// entries.
2612    ///
2613    /// When loading a device module, driver will relocate all encountered unresolved symbols to the host addresses.
2614    ///
2615    /// It is only allowed to register symbols that correspond to unresolved global variables.
2616    ///
2617    /// It is illegal to register the same device symbol at multiple addresses.
2618    ///
2619    /// Option type: const char \*\*
2620    ///
2621    /// Applies to: dynamic linker only.
2622    pub const CU_JIT_GLOBAL_SYMBOL_NAMES: CUjit_option_enum = CUjit_option_enum(17);
2623    /// Array of host addresses that will be used to relocate corresponding device symbols stored in [`CUjit_option_enum::CU_JIT_GLOBAL_SYMBOL_NAMES`].
2624    ///
2625    /// Must contain [`CUjit_option_enum::CU_JIT_GLOBAL_SYMBOL_COUNT`]
2626    ///
2627    /// entries.
2628    ///
2629    /// Option type: void \*\*
2630    ///
2631    /// Applies to: dynamic linker only.
2632    pub const CU_JIT_GLOBAL_SYMBOL_ADDRESSES: CUjit_option_enum = CUjit_option_enum(18);
2633    /// Number of entries in [`CUjit_option_enum::CU_JIT_GLOBAL_SYMBOL_NAMES`] and [`CUjit_option_enum::CU_JIT_GLOBAL_SYMBOL_ADDRESSES`] arrays.
2634    ///
2635    /// Option type: unsigned int
2636    ///
2637    /// Applies to: dynamic linker only.
2638    pub const CU_JIT_GLOBAL_SYMBOL_COUNT: CUjit_option_enum = CUjit_option_enum(19);
2639    /// Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0.
2640    ///
2641    /// Deprecated: Enable link-time optimization (-dlto) for device code (Disabled by default).
2642    ///
2643    /// This option is not supported on 32-bit platforms.
2644    ///
2645    /// Option type: int
2646    ///
2647    /// Applies to: compiler and linker.
2648    #[deprecated]
2649    pub const CU_JIT_LTO: CUjit_option_enum = CUjit_option_enum(20);
2650    /// Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0.
2651    ///
2652    /// Deprecated: Control single-precision denormals (-ftz) support (0: false, default). 1 : flushes denormal values to zero 0 : preserves denormal values Option type: int
2653    ///
2654    /// Applies to: link-time optimization specified with [`CUjit_option::CU_JIT_LTO`].
2655    #[deprecated]
2656    pub const CU_JIT_FTZ: CUjit_option_enum = CUjit_option_enum(21);
2657    /// Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0.
2658    ///
2659    /// Deprecated: Control single-precision floating-point division and reciprocals (-prec-div) support (1: true, default). 1 : Enables the IEEE round-to-nearest mode 0 : Enables the fast approximation mode Option type: int
2660    ///
2661    /// Applies to: link-time optimization specified with [`CUjit_option::CU_JIT_LTO`].
2662    #[deprecated]
2663    pub const CU_JIT_PREC_DIV: CUjit_option_enum = CUjit_option_enum(22);
2664    /// Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0.
2665    ///
2666    /// Deprecated: Control single-precision floating-point square root (-prec-sqrt) support (1: true, default). 1 : Enables the IEEE round-to-nearest mode 0 : Enables the fast approximation mode Option type: int
2667    ///
2668    /// Applies to: link-time optimization specified with [`CUjit_option::CU_JIT_LTO`].
2669    #[deprecated]
2670    pub const CU_JIT_PREC_SQRT: CUjit_option_enum = CUjit_option_enum(23);
2671    /// Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0.
2672    ///
2673    /// Deprecated: Enable/Disable the contraction of floating-point multiplies and adds/subtracts into floating-point multiply-add (-fma) operations (1: Enable, default; 0: Disable). Option type: int
2674    ///
2675    /// Applies to: link-time optimization specified with [`CUjit_option::CU_JIT_LTO`].
2676    #[deprecated]
2677    pub const CU_JIT_FMA: CUjit_option_enum = CUjit_option_enum(24);
2678    /// Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0.
2679    ///
2680    /// Deprecated: Array of kernel names that should be preserved at link time while others can be removed.
2681    ///
2682    /// Must contain
2683    ///
2684    /// CU_JIT_REFERENCED_KERNEL_COUNT
2685    ///
2686    /// entries.
2687    ///
2688    /// Note that kernel names can be mangled by the compiler in which case the mangled name needs to be specified.
2689    ///
2690    /// Wildcard “\*” can be used to represent zero or more characters instead of specifying the full or mangled name.
2691    ///
2692    /// It is important to note that the wildcard “\*” is also added implicitly. For example, specifying “foo” will match “foobaz”, “barfoo”, “barfoobaz” and thus preserve all kernels with those names. This can be avoided by providing a more specific name like “barfoobaz”.
2693    ///
2694    /// Option type: const char \*\*
2695    ///
2696    /// Applies to: dynamic linker only.
2697    #[deprecated]
2698    pub const CU_JIT_REFERENCED_KERNEL_NAMES: CUjit_option_enum = CUjit_option_enum(25);
2699    /// Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0.
2700    ///
2701    /// Deprecated: Number of entries in [`CUjit_option_enum::CU_JIT_REFERENCED_KERNEL_NAMES`]
2702    ///
2703    /// array.
2704    ///
2705    /// Option type: unsigned int
2706    ///
2707    /// Applies to: dynamic linker only.
2708    #[deprecated]
2709    pub const CU_JIT_REFERENCED_KERNEL_COUNT: CUjit_option_enum = CUjit_option_enum(26);
2710    /// Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0.
2711    ///
2712    /// Deprecated: Array of variable names (**device** and/or **constant**
2713    ///
2714    /// ) that should be preserved at link time while others can be removed.
2715    ///
2716    /// Must contain
2717    ///
2718    /// CU_JIT_REFERENCED_VARIABLE_COUNT
2719    ///
2720    /// entries.
2721    ///
2722    /// Note that variable names can be mangled by the compiler in which case the mangled name needs to be specified.
2723    ///
2724    /// Wildcard “\*” can be used to represent zero or more characters instead of specifying the full or mangled name.
2725    ///
2726    /// It is important to note that the wildcard “\*” is also added implicitly. For example, specifying “foo” will match “foobaz”, “barfoo”, “barfoobaz” and thus preserve all variables with those names. This can be avoided by providing a more specific name like “barfoobaz”.
2727    ///
2728    /// Option type: const char \*\*
2729    ///
2730    /// Applies to: link-time optimization specified with [`CUjit_option::CU_JIT_LTO`].
2731    #[deprecated]
2732    pub const CU_JIT_REFERENCED_VARIABLE_NAMES: CUjit_option_enum = CUjit_option_enum(
2733        27,
2734    );
2735    /// Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0.
2736    ///
2737    /// Deprecated: Number of entries in [`CUjit_option_enum::CU_JIT_REFERENCED_VARIABLE_NAMES`]
2738    ///
2739    /// array.
2740    ///
2741    /// Option type: unsigned int
2742    ///
2743    /// Applies to: link-time optimization specified with [`CUjit_option::CU_JIT_LTO`].
2744    #[deprecated]
2745    pub const CU_JIT_REFERENCED_VARIABLE_COUNT: CUjit_option_enum = CUjit_option_enum(
2746        28,
2747    );
2748    /// Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0.
2749    ///
2750    /// Deprecated: This option serves as a hint to enable the JIT compiler/linker to remove constant (**constant**) and device (**device**
2751    ///
2752    /// ) variables unreferenced in device code (Disabled by default).
2753    ///
2754    /// Note that host references to constant and device variables using APIs like cuModuleGetGlobal() with this option specified may result in undefined behavior unless the variables are explicitly specified using
2755    ///
2756    /// CU_JIT_REFERENCED_VARIABLE_NAMES
2757    ///
2758    /// .
2759    ///
2760    /// Option type: int
2761    ///
2762    /// Applies to: link-time optimization specified with [`CUjit_option::CU_JIT_LTO`].
2763    #[deprecated]
2764    pub const CU_JIT_OPTIMIZE_UNUSED_DEVICE_VARIABLES: CUjit_option_enum = CUjit_option_enum(
2765        29,
2766    );
2767    /// Generate position independent code (0: false)
2768    ///
2769    /// Option type: int
2770    ///
2771    /// Applies to: compiler only.
2772    pub const CU_JIT_POSITION_INDEPENDENT_CODE: CUjit_option_enum = CUjit_option_enum(
2773        30,
2774    );
2775    /// This option hints to the JIT compiler the minimum number of CTAs from the kernel’s grid to be mapped to a SM.
2776    ///
2777    /// This option is ignored when used together with [`CUjit_option_enum::CU_JIT_MAX_REGISTERS`] or [`CUjit_option_enum::CU_JIT_THREADS_PER_BLOCK`]. Optimizations based on this option need [`CUjit_option_enum::CU_JIT_MAX_THREADS_PER_BLOCK`] to be specified as well. For kernels already using PTX directive .minnctapersm, this option will be ignored by default. Use [`CUjit_option_enum::CU_JIT_OVERRIDE_DIRECTIVE_VALUES`]
2778    ///
2779    /// to let this option take precedence over the PTX directive. Option type: unsigned int
2780    ///
2781    /// Applies to: compiler only.
2782    pub const CU_JIT_MIN_CTA_PER_SM: CUjit_option_enum = CUjit_option_enum(31);
2783    /// Maximum number threads in a thread block, computed as the product of the maximum extent specifed for each dimension of the block.
2784    ///
2785    /// This limit is guaranteed not to be exeeded in any invocation of the kernel. Exceeding the maximum number of threads results in runtime error or kernel launch failure. For kernels already using PTX directive .maxntid, this option will be ignored by default. Use [`CUjit_option_enum::CU_JIT_OVERRIDE_DIRECTIVE_VALUES`]
2786    ///
2787    /// to let this option take precedence over the PTX directive. Option type: int
2788    ///
2789    /// Applies to: compiler only.
2790    pub const CU_JIT_MAX_THREADS_PER_BLOCK: CUjit_option_enum = CUjit_option_enum(32);
2791    /// This option lets the values specified using [`CUjit_option_enum::CU_JIT_MAX_REGISTERS`], [`CUjit_option_enum::CU_JIT_THREADS_PER_BLOCK`], [`CUjit_option_enum::CU_JIT_MAX_THREADS_PER_BLOCK`] and [`CUjit_option_enum::CU_JIT_MIN_CTA_PER_SM`] take precedence over any PTX directives.
2792    ///
2793    /// (0: Disable, default; 1: Enable) Option type: int
2794    ///
2795    /// Applies to: compiler only.
2796    pub const CU_JIT_OVERRIDE_DIRECTIVE_VALUES: CUjit_option_enum = CUjit_option_enum(
2797        33,
2798    );
2799    /// This option specifies the maximum number of concurrent threads to use when running compiler optimizations.
2800    ///
2801    /// If the specified value is 1, the option will be ignored. If the specified value is 0, the number of threads will match the number of CPUs on the underlying machine. Otherwise, if the option is N, then up to N threads will be used. Option type: unsigned int
2802    ///
2803    /// Applies to: compiler only.
2804    pub const CU_JIT_SPLIT_COMPILE: CUjit_option_enum = CUjit_option_enum(34);
2805    /// This option specifies the maximum number of concurrent threads to use when compiling device code.
2806    ///
2807    /// If the specified value is 1, the option will be ignored. If the specified value is 0, the number of threads will match the number of CPUs on the underlying machine. Otherwise, if the option is N, then up to N threads will be used. This option is ignored if the env var CUDA_BINARY_LOADER_THREAD_COUNT is set. Option type: unsigned int
2808    ///
2809    /// Applies to: compiler and linker.
2810    pub const CU_JIT_BINARY_LOADER_THREAD_COUNT: CUjit_option_enum = CUjit_option_enum(
2811        35,
2812    );
2813    /// Upper-bound sentinel for CUDA JIT option selectors.
2814    pub const CU_JIT_NUM_OPTIONS: CUjit_option_enum = CUjit_option_enum(36);
2815}
2816/// Online compiler and linker options.
2817#[repr(transparent)]
2818#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
2819pub struct CUjit_option_enum(pub ::core::ffi::c_uint);
2820pub use self::CUjit_option_enum as CUjit_option;
2821impl CUjit_target_enum {
2822    /// Compute device class 3.0.
2823    pub const CU_TARGET_COMPUTE_30: CUjit_target_enum = CUjit_target_enum(30);
2824    /// Compute device class 3.2.
2825    pub const CU_TARGET_COMPUTE_32: CUjit_target_enum = CUjit_target_enum(32);
2826    /// Compute device class 3.5.
2827    pub const CU_TARGET_COMPUTE_35: CUjit_target_enum = CUjit_target_enum(35);
2828    /// Compute device class 3.7.
2829    pub const CU_TARGET_COMPUTE_37: CUjit_target_enum = CUjit_target_enum(37);
2830    /// Compute device class 5.0.
2831    pub const CU_TARGET_COMPUTE_50: CUjit_target_enum = CUjit_target_enum(50);
2832    /// Compute device class 5.2.
2833    pub const CU_TARGET_COMPUTE_52: CUjit_target_enum = CUjit_target_enum(52);
2834    /// Compute device class 5.3.
2835    pub const CU_TARGET_COMPUTE_53: CUjit_target_enum = CUjit_target_enum(53);
2836    /// Compute device class 6.0.
2837    pub const CU_TARGET_COMPUTE_60: CUjit_target_enum = CUjit_target_enum(60);
2838    /// Compute device class 6.1.
2839    pub const CU_TARGET_COMPUTE_61: CUjit_target_enum = CUjit_target_enum(61);
2840    /// Compute device class 6.2.
2841    pub const CU_TARGET_COMPUTE_62: CUjit_target_enum = CUjit_target_enum(62);
2842    /// Compute device class 7.0.
2843    pub const CU_TARGET_COMPUTE_70: CUjit_target_enum = CUjit_target_enum(70);
2844    /// Compute device class 7.2.
2845    pub const CU_TARGET_COMPUTE_72: CUjit_target_enum = CUjit_target_enum(72);
2846    /// Compute device class 7.5.
2847    pub const CU_TARGET_COMPUTE_75: CUjit_target_enum = CUjit_target_enum(75);
2848    /// Compute device class 8.0.
2849    pub const CU_TARGET_COMPUTE_80: CUjit_target_enum = CUjit_target_enum(80);
2850    /// Compute device class 8.6.
2851    pub const CU_TARGET_COMPUTE_86: CUjit_target_enum = CUjit_target_enum(86);
2852    /// Compute device class 8.7.
2853    pub const CU_TARGET_COMPUTE_87: CUjit_target_enum = CUjit_target_enum(87);
2854    /// Compute device class 8.9.
2855    pub const CU_TARGET_COMPUTE_89: CUjit_target_enum = CUjit_target_enum(89);
2856    /// Compute device class 9.0.
2857    pub const CU_TARGET_COMPUTE_90: CUjit_target_enum = CUjit_target_enum(90);
2858    /// Compute device class 10.0.
2859    pub const CU_TARGET_COMPUTE_100: CUjit_target_enum = CUjit_target_enum(100);
2860    /// Compute device class 11.0.
2861    pub const CU_TARGET_COMPUTE_110: CUjit_target_enum = CUjit_target_enum(110);
2862    /// Compute device class 10.3.
2863    pub const CU_TARGET_COMPUTE_103: CUjit_target_enum = CUjit_target_enum(103);
2864    /// Compute device class 10.7.
2865    pub const CU_TARGET_COMPUTE_107: CUjit_target_enum = CUjit_target_enum(107);
2866    /// Compute device class 12.0.
2867    pub const CU_TARGET_COMPUTE_120: CUjit_target_enum = CUjit_target_enum(120);
2868    /// Compute device class 12.1.
2869    ///
2870    /// Compute device class 9.0. with accelerated features.
2871    pub const CU_TARGET_COMPUTE_121: CUjit_target_enum = CUjit_target_enum(121);
2872    /// Compute capability 9.0 target with architecture-specific accelerated features.
2873    pub const CU_TARGET_COMPUTE_90A: CUjit_target_enum = CUjit_target_enum(65626);
2874    /// Compute capability 10.0 target with architecture-specific accelerated features.
2875    pub const CU_TARGET_COMPUTE_100A: CUjit_target_enum = CUjit_target_enum(65636);
2876    /// Compute capability 11.0 target with architecture-specific accelerated features.
2877    pub const CU_TARGET_COMPUTE_110A: CUjit_target_enum = CUjit_target_enum(65646);
2878    /// Compute capability 10.3 target with architecture-specific accelerated features.
2879    pub const CU_TARGET_COMPUTE_103A: CUjit_target_enum = CUjit_target_enum(65639);
2880    /// Compute capability 10.7 target with architecture-specific accelerated features.
2881    pub const CU_TARGET_COMPUTE_107A: CUjit_target_enum = CUjit_target_enum(65643);
2882    /// Compute capability 12.0 target with architecture-specific accelerated features.
2883    pub const CU_TARGET_COMPUTE_120A: CUjit_target_enum = CUjit_target_enum(65656);
2884    /// Compute capability 12.1 target with architecture-specific accelerated features.
2885    pub const CU_TARGET_COMPUTE_121A: CUjit_target_enum = CUjit_target_enum(65657);
2886    /// Compute capability 10.0 target with architecture-family features.
2887    pub const CU_TARGET_COMPUTE_100F: CUjit_target_enum = CUjit_target_enum(131172);
2888    /// Compute capability 11.0 target with architecture-family features.
2889    pub const CU_TARGET_COMPUTE_110F: CUjit_target_enum = CUjit_target_enum(131182);
2890    /// Compute capability 10.3 target with architecture-family features.
2891    pub const CU_TARGET_COMPUTE_103F: CUjit_target_enum = CUjit_target_enum(131175);
2892    /// Compute capability 10.7 target with architecture-family features.
2893    pub const CU_TARGET_COMPUTE_107F: CUjit_target_enum = CUjit_target_enum(131179);
2894    /// Compute capability 12.0 target with architecture-family features.
2895    pub const CU_TARGET_COMPUTE_120F: CUjit_target_enum = CUjit_target_enum(131192);
2896    /// Compute capability 12.1 target with architecture-family features.
2897    pub const CU_TARGET_COMPUTE_121F: CUjit_target_enum = CUjit_target_enum(131193);
2898}
2899/// Online compilation targets.
2900#[repr(transparent)]
2901#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
2902pub struct CUjit_target_enum(pub ::core::ffi::c_uint);
2903pub use self::CUjit_target_enum as CUjit_target;
2904impl CUjit_fallback_enum {
2905    /// Prefer to compile ptx if exact binary match not found.
2906    pub const CU_PREFER_PTX: CUjit_fallback_enum = CUjit_fallback_enum(0);
2907    /// Prefer to fall back to compatible binary code if exact match not found.
2908    pub const CU_PREFER_BINARY: CUjit_fallback_enum = CUjit_fallback_enum(1);
2909}
2910/// Cubin matching fallback strategies.
2911#[repr(transparent)]
2912#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
2913pub struct CUjit_fallback_enum(pub ::core::ffi::c_uint);
2914pub use self::CUjit_fallback_enum as CUjit_fallback;
2915impl CUjit_cacheMode_enum {
2916    /// Compile with no -dlcm flag specified.
2917    pub const CU_JIT_CACHE_OPTION_NONE: CUjit_cacheMode_enum = CUjit_cacheMode_enum(0);
2918    /// Compile with L1 cache disabled.
2919    pub const CU_JIT_CACHE_OPTION_CG: CUjit_cacheMode_enum = CUjit_cacheMode_enum(1);
2920    /// Compile with L1 cache enabled.
2921    pub const CU_JIT_CACHE_OPTION_CA: CUjit_cacheMode_enum = CUjit_cacheMode_enum(2);
2922}
2923/// Caching modes for dlcm.
2924#[repr(transparent)]
2925#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
2926pub struct CUjit_cacheMode_enum(pub ::core::ffi::c_uint);
2927pub use self::CUjit_cacheMode_enum as CUjit_cacheMode;
2928impl CUjitInputType_enum {
2929    /// Compiled device-class-specific device code
2930    ///
2931    /// Applicable options: none.
2932    pub const CU_JIT_INPUT_CUBIN: CUjitInputType_enum = CUjitInputType_enum(0);
2933    /// PTX source code
2934    ///
2935    /// Applicable options: PTX compiler options.
2936    pub const CU_JIT_INPUT_PTX: CUjitInputType_enum = CUjitInputType_enum(1);
2937    /// Bundle of multiple cubins and/or PTX of some device code
2938    ///
2939    /// Applicable options: PTX compiler options,
2940    ///
2941    /// CU_JIT_FALLBACK_STRATEGY .
2942    pub const CU_JIT_INPUT_FATBINARY: CUjitInputType_enum = CUjitInputType_enum(2);
2943    /// Host object with embedded device code
2944    ///
2945    /// Applicable options: PTX compiler options,
2946    ///
2947    /// CU_JIT_FALLBACK_STRATEGY .
2948    pub const CU_JIT_INPUT_OBJECT: CUjitInputType_enum = CUjitInputType_enum(3);
2949    /// Archive of host objects with embedded device code
2950    ///
2951    /// Applicable options: PTX compiler options,
2952    ///
2953    /// CU_JIT_FALLBACK_STRATEGY .
2954    pub const CU_JIT_INPUT_LIBRARY: CUjitInputType_enum = CUjitInputType_enum(4);
2955    /// Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0.
2956    ///
2957    /// Deprecated: High-level intermediate code for link-time optimization
2958    ///
2959    /// Applicable options: NVVM compiler options, PTX compiler options.
2960    #[deprecated]
2961    pub const CU_JIT_INPUT_NVVM: CUjitInputType_enum = CUjitInputType_enum(5);
2962    /// Upper-bound sentinel for CUDA linker input formats.
2963    pub const CU_JIT_NUM_INPUT_TYPES: CUjitInputType_enum = CUjitInputType_enum(6);
2964}
2965/// Device code formats.
2966#[repr(transparent)]
2967#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
2968pub struct CUjitInputType_enum(pub ::core::ffi::c_uint);
2969pub use self::CUjitInputType_enum as CUjitInputType;
2970/// Incomplete native type used by [`CUlinkState`] handles. The native API owns its layout.
2971#[repr(C)]
2972#[derive(Debug, Copy, Clone)]
2973pub struct CUlinkState_st {
2974    _unused: [u8; 0],
2975}
2976/// Opaque state of a CUDA driver JIT linking session, created by [`cuLinkCreate`] and released by [`cuLinkDestroy`].
2977pub type CUlinkState = *mut CUlinkState_st;
2978impl CUgraphicsRegisterFlags_enum {
2979    /// Default registration behavior without additional access hints.
2980    pub const CU_GRAPHICS_REGISTER_FLAGS_NONE: CUgraphicsRegisterFlags_enum = CUgraphicsRegisterFlags_enum(
2981        0,
2982    );
2983    /// Hints that CUDA will only read the registered resource.
2984    pub const CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY: CUgraphicsRegisterFlags_enum = CUgraphicsRegisterFlags_enum(
2985        1,
2986    );
2987    /// Hints that CUDA will overwrite the registered resource without reading its previous contents.
2988    pub const CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD: CUgraphicsRegisterFlags_enum = CUgraphicsRegisterFlags_enum(
2989        2,
2990    );
2991    /// Allows binding the registered image to a CUDA surface for load and store operations.
2992    pub const CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST: CUgraphicsRegisterFlags_enum = CUgraphicsRegisterFlags_enum(
2993        4,
2994    );
2995    /// Allows texture-gather operations on the registered image.
2996    pub const CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER: CUgraphicsRegisterFlags_enum = CUgraphicsRegisterFlags_enum(
2997        8,
2998    );
2999}
3000/// Flags to register a graphics resource.
3001#[repr(transparent)]
3002#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
3003pub struct CUgraphicsRegisterFlags_enum(pub ::core::ffi::c_uint);
3004pub use self::CUgraphicsRegisterFlags_enum as CUgraphicsRegisterFlags;
3005impl CUgraphicsMapResourceFlags_enum {
3006    /// Specifies no hints about how this resource will be used. It is therefore assumed that this resource will be read from and written to by CUDA kernels.  This is the default value.
3007    pub const CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE: CUgraphicsMapResourceFlags_enum = CUgraphicsMapResourceFlags_enum(
3008        0,
3009    );
3010    /// Hints that CUDA will only read the mapped resource.
3011    pub const CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY: CUgraphicsMapResourceFlags_enum = CUgraphicsMapResourceFlags_enum(
3012        1,
3013    );
3014    /// Hints that CUDA will overwrite the mapped resource without reading its previous contents.
3015    pub const CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD: CUgraphicsMapResourceFlags_enum = CUgraphicsMapResourceFlags_enum(
3016        2,
3017    );
3018}
3019/// Flags for mapping and unmapping interop resources.
3020#[repr(transparent)]
3021#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
3022pub struct CUgraphicsMapResourceFlags_enum(pub ::core::ffi::c_uint);
3023pub use self::CUgraphicsMapResourceFlags_enum as CUgraphicsMapResourceFlags;
3024impl CUarray_cubemap_face_enum {
3025    /// Positive X face of cubemap.
3026    pub const CU_CUBEMAP_FACE_POSITIVE_X: CUarray_cubemap_face_enum = CUarray_cubemap_face_enum(
3027        0,
3028    );
3029    /// Negative X face of cubemap.
3030    pub const CU_CUBEMAP_FACE_NEGATIVE_X: CUarray_cubemap_face_enum = CUarray_cubemap_face_enum(
3031        1,
3032    );
3033    /// Positive Y face of cubemap.
3034    pub const CU_CUBEMAP_FACE_POSITIVE_Y: CUarray_cubemap_face_enum = CUarray_cubemap_face_enum(
3035        2,
3036    );
3037    /// Negative Y face of cubemap.
3038    pub const CU_CUBEMAP_FACE_NEGATIVE_Y: CUarray_cubemap_face_enum = CUarray_cubemap_face_enum(
3039        3,
3040    );
3041    /// Positive Z face of cubemap.
3042    pub const CU_CUBEMAP_FACE_POSITIVE_Z: CUarray_cubemap_face_enum = CUarray_cubemap_face_enum(
3043        4,
3044    );
3045    /// Negative Z face of cubemap.
3046    pub const CU_CUBEMAP_FACE_NEGATIVE_Z: CUarray_cubemap_face_enum = CUarray_cubemap_face_enum(
3047        5,
3048    );
3049}
3050/// Array indices for cube faces.
3051#[repr(transparent)]
3052#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
3053pub struct CUarray_cubemap_face_enum(pub ::core::ffi::c_uint);
3054pub use self::CUarray_cubemap_face_enum as CUarray_cubemap_face;
3055impl CUlimit_enum {
3056    /// GPU thread stack size.
3057    pub const CU_LIMIT_STACK_SIZE: CUlimit_enum = CUlimit_enum(0);
3058    /// GPU printf FIFO size.
3059    pub const CU_LIMIT_PRINTF_FIFO_SIZE: CUlimit_enum = CUlimit_enum(1);
3060    /// GPU malloc heap size.
3061    pub const CU_LIMIT_MALLOC_HEAP_SIZE: CUlimit_enum = CUlimit_enum(2);
3062    /// GPU device runtime launch synchronize depth.
3063    pub const CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH: CUlimit_enum = CUlimit_enum(3);
3064    /// GPU device runtime pending launch count.
3065    pub const CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT: CUlimit_enum = CUlimit_enum(4);
3066    /// A value between 0 and 128 that indicates the maximum fetch granularity of L2 (in Bytes).
3067    ///
3068    /// This is a hint.
3069    pub const CU_LIMIT_MAX_L2_FETCH_GRANULARITY: CUlimit_enum = CUlimit_enum(5);
3070    /// A size in bytes for L2 persisting lines cache size.
3071    pub const CU_LIMIT_PERSISTING_L2_CACHE_SIZE: CUlimit_enum = CUlimit_enum(6);
3072    /// A maximum size in bytes of shared memory available to CUDA kernels on a CIG context.
3073    ///
3074    /// Can only be queried, cannot be set.
3075    pub const CU_LIMIT_SHMEM_SIZE: CUlimit_enum = CUlimit_enum(7);
3076    /// A non-zero value indicates this CUDA context is a CIG-enabled context.
3077    ///
3078    /// Can only be queried, cannot be set.
3079    pub const CU_LIMIT_CIG_ENABLED: CUlimit_enum = CUlimit_enum(8);
3080    /// When set to zero, CUDA will fail to launch a kernel on a CIG context, instead of using the fallback path, if the kernel uses more shared memory than available.
3081    pub const CU_LIMIT_CIG_SHMEM_FALLBACK_ENABLED: CUlimit_enum = CUlimit_enum(9);
3082    /// Per-block memory size.
3083    pub const CU_LIMIT_PER_BLOCK_MEMORY_SIZE: CUlimit_enum = CUlimit_enum(10);
3084    /// Reserved upper-bound sentinel for native device limits.
3085    pub const CU_LIMIT_MAX: CUlimit_enum = CUlimit_enum(11);
3086}
3087/// Limits.
3088#[repr(transparent)]
3089#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
3090pub struct CUlimit_enum(pub ::core::ffi::c_uint);
3091pub use self::CUlimit_enum as CUlimit;
3092impl CUresourcetype_enum {
3093    /// Array resource.
3094    pub const CU_RESOURCE_TYPE_ARRAY: CUresourcetype_enum = CUresourcetype_enum(0);
3095    /// Mipmapped array resource.
3096    pub const CU_RESOURCE_TYPE_MIPMAPPED_ARRAY: CUresourcetype_enum = CUresourcetype_enum(
3097        1,
3098    );
3099    /// Linear resource.
3100    pub const CU_RESOURCE_TYPE_LINEAR: CUresourcetype_enum = CUresourcetype_enum(2);
3101    /// Pitch 2D resource.
3102    pub const CU_RESOURCE_TYPE_PITCH2D: CUresourcetype_enum = CUresourcetype_enum(3);
3103}
3104/// Resource types.
3105#[repr(transparent)]
3106#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
3107pub struct CUresourcetype_enum(pub ::core::ffi::c_uint);
3108pub use self::CUresourcetype_enum as CUresourcetype;
3109/// CUDA host function.
3110pub type CUhostFn = ::core::option::Option<
3111    unsafe extern "C" fn(userData: *mut ::core::ffi::c_void),
3112>;
3113impl CUaccessProperty_enum {
3114    /// Normal cache persistence.
3115    pub const CU_ACCESS_PROPERTY_NORMAL: CUaccessProperty_enum = CUaccessProperty_enum(
3116        0,
3117    );
3118    /// Streaming access is less likely to persit from cache.
3119    pub const CU_ACCESS_PROPERTY_STREAMING: CUaccessProperty_enum = CUaccessProperty_enum(
3120        1,
3121    );
3122    /// Persisting access is more likely to persist in cache.
3123    pub const CU_ACCESS_PROPERTY_PERSISTING: CUaccessProperty_enum = CUaccessProperty_enum(
3124        2,
3125    );
3126}
3127/// Specifies performance hint with [`CUaccessPolicyWindow`] for hitProp and missProp members.
3128#[repr(transparent)]
3129#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
3130pub struct CUaccessProperty_enum(pub ::core::ffi::c_uint);
3131pub use self::CUaccessProperty_enum as CUaccessProperty;
3132/// Specifies an access policy for a window, a contiguous extent of memory beginning at base_ptr and ending at base_ptr + num_bytes.
3133///
3134/// num_bytes is limited by [`CUdevice_attribute::CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE`]. Partition into many segments and assign segments such that: sum of “hit segments” / window == approx. ratio. sum of “miss segments” / window == approx 1-ratio. Segments and ratio specifications are fitted to the capabilities of the architecture. Accesses in a hit segment apply the hitProp access policy. Accesses in a miss segment apply the missProp access policy.
3135#[repr(C)]
3136#[derive(Debug, Copy, Clone, PartialOrd, PartialEq)]
3137pub struct CUaccessPolicyWindow_st {
3138    /// Starting address of the access policy window.
3139    ///
3140    /// CUDA driver may align it.
3141    pub base_ptr: *mut ::core::ffi::c_void,
3142    /// Size in bytes of the window policy.
3143    ///
3144    /// CUDA driver may restrict the maximum size and alignment.
3145    pub num_bytes: size_t,
3146    /// hitRatio specifies percentage of lines assigned hitProp, rest are assigned missProp.
3147    pub hitRatio: f32,
3148    /// [`CUaccessProperty`] set for hit.
3149    pub hitProp: CUaccessProperty,
3150    /// [`CUaccessProperty`] set for miss.
3151    ///
3152    /// Must be either NORMAL or STREAMING.
3153    pub missProp: CUaccessProperty,
3154}
3155impl Default for CUaccessPolicyWindow_st {
3156    fn default() -> Self {
3157        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
3158        unsafe {
3159            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
3160            s.assume_init()
3161        }
3162    }
3163}
3164/// Specifies an access policy for a window, a contiguous extent of memory beginning at base_ptr and ending at base_ptr + num_bytes.
3165///
3166/// num_bytes is limited by [`CUdevice_attribute::CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE`]. Partition into many segments and assign segments such that: sum of “hit segments” / window == approx. ratio. sum of “miss segments” / window == approx 1-ratio. Segments and ratio specifications are fitted to the capabilities of the architecture. Accesses in a hit segment apply the hitProp access policy. Accesses in a miss segment apply the missProp access policy.
3167pub type CUaccessPolicyWindow_v1 = CUaccessPolicyWindow_st;
3168/// Access policy window.
3169pub type CUaccessPolicyWindow = CUaccessPolicyWindow_v1;
3170/// GPU kernel node parameters.
3171#[repr(C)]
3172#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
3173pub struct CUDA_KERNEL_NODE_PARAMS_st {
3174    /// Kernel to launch.
3175    pub func: CUfunction,
3176    /// Width of grid in blocks.
3177    pub gridDimX: ::core::ffi::c_uint,
3178    /// Height of grid in blocks.
3179    pub gridDimY: ::core::ffi::c_uint,
3180    /// Depth of grid in blocks.
3181    pub gridDimZ: ::core::ffi::c_uint,
3182    /// X dimension of each thread block.
3183    pub blockDimX: ::core::ffi::c_uint,
3184    /// Y dimension of each thread block.
3185    pub blockDimY: ::core::ffi::c_uint,
3186    /// Z dimension of each thread block.
3187    pub blockDimZ: ::core::ffi::c_uint,
3188    /// Dynamic shared-memory size per thread block in bytes.
3189    pub sharedMemBytes: ::core::ffi::c_uint,
3190    /// Array of pointers to kernel parameters.
3191    pub kernelParams: *mut *mut ::core::ffi::c_void,
3192    /// Extra options.
3193    pub extra: *mut *mut ::core::ffi::c_void,
3194}
3195impl Default for CUDA_KERNEL_NODE_PARAMS_st {
3196    fn default() -> Self {
3197        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
3198        unsafe {
3199            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
3200            s.assume_init()
3201        }
3202    }
3203}
3204/// GPU kernel node parameters.
3205pub type CUDA_KERNEL_NODE_PARAMS_v1 = CUDA_KERNEL_NODE_PARAMS_st;
3206/// GPU kernel node parameters.
3207#[repr(C)]
3208#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
3209pub struct CUDA_KERNEL_NODE_PARAMS_v2_st {
3210    /// Kernel to launch.
3211    pub func: CUfunction,
3212    /// Width of grid in blocks.
3213    pub gridDimX: ::core::ffi::c_uint,
3214    /// Height of grid in blocks.
3215    pub gridDimY: ::core::ffi::c_uint,
3216    /// Depth of grid in blocks.
3217    pub gridDimZ: ::core::ffi::c_uint,
3218    /// X dimension of each thread block.
3219    pub blockDimX: ::core::ffi::c_uint,
3220    /// Y dimension of each thread block.
3221    pub blockDimY: ::core::ffi::c_uint,
3222    /// Z dimension of each thread block.
3223    pub blockDimZ: ::core::ffi::c_uint,
3224    /// Dynamic shared-memory size per thread block in bytes.
3225    pub sharedMemBytes: ::core::ffi::c_uint,
3226    /// Array of pointers to kernel parameters.
3227    pub kernelParams: *mut *mut ::core::ffi::c_void,
3228    /// Extra options.
3229    pub extra: *mut *mut ::core::ffi::c_void,
3230    /// Kernel to launch, will only be referenced if func is NULL.
3231    pub kern: CUkernel,
3232    /// Context for the kernel task to run in.
3233    ///
3234    /// The value NULL will indicate the current context should be used by the api. This field is ignored if func is set.
3235    pub ctx: CUcontext,
3236}
3237impl Default for CUDA_KERNEL_NODE_PARAMS_v2_st {
3238    fn default() -> Self {
3239        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
3240        unsafe {
3241            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
3242            s.assume_init()
3243        }
3244    }
3245}
3246/// GPU kernel node parameters.
3247pub type CUDA_KERNEL_NODE_PARAMS_v2 = CUDA_KERNEL_NODE_PARAMS_v2_st;
3248/// GPU kernel node parameters
3249pub type CUDA_KERNEL_NODE_PARAMS = CUDA_KERNEL_NODE_PARAMS_v2;
3250/// GPU kernel node parameters.
3251#[repr(C)]
3252#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
3253pub struct CUDA_KERNEL_NODE_PARAMS_v3_st {
3254    /// Kernel to launch.
3255    pub func: CUfunction,
3256    /// Width of grid in blocks.
3257    pub gridDimX: ::core::ffi::c_uint,
3258    /// Height of grid in blocks.
3259    pub gridDimY: ::core::ffi::c_uint,
3260    /// Depth of grid in blocks.
3261    pub gridDimZ: ::core::ffi::c_uint,
3262    /// X dimension of each thread block.
3263    pub blockDimX: ::core::ffi::c_uint,
3264    /// Y dimension of each thread block.
3265    pub blockDimY: ::core::ffi::c_uint,
3266    /// Z dimension of each thread block.
3267    pub blockDimZ: ::core::ffi::c_uint,
3268    /// Dynamic shared-memory size per thread block in bytes.
3269    pub sharedMemBytes: ::core::ffi::c_uint,
3270    /// Array of pointers to kernel parameters.
3271    pub kernelParams: *mut *mut ::core::ffi::c_void,
3272    /// Extra options.
3273    pub extra: *mut *mut ::core::ffi::c_void,
3274    /// Kernel to launch, will only be referenced if func is NULL.
3275    pub kern: CUkernel,
3276    /// Context for the kernel task to run in.
3277    ///
3278    /// The value NULL will indicate the current context should be used by the api. This field is ignored if func is set.
3279    pub ctx: CUcontext,
3280}
3281impl Default for CUDA_KERNEL_NODE_PARAMS_v3_st {
3282    fn default() -> Self {
3283        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
3284        unsafe {
3285            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
3286            s.assume_init()
3287        }
3288    }
3289}
3290/// GPU kernel node parameters.
3291pub type CUDA_KERNEL_NODE_PARAMS_v3 = CUDA_KERNEL_NODE_PARAMS_v3_st;
3292/// Memset node parameters.
3293#[repr(C)]
3294#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
3295pub struct CUDA_MEMSET_NODE_PARAMS_st {
3296    /// Destination device pointer.
3297    pub dst: CUdeviceptr,
3298    /// Pitch of destination device pointer.
3299    ///
3300    /// Unused if height is 1.
3301    pub pitch: size_t,
3302    /// Value to be set.
3303    pub value: ::core::ffi::c_uint,
3304    /// Size of each element in bytes.
3305    ///
3306    /// Must be 1, 2, or 4.
3307    pub elementSize: ::core::ffi::c_uint,
3308    /// Width of the row in elements.
3309    pub width: size_t,
3310    /// Number of rows.
3311    pub height: size_t,
3312}
3313/// Memset node parameters.
3314pub type CUDA_MEMSET_NODE_PARAMS_v1 = CUDA_MEMSET_NODE_PARAMS_st;
3315/// Memset node parameters
3316pub type CUDA_MEMSET_NODE_PARAMS = CUDA_MEMSET_NODE_PARAMS_v1;
3317/// Memset node parameters.
3318#[repr(C)]
3319#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
3320pub struct CUDA_MEMSET_NODE_PARAMS_v2_st {
3321    /// Destination device pointer.
3322    pub dst: CUdeviceptr,
3323    /// Pitch of destination device pointer.
3324    ///
3325    /// Unused if height is 1.
3326    pub pitch: size_t,
3327    /// Value to be set.
3328    pub value: ::core::ffi::c_uint,
3329    /// Size of each element in bytes.
3330    ///
3331    /// Must be 1, 2, or 4.
3332    pub elementSize: ::core::ffi::c_uint,
3333    /// Width of the row in elements.
3334    pub width: size_t,
3335    /// Number of rows.
3336    pub height: size_t,
3337    /// Context on which to run the node.
3338    pub ctx: CUcontext,
3339}
3340impl Default for CUDA_MEMSET_NODE_PARAMS_v2_st {
3341    fn default() -> Self {
3342        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
3343        unsafe {
3344            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
3345            s.assume_init()
3346        }
3347    }
3348}
3349/// Memset node parameters.
3350pub type CUDA_MEMSET_NODE_PARAMS_v2 = CUDA_MEMSET_NODE_PARAMS_v2_st;
3351/// Host node parameters.
3352#[repr(C)]
3353#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
3354pub struct CUDA_HOST_NODE_PARAMS_st {
3355    /// The function to call when the node executes.
3356    pub fn_: CUhostFn,
3357    /// Argument to pass to the function.
3358    pub userData: *mut ::core::ffi::c_void,
3359}
3360impl Default for CUDA_HOST_NODE_PARAMS_st {
3361    fn default() -> Self {
3362        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
3363        unsafe {
3364            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
3365            s.assume_init()
3366        }
3367    }
3368}
3369/// Host node parameters.
3370pub type CUDA_HOST_NODE_PARAMS_v1 = CUDA_HOST_NODE_PARAMS_st;
3371/// Host node parameters
3372pub type CUDA_HOST_NODE_PARAMS = CUDA_HOST_NODE_PARAMS_v1;
3373/// Host node parameters.
3374#[repr(C)]
3375#[derive(Copy, Clone)]
3376pub struct CUDA_HOST_NODE_PARAMS_v2_st {
3377    /// The function to call when the node executes.
3378    pub fn_: CUhostFn,
3379    /// Argument to pass to the function.
3380    pub userData: *mut ::core::ffi::c_void,
3381    /// The sync mode to use for the host task.
3382    pub syncMode: ::core::ffi::c_uint,
3383    /// Anonymous native member. See [`CUDA_HOST_NODE_PARAMS_v2_st__bindgen_ty_1`] for its fields.
3384    pub __bindgen_anon_1: CUDA_HOST_NODE_PARAMS_v2_st__bindgen_ty_1,
3385}
3386/// preferred context to use for the host task
3387#[repr(C)]
3388#[derive(Copy, Clone)]
3389pub union CUDA_HOST_NODE_PARAMS_v2_st__bindgen_ty_1 {
3390    /// Preferred CUDA context for the host task.
3391    pub ctx: CUcontext,
3392    /// Preferred green context for the host task.
3393    pub gCtx: CUgreenCtx,
3394}
3395impl Default for CUDA_HOST_NODE_PARAMS_v2_st__bindgen_ty_1 {
3396    fn default() -> Self {
3397        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
3398        unsafe {
3399            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
3400            s.assume_init()
3401        }
3402    }
3403}
3404impl Default for CUDA_HOST_NODE_PARAMS_v2_st {
3405    fn default() -> Self {
3406        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
3407        unsafe {
3408            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
3409            s.assume_init()
3410        }
3411    }
3412}
3413/// Host node parameters.
3414pub type CUDA_HOST_NODE_PARAMS_v2 = CUDA_HOST_NODE_PARAMS_v2_st;
3415impl CUgraphConditionalNodeType_enum {
3416    /// Conditional ‘if/else’ Node.
3417    ///
3418    /// Body\[0\] executed if condition is non-zero. If `size` == 2, an optional ELSE graph is created and this is executed if the condition is zero.
3419    pub const CU_GRAPH_COND_TYPE_IF: CUgraphConditionalNodeType_enum = CUgraphConditionalNodeType_enum(
3420        0,
3421    );
3422    /// Conditional ‘while’ Node.
3423    ///
3424    /// Body executed repeatedly while condition value is non-zero.
3425    pub const CU_GRAPH_COND_TYPE_WHILE: CUgraphConditionalNodeType_enum = CUgraphConditionalNodeType_enum(
3426        1,
3427    );
3428    /// Conditional ‘switch’ Node.
3429    ///
3430    /// Body\[n\] is executed once, where ‘n’ is the value of the condition. If the condition does not match a body index, no body is launched.
3431    pub const CU_GRAPH_COND_TYPE_SWITCH: CUgraphConditionalNodeType_enum = CUgraphConditionalNodeType_enum(
3432        2,
3433    );
3434}
3435/// Conditional node types.
3436#[repr(transparent)]
3437#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
3438pub struct CUgraphConditionalNodeType_enum(pub ::core::ffi::c_uint);
3439pub use self::CUgraphConditionalNodeType_enum as CUgraphConditionalNodeType;
3440/// Conditional node parameters.
3441#[repr(C)]
3442#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
3443pub struct CUDA_CONDITIONAL_NODE_PARAMS {
3444    /// Conditional node handle.
3445    ///
3446    /// Handles must be created in advance of creating the node using [`cuGraphConditionalHandleCreate`].
3447    pub handle: CUgraphConditionalHandle,
3448    /// Type of conditional node.
3449    pub type_: CUgraphConditionalNodeType,
3450    /// Size of graph output array.
3451    ///
3452    /// Allowed values are 1 for [`CUgraphConditionalNodeType::CU_GRAPH_COND_TYPE_WHILE`], 1 or 2 for [`CUgraphConditionalNodeType::CU_GRAPH_COND_TYPE_IF`], or any value greater than zero for [`CUgraphConditionalNodeType::CU_GRAPH_COND_TYPE_SWITCH`].
3453    pub size: ::core::ffi::c_uint,
3454    /// CUDA-owned array populated with conditional node child graphs during creation of the node.
3455    ///
3456    /// Valid for the lifetime of the conditional node. The contents of the graph(s) are subject to the following constraints:
3457    ///
3458    /// * Allowed node types are kernel nodes, empty nodes, child graphs, memsets, memcopies, and conditionals. This applies recursively to child graphs and conditional bodies.
3459    /// * All kernels, including kernels in nested conditionals or child graphs at any level, must belong to the same device context.
3460    ///
3461    /// These graphs may be populated using graph node creation APIs or [`cuStreamBeginCaptureToGraph`].
3462    ///
3463    /// [`CUgraphConditionalNodeType::CU_GRAPH_COND_TYPE_IF`]: phGraph_out\[0\] is executed when the condition is non-zero. If `size` == 2, phGraph_out\[1\] will be executed when the condition is zero. [`CUgraphConditionalNodeType::CU_GRAPH_COND_TYPE_WHILE`]: phGraph_out\[0\] is executed as long as the condition is non-zero. [`CUgraphConditionalNodeType::CU_GRAPH_COND_TYPE_SWITCH`]: phGraph_out\[n\] is executed when the condition is equal to n. If the condition >= `size`, no body graph is executed.
3464    pub phGraph_out: *mut CUgraph,
3465    /// Context on which to run the node.
3466    ///
3467    /// Must match context used to create the handle and all body nodes.
3468    pub ctx: CUcontext,
3469}
3470impl Default for CUDA_CONDITIONAL_NODE_PARAMS {
3471    fn default() -> Self {
3472        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
3473        unsafe {
3474            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
3475            s.assume_init()
3476        }
3477    }
3478}
3479impl CUgraphNodeType_enum {
3480    /// GPU kernel node.
3481    pub const CU_GRAPH_NODE_TYPE_KERNEL: CUgraphNodeType_enum = CUgraphNodeType_enum(0);
3482    /// Memcpy node.
3483    pub const CU_GRAPH_NODE_TYPE_MEMCPY: CUgraphNodeType_enum = CUgraphNodeType_enum(1);
3484    /// Memset node.
3485    pub const CU_GRAPH_NODE_TYPE_MEMSET: CUgraphNodeType_enum = CUgraphNodeType_enum(2);
3486    /// Host (executable) node.
3487    pub const CU_GRAPH_NODE_TYPE_HOST: CUgraphNodeType_enum = CUgraphNodeType_enum(3);
3488    /// Node which executes an embedded graph.
3489    pub const CU_GRAPH_NODE_TYPE_GRAPH: CUgraphNodeType_enum = CUgraphNodeType_enum(4);
3490    /// Empty (no-op) node.
3491    pub const CU_GRAPH_NODE_TYPE_EMPTY: CUgraphNodeType_enum = CUgraphNodeType_enum(5);
3492    /// External event wait node.
3493    pub const CU_GRAPH_NODE_TYPE_WAIT_EVENT: CUgraphNodeType_enum = CUgraphNodeType_enum(
3494        6,
3495    );
3496    /// External event record node.
3497    pub const CU_GRAPH_NODE_TYPE_EVENT_RECORD: CUgraphNodeType_enum = CUgraphNodeType_enum(
3498        7,
3499    );
3500    /// External semaphore signal node.
3501    pub const CU_GRAPH_NODE_TYPE_EXT_SEMAS_SIGNAL: CUgraphNodeType_enum = CUgraphNodeType_enum(
3502        8,
3503    );
3504    /// External semaphore wait node.
3505    pub const CU_GRAPH_NODE_TYPE_EXT_SEMAS_WAIT: CUgraphNodeType_enum = CUgraphNodeType_enum(
3506        9,
3507    );
3508    /// Memory Allocation Node.
3509    pub const CU_GRAPH_NODE_TYPE_MEM_ALLOC: CUgraphNodeType_enum = CUgraphNodeType_enum(
3510        10,
3511    );
3512    /// Memory Free Node.
3513    pub const CU_GRAPH_NODE_TYPE_MEM_FREE: CUgraphNodeType_enum = CUgraphNodeType_enum(
3514        11,
3515    );
3516    /// Batch MemOp Node See cuStreamBatchMemOp and [`CUstreamBatchMemOpType`] for what these nodes can do.
3517    pub const CU_GRAPH_NODE_TYPE_BATCH_MEM_OP: CUgraphNodeType_enum = CUgraphNodeType_enum(
3518        12,
3519    );
3520    /// Conditional Node.
3521    ///
3522    /// ```text
3523    /// May be used to implement a conditional execution path or loop
3524    /// inside of a graph. The graph(s) contained within the body of the conditional node
3525    /// can be selectively executed or iterated upon based on the value of a conditional
3526    /// variable.
3527    ///
3528    /// Handles must be created in advance of creating the node
3529    /// using ::cuGraphConditionalHandleCreate.
3530    ///
3531    /// The following restrictions apply to graphs which contain conditional nodes:
3532    /// The graph cannot be used in a child node.
3533    /// Only one instantiation of the graph may exist at any point in time.
3534    /// The graph cannot be cloned.
3535    ///
3536    /// To set the control value, supply a default value when creating the handle and/or
3537    /// call ::cudaGraphSetConditional from device code.
3538    /// ```
3539    pub const CU_GRAPH_NODE_TYPE_CONDITIONAL: CUgraphNodeType_enum = CUgraphNodeType_enum(
3540        13,
3541    );
3542    /// Reserved.
3543    pub const CU_GRAPH_NODE_TYPE_RESERVED_16: CUgraphNodeType_enum = CUgraphNodeType_enum(
3544        16,
3545    );
3546}
3547/// Graph node types.
3548#[repr(transparent)]
3549#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
3550pub struct CUgraphNodeType_enum(pub ::core::ffi::c_uint);
3551pub use self::CUgraphNodeType_enum as CUgraphNodeType;
3552impl CUgraphDependencyType_enum {
3553    /// This is an ordinary dependency.
3554    pub const CU_GRAPH_DEPENDENCY_TYPE_DEFAULT: CUgraphDependencyType_enum = CUgraphDependencyType_enum(
3555        0,
3556    );
3557    /// This dependency type allows the downstream node to use cudaGridDependencySynchronize().
3558    ///
3559    /// It may only be used between kernel nodes, and must be used with either the [`CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC`] or [`CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER`] outgoing port.
3560    pub const CU_GRAPH_DEPENDENCY_TYPE_PROGRAMMATIC: CUgraphDependencyType_enum = CUgraphDependencyType_enum(
3561        1,
3562    );
3563}
3564/// Type annotations that can be applied to graph edges as part of [`CUgraphEdgeData`].
3565#[repr(transparent)]
3566#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
3567pub struct CUgraphDependencyType_enum(pub ::core::ffi::c_uint);
3568pub use self::CUgraphDependencyType_enum as CUgraphDependencyType;
3569/// Optional annotation for edges in a CUDA graph.
3570///
3571/// Note, all edges implicitly have annotations and default to a zero-initialized value if not specified. A zero-initialized struct indicates a standard full serialization of two nodes with memory visibility.
3572#[repr(C)]
3573#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
3574pub struct CUgraphEdgeData_st {
3575    /// This indicates when the dependency is triggered from the upstream node on the edge.
3576    ///
3577    /// The meaning is specfic to the node type. A value of 0 in all cases means full completion of the upstream node, with memory visibility to the downstream node or portion thereof (indicated by `to_port`
3578    ///
3579    /// ).
3580    ///
3581    /// Only kernel nodes define non-zero ports. A kernel node can use the following output port types:
3582    ///
3583    /// [`CU_GRAPH_KERNEL_NODE_PORT_DEFAULT`] , [`CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC`] , or [`CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER`] .
3584    pub from_port: ::core::ffi::c_uchar,
3585    /// This indicates what portion of the downstream node is dependent on the upstream node or portion thereof (indicated by `from_port`).
3586    ///
3587    /// The meaning is specific to the node type. A value of 0 in all cases means the entirety of the downstream node is dependent on the upstream work.
3588    ///
3589    /// Currently no node types define non-zero ports. Accordingly, this field must be set to zero.
3590    pub to_port: ::core::ffi::c_uchar,
3591    /// This should be populated with a value from [`CUgraphDependencyType`].
3592    ///
3593    /// (It is typed as char due to compiler-specific layout of bitfields.) See [`CUgraphDependencyType`].
3594    pub type_: ::core::ffi::c_uchar,
3595    /// These bytes are unused and must be zeroed.
3596    ///
3597    /// This ensures compatibility if additional fields are added in the future.
3598    pub reserved: [::core::ffi::c_uchar; 5usize],
3599}
3600/// Optional annotation for edges in a CUDA graph.
3601///
3602/// Note, all edges implicitly have annotations and default to a zero-initialized value if not specified. A zero-initialized struct indicates a standard full serialization of two nodes with memory visibility.
3603pub type CUgraphEdgeData = CUgraphEdgeData_st;
3604impl CUgraphInstantiateResult_enum {
3605    /// Instantiation succeeded.
3606    pub const CUDA_GRAPH_INSTANTIATE_SUCCESS: CUgraphInstantiateResult_enum = CUgraphInstantiateResult_enum(
3607        0,
3608    );
3609    /// Instantiation failed for an unexpected reason which is described in the return value of the function.
3610    pub const CUDA_GRAPH_INSTANTIATE_ERROR: CUgraphInstantiateResult_enum = CUgraphInstantiateResult_enum(
3611        1,
3612    );
3613    /// Instantiation failed due to invalid structure, such as cycles.
3614    pub const CUDA_GRAPH_INSTANTIATE_INVALID_STRUCTURE: CUgraphInstantiateResult_enum = CUgraphInstantiateResult_enum(
3615        2,
3616    );
3617    /// Instantiation for device launch failed because the graph contained an unsupported operation.
3618    pub const CUDA_GRAPH_INSTANTIATE_NODE_OPERATION_NOT_SUPPORTED: CUgraphInstantiateResult_enum = CUgraphInstantiateResult_enum(
3619        3,
3620    );
3621    /// Instantiation for device launch failed due to the nodes belonging to different contexts.
3622    pub const CUDA_GRAPH_INSTANTIATE_MULTIPLE_CTXS_NOT_SUPPORTED: CUgraphInstantiateResult_enum = CUgraphInstantiateResult_enum(
3623        4,
3624    );
3625    /// One or more conditional handles are not associated with conditional nodes.
3626    pub const CUDA_GRAPH_INSTANTIATE_CONDITIONAL_HANDLE_UNUSED: CUgraphInstantiateResult_enum = CUgraphInstantiateResult_enum(
3627        5,
3628    );
3629}
3630/// Graph instantiation results.
3631#[repr(transparent)]
3632#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
3633pub struct CUgraphInstantiateResult_enum(pub ::core::ffi::c_uint);
3634pub use self::CUgraphInstantiateResult_enum as CUgraphInstantiateResult;
3635/// Graph instantiation parameters.
3636#[repr(C)]
3637#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
3638pub struct CUDA_GRAPH_INSTANTIATE_PARAMS_st {
3639    /// Instantiation flags.
3640    pub flags: cuuint64_t,
3641    /// Upload stream.
3642    pub hUploadStream: CUstream,
3643    /// The node which caused instantiation to fail, if any.
3644    pub hErrNode_out: CUgraphNode,
3645    /// Whether instantiation was successful.
3646    ///
3647    /// If it failed, the reason why.
3648    pub result_out: CUgraphInstantiateResult,
3649}
3650impl Default for CUDA_GRAPH_INSTANTIATE_PARAMS_st {
3651    fn default() -> Self {
3652        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
3653        unsafe {
3654            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
3655            s.assume_init()
3656        }
3657    }
3658}
3659/// Graph instantiation parameters.
3660pub type CUDA_GRAPH_INSTANTIATE_PARAMS = CUDA_GRAPH_INSTANTIATE_PARAMS_st;
3661impl CUsynchronizationPolicy_enum {
3662    /// Selects the synchronization policy automatically.
3663    pub const CU_SYNC_POLICY_AUTO: CUsynchronizationPolicy_enum = CUsynchronizationPolicy_enum(
3664        1,
3665    );
3666    /// Spins while waiting for completion.
3667    pub const CU_SYNC_POLICY_SPIN: CUsynchronizationPolicy_enum = CUsynchronizationPolicy_enum(
3668        2,
3669    );
3670    /// Yields the waiting thread while waiting for completion.
3671    pub const CU_SYNC_POLICY_YIELD: CUsynchronizationPolicy_enum = CUsynchronizationPolicy_enum(
3672        3,
3673    );
3674    /// Blocks the waiting thread until completion.
3675    pub const CU_SYNC_POLICY_BLOCKING_SYNC: CUsynchronizationPolicy_enum = CUsynchronizationPolicy_enum(
3676        4,
3677    );
3678}
3679/// Policy used when synchronizing CUDA work.
3680#[repr(transparent)]
3681#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
3682pub struct CUsynchronizationPolicy_enum(pub ::core::ffi::c_uint);
3683pub use self::CUsynchronizationPolicy_enum as CUsynchronizationPolicy;
3684impl CUclusterSchedulingPolicy_enum {
3685    /// the default policy.
3686    pub const CU_CLUSTER_SCHEDULING_POLICY_DEFAULT: CUclusterSchedulingPolicy_enum = CUclusterSchedulingPolicy_enum(
3687        0,
3688    );
3689    /// spread the blocks within a cluster to the SMs.
3690    pub const CU_CLUSTER_SCHEDULING_POLICY_SPREAD: CUclusterSchedulingPolicy_enum = CUclusterSchedulingPolicy_enum(
3691        1,
3692    );
3693    /// allow the hardware to load-balance the blocks in a cluster to the SMs.
3694    pub const CU_CLUSTER_SCHEDULING_POLICY_LOAD_BALANCING: CUclusterSchedulingPolicy_enum = CUclusterSchedulingPolicy_enum(
3695        2,
3696    );
3697    /// Spread the blocks within a cluster to the SMs, and prefer placement that prioritizes Distributed Shared Memory locality for Rubin-class GPUs.
3698    ///
3699    /// This is a preference only. The driver may ignore this request when the launch is not eligible, when the device does not support the requested placement behavior, or when other launch constraints take precedence.
3700    ///
3701    /// This policy is intended for clustered kernels whose performance depends on communication through Distributed Shared Memory among blocks in the same cluster.
3702    pub const CU_CLUSTER_SCHEDULING_POLICY_RUBIN_DSMEM_LOCALITY: CUclusterSchedulingPolicy_enum = CUclusterSchedulingPolicy_enum(
3703        3,
3704    );
3705}
3706/// Cluster scheduling policies.
3707///
3708/// These may be passed to [`cuFuncSetAttribute`] or [`cuKernelSetAttribute`].
3709#[repr(transparent)]
3710#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
3711pub struct CUclusterSchedulingPolicy_enum(pub ::core::ffi::c_uint);
3712pub use self::CUclusterSchedulingPolicy_enum as CUclusterSchedulingPolicy;
3713impl CUlaunchMemSyncDomain_enum {
3714    /// Launch kernels in the default domain.
3715    pub const CU_LAUNCH_MEM_SYNC_DOMAIN_DEFAULT: CUlaunchMemSyncDomain_enum = CUlaunchMemSyncDomain_enum(
3716        0,
3717    );
3718    /// Launch kernels in the remote domain.
3719    pub const CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE: CUlaunchMemSyncDomain_enum = CUlaunchMemSyncDomain_enum(
3720        1,
3721    );
3722}
3723/// Memory Synchronization Domain.
3724///
3725/// A kernel can be launched in a specified memory synchronization domain that affects all memory operations issued by that kernel. A memory barrier issued in one domain will only order memory operations in that domain, thus eliminating latency increase from memory barriers ordering unrelated traffic.
3726///
3727/// By default, kernels are launched in domain 0. Kernel launched with [`CUlaunchMemSyncDomain_enum::CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE`] will have a different domain ID. User may also alter the domain ID with [`CUlaunchMemSyncDomainMap`] for a specific stream / graph node / kernel launch. See [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN`], [`cuStreamSetAttribute`], [`cuLaunchKernelEx`], [`cuGraphKernelNodeSetAttribute`].
3728///
3729/// Memory operations done in kernels launched in different domains are considered system-scope distanced. In other words, a GPU scoped memory synchronization is not sufficient for memory order to be observed by kernels in another memory synchronization domain even if they are on the same GPU.
3730#[repr(transparent)]
3731#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
3732pub struct CUlaunchMemSyncDomain_enum(pub ::core::ffi::c_uint);
3733pub use self::CUlaunchMemSyncDomain_enum as CUlaunchMemSyncDomain;
3734/// Memory Synchronization Domain map.
3735///
3736/// See `cudaLaunchMemSyncDomain`.
3737///
3738/// By default, kernels are launched in domain 0. Kernel launched with [`CUlaunchMemSyncDomain_enum::CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE`] will have a different domain ID. User may also alter the domain ID with [`CUlaunchMemSyncDomainMap`] for a specific stream / graph node / kernel launch. See [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP`].
3739///
3740/// Domain ID range is available through [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MEM_SYNC_DOMAIN_COUNT`].
3741#[repr(C)]
3742#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
3743pub struct CUlaunchMemSyncDomainMap_st {
3744    /// The default domain ID to use for designated kernels.
3745    pub default_: ::core::ffi::c_uchar,
3746    /// The remote domain ID to use for designated kernels.
3747    pub remote: ::core::ffi::c_uchar,
3748}
3749/// Memory Synchronization Domain map.
3750///
3751/// See `cudaLaunchMemSyncDomain`.
3752///
3753/// By default, kernels are launched in domain 0. Kernel launched with [`CUlaunchMemSyncDomain_enum::CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE`] will have a different domain ID. User may also alter the domain ID with [`CUlaunchMemSyncDomainMap`] for a specific stream / graph node / kernel launch. See [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP`].
3754///
3755/// Domain ID range is available through [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MEM_SYNC_DOMAIN_COUNT`].
3756pub type CUlaunchMemSyncDomainMap = CUlaunchMemSyncDomainMap_st;
3757impl CUlaunchAttributePortableClusterMode_enum {
3758    /// The default to use for allowing non-portable cluster size on launch - uses current function attribute for [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED`].
3759    pub const CU_LAUNCH_PORTABLE_CLUSTER_MODE_DEFAULT: CUlaunchAttributePortableClusterMode_enum = CUlaunchAttributePortableClusterMode_enum(
3760        0,
3761    );
3762    /// Specifies that the cluster size requested must be a portable size.
3763    pub const CU_LAUNCH_PORTABLE_CLUSTER_MODE_REQUIRE_PORTABLE: CUlaunchAttributePortableClusterMode_enum = CUlaunchAttributePortableClusterMode_enum(
3764        1,
3765    );
3766    /// Specifies that the cluster size requested may be a non-portable size.
3767    pub const CU_LAUNCH_PORTABLE_CLUSTER_MODE_ALLOW_NON_PORTABLE: CUlaunchAttributePortableClusterMode_enum = CUlaunchAttributePortableClusterMode_enum(
3768        2,
3769    );
3770}
3771/// Enum for defining applicability of portable cluster size, used with [`cuLaunchKernelEx`].
3772#[repr(transparent)]
3773#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
3774pub struct CUlaunchAttributePortableClusterMode_enum(pub ::core::ffi::c_uint);
3775pub use self::CUlaunchAttributePortableClusterMode_enum as CUlaunchAttributePortableClusterMode;
3776impl CUsharedMemoryMode_enum {
3777    /// The default to use for shared memory on launch - uses current function attribute for [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES`].
3778    pub const CU_SHARED_MEMORY_MODE_DEFAULT: CUsharedMemoryMode_enum = CUsharedMemoryMode_enum(
3779        0,
3780    );
3781    /// Specifies that the dynamic shared size bytes requested must be a portable size within the bounds of [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK`].
3782    pub const CU_SHARED_MEMORY_MODE_REQUIRE_PORTABLE: CUsharedMemoryMode_enum = CUsharedMemoryMode_enum(
3783        1,
3784    );
3785    /// Specifies that the dynamic shared size bytes requested may be a non-portable size but still within the bounds of [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN`].
3786    pub const CU_SHARED_MEMORY_MODE_ALLOW_NON_PORTABLE: CUsharedMemoryMode_enum = CUsharedMemoryMode_enum(
3787        2,
3788    );
3789    /// Specifies that oversized shared memory configurations may be used (with the limitation of only 8kB L1 cache).
3790    pub const CU_SHARED_MEMORY_MODE_ALLOW_OVERSIZED_SHARED_MEMORY: CUsharedMemoryMode_enum = CUsharedMemoryMode_enum(
3791        3,
3792    );
3793    /// Specifies that oversized shared memory configurations may be used (with the limitation of only 8kB L1 cache), and prefer an oversized shared memory configuration.
3794    pub const CU_SHARED_MEMORY_MODE_PREFER_OVERSIZED_SHARED_MEMORY: CUsharedMemoryMode_enum = CUsharedMemoryMode_enum(
3795        4,
3796    );
3797}
3798/// Shared memory related attributes for use with [`cuLaunchKernelEx`].
3799#[repr(transparent)]
3800#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
3801pub struct CUsharedMemoryMode_enum(pub ::core::ffi::c_uint);
3802pub use self::CUsharedMemoryMode_enum as CUsharedMemoryMode;
3803impl CUlaunchAttributeID_enum {
3804    /// Ignored entry, for convenient composition.
3805    pub const CU_LAUNCH_ATTRIBUTE_IGNORE: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum(
3806        0,
3807    );
3808    /// Valid for streams, graph nodes, launches.
3809    ///
3810    /// See [`CUlaunchAttributeValue::accessPolicyWindow`](CUlaunchAttributeValue_union::accessPolicyWindow).
3811    pub const CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum(
3812        1,
3813    );
3814    /// Valid for graph nodes, launches.
3815    ///
3816    /// See [`CUlaunchAttributeValue::cooperative`](CUlaunchAttributeValue_union::cooperative).
3817    pub const CU_LAUNCH_ATTRIBUTE_COOPERATIVE: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum(
3818        2,
3819    );
3820    /// Valid for streams.
3821    ///
3822    /// See [`CUlaunchAttributeValue::syncPolicy`](CUlaunchAttributeValue_union::syncPolicy).
3823    pub const CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum(
3824        3,
3825    );
3826    /// Valid for graph nodes, launches.
3827    ///
3828    /// See [`CUlaunchAttributeValue::clusterDim`](CUlaunchAttributeValue_union::clusterDim).
3829    pub const CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum(
3830        4,
3831    );
3832    /// Valid for graph nodes, launches.
3833    ///
3834    /// See [`CUlaunchAttributeValue::clusterSchedulingPolicyPreference`](CUlaunchAttributeValue_union::clusterSchedulingPolicyPreference).
3835    pub const CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum(
3836        5,
3837    );
3838    /// Valid for launches.
3839    ///
3840    /// Setting [`CUlaunchAttributeValue::programmaticStreamSerializationAllowed`](CUlaunchAttributeValue_union::programmaticStreamSerializationAllowed) to non-0 signals that the kernel will use programmatic means to resolve its stream dependency, so that the CUDA runtime should opportunistically allow the grid’s execution to overlap with the previous kernel in the stream, if that kernel requests the overlap. The dependent launches can choose to wait on the dependency using the programmatic sync (cudaGridDependencySynchronize() or equivalent PTX instructions).
3841    pub const CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum(
3842        6,
3843    );
3844    /// Valid for launches.
3845    ///
3846    /// Set [`CUlaunchAttributeValue::programmaticEvent`](CUlaunchAttributeValue_union::programmaticEvent) to record the event. Event recorded through this launch attribute is guaranteed to only trigger after all block in the associated kernel trigger the event. A block can trigger the event through PTX launchdep.release or CUDA builtin function cudaTriggerProgrammaticLaunchCompletion(). A trigger can also be inserted at the beginning of each block’s execution if triggerAtBlockStart is set to non-0. The dependent launches can choose to wait on the dependency using the programmatic sync (cudaGridDependencySynchronize() or equivalent PTX instructions). Note that dependents (including the CPU thread calling [`cuEventSynchronize`]) are not guaranteed to observe the release precisely when it is released. For example, [`cuEventSynchronize`]
3847    ///
3848    /// may only observe the event trigger long after the associated kernel has completed. This recording type is primarily meant for establishing programmatic dependency between device tasks. Note also this type of dependency allows, but does not guarantee, concurrent execution of tasks.
3849    ///
3850    /// The event supplied must not be an interprocess or interop event. The event must disable timing (i.e. must be created with the
3851    ///
3852    /// CU_EVENT_DISABLE_TIMING flag set).
3853    pub const CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum(
3854        7,
3855    );
3856    /// Valid for streams, graph nodes, launches.
3857    ///
3858    /// See [`CUlaunchAttributeValue::priority`](CUlaunchAttributeValue_union::priority).
3859    pub const CU_LAUNCH_ATTRIBUTE_PRIORITY: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum(
3860        8,
3861    );
3862    /// Valid for streams, graph nodes, launches.
3863    ///
3864    /// See [`CUlaunchAttributeValue::memSyncDomainMap`](CUlaunchAttributeValue_union::memSyncDomainMap).
3865    pub const CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum(
3866        9,
3867    );
3868    /// Valid for streams, graph nodes, launches.
3869    ///
3870    /// See [`CUlaunchAttributeValue::memSyncDomain`](CUlaunchAttributeValue_union::memSyncDomain).
3871    pub const CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum(
3872        10,
3873    );
3874    /// Valid for graph nodes, launches.
3875    ///
3876    /// Set [`CUlaunchAttributeValue::preferredClusterDim`](CUlaunchAttributeValue_union::preferredClusterDim) to allow the kernel launch to specify a preferred substitute cluster dimension. Blocks may be grouped according to either the dimensions specified with this attribute (grouped into a “preferred substitute cluster”), or the one specified with [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION`]
3877    ///
3878    /// attribute (grouped into a “regular cluster”). The cluster dimensions of a “preferred substitute cluster” shall be an integer multiple greater than zero of the regular cluster dimensions. The device will attempt - on a best-effort basis - to group thread blocks into preferred clusters over grouping them into regular clusters. When it deems necessary (primarily when the device temporarily runs out of physical resources to launch the larger preferred clusters), the device may switch to launch the regular clusters instead to attempt to utilize as much of the physical device resources as possible.
3879    ///
3880    /// Each type of cluster will have its enumeration / coordinate setup as if the grid consists solely of its type of cluster. For example, if the preferred substitute cluster dimensions double the regular cluster dimensions, there might be simultaneously a regular cluster indexed at (1,0,0), and a preferred cluster indexed at (1,0,0). In this example, the preferred substitute cluster (1,0,0) replaces regular clusters (2,0,0) and (3,0,0) and groups their blocks.
3881    ///
3882    /// This attribute will only take effect when a regular cluster dimension has been specified. The preferred substitute cluster dimension must be an integer multiple greater than zero of the regular cluster dimension and must divide the grid. It must also be no more than `maxBlocksPerCluster` , if it is set in the kernel’s `__launch_bounds__` . Otherwise it must be less than the maximum value the driver can support. Otherwise, setting this attribute to a value physically unable to fit on any particular device is permitted.
3883    pub const CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum(
3884        11,
3885    );
3886    /// Valid for launches.
3887    ///
3888    /// Set [`CUlaunchAttributeValue::launchCompletionEvent`](CUlaunchAttributeValue_union::launchCompletionEvent)
3889    ///
3890    /// to record the event.
3891    ///
3892    /// Nominally, the event is triggered once all blocks of the kernel have begun execution. Currently this is a best effort. If a kernel B has a launch completion dependency on a kernel A, B may wait until A is complete. Alternatively, blocks of B may begin before all blocks of A have begun, for example if B can claim execution resources unavailable to A (e.g. they run on different GPUs) or if B is a higher priority than A. Exercise caution if such an ordering inversion could lead to deadlock.
3893    ///
3894    /// A launch completion event is nominally similar to a programmatic event with `triggerAtBlockStart`
3895    ///
3896    /// set except that it is not visible to cudaGridDependencySynchronize() and can be used with compute capability less than 9.0.
3897    ///
3898    /// The event supplied must not be an interprocess or interop event. The event must disable timing (i.e. must be created with the
3899    ///
3900    /// CU_EVENT_DISABLE_TIMING flag set).
3901    pub const CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum(
3902        12,
3903    );
3904    /// Valid for graph nodes, launches.
3905    ///
3906    /// This attribute is graphs-only, and passing it to a launch in a non-capturing stream will result in an error.
3907    ///
3908    /// `CUlaunchAttributeValue::deviceUpdatableKernelNode::deviceUpdatable` can only be set to 0 or 1. Setting the field to 1 indicates that the corresponding kernel node should be device-updatable. On success, a handle will be returned via `CUlaunchAttributeValue::deviceUpdatableKernelNode::devNode` which can be passed to the various device-side update functions to update the node’s kernel parameters from within another kernel. For more information on the types of device updates that can be made, as well as the relevant limitations thereof, see `cudaGraphKernelNodeUpdatesApply`.
3909    ///
3910    /// Nodes which are device-updatable have additional restrictions compared to regular kernel nodes. Firstly, device-updatable nodes cannot be removed from their graph via [`cuGraphDestroyNode`] . Additionally, once opted-in to this functionality, a node cannot opt out, and any attempt to set the deviceUpdatable attribute to 0 will result in an error. Device-updatable kernel nodes also cannot have their attributes copied to/from another kernel node via [`cuGraphKernelNodeCopyAttributes`]
3911    ///
3912    /// . Graphs containing one or more device-updatable nodes also do not allow multiple instantiation, and neither the graph nor its instantiated version can be passed to cuGraphExecUpdate.
3913    ///
3914    /// If a graph contains device-updatable nodes and updates those nodes from the device from within the graph, the graph must be uploaded with
3915    ///
3916    /// [`cuGraphUpload`] before it is launched. For such a graph, if host-side executable graph updates are made to the device-updatable nodes, the graph must be uploaded before it is launched again.
3917    pub const CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum(
3918        13,
3919    );
3920    /// Valid for launches.
3921    ///
3922    /// On devices where the L1 cache and shared memory use the same hardware resources, setting [`CUlaunchAttributeValue::sharedMemCarveout`](CUlaunchAttributeValue_union::sharedMemCarveout) to a percentage between 0-100 signals the CUDA driver to set the shared memory carveout preference, in percent of the total shared memory for that kernel launch. This attribute takes precedence over [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT`]. This is only a hint, and the CUDA driver can choose a different configuration if required for the launch.
3923    pub const CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum(
3924        14,
3925    );
3926    /// Valid for streams, graph nodes, launches.
3927    ///
3928    /// This attribute is a hint to the CUDA runtime that the launch should attempt to make the kernel maximize its NVLINK utilization.
3929    ///
3930    /// When possible to honor this hint, CUDA will assume each block in the grid launch will carry out an even amount of NVLINK traffic, and make a best-effort attempt to adjust the kernel launch based on that assumption.
3931    ///
3932    /// This attribute is a hint only. CUDA makes no functional or performance guarantee. Its applicability can be affected by many different factors, including driver version (i.e. CUDA doesn’t guarantee the performance characteristics will be maintained between driver versions or a driver update could alter or regress previously observed perf characteristics.) It also doesn’t guarantee a successful result, i.e. applying the attribute may not improve the performance of either the targeted kernel or the encapsulating application.
3933    ///
3934    /// Valid values for CUlaunchAttributeValue::nvlinkUtilCentricScheduling are 0 (disabled) and 1 (enabled).
3935    pub const CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum(
3936        16,
3937    );
3938    /// Valid for graph nodes, launches.
3939    ///
3940    /// This controls whether the kernel launch is allowed to use a non-portable cluster size. Valid values for [`CUlaunchAttributeValue::portableClusterSizeMode`](CUlaunchAttributeValue_union::portableClusterSizeMode) are described in [`CUlaunchAttributePortableClusterMode`]. Any other value will return [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`].
3941    pub const CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum(
3942        17,
3943    );
3944    /// Valid for graph nodes, launches.
3945    ///
3946    /// This controls a kernel’s use of non-portable or oversized shared memory configurations.
3947    pub const CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE: CUlaunchAttributeID_enum = CUlaunchAttributeID_enum(
3948        18,
3949    );
3950}
3951/// Launch attributes enum; used as id field of [`CUlaunchAttribute`].
3952#[repr(transparent)]
3953#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
3954pub struct CUlaunchAttributeID_enum(pub ::core::ffi::c_uint);
3955pub use self::CUlaunchAttributeID_enum as CUlaunchAttributeID;
3956/// Launch attributes union; used as value field of [`CUlaunchAttribute`].
3957#[repr(C)]
3958#[derive(Copy, Clone)]
3959pub union CUlaunchAttributeValue_union {
3960    /// Pad to 64 bytes
3961    pub pad: [::core::ffi::c_char; 64usize],
3962    /// Value of launch attribute [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW`].
3963    pub accessPolicyWindow: CUaccessPolicyWindow,
3964    /// Value of launch attribute [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_COOPERATIVE`].
3965    ///
3966    /// Nonzero indicates a cooperative kernel (see [`cuLaunchCooperativeKernel`]).
3967    pub cooperative: ::core::ffi::c_int,
3968    /// Value of launch attribute [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY`].
3969    ///
3970    /// CUsynchronizationPolicy for work queued up in this stream.
3971    pub syncPolicy: CUsynchronizationPolicy,
3972    /// Value of launch attribute [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION`] that represents the desired cluster dimensions for the kernel.
3973    ///
3974    /// Opaque type with the following fields:
3975    ///
3976    /// * `x` - The X dimension of the cluster, in blocks. Must be a divisor of the grid X dimension.
3977    /// * `y` - The Y dimension of the cluster, in blocks. Must be a divisor of the grid Y dimension.
3978    /// * `z` - The Z dimension of the cluster, in blocks. Must be a divisor of the grid Z dimension.
3979    pub clusterDim: CUlaunchAttributeValue_union__bindgen_ty_1,
3980    /// Value of launch attribute [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE`].
3981    ///
3982    /// Cluster scheduling policy preference for the kernel.
3983    pub clusterSchedulingPolicyPreference: CUclusterSchedulingPolicy,
3984    /// Value of launch attribute [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION`].
3985    pub programmaticStreamSerializationAllowed: ::core::ffi::c_int,
3986    /// Value of launch attribute [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT`] with the following fields:
3987    ///
3988    /// * [`CUevent`] event - Event to fire when all blocks trigger it.
3989    /// * `Event` record flags, see [`cuEventRecordWithFlags`]. Does not accept :CU_EVENT_RECORD_EXTERNAL.
3990    /// * `triggerAtBlockStart` - If this is set to non-0, each block launch will automatically trigger the event.
3991    pub programmaticEvent: CUlaunchAttributeValue_union__bindgen_ty_2,
3992    /// Value of launch attribute [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT`] with the following fields:
3993    ///
3994    /// * [`CUevent`] event - Event to fire when the last block launches
3995    /// * `int` flags; - Event record flags, see [`cuEventRecordWithFlags`]. Does not accept [`CUevent_record_flags_enum::CU_EVENT_RECORD_EXTERNAL`].
3996    pub launchCompletionEvent: CUlaunchAttributeValue_union__bindgen_ty_3,
3997    /// Value of launch attribute [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_PRIORITY`].
3998    ///
3999    /// Execution priority of the kernel.
4000    pub priority: ::core::ffi::c_int,
4001    /// Value of launch attribute [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP`].
4002    ///
4003    /// See [`CUlaunchMemSyncDomainMap`].
4004    pub memSyncDomainMap: CUlaunchMemSyncDomainMap,
4005    /// Value of launch attribute [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN`].
4006    ///
4007    /// See::CUlaunchMemSyncDomain.
4008    pub memSyncDomain: CUlaunchMemSyncDomain,
4009    /// Value of launch attribute [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION`] that represents the desired preferred cluster dimensions for the kernel.
4010    ///
4011    /// Opaque type with the following fields:
4012    ///
4013    /// * `x` - The X dimension of the preferred cluster, in blocks. Must be a divisor of the grid X dimension, and must be a multiple of the `x` field of [`CUlaunchAttributeValue::clusterDim`](CUlaunchAttributeValue_union::clusterDim).
4014    /// * `y` - The Y dimension of the preferred cluster, in blocks. Must be a divisor of the grid Y dimension, and must be a multiple of the `y` field of [`CUlaunchAttributeValue::clusterDim`](CUlaunchAttributeValue_union::clusterDim).
4015    /// * `z` - The Z dimension of the preferred cluster, in blocks. Must be equal to the `z` field of [`CUlaunchAttributeValue::clusterDim`](CUlaunchAttributeValue_union::clusterDim).
4016    pub preferredClusterDim: CUlaunchAttributeValue_union__bindgen_ty_4,
4017    /// Value of launch attribute [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE`].
4018    ///
4019    /// with the following fields:
4020    ///
4021    /// * `int` deviceUpdatable - Whether or not the resulting kernel node should be device-updatable.
4022    /// * [`CUgraphDeviceNode`] devNode - Returns a handle to pass to the various device-side update functions.
4023    pub deviceUpdatableKernelNode: CUlaunchAttributeValue_union__bindgen_ty_5,
4024    /// Value of launch attribute [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT`].
4025    pub sharedMemCarveout: ::core::ffi::c_uint,
4026    /// Enables NVLink-utilization-centric scheduling when 1; 0 disables it.
4027    pub nvlinkUtilCentricScheduling: ::core::ffi::c_uint,
4028    /// Value of launch attribute [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE`].
4029    pub portableClusterSizeMode: CUlaunchAttributePortableClusterMode,
4030    /// Value of launch attribute [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE`].
4031    ///
4032    /// See [`CUsharedMemoryMode`] for acceptable values.
4033    pub sharedMemoryMode: CUsharedMemoryMode,
4034}
4035/// Value of launch attribute [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION`] that represents the desired cluster dimensions for the kernel. Opaque type with the following fields:
4036/// - `x` - The X dimension of the cluster, in blocks. Must be a divisor of the grid X dimension.
4037/// - `y` - The Y dimension of the cluster, in blocks. Must be a divisor of the grid Y dimension.
4038/// - `z` - The Z dimension of the cluster, in blocks. Must be a divisor of the grid Z dimension.
4039#[repr(C)]
4040#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
4041pub struct CUlaunchAttributeValue_union__bindgen_ty_1 {
4042    /// The X dimension of the cluster, in blocks. Must be a divisor of the grid X dimension.
4043    pub x: ::core::ffi::c_uint,
4044    /// The Y dimension of the cluster, in blocks. Must be a divisor of the grid Y dimension.
4045    pub y: ::core::ffi::c_uint,
4046    /// The Z dimension of the cluster, in blocks. Must be a divisor of the grid Z dimension.
4047    pub z: ::core::ffi::c_uint,
4048}
4049/// Value of launch attribute [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT`] with the following fields:
4050/// - [`CUevent`] event - Event to fire when all blocks trigger it.
4051/// - `Event` record flags, see [`cuEventRecordWithFlags`]. Does not accept :CU_EVENT_RECORD_EXTERNAL.
4052/// - `triggerAtBlockStart` - If this is set to non-0, each block launch will automatically trigger the event.
4053#[repr(C)]
4054#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
4055pub struct CUlaunchAttributeValue_union__bindgen_ty_2 {
4056    /// Event to fire when all blocks trigger it.
4057    pub event: CUevent,
4058    /// `triggerAtBlockStart` - If this is set to non-0, each block launch will automatically trigger the event.
4059    pub flags: ::core::ffi::c_int,
4060    /// Nonzero causes each block launch to trigger the programmatic event automatically.
4061    pub triggerAtBlockStart: ::core::ffi::c_int,
4062}
4063impl Default for CUlaunchAttributeValue_union__bindgen_ty_2 {
4064    fn default() -> Self {
4065        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
4066        unsafe {
4067            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
4068            s.assume_init()
4069        }
4070    }
4071}
4072/// Value of launch attribute [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT`] with the following fields:
4073/// - [`CUevent`] event - Event to fire when the last block launches
4074/// - `int` flags; - Event record flags, see [`cuEventRecordWithFlags`]. Does not accept [`CUevent_record_flags_enum::CU_EVENT_RECORD_EXTERNAL`].
4075#[repr(C)]
4076#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
4077pub struct CUlaunchAttributeValue_union__bindgen_ty_3 {
4078    /// Event to fire when the last block launches
4079    pub event: CUevent,
4080    /// Event record flags, see [`cuEventRecordWithFlags`]. Does not accept [`CUevent_record_flags_enum::CU_EVENT_RECORD_EXTERNAL`].
4081    pub flags: ::core::ffi::c_int,
4082}
4083impl Default for CUlaunchAttributeValue_union__bindgen_ty_3 {
4084    fn default() -> Self {
4085        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
4086        unsafe {
4087            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
4088            s.assume_init()
4089        }
4090    }
4091}
4092/// Value of launch attribute [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION`] that represents the desired preferred cluster dimensions for the kernel. Opaque type with the following fields:
4093/// - `x` - The X dimension of the preferred cluster, in blocks. Must be a divisor of the grid X dimension, and must be a multiple of the `x` field of `CUlaunchAttributeValue::clusterDim`(CUlaunchAttributeValue_union::clusterDim).
4094/// - `y` - The Y dimension of the preferred cluster, in blocks. Must be a divisor of the grid Y dimension, and must be a multiple of the `y` field of `CUlaunchAttributeValue::clusterDim`(CUlaunchAttributeValue_union::clusterDim).
4095/// - `z` - The Z dimension of the preferred cluster, in blocks. Must be equal to the `z` field of `CUlaunchAttributeValue::clusterDim`(CUlaunchAttributeValue_union::clusterDim).
4096#[repr(C)]
4097#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
4098pub struct CUlaunchAttributeValue_union__bindgen_ty_4 {
4099    /// The X dimension of the preferred cluster, in blocks. Must be a divisor of the grid X dimension, and must be a multiple of the `x` field of `CUlaunchAttributeValue::clusterDim`(CUlaunchAttributeValue_union::clusterDim).
4100    pub x: ::core::ffi::c_uint,
4101    /// The Y dimension of the preferred cluster, in blocks. Must be a divisor of the grid Y dimension, and must be a multiple of the `y` field of `CUlaunchAttributeValue::clusterDim`(CUlaunchAttributeValue_union::clusterDim).
4102    pub y: ::core::ffi::c_uint,
4103    /// The Z dimension of the preferred cluster, in blocks. Must be equal to the `z` field of `CUlaunchAttributeValue::clusterDim`(CUlaunchAttributeValue_union::clusterDim).
4104    pub z: ::core::ffi::c_uint,
4105}
4106/// Value of launch attribute [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE`]. with the following fields:
4107/// - `int` deviceUpdatable - Whether or not the resulting kernel node should be device-updatable.
4108/// - [`CUgraphDeviceNode`] devNode - Returns a handle to pass to the various device-side update functions.
4109#[repr(C)]
4110#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
4111pub struct CUlaunchAttributeValue_union__bindgen_ty_5 {
4112    /// Whether or not the resulting kernel node should be device-updatable.
4113    pub deviceUpdatable: ::core::ffi::c_int,
4114    /// Returns a handle to pass to the various device-side update functions.
4115    pub devNode: CUgraphDeviceNode,
4116}
4117impl Default for CUlaunchAttributeValue_union__bindgen_ty_5 {
4118    fn default() -> Self {
4119        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
4120        unsafe {
4121            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
4122            s.assume_init()
4123        }
4124    }
4125}
4126impl Default for CUlaunchAttributeValue_union {
4127    fn default() -> Self {
4128        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
4129        unsafe {
4130            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
4131            s.assume_init()
4132        }
4133    }
4134}
4135/// Launch attributes union; used as value field of [`CUlaunchAttribute`].
4136pub type CUlaunchAttributeValue = CUlaunchAttributeValue_union;
4137/// Launch attribute.
4138#[repr(C)]
4139#[derive(Copy, Clone)]
4140pub struct CUlaunchAttribute_st {
4141    /// Attribute to set.
4142    pub id: CUlaunchAttributeID,
4143    /// Padding that preserves the native alignment of the launch-attribute value.
4144    pub pad: [::core::ffi::c_char; 4usize],
4145    /// Value of the attribute.
4146    pub value: CUlaunchAttributeValue,
4147}
4148impl Default for CUlaunchAttribute_st {
4149    fn default() -> Self {
4150        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
4151        unsafe {
4152            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
4153            s.assume_init()
4154        }
4155    }
4156}
4157/// Launch attribute.
4158pub type CUlaunchAttribute = CUlaunchAttribute_st;
4159/// CUDA extensible launch configuration.
4160#[repr(C)]
4161#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
4162pub struct CUlaunchConfig_st {
4163    /// Width of grid in blocks.
4164    pub gridDimX: ::core::ffi::c_uint,
4165    /// Height of grid in blocks.
4166    pub gridDimY: ::core::ffi::c_uint,
4167    /// Depth of grid in blocks.
4168    pub gridDimZ: ::core::ffi::c_uint,
4169    /// X dimension of each thread block.
4170    pub blockDimX: ::core::ffi::c_uint,
4171    /// Y dimension of each thread block.
4172    pub blockDimY: ::core::ffi::c_uint,
4173    /// Z dimension of each thread block.
4174    pub blockDimZ: ::core::ffi::c_uint,
4175    /// Dynamic shared-memory size per thread block in bytes.
4176    pub sharedMemBytes: ::core::ffi::c_uint,
4177    /// Stream identifier.
4178    pub hStream: CUstream,
4179    /// List of attributes; nullable if [`CUlaunchConfig::numAttrs`](CUlaunchConfig_st::numAttrs) == 0.
4180    pub attrs: *mut CUlaunchAttribute,
4181    /// Number of attributes populated in [`CUlaunchConfig::attrs`](CUlaunchConfig_st::attrs).
4182    pub numAttrs: ::core::ffi::c_uint,
4183}
4184impl Default for CUlaunchConfig_st {
4185    fn default() -> Self {
4186        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
4187        unsafe {
4188            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
4189            s.assume_init()
4190        }
4191    }
4192}
4193/// CUDA extensible launch configuration.
4194pub type CUlaunchConfig = CUlaunchConfig_st;
4195pub use self::CUlaunchAttributeID as CUkernelNodeAttrID;
4196/// Launch attributes union; used as value field of [`CUlaunchAttribute`]
4197pub type CUkernelNodeAttrValue_v1 = CUlaunchAttributeValue;
4198/// Launch attributes union; used as value field of [`CUlaunchAttribute`]
4199pub type CUkernelNodeAttrValue = CUkernelNodeAttrValue_v1;
4200impl CUstreamCaptureStatus_enum {
4201    /// Stream is not capturing.
4202    pub const CU_STREAM_CAPTURE_STATUS_NONE: CUstreamCaptureStatus_enum = CUstreamCaptureStatus_enum(
4203        0,
4204    );
4205    /// Stream is actively capturing.
4206    pub const CU_STREAM_CAPTURE_STATUS_ACTIVE: CUstreamCaptureStatus_enum = CUstreamCaptureStatus_enum(
4207        1,
4208    );
4209    /// Stream is part of a capture sequence that has been invalidated, but not terminated.
4210    pub const CU_STREAM_CAPTURE_STATUS_INVALIDATED: CUstreamCaptureStatus_enum = CUstreamCaptureStatus_enum(
4211        2,
4212    );
4213}
4214/// Possible stream capture statuses returned by [`cuStreamIsCapturing`].
4215#[repr(transparent)]
4216#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
4217pub struct CUstreamCaptureStatus_enum(pub ::core::ffi::c_uint);
4218pub use self::CUstreamCaptureStatus_enum as CUstreamCaptureStatus;
4219impl CUstreamCaptureMode_enum {
4220    /// This is the default mode. If the local thread has an ongoing capture sequence that was not initiated with [`CUstreamCaptureMode_enum::CU_STREAM_CAPTURE_MODE_RELAXED`] at [`cuStreamBeginCapture`], or if any other thread has a concurrent capture sequence initiated with [`CUstreamCaptureMode_enum::CU_STREAM_CAPTURE_MODE_GLOBAL`], this thread is prohibited from potentially unsafe API calls.
4221    pub const CU_STREAM_CAPTURE_MODE_GLOBAL: CUstreamCaptureMode_enum = CUstreamCaptureMode_enum(
4222        0,
4223    );
4224    /// If the local thread has an ongoing capture sequence not initiated with [`CUstreamCaptureMode_enum::CU_STREAM_CAPTURE_MODE_RELAXED`], it is prohibited from potentially unsafe API calls. Concurrent capture sequences in other threads are ignored.
4225    pub const CU_STREAM_CAPTURE_MODE_THREAD_LOCAL: CUstreamCaptureMode_enum = CUstreamCaptureMode_enum(
4226        1,
4227    );
4228    /// The local thread is not prohibited from potentially unsafe API calls. Note that the thread is still prohibited from API calls which necessarily conflict with stream capture, for example, attempting [`cuEventQuery`] on an event that was last recorded inside a capture sequence.
4229    pub const CU_STREAM_CAPTURE_MODE_RELAXED: CUstreamCaptureMode_enum = CUstreamCaptureMode_enum(
4230        2,
4231    );
4232}
4233/// Possible modes for stream capture thread interactions.
4234///
4235/// For more details see cuStreamBeginCapture and [`cuThreadExchangeStreamCaptureMode`].
4236#[repr(transparent)]
4237#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
4238pub struct CUstreamCaptureMode_enum(pub ::core::ffi::c_uint);
4239pub use self::CUlaunchAttributeID as CUstreamAttrID;
4240pub use self::CUstreamCaptureMode_enum as CUstreamCaptureMode;
4241/// Launch attributes union; used as value field of [`CUlaunchAttribute`]
4242pub type CUstreamAttrValue_v1 = CUlaunchAttributeValue;
4243/// Launch attributes union; used as value field of [`CUlaunchAttribute`]
4244pub type CUstreamAttrValue = CUstreamAttrValue_v1;
4245impl CUdriverProcAddress_flags_enum {
4246    /// Default search mode for driver symbols.
4247    pub const CU_GET_PROC_ADDRESS_DEFAULT: CUdriverProcAddress_flags_enum = CUdriverProcAddress_flags_enum(
4248        0,
4249    );
4250    /// Search for legacy versions of driver symbols.
4251    pub const CU_GET_PROC_ADDRESS_LEGACY_STREAM: CUdriverProcAddress_flags_enum = CUdriverProcAddress_flags_enum(
4252        1,
4253    );
4254    /// Search for per-thread versions of driver symbols.
4255    pub const CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM: CUdriverProcAddress_flags_enum = CUdriverProcAddress_flags_enum(
4256        2,
4257    );
4258}
4259/// Flags to specify search options.
4260///
4261/// For more details see cuGetProcAddress.
4262#[repr(transparent)]
4263#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
4264pub struct CUdriverProcAddress_flags_enum(pub ::core::ffi::c_uint);
4265pub use self::CUdriverProcAddress_flags_enum as CUdriverProcAddress_flags;
4266impl CUdriverProcAddressQueryResult_enum {
4267    /// Symbol was succesfully found.
4268    pub const CU_GET_PROC_ADDRESS_SUCCESS: CUdriverProcAddressQueryResult_enum = CUdriverProcAddressQueryResult_enum(
4269        0,
4270    );
4271    /// Symbol was not found in search.
4272    pub const CU_GET_PROC_ADDRESS_SYMBOL_NOT_FOUND: CUdriverProcAddressQueryResult_enum = CUdriverProcAddressQueryResult_enum(
4273        1,
4274    );
4275    /// Symbol was found but version supplied was not sufficient.
4276    pub const CU_GET_PROC_ADDRESS_VERSION_NOT_SUFFICIENT: CUdriverProcAddressQueryResult_enum = CUdriverProcAddressQueryResult_enum(
4277        2,
4278    );
4279}
4280/// Flags to indicate search status.
4281///
4282/// For more details see cuGetProcAddress.
4283#[repr(transparent)]
4284#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
4285pub struct CUdriverProcAddressQueryResult_enum(pub ::core::ffi::c_uint);
4286pub use self::CUdriverProcAddressQueryResult_enum as CUdriverProcAddressQueryResult;
4287impl CUexecAffinityType_enum {
4288    /// Create a context with limited SMs.
4289    pub const CU_EXEC_AFFINITY_TYPE_SM_COUNT: CUexecAffinityType_enum = CUexecAffinityType_enum(
4290        0,
4291    );
4292    /// Reserved upper-bound sentinel for native execution-affinity parameter kinds.
4293    pub const CU_EXEC_AFFINITY_TYPE_MAX: CUexecAffinityType_enum = CUexecAffinityType_enum(
4294        1,
4295    );
4296}
4297/// Execution Affinity Types.
4298#[repr(transparent)]
4299#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
4300pub struct CUexecAffinityType_enum(pub ::core::ffi::c_uint);
4301pub use self::CUexecAffinityType_enum as CUexecAffinityType;
4302/// Value for [`CUexecAffinityType_enum::CU_EXEC_AFFINITY_TYPE_SM_COUNT`].
4303#[repr(C)]
4304#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
4305pub struct CUexecAffinitySmCount_st {
4306    /// The number of SMs the context is limited to use.
4307    pub val: ::core::ffi::c_uint,
4308}
4309/// Value for [`CUexecAffinityType_enum::CU_EXEC_AFFINITY_TYPE_SM_COUNT`].
4310pub type CUexecAffinitySmCount_v1 = CUexecAffinitySmCount_st;
4311/// Value for [`CUexecAffinityType_enum::CU_EXEC_AFFINITY_TYPE_SM_COUNT`]
4312pub type CUexecAffinitySmCount = CUexecAffinitySmCount_v1;
4313/// Execution Affinity Parameters.
4314#[repr(C)]
4315#[derive(Copy, Clone)]
4316pub struct CUexecAffinityParam_st {
4317    /// Type of execution affinity.
4318    pub type_: CUexecAffinityType,
4319    /// Execution-affinity value interpreted according to `type`.
4320    pub param: CUexecAffinityParam_st__bindgen_ty_1,
4321}
4322/// Native layout of the `param` member of [`CUexecAffinityParam_st`].
4323#[repr(C)]
4324#[derive(Copy, Clone)]
4325pub union CUexecAffinityParam_st__bindgen_ty_1 {
4326    /// Value for [`CUexecAffinityType_enum::CU_EXEC_AFFINITY_TYPE_SM_COUNT`]
4327    pub smCount: CUexecAffinitySmCount,
4328}
4329impl Default for CUexecAffinityParam_st__bindgen_ty_1 {
4330    fn default() -> Self {
4331        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
4332        unsafe {
4333            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
4334            s.assume_init()
4335        }
4336    }
4337}
4338impl Default for CUexecAffinityParam_st {
4339    fn default() -> Self {
4340        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
4341        unsafe {
4342            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
4343            s.assume_init()
4344        }
4345    }
4346}
4347/// Execution Affinity Parameters.
4348pub type CUexecAffinityParam_v1 = CUexecAffinityParam_st;
4349/// Execution Affinity Parameters.
4350pub type CUexecAffinityParam = CUexecAffinityParam_v1;
4351impl CUcigDataType_enum {
4352    /// D3D12 Command Queue Handle.
4353    pub const CIG_DATA_TYPE_D3D12_COMMAND_QUEUE: CUcigDataType_enum = CUcigDataType_enum(
4354        1,
4355    );
4356    /// Nvidia specific data blob used for Vulkan and other NV clients.
4357    pub const CIG_DATA_TYPE_NV_BLOB: CUcigDataType_enum = CUcigDataType_enum(2);
4358}
4359/// Graphics-client handle representation supplied when creating a CUDA-in-Graphics context.
4360#[repr(transparent)]
4361#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
4362pub struct CUcigDataType_enum(pub ::core::ffi::c_uint);
4363pub use self::CUcigDataType_enum as CUcigDataType;
4364/// CIG Context Create Params.
4365#[repr(C)]
4366#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
4367pub struct CUctxCigParam_st {
4368    /// Type of shared data from graphics client (D3D12 or Vulkan).
4369    pub sharedDataType: CUcigDataType,
4370    /// Graphics client data handle (ID3D12CommandQueue or Nvidia specific data blob).
4371    pub sharedData: *mut ::core::ffi::c_void,
4372}
4373impl Default for CUctxCigParam_st {
4374    fn default() -> Self {
4375        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
4376        unsafe {
4377            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
4378            s.assume_init()
4379        }
4380    }
4381}
4382/// CIG Context Create Params.
4383pub type CUctxCigParam = CUctxCigParam_st;
4384/// Params for creating CUDA context.
4385///
4386/// Both execAffinityParams and cigParams cannot be non-NULL at the same time. If both are NULL, the context will be created as a regular CUDA context.
4387#[repr(C)]
4388#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
4389pub struct CUctxCreateParams_st {
4390    /// Array of execution affinity parameters to limit context resources (e.g., SM count).
4391    ///
4392    /// Only supported Volta+ MPS. Mutually exclusive with cigParams.
4393    pub execAffinityParams: *mut CUexecAffinityParam,
4394    /// Number of elements in execAffinityParams array.
4395    ///
4396    /// Must be 0 if execAffinityParams is NULL.
4397    pub numExecAffinityParams: ::core::ffi::c_int,
4398    /// CIG (CUDA in Graphics) parameters for sharing data from D3D12/Vulkan graphics clients.
4399    ///
4400    /// Mutually exclusive with execAffinityParams.
4401    pub cigParams: *mut CUctxCigParam,
4402}
4403impl Default for CUctxCreateParams_st {
4404    fn default() -> Self {
4405        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
4406        unsafe {
4407            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
4408            s.assume_init()
4409        }
4410    }
4411}
4412/// Params for creating CUDA context.
4413///
4414/// Both execAffinityParams and cigParams cannot be non-NULL at the same time. If both are NULL, the context will be created as a regular CUDA context.
4415pub type CUctxCreateParams = CUctxCreateParams_st;
4416impl CUstreamCigDataType_enum {
4417    /// D3D12 Command List Handle.
4418    pub const STREAM_CIG_DATA_TYPE_D3D12_COMMAND_LIST: CUstreamCigDataType_enum = CUstreamCigDataType_enum(
4419        1,
4420    );
4421}
4422/// Graphics-client command-list representation supplied for CUDA-in-Graphics stream capture.
4423#[repr(transparent)]
4424#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
4425pub struct CUstreamCigDataType_enum(pub ::core::ffi::c_uint);
4426pub use self::CUstreamCigDataType_enum as CUstreamCigDataType;
4427/// CIG Stream Capture Params.
4428#[repr(C)]
4429#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
4430pub struct CUstreamCigParam_st {
4431    /// Type of shared data from graphics client (D3D12).
4432    pub streamSharedDataType: CUstreamCigDataType,
4433    /// Graphics client data handle (ID3D12CommandList/ID3D12GraphicsCommandList).
4434    pub streamSharedData: *mut ::core::ffi::c_void,
4435}
4436impl Default for CUstreamCigParam_st {
4437    fn default() -> Self {
4438        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
4439        unsafe {
4440            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
4441            s.assume_init()
4442        }
4443    }
4444}
4445/// CIG Stream Capture Params.
4446pub type CUstreamCigParam = CUstreamCigParam_st;
4447/// Params for capturing CUDA stream to CIG streamCigParams must be non-NULL.
4448#[repr(C)]
4449#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
4450pub struct CUstreamCigCaptureParams_st {
4451    /// CIG (CUDA in Graphics) parameters for sharing command list data from D3D12 graphics clients.
4452    pub streamCigParams: *mut CUstreamCigParam,
4453}
4454impl Default for CUstreamCigCaptureParams_st {
4455    fn default() -> Self {
4456        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
4457        unsafe {
4458            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
4459            s.assume_init()
4460        }
4461    }
4462}
4463/// Params for capturing CUDA stream to CIG streamCigParams must be non-NULL.
4464pub type CUstreamCigCaptureParams = CUstreamCigCaptureParams_st;
4465impl CUlibraryOption_enum {
4466    /// Supplies the host universal-function and data tables when loading a CUDA library.
4467    pub const CU_LIBRARY_HOST_UNIVERSAL_FUNCTION_AND_DATA_TABLE: CUlibraryOption_enum = CUlibraryOption_enum(
4468        0,
4469    );
4470    /// Specifes that the argument `code` passed to [`cuLibraryLoadData`] will be preserved.
4471    ///
4472    /// Specifying this option will let the driver know that `code` can be accessed at any point until [`cuLibraryUnload`]. The default behavior is for the driver to allocate and maintain its own copy of `code`. Note that this is only a memory usage optimization hint and the driver can choose to ignore it if required. Specifying this option with [`cuLibraryLoadFromFile`] is invalid and will return [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`].
4473    pub const CU_LIBRARY_BINARY_IS_PRESERVED: CUlibraryOption_enum = CUlibraryOption_enum(
4474        1,
4475    );
4476    /// Upper-bound sentinel for CUDA library loading option selectors.
4477    pub const CU_LIBRARY_NUM_OPTIONS: CUlibraryOption_enum = CUlibraryOption_enum(2);
4478}
4479/// Library options to be specified with [`cuLibraryLoadData`] or [`cuLibraryLoadFromFile`].
4480#[repr(transparent)]
4481#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
4482pub struct CUlibraryOption_enum(pub ::core::ffi::c_uint);
4483pub use self::CUlibraryOption_enum as CUlibraryOption;
4484/// Host-side function and data tables supplied through [`CUlibraryOption_enum::CU_LIBRARY_HOST_UNIVERSAL_FUNCTION_AND_DATA_TABLE`].
4485#[repr(C)]
4486#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
4487pub struct CUlibraryHostUniversalFunctionAndDataTable_st {
4488    /// Address of the host universal-function table.
4489    pub functionTable: *mut ::core::ffi::c_void,
4490    /// Size of the native function-table window.
4491    pub functionWindowSize: size_t,
4492    /// Address of the host universal-data table.
4493    pub dataTable: *mut ::core::ffi::c_void,
4494    /// Size of the native data-table window.
4495    pub dataWindowSize: size_t,
4496}
4497impl Default for CUlibraryHostUniversalFunctionAndDataTable_st {
4498    fn default() -> Self {
4499        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
4500        unsafe {
4501            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
4502            s.assume_init()
4503        }
4504    }
4505}
4506/// Host-side function and data tables supplied through [`CUlibraryOption_enum::CU_LIBRARY_HOST_UNIVERSAL_FUNCTION_AND_DATA_TABLE`].
4507pub type CUlibraryHostUniversalFunctionAndDataTable = CUlibraryHostUniversalFunctionAndDataTable_st;
4508impl cudaError_enum {
4509    /// The API call returned with no errors.
4510    ///
4511    /// In the case of query calls, this also means that the operation being queried is complete (see [`cuEventQuery`] and [`cuStreamQuery`]).
4512    pub const CUDA_SUCCESS: cudaError_enum = cudaError_enum(0);
4513    /// This indicates that one or more of the parameters passed to the API call is not within an acceptable range of values.
4514    pub const CUDA_ERROR_INVALID_VALUE: cudaError_enum = cudaError_enum(1);
4515    /// The API call failed because it was unable to allocate enough memory or other resources to perform the requested operation.
4516    pub const CUDA_ERROR_OUT_OF_MEMORY: cudaError_enum = cudaError_enum(2);
4517    /// This indicates that the CUDA driver has not been initialized with [`cuInit`] or that initialization has failed.
4518    pub const CUDA_ERROR_NOT_INITIALIZED: cudaError_enum = cudaError_enum(3);
4519    /// This indicates that the CUDA driver is in the process of shutting down.
4520    pub const CUDA_ERROR_DEINITIALIZED: cudaError_enum = cudaError_enum(4);
4521    /// This indicates profiler is not initialized for this run.
4522    ///
4523    /// This can happen when the application is running with external profiling tools like visual profiler.
4524    pub const CUDA_ERROR_PROFILER_DISABLED: cudaError_enum = cudaError_enum(5);
4525    /// Deprecated: This error return is deprecated as of CUDA 5.0. It is no longer an error to attempt to enable/disable the profiling via [cuProfilerStart](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__PROFILER.html#group__cuda__profiler_1ga8a5314de2292c2efac83ac7fcfa9190e) or [cuProfilerStop](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__PROFILER.html#group__cuda__profiler_1ga4d8edef6174fd90165e6ac838f320a5f) without initialization.
4526    #[deprecated]
4527    pub const CUDA_ERROR_PROFILER_NOT_INITIALIZED: cudaError_enum = cudaError_enum(6);
4528    /// Deprecated: This error return is deprecated as of CUDA 5.0. It is no longer an error to call [cuProfilerStart()](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__PROFILER.html#group__cuda__profiler_1ga8a5314de2292c2efac83ac7fcfa9190e) when profiling is already enabled.
4529    #[deprecated]
4530    pub const CUDA_ERROR_PROFILER_ALREADY_STARTED: cudaError_enum = cudaError_enum(7);
4531    /// Deprecated: This error return is deprecated as of CUDA 5.0. It is no longer an error to call [cuProfilerStop()](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__PROFILER.html#group__cuda__profiler_1ga4d8edef6174fd90165e6ac838f320a5f) when profiling is already disabled.
4532    #[deprecated]
4533    pub const CUDA_ERROR_PROFILER_ALREADY_STOPPED: cudaError_enum = cudaError_enum(8);
4534    /// This indicates that the CUDA driver that the application has loaded is a stub library.
4535    ///
4536    /// Applications that run with the stub rather than a real driver loaded will result in CUDA API returning this error.
4537    pub const CUDA_ERROR_STUB_LIBRARY: cudaError_enum = cudaError_enum(34);
4538    /// This indicates that the API call requires a newer CUDA driver than the one currently installed.
4539    ///
4540    /// Users should install an updated NVIDIA CUDA driver to allow the API call to succeed.
4541    pub const CUDA_ERROR_CALL_REQUIRES_NEWER_DRIVER: cudaError_enum = cudaError_enum(36);
4542    /// This indicates that requested CUDA device is unavailable at the current time.
4543    ///
4544    /// Devices are often unavailable due to use of [`CUcomputemode_enum::CU_COMPUTEMODE_EXCLUSIVE_PROCESS`] or [`CUcomputemode_enum::CU_COMPUTEMODE_PROHIBITED`].
4545    pub const CUDA_ERROR_DEVICE_UNAVAILABLE: cudaError_enum = cudaError_enum(46);
4546    /// The API call failed because of a hardware resource required to bind memory to a multicast object is unavailable.
4547    pub const CUDA_ERROR_MULTICAST_RESOURCE_FULL: cudaError_enum = cudaError_enum(47);
4548    /// This indicates that no CUDA-capable devices were detected by the installed CUDA driver.
4549    pub const CUDA_ERROR_NO_DEVICE: cudaError_enum = cudaError_enum(100);
4550    /// This indicates that the device ordinal supplied by the user does not correspond to a valid CUDA device or that the action requested is invalid for the specified device.
4551    pub const CUDA_ERROR_INVALID_DEVICE: cudaError_enum = cudaError_enum(101);
4552    /// This error indicates that the Grid license is not applied.
4553    pub const CUDA_ERROR_DEVICE_NOT_LICENSED: cudaError_enum = cudaError_enum(102);
4554    /// This indicates that the device kernel image is invalid.
4555    ///
4556    /// This can also indicate an invalid CUDA module.
4557    pub const CUDA_ERROR_INVALID_IMAGE: cudaError_enum = cudaError_enum(200);
4558    /// This most frequently indicates that there is no context bound to the current thread.
4559    ///
4560    /// This can also be returned if the context passed to an API call is not a valid handle (such as a context that has had cuCtxDestroy() invoked on it). This can also be returned if a user mixes different API versions (i.e. 3010 context with 3020 API calls). See [`cuCtxGetApiVersion`] for more details. This can also be returned if the green context passed to an API call was not converted to a [`CUcontext`] using [`cuCtxFromGreenCtx`] API.
4561    pub const CUDA_ERROR_INVALID_CONTEXT: cudaError_enum = cudaError_enum(201);
4562    /// This indicated that the context being supplied as a parameter to the API call was already the active context.
4563    ///
4564    /// Deprecated: This error return is deprecated as of CUDA 3.2. It is no longer an error to attempt to push the active context via cuCtxPushCurrent().
4565    #[deprecated]
4566    pub const CUDA_ERROR_CONTEXT_ALREADY_CURRENT: cudaError_enum = cudaError_enum(202);
4567    /// This indicates that a map or register operation has failed.
4568    pub const CUDA_ERROR_MAP_FAILED: cudaError_enum = cudaError_enum(205);
4569    /// This indicates that an unmap or unregister operation has failed.
4570    pub const CUDA_ERROR_UNMAP_FAILED: cudaError_enum = cudaError_enum(206);
4571    /// This indicates that the specified array is currently mapped and thus cannot be destroyed.
4572    pub const CUDA_ERROR_ARRAY_IS_MAPPED: cudaError_enum = cudaError_enum(207);
4573    /// This indicates that the resource is already mapped.
4574    pub const CUDA_ERROR_ALREADY_MAPPED: cudaError_enum = cudaError_enum(208);
4575    /// This indicates that there is no kernel image available that is suitable for the device.
4576    ///
4577    /// This can occur when a user specifies code generation options for a particular CUDA source file that do not include the corresponding device configuration.
4578    pub const CUDA_ERROR_NO_BINARY_FOR_GPU: cudaError_enum = cudaError_enum(209);
4579    /// This indicates that a resource has already been acquired.
4580    pub const CUDA_ERROR_ALREADY_ACQUIRED: cudaError_enum = cudaError_enum(210);
4581    /// This indicates that a resource is not mapped.
4582    pub const CUDA_ERROR_NOT_MAPPED: cudaError_enum = cudaError_enum(211);
4583    /// This indicates that a mapped resource is not available for access as an array.
4584    pub const CUDA_ERROR_NOT_MAPPED_AS_ARRAY: cudaError_enum = cudaError_enum(212);
4585    /// This indicates that a mapped resource is not available for access as a pointer.
4586    pub const CUDA_ERROR_NOT_MAPPED_AS_POINTER: cudaError_enum = cudaError_enum(213);
4587    /// This indicates that an uncorrectable ECC error was detected during execution.
4588    pub const CUDA_ERROR_ECC_UNCORRECTABLE: cudaError_enum = cudaError_enum(214);
4589    /// This indicates that the [`CUlimit`] passed to the API call is not supported by the active device.
4590    pub const CUDA_ERROR_UNSUPPORTED_LIMIT: cudaError_enum = cudaError_enum(215);
4591    /// This indicates that the [`CUcontext`] passed to the API call can only be bound to a single CPU thread at a time but is already bound to a CPU thread.
4592    pub const CUDA_ERROR_CONTEXT_ALREADY_IN_USE: cudaError_enum = cudaError_enum(216);
4593    /// This indicates that peer access is not supported across the given devices.
4594    pub const CUDA_ERROR_PEER_ACCESS_UNSUPPORTED: cudaError_enum = cudaError_enum(217);
4595    /// This indicates that a PTX JIT compilation failed.
4596    pub const CUDA_ERROR_INVALID_PTX: cudaError_enum = cudaError_enum(218);
4597    /// This indicates an error with OpenGL or DirectX context.
4598    pub const CUDA_ERROR_INVALID_GRAPHICS_CONTEXT: cudaError_enum = cudaError_enum(219);
4599    /// This indicates that an uncorrectable NVLink error was detected during the execution.
4600    pub const CUDA_ERROR_NVLINK_UNCORRECTABLE: cudaError_enum = cudaError_enum(220);
4601    /// This indicates that the PTX JIT compiler library was not found.
4602    pub const CUDA_ERROR_JIT_COMPILER_NOT_FOUND: cudaError_enum = cudaError_enum(221);
4603    /// This indicates that the provided PTX was compiled with an unsupported toolchain.
4604    pub const CUDA_ERROR_UNSUPPORTED_PTX_VERSION: cudaError_enum = cudaError_enum(222);
4605    /// This indicates that the PTX JIT compilation was disabled.
4606    pub const CUDA_ERROR_JIT_COMPILATION_DISABLED: cudaError_enum = cudaError_enum(223);
4607    /// This indicates that the [`CUexecAffinityType`] passed to the API call is not supported by the active device.
4608    pub const CUDA_ERROR_UNSUPPORTED_EXEC_AFFINITY: cudaError_enum = cudaError_enum(224);
4609    /// This indicates that the code to be compiled by the PTX JIT contains unsupported call to cudaDeviceSynchronize.
4610    pub const CUDA_ERROR_UNSUPPORTED_DEVSIDE_SYNC: cudaError_enum = cudaError_enum(225);
4611    /// This indicates that an exception occurred on the device that is now contained by the GPU’s error containment capability.
4612    ///
4613    /// Common causes are - a. Certain types of invalid accesses of peer GPU memory over nvlink b. Certain classes of hardware errors This leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA, the process must be terminated and relaunched.
4614    pub const CUDA_ERROR_CONTAINED: cudaError_enum = cudaError_enum(226);
4615    /// This indicates that the Loader version is insufficient for fatbin.
4616    pub const CUDA_ERROR_INSUFFICIENT_LOADER_VERSION: cudaError_enum = cudaError_enum(
4617        227,
4618    );
4619    /// This indicates that the device kernel source is invalid.
4620    ///
4621    /// This includes compilation/linker errors encountered in device code or user error.
4622    pub const CUDA_ERROR_INVALID_SOURCE: cudaError_enum = cudaError_enum(300);
4623    /// This indicates that the file specified was not found.
4624    pub const CUDA_ERROR_FILE_NOT_FOUND: cudaError_enum = cudaError_enum(301);
4625    /// This indicates that a link to a shared object failed to resolve.
4626    pub const CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND: cudaError_enum = cudaError_enum(
4627        302,
4628    );
4629    /// This indicates that initialization of a shared object failed.
4630    pub const CUDA_ERROR_SHARED_OBJECT_INIT_FAILED: cudaError_enum = cudaError_enum(303);
4631    /// This indicates that an OS call failed.
4632    pub const CUDA_ERROR_OPERATING_SYSTEM: cudaError_enum = cudaError_enum(304);
4633    /// This indicates that a resource handle passed to the API call was not valid.
4634    ///
4635    /// Resource handles are opaque types like [`CUstream`] and [`CUevent`].
4636    pub const CUDA_ERROR_INVALID_HANDLE: cudaError_enum = cudaError_enum(400);
4637    /// This indicates that a resource required by the API call is not in a valid state to perform the requested operation.
4638    pub const CUDA_ERROR_ILLEGAL_STATE: cudaError_enum = cudaError_enum(401);
4639    /// This indicates an attempt was made to introspect an object in a way that would discard semantically important information.
4640    ///
4641    /// This is either due to the object using funtionality newer than the API version used to introspect it or omission of optional return arguments.
4642    pub const CUDA_ERROR_LOSSY_QUERY: cudaError_enum = cudaError_enum(402);
4643    /// This indicates that a named symbol was not found.
4644    ///
4645    /// Examples of symbols are global/constant variable names, driver function names, texture names, and surface names.
4646    pub const CUDA_ERROR_NOT_FOUND: cudaError_enum = cudaError_enum(500);
4647    /// This indicates that asynchronous operations issued previously have not completed yet.
4648    ///
4649    /// This result is not actually an error, but must be indicated differently than [`cudaError_enum::CUDA_SUCCESS`] (which indicates completion). Calls that may return this value include [`cuEventQuery`] and [`cuStreamQuery`].
4650    pub const CUDA_ERROR_NOT_READY: cudaError_enum = cudaError_enum(600);
4651    /// While executing a kernel, the device encountered a load or store instruction on an invalid memory address.
4652    ///
4653    /// This leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA, the process must be terminated and relaunched.
4654    pub const CUDA_ERROR_ILLEGAL_ADDRESS: cudaError_enum = cudaError_enum(700);
4655    /// This indicates that a launch did not occur because it did not have appropriate resources.
4656    ///
4657    /// This error usually indicates that the user has attempted to pass too many arguments to the device kernel, or the kernel launch specifies too many threads for the kernel’s register count. Passing arguments of the wrong size (i.e. a 64-bit pointer when a 32-bit int is expected) is equivalent to passing too many arguments and can also result in this error.
4658    pub const CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES: cudaError_enum = cudaError_enum(701);
4659    /// This indicates that the device kernel took too long to execute.
4660    ///
4661    /// This can only occur if timeouts are enabled - see the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT`] for more information. This leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA, the process must be terminated and relaunched.
4662    pub const CUDA_ERROR_LAUNCH_TIMEOUT: cudaError_enum = cudaError_enum(702);
4663    /// This error indicates a kernel launch that uses an incompatible texturing mode.
4664    pub const CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING: cudaError_enum = cudaError_enum(
4665        703,
4666    );
4667    /// This error indicates that a call to [`cuCtxEnablePeerAccess`] is trying to re-enable peer access to a context which has already had peer access to it enabled.
4668    pub const CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED: cudaError_enum = cudaError_enum(
4669        704,
4670    );
4671    /// This error indicates that [`cuCtxDisablePeerAccess`] is trying to disable peer access which has not been enabled yet via [`cuCtxEnablePeerAccess`].
4672    pub const CUDA_ERROR_PEER_ACCESS_NOT_ENABLED: cudaError_enum = cudaError_enum(705);
4673    /// This error indicates that the primary context for the specified device has already been initialized.
4674    pub const CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE: cudaError_enum = cudaError_enum(708);
4675    /// This error indicates that the context current to the calling thread has been destroyed using cuCtxDestroy, or is a primary context which has not yet been initialized.
4676    pub const CUDA_ERROR_CONTEXT_IS_DESTROYED: cudaError_enum = cudaError_enum(709);
4677    /// A device-side assert triggered during kernel execution.
4678    ///
4679    /// The context cannot be used anymore, and must be destroyed. All existing device memory allocations from this context are invalid and must be reconstructed if the program is to continue using CUDA.
4680    pub const CUDA_ERROR_ASSERT: cudaError_enum = cudaError_enum(710);
4681    /// This error indicates that the hardware resources required to enable peer access have been exhausted for one or more of the devices passed to [`cuCtxEnablePeerAccess`].
4682    pub const CUDA_ERROR_TOO_MANY_PEERS: cudaError_enum = cudaError_enum(711);
4683    /// This error indicates that the memory range passed to cuMemHostRegister() has already been registered.
4684    pub const CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED: cudaError_enum = cudaError_enum(
4685        712,
4686    );
4687    /// This error indicates that the pointer passed to [`cuMemHostUnregister`] does not correspond to any currently registered memory region.
4688    pub const CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED: cudaError_enum = cudaError_enum(
4689        713,
4690    );
4691    /// While executing a kernel, the device encountered a stack error.
4692    ///
4693    /// This can be due to stack corruption or exceeding the stack size limit. This leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA, the process must be terminated and relaunched.
4694    pub const CUDA_ERROR_HARDWARE_STACK_ERROR: cudaError_enum = cudaError_enum(714);
4695    /// While executing a kernel, the device encountered an illegal instruction.
4696    ///
4697    /// This leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA, the process must be terminated and relaunched.
4698    pub const CUDA_ERROR_ILLEGAL_INSTRUCTION: cudaError_enum = cudaError_enum(715);
4699    /// While executing a kernel, the device encountered a load or store instruction on a memory address which is not aligned.
4700    ///
4701    /// This leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA, the process must be terminated and relaunched.
4702    pub const CUDA_ERROR_MISALIGNED_ADDRESS: cudaError_enum = cudaError_enum(716);
4703    /// While executing a kernel, the device encountered an instruction which can only operate on memory locations in certain address spaces (global, shared, or local), but was supplied a memory address not belonging to an allowed address space.
4704    ///
4705    /// This leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA, the process must be terminated and relaunched.
4706    pub const CUDA_ERROR_INVALID_ADDRESS_SPACE: cudaError_enum = cudaError_enum(717);
4707    /// While executing a kernel, the device program counter wrapped its address space.
4708    ///
4709    /// This leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA, the process must be terminated and relaunched.
4710    pub const CUDA_ERROR_INVALID_PC: cudaError_enum = cudaError_enum(718);
4711    /// An exception occurred on the device while executing a kernel.
4712    ///
4713    /// Common causes include dereferencing an invalid device pointer and accessing out of bounds shared memory. Less common cases can be system specific - more information about these cases can be found in the system specific user guide. This leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA, the process must be terminated and relaunched.
4714    pub const CUDA_ERROR_LAUNCH_FAILED: cudaError_enum = cudaError_enum(719);
4715    /// This error indicates that the number of blocks launched per grid for a kernel that was launched via either [`cuLaunchCooperativeKernel`] or [`cuLaunchCooperativeKernelMultiDevice`] exceeds the maximum number of blocks as allowed by [`cuOccupancyMaxActiveBlocksPerMultiprocessor`] or [`cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags`] times the number of multiprocessors as specified by the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT`].
4716    pub const CUDA_ERROR_COOPERATIVE_LAUNCH_TOO_LARGE: cudaError_enum = cudaError_enum(
4717        720,
4718    );
4719    /// An exception occurred on the device while exiting a kernel using tensor memory: the tensor memory was not completely deallocated.
4720    ///
4721    /// This leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA, the process must be terminated and relaunched.
4722    pub const CUDA_ERROR_TENSOR_MEMORY_LEAK: cudaError_enum = cudaError_enum(721);
4723    /// This error indicates that the attempted operation is not permitted.
4724    pub const CUDA_ERROR_NOT_PERMITTED: cudaError_enum = cudaError_enum(800);
4725    /// This error indicates that the attempted operation is not supported on the current system or device.
4726    pub const CUDA_ERROR_NOT_SUPPORTED: cudaError_enum = cudaError_enum(801);
4727    /// This error indicates that the system is not yet ready to start any CUDA work.
4728    ///
4729    /// To continue using CUDA, verify the system configuration is in a valid state and all required driver daemons are actively running. More information about this error can be found in the system specific user guide.
4730    pub const CUDA_ERROR_SYSTEM_NOT_READY: cudaError_enum = cudaError_enum(802);
4731    /// This error indicates that there is a mismatch between the versions of the display driver and the CUDA driver.
4732    ///
4733    /// Refer to the compatibility documentation for supported versions.
4734    pub const CUDA_ERROR_SYSTEM_DRIVER_MISMATCH: cudaError_enum = cudaError_enum(803);
4735    /// This error indicates that the system was upgraded to run with forward compatibility but the visible hardware detected by CUDA does not support this configuration.
4736    ///
4737    /// Refer to the compatibility documentation for the supported hardware matrix or ensure that only supported hardware is visible during initialization via the CUDA_VISIBLE_DEVICES environment variable.
4738    pub const CUDA_ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE: cudaError_enum = cudaError_enum(
4739        804,
4740    );
4741    /// This error indicates that the MPS client failed to connect to the MPS control daemon or the MPS server.
4742    pub const CUDA_ERROR_MPS_CONNECTION_FAILED: cudaError_enum = cudaError_enum(805);
4743    /// This error indicates that the remote procedural call between the MPS server and the MPS client failed.
4744    pub const CUDA_ERROR_MPS_RPC_FAILURE: cudaError_enum = cudaError_enum(806);
4745    /// This error indicates that the MPS server is not ready to accept new MPS client requests.
4746    ///
4747    /// This error can be returned when the MPS server is in the process of recovering from a fatal failure.
4748    pub const CUDA_ERROR_MPS_SERVER_NOT_READY: cudaError_enum = cudaError_enum(807);
4749    /// This error indicates that the hardware resources required to create MPS client have been exhausted.
4750    pub const CUDA_ERROR_MPS_MAX_CLIENTS_REACHED: cudaError_enum = cudaError_enum(808);
4751    /// This error indicates the hardware resources required to support device connections have been exhausted.
4752    pub const CUDA_ERROR_MPS_MAX_CONNECTIONS_REACHED: cudaError_enum = cudaError_enum(
4753        809,
4754    );
4755    /// This error indicates that the MPS client has been terminated by the server.
4756    ///
4757    /// To continue using CUDA, the process must be terminated and relaunched.
4758    pub const CUDA_ERROR_MPS_CLIENT_TERMINATED: cudaError_enum = cudaError_enum(810);
4759    /// This error indicates that the module is using CUDA Dynamic Parallelism, but the current configuration, like MPS, does not support it.
4760    pub const CUDA_ERROR_CDP_NOT_SUPPORTED: cudaError_enum = cudaError_enum(811);
4761    /// This error indicates that a module contains an unsupported interaction between different versions of CUDA Dynamic Parallelism.
4762    pub const CUDA_ERROR_CDP_VERSION_MISMATCH: cudaError_enum = cudaError_enum(812);
4763    /// This error indicates that the operation is not permitted when the stream is capturing.
4764    pub const CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED: cudaError_enum = cudaError_enum(
4765        900,
4766    );
4767    /// This error indicates that the current capture sequence on the stream has been invalidated due to a previous error.
4768    pub const CUDA_ERROR_STREAM_CAPTURE_INVALIDATED: cudaError_enum = cudaError_enum(
4769        901,
4770    );
4771    /// This error indicates that the operation would have resulted in a merge of two independent capture sequences.
4772    pub const CUDA_ERROR_STREAM_CAPTURE_MERGE: cudaError_enum = cudaError_enum(902);
4773    /// This error indicates that the capture was not initiated in this stream.
4774    pub const CUDA_ERROR_STREAM_CAPTURE_UNMATCHED: cudaError_enum = cudaError_enum(903);
4775    /// This error indicates that the capture sequence contains a fork that was not joined to the primary stream.
4776    pub const CUDA_ERROR_STREAM_CAPTURE_UNJOINED: cudaError_enum = cudaError_enum(904);
4777    /// This error indicates that a dependency would have been created which crosses the capture sequence boundary.
4778    ///
4779    /// Only implicit in-stream ordering dependencies are allowed to cross the boundary.
4780    pub const CUDA_ERROR_STREAM_CAPTURE_ISOLATION: cudaError_enum = cudaError_enum(905);
4781    /// This error indicates a disallowed implicit dependency on a current capture sequence from cudaStreamLegacy.
4782    pub const CUDA_ERROR_STREAM_CAPTURE_IMPLICIT: cudaError_enum = cudaError_enum(906);
4783    /// This error indicates that the operation is not permitted on an event which was last recorded in a capturing stream.
4784    pub const CUDA_ERROR_CAPTURED_EVENT: cudaError_enum = cudaError_enum(907);
4785    /// A stream capture sequence not initiated with the [`CUstreamCaptureMode::CU_STREAM_CAPTURE_MODE_RELAXED`] argument to cuStreamBeginCapture was passed to [`cuStreamEndCapture`] in a different thread.
4786    pub const CUDA_ERROR_STREAM_CAPTURE_WRONG_THREAD: cudaError_enum = cudaError_enum(
4787        908,
4788    );
4789    /// This error indicates that the timeout specified for the wait operation has lapsed.
4790    pub const CUDA_ERROR_TIMEOUT: cudaError_enum = cudaError_enum(909);
4791    /// This error indicates that the graph update was not performed because it included changes which violated constraints specific to instantiated graph update.
4792    pub const CUDA_ERROR_GRAPH_EXEC_UPDATE_FAILURE: cudaError_enum = cudaError_enum(910);
4793    /// This indicates that an error has occurred in a device outside of GPU.
4794    ///
4795    /// It can be a synchronous error with respect to CUDA API or an asynchronous error from the external device. In case of asynchronous error, it means that if CUDA was waiting for an external device’s signal before consuming shared data, the external device signaled an error indicating that the data is not valid for consumption. This leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA, the process must be terminated and relaunched. In case of synchronous error, it means that one or more external devices have encountered an error and cannot complete the operation.
4796    pub const CUDA_ERROR_EXTERNAL_DEVICE: cudaError_enum = cudaError_enum(911);
4797    /// Indicates a kernel launch error due to cluster misconfiguration.
4798    pub const CUDA_ERROR_INVALID_CLUSTER_SIZE: cudaError_enum = cudaError_enum(912);
4799    /// Indiciates a function handle is not loaded when calling an API that requires a loaded function.
4800    pub const CUDA_ERROR_FUNCTION_NOT_LOADED: cudaError_enum = cudaError_enum(913);
4801    /// This error indicates one or more resources passed in are not valid resource types for the operation.
4802    pub const CUDA_ERROR_INVALID_RESOURCE_TYPE: cudaError_enum = cudaError_enum(914);
4803    /// This error indicates one or more resources are insufficient or non-applicable for the operation.
4804    pub const CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION: cudaError_enum = cudaError_enum(
4805        915,
4806    );
4807    /// This error indicates that an error happened during the key rotation sequence.
4808    pub const CUDA_ERROR_KEY_ROTATION: cudaError_enum = cudaError_enum(916);
4809    /// This error indicates that the requested operation is not permitted because the stream is in a detached state.
4810    ///
4811    /// This can occur if the green context associated with the stream has been destroyed, limiting the stream’s operational capabilities.
4812    pub const CUDA_ERROR_STREAM_DETACHED: cudaError_enum = cudaError_enum(917);
4813    /// This error indicates that a graph recapture failed and had to be terminated.
4814    pub const CUDA_ERROR_GRAPH_RECAPTURE_FAILURE: cudaError_enum = cudaError_enum(918);
4815    /// The GPU fabric is not ready within the bounded wait while the fabric manager probe is still in progress (or not converging in time).
4816    ///
4817    /// Applications may retry after a delay; for the initialization wait budget, see environment variables such as CUDA_FABRIC_INIT_TIMEOUT_MS. The CUDA Runtime uses the same value as `cudaErrorFabricNotReady`.
4818    pub const CUDA_ERROR_FABRIC_NOT_READY: cudaError_enum = cudaError_enum(919);
4819    /// This indicates that an unknown internal error has occurred.
4820    pub const CUDA_ERROR_UNKNOWN: cudaError_enum = cudaError_enum(999);
4821}
4822/// CUDA Error types.
4823#[repr(transparent)]
4824#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
4825pub struct cudaError_enum(pub ::core::ffi::c_uint);
4826pub use self::cudaError_enum as CUresult;
4827impl CUdevice_P2PAttribute_enum {
4828    /// A relative value indicating the performance of the link between two devices.
4829    pub const CU_DEVICE_P2P_ATTRIBUTE_PERFORMANCE_RANK: CUdevice_P2PAttribute_enum = CUdevice_P2PAttribute_enum(
4830        1,
4831    );
4832    /// P2P Access is enable.
4833    pub const CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED: CUdevice_P2PAttribute_enum = CUdevice_P2PAttribute_enum(
4834        2,
4835    );
4836    /// All CUDA-valid atomic operation over the link are supported.
4837    pub const CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED: CUdevice_P2PAttribute_enum = CUdevice_P2PAttribute_enum(
4838        3,
4839    );
4840    /// Deprecated: use [`CUdevice_P2PAttribute::CU_DEVICE_P2P_ATTRIBUTE_CUDA_ARRAY_ACCESS_SUPPORTED`] instead.
4841    #[deprecated]
4842    pub const CU_DEVICE_P2P_ATTRIBUTE_ACCESS_ACCESS_SUPPORTED: CUdevice_P2PAttribute_enum = CUdevice_P2PAttribute_enum(
4843        4,
4844    );
4845    /// Accessing CUDA arrays over the link supported.
4846    pub const CU_DEVICE_P2P_ATTRIBUTE_CUDA_ARRAY_ACCESS_SUPPORTED: CUdevice_P2PAttribute_enum = CUdevice_P2PAttribute_enum(
4847        4,
4848    );
4849    /// Only some CUDA-valid atomic operations over the link are supported.
4850    pub const CU_DEVICE_P2P_ATTRIBUTE_ONLY_PARTIAL_NATIVE_ATOMIC_SUPPORTED: CUdevice_P2PAttribute_enum = CUdevice_P2PAttribute_enum(
4851        5,
4852    );
4853}
4854/// P2P Attributes.
4855#[repr(transparent)]
4856#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
4857pub struct CUdevice_P2PAttribute_enum(pub ::core::ffi::c_uint);
4858pub use self::CUdevice_P2PAttribute_enum as CUdevice_P2PAttribute;
4859/// CUDA stream callback.
4860pub type CUstreamCallback = ::core::option::Option<
4861    unsafe extern "C" fn(
4862        hStream: CUstream,
4863        status: CUresult,
4864        userData: *mut ::core::ffi::c_void,
4865    ),
4866>;
4867/// Block size to per-block dynamic shared memory mapping for a certain kernel.
4868pub type CUoccupancyB2DSize = ::core::option::Option<
4869    unsafe extern "C" fn(blockSize: ::core::ffi::c_int) -> size_t,
4870>;
4871/// 2D memory copy parameters.
4872#[repr(C)]
4873#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
4874pub struct CUDA_MEMCPY2D_st {
4875    /// Source X in bytes.
4876    pub srcXInBytes: size_t,
4877    /// Source Y.
4878    pub srcY: size_t,
4879    /// Source memory type (host, device, array).
4880    pub srcMemoryType: CUmemorytype,
4881    /// Source host pointer.
4882    pub srcHost: *const ::core::ffi::c_void,
4883    /// Source device pointer.
4884    pub srcDevice: CUdeviceptr,
4885    /// Source array reference.
4886    pub srcArray: CUarray,
4887    /// Source pitch (ignored when src is array).
4888    pub srcPitch: size_t,
4889    /// Destination X in bytes.
4890    pub dstXInBytes: size_t,
4891    /// Destination Y.
4892    pub dstY: size_t,
4893    /// Destination memory type (host, device, array).
4894    pub dstMemoryType: CUmemorytype,
4895    /// Destination host pointer.
4896    pub dstHost: *mut ::core::ffi::c_void,
4897    /// Destination device pointer.
4898    pub dstDevice: CUdeviceptr,
4899    /// Destination array reference.
4900    pub dstArray: CUarray,
4901    /// Destination pitch (ignored when dst is array).
4902    pub dstPitch: size_t,
4903    /// Width of 2D memory copy in bytes.
4904    pub WidthInBytes: size_t,
4905    /// Height of 2D memory copy.
4906    pub Height: size_t,
4907}
4908impl Default for CUDA_MEMCPY2D_st {
4909    fn default() -> Self {
4910        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
4911        unsafe {
4912            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
4913            s.assume_init()
4914        }
4915    }
4916}
4917/// 2D memory copy parameters.
4918pub type CUDA_MEMCPY2D_v2 = CUDA_MEMCPY2D_st;
4919/// 2D memory copy parameters
4920pub type CUDA_MEMCPY2D = CUDA_MEMCPY2D_v2;
4921/// 3D memory copy parameters.
4922#[repr(C)]
4923#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
4924pub struct CUDA_MEMCPY3D_st {
4925    /// Source X in bytes.
4926    pub srcXInBytes: size_t,
4927    /// Source Y.
4928    pub srcY: size_t,
4929    /// Source Z.
4930    pub srcZ: size_t,
4931    /// Source LOD.
4932    pub srcLOD: size_t,
4933    /// Source memory type (host, device, array).
4934    pub srcMemoryType: CUmemorytype,
4935    /// Source host pointer.
4936    pub srcHost: *const ::core::ffi::c_void,
4937    /// Source device pointer.
4938    pub srcDevice: CUdeviceptr,
4939    /// Source array reference.
4940    pub srcArray: CUarray,
4941    /// Must be NULL.
4942    pub reserved0: *mut ::core::ffi::c_void,
4943    /// Source pitch (ignored when src is array).
4944    pub srcPitch: size_t,
4945    /// Source height (ignored when src is array; may be 0 if Depth==1).
4946    pub srcHeight: size_t,
4947    /// Destination X in bytes.
4948    pub dstXInBytes: size_t,
4949    /// Destination Y.
4950    pub dstY: size_t,
4951    /// Destination Z.
4952    pub dstZ: size_t,
4953    /// Destination LOD.
4954    pub dstLOD: size_t,
4955    /// Destination memory type (host, device, array).
4956    pub dstMemoryType: CUmemorytype,
4957    /// Destination host pointer.
4958    pub dstHost: *mut ::core::ffi::c_void,
4959    /// Destination device pointer.
4960    pub dstDevice: CUdeviceptr,
4961    /// Destination array reference.
4962    pub dstArray: CUarray,
4963    /// Must be NULL.
4964    pub reserved1: *mut ::core::ffi::c_void,
4965    /// Destination pitch (ignored when dst is array).
4966    pub dstPitch: size_t,
4967    /// Destination height (ignored when dst is array; may be 0 if Depth==1).
4968    pub dstHeight: size_t,
4969    /// Width of 3D memory copy in bytes.
4970    pub WidthInBytes: size_t,
4971    /// Height of 3D memory copy.
4972    pub Height: size_t,
4973    /// Depth of 3D memory copy.
4974    pub Depth: size_t,
4975}
4976impl Default for CUDA_MEMCPY3D_st {
4977    fn default() -> Self {
4978        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
4979        unsafe {
4980            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
4981            s.assume_init()
4982        }
4983    }
4984}
4985/// 3D memory copy parameters.
4986pub type CUDA_MEMCPY3D_v2 = CUDA_MEMCPY3D_st;
4987/// 3D memory copy parameters
4988pub type CUDA_MEMCPY3D = CUDA_MEMCPY3D_v2;
4989/// 3D memory cross-context copy parameters.
4990#[repr(C)]
4991#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
4992pub struct CUDA_MEMCPY3D_PEER_st {
4993    /// Source X in bytes.
4994    pub srcXInBytes: size_t,
4995    /// Source Y.
4996    pub srcY: size_t,
4997    /// Source Z.
4998    pub srcZ: size_t,
4999    /// Source LOD.
5000    pub srcLOD: size_t,
5001    /// Source memory type (host, device, array).
5002    pub srcMemoryType: CUmemorytype,
5003    /// Source host pointer.
5004    pub srcHost: *const ::core::ffi::c_void,
5005    /// Source device pointer.
5006    pub srcDevice: CUdeviceptr,
5007    /// Source array reference.
5008    pub srcArray: CUarray,
5009    /// Source context (ignored with srcMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_ARRAY`]).
5010    pub srcContext: CUcontext,
5011    /// Source pitch (ignored when src is array).
5012    pub srcPitch: size_t,
5013    /// Source height (ignored when src is array; may be 0 if Depth==1).
5014    pub srcHeight: size_t,
5015    /// Destination X in bytes.
5016    pub dstXInBytes: size_t,
5017    /// Destination Y.
5018    pub dstY: size_t,
5019    /// Destination Z.
5020    pub dstZ: size_t,
5021    /// Destination LOD.
5022    pub dstLOD: size_t,
5023    /// Destination memory type (host, device, array).
5024    pub dstMemoryType: CUmemorytype,
5025    /// Destination host pointer.
5026    pub dstHost: *mut ::core::ffi::c_void,
5027    /// Destination device pointer.
5028    pub dstDevice: CUdeviceptr,
5029    /// Destination array reference.
5030    pub dstArray: CUarray,
5031    /// Destination context (ignored with dstMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_ARRAY`]).
5032    pub dstContext: CUcontext,
5033    /// Destination pitch (ignored when dst is array).
5034    pub dstPitch: size_t,
5035    /// Destination height (ignored when dst is array; may be 0 if Depth==1).
5036    pub dstHeight: size_t,
5037    /// Width of 3D memory copy in bytes.
5038    pub WidthInBytes: size_t,
5039    /// Height of 3D memory copy.
5040    pub Height: size_t,
5041    /// Depth of 3D memory copy.
5042    pub Depth: size_t,
5043}
5044impl Default for CUDA_MEMCPY3D_PEER_st {
5045    fn default() -> Self {
5046        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
5047        unsafe {
5048            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
5049            s.assume_init()
5050        }
5051    }
5052}
5053/// 3D memory cross-context copy parameters.
5054pub type CUDA_MEMCPY3D_PEER_v1 = CUDA_MEMCPY3D_PEER_st;
5055/// 3D memory cross-context copy parameters
5056pub type CUDA_MEMCPY3D_PEER = CUDA_MEMCPY3D_PEER_v1;
5057/// Memcpy node parameters.
5058#[repr(C)]
5059#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
5060pub struct CUDA_MEMCPY_NODE_PARAMS_st {
5061    /// Must be zero.
5062    pub flags: ::core::ffi::c_int,
5063    /// Must be zero.
5064    pub reserved: ::core::ffi::c_int,
5065    /// Context on which to run the node.
5066    pub copyCtx: CUcontext,
5067    /// Parameters for the memory copy.
5068    pub copyParams: CUDA_MEMCPY3D,
5069}
5070impl Default for CUDA_MEMCPY_NODE_PARAMS_st {
5071    fn default() -> Self {
5072        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
5073        unsafe {
5074            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
5075            s.assume_init()
5076        }
5077    }
5078}
5079/// Memcpy node parameters.
5080pub type CUDA_MEMCPY_NODE_PARAMS = CUDA_MEMCPY_NODE_PARAMS_st;
5081/// Array descriptor.
5082#[repr(C)]
5083#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
5084pub struct CUDA_ARRAY_DESCRIPTOR_st {
5085    /// Width of array.
5086    pub Width: size_t,
5087    /// Height of array.
5088    pub Height: size_t,
5089    /// Array format.
5090    pub Format: CUarray_format,
5091    /// Channels per array element.
5092    pub NumChannels: ::core::ffi::c_uint,
5093}
5094impl Default for CUDA_ARRAY_DESCRIPTOR_st {
5095    fn default() -> Self {
5096        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
5097        unsafe {
5098            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
5099            s.assume_init()
5100        }
5101    }
5102}
5103/// Array descriptor.
5104pub type CUDA_ARRAY_DESCRIPTOR_v2 = CUDA_ARRAY_DESCRIPTOR_st;
5105/// Array descriptor
5106pub type CUDA_ARRAY_DESCRIPTOR = CUDA_ARRAY_DESCRIPTOR_v2;
5107/// 3D array descriptor.
5108#[repr(C)]
5109#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
5110pub struct CUDA_ARRAY3D_DESCRIPTOR_st {
5111    /// Width of 3D array.
5112    pub Width: size_t,
5113    /// Height of 3D array.
5114    pub Height: size_t,
5115    /// Depth of 3D array.
5116    pub Depth: size_t,
5117    /// Array format.
5118    pub Format: CUarray_format,
5119    /// Channels per array element.
5120    pub NumChannels: ::core::ffi::c_uint,
5121    /// Flags.
5122    pub Flags: ::core::ffi::c_uint,
5123}
5124impl Default for CUDA_ARRAY3D_DESCRIPTOR_st {
5125    fn default() -> Self {
5126        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
5127        unsafe {
5128            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
5129            s.assume_init()
5130        }
5131    }
5132}
5133/// 3D array descriptor.
5134pub type CUDA_ARRAY3D_DESCRIPTOR_v2 = CUDA_ARRAY3D_DESCRIPTOR_st;
5135/// 3D array descriptor
5136pub type CUDA_ARRAY3D_DESCRIPTOR = CUDA_ARRAY3D_DESCRIPTOR_v2;
5137/// CUDA array sparse properties.
5138#[repr(C)]
5139#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
5140pub struct CUDA_ARRAY_SPARSE_PROPERTIES_st {
5141    /// Width, height, and depth of a sparse array tile in elements.
5142    pub tileExtent: CUDA_ARRAY_SPARSE_PROPERTIES_st__bindgen_ty_1,
5143    /// First mip level at which the mip tail begins.
5144    pub miptailFirstLevel: ::core::ffi::c_uint,
5145    /// Total size of the mip tail.
5146    pub miptailSize: ::core::ffi::c_ulonglong,
5147    /// Flags will either be zero or [`CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL`].
5148    pub flags: ::core::ffi::c_uint,
5149    /// Reserved storage in the native ABI.
5150    pub reserved: [::core::ffi::c_uint; 4usize],
5151}
5152/// Native layout of the `tileExtent` member of [`CUDA_ARRAY_SPARSE_PROPERTIES_st`].
5153#[repr(C)]
5154#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
5155pub struct CUDA_ARRAY_SPARSE_PROPERTIES_st__bindgen_ty_1 {
5156    /// Width of sparse tile in elements
5157    pub width: ::core::ffi::c_uint,
5158    /// Height of sparse tile in elements
5159    pub height: ::core::ffi::c_uint,
5160    /// Depth of sparse tile in elements
5161    pub depth: ::core::ffi::c_uint,
5162}
5163/// CUDA array sparse properties.
5164pub type CUDA_ARRAY_SPARSE_PROPERTIES_v1 = CUDA_ARRAY_SPARSE_PROPERTIES_st;
5165/// CUDA array sparse properties
5166pub type CUDA_ARRAY_SPARSE_PROPERTIES = CUDA_ARRAY_SPARSE_PROPERTIES_v1;
5167/// CUDA array memory requirements.
5168#[repr(C)]
5169#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
5170pub struct CUDA_ARRAY_MEMORY_REQUIREMENTS_st {
5171    /// Total required memory size.
5172    pub size: size_t,
5173    /// alignment requirement.
5174    pub alignment: size_t,
5175    /// Reserved storage in the native ABI.
5176    pub reserved: [::core::ffi::c_uint; 4usize],
5177}
5178/// CUDA array memory requirements.
5179pub type CUDA_ARRAY_MEMORY_REQUIREMENTS_v1 = CUDA_ARRAY_MEMORY_REQUIREMENTS_st;
5180/// CUDA array memory requirements
5181pub type CUDA_ARRAY_MEMORY_REQUIREMENTS = CUDA_ARRAY_MEMORY_REQUIREMENTS_v1;
5182/// CUDA Resource descriptor.
5183#[repr(C)]
5184#[derive(Copy, Clone)]
5185pub struct CUDA_RESOURCE_DESC_st {
5186    /// Resource type.
5187    pub resType: CUresourcetype,
5188    /// Resource storage description selected by `resType`.
5189    pub res: CUDA_RESOURCE_DESC_st__bindgen_ty_1,
5190    /// Flags (must be zero).
5191    pub flags: ::core::ffi::c_uint,
5192}
5193/// Native layout of the `res` member of [`CUDA_RESOURCE_DESC_st`].
5194#[repr(C)]
5195#[derive(Copy, Clone)]
5196pub union CUDA_RESOURCE_DESC_st__bindgen_ty_1 {
5197    /// CUDA array handle used for an array resource.
5198    pub array: CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_1,
5199    /// CUDA mipmapped-array handle used for a mipmapped resource.
5200    pub mipmap: CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_2,
5201    /// Device pointer, element format, and capacity of a linear resource.
5202    pub linear: CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_3,
5203    /// Device pointer, element format, dimensions, and row pitch of a two-dimensional resource.
5204    pub pitch2D: CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_4,
5205    /// Reserved storage in the native ABI.
5206    pub reserved: CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_5,
5207}
5208/// Native layout of the `array` member of [`CUDA_RESOURCE_DESC_st__bindgen_ty_1`].
5209#[repr(C)]
5210#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
5211pub struct CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_1 {
5212    /// CUDA array
5213    pub hArray: CUarray,
5214}
5215impl Default for CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_1 {
5216    fn default() -> Self {
5217        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
5218        unsafe {
5219            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
5220            s.assume_init()
5221        }
5222    }
5223}
5224/// Native layout of the `mipmap` member of [`CUDA_RESOURCE_DESC_st__bindgen_ty_1`].
5225#[repr(C)]
5226#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
5227pub struct CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_2 {
5228    /// CUDA mipmapped array
5229    pub hMipmappedArray: CUmipmappedArray,
5230}
5231impl Default for CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_2 {
5232    fn default() -> Self {
5233        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
5234        unsafe {
5235            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
5236            s.assume_init()
5237        }
5238    }
5239}
5240/// Native layout of the `linear` member of [`CUDA_RESOURCE_DESC_st__bindgen_ty_1`].
5241#[repr(C)]
5242#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
5243pub struct CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_3 {
5244    /// Device pointer
5245    pub devPtr: CUdeviceptr,
5246    /// Array format
5247    pub format: CUarray_format,
5248    /// Channels per array element
5249    pub numChannels: ::core::ffi::c_uint,
5250    /// Size in bytes
5251    pub sizeInBytes: size_t,
5252}
5253impl Default for CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_3 {
5254    fn default() -> Self {
5255        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
5256        unsafe {
5257            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
5258            s.assume_init()
5259        }
5260    }
5261}
5262/// Native layout of the `pitch2D` member of [`CUDA_RESOURCE_DESC_st__bindgen_ty_1`].
5263#[repr(C)]
5264#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
5265pub struct CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_4 {
5266    /// Device pointer
5267    pub devPtr: CUdeviceptr,
5268    /// Array format
5269    pub format: CUarray_format,
5270    /// Channels per array element
5271    pub numChannels: ::core::ffi::c_uint,
5272    /// Width of the array in elements
5273    pub width: size_t,
5274    /// Height of the array in elements
5275    pub height: size_t,
5276    /// Pitch between two rows in bytes
5277    pub pitchInBytes: size_t,
5278}
5279impl Default for CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_4 {
5280    fn default() -> Self {
5281        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
5282        unsafe {
5283            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
5284            s.assume_init()
5285        }
5286    }
5287}
5288/// Native layout of the `reserved` member of [`CUDA_RESOURCE_DESC_st__bindgen_ty_1`].
5289#[repr(C)]
5290#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
5291pub struct CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_5 {
5292    /// Reserved storage in the native ABI.
5293    pub reserved: [::core::ffi::c_int; 32usize],
5294}
5295impl Default for CUDA_RESOURCE_DESC_st__bindgen_ty_1 {
5296    fn default() -> Self {
5297        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
5298        unsafe {
5299            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
5300            s.assume_init()
5301        }
5302    }
5303}
5304impl Default for CUDA_RESOURCE_DESC_st {
5305    fn default() -> Self {
5306        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
5307        unsafe {
5308            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
5309            s.assume_init()
5310        }
5311    }
5312}
5313/// CUDA Resource descriptor.
5314pub type CUDA_RESOURCE_DESC_v1 = CUDA_RESOURCE_DESC_st;
5315/// CUDA Resource descriptor
5316pub type CUDA_RESOURCE_DESC = CUDA_RESOURCE_DESC_v1;
5317/// Texture descriptor.
5318#[repr(C)]
5319#[derive(Debug, Copy, Clone, PartialOrd, PartialEq)]
5320pub struct CUDA_TEXTURE_DESC_st {
5321    /// Address modes.
5322    pub addressMode: [CUaddress_mode; 3usize],
5323    /// Filter mode.
5324    pub filterMode: CUfilter_mode,
5325    /// Flags.
5326    pub flags: ::core::ffi::c_uint,
5327    /// Maximum anisotropy ratio.
5328    pub maxAnisotropy: ::core::ffi::c_uint,
5329    /// Mipmap filter mode.
5330    pub mipmapFilterMode: CUfilter_mode,
5331    /// Mipmap level bias.
5332    pub mipmapLevelBias: f32,
5333    /// Mipmap minimum level clamp.
5334    pub minMipmapLevelClamp: f32,
5335    /// Mipmap maximum level clamp.
5336    pub maxMipmapLevelClamp: f32,
5337    /// Border Color.
5338    pub borderColor: [f32; 4usize],
5339    /// Reserved storage in the native ABI.
5340    pub reserved: [::core::ffi::c_int; 12usize],
5341}
5342impl Default for CUDA_TEXTURE_DESC_st {
5343    fn default() -> Self {
5344        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
5345        unsafe {
5346            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
5347            s.assume_init()
5348        }
5349    }
5350}
5351/// Texture descriptor.
5352pub type CUDA_TEXTURE_DESC_v1 = CUDA_TEXTURE_DESC_st;
5353/// Texture descriptor
5354pub type CUDA_TEXTURE_DESC = CUDA_TEXTURE_DESC_v1;
5355impl CUresourceViewFormat_enum {
5356    /// No resource view format (use underlying resource format).
5357    pub const CU_RES_VIEW_FORMAT_NONE: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5358        0,
5359    );
5360    /// 1 channel unsigned 8-bit integers.
5361    pub const CU_RES_VIEW_FORMAT_UINT_1X8: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5362        1,
5363    );
5364    /// 2 channel unsigned 8-bit integers.
5365    pub const CU_RES_VIEW_FORMAT_UINT_2X8: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5366        2,
5367    );
5368    /// 4 channel unsigned 8-bit integers.
5369    pub const CU_RES_VIEW_FORMAT_UINT_4X8: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5370        3,
5371    );
5372    /// 1 channel signed 8-bit integers.
5373    pub const CU_RES_VIEW_FORMAT_SINT_1X8: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5374        4,
5375    );
5376    /// 2 channel signed 8-bit integers.
5377    pub const CU_RES_VIEW_FORMAT_SINT_2X8: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5378        5,
5379    );
5380    /// 4 channel signed 8-bit integers.
5381    pub const CU_RES_VIEW_FORMAT_SINT_4X8: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5382        6,
5383    );
5384    /// 1 channel unsigned 16-bit integers.
5385    pub const CU_RES_VIEW_FORMAT_UINT_1X16: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5386        7,
5387    );
5388    /// 2 channel unsigned 16-bit integers.
5389    pub const CU_RES_VIEW_FORMAT_UINT_2X16: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5390        8,
5391    );
5392    /// 4 channel unsigned 16-bit integers.
5393    pub const CU_RES_VIEW_FORMAT_UINT_4X16: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5394        9,
5395    );
5396    /// 1 channel signed 16-bit integers.
5397    pub const CU_RES_VIEW_FORMAT_SINT_1X16: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5398        10,
5399    );
5400    /// 2 channel signed 16-bit integers.
5401    pub const CU_RES_VIEW_FORMAT_SINT_2X16: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5402        11,
5403    );
5404    /// 4 channel signed 16-bit integers.
5405    pub const CU_RES_VIEW_FORMAT_SINT_4X16: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5406        12,
5407    );
5408    /// 1 channel unsigned 32-bit integers.
5409    pub const CU_RES_VIEW_FORMAT_UINT_1X32: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5410        13,
5411    );
5412    /// 2 channel unsigned 32-bit integers.
5413    pub const CU_RES_VIEW_FORMAT_UINT_2X32: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5414        14,
5415    );
5416    /// 4 channel unsigned 32-bit integers.
5417    pub const CU_RES_VIEW_FORMAT_UINT_4X32: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5418        15,
5419    );
5420    /// 1 channel signed 32-bit integers.
5421    pub const CU_RES_VIEW_FORMAT_SINT_1X32: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5422        16,
5423    );
5424    /// 2 channel signed 32-bit integers.
5425    pub const CU_RES_VIEW_FORMAT_SINT_2X32: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5426        17,
5427    );
5428    /// 4 channel signed 32-bit integers.
5429    pub const CU_RES_VIEW_FORMAT_SINT_4X32: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5430        18,
5431    );
5432    /// 1 channel 16-bit floating point.
5433    pub const CU_RES_VIEW_FORMAT_FLOAT_1X16: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5434        19,
5435    );
5436    /// 2 channel 16-bit floating point.
5437    pub const CU_RES_VIEW_FORMAT_FLOAT_2X16: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5438        20,
5439    );
5440    /// 4 channel 16-bit floating point.
5441    pub const CU_RES_VIEW_FORMAT_FLOAT_4X16: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5442        21,
5443    );
5444    /// 1 channel 32-bit floating point.
5445    pub const CU_RES_VIEW_FORMAT_FLOAT_1X32: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5446        22,
5447    );
5448    /// 2 channel 32-bit floating point.
5449    pub const CU_RES_VIEW_FORMAT_FLOAT_2X32: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5450        23,
5451    );
5452    /// 4 channel 32-bit floating point.
5453    pub const CU_RES_VIEW_FORMAT_FLOAT_4X32: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5454        24,
5455    );
5456    /// Block compressed 1.
5457    pub const CU_RES_VIEW_FORMAT_UNSIGNED_BC1: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5458        25,
5459    );
5460    /// Block compressed 2.
5461    pub const CU_RES_VIEW_FORMAT_UNSIGNED_BC2: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5462        26,
5463    );
5464    /// Block compressed 3.
5465    pub const CU_RES_VIEW_FORMAT_UNSIGNED_BC3: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5466        27,
5467    );
5468    /// Block compressed 4 unsigned.
5469    pub const CU_RES_VIEW_FORMAT_UNSIGNED_BC4: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5470        28,
5471    );
5472    /// Block compressed 4 signed.
5473    pub const CU_RES_VIEW_FORMAT_SIGNED_BC4: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5474        29,
5475    );
5476    /// Block compressed 5 unsigned.
5477    pub const CU_RES_VIEW_FORMAT_UNSIGNED_BC5: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5478        30,
5479    );
5480    /// Block compressed 5 signed.
5481    pub const CU_RES_VIEW_FORMAT_SIGNED_BC5: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5482        31,
5483    );
5484    /// Block compressed 6 unsigned half-float.
5485    pub const CU_RES_VIEW_FORMAT_UNSIGNED_BC6H: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5486        32,
5487    );
5488    /// Block compressed 6 signed half-float.
5489    pub const CU_RES_VIEW_FORMAT_SIGNED_BC6H: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5490        33,
5491    );
5492    /// Block compressed 7.
5493    pub const CU_RES_VIEW_FORMAT_UNSIGNED_BC7: CUresourceViewFormat_enum = CUresourceViewFormat_enum(
5494        34,
5495    );
5496}
5497/// Resource view format.
5498#[repr(transparent)]
5499#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
5500pub struct CUresourceViewFormat_enum(pub ::core::ffi::c_uint);
5501pub use self::CUresourceViewFormat_enum as CUresourceViewFormat;
5502/// Resource view descriptor.
5503#[repr(C)]
5504#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
5505pub struct CUDA_RESOURCE_VIEW_DESC_st {
5506    /// Resource view format.
5507    pub format: CUresourceViewFormat,
5508    /// Width of the resource view.
5509    pub width: size_t,
5510    /// Height of the resource view.
5511    pub height: size_t,
5512    /// Depth of the resource view.
5513    pub depth: size_t,
5514    /// First defined mipmap level.
5515    pub firstMipmapLevel: ::core::ffi::c_uint,
5516    /// Last defined mipmap level.
5517    pub lastMipmapLevel: ::core::ffi::c_uint,
5518    /// First layer index.
5519    pub firstLayer: ::core::ffi::c_uint,
5520    /// Last layer index.
5521    pub lastLayer: ::core::ffi::c_uint,
5522    /// Reserved storage in the native ABI.
5523    pub reserved: [::core::ffi::c_uint; 16usize],
5524}
5525impl Default for CUDA_RESOURCE_VIEW_DESC_st {
5526    fn default() -> Self {
5527        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
5528        unsafe {
5529            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
5530            s.assume_init()
5531        }
5532    }
5533}
5534/// Resource view descriptor.
5535pub type CUDA_RESOURCE_VIEW_DESC_v1 = CUDA_RESOURCE_VIEW_DESC_st;
5536/// Resource view descriptor
5537pub type CUDA_RESOURCE_VIEW_DESC = CUDA_RESOURCE_VIEW_DESC_v1;
5538/// Tensor map descriptor.
5539///
5540/// Requires compiler support for aligning to 128 bytes.
5541#[repr(C)]
5542#[repr(align(128))]
5543#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
5544pub struct CUtensorMap_st {
5545    /// Opaque descriptor storage populated by the CUDA tensor-map encoding APIs.
5546    pub opaque: [cuuint64_t; 16usize],
5547}
5548impl Default for CUtensorMap_st {
5549    fn default() -> Self {
5550        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
5551        unsafe {
5552            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
5553            s.assume_init()
5554        }
5555    }
5556}
5557/// Tensor map descriptor.
5558///
5559/// Requires compiler support for aligning to 128 bytes.
5560pub type CUtensorMap = CUtensorMap_st;
5561impl CUtensorMapDataType_enum {
5562    /// Unsigned 8-bit integer elements.
5563    pub const CU_TENSOR_MAP_DATA_TYPE_UINT8: CUtensorMapDataType_enum = CUtensorMapDataType_enum(
5564        0,
5565    );
5566    /// Unsigned 16-bit integer elements.
5567    pub const CU_TENSOR_MAP_DATA_TYPE_UINT16: CUtensorMapDataType_enum = CUtensorMapDataType_enum(
5568        1,
5569    );
5570    /// Unsigned 32-bit integer elements.
5571    pub const CU_TENSOR_MAP_DATA_TYPE_UINT32: CUtensorMapDataType_enum = CUtensorMapDataType_enum(
5572        2,
5573    );
5574    /// Signed 32-bit integer elements.
5575    pub const CU_TENSOR_MAP_DATA_TYPE_INT32: CUtensorMapDataType_enum = CUtensorMapDataType_enum(
5576        3,
5577    );
5578    /// Unsigned 64-bit integer elements.
5579    pub const CU_TENSOR_MAP_DATA_TYPE_UINT64: CUtensorMapDataType_enum = CUtensorMapDataType_enum(
5580        4,
5581    );
5582    /// Signed 64-bit integer elements.
5583    pub const CU_TENSOR_MAP_DATA_TYPE_INT64: CUtensorMapDataType_enum = CUtensorMapDataType_enum(
5584        5,
5585    );
5586    /// 16-bit floating-point elements.
5587    pub const CU_TENSOR_MAP_DATA_TYPE_FLOAT16: CUtensorMapDataType_enum = CUtensorMapDataType_enum(
5588        6,
5589    );
5590    /// 32-bit floating-point elements.
5591    pub const CU_TENSOR_MAP_DATA_TYPE_FLOAT32: CUtensorMapDataType_enum = CUtensorMapDataType_enum(
5592        7,
5593    );
5594    /// 64-bit floating-point elements.
5595    pub const CU_TENSOR_MAP_DATA_TYPE_FLOAT64: CUtensorMapDataType_enum = CUtensorMapDataType_enum(
5596        8,
5597    );
5598    /// 16-bit brain floating-point elements.
5599    pub const CU_TENSOR_MAP_DATA_TYPE_BFLOAT16: CUtensorMapDataType_enum = CUtensorMapDataType_enum(
5600        9,
5601    );
5602    /// 32-bit floating-point elements with subnormal values flushed to zero.
5603    pub const CU_TENSOR_MAP_DATA_TYPE_FLOAT32_FTZ: CUtensorMapDataType_enum = CUtensorMapDataType_enum(
5604        10,
5605    );
5606    /// TensorFloat-32 elements.
5607    pub const CU_TENSOR_MAP_DATA_TYPE_TFLOAT32: CUtensorMapDataType_enum = CUtensorMapDataType_enum(
5608        11,
5609    );
5610    /// TensorFloat-32 elements with subnormal values flushed to zero.
5611    pub const CU_TENSOR_MAP_DATA_TYPE_TFLOAT32_FTZ: CUtensorMapDataType_enum = CUtensorMapDataType_enum(
5612        12,
5613    );
5614    /// Groups of sixteen unsigned 4-bit values packed into eight bytes, with no gaps between groups.
5615    pub const CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B: CUtensorMapDataType_enum = CUtensorMapDataType_enum(
5616        13,
5617    );
5618    /// Groups of sixteen unsigned 4-bit values in 16-byte-aligned storage, with eight padding bytes after each eight-byte packed group.
5619    pub const CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B: CUtensorMapDataType_enum = CUtensorMapDataType_enum(
5620        14,
5621    );
5622    /// Groups of sixteen unsigned 6-bit values in 16-byte-aligned storage, with four padding bytes after each twelve-byte packed group.
5623    pub const CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B: CUtensorMapDataType_enum = CUtensorMapDataType_enum(
5624        15,
5625    );
5626}
5627/// Tensor map data type.
5628#[repr(transparent)]
5629#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
5630pub struct CUtensorMapDataType_enum(pub ::core::ffi::c_uint);
5631pub use self::CUtensorMapDataType_enum as CUtensorMapDataType;
5632impl CUtensorMapInterleave_enum {
5633    /// No channel interleaving.
5634    pub const CU_TENSOR_MAP_INTERLEAVE_NONE: CUtensorMapInterleave_enum = CUtensorMapInterleave_enum(
5635        0,
5636    );
5637    /// Interleaves channels in 16-byte groups, such as eight 16-bit channels per group.
5638    pub const CU_TENSOR_MAP_INTERLEAVE_16B: CUtensorMapInterleave_enum = CUtensorMapInterleave_enum(
5639        1,
5640    );
5641    /// Interleaves channels in 32-byte groups, such as sixteen 16-bit channels per group.
5642    pub const CU_TENSOR_MAP_INTERLEAVE_32B: CUtensorMapInterleave_enum = CUtensorMapInterleave_enum(
5643        2,
5644    );
5645}
5646/// Tensor map interleave layout type.
5647#[repr(transparent)]
5648#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
5649pub struct CUtensorMapInterleave_enum(pub ::core::ffi::c_uint);
5650pub use self::CUtensorMapInterleave_enum as CUtensorMapInterleave;
5651impl CUtensorMapSwizzle_enum {
5652    /// No shared-memory swizzling.
5653    pub const CU_TENSOR_MAP_SWIZZLE_NONE: CUtensorMapSwizzle_enum = CUtensorMapSwizzle_enum(
5654        0,
5655    );
5656    /// Swizzles 16-byte chunks within a 32-byte span.
5657    pub const CU_TENSOR_MAP_SWIZZLE_32B: CUtensorMapSwizzle_enum = CUtensorMapSwizzle_enum(
5658        1,
5659    );
5660    /// Swizzles 16-byte chunks within a 64-byte span.
5661    pub const CU_TENSOR_MAP_SWIZZLE_64B: CUtensorMapSwizzle_enum = CUtensorMapSwizzle_enum(
5662        2,
5663    );
5664    /// Swizzles 16-byte chunks within a 128-byte span.
5665    pub const CU_TENSOR_MAP_SWIZZLE_128B: CUtensorMapSwizzle_enum = CUtensorMapSwizzle_enum(
5666        3,
5667    );
5668    /// Swizzles 32-byte chunks within a 128-byte span.
5669    pub const CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B: CUtensorMapSwizzle_enum = CUtensorMapSwizzle_enum(
5670        4,
5671    );
5672    /// Swizzles 32-byte chunks within a 128-byte span and exchanges the lower and upper eight bytes of each 16-byte unit on alternate rows.
5673    pub const CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B_FLIP_8B: CUtensorMapSwizzle_enum = CUtensorMapSwizzle_enum(
5674        5,
5675    );
5676    /// Swizzles 64-byte chunks within a 128-byte span.
5677    pub const CU_TENSOR_MAP_SWIZZLE_128B_ATOM_64B: CUtensorMapSwizzle_enum = CUtensorMapSwizzle_enum(
5678        6,
5679    );
5680}
5681/// Tensor map swizzling mode of shared memory banks.
5682#[repr(transparent)]
5683#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
5684pub struct CUtensorMapSwizzle_enum(pub ::core::ffi::c_uint);
5685pub use self::CUtensorMapSwizzle_enum as CUtensorMapSwizzle;
5686impl CUtensorMapL2promotion_enum {
5687    /// No L2 fetch-size promotion.
5688    pub const CU_TENSOR_MAP_L2_PROMOTION_NONE: CUtensorMapL2promotion_enum = CUtensorMapL2promotion_enum(
5689        0,
5690    );
5691    /// Fills L2 requests from DRAM at 64-byte granularity.
5692    pub const CU_TENSOR_MAP_L2_PROMOTION_L2_64B: CUtensorMapL2promotion_enum = CUtensorMapL2promotion_enum(
5693        1,
5694    );
5695    /// Fills L2 requests from DRAM at 128-byte granularity.
5696    pub const CU_TENSOR_MAP_L2_PROMOTION_L2_128B: CUtensorMapL2promotion_enum = CUtensorMapL2promotion_enum(
5697        2,
5698    );
5699    /// Fills L2 requests from DRAM at 256-byte granularity.
5700    pub const CU_TENSOR_MAP_L2_PROMOTION_L2_256B: CUtensorMapL2promotion_enum = CUtensorMapL2promotion_enum(
5701        3,
5702    );
5703}
5704/// Tensor map L2 promotion type.
5705#[repr(transparent)]
5706#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
5707pub struct CUtensorMapL2promotion_enum(pub ::core::ffi::c_uint);
5708pub use self::CUtensorMapL2promotion_enum as CUtensorMapL2promotion;
5709impl CUtensorMapFloatOOBfill_enum {
5710    /// Fills out-of-bounds elements with zero.
5711    pub const CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE: CUtensorMapFloatOOBfill_enum = CUtensorMapFloatOOBfill_enum(
5712        0,
5713    );
5714    /// Fills out-of-bounds elements with the special NaN value that requests zero contribution to FMA. Only floating-point tensor data types support this mode.
5715    pub const CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA: CUtensorMapFloatOOBfill_enum = CUtensorMapFloatOOBfill_enum(
5716        1,
5717    );
5718}
5719/// Tensor map out-of-bounds fill type.
5720#[repr(transparent)]
5721#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
5722pub struct CUtensorMapFloatOOBfill_enum(pub ::core::ffi::c_uint);
5723pub use self::CUtensorMapFloatOOBfill_enum as CUtensorMapFloatOOBfill;
5724impl CUtensorMapIm2ColWideMode_enum {
5725    /// Loads along the W dimension using the element count in `pixelsPerColumn`.
5726    pub const CU_TENSOR_MAP_IM2COL_WIDE_MODE_W: CUtensorMapIm2ColWideMode_enum = CUtensorMapIm2ColWideMode_enum(
5727        0,
5728    );
5729    /// Uses native W128 loading along the W dimension; `pixelsPerColumn` is ignored.
5730    pub const CU_TENSOR_MAP_IM2COL_WIDE_MODE_W128: CUtensorMapIm2ColWideMode_enum = CUtensorMapIm2ColWideMode_enum(
5731        1,
5732    );
5733}
5734/// Tensor map Im2Col wide mode.
5735#[repr(transparent)]
5736#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
5737pub struct CUtensorMapIm2ColWideMode_enum(pub ::core::ffi::c_uint);
5738pub use self::CUtensorMapIm2ColWideMode_enum as CUtensorMapIm2ColWideMode;
5739/// GPU Direct v3 tokens.
5740#[repr(C)]
5741#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
5742pub struct CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st {
5743    /// GPUDirect peer-to-peer token identifying the allocation.
5744    pub p2pToken: ::core::ffi::c_ulonglong,
5745    /// Token identifying the CUDA virtual address space for GPUDirect peer access.
5746    pub vaSpaceToken: ::core::ffi::c_uint,
5747}
5748/// GPU Direct v3 tokens.
5749pub type CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1 = CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st;
5750/// GPU Direct v3 tokens
5751pub type CUDA_POINTER_ATTRIBUTE_P2P_TOKENS = CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1;
5752impl CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum {
5753    /// No access, meaning the device cannot access this memory at all, thus must be staged through accessible memory in order to complete certain operations.
5754    pub const CU_POINTER_ATTRIBUTE_ACCESS_FLAG_NONE: CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum = CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum(
5755        0,
5756    );
5757    /// Read-only access, meaning writes to this memory are considered invalid accesses and thus return error in that case.
5758    pub const CU_POINTER_ATTRIBUTE_ACCESS_FLAG_READ: CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum = CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum(
5759        1,
5760    );
5761    /// Read-write access, the device has full read-write access to the memory.
5762    pub const CU_POINTER_ATTRIBUTE_ACCESS_FLAG_READWRITE: CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum = CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum(
5763        3,
5764    );
5765}
5766/// Access flags that specify the level of access the current context’s device has on the memory referenced.
5767#[repr(transparent)]
5768#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
5769pub struct CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum(pub ::core::ffi::c_uint);
5770pub use self::CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum as CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS;
5771/// Kernel launch parameters.
5772#[repr(C)]
5773#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
5774pub struct CUDA_LAUNCH_PARAMS_st {
5775    /// Kernel to launch.
5776    pub function: CUfunction,
5777    /// Width of grid in blocks.
5778    pub gridDimX: ::core::ffi::c_uint,
5779    /// Height of grid in blocks.
5780    pub gridDimY: ::core::ffi::c_uint,
5781    /// Depth of grid in blocks.
5782    pub gridDimZ: ::core::ffi::c_uint,
5783    /// X dimension of each thread block.
5784    pub blockDimX: ::core::ffi::c_uint,
5785    /// Y dimension of each thread block.
5786    pub blockDimY: ::core::ffi::c_uint,
5787    /// Z dimension of each thread block.
5788    pub blockDimZ: ::core::ffi::c_uint,
5789    /// Dynamic shared-memory size per thread block in bytes.
5790    pub sharedMemBytes: ::core::ffi::c_uint,
5791    /// Stream identifier.
5792    pub hStream: CUstream,
5793    /// Array of pointers to kernel parameters.
5794    pub kernelParams: *mut *mut ::core::ffi::c_void,
5795}
5796impl Default for CUDA_LAUNCH_PARAMS_st {
5797    fn default() -> Self {
5798        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
5799        unsafe {
5800            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
5801            s.assume_init()
5802        }
5803    }
5804}
5805/// Kernel launch parameters.
5806pub type CUDA_LAUNCH_PARAMS_v1 = CUDA_LAUNCH_PARAMS_st;
5807/// Kernel launch parameters
5808pub type CUDA_LAUNCH_PARAMS = CUDA_LAUNCH_PARAMS_v1;
5809impl CUexternalMemoryHandleType_enum {
5810    /// Handle is an opaque file descriptor.
5811    pub const CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD: CUexternalMemoryHandleType_enum = CUexternalMemoryHandleType_enum(
5812        1,
5813    );
5814    /// Handle is an opaque shared NT handle.
5815    pub const CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32: CUexternalMemoryHandleType_enum = CUexternalMemoryHandleType_enum(
5816        2,
5817    );
5818    /// Handle is an opaque, globally shared handle.
5819    pub const CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT: CUexternalMemoryHandleType_enum = CUexternalMemoryHandleType_enum(
5820        3,
5821    );
5822    /// Handle is a D3D12 heap object.
5823    pub const CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP: CUexternalMemoryHandleType_enum = CUexternalMemoryHandleType_enum(
5824        4,
5825    );
5826    /// Handle is a D3D12 committed resource.
5827    pub const CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE: CUexternalMemoryHandleType_enum = CUexternalMemoryHandleType_enum(
5828        5,
5829    );
5830    /// Handle is a shared NT handle to a D3D11 resource.
5831    pub const CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE: CUexternalMemoryHandleType_enum = CUexternalMemoryHandleType_enum(
5832        6,
5833    );
5834    /// Handle is a globally shared handle to a D3D11 resource.
5835    pub const CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT: CUexternalMemoryHandleType_enum = CUexternalMemoryHandleType_enum(
5836        7,
5837    );
5838    /// Handle is an NvSciBuf object.
5839    pub const CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF: CUexternalMemoryHandleType_enum = CUexternalMemoryHandleType_enum(
5840        8,
5841    );
5842    /// Handle is a dma_buf file descriptor.
5843    pub const CU_EXTERNAL_MEMORY_HANDLE_TYPE_DMABUF_FD: CUexternalMemoryHandleType_enum = CUexternalMemoryHandleType_enum(
5844        9,
5845    );
5846}
5847/// External memory handle types.
5848#[repr(transparent)]
5849#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
5850pub struct CUexternalMemoryHandleType_enum(pub ::core::ffi::c_uint);
5851pub use self::CUexternalMemoryHandleType_enum as CUexternalMemoryHandleType;
5852/// External memory handle descriptor.
5853#[repr(C)]
5854#[derive(Copy, Clone)]
5855pub struct CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st {
5856    /// Type of the handle.
5857    pub type_: CUexternalMemoryHandleType,
5858    /// Platform-specific external handle representation selected by `type`.
5859    pub handle: CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st__bindgen_ty_1,
5860    /// Size of the memory allocation.
5861    pub size: ::core::ffi::c_ulonglong,
5862    /// Flags must either be zero or [`CUDA_EXTERNAL_MEMORY_DEDICATED`].
5863    pub flags: ::core::ffi::c_uint,
5864    /// Reserved storage in the native ABI.
5865    pub reserved: [::core::ffi::c_uint; 16usize],
5866}
5867/// Native layout of the `handle` member of [`CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st`].
5868#[repr(C)]
5869#[derive(Copy, Clone)]
5870pub union CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st__bindgen_ty_1 {
5871    /// File descriptor referencing the memory object. Valid when type is [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD`]
5872    pub fd: ::core::ffi::c_int,
5873    /// Win32 handle referencing the semaphore object. Valid when type is one of the following:
5874    /// - [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32`]
5875    /// - [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT`]
5876    /// - [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP`]
5877    /// - [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE`]
5878    /// - [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE`]
5879    /// - [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT`] Exactly one of 'handle' and 'name' must be non-NULL. If type is one of the following: [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT`] [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT`] then 'name' must be NULL.
5880    pub win32: CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st__bindgen_ty_1__bindgen_ty_1,
5881    /// A handle representing an NvSciBuf Object. Valid when type is [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF`]
5882    pub nvSciBufObject: *const ::core::ffi::c_void,
5883}
5884/// Win32 handle referencing the semaphore object. Valid when type is one of the following:
5885/// - [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32`]
5886/// - [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT`]
5887/// - [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP`]
5888/// - [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE`]
5889/// - [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE`]
5890/// - [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT`] Exactly one of 'handle' and 'name' must be non-NULL. If type is one of the following: [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT`] [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT`] then 'name' must be NULL.
5891#[repr(C)]
5892#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
5893pub struct CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st__bindgen_ty_1__bindgen_ty_1 {
5894    /// Valid NT handle. Must be NULL if 'name' is non-NULL
5895    pub handle: *mut ::core::ffi::c_void,
5896    /// Name of a valid memory object. Must be NULL if 'handle' is non-NULL.
5897    pub name: *const ::core::ffi::c_void,
5898}
5899impl Default for CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st__bindgen_ty_1__bindgen_ty_1 {
5900    fn default() -> Self {
5901        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
5902        unsafe {
5903            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
5904            s.assume_init()
5905        }
5906    }
5907}
5908impl Default for CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st__bindgen_ty_1 {
5909    fn default() -> Self {
5910        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
5911        unsafe {
5912            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
5913            s.assume_init()
5914        }
5915    }
5916}
5917impl Default for CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st {
5918    fn default() -> Self {
5919        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
5920        unsafe {
5921            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
5922            s.assume_init()
5923        }
5924    }
5925}
5926/// External memory handle descriptor.
5927pub type CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1 = CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st;
5928/// External memory handle descriptor
5929pub type CUDA_EXTERNAL_MEMORY_HANDLE_DESC = CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1;
5930/// External memory buffer descriptor.
5931#[repr(C)]
5932#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
5933pub struct CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st {
5934    /// Offset into the memory object where the buffer’s base is.
5935    pub offset: ::core::ffi::c_ulonglong,
5936    /// Size of the buffer.
5937    pub size: ::core::ffi::c_ulonglong,
5938    /// Flags reserved for future use.
5939    ///
5940    /// Must be zero.
5941    pub flags: ::core::ffi::c_uint,
5942    /// Reserved storage in the native ABI.
5943    pub reserved: [::core::ffi::c_uint; 16usize],
5944}
5945/// External memory buffer descriptor.
5946pub type CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1 = CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st;
5947/// External memory buffer descriptor
5948pub type CUDA_EXTERNAL_MEMORY_BUFFER_DESC = CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1;
5949/// External memory mipmap descriptor.
5950#[repr(C)]
5951#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
5952pub struct CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st {
5953    /// Offset into the memory object where the base level of the mipmap chain is.
5954    pub offset: ::core::ffi::c_ulonglong,
5955    /// Format, dimension and type of base level of the mipmap chain.
5956    pub arrayDesc: CUDA_ARRAY3D_DESCRIPTOR,
5957    /// Total number of levels in the mipmap chain.
5958    pub numLevels: ::core::ffi::c_uint,
5959    /// Reserved storage in the native ABI.
5960    pub reserved: [::core::ffi::c_uint; 16usize],
5961}
5962impl Default for CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st {
5963    fn default() -> Self {
5964        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
5965        unsafe {
5966            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
5967            s.assume_init()
5968        }
5969    }
5970}
5971/// External memory mipmap descriptor.
5972pub type CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1 = CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st;
5973/// External memory mipmap descriptor
5974pub type CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC = CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1;
5975impl CUexternalSemaphoreHandleType_enum {
5976    /// Handle is an opaque file descriptor.
5977    pub const CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD: CUexternalSemaphoreHandleType_enum = CUexternalSemaphoreHandleType_enum(
5978        1,
5979    );
5980    /// Handle is an opaque shared NT handle.
5981    pub const CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32: CUexternalSemaphoreHandleType_enum = CUexternalSemaphoreHandleType_enum(
5982        2,
5983    );
5984    /// Handle is an opaque, globally shared handle.
5985    pub const CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT: CUexternalSemaphoreHandleType_enum = CUexternalSemaphoreHandleType_enum(
5986        3,
5987    );
5988    /// Handle is a shared NT handle referencing a D3D12 fence object.
5989    pub const CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE: CUexternalSemaphoreHandleType_enum = CUexternalSemaphoreHandleType_enum(
5990        4,
5991    );
5992    /// Handle is a shared NT handle referencing a D3D11 fence object.
5993    pub const CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE: CUexternalSemaphoreHandleType_enum = CUexternalSemaphoreHandleType_enum(
5994        5,
5995    );
5996    /// Opaque handle to NvSciSync Object.
5997    pub const CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC: CUexternalSemaphoreHandleType_enum = CUexternalSemaphoreHandleType_enum(
5998        6,
5999    );
6000    /// Handle is a shared NT handle referencing a D3D11 keyed mutex object.
6001    pub const CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX: CUexternalSemaphoreHandleType_enum = CUexternalSemaphoreHandleType_enum(
6002        7,
6003    );
6004    /// Handle is a globally shared handle referencing a D3D11 keyed mutex object.
6005    pub const CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT: CUexternalSemaphoreHandleType_enum = CUexternalSemaphoreHandleType_enum(
6006        8,
6007    );
6008    /// Handle is an opaque file descriptor referencing a timeline semaphore.
6009    pub const CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD: CUexternalSemaphoreHandleType_enum = CUexternalSemaphoreHandleType_enum(
6010        9,
6011    );
6012    /// Handle is an opaque shared NT handle referencing a timeline semaphore.
6013    pub const CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32: CUexternalSemaphoreHandleType_enum = CUexternalSemaphoreHandleType_enum(
6014        10,
6015    );
6016}
6017/// External semaphore handle types.
6018#[repr(transparent)]
6019#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
6020pub struct CUexternalSemaphoreHandleType_enum(pub ::core::ffi::c_uint);
6021pub use self::CUexternalSemaphoreHandleType_enum as CUexternalSemaphoreHandleType;
6022/// External semaphore handle descriptor.
6023#[repr(C)]
6024#[derive(Copy, Clone)]
6025pub struct CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st {
6026    /// Type of the handle.
6027    pub type_: CUexternalSemaphoreHandleType,
6028    /// Platform-specific external handle representation selected by `type`.
6029    pub handle: CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st__bindgen_ty_1,
6030    /// Flags reserved for the future.
6031    ///
6032    /// Must be zero.
6033    pub flags: ::core::ffi::c_uint,
6034    /// Reserved storage in the native ABI.
6035    pub reserved: [::core::ffi::c_uint; 16usize],
6036}
6037/// Native layout of the `handle` member of [`CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st`].
6038#[repr(C)]
6039#[derive(Copy, Clone)]
6040pub union CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st__bindgen_ty_1 {
6041    /// File descriptor referencing the semaphore object. Valid when type is one of the following:
6042    /// - [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD`]
6043    /// - [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD`]
6044    pub fd: ::core::ffi::c_int,
6045    /// Win32 handle referencing the semaphore object. Valid when type is one of the following:
6046    /// - [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32`]
6047    /// - [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT`]
6048    /// - [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE`]
6049    /// - [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE`]
6050    /// - [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX`]
6051    /// - [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32`] Exactly one of 'handle' and 'name' must be non-NULL. If type is one of the following:
6052    /// - [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT`]
6053    /// - [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT`] then 'name' must be NULL.
6054    pub win32: CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st__bindgen_ty_1__bindgen_ty_1,
6055    /// Valid NvSciSyncObj. Must be non NULL
6056    pub nvSciSyncObj: *const ::core::ffi::c_void,
6057}
6058/// Win32 handle referencing the semaphore object. Valid when type is one of the following:
6059/// - [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32`]
6060/// - [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT`]
6061/// - [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE`]
6062/// - [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE`]
6063/// - [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX`]
6064/// - [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32`] Exactly one of 'handle' and 'name' must be non-NULL. If type is one of the following:
6065/// - [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT`]
6066/// - [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT`] then 'name' must be NULL.
6067#[repr(C)]
6068#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
6069pub struct CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st__bindgen_ty_1__bindgen_ty_1 {
6070    /// Valid NT handle. Must be NULL if 'name' is non-NULL
6071    pub handle: *mut ::core::ffi::c_void,
6072    /// Name of a valid synchronization primitive. Must be NULL if 'handle' is non-NULL.
6073    pub name: *const ::core::ffi::c_void,
6074}
6075impl Default for CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st__bindgen_ty_1__bindgen_ty_1 {
6076    fn default() -> Self {
6077        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
6078        unsafe {
6079            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
6080            s.assume_init()
6081        }
6082    }
6083}
6084impl Default for CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st__bindgen_ty_1 {
6085    fn default() -> Self {
6086        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
6087        unsafe {
6088            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
6089            s.assume_init()
6090        }
6091    }
6092}
6093impl Default for CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st {
6094    fn default() -> Self {
6095        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
6096        unsafe {
6097            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
6098            s.assume_init()
6099        }
6100    }
6101}
6102/// External semaphore handle descriptor.
6103pub type CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1 = CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st;
6104/// External semaphore handle descriptor
6105pub type CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC = CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1;
6106/// External semaphore signal parameters.
6107#[repr(C)]
6108#[derive(Copy, Clone)]
6109pub struct CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st {
6110    /// Payload for the signal operation, interpreted using the external semaphore's handle type.
6111    pub params: CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st__bindgen_ty_1,
6112    /// Only when CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS is used to signal a [`CUexternalSemaphore`] of type [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC`], the valid flag is [`CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC`] which indicates that while signaling the [`CUexternalSemaphore`], no memory synchronization operations should be performed for any external memory object imported as [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF`].
6113    ///
6114    /// For all other types of [`CUexternalSemaphore`], flags must be zero.
6115    pub flags: ::core::ffi::c_uint,
6116    /// Reserved storage in the native ABI.
6117    pub reserved: [::core::ffi::c_uint; 16usize],
6118}
6119/// Native layout of the `params` member of [`CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st`].
6120#[repr(C)]
6121#[derive(Copy, Clone)]
6122pub struct CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st__bindgen_ty_1 {
6123    /// Parameters for fence objects
6124    pub fence: CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st__bindgen_ty_1__bindgen_ty_1,
6125    /// NvSciSync fence representation used for an NvSciSync semaphore.
6126    pub nvSciSync: CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st__bindgen_ty_1__bindgen_ty_2,
6127    /// Parameters for keyed mutex objects
6128    pub keyedMutex: CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st__bindgen_ty_1__bindgen_ty_3,
6129    /// Reserved storage in the native ABI.
6130    pub reserved: [::core::ffi::c_uint; 12usize],
6131}
6132/// Parameters for fence objects
6133#[repr(C)]
6134#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
6135pub struct CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st__bindgen_ty_1__bindgen_ty_1 {
6136    /// Value of fence to be signaled
6137    pub value: ::core::ffi::c_ulonglong,
6138}
6139/// Native layout of the `nvSciSync` member of [`CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st__bindgen_ty_1`].
6140#[repr(C)]
6141#[derive(Copy, Clone)]
6142pub union CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st__bindgen_ty_1__bindgen_ty_2 {
6143    /// Pointer to NvSciSyncFence. Valid if [`CUexternalSemaphoreHandleType`] is of type [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC`].
6144    pub fence: *mut ::core::ffi::c_void,
6145    /// Reserved storage in the native ABI.
6146    pub reserved: ::core::ffi::c_ulonglong,
6147}
6148impl Default for CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st__bindgen_ty_1__bindgen_ty_2 {
6149    fn default() -> Self {
6150        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
6151        unsafe {
6152            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
6153            s.assume_init()
6154        }
6155    }
6156}
6157/// Parameters for keyed mutex objects
6158#[repr(C)]
6159#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
6160pub struct CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st__bindgen_ty_1__bindgen_ty_3 {
6161    /// Value of key to release the mutex with
6162    pub key: ::core::ffi::c_ulonglong,
6163}
6164impl Default for CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st__bindgen_ty_1 {
6165    fn default() -> Self {
6166        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
6167        unsafe {
6168            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
6169            s.assume_init()
6170        }
6171    }
6172}
6173impl Default for CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st {
6174    fn default() -> Self {
6175        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
6176        unsafe {
6177            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
6178            s.assume_init()
6179        }
6180    }
6181}
6182/// External semaphore signal parameters.
6183pub type CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1 = CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st;
6184/// External semaphore signal parameters
6185pub type CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS = CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1;
6186/// External semaphore wait parameters.
6187#[repr(C)]
6188#[derive(Copy, Clone)]
6189pub struct CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st {
6190    /// Payload for the wait operation, interpreted using the external semaphore's handle type.
6191    pub params: CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st__bindgen_ty_1,
6192    /// Only when CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS is used to wait on a [`CUexternalSemaphore`] of type [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC`], the valid flag is [`CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC`] which indicates that while waiting for the [`CUexternalSemaphore`], no memory synchronization operations should be performed for any external memory object imported as [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF`].
6193    ///
6194    /// For all other types of [`CUexternalSemaphore`], flags must be zero.
6195    pub flags: ::core::ffi::c_uint,
6196    /// Reserved storage in the native ABI.
6197    pub reserved: [::core::ffi::c_uint; 16usize],
6198}
6199/// Native layout of the `params` member of [`CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st`].
6200#[repr(C)]
6201#[derive(Copy, Clone)]
6202pub struct CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st__bindgen_ty_1 {
6203    /// Parameters for fence objects
6204    pub fence: CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st__bindgen_ty_1__bindgen_ty_1,
6205    /// Pointer to NvSciSyncFence. Valid if CUexternalSemaphoreHandleType is of type CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC.
6206    pub nvSciSync: CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st__bindgen_ty_1__bindgen_ty_2,
6207    /// Parameters for keyed mutex objects
6208    pub keyedMutex: CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st__bindgen_ty_1__bindgen_ty_3,
6209    /// Reserved storage in the native ABI.
6210    pub reserved: [::core::ffi::c_uint; 10usize],
6211}
6212/// Parameters for fence objects
6213#[repr(C)]
6214#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
6215pub struct CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st__bindgen_ty_1__bindgen_ty_1 {
6216    /// Value of fence to be waited on
6217    pub value: ::core::ffi::c_ulonglong,
6218}
6219/// Pointer to NvSciSyncFence. Valid if CUexternalSemaphoreHandleType is of type CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC.
6220#[repr(C)]
6221#[derive(Copy, Clone)]
6222pub union CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st__bindgen_ty_1__bindgen_ty_2 {
6223    /// Pointer to the NvSciSync fence used by this semaphore operation.
6224    pub fence: *mut ::core::ffi::c_void,
6225    /// Reserved storage in the native ABI.
6226    pub reserved: ::core::ffi::c_ulonglong,
6227}
6228impl Default for CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st__bindgen_ty_1__bindgen_ty_2 {
6229    fn default() -> Self {
6230        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
6231        unsafe {
6232            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
6233            s.assume_init()
6234        }
6235    }
6236}
6237/// Parameters for keyed mutex objects
6238#[repr(C)]
6239#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
6240pub struct CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st__bindgen_ty_1__bindgen_ty_3 {
6241    /// Value of key to acquire the mutex with
6242    pub key: ::core::ffi::c_ulonglong,
6243    /// Timeout in milliseconds to wait to acquire the mutex
6244    pub timeoutMs: ::core::ffi::c_uint,
6245}
6246impl Default for CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st__bindgen_ty_1 {
6247    fn default() -> Self {
6248        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
6249        unsafe {
6250            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
6251            s.assume_init()
6252        }
6253    }
6254}
6255impl Default for CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st {
6256    fn default() -> Self {
6257        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
6258        unsafe {
6259            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
6260            s.assume_init()
6261        }
6262    }
6263}
6264/// External semaphore wait parameters.
6265pub type CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1 = CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st;
6266/// External semaphore wait parameters
6267pub type CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS = CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1;
6268/// Semaphore signal node parameters.
6269#[repr(C)]
6270#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
6271pub struct CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st {
6272    /// Array of external semaphore handles.
6273    pub extSemArray: *mut CUexternalSemaphore,
6274    /// Array of external semaphore signal parameters.
6275    pub paramsArray: *const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS,
6276    /// Number of handles and parameters supplied in extSemArray and paramsArray.
6277    pub numExtSems: ::core::ffi::c_uint,
6278}
6279impl Default for CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st {
6280    fn default() -> Self {
6281        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
6282        unsafe {
6283            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
6284            s.assume_init()
6285        }
6286    }
6287}
6288/// Semaphore signal node parameters.
6289pub type CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1 = CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st;
6290/// Semaphore signal node parameters
6291pub type CUDA_EXT_SEM_SIGNAL_NODE_PARAMS = CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1;
6292/// Semaphore signal node parameters.
6293#[repr(C)]
6294#[derive(Copy, Clone)]
6295pub struct CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st {
6296    /// Array of external semaphore handles.
6297    pub extSemArray: *mut CUexternalSemaphore,
6298    /// Array of external semaphore signal parameters.
6299    pub paramsArray: *const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS,
6300    /// Number of handles and parameters supplied in extSemArray and paramsArray.
6301    pub numExtSems: ::core::ffi::c_uint,
6302    /// Anonymous native member. See [`CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st__bindgen_ty_1`] for its fields.
6303    pub __bindgen_anon_1: CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st__bindgen_ty_1,
6304}
6305/// preferred context to use for the semaphore signal task
6306#[repr(C)]
6307#[derive(Copy, Clone)]
6308pub union CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st__bindgen_ty_1 {
6309    /// Preferred CUDA context for the external semaphore signal task.
6310    pub ctx: CUcontext,
6311    /// Preferred green context for the external semaphore signal task.
6312    pub gCtx: CUgreenCtx,
6313}
6314impl Default for CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st__bindgen_ty_1 {
6315    fn default() -> Self {
6316        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
6317        unsafe {
6318            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
6319            s.assume_init()
6320        }
6321    }
6322}
6323impl Default for CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st {
6324    fn default() -> Self {
6325        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
6326        unsafe {
6327            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
6328            s.assume_init()
6329        }
6330    }
6331}
6332/// Semaphore signal node parameters.
6333pub type CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 = CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st;
6334/// Semaphore wait node parameters.
6335#[repr(C)]
6336#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
6337pub struct CUDA_EXT_SEM_WAIT_NODE_PARAMS_st {
6338    /// Array of external semaphore handles.
6339    pub extSemArray: *mut CUexternalSemaphore,
6340    /// Array of external semaphore wait parameters.
6341    pub paramsArray: *const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS,
6342    /// Number of handles and parameters supplied in extSemArray and paramsArray.
6343    pub numExtSems: ::core::ffi::c_uint,
6344}
6345impl Default for CUDA_EXT_SEM_WAIT_NODE_PARAMS_st {
6346    fn default() -> Self {
6347        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
6348        unsafe {
6349            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
6350            s.assume_init()
6351        }
6352    }
6353}
6354/// Semaphore wait node parameters.
6355pub type CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1 = CUDA_EXT_SEM_WAIT_NODE_PARAMS_st;
6356/// Semaphore wait node parameters
6357pub type CUDA_EXT_SEM_WAIT_NODE_PARAMS = CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1;
6358/// Semaphore wait node parameters.
6359#[repr(C)]
6360#[derive(Copy, Clone)]
6361pub struct CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st {
6362    /// Array of external semaphore handles.
6363    pub extSemArray: *mut CUexternalSemaphore,
6364    /// Array of external semaphore wait parameters.
6365    pub paramsArray: *const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS,
6366    /// Number of handles and parameters supplied in extSemArray and paramsArray.
6367    pub numExtSems: ::core::ffi::c_uint,
6368    /// Anonymous native member. See [`CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st__bindgen_ty_1`] for its fields.
6369    pub __bindgen_anon_1: CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st__bindgen_ty_1,
6370}
6371/// preferred context to use for the semaphore wait task
6372#[repr(C)]
6373#[derive(Copy, Clone)]
6374pub union CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st__bindgen_ty_1 {
6375    /// Preferred CUDA context for the external semaphore wait task.
6376    pub ctx: CUcontext,
6377    /// Preferred green context for the external semaphore wait task.
6378    pub gCtx: CUgreenCtx,
6379}
6380impl Default for CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st__bindgen_ty_1 {
6381    fn default() -> Self {
6382        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
6383        unsafe {
6384            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
6385            s.assume_init()
6386        }
6387    }
6388}
6389impl Default for CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st {
6390    fn default() -> Self {
6391        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
6392        unsafe {
6393            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
6394            s.assume_init()
6395        }
6396    }
6397}
6398/// Semaphore wait node parameters.
6399pub type CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 = CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st;
6400/// Opaque handle to a CUDA virtual-memory allocation. The handle identifies an allocation, not a device address; mappings are established separately with [`cuMemMap`].
6401pub type CUmemGenericAllocationHandle_v1 = ::core::ffi::c_ulonglong;
6402/// Opaque handle to a CUDA virtual-memory allocation. The handle identifies an allocation, not a device address; mappings are established separately with [`cuMemMap`].
6403pub type CUmemGenericAllocationHandle = CUmemGenericAllocationHandle_v1;
6404impl CUmemAllocationHandleType_enum {
6405    /// Does not allow any export mechanism.
6406    ///
6407    /// >.
6408    pub const CU_MEM_HANDLE_TYPE_NONE: CUmemAllocationHandleType_enum = CUmemAllocationHandleType_enum(
6409        0,
6410    );
6411    /// Allows a file descriptor to be used for exporting.
6412    ///
6413    /// Permitted only on POSIX systems. (int).
6414    pub const CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR: CUmemAllocationHandleType_enum = CUmemAllocationHandleType_enum(
6415        1,
6416    );
6417    /// Allows a Win32 NT handle to be used for exporting.
6418    ///
6419    /// (HANDLE).
6420    pub const CU_MEM_HANDLE_TYPE_WIN32: CUmemAllocationHandleType_enum = CUmemAllocationHandleType_enum(
6421        2,
6422    );
6423    /// Allows a Win32 KMT handle to be used for exporting.
6424    ///
6425    /// (D3DKMT_HANDLE).
6426    pub const CU_MEM_HANDLE_TYPE_WIN32_KMT: CUmemAllocationHandleType_enum = CUmemAllocationHandleType_enum(
6427        4,
6428    );
6429    /// Allows a fabric handle to be used for exporting.
6430    ///
6431    /// (CUmemFabricHandle).
6432    pub const CU_MEM_HANDLE_TYPE_FABRIC: CUmemAllocationHandleType_enum = CUmemAllocationHandleType_enum(
6433        8,
6434    );
6435    /// Reserved upper-bound sentinel for native allocation handle types.
6436    pub const CU_MEM_HANDLE_TYPE_MAX: CUmemAllocationHandleType_enum = CUmemAllocationHandleType_enum(
6437        2147483647,
6438    );
6439}
6440/// Flags for specifying particular handle types.
6441#[repr(transparent)]
6442#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
6443pub struct CUmemAllocationHandleType_enum(pub ::core::ffi::c_uint);
6444pub use self::CUmemAllocationHandleType_enum as CUmemAllocationHandleType;
6445impl CUmemAccess_flags_enum {
6446    /// Default, make the address range not accessible.
6447    pub const CU_MEM_ACCESS_FLAGS_PROT_NONE: CUmemAccess_flags_enum = CUmemAccess_flags_enum(
6448        0,
6449    );
6450    /// Make the address range read accessible.
6451    pub const CU_MEM_ACCESS_FLAGS_PROT_READ: CUmemAccess_flags_enum = CUmemAccess_flags_enum(
6452        1,
6453    );
6454    /// Make the address range read-write accessible.
6455    pub const CU_MEM_ACCESS_FLAGS_PROT_READWRITE: CUmemAccess_flags_enum = CUmemAccess_flags_enum(
6456        3,
6457    );
6458    /// Reserved upper-bound sentinel for native memory access protections.
6459    pub const CU_MEM_ACCESS_FLAGS_PROT_MAX: CUmemAccess_flags_enum = CUmemAccess_flags_enum(
6460        2147483647,
6461    );
6462}
6463/// Specifies the memory protection flags for mapping.
6464#[repr(transparent)]
6465#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
6466pub struct CUmemAccess_flags_enum(pub ::core::ffi::c_uint);
6467pub use self::CUmemAccess_flags_enum as CUmemAccess_flags;
6468impl CUmemLocationType_enum {
6469    /// No valid native memory location is selected.
6470    pub const CU_MEM_LOCATION_TYPE_INVALID: CUmemLocationType_enum = CUmemLocationType_enum(
6471        0,
6472    );
6473    /// Location is unspecified.
6474    ///
6475    /// This is used when creating a managed memory pool to indicate no preferred location for the pool.
6476    pub const CU_MEM_LOCATION_TYPE_NONE: CUmemLocationType_enum = CUmemLocationType_enum(
6477        0,
6478    );
6479    /// Location is a device location, thus id is a device ordinal.
6480    pub const CU_MEM_LOCATION_TYPE_DEVICE: CUmemLocationType_enum = CUmemLocationType_enum(
6481        1,
6482    );
6483    /// Location is host, id is ignored.
6484    pub const CU_MEM_LOCATION_TYPE_HOST: CUmemLocationType_enum = CUmemLocationType_enum(
6485        2,
6486    );
6487    /// Location is a host NUMA node, thus id is a host NUMA node id.
6488    pub const CU_MEM_LOCATION_TYPE_HOST_NUMA: CUmemLocationType_enum = CUmemLocationType_enum(
6489        3,
6490    );
6491    /// Location is a host NUMA node of the current thread, id is ignored.
6492    pub const CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT: CUmemLocationType_enum = CUmemLocationType_enum(
6493        4,
6494    );
6495    /// Location is not visible but device is accessible, id is always CU_DEVICE_INVALID.
6496    pub const CU_MEM_LOCATION_TYPE_INVISIBLE: CUmemLocationType_enum = CUmemLocationType_enum(
6497        5,
6498    );
6499    /// Location is a portion of device memory, specified by the locality domain ID.
6500    pub const CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN: CUmemLocationType_enum = CUmemLocationType_enum(
6501        6,
6502    );
6503    /// Reserved upper-bound sentinel for native memory location types.
6504    pub const CU_MEM_LOCATION_TYPE_MAX: CUmemLocationType_enum = CUmemLocationType_enum(
6505        2147483647,
6506    );
6507}
6508/// Specifies the type of location.
6509#[repr(transparent)]
6510#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
6511pub struct CUmemLocationType_enum(pub ::core::ffi::c_uint);
6512pub use self::CUmemLocationType_enum as CUmemLocationType;
6513impl CUmemAllocationType_enum {
6514    /// No valid native memory allocation type is selected.
6515    pub const CU_MEM_ALLOCATION_TYPE_INVALID: CUmemAllocationType_enum = CUmemAllocationType_enum(
6516        0,
6517    );
6518    /// This allocation type is ‘pinned’, i.e.
6519    ///
6520    /// cannot migrate from its current location while the application is actively using it.
6521    pub const CU_MEM_ALLOCATION_TYPE_PINNED: CUmemAllocationType_enum = CUmemAllocationType_enum(
6522        1,
6523    );
6524    /// This allocation type is managed memory.
6525    pub const CU_MEM_ALLOCATION_TYPE_MANAGED: CUmemAllocationType_enum = CUmemAllocationType_enum(
6526        2,
6527    );
6528    /// ABI sentinel that forces a 32-bit C allocation-type enum representation.
6529    pub const CU_MEM_ALLOCATION_TYPE_MAX: CUmemAllocationType_enum = CUmemAllocationType_enum(
6530        2147483647,
6531    );
6532}
6533/// Defines the allocation types available.
6534#[repr(transparent)]
6535#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
6536pub struct CUmemAllocationType_enum(pub ::core::ffi::c_uint);
6537pub use self::CUmemAllocationType_enum as CUmemAllocationType;
6538impl CUmemAllocationGranularity_flags_enum {
6539    /// Minimum required granularity for allocation.
6540    pub const CU_MEM_ALLOC_GRANULARITY_MINIMUM: CUmemAllocationGranularity_flags_enum = CUmemAllocationGranularity_flags_enum(
6541        0,
6542    );
6543    /// Recommended granularity for allocation for best performance.
6544    pub const CU_MEM_ALLOC_GRANULARITY_RECOMMENDED: CUmemAllocationGranularity_flags_enum = CUmemAllocationGranularity_flags_enum(
6545        1,
6546    );
6547}
6548/// Flag for requesting different optimal and required granularities for an allocation.
6549#[repr(transparent)]
6550#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
6551pub struct CUmemAllocationGranularity_flags_enum(pub ::core::ffi::c_uint);
6552pub use self::CUmemAllocationGranularity_flags_enum as CUmemAllocationGranularity_flags;
6553impl CUmemRangeHandleType_enum {
6554    /// Exports a memory-range handle as a DMA-BUF file descriptor.
6555    pub const CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD: CUmemRangeHandleType_enum = CUmemRangeHandleType_enum(
6556        1,
6557    );
6558    /// Reserved upper-bound sentinel for native memory-range handle types.
6559    pub const CU_MEM_RANGE_HANDLE_TYPE_MAX: CUmemRangeHandleType_enum = CUmemRangeHandleType_enum(
6560        2147483647,
6561    );
6562}
6563/// Specifies the handle type for address range.
6564#[repr(transparent)]
6565#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
6566pub struct CUmemRangeHandleType_enum(pub ::core::ffi::c_uint);
6567pub use self::CUmemRangeHandleType_enum as CUmemRangeHandleType;
6568impl CUmemRangeFlags_enum {
6569    /// Indicates that DMA_BUF handle should be mapped via PCIe BAR1.
6570    pub const CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE: CUmemRangeFlags_enum = CUmemRangeFlags_enum(
6571        1,
6572    );
6573}
6574/// Flag for requesting handle type for address range.
6575#[repr(transparent)]
6576#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
6577pub struct CUmemRangeFlags_enum(pub ::core::ffi::c_uint);
6578pub use self::CUmemRangeFlags_enum as CUmemRangeFlags;
6579impl CUarraySparseSubresourceType_enum {
6580    /// Selects a sparse mip level for array mapping.
6581    pub const CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_SPARSE_LEVEL: CUarraySparseSubresourceType_enum = CUarraySparseSubresourceType_enum(
6582        0,
6583    );
6584    /// Selects a packed mip tail for array mapping.
6585    pub const CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL: CUarraySparseSubresourceType_enum = CUarraySparseSubresourceType_enum(
6586        1,
6587    );
6588}
6589/// Sparse subresource types.
6590#[repr(transparent)]
6591#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
6592pub struct CUarraySparseSubresourceType_enum(pub ::core::ffi::c_uint);
6593pub use self::CUarraySparseSubresourceType_enum as CUarraySparseSubresourceType;
6594impl CUmemOperationType_enum {
6595    /// Maps the selected sparse-array subresource to an allocation.
6596    pub const CU_MEM_OPERATION_TYPE_MAP: CUmemOperationType_enum = CUmemOperationType_enum(
6597        1,
6598    );
6599    /// Removes the mapping of the selected sparse-array subresource.
6600    pub const CU_MEM_OPERATION_TYPE_UNMAP: CUmemOperationType_enum = CUmemOperationType_enum(
6601        2,
6602    );
6603}
6604/// Memory operation types.
6605#[repr(transparent)]
6606#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
6607pub struct CUmemOperationType_enum(pub ::core::ffi::c_uint);
6608pub use self::CUmemOperationType_enum as CUmemOperationType;
6609impl CUmemHandleType_enum {
6610    /// Uses a generic CUDA allocation handle in an array-mapping operation.
6611    pub const CU_MEM_HANDLE_TYPE_GENERIC: CUmemHandleType_enum = CUmemHandleType_enum(0);
6612}
6613/// Memory handle types.
6614#[repr(transparent)]
6615#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
6616pub struct CUmemHandleType_enum(pub ::core::ffi::c_uint);
6617pub use self::CUmemHandleType_enum as CUmemHandleType;
6618/// Specifies the CUDA array or CUDA mipmapped array memory mapping information.
6619#[repr(C)]
6620#[derive(Copy, Clone)]
6621pub struct CUarrayMapInfo_st {
6622    /// Resource type.
6623    pub resourceType: CUresourcetype,
6624    /// Array or mipmapped-array resource selected by `resourceType`.
6625    pub resource: CUarrayMapInfo_st__bindgen_ty_1,
6626    /// Sparse subresource type.
6627    pub subresourceType: CUarraySparseSubresourceType,
6628    /// Sparse mip-level or mip-tail region selected by `subresourceType`.
6629    pub subresource: CUarrayMapInfo_st__bindgen_ty_2,
6630    /// Memory operation type.
6631    pub memOperationType: CUmemOperationType,
6632    /// Memory handle type.
6633    pub memHandleType: CUmemHandleType,
6634    /// Memory handle representation selected by `memHandleType`.
6635    pub memHandle: CUarrayMapInfo_st__bindgen_ty_3,
6636    /// Offset within mip tail.
6637    ///
6638    /// Offset within the memory.
6639    pub offset: ::core::ffi::c_ulonglong,
6640    /// Device ordinal bit mask.
6641    pub deviceBitMask: ::core::ffi::c_uint,
6642    /// flags for future use, must be zero now.
6643    pub flags: ::core::ffi::c_uint,
6644    /// Reserved for future use, must be zero now.
6645    pub reserved: [::core::ffi::c_uint; 2usize],
6646}
6647/// Native layout of the `resource` member of [`CUarrayMapInfo_st`].
6648#[repr(C)]
6649#[derive(Copy, Clone)]
6650pub union CUarrayMapInfo_st__bindgen_ty_1 {
6651    /// Mipmapped array containing the sparse resource.
6652    pub mipmap: CUmipmappedArray,
6653    /// CUDA array containing the sparse resource.
6654    pub array: CUarray,
6655}
6656impl Default for CUarrayMapInfo_st__bindgen_ty_1 {
6657    fn default() -> Self {
6658        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
6659        unsafe {
6660            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
6661            s.assume_init()
6662        }
6663    }
6664}
6665/// Native layout of the `subresource` member of [`CUarrayMapInfo_st`].
6666#[repr(C)]
6667#[derive(Copy, Clone)]
6668pub union CUarrayMapInfo_st__bindgen_ty_2 {
6669    /// Sparse mip-level coordinates and extents.
6670    pub sparseLevel: CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_1,
6671    /// Offset, size, and layer selecting a packed mip tail.
6672    pub miptail: CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_2,
6673}
6674/// Native layout of the `sparseLevel` member of [`CUarrayMapInfo_st__bindgen_ty_2`].
6675#[repr(C)]
6676#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
6677pub struct CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_1 {
6678    /// For CUDA mipmapped arrays must a valid mipmap level. For CUDA arrays must be zero
6679    pub level: ::core::ffi::c_uint,
6680    /// For CUDA layered arrays must be a valid layer index. Otherwise, must be zero
6681    pub layer: ::core::ffi::c_uint,
6682    /// Starting X offset in elements
6683    pub offsetX: ::core::ffi::c_uint,
6684    /// Starting Y offset in elements
6685    pub offsetY: ::core::ffi::c_uint,
6686    /// Starting Z offset in elements
6687    pub offsetZ: ::core::ffi::c_uint,
6688    /// Width in elements
6689    pub extentWidth: ::core::ffi::c_uint,
6690    /// Height in elements
6691    pub extentHeight: ::core::ffi::c_uint,
6692    /// Depth in elements
6693    pub extentDepth: ::core::ffi::c_uint,
6694}
6695/// Native layout of the `miptail` member of [`CUarrayMapInfo_st__bindgen_ty_2`].
6696#[repr(C)]
6697#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
6698pub struct CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_2 {
6699    /// For CUDA layered arrays must be a valid layer index. Otherwise, must be zero
6700    pub layer: ::core::ffi::c_uint,
6701    /// Offset within mip tail
6702    pub offset: ::core::ffi::c_ulonglong,
6703    /// Extent in bytes
6704    pub size: ::core::ffi::c_ulonglong,
6705}
6706impl Default for CUarrayMapInfo_st__bindgen_ty_2 {
6707    fn default() -> Self {
6708        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
6709        unsafe {
6710            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
6711            s.assume_init()
6712        }
6713    }
6714}
6715/// Native layout of the `memHandle` member of [`CUarrayMapInfo_st`].
6716#[repr(C)]
6717#[derive(Copy, Clone)]
6718pub union CUarrayMapInfo_st__bindgen_ty_3 {
6719    /// Generic allocation handle used as backing memory for the mapping.
6720    pub memHandle: CUmemGenericAllocationHandle,
6721}
6722impl Default for CUarrayMapInfo_st__bindgen_ty_3 {
6723    fn default() -> Self {
6724        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
6725        unsafe {
6726            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
6727            s.assume_init()
6728        }
6729    }
6730}
6731impl Default for CUarrayMapInfo_st {
6732    fn default() -> Self {
6733        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
6734        unsafe {
6735            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
6736            s.assume_init()
6737        }
6738    }
6739}
6740/// Specifies the CUDA array or CUDA mipmapped array memory mapping information.
6741pub type CUarrayMapInfo_v1 = CUarrayMapInfo_st;
6742/// Specifies the CUDA array or CUDA mipmapped array memory mapping information
6743pub type CUarrayMapInfo = CUarrayMapInfo_v1;
6744/// Specifies a memory location.
6745#[repr(C)]
6746#[derive(Copy, Clone)]
6747pub struct CUmemLocation_st {
6748    /// Specifies the location type, which modifies the meaning of id.
6749    pub type_: CUmemLocationType,
6750    /// Anonymous native member. See [`CUmemLocation_st__bindgen_ty_1`] for its fields.
6751    pub __bindgen_anon_1: CUmemLocation_st__bindgen_ty_1,
6752}
6753/// Anonymous native union in [`CUmemLocation_st`]. Its members share the same storage.
6754#[repr(C)]
6755#[derive(Copy, Clone)]
6756pub union CUmemLocation_st__bindgen_ty_1 {
6757    /// Identifier for CUmemLocationType::CU_MEM_LOCATION_TYPE_DEVICE, CUmemLocationType::CU_MEM_LOCATION_TYPE_HOST, CUmemLocationType::CU_MEM_LOCATION_TYPE_HOST_NUMA.
6758    pub id: ::core::ffi::c_int,
6759    /// Identifier for CUmemLocationType::CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN.
6760    pub localized: CUmemLocation_st__bindgen_ty_1__bindgen_ty_1,
6761}
6762/// Native layout of the `localized` member of [`CUmemLocation_st__bindgen_ty_1`].
6763///
6764/// Identifier for CUmemLocationType::CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN.
6765#[repr(C)]
6766#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
6767pub struct CUmemLocation_st__bindgen_ty_1__bindgen_ty_1 {
6768    /// Device ID
6769    pub deviceId: ::core::ffi::c_uchar,
6770    /// Locality domain ID
6771    pub localityDomainId: ::core::ffi::c_uchar,
6772}
6773impl Default for CUmemLocation_st__bindgen_ty_1 {
6774    fn default() -> Self {
6775        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
6776        unsafe {
6777            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
6778            s.assume_init()
6779        }
6780    }
6781}
6782impl Default for CUmemLocation_st {
6783    fn default() -> Self {
6784        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
6785        unsafe {
6786            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
6787            s.assume_init()
6788        }
6789    }
6790}
6791/// Specifies a memory location.
6792pub type CUmemLocation_v1 = CUmemLocation_st;
6793/// Specifies a memory location.
6794pub type CUmemLocation = CUmemLocation_v1;
6795impl CUmemAllocationCompType_enum {
6796    /// Allocating non-compressible memory.
6797    pub const CU_MEM_ALLOCATION_COMP_NONE: CUmemAllocationCompType_enum = CUmemAllocationCompType_enum(
6798        0,
6799    );
6800    /// Allocating compressible memory.
6801    pub const CU_MEM_ALLOCATION_COMP_GENERIC: CUmemAllocationCompType_enum = CUmemAllocationCompType_enum(
6802        1,
6803    );
6804}
6805/// Specifies compression attribute for an allocation.
6806#[repr(transparent)]
6807#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
6808pub struct CUmemAllocationCompType_enum(pub ::core::ffi::c_uint);
6809pub use self::CUmemAllocationCompType_enum as CUmemAllocationCompType;
6810/// Specifies the allocation properties for a allocation.
6811#[repr(C)]
6812#[derive(Copy, Clone)]
6813pub struct CUmemAllocationProp_st {
6814    /// Allocation type.
6815    pub type_: CUmemAllocationType,
6816    /// requested [`CUmemAllocationHandleType`].
6817    pub requestedHandleTypes: CUmemAllocationHandleType,
6818    /// Location of allocation.
6819    pub location: CUmemLocation,
6820    /// Windows-specific POBJECT_ATTRIBUTES required when [`CUmemAllocationHandleType_enum::CU_MEM_HANDLE_TYPE_WIN32`] is specified.
6821    ///
6822    /// This object attributes structure includes security attributes that define the scope of which exported allocations may be transferred to other processes. In all other cases, this field is required to be zero.
6823    pub win32HandleMetaData: *mut ::core::ffi::c_void,
6824    /// Native allocation options for compression, GPUDirect RDMA, and allocation usage.
6825    pub allocFlags: CUmemAllocationProp_st__bindgen_ty_1,
6826}
6827/// Native layout of the `allocFlags` member of [`CUmemAllocationProp_st`].
6828#[repr(C)]
6829#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
6830pub struct CUmemAllocationProp_st__bindgen_ty_1 {
6831    /// Allocation hint for requesting compressible memory. On devices that support Compute Data Compression, compressible memory can be used to accelerate accesses to data with unstructured sparsity and other compressible data patterns. Applications are expected to query allocation property of the handle obtained with [`cuMemCreate`] using [`cuMemGetAllocationPropertiesFromHandle`] to validate if the obtained allocation is compressible or not. Note that compressed memory may not be mappable on all devices.
6832    pub compressionType: ::core::ffi::c_uchar,
6833    /// Allocation hint for requesting GPUDirect RDMA capable memory. On devices with attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WITH_CUDA_VMM_SUPPORTED`] set, this flag indicates that the memory will be used for GPUDirect RDMA. On platforms where the default RDMA path does not support localized allocations, this flag has the following effects:
6834    /// - For MPS clients using MLOPart/locality domains, this flag has the effect of disabling localization for the allocation. This allows the allocation to be used for GPUDirect RDMA with the default RDMA path.
6835    /// - For allocations that are localized using CUDA locality domain APIs, using this flag will return an error. To use GPUDirect RDMA with localized allocations on platforms where the default RDMA path does not support localized allocations, allocations must explicitly opt-in to using the PCIe (BAR1) path by setting the flag CU_MEM_CREATE_USAGE_GPU_DIRECT_RDMA_OVER_PCIE.
6836    pub gpuDirectRDMACapable: ::core::ffi::c_uchar,
6837    /// Bitmask indicating intended usage for this allocation
6838    pub usage: ::core::ffi::c_ushort,
6839    /// Reserved storage in the native ABI.
6840    pub reserved: [::core::ffi::c_uchar; 4usize],
6841}
6842impl Default for CUmemAllocationProp_st {
6843    fn default() -> Self {
6844        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
6845        unsafe {
6846            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
6847            s.assume_init()
6848        }
6849    }
6850}
6851/// Specifies the allocation properties for a allocation.
6852pub type CUmemAllocationProp_v1 = CUmemAllocationProp_st;
6853/// Specifies the allocation properties for a allocation.
6854pub type CUmemAllocationProp = CUmemAllocationProp_v1;
6855impl CUmulticastGranularity_flags_enum {
6856    /// Minimum required granularity.
6857    pub const CU_MULTICAST_GRANULARITY_MINIMUM: CUmulticastGranularity_flags_enum = CUmulticastGranularity_flags_enum(
6858        0,
6859    );
6860    /// Recommended granularity for best performance.
6861    pub const CU_MULTICAST_GRANULARITY_RECOMMENDED: CUmulticastGranularity_flags_enum = CUmulticastGranularity_flags_enum(
6862        1,
6863    );
6864}
6865/// Flags for querying different granularities for a multicast object.
6866#[repr(transparent)]
6867#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
6868pub struct CUmulticastGranularity_flags_enum(pub ::core::ffi::c_uint);
6869pub use self::CUmulticastGranularity_flags_enum as CUmulticastGranularity_flags;
6870/// Specifies the properties for a multicast object.
6871#[repr(C)]
6872#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
6873pub struct CUmulticastObjectProp_st {
6874    /// The number of devices in the multicast team that will bind memory to this object.
6875    pub numDevices: ::core::ffi::c_uint,
6876    /// The maximum amount of memory that can be bound to this multicast object per device.
6877    pub size: size_t,
6878    /// Bitmask of exportable handle types (see [`CUmemAllocationHandleType`]) for this object.
6879    pub handleTypes: ::core::ffi::c_ulonglong,
6880    /// Flags for future use, must be zero now.
6881    pub flags: ::core::ffi::c_ulonglong,
6882}
6883/// Specifies the properties for a multicast object.
6884pub type CUmulticastObjectProp_v1 = CUmulticastObjectProp_st;
6885/// Specifies the properties for a multicast object.
6886pub type CUmulticastObjectProp = CUmulticastObjectProp_v1;
6887/// Memory access descriptor.
6888#[repr(C)]
6889#[derive(Copy, Clone)]
6890pub struct CUmemAccessDesc_st {
6891    /// Location on which the request is to change it’s accessibility.
6892    pub location: CUmemLocation,
6893    /// CUmemProt accessibility flags to set on the request.
6894    pub flags: CUmemAccess_flags,
6895}
6896impl Default for CUmemAccessDesc_st {
6897    fn default() -> Self {
6898        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
6899        unsafe {
6900            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
6901            s.assume_init()
6902        }
6903    }
6904}
6905/// Memory access descriptor.
6906pub type CUmemAccessDesc_v1 = CUmemAccessDesc_st;
6907/// Memory access descriptor
6908pub type CUmemAccessDesc = CUmemAccessDesc_v1;
6909impl CUgraphExecUpdateResult_enum {
6910    /// The update succeeded.
6911    pub const CU_GRAPH_EXEC_UPDATE_SUCCESS: CUgraphExecUpdateResult_enum = CUgraphExecUpdateResult_enum(
6912        0,
6913    );
6914    /// The update failed for an unexpected reason which is described in the return value of the function.
6915    pub const CU_GRAPH_EXEC_UPDATE_ERROR: CUgraphExecUpdateResult_enum = CUgraphExecUpdateResult_enum(
6916        1,
6917    );
6918    /// The update failed because the topology changed.
6919    pub const CU_GRAPH_EXEC_UPDATE_ERROR_TOPOLOGY_CHANGED: CUgraphExecUpdateResult_enum = CUgraphExecUpdateResult_enum(
6920        2,
6921    );
6922    /// The update failed because a node type changed.
6923    pub const CU_GRAPH_EXEC_UPDATE_ERROR_NODE_TYPE_CHANGED: CUgraphExecUpdateResult_enum = CUgraphExecUpdateResult_enum(
6924        3,
6925    );
6926    /// The update failed because the function of a kernel node changed (CUDA driver &lt; 11.2).
6927    pub const CU_GRAPH_EXEC_UPDATE_ERROR_FUNCTION_CHANGED: CUgraphExecUpdateResult_enum = CUgraphExecUpdateResult_enum(
6928        4,
6929    );
6930    /// The update failed because the parameters changed in a way that is not supported.
6931    pub const CU_GRAPH_EXEC_UPDATE_ERROR_PARAMETERS_CHANGED: CUgraphExecUpdateResult_enum = CUgraphExecUpdateResult_enum(
6932        5,
6933    );
6934    /// The update failed because something about the node is not supported.
6935    pub const CU_GRAPH_EXEC_UPDATE_ERROR_NOT_SUPPORTED: CUgraphExecUpdateResult_enum = CUgraphExecUpdateResult_enum(
6936        6,
6937    );
6938    /// The update failed because the function of a kernel node changed in an unsupported way.
6939    pub const CU_GRAPH_EXEC_UPDATE_ERROR_UNSUPPORTED_FUNCTION_CHANGE: CUgraphExecUpdateResult_enum = CUgraphExecUpdateResult_enum(
6940        7,
6941    );
6942    /// The update failed because the node attributes changed in a way that is not supported.
6943    pub const CU_GRAPH_EXEC_UPDATE_ERROR_ATTRIBUTES_CHANGED: CUgraphExecUpdateResult_enum = CUgraphExecUpdateResult_enum(
6944        8,
6945    );
6946}
6947/// CUDA Graph Update error types.
6948#[repr(transparent)]
6949#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
6950pub struct CUgraphExecUpdateResult_enum(pub ::core::ffi::c_uint);
6951pub use self::CUgraphExecUpdateResult_enum as CUgraphExecUpdateResult;
6952/// Result information returned by cuGraphExecUpdate.
6953#[repr(C)]
6954#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
6955pub struct CUgraphExecUpdateResultInfo_st {
6956    /// Gives more specific detail when a cuda graph update fails.
6957    pub result: CUgraphExecUpdateResult,
6958    /// The “to node” of the error edge when the topologies do not match.
6959    ///
6960    /// The error node when the error is associated with a specific node. NULL when the error is generic.
6961    pub errorNode: CUgraphNode,
6962    /// The from node of error edge when the topologies do not match.
6963    ///
6964    /// Otherwise NULL.
6965    pub errorFromNode: CUgraphNode,
6966}
6967impl Default for CUgraphExecUpdateResultInfo_st {
6968    fn default() -> Self {
6969        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
6970        unsafe {
6971            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
6972            s.assume_init()
6973        }
6974    }
6975}
6976/// Result information returned by cuGraphExecUpdate.
6977pub type CUgraphExecUpdateResultInfo_v1 = CUgraphExecUpdateResultInfo_st;
6978/// Result information returned by cuGraphExecUpdate
6979pub type CUgraphExecUpdateResultInfo = CUgraphExecUpdateResultInfo_v1;
6980impl CUmemPool_attribute_enum {
6981    /// (value type = int) Allow cuMemAllocAsync to use memory asynchronously freed in another streams as long as a stream ordering dependency of the allocating stream on the free action exists.
6982    ///
6983    /// CUDA events and null stream interactions can create the required stream ordered dependencies. (default enabled).
6984    pub const CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES: CUmemPool_attribute_enum = CUmemPool_attribute_enum(
6985        1,
6986    );
6987    /// (value type = int) Allow reuse of already completed frees when there is no dependency between the free and allocation.
6988    ///
6989    /// (default enabled).
6990    pub const CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC: CUmemPool_attribute_enum = CUmemPool_attribute_enum(
6991        2,
6992    );
6993    /// (value type = int) Allow cuMemAllocAsync to insert new stream dependencies in order to establish the stream ordering required to reuse a piece of memory released by cuMemFreeAsync (default enabled).
6994    pub const CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES: CUmemPool_attribute_enum = CUmemPool_attribute_enum(
6995        3,
6996    );
6997    /// (value type = cuuint64_t) Amount of reserved memory in bytes to hold onto before trying to release memory back to the OS.
6998    ///
6999    /// When more than the release threshold bytes of memory are held by the memory pool, the allocator will try to release memory back to the OS on the next call to stream, event or context synchronize. (default 0).
7000    pub const CU_MEMPOOL_ATTR_RELEASE_THRESHOLD: CUmemPool_attribute_enum = CUmemPool_attribute_enum(
7001        4,
7002    );
7003    /// (value type = cuuint64_t) Amount of backing memory currently allocated for the mempool.
7004    pub const CU_MEMPOOL_ATTR_RESERVED_MEM_CURRENT: CUmemPool_attribute_enum = CUmemPool_attribute_enum(
7005        5,
7006    );
7007    /// (value type = cuuint64_t) High watermark of backing memory allocated for the mempool since the last time it was reset.
7008    ///
7009    /// High watermark can only be reset to zero.
7010    pub const CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH: CUmemPool_attribute_enum = CUmemPool_attribute_enum(
7011        6,
7012    );
7013    /// (value type = cuuint64_t) Amount of memory from the pool that is currently in use by the application.
7014    pub const CU_MEMPOOL_ATTR_USED_MEM_CURRENT: CUmemPool_attribute_enum = CUmemPool_attribute_enum(
7015        7,
7016    );
7017    /// (value type = cuuint64_t) High watermark of the amount of memory from the pool that was in use by the application since the last time it was reset.
7018    ///
7019    /// High watermark can only be reset to zero.
7020    pub const CU_MEMPOOL_ATTR_USED_MEM_HIGH: CUmemPool_attribute_enum = CUmemPool_attribute_enum(
7021        8,
7022    );
7023    /// (value type = CUmemAllocationType) The allocation type of the mempool.
7024    pub const CU_MEMPOOL_ATTR_ALLOCATION_TYPE: CUmemPool_attribute_enum = CUmemPool_attribute_enum(
7025        9,
7026    );
7027    /// (value type = CUmemAllocationHandleType) Available export handle types for the mempool.
7028    ///
7029    /// For imported pools this value is always [`CUmemAllocationHandleType::CU_MEM_HANDLE_TYPE_NONE`] as an imported pool cannot be re-exported.
7030    pub const CU_MEMPOOL_ATTR_EXPORT_HANDLE_TYPES: CUmemPool_attribute_enum = CUmemPool_attribute_enum(
7031        10,
7032    );
7033    /// (value type = int) The location id for the mempool.
7034    ///
7035    /// If the location type for this pool is [`CUmemLocationType::CU_MEM_LOCATION_TYPE_INVISIBLE`] then ID will be CU_DEVICE_INVALID.
7036    pub const CU_MEMPOOL_ATTR_LOCATION_ID: CUmemPool_attribute_enum = CUmemPool_attribute_enum(
7037        11,
7038    );
7039    /// (value type = CUmemLocationType) The location type for the mempool.
7040    ///
7041    /// For imported memory pools where the device is not directly visible to the importing process or pools imported via fabric handles across nodes this will be [`CUmemLocationType::CU_MEM_LOCATION_TYPE_INVISIBLE`].
7042    pub const CU_MEMPOOL_ATTR_LOCATION_TYPE: CUmemPool_attribute_enum = CUmemPool_attribute_enum(
7043        12,
7044    );
7045    /// (value type = cuuint64_t) Maximum size of the pool in bytes, this value may be higher than what was initially passed to cuMemPoolCreate due to alignment requirements.
7046    ///
7047    /// A value of 0 indicates no maximum size. For [`CUmemAllocationType::CU_MEM_ALLOCATION_TYPE_MANAGED`] and IPC imported pools this value will be system dependent.
7048    pub const CU_MEMPOOL_ATTR_MAX_POOL_SIZE: CUmemPool_attribute_enum = CUmemPool_attribute_enum(
7049        13,
7050    );
7051    /// (value type = int) Indicates whether the pool has hardware compresssion enabled.
7052    pub const CU_MEMPOOL_ATTR_HW_DECOMPRESS_ENABLED: CUmemPool_attribute_enum = CUmemPool_attribute_enum(
7053        14,
7054    );
7055    /// (value type = int) The locality domain ID for the mempool, if the mempool is localized to a locality domain.
7056    ///
7057    /// A value of -1 indicates that the mempool is not localized.
7058    ///
7059    /// Note: On devices with a single locality domain, mempools created with [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN`] and localityDomainId 0 are equivalent to full-device mempools created with [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`]. The value of this attribute will be -1 for such mempools.
7060    pub const CU_MEMPOOL_ATTR_LOCALITY_DOMAIN_ID: CUmemPool_attribute_enum = CUmemPool_attribute_enum(
7061        15,
7062    );
7063}
7064/// CUDA memory pool attributes.
7065#[repr(transparent)]
7066#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
7067pub struct CUmemPool_attribute_enum(pub ::core::ffi::c_uint);
7068pub use self::CUmemPool_attribute_enum as CUmemPool_attribute;
7069/// Specifies the properties of allocations made from the pool.
7070#[repr(C)]
7071#[derive(Copy, Clone)]
7072pub struct CUmemPoolProps_st {
7073    /// Allocation type.
7074    ///
7075    /// Currently must be specified as [`CUmemAllocationType::CU_MEM_ALLOCATION_TYPE_PINNED`].
7076    pub allocType: CUmemAllocationType,
7077    /// Handle types that will be supported by allocations from the pool.
7078    pub handleTypes: CUmemAllocationHandleType,
7079    /// Location where allocations should reside.
7080    pub location: CUmemLocation,
7081    /// Windows-specific LPSECURITYATTRIBUTES required when [`CUmemAllocationHandleType_enum::CU_MEM_HANDLE_TYPE_WIN32`] is specified.
7082    ///
7083    /// This security attribute defines the scope of which exported allocations may be transferred to other processes. In all other cases, this field is required to be zero.
7084    pub win32SecurityAttributes: *mut ::core::ffi::c_void,
7085    /// Maximum pool size.
7086    ///
7087    /// When set to 0, defaults to a system dependent value.
7088    pub maxSize: size_t,
7089    /// Bitmask indicating intended usage for the pool.
7090    pub usage: ::core::ffi::c_ushort,
7091    /// Allocation hint for requesting GPUDirect RDMA capable memory.
7092    ///
7093    /// On devices that support GPUDirect RDMA, this flag indicates that the memory will be used for GPUDirect RDMA. On platforms where the default RDMA path does not support localized allocations, this flag has the following effects:
7094    ///
7095    /// * For MPS clients using MLOPart/locality domains, this flag has the effect of disabling localization for the pool. This allows the pool to be used for GPUDirect RDMA with the default RDMA path.
7096    /// * For pools that are localized using CUDA locality domain APIs, using this flag will have no effect, but attempting to export the localized memory without forcing PCIe will return an error. To use GPUDirect RDMA with localized pools on platforms where the default RDMA path does not support localized allocations, handles must be acquired with the flag [`CUmemRangeFlags_enum::CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE`]. Note that CUDA memory pools are only compatible with dma_buf mappings.
7097    pub gpuDirectRDMACapable: ::core::ffi::c_uchar,
7098    /// reserved for future use, must be 0.
7099    pub reserved: [::core::ffi::c_uchar; 53usize],
7100}
7101impl Default for CUmemPoolProps_st {
7102    fn default() -> Self {
7103        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
7104        unsafe {
7105            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
7106            s.assume_init()
7107        }
7108    }
7109}
7110/// Specifies the properties of allocations made from the pool.
7111pub type CUmemPoolProps_v1 = CUmemPoolProps_st;
7112/// Specifies the properties of allocations made from the pool.
7113pub type CUmemPoolProps = CUmemPoolProps_v1;
7114/// Opaque data for exporting a pool allocation.
7115#[repr(C)]
7116#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
7117pub struct CUmemPoolPtrExportData_st {
7118    /// Reserved storage in the native ABI.
7119    pub reserved: [::core::ffi::c_uchar; 64usize],
7120}
7121impl Default for CUmemPoolPtrExportData_st {
7122    fn default() -> Self {
7123        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
7124        unsafe {
7125            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
7126            s.assume_init()
7127        }
7128    }
7129}
7130/// Opaque data for exporting a pool allocation.
7131pub type CUmemPoolPtrExportData_v1 = CUmemPoolPtrExportData_st;
7132/// Opaque data for exporting a pool allocation
7133pub type CUmemPoolPtrExportData = CUmemPoolPtrExportData_v1;
7134impl CUmemcpyFlags_enum {
7135    /// Uses the default behavior for the copy operation.
7136    pub const CU_MEMCPY_FLAG_DEFAULT: CUmemcpyFlags_enum = CUmemcpyFlags_enum(0);
7137    /// Hint to the driver to try and overlap the copy with compute work on the SMs.
7138    pub const CU_MEMCPY_FLAG_PREFER_OVERLAP_WITH_COMPUTE: CUmemcpyFlags_enum = CUmemcpyFlags_enum(
7139        1,
7140    );
7141}
7142/// Flags to specify for copies within a batch.
7143///
7144/// For more details see cuMemcpyBatchAsync.
7145#[repr(transparent)]
7146#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
7147pub struct CUmemcpyFlags_enum(pub ::core::ffi::c_uint);
7148pub use self::CUmemcpyFlags_enum as CUmemcpyFlags;
7149impl CUmemcpySrcAccessOrder_enum {
7150    /// Default invalid.
7151    pub const CU_MEMCPY_SRC_ACCESS_ORDER_INVALID: CUmemcpySrcAccessOrder_enum = CUmemcpySrcAccessOrder_enum(
7152        0,
7153    );
7154    /// Indicates that access to the source pointer must be in stream order.
7155    pub const CU_MEMCPY_SRC_ACCESS_ORDER_STREAM: CUmemcpySrcAccessOrder_enum = CUmemcpySrcAccessOrder_enum(
7156        1,
7157    );
7158    /// Indicates that access to the source pointer can be out of stream order and all accesses must be complete before the API call returns.
7159    ///
7160    /// This flag is suited for ephemeral sources (ex., stack variables) when it’s known that no prior operations in the stream can be accessing the memory and also that the lifetime of the memory is limited to the scope that the source variable was declared in. Specifying this flag allows the driver to optimize the copy and removes the need for the user to synchronize the stream after the API call.
7161    pub const CU_MEMCPY_SRC_ACCESS_ORDER_DURING_API_CALL: CUmemcpySrcAccessOrder_enum = CUmemcpySrcAccessOrder_enum(
7162        2,
7163    );
7164    /// Indicates that access to the source pointer can be out of stream order and the accesses can happen even after the API call returns.
7165    ///
7166    /// This flag is suited for host pointers allocated outside CUDA (ex., via malloc) when it’s known that no prior operations in the stream can be accessing the memory. Specifying this flag allows the driver to optimize the copy on certain platforms.
7167    pub const CU_MEMCPY_SRC_ACCESS_ORDER_ANY: CUmemcpySrcAccessOrder_enum = CUmemcpySrcAccessOrder_enum(
7168        3,
7169    );
7170    /// ABI sentinel that forces a 32-bit C source-access-order enum representation.
7171    pub const CU_MEMCPY_SRC_ACCESS_ORDER_MAX: CUmemcpySrcAccessOrder_enum = CUmemcpySrcAccessOrder_enum(
7172        2147483647,
7173    );
7174}
7175/// These flags allow applications to convey the source access ordering CUDA must maintain.
7176///
7177/// The destination will always be accessed in stream order.
7178#[repr(transparent)]
7179#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
7180pub struct CUmemcpySrcAccessOrder_enum(pub ::core::ffi::c_uint);
7181pub use self::CUmemcpySrcAccessOrder_enum as CUmemcpySrcAccessOrder;
7182/// Attributes specific to copies within a batch.
7183///
7184/// For more details on usage see cuMemcpyBatchAsync.
7185#[repr(C)]
7186#[derive(Copy, Clone)]
7187pub struct CUmemcpyAttributes_st {
7188    /// Source access ordering to be observed for copies with this attribute.
7189    pub srcAccessOrder: CUmemcpySrcAccessOrder,
7190    /// Hint location for the source operand.
7191    ///
7192    /// Ignored when the pointers are not managed memory or memory allocated outside CUDA.
7193    pub srcLocHint: CUmemLocation,
7194    /// Hint location for the destination operand.
7195    ///
7196    /// Ignored when the pointers are not managed memory or memory allocated outside CUDA.
7197    pub dstLocHint: CUmemLocation,
7198    /// Additional flags for copies with this attribute.
7199    ///
7200    /// See [`CUmemcpyFlags`].
7201    pub flags: ::core::ffi::c_uint,
7202}
7203impl Default for CUmemcpyAttributes_st {
7204    fn default() -> Self {
7205        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
7206        unsafe {
7207            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
7208            s.assume_init()
7209        }
7210    }
7211}
7212/// Attributes specific to copies within a batch.
7213///
7214/// For more details on usage see cuMemcpyBatchAsync.
7215pub type CUmemcpyAttributes_v1 = CUmemcpyAttributes_st;
7216/// Attributes specific to copies within a batch. For more details on usage see [`cuMemcpyBatchAsync`].
7217pub type CUmemcpyAttributes = CUmemcpyAttributes_v1;
7218impl CUmemcpy3DOperandType_enum {
7219    /// Memcpy operand is a valid pointer.
7220    pub const CU_MEMCPY_OPERAND_TYPE_POINTER: CUmemcpy3DOperandType_enum = CUmemcpy3DOperandType_enum(
7221        1,
7222    );
7223    /// Memcpy operand is a CUarray.
7224    pub const CU_MEMCPY_OPERAND_TYPE_ARRAY: CUmemcpy3DOperandType_enum = CUmemcpy3DOperandType_enum(
7225        2,
7226    );
7227    /// Reserved upper-bound sentinel for native three-dimensional copy operand types.
7228    pub const CU_MEMCPY_OPERAND_TYPE_MAX: CUmemcpy3DOperandType_enum = CUmemcpy3DOperandType_enum(
7229        2147483647,
7230    );
7231}
7232/// These flags allow applications to convey the operand type for individual copies specified in cuMemcpy3DBatchAsync.
7233#[repr(transparent)]
7234#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
7235pub struct CUmemcpy3DOperandType_enum(pub ::core::ffi::c_uint);
7236pub use self::CUmemcpy3DOperandType_enum as CUmemcpy3DOperandType;
7237/// Struct representing a 3D offset.
7238#[repr(C)]
7239#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
7240pub struct CUoffset3D_st {
7241    /// Offset along the x axis in elements.
7242    pub x: size_t,
7243    /// Offset along the y axis in elements.
7244    pub y: size_t,
7245    /// Offset along the z axis in elements.
7246    pub z: size_t,
7247}
7248/// Struct representing a 3D offset.
7249pub type CUoffset3D_v1 = CUoffset3D_st;
7250/// Struct representing a 3D offset
7251pub type CUoffset3D = CUoffset3D_v1;
7252/// Struct representing width/height/depth of a CUarray in elements.
7253#[repr(C)]
7254#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
7255pub struct CUextent3D_st {
7256    /// Copy extent along the x axis in elements.
7257    pub width: size_t,
7258    /// Copy extent along the y axis in elements.
7259    pub height: size_t,
7260    /// Copy extent along the z axis in elements.
7261    pub depth: size_t,
7262}
7263/// Struct representing width/height/depth of a CUarray in elements.
7264pub type CUextent3D_v1 = CUextent3D_st;
7265/// Struct representing width/height/depth of a CUarray in elements
7266pub type CUextent3D = CUextent3D_v1;
7267/// Struct representing an operand for copy with cuMemcpy3DBatchAsync.
7268#[repr(C)]
7269#[derive(Copy, Clone)]
7270pub struct CUmemcpy3DOperand_st {
7271    /// Selects a pointer-backed or array-backed copy operand.
7272    pub type_: CUmemcpy3DOperandType,
7273    /// Operand storage and layout selected by `type`.
7274    pub op: CUmemcpy3DOperand_st__bindgen_ty_1,
7275}
7276/// Native layout of the `op` member of [`CUmemcpy3DOperand_st`].
7277#[repr(C)]
7278#[derive(Copy, Clone)]
7279pub union CUmemcpy3DOperand_st__bindgen_ty_1 {
7280    /// Struct representing an operand when `CUmemcpy3DOperand::type`(CUmemcpy3DOperand_st::type_) is [`CUmemcpy3DOperandType_enum::CU_MEMCPY_OPERAND_TYPE_POINTER`]
7281    pub ptr: CUmemcpy3DOperand_st__bindgen_ty_1__bindgen_ty_1,
7282    /// Struct representing an operand when `CUmemcpy3DOperand::type`(CUmemcpy3DOperand_st::type_) is [`CUmemcpy3DOperandType_enum::CU_MEMCPY_OPERAND_TYPE_ARRAY`]
7283    pub array: CUmemcpy3DOperand_st__bindgen_ty_1__bindgen_ty_2,
7284}
7285/// Struct representing an operand when `CUmemcpy3DOperand::type`(CUmemcpy3DOperand_st::type_) is [`CUmemcpy3DOperandType_enum::CU_MEMCPY_OPERAND_TYPE_POINTER`]
7286#[repr(C)]
7287#[derive(Copy, Clone)]
7288pub struct CUmemcpy3DOperand_st__bindgen_ty_1__bindgen_ty_1 {
7289    /// Device address used as the pointer-backed copy operand.
7290    pub ptr: CUdeviceptr,
7291    /// Length of each row in elements.
7292    pub rowLength: size_t,
7293    /// Height of each layer in elements.
7294    pub layerHeight: size_t,
7295    /// Hint location for the operand. Ignored when the pointers are not managed memory or memory allocated outside CUDA.
7296    pub locHint: CUmemLocation,
7297}
7298impl Default for CUmemcpy3DOperand_st__bindgen_ty_1__bindgen_ty_1 {
7299    fn default() -> Self {
7300        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
7301        unsafe {
7302            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
7303            s.assume_init()
7304        }
7305    }
7306}
7307/// Struct representing an operand when `CUmemcpy3DOperand::type`(CUmemcpy3DOperand_st::type_) is [`CUmemcpy3DOperandType_enum::CU_MEMCPY_OPERAND_TYPE_ARRAY`]
7308#[repr(C)]
7309#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
7310pub struct CUmemcpy3DOperand_st__bindgen_ty_1__bindgen_ty_2 {
7311    /// referenced array
7312    pub array: CUarray,
7313    /// offset into the array in elements
7314    pub offset: CUoffset3D,
7315}
7316impl Default for CUmemcpy3DOperand_st__bindgen_ty_1__bindgen_ty_2 {
7317    fn default() -> Self {
7318        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
7319        unsafe {
7320            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
7321            s.assume_init()
7322        }
7323    }
7324}
7325impl Default for CUmemcpy3DOperand_st__bindgen_ty_1 {
7326    fn default() -> Self {
7327        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
7328        unsafe {
7329            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
7330            s.assume_init()
7331        }
7332    }
7333}
7334impl Default for CUmemcpy3DOperand_st {
7335    fn default() -> Self {
7336        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
7337        unsafe {
7338            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
7339            s.assume_init()
7340        }
7341    }
7342}
7343/// Struct representing an operand for copy with cuMemcpy3DBatchAsync.
7344pub type CUmemcpy3DOperand_v1 = CUmemcpy3DOperand_st;
7345/// Struct representing an operand for copy with [`cuMemcpy3DBatchAsync`]
7346pub type CUmemcpy3DOperand = CUmemcpy3DOperand_v1;
7347/// One source, destination, extent, and access-order specification in a batched three-dimensional copy.
7348#[repr(C)]
7349#[derive(Copy, Clone)]
7350pub struct CUDA_MEMCPY3D_BATCH_OP_st {
7351    /// Source memcpy operand.
7352    pub src: CUmemcpy3DOperand,
7353    /// Destination memcpy operand.
7354    pub dst: CUmemcpy3DOperand,
7355    /// Extents of the memcpy between src and dst.
7356    ///
7357    /// The width, height and depth components must not be 0.
7358    pub extent: CUextent3D,
7359    /// Source access ordering to be observed for copy from src to dst.
7360    pub srcAccessOrder: CUmemcpySrcAccessOrder,
7361    /// Additional flags for copies with this attribute.
7362    ///
7363    /// See [`CUmemcpyFlags`].
7364    pub flags: ::core::ffi::c_uint,
7365}
7366impl Default for CUDA_MEMCPY3D_BATCH_OP_st {
7367    fn default() -> Self {
7368        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
7369        unsafe {
7370            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
7371            s.assume_init()
7372        }
7373    }
7374}
7375/// One source, destination, extent, and access-order specification in a batched three-dimensional copy.
7376pub type CUDA_MEMCPY3D_BATCH_OP_v1 = CUDA_MEMCPY3D_BATCH_OP_st;
7377/// One source, destination, extent, and access-order specification in a batched three-dimensional copy.
7378pub type CUDA_MEMCPY3D_BATCH_OP = CUDA_MEMCPY3D_BATCH_OP_v1;
7379/// Memory allocation node parameters.
7380#[repr(C)]
7381#[derive(Copy, Clone)]
7382pub struct CUDA_MEM_ALLOC_NODE_PARAMS_v1_st {
7383    /// in: location where the allocation should reside (specified in `location`).
7384    ///
7385    /// `handleTypes` must be [`CUmemAllocationHandleType_enum::CU_MEM_HANDLE_TYPE_NONE`]. IPC is not supported.
7386    pub poolProps: CUmemPoolProps,
7387    /// in: array of memory access descriptors.
7388    ///
7389    /// Used to describe peer GPU access.
7390    pub accessDescs: *const CUmemAccessDesc,
7391    /// in: number of memory access descriptors.
7392    ///
7393    /// Must not exceed the number of GPUs.
7394    pub accessDescCount: size_t,
7395    /// in: size in bytes of the requested allocation.
7396    pub bytesize: size_t,
7397    /// out: address of the allocation returned by CUDA.
7398    pub dptr: CUdeviceptr,
7399}
7400impl Default for CUDA_MEM_ALLOC_NODE_PARAMS_v1_st {
7401    fn default() -> Self {
7402        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
7403        unsafe {
7404            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
7405            s.assume_init()
7406        }
7407    }
7408}
7409/// Memory allocation node parameters.
7410pub type CUDA_MEM_ALLOC_NODE_PARAMS_v1 = CUDA_MEM_ALLOC_NODE_PARAMS_v1_st;
7411/// Memory allocation node parameters
7412pub type CUDA_MEM_ALLOC_NODE_PARAMS = CUDA_MEM_ALLOC_NODE_PARAMS_v1;
7413/// Memory allocation node parameters.
7414#[repr(C)]
7415#[derive(Copy, Clone)]
7416pub struct CUDA_MEM_ALLOC_NODE_PARAMS_v2_st {
7417    /// in: location where the allocation should reside (specified in `location`).
7418    ///
7419    /// `handleTypes` must be [`CUmemAllocationHandleType_enum::CU_MEM_HANDLE_TYPE_NONE`]. IPC is not supported.
7420    pub poolProps: CUmemPoolProps,
7421    /// in: array of memory access descriptors.
7422    ///
7423    /// Used to describe peer GPU access.
7424    pub accessDescs: *const CUmemAccessDesc,
7425    /// in: number of memory access descriptors.
7426    ///
7427    /// Must not exceed the number of GPUs.
7428    pub accessDescCount: size_t,
7429    /// in: size in bytes of the requested allocation.
7430    pub bytesize: size_t,
7431    /// out: address of the allocation returned by CUDA.
7432    pub dptr: CUdeviceptr,
7433}
7434impl Default for CUDA_MEM_ALLOC_NODE_PARAMS_v2_st {
7435    fn default() -> Self {
7436        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
7437        unsafe {
7438            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
7439            s.assume_init()
7440        }
7441    }
7442}
7443/// Memory allocation node parameters.
7444pub type CUDA_MEM_ALLOC_NODE_PARAMS_v2 = CUDA_MEM_ALLOC_NODE_PARAMS_v2_st;
7445/// Memory free node parameters.
7446#[repr(C)]
7447#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
7448pub struct CUDA_MEM_FREE_NODE_PARAMS_st {
7449    /// in: the pointer to free.
7450    pub dptr: CUdeviceptr,
7451}
7452/// Memory free node parameters.
7453pub type CUDA_MEM_FREE_NODE_PARAMS = CUDA_MEM_FREE_NODE_PARAMS_st;
7454impl CUgraphMem_attribute_enum {
7455    /// (value type = cuuint64_t) Amount of memory, in bytes, currently associated with graphs.
7456    pub const CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT: CUgraphMem_attribute_enum = CUgraphMem_attribute_enum(
7457        0,
7458    );
7459    /// (value type = cuuint64_t) High watermark of memory, in bytes, associated with graphs since the last time it was reset.
7460    ///
7461    /// High watermark can only be reset to zero.
7462    pub const CU_GRAPH_MEM_ATTR_USED_MEM_HIGH: CUgraphMem_attribute_enum = CUgraphMem_attribute_enum(
7463        1,
7464    );
7465    /// (value type = cuuint64_t) Amount of memory, in bytes, currently allocated for use by the CUDA graphs asynchronous allocator.
7466    pub const CU_GRAPH_MEM_ATTR_RESERVED_MEM_CURRENT: CUgraphMem_attribute_enum = CUgraphMem_attribute_enum(
7467        2,
7468    );
7469    /// (value type = cuuint64_t) High watermark of memory, in bytes, currently allocated for use by the CUDA graphs asynchronous allocator.
7470    pub const CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH: CUgraphMem_attribute_enum = CUgraphMem_attribute_enum(
7471        3,
7472    );
7473}
7474/// Device-level accounting and limits for memory allocated by CUDA graphs.
7475#[repr(transparent)]
7476#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
7477pub struct CUgraphMem_attribute_enum(pub ::core::ffi::c_uint);
7478pub use self::CUgraphMem_attribute_enum as CUgraphMem_attribute;
7479impl CUgraphChildGraphNodeOwnership_enum {
7480    /// Default behavior for a child graph node.
7481    ///
7482    /// Child graph is cloned into the parent and memory allocation/free nodes can’t be present in the child graph.
7483    pub const CU_GRAPH_CHILD_GRAPH_OWNERSHIP_CLONE: CUgraphChildGraphNodeOwnership_enum = CUgraphChildGraphNodeOwnership_enum(
7484        0,
7485    );
7486    /// The child graph is moved to the parent.
7487    ///
7488    /// The handle to the child graph is owned by the parent and will be destroyed when the parent is destroyed.
7489    ///
7490    /// The following restrictions apply to child graphs after they have been moved: Cannot be independently instantiated or destroyed; Cannot be added as a child graph of a separate parent graph; Cannot be used as an argument to cuGraphExecUpdate; Cannot have additional memory allocation or free nodes added.
7491    pub const CU_GRAPH_CHILD_GRAPH_OWNERSHIP_MOVE: CUgraphChildGraphNodeOwnership_enum = CUgraphChildGraphNodeOwnership_enum(
7492        1,
7493    );
7494    /// Invalid ownership flag.
7495    ///
7496    /// Set when params are queried to prevent accidentally reusing the driver-owned graph object.
7497    pub const CU_GRAPH_CHILD_GRAPH_OWNERSHIP_INVALID: CUgraphChildGraphNodeOwnership_enum = CUgraphChildGraphNodeOwnership_enum(
7498        -1,
7499    );
7500}
7501/// Child graph node ownership.
7502#[repr(transparent)]
7503#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
7504pub struct CUgraphChildGraphNodeOwnership_enum(pub ::core::ffi::c_int);
7505pub use self::CUgraphChildGraphNodeOwnership_enum as CUgraphChildGraphNodeOwnership;
7506/// Child graph node parameters.
7507#[repr(C)]
7508#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
7509pub struct CUDA_CHILD_GRAPH_NODE_PARAMS_st {
7510    /// The child graph to clone into the node for node creation, or a handle to the graph owned by the node for node query.
7511    ///
7512    /// The graph must not contain conditional nodes. Graphs containing memory allocation or memory free nodes must set the ownership to be moved to the parent.
7513    pub graph: CUgraph,
7514    /// The ownership relationship of the child graph node.
7515    pub ownership: CUgraphChildGraphNodeOwnership,
7516}
7517impl Default for CUDA_CHILD_GRAPH_NODE_PARAMS_st {
7518    fn default() -> Self {
7519        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
7520        unsafe {
7521            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
7522            s.assume_init()
7523        }
7524    }
7525}
7526/// Child graph node parameters.
7527pub type CUDA_CHILD_GRAPH_NODE_PARAMS = CUDA_CHILD_GRAPH_NODE_PARAMS_st;
7528/// Event record node parameters.
7529#[repr(C)]
7530#[derive(Copy, Clone)]
7531pub struct CUDA_EVENT_RECORD_NODE_PARAMS_st {
7532    /// The event to record when the node executes.
7533    pub event: CUevent,
7534    /// Anonymous native member. See [`CUDA_EVENT_RECORD_NODE_PARAMS_st__bindgen_ty_1`] for its fields.
7535    pub __bindgen_anon_1: CUDA_EVENT_RECORD_NODE_PARAMS_st__bindgen_ty_1,
7536}
7537/// preferred context to use for the event record
7538#[repr(C)]
7539#[derive(Copy, Clone)]
7540pub union CUDA_EVENT_RECORD_NODE_PARAMS_st__bindgen_ty_1 {
7541    /// Preferred CUDA context for the event record.
7542    pub ctx: CUcontext,
7543    /// Preferred green context for the event record.
7544    pub gCtx: CUgreenCtx,
7545}
7546impl Default for CUDA_EVENT_RECORD_NODE_PARAMS_st__bindgen_ty_1 {
7547    fn default() -> Self {
7548        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
7549        unsafe {
7550            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
7551            s.assume_init()
7552        }
7553    }
7554}
7555impl Default for CUDA_EVENT_RECORD_NODE_PARAMS_st {
7556    fn default() -> Self {
7557        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
7558        unsafe {
7559            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
7560            s.assume_init()
7561        }
7562    }
7563}
7564/// Event record node parameters.
7565pub type CUDA_EVENT_RECORD_NODE_PARAMS = CUDA_EVENT_RECORD_NODE_PARAMS_st;
7566/// Event wait node parameters.
7567#[repr(C)]
7568#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
7569pub struct CUDA_EVENT_WAIT_NODE_PARAMS_st {
7570    /// The event to wait on from the node.
7571    pub event: CUevent,
7572}
7573impl Default for CUDA_EVENT_WAIT_NODE_PARAMS_st {
7574    fn default() -> Self {
7575        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
7576        unsafe {
7577            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
7578            s.assume_init()
7579        }
7580    }
7581}
7582/// Event wait node parameters.
7583pub type CUDA_EVENT_WAIT_NODE_PARAMS = CUDA_EVENT_WAIT_NODE_PARAMS_st;
7584/// Graph node parameters.
7585///
7586/// See cuGraphAddNode.
7587#[repr(C)]
7588#[derive(Copy, Clone)]
7589pub struct CUgraphNodeParams_st {
7590    /// Type of the node.
7591    pub type_: CUgraphNodeType,
7592    /// Reserved.
7593    ///
7594    /// Must be zero.
7595    pub reserved0: [::core::ffi::c_int; 3usize],
7596    /// Anonymous native member. See [`CUgraphNodeParams_st__bindgen_ty_1`] for its fields.
7597    pub __bindgen_anon_1: CUgraphNodeParams_st__bindgen_ty_1,
7598    /// Reserved bytes.
7599    ///
7600    /// Must be zero.
7601    pub reserved2: ::core::ffi::c_longlong,
7602}
7603/// Anonymous native union in [`CUgraphNodeParams_st`]. Its members share the same storage.
7604#[repr(C)]
7605#[derive(Copy, Clone)]
7606pub union CUgraphNodeParams_st__bindgen_ty_1 {
7607    /// Padding. Unused bytes must be zero.
7608    pub reserved1: [::core::ffi::c_longlong; 29usize],
7609    /// Kernel node parameters.
7610    pub kernel: CUDA_KERNEL_NODE_PARAMS_v3,
7611    /// Memcpy node parameters.
7612    pub memcpy: CUDA_MEMCPY_NODE_PARAMS,
7613    /// Memset node parameters.
7614    pub memset: CUDA_MEMSET_NODE_PARAMS_v2,
7615    /// Host node parameters.
7616    pub host: CUDA_HOST_NODE_PARAMS_v2,
7617    /// Child graph node parameters.
7618    pub graph: CUDA_CHILD_GRAPH_NODE_PARAMS,
7619    /// Event wait node parameters.
7620    pub eventWait: CUDA_EVENT_WAIT_NODE_PARAMS,
7621    /// Event record node parameters.
7622    pub eventRecord: CUDA_EVENT_RECORD_NODE_PARAMS,
7623    /// External semaphore signal node parameters.
7624    pub extSemSignal: CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2,
7625    /// External semaphore wait node parameters.
7626    pub extSemWait: CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2,
7627    /// Memory allocation node parameters.
7628    pub alloc: CUDA_MEM_ALLOC_NODE_PARAMS_v2,
7629    /// Memory free node parameters.
7630    pub free: CUDA_MEM_FREE_NODE_PARAMS,
7631    /// MemOp node parameters.
7632    pub memOp: CUDA_BATCH_MEM_OP_NODE_PARAMS_v2,
7633    /// Conditional node parameters.
7634    pub conditional: CUDA_CONDITIONAL_NODE_PARAMS,
7635    /// Padding as bytes
7636    pub asBytes: [::core::ffi::c_char; 232usize],
7637}
7638impl Default for CUgraphNodeParams_st__bindgen_ty_1 {
7639    fn default() -> Self {
7640        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
7641        unsafe {
7642            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
7643            s.assume_init()
7644        }
7645    }
7646}
7647impl Default for CUgraphNodeParams_st {
7648    fn default() -> Self {
7649        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
7650        unsafe {
7651            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
7652            s.assume_init()
7653        }
7654    }
7655}
7656/// Graph node parameters.
7657///
7658/// See cuGraphAddNode.
7659pub type CUgraphNodeParams = CUgraphNodeParams_st;
7660impl CUflushGPUDirectRDMAWritesOptions_enum {
7661    /// [`cuFlushGPUDirectRDMAWrites`] and its CUDA Runtime API counterpart are supported on the device.
7662    pub const CU_FLUSH_GPU_DIRECT_RDMA_WRITES_OPTION_HOST: CUflushGPUDirectRDMAWritesOptions_enum = CUflushGPUDirectRDMAWritesOptions_enum(
7663        1,
7664    );
7665    /// The [`CUstreamWaitValue_flags_enum::CU_STREAM_WAIT_VALUE_FLUSH`] flag and the [`CUstreamBatchMemOpType_enum::CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES`] MemOp are supported on the device.
7666    pub const CU_FLUSH_GPU_DIRECT_RDMA_WRITES_OPTION_MEMOPS: CUflushGPUDirectRDMAWritesOptions_enum = CUflushGPUDirectRDMAWritesOptions_enum(
7667        2,
7668    );
7669}
7670/// Bitmasks for [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_FLUSH_WRITES_OPTIONS`].
7671#[repr(transparent)]
7672#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
7673pub struct CUflushGPUDirectRDMAWritesOptions_enum(pub ::core::ffi::c_uint);
7674pub use self::CUflushGPUDirectRDMAWritesOptions_enum as CUflushGPUDirectRDMAWritesOptions;
7675impl CUGPUDirectRDMAWritesOrdering_enum {
7676    /// The device does not natively support ordering of remote writes.
7677    ///
7678    /// [`cuFlushGPUDirectRDMAWrites`] can be leveraged if supported.
7679    pub const CU_GPU_DIRECT_RDMA_WRITES_ORDERING_NONE: CUGPUDirectRDMAWritesOrdering_enum = CUGPUDirectRDMAWritesOrdering_enum(
7680        0,
7681    );
7682    /// Natively, the device can consistently consume remote writes, although other CUDA devices may not.
7683    pub const CU_GPU_DIRECT_RDMA_WRITES_ORDERING_OWNER: CUGPUDirectRDMAWritesOrdering_enum = CUGPUDirectRDMAWritesOrdering_enum(
7684        100,
7685    );
7686    /// Any CUDA device in the system can consistently consume remote writes to this device.
7687    pub const CU_GPU_DIRECT_RDMA_WRITES_ORDERING_ALL_DEVICES: CUGPUDirectRDMAWritesOrdering_enum = CUGPUDirectRDMAWritesOrdering_enum(
7688        200,
7689    );
7690}
7691/// Platform native ordering for GPUDirect RDMA writes.
7692#[repr(transparent)]
7693#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
7694pub struct CUGPUDirectRDMAWritesOrdering_enum(pub ::core::ffi::c_uint);
7695pub use self::CUGPUDirectRDMAWritesOrdering_enum as CUGPUDirectRDMAWritesOrdering;
7696impl CUflushGPUDirectRDMAWritesScope_enum {
7697    /// Blocks until remote writes are visible to the CUDA device context owning the data.
7698    pub const CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TO_OWNER: CUflushGPUDirectRDMAWritesScope_enum = CUflushGPUDirectRDMAWritesScope_enum(
7699        100,
7700    );
7701    /// Blocks until remote writes are visible to all CUDA device contexts.
7702    pub const CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TO_ALL_DEVICES: CUflushGPUDirectRDMAWritesScope_enum = CUflushGPUDirectRDMAWritesScope_enum(
7703        200,
7704    );
7705}
7706/// The scopes for [`cuFlushGPUDirectRDMAWrites`].
7707#[repr(transparent)]
7708#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
7709pub struct CUflushGPUDirectRDMAWritesScope_enum(pub ::core::ffi::c_uint);
7710pub use self::CUflushGPUDirectRDMAWritesScope_enum as CUflushGPUDirectRDMAWritesScope;
7711impl CUflushGPUDirectRDMAWritesTarget_enum {
7712    /// Sets the target for [`cuFlushGPUDirectRDMAWrites`] to the currently active CUDA device context.
7713    pub const CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TARGET_CURRENT_CTX: CUflushGPUDirectRDMAWritesTarget_enum = CUflushGPUDirectRDMAWritesTarget_enum(
7714        0,
7715    );
7716}
7717/// The targets for [`cuFlushGPUDirectRDMAWrites`].
7718#[repr(transparent)]
7719#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
7720pub struct CUflushGPUDirectRDMAWritesTarget_enum(pub ::core::ffi::c_uint);
7721pub use self::CUflushGPUDirectRDMAWritesTarget_enum as CUflushGPUDirectRDMAWritesTarget;
7722impl CUgraphDebugDot_flags_enum {
7723    /// Output all debug data as if every debug flag is enabled.
7724    pub const CU_GRAPH_DEBUG_DOT_FLAGS_VERBOSE: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum(
7725        1,
7726    );
7727    /// Use CUDA Runtime structures for output.
7728    pub const CU_GRAPH_DEBUG_DOT_FLAGS_RUNTIME_TYPES: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum(
7729        2,
7730    );
7731    /// Adds CUDA_KERNEL_NODE_PARAMS values to output.
7732    pub const CU_GRAPH_DEBUG_DOT_FLAGS_KERNEL_NODE_PARAMS: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum(
7733        4,
7734    );
7735    /// Adds CUDA_MEMCPY3D values to output.
7736    pub const CU_GRAPH_DEBUG_DOT_FLAGS_MEMCPY_NODE_PARAMS: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum(
7737        8,
7738    );
7739    /// Adds CUDA_MEMSET_NODE_PARAMS values to output.
7740    pub const CU_GRAPH_DEBUG_DOT_FLAGS_MEMSET_NODE_PARAMS: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum(
7741        16,
7742    );
7743    /// Adds CUDA_HOST_NODE_PARAMS values to output.
7744    pub const CU_GRAPH_DEBUG_DOT_FLAGS_HOST_NODE_PARAMS: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum(
7745        32,
7746    );
7747    /// Adds CUevent handle from record and wait nodes to output.
7748    pub const CU_GRAPH_DEBUG_DOT_FLAGS_EVENT_NODE_PARAMS: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum(
7749        64,
7750    );
7751    /// Adds CUDA_EXT_SEM_SIGNAL_NODE_PARAMS values to output.
7752    pub const CU_GRAPH_DEBUG_DOT_FLAGS_EXT_SEMAS_SIGNAL_NODE_PARAMS: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum(
7753        128,
7754    );
7755    /// Adds CUDA_EXT_SEM_WAIT_NODE_PARAMS values to output.
7756    pub const CU_GRAPH_DEBUG_DOT_FLAGS_EXT_SEMAS_WAIT_NODE_PARAMS: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum(
7757        256,
7758    );
7759    /// Adds CUkernelNodeAttrValue values to output.
7760    pub const CU_GRAPH_DEBUG_DOT_FLAGS_KERNEL_NODE_ATTRIBUTES: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum(
7761        512,
7762    );
7763    /// Adds node handles and every kernel function handle to output.
7764    pub const CU_GRAPH_DEBUG_DOT_FLAGS_HANDLES: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum(
7765        1024,
7766    );
7767    /// Adds memory alloc node parameters to output.
7768    pub const CU_GRAPH_DEBUG_DOT_FLAGS_MEM_ALLOC_NODE_PARAMS: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum(
7769        2048,
7770    );
7771    /// Adds memory free node parameters to output.
7772    pub const CU_GRAPH_DEBUG_DOT_FLAGS_MEM_FREE_NODE_PARAMS: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum(
7773        4096,
7774    );
7775    /// Adds batch mem op node parameters to output.
7776    pub const CU_GRAPH_DEBUG_DOT_FLAGS_BATCH_MEM_OP_NODE_PARAMS: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum(
7777        8192,
7778    );
7779    /// Adds edge numbering information.
7780    pub const CU_GRAPH_DEBUG_DOT_FLAGS_EXTRA_TOPO_INFO: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum(
7781        16384,
7782    );
7783    /// Adds conditional node parameters to output.
7784    pub const CU_GRAPH_DEBUG_DOT_FLAGS_CONDITIONAL_NODE_PARAMS: CUgraphDebugDot_flags_enum = CUgraphDebugDot_flags_enum(
7785        32768,
7786    );
7787}
7788/// The additional write options for [`cuGraphDebugDotPrint`].
7789#[repr(transparent)]
7790#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
7791pub struct CUgraphDebugDot_flags_enum(pub ::core::ffi::c_uint);
7792pub use self::CUgraphDebugDot_flags_enum as CUgraphDebugDot_flags;
7793impl CUuserObject_flags_enum {
7794    /// Indicates the destructor execution is not synchronized by any CUDA handle.
7795    pub const CU_USER_OBJECT_NO_DESTRUCTOR_SYNC: CUuserObject_flags_enum = CUuserObject_flags_enum(
7796        1,
7797    );
7798}
7799/// Flags for user objects for graphs.
7800#[repr(transparent)]
7801#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
7802pub struct CUuserObject_flags_enum(pub ::core::ffi::c_uint);
7803pub use self::CUuserObject_flags_enum as CUuserObject_flags;
7804impl CUuserObjectRetain_flags_enum {
7805    /// Transfer references from the caller rather than creating new references.
7806    pub const CU_GRAPH_USER_OBJECT_MOVE: CUuserObjectRetain_flags_enum = CUuserObjectRetain_flags_enum(
7807        1,
7808    );
7809}
7810/// Flags for retaining user object references for graphs.
7811#[repr(transparent)]
7812#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
7813pub struct CUuserObjectRetain_flags_enum(pub ::core::ffi::c_uint);
7814pub use self::CUuserObjectRetain_flags_enum as CUuserObjectRetain_flags;
7815impl CUgraphInstantiate_flags_enum {
7816    /// Automatically free memory allocated in a graph before relaunching.
7817    pub const CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH: CUgraphInstantiate_flags_enum = CUgraphInstantiate_flags_enum(
7818        1,
7819    );
7820    /// Automatically upload the graph after instantiation.
7821    ///
7822    /// Only supported by [`cuGraphInstantiateWithParams`]. The upload will be performed using the stream provided in `instantiateParams`.
7823    pub const CUDA_GRAPH_INSTANTIATE_FLAG_UPLOAD: CUgraphInstantiate_flags_enum = CUgraphInstantiate_flags_enum(
7824        2,
7825    );
7826    /// Instantiate the graph to be launchable from the device.
7827    ///
7828    /// This flag can only be used on platforms which support unified addressing. This flag cannot be used in conjunction with [`CUgraphInstantiate_flags::CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH`].
7829    pub const CUDA_GRAPH_INSTANTIATE_FLAG_DEVICE_LAUNCH: CUgraphInstantiate_flags_enum = CUgraphInstantiate_flags_enum(
7830        4,
7831    );
7832    /// Run the graph using the per-node priority attributes rather than the priority of the stream it is launched into.
7833    pub const CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY: CUgraphInstantiate_flags_enum = CUgraphInstantiate_flags_enum(
7834        8,
7835    );
7836}
7837/// Flags for instantiating a graph.
7838#[repr(transparent)]
7839#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
7840pub struct CUgraphInstantiate_flags_enum(pub ::core::ffi::c_uint);
7841pub use self::CUgraphInstantiate_flags_enum as CUgraphInstantiate_flags;
7842impl CUdeviceNumaConfig_enum {
7843    /// The GPU is not a NUMA node.
7844    pub const CU_DEVICE_NUMA_CONFIG_NONE: CUdeviceNumaConfig_enum = CUdeviceNumaConfig_enum(
7845        0,
7846    );
7847    /// The GPU is a NUMA node, [`CUdevice_attribute::CU_DEVICE_ATTRIBUTE_NUMA_ID`] contains its NUMA ID.
7848    pub const CU_DEVICE_NUMA_CONFIG_NUMA_NODE: CUdeviceNumaConfig_enum = CUdeviceNumaConfig_enum(
7849        1,
7850    );
7851}
7852/// CUDA device NUMA configuration.
7853#[repr(transparent)]
7854#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
7855pub struct CUdeviceNumaConfig_enum(pub ::core::ffi::c_uint);
7856pub use self::CUdeviceNumaConfig_enum as CUdeviceNumaConfig;
7857impl CUprocessState_enum {
7858    /// Default process state.
7859    pub const CU_PROCESS_STATE_RUNNING: CUprocessState_enum = CUprocessState_enum(0);
7860    /// CUDA API locks are taken so further CUDA API calls will block.
7861    pub const CU_PROCESS_STATE_LOCKED: CUprocessState_enum = CUprocessState_enum(1);
7862    /// Application memory contents have been checkpointed and underlying allocations and device handles have been released.
7863    pub const CU_PROCESS_STATE_CHECKPOINTED: CUprocessState_enum = CUprocessState_enum(
7864        2,
7865    );
7866    /// Application entered an uncorrectable error during the checkpoint/restore process.
7867    pub const CU_PROCESS_STATE_FAILED: CUprocessState_enum = CUprocessState_enum(3);
7868    /// Application memory contents are being checkpointed.
7869    pub const CU_PROCESS_STATE_CHECKPOINTING: CUprocessState_enum = CUprocessState_enum(
7870        4,
7871    );
7872    /// Application memory contents are being restored.
7873    pub const CU_PROCESS_STATE_RESTORING: CUprocessState_enum = CUprocessState_enum(5);
7874}
7875/// CUDA Process States.
7876#[repr(transparent)]
7877#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
7878pub struct CUprocessState_enum(pub ::core::ffi::c_uint);
7879pub use self::CUprocessState_enum as CUprocessState;
7880/// Per-GPU data for zero-copy mapped device memory used with CUDA checkpoint/restore on custom storage.
7881#[repr(C)]
7882#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
7883pub struct CUcheckpointCustomStoragePerDeviceData_st {
7884    /// Zero-copy mapped device memory pointer for the user to copy to/from.
7885    pub devPtr: CUdeviceptr,
7886    /// Size of mapped memory.
7887    pub size: size_t,
7888    /// Stream the user may use for the copy; the CUDA driver synchronizes on this stream before completing checkpoint or restore.
7889    pub stream: CUstream,
7890}
7891impl Default for CUcheckpointCustomStoragePerDeviceData_st {
7892    fn default() -> Self {
7893        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
7894        unsafe {
7895            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
7896            s.assume_init()
7897        }
7898    }
7899}
7900/// Per-GPU data for zero-copy mapped device memory used with CUDA checkpoint/restore on custom storage.
7901pub type CUcheckpointCustomStoragePerDeviceData = CUcheckpointCustomStoragePerDeviceData_st;
7902/// Incomplete native type used by [`CUcheckpointOperationHandle`] handles. The native API owns its layout.
7903#[repr(C)]
7904#[derive(Debug, Copy, Clone)]
7905pub struct CUIcheckpointOperation_st {
7906    _unused: [u8; 0],
7907}
7908/// Handle for a CUDA custom storage checkpoint or restore operation awaiting completion.
7909pub type CUcheckpointOperationHandle = *mut CUIcheckpointOperation_st;
7910/// Output from CUDA custom storage checkpoint/restore: per-GPU device pointers and a handle to complete the operation.
7911#[repr(C)]
7912#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
7913pub struct CUcheckpointCustomStorageInfo_st {
7914    /// Handle returned that is needed to complete checkpoint or restore.
7915    pub handle: CUcheckpointOperationHandle,
7916    /// Returned pointer to array of per-device data, one per device.
7917    ///
7918    /// User should set to NULL.
7919    pub perDeviceData: *mut CUcheckpointCustomStoragePerDeviceData,
7920    /// Number of devices (and elements in `perDeviceData` array).
7921    pub deviceCount: ::core::ffi::c_uint,
7922}
7923impl Default for CUcheckpointCustomStorageInfo_st {
7924    fn default() -> Self {
7925        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
7926        unsafe {
7927            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
7928            s.assume_init()
7929        }
7930    }
7931}
7932/// Output from CUDA custom storage checkpoint/restore: per-GPU device pointers and a handle to complete the operation.
7933pub type CUcheckpointCustomStorageInfo = CUcheckpointCustomStorageInfo_st;
7934/// CUDA checkpoint optional lock arguments.
7935#[repr(C)]
7936#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
7937pub struct CUcheckpointLockArgs_st {
7938    /// Timeout in milliseconds to attempt to lock the process, 0 indicates no timeout.
7939    pub timeoutMs: ::core::ffi::c_uint,
7940    /// Reserved for future use, must be zero.
7941    pub reserved0: ::core::ffi::c_uint,
7942    /// Reserved for future use, must be zeroed.
7943    pub reserved1: [cuuint64_t; 7usize],
7944}
7945/// CUDA checkpoint optional lock arguments.
7946pub type CUcheckpointLockArgs = CUcheckpointLockArgs_st;
7947/// CUDA checkpoint optional checkpoint arguments.
7948#[repr(C)]
7949#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
7950pub struct CUcheckpointCheckpointArgs_st {
7951    /// Optional custom storage; if NULL, GPU memory is checkpointed to host.
7952    pub customStorageInfo_out: *mut *mut CUcheckpointCustomStorageInfo,
7953    /// Reserved for future use, must be zeroed.
7954    pub reserved: [::core::ffi::c_char; 56usize],
7955}
7956impl Default for CUcheckpointCheckpointArgs_st {
7957    fn default() -> Self {
7958        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
7959        unsafe {
7960            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
7961            s.assume_init()
7962        }
7963    }
7964}
7965/// CUDA checkpoint optional checkpoint arguments.
7966pub type CUcheckpointCheckpointArgs = CUcheckpointCheckpointArgs_st;
7967/// CUDA checkpoint GPU UUID pairs for device remapping during restore.
7968#[repr(C)]
7969#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
7970pub struct CUcheckpointGpuPair_st {
7971    /// UUID of the GPU that was checkpointed.
7972    pub oldUuid: CUuuid,
7973    /// UUID of the GPU to restore onto.
7974    pub newUuid: CUuuid,
7975}
7976/// CUDA checkpoint GPU UUID pairs for device remapping during restore.
7977pub type CUcheckpointGpuPair = CUcheckpointGpuPair_st;
7978/// CUDA checkpoint optional restore arguments.
7979#[repr(C)]
7980#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
7981pub struct CUcheckpointRestoreArgs_st {
7982    /// Pointer to array of gpu pairs that indicate how to remap GPUs during restore.
7983    pub gpuPairs: *mut CUcheckpointGpuPair,
7984    /// Number of gpu pairs to remap.
7985    pub gpuPairsCount: ::core::ffi::c_uint,
7986    /// Padding to align the following fields.
7987    pub padding0: ::core::ffi::c_uint,
7988    /// Optional custom storage; if NULL, GPU memory is restored from host.
7989    pub customStorageInfo_out: *mut *mut CUcheckpointCustomStorageInfo,
7990    /// Reserved for future use, must be zeroed; includes alignment before `customStorageInfo`.
7991    pub reserved: [::core::ffi::c_char; 40usize],
7992}
7993impl Default for CUcheckpointRestoreArgs_st {
7994    fn default() -> Self {
7995        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
7996        unsafe {
7997            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
7998            s.assume_init()
7999        }
8000    }
8001}
8002/// CUDA checkpoint optional restore arguments.
8003pub type CUcheckpointRestoreArgs = CUcheckpointRestoreArgs_st;
8004/// CUDA checkpoint optional unlock arguments.
8005#[repr(C)]
8006#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
8007pub struct CUcheckpointUnlockArgs_st {
8008    /// Reserved for future use, must be zeroed.
8009    pub reserved: [cuuint64_t; 8usize],
8010}
8011/// CUDA checkpoint optional unlock arguments.
8012pub type CUcheckpointUnlockArgs = CUcheckpointUnlockArgs_st;
8013singe_loader::functions! { crate::DRIVER;
8014    /// Gets the string description of an error code.
8015    ///
8016    /// Sets `*pStr` to the address of a NULL-terminated string description of the error code `error`. If the error code is not recognized, [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] will be returned and `*pStr` will be set to the NULL address.
8017    ///
8018    /// # Parameters
8019    ///
8020    /// - `error`: Error code to convert to string.
8021    /// - `pStr`: Address of the string pointer.
8022    ///
8023    /// # Return value
8024    ///
8025    /// - [`CUresult::CUDA_SUCCESS`]
8026    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8027    ///
8028    /// See also: [`CUresult`], `cudaGetErrorString`.
8029    pub fn cuGetErrorString(
8030        error: CUresult,
8031        pStr: *mut *const ::core::ffi::c_char,
8032    ) -> CUresult;
8033}
8034singe_loader::functions! { crate::DRIVER;
8035    /// Gets the string representation of an error code enum name.
8036    ///
8037    /// Sets `*pStr` to the address of a NULL-terminated string representation of the name of the enum error code `error`. If the error code is not recognized, [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] will be returned and `*pStr` will be set to the NULL address.
8038    ///
8039    /// # Parameters
8040    ///
8041    /// - `error`: Error code to convert to string.
8042    /// - `pStr`: Address of the string pointer.
8043    ///
8044    /// # Return value
8045    ///
8046    /// - [`CUresult::CUDA_SUCCESS`]
8047    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8048    ///
8049    /// See also: [`CUresult`], `cudaGetErrorName`.
8050    pub fn cuGetErrorName(
8051        error: CUresult,
8052        pStr: *mut *const ::core::ffi::c_char,
8053    ) -> CUresult;
8054}
8055singe_loader::functions! { crate::DRIVER;
8056    /// Initialize the CUDA driver API Initializes the driver API and must be called before any other function from the driver API in the current process.
8057    ///
8058    /// Currently, the `Flags` parameter must be 0. If [`cuInit`] has not been called, any function from the driver API will return [`cudaError_enum::CUDA_ERROR_NOT_INITIALIZED`].
8059    ///
8060    /// Note: cuInit preloads various libraries needed for JIT compilation. To opt-out of this behavior, set the environment variable CUDA_FORCE_PRELOAD_LIBRARIES=0. CUDA will lazily load JIT libraries as needed. To disable JIT entirely, set the environment variable CUDA_DISABLE_JIT=1.
8061    ///
8062    /// Note that this function may also return error codes from previous, asynchronous launches.
8063    ///
8064    /// # Parameters
8065    ///
8066    /// - `Flags`: Initialization flag for CUDA.
8067    ///
8068    /// # Return value
8069    ///
8070    /// - [`CUresult::CUDA_SUCCESS`]
8071    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8072    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
8073    /// - [`CUresult::CUDA_ERROR_SYSTEM_DRIVER_MISMATCH`]
8074    /// - [`CUresult::CUDA_ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE`]
8075    pub fn cuInit(Flags: ::core::ffi::c_uint) -> CUresult;
8076}
8077singe_loader::functions! { crate::DRIVER;
8078    /// Returns the latest CUDA version supported by driver.
8079    ///
8080    /// Returns in `*driverVersion` the version of CUDA supported by the driver. The version is returned as (1000 \* major + 10 \* minor). For example, CUDA 9.2 would be represented by 9020.
8081    ///
8082    /// This function automatically returns [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] if `driverVersion` is NULL.
8083    ///
8084    /// Note that this function may also return error codes from previous, asynchronous launches.
8085    ///
8086    /// # Parameters
8087    ///
8088    /// - `driverVersion`: Returns the CUDA driver version
8089    ///
8090    /// # Return value
8091    ///
8092    /// - [`CUresult::CUDA_SUCCESS`]
8093    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8094    ///
8095    /// See also: `cudaDriverGetVersion`, `cudaRuntimeGetVersion`.
8096    pub fn cuDriverGetVersion(driverVersion: *mut ::core::ffi::c_int) -> CUresult;
8097}
8098singe_loader::functions! { crate::DRIVER;
8099    /// Returns a handle to a compute device.
8100    ///
8101    /// Returns in `*device` a device handle given an ordinal in the range **[0, [`cuDeviceGetCount`]-1]**.
8102    ///
8103    /// Note that this function may also return error codes from previous, asynchronous launches.
8104    ///
8105    /// # Parameters
8106    ///
8107    /// - `device`: Returned device handle.
8108    /// - `ordinal`: Device number to get handle for.
8109    ///
8110    /// # Return value
8111    ///
8112    /// - [`CUresult::CUDA_SUCCESS`]
8113    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
8114    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
8115    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
8116    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8117    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
8118    ///
8119    /// See also: [`cuDeviceGetAttribute`], [`cuDeviceGetCount`], [`cuDeviceGetName`], [`cuDeviceGetUuid`], [`cuDeviceGetLuid`], [`cuDeviceTotalMem`], [`cuDeviceGetExecAffinitySupport`].
8120    pub fn cuDeviceGet(device: *mut CUdevice, ordinal: ::core::ffi::c_int) -> CUresult;
8121}
8122singe_loader::functions! { crate::DRIVER;
8123    /// Returns the number of compute-capable devices.
8124    ///
8125    /// Returns in `*count` the number of devices with compute capability greater than or equal to 2.0 that are available for execution. If there is no such device, [`cuDeviceGetCount`] returns 0.
8126    ///
8127    /// Note that this function may also return error codes from previous, asynchronous launches.
8128    ///
8129    /// # Parameters
8130    ///
8131    /// - `count`: Returned number of compute-capable devices
8132    ///
8133    /// # Return value
8134    ///
8135    /// - [`CUresult::CUDA_SUCCESS`]
8136    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
8137    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
8138    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
8139    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8140    ///
8141    /// See also: [`cuDeviceGetAttribute`], [`cuDeviceGetName`], [`cuDeviceGetUuid`], [`cuDeviceGetLuid`], [`cuDeviceGet`], [`cuDeviceTotalMem`], [`cuDeviceGetExecAffinitySupport`], `cudaGetDeviceCount`.
8142    pub fn cuDeviceGetCount(count: *mut ::core::ffi::c_int) -> CUresult;
8143}
8144singe_loader::functions! { crate::DRIVER;
8145    /// Returns an identifier string for the device.
8146    ///
8147    /// Returns an ASCII string identifying the device `dev` in the NULL-terminated string pointed to by `name`. `len` specifies the maximum length of the string that may be returned. `name` is shortened to the specified `len`, if `len` is less than the device name.
8148    ///
8149    /// Note that this function may also return error codes from previous, asynchronous launches.
8150    ///
8151    /// # Parameters
8152    ///
8153    /// - `name`: Returned identifier string for the device.
8154    /// - `len`: Maximum length of string to store in `name`.
8155    /// - `dev`: Device to get identifier string for.
8156    ///
8157    /// # Return value
8158    ///
8159    /// - [`CUresult::CUDA_SUCCESS`]
8160    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
8161    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
8162    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
8163    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8164    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
8165    ///
8166    /// See also: [`cuDeviceGetAttribute`], [`cuDeviceGetUuid`], [`cuDeviceGetLuid`], [`cuDeviceGetCount`], [`cuDeviceGet`], [`cuDeviceTotalMem`], [`cuDeviceGetExecAffinitySupport`], `cudaGetDeviceProperties`.
8167    pub fn cuDeviceGetName(
8168        name: *mut ::core::ffi::c_char,
8169        len: ::core::ffi::c_int,
8170        dev: CUdevice,
8171    ) -> CUresult;
8172}
8173singe_loader::functions! { crate::DRIVER;
8174    /// Return an UUID for the device.
8175    ///
8176    /// Returns 16-octets identifying the device `dev` in the structure pointed by the `uuid`. If the device is in MIG mode, returns its MIG UUID which uniquely identifies the subscribed MIG compute instance.
8177    ///
8178    /// Note that this function may also return error codes from previous, asynchronous launches.
8179    ///
8180    /// # Parameters
8181    ///
8182    /// - `uuid`: Returned UUID.
8183    /// - `dev`: Device to get identifier string for.
8184    ///
8185    /// # Return value
8186    ///
8187    /// - [`CUresult::CUDA_SUCCESS`]
8188    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
8189    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
8190    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8191    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
8192    ///
8193    /// See also: [`cuDeviceGetAttribute`], [`cuDeviceGetCount`], [`cuDeviceGetName`], [`cuDeviceGetLuid`], [`cuDeviceGet`], [`cuDeviceTotalMem`], `cudaGetDeviceProperties`.
8194    pub fn cuDeviceGetUuid_v2(uuid: *mut CUuuid, dev: CUdevice) -> CUresult;
8195}
8196singe_loader::functions! { crate::DRIVER;
8197    /// Return an LUID and device node mask for the device.
8198    ///
8199    /// Return identifying information (`luid` and `deviceNodeMask`) to allow matching device with graphics APIs.
8200    ///
8201    /// Note that this function may also return error codes from previous, asynchronous launches.
8202    ///
8203    /// # Parameters
8204    ///
8205    /// - `luid`: Returned LUID.
8206    /// - `deviceNodeMask`: Returned device node mask.
8207    /// - `dev`: Device to get identifier string for.
8208    ///
8209    /// # Return value
8210    ///
8211    /// - [`CUresult::CUDA_SUCCESS`]
8212    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
8213    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
8214    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8215    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
8216    ///
8217    /// See also: [`cuDeviceGetAttribute`], [`cuDeviceGetCount`], [`cuDeviceGetName`], [`cuDeviceGet`], [`cuDeviceTotalMem`], [`cuDeviceGetExecAffinitySupport`], `cudaGetDeviceProperties`.
8218    pub fn cuDeviceGetLuid(
8219        luid: *mut ::core::ffi::c_char,
8220        deviceNodeMask: *mut ::core::ffi::c_uint,
8221        dev: CUdevice,
8222    ) -> CUresult;
8223}
8224singe_loader::functions! { crate::DRIVER;
8225    /// Returns the total amount of memory on the device.
8226    ///
8227    /// Returns in `*bytes` the total amount of memory available on the device `dev` in bytes.
8228    ///
8229    /// Note that this function may also return error codes from previous, asynchronous launches.
8230    ///
8231    /// # Parameters
8232    ///
8233    /// - `bytes`: Returned memory available on device in bytes.
8234    /// - `dev`: Device handle.
8235    ///
8236    /// # Return value
8237    ///
8238    /// - [`CUresult::CUDA_SUCCESS`]
8239    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
8240    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
8241    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
8242    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8243    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
8244    ///
8245    /// See also: [`cuDeviceGetAttribute`], [`cuDeviceGetCount`], [`cuDeviceGetName`], [`cuDeviceGetUuid`], [`cuDeviceGet`], [`cuDeviceGetExecAffinitySupport`], `cudaMemGetInfo`.
8246    pub fn cuDeviceTotalMem_v2(bytes: *mut size_t, dev: CUdevice) -> CUresult;
8247}
8248singe_loader::functions! { crate::DRIVER;
8249    /// Returns the maximum number of elements allocatable in a 1D linear texture for a given texture element size.
8250    ///
8251    /// Returns in `maxWidthInElements` the maximum number of texture elements allocatable in a 1D linear texture for given `format` and `numChannels`.
8252    ///
8253    /// Note that this function may also return error codes from previous, asynchronous launches.
8254    ///
8255    /// # Parameters
8256    ///
8257    /// - `maxWidthInElements`: Returned maximum number of texture elements allocatable for given `format` and `numChannels`.
8258    /// - `format`: Texture format.
8259    /// - `numChannels`: Number of channels per texture element.
8260    /// - `dev`: Device handle.
8261    ///
8262    /// # Return value
8263    ///
8264    /// - [`CUresult::CUDA_SUCCESS`]
8265    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
8266    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
8267    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
8268    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8269    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
8270    ///
8271    /// See also: [`cuDeviceGetAttribute`], [`cuDeviceGetCount`], [`cuDeviceGetName`], [`cuDeviceGetUuid`], [`cuDeviceGet`], `cudaMemGetInfo`, [`cuDeviceTotalMem`].
8272    pub fn cuDeviceGetTexture1DLinearMaxWidth(
8273        maxWidthInElements: *mut size_t,
8274        format: CUarray_format,
8275        numChannels: ::core::ffi::c_uint,
8276        dev: CUdevice,
8277    ) -> CUresult;
8278}
8279singe_loader::functions! { crate::DRIVER;
8280    /// Returns information about the device.
8281    ///
8282    /// Returns in `*pi` the integer value of the attribute `attrib` on device `dev`.
8283    ///
8284    /// Note that this function may also return error codes from previous, asynchronous launches.
8285    ///
8286    /// # Parameters
8287    ///
8288    /// - `pi`: Returned device attribute value.
8289    /// - `attrib`: Device attribute to query.
8290    /// - `dev`: Device handle.
8291    ///
8292    /// # Return value
8293    ///
8294    /// - [`CUresult::CUDA_SUCCESS`]
8295    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
8296    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
8297    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
8298    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8299    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
8300    ///
8301    /// See also: [`cuDeviceGetCount`], [`cuDeviceGetName`], [`cuDeviceGetUuid`], [`cuDeviceGet`], [`cuDeviceTotalMem`], [`cuDeviceGetExecAffinitySupport`], `cudaDeviceGetAttribute`, `cudaGetDeviceProperties`.
8302    pub fn cuDeviceGetAttribute(
8303        pi: *mut ::core::ffi::c_int,
8304        attrib: CUdevice_attribute,
8305        dev: CUdevice,
8306    ) -> CUresult;
8307}
8308singe_loader::functions! { crate::DRIVER;
8309    /// Queries details about atomic operations supported between the device and host.
8310    ///
8311    /// Returns in `*capabilities` the details about requested atomic `*operations` over the link between `dev` and the host. The allocated size of `*operations` and `*capabilities` must be `count`.
8312    ///
8313    /// For each [`CUatomicOperation`] in `*operations`, the corresponding result in `*capabilities` will be a bitmask indicating which of [`CUatomicOperationCapability`] the link supports natively.
8314    ///
8315    /// Returns [`cudaError_enum::CUDA_ERROR_INVALID_DEVICE`] if `dev` is not valid.
8316    ///
8317    /// Returns [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] if `*capabilities` or `*operations` is NULL, if `count` is 0, or if any of `*operations` is not valid.
8318    ///
8319    /// Note that this function may also return error codes from previous, asynchronous launches.
8320    ///
8321    /// # Parameters
8322    ///
8323    /// - `capabilities`: Returned capability details of each requested operation.
8324    /// - `operations`: Requested operations.
8325    /// - `count`: Count of requested operations and size of capabilities.
8326    /// - `dev`: Device handle.
8327    ///
8328    /// # Return value
8329    ///
8330    /// - [`CUresult::CUDA_SUCCESS`]
8331    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
8332    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8333    ///
8334    /// See also: [`cuDeviceGetAttribute`], [`cuDeviceGetP2PAtomicCapabilities`], `cudaDeviceGeHostAtomicCapabilities`.
8335    pub fn cuDeviceGetHostAtomicCapabilities(
8336        capabilities: *mut ::core::ffi::c_uint,
8337        operations: *const CUatomicOperation,
8338        count: ::core::ffi::c_uint,
8339        dev: CUdevice,
8340    ) -> CUresult;
8341}
8342singe_loader::functions! { crate::DRIVER;
8343    /// Return NvSciSync attributes that this device can support.
8344    ///
8345    /// Returns in `nvSciSyncAttrList`, the properties of NvSciSync that this CUDA device, `dev` can support. The returned `nvSciSyncAttrList` can be used to create an NvSciSync object that matches this device’s capabilities.
8346    ///
8347    /// If NvSciSyncAttrKey_RequiredPerm field in `nvSciSyncAttrList` is already set this API will return [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`].
8348    ///
8349    /// The applications should set `nvSciSyncAttrList` to a valid NvSciSyncAttrList failing which this API will return [`cudaError_enum::CUDA_ERROR_INVALID_HANDLE`].
8350    ///
8351    /// The `flags` controls how applications intends to use the NvSciSync created from the `nvSciSyncAttrList`. The valid flags are:
8352    ///
8353    /// * [`CUDA_NVSCISYNC_ATTR_SIGNAL`], specifies that the applications intends to signal an NvSciSync on this CUDA device.
8354    /// * [`CUDA_NVSCISYNC_ATTR_WAIT`], specifies that the applications intends to wait on an NvSciSync on this CUDA device.
8355    ///
8356    /// At least one of these flags must be set, failing which the API returns [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`]. Both the flags are orthogonal to one another: a developer may set both these flags that allows to set both wait and signal specific attributes in the same `nvSciSyncAttrList`.
8357    ///
8358    /// Note that this API updates the input `nvSciSyncAttrList` with values equivalent to the following public attribute key-values: NvSciSyncAttrKey_RequiredPerm is set to
8359    ///
8360    /// * NvSciSyncAccessPerm_SignalOnly if [`CUDA_NVSCISYNC_ATTR_SIGNAL`] is set in `flags`.
8361    /// * NvSciSyncAccessPerm_WaitOnly if [`CUDA_NVSCISYNC_ATTR_WAIT`] is set in `flags`.
8362    /// * NvSciSyncAccessPerm_WaitSignal if both [`CUDA_NVSCISYNC_ATTR_WAIT`] and [`CUDA_NVSCISYNC_ATTR_SIGNAL`] are set in `flags`. NvSciSyncAttrKey_PrimitiveInfo is set to
8363    /// * NvSciSyncAttrValPrimitiveType_SysmemSemaphore on any valid `device`.
8364    /// * NvSciSyncAttrValPrimitiveType_Syncpoint if `device` is a Tegra device.
8365    /// * NvSciSyncAttrValPrimitiveType_SysmemSemaphorePayload64b if `device` is GA10X+. NvSciSyncAttrKey_GpuId is set to the same UUID that is returned for this `device` from cuDeviceGetUuid.
8366    ///
8367    /// [`cudaError_enum::CUDA_SUCCESS`], [`cudaError_enum::CUDA_ERROR_DEINITIALIZED`], [`cudaError_enum::CUDA_ERROR_NOT_INITIALIZED`], [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`], [`cudaError_enum::CUDA_ERROR_INVALID_HANDLE`], [`cudaError_enum::CUDA_ERROR_INVALID_DEVICE`], [`cudaError_enum::CUDA_ERROR_NOT_SUPPORTED`], [`cudaError_enum::CUDA_ERROR_OUT_OF_MEMORY`].
8368    ///
8369    /// # Parameters
8370    ///
8371    /// - `nvSciSyncAttrList`: Return NvSciSync attributes supported.
8372    /// - `dev`: Valid CUDA Device to get NvSciSync attributes for.
8373    /// - `flags`: flags describing NvSciSync usage.
8374    ///
8375    /// See also: [`cuImportExternalSemaphore`], [`cuDestroyExternalSemaphore`], [`cuSignalExternalSemaphoresAsync`], [`cuWaitExternalSemaphoresAsync`].
8376    pub fn cuDeviceGetNvSciSyncAttributes(
8377        nvSciSyncAttrList: *mut ::core::ffi::c_void,
8378        dev: CUdevice,
8379        flags: ::core::ffi::c_int,
8380    ) -> CUresult;
8381}
8382singe_loader::functions! { crate::DRIVER;
8383    /// Sets the current memory pool of a device.
8384    ///
8385    /// The memory pool must be local to the specified device. [`cuMemAllocAsync`] allocates from the current mempool of the provided stream’s device. By default, a device’s current memory pool is its default memory pool.
8386    ///
8387    /// Note: Use [`cuMemAllocFromPoolAsync`] to specify asynchronous allocations from a device different than the one the stream runs on.
8388    ///
8389    /// # Return value
8390    ///
8391    /// - [`CUresult::CUDA_SUCCESS`]
8392    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8393    ///
8394    /// See also: [`cuDeviceGetDefaultMemPool`], [`cuDeviceGetMemPool`], [`cuMemPoolCreate`], [`cuMemPoolDestroy`], [`cuMemAllocFromPoolAsync`].
8395    pub fn cuDeviceSetMemPool(dev: CUdevice, pool: CUmemoryPool) -> CUresult;
8396}
8397singe_loader::functions! { crate::DRIVER;
8398    /// Gets the current mempool for a device.
8399    ///
8400    /// Returns the last pool provided to [`cuDeviceSetMemPool`] for this device or the device’s default memory pool if [`cuDeviceSetMemPool`] has never been called. By default the current mempool is the default mempool for a device. Otherwise the returned pool must have been set with [`cuDeviceSetMemPool`].
8401    ///
8402    /// # Return value
8403    ///
8404    /// - [`CUresult::CUDA_SUCCESS`]
8405    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8406    ///
8407    /// See also: [`cuDeviceGetDefaultMemPool`], [`cuMemPoolCreate`], [`cuDeviceSetMemPool`].
8408    pub fn cuDeviceGetMemPool(pool: *mut CUmemoryPool, dev: CUdevice) -> CUresult;
8409}
8410singe_loader::functions! { crate::DRIVER;
8411    /// Returns the default mempool of a device.
8412    ///
8413    /// The default mempool of a device contains device memory from that device.
8414    ///
8415    /// Note that this function may also return error codes from previous, asynchronous launches.
8416    ///
8417    /// # Return value
8418    ///
8419    /// - [`CUresult::CUDA_SUCCESS`]
8420    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
8421    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
8422    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8423    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
8424    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
8425    ///
8426    /// See also: [`cuMemAllocAsync`], [`cuMemPoolTrimTo`], [`cuMemPoolGetAttribute`], [`cuMemPoolSetAttribute`], [`cuMemPoolSetAccess`], [`cuDeviceGetMemPool`], [`cuMemPoolCreate`].
8427    pub fn cuDeviceGetDefaultMemPool(
8428        pool_out: *mut CUmemoryPool,
8429        dev: CUdevice,
8430    ) -> CUresult;
8431}
8432singe_loader::functions! { crate::DRIVER;
8433    /// Returns information about the execution affinity support of the device.
8434    ///
8435    /// Returns in `*pi` whether execution affinity type `type` is supported by device `dev`. The supported types are:
8436    ///
8437    /// * [`CUexecAffinityType_enum::CU_EXEC_AFFINITY_TYPE_SM_COUNT`]: 1 if context with limited SMs is supported by the device, or 0 if not;.
8438    ///
8439    /// Note that this function may also return error codes from previous, asynchronous launches.
8440    ///
8441    /// # Parameters
8442    ///
8443    /// - `pi`: 1 if the execution affinity type `type` is supported by the device, or 0 if not.
8444    /// - `type_`: Execution affinity type to query.
8445    /// - `dev`: Device handle.
8446    ///
8447    /// # Return value
8448    ///
8449    /// - [`CUresult::CUDA_SUCCESS`]
8450    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
8451    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
8452    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
8453    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8454    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
8455    ///
8456    /// See also: [`cuDeviceGetAttribute`], [`cuDeviceGetCount`], [`cuDeviceGetName`], [`cuDeviceGetUuid`], [`cuDeviceGet`], [`cuDeviceTotalMem`].
8457    pub fn cuDeviceGetExecAffinitySupport(
8458        pi: *mut ::core::ffi::c_int,
8459        type_: CUexecAffinityType,
8460        dev: CUdevice,
8461    ) -> CUresult;
8462}
8463singe_loader::functions! { crate::DRIVER;
8464    /// Blocks until remote writes are visible to the specified scope.
8465    ///
8466    /// Blocks until GPUDirect RDMA writes to the target context via mappings created through APIs like nvidia_p2p_get_pages (see <https://docs.nvidia.com/cuda/gpudirect-rdma> for more information), are visible to the specified scope.
8467    ///
8468    /// If the scope equals or lies within the scope indicated by [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WRITES_ORDERING`], the call will be a no-op and can be safely omitted for performance. This can be determined by comparing the numerical values between the two enums, with smaller scopes having smaller values.
8469    ///
8470    /// On platforms that support GPUDirect RDMA writes via more than one path in hardware (see [`CUmemRangeFlags_enum::CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE`]), the user should consider those paths as belonging to separate ordering domains. Note that in such cases CUDA driver will report both RDMA writes ordering and RDMA write scope as ALL_DEVICES and a call to cuFlushGPUDirectRDMA will be a no-op, but when these multiple paths are used simultaneously, it is the user’s responsibility to ensure ordering by using mechanisms outside the scope of CUDA.
8471    ///
8472    /// Users may query support for this API via `CU_DEVICE_ATTRIBUTE_FLUSH_FLUSH_GPU_DIRECT_RDMA_OPTIONS`.
8473    ///
8474    /// Note that this function may also return error codes from previous, asynchronous launches.
8475    ///
8476    /// # Parameters
8477    ///
8478    /// - `target`: The target of the operation, see [`CUflushGPUDirectRDMAWritesTarget`].
8479    /// - `scope`: The scope of the operation, see [`CUflushGPUDirectRDMAWritesScope`].
8480    ///
8481    /// # Return value
8482    ///
8483    /// - [`CUresult::CUDA_SUCCESS`]
8484    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
8485    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
8486    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
8487    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8488    pub fn cuFlushGPUDirectRDMAWrites(
8489        target: CUflushGPUDirectRDMAWritesTarget,
8490        scope: CUflushGPUDirectRDMAWritesScope,
8491    ) -> CUresult;
8492}
8493singe_loader::functions! { crate::DRIVER;
8494    /// Returns properties for a selected device.
8495    ///
8496    /// Returns in `*prop` the properties of device `dev`. The CUdevprop structure is defined as:
8497    ///
8498    /// ```text
8499    ///    typedef struct CUdevprop_st {
8500    ///    int maxThreadsPerBlock;
8501    ///    int maxThreadsDim\[3\];
8502    ///    int maxGridSize\[3\];
8503    ///    int sharedMemPerBlock;
8504    ///    int totalConstantMemory;
8505    ///    int SIMDWidth;
8506    ///    int memPitch;
8507    ///    int regsPerBlock;
8508    ///    int clockRate;
8509    ///    int textureAlign
8510    /// } CUdevprop;
8511    /// ```
8512    ///
8513    /// where:
8514    ///
8515    /// * `maxThreadsPerBlock` is the maximum number of threads per block;
8516    /// * `maxThreadsDim`\[3\] is the maximum sizes of each dimension of a block;
8517    /// * `maxGridSize`\[3\] is the maximum sizes of each dimension of a grid;
8518    /// * `sharedMemPerBlock` is the total amount of shared memory available per block in bytes;
8519    /// * `totalConstantMemory` is the total amount of constant memory available on the device in bytes;
8520    /// * `SIMDWidth` is the warp size;
8521    /// * `memPitch` is the maximum pitch allowed by the memory copy functions that involve memory regions allocated through cuMemAllocPitch();
8522    /// * `regsPerBlock` is the total number of registers available per block;
8523    /// * `clockRate` is the clock frequency in kilohertz;
8524    /// * `textureAlign` is the alignment requirement; texture base addresses that are aligned to `textureAlign` bytes do not need an offset applied to texture fetches.
8525    ///
8526    /// Note that this function may also return error codes from previous, asynchronous launches.
8527    ///
8528    /// # Parameters
8529    ///
8530    /// - `prop`: Returned properties of device.
8531    /// - `dev`: Device to get properties for.
8532    ///
8533    /// # Return value
8534    ///
8535    /// - [`CUresult::CUDA_SUCCESS`]
8536    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
8537    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
8538    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
8539    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8540    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
8541    ///
8542    /// See also: [`cuDeviceGetAttribute`], [`cuDeviceGetCount`], [`cuDeviceGetName`], [`cuDeviceGetUuid`], [`cuDeviceGet`], [`cuDeviceTotalMem`].
8543    #[deprecated]
8544    pub fn cuDeviceGetProperties(prop: *mut CUdevprop, dev: CUdevice) -> CUresult;
8545}
8546singe_loader::functions! { crate::DRIVER;
8547    /// Returns the compute capability of the device.
8548    ///
8549    /// Returns in `*major` and `*minor` the major and minor revision numbers that define the compute capability of the device `dev`.
8550    ///
8551    /// Note that this function may also return error codes from previous, asynchronous launches.
8552    ///
8553    /// # Parameters
8554    ///
8555    /// - `major`: Major revision number.
8556    /// - `minor`: Minor revision number.
8557    /// - `dev`: Device handle.
8558    ///
8559    /// # Return value
8560    ///
8561    /// - [`CUresult::CUDA_SUCCESS`]
8562    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
8563    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
8564    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
8565    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8566    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
8567    ///
8568    /// See also: [`cuDeviceGetAttribute`], [`cuDeviceGetCount`], [`cuDeviceGetName`], [`cuDeviceGetUuid`], [`cuDeviceGet`], [`cuDeviceTotalMem`].
8569    #[deprecated]
8570    pub fn cuDeviceComputeCapability(
8571        major: *mut ::core::ffi::c_int,
8572        minor: *mut ::core::ffi::c_int,
8573        dev: CUdevice,
8574    ) -> CUresult;
8575}
8576singe_loader::functions! { crate::DRIVER;
8577    /// Retain the primary context on the GPU.
8578    ///
8579    /// Retains the primary context on the device. Once the user successfully retains the primary context, the primary context will be active and available to the user until the user releases it with cuDevicePrimaryCtxRelease() or resets it with cuDevicePrimaryCtxReset(). Unlike cuCtxCreate() the newly retained context is not pushed onto the stack.
8580    ///
8581    /// Retaining the primary context for the first time will fail with [`cudaError_enum::CUDA_ERROR_UNKNOWN`] if the compute mode of the device is [`CUcomputemode_enum::CU_COMPUTEMODE_PROHIBITED`]. The function [`cuDeviceGetAttribute`] can be used with [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_COMPUTE_MODE`] to determine the compute mode of the device. The *nvidia-smi* tool can be used to set the compute mode for devices. Documentation for *nvidia-smi* can be obtained by passing a -h option to it.
8582    ///
8583    /// Please note that the primary context always supports pinned allocations. Other flags can be specified by cuDevicePrimaryCtxSetFlags().
8584    ///
8585    /// Note that this function may also return error codes from previous, asynchronous launches.
8586    ///
8587    /// # Parameters
8588    ///
8589    /// - `pctx`: Returned context handle of the new context.
8590    /// - `dev`: Device for which primary context is requested.
8591    ///
8592    /// # Return value
8593    ///
8594    /// - [`CUresult::CUDA_SUCCESS`]
8595    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
8596    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
8597    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
8598    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
8599    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8600    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
8601    /// - [`CUresult::CUDA_ERROR_UNKNOWN`]
8602    ///
8603    /// See also: [`cuDevicePrimaryCtxRelease`], [`cuDevicePrimaryCtxSetFlags`], [`cuCtxCreate`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent`], [`cuCtxPushCurrent`], [`cuCtxSetCacheConfig`], [`cuCtxSetLimit`], [`cuCtxSynchronize`].
8604    pub fn cuDevicePrimaryCtxRetain(pctx: *mut CUcontext, dev: CUdevice) -> CUresult;
8605}
8606singe_loader::functions! { crate::DRIVER;
8607    /// Release the primary context on the GPU.
8608    ///
8609    /// Releases the primary context interop on the device. A retained context should always be released once the user is done using it. The context is automatically reset once the last reference to it is released. This behavior is different when the primary context was retained by the CUDA runtime from CUDA 4.0 and earlier. In this case, the primary context remains always active.
8610    ///
8611    /// Releasing a primary context that has not been previously retained will fail with [`cudaError_enum::CUDA_ERROR_INVALID_CONTEXT`].
8612    ///
8613    /// Please note that unlike cuCtxDestroy() this method does not pop the context from stack in any circumstances.
8614    ///
8615    /// Note that this function may also return error codes from previous, asynchronous launches.
8616    ///
8617    /// # Return value
8618    ///
8619    /// - [`CUresult::CUDA_SUCCESS`]
8620    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
8621    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
8622    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
8623    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
8624    ///
8625    /// See also: [`cuDevicePrimaryCtxRetain`], [`cuCtxDestroy`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent`], [`cuCtxPushCurrent`], [`cuCtxSetCacheConfig`], [`cuCtxSetLimit`], [`cuCtxSynchronize`].
8626    pub fn cuDevicePrimaryCtxRelease_v2(dev: CUdevice) -> CUresult;
8627}
8628singe_loader::functions! { crate::DRIVER;
8629    /// Set flags for the primary context.
8630    ///
8631    /// Sets the flags for the primary context on the device overwriting previously set ones.
8632    ///
8633    /// The three LSBs of the `flags` parameter can be used to control how the OS thread, which owns the CUDA context at the time of an API call, interacts with the OS scheduler when waiting for results from the GPU. Only one of the scheduling flags can be set when creating a context.
8634    ///
8635    /// * [`CUctx_flags_enum::CU_CTX_SCHED_SPIN`]: Instruct CUDA to actively spin when waiting for results from the GPU. This can decrease latency when waiting for the GPU, but may lower the performance of CPU threads if they are performing work in parallel with the CUDA thread.
8636    /// * [`CUctx_flags_enum::CU_CTX_SCHED_YIELD`]: Instruct CUDA to yield its thread when waiting for results from the GPU. This can increase latency when waiting for the GPU, but can increase the performance of CPU threads performing work in parallel with the GPU.
8637    /// * [`CUctx_flags_enum::CU_CTX_SCHED_BLOCKING_SYNC`]: Instruct CUDA to block the CPU thread on a synchronization primitive when waiting for the GPU to finish work.
8638    /// * [`CUctx_flags_enum::CU_CTX_BLOCKING_SYNC`]: Instruct CUDA to block the CPU thread on a synchronization primitive when waiting for the GPU to finish work. **Deprecated:** This flag was deprecated as of CUDA 4.0 and was replaced with [`CUctx_flags_enum::CU_CTX_SCHED_BLOCKING_SYNC`].
8639    /// * [`CUctx_flags_enum::CU_CTX_SCHED_AUTO`]: The default value if the `flags` parameter is zero, uses a heuristic based on the number of active CUDA contexts in the process *C* and the number of logical processors in the system *P*. If *C* > *P*, then CUDA will yield to other OS threads when waiting for the GPU ([`CUctx_flags_enum::CU_CTX_SCHED_YIELD`]), otherwise CUDA will not yield while waiting for results and actively spin on the processor ([`CUctx_flags_enum::CU_CTX_SCHED_SPIN`]). Additionally, on Tegra devices, [`CUctx_flags_enum::CU_CTX_SCHED_AUTO`] uses a heuristic based on the power profile of the platform and may choose [`CUctx_flags_enum::CU_CTX_SCHED_BLOCKING_SYNC`] for low-powered devices.
8640    /// * [`CUctx_flags_enum::CU_CTX_LMEM_RESIZE_TO_MAX`]: Instruct CUDA to not reduce local memory after resizing local memory for a kernel. This can prevent thrashing by local memory allocations when launching many kernels with high local memory usage at the cost of potentially increased memory usage. **Deprecated:** This flag is deprecated and the behavior enabled by this flag is now the default and cannot be disabled.
8641    /// * [`CUctx_flags_enum::CU_CTX_COREDUMP_ENABLE`]: If GPU coredumps have not been enabled globally with [`cuCoredumpSetAttributeGlobal`] or environment variables, this flag can be set during context creation to instruct CUDA to create a coredump if this context raises an exception during execution. These environment variables are described in the CUDA-GDB user guide under the “GPU core dump support” section. The initial settings will be taken from the global settings at the time of context creation. The other settings that control coredump output can be modified by calling [`cuCoredumpSetAttribute`] from the created context after it becomes current.
8642    /// * [`CUctx_flags_enum::CU_CTX_USER_COREDUMP_ENABLE`]: If user-triggered GPU coredumps have not been enabled globally with [`cuCoredumpSetAttributeGlobal`] or environment variables, this flag can be set during context creation to instruct CUDA to create a coredump if data is written to a certain pipe that is present in the OS space. These environment variables are described in the CUDA-GDB user guide under the “GPU core dump support” section. It is important to note that the pipe name `must` be set with [`cuCoredumpSetAttributeGlobal`] before creating the context if this flag is used. Setting this flag implies that [`CUctx_flags_enum::CU_CTX_COREDUMP_ENABLE`] is set. The initial settings will be taken from the global settings at the time of context creation. The other settings that control coredump output can be modified by calling [`cuCoredumpSetAttribute`] from the created context after it becomes current.
8643    /// * [`CUctx_flags_enum::CU_CTX_SYNC_MEMOPS`]: Ensures that synchronous memory operations initiated on this context will always synchronize. See further documentation in the section titled “API Synchronization behavior” to learn more about cases when synchronous memory operations can exhibit asynchronous behavior.
8644    ///
8645    /// Note that this function may also return error codes from previous, asynchronous launches.
8646    ///
8647    /// # Parameters
8648    ///
8649    /// - `dev`: Device for which the primary context flags are set.
8650    /// - `flags`: New flags for the device.
8651    ///
8652    /// # Return value
8653    ///
8654    /// - [`CUresult::CUDA_SUCCESS`]
8655    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
8656    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
8657    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
8658    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8659    ///
8660    /// See also: [`cuDevicePrimaryCtxRetain`], [`cuDevicePrimaryCtxGetState`], [`cuCtxCreate`], [`cuCtxGetFlags`], [`cuCtxSetFlags`], `cudaSetDeviceFlags`.
8661    pub fn cuDevicePrimaryCtxSetFlags_v2(
8662        dev: CUdevice,
8663        flags: ::core::ffi::c_uint,
8664    ) -> CUresult;
8665}
8666singe_loader::functions! { crate::DRIVER;
8667    /// Get the state of the primary context.
8668    ///
8669    /// Returns in `*flags` the flags for the primary context of `dev`, and in `*active` whether it is active. See cuDevicePrimaryCtxSetFlags for flag values.
8670    ///
8671    /// Note that this function may also return error codes from previous, asynchronous launches.
8672    ///
8673    /// # Parameters
8674    ///
8675    /// - `dev`: Device to get primary context flags for.
8676    /// - `flags`: Pointer to store flags.
8677    /// - `active`: Pointer to store context state; 0 = inactive, 1 = active.
8678    ///
8679    /// # Return value
8680    ///
8681    /// - [`CUresult::CUDA_SUCCESS`]
8682    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
8683    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
8684    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
8685    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8686    ///
8687    /// See also: [`cuDevicePrimaryCtxSetFlags`], [`cuCtxGetFlags`], [`cuCtxSetFlags`], `cudaGetDeviceFlags`.
8688    pub fn cuDevicePrimaryCtxGetState(
8689        dev: CUdevice,
8690        flags: *mut ::core::ffi::c_uint,
8691        active: *mut ::core::ffi::c_int,
8692    ) -> CUresult;
8693}
8694singe_loader::functions! { crate::DRIVER;
8695    /// Destroy all allocations and reset all state on the primary context.
8696    ///
8697    /// Explicitly destroys and cleans up all resources associated with the current device in the current process.
8698    ///
8699    /// Note that it is responsibility of the calling function to ensure that no other module in the process is using the device any more. For that reason it is recommended to use cuDevicePrimaryCtxRelease() in most cases. However it is safe for other modules to call cuDevicePrimaryCtxRelease() even after resetting the device. Resetting the primary context does not release it, an application that has retained the primary context should explicitly release its usage.
8700    ///
8701    /// Note that this function may also return error codes from previous, asynchronous launches.
8702    ///
8703    /// # Return value
8704    ///
8705    /// - [`CUresult::CUDA_SUCCESS`]
8706    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
8707    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
8708    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
8709    /// - [`CUresult::CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE`]
8710    ///
8711    /// See also: [`cuDevicePrimaryCtxRetain`], [`cuDevicePrimaryCtxRelease`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent`], [`cuCtxPushCurrent`], [`cuCtxSetCacheConfig`], [`cuCtxSetLimit`], [`cuCtxSynchronize`], `cudaDeviceReset`.
8712    pub fn cuDevicePrimaryCtxReset_v2(dev: CUdevice) -> CUresult;
8713}
8714singe_loader::functions! { crate::DRIVER;
8715    /// Create a CUDA context.
8716    ///
8717    /// Creates a new CUDA context and associates it with the calling thread. The `flags` parameter is described below. The context is created with a usage count of 1 and the caller of cuCtxCreate() must call cuCtxDestroy() when done using the context. If a context is already current to the thread, it is supplanted by the newly created context and may be restored by a subsequent call to cuCtxPopCurrent().
8718    ///
8719    /// A regular CUDA context can be created by setting `ctxCreateParams` to NULL.
8720    ///
8721    /// A CUDA context can be created with execution affinity. The type and the amount of execution resource the context can use is limited by `paramsArray` and `numExecAffinityParams` in `execAffinity`. The `paramsArray` is an array of [`CUexecAffinityParam`] and the `numExecAffinityParams` describes the size of the paramsArray. If two [`CUexecAffinityParam`] in the array have the same type, the latter execution affinity parameter overrides the former execution affinity parameter. The supported execution affinity types are:
8722    ///
8723    /// * [`CUexecAffinityType_enum::CU_EXEC_AFFINITY_TYPE_SM_COUNT`] limits the portion of SMs that the context can use. The portion of SMs is specified as the number of SMs via [`CUexecAffinitySmCount`]. This limit will be internally rounded up to the next hardware-supported amount. Hence, it is imperative to query the actual execution affinity of the context via [`cuCtxGetExecAffinity`] after context creation. Currently, this attribute is only supported under Volta+ MPS.
8724    ///
8725    /// A CUDA context can be created in CIG(CUDA in Graphics) mode by setting `cigParams`. Data from graphics client is shared with CUDA via the `sharedData` in `cigParams`. Support for D3D12 graphics client can be determined using [`cuDeviceGetAttribute`] with [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_D3D12_CIG_SUPPORTED`]. `sharedData` is a ID3D12CommandQueue handle. Support for Vulkan graphics client can be determined using [`cuDeviceGetAttribute`] with [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_VULKAN_CIG_SUPPORTED`]. `sharedData` is a Nvidia specific data blob populated by calling vkGetExternalComputeQueueDataNV(). `execAffinityParams` and `cigParams` are mutually exclusive and cannot both be non-NULL. Setting both to non-NULL values will result in undefined behavior. If both `execAffinityParams` and `cigParams` are NULL, the context will be created as a regular CUDA context.
8726    ///
8727    /// The three LSBs of the `flags` parameter can be used to control how the OS thread, which owns the CUDA context at the time of an API call, interacts with the OS scheduler when waiting for results from the GPU. Only one of the scheduling flags can be set when creating a context.
8728    ///
8729    /// * [`CUctx_flags_enum::CU_CTX_SCHED_SPIN`]: Instruct CUDA to actively spin when waiting for results from the GPU. This can decrease latency when waiting for the GPU, but may lower the performance of CPU threads if they are performing work in parallel with the CUDA thread.
8730    /// * [`CUctx_flags_enum::CU_CTX_SCHED_YIELD`]: Instruct CUDA to yield its thread when waiting for results from the GPU. This can increase latency when waiting for the GPU, but can increase the performance of CPU threads performing work in parallel with the GPU.
8731    /// * [`CUctx_flags_enum::CU_CTX_SCHED_BLOCKING_SYNC`]: Instruct CUDA to block the CPU thread on a synchronization primitive when waiting for the GPU to finish work.
8732    /// * [`CUctx_flags_enum::CU_CTX_BLOCKING_SYNC`]: Instruct CUDA to block the CPU thread on a synchronization primitive when waiting for the GPU to finish work. **Deprecated:** This flag was deprecated as of CUDA 4.0 and was replaced with [`CUctx_flags_enum::CU_CTX_SCHED_BLOCKING_SYNC`].
8733    /// * [`CUctx_flags_enum::CU_CTX_SCHED_AUTO`]: The default value if the `flags` parameter is zero, uses a heuristic based on the number of active CUDA contexts in the process *C* and the number of logical processors in the system *P*. If *C* > *P*, then CUDA will yield to other OS threads when waiting for the GPU ([`CUctx_flags_enum::CU_CTX_SCHED_YIELD`]), otherwise CUDA will not yield while waiting for results and actively spin on the processor ([`CUctx_flags_enum::CU_CTX_SCHED_SPIN`]). Additionally, on Tegra devices, [`CUctx_flags_enum::CU_CTX_SCHED_AUTO`] uses a heuristic based on the power profile of the platform and may choose [`CUctx_flags_enum::CU_CTX_SCHED_BLOCKING_SYNC`] for low-powered devices.
8734    /// * [`CUctx_flags_enum::CU_CTX_MAP_HOST`]: Instruct CUDA to support mapped pinned allocations. This flag must be set in order to allocate pinned host memory that is accessible to the GPU.
8735    /// * [`CUctx_flags_enum::CU_CTX_LMEM_RESIZE_TO_MAX`]: Instruct CUDA to not reduce local memory after resizing local memory for a kernel. This can prevent thrashing by local memory allocations when launching many kernels with high local memory usage at the cost of potentially increased memory usage. **Deprecated:** This flag is deprecated and the behavior enabled by this flag is now the default and cannot be disabled. Instead, the per-thread stack size can be controlled with [`cuCtxSetLimit`].
8736    /// * [`CUctx_flags_enum::CU_CTX_COREDUMP_ENABLE`]: If GPU coredumps have not been enabled globally with [`cuCoredumpSetAttributeGlobal`] or environment variables, this flag can be set during context creation to instruct CUDA to create a coredump if this context raises an exception during execution. These environment variables are described in the CUDA-GDB user guide under the “GPU core dump support” section. The initial attributes will be taken from the global attributes at the time of context creation. The other attributes that control coredump output can be modified by calling [`cuCoredumpSetAttribute`] from the created context after it becomes current. This flag is not supported when CUDA context is created in CIG(CUDA in Graphics) mode.
8737    /// * [`CUctx_flags_enum::CU_CTX_USER_COREDUMP_ENABLE`]: If user-triggered GPU coredumps have not been enabled globally with [`cuCoredumpSetAttributeGlobal`] or environment variables, this flag can be set during context creation to instruct CUDA to create a coredump if data is written to a certain pipe that is present in the OS space. These environment variables are described in the CUDA-GDB user guide under the “GPU core dump support” section. It is important to note that the pipe name `must` be set with [`cuCoredumpSetAttributeGlobal`] before creating the context if this flag is used. Setting this flag implies that [`CUctx_flags_enum::CU_CTX_COREDUMP_ENABLE`] is set. The initial attributes will be taken from the global attributes at the time of context creation. The other attributes that control coredump output can be modified by calling [`cuCoredumpSetAttribute`] from the created context after it becomes current. Setting this flag on any context creation is equivalent to setting the [`CUcoredumpSettings::CU_COREDUMP_ENABLE_USER_TRIGGER`] attribute to `true` globally. This flag is not supported when CUDA context is created in CIG(CUDA in Graphics) mode.
8738    /// * [`CUctx_flags_enum::CU_CTX_SYNC_MEMOPS`]: Ensures that synchronous memory operations initiated on this context will always synchronize. See further documentation in the section titled “API Synchronization behavior” to learn more about cases when synchronous memory operations can exhibit asynchronous behavior.
8739    ///
8740    /// Context creation will fail with [`cudaError_enum::CUDA_ERROR_UNKNOWN`] if the compute mode of the device is [`CUcomputemode_enum::CU_COMPUTEMODE_PROHIBITED`]. The function [`cuDeviceGetAttribute`] can be used with [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_COMPUTE_MODE`] to determine the compute mode of the device. The *nvidia-smi* tool can be used to set the compute mode for \* devices. Documentation for *nvidia-smi* can be obtained by passing a -h option to it.
8741    ///
8742    /// Context creation will fail with [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] if invalid parameter was passed by client to create the CUDA context.
8743    ///
8744    /// Context creation in CIG mode will fail with [`cudaError_enum::CUDA_ERROR_NOT_SUPPORTED`] if CIG is not supported by the device or the driver.
8745    ///
8746    /// Note that this function may also return error codes from previous, asynchronous launches.
8747    ///
8748    /// # Parameters
8749    ///
8750    /// - `pctx`: Returned context handle of the new context.
8751    /// - `ctxCreateParams`: Context creation parameters. Can be NULL to create a regular CUDA context. See [`CUctxCreateParams`] for details.
8752    /// - `flags`: Context creation flags.
8753    /// - `dev`: Device to create context on.
8754    ///
8755    /// # Return value
8756    ///
8757    /// - [`CUresult::CUDA_SUCCESS`]
8758    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
8759    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
8760    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
8761    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
8762    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8763    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
8764    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
8765    /// - [`CUresult::CUDA_ERROR_UNKNOWN`]
8766    ///
8767    /// See also: [`cuCtxDestroy`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent`], [`cuCtxPushCurrent`], [`cuCtxSetCacheConfig`], [`cuCtxSetLimit`], [`cuCoredumpSetAttributeGlobal`], [`cuCoredumpSetAttribute`], [`cuCtxSynchronize`], [`cuCtxGetExecAffinity`].
8768    pub fn cuCtxCreate_v4(
8769        pctx: *mut CUcontext,
8770        ctxCreateParams: *mut CUctxCreateParams,
8771        flags: ::core::ffi::c_uint,
8772        dev: CUdevice,
8773    ) -> CUresult;
8774}
8775singe_loader::functions! { crate::DRIVER;
8776    /// Destroy a CUDA context.
8777    ///
8778    /// Destroys the CUDA context specified by `ctx`. The context `ctx` will be destroyed regardless of how many threads it is current to. It is the responsibility of the calling function to ensure that no API call issues using `ctx` while cuCtxDestroy() is executing.
8779    ///
8780    /// Destroys and cleans up all resources associated with the context. It is the caller’s responsibility to ensure that the context or its resources are not accessed or passed in subsequent API calls and doing so will result in undefined behavior. These resources include CUDA types [`CUmodule`], [`CUfunction`], [`CUstream`], [`CUevent`], [`CUarray`], [`CUmipmappedArray`], [`CUtexObject`], [`CUsurfObject`], [`CUtexref`], [`CUsurfref`], [`CUgraphicsResource`], CUlinkState, [`CUexternalMemory`] and [`CUexternalSemaphore`]. These resources also include memory allocations by cuMemAlloc(), cuMemAllocHost(), [`cuMemAllocManaged`] and cuMemAllocPitch().
8781    ///
8782    /// If `ctx` is current to the calling thread then `ctx` will also be popped from the current thread’s context stack (as though cuCtxPopCurrent() were called). If `ctx` is current to other threads, then `ctx` will remain current to those threads, and attempting to access `ctx` from those threads will result in the error [`cudaError_enum::CUDA_ERROR_CONTEXT_IS_DESTROYED`].
8783    ///
8784    /// Note: cuCtxDestroy() will not destroy memory allocations by [`cuMemCreate`], [`cuMemAllocAsync`] and [`cuMemAllocFromPoolAsync`]. These memory allocations are not associated with any CUDA context and need to be destroyed explicitly.
8785    ///
8786    /// Note that this function may also return error codes from previous, asynchronous launches.
8787    ///
8788    /// # Return value
8789    ///
8790    /// - [`CUresult::CUDA_SUCCESS`]
8791    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
8792    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
8793    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
8794    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8795    ///
8796    /// See also: [`cuCtxCreate`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent`], [`cuCtxPushCurrent`], [`cuCtxSetCacheConfig`], [`cuCtxSetLimit`], [`cuCtxSynchronize`].
8797    pub fn cuCtxDestroy_v2(ctx: CUcontext) -> CUresult;
8798}
8799singe_loader::functions! { crate::DRIVER;
8800    /// Pushes a context on the current CPU thread.
8801    ///
8802    /// Pushes the given context `ctx` onto the CPU thread’s stack of current contexts. The specified context becomes the CPU thread’s current context, so all CUDA functions that operate on the current context are affected.
8803    ///
8804    /// The previous current context may be made current again by calling cuCtxDestroy() or cuCtxPopCurrent().
8805    ///
8806    /// Note that this function may also return error codes from previous, asynchronous launches.
8807    ///
8808    /// # Return value
8809    ///
8810    /// - [`CUresult::CUDA_SUCCESS`]
8811    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
8812    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
8813    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
8814    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8815    ///
8816    /// See also: [`cuCtxCreate`], [`cuCtxDestroy`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent`], [`cuCtxSetCacheConfig`], [`cuCtxSetLimit`], [`cuCtxSynchronize`].
8817    pub fn cuCtxPushCurrent_v2(ctx: CUcontext) -> CUresult;
8818}
8819singe_loader::functions! { crate::DRIVER;
8820    /// Pops the current CUDA context from the current CPU thread.
8821    ///
8822    /// Pops the current CUDA context from the CPU thread and passes back the old context handle in `*pctx`. That context may then be made current to a different CPU thread by calling cuCtxPushCurrent().
8823    ///
8824    /// If a context was current to the CPU thread before cuCtxCreate() or cuCtxPushCurrent() was called, this function makes that context current to the CPU thread again.
8825    ///
8826    /// Note that this function may also return error codes from previous, asynchronous launches.
8827    ///
8828    /// # Return value
8829    ///
8830    /// - [`CUresult::CUDA_SUCCESS`]
8831    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
8832    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
8833    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
8834    ///
8835    /// See also: [`cuCtxCreate`], [`cuCtxDestroy`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPushCurrent`], [`cuCtxSetCacheConfig`], [`cuCtxSetLimit`], [`cuCtxSynchronize`].
8836    pub fn cuCtxPopCurrent_v2(pctx: *mut CUcontext) -> CUresult;
8837}
8838singe_loader::functions! { crate::DRIVER;
8839    /// Binds the specified CUDA context to the calling CPU thread.
8840    ///
8841    /// Binds the specified CUDA context to the calling CPU thread. If `ctx` is NULL then the CUDA context previously bound to the calling CPU thread is unbound and [`cudaError_enum::CUDA_SUCCESS`] is returned.
8842    ///
8843    /// If there exists a CUDA context stack on the calling CPU thread, this will replace the top of that stack with `ctx`. If `ctx` is NULL then this will be equivalent to popping the top of the calling CPU thread’s CUDA context stack (or a no-op if the calling CPU thread’s CUDA context stack is empty).
8844    ///
8845    /// Note that this function may also return error codes from previous, asynchronous launches.
8846    ///
8847    /// # Parameters
8848    ///
8849    /// - `ctx`: Context to bind to the calling CPU thread
8850    ///
8851    /// # Return value
8852    ///
8853    /// - [`CUresult::CUDA_SUCCESS`]
8854    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
8855    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
8856    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
8857    ///
8858    /// See also: [`cuCtxGetCurrent`], [`cuCtxCreate`], [`cuCtxDestroy`], `cudaSetDevice`.
8859    pub fn cuCtxSetCurrent(ctx: CUcontext) -> CUresult;
8860}
8861singe_loader::functions! { crate::DRIVER;
8862    /// Returns the CUDA context bound to the calling CPU thread.
8863    ///
8864    /// Returns in `*pctx` the CUDA context bound to the calling CPU thread. If no context is bound to the calling CPU thread then `*pctx` is set to NULL and [`cudaError_enum::CUDA_SUCCESS`] is returned.
8865    ///
8866    /// Note that this function may also return error codes from previous, asynchronous launches.
8867    ///
8868    /// # Parameters
8869    ///
8870    /// - `pctx`: Returned context handle
8871    ///
8872    /// # Return value
8873    ///
8874    /// - [`CUresult::CUDA_SUCCESS`]
8875    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
8876    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
8877    ///
8878    /// See also: [`cuCtxSetCurrent`], [`cuCtxCreate`], [`cuCtxDestroy`], `cudaGetDevice`.
8879    pub fn cuCtxGetCurrent(pctx: *mut CUcontext) -> CUresult;
8880}
8881singe_loader::functions! { crate::DRIVER;
8882    /// Returns the device handle for the current context.
8883    ///
8884    /// Returns in `*device` the handle of the current context’s device.
8885    ///
8886    /// Note that this function may also return error codes from previous, asynchronous launches.
8887    ///
8888    /// # Parameters
8889    ///
8890    /// - `device`: Returned device handle for the current context
8891    ///
8892    /// # Return value
8893    ///
8894    /// - [`CUresult::CUDA_SUCCESS`]
8895    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
8896    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
8897    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
8898    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8899    ///
8900    /// See also: [`cuCtxCreate`], [`cuCtxDestroy`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent`], [`cuCtxPushCurrent`], [`cuCtxSetCacheConfig`], [`cuCtxSetLimit`], [`cuCtxSynchronize`], `cudaGetDevice`.
8901    pub fn cuCtxGetDevice(device: *mut CUdevice) -> CUresult;
8902}
8903singe_loader::functions! { crate::DRIVER;
8904    /// Returns the device handle for the specified context.
8905    ///
8906    /// Returns in `*device` the handle of the specified context’s device. If the specified context is NULL, the API will return the current context’s device.
8907    ///
8908    /// Note that this function may also return error codes from previous, asynchronous launches.
8909    ///
8910    /// # Parameters
8911    ///
8912    /// - `device`: Returned device handle for the specified context.
8913    /// - `ctx`: Context for which to obtain the device.
8914    ///
8915    /// # Return value
8916    ///
8917    /// - [`CUresult::CUDA_SUCCESS`]
8918    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
8919    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
8920    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
8921    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8922    ///
8923    /// See also: [`cuCtxGetCurrent`], [`cuCtxPopCurrent`], [`cuCtxPushCurrent`].
8924    pub fn cuCtxGetDevice_v2(device: *mut CUdevice, ctx: CUcontext) -> CUresult;
8925}
8926singe_loader::functions! { crate::DRIVER;
8927    /// Returns the flags for the current context.
8928    ///
8929    /// Returns in `*flags` the flags of the current context. See cuCtxCreate for flag values.
8930    ///
8931    /// Note that this function may also return error codes from previous, asynchronous launches.
8932    ///
8933    /// # Parameters
8934    ///
8935    /// - `flags`: Pointer to store flags of current context
8936    ///
8937    /// # Return value
8938    ///
8939    /// - [`CUresult::CUDA_SUCCESS`]
8940    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
8941    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
8942    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
8943    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8944    ///
8945    /// See also: [`cuCtxCreate`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetCurrent`], [`cuCtxGetDevice`], [`cuCtxGetLimit`], [`cuCtxGetSharedMemConfig`], [`cuCtxGetStreamPriorityRange`], [`cuCtxSetFlags`], `cudaGetDeviceFlags`.
8946    pub fn cuCtxGetFlags(flags: *mut ::core::ffi::c_uint) -> CUresult;
8947}
8948singe_loader::functions! { crate::DRIVER;
8949    /// Sets the flags for the current context.
8950    ///
8951    /// Sets the flags for the current context overwriting previously set ones. See cuDevicePrimaryCtxSetFlags for flag values.
8952    ///
8953    /// Note that this function may also return error codes from previous, asynchronous launches.
8954    ///
8955    /// # Parameters
8956    ///
8957    /// - `flags`: Flags to set on the current context
8958    ///
8959    /// # Return value
8960    ///
8961    /// - [`CUresult::CUDA_SUCCESS`]
8962    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
8963    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
8964    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
8965    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8966    ///
8967    /// See also: [`cuCtxCreate`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetCurrent`], [`cuCtxGetDevice`], [`cuCtxGetLimit`], [`cuCtxGetSharedMemConfig`], [`cuCtxGetStreamPriorityRange`], [`cuCtxGetFlags`], `cudaGetDeviceFlags`, [`cuDevicePrimaryCtxSetFlags`].
8968    pub fn cuCtxSetFlags(flags: ::core::ffi::c_uint) -> CUresult;
8969}
8970singe_loader::functions! { crate::DRIVER;
8971    /// Returns the unique Id associated with the context supplied.
8972    ///
8973    /// Returns in `ctxId` the unique Id which is associated with a given context. The Id is unique for the life of the program for this instance of CUDA. If context is supplied as NULL and there is one current, the Id of the current context is returned.
8974    ///
8975    /// Note that this function may also return error codes from previous, asynchronous launches.
8976    ///
8977    /// # Parameters
8978    ///
8979    /// - `ctx`: Context for which to obtain the Id.
8980    /// - `ctxId`: Pointer to store the Id of the context.
8981    ///
8982    /// # Return value
8983    ///
8984    /// - [`CUresult::CUDA_SUCCESS`]
8985    /// - [`CUresult::CUDA_ERROR_CONTEXT_IS_DESTROYED`]
8986    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
8987    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
8988    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
8989    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
8990    ///
8991    /// See also: [`cuCtxCreate`], [`cuCtxDestroy`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPushCurrent`].
8992    pub fn cuCtxGetId(ctx: CUcontext, ctxId: *mut ::core::ffi::c_ulonglong) -> CUresult;
8993}
8994singe_loader::functions! { crate::DRIVER;
8995    /// Block for the current context’s tasks to complete.
8996    ///
8997    /// Blocks until the current context has completed all preceding requested tasks. If the current context is the primary context, green contexts that have been created will also be synchronized. [`cuCtxSynchronize`] returns an error if one of the preceding tasks failed. If the context was created with the [`CUctx_flags_enum::CU_CTX_SCHED_BLOCKING_SYNC`] flag, the CPU thread will block until the GPU context has finished its work.
8998    ///
8999    /// Note that this function may also return error codes from previous, asynchronous launches.
9000    ///
9001    /// # Return value
9002    ///
9003    /// - [`CUresult::CUDA_SUCCESS`]
9004    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
9005    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
9006    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
9007    /// - [`CUresult::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED`]
9008    ///
9009    /// See also: [`cuCtxCreate`], [`cuCtxDestroy`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent`], [`cuCtxPushCurrent`], [`cuCtxSetCacheConfig`], [`cuCtxSetLimit`], `cudaDeviceSynchronize`.
9010    pub fn cuCtxSynchronize() -> CUresult;
9011}
9012singe_loader::functions! { crate::DRIVER;
9013    /// Block for the specified context’s tasks to complete.
9014    ///
9015    /// Blocks until the specified context has completed all preceding requested tasks. If the specified context is the primary context, green contexts that have been created will also be synchronized. The API returns an error if one of the preceding tasks failed.
9016    ///
9017    /// If the context was created with the [`CUctx_flags_enum::CU_CTX_SCHED_BLOCKING_SYNC`] flag, the CPU thread will block until the GPU context has finished its work.
9018    ///
9019    /// If the specified context is NULL, the API will operate on the current context.
9020    ///
9021    /// Note that this function may also return error codes from previous, asynchronous launches.
9022    ///
9023    /// # Parameters
9024    ///
9025    /// - `ctx`: Context to synchronize
9026    ///
9027    /// # Return value
9028    ///
9029    /// - [`CUresult::CUDA_SUCCESS`]
9030    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
9031    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
9032    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
9033    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
9034    /// - [`CUresult::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED`]
9035    ///
9036    /// See also: [`cuCtxGetCurrent`], [`cuCtxPopCurrent`], [`cuCtxPushCurrent`], [`cuGreenCtxCreate`], [`cuCtxFromGreenCtx`], `cudaDeviceSynchronize`.
9037    pub fn cuCtxSynchronize_v2(ctx: CUcontext) -> CUresult;
9038}
9039singe_loader::functions! { crate::DRIVER;
9040    /// Set resource limits.
9041    ///
9042    /// Setting `limit` to `value` is a request by the application to update the current limit maintained by the context. The driver is free to modify the requested value to meet h/w requirements (this could be clamping to minimum or maximum values, rounding up to nearest element size, etc). The application can use [`cuCtxGetLimit`] to find out exactly what the limit has been set to.
9043    ///
9044    /// Setting each [`CUlimit`] has its own specific restrictions, so each is discussed here.
9045    ///
9046    /// * [`CUlimit_enum::CU_LIMIT_STACK_SIZE`] controls the stack size in bytes of each GPU thread. The driver automatically increases the per-thread stack size for each kernel launch as needed. This size isn’t reset back to the original value after each launch. Setting this value will take effect immediately, and if necessary, the device will block until all preceding requested tasks are complete.
9047    /// * [`CUlimit_enum::CU_LIMIT_PRINTF_FIFO_SIZE`] controls the size in bytes of the FIFO used by the `printf()` device system call. Setting [`CUlimit_enum::CU_LIMIT_PRINTF_FIFO_SIZE`] must be performed before launching any kernel that uses the `printf()` device system call, otherwise [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] will be returned.
9048    /// * [`CUlimit_enum::CU_LIMIT_MALLOC_HEAP_SIZE`] controls the size in bytes of the heap used by the `malloc()` and `free()` device system calls. Setting [`CUlimit_enum::CU_LIMIT_MALLOC_HEAP_SIZE`] must be performed before launching any kernel that uses the `malloc()` or `free()` device system calls, otherwise [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] will be returned.
9049    /// * [`CUlimit_enum::CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH`] controls the maximum nesting depth of a grid at which a thread can safely call `cudaDeviceSynchronize()`. Setting this limit must be performed before any launch of a kernel that uses the device runtime and calls `cudaDeviceSynchronize()` above the default sync depth, two levels of grids. Calls to `cudaDeviceSynchronize()` will fail with error code `cudaErrorSyncDepthExceeded` if the limitation is violated. This limit can be set smaller than the default or up the maximum launch depth of 24. When setting this limit, keep in mind that additional levels of sync depth require the driver to reserve large amounts of device memory which can no longer be used for user allocations. If these reservations of device memory fail, [`cuCtxSetLimit`] will return [`cudaError_enum::CUDA_ERROR_OUT_OF_MEMORY`], and the limit can be reset to a lower value. This limit is only applicable to devices of compute capability &lt; 9.0. Attempting to set this limit on devices of other compute capability versions will result in the error [`cudaError_enum::CUDA_ERROR_UNSUPPORTED_LIMIT`] being returned.
9050    /// * [`CUlimit_enum::CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT`] controls the maximum number of outstanding device runtime launches that can be made from the current context. A grid is outstanding from the point of launch up until the grid is known to have been completed. Device runtime launches which violate this limitation fail and return `cudaErrorLaunchPendingCountExceeded` when `cudaGetLastError()` is called after launch. If more pending launches than the default (2048 launches) are needed for a module using the device runtime, this limit can be increased. Keep in mind that being able to sustain additional pending launches will require the driver to reserve larger amounts of device memory upfront which can no longer be used for allocations. If these reservations fail, [`cuCtxSetLimit`] will return [`cudaError_enum::CUDA_ERROR_OUT_OF_MEMORY`], and the limit can be reset to a lower value. This limit is only applicable to devices of compute capability 3.5 and higher. Attempting to set this limit on devices of compute capability less than 3.5 will result in the error [`cudaError_enum::CUDA_ERROR_UNSUPPORTED_LIMIT`] being returned.
9051    /// * [`CUlimit_enum::CU_LIMIT_MAX_L2_FETCH_GRANULARITY`] controls the L2 cache fetch granularity. Values can range from 0B to 128B. This is purely a performance hint and it can be ignored or clamped depending on the platform.
9052    /// * [`CUlimit_enum::CU_LIMIT_PERSISTING_L2_CACHE_SIZE`] controls size in bytes available for persisting L2 cache. This is purely a performance hint and it can be ignored or clamped depending on the platform.
9053    /// * [`CUlimit_enum::CU_LIMIT_PER_BLOCK_MEMORY_SIZE`] constrols size in bytes of per-block memory.
9054    ///
9055    /// Note that this function may also return error codes from previous, asynchronous launches.
9056    ///
9057    /// # Parameters
9058    ///
9059    /// - `limit`: Limit to set.
9060    /// - `value`: Size of limit.
9061    ///
9062    /// # Return value
9063    ///
9064    /// - [`CUresult::CUDA_SUCCESS`]
9065    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
9066    /// - [`CUresult::CUDA_ERROR_UNSUPPORTED_LIMIT`]
9067    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
9068    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
9069    ///
9070    /// See also: [`cuCtxCreate`], [`cuCtxDestroy`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent`], [`cuCtxPushCurrent`], [`cuCtxSetCacheConfig`], [`cuCtxSynchronize`], `cudaDeviceSetLimit`.
9071    pub fn cuCtxSetLimit(limit: CUlimit, value: size_t) -> CUresult;
9072}
9073singe_loader::functions! { crate::DRIVER;
9074    /// Returns resource limits.
9075    ///
9076    /// Returns in `*pvalue` the current size of `limit`. The supported [`CUlimit`] values are:
9077    ///
9078    /// * [`CUlimit_enum::CU_LIMIT_STACK_SIZE`]: stack size in bytes of each GPU thread.
9079    /// * [`CUlimit_enum::CU_LIMIT_PRINTF_FIFO_SIZE`]: size in bytes of the FIFO used by the `printf()` device system call.
9080    /// * [`CUlimit_enum::CU_LIMIT_MALLOC_HEAP_SIZE`]: size in bytes of the heap used by the `malloc()` and `free()` device system calls.
9081    /// * [`CUlimit_enum::CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH`]: maximum grid depth at which a thread can issue the device runtime call `cudaDeviceSynchronize()` to wait on child grid launches to complete.
9082    /// * [`CUlimit_enum::CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT`]: maximum number of outstanding device runtime launches that can be made from this context.
9083    /// * [`CUlimit_enum::CU_LIMIT_MAX_L2_FETCH_GRANULARITY`]: L2 cache fetch granularity.
9084    /// * [`CUlimit_enum::CU_LIMIT_PERSISTING_L2_CACHE_SIZE`]: Persisting L2 cache size in bytes
9085    /// * [`CUlimit_enum::CU_LIMIT_PER_BLOCK_MEMORY_SIZE`]: Per-block memory in bytes.
9086    ///
9087    /// Note that this function may also return error codes from previous, asynchronous launches.
9088    ///
9089    /// # Parameters
9090    ///
9091    /// - `pvalue`: Returned size of limit.
9092    /// - `limit`: Limit to query.
9093    ///
9094    /// # Return value
9095    ///
9096    /// - [`CUresult::CUDA_SUCCESS`]
9097    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
9098    /// - [`CUresult::CUDA_ERROR_UNSUPPORTED_LIMIT`]
9099    ///
9100    /// See also: [`cuCtxCreate`], [`cuCtxDestroy`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxPopCurrent`], [`cuCtxPushCurrent`], [`cuCtxSetCacheConfig`], [`cuCtxSetLimit`], [`cuCtxSynchronize`], `cudaDeviceGetLimit`.
9101    pub fn cuCtxGetLimit(pvalue: *mut size_t, limit: CUlimit) -> CUresult;
9102}
9103singe_loader::functions! { crate::DRIVER;
9104    /// Returns the preferred cache configuration for the current context.
9105    ///
9106    /// On devices where the L1 cache and shared memory use the same hardware resources, this function returns through `pconfig` the preferred cache configuration for the current context. This is only a preference. The driver will use the requested configuration if possible, but it is free to choose a different configuration if required to execute functions.
9107    ///
9108    /// This will return a `pconfig` of [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_NONE`] on devices where the size of the L1 cache and shared memory are fixed.
9109    ///
9110    /// The supported cache configurations are:
9111    ///
9112    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_NONE`]: no preference for shared memory or L1 (default)
9113    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_SHARED`]: prefer larger shared memory and smaller L1 cache
9114    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_L1`]: prefer larger L1 cache and smaller shared memory
9115    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_EQUAL`]: prefer equal sized L1 cache and shared memory.
9116    ///
9117    /// Note that this function may also return error codes from previous, asynchronous launches.
9118    ///
9119    /// # Parameters
9120    ///
9121    /// - `pconfig`: Returned cache configuration
9122    ///
9123    /// # Return value
9124    ///
9125    /// - [`CUresult::CUDA_SUCCESS`]
9126    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
9127    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
9128    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
9129    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
9130    ///
9131    /// See also: [`cuCtxCreate`], [`cuCtxDestroy`], [`cuCtxGetApiVersion`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent`], [`cuCtxPushCurrent`], [`cuCtxSetCacheConfig`], [`cuCtxSetLimit`], [`cuCtxSynchronize`], [`cuFuncSetCacheConfig`], `cudaDeviceGetCacheConfig`.
9132    pub fn cuCtxGetCacheConfig(pconfig: *mut CUfunc_cache) -> CUresult;
9133}
9134singe_loader::functions! { crate::DRIVER;
9135    /// Sets the preferred cache configuration for the current context.
9136    ///
9137    /// On devices where the L1 cache and shared memory use the same hardware resources, this sets through `config` the preferred cache configuration for the current context. This is only a preference. The driver will use the requested configuration if possible, but it is free to choose a different configuration if required to execute the function. Any function preference set via [`cuFuncSetCacheConfig`] or [`cuKernelSetCacheConfig`] will be preferred over this context-wide setting. Setting the context-wide cache configuration to [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_NONE`] will cause subsequent kernel launches to prefer to not change the cache configuration unless required to launch the kernel.
9138    ///
9139    /// This setting does nothing on devices where the size of the L1 cache and shared memory are fixed.
9140    ///
9141    /// Launching a kernel with a different preference than the most recent preference setting may insert a device-side synchronization point.
9142    ///
9143    /// The supported cache configurations are:
9144    ///
9145    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_NONE`]: no preference for shared memory or L1 (default)
9146    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_SHARED`]: prefer larger shared memory and smaller L1 cache
9147    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_L1`]: prefer larger L1 cache and smaller shared memory
9148    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_EQUAL`]: prefer equal sized L1 cache and shared memory.
9149    ///
9150    /// Note that this function may also return error codes from previous, asynchronous launches.
9151    ///
9152    /// # Parameters
9153    ///
9154    /// - `config`: Requested cache configuration
9155    ///
9156    /// # Return value
9157    ///
9158    /// - [`CUresult::CUDA_SUCCESS`]
9159    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
9160    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
9161    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
9162    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
9163    ///
9164    /// See also: [`cuCtxCreate`], [`cuCtxDestroy`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent`], [`cuCtxPushCurrent`], [`cuCtxSetLimit`], [`cuCtxSynchronize`], [`cuFuncSetCacheConfig`], `cudaDeviceSetCacheConfig`, [`cuKernelSetCacheConfig`].
9165    pub fn cuCtxSetCacheConfig(config: CUfunc_cache) -> CUresult;
9166}
9167singe_loader::functions! { crate::DRIVER;
9168    /// Gets the context’s API version.
9169    ///
9170    /// Returns a version number in `version` corresponding to the capabilities of the context (e.g. 3010 or 3020), which library developers can use to direct callers to a specific API version. If `ctx` is NULL, returns the API version used to create the currently bound context.
9171    ///
9172    /// Note that new API versions are only introduced when context capabilities are changed that break binary compatibility, so the API version and driver version may be different. For example, it is valid for the API version to be 3020 while the driver version is 4020.
9173    ///
9174    /// Note that this function may also return error codes from previous, asynchronous launches.
9175    ///
9176    /// # Parameters
9177    ///
9178    /// - `ctx`: Context to check.
9179    /// - `version`: Pointer to version.
9180    ///
9181    /// # Return value
9182    ///
9183    /// - [`CUresult::CUDA_SUCCESS`]
9184    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
9185    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
9186    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
9187    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
9188    /// - [`CUresult::CUDA_ERROR_UNKNOWN`]
9189    ///
9190    /// See also: [`cuCtxCreate`], [`cuCtxDestroy`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent`], [`cuCtxPushCurrent`], [`cuCtxSetCacheConfig`], [`cuCtxSetLimit`], [`cuCtxSynchronize`].
9191    pub fn cuCtxGetApiVersion(
9192        ctx: CUcontext,
9193        version: *mut ::core::ffi::c_uint,
9194    ) -> CUresult;
9195}
9196singe_loader::functions! { crate::DRIVER;
9197    /// Returns numerical values that correspond to the least and greatest stream priorities.
9198    ///
9199    /// Returns in `*leastPriority` and `*greatestPriority` the numerical values that correspond to the least and greatest stream priorities respectively. Stream priorities follow a convention where lower numbers imply greater priorities. The range of meaningful stream priorities is given by `*greatestPriority`, `*leastPriority`. If the user attempts to create a stream with a priority value that is outside the meaningful range as specified by this API, the priority is automatically clamped down or up to either `*leastPriority` or `*greatestPriority` respectively. See [`cuStreamCreateWithPriority`] for details on creating a priority stream. A NULL may be passed in for `*leastPriority` or `*greatestPriority` if the value is not desired.
9200    ///
9201    /// This function will return ‘0’ in both `*leastPriority` and `*greatestPriority` if the current context’s device does not support stream priorities (see [`cuDeviceGetAttribute`]).
9202    ///
9203    /// Note that this function may also return error codes from previous, asynchronous launches.
9204    ///
9205    /// # Parameters
9206    ///
9207    /// - `leastPriority`: Pointer to an int in which the numerical value for least stream priority is returned.
9208    /// - `greatestPriority`: Pointer to an int in which the numerical value for greatest stream priority is returned.
9209    ///
9210    /// # Return value
9211    ///
9212    /// - [`CUresult::CUDA_SUCCESS`]
9213    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
9214    ///
9215    /// See also: [`cuStreamCreateWithPriority`], [`cuStreamGetPriority`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxSetLimit`], [`cuCtxSynchronize`], `cudaDeviceGetStreamPriorityRange`.
9216    pub fn cuCtxGetStreamPriorityRange(
9217        leastPriority: *mut ::core::ffi::c_int,
9218        greatestPriority: *mut ::core::ffi::c_int,
9219    ) -> CUresult;
9220}
9221singe_loader::functions! { crate::DRIVER;
9222    /// Resets all persisting lines in cache to normal status.
9223    ///
9224    /// [`cuCtxResetPersistingL2Cache`] Resets all persisting lines in cache to normal status. Takes effect on function return.
9225    ///
9226    /// Note that this function may also return error codes from previous, asynchronous launches.
9227    ///
9228    /// # Return value
9229    ///
9230    /// - [`CUresult::CUDA_SUCCESS`]
9231    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
9232    ///
9233    /// See also: [`CUaccessPolicyWindow`].
9234    pub fn cuCtxResetPersistingL2Cache() -> CUresult;
9235}
9236singe_loader::functions! { crate::DRIVER;
9237    /// Returns the execution affinity setting for the current context.
9238    ///
9239    /// Returns in `*pExecAffinity` the current value of `type`. The supported [`CUexecAffinityType`] values are:
9240    ///
9241    /// * [`CUexecAffinityType_enum::CU_EXEC_AFFINITY_TYPE_SM_COUNT`]: number of SMs the context is limited to use.
9242    ///
9243    /// Note that this function may also return error codes from previous, asynchronous launches.
9244    ///
9245    /// # Parameters
9246    ///
9247    /// - `pExecAffinity`: Returned execution affinity.
9248    /// - `type_`: Execution affinity type to query.
9249    ///
9250    /// # Return value
9251    ///
9252    /// - [`CUresult::CUDA_SUCCESS`]
9253    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
9254    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
9255    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
9256    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
9257    /// - [`CUresult::CUDA_ERROR_UNSUPPORTED_EXEC_AFFINITY`]
9258    ///
9259    /// See also: [`CUexecAffinityParam`].
9260    pub fn cuCtxGetExecAffinity(
9261        pExecAffinity: *mut CUexecAffinityParam,
9262        type_: CUexecAffinityType,
9263    ) -> CUresult;
9264}
9265singe_loader::functions! { crate::DRIVER;
9266    /// Records an event.
9267    ///
9268    /// Captures in `hEvent` all the activities of the context `hCtx` at the time of this call. `hEvent` and `hCtx` must be from the same CUDA context, otherwise [`cudaError_enum::CUDA_ERROR_INVALID_HANDLE`] will be returned. Calls such as [`cuEventQuery`] or [`cuCtxWaitEvent`] will then examine or wait for completion of the work that was captured. Uses of `hCtx` after this call do not modify `hEvent`. If the context passed to `hCtx` is the primary context, `hEvent` will capture all the activities of the primary context and its green contexts. If the context passed to `hCtx` is a context converted from green context via [`cuCtxFromGreenCtx`], `hEvent` will capture only the activities of the green context.
9269    ///
9270    /// Note: The API will return [`cudaError_enum::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED`] if the specified context `hCtx` has a stream in the capture mode. In such a case, the call will invalidate all the conflicting captures.
9271    ///
9272    /// # Parameters
9273    ///
9274    /// - `hCtx`: Context to record event for.
9275    /// - `hEvent`: Event to record.
9276    ///
9277    /// # Return value
9278    ///
9279    /// - [`CUresult::CUDA_SUCCESS`]
9280    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
9281    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
9282    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
9283    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
9284    /// - [`CUresult::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED`]
9285    ///
9286    /// See also: [`cuCtxWaitEvent`], [`cuGreenCtxRecordEvent`], [`cuGreenCtxWaitEvent`], [`cuEventRecord`].
9287    pub fn cuCtxRecordEvent(hCtx: CUcontext, hEvent: CUevent) -> CUresult;
9288}
9289singe_loader::functions! { crate::DRIVER;
9290    /// Make a context wait on an event.
9291    ///
9292    /// Makes all future work submitted to context `hCtx` wait for all work captured in `hEvent`. The synchronization will be performed on the device and will not block the calling CPU thread. See [`cuCtxRecordEvent`] for details on what is captured by an event. If the context passed to `hCtx` is the primary context, the primary context and its green contexts will wait for `hEvent`. If the context passed to `hCtx` is a context converted from green context via [`cuCtxFromGreenCtx`], the green context will wait for `hEvent`.
9293    ///
9294    /// Note: `hEvent` may be from a different context or device than `hCtx`.
9295    ///
9296    /// Note: The API will return [`cudaError_enum::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED`] and invalidate the capture if the specified event `hEvent` is part of an ongoing capture sequence or if the specified context `hCtx` has a stream in the capture mode.
9297    ///
9298    /// # Parameters
9299    ///
9300    /// - `hCtx`: Context to wait.
9301    /// - `hEvent`: Event to wait on.
9302    ///
9303    /// # Return value
9304    ///
9305    /// - [`CUresult::CUDA_SUCCESS`]
9306    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
9307    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
9308    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
9309    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
9310    /// - [`CUresult::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED`]
9311    ///
9312    /// See also: [`cuCtxRecordEvent`], [`cuGreenCtxRecordEvent`], [`cuGreenCtxWaitEvent`], [`cuStreamWaitEvent`].
9313    pub fn cuCtxWaitEvent(hCtx: CUcontext, hEvent: CUevent) -> CUresult;
9314}
9315singe_loader::functions! { crate::DRIVER;
9316    /// Increment a context’s usage-count.
9317    ///
9318    /// Note that
9319    ///
9320    /// Increments the usage count of the context and passes back a context handle in `*pctx` that must be passed to [`cuCtxDetach`] when the application is done with the context. [`cuCtxAttach`] fails if there is no context current to the thread.
9321    ///
9322    /// Currently, the `flags` parameter must be 0.
9323    ///
9324    /// Note that this function may also return error codes from previous, asynchronous launches.
9325    ///
9326    /// # Parameters
9327    ///
9328    /// - `pctx`: Returned context handle of the current context.
9329    /// - `flags`: Context attach flags (must be 0).
9330    ///
9331    /// # Return value
9332    ///
9333    /// - [`CUresult::CUDA_SUCCESS`]
9334    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
9335    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
9336    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
9337    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
9338    ///
9339    /// See also: [`cuCtxCreate`], [`cuCtxDestroy`], [`cuCtxDetach`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent`], [`cuCtxPushCurrent`], [`cuCtxSetCacheConfig`], [`cuCtxSetLimit`], [`cuCtxSynchronize`].
9340    #[deprecated]
9341    pub fn cuCtxAttach(pctx: *mut CUcontext, flags: ::core::ffi::c_uint) -> CUresult;
9342}
9343singe_loader::functions! { crate::DRIVER;
9344    /// Decrement a context’s usage-count.
9345    ///
9346    /// Note that
9347    ///
9348    /// Decrements the usage count of the context `ctx`, and destroys the context if the usage count goes to 0. The context must be a handle that was passed back by cuCtxCreate() or [`cuCtxAttach`], and must be current to the calling thread.
9349    ///
9350    /// Note that this function may also return error codes from previous, asynchronous launches.
9351    ///
9352    /// # Parameters
9353    ///
9354    /// - `ctx`: Context to destroy
9355    ///
9356    /// # Return value
9357    ///
9358    /// - [`CUresult::CUDA_SUCCESS`]
9359    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
9360    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
9361    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
9362    ///
9363    /// See also: [`cuCtxCreate`], [`cuCtxDestroy`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent`], [`cuCtxPushCurrent`], [`cuCtxSetCacheConfig`], [`cuCtxSetLimit`], [`cuCtxSynchronize`].
9364    #[deprecated]
9365    pub fn cuCtxDetach(ctx: CUcontext) -> CUresult;
9366}
9367singe_loader::functions! { crate::DRIVER;
9368    /// Returns the current shared memory configuration for the current context.
9369    ///
9370    /// This function will return in `pConfig` the current size of shared memory banks in the current context. On devices with configurable shared memory banks, [`cuCtxSetSharedMemConfig`] can be used to change this setting, so that all subsequent kernel launches will by default use the new bank size. When [`cuCtxGetSharedMemConfig`] is called on devices without configurable shared memory, it will return the fixed bank size of the hardware.
9371    ///
9372    /// The returned bank configurations can be either:
9373    ///
9374    /// * [`CUsharedconfig_enum::CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE`]: shared memory bank width is four bytes.
9375    /// * [`CUsharedconfig_enum::CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE`]: shared memory bank width will eight bytes.
9376    ///
9377    /// Note that this function may also return error codes from previous, asynchronous launches.
9378    ///
9379    /// # Parameters
9380    ///
9381    /// - `pConfig`: returned shared memory configuration
9382    ///
9383    /// # Return value
9384    ///
9385    /// - [`CUresult::CUDA_SUCCESS`]
9386    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
9387    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
9388    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
9389    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
9390    ///
9391    /// See also: [`cuCtxCreate`], [`cuCtxDestroy`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent`], [`cuCtxPushCurrent`], [`cuCtxSetLimit`], [`cuCtxSynchronize`], [`cuFuncSetCacheConfig`], `cudaDeviceGetSharedMemConfig`.
9392    #[deprecated]
9393    pub fn cuCtxGetSharedMemConfig(pConfig: *mut CUsharedconfig) -> CUresult;
9394}
9395singe_loader::functions! { crate::DRIVER;
9396    /// Sets the shared memory configuration for the current context.
9397    ///
9398    /// On devices with configurable shared memory banks, this function will set the context’s shared memory bank size which is used for subsequent kernel launches.
9399    ///
9400    /// Changed the shared memory configuration between launches may insert a device side synchronization point between those launches.
9401    ///
9402    /// Changing the shared memory bank size will not increase shared memory usage or affect occupancy of kernels, but may have major effects on performance. Larger bank sizes will allow for greater potential bandwidth to shared memory, but will change what kinds of accesses to shared memory will result in bank conflicts.
9403    ///
9404    /// This function will do nothing on devices with fixed shared memory bank size.
9405    ///
9406    /// The supported bank configurations are:
9407    ///
9408    /// * [`CUsharedconfig_enum::CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE`]: set bank width to the default initial setting (currently, four bytes).
9409    /// * [`CUsharedconfig_enum::CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE`]: set shared memory bank width to be natively four bytes.
9410    /// * [`CUsharedconfig_enum::CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE`]: set shared memory bank width to be natively eight bytes.
9411    ///
9412    /// Note that this function may also return error codes from previous, asynchronous launches.
9413    ///
9414    /// # Parameters
9415    ///
9416    /// - `config`: requested shared memory configuration
9417    ///
9418    /// # Return value
9419    ///
9420    /// - [`CUresult::CUDA_SUCCESS`]
9421    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
9422    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
9423    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
9424    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
9425    ///
9426    /// See also: [`cuCtxCreate`], [`cuCtxDestroy`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent`], [`cuCtxPushCurrent`], [`cuCtxSetLimit`], [`cuCtxSynchronize`], [`cuCtxGetSharedMemConfig`], [`cuFuncSetCacheConfig`], `cudaDeviceSetSharedMemConfig`.
9427    #[deprecated]
9428    pub fn cuCtxSetSharedMemConfig(config: CUsharedconfig) -> CUresult;
9429}
9430singe_loader::functions! { crate::DRIVER;
9431    /// Loads a compute module.
9432    ///
9433    /// Takes a filename `fname` and loads the corresponding module `module` into the current context. The CUDA driver API does not attempt to lazily allocate the resources needed by a module; if the memory for functions and data (constant and global) needed by the module cannot be allocated, [`cuModuleLoad`] fails. The file should be a `cubin` file as output by **nvcc**, or a `PTX` file either as output by **nvcc** or handwritten, or a `fatbin` file as output by **nvcc** from toolchain 4.0 or later, or a `Tile` IR file.
9434    ///
9435    /// Note that this function may also return error codes from previous, asynchronous launches.
9436    ///
9437    /// # Parameters
9438    ///
9439    /// - `module`: Returned module.
9440    /// - `fname`: Filename of module to load.
9441    ///
9442    /// # Return value
9443    ///
9444    /// - [`CUresult::CUDA_SUCCESS`]
9445    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
9446    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
9447    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
9448    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
9449    /// - [`CUresult::CUDA_ERROR_INVALID_PTX`]
9450    /// - [`CUresult::CUDA_ERROR_UNSUPPORTED_PTX_VERSION`]
9451    /// - [`CUresult::CUDA_ERROR_NOT_FOUND`]
9452    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
9453    /// - [`CUresult::CUDA_ERROR_FILE_NOT_FOUND`]
9454    /// - [`CUresult::CUDA_ERROR_NO_BINARY_FOR_GPU`]
9455    /// - [`CUresult::CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND`]
9456    /// - [`CUresult::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED`]
9457    /// - [`CUresult::CUDA_ERROR_JIT_COMPILER_NOT_FOUND`]
9458    ///
9459    /// See also: [`cuModuleGetFunction`], [`cuModuleGetGlobal`], [`cuModuleGetTexRef`], [`cuModuleLoadData`], [`cuModuleLoadDataEx`], [`cuModuleLoadFatBinary`], [`cuModuleUnload`].
9460    pub fn cuModuleLoad(
9461        module: *mut CUmodule,
9462        fname: *const ::core::ffi::c_char,
9463    ) -> CUresult;
9464}
9465singe_loader::functions! { crate::DRIVER;
9466    /// Load a module’s data.
9467    ///
9468    /// Takes a pointer `image` and loads the corresponding module `module` into the current context. The `image` may be a `cubin` or `fatbin` as output by **nvcc**, or a NULL-terminated `PTX`, either as output by **nvcc** or hand-written, or `Tile` IR data.
9469    ///
9470    /// Note that this function may also return error codes from previous, asynchronous launches.
9471    ///
9472    /// # Parameters
9473    ///
9474    /// - `module`: Returned module.
9475    /// - `image`: Module data to load.
9476    ///
9477    /// # Return value
9478    ///
9479    /// - [`CUresult::CUDA_SUCCESS`]
9480    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
9481    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
9482    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
9483    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
9484    /// - [`CUresult::CUDA_ERROR_INVALID_PTX`]
9485    /// - [`CUresult::CUDA_ERROR_UNSUPPORTED_PTX_VERSION`]
9486    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
9487    /// - [`CUresult::CUDA_ERROR_NO_BINARY_FOR_GPU`]
9488    /// - [`CUresult::CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND`]
9489    /// - [`CUresult::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED`]
9490    /// - [`CUresult::CUDA_ERROR_JIT_COMPILER_NOT_FOUND`]
9491    ///
9492    /// See also: [`cuModuleGetFunction`], [`cuModuleGetGlobal`], [`cuModuleGetTexRef`], [`cuModuleLoad`], [`cuModuleLoadDataEx`], [`cuModuleLoadFatBinary`], [`cuModuleUnload`].
9493    pub fn cuModuleLoadData(
9494        module: *mut CUmodule,
9495        image: *const ::core::ffi::c_void,
9496    ) -> CUresult;
9497}
9498singe_loader::functions! { crate::DRIVER;
9499    /// Load a module’s data with options.
9500    ///
9501    /// Takes a pointer `image` and loads the corresponding module `module` into the current context. The `image` may be a `cubin` or `fatbin` as output by **nvcc**, or a NULL-terminated `PTX`, either as output by **nvcc** or hand-written, or `Tile` IR data.
9502    ///
9503    /// Note that this function may also return error codes from previous, asynchronous launches.
9504    ///
9505    /// # Parameters
9506    ///
9507    /// - `module`: Returned module.
9508    /// - `image`: Module data to load.
9509    /// - `numOptions`: Number of options.
9510    /// - `options`: Options for JIT.
9511    /// - `optionValues`: Option values for JIT.
9512    ///
9513    /// # Return value
9514    ///
9515    /// - [`CUresult::CUDA_SUCCESS`]
9516    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
9517    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
9518    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
9519    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
9520    /// - [`CUresult::CUDA_ERROR_INVALID_PTX`]
9521    /// - [`CUresult::CUDA_ERROR_UNSUPPORTED_PTX_VERSION`]
9522    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
9523    /// - [`CUresult::CUDA_ERROR_NO_BINARY_FOR_GPU`]
9524    /// - [`CUresult::CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND`]
9525    /// - [`CUresult::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED`]
9526    /// - [`CUresult::CUDA_ERROR_JIT_COMPILER_NOT_FOUND`]
9527    ///
9528    /// See also: [`cuModuleGetFunction`], [`cuModuleGetGlobal`], [`cuModuleGetTexRef`], [`cuModuleLoad`], [`cuModuleLoadData`], [`cuModuleLoadFatBinary`], [`cuModuleUnload`].
9529    pub fn cuModuleLoadDataEx(
9530        module: *mut CUmodule,
9531        image: *const ::core::ffi::c_void,
9532        numOptions: ::core::ffi::c_uint,
9533        options: *mut CUjit_option,
9534        optionValues: *mut *mut ::core::ffi::c_void,
9535    ) -> CUresult;
9536}
9537singe_loader::functions! { crate::DRIVER;
9538    /// Load a module’s data.
9539    ///
9540    /// Takes a pointer `fatCubin` and loads the corresponding module `module` into the current context. The pointer represents a *fat binary* object, which is a collection of different `cubin` and/or `PTX` files, all representing the same device code, but compiled and optimized for different architectures.
9541    ///
9542    /// Prior to CUDA 4.0, there was no documented API for constructing and using fat binary objects by programmers. Starting with CUDA 4.0, fat binary objects can be constructed by providing the *-fatbin option* to **nvcc**. More information can be found in the **nvcc** document.
9543    ///
9544    /// Note that this function may also return error codes from previous, asynchronous launches.
9545    ///
9546    /// # Parameters
9547    ///
9548    /// - `module`: Returned module.
9549    /// - `fatCubin`: Fat binary to load.
9550    ///
9551    /// # Return value
9552    ///
9553    /// - [`CUresult::CUDA_SUCCESS`]
9554    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
9555    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
9556    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
9557    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
9558    /// - [`CUresult::CUDA_ERROR_INVALID_PTX`]
9559    /// - [`CUresult::CUDA_ERROR_UNSUPPORTED_PTX_VERSION`]
9560    /// - [`CUresult::CUDA_ERROR_NOT_FOUND`]
9561    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
9562    /// - [`CUresult::CUDA_ERROR_NO_BINARY_FOR_GPU`]
9563    /// - [`CUresult::CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND`]
9564    /// - [`CUresult::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED`]
9565    /// - [`CUresult::CUDA_ERROR_JIT_COMPILER_NOT_FOUND`]
9566    ///
9567    /// See also: [`cuModuleGetFunction`], [`cuModuleGetGlobal`], [`cuModuleGetTexRef`], [`cuModuleLoad`], [`cuModuleLoadData`], [`cuModuleLoadDataEx`], [`cuModuleUnload`].
9568    pub fn cuModuleLoadFatBinary(
9569        module: *mut CUmodule,
9570        fatCubin: *const ::core::ffi::c_void,
9571    ) -> CUresult;
9572}
9573singe_loader::functions! { crate::DRIVER;
9574    /// Unloads a module.
9575    ///
9576    /// Unloads a module `hmod` from the current context. Attempting to unload a module which was obtained from the Library Management API such as [`cuLibraryGetModule`] will return [`cudaError_enum::CUDA_ERROR_NOT_PERMITTED`].
9577    ///
9578    /// Note that this function may also return error codes from previous, asynchronous launches.
9579    ///
9580    /// Note: Use of the handle after this call is undefined behavior.
9581    ///
9582    /// # Parameters
9583    ///
9584    /// - `hmod`: Module to unload
9585    ///
9586    /// # Return value
9587    ///
9588    /// - [`CUresult::CUDA_SUCCESS`]
9589    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
9590    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
9591    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
9592    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
9593    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
9594    ///
9595    /// See also: [`cuModuleGetFunction`], [`cuModuleGetGlobal`], [`cuModuleGetTexRef`], [`cuModuleLoad`], [`cuModuleLoadData`], [`cuModuleLoadDataEx`], [`cuModuleLoadFatBinary`].
9596    pub fn cuModuleUnload(hmod: CUmodule) -> CUresult;
9597}
9598impl CUmoduleLoadingMode_enum {
9599    /// Lazy Kernel Loading is not enabled.
9600    pub const CU_MODULE_EAGER_LOADING: CUmoduleLoadingMode_enum = CUmoduleLoadingMode_enum(
9601        1,
9602    );
9603    /// Lazy Kernel Loading is enabled.
9604    pub const CU_MODULE_LAZY_LOADING: CUmoduleLoadingMode_enum = CUmoduleLoadingMode_enum(
9605        2,
9606    );
9607}
9608/// CUDA Lazy Loading status.
9609#[repr(transparent)]
9610#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
9611pub struct CUmoduleLoadingMode_enum(pub ::core::ffi::c_uint);
9612pub use self::CUmoduleLoadingMode_enum as CUmoduleLoadingMode;
9613singe_loader::functions! { crate::DRIVER;
9614    /// Query lazy loading mode.
9615    ///
9616    /// Returns lazy loading mode Module loading mode is controlled by CUDA_MODULE_LOADING env variable.
9617    ///
9618    /// Note that this function may also return error codes from previous, asynchronous launches.
9619    ///
9620    /// # Parameters
9621    ///
9622    /// - `mode`: Returns the lazy loading mode
9623    ///
9624    /// # Return value
9625    ///
9626    /// - [`CUresult::CUDA_SUCCESS`]
9627    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
9628    ///
9629    /// See also: [`cuModuleLoad`].
9630    pub fn cuModuleGetLoadingMode(mode: *mut CUmoduleLoadingMode) -> CUresult;
9631}
9632singe_loader::functions! { crate::DRIVER;
9633    /// Returns a function handle.
9634    ///
9635    /// Returns in `*hfunc` the handle of the function of name `name` located in module `hmod`. If no function of that name exists, [`cuModuleGetFunction`] returns [`cudaError_enum::CUDA_ERROR_NOT_FOUND`].
9636    ///
9637    /// Note that this function may also return error codes from previous, asynchronous launches.
9638    ///
9639    /// # Parameters
9640    ///
9641    /// - `hfunc`: Returned function handle.
9642    /// - `hmod`: Module to retrieve function from.
9643    /// - `name`: Name of function to retrieve.
9644    ///
9645    /// # Return value
9646    ///
9647    /// - [`CUresult::CUDA_SUCCESS`]
9648    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
9649    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
9650    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
9651    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
9652    /// - [`CUresult::CUDA_ERROR_NOT_FOUND`]
9653    ///
9654    /// See also: [`cuModuleGetGlobal`], [`cuModuleGetTexRef`], [`cuModuleLoad`], [`cuModuleLoadData`], [`cuModuleLoadDataEx`], [`cuModuleLoadFatBinary`], [`cuModuleUnload`].
9655    pub fn cuModuleGetFunction(
9656        hfunc: *mut CUfunction,
9657        hmod: CUmodule,
9658        name: *const ::core::ffi::c_char,
9659    ) -> CUresult;
9660}
9661singe_loader::functions! { crate::DRIVER;
9662    /// Returns the number of functions within a module.
9663    ///
9664    /// Returns in `count` the number of functions in `mod`.
9665    ///
9666    /// # Parameters
9667    ///
9668    /// - `count`: Number of functions found within the module.
9669    /// - `mod_`: Module to query.
9670    ///
9671    /// # Return value
9672    ///
9673    /// - [`CUresult::CUDA_SUCCESS`]
9674    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
9675    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
9676    pub fn cuModuleGetFunctionCount(
9677        count: *mut ::core::ffi::c_uint,
9678        mod_: CUmodule,
9679    ) -> CUresult;
9680}
9681singe_loader::functions! { crate::DRIVER;
9682    /// Returns the function handles within a module.
9683    ///
9684    /// Returns in `functions` a maximum number of `numFunctions` function handles within `mod`. When function loading mode is set to LAZY the function retrieved may be partially loaded. The loading state of a function can be queried using `cuFunctionIsLoaded`. CUDA APIs may load the function automatically when called with partially loaded function handle which may incur additional latency. Alternatively, `cuFunctionLoad` can be used to explicitly load a function. The returned function handles become invalid when the module is unloaded.
9685    ///
9686    /// # Parameters
9687    ///
9688    /// - `functions`: Buffer where the function handles are returned to.
9689    /// - `numFunctions`: Maximum number of function handles may be returned to the buffer.
9690    /// - `mod_`: Module to query from.
9691    ///
9692    /// # Return value
9693    ///
9694    /// - [`CUresult::CUDA_SUCCESS`]
9695    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
9696    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
9697    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
9698    ///
9699    /// See also: [`cuModuleGetFunction`], [`cuModuleGetFunctionCount`], [`cuFuncIsLoaded`], [`cuFuncLoad`].
9700    pub fn cuModuleEnumerateFunctions(
9701        functions: *mut CUfunction,
9702        numFunctions: ::core::ffi::c_uint,
9703        mod_: CUmodule,
9704    ) -> CUresult;
9705}
9706singe_loader::functions! { crate::DRIVER;
9707    /// Returns a global pointer from a module.
9708    ///
9709    /// Returns in `*dptr` and `*bytes` the base pointer and size of the global of name `name` located in module `hmod`. If no variable of that name exists, cuModuleGetGlobal() returns [`cudaError_enum::CUDA_ERROR_NOT_FOUND`]. One of the parameters `dptr` or `bytes` (not both) can be NULL in which case it is ignored.
9710    ///
9711    /// Note that this function may also return error codes from previous, asynchronous launches.
9712    ///
9713    /// # Parameters
9714    ///
9715    /// - `dptr`: Returned global device pointer.
9716    /// - `bytes`: Returned global size in bytes.
9717    /// - `hmod`: Module to retrieve global from.
9718    /// - `name`: Name of global to retrieve.
9719    ///
9720    /// # Return value
9721    ///
9722    /// - [`CUresult::CUDA_SUCCESS`]
9723    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
9724    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
9725    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
9726    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
9727    /// - [`CUresult::CUDA_ERROR_NOT_FOUND`]
9728    ///
9729    /// See also: [`cuModuleGetFunction`], [`cuModuleGetTexRef`], [`cuModuleLoad`], [`cuModuleLoadData`], [`cuModuleLoadDataEx`], [`cuModuleLoadFatBinary`], [`cuModuleUnload`], `cudaGetSymbolAddress`, `cudaGetSymbolSize`.
9730    pub fn cuModuleGetGlobal_v2(
9731        dptr: *mut CUdeviceptr,
9732        bytes: *mut size_t,
9733        hmod: CUmodule,
9734        name: *const ::core::ffi::c_char,
9735    ) -> CUresult;
9736}
9737singe_loader::functions! { crate::DRIVER;
9738    /// Creates a pending JIT linker invocation.
9739    ///
9740    /// If the call is successful, the caller owns the returned CUlinkState, which should eventually be destroyed with [`cuLinkDestroy`]. The device code machine size (32 or 64 bit) will match the calling application.
9741    ///
9742    /// Both linker and compiler options may be specified. Compiler options will be applied to inputs to this linker action which must be compiled from PTX. The options [`CUjit_option_enum::CU_JIT_WALL_TIME`], [`CUjit_option_enum::CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES`], and [`CUjit_option_enum::CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES`] will accumulate data until the CUlinkState is destroyed.
9743    ///
9744    /// The data passed in via cuLinkAddData and cuLinkAddFile will be treated as relocatable (-rdc=true to nvcc) when linking the final cubin during [`cuLinkComplete`] and will have similar consequences as offline relocatable device code linking.
9745    ///
9746    /// `optionValues` must remain valid for the life of the CUlinkState if output options are used. No other references to inputs are maintained after this call returns.
9747    ///
9748    /// Note: For LTO-IR input, only LTO-IR compiled with toolkits prior to CUDA 12.0 will be accepted.
9749    ///
9750    /// Note that this function may also return error codes from previous, asynchronous launches.
9751    ///
9752    /// # Parameters
9753    ///
9754    /// - `numOptions`: Size of options arrays.
9755    /// - `options`: Array of linker and compiler options.
9756    /// - `optionValues`: Array of option values, each cast to void \*.
9757    /// - `stateOut`: On success, this will contain a CUlinkState to specify and complete this action.
9758    ///
9759    /// # Return value
9760    ///
9761    /// - [`CUresult::CUDA_SUCCESS`]
9762    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
9763    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
9764    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
9765    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
9766    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
9767    /// - [`CUresult::CUDA_ERROR_JIT_COMPILER_NOT_FOUND`]
9768    ///
9769    /// See also: [`cuLinkAddData`], [`cuLinkAddFile`], [`cuLinkComplete`], [`cuLinkDestroy`].
9770    pub fn cuLinkCreate_v2(
9771        numOptions: ::core::ffi::c_uint,
9772        options: *mut CUjit_option,
9773        optionValues: *mut *mut ::core::ffi::c_void,
9774        stateOut: *mut CUlinkState,
9775    ) -> CUresult;
9776}
9777singe_loader::functions! { crate::DRIVER;
9778    /// Add an input to a pending linker invocation.
9779    ///
9780    /// Ownership of `data` is retained by the caller. No reference is retained to any inputs after this call returns.
9781    ///
9782    /// This method accepts only compiler options, which are used if the data must be compiled from PTX, and does not accept any of [`CUjit_option_enum::CU_JIT_WALL_TIME`], [`CUjit_option_enum::CU_JIT_INFO_LOG_BUFFER`], [`CUjit_option_enum::CU_JIT_ERROR_LOG_BUFFER`], [`CUjit_option_enum::CU_JIT_TARGET_FROM_CUCONTEXT`], or [`CUjit_option_enum::CU_JIT_TARGET`].
9783    ///
9784    /// Note: For LTO-IR input, only LTO-IR compiled with toolkits prior to CUDA 12.0 will be accepted.
9785    ///
9786    /// # Parameters
9787    ///
9788    /// - `state`: A pending linker action.
9789    /// - `type_`: The type of the input data.
9790    /// - `data`: The input data. PTX must be NULL-terminated.
9791    /// - `size`: The length of the input data.
9792    /// - `name`: An optional name for this input in log messages.
9793    /// - `numOptions`: Size of options.
9794    /// - `options`: Options to be applied only for this input (overrides options from cuLinkCreate).
9795    /// - `optionValues`: Array of option values, each cast to void \*.
9796    ///
9797    /// # Return value
9798    ///
9799    /// - [`CUresult::CUDA_SUCCESS`]
9800    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
9801    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
9802    /// - [`CUresult::CUDA_ERROR_INVALID_IMAGE`]
9803    /// - [`CUresult::CUDA_ERROR_INVALID_PTX`]
9804    /// - [`CUresult::CUDA_ERROR_UNSUPPORTED_PTX_VERSION`]
9805    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
9806    /// - [`CUresult::CUDA_ERROR_NO_BINARY_FOR_GPU`]
9807    ///
9808    /// See also: [`cuLinkCreate`], [`cuLinkAddFile`], [`cuLinkComplete`], [`cuLinkDestroy`].
9809    pub fn cuLinkAddData_v2(
9810        state: CUlinkState,
9811        type_: CUjitInputType,
9812        data: *mut ::core::ffi::c_void,
9813        size: size_t,
9814        name: *const ::core::ffi::c_char,
9815        numOptions: ::core::ffi::c_uint,
9816        options: *mut CUjit_option,
9817        optionValues: *mut *mut ::core::ffi::c_void,
9818    ) -> CUresult;
9819}
9820singe_loader::functions! { crate::DRIVER;
9821    /// Add a file input to a pending linker invocation.
9822    ///
9823    /// No reference is retained to any inputs after this call returns.
9824    ///
9825    /// This method accepts only compiler options, which are used if the input must be compiled from PTX, and does not accept any of [`CUjit_option_enum::CU_JIT_WALL_TIME`], [`CUjit_option_enum::CU_JIT_INFO_LOG_BUFFER`], [`CUjit_option_enum::CU_JIT_ERROR_LOG_BUFFER`], [`CUjit_option_enum::CU_JIT_TARGET_FROM_CUCONTEXT`], or [`CUjit_option_enum::CU_JIT_TARGET`].
9826    ///
9827    /// This method is equivalent to invoking cuLinkAddData on the contents of the file.
9828    ///
9829    /// Note: For LTO-IR input, only LTO-IR compiled with toolkits prior to CUDA 12.0 will be accepted.
9830    ///
9831    /// # Parameters
9832    ///
9833    /// - `state`: A pending linker action.
9834    /// - `type_`: The type of the input data.
9835    /// - `path`: Path to the input file.
9836    /// - `numOptions`: Size of options.
9837    /// - `options`: Options to be applied only for this input (overrides options from cuLinkCreate).
9838    /// - `optionValues`: Array of option values, each cast to void \*.
9839    ///
9840    /// # Return value
9841    ///
9842    /// - [`CUresult::CUDA_SUCCESS`]
9843    /// - [`CUresult::CUDA_ERROR_FILE_NOT_FOUND`]
9844    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
9845    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
9846    /// - [`CUresult::CUDA_ERROR_INVALID_IMAGE`]
9847    /// - [`CUresult::CUDA_ERROR_INVALID_PTX`]
9848    /// - [`CUresult::CUDA_ERROR_UNSUPPORTED_PTX_VERSION`]
9849    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
9850    /// - [`CUresult::CUDA_ERROR_NO_BINARY_FOR_GPU`]
9851    ///
9852    /// See also: [`cuLinkCreate`], [`cuLinkAddData`], [`cuLinkComplete`], [`cuLinkDestroy`].
9853    pub fn cuLinkAddFile_v2(
9854        state: CUlinkState,
9855        type_: CUjitInputType,
9856        path: *const ::core::ffi::c_char,
9857        numOptions: ::core::ffi::c_uint,
9858        options: *mut CUjit_option,
9859        optionValues: *mut *mut ::core::ffi::c_void,
9860    ) -> CUresult;
9861}
9862singe_loader::functions! { crate::DRIVER;
9863    /// Complete a pending linker invocation.
9864    ///
9865    /// Completes the pending linker action and returns the cubin image for the linked device code, which can be used with [`cuModuleLoadData`]. The cubin is owned by `state`, so it should be loaded before `state` is destroyed via [`cuLinkDestroy`]. This call does not destroy `state`.
9866    ///
9867    /// # Parameters
9868    ///
9869    /// - `state`: A pending linker invocation.
9870    /// - `cubinOut`: On success, this will point to the output image.
9871    /// - `sizeOut`: Optional parameter to receive the size of the generated image.
9872    ///
9873    /// # Return value
9874    ///
9875    /// - [`CUresult::CUDA_SUCCESS`]
9876    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
9877    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
9878    ///
9879    /// See also: [`cuLinkCreate`], [`cuLinkAddData`], [`cuLinkAddFile`], [`cuLinkDestroy`], [`cuModuleLoadData`].
9880    pub fn cuLinkComplete(
9881        state: CUlinkState,
9882        cubinOut: *mut *mut ::core::ffi::c_void,
9883        sizeOut: *mut size_t,
9884    ) -> CUresult;
9885}
9886singe_loader::functions! { crate::DRIVER;
9887    /// Destroys state for a JIT linker invocation.
9888    ///
9889    /// # Parameters
9890    ///
9891    /// - `state`: State object for the linker invocation
9892    ///
9893    /// # Return value
9894    ///
9895    /// - [`CUresult::CUDA_SUCCESS`]
9896    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
9897    ///
9898    /// See also: [`cuLinkCreate`].
9899    pub fn cuLinkDestroy(state: CUlinkState) -> CUresult;
9900}
9901singe_loader::functions! { crate::DRIVER;
9902    /// Returns a handle to a texture reference.
9903    ///
9904    /// Returns in `*pTexRef` the handle of the texture reference of name `name` in the module `hmod`. If no texture reference of that name exists, [`cuModuleGetTexRef`] returns [`cudaError_enum::CUDA_ERROR_NOT_FOUND`]. This texture reference handle should not be destroyed, since it will be destroyed when the module is unloaded.
9905    ///
9906    /// Note that this function may also return error codes from previous, asynchronous launches.
9907    ///
9908    /// # Parameters
9909    ///
9910    /// - `pTexRef`: Returned texture reference.
9911    /// - `hmod`: Module to retrieve texture reference from.
9912    /// - `name`: Name of texture reference to retrieve.
9913    ///
9914    /// # Return value
9915    ///
9916    /// - [`CUresult::CUDA_SUCCESS`]
9917    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
9918    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
9919    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
9920    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
9921    /// - [`CUresult::CUDA_ERROR_NOT_FOUND`]
9922    ///
9923    /// See also: [`cuModuleGetFunction`], [`cuModuleGetGlobal`], [`cuModuleGetSurfRef`], [`cuModuleLoad`], [`cuModuleLoadData`], [`cuModuleLoadDataEx`], [`cuModuleLoadFatBinary`], [`cuModuleUnload`].
9924    #[deprecated]
9925    pub fn cuModuleGetTexRef(
9926        pTexRef: *mut CUtexref,
9927        hmod: CUmodule,
9928        name: *const ::core::ffi::c_char,
9929    ) -> CUresult;
9930}
9931singe_loader::functions! { crate::DRIVER;
9932    /// Returns a handle to a surface reference.
9933    ///
9934    /// Returns in `*pSurfRef` the handle of the surface reference of name `name` in the module `hmod`. If no surface reference of that name exists, [`cuModuleGetSurfRef`] returns [`cudaError_enum::CUDA_ERROR_NOT_FOUND`].
9935    ///
9936    /// Note that this function may also return error codes from previous, asynchronous launches.
9937    ///
9938    /// # Parameters
9939    ///
9940    /// - `pSurfRef`: Returned surface reference.
9941    /// - `hmod`: Module to retrieve surface reference from.
9942    /// - `name`: Name of surface reference to retrieve.
9943    ///
9944    /// # Return value
9945    ///
9946    /// - [`CUresult::CUDA_SUCCESS`]
9947    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
9948    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
9949    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
9950    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
9951    /// - [`CUresult::CUDA_ERROR_NOT_FOUND`]
9952    ///
9953    /// See also: [`cuModuleGetFunction`], [`cuModuleGetGlobal`], [`cuModuleGetTexRef`], [`cuModuleLoad`], [`cuModuleLoadData`], [`cuModuleLoadDataEx`], [`cuModuleLoadFatBinary`], [`cuModuleUnload`].
9954    #[deprecated]
9955    pub fn cuModuleGetSurfRef(
9956        pSurfRef: *mut CUsurfref,
9957        hmod: CUmodule,
9958        name: *const ::core::ffi::c_char,
9959    ) -> CUresult;
9960}
9961singe_loader::functions! { crate::DRIVER;
9962    /// Load a library with specified code and options.
9963    ///
9964    /// Takes a pointer `code` and loads the corresponding library `library` based on the application defined library loading mode:
9965    ///
9966    /// * If module loading is set to EAGER, via the environment variables described in “Module loading”, `library` is loaded eagerly into all contexts at the time of the call and future contexts at the time of creation until the library is unloaded with [`cuLibraryUnload`].
9967    /// * If the environment variables are set to LAZY, `library` is not immediately loaded onto all existent contexts and will only be loaded when a function is needed for that context, such as a kernel launch.
9968    ///
9969    /// These environment variables are described in the CUDA programming guide under the “CUDA environment variables” section.
9970    ///
9971    /// The `code` may be a `cubin` or `fatbin` as output by **nvcc**, or a NULL-terminated `PTX`, either as output by **nvcc** or hand-written, or `Tile` IR data. A fatbin should also contain relocatable code when doing separate compilation.
9972    ///
9973    /// Options are passed as an array via `jitOptions` and any corresponding parameters are passed in `jitOptionsValues`. The number of total JIT options is supplied via `numJitOptions`. Any outputs will be returned via `jitOptionsValues`.
9974    ///
9975    /// Library load options are passed as an array via `libraryOptions` and any corresponding parameters are passed in `libraryOptionValues`. The number of total library load options is supplied via `numLibraryOptions`.
9976    ///
9977    /// Note: If the library contains managed variables and no device in the system supports managed variables this call is expected to return [`cudaError_enum::CUDA_ERROR_NOT_SUPPORTED`].
9978    ///
9979    /// # Parameters
9980    ///
9981    /// - `library`: Returned library.
9982    /// - `code`: Code to load.
9983    /// - `jitOptions`: Options for JIT.
9984    /// - `jitOptionsValues`: Option values for JIT.
9985    /// - `numJitOptions`: Number of options.
9986    /// - `libraryOptions`: Options for loading.
9987    /// - `libraryOptionValues`: Option values for loading.
9988    /// - `numLibraryOptions`: Number of options for loading.
9989    ///
9990    /// # Return value
9991    ///
9992    /// - [`CUresult::CUDA_SUCCESS`]
9993    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
9994    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
9995    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
9996    /// - [`CUresult::CUDA_ERROR_INVALID_PTX`]
9997    /// - [`CUresult::CUDA_ERROR_UNSUPPORTED_PTX_VERSION`]
9998    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
9999    /// - [`CUresult::CUDA_ERROR_NO_BINARY_FOR_GPU`]
10000    /// - [`CUresult::CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND`]
10001    /// - [`CUresult::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED`]
10002    /// - [`CUresult::CUDA_ERROR_JIT_COMPILER_NOT_FOUND`]
10003    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
10004    ///
10005    /// See also: [`cuLibraryLoadFromFile`], [`cuLibraryUnload`], [`cuModuleLoad`], [`cuModuleLoadData`], [`cuModuleLoadDataEx`].
10006    pub fn cuLibraryLoadData(
10007        library: *mut CUlibrary,
10008        code: *const ::core::ffi::c_void,
10009        jitOptions: *mut CUjit_option,
10010        jitOptionsValues: *mut *mut ::core::ffi::c_void,
10011        numJitOptions: ::core::ffi::c_uint,
10012        libraryOptions: *mut CUlibraryOption,
10013        libraryOptionValues: *mut *mut ::core::ffi::c_void,
10014        numLibraryOptions: ::core::ffi::c_uint,
10015    ) -> CUresult;
10016}
10017singe_loader::functions! { crate::DRIVER;
10018    /// Load a library with specified file and options.
10019    ///
10020    /// Takes a pointer `code` and loads the corresponding library `library` based on the application defined library loading mode:
10021    ///
10022    /// * If module loading is set to EAGER, via the environment variables described in “Module loading”, `library` is loaded eagerly into all contexts at the time of the call and future contexts at the time of creation until the library is unloaded with [`cuLibraryUnload`].
10023    /// * If the environment variables are set to LAZY, `library` is not immediately loaded onto all existent contexts and will only be loaded when a function is needed for that context, such as a kernel launch.
10024    ///
10025    /// These environment variables are described in the CUDA programming guide under the “CUDA environment variables” section.
10026    ///
10027    /// The file should be a `cubin` file as output by **nvcc**, or a `PTX` file either as output by **nvcc** or handwritten, or a `fatbin` file as output by **nvcc** or hand-written, or `Tile` IR file. A fatbin should also contain relocatable code when doing separate compilation.
10028    ///
10029    /// Options are passed as an array via `jitOptions` and any corresponding parameters are passed in `jitOptionsValues`. The number of total options is supplied via `numJitOptions`. Any outputs will be returned via `jitOptionsValues`.
10030    ///
10031    /// Library load options are passed as an array via `libraryOptions` and any corresponding parameters are passed in `libraryOptionValues`. The number of total library load options is supplied via `numLibraryOptions`.
10032    ///
10033    /// Note: If the library contains managed variables and no device in the system supports managed variables this call is expected to return [`cudaError_enum::CUDA_ERROR_NOT_SUPPORTED`].
10034    ///
10035    /// # Parameters
10036    ///
10037    /// - `library`: Returned library.
10038    /// - `fileName`: File to load from.
10039    /// - `jitOptions`: Options for JIT.
10040    /// - `jitOptionsValues`: Option values for JIT.
10041    /// - `numJitOptions`: Number of options.
10042    /// - `libraryOptions`: Options for loading.
10043    /// - `libraryOptionValues`: Option values for loading.
10044    /// - `numLibraryOptions`: Number of options for loading.
10045    ///
10046    /// # Return value
10047    ///
10048    /// - [`CUresult::CUDA_SUCCESS`]
10049    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
10050    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
10051    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10052    /// - [`CUresult::CUDA_ERROR_INVALID_PTX`]
10053    /// - [`CUresult::CUDA_ERROR_UNSUPPORTED_PTX_VERSION`]
10054    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
10055    /// - [`CUresult::CUDA_ERROR_NO_BINARY_FOR_GPU`]
10056    /// - [`CUresult::CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND`]
10057    /// - [`CUresult::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED`]
10058    /// - [`CUresult::CUDA_ERROR_JIT_COMPILER_NOT_FOUND`]
10059    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
10060    ///
10061    /// See also: [`cuLibraryLoadData`], [`cuLibraryUnload`], [`cuModuleLoad`], [`cuModuleLoadData`], [`cuModuleLoadDataEx`].
10062    pub fn cuLibraryLoadFromFile(
10063        library: *mut CUlibrary,
10064        fileName: *const ::core::ffi::c_char,
10065        jitOptions: *mut CUjit_option,
10066        jitOptionsValues: *mut *mut ::core::ffi::c_void,
10067        numJitOptions: ::core::ffi::c_uint,
10068        libraryOptions: *mut CUlibraryOption,
10069        libraryOptionValues: *mut *mut ::core::ffi::c_void,
10070        numLibraryOptions: ::core::ffi::c_uint,
10071    ) -> CUresult;
10072}
10073singe_loader::functions! { crate::DRIVER;
10074    /// Unloads a library.
10075    ///
10076    /// Unloads the library specified with `library`.
10077    ///
10078    /// # Parameters
10079    ///
10080    /// - `library`: Library to unload
10081    ///
10082    /// # Return value
10083    ///
10084    /// - [`CUresult::CUDA_SUCCESS`]
10085    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
10086    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
10087    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10088    ///
10089    /// See also: [`cuLibraryLoadData`], [`cuLibraryLoadFromFile`], [`cuModuleUnload`].
10090    pub fn cuLibraryUnload(library: CUlibrary) -> CUresult;
10091}
10092singe_loader::functions! { crate::DRIVER;
10093    /// Returns a kernel handle.
10094    ///
10095    /// Returns in `pKernel` the handle of the kernel with name `name` located in library `library`. If kernel handle is not found, the call returns [`cudaError_enum::CUDA_ERROR_NOT_FOUND`].
10096    ///
10097    /// # Parameters
10098    ///
10099    /// - `pKernel`: Returned kernel handle.
10100    /// - `library`: Library to retrieve kernel from.
10101    /// - `name`: Name of kernel to retrieve.
10102    ///
10103    /// # Return value
10104    ///
10105    /// - [`CUresult::CUDA_SUCCESS`]
10106    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
10107    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
10108    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10109    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
10110    /// - [`CUresult::CUDA_ERROR_NOT_FOUND`]
10111    ///
10112    /// See also: [`cuLibraryLoadData`], [`cuLibraryLoadFromFile`], [`cuLibraryUnload`], [`cuKernelGetFunction`], [`cuLibraryGetModule`], [`cuModuleGetFunction`].
10113    pub fn cuLibraryGetKernel(
10114        pKernel: *mut CUkernel,
10115        library: CUlibrary,
10116        name: *const ::core::ffi::c_char,
10117    ) -> CUresult;
10118}
10119singe_loader::functions! { crate::DRIVER;
10120    /// Returns the number of kernels within a library.
10121    ///
10122    /// Returns in `count` the number of kernels in `lib`.
10123    ///
10124    /// # Parameters
10125    ///
10126    /// - `count`: Number of kernels found within the library.
10127    /// - `lib`: Library to query.
10128    ///
10129    /// # Return value
10130    ///
10131    /// - [`CUresult::CUDA_SUCCESS`]
10132    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
10133    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10134    pub fn cuLibraryGetKernelCount(
10135        count: *mut ::core::ffi::c_uint,
10136        lib: CUlibrary,
10137    ) -> CUresult;
10138}
10139singe_loader::functions! { crate::DRIVER;
10140    /// Retrieve the kernel handles within a library.
10141    ///
10142    /// Returns in `kernels` a maximum number of `numKernels` kernel handles within `lib`. The returned kernel handle becomes invalid when the library is unloaded.
10143    ///
10144    /// # Parameters
10145    ///
10146    /// - `kernels`: Buffer where the kernel handles are returned to.
10147    /// - `numKernels`: Maximum number of kernel handles may be returned to the buffer.
10148    /// - `lib`: Library to query from.
10149    ///
10150    /// # Return value
10151    ///
10152    /// - [`CUresult::CUDA_SUCCESS`]
10153    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
10154    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10155    ///
10156    /// See also: [`cuLibraryGetKernelCount`].
10157    pub fn cuLibraryEnumerateKernels(
10158        kernels: *mut CUkernel,
10159        numKernels: ::core::ffi::c_uint,
10160        lib: CUlibrary,
10161    ) -> CUresult;
10162}
10163singe_loader::functions! { crate::DRIVER;
10164    /// Returns a module handle.
10165    ///
10166    /// Returns in `pMod` the module handle associated with the current context located in library `library`. If module handle is not found, the call returns [`cudaError_enum::CUDA_ERROR_NOT_FOUND`].
10167    ///
10168    /// # Parameters
10169    ///
10170    /// - `pMod`: Returned module handle.
10171    /// - `library`: Library to retrieve module from.
10172    ///
10173    /// # Return value
10174    ///
10175    /// - [`CUresult::CUDA_SUCCESS`]
10176    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
10177    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
10178    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10179    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
10180    /// - [`CUresult::CUDA_ERROR_NOT_FOUND`]
10181    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
10182    /// - [`CUresult::CUDA_ERROR_CONTEXT_IS_DESTROYED`]
10183    ///
10184    /// See also: [`cuLibraryLoadData`], [`cuLibraryLoadFromFile`], [`cuLibraryUnload`], [`cuModuleGetFunction`].
10185    pub fn cuLibraryGetModule(pMod: *mut CUmodule, library: CUlibrary) -> CUresult;
10186}
10187singe_loader::functions! { crate::DRIVER;
10188    /// Returns a function handle.
10189    ///
10190    /// Returns in `pFunc` the handle of the function for the requested kernel `kernel` and the current context. If function handle is not found, the call returns [`cudaError_enum::CUDA_ERROR_NOT_FOUND`].
10191    ///
10192    /// # Parameters
10193    ///
10194    /// - `pFunc`: Returned function handle.
10195    /// - `kernel`: Kernel to retrieve function for the requested context.
10196    ///
10197    /// # Return value
10198    ///
10199    /// - [`CUresult::CUDA_SUCCESS`]
10200    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
10201    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
10202    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10203    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
10204    /// - [`CUresult::CUDA_ERROR_NOT_FOUND`]
10205    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
10206    /// - [`CUresult::CUDA_ERROR_CONTEXT_IS_DESTROYED`]
10207    ///
10208    /// See also: [`cuLibraryLoadData`], [`cuLibraryLoadFromFile`], [`cuLibraryUnload`], [`cuLibraryGetKernel`], [`cuLibraryGetModule`], [`cuModuleGetFunction`].
10209    pub fn cuKernelGetFunction(pFunc: *mut CUfunction, kernel: CUkernel) -> CUresult;
10210}
10211singe_loader::functions! { crate::DRIVER;
10212    /// Returns a library handle.
10213    ///
10214    /// Returns in `pLib` the handle of the library for the requested kernel `kernel`.
10215    ///
10216    /// # Parameters
10217    ///
10218    /// - `pLib`: Returned library handle.
10219    /// - `kernel`: Kernel to retrieve library handle.
10220    ///
10221    /// # Return value
10222    ///
10223    /// - [`CUresult::CUDA_SUCCESS`]
10224    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
10225    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
10226    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10227    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
10228    /// - [`CUresult::CUDA_ERROR_NOT_FOUND`]
10229    ///
10230    /// See also: [`cuLibraryLoadData`], [`cuLibraryLoadFromFile`], [`cuLibraryUnload`], [`cuLibraryGetKernel`].
10231    pub fn cuKernelGetLibrary(pLib: *mut CUlibrary, kernel: CUkernel) -> CUresult;
10232}
10233singe_loader::functions! { crate::DRIVER;
10234    /// Returns a global device pointer.
10235    ///
10236    /// Returns in `*dptr` and `*bytes` the base pointer and size of the global with name `name` for the requested library `library` and the current context. If no global for the requested name `name` exists, the call returns [`cudaError_enum::CUDA_ERROR_NOT_FOUND`]. One of the parameters `dptr` or `bytes` (not both) can be NULL in which case it is ignored.
10237    ///
10238    /// # Parameters
10239    ///
10240    /// - `dptr`: Returned global device pointer for the requested context.
10241    /// - `bytes`: Returned global size in bytes.
10242    /// - `library`: Library to retrieve global from.
10243    /// - `name`: Name of global to retrieve.
10244    ///
10245    /// # Return value
10246    ///
10247    /// - [`CUresult::CUDA_SUCCESS`]
10248    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
10249    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
10250    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10251    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
10252    /// - [`CUresult::CUDA_ERROR_NOT_FOUND`]
10253    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
10254    /// - [`CUresult::CUDA_ERROR_CONTEXT_IS_DESTROYED`]
10255    ///
10256    /// See also: [`cuLibraryLoadData`], [`cuLibraryLoadFromFile`], [`cuLibraryUnload`], [`cuLibraryGetModule`], [`cuModuleGetGlobal`].
10257    pub fn cuLibraryGetGlobal(
10258        dptr: *mut CUdeviceptr,
10259        bytes: *mut size_t,
10260        library: CUlibrary,
10261        name: *const ::core::ffi::c_char,
10262    ) -> CUresult;
10263}
10264singe_loader::functions! { crate::DRIVER;
10265    /// Returns a pointer to managed memory.
10266    ///
10267    /// Returns in `*dptr` and `*bytes` the base pointer and size of the managed memory with name `name` for the requested library `library`. If no managed memory with the requested name `name` exists, the call returns [`cudaError_enum::CUDA_ERROR_NOT_FOUND`]. One of the parameters `dptr` or `bytes` (not both) can be NULL in which case it is ignored. Note that managed memory for library `library` is shared across devices and is registered when the library is loaded into at least one context.
10268    ///
10269    /// # Parameters
10270    ///
10271    /// - `dptr`: Returned pointer to the managed memory.
10272    /// - `bytes`: Returned memory size in bytes.
10273    /// - `library`: Library to retrieve managed memory from.
10274    /// - `name`: Name of managed memory to retrieve.
10275    ///
10276    /// # Return value
10277    ///
10278    /// - [`CUresult::CUDA_SUCCESS`]
10279    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
10280    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
10281    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10282    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
10283    /// - [`CUresult::CUDA_ERROR_NOT_FOUND`]
10284    ///
10285    /// See also: [`cuLibraryLoadData`], [`cuLibraryLoadFromFile`], [`cuLibraryUnload`].
10286    pub fn cuLibraryGetManaged(
10287        dptr: *mut CUdeviceptr,
10288        bytes: *mut size_t,
10289        library: CUlibrary,
10290        name: *const ::core::ffi::c_char,
10291    ) -> CUresult;
10292}
10293singe_loader::functions! { crate::DRIVER;
10294    /// Returns a pointer to a unified function.
10295    ///
10296    /// Returns in `*fptr` the function pointer to a unified function denoted by `symbol`. If no unified function with name `symbol` exists, the call returns [`cudaError_enum::CUDA_ERROR_NOT_FOUND`]. If there is no device with attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_UNIFIED_FUNCTION_POINTERS`] present in the system, the call may return [`cudaError_enum::CUDA_ERROR_NOT_FOUND`].
10297    ///
10298    /// # Parameters
10299    ///
10300    /// - `fptr`: Returned pointer to a unified function.
10301    /// - `library`: Library to retrieve function pointer memory from.
10302    /// - `symbol`: Name of function pointer to retrieve.
10303    ///
10304    /// # Return value
10305    ///
10306    /// - [`CUresult::CUDA_SUCCESS`]
10307    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
10308    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
10309    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10310    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
10311    /// - [`CUresult::CUDA_ERROR_NOT_FOUND`]
10312    ///
10313    /// See also: [`cuLibraryLoadData`], [`cuLibraryLoadFromFile`], [`cuLibraryUnload`].
10314    pub fn cuLibraryGetUnifiedFunction(
10315        fptr: *mut *mut ::core::ffi::c_void,
10316        library: CUlibrary,
10317        symbol: *const ::core::ffi::c_char,
10318    ) -> CUresult;
10319}
10320singe_loader::functions! { crate::DRIVER;
10321    /// Returns information about a kernel.
10322    ///
10323    /// Returns in `*pi` the integer value of the attribute `attrib` for the kernel `kernel` for the requested device `dev`. The supported attributes are:
10324    ///
10325    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK`]: The maximum number of threads per block, beyond which a launch of the kernel would fail. This number depends on both the kernel and the requested device.
10326    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES`]: The size in bytes of statically-allocated shared memory per block required by this kernel. This does not include dynamically-allocated shared memory requested by the user at runtime.
10327    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES`]: The size in bytes of user-allocated constant memory required by this kernel.
10328    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES`]: The size in bytes of local memory used by each thread of this kernel.
10329    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_NUM_REGS`]: The number of registers used by each thread of this kernel.
10330    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_PTX_VERSION`]: The PTX virtual architecture version for which the kernel was compiled. This value is the major PTX version \* 10
10331    ///
10332    ///   + the minor PTX version, so a PTX version 1.3 function would return the value 13. Note that this may return the undefined value of 0 for cubins compiled prior to CUDA 3.0.
10333    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_BINARY_VERSION`]: The binary architecture version for which the kernel was compiled. This value is the major binary version \* 10 + the minor binary version, so a binary version 1.3 function would return the value 13. Note that this will return a value of 10 for legacy cubins that do not have a properly-encoded binary architecture version.
10334    /// * `CU_FUNC_CACHE_MODE_CA`: The attribute to indicate whether the kernel has been compiled with user specified option “-Xptxas –dlcm=ca” set.
10335    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES`]: The maximum size in bytes of dynamically-allocated shared memory.
10336    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT`]: Preferred shared memory-L1 cache split ratio in percent of total shared memory.
10337    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_CLUSTER_SIZE_MUST_BE_SET`]: If this attribute is set, the kernel must launch with a valid cluster size specified.
10338    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH`]: The required cluster width in blocks.
10339    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT`]: The required cluster height in blocks.
10340    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH`]: The required cluster depth in blocks.
10341    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED`]: Indicates whether the function can be launched with non-portable cluster size. 1 is allowed, 0 is disallowed. A non-portable cluster size may only function on the specific SKUs the program is tested on. The launch might fail if the program is run on a different hardware platform. CUDA API provides cudaOccupancyMaxActiveClusters to assist with checking whether the desired size can be launched on the current device. A portable cluster size is guaranteed to be functional on all compute capabilities higher than the target compute capability. The portable cluster size for sm_90 is 8 blocks per cluster. This value may increase for future compute capabilities. The specific hardware unit may support higher cluster sizes that’s not guaranteed to be portable.
10342    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE`]: The block scheduling policy of a function. The value type is CUclusterSchedulingPolicy.
10343    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_SHARED_MEMORY_MODE`]: The shared memory mode of a function. The value type is CUsharedMemoryMode / cudaSharedMemoryMode.
10344    ///
10345    /// Note: If another thread is trying to set the same attribute on the same device using [`cuKernelSetAttribute`] simultaneously, the attribute query will give the old or new value depending on the interleavings chosen by the OS scheduler and memory consistency.
10346    ///
10347    /// # Parameters
10348    ///
10349    /// - `pi`: Returned attribute value.
10350    /// - `attrib`: Attribute requested.
10351    /// - `kernel`: Kernel to query attribute of.
10352    /// - `dev`: Device to query attribute of.
10353    ///
10354    /// # Return value
10355    ///
10356    /// - [`CUresult::CUDA_SUCCESS`]
10357    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
10358    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
10359    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
10360    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10361    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
10362    ///
10363    /// See also: [`cuLibraryLoadData`], [`cuLibraryLoadFromFile`], [`cuLibraryUnload`], [`cuKernelSetAttribute`], [`cuLibraryGetKernel`], [`cuLaunchKernel`], [`cuKernelGetFunction`], [`cuLibraryGetModule`], [`cuModuleGetFunction`], [`cuFuncGetAttribute`].
10364    pub fn cuKernelGetAttribute(
10365        pi: *mut ::core::ffi::c_int,
10366        attrib: CUfunction_attribute,
10367        kernel: CUkernel,
10368        dev: CUdevice,
10369    ) -> CUresult;
10370}
10371singe_loader::functions! { crate::DRIVER;
10372    /// Sets information about a kernel.
10373    ///
10374    /// This call sets the value of a specified attribute `attrib` on the kernel `kernel` for the requested device `dev` to an integer value specified by `val`. This function returns [`CUresult::CUDA_SUCCESS`] if the new value of the attribute could be successfully set. If the set fails, this call will return an error. Not all attributes can have values set. Attempting to set a value on a read-only attribute will result in an error ([`CUresult::CUDA_ERROR_INVALID_VALUE`])
10375    ///
10376    /// Note that attributes set using [`cuFuncSetAttribute`] will override the attribute set by this API irrespective of whether the call to [`cuFuncSetAttribute`] is made before or after this API call. However, [`cuKernelGetAttribute`] will always return the attribute value set by this API.
10377    ///
10378    /// Supported attributes are:
10379    ///
10380    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES`]: This is the maximum size in bytes of dynamically-allocated shared memory. The value should contain the requested maximum size of dynamically-allocated shared memory. The sum of this value and the function attribute [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES`] cannot exceed the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN`]. The maximal size of requestable dynamic shared memory may differ by GPU architecture.
10381    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT`]: On devices where the L1 cache and shared memory use the same hardware resources, this sets the shared memory carveout preference, in percent of the total shared memory. See [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR`] This is only a hint, and the driver can choose a different ratio if required to execute the function.
10382    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH`]: The required cluster width in blocks. The width, height, and depth values must either all be 0 or all be positive. The validity of the cluster dimensions is checked at launch time. If the value is set during compile time, it cannot be set at runtime. Setting it at runtime will return [`CUresult::CUDA_ERROR_NOT_PERMITTED`].
10383    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT`]: The required cluster height in blocks. The width, height, and depth values must either all be 0 or all be positive. The validity of the cluster dimensions is checked at launch time. If the value is set during compile time, it cannot be set at runtime. Setting it at runtime will return [`CUresult::CUDA_ERROR_NOT_PERMITTED`].
10384    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH`]: The required cluster depth in blocks. The width, height, and depth values must either all be 0 or all be positive. The validity of the cluster dimensions is checked at launch time. If the value is set during compile time, it cannot be set at runtime. Setting it at runtime will return [`CUresult::CUDA_ERROR_NOT_PERMITTED`].
10385    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED`]: Indicates whether the function can be launched with non-portable cluster size. 1 is allowed, 0 is disallowed.
10386    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE`]: The block scheduling policy of a function. The value type is CUclusterSchedulingPolicy.
10387    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_SHARED_MEMORY_MODE`]: The shared memory mode of a function. The value type is CUsharedMemoryMode / cudaSharedMemoryMode.
10388    ///
10389    /// Note: The API has stricter locking requirements in comparison to its legacy counterpart [`cuFuncSetAttribute`] due to device-wide semantics. If multiple threads are trying to set the same attribute on the same device simultaneously, the attribute setting will depend on the interleavings chosen by the OS scheduler and memory consistency.
10390    ///
10391    /// # Parameters
10392    ///
10393    /// - `attrib`: Attribute requested.
10394    /// - `val`: Value to set.
10395    /// - `kernel`: Kernel to set attribute of.
10396    /// - `dev`: Device to set attribute of.
10397    ///
10398    /// # Return value
10399    ///
10400    /// - [`CUresult::CUDA_SUCCESS`]
10401    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
10402    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
10403    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
10404    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10405    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
10406    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
10407    ///
10408    /// See also: [`cuLibraryLoadData`], [`cuLibraryLoadFromFile`], [`cuLibraryUnload`], [`cuKernelGetAttribute`], [`cuLibraryGetKernel`], [`cuLaunchKernel`], [`cuKernelGetFunction`], [`cuLibraryGetModule`], [`cuModuleGetFunction`], [`cuFuncSetAttribute`].
10409    pub fn cuKernelSetAttribute(
10410        attrib: CUfunction_attribute,
10411        val: ::core::ffi::c_int,
10412        kernel: CUkernel,
10413        dev: CUdevice,
10414    ) -> CUresult;
10415}
10416singe_loader::functions! { crate::DRIVER;
10417    /// Sets the preferred cache configuration for a device kernel.
10418    ///
10419    /// On devices where the L1 cache and shared memory use the same hardware resources, this sets through `config` the preferred cache configuration for the device kernel `kernel` on the requested device `dev`. This is only a preference. The driver will use the requested configuration if possible, but it is free to choose a different configuration if required to execute `kernel`. Any context-wide preference set via [`cuCtxSetCacheConfig`] will be overridden by this per-kernel setting.
10420    ///
10421    /// Note that attributes set using [`cuFuncSetCacheConfig`] will override the attribute set by this API irrespective of whether the call to [`cuFuncSetCacheConfig`] is made before or after this API call.
10422    ///
10423    /// This setting does nothing on devices where the size of the L1 cache and shared memory are fixed.
10424    ///
10425    /// Launching a kernel with a different preference than the most recent preference setting may insert a device-side synchronization point.
10426    ///
10427    /// The supported cache configurations are:
10428    ///
10429    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_NONE`]: no preference for shared memory or L1 (default)
10430    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_SHARED`]: prefer larger shared memory and smaller L1 cache
10431    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_L1`]: prefer larger L1 cache and smaller shared memory
10432    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_EQUAL`]: prefer equal sized L1 cache and shared memory.
10433    ///
10434    /// Note: The API has stricter locking requirements in comparison to its legacy counterpart [`cuFuncSetCacheConfig`] due to device-wide semantics. If multiple threads are trying to set a config on the same device simultaneously, the cache config setting will depend on the interleavings chosen by the OS scheduler and memory consistency.
10435    ///
10436    /// # Parameters
10437    ///
10438    /// - `kernel`: Kernel to configure cache for.
10439    /// - `config`: Requested cache configuration.
10440    /// - `dev`: Device to set attribute of.
10441    ///
10442    /// # Return value
10443    ///
10444    /// - [`CUresult::CUDA_SUCCESS`]
10445    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
10446    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
10447    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
10448    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10449    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
10450    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
10451    ///
10452    /// See also: [`cuLibraryLoadData`], [`cuLibraryLoadFromFile`], [`cuLibraryUnload`], [`cuLibraryGetKernel`], [`cuKernelGetFunction`], [`cuLibraryGetModule`], [`cuModuleGetFunction`], [`cuFuncSetCacheConfig`], [`cuCtxSetCacheConfig`], [`cuLaunchKernel`].
10453    pub fn cuKernelSetCacheConfig(
10454        kernel: CUkernel,
10455        config: CUfunc_cache,
10456        dev: CUdevice,
10457    ) -> CUresult;
10458}
10459singe_loader::functions! { crate::DRIVER;
10460    /// Returns the function name for a [`CUkernel`] handle.
10461    ///
10462    /// Returns in `**name` the function name associated with the kernel handle `hfunc`. The function name is returned as a null-terminated string. The returned name is only valid when the kernel handle is valid. If the library is unloaded or reloaded, one must call the API again to get the updated name. This API may return a mangled name if the function is not declared as having C linkage. If either `**name` or `hfunc` is NULL, [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned.
10463    ///
10464    /// Note that this function may also return error codes from previous, asynchronous launches.
10465    ///
10466    /// # Parameters
10467    ///
10468    /// - `name`: The returned name of the function.
10469    /// - `hfunc`: The function handle to retrieve the name for.
10470    ///
10471    /// # Return value
10472    ///
10473    /// - [`CUresult::CUDA_SUCCESS`]
10474    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10475    pub fn cuKernelGetName(
10476        name: *mut *const ::core::ffi::c_char,
10477        hfunc: CUkernel,
10478    ) -> CUresult;
10479}
10480singe_loader::functions! { crate::DRIVER;
10481    /// Returns the offset and size of a kernel parameter in the device-side parameter layout.
10482    ///
10483    /// Queries the kernel parameter at `paramIndex` into `kernel's` list of parameters, and returns in `paramOffset` and `paramSize` the offset and size, respectively, where the parameter will reside in the device-side parameter layout. This information can be used to update kernel node parameters from the device via `cudaGraphKernelNodeSetParam()` and `cudaGraphKernelNodeUpdatesApply()`. `paramIndex` must be less than the number of parameters that `kernel` takes. `paramSize` can be set to NULL if only the parameter offset is desired.
10484    ///
10485    /// Note that this function may also return error codes from previous, asynchronous launches.
10486    ///
10487    /// # Parameters
10488    ///
10489    /// - `kernel`: The kernel to query.
10490    /// - `paramIndex`: The parameter index to query.
10491    /// - `paramOffset`: Returns the offset into the device-side parameter layout at which the parameter resides.
10492    /// - `paramSize`: Optionally returns the size of the parameter in the device-side parameter layout.
10493    ///
10494    /// # Return value
10495    ///
10496    /// - [`CUresult::CUDA_SUCCESS`]
10497    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10498    ///
10499    /// See also: [`cuFuncGetParamInfo`].
10500    pub fn cuKernelGetParamInfo(
10501        kernel: CUkernel,
10502        paramIndex: size_t,
10503        paramOffset: *mut size_t,
10504        paramSize: *mut size_t,
10505    ) -> CUresult;
10506}
10507singe_loader::functions! { crate::DRIVER;
10508    /// Returns the number of parameters used by the kernel.
10509    ///
10510    /// Queries the number of kernel parameters used by `kernel` and returns it in `paramCount`.
10511    ///
10512    /// Note that this function may also return error codes from previous, asynchronous launches.
10513    ///
10514    /// # Parameters
10515    ///
10516    /// - `kernel`: The kernel to query.
10517    /// - `paramCount`: Returns the number of parameters used by the function.
10518    ///
10519    /// # Return value
10520    ///
10521    /// - [`CUresult::CUDA_SUCCESS`]
10522    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10523    ///
10524    /// See also: [`cuKernelGetParamInfo`].
10525    pub fn cuKernelGetParamCount(kernel: CUkernel, paramCount: *mut size_t) -> CUresult;
10526}
10527singe_loader::functions! { crate::DRIVER;
10528    /// Gets free and total memory.
10529    ///
10530    /// Returns in `*total` the total amount of memory available to the current context. Returns in `*free` the amount of memory on the device that is free according to the OS. CUDA is not guaranteed to be able to allocate all of the memory that the OS reports as free. In a multi-tenet situation, free estimate returned is prone to race condition where a new allocation/free done by a different process or a different thread in the same process between the time when free memory was estimated and reported, will result in deviation in free value reported and actual free memory.
10531    ///
10532    /// The integrated GPU on Tegra shares memory with CPU and other component of the SoC. The free and total values returned by the API excludes the SWAP memory space maintained by the OS on some platforms. The OS may move some of the memory pages into swap area as the GPU or CPU allocate or access memory. See Tegra app note on how to calculate total and free memory on Tegra.
10533    ///
10534    /// Note that this function may also return error codes from previous, asynchronous launches.
10535    ///
10536    /// # Parameters
10537    ///
10538    /// - `free`: Returned free memory in bytes.
10539    /// - `total`: Returned total memory in bytes.
10540    ///
10541    /// # Return value
10542    ///
10543    /// - [`CUresult::CUDA_SUCCESS`]
10544    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
10545    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
10546    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
10547    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10548    ///
10549    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D16`], [`cuMemsetD2D32`], [`cuMemsetD8`], [`cuMemsetD16`], [`cuMemsetD32`], `cudaMemGetInfo`.
10550    pub fn cuMemGetInfo_v2(free: *mut size_t, total: *mut size_t) -> CUresult;
10551}
10552singe_loader::functions! { crate::DRIVER;
10553    /// Allocates device memory.
10554    ///
10555    /// Allocates `bytesize` bytes of linear memory on the device and returns in `*dptr` a pointer to the allocated memory. The allocated memory is suitably aligned for any kind of variable. The memory is not cleared. If `bytesize` is 0, cuMemAlloc() returns [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`].
10556    ///
10557    /// Note that this function may also return error codes from previous, asynchronous launches.
10558    ///
10559    /// # Parameters
10560    ///
10561    /// - `dptr`: Returned device pointer.
10562    /// - `bytesize`: Requested allocation size in bytes.
10563    ///
10564    /// # Return value
10565    ///
10566    /// - [`CUresult::CUDA_SUCCESS`]
10567    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
10568    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
10569    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
10570    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10571    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
10572    /// - [`CUresult::CUDA_ERROR_EXTERNAL_DEVICE`]
10573    ///
10574    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D16`], [`cuMemsetD2D32`], [`cuMemsetD8`], [`cuMemsetD16`], [`cuMemsetD32`], `cudaMalloc`.
10575    pub fn cuMemAlloc_v2(dptr: *mut CUdeviceptr, bytesize: size_t) -> CUresult;
10576}
10577singe_loader::functions! { crate::DRIVER;
10578    /// Allocates pitched device memory.
10579    ///
10580    /// Allocates at least `WidthInBytes` \* `Height` bytes of linear memory on the device and returns in `*dptr` a pointer to the allocated memory. The function may pad the allocation to ensure that corresponding pointers in any given row will continue to meet the alignment requirements for coalescing as the address is updated from row to row. `ElementSizeBytes` specifies the size of the largest reads and writes that will be performed on the memory range. `ElementSizeBytes` may be 4, 8 or 16 (since coalesced memory transactions are not possible on other data sizes). If `ElementSizeBytes` is smaller than the actual read/write size of a kernel, the kernel will run correctly, but possibly at reduced speed. The pitch returned in `*pPitch` by cuMemAllocPitch() is the width in bytes of the allocation. The intended usage of pitch is as a separate parameter of the allocation, used to compute addresses within the 2D array. Given the row and column of an array element of type **T**, the address is computed as:
10581    ///
10582    /// ```text
10583    /// T* pElement = (T*)((char*)BaseAddress + Row * Pitch) + Column;
10584    /// ```
10585    ///
10586    /// The pitch returned by cuMemAllocPitch() is guaranteed to work with cuMemcpy2D() under all circumstances. For allocations of 2D arrays, it is recommended that programmers consider performing pitch allocations using cuMemAllocPitch(). Due to alignment restrictions in the hardware, this is especially true if the application will be performing 2D memory copies between different regions of device memory (whether linear memory or CUDA arrays).
10587    ///
10588    /// The byte alignment of the pitch returned by cuMemAllocPitch() is guaranteed to match or exceed the alignment requirement for texture binding with cuTexRefSetAddress2D().
10589    ///
10590    /// Note that this function may also return error codes from previous, asynchronous launches.
10591    ///
10592    /// # Parameters
10593    ///
10594    /// - `dptr`: Returned device pointer.
10595    /// - `pPitch`: Returned pitch of allocation in bytes.
10596    /// - `WidthInBytes`: Requested allocation width in bytes.
10597    /// - `Height`: Requested allocation height in rows.
10598    /// - `ElementSizeBytes`: Size of largest reads/writes for range.
10599    ///
10600    /// # Return value
10601    ///
10602    /// - [`CUresult::CUDA_SUCCESS`]
10603    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
10604    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
10605    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
10606    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10607    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
10608    ///
10609    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D16`], [`cuMemsetD2D32`], [`cuMemsetD8`], [`cuMemsetD16`], [`cuMemsetD32`], `cudaMallocPitch`.
10610    pub fn cuMemAllocPitch_v2(
10611        dptr: *mut CUdeviceptr,
10612        pPitch: *mut size_t,
10613        WidthInBytes: size_t,
10614        Height: size_t,
10615        ElementSizeBytes: ::core::ffi::c_uint,
10616    ) -> CUresult;
10617}
10618singe_loader::functions! { crate::DRIVER;
10619    /// Frees device memory.
10620    ///
10621    /// Frees the memory space pointed to by `dptr`, which must have been returned by a previous call to one of the following memory allocation APIs - cuMemAlloc(), cuMemAllocPitch(), [`cuMemAllocManaged`], [`cuMemAllocAsync`], [`cuMemAllocFromPoolAsync`]
10622    ///
10623    /// Note - This API will not perform any implict synchronization when the pointer was allocated with [`cuMemAllocAsync`] or [`cuMemAllocFromPoolAsync`]. Callers must ensure that all accesses to these pointer have completed before invoking cuMemFree. For best performance and memory reuse, users should use [`cuMemFreeAsync`] to free memory allocated via the stream ordered memory allocator. For all other pointers, this API may perform implicit synchronization.
10624    ///
10625    /// Note that this function may also return error codes from previous, asynchronous launches.
10626    ///
10627    /// # Return value
10628    ///
10629    /// - [`CUresult::CUDA_SUCCESS`]
10630    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
10631    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
10632    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
10633    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10634    ///
10635    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemAllocManaged`], [`cuMemAllocAsync`], [`cuMemAllocFromPoolAsync`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemFreeAsync`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D16`], [`cuMemsetD2D32`], [`cuMemsetD8`], [`cuMemsetD16`], [`cuMemsetD32`], `cudaFree`.
10636    pub fn cuMemFree_v2(dptr: CUdeviceptr) -> CUresult;
10637}
10638singe_loader::functions! { crate::DRIVER;
10639    /// Get information on memory allocations.
10640    ///
10641    /// Returns the base address in `*pbase` and size in `*psize` of the allocation that contains the input pointer `dptr`. Both parameters `pbase` and `psize` are optional. If one of them is NULL, it is ignored.
10642    ///
10643    /// Note that this function may also return error codes from previous, asynchronous launches.
10644    ///
10645    /// # Parameters
10646    ///
10647    /// - `pbase`: Returned base address.
10648    /// - `psize`: Returned size of device memory allocation.
10649    /// - `dptr`: Device pointer to query.
10650    ///
10651    /// # Return value
10652    ///
10653    /// - [`CUresult::CUDA_SUCCESS`]
10654    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
10655    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
10656    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
10657    /// - [`CUresult::CUDA_ERROR_NOT_FOUND`]
10658    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10659    ///
10660    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D16`], [`cuMemsetD2D32`], [`cuMemsetD8`], [`cuMemsetD16`], [`cuMemsetD32`].
10661    pub fn cuMemGetAddressRange_v2(
10662        pbase: *mut CUdeviceptr,
10663        psize: *mut size_t,
10664        dptr: CUdeviceptr,
10665    ) -> CUresult;
10666}
10667singe_loader::functions! { crate::DRIVER;
10668    /// Allocates page-locked host memory.
10669    ///
10670    /// Allocates `bytesize` bytes of host memory that is page-locked and accessible to the device. The driver tracks the virtual memory ranges allocated with this function and automatically accelerates calls to functions such as [`cuMemcpy`]. Since the memory can be accessed directly by the device, it can be read or written with much higher bandwidth than pageable memory obtained with functions such as `malloc()`.
10671    ///
10672    /// On systems where [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES`] is true, cuMemAllocHost may not page-lock the allocated memory.
10673    ///
10674    /// Page-locking excessive amounts of memory with cuMemAllocHost() may degrade system performance, since it reduces the amount of memory available to the system for paging. As a result, this function is best used sparingly to allocate staging areas for data exchange between host and device.
10675    ///
10676    /// Note all host memory allocated using cuMemAllocHost() will automatically be immediately accessible to all contexts on all devices which support unified addressing (as may be queried using [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING`]). The device pointer that may be used to access this host memory from those contexts is always equal to the returned host pointer `*pp`. See [Unified Addressing](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__UNIFIED.html#group__cuda__unified) for additional details.
10677    ///
10678    /// Note that this function may also return error codes from previous, asynchronous launches.
10679    ///
10680    /// # Parameters
10681    ///
10682    /// - `pp`: Returned pointer to host memory.
10683    /// - `bytesize`: Requested allocation size in bytes.
10684    ///
10685    /// # Return value
10686    ///
10687    /// - [`CUresult::CUDA_SUCCESS`]
10688    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
10689    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
10690    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
10691    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10692    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
10693    /// - [`CUresult::CUDA_ERROR_EXTERNAL_DEVICE`]
10694    ///
10695    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D16`], [`cuMemsetD2D32`], [`cuMemsetD8`], [`cuMemsetD16`], [`cuMemsetD32`], `cudaMallocHost`.
10696    pub fn cuMemAllocHost_v2(
10697        pp: *mut *mut ::core::ffi::c_void,
10698        bytesize: size_t,
10699    ) -> CUresult;
10700}
10701singe_loader::functions! { crate::DRIVER;
10702    /// Frees page-locked host memory.
10703    ///
10704    /// Frees the memory space pointed to by `p`, which must have been returned by a previous call to cuMemAllocHost().
10705    ///
10706    /// Note that this function may also return error codes from previous, asynchronous launches.
10707    ///
10708    /// # Parameters
10709    ///
10710    /// - `p`: Pointer to memory to free
10711    ///
10712    /// # Return value
10713    ///
10714    /// - [`CUresult::CUDA_SUCCESS`]
10715    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
10716    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
10717    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
10718    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10719    ///
10720    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D16`], [`cuMemsetD2D32`], [`cuMemsetD8`], [`cuMemsetD16`], [`cuMemsetD32`], `cudaFreeHost`.
10721    pub fn cuMemFreeHost(p: *mut ::core::ffi::c_void) -> CUresult;
10722}
10723singe_loader::functions! { crate::DRIVER;
10724    /// Allocates page-locked host memory.
10725    ///
10726    /// Allocates `bytesize` bytes of host memory that is page-locked and accessible to the device. The driver tracks the virtual memory ranges allocated with this function and automatically accelerates calls to functions such as cuMemcpyHtoD(). Since the memory can be accessed directly by the device, it can be read or written with much higher bandwidth than pageable memory obtained with functions such as `malloc()`.
10727    ///
10728    /// On systems where [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES`] is true, [`cuMemHostAlloc`] may not page-lock the allocated memory.
10729    ///
10730    /// Page-locking excessive amounts of memory may degrade system performance, since it reduces the amount of memory available to the system for paging. As a result, this function is best used sparingly to allocate staging areas for data exchange between host and device.
10731    ///
10732    /// The `Flags` parameter enables different options to be specified that affect the allocation, as follows.
10733    ///
10734    /// * [`CU_MEMHOSTALLOC_PORTABLE`]: The memory returned by this call will be considered as pinned memory by all CUDA contexts, not just the one that performed the allocation.
10735    /// * [`CU_MEMHOSTALLOC_DEVICEMAP`]: Maps the allocation into the CUDA address space. The device pointer to the memory may be obtained by calling cuMemHostGetDevicePointer().
10736    /// * [`CU_MEMHOSTALLOC_WRITECOMBINED`]: Allocates the memory as write-combined (WC). WC memory can be transferred across the PCI Express bus more quickly on some system configurations, but cannot be read efficiently by most CPUs. WC memory is a good option for buffers that will be written by the CPU and read by the GPU via mapped pinned memory or host->device transfers.
10737    ///
10738    /// All of these flags are orthogonal to one another: a developer may allocate memory that is portable, mapped and/or write-combined with no restrictions.
10739    ///
10740    /// The [`CU_MEMHOSTALLOC_DEVICEMAP`] flag may be specified on CUDA contexts for devices that do not support mapped pinned memory. The failure is deferred to cuMemHostGetDevicePointer() because the memory may be mapped into other CUDA contexts via the [`CU_MEMHOSTALLOC_PORTABLE`] flag.
10741    ///
10742    /// The memory allocated by this function must be freed with [`cuMemFreeHost`].
10743    ///
10744    /// Note all host memory allocated using [`cuMemHostAlloc`] will automatically be immediately accessible to all contexts on all devices which support unified addressing (as may be queried using [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING`]). Unless the flag [`CU_MEMHOSTALLOC_WRITECOMBINED`] is specified, the device pointer that may be used to access this host memory from those contexts is always equal to the returned host pointer `*pp`. If the flag [`CU_MEMHOSTALLOC_WRITECOMBINED`] is specified, then the function cuMemHostGetDevicePointer() must be used to query the device pointer, even if the context supports unified addressing. See [Unified Addressing](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__UNIFIED.html#group__cuda__unified) for additional details.
10745    ///
10746    /// Note that this function may also return error codes from previous, asynchronous launches.
10747    ///
10748    /// # Parameters
10749    ///
10750    /// - `pp`: Returned pointer to host memory.
10751    /// - `bytesize`: Requested allocation size in bytes.
10752    /// - `Flags`: Flags for allocation request.
10753    ///
10754    /// # Return value
10755    ///
10756    /// - [`CUresult::CUDA_SUCCESS`]
10757    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
10758    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
10759    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
10760    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10761    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
10762    /// - [`CUresult::CUDA_ERROR_EXTERNAL_DEVICE`]
10763    ///
10764    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D16`], [`cuMemsetD2D32`], [`cuMemsetD8`], [`cuMemsetD16`], [`cuMemsetD32`], `cudaHostAlloc`.
10765    pub fn cuMemHostAlloc(
10766        pp: *mut *mut ::core::ffi::c_void,
10767        bytesize: size_t,
10768        Flags: ::core::ffi::c_uint,
10769    ) -> CUresult;
10770}
10771singe_loader::functions! { crate::DRIVER;
10772    /// Passes back device pointer of mapped pinned memory.
10773    ///
10774    /// Passes back the device pointer `pdptr` corresponding to the mapped, pinned host buffer `p` allocated by [`cuMemHostAlloc`].
10775    ///
10776    /// cuMemHostGetDevicePointer() will fail if the [`CU_MEMHOSTALLOC_DEVICEMAP`] flag was not specified at the time the memory was allocated, or if the function is called on a GPU that does not support mapped pinned memory.
10777    ///
10778    /// For devices that have a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM`], the memory can also be accessed from the device using the host pointer `p`. The device pointer returned by cuMemHostGetDevicePointer() may or may not match the original host pointer `p` and depends on the devices visible to the application. If all devices visible to the application have a non-zero value for the device attribute, the device pointer returned by cuMemHostGetDevicePointer() will match the original pointer `p`. If any device visible to the application has a zero value for the device attribute, the device pointer returned by cuMemHostGetDevicePointer() will not match the original host pointer `p`, but it will be suitable for use on all devices provided Unified Virtual Addressing is enabled. In such systems, it is valid to access the memory using either pointer on devices that have a non-zero value for the device attribute. Note however that such devices should access the memory using only one of the two pointers and not both.
10779    ///
10780    /// `Flags` provides for future releases. For now, it must be set to 0.
10781    ///
10782    /// Note that this function may also return error codes from previous, asynchronous launches.
10783    ///
10784    /// # Parameters
10785    ///
10786    /// - `pdptr`: Returned device pointer.
10787    /// - `p`: Host pointer.
10788    /// - `Flags`: Options (must be 0).
10789    ///
10790    /// # Return value
10791    ///
10792    /// - [`CUresult::CUDA_SUCCESS`]
10793    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
10794    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
10795    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
10796    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10797    ///
10798    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemsetD2D8`], [`cuMemsetD2D16`], [`cuMemsetD2D32`], [`cuMemsetD8`], [`cuMemsetD16`], [`cuMemsetD32`], `cudaHostGetDevicePointer`.
10799    pub fn cuMemHostGetDevicePointer_v2(
10800        pdptr: *mut CUdeviceptr,
10801        p: *mut ::core::ffi::c_void,
10802        Flags: ::core::ffi::c_uint,
10803    ) -> CUresult;
10804}
10805singe_loader::functions! { crate::DRIVER;
10806    /// Passes back flags that were used for a pinned allocation.
10807    ///
10808    /// Passes back the flags `pFlags` that were specified when allocating the pinned host buffer `p` allocated by [`cuMemHostAlloc`].
10809    ///
10810    /// [`cuMemHostGetFlags`] will fail if the pointer does not reside in an allocation performed by cuMemAllocHost() or [`cuMemHostAlloc`].
10811    ///
10812    /// Note that this function may also return error codes from previous, asynchronous launches.
10813    ///
10814    /// # Parameters
10815    ///
10816    /// - `pFlags`: Returned flags word.
10817    /// - `p`: Host pointer.
10818    ///
10819    /// # Return value
10820    ///
10821    /// - [`CUresult::CUDA_SUCCESS`]
10822    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
10823    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
10824    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
10825    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10826    ///
10827    /// See also: [`cuMemAllocHost`], [`cuMemHostAlloc`], `cudaHostGetFlags`.
10828    pub fn cuMemHostGetFlags(
10829        pFlags: *mut ::core::ffi::c_uint,
10830        p: *mut ::core::ffi::c_void,
10831    ) -> CUresult;
10832}
10833singe_loader::functions! { crate::DRIVER;
10834    /// Allocates memory that will be automatically managed by the Unified Memory system.
10835    ///
10836    /// Allocates `bytesize` bytes of managed memory on the device and returns in `*dptr` a pointer to the allocated memory. If the device doesn’t support allocating managed memory, [`cudaError_enum::CUDA_ERROR_NOT_SUPPORTED`] is returned. Support for managed memory can be queried using the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY`]. The allocated memory is suitably aligned for any kind of variable. The memory is not cleared. If `bytesize` is 0, [`cuMemAllocManaged`] returns [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`]. The pointer is valid on the CPU and on all GPUs in the system that support managed memory. All accesses to this pointer must obey the Unified Memory programming model.
10837    ///
10838    /// `flags` specifies the default stream association for this allocation. `flags` must be one of [`CUmemAttach_flags_enum::CU_MEM_ATTACH_GLOBAL`] or [`CUmemAttach_flags_enum::CU_MEM_ATTACH_HOST`]. If [`CUmemAttach_flags_enum::CU_MEM_ATTACH_GLOBAL`] is specified, then this memory is accessible from any stream on any device. If [`CUmemAttach_flags_enum::CU_MEM_ATTACH_HOST`] is specified, then the allocation should not be accessed from devices that have a zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`]; an explicit call to [`cuStreamAttachMemAsync`] will be required to enable access on such devices.
10839    ///
10840    /// If the association is later changed via [`cuStreamAttachMemAsync`] to a single stream, the default association as specified during [`cuMemAllocManaged`] is restored when that stream is destroyed. For **managed** variables, the default association is always [`CUmemAttach_flags_enum::CU_MEM_ATTACH_GLOBAL`]. Note that destroying a stream is an asynchronous operation, and as a result, the change to default association won’t happen until all work in the stream has completed.
10841    ///
10842    /// Memory allocated with [`cuMemAllocManaged`] should be released with cuMemFree.
10843    ///
10844    /// Device memory oversubscription is possible for GPUs that have a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`]. Managed memory on such GPUs may be evicted from device memory to host memory at any time by the Unified Memory driver in order to make room for other allocations.
10845    ///
10846    /// In a system where all GPUs have a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`], managed memory may not be populated when this API returns and instead may be populated on access. In such systems, managed memory can migrate to any processor’s memory at any time. The Unified Memory driver will employ heuristics to maintain data locality and prevent excessive page faults to the extent possible. The application can also guide the driver about memory usage patterns via cuMemAdvise. The application can also explicitly migrate memory to a desired processor’s memory via cuMemPrefetchAsync.
10847    ///
10848    /// In a multi-GPU system where all of the GPUs have a zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`] and all the GPUs have peer-to-peer support with each other, the physical storage for managed memory is created on the GPU which is active at the time [`cuMemAllocManaged`] is called. All other GPUs will reference the data at reduced bandwidth via peer mappings over the PCIe bus. The Unified Memory driver does not migrate memory among such GPUs.
10849    ///
10850    /// In a multi-GPU system where not all GPUs have peer-to-peer support with each other and where the value of the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`] is zero for at least one of those GPUs, the location chosen for physical storage of managed memory is system-dependent.
10851    ///
10852    /// * On Linux, the location chosen will be device memory as long as the current set of active contexts are on devices that either have peer-to-peer support with each other or have a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`]. If there is an active context on a GPU that does not have a non-zero value for that device attribute and it does not have peer-to-peer support with the other devices that have active contexts on them, then the location for physical storage will be ‘zero-copy’ or host memory. Note that this means that managed memory that is located in device memory is migrated to host memory if a new context is created on a GPU that doesn’t have a non-zero value for the device attribute and does not support peer-to-peer with at least one of the other devices that has an active context. This in turn implies that context creation may fail if there is insufficient host memory to migrate all managed allocations.
10853    /// * On Windows, the physical storage is always created in ‘zero-copy’ or host memory. All GPUs will reference the data at reduced bandwidth over the PCIe bus. In these circumstances, use of the environment variable CUDA_VISIBLE_DEVICES is recommended to restrict CUDA to only use those GPUs that have peer-to-peer support. Alternatively, users can also set CUDA_MANAGED_FORCE_DEVICE_ALLOC to a non-zero value to force the driver to always use device memory for physical storage. When this environment variable is set to a non-zero value, all contexts created in that process on devices that support managed memory have to be peer-to-peer compatible with each other. Context creation will fail if a context is created on a device that supports managed memory and is not peer-to-peer compatible with any of the other managed memory supporting devices on which contexts were previously created, even if those contexts have been destroyed. These environment variables are described in the CUDA programming guide under the “CUDA environment variables” section.
10854    /// * On ARM, managed memory is not available on discrete gpu with Drive PX-2.
10855    ///
10856    /// Note that this function may also return error codes from previous, asynchronous launches.
10857    ///
10858    /// # Parameters
10859    ///
10860    /// - `dptr`: Returned device pointer.
10861    /// - `bytesize`: Requested allocation size in bytes.
10862    /// - `flags`: Must be one of [`CUmemAttach_flags_enum::CU_MEM_ATTACH_GLOBAL`] or [`CUmemAttach_flags_enum::CU_MEM_ATTACH_HOST`].
10863    ///
10864    /// # Return value
10865    ///
10866    /// - [`CUresult::CUDA_SUCCESS`]
10867    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
10868    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
10869    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
10870    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
10871    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10872    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
10873    ///
10874    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D16`], [`cuMemsetD2D32`], [`cuMemsetD8`], [`cuMemsetD16`], [`cuMemsetD32`], [`cuDeviceGetAttribute`], [`cuStreamAttachMemAsync`], `cudaMallocManaged`.
10875    pub fn cuMemAllocManaged(
10876        dptr: *mut CUdeviceptr,
10877        bytesize: size_t,
10878        flags: ::core::ffi::c_uint,
10879    ) -> CUresult;
10880}
10881singe_loader::functions! { crate::DRIVER;
10882    /// Registers a callback function to receive async notifications.
10883    ///
10884    /// Registers `callbackFunc` to receive async notifications.
10885    ///
10886    /// The `userData`
10887    ///
10888    /// parameter is passed to the callback function at async notification time.
10889    ///
10890    /// Likewise,
10891    ///
10892    /// `callback` is also passed to the callback function to distinguish between multiple registered callbacks.
10893    ///
10894    /// The callback function being registered should be designed to return quickly (~10ms).
10895    ///
10896    /// Any long running tasks should be queued for execution on an application thread.
10897    ///
10898    /// Callbacks may not call cuDeviceRegisterAsyncNotification or cuDeviceUnregisterAsyncNotification. Doing so will result in [`cudaError_enum::CUDA_ERROR_NOT_PERMITTED`]. Async notification callbacks execute in an undefined order and may be serialized.
10899    ///
10900    /// Returns in `*callback` a handle representing the registered callback instance.
10901    ///
10902    /// Note that this function may also return error codes from previous, asynchronous launches.
10903    ///
10904    /// # Parameters
10905    ///
10906    /// - `device`: The device on which to register the callback.
10907    /// - `callbackFunc`: The function to register as a callback.
10908    /// - `userData`: A generic pointer to user data. This is passed into the callback function.
10909    /// - `callback`: A handle representing the registered callback instance.
10910    ///
10911    /// # Return value
10912    ///
10913    /// - [`CUresult::CUDA_SUCCESS`]
10914    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
10915    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
10916    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10917    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
10918    /// - [`CUresult::CUDA_ERROR_UNKNOWN`]
10919    ///
10920    /// See also: [`cuDeviceUnregisterAsyncNotification`].
10921    pub fn cuDeviceRegisterAsyncNotification(
10922        device: CUdevice,
10923        callbackFunc: CUasyncCallback,
10924        userData: *mut ::core::ffi::c_void,
10925        callback: *mut CUasyncCallbackHandle,
10926    ) -> CUresult;
10927}
10928singe_loader::functions! { crate::DRIVER;
10929    /// Unregisters an async notification callback.
10930    ///
10931    /// Unregisters `callback` so that the corresponding callback function will stop receiving async notifications.
10932    ///
10933    /// Note that this function may also return error codes from previous, asynchronous launches.
10934    ///
10935    /// # Parameters
10936    ///
10937    /// - `device`: The device from which to remove `callback`.
10938    /// - `callback`: The callback instance to unregister from receiving async notifications.
10939    ///
10940    /// # Return value
10941    ///
10942    /// - [`CUresult::CUDA_SUCCESS`]
10943    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
10944    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
10945    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10946    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
10947    /// - [`CUresult::CUDA_ERROR_UNKNOWN`]
10948    ///
10949    /// See also: [`cuDeviceRegisterAsyncNotification`].
10950    pub fn cuDeviceUnregisterAsyncNotification(
10951        device: CUdevice,
10952        callback: CUasyncCallbackHandle,
10953    ) -> CUresult;
10954}
10955singe_loader::functions! { crate::DRIVER;
10956    /// Returns a handle to a compute device.
10957    ///
10958    /// Returns in `*device` a device handle given a PCI bus ID string.
10959    ///
10960    /// where `domain`, `bus`, `device`, and `function` are all hexadecimal values.
10961    ///
10962    /// Note that this function may also return error codes from previous, asynchronous launches.
10963    ///
10964    /// # Parameters
10965    ///
10966    /// - `dev`: Returned device handle.
10967    /// - `pciBusId`: String in one of the following forms.
10968    ///
10969    /// # Return value
10970    ///
10971    /// - [`CUresult::CUDA_SUCCESS`]
10972    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
10973    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
10974    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
10975    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
10976    ///
10977    /// See also: [`cuDeviceGet`], [`cuDeviceGetAttribute`], [`cuDeviceGetPCIBusId`], `cudaDeviceGetByPCIBusId`.
10978    pub fn cuDeviceGetByPCIBusId(
10979        dev: *mut CUdevice,
10980        pciBusId: *const ::core::ffi::c_char,
10981    ) -> CUresult;
10982}
10983singe_loader::functions! { crate::DRIVER;
10984    /// Returns a PCI Bus Id string for the device.
10985    ///
10986    /// Returns an ASCII string identifying the device `dev` in the NULL-terminated string pointed to by `pciBusId`. `len` specifies the maximum length of the string that may be returned.
10987    ///
10988    /// where `domain`, `bus`, `device`, and `function` are all hexadecimal values. pciBusId should be large enough to store 13 characters including the NULL-terminator.
10989    ///
10990    /// Note that this function may also return error codes from previous, asynchronous launches.
10991    ///
10992    /// # Parameters
10993    ///
10994    /// - `pciBusId`: Returned identifier string for the device in the following format.
10995    /// - `len`: Maximum length of string to store in `name`.
10996    /// - `dev`: Device to get identifier string for.
10997    ///
10998    /// # Return value
10999    ///
11000    /// - [`CUresult::CUDA_SUCCESS`]
11001    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
11002    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
11003    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
11004    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
11005    ///
11006    /// See also: [`cuDeviceGet`], [`cuDeviceGetAttribute`], [`cuDeviceGetByPCIBusId`], `cudaDeviceGetPCIBusId`.
11007    pub fn cuDeviceGetPCIBusId(
11008        pciBusId: *mut ::core::ffi::c_char,
11009        len: ::core::ffi::c_int,
11010        dev: CUdevice,
11011    ) -> CUresult;
11012}
11013singe_loader::functions! { crate::DRIVER;
11014    /// Gets an interprocess handle for a previously allocated event.
11015    ///
11016    /// Takes as input a previously allocated event. This event must have been created with the [`CUevent_flags_enum::CU_EVENT_INTERPROCESS`] and [`CUevent_flags_enum::CU_EVENT_DISABLE_TIMING`] flags set. This opaque handle may be copied into other processes and opened with [`cuIpcOpenEventHandle`] to allow efficient hardware synchronization between GPU work in different processes.
11017    ///
11018    /// After the event has been opened in the importing process, [`cuEventRecord`], [`cuEventSynchronize`], [`cuStreamWaitEvent`] and [`cuEventQuery`] may be used in either process. Performing operations on the imported event after the exported event has been freed with cuEventDestroy will result in undefined behavior.
11019    ///
11020    /// IPC functionality is restricted to devices with support for unified addressing on Linux and Windows operating systems. IPC functionality on Windows is supported for compatibility purposes but not recommended as it comes with performance cost. Users can test their device for IPC functionality by calling [`cuDeviceGetAttribute`] with [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED`].
11021    ///
11022    /// # Parameters
11023    ///
11024    /// - `pHandle`: Pointer to a user allocated CUipcEventHandle in which to return the opaque event handle.
11025    /// - `event`: Event allocated with [`CUevent_flags_enum::CU_EVENT_INTERPROCESS`] and [`CUevent_flags_enum::CU_EVENT_DISABLE_TIMING`] flags.
11026    ///
11027    /// # Return value
11028    ///
11029    /// - [`CUresult::CUDA_SUCCESS`]
11030    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
11031    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
11032    /// - [`CUresult::CUDA_ERROR_MAP_FAILED`]
11033    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
11034    ///
11035    /// See also: [`cuEventCreate`], [`cuEventDestroy`], [`cuEventSynchronize`], [`cuEventQuery`], [`cuStreamWaitEvent`], [`cuIpcOpenEventHandle`], [`cuIpcGetMemHandle`], [`cuIpcOpenMemHandle`], [`cuIpcCloseMemHandle`], `cudaIpcGetEventHandle`.
11036    pub fn cuIpcGetEventHandle(
11037        pHandle: *mut CUipcEventHandle,
11038        event: CUevent,
11039    ) -> CUresult;
11040}
11041singe_loader::functions! { crate::DRIVER;
11042    /// Opens an interprocess event handle for use in the current process.
11043    ///
11044    /// Opens an interprocess event handle exported from another process with [`cuIpcGetEventHandle`]. This function returns a [`CUevent`] that behaves like a locally created event with the [`CUevent_flags_enum::CU_EVENT_DISABLE_TIMING`] flag specified. This event must be freed with cuEventDestroy.
11045    ///
11046    /// Performing operations on the imported event after the exported event has been freed with cuEventDestroy will result in undefined behavior.
11047    ///
11048    /// IPC functionality is restricted to devices with support for unified addressing on Linux and Windows operating systems. IPC functionality on Windows is supported for compatibility purposes but not recommended as it comes with performance cost. Users can test their device for IPC functionality by calling `cuapiDeviceGetAttribute` with [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED`].
11049    ///
11050    /// # Parameters
11051    ///
11052    /// - `phEvent`: Returns the imported event.
11053    /// - `handle`: Interprocess handle to open.
11054    ///
11055    /// # Return value
11056    ///
11057    /// - [`CUresult::CUDA_SUCCESS`]
11058    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
11059    /// - [`CUresult::CUDA_ERROR_MAP_FAILED`]
11060    /// - [`CUresult::CUDA_ERROR_PEER_ACCESS_UNSUPPORTED`]
11061    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
11062    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
11063    ///
11064    /// See also: [`cuEventCreate`], [`cuEventDestroy`], [`cuEventSynchronize`], [`cuEventQuery`], [`cuStreamWaitEvent`], [`cuIpcGetEventHandle`], [`cuIpcGetMemHandle`], [`cuIpcOpenMemHandle`], [`cuIpcCloseMemHandle`], `cudaIpcOpenEventHandle`.
11065    pub fn cuIpcOpenEventHandle(
11066        phEvent: *mut CUevent,
11067        handle: CUipcEventHandle,
11068    ) -> CUresult;
11069}
11070singe_loader::functions! { crate::DRIVER;
11071    /// Gets an interprocess memory handle for an existing device memory allocation.
11072    ///
11073    /// Takes a pointer to the base of an existing device memory allocation created with cuMemAlloc and exports it for use in another process. This is a lightweight operation and may be called multiple times on an allocation without adverse effects.
11074    ///
11075    /// If a region of memory is freed with cuMemFree and a subsequent call to cuMemAlloc returns memory with the same device address, [`cuIpcGetMemHandle`] will return a unique handle for the new memory.
11076    ///
11077    /// IPC functionality is restricted to devices with support for unified addressing on Linux and Windows operating systems. IPC functionality on Windows is supported for compatibility purposes but not recommended as it comes with performance cost. Users can test their device for IPC functionality by calling `cuapiDeviceGetAttribute` with [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED`].
11078    ///
11079    /// # Parameters
11080    ///
11081    /// - `pHandle`: Pointer to user allocated CUipcMemHandle to return the handle in.
11082    /// - `dptr`: Base pointer to previously allocated device memory.
11083    ///
11084    /// # Return value
11085    ///
11086    /// - [`CUresult::CUDA_SUCCESS`]
11087    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
11088    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
11089    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
11090    /// - [`CUresult::CUDA_ERROR_MAP_FAILED`]
11091    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
11092    ///
11093    /// See also: [`cuMemAlloc`], [`cuMemFree`], [`cuIpcGetEventHandle`], [`cuIpcOpenEventHandle`], [`cuIpcOpenMemHandle`], [`cuIpcCloseMemHandle`], `cudaIpcGetMemHandle`.
11094    pub fn cuIpcGetMemHandle(
11095        pHandle: *mut CUipcMemHandle,
11096        dptr: CUdeviceptr,
11097    ) -> CUresult;
11098}
11099singe_loader::functions! { crate::DRIVER;
11100    /// Opens an interprocess memory handle exported from another process and returns a device pointer usable in the local process.
11101    ///
11102    /// Maps memory exported from another process with [`cuIpcGetMemHandle`] into the current device address space. For contexts on different devices cuIpcOpenMemHandle can attempt to enable peer access between the devices as if the user called [`cuCtxEnablePeerAccess`]. This behavior is controlled by the [`CUipcMem_flags_enum::CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS`] flag. [`cuDeviceCanAccessPeer`] can determine if a mapping is possible.
11103    ///
11104    /// Contexts that may open `CUipcMemHandles` are restricted in the following way. `CUipcMemHandles` from each [`CUdevice`] in a given process may only be opened by one [`CUcontext`] per [`CUdevice`] per other process.
11105    ///
11106    /// If the memory handle has already been opened by the current context, the reference count on the handle is incremented by 1 and the existing device pointer is returned.
11107    ///
11108    /// Memory returned from cuIpcOpenMemHandle must be freed with [`cuIpcCloseMemHandle`].
11109    ///
11110    /// Calling cuMemFree on an exported memory region before calling [`cuIpcCloseMemHandle`] in the importing context will result in undefined behavior.
11111    ///
11112    /// IPC functionality is restricted to devices with support for unified addressing on Linux and Windows operating systems. IPC functionality on Windows is supported for compatibility purposes but not recommended as it comes with performance cost. Users can test their device for IPC functionality by calling `cuapiDeviceGetAttribute` with [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED`].
11113    ///
11114    /// Note: No guarantees are made about the address returned in `*pdptr`. In particular, multiple processes may not receive the same address for the same `handle`.
11115    ///
11116    /// # Parameters
11117    ///
11118    /// - `pdptr`: Returned device pointer.
11119    /// - `handle`: CUipcMemHandle to open.
11120    /// - `Flags`: Flags for this operation. Must be specified as [`CUipcMem_flags_enum::CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS`].
11121    ///
11122    /// # Return value
11123    ///
11124    /// - [`CUresult::CUDA_SUCCESS`]
11125    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
11126    /// - [`CUresult::CUDA_ERROR_MAP_FAILED`]
11127    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
11128    /// - [`CUresult::CUDA_ERROR_TOO_MANY_PEERS`]
11129    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
11130    ///
11131    /// See also: [`cuMemAlloc`], [`cuMemFree`], [`cuIpcGetEventHandle`], [`cuIpcOpenEventHandle`], [`cuIpcGetMemHandle`], [`cuIpcCloseMemHandle`], [`cuCtxEnablePeerAccess`], [`cuDeviceCanAccessPeer`], `cudaIpcOpenMemHandle`.
11132    pub fn cuIpcOpenMemHandle_v2(
11133        pdptr: *mut CUdeviceptr,
11134        handle: CUipcMemHandle,
11135        Flags: ::core::ffi::c_uint,
11136    ) -> CUresult;
11137}
11138singe_loader::functions! { crate::DRIVER;
11139    /// Attempts to close memory mapped with cuIpcOpenMemHandle.
11140    ///
11141    /// Decrements the reference count of the memory returned by cuIpcOpenMemHandle by 1. When the reference count reaches 0, this API unmaps the memory. The original allocation in the exporting process as well as imported mappings in other processes will be unaffected.
11142    ///
11143    /// Any resources used to enable peer access will be freed if this is the last mapping using them.
11144    ///
11145    /// IPC functionality is restricted to devices with support for unified addressing on Linux and Windows operating systems. IPC functionality on Windows is supported for compatibility purposes but not recommended as it comes with performance cost. Users can test their device for IPC functionality by calling `cuapiDeviceGetAttribute` with [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED`].
11146    ///
11147    /// # Parameters
11148    ///
11149    /// - `dptr`: Device pointer returned by [`cuIpcOpenMemHandle`]
11150    ///
11151    /// # Return value
11152    ///
11153    /// - [`CUresult::CUDA_SUCCESS`]
11154    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
11155    /// - [`CUresult::CUDA_ERROR_MAP_FAILED`]
11156    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
11157    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
11158    ///
11159    /// See also: [`cuMemAlloc`], [`cuMemFree`], [`cuIpcGetEventHandle`], [`cuIpcOpenEventHandle`], [`cuIpcGetMemHandle`], [`cuIpcOpenMemHandle`], `cudaIpcCloseMemHandle`.
11160    pub fn cuIpcCloseMemHandle(dptr: CUdeviceptr) -> CUresult;
11161}
11162singe_loader::functions! { crate::DRIVER;
11163    /// Registers an existing host memory range for use by CUDA.
11164    ///
11165    /// Page-locks the memory range specified by `p` and `bytesize` and maps it for the device(s) as specified by `Flags`. This memory range also is added to the same tracking mechanism as [`cuMemHostAlloc`] to automatically accelerate calls to functions such as cuMemcpyHtoD(). Since the memory can be accessed directly by the device, it can be read or written with much higher bandwidth than pageable memory that has not been registered. Page-locking excessive amounts of memory may degrade system performance, since it reduces the amount of memory available to the system for paging. As a result, this function is best used sparingly to register staging areas for data exchange between host and device.
11166    ///
11167    /// On systems where [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES`] is true, cuMemHostRegister will not page-lock the memory range specified by `ptr` but only populate unpopulated pages.
11168    ///
11169    /// The `Flags` parameter enables different options to be specified that affect the allocation, as follows.
11170    ///
11171    /// * [`CU_MEMHOSTREGISTER_PORTABLE`]: The memory returned by this call will be considered as pinned memory by all CUDA contexts, not just the one that performed the allocation.
11172    /// * [`CU_MEMHOSTREGISTER_DEVICEMAP`]: Maps the allocation into the CUDA address space. The device pointer to the memory may be obtained by calling cuMemHostGetDevicePointer().
11173    /// * [`CU_MEMHOSTREGISTER_IOMEMORY`]: The pointer is treated as pointing to some I/O memory space, e.g. the PCI Express resource of a 3rd party device.
11174    /// * [`CU_MEMHOSTREGISTER_READ_ONLY`]: The pointer is treated as pointing to memory that is considered read-only by the device. On platforms without [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES`], this flag is required in order to register memory mapped to the CPU as read-only. Support for the use of this flag can be queried from the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_READ_ONLY_HOST_REGISTER_SUPPORTED`]. Using this flag with a current context associated with a device that does not have this attribute set will cause cuMemHostRegister to error with [`CUresult::CUDA_ERROR_NOT_SUPPORTED`].
11175    ///
11176    /// All of these flags are orthogonal to one another: a developer may page-lock memory that is portable or mapped with no restrictions.
11177    ///
11178    /// The [`CU_MEMHOSTREGISTER_DEVICEMAP`] flag may be specified on CUDA contexts for devices that do not support mapped pinned memory. The failure is deferred to cuMemHostGetDevicePointer() because the memory may be mapped into other CUDA contexts via the [`CU_MEMHOSTREGISTER_PORTABLE`] flag.
11179    ///
11180    /// For devices that have a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM`], the memory can also be accessed from the device using the host pointer `p`. The device pointer returned by cuMemHostGetDevicePointer() may or may not match the original host pointer `ptr` and depends on the devices visible to the application. If all devices visible to the application have a non-zero value for the device attribute, the device pointer returned by cuMemHostGetDevicePointer() will match the original pointer `ptr`. If any device visible to the application has a zero value for the device attribute, the device pointer returned by cuMemHostGetDevicePointer() will not match the original host pointer `ptr`, but it will be suitable for use on all devices provided Unified Virtual Addressing is enabled. In such systems, it is valid to access the memory using either pointer on devices that have a non-zero value for the device attribute. Note however that such devices should access the memory using only of the two pointers and not both.
11181    ///
11182    /// The memory page-locked by this function must be unregistered with [`cuMemHostUnregister`].
11183    ///
11184    /// Note that this function may also return error codes from previous, asynchronous launches.
11185    ///
11186    /// # Parameters
11187    ///
11188    /// - `p`: Host pointer to memory to page-lock.
11189    /// - `bytesize`: Size in bytes of the address range to page-lock.
11190    /// - `Flags`: Flags for allocation request.
11191    ///
11192    /// # Return value
11193    ///
11194    /// - [`CUresult::CUDA_SUCCESS`]
11195    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
11196    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
11197    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
11198    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
11199    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
11200    /// - [`CUresult::CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED`]
11201    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
11202    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
11203    /// - [`CUresult::CUDA_ERROR_EXTERNAL_DEVICE`]
11204    ///
11205    /// See also: [`cuMemHostUnregister`], [`cuMemHostGetFlags`], [`cuMemHostGetDevicePointer`], `cudaHostRegister`.
11206    pub fn cuMemHostRegister_v2(
11207        p: *mut ::core::ffi::c_void,
11208        bytesize: size_t,
11209        Flags: ::core::ffi::c_uint,
11210    ) -> CUresult;
11211}
11212singe_loader::functions! { crate::DRIVER;
11213    /// Unregisters a memory range that was registered with cuMemHostRegister.
11214    ///
11215    /// Unmaps the memory range whose base address is specified by `p`, and makes it pageable again.
11216    ///
11217    /// The base address must be the same one specified to cuMemHostRegister().
11218    ///
11219    /// Note that this function may also return error codes from previous, asynchronous launches.
11220    ///
11221    /// # Parameters
11222    ///
11223    /// - `p`: Host pointer to memory to unregister
11224    ///
11225    /// # Return value
11226    ///
11227    /// - [`CUresult::CUDA_SUCCESS`]
11228    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
11229    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
11230    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
11231    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
11232    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
11233    /// - [`CUresult::CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED`]
11234    ///
11235    /// See also: [`cuMemHostRegister`], `cudaHostUnregister`.
11236    pub fn cuMemHostUnregister(p: *mut ::core::ffi::c_void) -> CUresult;
11237}
11238singe_loader::functions! { crate::DRIVER;
11239    /// Copies memory.
11240    ///
11241    /// Copies data between two pointers. `dst` and `src` are base pointers of the destination and source, respectively. `ByteCount` specifies the number of bytes to copy. Note that this function infers the type of the transfer (host to host, host to device, device to device, or device to host) from the pointer values. This function is only allowed in contexts which support unified addressing.
11242    ///
11243    /// Note that this function may also return error codes from previous, asynchronous launches.
11244    ///
11245    /// Note: This function exhibits synchronous behavior for most use cases.
11246    ///
11247    /// Note: Memory regions requested must be either entirely registered with CUDA, or in the case of host pageable transfers, not registered at all. Memory regions spanning over allocations that are both registered and not registered with CUDA are not supported and will return [`CUresult::CUDA_ERROR_INVALID_VALUE`].
11248    ///
11249    /// # Parameters
11250    ///
11251    /// - `dst`: Destination unified virtual address space pointer.
11252    /// - `src`: Source unified virtual address space pointer.
11253    /// - `ByteCount`: Size of memory copy in bytes.
11254    ///
11255    /// # Return value
11256    ///
11257    /// - [`CUresult::CUDA_SUCCESS`]
11258    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
11259    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
11260    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
11261    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
11262    ///
11263    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D16`], [`cuMemsetD2D32`], [`cuMemsetD8`], [`cuMemsetD16`], [`cuMemsetD32`], `cudaMemcpy`, `cudaMemcpyToSymbol`, `cudaMemcpyFromSymbol`.
11264    pub fn cuMemcpy(dst: CUdeviceptr, src: CUdeviceptr, ByteCount: size_t) -> CUresult;
11265}
11266singe_loader::functions! { crate::DRIVER;
11267    /// Copies device memory between two contexts.
11268    ///
11269    /// Copies from device memory in one context to device memory in another context. `dstDevice` is the base device pointer of the destination memory and `dstContext` is the destination context. `srcDevice` is the base device pointer of the source memory and `srcContext` is the source pointer. `ByteCount` specifies the number of bytes to copy.
11270    ///
11271    /// Note that this function may also return error codes from previous, asynchronous launches.
11272    ///
11273    /// Note: This function exhibits synchronous behavior for most use cases.
11274    ///
11275    /// # Parameters
11276    ///
11277    /// - `dstDevice`: Destination device pointer.
11278    /// - `dstContext`: Destination context.
11279    /// - `srcDevice`: Source device pointer.
11280    /// - `srcContext`: Source context.
11281    /// - `ByteCount`: Size of memory copy in bytes.
11282    ///
11283    /// # Return value
11284    ///
11285    /// - [`CUresult::CUDA_SUCCESS`]
11286    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
11287    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
11288    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
11289    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
11290    ///
11291    /// See also: [`cuMemcpyDtoD`], [`cuMemcpy3DPeer`], [`cuMemcpyDtoDAsync`], [`cuMemcpyPeerAsync`], [`cuMemcpy3DPeerAsync`], `cudaMemcpyPeer`.
11292    pub fn cuMemcpyPeer(
11293        dstDevice: CUdeviceptr,
11294        dstContext: CUcontext,
11295        srcDevice: CUdeviceptr,
11296        srcContext: CUcontext,
11297        ByteCount: size_t,
11298    ) -> CUresult;
11299}
11300singe_loader::functions! { crate::DRIVER;
11301    /// Copies memory from Host to Device.
11302    ///
11303    /// Copies from host memory to device memory. `dstDevice` and `srcHost` are the base addresses of the destination and source, respectively. `ByteCount` specifies the number of bytes to copy.
11304    ///
11305    /// Note that this function may also return error codes from previous, asynchronous launches.
11306    ///
11307    /// Note: This function exhibits synchronous behavior for most use cases.
11308    ///
11309    /// Note: Memory regions requested must be either entirely registered with CUDA, or in the case of host pageable transfers, not registered at all. Memory regions spanning over allocations that are both registered and not registered with CUDA are not supported and will return [`CUresult::CUDA_ERROR_INVALID_VALUE`].
11310    ///
11311    /// # Parameters
11312    ///
11313    /// - `dstDevice`: Destination device pointer.
11314    /// - `srcHost`: Source host pointer.
11315    /// - `ByteCount`: Size of memory copy in bytes.
11316    ///
11317    /// # Return value
11318    ///
11319    /// - [`CUresult::CUDA_SUCCESS`]
11320    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
11321    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
11322    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
11323    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
11324    ///
11325    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D16`], [`cuMemsetD2D32`], [`cuMemsetD8`], [`cuMemsetD16`], [`cuMemsetD32`], `cudaMemcpy`, `cudaMemcpyToSymbol`.
11326    pub fn cuMemcpyHtoD_v2(
11327        dstDevice: CUdeviceptr,
11328        srcHost: *const ::core::ffi::c_void,
11329        ByteCount: size_t,
11330    ) -> CUresult;
11331}
11332singe_loader::functions! { crate::DRIVER;
11333    /// Copies memory from Device to Host.
11334    ///
11335    /// Copies from device to host memory. `dstHost` and `srcDevice` specify the base pointers of the destination and source, respectively. `ByteCount` specifies the number of bytes to copy.
11336    ///
11337    /// Note that this function may also return error codes from previous, asynchronous launches.
11338    ///
11339    /// Note: This function exhibits synchronous behavior for most use cases.
11340    ///
11341    /// Note: Memory regions requested must be either entirely registered with CUDA, or in the case of host pageable transfers, not registered at all. Memory regions spanning over allocations that are both registered and not registered with CUDA are not supported and will return [`CUresult::CUDA_ERROR_INVALID_VALUE`].
11342    ///
11343    /// # Parameters
11344    ///
11345    /// - `dstHost`: Destination host pointer.
11346    /// - `srcDevice`: Source device pointer.
11347    /// - `ByteCount`: Size of memory copy in bytes.
11348    ///
11349    /// # Return value
11350    ///
11351    /// - [`CUresult::CUDA_SUCCESS`]
11352    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
11353    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
11354    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
11355    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
11356    ///
11357    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D16`], [`cuMemsetD2D32`], [`cuMemsetD8`], [`cuMemsetD16`], [`cuMemsetD32`], `cudaMemcpy`, `cudaMemcpyFromSymbol`.
11358    pub fn cuMemcpyDtoH_v2(
11359        dstHost: *mut ::core::ffi::c_void,
11360        srcDevice: CUdeviceptr,
11361        ByteCount: size_t,
11362    ) -> CUresult;
11363}
11364singe_loader::functions! { crate::DRIVER;
11365    /// Copies memory from Device to Device.
11366    ///
11367    /// Copies from device memory to device memory. `dstDevice` and `srcDevice` are the base pointers of the destination and source, respectively. `ByteCount` specifies the number of bytes to copy.
11368    ///
11369    /// Note that this function may also return error codes from previous, asynchronous launches.
11370    ///
11371    /// Note: This function exhibits synchronous behavior for most use cases.
11372    ///
11373    /// # Parameters
11374    ///
11375    /// - `dstDevice`: Destination device pointer.
11376    /// - `srcDevice`: Source device pointer.
11377    /// - `ByteCount`: Size of memory copy in bytes.
11378    ///
11379    /// # Return value
11380    ///
11381    /// - [`CUresult::CUDA_SUCCESS`]
11382    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
11383    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
11384    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
11385    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
11386    ///
11387    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D16`], [`cuMemsetD2D32`], [`cuMemsetD8`], [`cuMemsetD16`], [`cuMemsetD32`], `cudaMemcpy`, `cudaMemcpyToSymbol`, `cudaMemcpyFromSymbol`.
11388    pub fn cuMemcpyDtoD_v2(
11389        dstDevice: CUdeviceptr,
11390        srcDevice: CUdeviceptr,
11391        ByteCount: size_t,
11392    ) -> CUresult;
11393}
11394singe_loader::functions! { crate::DRIVER;
11395    /// Copies memory from Device to Array.
11396    ///
11397    /// Copies from device memory to a 1D CUDA array. `dstArray` and `dstOffset` specify the CUDA array handle and starting index of the destination data. `srcDevice` specifies the base pointer of the source. `ByteCount` specifies the number of bytes to copy.
11398    ///
11399    /// Note that this function may also return error codes from previous, asynchronous launches.
11400    ///
11401    /// Note: This function exhibits synchronous behavior for most use cases.
11402    ///
11403    /// # Parameters
11404    ///
11405    /// - `dstArray`: Destination array.
11406    /// - `dstOffset`: Offset in bytes of destination array.
11407    /// - `srcDevice`: Source device pointer.
11408    /// - `ByteCount`: Size of memory copy in bytes.
11409    ///
11410    /// # Return value
11411    ///
11412    /// - [`CUresult::CUDA_SUCCESS`]
11413    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
11414    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
11415    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
11416    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
11417    ///
11418    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D16`], [`cuMemsetD2D32`], [`cuMemsetD8`], [`cuMemsetD16`], [`cuMemsetD32`], `cudaMemcpyToArray`.
11419    pub fn cuMemcpyDtoA_v2(
11420        dstArray: CUarray,
11421        dstOffset: size_t,
11422        srcDevice: CUdeviceptr,
11423        ByteCount: size_t,
11424    ) -> CUresult;
11425}
11426singe_loader::functions! { crate::DRIVER;
11427    /// Copies memory from Array to Device.
11428    ///
11429    /// Copies from one 1D CUDA array to device memory. `dstDevice` specifies the base pointer of the destination and must be naturally aligned with the CUDA array elements. `srcArray` and `srcOffset` specify the CUDA array handle and the offset in bytes into the array where the copy is to begin. `ByteCount` specifies the number of bytes to copy and must be evenly divisible by the array element size.
11430    ///
11431    /// Note that this function may also return error codes from previous, asynchronous launches.
11432    ///
11433    /// Note: This function exhibits synchronous behavior for most use cases.
11434    ///
11435    /// # Parameters
11436    ///
11437    /// - `dstDevice`: Destination device pointer.
11438    /// - `srcArray`: Source array.
11439    /// - `srcOffset`: Offset in bytes of source array.
11440    /// - `ByteCount`: Size of memory copy in bytes.
11441    ///
11442    /// # Return value
11443    ///
11444    /// - [`CUresult::CUDA_SUCCESS`]
11445    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
11446    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
11447    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
11448    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
11449    ///
11450    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D16`], [`cuMemsetD2D32`], [`cuMemsetD8`], [`cuMemsetD16`], [`cuMemsetD32`], `cudaMemcpyFromArray`.
11451    pub fn cuMemcpyAtoD_v2(
11452        dstDevice: CUdeviceptr,
11453        srcArray: CUarray,
11454        srcOffset: size_t,
11455        ByteCount: size_t,
11456    ) -> CUresult;
11457}
11458singe_loader::functions! { crate::DRIVER;
11459    /// Copies memory from Host to Array.
11460    ///
11461    /// Copies from host memory to a 1D CUDA array. `dstArray` and `dstOffset` specify the CUDA array handle and starting offset in bytes of the destination data. `pSrc` specifies the base address of the source. `ByteCount` specifies the number of bytes to copy.
11462    ///
11463    /// Note that this function may also return error codes from previous, asynchronous launches.
11464    ///
11465    /// Note: This function exhibits synchronous behavior for most use cases.
11466    ///
11467    /// Note: Memory regions requested must be either entirely registered with CUDA, or in the case of host pageable transfers, not registered at all. Memory regions spanning over allocations that are both registered and not registered with CUDA are not supported and will return [`CUresult::CUDA_ERROR_INVALID_VALUE`].
11468    ///
11469    /// # Parameters
11470    ///
11471    /// - `dstArray`: Destination array.
11472    /// - `dstOffset`: Offset in bytes of destination array.
11473    /// - `srcHost`: Source host pointer.
11474    /// - `ByteCount`: Size of memory copy in bytes.
11475    ///
11476    /// # Return value
11477    ///
11478    /// - [`CUresult::CUDA_SUCCESS`]
11479    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
11480    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
11481    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
11482    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
11483    ///
11484    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D16`], [`cuMemsetD2D32`], [`cuMemsetD8`], [`cuMemsetD16`], [`cuMemsetD32`], `cudaMemcpyToArray`.
11485    pub fn cuMemcpyHtoA_v2(
11486        dstArray: CUarray,
11487        dstOffset: size_t,
11488        srcHost: *const ::core::ffi::c_void,
11489        ByteCount: size_t,
11490    ) -> CUresult;
11491}
11492singe_loader::functions! { crate::DRIVER;
11493    /// Copies memory from Array to Host.
11494    ///
11495    /// Copies from one 1D CUDA array to host memory. `dstHost` specifies the base pointer of the destination. `srcArray` and `srcOffset` specify the CUDA array handle and starting offset in bytes of the source data. `ByteCount` specifies the number of bytes to copy.
11496    ///
11497    /// Note that this function may also return error codes from previous, asynchronous launches.
11498    ///
11499    /// Note: This function exhibits synchronous behavior for most use cases.
11500    ///
11501    /// Note: Memory regions requested must be either entirely registered with CUDA, or in the case of host pageable transfers, not registered at all. Memory regions spanning over allocations that are both registered and not registered with CUDA are not supported and will return [`CUresult::CUDA_ERROR_INVALID_VALUE`].
11502    ///
11503    /// # Parameters
11504    ///
11505    /// - `dstHost`: Destination device pointer.
11506    /// - `srcArray`: Source array.
11507    /// - `srcOffset`: Offset in bytes of source array.
11508    /// - `ByteCount`: Size of memory copy in bytes.
11509    ///
11510    /// # Return value
11511    ///
11512    /// - [`CUresult::CUDA_SUCCESS`]
11513    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
11514    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
11515    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
11516    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
11517    ///
11518    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D16`], [`cuMemsetD2D32`], [`cuMemsetD8`], [`cuMemsetD16`], [`cuMemsetD32`], `cudaMemcpyFromArray`.
11519    pub fn cuMemcpyAtoH_v2(
11520        dstHost: *mut ::core::ffi::c_void,
11521        srcArray: CUarray,
11522        srcOffset: size_t,
11523        ByteCount: size_t,
11524    ) -> CUresult;
11525}
11526singe_loader::functions! { crate::DRIVER;
11527    /// Copies memory from Array to Array.
11528    ///
11529    /// Copies from one 1D CUDA array to another. `dstArray` and `srcArray` specify the handles of the destination and source CUDA arrays for the copy, respectively. `dstOffset` and `srcOffset` specify the destination and source offsets in bytes into the CUDA arrays. `ByteCount` is the number of bytes to be copied. The size of the elements in the CUDA arrays need not be the same format, but the elements must be the same size; and count must be evenly divisible by that size.
11530    ///
11531    /// Note that this function may also return error codes from previous, asynchronous launches.
11532    ///
11533    /// Note: This function exhibits synchronous behavior for most use cases.
11534    ///
11535    /// # Parameters
11536    ///
11537    /// - `dstArray`: Destination array.
11538    /// - `dstOffset`: Offset in bytes of destination array.
11539    /// - `srcArray`: Source array.
11540    /// - `srcOffset`: Offset in bytes of source array.
11541    /// - `ByteCount`: Size of memory copy in bytes.
11542    ///
11543    /// # Return value
11544    ///
11545    /// - [`CUresult::CUDA_SUCCESS`]
11546    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
11547    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
11548    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
11549    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
11550    ///
11551    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D16`], [`cuMemsetD2D32`], [`cuMemsetD8`], [`cuMemsetD16`], [`cuMemsetD32`], `cudaMemcpyArrayToArray`.
11552    pub fn cuMemcpyAtoA_v2(
11553        dstArray: CUarray,
11554        dstOffset: size_t,
11555        srcArray: CUarray,
11556        srcOffset: size_t,
11557        ByteCount: size_t,
11558    ) -> CUresult;
11559}
11560singe_loader::functions! { crate::DRIVER;
11561    /// Copies memory for 2D arrays.
11562    ///
11563    /// Perform a 2D memory copy according to the parameters specified in `pCopy`. The CUDA_MEMCPY2D structure is defined as:
11564    ///
11565    /// ```text
11566    /// typedef struct CUDA_MEMCPY2D_st {
11567    ///    unsigned int srcXInBytes, srcY;
11568    ///    CUmemorytype srcMemoryType;
11569    /// const void *srcHost;
11570    /// CUdeviceptr srcDevice;
11571    /// CUarray srcArray;
11572    /// unsigned int srcPitch;
11573    ///
11574    ///    unsigned int dstXInBytes, dstY;
11575    ///    CUmemorytype dstMemoryType;
11576    /// void *dstHost;
11577    /// CUdeviceptr dstDevice;
11578    /// CUarray dstArray;
11579    /// unsigned int dstPitch;
11580    ///
11581    ///    unsigned int WidthInBytes;
11582    ///    unsigned int Height;
11583    /// } CUDA_MEMCPY2D;
11584    /// ```
11585    ///
11586    /// where:
11587    ///
11588    /// * `srcMemoryType` and `dstMemoryType` specify the type of memory of the source and destination, respectively; [`CUmemorytype_enum`] is defined as:
11589    ///
11590    /// ```text
11591    /// typedef enum CUmemorytype_enum {
11592    ///    CU_MEMORYTYPE_HOST = 0x01,
11593    ///    CU_MEMORYTYPE_DEVICE = 0x02,
11594    ///    CU_MEMORYTYPE_ARRAY = 0x03,
11595    ///    CU_MEMORYTYPE_UNIFIED = 0x04
11596    /// } CUmemorytype;
11597    /// ```
11598    ///
11599    /// * `srcXInBytes` and `srcY` specify the base address of the source data for the copy.
11600    ///
11601    /// If `srcMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_UNIFIED`], `srcDevice` and `srcPitch` specify the (unified virtual address space) base address of the source data and the bytes per row to apply. `srcArray` is ignored. This value may be used only if unified addressing is supported in the calling context.
11602    ///
11603    /// If `srcMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_HOST`], `srcHost` and `srcPitch` specify the (host) base address of the source data and the bytes per row to apply. `srcArray` is ignored.
11604    ///
11605    /// If `srcMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_DEVICE`], `srcDevice` and `srcPitch` specify the (device) base address of the source data and the bytes per row to apply. `srcArray` is ignored.
11606    ///
11607    /// If `srcMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_ARRAY`], `srcArray` specifies the handle of the source data. `srcHost`, `srcDevice` and `srcPitch` are ignored.
11608    ///
11609    /// If `dstMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_HOST`], `dstHost` and `dstPitch` specify the (host) base address of the destination data and the bytes per row to apply. `dstArray` is ignored.
11610    ///
11611    /// If `dstMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_UNIFIED`], `dstDevice` and `dstPitch` specify the (unified virtual address space) base address of the source data and the bytes per row to apply. `dstArray` is ignored. This value may be used only if unified addressing is supported in the calling context.
11612    ///
11613    /// If `dstMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_DEVICE`], `dstDevice` and `dstPitch` specify the (device) base address of the destination data and the bytes per row to apply. `dstArray` is ignored.
11614    ///
11615    /// If `dstMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_ARRAY`], `dstArray` specifies the handle of the destination data. `dstHost`, `dstDevice` and `dstPitch` are ignored.
11616    ///
11617    /// * `dstXInBytes` and `dstY` specify the base address of the destination data for the copy.
11618    ///
11619    /// For host pointers, the starting address is
11620    ///
11621    /// ```text
11622    /// void* Start = (void*)((char*)srcHost+srcY*srcPitch + srcXInBytes);
11623    /// ```
11624    ///
11625    /// For device pointers, the starting address is
11626    ///
11627    /// ```text
11628    /// CUdeviceptr Start = srcDevice+srcY*srcPitch+srcXInBytes;
11629    /// ```
11630    ///
11631    /// For CUDA arrays, `srcXInBytes` must be evenly divisible by the array element size.
11632    ///
11633    /// * `WidthInBytes` and `Height` specify the width (in bytes) and height of the 2D copy being performed.
11634    /// * If specified, `srcPitch` must be greater than or equal to `WidthInBytes` + `srcXInBytes`, and `dstPitch` must be greater than or equal to `WidthInBytes` + dstXInBytes.
11635    ///
11636    /// For host pointers, the base address is
11637    ///
11638    /// ```text
11639    /// void* dstStart = (void*)((char*)dstHost+dstY*dstPitch + dstXInBytes);
11640    /// ```
11641    ///
11642    /// For device pointers, the starting address is
11643    ///
11644    /// ```text
11645    /// CUdeviceptr dstStart = dstDevice+dstY*dstPitch+dstXInBytes;
11646    /// ```
11647    ///
11648    /// For CUDA arrays, `dstXInBytes` must be evenly divisible by the array element size.
11649    ///
11650    /// cuMemcpy2D() returns an error if any pitch is greater than the maximum allowed ([`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAX_PITCH`]). cuMemAllocPitch() passes back pitches that always work with cuMemcpy2D(). On intra-device memory copies (device to device, CUDA array to device, CUDA array to CUDA array), cuMemcpy2D() may fail for pitches not computed by cuMemAllocPitch(). cuMemcpy2DUnaligned() does not have this restriction, but may run significantly slower in the cases where cuMemcpy2D() would have returned an error code.
11651    ///
11652    /// Note that this function may also return error codes from previous, asynchronous launches.
11653    ///
11654    /// Note: This function exhibits synchronous behavior for most use cases.
11655    ///
11656    /// # Return value
11657    ///
11658    /// - [`CUresult::CUDA_SUCCESS`]
11659    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
11660    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
11661    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
11662    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
11663    ///
11664    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D16`], [`cuMemsetD2D32`], [`cuMemsetD8`], [`cuMemsetD16`], [`cuMemsetD32`], `cudaMemcpy2D`, `cudaMemcpy2DToArray`, `cudaMemcpy2DFromArray`.
11665    pub fn cuMemcpy2D_v2(pCopy: *const CUDA_MEMCPY2D) -> CUresult;
11666}
11667singe_loader::functions! { crate::DRIVER;
11668    /// Copies memory for 2D arrays.
11669    ///
11670    /// Perform a 2D memory copy according to the parameters specified in `pCopy`. The CUDA_MEMCPY2D structure is defined as:
11671    ///
11672    /// ```text
11673    /// typedef struct CUDA_MEMCPY2D_st {
11674    ///    unsigned int srcXInBytes, srcY;
11675    ///    CUmemorytype srcMemoryType;
11676    ///    const void *srcHost;
11677    ///    CUdeviceptr srcDevice;
11678    ///    CUarray srcArray;
11679    ///    unsigned int srcPitch;
11680    ///    unsigned int dstXInBytes, dstY;
11681    ///    CUmemorytype dstMemoryType;
11682    ///    void *dstHost;
11683    ///    CUdeviceptr dstDevice;
11684    ///    CUarray dstArray;
11685    ///    unsigned int dstPitch;
11686    ///    unsigned int WidthInBytes;
11687    ///    unsigned int Height;
11688    /// } CUDA_MEMCPY2D;
11689    /// ```
11690    ///
11691    /// where:
11692    ///
11693    /// * `srcMemoryType` and `dstMemoryType` specify the type of memory of the source and destination, respectively; [`CUmemorytype_enum`] is defined as:
11694    ///
11695    /// ```text
11696    /// typedef enum CUmemorytype_enum {
11697    ///    CU_MEMORYTYPE_HOST = 0x01,
11698    ///    CU_MEMORYTYPE_DEVICE = 0x02,
11699    ///    CU_MEMORYTYPE_ARRAY = 0x03,
11700    ///    CU_MEMORYTYPE_UNIFIED = 0x04
11701    /// } CUmemorytype;
11702    /// ```
11703    ///
11704    /// * `srcXInBytes` and `srcY` specify the base address of the source data for the copy.
11705    ///
11706    /// If `srcMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_UNIFIED`], `srcDevice` and `srcPitch` specify the (unified virtual address space) base address of the source data and the bytes per row to apply. `srcArray` is ignored. This value may be used only if unified addressing is supported in the calling context.
11707    ///
11708    /// If `srcMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_HOST`], `srcHost` and `srcPitch` specify the (host) base address of the source data and the bytes per row to apply. `srcArray` is ignored.
11709    ///
11710    /// If `srcMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_DEVICE`], `srcDevice` and `srcPitch` specify the (device) base address of the source data and the bytes per row to apply. `srcArray` is ignored.
11711    ///
11712    /// If `srcMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_ARRAY`], `srcArray` specifies the handle of the source data. `srcHost`, `srcDevice` and `srcPitch` are ignored.
11713    ///
11714    /// If `dstMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_UNIFIED`], `dstDevice` and `dstPitch` specify the (unified virtual address space) base address of the source data and the bytes per row to apply. `dstArray` is ignored. This value may be used only if unified addressing is supported in the calling context.
11715    ///
11716    /// If `dstMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_HOST`], `dstHost` and `dstPitch` specify the (host) base address of the destination data and the bytes per row to apply. `dstArray` is ignored.
11717    ///
11718    /// If `dstMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_DEVICE`], `dstDevice` and `dstPitch` specify the (device) base address of the destination data and the bytes per row to apply. `dstArray` is ignored.
11719    ///
11720    /// If `dstMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_ARRAY`], `dstArray` specifies the handle of the destination data. `dstHost`, `dstDevice` and `dstPitch` are ignored.
11721    ///
11722    /// * `dstXInBytes` and `dstY` specify the base address of the destination data for the copy.
11723    ///
11724    /// For host pointers, the starting address is
11725    ///
11726    /// ```text
11727    /// void* Start = (void*)((char*)srcHost+srcY*srcPitch + srcXInBytes);
11728    /// ```
11729    ///
11730    /// For device pointers, the starting address is
11731    ///
11732    /// ```text
11733    /// CUdeviceptr Start = srcDevice+srcY*srcPitch+srcXInBytes;
11734    /// ```
11735    ///
11736    /// For CUDA arrays, `srcXInBytes` must be evenly divisible by the array element size.
11737    ///
11738    /// * `WidthInBytes` and `Height` specify the width (in bytes) and height of the 2D copy being performed.
11739    /// * If specified, `srcPitch` must be greater than or equal to `WidthInBytes` + `srcXInBytes`, and `dstPitch` must be greater than or equal to `WidthInBytes` + dstXInBytes.
11740    ///
11741    /// For host pointers, the base address is
11742    ///
11743    /// ```text
11744    /// void* dstStart = (void*)((char*)dstHost+dstY*dstPitch + dstXInBytes);
11745    /// ```
11746    ///
11747    /// For device pointers, the starting address is
11748    ///
11749    /// ```text
11750    /// CUdeviceptr dstStart = dstDevice+dstY*dstPitch+dstXInBytes;
11751    /// ```
11752    ///
11753    /// For CUDA arrays, `dstXInBytes` must be evenly divisible by the array element size.
11754    ///
11755    /// cuMemcpy2D() returns an error if any pitch is greater than the maximum allowed ([`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAX_PITCH`]). cuMemAllocPitch() passes back pitches that always work with cuMemcpy2D(). On intra-device memory copies (device to device, CUDA array to device, CUDA array to CUDA array), cuMemcpy2D() may fail for pitches not computed by cuMemAllocPitch(). cuMemcpy2DUnaligned() does not have this restriction, but may run significantly slower in the cases where cuMemcpy2D() would have returned an error code.
11756    ///
11757    /// Note that this function may also return error codes from previous, asynchronous launches.
11758    ///
11759    /// Note: This function exhibits synchronous behavior for most use cases.
11760    ///
11761    /// # Return value
11762    ///
11763    /// - [`CUresult::CUDA_SUCCESS`]
11764    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
11765    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
11766    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
11767    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
11768    ///
11769    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D16`], [`cuMemsetD2D32`], [`cuMemsetD8`], [`cuMemsetD16`], [`cuMemsetD32`], `cudaMemcpy2D`, `cudaMemcpy2DToArray`, `cudaMemcpy2DFromArray`.
11770    pub fn cuMemcpy2DUnaligned_v2(pCopy: *const CUDA_MEMCPY2D) -> CUresult;
11771}
11772singe_loader::functions! { crate::DRIVER;
11773    /// Copies memory for 3D arrays.
11774    ///
11775    /// Perform a 3D memory copy according to the parameters specified in `pCopy`. The CUDA_MEMCPY3D structure is defined as:
11776    ///
11777    /// ```text
11778    /// typedef struct CUDA_MEMCPY3D_st {
11779    ///
11780    /// unsigned int srcXInBytes, srcY, srcZ;
11781    /// unsigned int srcLOD;
11782    /// CUmemorytype srcMemoryType;
11783    /// const void *srcHost;
11784    /// CUdeviceptr srcDevice;
11785    /// CUarray srcArray;
11786    /// unsigned int srcPitch;  // ignored when src is array
11787    /// unsigned int srcHeight; // ignored when src is array; may be 0 if Depth==1
11788    ///
11789    /// unsigned int dstXInBytes, dstY, dstZ;
11790    /// unsigned int dstLOD;
11791    /// CUmemorytype dstMemoryType;
11792    /// void *dstHost;
11793    /// CUdeviceptr dstDevice;
11794    /// CUarray dstArray;
11795    /// unsigned int dstPitch;  // ignored when dst is array
11796    /// unsigned int dstHeight; // ignored when dst is array; may be 0 if Depth==1
11797    ///
11798    /// unsigned int WidthInBytes;
11799    /// unsigned int Height;
11800    /// unsigned int Depth;
11801    /// } CUDA_MEMCPY3D;
11802    /// ```
11803    ///
11804    /// where:
11805    ///
11806    /// * `srcMemoryType` and `dstMemoryType` specify the type of memory of the source and destination, respectively; [`CUmemorytype_enum`] is defined as:
11807    ///
11808    /// ```text
11809    /// typedef enum CUmemorytype_enum {
11810    ///    CU_MEMORYTYPE_HOST = 0x01,
11811    ///    CU_MEMORYTYPE_DEVICE = 0x02,
11812    ///    CU_MEMORYTYPE_ARRAY = 0x03,
11813    ///    CU_MEMORYTYPE_UNIFIED = 0x04
11814    /// } CUmemorytype;
11815    /// ```
11816    ///
11817    /// * `srcXInBytes`, `srcY` and `srcZ` specify the base address of the source data for the copy.
11818    ///
11819    /// If `srcMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_UNIFIED`], `srcDevice` and `srcPitch` specify the (unified virtual address space) base address of the source data and the bytes per row to apply. `srcArray` is ignored. This value may be used only if unified addressing is supported in the calling context.
11820    ///
11821    /// If `srcMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_HOST`], `srcHost`, `srcPitch` and `srcHeight` specify the (host) base address of the source data, the bytes per row, and the height of each 2D slice of the 3D array. `srcArray` is ignored.
11822    ///
11823    /// If `srcMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_DEVICE`], `srcDevice`, `srcPitch` and `srcHeight` specify the (device) base address of the source data, the bytes per row, and the height of each 2D slice of the 3D array. `srcArray` is ignored.
11824    ///
11825    /// If `srcMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_ARRAY`], `srcArray` specifies the handle of the source data. `srcHost`, `srcDevice`, `srcPitch` and `srcHeight` are ignored.
11826    ///
11827    /// If `dstMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_UNIFIED`], `dstDevice` and `dstPitch` specify the (unified virtual address space) base address of the source data and the bytes per row to apply. `dstArray` is ignored. This value may be used only if unified addressing is supported in the calling context.
11828    ///
11829    /// If `dstMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_HOST`], `dstHost` and `dstPitch` specify the (host) base address of the destination data, the bytes per row, and the height of each 2D slice of the 3D array. `dstArray` is ignored.
11830    ///
11831    /// If `dstMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_DEVICE`], `dstDevice` and `dstPitch` specify the (device) base address of the destination data, the bytes per row, and the height of each 2D slice of the 3D array. `dstArray` is ignored.
11832    ///
11833    /// If `dstMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_ARRAY`], `dstArray` specifies the handle of the destination data. `dstHost`, `dstDevice`, `dstPitch` and `dstHeight` are ignored.
11834    ///
11835    /// * dstXInBytes, `dstY` and `dstZ` specify the base address of the destination data for the copy.
11836    ///
11837    /// For host pointers, the starting address is
11838    ///
11839    /// ```text
11840    /// void* Start = (void*)((char*)srcHost+(srcZ*srcHeight+srcY)*srcPitch + srcXInBytes);
11841    /// ```
11842    ///
11843    /// For device pointers, the starting address is
11844    ///
11845    /// ```text
11846    /// CUdeviceptr Start = srcDevice+(srcZ*srcHeight+srcY)*srcPitch+srcXInBytes;
11847    /// ```
11848    ///
11849    /// For CUDA arrays, `srcXInBytes` must be evenly divisible by the array element size.
11850    ///
11851    /// * `WidthInBytes`, `Height` and `Depth` specify the width (in bytes), height and depth of the 3D copy being performed.
11852    /// * If specified, `srcPitch` must be greater than or equal to `WidthInBytes` + `srcXInBytes`, and `dstPitch` must be greater than or equal to `WidthInBytes` + dstXInBytes.
11853    /// * If specified, `srcHeight` must be greater than or equal to `Height` + `srcY`, and `dstHeight` must be greater than or equal to `Height` + `dstY`.
11854    ///
11855    /// For host pointers, the base address is
11856    ///
11857    /// ```text
11858    /// void* dstStart = (void*)((char*)dstHost+(dstZ*dstHeight+dstY)*dstPitch + dstXInBytes);
11859    /// ```
11860    ///
11861    /// For device pointers, the starting address is
11862    ///
11863    /// ```text
11864    /// CUdeviceptr dstStart = dstDevice+(dstZ*dstHeight+dstY)*dstPitch+dstXInBytes;
11865    /// ```
11866    ///
11867    /// For CUDA arrays, `dstXInBytes` must be evenly divisible by the array element size.
11868    ///
11869    /// The `srcLOD` and `dstLOD` members of the CUDA_MEMCPY3D structure must be set to 0.
11870    ///
11871    /// cuMemcpy3D() returns an error if any pitch is greater than the maximum allowed ([`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAX_PITCH`]).
11872    ///
11873    /// Note that this function may also return error codes from previous, asynchronous launches.
11874    ///
11875    /// Note: This function exhibits synchronous behavior for most use cases.
11876    ///
11877    /// # Return value
11878    ///
11879    /// - [`CUresult::CUDA_SUCCESS`]
11880    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
11881    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
11882    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
11883    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
11884    ///
11885    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D16`], [`cuMemsetD2D32`], [`cuMemsetD8`], [`cuMemsetD16`], [`cuMemsetD32`], `cudaMemcpy3D`.
11886    pub fn cuMemcpy3D_v2(pCopy: *const CUDA_MEMCPY3D) -> CUresult;
11887}
11888singe_loader::functions! { crate::DRIVER;
11889    /// Copies memory between contexts.
11890    ///
11891    /// Perform a 3D memory copy according to the parameters specified in `pCopy`. See the definition of the CUDA_MEMCPY3D_PEER structure for documentation of its parameters.
11892    ///
11893    /// Note that this function may also return error codes from previous, asynchronous launches.
11894    ///
11895    /// Note: This function exhibits synchronous behavior for most use cases.
11896    ///
11897    /// # Parameters
11898    ///
11899    /// - `pCopy`: Parameters for the memory copy
11900    ///
11901    /// # Return value
11902    ///
11903    /// - [`CUresult::CUDA_SUCCESS`]
11904    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
11905    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
11906    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
11907    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
11908    ///
11909    /// See also: [`cuMemcpyDtoD`], [`cuMemcpyPeer`], [`cuMemcpyDtoDAsync`], [`cuMemcpyPeerAsync`], [`cuMemcpy3DPeerAsync`], `cudaMemcpy3DPeer`.
11910    pub fn cuMemcpy3DPeer(pCopy: *const CUDA_MEMCPY3D_PEER) -> CUresult;
11911}
11912singe_loader::functions! { crate::DRIVER;
11913    /// Copies memory asynchronously.
11914    ///
11915    /// Copies data between two pointers. `dst` and `src` are base pointers of the destination and source, respectively. `ByteCount` specifies the number of bytes to copy. Note that this function infers the type of the transfer (host to host, host to device, device to device, or device to host) from the pointer values. This function is only allowed in contexts which support unified addressing.
11916    ///
11917    /// Note that this function may also return error codes from previous, asynchronous launches.
11918    ///
11919    /// Note: This function exhibits asynchronous behavior for most use cases.
11920    ///
11921    /// Note: This function uses standard default stream semantics.
11922    ///
11923    /// Note: Memory regions requested must be either entirely registered with CUDA, or in the case of host pageable transfers, not registered at all. Memory regions spanning over allocations that are both registered and not registered with CUDA are not supported and will return [`CUresult::CUDA_ERROR_INVALID_VALUE`].
11924    ///
11925    /// # Parameters
11926    ///
11927    /// - `dst`: Destination unified virtual address space pointer.
11928    /// - `src`: Source unified virtual address space pointer.
11929    /// - `ByteCount`: Size of memory copy in bytes.
11930    /// - `hStream`: Stream identifier.
11931    ///
11932    /// # Return value
11933    ///
11934    /// - [`CUresult::CUDA_SUCCESS`]
11935    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
11936    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
11937    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
11938    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
11939    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
11940    ///
11941    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32`], [`cuMemsetD2D32Async`], [`cuMemsetD8`], [`cuMemsetD8Async`], [`cuMemsetD16`], [`cuMemsetD16Async`], [`cuMemsetD32`], [`cuMemsetD32Async`], `cudaMemcpyAsync`, `cudaMemcpyToSymbolAsync`, `cudaMemcpyFromSymbolAsync`.
11942    pub fn cuMemcpyAsync(
11943        dst: CUdeviceptr,
11944        src: CUdeviceptr,
11945        ByteCount: size_t,
11946        hStream: CUstream,
11947    ) -> CUresult;
11948}
11949singe_loader::functions! { crate::DRIVER;
11950    /// Copies device memory between two contexts asynchronously.
11951    ///
11952    /// Copies from device memory in one context to device memory in another context. `dstDevice` is the base device pointer of the destination memory and `dstContext` is the destination context. `srcDevice` is the base device pointer of the source memory and `srcContext` is the source pointer. `ByteCount` specifies the number of bytes to copy.
11953    ///
11954    /// Note that this function may also return error codes from previous, asynchronous launches.
11955    ///
11956    /// Note: This function exhibits asynchronous behavior for most use cases.
11957    ///
11958    /// Note: This function uses standard default stream semantics.
11959    ///
11960    /// # Parameters
11961    ///
11962    /// - `dstDevice`: Destination device pointer.
11963    /// - `dstContext`: Destination context.
11964    /// - `srcDevice`: Source device pointer.
11965    /// - `srcContext`: Source context.
11966    /// - `ByteCount`: Size of memory copy in bytes.
11967    /// - `hStream`: Stream identifier.
11968    ///
11969    /// # Return value
11970    ///
11971    /// - [`CUresult::CUDA_SUCCESS`]
11972    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
11973    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
11974    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
11975    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
11976    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
11977    ///
11978    /// See also: [`cuMemcpyDtoD`], [`cuMemcpyPeer`], [`cuMemcpy3DPeer`], [`cuMemcpyDtoDAsync`], [`cuMemcpy3DPeerAsync`], `cudaMemcpyPeerAsync`.
11979    pub fn cuMemcpyPeerAsync(
11980        dstDevice: CUdeviceptr,
11981        dstContext: CUcontext,
11982        srcDevice: CUdeviceptr,
11983        srcContext: CUcontext,
11984        ByteCount: size_t,
11985        hStream: CUstream,
11986    ) -> CUresult;
11987}
11988singe_loader::functions! { crate::DRIVER;
11989    /// Copies memory from Host to Device.
11990    ///
11991    /// Copies from host memory to device memory. `dstDevice` and `srcHost` are the base addresses of the destination and source, respectively. `ByteCount` specifies the number of bytes to copy.
11992    ///
11993    /// Note that this function may also return error codes from previous, asynchronous launches.
11994    ///
11995    /// Note: This function exhibits asynchronous behavior for most use cases.
11996    ///
11997    /// Note: This function uses standard default stream semantics.
11998    ///
11999    /// Note: Memory regions requested must be either entirely registered with CUDA, or in the case of host pageable transfers, not registered at all. Memory regions spanning over allocations that are both registered and not registered with CUDA are not supported and will return [`CUresult::CUDA_ERROR_INVALID_VALUE`].
12000    ///
12001    /// # Parameters
12002    ///
12003    /// - `dstDevice`: Destination device pointer.
12004    /// - `srcHost`: Source host pointer.
12005    /// - `ByteCount`: Size of memory copy in bytes.
12006    /// - `hStream`: Stream identifier.
12007    ///
12008    /// # Return value
12009    ///
12010    /// - [`CUresult::CUDA_SUCCESS`]
12011    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
12012    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
12013    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
12014    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
12015    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
12016    ///
12017    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32`], [`cuMemsetD2D32Async`], [`cuMemsetD8`], [`cuMemsetD8Async`], [`cuMemsetD16`], [`cuMemsetD16Async`], [`cuMemsetD32`], [`cuMemsetD32Async`], `cudaMemcpyAsync`, `cudaMemcpyToSymbolAsync`.
12018    pub fn cuMemcpyHtoDAsync_v2(
12019        dstDevice: CUdeviceptr,
12020        srcHost: *const ::core::ffi::c_void,
12021        ByteCount: size_t,
12022        hStream: CUstream,
12023    ) -> CUresult;
12024}
12025singe_loader::functions! { crate::DRIVER;
12026    /// Copies memory from Device to Host.
12027    ///
12028    /// Copies from device to host memory. `dstHost` and `srcDevice` specify the base pointers of the destination and source, respectively. `ByteCount` specifies the number of bytes to copy.
12029    ///
12030    /// Note that this function may also return error codes from previous, asynchronous launches.
12031    ///
12032    /// Note: This function exhibits asynchronous behavior for most use cases.
12033    ///
12034    /// Note: This function uses standard default stream semantics.
12035    ///
12036    /// Note: Memory regions requested must be either entirely registered with CUDA, or in the case of host pageable transfers, not registered at all. Memory regions spanning over allocations that are both registered and not registered with CUDA are not supported and will return [`CUresult::CUDA_ERROR_INVALID_VALUE`].
12037    ///
12038    /// # Parameters
12039    ///
12040    /// - `dstHost`: Destination host pointer.
12041    /// - `srcDevice`: Source device pointer.
12042    /// - `ByteCount`: Size of memory copy in bytes.
12043    /// - `hStream`: Stream identifier.
12044    ///
12045    /// # Return value
12046    ///
12047    /// - [`CUresult::CUDA_SUCCESS`]
12048    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
12049    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
12050    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
12051    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
12052    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
12053    ///
12054    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32`], [`cuMemsetD2D32Async`], [`cuMemsetD8`], [`cuMemsetD8Async`], [`cuMemsetD16`], [`cuMemsetD16Async`], [`cuMemsetD32`], [`cuMemsetD32Async`], `cudaMemcpyAsync`, `cudaMemcpyFromSymbolAsync`.
12055    pub fn cuMemcpyDtoHAsync_v2(
12056        dstHost: *mut ::core::ffi::c_void,
12057        srcDevice: CUdeviceptr,
12058        ByteCount: size_t,
12059        hStream: CUstream,
12060    ) -> CUresult;
12061}
12062singe_loader::functions! { crate::DRIVER;
12063    /// Copies memory from Device to Device.
12064    ///
12065    /// Copies from device memory to device memory. `dstDevice` and `srcDevice` are the base pointers of the destination and source, respectively. `ByteCount` specifies the number of bytes to copy.
12066    ///
12067    /// Note that this function may also return error codes from previous, asynchronous launches.
12068    ///
12069    /// Note: This function exhibits asynchronous behavior for most use cases.
12070    ///
12071    /// Note: This function uses standard default stream semantics.
12072    ///
12073    /// # Parameters
12074    ///
12075    /// - `dstDevice`: Destination device pointer.
12076    /// - `srcDevice`: Source device pointer.
12077    /// - `ByteCount`: Size of memory copy in bytes.
12078    /// - `hStream`: Stream identifier.
12079    ///
12080    /// # Return value
12081    ///
12082    /// - [`CUresult::CUDA_SUCCESS`]
12083    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
12084    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
12085    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
12086    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
12087    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
12088    ///
12089    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32`], [`cuMemsetD2D32Async`], [`cuMemsetD8`], [`cuMemsetD8Async`], [`cuMemsetD16`], [`cuMemsetD16Async`], [`cuMemsetD32`], [`cuMemsetD32Async`], `cudaMemcpyAsync`, `cudaMemcpyToSymbolAsync`, `cudaMemcpyFromSymbolAsync`.
12090    pub fn cuMemcpyDtoDAsync_v2(
12091        dstDevice: CUdeviceptr,
12092        srcDevice: CUdeviceptr,
12093        ByteCount: size_t,
12094        hStream: CUstream,
12095    ) -> CUresult;
12096}
12097singe_loader::functions! { crate::DRIVER;
12098    /// Copies memory from Host to Array.
12099    ///
12100    /// Copies from host memory to a 1D CUDA array. `dstArray` and `dstOffset` specify the CUDA array handle and starting offset in bytes of the destination data. `srcHost` specifies the base address of the source. `ByteCount` specifies the number of bytes to copy.
12101    ///
12102    /// Note that this function may also return error codes from previous, asynchronous launches.
12103    ///
12104    /// Note: This function exhibits asynchronous behavior for most use cases.
12105    ///
12106    /// Note: This function uses standard default stream semantics.
12107    ///
12108    /// Note: Memory regions requested must be either entirely registered with CUDA, or in the case of host pageable transfers, not registered at all. Memory regions spanning over allocations that are both registered and not registered with CUDA are not supported and will return [`CUresult::CUDA_ERROR_INVALID_VALUE`].
12109    ///
12110    /// # Parameters
12111    ///
12112    /// - `dstArray`: Destination array.
12113    /// - `dstOffset`: Offset in bytes of destination array.
12114    /// - `srcHost`: Source host pointer.
12115    /// - `ByteCount`: Size of memory copy in bytes.
12116    /// - `hStream`: Stream identifier.
12117    ///
12118    /// # Return value
12119    ///
12120    /// - [`CUresult::CUDA_SUCCESS`]
12121    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
12122    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
12123    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
12124    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
12125    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
12126    ///
12127    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32`], [`cuMemsetD2D32Async`], [`cuMemsetD8`], [`cuMemsetD8Async`], [`cuMemsetD16`], [`cuMemsetD16Async`], [`cuMemsetD32`], [`cuMemsetD32Async`], `cudaMemcpyToArrayAsync`.
12128    pub fn cuMemcpyHtoAAsync_v2(
12129        dstArray: CUarray,
12130        dstOffset: size_t,
12131        srcHost: *const ::core::ffi::c_void,
12132        ByteCount: size_t,
12133        hStream: CUstream,
12134    ) -> CUresult;
12135}
12136singe_loader::functions! { crate::DRIVER;
12137    /// Copies memory from Array to Host.
12138    ///
12139    /// Copies from one 1D CUDA array to host memory. `dstHost` specifies the base pointer of the destination. `srcArray` and `srcOffset` specify the CUDA array handle and starting offset in bytes of the source data. `ByteCount` specifies the number of bytes to copy.
12140    ///
12141    /// Note that this function may also return error codes from previous, asynchronous launches.
12142    ///
12143    /// Note: This function exhibits asynchronous behavior for most use cases.
12144    ///
12145    /// Note: This function uses standard default stream semantics.
12146    ///
12147    /// Note: Memory regions requested must be either entirely registered with CUDA, or in the case of host pageable transfers, not registered at all. Memory regions spanning over allocations that are both registered and not registered with CUDA are not supported and will return [`CUresult::CUDA_ERROR_INVALID_VALUE`].
12148    ///
12149    /// # Parameters
12150    ///
12151    /// - `dstHost`: Destination pointer.
12152    /// - `srcArray`: Source array.
12153    /// - `srcOffset`: Offset in bytes of source array.
12154    /// - `ByteCount`: Size of memory copy in bytes.
12155    /// - `hStream`: Stream identifier.
12156    ///
12157    /// # Return value
12158    ///
12159    /// - [`CUresult::CUDA_SUCCESS`]
12160    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
12161    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
12162    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
12163    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
12164    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
12165    ///
12166    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32`], [`cuMemsetD2D32Async`], [`cuMemsetD8`], [`cuMemsetD8Async`], [`cuMemsetD16`], [`cuMemsetD16Async`], [`cuMemsetD32`], [`cuMemsetD32Async`], `cudaMemcpyFromArrayAsync`.
12167    pub fn cuMemcpyAtoHAsync_v2(
12168        dstHost: *mut ::core::ffi::c_void,
12169        srcArray: CUarray,
12170        srcOffset: size_t,
12171        ByteCount: size_t,
12172        hStream: CUstream,
12173    ) -> CUresult;
12174}
12175singe_loader::functions! { crate::DRIVER;
12176    /// Copies memory for 2D arrays.
12177    ///
12178    /// Perform a 2D memory copy according to the parameters specified in `pCopy`. The CUDA_MEMCPY2D structure is defined as:
12179    ///
12180    /// ```text
12181    /// typedef struct CUDA_MEMCPY2D_st {
12182    ///    unsigned int srcXInBytes, srcY;
12183    ///    CUmemorytype srcMemoryType;
12184    ///    const void *srcHost;
12185    ///    CUdeviceptr srcDevice;
12186    ///    CUarray srcArray;
12187    ///    unsigned int srcPitch;
12188    ///    unsigned int dstXInBytes, dstY;
12189    ///    CUmemorytype dstMemoryType;
12190    ///    void *dstHost;
12191    ///    CUdeviceptr dstDevice;
12192    ///    CUarray dstArray;
12193    ///    unsigned int dstPitch;
12194    ///    unsigned int WidthInBytes;
12195    ///    unsigned int Height;
12196    /// } CUDA_MEMCPY2D;
12197    /// ```
12198    ///
12199    /// where:
12200    ///
12201    /// * `srcMemoryType` and `dstMemoryType` specify the type of memory of the source and destination, respectively; [`CUmemorytype_enum`] is defined as:
12202    ///
12203    /// ```text
12204    /// typedef enum CUmemorytype_enum {
12205    ///    CU_MEMORYTYPE_HOST = 0x01,
12206    ///    CU_MEMORYTYPE_DEVICE = 0x02,
12207    ///    CU_MEMORYTYPE_ARRAY = 0x03,
12208    ///    CU_MEMORYTYPE_UNIFIED = 0x04
12209    /// } CUmemorytype;
12210    /// ```
12211    ///
12212    /// * `srcXInBytes` and `srcY` specify the base address of the source data for the copy.
12213    ///
12214    /// If `srcMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_HOST`], `srcHost` and `srcPitch` specify the (host) base address of the source data and the bytes per row to apply. `srcArray` is ignored.
12215    ///
12216    /// If `srcMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_UNIFIED`], `srcDevice` and `srcPitch` specify the (unified virtual address space) base address of the source data and the bytes per row to apply. `srcArray` is ignored. This value may be used only if unified addressing is supported in the calling context.
12217    ///
12218    /// If `srcMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_DEVICE`], `srcDevice` and `srcPitch` specify the (device) base address of the source data and the bytes per row to apply. `srcArray` is ignored.
12219    ///
12220    /// If `srcMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_ARRAY`], `srcArray` specifies the handle of the source data. `srcHost`, `srcDevice` and `srcPitch` are ignored.
12221    ///
12222    /// If `dstMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_UNIFIED`], `dstDevice` and `dstPitch` specify the (unified virtual address space) base address of the source data and the bytes per row to apply. `dstArray` is ignored. This value may be used only if unified addressing is supported in the calling context.
12223    ///
12224    /// If `dstMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_HOST`], `dstHost` and `dstPitch` specify the (host) base address of the destination data and the bytes per row to apply. `dstArray` is ignored.
12225    ///
12226    /// If `dstMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_DEVICE`], `dstDevice` and `dstPitch` specify the (device) base address of the destination data and the bytes per row to apply. `dstArray` is ignored.
12227    ///
12228    /// If `dstMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_ARRAY`], `dstArray` specifies the handle of the destination data. `dstHost`, `dstDevice` and `dstPitch` are ignored.
12229    ///
12230    /// * `dstXInBytes` and `dstY` specify the base address of the destination data for the copy.
12231    ///
12232    /// For host pointers, the starting address is
12233    ///
12234    /// ```text
12235    /// void* Start = (void*)((char*)srcHost+srcY*srcPitch + srcXInBytes);
12236    /// ```
12237    ///
12238    /// For device pointers, the starting address is
12239    ///
12240    /// ```text
12241    /// CUdeviceptr Start = srcDevice+srcY*srcPitch+srcXInBytes;
12242    /// ```
12243    ///
12244    /// For CUDA arrays, `srcXInBytes` must be evenly divisible by the array element size.
12245    ///
12246    /// * `WidthInBytes` and `Height` specify the width (in bytes) and height of the 2D copy being performed.
12247    /// * If specified, `srcPitch` must be greater than or equal to `WidthInBytes` + `srcXInBytes`, and `dstPitch` must be greater than or equal to `WidthInBytes` + dstXInBytes.
12248    /// * If specified, `srcPitch` must be greater than or equal to `WidthInBytes` + `srcXInBytes`, and `dstPitch` must be greater than or equal to `WidthInBytes` + dstXInBytes.
12249    /// * If specified, `srcHeight` must be greater than or equal to `Height` + `srcY`, and `dstHeight` must be greater than or equal to `Height` + `dstY`.
12250    ///
12251    /// For host pointers, the base address is
12252    ///
12253    /// ```text
12254    /// void* dstStart = (void*)((char*)dstHost+dstY*dstPitch + dstXInBytes);
12255    /// ```
12256    ///
12257    /// For device pointers, the starting address is
12258    ///
12259    /// ```text
12260    /// CUdeviceptr dstStart = dstDevice+dstY*dstPitch+dstXInBytes;
12261    /// ```
12262    ///
12263    /// For CUDA arrays, `dstXInBytes` must be evenly divisible by the array element size.
12264    ///
12265    /// cuMemcpy2DAsync() returns an error if any pitch is greater than the maximum allowed ([`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAX_PITCH`]). cuMemAllocPitch() passes back pitches that always work with cuMemcpy2D(). On intra-device memory copies (device to device, CUDA array to device, CUDA array to CUDA array), cuMemcpy2DAsync() may fail for pitches not computed by cuMemAllocPitch().
12266    ///
12267    /// Note that this function may also return error codes from previous, asynchronous launches.
12268    ///
12269    /// Note: This function exhibits asynchronous behavior for most use cases.
12270    ///
12271    /// Note: This function uses standard default stream semantics.
12272    ///
12273    /// # Parameters
12274    ///
12275    /// - `pCopy`: Parameters for the memory copy.
12276    /// - `hStream`: Stream identifier.
12277    ///
12278    /// # Return value
12279    ///
12280    /// - [`CUresult::CUDA_SUCCESS`]
12281    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
12282    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
12283    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
12284    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
12285    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
12286    ///
12287    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32`], [`cuMemsetD2D32Async`], [`cuMemsetD8`], [`cuMemsetD8Async`], [`cuMemsetD16`], [`cuMemsetD16Async`], [`cuMemsetD32`], [`cuMemsetD32Async`], `cudaMemcpy2DAsync`, `cudaMemcpy2DToArrayAsync`, `cudaMemcpy2DFromArrayAsync`.
12288    pub fn cuMemcpy2DAsync_v2(
12289        pCopy: *const CUDA_MEMCPY2D,
12290        hStream: CUstream,
12291    ) -> CUresult;
12292}
12293singe_loader::functions! { crate::DRIVER;
12294    /// Copies memory for 3D arrays.
12295    ///
12296    /// Perform a 3D memory copy according to the parameters specified in `pCopy`. The CUDA_MEMCPY3D structure is defined as:
12297    ///
12298    /// ```text
12299    /// typedef struct CUDA_MEMCPY3D_st {
12300    ///
12301    /// unsigned int srcXInBytes, srcY, srcZ;
12302    /// unsigned int srcLOD;
12303    /// CUmemorytype srcMemoryType;
12304    /// const void *srcHost;
12305    /// CUdeviceptr srcDevice;
12306    /// CUarray srcArray;
12307    /// unsigned int srcPitch;  // ignored when src is array
12308    /// unsigned int srcHeight; // ignored when src is array; may be 0 if Depth==1
12309    ///
12310    /// unsigned int dstXInBytes, dstY, dstZ;
12311    /// unsigned int dstLOD;
12312    /// CUmemorytype dstMemoryType;
12313    /// void *dstHost;
12314    /// CUdeviceptr dstDevice;
12315    /// CUarray dstArray;
12316    /// unsigned int dstPitch;  // ignored when dst is array
12317    /// unsigned int dstHeight; // ignored when dst is array; may be 0 if Depth==1
12318    ///
12319    /// unsigned int WidthInBytes;
12320    /// unsigned int Height;
12321    /// unsigned int Depth;
12322    /// } CUDA_MEMCPY3D;
12323    /// ```
12324    ///
12325    /// where:
12326    ///
12327    /// * `srcMemoryType` and `dstMemoryType` specify the type of memory of the source and destination, respectively; [`CUmemorytype_enum`] is defined as:
12328    ///
12329    /// ```text
12330    /// typedef enum CUmemorytype_enum {
12331    ///    CU_MEMORYTYPE_HOST = 0x01,
12332    ///    CU_MEMORYTYPE_DEVICE = 0x02,
12333    ///    CU_MEMORYTYPE_ARRAY = 0x03,
12334    ///    CU_MEMORYTYPE_UNIFIED = 0x04
12335    /// } CUmemorytype;
12336    /// ```
12337    ///
12338    /// * `srcXInBytes`, `srcY` and `srcZ` specify the base address of the source data for the copy.
12339    ///
12340    /// If `srcMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_UNIFIED`], `srcDevice` and `srcPitch` specify the (unified virtual address space) base address of the source data and the bytes per row to apply. `srcArray` is ignored. This value may be used only if unified addressing is supported in the calling context.
12341    ///
12342    /// If `srcMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_HOST`], `srcHost`, `srcPitch` and `srcHeight` specify the (host) base address of the source data, the bytes per row, and the height of each 2D slice of the 3D array. `srcArray` is ignored.
12343    ///
12344    /// If `srcMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_DEVICE`], `srcDevice`, `srcPitch` and `srcHeight` specify the (device) base address of the source data, the bytes per row, and the height of each 2D slice of the 3D array. `srcArray` is ignored.
12345    ///
12346    /// If `srcMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_ARRAY`], `srcArray` specifies the handle of the source data. `srcHost`, `srcDevice`, `srcPitch` and `srcHeight` are ignored.
12347    ///
12348    /// If `dstMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_UNIFIED`], `dstDevice` and `dstPitch` specify the (unified virtual address space) base address of the source data and the bytes per row to apply. `dstArray` is ignored. This value may be used only if unified addressing is supported in the calling context.
12349    ///
12350    /// If `dstMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_HOST`], `dstHost` and `dstPitch` specify the (host) base address of the destination data, the bytes per row, and the height of each 2D slice of the 3D array. `dstArray` is ignored.
12351    ///
12352    /// If `dstMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_DEVICE`], `dstDevice` and `dstPitch` specify the (device) base address of the destination data, the bytes per row, and the height of each 2D slice of the 3D array. `dstArray` is ignored.
12353    ///
12354    /// If `dstMemoryType` is [`CUmemorytype_enum::CU_MEMORYTYPE_ARRAY`], `dstArray` specifies the handle of the destination data. `dstHost`, `dstDevice`, `dstPitch` and `dstHeight` are ignored.
12355    ///
12356    /// * dstXInBytes, `dstY` and `dstZ` specify the base address of the destination data for the copy.
12357    ///
12358    /// For host pointers, the starting address is
12359    ///
12360    /// ```text
12361    /// void* Start = (void*)((char*)srcHost+(srcZ*srcHeight+srcY)*srcPitch + srcXInBytes);
12362    /// ```
12363    ///
12364    /// For device pointers, the starting address is
12365    ///
12366    /// ```text
12367    /// CUdeviceptr Start = srcDevice+(srcZ*srcHeight+srcY)*srcPitch+srcXInBytes;
12368    /// ```
12369    ///
12370    /// For CUDA arrays, `srcXInBytes` must be evenly divisible by the array element size.
12371    ///
12372    /// * `WidthInBytes`, `Height` and `Depth` specify the width (in bytes), height and depth of the 3D copy being performed.
12373    /// * If specified, `srcPitch` must be greater than or equal to `WidthInBytes` + `srcXInBytes`, and `dstPitch` must be greater than or equal to `WidthInBytes` + dstXInBytes.
12374    /// * If specified, `srcHeight` must be greater than or equal to `Height` + `srcY`, and `dstHeight` must be greater than or equal to `Height` + `dstY`.
12375    ///
12376    /// For host pointers, the base address is
12377    ///
12378    /// ```text
12379    /// void* dstStart = (void*)((char*)dstHost+(dstZ*dstHeight+dstY)*dstPitch + dstXInBytes);
12380    /// ```
12381    ///
12382    /// For device pointers, the starting address is
12383    ///
12384    /// ```text
12385    /// CUdeviceptr dstStart = dstDevice+(dstZ*dstHeight+dstY)*dstPitch+dstXInBytes;
12386    /// ```
12387    ///
12388    /// For CUDA arrays, `dstXInBytes` must be evenly divisible by the array element size.
12389    ///
12390    /// The `srcLOD` and `dstLOD` members of the CUDA_MEMCPY3D structure must be set to 0.
12391    ///
12392    /// cuMemcpy3DAsync() returns an error if any pitch is greater than the maximum allowed ([`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAX_PITCH`]).
12393    ///
12394    /// Note that this function may also return error codes from previous, asynchronous launches.
12395    ///
12396    /// Note: This function exhibits asynchronous behavior for most use cases.
12397    ///
12398    /// Note: This function uses standard default stream semantics.
12399    ///
12400    /// # Parameters
12401    ///
12402    /// - `pCopy`: Parameters for the memory copy.
12403    /// - `hStream`: Stream identifier.
12404    ///
12405    /// # Return value
12406    ///
12407    /// - [`CUresult::CUDA_SUCCESS`]
12408    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
12409    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
12410    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
12411    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
12412    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
12413    ///
12414    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32`], [`cuMemsetD2D32Async`], [`cuMemsetD8`], [`cuMemsetD8Async`], [`cuMemsetD16`], [`cuMemsetD16Async`], [`cuMemsetD32`], [`cuMemsetD32Async`], `cudaMemcpy3DAsync`.
12415    pub fn cuMemcpy3DAsync_v2(
12416        pCopy: *const CUDA_MEMCPY3D,
12417        hStream: CUstream,
12418    ) -> CUresult;
12419}
12420singe_loader::functions! { crate::DRIVER;
12421    /// Copies memory between contexts asynchronously.
12422    ///
12423    /// Perform a 3D memory copy according to the parameters specified in `pCopy`. See the definition of the CUDA_MEMCPY3D_PEER structure for documentation of its parameters.
12424    ///
12425    /// Note that this function may also return error codes from previous, asynchronous launches.
12426    ///
12427    /// Note: This function exhibits asynchronous behavior for most use cases.
12428    ///
12429    /// Note: This function uses standard default stream semantics.
12430    ///
12431    /// # Parameters
12432    ///
12433    /// - `pCopy`: Parameters for the memory copy.
12434    /// - `hStream`: Stream identifier.
12435    ///
12436    /// # Return value
12437    ///
12438    /// - [`CUresult::CUDA_SUCCESS`]
12439    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
12440    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
12441    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
12442    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
12443    ///
12444    /// See also: [`cuMemcpyDtoD`], [`cuMemcpyPeer`], [`cuMemcpyDtoDAsync`], [`cuMemcpyPeerAsync`], `cudaMemcpy3DPeerAsync`.
12445    pub fn cuMemcpy3DPeerAsync(
12446        pCopy: *const CUDA_MEMCPY3D_PEER,
12447        hStream: CUstream,
12448    ) -> CUresult;
12449}
12450singe_loader::functions! { crate::DRIVER;
12451    /// Performs a batch of memory copies asynchronously.
12452    ///
12453    /// Performs a batch of memory copies. The batch as a whole executes in stream order but copies within a batch are not guaranteed to execute in any specific order. This API only supports pointer-to-pointer copies. For copies involving CUDA arrays, please see cuMemcpy3DBatchAsync.
12454    ///
12455    /// Performs memory copies from source buffers specified in `srcs` to destination buffers specified in `dsts`. The size of each copy is specified in `sizes`. All three arrays must be of the same length as specified by `count`. Since there are no ordering guarantees for copies within a batch, specifying any dependent copies within a batch will result in undefined behavior.
12456    ///
12457    /// Every copy in the batch has to be associated with a set of attributes specified in the `attrs` array. Each entry in this array can apply to more than one copy. This can be done by specifying in the `attrsIdxs` array, the index of the first copy that the corresponding entry in the `attrs` array applies to. Both `attrs` and `attrsIdxs` must be of the same length as specified by `numAttrs`. For example, if a batch has 10 copies listed in dst/src/sizes, the first 6 of which have one set of attributes and the remaining 4 another, then `numAttrs` will be 2, `attrsIdxs` will be {0, 6} and `attrs` will contains the two sets of attributes. Note that the first entry in `attrsIdxs` must always be 0. Also, each entry must be greater than the previous entry and the last entry should be less than `count`. Furthermore, `numAttrs` must be lesser than or equal to `count`.
12458    ///
12459    /// The [`CUmemcpyAttributes::srcAccessOrder`](CUmemcpyAttributes_st::srcAccessOrder) indicates the source access ordering to be observed for copies associated with the attribute. If the source access order is set to [`CUmemcpySrcAccessOrder_enum::CU_MEMCPY_SRC_ACCESS_ORDER_STREAM`], then the source will be accessed in stream order. If the source access order is set to [`CUmemcpySrcAccessOrder_enum::CU_MEMCPY_SRC_ACCESS_ORDER_DURING_API_CALL`] then it indicates that access to the source pointer can be out of stream order and all accesses must be complete before the API call returns. This flag is suited for ephemeral sources (ex., stack variables) when it’s known that no prior operations in the stream can be accessing the memory and also that the lifetime of the memory is limited to the scope that the source variable was declared in. Specifying this flag allows the driver to optimize the copy and removes the need for the user to synchronize the stream after the API call. If the source access order is set to [`CUmemcpySrcAccessOrder_enum::CU_MEMCPY_SRC_ACCESS_ORDER_ANY`] then it indicates that access to the source pointer can be out of stream order and the accesses can happen even after the API call returns. This flag is suited for host pointers allocated outside CUDA (ex., via malloc) when it’s known that no prior operations in the stream can be accessing the memory. Specifying this flag allows the driver to optimize the copy on certain platforms. Each memcpy operation in the batch must have a valid CUmemcpyAttributes corresponding to it including the appropriate srcAccessOrder setting, otherwise the API will return [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`].
12460    ///
12461    /// The [`CUmemcpyAttributes::srcLocHint`](CUmemcpyAttributes_st::srcLocHint) and [`CUmemcpyAttributes::dstLocHint`](CUmemcpyAttributes_st::dstLocHint) allows applications to specify hint locations for operands of a copy when the operand doesn’t have a fixed location. That is, these hints are only applicable for managed memory pointers on devices where [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`] is true or system-allocated pageable memory on devices where [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`] is true. For other cases, these hints are ignored.
12462    ///
12463    /// The [`CUmemcpyAttributes::flags`](CUmemcpyAttributes_st::flags) field can be used to specify certain flags for copies. Setting the [`CUmemcpyFlags_enum::CU_MEMCPY_FLAG_PREFER_OVERLAP_WITH_COMPUTE`] flag indicates that the associated copies should preferably overlap with any compute work. Note that this flag is a hint and can be ignored depending on the platform and other parameters of the copy.
12464    ///
12465    /// Note that this function may also return error codes from previous, asynchronous launches.
12466    ///
12467    /// Note: This function exhibits asynchronous behavior for most use cases.
12468    ///
12469    /// Note: Memory regions requested must be either entirely registered with CUDA, or in the case of host pageable transfers, not registered at all. Memory regions spanning over allocations that are both registered and not registered with CUDA are not supported and will return [`CUresult::CUDA_ERROR_INVALID_VALUE`].
12470    ///
12471    /// # Parameters
12472    ///
12473    /// - `dsts`: Array of destination pointers.
12474    /// - `srcs`: Array of memcpy source pointers.
12475    /// - `sizes`: Array of sizes for memcpy operations.
12476    /// - `count`: Size of `dsts`, `srcs` and `sizes` arrays.
12477    /// - `attrs`: Array of memcpy attributes.
12478    /// - `attrsIdxs`: Array of indices to specify which copies each entry in the `attrs` array applies to. The attributes specified in attrs\[k\] will be applied to copies starting from attrsIdxs\[k\] through attrsIdxs\[k+1\] - 1. Also attrs\[numAttrs-1\] will apply to copies starting from attrsIdxs\[numAttrs-1\] through count - 1.
12479    /// - `numAttrs`: Size of `attrs` and `attrsIdxs` arrays.
12480    /// - `hStream`: The stream to enqueue the operations in. Must not be legacy NULL stream.
12481    ///
12482    /// # Return value
12483    ///
12484    /// - [`CUresult::CUDA_SUCCESS`]
12485    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
12486    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
12487    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
12488    pub fn cuMemcpyBatchAsync_v2(
12489        dsts: *mut CUdeviceptr,
12490        srcs: *mut CUdeviceptr,
12491        sizes: *mut size_t,
12492        count: size_t,
12493        attrs: *mut CUmemcpyAttributes,
12494        attrsIdxs: *mut size_t,
12495        numAttrs: size_t,
12496        hStream: CUstream,
12497    ) -> CUresult;
12498}
12499singe_loader::functions! { crate::DRIVER;
12500    /// Performs a batch of 3D memory copies asynchronously.
12501    ///
12502    /// Performs a batch of memory copies. The batch as a whole executes in stream order but copies within a batch are not guaranteed to execute in any specific order. Note that this means specifying any dependent copies within a batch will result in undefined behavior.
12503    ///
12504    /// Performs memory copies as specified in the `opList` array. The length of this array is specified in `numOps`. Each entry in this array describes a copy operation. This includes among other things, the source and destination operands for the copy as specified in [`CUDA_MEMCPY3D_BATCH_OP::src`](CUDA_MEMCPY3D_BATCH_OP_st::src) and [`CUDA_MEMCPY3D_BATCH_OP::dst`](CUDA_MEMCPY3D_BATCH_OP_st::dst) respectively. The source and destination operands of a copy can either be a pointer or a CUDA array. The width, height and depth of a copy is specified in [`CUDA_MEMCPY3D_BATCH_OP::extent`](CUDA_MEMCPY3D_BATCH_OP_st::extent). The width, height and depth of a copy are specified in elements and must not be zero. For pointer-to-pointer copies, the element size is considered to be 1. For pointer to CUDA array or vice versa copies, the element size is determined by the CUDA array. For CUDA array to CUDA array copies, the element size of the two CUDA arrays must match.
12505    ///
12506    /// For a given operand, if CUmemcpy3DOperand::type is specified as [`CUmemcpy3DOperandType_enum::CU_MEMCPY_OPERAND_TYPE_POINTER`], then CUmemcpy3DOperand::op::ptr will be used. The CUmemcpy3DOperand::op::ptr::ptr field must contain the pointer where the copy should begin. The [CUmemcpy3DOperand::op::ptr::rowLength](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemcpy3DOperand__v1.html#structcumemcpy3doperand__v1_1a8b6779a38997b27fa345edf3b06a58d6) field specifies the length of each row in elements and must either be zero or be greater than or equal to the width of the copy specified in `CUDA_MEMCPY3D_BATCH_OP::extent::width`. The [CUmemcpy3DOperand::op::ptr::layerHeight](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemcpy3DOperand__v1.html#structcumemcpy3doperand__v1_1af983e627aecdb2a8ee5d46e70d3e8b16) field specifies the height of each layer and must either be zero or be greater than or equal to the height of the copy specified in `CUDA_MEMCPY3D_BATCH_OP::extent::height`. When either of these values is zero, that aspect of the operand is considered to be tightly packed according to the copy extent. For managed memory pointers on devices where [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`] is true or system-allocated pageable memory on devices where [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`] is true, the [CUmemcpy3DOperand::op::ptr::locHint](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemcpy3DOperand__v1.html#structcumemcpy3doperand__v1_1ab83be9ffd6cd48c3244f398679cc2ef2) field can be used to hint the location of the operand.
12507    ///
12508    /// If an operand’s type is specified as [`CUmemcpy3DOperandType_enum::CU_MEMCPY_OPERAND_TYPE_ARRAY`], then [CUmemcpy3DOperand::op::array](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemcpy3DOperand__v1.html#structcumemcpy3doperand__v1_1a79a47cd2e104f04efe9bd874ecd563d6) will be used. The [CUmemcpy3DOperand::op::array::array](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemcpy3DOperand__v1.html#structcumemcpy3doperand__v1_1a79a47cd2e104f04efe9bd874ecd563d6) field specifies the CUDA array and [CUmemcpy3DOperand::op::array::offset](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemcpy3DOperand__v1.html#structcumemcpy3doperand__v1_1ae9468cc71fc28317e1d4a9a5a57faf72) specifies the 3D offset into that array where the copy begins.
12509    ///
12510    /// The [`CUmemcpyAttributes::srcAccessOrder`](CUmemcpyAttributes_st::srcAccessOrder) indicates the source access ordering to be observed for copies associated with the attribute. If the source access order is set to [`CUmemcpySrcAccessOrder_enum::CU_MEMCPY_SRC_ACCESS_ORDER_STREAM`], then the source will be accessed in stream order. If the source access order is set to [`CUmemcpySrcAccessOrder_enum::CU_MEMCPY_SRC_ACCESS_ORDER_DURING_API_CALL`] then it indicates that access to the source pointer can be out of stream order and all accesses must be complete before the API call returns. This flag is suited for ephemeral sources (ex., stack variables) when it’s known that no prior operations in the stream can be accessing the memory and also that the lifetime of the memory is limited to the scope that the source variable was declared in. Specifying this flag allows the driver to optimize the copy and removes the need for the user to synchronize the stream after the API call. If the source access order is set to [`CUmemcpySrcAccessOrder_enum::CU_MEMCPY_SRC_ACCESS_ORDER_ANY`] then it indicates that access to the source pointer can be out of stream order and the accesses can happen even after the API call returns. This flag is suited for host pointers allocated outside CUDA (ex., via malloc) when it’s known that no prior operations in the stream can be accessing the memory. Specifying this flag allows the driver to optimize the copy on certain platforms. Each memcopy operation in `opList` must have a valid srcAccessOrder setting, otherwise this API will return [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`].
12511    ///
12512    /// The [`CUmemcpyAttributes::flags`](CUmemcpyAttributes_st::flags) field can be used to specify certain flags for copies. Setting the [`CUmemcpyFlags_enum::CU_MEMCPY_FLAG_PREFER_OVERLAP_WITH_COMPUTE`] flag indicates that the associated copies should preferably overlap with any compute work. Note that this flag is a hint and can be ignored depending on the platform and other parameters of the copy.
12513    ///
12514    /// Note that this function may also return error codes from previous, asynchronous launches.
12515    ///
12516    /// Note: This function exhibits asynchronous behavior for most use cases.
12517    ///
12518    /// Note: Memory regions requested must be either entirely registered with CUDA, or in the case of host pageable transfers, not registered at all. Memory regions spanning over allocations that are both registered and not registered with CUDA are not supported and will return [`CUresult::CUDA_ERROR_INVALID_VALUE`].
12519    ///
12520    /// # Parameters
12521    ///
12522    /// - `numOps`: Total number of memcpy operations.
12523    /// - `opList`: Array of size `numOps` containing the actual memcpy operations.
12524    /// - `flags`: Flags for future use, must be zero now.
12525    /// - `hStream`: The stream to enqueue the operations in. Must not be default NULL stream.
12526    ///
12527    /// # Return value
12528    ///
12529    /// - [`CUresult::CUDA_SUCCESS`]
12530    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
12531    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
12532    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
12533    pub fn cuMemcpy3DBatchAsync_v2(
12534        numOps: size_t,
12535        opList: *mut CUDA_MEMCPY3D_BATCH_OP,
12536        flags: ::core::ffi::c_ulonglong,
12537        hStream: CUstream,
12538    ) -> CUresult;
12539}
12540singe_loader::functions! { crate::DRIVER;
12541    /// Performs asynchronous memory copy operation with the specified attributes.
12542    ///
12543    /// Performs asynchronous memory copy operation where `dst` and `src` are the destination and source pointers respectively. `size` specifies the number of bytes to copy. `attr` specifies the attributes for the copy and `hStream` specifies the stream to enqueue the operation in.
12544    ///
12545    /// For more information regarding the attributes, please refer to CUmemcpyAttributes and it’s usage desciption in::cuMemcpyBatchAsync.
12546    ///
12547    /// Note that this function may also return error codes from previous, asynchronous launches.
12548    ///
12549    /// Note: This function exhibits asynchronous behavior for most use cases.
12550    ///
12551    /// Note: Memory regions requested must be either entirely registered with CUDA, or in the case of host pageable transfers, not registered at all. Memory regions spanning over allocations that are both registered and not registered with CUDA are not supported and will return [`CUresult::CUDA_ERROR_INVALID_VALUE`].
12552    ///
12553    /// # Parameters
12554    ///
12555    /// - `dst`: Destination device pointer.
12556    /// - `src`: Source device pointer.
12557    /// - `size`: Number of bytes to copy.
12558    /// - `attr`: Attributes for the copy.
12559    /// - `hStream`: Stream to enqueue the operation in.
12560    ///
12561    /// # Return value
12562    ///
12563    /// - [`CUresult::CUDA_SUCCESS`]
12564    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
12565    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
12566    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
12567    ///
12568    /// See also: [`cuMemcpyBatchAsync`].
12569    pub fn cuMemcpyWithAttributesAsync(
12570        dst: CUdeviceptr,
12571        src: CUdeviceptr,
12572        size: size_t,
12573        attr: *mut CUmemcpyAttributes,
12574        hStream: CUstream,
12575    ) -> CUresult;
12576}
12577singe_loader::functions! { crate::DRIVER;
12578    /// Performs 3D memory copy with attributes asynchronously.
12579    ///
12580    /// Performs the copy operation specified in `op`. `flags` specifies the flags for the copy and `hStream` specifies the stream to enqueue the operation in.
12581    ///
12582    /// For more information regarding the operation, please refer to CUDA_MEMCPY3D_BATCH_OP and it’s usage desciption in::cuMemcpy3DBatchAsync.
12583    ///
12584    /// Note that this function may also return error codes from previous, asynchronous launches.
12585    ///
12586    /// Note: This function exhibits asynchronous behavior for most use cases.
12587    ///
12588    /// Note: Memory regions requested must be either entirely registered with CUDA, or in the case of host pageable transfers, not registered at all. Memory regions spanning over allocations that are both registered and not registered with CUDA are not supported and will return [`CUresult::CUDA_ERROR_INVALID_VALUE`].
12589    ///
12590    /// # Parameters
12591    ///
12592    /// - `op`: Operation to perform.
12593    /// - `flags`: Flags for the copy, must be zero now.
12594    /// - `hStream`: Stream to enqueue the operation in.
12595    ///
12596    /// # Return value
12597    ///
12598    /// - [`CUresult::CUDA_SUCCESS`]
12599    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
12600    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
12601    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
12602    ///
12603    /// See also: [`cuMemcpy3DBatchAsync`].
12604    pub fn cuMemcpy3DWithAttributesAsync(
12605        op: *mut CUDA_MEMCPY3D_BATCH_OP,
12606        flags: ::core::ffi::c_ulonglong,
12607        hStream: CUstream,
12608    ) -> CUresult;
12609}
12610singe_loader::functions! { crate::DRIVER;
12611    /// Initializes device memory.
12612    ///
12613    /// Sets the memory range of `N` 8-bit values to the specified value `uc`.
12614    ///
12615    /// Note that this function may also return error codes from previous, asynchronous launches.
12616    ///
12617    /// Note: See also memset synchronization details.
12618    ///
12619    /// # Parameters
12620    ///
12621    /// - `dstDevice`: Destination device pointer.
12622    /// - `uc`: Value to set.
12623    /// - `N`: Number of elements.
12624    ///
12625    /// # Return value
12626    ///
12627    /// - [`CUresult::CUDA_SUCCESS`]
12628    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
12629    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
12630    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
12631    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
12632    ///
12633    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32`], [`cuMemsetD2D32Async`], [`cuMemsetD8Async`], [`cuMemsetD16`], [`cuMemsetD16Async`], [`cuMemsetD32`], [`cuMemsetD32Async`], `cudaMemset`.
12634    pub fn cuMemsetD8_v2(
12635        dstDevice: CUdeviceptr,
12636        uc: ::core::ffi::c_uchar,
12637        N: size_t,
12638    ) -> CUresult;
12639}
12640singe_loader::functions! { crate::DRIVER;
12641    /// Initializes device memory.
12642    ///
12643    /// Sets the memory range of `N` 16-bit values to the specified value `us`. The `dstDevice` pointer must be two byte aligned.
12644    ///
12645    /// Note that this function may also return error codes from previous, asynchronous launches.
12646    ///
12647    /// Note: See also memset synchronization details.
12648    ///
12649    /// # Parameters
12650    ///
12651    /// - `dstDevice`: Destination device pointer.
12652    /// - `us`: Value to set.
12653    /// - `N`: Number of elements.
12654    ///
12655    /// # Return value
12656    ///
12657    /// - [`CUresult::CUDA_SUCCESS`]
12658    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
12659    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
12660    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
12661    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
12662    ///
12663    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32`], [`cuMemsetD2D32Async`], [`cuMemsetD8`], [`cuMemsetD8Async`], [`cuMemsetD16Async`], [`cuMemsetD32`], [`cuMemsetD32Async`], `cudaMemset`.
12664    pub fn cuMemsetD16_v2(
12665        dstDevice: CUdeviceptr,
12666        us: ::core::ffi::c_ushort,
12667        N: size_t,
12668    ) -> CUresult;
12669}
12670singe_loader::functions! { crate::DRIVER;
12671    /// Initializes device memory.
12672    ///
12673    /// Sets the memory range of `N` 32-bit values to the specified value `ui`. The `dstDevice` pointer must be four byte aligned.
12674    ///
12675    /// Note that this function may also return error codes from previous, asynchronous launches.
12676    ///
12677    /// Note: See also memset synchronization details.
12678    ///
12679    /// # Parameters
12680    ///
12681    /// - `dstDevice`: Destination device pointer.
12682    /// - `ui`: Value to set.
12683    /// - `N`: Number of elements.
12684    ///
12685    /// # Return value
12686    ///
12687    /// - [`CUresult::CUDA_SUCCESS`]
12688    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
12689    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
12690    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
12691    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
12692    ///
12693    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32`], [`cuMemsetD2D32Async`], [`cuMemsetD8`], [`cuMemsetD8Async`], [`cuMemsetD16`], [`cuMemsetD16Async`], [`cuMemsetD32Async`], `cudaMemset`.
12694    pub fn cuMemsetD32_v2(
12695        dstDevice: CUdeviceptr,
12696        ui: ::core::ffi::c_uint,
12697        N: size_t,
12698    ) -> CUresult;
12699}
12700singe_loader::functions! { crate::DRIVER;
12701    /// Initializes device memory.
12702    ///
12703    /// Sets the 2D memory range of `Width` 8-bit values to the specified value `uc`. `Height` specifies the number of rows to set, and `dstPitch` specifies the number of bytes between each row. This function performs fastest when the pitch is one that has been passed back by cuMemAllocPitch().
12704    ///
12705    /// Note that this function may also return error codes from previous, asynchronous launches.
12706    ///
12707    /// Note: See also memset synchronization details.
12708    ///
12709    /// # Parameters
12710    ///
12711    /// - `dstDevice`: Destination device pointer.
12712    /// - `dstPitch`: Pitch of destination device pointer(Unused if `Height` is 1).
12713    /// - `uc`: Value to set.
12714    /// - `Width`: Width of row.
12715    /// - `Height`: Number of rows.
12716    ///
12717    /// # Return value
12718    ///
12719    /// - [`CUresult::CUDA_SUCCESS`]
12720    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
12721    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
12722    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
12723    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
12724    ///
12725    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32`], [`cuMemsetD2D32Async`], [`cuMemsetD8`], [`cuMemsetD8Async`], [`cuMemsetD16`], [`cuMemsetD16Async`], [`cuMemsetD32`], [`cuMemsetD32Async`], `cudaMemset2D`.
12726    pub fn cuMemsetD2D8_v2(
12727        dstDevice: CUdeviceptr,
12728        dstPitch: size_t,
12729        uc: ::core::ffi::c_uchar,
12730        Width: size_t,
12731        Height: size_t,
12732    ) -> CUresult;
12733}
12734singe_loader::functions! { crate::DRIVER;
12735    /// Initializes device memory.
12736    ///
12737    /// Sets the 2D memory range of `Width` 16-bit values to the specified value `us`. `Height` specifies the number of rows to set, and `dstPitch` specifies the number of bytes between each row. The `dstDevice` pointer and `dstPitch` offset must be two byte aligned. This function performs fastest when the pitch is one that has been passed back by cuMemAllocPitch().
12738    ///
12739    /// Note that this function may also return error codes from previous, asynchronous launches.
12740    ///
12741    /// Note: See also memset synchronization details.
12742    ///
12743    /// # Parameters
12744    ///
12745    /// - `dstDevice`: Destination device pointer.
12746    /// - `dstPitch`: Pitch of destination device pointer(Unused if `Height` is 1).
12747    /// - `us`: Value to set.
12748    /// - `Width`: Width of row.
12749    /// - `Height`: Number of rows.
12750    ///
12751    /// # Return value
12752    ///
12753    /// - [`CUresult::CUDA_SUCCESS`]
12754    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
12755    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
12756    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
12757    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
12758    ///
12759    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32`], [`cuMemsetD2D32Async`], [`cuMemsetD8`], [`cuMemsetD8Async`], [`cuMemsetD16`], [`cuMemsetD16Async`], [`cuMemsetD32`], [`cuMemsetD32Async`], `cudaMemset2D`.
12760    pub fn cuMemsetD2D16_v2(
12761        dstDevice: CUdeviceptr,
12762        dstPitch: size_t,
12763        us: ::core::ffi::c_ushort,
12764        Width: size_t,
12765        Height: size_t,
12766    ) -> CUresult;
12767}
12768singe_loader::functions! { crate::DRIVER;
12769    /// Initializes device memory.
12770    ///
12771    /// Sets the 2D memory range of `Width` 32-bit values to the specified value `ui`. `Height` specifies the number of rows to set, and `dstPitch` specifies the number of bytes between each row. The `dstDevice` pointer and `dstPitch` offset must be four byte aligned. This function performs fastest when the pitch is one that has been passed back by cuMemAllocPitch().
12772    ///
12773    /// Note that this function may also return error codes from previous, asynchronous launches.
12774    ///
12775    /// Note: See also memset synchronization details.
12776    ///
12777    /// # Parameters
12778    ///
12779    /// - `dstDevice`: Destination device pointer.
12780    /// - `dstPitch`: Pitch of destination device pointer(Unused if `Height` is 1).
12781    /// - `ui`: Value to set.
12782    /// - `Width`: Width of row.
12783    /// - `Height`: Number of rows.
12784    ///
12785    /// # Return value
12786    ///
12787    /// - [`CUresult::CUDA_SUCCESS`]
12788    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
12789    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
12790    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
12791    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
12792    ///
12793    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32Async`], [`cuMemsetD8`], [`cuMemsetD8Async`], [`cuMemsetD16`], [`cuMemsetD16Async`], [`cuMemsetD32`], [`cuMemsetD32Async`], `cudaMemset2D`.
12794    pub fn cuMemsetD2D32_v2(
12795        dstDevice: CUdeviceptr,
12796        dstPitch: size_t,
12797        ui: ::core::ffi::c_uint,
12798        Width: size_t,
12799        Height: size_t,
12800    ) -> CUresult;
12801}
12802singe_loader::functions! { crate::DRIVER;
12803    /// Sets device memory.
12804    ///
12805    /// Sets the memory range of `N` 8-bit values to the specified value `uc`.
12806    ///
12807    /// Note that this function may also return error codes from previous, asynchronous launches.
12808    ///
12809    /// Note: See also memset synchronization details.
12810    ///
12811    /// Note: This function uses standard default stream semantics.
12812    ///
12813    /// # Parameters
12814    ///
12815    /// - `dstDevice`: Destination device pointer.
12816    /// - `uc`: Value to set.
12817    /// - `N`: Number of elements.
12818    /// - `hStream`: Stream identifier.
12819    ///
12820    /// # Return value
12821    ///
12822    /// - [`CUresult::CUDA_SUCCESS`]
12823    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
12824    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
12825    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
12826    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
12827    ///
12828    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32`], [`cuMemsetD2D32Async`], [`cuMemsetD8`], [`cuMemsetD16`], [`cuMemsetD16Async`], [`cuMemsetD32`], [`cuMemsetD32Async`], `cudaMemsetAsync`.
12829    pub fn cuMemsetD8Async(
12830        dstDevice: CUdeviceptr,
12831        uc: ::core::ffi::c_uchar,
12832        N: size_t,
12833        hStream: CUstream,
12834    ) -> CUresult;
12835}
12836singe_loader::functions! { crate::DRIVER;
12837    /// Sets device memory.
12838    ///
12839    /// Sets the memory range of `N` 16-bit values to the specified value `us`. The `dstDevice` pointer must be two byte aligned.
12840    ///
12841    /// Note that this function may also return error codes from previous, asynchronous launches.
12842    ///
12843    /// Note: See also memset synchronization details.
12844    ///
12845    /// Note: This function uses standard default stream semantics.
12846    ///
12847    /// # Parameters
12848    ///
12849    /// - `dstDevice`: Destination device pointer.
12850    /// - `us`: Value to set.
12851    /// - `N`: Number of elements.
12852    /// - `hStream`: Stream identifier.
12853    ///
12854    /// # Return value
12855    ///
12856    /// - [`CUresult::CUDA_SUCCESS`]
12857    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
12858    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
12859    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
12860    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
12861    ///
12862    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32`], [`cuMemsetD2D32Async`], [`cuMemsetD8`], [`cuMemsetD8Async`], [`cuMemsetD16`], [`cuMemsetD32`], [`cuMemsetD32Async`], `cudaMemsetAsync`.
12863    pub fn cuMemsetD16Async(
12864        dstDevice: CUdeviceptr,
12865        us: ::core::ffi::c_ushort,
12866        N: size_t,
12867        hStream: CUstream,
12868    ) -> CUresult;
12869}
12870singe_loader::functions! { crate::DRIVER;
12871    /// Sets device memory.
12872    ///
12873    /// Sets the memory range of `N` 32-bit values to the specified value `ui`. The `dstDevice` pointer must be four byte aligned.
12874    ///
12875    /// Note that this function may also return error codes from previous, asynchronous launches.
12876    ///
12877    /// Note: See also memset synchronization details.
12878    ///
12879    /// Note: This function uses standard default stream semantics.
12880    ///
12881    /// # Parameters
12882    ///
12883    /// - `dstDevice`: Destination device pointer.
12884    /// - `ui`: Value to set.
12885    /// - `N`: Number of elements.
12886    /// - `hStream`: Stream identifier.
12887    ///
12888    /// # Return value
12889    ///
12890    /// - [`CUresult::CUDA_SUCCESS`]
12891    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
12892    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
12893    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
12894    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
12895    ///
12896    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32`], [`cuMemsetD2D32Async`], [`cuMemsetD8`], [`cuMemsetD8Async`], [`cuMemsetD16`], [`cuMemsetD16Async`], [`cuMemsetD32`], `cudaMemsetAsync`.
12897    pub fn cuMemsetD32Async(
12898        dstDevice: CUdeviceptr,
12899        ui: ::core::ffi::c_uint,
12900        N: size_t,
12901        hStream: CUstream,
12902    ) -> CUresult;
12903}
12904singe_loader::functions! { crate::DRIVER;
12905    /// Sets device memory.
12906    ///
12907    /// Sets the 2D memory range of `Width` 8-bit values to the specified value `uc`. `Height` specifies the number of rows to set, and `dstPitch` specifies the number of bytes between each row. This function performs fastest when the pitch is one that has been passed back by cuMemAllocPitch().
12908    ///
12909    /// Note that this function may also return error codes from previous, asynchronous launches.
12910    ///
12911    /// Note: See also memset synchronization details.
12912    ///
12913    /// Note: This function uses standard default stream semantics.
12914    ///
12915    /// # Parameters
12916    ///
12917    /// - `dstDevice`: Destination device pointer.
12918    /// - `dstPitch`: Pitch of destination device pointer(Unused if `Height` is 1).
12919    /// - `uc`: Value to set.
12920    /// - `Width`: Width of row.
12921    /// - `Height`: Number of rows.
12922    /// - `hStream`: Stream identifier.
12923    ///
12924    /// # Return value
12925    ///
12926    /// - [`CUresult::CUDA_SUCCESS`]
12927    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
12928    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
12929    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
12930    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
12931    ///
12932    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D16`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32`], [`cuMemsetD2D32Async`], [`cuMemsetD8`], [`cuMemsetD8Async`], [`cuMemsetD16`], [`cuMemsetD16Async`], [`cuMemsetD32`], [`cuMemsetD32Async`], `cudaMemset2DAsync`.
12933    pub fn cuMemsetD2D8Async(
12934        dstDevice: CUdeviceptr,
12935        dstPitch: size_t,
12936        uc: ::core::ffi::c_uchar,
12937        Width: size_t,
12938        Height: size_t,
12939        hStream: CUstream,
12940    ) -> CUresult;
12941}
12942singe_loader::functions! { crate::DRIVER;
12943    /// Sets device memory.
12944    ///
12945    /// Sets the 2D memory range of `Width` 16-bit values to the specified value `us`. `Height` specifies the number of rows to set, and `dstPitch` specifies the number of bytes between each row. The `dstDevice` pointer and `dstPitch` offset must be two byte aligned. This function performs fastest when the pitch is one that has been passed back by cuMemAllocPitch().
12946    ///
12947    /// Note that this function may also return error codes from previous, asynchronous launches.
12948    ///
12949    /// Note: See also memset synchronization details.
12950    ///
12951    /// Note: This function uses standard default stream semantics.
12952    ///
12953    /// # Parameters
12954    ///
12955    /// - `dstDevice`: Destination device pointer.
12956    /// - `dstPitch`: Pitch of destination device pointer(Unused if `Height` is 1).
12957    /// - `us`: Value to set.
12958    /// - `Width`: Width of row.
12959    /// - `Height`: Number of rows.
12960    /// - `hStream`: Stream identifier.
12961    ///
12962    /// # Return value
12963    ///
12964    /// - [`CUresult::CUDA_SUCCESS`]
12965    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
12966    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
12967    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
12968    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
12969    ///
12970    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16`], [`cuMemsetD2D32`], [`cuMemsetD2D32Async`], [`cuMemsetD8`], [`cuMemsetD8Async`], [`cuMemsetD16`], [`cuMemsetD16Async`], [`cuMemsetD32`], [`cuMemsetD32Async`], `cudaMemset2DAsync`.
12971    pub fn cuMemsetD2D16Async(
12972        dstDevice: CUdeviceptr,
12973        dstPitch: size_t,
12974        us: ::core::ffi::c_ushort,
12975        Width: size_t,
12976        Height: size_t,
12977        hStream: CUstream,
12978    ) -> CUresult;
12979}
12980singe_loader::functions! { crate::DRIVER;
12981    /// Sets device memory.
12982    ///
12983    /// Sets the 2D memory range of `Width` 32-bit values to the specified value `ui`. `Height` specifies the number of rows to set, and `dstPitch` specifies the number of bytes between each row. The `dstDevice` pointer and `dstPitch` offset must be four byte aligned. This function performs fastest when the pitch is one that has been passed back by cuMemAllocPitch().
12984    ///
12985    /// Note that this function may also return error codes from previous, asynchronous launches.
12986    ///
12987    /// Note: See also memset synchronization details.
12988    ///
12989    /// Note: This function uses standard default stream semantics.
12990    ///
12991    /// # Parameters
12992    ///
12993    /// - `dstDevice`: Destination device pointer.
12994    /// - `dstPitch`: Pitch of destination device pointer(Unused if `Height` is 1).
12995    /// - `ui`: Value to set.
12996    /// - `Width`: Width of row.
12997    /// - `Height`: Number of rows.
12998    /// - `hStream`: Stream identifier.
12999    ///
13000    /// # Return value
13001    ///
13002    /// - [`CUresult::CUDA_SUCCESS`]
13003    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
13004    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
13005    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
13006    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
13007    ///
13008    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32`], [`cuMemsetD8`], [`cuMemsetD8Async`], [`cuMemsetD16`], [`cuMemsetD16Async`], [`cuMemsetD32`], [`cuMemsetD32Async`], `cudaMemset2DAsync`.
13009    pub fn cuMemsetD2D32Async(
13010        dstDevice: CUdeviceptr,
13011        dstPitch: size_t,
13012        ui: ::core::ffi::c_uint,
13013        Width: size_t,
13014        Height: size_t,
13015        hStream: CUstream,
13016    ) -> CUresult;
13017}
13018singe_loader::functions! { crate::DRIVER;
13019    /// Creates a 1D or 2D CUDA array.
13020    ///
13021    /// Creates a CUDA array according to the CUDA_ARRAY_DESCRIPTOR structure `pAllocateArray` and returns a handle to the new CUDA array in `*pHandle`. The CUDA_ARRAY_DESCRIPTOR is defined as:
13022    ///
13023    /// ```text
13024    /// typedef struct {
13025    /// unsigned int Width;
13026    /// unsigned int Height;
13027    /// CUarray_format Format;
13028    /// unsigned int NumChannels;
13029    /// } CUDA_ARRAY_DESCRIPTOR;
13030    /// ```
13031    ///
13032    /// where:
13033    ///
13034    /// * `Width`, and `Height` are the width, and height of the CUDA array (in elements); the CUDA array is one-dimensional if height is 0, two-dimensional otherwise;
13035    /// * `Format` specifies the format of the elements; [`CUarray_format`] is defined as:
13036    ///
13037    /// ```text
13038    ///    typedef enum CUarray_format_enum {
13039    /// CU_AD_FORMAT_UNSIGNED_INT8 = 0x01,
13040    /// CU_AD_FORMAT_UNSIGNED_INT16 = 0x02,
13041    /// CU_AD_FORMAT_UNSIGNED_INT32 = 0x03,
13042    /// CU_AD_FORMAT_SIGNED_INT8 = 0x08,
13043    /// CU_AD_FORMAT_SIGNED_INT16 = 0x09,
13044    /// CU_AD_FORMAT_SIGNED_INT32 = 0x0a,
13045    /// CU_AD_FORMAT_HALF = 0x10,
13046    /// CU_AD_FORMAT_FLOAT = 0x20,
13047    /// CU_AD_FORMAT_NV12 = 0xb0,
13048    /// CU_AD_FORMAT_UNORM_INT8X1 = 0xc0,
13049    /// CU_AD_FORMAT_UNORM_INT8X2 = 0xc1,
13050    /// CU_AD_FORMAT_UNORM_INT8X4 = 0xc2,
13051    /// CU_AD_FORMAT_UNORM_INT16X1 = 0xc3,
13052    /// CU_AD_FORMAT_UNORM_INT16X2 = 0xc4,
13053    /// CU_AD_FORMAT_UNORM_INT16X4 = 0xc5,
13054    /// CU_AD_FORMAT_SNORM_INT8X1 = 0xc6,
13055    /// CU_AD_FORMAT_SNORM_INT8X2 = 0xc7,
13056    /// CU_AD_FORMAT_SNORM_INT8X4 = 0xc8,
13057    /// CU_AD_FORMAT_SNORM_INT16X1 = 0xc9,
13058    /// CU_AD_FORMAT_SNORM_INT16X2 = 0xca,
13059    /// CU_AD_FORMAT_SNORM_INT16X4 = 0xcb,
13060    /// CU_AD_FORMAT_BC1_UNORM = 0x91,
13061    /// CU_AD_FORMAT_BC1_UNORM_SRGB = 0x92,
13062    /// CU_AD_FORMAT_BC2_UNORM = 0x93,
13063    /// CU_AD_FORMAT_BC2_UNORM_SRGB = 0x94,
13064    /// CU_AD_FORMAT_BC3_UNORM = 0x95,
13065    /// CU_AD_FORMAT_BC3_UNORM_SRGB = 0x96,
13066    /// CU_AD_FORMAT_BC4_UNORM = 0x97,
13067    /// CU_AD_FORMAT_BC4_SNORM = 0x98,
13068    /// CU_AD_FORMAT_BC5_UNORM = 0x99,
13069    /// CU_AD_FORMAT_BC5_SNORM = 0x9a,
13070    /// CU_AD_FORMAT_BC6H_UF16 = 0x9b,
13071    /// CU_AD_FORMAT_BC6H_SF16 = 0x9c,
13072    /// CU_AD_FORMAT_BC7_UNORM = 0x9d,
13073    /// CU_AD_FORMAT_BC7_UNORM_SRGB = 0x9e,
13074    /// CU_AD_FORMAT_P010 = 0x9f,
13075    /// CU_AD_FORMAT_P016 = 0xa1,
13076    /// CU_AD_FORMAT_NV16 = 0xa2,
13077    /// CU_AD_FORMAT_P210 = 0xa3,
13078    /// CU_AD_FORMAT_P216 = 0xa4,
13079    /// CU_AD_FORMAT_YUY2 = 0xa5,
13080    /// CU_AD_FORMAT_Y210 = 0xa6,
13081    /// CU_AD_FORMAT_Y216 = 0xa7,
13082    /// CU_AD_FORMAT_AYUV = 0xa8,
13083    /// CU_AD_FORMAT_Y410 = 0xa9,
13084    /// CU_AD_FORMAT_Y416 = 0xb1,
13085    /// CU_AD_FORMAT_Y444_PLANAR8 = 0xb2,
13086    /// CU_AD_FORMAT_Y444_PLANAR10 = 0xb3,
13087    /// CU_AD_FORMAT_YUV444_8bit_SemiPlanar = 0xb4,
13088    /// CU_AD_FORMAT_YUV444_16bit_SemiPlanar = 0xb5,
13089    /// CU_AD_FORMAT_UNORM_INT_101010_2 = 0x50,
13090    /// CU_AD_FORMAT_UINT8_PACKED_422 = 0x51,
13091    /// CU_AD_FORMAT_UINT8_PACKED_444 = 0x52,
13092    /// CU_AD_FORMAT_UINT8_SEMIPLANAR_420 = 0x53,
13093    /// CU_AD_FORMAT_UINT16_SEMIPLANAR_420 = 0x54,
13094    /// CU_AD_FORMAT_UINT8_SEMIPLANAR_422 = 0x55,
13095    /// CU_AD_FORMAT_UINT16_SEMIPLANAR_422 = 0x56,
13096    /// CU_AD_FORMAT_UINT8_SEMIPLANAR_444 = 0x57,
13097    /// CU_AD_FORMAT_UINT16_SEMIPLANAR_444 = 0x58,
13098    /// CU_AD_FORMAT_UINT8_PLANAR_420 = 0x59,
13099    /// CU_AD_FORMAT_UINT16_PLANAR_420 = 0x5a,
13100    /// CU_AD_FORMAT_UINT8_PLANAR_422 = 0x5b,
13101    /// CU_AD_FORMAT_UINT16_PLANAR_422 = 0x5c,
13102    /// CU_AD_FORMAT_UINT8_PLANAR_444 = 0x5d,
13103    /// CU_AD_FORMAT_UINT16_PLANAR_444 = 0x5e,
13104    ///   } CUarray_format;
13105    /// ```
13106    /// * `NumChannels` specifies the number of packed components per CUDA array element; it may be 1, 2, or 4;
13107    ///
13108    /// Here are examples of CUDA array descriptions:
13109    ///
13110    /// Description for a CUDA array of 2048 floats:
13111    ///
13112    /// ```text
13113    /// CUDA_ARRAY_DESCRIPTOR desc;
13114    /// desc.Format = CU_AD_FORMAT_FLOAT;
13115    /// desc.NumChannels = 1;
13116    /// desc.Width = 2048;
13117    /// desc.Height = 1;
13118    /// ```
13119    ///
13120    /// Description for a 64 x 64 CUDA array of floats:
13121    ///
13122    /// ```text
13123    /// CUDA_ARRAY_DESCRIPTOR desc;
13124    /// desc.Format = CU_AD_FORMAT_FLOAT;
13125    /// desc.NumChannels = 1;
13126    /// desc.Width = 64;
13127    /// desc.Height = 64;
13128    /// ```
13129    ///
13130    /// Description for a `width` x `height` CUDA array of 64-bit, 4x16-bit float16’s:
13131    ///
13132    /// ```text
13133    /// CUDA_ARRAY_DESCRIPTOR desc;
13134    /// desc.Format = CU_AD_FORMAT_HALF;
13135    /// desc.NumChannels = 4;
13136    /// desc.Width = width;
13137    /// desc.Height = height;
13138    /// ```
13139    ///
13140    /// Description for a `width` x `height` CUDA array of 16-bit elements, each of which is two 8-bit unsigned chars:
13141    ///
13142    /// ```text
13143    /// CUDA_ARRAY_DESCRIPTOR arrayDesc;
13144    /// desc.Format = CU_AD_FORMAT_UNSIGNED_INT8;
13145    /// desc.NumChannels = 2;
13146    /// desc.Width = width;
13147    /// desc.Height = height;
13148    /// ```
13149    ///
13150    /// Note that this function may also return error codes from previous, asynchronous launches.
13151    ///
13152    /// # Parameters
13153    ///
13154    /// - `pHandle`: Returned array.
13155    /// - `pAllocateArray`: Array descriptor.
13156    ///
13157    /// # Return value
13158    ///
13159    /// - [`CUresult::CUDA_SUCCESS`]
13160    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
13161    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
13162    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
13163    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
13164    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
13165    /// - [`CUresult::CUDA_ERROR_UNKNOWN`]
13166    ///
13167    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D16`], [`cuMemsetD2D32`], [`cuMemsetD8`], [`cuMemsetD16`], [`cuMemsetD32`], `cudaMallocArray`.
13168    pub fn cuArrayCreate_v2(
13169        pHandle: *mut CUarray,
13170        pAllocateArray: *const CUDA_ARRAY_DESCRIPTOR,
13171    ) -> CUresult;
13172}
13173singe_loader::functions! { crate::DRIVER;
13174    /// Get a 1D or 2D CUDA array descriptor.
13175    ///
13176    /// Returns in `*pArrayDescriptor` a descriptor containing information on the format and dimensions of the CUDA array `hArray`. It is useful for subroutines that have been passed a CUDA array, but need to know the CUDA array parameters for validation or other purposes.
13177    ///
13178    /// Note that this function may also return error codes from previous, asynchronous launches.
13179    ///
13180    /// # Parameters
13181    ///
13182    /// - `pArrayDescriptor`: Returned array descriptor.
13183    /// - `hArray`: Array to get descriptor of.
13184    ///
13185    /// # Return value
13186    ///
13187    /// - [`CUresult::CUDA_SUCCESS`]
13188    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
13189    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
13190    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
13191    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
13192    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
13193    ///
13194    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D16`], [`cuMemsetD2D32`], [`cuMemsetD8`], [`cuMemsetD16`], [`cuMemsetD32`], `cudaArrayGetInfo`.
13195    pub fn cuArrayGetDescriptor_v2(
13196        pArrayDescriptor: *mut CUDA_ARRAY_DESCRIPTOR,
13197        hArray: CUarray,
13198    ) -> CUresult;
13199}
13200singe_loader::functions! { crate::DRIVER;
13201    /// Returns the layout properties of a sparse CUDA array.
13202    ///
13203    /// Returns the layout properties of a sparse CUDA array in `sparseProperties` If the CUDA array is not allocated with flag [`CUDA_ARRAY3D_SPARSE`] [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] will be returned.
13204    ///
13205    /// If the returned value in [`CUDA_ARRAY_SPARSE_PROPERTIES::flags`](CUDA_ARRAY_SPARSE_PROPERTIES_st::flags) contains [`CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL`], then [`CUDA_ARRAY_SPARSE_PROPERTIES::miptailSize`](CUDA_ARRAY_SPARSE_PROPERTIES_st::miptailSize) represents the total size of the array. Otherwise, it will be zero. Also, the returned value in [`CUDA_ARRAY_SPARSE_PROPERTIES::miptailFirstLevel`](CUDA_ARRAY_SPARSE_PROPERTIES_st::miptailFirstLevel) is always zero. Note that the `array` must have been allocated using cuArrayCreate or cuArray3DCreate. For CUDA arrays obtained using [`cuMipmappedArrayGetLevel`], [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] will be returned. Instead, [`cuMipmappedArrayGetSparseProperties`] must be used to obtain the sparse properties of the entire CUDA mipmapped array to which `array` belongs to.
13206    ///
13207    /// # Parameters
13208    ///
13209    /// - `sparseProperties`: Pointer to CUDA_ARRAY_SPARSE_PROPERTIES.
13210    /// - `array`: CUDA array to get the sparse properties of.
13211    ///
13212    /// # Return value
13213    ///
13214    /// - [`CUresult::CUDA_SUCCESS`]
13215    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
13216    ///
13217    /// See also: [`cuMipmappedArrayGetSparseProperties`], [`cuMemMapArrayAsync`].
13218    pub fn cuArrayGetSparseProperties(
13219        sparseProperties: *mut CUDA_ARRAY_SPARSE_PROPERTIES,
13220        array: CUarray,
13221    ) -> CUresult;
13222}
13223singe_loader::functions! { crate::DRIVER;
13224    /// Returns the layout properties of a sparse CUDA mipmapped array.
13225    ///
13226    /// Returns the sparse array layout properties in `sparseProperties` If the CUDA mipmapped array is not allocated with flag [`CUDA_ARRAY3D_SPARSE`] [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] will be returned.
13227    ///
13228    /// For non-layered CUDA mipmapped arrays, [`CUDA_ARRAY_SPARSE_PROPERTIES::miptailSize`](CUDA_ARRAY_SPARSE_PROPERTIES_st::miptailSize) returns the size of the mip tail region. The mip tail region includes all mip levels whose width, height or depth is less than that of the tile. For layered CUDA mipmapped arrays, if [`CUDA_ARRAY_SPARSE_PROPERTIES::flags`](CUDA_ARRAY_SPARSE_PROPERTIES_st::flags) contains [`CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL`], then [`CUDA_ARRAY_SPARSE_PROPERTIES::miptailSize`](CUDA_ARRAY_SPARSE_PROPERTIES_st::miptailSize) specifies the size of the mip tail of all layers combined. Otherwise, [`CUDA_ARRAY_SPARSE_PROPERTIES::miptailSize`](CUDA_ARRAY_SPARSE_PROPERTIES_st::miptailSize) specifies mip tail size per layer. The returned value of [`CUDA_ARRAY_SPARSE_PROPERTIES::miptailFirstLevel`](CUDA_ARRAY_SPARSE_PROPERTIES_st::miptailFirstLevel) is valid only if [`CUDA_ARRAY_SPARSE_PROPERTIES::miptailSize`](CUDA_ARRAY_SPARSE_PROPERTIES_st::miptailSize) is non-zero.
13229    ///
13230    /// # Parameters
13231    ///
13232    /// - `sparseProperties`: Pointer to CUDA_ARRAY_SPARSE_PROPERTIES.
13233    /// - `mipmap`: CUDA mipmapped array to get the sparse properties of.
13234    ///
13235    /// # Return value
13236    ///
13237    /// - [`CUresult::CUDA_SUCCESS`]
13238    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
13239    ///
13240    /// See also: [`cuArrayGetSparseProperties`], [`cuMemMapArrayAsync`].
13241    pub fn cuMipmappedArrayGetSparseProperties(
13242        sparseProperties: *mut CUDA_ARRAY_SPARSE_PROPERTIES,
13243        mipmap: CUmipmappedArray,
13244    ) -> CUresult;
13245}
13246singe_loader::functions! { crate::DRIVER;
13247    /// Returns the memory requirements of a CUDA array.
13248    ///
13249    /// Returns the memory requirements of a CUDA array in `memoryRequirements` If the CUDA array is not allocated with flag [`CUDA_ARRAY3D_DEFERRED_MAPPING`] [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] will be returned.
13250    ///
13251    /// The returned value in [`CUDA_ARRAY_MEMORY_REQUIREMENTS::size`](CUDA_ARRAY_MEMORY_REQUIREMENTS_st::size) represents the total size of the CUDA array. The returned value in [`CUDA_ARRAY_MEMORY_REQUIREMENTS::alignment`](CUDA_ARRAY_MEMORY_REQUIREMENTS_st::alignment) represents the alignment necessary for mapping the CUDA array.
13252    ///
13253    /// # Parameters
13254    ///
13255    /// - `memoryRequirements`: Pointer to CUDA_ARRAY_MEMORY_REQUIREMENTS.
13256    /// - `array`: CUDA array to get the memory requirements of.
13257    /// - `device`: Device to get the memory requirements for.
13258    ///
13259    /// # Return value
13260    ///
13261    /// - [`CUresult::CUDA_SUCCESS`]
13262    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
13263    ///
13264    /// See also: [`cuMipmappedArrayGetMemoryRequirements`], [`cuMemMapArrayAsync`].
13265    pub fn cuArrayGetMemoryRequirements(
13266        memoryRequirements: *mut CUDA_ARRAY_MEMORY_REQUIREMENTS,
13267        array: CUarray,
13268        device: CUdevice,
13269    ) -> CUresult;
13270}
13271singe_loader::functions! { crate::DRIVER;
13272    /// Returns the memory requirements of a CUDA mipmapped array.
13273    ///
13274    /// Returns the memory requirements of a CUDA mipmapped array in `memoryRequirements` If the CUDA mipmapped array is not allocated with flag [`CUDA_ARRAY3D_DEFERRED_MAPPING`] [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] will be returned.
13275    ///
13276    /// The returned value in [`CUDA_ARRAY_MEMORY_REQUIREMENTS::size`](CUDA_ARRAY_MEMORY_REQUIREMENTS_st::size) represents the total size of the CUDA mipmapped array. The returned value in [`CUDA_ARRAY_MEMORY_REQUIREMENTS::alignment`](CUDA_ARRAY_MEMORY_REQUIREMENTS_st::alignment)
13277    ///
13278    /// represents the alignment necessary for mapping the CUDA mipmapped
13279    ///
13280    /// array.
13281    ///
13282    /// # Parameters
13283    ///
13284    /// - `memoryRequirements`: Pointer to CUDA_ARRAY_MEMORY_REQUIREMENTS.
13285    /// - `mipmap`: CUDA mipmapped array to get the memory requirements of.
13286    /// - `device`: Device to get the memory requirements for.
13287    ///
13288    /// # Return value
13289    ///
13290    /// - [`CUresult::CUDA_SUCCESS`]
13291    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
13292    ///
13293    /// See also: [`cuArrayGetMemoryRequirements`], [`cuMemMapArrayAsync`].
13294    pub fn cuMipmappedArrayGetMemoryRequirements(
13295        memoryRequirements: *mut CUDA_ARRAY_MEMORY_REQUIREMENTS,
13296        mipmap: CUmipmappedArray,
13297        device: CUdevice,
13298    ) -> CUresult;
13299}
13300singe_loader::functions! { crate::DRIVER;
13301    /// Gets a CUDA array plane from a CUDA array.
13302    ///
13303    /// Returns in `pPlaneArray` a CUDA array that represents a single format plane of the CUDA array `hArray`.
13304    ///
13305    /// If `planeIdx` is greater than the maximum number of planes in this array or if the array does not have a multi-planar format e.g: [`CUarray_format_enum::CU_AD_FORMAT_NV12`], then [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned.
13306    ///
13307    /// Note that if the `hArray` has format [`CUarray_format_enum::CU_AD_FORMAT_NV12`], then passing in 0 for `planeIdx` returns a CUDA array of the same size as `hArray` but with one channel and [`CUarray_format_enum::CU_AD_FORMAT_UNSIGNED_INT8`] as its format. If 1 is passed for `planeIdx`, then the returned CUDA array has half the height and width of `hArray` with two channels and [`CUarray_format_enum::CU_AD_FORMAT_UNSIGNED_INT8`] as its format.
13308    ///
13309    /// Note that this function may also return error codes from previous, asynchronous launches.
13310    ///
13311    /// # Parameters
13312    ///
13313    /// - `pPlaneArray`: Returned CUDA array referenced by the `planeIdx`.
13314    /// - `hArray`: Multiplanar CUDA array.
13315    /// - `planeIdx`: Plane index.
13316    ///
13317    /// # Return value
13318    ///
13319    /// - [`CUresult::CUDA_SUCCESS`]
13320    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
13321    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
13322    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
13323    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
13324    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
13325    ///
13326    /// See also: [`cuArrayCreate`], `cudaArrayGetPlane`.
13327    pub fn cuArrayGetPlane(
13328        pPlaneArray: *mut CUarray,
13329        hArray: CUarray,
13330        planeIdx: ::core::ffi::c_uint,
13331    ) -> CUresult;
13332}
13333singe_loader::functions! { crate::DRIVER;
13334    /// Destroys a CUDA array.
13335    ///
13336    /// Destroys the CUDA array `hArray`.
13337    ///
13338    /// Note that this function may also return error codes from previous, asynchronous launches.
13339    ///
13340    /// # Parameters
13341    ///
13342    /// - `hArray`: Array to destroy
13343    ///
13344    /// # Return value
13345    ///
13346    /// - [`CUresult::CUDA_SUCCESS`]
13347    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
13348    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
13349    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
13350    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
13351    /// - [`CUresult::CUDA_ERROR_ARRAY_IS_MAPPED`]
13352    /// - [`CUresult::CUDA_ERROR_CONTEXT_IS_DESTROYED`]
13353    ///
13354    /// See also: [`cuArray3DCreate`], [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D16`], [`cuMemsetD2D32`], [`cuMemsetD8`], [`cuMemsetD16`], [`cuMemsetD32`], `cudaFreeArray`.
13355    pub fn cuArrayDestroy(hArray: CUarray) -> CUresult;
13356}
13357singe_loader::functions! { crate::DRIVER;
13358    /// Creates a 3D CUDA array.
13359    ///
13360    /// Creates a CUDA array according to the CUDA_ARRAY3D_DESCRIPTOR structure `pAllocateArray` and returns a handle to the new CUDA array in `*pHandle`. The CUDA_ARRAY3D_DESCRIPTOR is defined as:
13361    ///
13362    /// ```text
13363    /// typedef struct {
13364    /// unsigned int Width;
13365    /// unsigned int Height;
13366    /// unsigned int Depth;
13367    /// CUarray_format Format;
13368    /// unsigned int NumChannels;
13369    /// unsigned int Flags;
13370    /// } CUDA_ARRAY3D_DESCRIPTOR;
13371    /// ```
13372    ///
13373    /// where:
13374    ///
13375    /// * `Width`, `Height`, and `Depth` are the width, height, and depth of the CUDA array (in elements); the following types of CUDA arrays can be allocated:
13376    ///
13377    ///   + A 1D array is allocated if `Height` and `Depth` extents are both zero.
13378    ///   + A 2D array is allocated if only `Depth` extent is zero.
13379    ///   + A 3D array is allocated if all three extents are non-zero.
13380    ///   + A 1D layered CUDA array is allocated if only `Height` is zero and the [`CUDA_ARRAY3D_LAYERED`] flag is set. Each layer is a 1D array. The number of layers is determined by the depth extent.
13381    ///   + A 2D layered CUDA array is allocated if all three extents are non-zero and the [`CUDA_ARRAY3D_LAYERED`] flag is set. Each layer is a 2D array. The number of layers is determined by the depth extent.
13382    ///   + A cubemap CUDA array is allocated if all three extents are non-zero and the [`CUDA_ARRAY3D_CUBEMAP`] flag is set. `Width` must be equal to `Height`, and `Depth` must be six. A cubemap is a special type of 2D layered CUDA array, where the six layers represent the six faces of a cube. The order of the six layers in memory is the same as that listed in [`CUarray_cubemap_face`].
13383    ///   + A cubemap layered CUDA array is allocated if all three extents are non-zero, and both, [`CUDA_ARRAY3D_CUBEMAP`] and [`CUDA_ARRAY3D_LAYERED`] flags are set. `Width` must be equal to `Height`, and `Depth` must be a multiple of six. A cubemap layered CUDA array is a special type of 2D layered CUDA array that consists of a collection of cubemaps. The first six layers represent the first cubemap, the next six layers form the second cubemap, and so on.
13384    /// * `Format` specifies the format of the elements; [`CUarray_format`] is defined as:
13385    ///
13386    /// ```text
13387    ///   typedef enum CUarray_format_enum {
13388    /// CU_AD_FORMAT_UNSIGNED_INT8 = 0x01,
13389    /// CU_AD_FORMAT_UNSIGNED_INT16 = 0x02,
13390    /// CU_AD_FORMAT_UNSIGNED_INT32 = 0x03,
13391    /// CU_AD_FORMAT_SIGNED_INT8 = 0x08,
13392    /// CU_AD_FORMAT_SIGNED_INT16 = 0x09,
13393    /// CU_AD_FORMAT_SIGNED_INT32 = 0x0a,
13394    /// CU_AD_FORMAT_HALF = 0x10,
13395    /// CU_AD_FORMAT_FLOAT = 0x20,
13396    /// CU_AD_FORMAT_NV12 = 0xb0,
13397    /// CU_AD_FORMAT_UNORM_INT8X1 = 0xc0,
13398    /// CU_AD_FORMAT_UNORM_INT8X2 = 0xc1,
13399    /// CU_AD_FORMAT_UNORM_INT8X4 = 0xc2,
13400    /// CU_AD_FORMAT_UNORM_INT16X1 = 0xc3,
13401    /// CU_AD_FORMAT_UNORM_INT16X2 = 0xc4,
13402    /// CU_AD_FORMAT_UNORM_INT16X4 = 0xc5,
13403    /// CU_AD_FORMAT_SNORM_INT8X1 = 0xc6,
13404    /// CU_AD_FORMAT_SNORM_INT8X2 = 0xc7,
13405    /// CU_AD_FORMAT_SNORM_INT8X4 = 0xc8,
13406    /// CU_AD_FORMAT_SNORM_INT16X1 = 0xc9,
13407    /// CU_AD_FORMAT_SNORM_INT16X2 = 0xca,
13408    /// CU_AD_FORMAT_SNORM_INT16X4 = 0xcb,
13409    /// CU_AD_FORMAT_BC1_UNORM = 0x91,
13410    /// CU_AD_FORMAT_BC1_UNORM_SRGB = 0x92,
13411    /// CU_AD_FORMAT_BC2_UNORM = 0x93,
13412    /// CU_AD_FORMAT_BC2_UNORM_SRGB = 0x94,
13413    /// CU_AD_FORMAT_BC3_UNORM = 0x95,
13414    /// CU_AD_FORMAT_BC3_UNORM_SRGB = 0x96,
13415    /// CU_AD_FORMAT_BC4_UNORM = 0x97,
13416    /// CU_AD_FORMAT_BC4_SNORM = 0x98,
13417    /// CU_AD_FORMAT_BC5_UNORM = 0x99,
13418    /// CU_AD_FORMAT_BC5_SNORM = 0x9a,
13419    /// CU_AD_FORMAT_BC6H_UF16 = 0x9b,
13420    /// CU_AD_FORMAT_BC6H_SF16 = 0x9c,
13421    /// CU_AD_FORMAT_BC7_UNORM = 0x9d,
13422    /// CU_AD_FORMAT_BC7_UNORM_SRGB = 0x9e,
13423    /// CU_AD_FORMAT_P010 = 0x9f,
13424    /// CU_AD_FORMAT_P016 = 0xa1,
13425    /// CU_AD_FORMAT_NV16 = 0xa2,
13426    /// CU_AD_FORMAT_P210 = 0xa3,
13427    /// CU_AD_FORMAT_P216 = 0xa4,
13428    /// CU_AD_FORMAT_YUY2 = 0xa5,
13429    /// CU_AD_FORMAT_Y210 = 0xa6,
13430    /// CU_AD_FORMAT_Y216 = 0xa7,
13431    /// CU_AD_FORMAT_AYUV = 0xa8,
13432    /// CU_AD_FORMAT_Y410 = 0xa9,
13433    /// CU_AD_FORMAT_Y416 = 0xb1,
13434    /// CU_AD_FORMAT_Y444_PLANAR8 = 0xb2,
13435    /// CU_AD_FORMAT_Y444_PLANAR10 = 0xb3,
13436    /// CU_AD_FORMAT_YUV444_8bit_SemiPlanar = 0xb4,
13437    /// CU_AD_FORMAT_YUV444_16bit_SemiPlanar = 0xb5,
13438    /// CU_AD_FORMAT_UNORM_INT_101010_2 = 0x50,
13439    ///   } CUarray_format;
13440    /// ```
13441    /// * `NumChannels` specifies the number of packed components per CUDA array element; it may be 1, 2, or 4;
13442    /// * `Flags` may be set to
13443    ///
13444    ///   + [`CUDA_ARRAY3D_LAYERED`] to enable creation of layered CUDA arrays. If this flag is set, `Depth` specifies the number of layers, not the depth of a 3D array.
13445    ///   + [`CUDA_ARRAY3D_SURFACE_LDST`] to enable surface references to be bound to the CUDA array. If this flag is not set, [`cuSurfRefSetArray`] will fail when attempting to bind the CUDA array to a surface reference.
13446    ///   + [`CUDA_ARRAY3D_CUBEMAP`] to enable creation of cubemaps. If this flag is set, `Width` must be equal to `Height`, and `Depth` must be six. If the [`CUDA_ARRAY3D_LAYERED`] flag is also set, then `Depth` must be a multiple of six.
13447    ///   + [`CUDA_ARRAY3D_TEXTURE_GATHER`] to indicate that the CUDA array will be used for texture gather. Texture gather can only be performed on 2D CUDA arrays.
13448    ///
13449    /// `Width`, `Height` and `Depth` must meet certain size requirements as listed in the following table. All values are specified in elements. Note that for brevity’s sake, the full name of the device attribute is not specified. For ex., TEXTURE1D_WIDTH refers to the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH`].
13450    ///
13451    /// Note that 2D CUDA arrays have different size requirements if the [`CUDA_ARRAY3D_TEXTURE_GATHER`] flag is set. `Width` and `Height` must not be greater than [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH`] and [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT`] respectively, in that case.
13452    ///
13453    /// |  |  |  |
13454    /// | --- | --- | --- |
13455    /// | **CUDA array type** | **Valid extents that must always be met {(width range in elements), (height range), (depth range)}** | **Valid extents with CUDA_ARRAY3D_SURFACE_LDST set {(width range in elements), (height range), (depth range)}** |
13456    /// | 1D | { (1,TEXTURE1D_WIDTH), 0, 0 } | { (1,SURFACE1D_WIDTH), 0, 0 } |
13457    /// | 2D | { (1,TEXTURE2D_WIDTH), (1,TEXTURE2D_HEIGHT), 0 } | { (1,SURFACE2D_WIDTH), (1,SURFACE2D_HEIGHT), 0 } |
13458    /// | 3D | { (1,TEXTURE3D_WIDTH), (1,TEXTURE3D_HEIGHT), (1,TEXTURE3D_DEPTH) } OR { (1,TEXTURE3D_WIDTH_ALTERNATE), (1,TEXTURE3D_HEIGHT_ALTERNATE), (1,TEXTURE3D_DEPTH_ALTERNATE) } | { (1,SURFACE3D_WIDTH), (1,SURFACE3D_HEIGHT), (1,SURFACE3D_DEPTH) } |
13459    /// | 1D Layered | { (1,TEXTURE1D_LAYERED_WIDTH), 0, (1,TEXTURE1D_LAYERED_LAYERS) } | { (1,SURFACE1D_LAYERED_WIDTH), 0, (1,SURFACE1D_LAYERED_LAYERS) } |
13460    /// | 2D Layered | { (1,TEXTURE2D_LAYERED_WIDTH), (1,TEXTURE2D_LAYERED_HEIGHT), (1,TEXTURE2D_LAYERED_LAYERS) } | { (1,SURFACE2D_LAYERED_WIDTH), (1,SURFACE2D_LAYERED_HEIGHT), (1,SURFACE2D_LAYERED_LAYERS) } |
13461    /// | Cubemap | { (1,TEXTURECUBEMAP_WIDTH), (1,TEXTURECUBEMAP_WIDTH), 6 } | { (1,SURFACECUBEMAP_WIDTH), (1,SURFACECUBEMAP_WIDTH), 6 } |
13462    /// | Cubemap Layered | { (1,TEXTURECUBEMAP_LAYERED_WIDTH), (1,TEXTURECUBEMAP_LAYERED_WIDTH), (1,TEXTURECUBEMAP_LAYERED_LAYERS) } | { (1,SURFACECUBEMAP_LAYERED_WIDTH), (1,SURFACECUBEMAP_LAYERED_WIDTH), (1,SURFACECUBEMAP_LAYERED_LAYERS) } |
13463    ///
13464    /// Here are examples of CUDA array descriptions:
13465    ///
13466    /// Description for a CUDA array of 2048 floats:
13467    ///
13468    /// ```text
13469    /// CUDA_ARRAY3D_DESCRIPTOR desc;
13470    /// desc.Format = CU_AD_FORMAT_FLOAT;
13471    /// desc.NumChannels = 1;
13472    /// desc.Width = 2048;
13473    /// desc.Height = 0;
13474    /// desc.Depth = 0;
13475    /// ```
13476    ///
13477    /// Description for a 64 x 64 CUDA array of floats:
13478    ///
13479    /// ```text
13480    /// CUDA_ARRAY3D_DESCRIPTOR desc;
13481    /// desc.Format = CU_AD_FORMAT_FLOAT;
13482    /// desc.NumChannels = 1;
13483    /// desc.Width = 64;
13484    /// desc.Height = 64;
13485    /// desc.Depth = 0;
13486    /// ```
13487    ///
13488    /// Description for a `width` x `height` x `depth` CUDA array of 64-bit, 4x16-bit float16’s:
13489    ///
13490    /// ```text
13491    /// CUDA_ARRAY3D_DESCRIPTOR desc;
13492    /// desc.Format = CU_AD_FORMAT_HALF;
13493    /// desc.NumChannels = 4;
13494    /// desc.Width = width;
13495    /// desc.Height = height;
13496    /// desc.Depth = depth;
13497    /// ```
13498    ///
13499    /// Note that this function may also return error codes from previous, asynchronous launches.
13500    ///
13501    /// # Parameters
13502    ///
13503    /// - `pHandle`: Returned array.
13504    /// - `pAllocateArray`: 3D array descriptor.
13505    ///
13506    /// # Return value
13507    ///
13508    /// - [`CUresult::CUDA_SUCCESS`]
13509    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
13510    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
13511    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
13512    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
13513    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
13514    /// - [`CUresult::CUDA_ERROR_UNKNOWN`]
13515    ///
13516    /// See also: [`cuArray3DGetDescriptor`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D16`], [`cuMemsetD2D32`], [`cuMemsetD8`], [`cuMemsetD16`], [`cuMemsetD32`], `cudaMalloc3DArray`.
13517    pub fn cuArray3DCreate_v2(
13518        pHandle: *mut CUarray,
13519        pAllocateArray: *const CUDA_ARRAY3D_DESCRIPTOR,
13520    ) -> CUresult;
13521}
13522singe_loader::functions! { crate::DRIVER;
13523    /// Get a 3D CUDA array descriptor.
13524    ///
13525    /// Returns in `*pArrayDescriptor` a descriptor containing information on the format and dimensions of the CUDA array `hArray`. It is useful for subroutines that have been passed a CUDA array, but need to know the CUDA array parameters for validation or other purposes.
13526    ///
13527    /// This function may be called on 1D and 2D arrays, in which case the `Height` and/or `Depth` members of the descriptor struct will be set to 0.
13528    ///
13529    /// Note that this function may also return error codes from previous, asynchronous launches.
13530    ///
13531    /// # Parameters
13532    ///
13533    /// - `pArrayDescriptor`: Returned 3D array descriptor.
13534    /// - `hArray`: 3D array to get descriptor of.
13535    ///
13536    /// # Return value
13537    ///
13538    /// - [`CUresult::CUDA_SUCCESS`]
13539    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
13540    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
13541    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
13542    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
13543    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
13544    /// - [`CUresult::CUDA_ERROR_CONTEXT_IS_DESTROYED`]
13545    ///
13546    /// See also: [`cuArray3DCreate`], [`cuArrayCreate`], [`cuArrayDestroy`], [`cuArrayGetDescriptor`], [`cuMemAlloc`], [`cuMemAllocHost`], [`cuMemAllocPitch`], [`cuMemcpy2D`], [`cuMemcpy2DAsync`], [`cuMemcpy2DUnaligned`], [`cuMemcpy3D`], [`cuMemcpy3DAsync`], [`cuMemcpyAtoA`], [`cuMemcpyAtoD`], [`cuMemcpyAtoH`], [`cuMemcpyAtoHAsync`], [`cuMemcpyDtoA`], [`cuMemcpyDtoD`], [`cuMemcpyDtoDAsync`], [`cuMemcpyDtoH`], [`cuMemcpyDtoHAsync`], [`cuMemcpyHtoA`], [`cuMemcpyHtoAAsync`], [`cuMemcpyHtoD`], [`cuMemcpyHtoDAsync`], [`cuMemFree`], [`cuMemFreeHost`], [`cuMemGetAddressRange`], [`cuMemGetInfo`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer`], [`cuMemsetD2D8`], [`cuMemsetD2D16`], [`cuMemsetD2D32`], [`cuMemsetD8`], [`cuMemsetD16`], [`cuMemsetD32`], `cudaArrayGetInfo`.
13547    pub fn cuArray3DGetDescriptor_v2(
13548        pArrayDescriptor: *mut CUDA_ARRAY3D_DESCRIPTOR,
13549        hArray: CUarray,
13550    ) -> CUresult;
13551}
13552singe_loader::functions! { crate::DRIVER;
13553    /// Creates a CUDA mipmapped array.
13554    ///
13555    /// Creates a CUDA mipmapped array according to the CUDA_ARRAY3D_DESCRIPTOR structure `pMipmappedArrayDesc` and returns a handle to the new CUDA mipmapped array in `*pHandle`. `numMipmapLevels` specifies the number of mipmap levels to be allocated. This value is clamped to the range \[1, 1 + floor(log2(max(width, height, depth)))\].
13556    ///
13557    /// The CUDA_ARRAY3D_DESCRIPTOR is defined as:
13558    ///
13559    /// ```text
13560    /// typedef struct {
13561    /// unsigned int Width;
13562    /// unsigned int Height;
13563    /// unsigned int Depth;
13564    /// CUarray_format Format;
13565    /// unsigned int NumChannels;
13566    /// unsigned int Flags;
13567    /// } CUDA_ARRAY3D_DESCRIPTOR;
13568    /// ```
13569    ///
13570    /// where:
13571    ///
13572    /// * `Width`, `Height`, and `Depth` are the width, height, and depth of the CUDA array (in elements); the following types of CUDA arrays can be allocated:
13573    ///
13574    ///   + A 1D mipmapped array is allocated if `Height` and `Depth` extents are both zero.
13575    ///   + A 2D mipmapped array is allocated if only `Depth` extent is zero.
13576    ///   + A 3D mipmapped array is allocated if all three extents are non-zero.
13577    ///   + A 1D layered CUDA mipmapped array is allocated if only `Height` is zero and the [`CUDA_ARRAY3D_LAYERED`] flag is set. Each layer is a 1D array. The number of layers is determined by the depth extent.
13578    ///   + A 2D layered CUDA mipmapped array is allocated if all three extents are non-zero and the [`CUDA_ARRAY3D_LAYERED`] flag is set. Each layer is a 2D array. The number of layers is determined by the depth extent.
13579    ///   + A cubemap CUDA mipmapped array is allocated if all three extents are non-zero and the [`CUDA_ARRAY3D_CUBEMAP`] flag is set. `Width` must be equal to `Height`, and `Depth` must be six. A cubemap is a special type of 2D layered CUDA array, where the six layers represent the six faces of a cube. The order of the six layers in memory is the same as that listed in [`CUarray_cubemap_face`].
13580    ///   + A cubemap layered CUDA mipmapped array is allocated if all three extents are non-zero, and both, [`CUDA_ARRAY3D_CUBEMAP`] and [`CUDA_ARRAY3D_LAYERED`] flags are set. `Width` must be equal to `Height`, and `Depth` must be a multiple of six. A cubemap layered CUDA array is a special type of 2D layered CUDA array that consists of a collection of cubemaps. The first six layers represent the first cubemap, the next six layers form the second cubemap, and so on.
13581    /// * `Format` specifies the format of the elements; [`CUarray_format`] is defined as:
13582    ///
13583    /// ```text
13584    ///   typedef enum CUarray_format_enum {
13585    /// CU_AD_FORMAT_UNSIGNED_INT8 = 0x01,
13586    /// CU_AD_FORMAT_UNSIGNED_INT16 = 0x02,
13587    /// CU_AD_FORMAT_UNSIGNED_INT32 = 0x03,
13588    /// CU_AD_FORMAT_SIGNED_INT8 = 0x08,
13589    /// CU_AD_FORMAT_SIGNED_INT16 = 0x09,
13590    /// CU_AD_FORMAT_SIGNED_INT32 = 0x0a,
13591    /// CU_AD_FORMAT_HALF = 0x10,
13592    /// CU_AD_FORMAT_FLOAT = 0x20,
13593    /// CU_AD_FORMAT_NV12 = 0xb0,
13594    /// CU_AD_FORMAT_UNORM_INT8X1 = 0xc0,
13595    /// CU_AD_FORMAT_UNORM_INT8X2 = 0xc1,
13596    /// CU_AD_FORMAT_UNORM_INT8X4 = 0xc2,
13597    /// CU_AD_FORMAT_UNORM_INT16X1 = 0xc3,
13598    /// CU_AD_FORMAT_UNORM_INT16X2 = 0xc4,
13599    /// CU_AD_FORMAT_UNORM_INT16X4 = 0xc5,
13600    /// CU_AD_FORMAT_SNORM_INT8X1 = 0xc6,
13601    /// CU_AD_FORMAT_SNORM_INT8X2 = 0xc7,
13602    /// CU_AD_FORMAT_SNORM_INT8X4 = 0xc8,
13603    /// CU_AD_FORMAT_SNORM_INT16X1 = 0xc9,
13604    /// CU_AD_FORMAT_SNORM_INT16X2 = 0xca,
13605    /// CU_AD_FORMAT_SNORM_INT16X4 = 0xcb,
13606    /// CU_AD_FORMAT_BC1_UNORM = 0x91,
13607    /// CU_AD_FORMAT_BC1_UNORM_SRGB = 0x92,
13608    /// CU_AD_FORMAT_BC2_UNORM = 0x93,
13609    /// CU_AD_FORMAT_BC2_UNORM_SRGB = 0x94,
13610    /// CU_AD_FORMAT_BC3_UNORM = 0x95,
13611    /// CU_AD_FORMAT_BC3_UNORM_SRGB = 0x96,
13612    /// CU_AD_FORMAT_BC4_UNORM = 0x97,
13613    /// CU_AD_FORMAT_BC4_SNORM = 0x98,
13614    /// CU_AD_FORMAT_BC5_UNORM = 0x99,
13615    /// CU_AD_FORMAT_BC5_SNORM = 0x9a,
13616    /// CU_AD_FORMAT_BC6H_UF16 = 0x9b,
13617    /// CU_AD_FORMAT_BC6H_SF16 = 0x9c,
13618    /// CU_AD_FORMAT_BC7_UNORM = 0x9d,
13619    /// CU_AD_FORMAT_BC7_UNORM_SRGB = 0x9e,
13620    /// CU_AD_FORMAT_P010 = 0x9f,
13621    /// CU_AD_FORMAT_P016 = 0xa1,
13622    /// CU_AD_FORMAT_NV16 = 0xa2,
13623    /// CU_AD_FORMAT_P210 = 0xa3,
13624    /// CU_AD_FORMAT_P216 = 0xa4,
13625    /// CU_AD_FORMAT_YUY2 = 0xa5,
13626    /// CU_AD_FORMAT_Y210 = 0xa6,
13627    /// CU_AD_FORMAT_Y216 = 0xa7,
13628    /// CU_AD_FORMAT_AYUV = 0xa8,
13629    /// CU_AD_FORMAT_Y410 = 0xa9,
13630    /// CU_AD_FORMAT_Y416 = 0xb1,
13631    /// CU_AD_FORMAT_Y444_PLANAR8 = 0xb2,
13632    /// CU_AD_FORMAT_Y444_PLANAR10 = 0xb3,
13633    /// CU_AD_FORMAT_YUV444_8bit_SemiPlanar = 0xb4,
13634    /// CU_AD_FORMAT_YUV444_16bit_SemiPlanar = 0xb5,
13635    /// CU_AD_FORMAT_UNORM_INT_101010_2 = 0x50,
13636    /// CU_AD_FORMAT_UINT8_PACKED_422 = 0x51,
13637    /// CU_AD_FORMAT_UINT8_PACKED_444 = 0x52,
13638    /// CU_AD_FORMAT_UINT8_SEMIPLANAR_420 = 0x53,
13639    /// CU_AD_FORMAT_UINT16_SEMIPLANAR_420 = 0x54,
13640    /// CU_AD_FORMAT_UINT8_SEMIPLANAR_422 = 0x55,
13641    /// CU_AD_FORMAT_UINT16_SEMIPLANAR_422 = 0x56,
13642    /// CU_AD_FORMAT_UINT8_SEMIPLANAR_444 = 0x57,
13643    /// CU_AD_FORMAT_UINT16_SEMIPLANAR_444 = 0x58,
13644    /// CU_AD_FORMAT_UINT8_PLANAR_420 = 0x59,
13645    /// CU_AD_FORMAT_UINT16_PLANAR_420 = 0x5a,
13646    /// CU_AD_FORMAT_UINT8_PLANAR_422 = 0x5b,
13647    /// CU_AD_FORMAT_UINT16_PLANAR_422 = 0x5c,
13648    /// CU_AD_FORMAT_UINT8_PLANAR_444 = 0x5d,
13649    /// CU_AD_FORMAT_UINT16_PLANAR_444 = 0x5e,
13650    ///   } CUarray_format;
13651    /// ```
13652    /// * `NumChannels` specifies the number of packed components per CUDA array element; it may be 1, 2, or 4;
13653    /// * `Flags` may be set to
13654    ///
13655    ///   + [`CUDA_ARRAY3D_LAYERED`] to enable creation of layered CUDA mipmapped arrays. If this flag is set, `Depth` specifies the number of layers, not the depth of a 3D array.
13656    ///   + [`CUDA_ARRAY3D_SURFACE_LDST`] to enable surface references to be bound to individual mipmap levels of the CUDA mipmapped array. If this flag is not set, [`cuSurfRefSetArray`] will fail when attempting to bind a mipmap level of the CUDA mipmapped array to a surface reference.
13657    ///
13658    /// - [`CUDA_ARRAY3D_CUBEMAP`] to enable creation of mipmapped cubemaps. If this flag is set, `Width` must be equal to `Height`, and `Depth` must be six. If the [`CUDA_ARRAY3D_LAYERED`] flag is also set, then `Depth` must be a multiple of six.
13659    ///   + [`CUDA_ARRAY3D_TEXTURE_GATHER`] to indicate that the CUDA mipmapped array will be used for texture gather. Texture gather can only be performed on 2D CUDA mipmapped arrays.
13660    ///
13661    /// `Width`, `Height` and `Depth` must meet certain size requirements as listed in the following table. All values are specified in elements. Note that for brevity’s sake, the full name of the device attribute is not specified. For ex., TEXTURE1D_MIPMAPPED_WIDTH refers to the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH`].
13662    ///
13663    /// |  |  |  |
13664    /// | --- | --- | --- |
13665    /// | **CUDA array type** | **Valid extents that must always be met {(width range in elements), (height range), (depth range)}** | **Valid extents with CUDA_ARRAY3D_SURFACE_LDST set {(width range in elements), (height range), (depth range)}** |
13666    /// | 1D | { (1,TEXTURE1D_MIPMAPPED_WIDTH), 0, 0 } | { (1,SURFACE1D_WIDTH), 0, 0 } |
13667    /// | 2D | { (1,TEXTURE2D_MIPMAPPED_WIDTH), (1,TEXTURE2D_MIPMAPPED_HEIGHT), 0 } | { (1,SURFACE2D_WIDTH), (1,SURFACE2D_HEIGHT), 0 } |
13668    /// | 3D | { (1,TEXTURE3D_WIDTH), (1,TEXTURE3D_HEIGHT), (1,TEXTURE3D_DEPTH) } OR { (1,TEXTURE3D_WIDTH_ALTERNATE), (1,TEXTURE3D_HEIGHT_ALTERNATE), (1,TEXTURE3D_DEPTH_ALTERNATE) } | { (1,SURFACE3D_WIDTH), (1,SURFACE3D_HEIGHT), (1,SURFACE3D_DEPTH) } |
13669    /// | 1D Layered | { (1,TEXTURE1D_LAYERED_WIDTH), 0, (1,TEXTURE1D_LAYERED_LAYERS) } | { (1,SURFACE1D_LAYERED_WIDTH), 0, (1,SURFACE1D_LAYERED_LAYERS) } |
13670    /// | 2D Layered | { (1,TEXTURE2D_LAYERED_WIDTH), (1,TEXTURE2D_LAYERED_HEIGHT), (1,TEXTURE2D_LAYERED_LAYERS) } | { (1,SURFACE2D_LAYERED_WIDTH), (1,SURFACE2D_LAYERED_HEIGHT), (1,SURFACE2D_LAYERED_LAYERS) } |
13671    /// | Cubemap | { (1,TEXTURECUBEMAP_WIDTH), (1,TEXTURECUBEMAP_WIDTH), 6 } | { (1,SURFACECUBEMAP_WIDTH), (1,SURFACECUBEMAP_WIDTH), 6 } |
13672    /// | Cubemap Layered | { (1,TEXTURECUBEMAP_LAYERED_WIDTH), (1,TEXTURECUBEMAP_LAYERED_WIDTH), (1,TEXTURECUBEMAP_LAYERED_LAYERS) } | { (1,SURFACECUBEMAP_LAYERED_WIDTH), (1,SURFACECUBEMAP_LAYERED_WIDTH), (1,SURFACECUBEMAP_LAYERED_LAYERS) } |
13673    ///
13674    /// Note that this function may also return error codes from previous, asynchronous launches.
13675    ///
13676    /// # Parameters
13677    ///
13678    /// - `pHandle`: Returned mipmapped array.
13679    /// - `pMipmappedArrayDesc`: mipmapped array descriptor.
13680    /// - `numMipmapLevels`: Number of mipmap levels.
13681    ///
13682    /// # Return value
13683    ///
13684    /// - [`CUresult::CUDA_SUCCESS`]
13685    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
13686    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
13687    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
13688    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
13689    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
13690    /// - [`CUresult::CUDA_ERROR_UNKNOWN`]
13691    ///
13692    /// See also: [`cuMipmappedArrayDestroy`], [`cuMipmappedArrayGetLevel`], [`cuArrayCreate`], `cudaMallocMipmappedArray`.
13693    pub fn cuMipmappedArrayCreate(
13694        pHandle: *mut CUmipmappedArray,
13695        pMipmappedArrayDesc: *const CUDA_ARRAY3D_DESCRIPTOR,
13696        numMipmapLevels: ::core::ffi::c_uint,
13697    ) -> CUresult;
13698}
13699singe_loader::functions! { crate::DRIVER;
13700    /// Gets a mipmap level of a CUDA mipmapped array.
13701    ///
13702    /// Returns in `*pLevelArray` a CUDA array that represents a single mipmap level of the CUDA mipmapped array `hMipmappedArray`.
13703    ///
13704    /// If `level` is greater than the maximum number of levels in this mipmapped array, [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned.
13705    ///
13706    /// Note that this function may also return error codes from previous, asynchronous launches.
13707    ///
13708    /// # Parameters
13709    ///
13710    /// - `pLevelArray`: Returned mipmap level CUDA array.
13711    /// - `hMipmappedArray`: CUDA mipmapped array.
13712    /// - `level`: Mipmap level.
13713    ///
13714    /// # Return value
13715    ///
13716    /// - [`CUresult::CUDA_SUCCESS`]
13717    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
13718    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
13719    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
13720    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
13721    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
13722    ///
13723    /// See also: [`cuMipmappedArrayCreate`], [`cuMipmappedArrayDestroy`], [`cuArrayCreate`], `cudaGetMipmappedArrayLevel`.
13724    pub fn cuMipmappedArrayGetLevel(
13725        pLevelArray: *mut CUarray,
13726        hMipmappedArray: CUmipmappedArray,
13727        level: ::core::ffi::c_uint,
13728    ) -> CUresult;
13729}
13730singe_loader::functions! { crate::DRIVER;
13731    /// Destroys a CUDA mipmapped array.
13732    ///
13733    /// Destroys the CUDA mipmapped array `hMipmappedArray`.
13734    ///
13735    /// Note that this function may also return error codes from previous, asynchronous launches.
13736    ///
13737    /// # Parameters
13738    ///
13739    /// - `hMipmappedArray`: Mipmapped array to destroy
13740    ///
13741    /// # Return value
13742    ///
13743    /// - [`CUresult::CUDA_SUCCESS`]
13744    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
13745    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
13746    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
13747    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
13748    /// - [`CUresult::CUDA_ERROR_ARRAY_IS_MAPPED`]
13749    /// - [`CUresult::CUDA_ERROR_CONTEXT_IS_DESTROYED`]
13750    ///
13751    /// See also: [`cuMipmappedArrayCreate`], [`cuMipmappedArrayGetLevel`], [`cuArrayCreate`], `cudaFreeMipmappedArray`.
13752    pub fn cuMipmappedArrayDestroy(hMipmappedArray: CUmipmappedArray) -> CUresult;
13753}
13754singe_loader::functions! { crate::DRIVER;
13755    /// Retrieve handle for an address range.
13756    ///
13757    /// Get a handle of the specified type to an address range. When requesting CUmemRangeHandleType::CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD, address range obtained by a prior call to either cuMemAlloc or [`cuMemAddressReserve`] is supported if the [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_DMA_BUF_SUPPORTED`] device attribute returns true. If the address range was obtained via [`cuMemAddressReserve`], it must also be fully mapped via [`cuMemMap`]. Address range obtained by a prior call to either cuMemAllocHost or [`cuMemHostAlloc`] is supported if the [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_HOST_ALLOC_DMA_BUF_SUPPORTED`] device attribute returns true.
13758    ///
13759    /// As of CUDA 13.0, querying support for address range obtained by calling cuMemAllocHost or [`cuMemHostAlloc`] using the [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_DMA_BUF_SUPPORTED`] device attribute is deprecated.
13760    ///
13761    /// Users must ensure the `dptr` and `size` are aligned to the host page size.
13762    ///
13763    /// The `handle` will be interpreted as a pointer to an integer to store the dma_buf file descriptor. Users must ensure the entire address range is backed and mapped when the address range is allocated by [`cuMemAddressReserve`]. All the physical allocations backing the address range must be resident on the same device and have identical allocation properties. Users are also expected to retrieve a new handle every time the underlying physical allocation(s) corresponding to a previously queried VA range are changed.
13764    ///
13765    /// For CUmemRangeHandleType::CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD, users may set flags to [`CUmemRangeFlags_enum::CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE`]. Which when set on a supported platform, will give a DMA_BUF handle mapped via PCIE BAR1 or will return an error otherwise.
13766    ///
13767    /// If the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_DMA_BUF_MMAP_SUPPORTED`] is set and a CUmemRangeHandleType::CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD is requested for a device memory range then the returned dmabuf file descriptor may be passed as the file descriptor argument to the mmap() system call.
13768    ///
13769    /// For device memory on x86 systems the mapping will be a write combined mapping. On coherent ARM platforms these mappings will be regular cached memory. On all other platforms these mappings will be uncached.
13770    ///
13771    /// # Parameters
13772    ///
13773    /// - `handle`: Pointer to the location where the returned handle will be stored.
13774    /// - `dptr`: Pointer to a valid CUDA device allocation. Must be aligned to host page size.
13775    /// - `size`: Length of the address range. Must be aligned to host page size.
13776    /// - `handleType`: Type of handle requested (defines type and size of the `handle` output parameter).
13777    /// - `flags`: When requesting CUmemRangeHandleType::CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD the value could be [`CUmemRangeFlags_enum::CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE`], otherwise 0.
13778    ///
13779    /// # Return value
13780    ///
13781    /// - [`CUresult::CUDA_SUCCESS`]
13782    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
13783    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
13784    pub fn cuMemGetHandleForAddressRange(
13785        handle: *mut ::core::ffi::c_void,
13786        dptr: CUdeviceptr,
13787        size: size_t,
13788        handleType: CUmemRangeHandleType,
13789        flags: ::core::ffi::c_ulonglong,
13790    ) -> CUresult;
13791}
13792impl CUmemDecompressAlgorithm_enum {
13793    /// Decompression is unsupported.
13794    pub const CU_MEM_DECOMPRESS_UNSUPPORTED: CUmemDecompressAlgorithm_enum = CUmemDecompressAlgorithm_enum(
13795        0,
13796    );
13797    /// Deflate is supported.
13798    pub const CU_MEM_DECOMPRESS_ALGORITHM_DEFLATE: CUmemDecompressAlgorithm_enum = CUmemDecompressAlgorithm_enum(
13799        1,
13800    );
13801    /// Snappy is supported.
13802    pub const CU_MEM_DECOMPRESS_ALGORITHM_SNAPPY: CUmemDecompressAlgorithm_enum = CUmemDecompressAlgorithm_enum(
13803        2,
13804    );
13805    /// LZ4 is supported.
13806    pub const CU_MEM_DECOMPRESS_ALGORITHM_LZ4: CUmemDecompressAlgorithm_enum = CUmemDecompressAlgorithm_enum(
13807        4,
13808    );
13809}
13810/// Bitmasks for [`CUdevice_attribute::CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_ALGORITHM_MASK`].
13811#[repr(transparent)]
13812#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
13813pub struct CUmemDecompressAlgorithm_enum(pub ::core::ffi::c_uint);
13814pub use self::CUmemDecompressAlgorithm_enum as CUmemDecompressAlgorithm;
13815/// Structure describing the parameters that compose a single decompression operation.
13816#[repr(C)]
13817#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
13818pub struct CUmemDecompressParams_st {
13819    /// The number of bytes to be read and decompressed from [`CUmemDecompressParams_st`].src.
13820    pub srcNumBytes: size_t,
13821    /// The number of bytes that the decompression operation will be expected to write to [`CUmemDecompressParams_st`].dst.
13822    ///
13823    /// This value is optional; if present, it may be used by the CUDA driver as a heuristic for scheduling the individual decompression operations.
13824    pub dstNumBytes: size_t,
13825    /// After the decompression operation has completed, the actual number of bytes written to [CUmemDecompressParams.dst](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemDecompressParams.html#structcumemdecompressparams_1a39077e823122cfcfab6aeca53093c88c) will be recorded as a 32-bit unsigned integer in the memory at this address.
13826    pub dstActBytes: *mut cuuint32_t,
13827    /// Pointer to a buffer of at least [`CUmemDecompressParams_st`].srcNumBytes compressed bytes.
13828    pub src: *const ::core::ffi::c_void,
13829    /// Pointer to a buffer where the decompressed data will be written.
13830    ///
13831    /// The number of bytes written to this location will be recorded in the memory pointed to by [`CUmemDecompressParams_st`].dstActBytes.
13832    pub dst: *mut ::core::ffi::c_void,
13833    /// The decompression algorithm to use.
13834    pub algo: CUmemDecompressAlgorithm,
13835    /// These bytes are unused and must be zeroed. This ensures compatibility if additional fields are added in the future.
13836    pub padding: [::core::ffi::c_uchar; 20usize],
13837}
13838impl Default for CUmemDecompressParams_st {
13839    fn default() -> Self {
13840        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
13841        unsafe {
13842            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
13843            s.assume_init()
13844        }
13845    }
13846}
13847/// Structure describing the parameters that compose a single decompression operation.
13848pub type CUmemDecompressParams = CUmemDecompressParams_st;
13849singe_loader::functions! { crate::DRIVER;
13850    /// Submit a batch of `count` independent decompression operations.
13851    ///
13852    /// Each of the `count` decompression operations is described by a single entry in the `paramsArray` array. Once the batch has been submitted, the function will return, and decompression will happen asynchronously with respect to the CPU. To the work completion tracking mechanisms in the CUDA driver, the batch will be considered a single unit of work and processed according to stream semantics, i.e., it is not possible to query the completion of individual decompression operations within a batch.
13853    ///
13854    /// The memory pointed to by each of [CUmemDecompressParams.src](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemDecompressParams.html#structcumemdecompressparams_1a4d390c15ec5ed068f0912e42077ae0e0), [CUmemDecompressParams.dst](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemDecompressParams.html#structcumemdecompressparams_1a39077e823122cfcfab6aeca53093c88c), and [CUmemDecompressParams.dstActBytes](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemDecompressParams.html#structcumemdecompressparams_1adf7e9b52dd81aa6c0ed689eeab86d1a7), must be capable of usage with the hardware decompress feature. That is, for each of said pointers, the pointer attribute [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_IS_HW_DECOMPRESS_CAPABLE`] should give a non-zero value. To ensure this, the memory backing the pointers should have been allocated using one of the following CUDA memory allocators:
13855    ///
13856    /// * cuMemAlloc()
13857    /// * [`cuMemCreate`] with the usage flag [`CU_MEM_CREATE_USAGE_HW_DECOMPRESS`]
13858    /// * [`cuMemAllocFromPoolAsync`] from a pool that was created with the usage flag [`CU_MEM_POOL_CREATE_USAGE_HW_DECOMPRESS`] Additionally, [CUmemDecompressParams.src](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemDecompressParams.html#structcumemdecompressparams_1a4d390c15ec5ed068f0912e42077ae0e0), [CUmemDecompressParams.dst](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemDecompressParams.html#structcumemdecompressparams_1a39077e823122cfcfab6aeca53093c88c), and [CUmemDecompressParams.dstActBytes](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemDecompressParams.html#structcumemdecompressparams_1adf7e9b52dd81aa6c0ed689eeab86d1a7), must all be accessible from the device associated with the context where `stream` was created. For information on how to ensure this, see the documentation for the allocator of interest.
13859    ///
13860    /// Note that this function may also return error codes from previous, asynchronous launches.
13861    ///
13862    /// Note: This function exhibits asynchronous behavior for most use cases.
13863    ///
13864    /// Note: This function uses standard default stream semantics.
13865    ///
13866    /// # Parameters
13867    ///
13868    /// - `paramsArray`: The array of structures describing the independent decompression operations.
13869    /// - `count`: The number of entries in `paramsArray` array.
13870    /// - `flags`: Must be 0.
13871    /// - `errorIndex`: The index into `paramsArray` of the decompression operation for which the error returned by this function pertains to. If `index` is SIZE_MAX and the value returned is not [`cudaError_enum::CUDA_SUCCESS`], then the error returned by this function should be considered a general error that does not pertain to a particular decompression operation. May be `NULL`, in which case, no index will be recorded in the event of error.
13872    /// - `stream`: The stream where the work will be enqueued.
13873    ///
13874    /// # Return value
13875    ///
13876    /// - [`CUresult::CUDA_SUCCESS`]
13877    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
13878    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
13879    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
13880    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
13881    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
13882    ///
13883    /// See also: [`cuMemAlloc`], [`cuMemPoolCreate`], [`cuMemAllocFromPoolAsync`].
13884    pub fn cuMemBatchDecompressAsync(
13885        paramsArray: *mut CUmemDecompressParams,
13886        count: size_t,
13887        flags: ::core::ffi::c_uint,
13888        errorIndex: *mut size_t,
13889        stream: CUstream,
13890    ) -> CUresult;
13891}
13892singe_loader::functions! { crate::DRIVER;
13893    /// Allocate an address range reservation.
13894    ///
13895    /// Reserves a virtual address range based on the given parameters, giving the starting address of the range in `ptr`. This API requires a system that supports UVA. The size and address parameters must be a multiple of the host page size and the alignment must be a power of two or zero for default alignment. If `addr` is 0, then the driver chooses the address at which to place the start of the reservation whereas when it is non-zero then the driver treats it as a hint about where to place the reservation.
13896    ///
13897    /// # Parameters
13898    ///
13899    /// - `ptr`: Resulting pointer to start of virtual address range allocated.
13900    /// - `size`: Size of the reserved virtual address range requested.
13901    /// - `alignment`: Alignment of the reserved virtual address range requested.
13902    /// - `addr`: Hint address for the start of the address range.
13903    /// - `flags`: Currently unused, must be zero.
13904    ///
13905    /// # Return value
13906    ///
13907    /// - [`CUresult::CUDA_SUCCESS`]
13908    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
13909    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
13910    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
13911    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
13912    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
13913    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
13914    ///
13915    /// See also: [`cuMemAddressFree`].
13916    pub fn cuMemAddressReserve(
13917        ptr: *mut CUdeviceptr,
13918        size: size_t,
13919        alignment: size_t,
13920        addr: CUdeviceptr,
13921        flags: ::core::ffi::c_ulonglong,
13922    ) -> CUresult;
13923}
13924singe_loader::functions! { crate::DRIVER;
13925    /// Free an address range reservation.
13926    ///
13927    /// Frees a virtual address range reserved by cuMemAddressReserve. The size must match what was given to memAddressReserve and the ptr given must match what was returned from memAddressReserve.
13928    ///
13929    /// # Parameters
13930    ///
13931    /// - `ptr`: Starting address of the virtual address range to free.
13932    /// - `size`: Size of the virtual address region to free.
13933    ///
13934    /// # Return value
13935    ///
13936    /// - [`CUresult::CUDA_SUCCESS`]
13937    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
13938    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
13939    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
13940    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
13941    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
13942    ///
13943    /// See also: [`cuMemAddressReserve`].
13944    pub fn cuMemAddressFree(ptr: CUdeviceptr, size: size_t) -> CUresult;
13945}
13946singe_loader::functions! { crate::DRIVER;
13947    /// Create a CUDA memory handle representing a memory allocation of a given size described by the given properties.
13948    ///
13949    /// This creates a memory allocation on the target device specified through the `prop` structure. The created allocation will not have any device or host mappings. The generic memory `handle` for the allocation can be mapped to the address space of calling process via [`cuMemMap`]. This handle cannot be transmitted directly to other processes (see [`cuMemExportToShareableHandle`]). On Windows, the caller must also pass an LPSECURITYATTRIBUTE in `prop` to be associated with this handle which limits or allows access to this handle for a recipient process (see [`CUmemAllocationProp::win32HandleMetaData`](CUmemAllocationProp_st::win32HandleMetaData) for more). The `size` of this allocation must be a multiple of the value given via [`cuMemGetAllocationGranularity`] with the [`CUmemAllocationGranularity_flags_enum::CU_MEM_ALLOC_GRANULARITY_MINIMUM`] flag. To create a CPU allocation that doesn’t target any specific NUMA nodes, applications must set [CUmemAllocationProp::CUmemLocation::type](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemAllocationProp__v1.html#structcumemallocationprop__v1_1a574c7287583cd07f23efc94d444087b1) to [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST`]. `CUmemAllocationProp::CUmemLocation::id` is ignored for HOST allocations. HOST allocations are not IPC capable and [`CUmemAllocationProp::requestedHandleTypes`](CUmemAllocationProp_st::requestedHandleTypes) must be 0, any other value will result in [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`]. To create a CPU allocation targeting a specific host NUMA node, applications must set [CUmemAllocationProp::CUmemLocation::type](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemAllocationProp__v1.html#structcumemallocationprop__v1_1a574c7287583cd07f23efc94d444087b1) to [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`] and `CUmemAllocationProp::CUmemLocation::id` must specify the NUMA ID of the CPU. On systems where NUMA is not available `CUmemAllocationProp::CUmemLocation::id` must be set to 0. Specifying [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT`] as the [`CUmemLocation::type`](CUmemLocation_st::type_) will result in [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`]. Specifying [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN`] as the [`CUmemLocation::type`](CUmemLocation_st::type_) will localize the allocation to the specified locality domain. `CUmemAllocationProp::CUmemLocation::localized`.deviceId must specify the device ID. `CUmemAllocationProp::CUmemLocation::localized`.localityDomainId must specify the locality domain ID. The locality domain ID must be a valid locality domain ID for the specified device. See also [`cuDeviceGetAttribute`] with the attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_LOCALITY_DOMAIN_COUNT`].
13950    ///
13951    /// Applications that intend to use [`CUmemAllocationHandleType_enum::CU_MEM_HANDLE_TYPE_FABRIC`] based memory sharing must ensure: (1) `nvidia-caps-imex-channels` character device is created by the driver and is listed under /proc/devices (2) have at least one IMEX channel file accessible by the user launching the application.
13952    ///
13953    /// When exporter and importer CUDA processes have been granted access to the same IMEX channel, they can securely share memory.
13954    ///
13955    /// The IMEX channel security model works on a per user basis. Which means all processes under a user can share memory if the user has access to a valid IMEX channel. When multi-user isolation is desired, a separate IMEX channel is required for each user.
13956    ///
13957    /// These channel files exist in /dev/nvidia-caps-imex-channels/channel\* and can be created using standard OS native calls like mknod on Linux. For example: To create channel0 with the major number from /proc/devices users can execute the following command: `mknod /dev/nvidia-caps-imex-channels/channel0 c <major number> 0`
13958    ///
13959    /// If [CUmemAllocationProp::allocFlags::usage](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemAllocationProp__v1.html#structcumemallocationprop__v1_1affdae8fc56d42a203bb8a7629df3ac51) contains [`CU_MEM_CREATE_USAGE_TILE_POOL`] flag then the memory allocation is intended only to be used as backing tile pool for sparse CUDA arrays and sparse CUDA mipmapped arrays. (see [`cuMemMapArrayAsync`]).
13960    ///
13961    /// Note: On devices with a single locality domain, [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN`] and localityDomainId 0 is equivalent to a full-device allocation created with [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`]. The resulting allocation will be of type [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`].
13962    ///
13963    /// Note that this function may also return error codes from previous, asynchronous launches.
13964    ///
13965    /// # Parameters
13966    ///
13967    /// - `handle`: Value of handle returned. All operations on this allocation are to be performed using this handle.
13968    /// - `size`: Size of the allocation requested.
13969    /// - `prop`: Properties of the allocation to create.
13970    /// - `flags`: flags for future use, must be zero now.
13971    ///
13972    /// # Return value
13973    ///
13974    /// - [`CUresult::CUDA_SUCCESS`]
13975    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
13976    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
13977    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
13978    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
13979    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
13980    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
13981    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
13982    ///
13983    /// See also: [`cuMemRelease`], [`cuMemExportToShareableHandle`], [`cuMemImportFromShareableHandle`].
13984    pub fn cuMemCreate(
13985        handle: *mut CUmemGenericAllocationHandle,
13986        size: size_t,
13987        prop: *const CUmemAllocationProp,
13988        flags: ::core::ffi::c_ulonglong,
13989    ) -> CUresult;
13990}
13991singe_loader::functions! { crate::DRIVER;
13992    /// Release a memory handle representing a memory allocation which was previously allocated through cuMemCreate.
13993    ///
13994    /// Frees the memory that was allocated on a device through cuMemCreate.
13995    ///
13996    /// The memory allocation will be freed when all outstanding mappings to the memory are unmapped and when all outstanding references to the handle (including it’s shareable counterparts) are also released. The generic memory handle can be freed when there are still outstanding mappings made with this handle. Each time a recipient process imports a shareable handle, it needs to pair it with [`cuMemRelease`] for the handle to be freed. If `handle` is not a valid handle the behavior is undefined.
13997    ///
13998    /// Note that this function may also return error codes from previous, asynchronous launches.
13999    ///
14000    /// # Parameters
14001    ///
14002    /// - `handle`: Value of handle which was returned previously by cuMemCreate.
14003    ///
14004    /// # Return value
14005    ///
14006    /// - [`CUresult::CUDA_SUCCESS`]
14007    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14008    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
14009    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
14010    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
14011    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
14012    ///
14013    /// See also: [`cuMemCreate`].
14014    pub fn cuMemRelease(handle: CUmemGenericAllocationHandle) -> CUresult;
14015}
14016singe_loader::functions! { crate::DRIVER;
14017    /// Maps an allocation handle to a reserved virtual address range.
14018    ///
14019    /// Maps bytes of memory represented by `handle` starting from byte `offset` to `size` to address range `addr`, `addr` + `size`. This range must be an address reservation previously reserved with [`cuMemAddressReserve`], and `offset` + `size` must be less than the size of the memory allocation. Both `ptr`, `size`, and `offset` must be a multiple of the value given via [`cuMemGetAllocationGranularity`] with the [`CUmemAllocationGranularity_flags_enum::CU_MEM_ALLOC_GRANULARITY_MINIMUM`] flag. If `handle` represents a multicast object, `ptr`, `size` and `offset` must be aligned to the value returned by [`cuMulticastGetGranularity`] with the flag `CU_MULTICAST_MINIMUM_GRANULARITY`. For best performance however, it is recommended that `ptr`, `size` and `offset` be aligned to the value returned by [`cuMulticastGetGranularity`] with the flag `CU_MULTICAST_RECOMMENDED_GRANULARITY`.
14020    ///
14021    /// When `handle` represents a multicast object, this call may fail if the devices added via [`cuMulticastAddDevice`] do not belong to the same clique.
14022    ///
14023    /// When `handle` represents a multicast object, this call may return [`CUresult::CUDA_ERROR_ILLEGAL_STATE`] if the system configuration is in an illegal state. In such cases, to continue using multicast, verify that the system configuration is in a valid state and all required driver daemons are running properly.
14024    ///
14025    /// Please note calling [`cuMemMap`] does not make the address accessible, the caller needs to update accessibility of a contiguous mapped VA range by calling [`cuMemSetAccess`].
14026    ///
14027    /// Once a recipient process obtains a shareable memory handle from [`cuMemImportFromShareableHandle`], the process must use [`cuMemMap`] to map the memory into its address ranges before setting accessibility with [`cuMemSetAccess`].
14028    ///
14029    /// [`cuMemMap`] can only create mappings on VA range reservations that are not currently mapped.
14030    ///
14031    /// Note that this function may also return error codes from previous, asynchronous launches.
14032    ///
14033    /// # Parameters
14034    ///
14035    /// - `ptr`: Address where memory will be mapped.
14036    /// - `size`: Size of the memory mapping.
14037    /// - `offset`: Offset into the memory represented by
14038    /// - `handle` from which to start mapping
14039    /// - Note: currently must be zero.
14040    /// - `handle`: Handle to a shareable memory.
14041    /// - `flags`: flags for future use, must be zero now.
14042    ///
14043    /// # Return value
14044    ///
14045    /// - [`CUresult::CUDA_SUCCESS`]
14046    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14047    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
14048    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
14049    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
14050    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
14051    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
14052    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
14053    /// - [`CUresult::CUDA_ERROR_ILLEGAL_STATE`]
14054    ///
14055    /// See also: [`cuMemUnmap`], [`cuMemSetAccess`], [`cuMemCreate`], [`cuMemAddressReserve`], [`cuMemImportFromShareableHandle`].
14056    pub fn cuMemMap(
14057        ptr: CUdeviceptr,
14058        size: size_t,
14059        offset: size_t,
14060        handle: CUmemGenericAllocationHandle,
14061        flags: ::core::ffi::c_ulonglong,
14062    ) -> CUresult;
14063}
14064singe_loader::functions! { crate::DRIVER;
14065    /// Maps or unmaps subregions of sparse CUDA arrays and sparse CUDA mipmapped arrays.
14066    ///
14067    /// Performs map or unmap operations on subregions of sparse CUDA arrays and sparse CUDA mipmapped arrays. Each operation is specified by a CUarrayMapInfo entry in the `mapInfoList` array of size `count`. The structure CUarrayMapInfo is defined as follow:
14068    ///
14069    /// ```text
14070    ///  typedef struct CUarrayMapInfo_st {
14071    /// CUresourcetype resourceType;
14072    /// union {
14073    /// CUmipmappedArray mipmap;
14074    /// CUarray array;
14075    /// } resource;
14076    ///
14077    /// CUarraySparseSubresourceType subresourceType;
14078    /// union {
14079    /// struct {
14080    /// unsigned int level;
14081    /// unsigned int layer;
14082    /// unsigned int offsetX;
14083    /// unsigned int offsetY;
14084    /// unsigned int offsetZ;
14085    /// unsigned int extentWidth;
14086    /// unsigned int extentHeight;
14087    /// unsigned int extentDepth;
14088    /// } sparseLevel;
14089    /// struct {
14090    /// unsigned int layer;
14091    /// unsigned long long offset;
14092    /// unsigned long long size;
14093    /// } miptail;
14094    /// } subresource;
14095    ///
14096    /// CUmemOperationType memOperationType;
14097    ///
14098    /// CUmemHandleType memHandleType;
14099    /// union {
14100    /// CUmemGenericAllocationHandle memHandle;
14101    /// } memHandle;
14102    ///
14103    /// unsigned long long offset;
14104    /// unsigned int deviceBitMask;
14105    /// unsigned int flags;
14106    /// unsigned int reserved\[2\];
14107    /// } CUarrayMapInfo;
14108    /// ```
14109    ///
14110    /// where [`CUarrayMapInfo::resourceType`](CUarrayMapInfo_st::resourceType) specifies the type of resource to be operated on. If [`CUarrayMapInfo::resourceType`](CUarrayMapInfo_st::resourceType) is set to [`CUresourcetype::CU_RESOURCE_TYPE_ARRAY`] then CUarrayMapInfo::resource::array must be set to a valid sparse CUDA array handle. The CUDA array must be either a 2D, 2D layered or 3D CUDA array and must have been allocated using cuArrayCreate or cuArray3DCreate with the flag [`CUDA_ARRAY3D_SPARSE`] or [`CUDA_ARRAY3D_DEFERRED_MAPPING`]. For CUDA arrays obtained using [`cuMipmappedArrayGetLevel`], [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] will be returned. If [`CUarrayMapInfo::resourceType`](CUarrayMapInfo_st::resourceType) is set to [`CUresourcetype::CU_RESOURCE_TYPE_MIPMAPPED_ARRAY`] then CUarrayMapInfo::resource::mipmap must be set to a valid sparse CUDA mipmapped array handle. The CUDA mipmapped array must be either a 2D, 2D layered or 3D CUDA mipmapped array and must have been allocated using [`cuMipmappedArrayCreate`] with the flag [`CUDA_ARRAY3D_SPARSE`] or [`CUDA_ARRAY3D_DEFERRED_MAPPING`].
14111    ///
14112    /// [`CUarrayMapInfo::subresourceType`](CUarrayMapInfo_st::subresourceType) specifies the type of subresource within the resource. [`CUarraySparseSubresourceType_enum`] is defined as:
14113    ///
14114    /// ```text
14115    /// typedef enum CUarraySparseSubresourceType_enum {
14116    /// CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_SPARSE_LEVEL = 0,
14117    /// CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL = 1
14118    /// } CUarraySparseSubresourceType;
14119    /// ```
14120    ///
14121    /// where [`CUarraySparseSubresourceType::CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_SPARSE_LEVEL`] indicates a sparse-miplevel which spans at least one tile in every dimension. The remaining miplevels which are too small to span at least one tile in any dimension constitute the mip tail region as indicated by [`CUarraySparseSubresourceType::CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL`] subresource type.
14122    ///
14123    /// If [`CUarrayMapInfo::subresourceType`](CUarrayMapInfo_st::subresourceType) is set to [`CUarraySparseSubresourceType::CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_SPARSE_LEVEL`] then CUarrayMapInfo::subresource::sparseLevel struct must contain valid array subregion offsets and extents. The [CUarrayMapInfo::subresource::sparseLevel::offsetX](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUarrayMapInfo__v1.html#structcuarraymapinfo__v1_1aefe372bb107f7bc89cfcca0a857b33d3), [CUarrayMapInfo::subresource::sparseLevel::offsetY](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUarrayMapInfo__v1.html#structcuarraymapinfo__v1_1a98a37a828dc2814543c410c01e93b6dd) and [CUarrayMapInfo::subresource::sparseLevel::offsetZ](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUarrayMapInfo__v1.html#structcuarraymapinfo__v1_1ad5dd8de9c3bd4c486a951c2784eb1c56) must specify valid X, Y and Z offsets respectively. The [CUarrayMapInfo::subresource::sparseLevel::extentWidth](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUarrayMapInfo__v1.html#structcuarraymapinfo__v1_1a50dd4e7049b30f74a5edfd393824f7f8), [CUarrayMapInfo::subresource::sparseLevel::extentHeight](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUarrayMapInfo__v1.html#structcuarraymapinfo__v1_1acee9af385a8d55412462af044e2014f2) and [CUarrayMapInfo::subresource::sparseLevel::extentDepth](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUarrayMapInfo__v1.html#structcuarraymapinfo__v1_1aace61d37825a0eabdd76649628e38e56) must specify valid width, height and depth extents respectively. These offsets and extents must be aligned to the corresponding tile dimension. For CUDA mipmapped arrays [CUarrayMapInfo::subresource::sparseLevel::level](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUarrayMapInfo__v1.html#structcuarraymapinfo__v1_1aa8236fa42f04cd67abd14cb1ef0fca86) must specify a valid mip level index. Otherwise, must be zero. For layered CUDA arrays and layered CUDA mipmapped arrays [CUarrayMapInfo::subresource::sparseLevel::layer](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUarrayMapInfo__v1.html#structcuarraymapinfo__v1_1a843b7856a03e69ad18eec27ccb40b222) must specify a valid layer index. Otherwise, must be zero. [CUarrayMapInfo::subresource::sparseLevel::offsetZ](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUarrayMapInfo__v1.html#structcuarraymapinfo__v1_1ad5dd8de9c3bd4c486a951c2784eb1c56) must be zero and [CUarrayMapInfo::subresource::sparseLevel::extentDepth](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUarrayMapInfo__v1.html#structcuarraymapinfo__v1_1aace61d37825a0eabdd76649628e38e56) must be set to 1 for 2D and 2D layered CUDA arrays and CUDA mipmapped arrays. Tile extents can be obtained by calling [`cuArrayGetSparseProperties`] and [`cuMipmappedArrayGetSparseProperties`]
14124    ///
14125    /// If [`CUarrayMapInfo::subresourceType`](CUarrayMapInfo_st::subresourceType) is set to [`CUarraySparseSubresourceType::CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL`] then CUarrayMapInfo::subresource::miptail struct must contain valid mip tail offset in [CUarrayMapInfo::subresource::miptail::offset](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUarrayMapInfo__v1.html#structcuarraymapinfo__v1_1a4aee5e358272af897aeaf8b44fd15bdb) and size in [CUarrayMapInfo::subresource::miptail::size](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUarrayMapInfo__v1.html#structcuarraymapinfo__v1_1abb22d0785912f6bd26802bbd6c31a7ec). Both, mip tail offset and mip tail size must be aligned to the tile size. For layered CUDA mipmapped arrays which don’t have the flag [`CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL`] set in [`CUDA_ARRAY_SPARSE_PROPERTIES::flags`](CUDA_ARRAY_SPARSE_PROPERTIES_st::flags) as returned by [`cuMipmappedArrayGetSparseProperties`], [CUarrayMapInfo::subresource::miptail::layer](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUarrayMapInfo__v1.html#structcuarraymapinfo__v1_1a843b7856a03e69ad18eec27ccb40b222) must specify a valid layer index. Otherwise, must be zero.
14126    ///
14127    /// If CUarrayMapInfo::resource::array or CUarrayMapInfo::resource::mipmap was created with [`CUDA_ARRAY3D_DEFERRED_MAPPING`] flag set the [`CUarrayMapInfo::subresourceType`](CUarrayMapInfo_st::subresourceType) and the contents of CUarrayMapInfo::subresource will be ignored.
14128    ///
14129    /// [`CUarrayMapInfo::memOperationType`](CUarrayMapInfo_st::memOperationType) specifies the type of operation. [`CUmemOperationType`] is defined as:
14130    ///
14131    /// ```text
14132    /// typedef enum CUmemOperationType_enum {
14133    /// CU_MEM_OPERATION_TYPE_MAP = 1,
14134    /// CU_MEM_OPERATION_TYPE_UNMAP = 2
14135    /// } CUmemOperationType;
14136    /// ```
14137    ///
14138    /// If [`CUarrayMapInfo::memOperationType`](CUarrayMapInfo_st::memOperationType) is set to [`CUmemOperationType::CU_MEM_OPERATION_TYPE_MAP`] then the subresource will be mapped onto the tile pool memory specified by CUarrayMapInfo::memHandle at offset [`CUarrayMapInfo::offset`](CUarrayMapInfo_st::offset) . The tile pool allocation has to be created by specifying the [`CU_MEM_CREATE_USAGE_TILE_POOL`] flag when calling cuMemCreate . Also, [`CUarrayMapInfo::memHandleType`](CUarrayMapInfo_st::memHandleType) must be set to [`CUmemHandleType::CU_MEM_HANDLE_TYPE_GENERIC`].
14139    ///
14140    /// If [`CUarrayMapInfo::memOperationType`](CUarrayMapInfo_st::memOperationType) is set to [`CUmemOperationType::CU_MEM_OPERATION_TYPE_UNMAP`] then an unmapping operation is performed. CUarrayMapInfo::memHandle must be NULL.
14141    ///
14142    /// [`CUarrayMapInfo::deviceBitMask`](CUarrayMapInfo_st::deviceBitMask) specifies the list of devices that must map or unmap physical memory. Currently, this mask must have exactly one bit set, and the corresponding device must match the device associated with the stream. If [`CUarrayMapInfo::memOperationType`](CUarrayMapInfo_st::memOperationType) is set to [`CUmemOperationType::CU_MEM_OPERATION_TYPE_MAP`], the device must also match the device associated with the tile pool memory allocation as specified by CUarrayMapInfo::memHandle.
14143    ///
14144    /// [`CUarrayMapInfo::flags`](CUarrayMapInfo_st::flags) and [`CUarrayMapInfo::reserved`](CUarrayMapInfo_st::reserved)[] are unused and must be set to zero.
14145    ///
14146    /// # Parameters
14147    ///
14148    /// - `mapInfoList`: List of CUarrayMapInfo.
14149    /// - `count`: Count of CUarrayMapInfo in `mapInfoList`.
14150    /// - `hStream`: Stream identifier for the stream to use for map or unmap operations.
14151    ///
14152    /// # Return value
14153    ///
14154    /// - [`CUresult::CUDA_SUCCESS`]
14155    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14156    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
14157    ///
14158    /// See also: [`cuMipmappedArrayCreate`], [`cuArrayCreate`], [`cuArray3DCreate`], [`cuMemCreate`], [`cuArrayGetSparseProperties`], [`cuMipmappedArrayGetSparseProperties`].
14159    pub fn cuMemMapArrayAsync(
14160        mapInfoList: *mut CUarrayMapInfo,
14161        count: ::core::ffi::c_uint,
14162        hStream: CUstream,
14163    ) -> CUresult;
14164}
14165singe_loader::functions! { crate::DRIVER;
14166    /// Unmap the backing memory of a given address range.
14167    ///
14168    /// The range must be the entire contiguous address range that was mapped to. In other words, [`cuMemUnmap`] cannot unmap a sub-range of an address range mapped by [`cuMemCreate`] / [`cuMemMap`]. Any backing memory allocations will be freed if there are no existing mappings and there are no unreleased memory handles.
14169    ///
14170    /// When [`cuMemUnmap`] returns successfully the address range is converted to an address reservation and can be used for a future calls to [`cuMemMap`]. Any new mapping to this virtual address will need to have access granted through [`cuMemSetAccess`], as all mappings start with no accessibility setup.
14171    ///
14172    /// Note that this function may also return error codes from previous, asynchronous launches.
14173    ///
14174    /// Note: This function exhibits synchronous behavior for most use cases.
14175    ///
14176    /// # Parameters
14177    ///
14178    /// - `ptr`: Starting address for the virtual address range to unmap.
14179    /// - `size`: Size of the virtual address range to unmap.
14180    ///
14181    /// # Return value
14182    ///
14183    /// - [`CUresult::CUDA_SUCCESS`]
14184    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14185    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
14186    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
14187    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
14188    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
14189    ///
14190    /// See also: [`cuMemCreate`], [`cuMemAddressReserve`].
14191    pub fn cuMemUnmap(ptr: CUdeviceptr, size: size_t) -> CUresult;
14192}
14193singe_loader::functions! { crate::DRIVER;
14194    /// Set the access flags for each location specified in `desc` for the given virtual address range.
14195    ///
14196    /// Given the virtual address range via `ptr` and `size`, and the locations in the array given by `desc` and `count`, set the access flags for the target locations. The range must be a fully mapped address range containing all allocations created by [`cuMemMap`] / [`cuMemCreate`]. Users cannot specify [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`] accessibility for allocations created on with other location types. Note: When `CUmemAccessDesc::CUmemLocation::type` is [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`], `CUmemAccessDesc::CUmemLocation::id` is ignored. When setting the access flags for a virtual address range mapping a multicast object, `ptr` and `size` must be aligned to the value returned by [`cuMulticastGetGranularity`] with the flag `CU_MULTICAST_MINIMUM_GRANULARITY`. For best performance however, it is recommended that `ptr` and `size` be aligned to the value returned by [`cuMulticastGetGranularity`] with the flag `CU_MULTICAST_RECOMMENDED_GRANULARITY`.
14197    ///
14198    /// Note that this function may also return error codes from previous, asynchronous launches.
14199    ///
14200    /// Note: This function exhibits synchronous behavior for most use cases.
14201    ///
14202    /// # Parameters
14203    ///
14204    /// - `ptr`: Starting address for the virtual address range.
14205    /// - `size`: Length of the virtual address range.
14206    /// - `desc`: Array of [`CUmemAccessDesc`] that describe how to change the
14207    /// - mapping for each location specified
14208    /// - `count`: Number of CUmemAccessDesc in `desc`.
14209    ///
14210    /// # Return value
14211    ///
14212    /// - [`CUresult::CUDA_SUCCESS`]
14213    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14214    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
14215    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
14216    ///
14217    /// See also: [`cuMemCreate`], :, [`cuMemMap`].
14218    pub fn cuMemSetAccess(
14219        ptr: CUdeviceptr,
14220        size: size_t,
14221        desc: *const CUmemAccessDesc,
14222        count: size_t,
14223    ) -> CUresult;
14224}
14225singe_loader::functions! { crate::DRIVER;
14226    /// Get the access `flags` set for the given `location` and `ptr`.
14227    ///
14228    /// # Parameters
14229    ///
14230    /// - `flags`: Flags set for this location.
14231    /// - `location`: Location in which to check the flags for.
14232    /// - `ptr`: Address in which to check the access flags for.
14233    ///
14234    /// # Return value
14235    ///
14236    /// - [`CUresult::CUDA_SUCCESS`]
14237    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14238    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
14239    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
14240    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
14241    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
14242    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
14243    ///
14244    /// See also: [`cuMemSetAccess`].
14245    pub fn cuMemGetAccess(
14246        flags: *mut ::core::ffi::c_ulonglong,
14247        location: *const CUmemLocation,
14248        ptr: CUdeviceptr,
14249    ) -> CUresult;
14250}
14251singe_loader::functions! { crate::DRIVER;
14252    /// Exports an allocation to a requested shareable handle type.
14253    ///
14254    /// Given a CUDA memory handle, create a shareable memory allocation handle that can be used to share the memory with other processes. The recipient process can convert the shareable handle back into a CUDA memory handle using [`cuMemImportFromShareableHandle`] and map it with [`cuMemMap`]. The implementation of what this handle is and how it can be transferred is defined by the requested handle type in `handleType`
14255    ///
14256    /// Once all shareable handles are closed and the allocation is released, the allocated memory referenced will be released back to the OS and uses of the CUDA handle afterward will lead to undefined behavior.
14257    ///
14258    /// This API can also be used in conjunction with other APIs (e.g. Vulkan, OpenGL) that support importing memory from the shareable type.
14259    ///
14260    /// # Parameters
14261    ///
14262    /// - `shareableHandle`: Pointer to the location in which to store the requested handle type.
14263    /// - `handle`: CUDA handle for the memory allocation.
14264    /// - `handleType`: Type of shareable handle requested (defines type and size of the `shareableHandle` output parameter).
14265    /// - `flags`: Reserved, must be zero.
14266    ///
14267    /// # Return value
14268    ///
14269    /// - [`CUresult::CUDA_SUCCESS`]
14270    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14271    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
14272    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
14273    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
14274    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
14275    ///
14276    /// See also: [`cuMemImportFromShareableHandle`].
14277    pub fn cuMemExportToShareableHandle(
14278        shareableHandle: *mut ::core::ffi::c_void,
14279        handle: CUmemGenericAllocationHandle,
14280        handleType: CUmemAllocationHandleType,
14281        flags: ::core::ffi::c_ulonglong,
14282    ) -> CUresult;
14283}
14284singe_loader::functions! { crate::DRIVER;
14285    /// Imports an allocation from a requested shareable handle type.
14286    ///
14287    /// If the current process cannot support the memory described by this shareable handle, this API will error as [`cudaError_enum::CUDA_ERROR_NOT_SUPPORTED`].
14288    ///
14289    /// If `shHandleType` is [`CUmemAllocationHandleType_enum::CU_MEM_HANDLE_TYPE_FABRIC`] and the importer process has not been granted access to the same IMEX channel as the exporter process, this API will error as [`cudaError_enum::CUDA_ERROR_NOT_PERMITTED`].
14290    ///
14291    /// Note: Importing shareable handles exported from some graphics APIs(VUlkan, OpenGL, etc) created on devices under an SLI group may not be supported, and thus this API will return [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]. There is no guarantee that the contents of `handle` will be the same CUDA memory handle for the same given OS shareable handle, or the same underlying allocation.
14292    ///
14293    /// # Parameters
14294    ///
14295    /// - `handle`: CUDA Memory handle for the memory allocation.
14296    /// - `osHandle`: Shareable Handle representing the memory allocation that is to be imported.
14297    /// - `shHandleType`: handle type of the exported handle [`CUmemAllocationHandleType`].
14298    ///
14299    /// # Return value
14300    ///
14301    /// - [`CUresult::CUDA_SUCCESS`]
14302    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14303    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
14304    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
14305    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
14306    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
14307    ///
14308    /// See also: [`cuMemExportToShareableHandle`], [`cuMemMap`], [`cuMemRelease`].
14309    pub fn cuMemImportFromShareableHandle(
14310        handle: *mut CUmemGenericAllocationHandle,
14311        osHandle: *mut ::core::ffi::c_void,
14312        shHandleType: CUmemAllocationHandleType,
14313    ) -> CUresult;
14314}
14315singe_loader::functions! { crate::DRIVER;
14316    /// Calculates either the minimal or recommended granularity.
14317    ///
14318    /// Calculates either the minimal or recommended granularity for a given allocation specification and returns it in granularity. This granularity can be used as a multiple for alignment, size, or address mapping.
14319    ///
14320    /// # Parameters
14321    ///
14322    /// - `granularity`: Returned granularity.
14323    /// - `prop`: Property for which to determine the granularity for.
14324    /// - `option`: Determines which granularity to return.
14325    ///
14326    /// # Return value
14327    ///
14328    /// - [`CUresult::CUDA_SUCCESS`]
14329    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14330    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
14331    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
14332    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
14333    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
14334    ///
14335    /// See also: [`cuMemCreate`], [`cuMemMap`].
14336    pub fn cuMemGetAllocationGranularity(
14337        granularity: *mut size_t,
14338        prop: *const CUmemAllocationProp,
14339        option: CUmemAllocationGranularity_flags,
14340    ) -> CUresult;
14341}
14342singe_loader::functions! { crate::DRIVER;
14343    /// Retrieve the contents of the property structure defining properties for this handle.
14344    ///
14345    /// # Parameters
14346    ///
14347    /// - `prop`: Pointer to a properties structure which will hold the information about this handle.
14348    /// - `handle`: Handle which to perform the query on.
14349    ///
14350    /// # Return value
14351    ///
14352    /// - [`CUresult::CUDA_SUCCESS`]
14353    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14354    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
14355    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
14356    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
14357    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
14358    ///
14359    /// See also: [`cuMemCreate`], [`cuMemImportFromShareableHandle`].
14360    pub fn cuMemGetAllocationPropertiesFromHandle(
14361        prop: *mut CUmemAllocationProp,
14362        handle: CUmemGenericAllocationHandle,
14363    ) -> CUresult;
14364}
14365singe_loader::functions! { crate::DRIVER;
14366    /// Given an address `addr`, returns the allocation handle of the backing memory allocation.
14367    ///
14368    /// The handle is guaranteed to be the same handle value used to map the memory. If the address requested is not mapped, the function will fail. The returned handle must be released with corresponding number of calls to [`cuMemRelease`].
14369    ///
14370    /// Note: The address `addr`, can be any address in a range previously mapped by [`cuMemMap`], and not necessarily the start address.
14371    ///
14372    /// # Parameters
14373    ///
14374    /// - `handle`: CUDA Memory handle for the backing memory allocation.
14375    /// - `addr`: Memory address to query, that has been mapped previously.
14376    ///
14377    /// # Return value
14378    ///
14379    /// - [`CUresult::CUDA_SUCCESS`]
14380    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14381    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
14382    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
14383    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
14384    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
14385    ///
14386    /// See also: [`cuMemCreate`], [`cuMemRelease`], [`cuMemMap`].
14387    pub fn cuMemRetainAllocationHandle(
14388        handle: *mut CUmemGenericAllocationHandle,
14389        addr: *mut ::core::ffi::c_void,
14390    ) -> CUresult;
14391}
14392singe_loader::functions! { crate::DRIVER;
14393    /// Frees memory with stream ordered semantics.
14394    ///
14395    /// Inserts a free operation into `hStream`. The allocation must not be accessed after stream execution reaches the free. After this API returns, accessing the memory from any subsequent work launched on the GPU or querying its pointer attributes results in undefined behavior.
14396    ///
14397    /// Note: During stream capture, this function results in the creation of a free node and must therefore be passed the address of a graph allocation.
14398    ///
14399    /// # Parameters
14400    ///
14401    /// - `dptr`: memory to free.
14402    /// - `hStream`: The stream establishing the stream ordering contract.
14403    ///
14404    /// # Return value
14405    ///
14406    /// - [`CUresult::CUDA_SUCCESS`]
14407    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14408    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
14409    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]: (default stream specified with no current context).
14410    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
14411    pub fn cuMemFreeAsync(dptr: CUdeviceptr, hStream: CUstream) -> CUresult;
14412}
14413singe_loader::functions! { crate::DRIVER;
14414    /// Allocates memory with stream ordered semantics.
14415    ///
14416    /// Inserts an allocation operation into `hStream`. A pointer to the allocated memory is returned immediately in \*dptr. The allocation must not be accessed until the allocation operation completes. The allocation comes from the memory pool current to the stream’s device.
14417    ///
14418    /// Note: The default memory pool of a device contains device memory from that device.
14419    ///
14420    /// Note: Basic stream ordering allows future work submitted into the same stream to use the allocation. Stream query, stream synchronize, and CUDA events can be used to guarantee that the allocation operation completes before work submitted in a separate stream runs.
14421    ///
14422    /// Note: During stream capture, this function results in the creation of an allocation node. In this case, the allocation is owned by the graph instead of the memory pool. The memory pool’s properties are used to set the node’s creation parameters.
14423    ///
14424    /// # Parameters
14425    ///
14426    /// - `dptr`: Returned device pointer.
14427    /// - `bytesize`: Number of bytes to allocate.
14428    /// - `hStream`: The stream establishing the stream ordering contract and the memory pool to allocate from.
14429    ///
14430    /// # Return value
14431    ///
14432    /// - [`CUresult::CUDA_SUCCESS`]
14433    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14434    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
14435    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]: (default stream specified with no current context).
14436    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
14437    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
14438    ///
14439    /// See also: [`cuMemAllocFromPoolAsync`], [`cuMemFreeAsync`], [`cuDeviceSetMemPool`], [`cuDeviceGetDefaultMemPool`], [`cuDeviceGetMemPool`], [`cuMemPoolCreate`], [`cuMemPoolSetAccess`], [`cuMemPoolSetAttribute`].
14440    pub fn cuMemAllocAsync(
14441        dptr: *mut CUdeviceptr,
14442        bytesize: size_t,
14443        hStream: CUstream,
14444    ) -> CUresult;
14445}
14446singe_loader::functions! { crate::DRIVER;
14447    /// Tries to release memory back to the OS.
14448    ///
14449    /// Releases memory back to the OS until the pool contains fewer than minBytesToKeep reserved bytes, or there is no more memory that the allocator can safely release. The allocator cannot release OS allocations that back outstanding asynchronous allocations. The OS allocations may happen at different granularity from the user allocations.
14450    ///
14451    /// Note: Allocations that have not been freed count as outstanding.
14452    ///
14453    /// Note: Allocations that have been asynchronously freed but whose completion has not been observed on the host (eg. by a synchronize) can count as outstanding.
14454    ///
14455    /// # Parameters
14456    ///
14457    /// - `pool`: The memory pool to trim.
14458    /// - `minBytesToKeep`: If the pool has less than minBytesToKeep reserved, the TrimTo operation is a no-op. Otherwise the pool will be guaranteed to have at least minBytesToKeep bytes reserved after the operation.
14459    ///
14460    /// # Return value
14461    ///
14462    /// - [`CUresult::CUDA_SUCCESS`]
14463    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
14464    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14465    ///
14466    /// See also: [`cuMemAllocAsync`], [`cuMemFreeAsync`], [`cuDeviceGetDefaultMemPool`], [`cuDeviceGetMemPool`], [`cuMemPoolCreate`].
14467    pub fn cuMemPoolTrimTo(pool: CUmemoryPool, minBytesToKeep: size_t) -> CUresult;
14468}
14469singe_loader::functions! { crate::DRIVER;
14470    /// Sets attributes of a memory pool.
14471    ///
14472    /// Supported attributes are:
14473    ///
14474    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_RELEASE_THRESHOLD`]: (value type = cuuint64_t) Amount of reserved memory in bytes to hold onto before trying to release memory back to the OS. When more than the release threshold bytes of memory are held by the memory pool, the allocator will try to release memory back to the OS on the next call to stream, event or context synchronize. (default 0)
14475    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES`]: (value type = int) Allow [`cuMemAllocAsync`] to use memory asynchronously freed in another stream as long as a stream ordering dependency of the allocating stream on the free action exists. CUDA events and null stream interactions can create the required stream ordered dependencies. (default enabled)
14476    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC`]: (value type = int) Allow reuse of already completed frees when there is no dependency between the free and allocation. (default enabled)
14477    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES`]: (value type = int) Allow [`cuMemAllocAsync`] to insert new stream dependencies in order to establish the stream ordering required to reuse a piece of memory released by [`cuMemFreeAsync`] (default enabled).
14478    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH`]: (value type = cuuint64_t) Reset the high watermark that tracks the amount of backing memory that was allocated for the memory pool. It is illegal to set this attribute to a non-zero value.
14479    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_USED_MEM_HIGH`]: (value type = cuuint64_t) Reset the high watermark that tracks the amount of used memory that was allocated for the memory pool.
14480    ///
14481    /// # Parameters
14482    ///
14483    /// - `pool`: The memory pool to modify.
14484    /// - `attr`: The attribute to modify.
14485    /// - `value`: Pointer to the value to assign.
14486    ///
14487    /// # Return value
14488    ///
14489    /// - [`CUresult::CUDA_SUCCESS`]
14490    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14491    ///
14492    /// See also: [`cuMemAllocAsync`], [`cuMemFreeAsync`], [`cuDeviceGetDefaultMemPool`], [`cuDeviceGetMemPool`], [`cuMemPoolCreate`].
14493    pub fn cuMemPoolSetAttribute(
14494        pool: CUmemoryPool,
14495        attr: CUmemPool_attribute,
14496        value: *mut ::core::ffi::c_void,
14497    ) -> CUresult;
14498}
14499singe_loader::functions! { crate::DRIVER;
14500    /// Gets attributes of a memory pool.
14501    ///
14502    /// Supported attributes are:
14503    ///
14504    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_RELEASE_THRESHOLD`]: (value type = cuuint64_t) Amount of reserved memory in bytes to hold onto before trying to release memory back to the OS. When more than the release threshold bytes of memory are held by the memory pool, the allocator will try to release memory back to the OS on the next call to stream, event or context synchronize. (default 0)
14505    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES`]: (value type = int) Allow [`cuMemAllocAsync`] to use memory asynchronously freed in another stream as long as a stream ordering dependency of the allocating stream on the free action exists. CUDA events and null stream interactions can create the required stream ordered dependencies. (default enabled)
14506    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC`]: (value type = int) Allow reuse of already completed frees when there is no dependency between the free and allocation. (default enabled)
14507    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES`]: (value type = int) Allow [`cuMemAllocAsync`] to insert new stream dependencies in order to establish the stream ordering required to reuse a piece of memory released by [`cuMemFreeAsync`] (default enabled).
14508    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_RESERVED_MEM_CURRENT`]: (value type = cuuint64_t) Amount of backing memory currently allocated for the mempool
14509    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH`]: (value type = cuuint64_t) High watermark of backing memory allocated for the mempool since the last time it was reset.
14510    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_USED_MEM_CURRENT`]: (value type = cuuint64_t) Amount of memory from the pool that is currently in use by the application.
14511    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_USED_MEM_HIGH`]: (value type = cuuint64_t) High watermark of the amount of memory from the pool that was in use by the application.
14512    ///
14513    /// The following properties can be also be queried on imported and default pools:
14514    ///
14515    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_ALLOCATION_TYPE`]: (value type = CUmemAllocationType) The allocation type of the mempool
14516    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_EXPORT_HANDLE_TYPES`]: (value type = CUmemAllocationHandleType) Available export handle types for the mempool. For imported pools this value is always [`CUmemAllocationHandleType::CU_MEM_HANDLE_TYPE_NONE`] as an imported pool cannot be re-exported
14517    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_LOCATION_ID`]: (value type = int) The location id for the mempool. If the location type for this pool is [`CUmemLocationType::CU_MEM_LOCATION_TYPE_INVISIBLE`] then ID will be CU_DEVICE_INVALID.
14518    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_LOCATION_TYPE`]: (value type = CUmemLocationType) The location type for the mempool. For imported memory pools where the device is not directly visible to the importing process or pools imported via fabric handles across nodes this will be [`CUmemLocationType::CU_MEM_LOCATION_TYPE_INVISIBLE`].
14519    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_LOCALITY_DOMAIN_ID`]: (value type = int) The locality domain id for the mempool, if the mempool is localized to a locality domain. A value of -1 indicates that the mempool is not localized to a locality domain.
14520    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_MAX_POOL_SIZE`]: (value type = cuuint64_t) Maximum size of the pool in bytes, this value may be higher than what was initially passed to cuMemPoolCreate due to alignment requirements. A value of 0 indicates no maximum size. For CU__MEM_ALLOCATION_TYPE_MANAGED and IPC imported pools this value will be system dependent.
14521    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_HW_DECOMPRESS_ENABLED`]: (value type = int) Indicates whether the pool has hardware compresssion enabled
14522    ///
14523    ///   See also
14524    ///
14525    ///   [`cuMemAllocAsync`], [`cuMemFreeAsync`], [`cuDeviceGetDefaultMemPool`], [`cuDeviceGetMemPool`], [`cuMemPoolCreate`].
14526    ///
14527    /// Note: On devices with a single locality domain, mempools created with [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN`] and localityDomainId 0 are equivalent to full-device mempools created with [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`]. The value of this attribute will be -1 for such mempools.
14528    ///
14529    /// # Parameters
14530    ///
14531    /// - `pool`: The memory pool to get attributes of.
14532    /// - `attr`: The attribute to get.
14533    /// - `value`: Retrieved value.
14534    ///
14535    /// # Return value
14536    ///
14537    /// - [`CUresult::CUDA_SUCCESS`]
14538    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
14539    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14540    pub fn cuMemPoolGetAttribute(
14541        pool: CUmemoryPool,
14542        attr: CUmemPool_attribute,
14543        value: *mut ::core::ffi::c_void,
14544    ) -> CUresult;
14545}
14546singe_loader::functions! { crate::DRIVER;
14547    /// Controls visibility of pools between devices.
14548    ///
14549    /// # Parameters
14550    ///
14551    /// - `pool`: The pool being modified.
14552    /// - `map`: Array of access descriptors. Each descriptor instructs the access to enable for a single gpu.
14553    /// - `count`: Number of descriptors in the map array.
14554    ///
14555    /// # Return value
14556    ///
14557    /// - [`CUresult::CUDA_SUCCESS`]
14558    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
14559    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14560    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
14561    ///
14562    /// See also: [`cuMemAllocAsync`], [`cuMemFreeAsync`], [`cuDeviceGetDefaultMemPool`], [`cuDeviceGetMemPool`], [`cuMemPoolCreate`].
14563    pub fn cuMemPoolSetAccess(
14564        pool: CUmemoryPool,
14565        map: *const CUmemAccessDesc,
14566        count: size_t,
14567    ) -> CUresult;
14568}
14569singe_loader::functions! { crate::DRIVER;
14570    /// Returns the accessibility of a pool from a device.
14571    ///
14572    /// Returns the accessibility of the pool’s memory from the specified location.
14573    ///
14574    /// # Parameters
14575    ///
14576    /// - `flags`: the accessibility of the pool from the specified location.
14577    /// - `memPool`: the pool being queried.
14578    /// - `location`: the location accessing the pool.
14579    ///
14580    /// See also: [`cuMemAllocAsync`], [`cuMemFreeAsync`], [`cuDeviceGetDefaultMemPool`], [`cuDeviceGetMemPool`], [`cuMemPoolCreate`].
14581    pub fn cuMemPoolGetAccess(
14582        flags: *mut CUmemAccess_flags,
14583        memPool: CUmemoryPool,
14584        location: *mut CUmemLocation,
14585    ) -> CUresult;
14586}
14587singe_loader::functions! { crate::DRIVER;
14588    /// Creates a memory pool.
14589    ///
14590    /// Creates a CUDA memory pool and returns the handle in `pool`. The `poolProps` determines the properties of the pool such as the backing device and IPC capabilities.
14591    ///
14592    /// To create a memory pool for HOST memory not targeting a specific NUMA node, applications must set set `CUmemPoolProps::CUmemLocation::type` to [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST`]. `CUmemPoolProps::CUmemLocation::id` is ignored for such pools. Pools created with the type [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST`] are not IPC capable and [`CUmemPoolProps::handleTypes`](CUmemPoolProps_st::handleTypes) must be 0, any other values will result in [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`]. To create a memory pool targeting a specific host NUMA node, applications must set `CUmemPoolProps::CUmemLocation::type` to [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`] and `CUmemPoolProps::CUmemLocation::id` must specify the NUMA ID of the host memory node. Specifying [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT`] as the `CUmemPoolProps::CUmemLocation::type` will result in [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`]. To create a memory pool targeting a specific device locality domain, applications must set `CUmemPoolProps::CUmemLocation::type` to [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN`], `CUmemPoolProps::CUmemLocation::localized`.deviceId must specify the device ID, and `CUmemPoolProps::CUmemLocation::localized`.localityDomainId must specify the locality domain ID. The locality domain ID must be a valid locality domain ID for the specified device. See also [`cuDeviceGetAttribute`] with the attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_LOCALITY_DOMAIN_COUNT`].
14593    ///
14594    /// By default, the pool’s memory will be accessible from the device it is allocated on. In the case of pools created with [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`] or [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST`], their default accessibility will be from the host CPU. Applications can control the maximum size of the pool by specifying a non-zero value for [`CUmemPoolProps::maxSize`](CUmemPoolProps_st::maxSize). If set to 0, the maximum size of the pool will default to a system dependent value.
14595    ///
14596    /// Applications that intend to use [`CUmemAllocationHandleType_enum::CU_MEM_HANDLE_TYPE_FABRIC`] based memory sharing must ensure: (1) `nvidia-caps-imex-channels` character device is created by the driver and is listed under /proc/devices (2) have at least one IMEX channel file accessible by the user launching the application.
14597    ///
14598    /// When exporter and importer CUDA processes have been granted access to the same IMEX channel, they can securely share memory.
14599    ///
14600    /// The IMEX channel security model works on a per user basis. Which means all processes under a user can share memory if the user has access to a valid IMEX channel. When multi-user isolation is desired, a separate IMEX channel is required for each user.
14601    ///
14602    /// These channel files exist in /dev/nvidia-caps-imex-channels/channel\* and can be created using standard OS native calls like mknod on Linux. For example: To create channel0 with the major number from /proc/devices users can execute the following command: `mknod /dev/nvidia-caps-imex-channels/channel0 c <major number> 0`
14603    ///
14604    /// To create a managed memory pool, applications must set [`CUmemAllocationType`] to [`CUmemAllocationType::CU_MEM_ALLOCATION_TYPE_MANAGED`]. [`CUmemAllocationHandleType`] must also be set to [`CUmemAllocationHandleType::CU_MEM_HANDLE_TYPE_NONE`] since IPC is not supported. For managed memory pools, [`CUmemLocation`] will be treated as the preferred location for all allocations created from the pool. An application can also set [`CUmemLocationType::CU_MEM_LOCATION_TYPE_NONE`] to indicate no preferred location. [`CUmemPoolProps::maxSize`](CUmemPoolProps_st::maxSize) must be set to zero for managed memory pools. [`CUmemPoolProps::usage`](CUmemPoolProps_st::usage) should be zero as decompress for managed memory is not supported. For managed memory pools, all devices on the system must have non-zero `concurrentManagedAccess`. If not, this call returns [`CUresult::CUDA_ERROR_NOT_SUPPORTED`].
14605    ///
14606    /// Note: On devices with a single locality domain, a memory pool created with [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN`] and localityDomainId 0 is equivalent to a full-device memory pool created with [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`]. The pool will report [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`] for [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_LOCATION_TYPE`] and -1 for [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_LOCALITY_DOMAIN_ID`].
14607    ///
14608    /// Note: Specifying [`CUmemAllocationHandleType::CU_MEM_HANDLE_TYPE_NONE`] creates a memory pool that will not support IPC.
14609    ///
14610    /// # Return value
14611    ///
14612    /// - [`CUresult::CUDA_SUCCESS`]
14613    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
14614    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14615    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
14616    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
14617    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
14618    ///
14619    /// See also: [`cuDeviceSetMemPool`], [`cuDeviceGetMemPool`], [`cuDeviceGetDefaultMemPool`], [`cuMemAllocFromPoolAsync`], [`cuMemPoolExportToShareableHandle`].
14620    pub fn cuMemPoolCreate(
14621        pool: *mut CUmemoryPool,
14622        poolProps: *const CUmemPoolProps,
14623    ) -> CUresult;
14624}
14625singe_loader::functions! { crate::DRIVER;
14626    /// Destroys the specified memory pool.
14627    ///
14628    /// If any pointers obtained from this pool haven’t been freed or the pool has free operations that haven’t completed when [`cuMemPoolDestroy`] is invoked, the function will return immediately and the resources associated with the pool will be released automatically once there are no more outstanding allocations.
14629    ///
14630    /// Destroying the current mempool of a device sets the default mempool of that device as the current mempool for that device.
14631    ///
14632    /// Note: A device’s default memory pool cannot be destroyed.
14633    ///
14634    /// # Return value
14635    ///
14636    /// - [`CUresult::CUDA_SUCCESS`]
14637    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14638    ///
14639    /// See also: [`cuMemFreeAsync`], [`cuDeviceSetMemPool`], [`cuDeviceGetMemPool`], [`cuDeviceGetDefaultMemPool`], [`cuMemPoolCreate`].
14640    pub fn cuMemPoolDestroy(pool: CUmemoryPool) -> CUresult;
14641}
14642singe_loader::functions! { crate::DRIVER;
14643    /// Returns the default memory pool for a given location and allocation type.
14644    ///
14645    /// The memory location can be of one of [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`], [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST`], [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`], or [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN`]. The allocation type can be one of [`CUmemAllocationType_enum::CU_MEM_ALLOCATION_TYPE_PINNED`] or [`CUmemAllocationType_enum::CU_MEM_ALLOCATION_TYPE_MANAGED`]. When the allocation type is [`CUmemAllocationType_enum::CU_MEM_ALLOCATION_TYPE_MANAGED`], the location type can also be [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_NONE`] to indicate no preferred location for the managed memory pool. [`CUmemAllocationType_enum::CU_MEM_ALLOCATION_TYPE_MANAGED`] can not be used with [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN`].
14646    ///
14647    /// Note that this function may also return error codes from previous, asynchronous launches.
14648    ///
14649    /// # Return value
14650    ///
14651    /// - [`CUresult::CUDA_SUCCESS`]
14652    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
14653    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
14654    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14655    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
14656    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
14657    ///
14658    /// See also: [`cuMemAllocAsync`], [`cuMemPoolTrimTo`], [`cuMemPoolGetAttribute`], [`cuMemPoolSetAttribute`], [`cuMemPoolSetAccess`], [`cuMemGetMemPool`], [`cuMemPoolCreate`].
14659    pub fn cuMemGetDefaultMemPool(
14660        pool_out: *mut CUmemoryPool,
14661        location: *mut CUmemLocation,
14662        type_: CUmemAllocationType,
14663    ) -> CUresult;
14664}
14665singe_loader::functions! { crate::DRIVER;
14666    /// Gets the current memory pool for a memory location and of a particular allocation type.
14667    ///
14668    /// The memory location can be of one of [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`], [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST`] or [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`], [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`], or [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN`]. The allocation type can be one of [`CUmemAllocationType_enum::CU_MEM_ALLOCATION_TYPE_PINNED`] or [`CUmemAllocationType_enum::CU_MEM_ALLOCATION_TYPE_MANAGED`]. When the allocation type is [`CUmemAllocationType_enum::CU_MEM_ALLOCATION_TYPE_MANAGED`], the location type can also be [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_NONE`] to indicate no preferred location for the managed memory pool. [`CUmemAllocationType_enum::CU_MEM_ALLOCATION_TYPE_MANAGED`] can not be used with [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN`]. In all other cases, the call returns [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`]
14669    ///
14670    /// Returns the last pool provided to [`cuMemSetMemPool`] or [`cuDeviceSetMemPool`] for this location and allocation type or the location’s default memory pool if [`cuMemSetMemPool`] or [`cuDeviceSetMemPool`] for that allocType and location has never been called. By default the current mempool of a location is the default mempool for a device. Otherwise the returned pool must have been set with [`cuDeviceSetMemPool`].
14671    ///
14672    /// # Return value
14673    ///
14674    /// - [`CUresult::CUDA_SUCCESS`]
14675    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14676    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
14677    ///
14678    /// See also: [`cuDeviceGetDefaultMemPool`], [`cuMemPoolCreate`], [`cuDeviceSetMemPool`], [`cuMemSetMemPool`].
14679    pub fn cuMemGetMemPool(
14680        pool: *mut CUmemoryPool,
14681        location: *mut CUmemLocation,
14682        type_: CUmemAllocationType,
14683    ) -> CUresult;
14684}
14685singe_loader::functions! { crate::DRIVER;
14686    /// Sets the current memory pool for a memory location and allocation type.
14687    ///
14688    /// The memory location can be of one of [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`], [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST`] or [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`], [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN`]. The allocation type can be one of [`CUmemAllocationType_enum::CU_MEM_ALLOCATION_TYPE_PINNED`] or [`CUmemAllocationType_enum::CU_MEM_ALLOCATION_TYPE_MANAGED`]. When the allocation type is [`CUmemAllocationType_enum::CU_MEM_ALLOCATION_TYPE_MANAGED`], the location type can also be [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_NONE`] to indicate no preferred location for the managed memory pool. In all other cases, the call returns [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`].
14689    ///
14690    /// When a memory pool is set as the current memory pool, the location parameter should be the same as the location of the pool. The location and allocation type specified must match those of the pool otherwise [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned. By default, a memory location’s current memory pool is its default memory pool that can be obtained via [`cuMemGetDefaultMemPool`]. If the location type is [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`] and the allocation type is [`CUmemAllocationType_enum::CU_MEM_ALLOCATION_TYPE_PINNED`], then this API is the equivalent of calling [`cuDeviceSetMemPool`] with the location id as the device. For further details on the implications, please refer to the documentation for [`cuDeviceSetMemPool`].
14691    ///
14692    /// Note: Use [`cuMemAllocFromPoolAsync`] to specify asynchronous allocations from a device different than the one the stream runs on.
14693    ///
14694    /// # Return value
14695    ///
14696    /// - [`CUresult::CUDA_SUCCESS`]
14697    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14698    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
14699    ///
14700    /// See also: [`cuDeviceGetDefaultMemPool`], [`cuDeviceGetMemPool`], [`cuMemGetMemPool`], [`cuMemPoolCreate`], [`cuMemPoolDestroy`], [`cuMemAllocFromPoolAsync`].
14701    pub fn cuMemSetMemPool(
14702        location: *mut CUmemLocation,
14703        type_: CUmemAllocationType,
14704        pool: CUmemoryPool,
14705    ) -> CUresult;
14706}
14707singe_loader::functions! { crate::DRIVER;
14708    /// Allocates memory from a specified pool with stream ordered semantics.
14709    ///
14710    /// Inserts an allocation operation into `hStream`. A pointer to the allocated memory is returned immediately in \*dptr. The allocation must not be accessed until the allocation operation completes. The allocation comes from the specified memory pool.
14711    ///
14712    /// Note: The specified memory pool may be from a device different than that of the specified `hStream`.
14713    ///
14714    /// Note: Basic stream ordering allows future work submitted into the same stream to use the allocation. Stream query, stream synchronize, and CUDA events can be used to guarantee that the allocation operation completes before work submitted in a separate stream runs.
14715    ///
14716    /// Note: During stream capture, this function results in the creation of an allocation node. In this case, the allocation is owned by the graph instead of the memory pool. The memory pool’s properties are used to set the node’s creation parameters.
14717    ///
14718    /// # Parameters
14719    ///
14720    /// - `dptr`: Returned device pointer.
14721    /// - `bytesize`: Number of bytes to allocate.
14722    /// - `pool`: The pool to allocate from.
14723    /// - `hStream`: The stream establishing the stream ordering semantic.
14724    ///
14725    /// # Return value
14726    ///
14727    /// - [`CUresult::CUDA_SUCCESS`]
14728    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14729    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
14730    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]: (default stream specified with no current context).
14731    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
14732    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
14733    ///
14734    /// See also: [`cuMemAllocAsync`], [`cuMemFreeAsync`], [`cuDeviceGetDefaultMemPool`], [`cuDeviceGetMemPool`], [`cuMemPoolCreate`], [`cuMemPoolSetAccess`], [`cuMemPoolSetAttribute`].
14735    pub fn cuMemAllocFromPoolAsync(
14736        dptr: *mut CUdeviceptr,
14737        bytesize: size_t,
14738        pool: CUmemoryPool,
14739        hStream: CUstream,
14740    ) -> CUresult;
14741}
14742singe_loader::functions! { crate::DRIVER;
14743    /// Exports a memory pool to the requested handle type.
14744    ///
14745    /// Given an IPC capable mempool, create an OS handle to share the pool with another process. A recipient process can convert the shareable handle into a mempool with [`cuMemPoolImportFromShareableHandle`]. Individual pointers can then be shared with the [`cuMemPoolExportPointer`] and [`cuMemPoolImportPointer`] APIs. The implementation of what the shareable handle is and how it can be transferred is defined by the requested handle type.
14746    ///
14747    /// Note: To create an IPC capable mempool, create a mempool with a CUmemAllocationHandleType other than [`CUmemAllocationHandleType::CU_MEM_HANDLE_TYPE_NONE`].
14748    ///
14749    /// # Parameters
14750    ///
14751    /// - `handle_out`: Returned OS handle.
14752    /// - `pool`: pool to export.
14753    /// - `handleType`: the type of handle to create.
14754    /// - `flags`: must be 0.
14755    ///
14756    /// # Return value
14757    ///
14758    /// - [`CUresult::CUDA_SUCCESS`]
14759    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14760    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
14761    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
14762    ///
14763    /// See also: [`cuMemPoolImportFromShareableHandle`], [`cuMemPoolExportPointer`], [`cuMemPoolImportPointer`], [`cuMemAllocAsync`], [`cuMemFreeAsync`], [`cuDeviceGetDefaultMemPool`], [`cuDeviceGetMemPool`], [`cuMemPoolCreate`], [`cuMemPoolSetAccess`], [`cuMemPoolSetAttribute`].
14764    pub fn cuMemPoolExportToShareableHandle(
14765        handle_out: *mut ::core::ffi::c_void,
14766        pool: CUmemoryPool,
14767        handleType: CUmemAllocationHandleType,
14768        flags: ::core::ffi::c_ulonglong,
14769    ) -> CUresult;
14770}
14771singe_loader::functions! { crate::DRIVER;
14772    /// imports a memory pool from a shared handle.
14773    ///
14774    /// Specific allocations can be imported from the imported pool with cuMemPoolImportPointer.
14775    ///
14776    /// If `handleType` is [`CUmemAllocationHandleType_enum::CU_MEM_HANDLE_TYPE_FABRIC`] and the importer process has not been granted access to the same IMEX channel as the exporter process, this API will error as [`cudaError_enum::CUDA_ERROR_NOT_PERMITTED`].
14777    ///
14778    /// Note: Imported memory pools do not support creating new allocations. As such imported memory pools may not be used in cuDeviceSetMemPool or [`cuMemAllocFromPoolAsync`] calls.
14779    ///
14780    /// # Parameters
14781    ///
14782    /// - `pool_out`: Returned memory pool.
14783    /// - `handle`: OS handle of the pool to open.
14784    /// - `handleType`: The type of handle being imported.
14785    /// - `flags`: must be 0.
14786    ///
14787    /// # Return value
14788    ///
14789    /// - [`CUresult::CUDA_SUCCESS`]
14790    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14791    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
14792    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
14793    ///
14794    /// See also: [`cuMemPoolExportToShareableHandle`], [`cuMemPoolExportPointer`], [`cuMemPoolImportPointer`].
14795    pub fn cuMemPoolImportFromShareableHandle(
14796        pool_out: *mut CUmemoryPool,
14797        handle: *mut ::core::ffi::c_void,
14798        handleType: CUmemAllocationHandleType,
14799        flags: ::core::ffi::c_ulonglong,
14800    ) -> CUresult;
14801}
14802singe_loader::functions! { crate::DRIVER;
14803    /// Export data to share a memory pool allocation between processes.
14804    ///
14805    /// Constructs `shareData_out` for sharing a specific allocation from an already shared memory pool. The recipient process can import the allocation with the [`cuMemPoolImportPointer`] api. The data is not a handle and may be shared through any IPC mechanism.
14806    ///
14807    /// # Parameters
14808    ///
14809    /// - `shareData_out`: Returned export data.
14810    /// - `ptr`: pointer to memory being exported.
14811    ///
14812    /// # Return value
14813    ///
14814    /// - [`CUresult::CUDA_SUCCESS`]
14815    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14816    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
14817    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
14818    ///
14819    /// See also: [`cuMemPoolExportToShareableHandle`], [`cuMemPoolImportFromShareableHandle`], [`cuMemPoolImportPointer`].
14820    pub fn cuMemPoolExportPointer(
14821        shareData_out: *mut CUmemPoolPtrExportData,
14822        ptr: CUdeviceptr,
14823    ) -> CUresult;
14824}
14825singe_loader::functions! { crate::DRIVER;
14826    /// Import a memory pool allocation from another process.
14827    ///
14828    /// Returns in `ptr_out` a pointer to the imported memory. The imported memory must not be accessed before the allocation operation completes in the exporting process. The imported memory must be freed from all importing processes before being freed in the exporting process. The pointer may be freed with cuMemFree or cuMemFreeAsync. If cuMemFreeAsync is used, the free must be completed on the importing process before the free operation on the exporting process.
14829    ///
14830    /// Note: The cuMemFreeAsync api may be used in the exporting process before the cuMemFreeAsync operation completes in its stream as long as the cuMemFreeAsync in the exporting process specifies a stream with a stream dependency on the importing process’s cuMemFreeAsync.
14831    ///
14832    /// # Parameters
14833    ///
14834    /// - `ptr_out`: pointer to imported memory.
14835    /// - `pool`: pool from which to import.
14836    /// - `shareData`: data specifying the memory to import.
14837    ///
14838    /// # Return value
14839    ///
14840    /// - [`CUresult::CUDA_SUCCESS`]
14841    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14842    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
14843    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
14844    ///
14845    /// See also: [`cuMemPoolExportToShareableHandle`], [`cuMemPoolImportFromShareableHandle`], [`cuMemPoolExportPointer`].
14846    pub fn cuMemPoolImportPointer(
14847        ptr_out: *mut CUdeviceptr,
14848        pool: CUmemoryPool,
14849        shareData: *mut CUmemPoolPtrExportData,
14850    ) -> CUresult;
14851}
14852singe_loader::functions! { crate::DRIVER;
14853    /// Create a generic allocation handle representing a multicast object described by the given properties.
14854    ///
14855    /// This creates a multicast object as described by `prop`. The number of participating devices is specified by [`CUmulticastObjectProp::numDevices`](CUmulticastObjectProp_st::numDevices). Devices can be added to the multicast object via [`cuMulticastAddDevice`]. All participating devices must be added to the multicast object before memory can be bound to it. Memory is bound to the multicast object via [`cuMulticastBindMem`], [`cuMulticastBindMem_v2`], [`cuMulticastBindAddr`], or [`cuMulticastBindAddr_v2`]. and can be unbound via [`cuMulticastUnbind`]. The total amount of memory that can be bound per device is specified by :[`CUmulticastObjectProp::size`](CUmulticastObjectProp_st::size). This size must be a multiple of the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_MINIMUM`]. For best performance however, the size should be aligned to the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_RECOMMENDED`].
14856    ///
14857    /// After all participating devices have been added, multicast objects can also be mapped to a device’s virtual address space using the virtual memory management APIs (see [`cuMemMap`] and [`cuMemSetAccess`]). Multicast objects can also be shared with other processes by requesting a shareable handle via [`cuMemExportToShareableHandle`]. Note that the desired types of shareable handles must be specified in the bitmask [`CUmulticastObjectProp::handleTypes`](CUmulticastObjectProp_st::handleTypes). Multicast objects can be released using the virtual memory management API [`cuMemRelease`].
14858    ///
14859    /// # Parameters
14860    ///
14861    /// - `mcHandle`: Value of handle returned.
14862    /// - `prop`: Properties of the multicast object to create.
14863    ///
14864    /// # Return value
14865    ///
14866    /// - [`CUresult::CUDA_SUCCESS`]
14867    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14868    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
14869    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
14870    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
14871    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
14872    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
14873    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
14874    ///
14875    /// See also: [`cuMulticastAddDevice`], [`cuMulticastBindMem`], [`cuMulticastBindAddr`], [`cuMulticastUnbind`], [`cuMemCreate`], [`cuMemRelease`], [`cuMemExportToShareableHandle`], [`cuMemImportFromShareableHandle`], [`cuMulticastBindAddr_v2`], [`cuMulticastBindMem_v2`].
14876    pub fn cuMulticastCreate(
14877        mcHandle: *mut CUmemGenericAllocationHandle,
14878        prop: *const CUmulticastObjectProp,
14879    ) -> CUresult;
14880}
14881singe_loader::functions! { crate::DRIVER;
14882    /// Associate a device to a multicast object.
14883    ///
14884    /// Associates a device to a multicast object. The added device will be a part of the multicast team of size specified by [`CUmulticastObjectProp::numDevices`](CUmulticastObjectProp_st::numDevices) during [`cuMulticastCreate`]. The association of the device to the multicast object is permanent during the life time of the multicast object. All devices must be added to the multicast team before any memory can be bound to any device in the team. Any calls to [`cuMulticastBindMem`], [`cuMulticastBindMem_v2`], [`cuMulticastBindAddr`], or [`cuMulticastBindAddr_v2`] will block until all devices have been added. Similarly all devices must be added to the multicast team before a virtual address range can be mapped to the multicast object. A call to [`cuMemMap`] will block until all devices have been added.
14885    ///
14886    /// This call may fail with [`cudaError_enum::CUDA_ERROR_INVALID_DEVICE`] if the device specified by `dev` does not belong to the same clique as the other devices previously added to this multicast object.
14887    ///
14888    /// # Parameters
14889    ///
14890    /// - `mcHandle`: Handle representing a multicast object.
14891    /// - `dev`: Device that will be associated to the multicast object.
14892    ///
14893    /// # Return value
14894    ///
14895    /// - [`CUresult::CUDA_SUCCESS`]
14896    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14897    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
14898    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
14899    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
14900    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
14901    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
14902    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
14903    ///
14904    /// See also: [`cuMulticastCreate`], [`cuMulticastBindMem`], [`cuMulticastBindAddr`].
14905    pub fn cuMulticastAddDevice(
14906        mcHandle: CUmemGenericAllocationHandle,
14907        dev: CUdevice,
14908    ) -> CUresult;
14909}
14910singe_loader::functions! { crate::DRIVER;
14911    /// Bind a memory allocation represented by a handle to a multicast object.
14912    ///
14913    /// Binds a memory allocation specified by `memHandle` and created via [`cuMemCreate`] to a multicast object represented by `mcHandle` and created via [`cuMulticastCreate`]. The intended `size` of the bind, the offset in the multicast range `mcOffset` as well as the offset in the memory `memOffset` must be a multiple of the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_MINIMUM`]. For best performance however, `size`, `mcOffset` and `memOffset` should be aligned to the granularity of the memory allocation(see [`cuMemGetAllocationGranularity`]) or to the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_RECOMMENDED`].
14914    ///
14915    /// The `size` + `memOffset` cannot be larger than the size of the allocated memory. Similarly the `size` + `mcOffset` cannot be larger than the size of the multicast object.
14916    ///
14917    /// On systems with Rubin+ (SM_107+) GPUs, `memOffset` may be aligned to 256 instead of the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_MINIMUM`] or [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_RECOMMENDED`]. In such a case the `size` + `memOffset` cannot be larger than the size of the allocated memory. Similarly the `size` + `mcOffset` + the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_MINIMUM`] cannot be larger than the size of the than the size of the multicast object. The next available mcOffset for the next bind will be mcOffset + size + the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_MINIMUM`].
14918    ///
14919    /// Also note that the ability to accept a `memOffset` that is not aligned to the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_MINIMUM`] or [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_RECOMMENDED`] is limited by HW resources and may result in error [`cudaError_enum::CUDA_ERROR_MULTICAST_RESOURCE_FULL`]
14920    ///
14921    /// The memory allocation must have beeen created on one of the devices that was added to the multicast team via [`cuMulticastAddDevice`]. Externally shareable as well as imported multicast objects can be bound only to externally shareable memory. Note that this call will return [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`] if there are insufficient resources required to perform the bind. This call may also return [`CUresult::CUDA_ERROR_SYSTEM_NOT_READY`] if the necessary system software is not initialized or running.
14922    ///
14923    /// This call may fail if the devices added via [`cuMulticastAddDevice`] do not belong to the same clique.
14924    ///
14925    /// This call may return [`CUresult::CUDA_ERROR_ILLEGAL_STATE`] if the system configuration is in an illegal state. In such cases, to continue using multicast, verify that the system configuration is in a valid state and all required driver daemons are running properly.
14926    ///
14927    /// # Parameters
14928    ///
14929    /// - `mcHandle`: Handle representing a multicast object.
14930    /// - `mcOffset`: Offset into the multicast object for attachment.
14931    /// - `memHandle`: Handle representing a memory allocation.
14932    /// - `memOffset`: Offset into the memory for attachment.
14933    /// - `size`: Size of the memory that will be bound to the multicast object.
14934    /// - `flags`: Flags for future use, must be zero for now.
14935    ///
14936    /// # Return value
14937    ///
14938    /// - [`CUresult::CUDA_SUCCESS`]
14939    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14940    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
14941    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
14942    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
14943    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
14944    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
14945    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
14946    /// - [`CUresult::CUDA_ERROR_SYSTEM_NOT_READY`]
14947    /// - [`CUresult::CUDA_ERROR_ILLEGAL_STATE`]
14948    /// - [`CUresult::CUDA_ERROR_MULTICAST_RESOURCE_FULL`]
14949    ///
14950    /// See also: [`cuMulticastCreate`], [`cuMulticastAddDevice`], [`cuMemCreate`], [`cuMulticastBindMem_v2`].
14951    pub fn cuMulticastBindMem(
14952        mcHandle: CUmemGenericAllocationHandle,
14953        mcOffset: size_t,
14954        memHandle: CUmemGenericAllocationHandle,
14955        memOffset: size_t,
14956        size: size_t,
14957        flags: ::core::ffi::c_ulonglong,
14958    ) -> CUresult;
14959}
14960singe_loader::functions! { crate::DRIVER;
14961    /// Bind a memory allocation represented by a handle to a multicast object.
14962    ///
14963    /// Binds a memory allocation specified by `memHandle` and created via [`cuMemCreate`] to a multicast object represented by `mcHandle` and created via [`cuMulticastCreate`]. The binding will be applicable for the device `dev`. The intended `size` of the bind, the offset in the multicast range `mcOffset` as well as the offset in the memory `memOffset` must be a multiple of the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_MINIMUM`]. For best performance however, `size`, `mcOffset` and `memOffset` should be aligned to the granularity of the memory allocation(see [`cuMemGetAllocationGranularity`]) or to the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_RECOMMENDED`].
14964    ///
14965    /// The `size` + `memOffset` cannot be larger than the size of the allocated memory. Similarly the `size` + `mcOffset` cannot be larger than the size of the multicast object.
14966    ///
14967    /// On systems with Rubin+ (SM_107+) GPUs, `memOffset` may be aligned to 256 instead of the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_MINIMUM`] or [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_RECOMMENDED`]. In such a case the `size` + `memOffset` cannot be larger than the size of the allocated memory. Similarly the `size` + `mcOffset` + the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_MINIMUM`] cannot be larger than the size of the than the size of the multicast object. The next available mcOffset for the next bind will be mcOffset + size + the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_MINIMUM`].
14968    ///
14969    /// Also note that the ability to accept a `memOffset` that is not aligned to the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_MINIMUM`] or [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_RECOMMENDED`] is limited by HW resources and may result in error [`cudaError_enum::CUDA_ERROR_MULTICAST_RESOURCE_FULL`]
14970    ///
14971    /// The memory allocation must have beeen created on one of the devices that was added to the multicast team via [`cuMulticastAddDevice`]. For device memory, i.e., type [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`], the memory allocation must have been created on the device specified by `dev`. For host NUMA memory, i.e., type [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`], the memory allocation must have been created on the CPU NUMA node closest to `dev`. That is, the value returned when querying [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_HOST_NUMA_ID`] for `dev`, must be the CPU NUMA node where the memory was allocated. In both cases, the device named by `dev` must have been added to the multicast team via [`cuMulticastAddDevice`]. Externally shareable as well as imported multicast objects can be bound only to externally shareable memory. Note that this call will return [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`] if there are insufficient resources required to perform the bind. This call may also return [`CUresult::CUDA_ERROR_SYSTEM_NOT_READY`] if the necessary system software is not initialized or running.
14972    ///
14973    /// This call may fail if the devices added via [`cuMulticastAddDevice`] do not belong to the same clique.
14974    ///
14975    /// This call may return [`CUresult::CUDA_ERROR_ILLEGAL_STATE`] if the system configuration is in an illegal state. In such cases, to continue using multicast, verify that the system configuration is in a valid state and all required driver daemons are running properly.
14976    ///
14977    /// # Parameters
14978    ///
14979    /// - `mcHandle`: Handle representing a multicast object.
14980    /// - `dev`: The device that for which the multicast memory binding will be applicable.
14981    /// - `mcOffset`: Offset into the multicast object for attachment.
14982    /// - `memHandle`: Handle representing a memory allocation.
14983    /// - `memOffset`: Offset into the memory for attachment.
14984    /// - `size`: Size of the memory that will be bound to the multicast object.
14985    /// - `flags`: Flags for future use, must be zero for now.
14986    ///
14987    /// # Return value
14988    ///
14989    /// - [`CUresult::CUDA_SUCCESS`]
14990    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
14991    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
14992    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
14993    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
14994    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
14995    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
14996    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
14997    /// - [`CUresult::CUDA_ERROR_SYSTEM_NOT_READY`]
14998    /// - [`CUresult::CUDA_ERROR_ILLEGAL_STATE`]
14999    /// - [`CUresult::CUDA_ERROR_MULTICAST_RESOURCE_FULL`]
15000    ///
15001    /// See also: [`cuMulticastCreate`], [`cuMulticastAddDevice`], [`cuMemCreate`].
15002    pub fn cuMulticastBindMem_v2(
15003        mcHandle: CUmemGenericAllocationHandle,
15004        dev: CUdevice,
15005        mcOffset: size_t,
15006        memHandle: CUmemGenericAllocationHandle,
15007        memOffset: size_t,
15008        size: size_t,
15009        flags: ::core::ffi::c_ulonglong,
15010    ) -> CUresult;
15011}
15012singe_loader::functions! { crate::DRIVER;
15013    /// Bind a memory allocation represented by a virtual address to a multicast object.
15014    ///
15015    /// Binds a memory allocation specified by its mapped address `memptr` to a multicast object represented by `mcHandle`. The memory must have been allocated via [`cuMemCreate`] or `cudaMallocAsync`. The intended `size` of the bind, the offset in the multicast range `mcOffset` and `memptr` must be a multiple of the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_MINIMUM`]. For best performance however, `size`, `mcOffset` and `memptr` should be aligned to the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_RECOMMENDED`].
15016    ///
15017    /// The `size` cannot be larger than the size of the allocated memory. Similarly the `size` + `mcOffset` cannot be larger than the total size of the multicast object.
15018    ///
15019    /// On systems with Rubin+ (SM_107+) GPUs, `memptr` may be aligned to 256 instead of the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_MINIMUM`] or [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_RECOMMENDED`]. In such a case the `size` + `memptr` cannot be larger than the size of the allocated memory. Similarly the `size` + `mcOffset` + the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_MINIMUM`] cannot be larger than the size of the than the size of the multicast object. The next available mcOffset for the next bind will be mcOffset + size + the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_MINIMUM`]
15020    ///
15021    /// Also note that the ability to accept a `memptr` that is not aligned to the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_MINIMUM`] or [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_RECOMMENDED`] is limited by HW resources and may result in error [`cudaError_enum::CUDA_ERROR_MULTICAST_RESOURCE_FULL`]
15022    ///
15023    /// The memory allocation must have beeen created on one of the devices that was added to the multicast team via [`cuMulticastAddDevice`]. Externally shareable as well as imported multicast objects can be bound only to externally shareable memory. Note that this call will return [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`] if there are insufficient resources required to perform the bind. This call may also return [`CUresult::CUDA_ERROR_SYSTEM_NOT_READY`] if the necessary system software is not initialized or running.
15024    ///
15025    /// This call may fail if the devices added via [`cuMulticastAddDevice`] do not belong to the same clique.
15026    ///
15027    /// This call may return [`CUresult::CUDA_ERROR_ILLEGAL_STATE`] if the system configuration is in an illegal state. In such cases, to continue using multicast, verify that the system configuration is in a valid state and all required driver daemons are running properly.
15028    ///
15029    /// # Parameters
15030    ///
15031    /// - `mcHandle`: Handle representing a multicast object.
15032    /// - `mcOffset`: Offset into multicast va range for attachment.
15033    /// - `memptr`: Virtual address of the memory allocation.
15034    /// - `size`: Size of memory that will be bound to the multicast object.
15035    /// - `flags`: Flags for future use, must be zero now.
15036    ///
15037    /// # Return value
15038    ///
15039    /// - [`CUresult::CUDA_SUCCESS`]
15040    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
15041    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
15042    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
15043    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
15044    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
15045    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
15046    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
15047    /// - [`CUresult::CUDA_ERROR_SYSTEM_NOT_READY`]
15048    /// - [`CUresult::CUDA_ERROR_ILLEGAL_STATE`]
15049    /// - [`CUresult::CUDA_ERROR_MULTICAST_RESOURCE_FULL`]
15050    ///
15051    /// See also: [`cuMulticastCreate`], [`cuMulticastAddDevice`], [`cuMemCreate`], [`cuMulticastBindAddr_v2`].
15052    pub fn cuMulticastBindAddr(
15053        mcHandle: CUmemGenericAllocationHandle,
15054        mcOffset: size_t,
15055        memptr: CUdeviceptr,
15056        size: size_t,
15057        flags: ::core::ffi::c_ulonglong,
15058    ) -> CUresult;
15059}
15060singe_loader::functions! { crate::DRIVER;
15061    /// Bind a memory allocation represented by a virtual address to a multicast object.
15062    ///
15063    /// Binds a memory allocation specified by its mapped address `memptr` to a multicast object represented by `mcHandle`. The binding will be applicable for the device `dev`. The memory must have been allocated via [`cuMemCreate`] or `cudaMallocAsync`. The intended `size` of the bind, the offset in the multicast range `mcOffset` and `memptr` must be a multiple of the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_MINIMUM`]. For best performance however, `size`, `mcOffset` and `memptr` should be aligned to the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_RECOMMENDED`].
15064    ///
15065    /// The `size` cannot be larger than the size of the allocated memory. Similarly the `size` + `mcOffset` cannot be larger than the total size of the multicast object.
15066    ///
15067    /// On systems with Rubin+ (SM_107+) GPUs, `memptr` may be aligned to 256 instead of the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_MINIMUM`] or [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_RECOMMENDED`]. In such a case the `size` + `memptr` cannot be larger than the size of the allocated memory. Similarly the `size` + `mcOffset` + the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_MINIMUM`] cannot be larger than the size of the than the size of the multicast object. The next available mcOffset for the next bind will be mcOffset + size + the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_MINIMUM`]
15068    ///
15069    /// Also note that the ability to accept a `memptr` that is not aligned to the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_MINIMUM`] or [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_RECOMMENDED`] is limited by HW resources and may result in error [`cudaError_enum::CUDA_ERROR_MULTICAST_RESOURCE_FULL`]
15070    ///
15071    /// For device memory, i.e., type [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`], the memory allocation must have been created on the device specified by `dev`. For host NUMA memory, i.e., type [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`], the memory allocation must have been created on the CPU NUMA node closest to `dev`. That is, the value returned when querying [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_HOST_NUMA_ID`] for `dev`, must be the CPU NUMA node where the memory was allocated. In both cases, the device named by `dev` must have been added to the multicast team via [`cuMulticastAddDevice`]. Externally shareable as well as imported multicast objects can be bound only to externally shareable memory. Note that this call will return [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`] if there are insufficient resources required to perform the bind. This call may also return [`CUresult::CUDA_ERROR_SYSTEM_NOT_READY`] if the necessary system software is not initialized or running.
15072    ///
15073    /// This call may fail if the devices added via [`cuMulticastAddDevice`] do not belong to the same clique.
15074    ///
15075    /// This call may return [`CUresult::CUDA_ERROR_ILLEGAL_STATE`] if the system configuration is in an illegal state. In such cases, to continue using multicast, verify that the system configuration is in a valid state and all required driver daemons are running properly.
15076    ///
15077    /// # Parameters
15078    ///
15079    /// - `mcHandle`: Handle representing a multicast object.
15080    /// - `dev`: The device that for which the multicast memory binding will be applicable.
15081    /// - `mcOffset`: Offset into multicast va range for attachment.
15082    /// - `memptr`: Virtual address of the memory allocation.
15083    /// - `size`: Size of memory that will be bound to the multicast object.
15084    /// - `flags`: Flags for future use, must be zero now.
15085    ///
15086    /// # Return value
15087    ///
15088    /// - [`CUresult::CUDA_SUCCESS`]
15089    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
15090    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
15091    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
15092    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
15093    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
15094    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
15095    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
15096    /// - [`CUresult::CUDA_ERROR_SYSTEM_NOT_READY`]
15097    /// - [`CUresult::CUDA_ERROR_ILLEGAL_STATE`]
15098    /// - [`CUresult::CUDA_ERROR_MULTICAST_RESOURCE_FULL`]
15099    ///
15100    /// See also: [`cuMulticastCreate`], [`cuMulticastAddDevice`], [`cuMemCreate`].
15101    pub fn cuMulticastBindAddr_v2(
15102        mcHandle: CUmemGenericAllocationHandle,
15103        dev: CUdevice,
15104        mcOffset: size_t,
15105        memptr: CUdeviceptr,
15106        size: size_t,
15107        flags: ::core::ffi::c_ulonglong,
15108    ) -> CUresult;
15109}
15110singe_loader::functions! { crate::DRIVER;
15111    /// Unbind any memory allocations bound to a multicast object at a given offset and upto a given size.
15112    ///
15113    /// Unbinds any memory allocations hosted on `dev` and bound to a multicast object at `mcOffset` and upto a given `size`. The intended `size` of the unbind and the offset in the multicast range ( `mcOffset` ) must be a multiple of the value returned by [`cuMulticastGetGranularity`] flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_MINIMUM`]. The `size` + `mcOffset` cannot be larger than the total size of the multicast object.
15114    ///
15115    /// Note: Warning: The `mcOffset` and the `size` must match the corresponding values specified during the bind call. Any other values may result in undefined behavior.
15116    ///
15117    /// # Parameters
15118    ///
15119    /// - `mcHandle`: Handle representing a multicast object.
15120    /// - `dev`: Device that hosts the memory allocation.
15121    /// - `mcOffset`: Offset into the multicast object.
15122    /// - `size`: Desired size to unbind.
15123    ///
15124    /// # Return value
15125    ///
15126    /// - [`CUresult::CUDA_SUCCESS`]
15127    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
15128    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
15129    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
15130    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
15131    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
15132    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
15133    ///
15134    /// See also: [`cuMulticastBindMem`], [`cuMulticastBindAddr`], [`cuMulticastBindMem_v2`], [`cuMulticastBindAddr_v2`].
15135    pub fn cuMulticastUnbind(
15136        mcHandle: CUmemGenericAllocationHandle,
15137        dev: CUdevice,
15138        mcOffset: size_t,
15139        size: size_t,
15140    ) -> CUresult;
15141}
15142singe_loader::functions! { crate::DRIVER;
15143    /// Calculates either the minimal or recommended granularity for multicast object.
15144    ///
15145    /// Calculates either the minimal or recommended granularity for a given set of multicast object properties and returns it in granularity. This granularity can be used as a multiple for size, bind offsets and address mappings of the multicast object.
15146    ///
15147    /// # Parameters
15148    ///
15149    /// - `granularity`: Returned granularity.
15150    /// - `prop`: Properties of the multicast object.
15151    /// - `option`: Determines which granularity to return.
15152    ///
15153    /// # Return value
15154    ///
15155    /// - [`CUresult::CUDA_SUCCESS`]
15156    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
15157    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
15158    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
15159    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
15160    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
15161    ///
15162    /// See also: [`cuMulticastCreate`], [`cuMulticastBindMem`], [`cuMulticastBindAddr`], [`cuMulticastUnbind`], [`cuMulticastBindMem_v2`], [`cuMulticastBindAddr_v2`].
15163    pub fn cuMulticastGetGranularity(
15164        granularity: *mut size_t,
15165        prop: *const CUmulticastObjectProp,
15166        option: CUmulticastGranularity_flags,
15167    ) -> CUresult;
15168}
15169impl CUcliqueType_enum {
15170    /// Unicast pointer clique.
15171    pub const CU_CLIQUE_TYPE_UNICAST_POINTER: CUcliqueType_enum = CUcliqueType_enum(0);
15172    /// Multicast pointer clique.
15173    pub const CU_CLIQUE_TYPE_MULTICAST_POINTER: CUcliqueType_enum = CUcliqueType_enum(1);
15174    /// Unicast logical endpoint clique.
15175    pub const CU_CLIQUE_TYPE_UNICAST_LOGICAL_ENDPOINT: CUcliqueType_enum = CUcliqueType_enum(
15176        2,
15177    );
15178    /// Multicast logical endpoint clique.
15179    pub const CU_CLIQUE_TYPE_MULTICAST_LOGICAL_ENDPOINT: CUcliqueType_enum = CUcliqueType_enum(
15180        3,
15181    );
15182}
15183/// Fabric clique types.
15184#[repr(transparent)]
15185#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
15186pub struct CUcliqueType_enum(pub ::core::ffi::c_uint);
15187pub use self::CUcliqueType_enum as CUcliqueType;
15188/// Fabric clique information.
15189#[repr(C)]
15190#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
15191pub struct CUcliqueInfo_st {
15192    /// Type of the fabric clique.
15193    pub type_: CUcliqueType,
15194    /// ID of the fabric clique.
15195    pub id: ::core::ffi::c_uint,
15196}
15197impl Default for CUcliqueInfo_st {
15198    fn default() -> Self {
15199        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
15200        unsafe {
15201            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
15202            s.assume_init()
15203        }
15204    }
15205}
15206/// Fabric clique information.
15207pub type CUcliqueInfo = CUcliqueInfo_st;
15208singe_loader::functions! { crate::DRIVER;
15209    /// Retrieves the fabric cluster UUID.
15210    ///
15211    /// Retrieves the fabric cluster UUID for the given device.
15212    ///
15213    /// # Parameters
15214    ///
15215    /// - `uuid`: Fabric cluster UUID.
15216    /// - `dev`: Device for which the fabric cluster UUID is requested.
15217    ///
15218    /// # Return value
15219    ///
15220    /// - [`CUresult::CUDA_SUCCESS`]
15221    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
15222    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
15223    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
15224    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
15225    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
15226    pub fn cuDeviceGetFabricClusterUuid(uuid: *mut CUuuid, dev: CUdevice) -> CUresult;
15227}
15228singe_loader::functions! { crate::DRIVER;
15229    /// Retrieves the number of fabric cliques.
15230    ///
15231    /// Retrieves the number of fabric cliques that the device is part of.
15232    ///
15233    /// # Parameters
15234    ///
15235    /// - `count`: Number of fabric cliques that the device is part of.
15236    /// - `dev`: Device for which the number of fabric cliques is requested.
15237    ///
15238    /// # Return value
15239    ///
15240    /// - [`CUresult::CUDA_SUCCESS`]
15241    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
15242    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
15243    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
15244    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
15245    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
15246    pub fn cuDeviceGetCliqueCount(count: *mut size_t, dev: CUdevice) -> CUresult;
15247}
15248singe_loader::functions! { crate::DRIVER;
15249    /// Retrieves fabric clique information.
15250    ///
15251    /// Returns the fabric clique information for the cliques that the device is a part of. User must specify the size of the `cliqueInfo` array in `count`. The same parameter `count` will return the actual number of entries updated in the `cliqueInfo` array.
15252    ///
15253    /// # Parameters
15254    ///
15255    /// - `cliqueInfo`: Array to store the fabric clique information.
15256    /// - `count`: Input: Size of the `cliqueInfo` array. Output: Number of entries updated in the `cliqueInfo` array.
15257    /// - `dev`: Device for which the clique information is requested.
15258    ///
15259    /// # Return value
15260    ///
15261    /// - [`CUresult::CUDA_SUCCESS`]
15262    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
15263    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
15264    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
15265    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
15266    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
15267    pub fn cuDeviceGetCliqueInfo(
15268        cliqueInfo: *mut CUcliqueInfo,
15269        count: *mut size_t,
15270        dev: CUdevice,
15271    ) -> CUresult;
15272}
15273/// An ID that represents a logical endpoint.
15274pub type CUlogicalEndpointId = cuuint32_t;
15275impl CUlogicalEndpointIpcHandleType_enum {
15276    /// Does not request an IPC handle for the logical endpoint.
15277    pub const CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_NONE: CUlogicalEndpointIpcHandleType_enum = CUlogicalEndpointIpcHandleType_enum(
15278        0,
15279    );
15280    /// Uses a fabric handle to share the logical endpoint.
15281    pub const CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_FABRIC: CUlogicalEndpointIpcHandleType_enum = CUlogicalEndpointIpcHandleType_enum(
15282        1,
15283    );
15284}
15285/// IPC handle types that can be requested/queried for a given logical endpoint.
15286#[repr(transparent)]
15287#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
15288pub struct CUlogicalEndpointIpcHandleType_enum(pub ::core::ffi::c_uint);
15289pub use self::CUlogicalEndpointIpcHandleType_enum as CUlogicalEndpointIpcHandleType;
15290/// Fabric handle for a logical endpoint.
15291#[repr(C)]
15292#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
15293pub struct CUlogicalEndpointFabricHandle_st {
15294    /// Opaque bytes of the fabric handle used to share a logical endpoint.
15295    pub data: [::core::ffi::c_uchar; 64usize],
15296}
15297impl Default for CUlogicalEndpointFabricHandle_st {
15298    fn default() -> Self {
15299        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
15300        unsafe {
15301            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
15302            s.assume_init()
15303        }
15304    }
15305}
15306/// Fabric handle for a logical endpoint.
15307pub type CUlogicalEndpointFabricHandle = CUlogicalEndpointFabricHandle_st;
15308impl CUlogicalEndpointType_enum {
15309    /// No valid logical endpoint type is selected.
15310    pub const CU_LOGICAL_ENDPOINT_TYPE_INVALID: CUlogicalEndpointType_enum = CUlogicalEndpointType_enum(
15311        0,
15312    );
15313    /// Selects one device as the destination logical endpoint.
15314    pub const CU_LOGICAL_ENDPOINT_TYPE_UNICAST: CUlogicalEndpointType_enum = CUlogicalEndpointType_enum(
15315        1,
15316    );
15317    /// Selects a multicast group as the destination logical endpoint.
15318    pub const CU_LOGICAL_ENDPOINT_TYPE_MULTICAST: CUlogicalEndpointType_enum = CUlogicalEndpointType_enum(
15319        2,
15320    );
15321}
15322/// Logical endpoint type.
15323#[repr(transparent)]
15324#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
15325pub struct CUlogicalEndpointType_enum(pub ::core::ffi::c_uint);
15326pub use self::CUlogicalEndpointType_enum as CUlogicalEndpointType;
15327impl CUlogicalEndpointFlag_enum {
15328    /// Default flag for logical endpoint construction.
15329    pub const CU_LOGICAL_ENDPOINT_FLAG_NONE: CUlogicalEndpointFlag_enum = CUlogicalEndpointFlag_enum(
15330        0,
15331    );
15332    /// Indicate the programmer’s intention to use counted operations with the logical endpoint.
15333    pub const CU_LOGICAL_ENDPOINT_FLAG_COUNTED_OPS: CUlogicalEndpointFlag_enum = CUlogicalEndpointFlag_enum(
15334        1,
15335    );
15336}
15337/// Flags for [`CUlogicalEndpointProp`].
15338#[repr(transparent)]
15339#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
15340pub struct CUlogicalEndpointFlag_enum(pub ::core::ffi::c_uint);
15341pub use self::CUlogicalEndpointFlag_enum as CUlogicalEndpointFlag;
15342/// Properties of a logical endpoint construction.
15343#[repr(C)]
15344#[derive(Copy, Clone)]
15345pub struct CUlogicalEndpointProp_struct {
15346    /// Type of the logical endpoint defined in [`CUlogicalEndpointType`].
15347    pub type_: CUlogicalEndpointType,
15348    /// Anonymous native member. See [`CUlogicalEndpointProp_struct__bindgen_ty_1`] for its fields.
15349    pub __bindgen_anon_1: CUlogicalEndpointProp_struct__bindgen_ty_1,
15350    /// Size of the logical endpoint.
15351    pub size: ::core::ffi::c_ulonglong,
15352    /// A bitmask of IPC handle types defined in [`CUlogicalEndpointIpcHandleType`].
15353    pub ipcHandleTypes: ::core::ffi::c_uint,
15354    /// A bitmask of flags defined in [`CUlogicalEndpointFlag`].
15355    pub flags: ::core::ffi::c_uint,
15356}
15357/// Anonymous native union in [`CUlogicalEndpointProp_struct`]. Its members share the same storage.
15358#[repr(C)]
15359#[derive(Copy, Clone)]
15360pub union CUlogicalEndpointProp_struct__bindgen_ty_1 {
15361    /// Owner-device properties for a unicast logical endpoint.
15362    pub unicast: CUlogicalEndpointProp_struct__bindgen_ty_1__bindgen_ty_1,
15363    /// Multicast-object properties for a multicast logical endpoint.
15364    pub multicast: CUlogicalEndpointProp_struct__bindgen_ty_1__bindgen_ty_2,
15365}
15366/// Native layout of the `unicast` member of [`CUlogicalEndpointProp_struct__bindgen_ty_1`].
15367#[repr(C)]
15368#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
15369pub struct CUlogicalEndpointProp_struct__bindgen_ty_1__bindgen_ty_1 {
15370    /// Owner device of the unicast logical endpoint
15371    pub device: CUdevice,
15372}
15373/// Native layout of the `multicast` member of [`CUlogicalEndpointProp_struct__bindgen_ty_1`].
15374#[repr(C)]
15375#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
15376pub struct CUlogicalEndpointProp_struct__bindgen_ty_1__bindgen_ty_2 {
15377    /// Number of devices in the multicast logical endpoint team
15378    pub numDevices: ::core::ffi::c_uint,
15379}
15380impl Default for CUlogicalEndpointProp_struct__bindgen_ty_1 {
15381    fn default() -> Self {
15382        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
15383        unsafe {
15384            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
15385            s.assume_init()
15386        }
15387    }
15388}
15389impl Default for CUlogicalEndpointProp_struct {
15390    fn default() -> Self {
15391        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
15392        unsafe {
15393            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
15394            s.assume_init()
15395        }
15396    }
15397}
15398/// Properties of a logical endpoint construction.
15399pub type CUlogicalEndpointProp = CUlogicalEndpointProp_struct;
15400singe_loader::functions! { crate::DRIVER;
15401    /// Reserves a range of logical endpoint ids.
15402    ///
15403    /// Reserves a range of logical endpoint ids starting at `*baseLeId` and extending for `count`. The reserved ids can be used to create or import logical endpoints via [`cuLogicalEndpointCreate`] or [`cuLogicalEndpointImport`] respectively.
15404    ///
15405    /// # Parameters
15406    ///
15407    /// - `baseLeId`: If [`cuLogicalEndpointIdReserve`] returns [`CUresult::CUDA_SUCCESS`], \*baseLeId contains the base logical endpoint id of the reserved logical endpoint id range.
15408    /// - `count`: The number of logical endpoint ids to reserve.
15409    ///
15410    /// # Return value
15411    ///
15412    /// - [`CUresult::CUDA_SUCCESS`]
15413    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
15414    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
15415    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
15416    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
15417    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
15418    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
15419    ///
15420    /// See also: [`cuLogicalEndpointCreate`], [`cuLogicalEndpointAddDevice`], [`cuLogicalEndpointDestroy`], [`cuLogicalEndpointBindAddr`], [`cuLogicalEndpointBindMem`], [`cuLogicalEndpointUnbind`], [`cuLogicalEndpointExport`], [`cuLogicalEndpointImport`], [`cuLogicalEndpointGetLimits`], [`cuLogicalEndpointQuery`].
15421    pub fn cuLogicalEndpointIdReserve(
15422        baseLeId: *mut CUlogicalEndpointId,
15423        count: cuuint32_t,
15424    ) -> CUresult;
15425}
15426singe_loader::functions! { crate::DRIVER;
15427    /// Releases a range of logical endpoint ids.
15428    ///
15429    /// Releases up to `count` logical endpoint ids starting at `baseLeId`. The range of ids represented by `baseLeId`, `baseLeId` + `count`) must all be previously reserved. All logical endpoints in the range must be destroyed before they can be released.
15430    ///
15431    /// # Parameters
15432    ///
15433    /// - `baseLeId`: First logical endpoint id to be released back to the system.
15434    /// - `count`: Number of logical endpoint ids to release back to the system.
15435    ///
15436    /// # Return value
15437    ///
15438    /// - [`CUresult::CUDA_SUCCESS`
15439    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
15440    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
15441    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
15442    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
15443    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
15444    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
15445    ///
15446    /// See also: [`cuLogicalEndpointCreate`], [`cuLogicalEndpointAddDevice`], [`cuLogicalEndpointDestroy`], [`cuLogicalEndpointBindAddr`], [`cuLogicalEndpointBindMem`], [`cuLogicalEndpointUnbind`], [`cuLogicalEndpointExport`], [`cuLogicalEndpointImport`], [`cuLogicalEndpointGetLimits`], [`cuLogicalEndpointQuery`].
15447    pub fn cuLogicalEndpointIdRelease(
15448        baseLeId: CUlogicalEndpointId,
15449        count: cuuint32_t,
15450    ) -> CUresult;
15451}
15452singe_loader::functions! { crate::DRIVER;
15453    /// Creates a logical endpoint with the requested properties and associates it with the logical endpoint id.
15454    ///
15455    /// This creates a logical endpoint as described by `prop`. The number of participating devices is determined by the [`CUlogicalEndpointProp::type`](CUlogicalEndpointProp_struct::type_). If the type is [`CUlogicalEndpointType::CU_LOGICAL_ENDPOINT_TYPE_UNICAST`] then `CUlogicalEndpointProp::unicast::device` specifies the owner device of the unicast logical endpoint. If the type is [`CUlogicalEndpointType::CU_LOGICAL_ENDPOINT_TYPE_MULTICAST`] then `CUlogicalEndpointProp::multicast::numDevices` specifies the number of devices in the multicast logical endpoint team.
15456    ///
15457    /// Devices can be added to a multicast logical endpoint via [`cuLogicalEndpointAddDevice`]. After all the participating devices have been added, a call to [`cuLogicalEndpointQuery`] must be made to ensure that the logical endpoint is ready for memory binding and access.
15458    ///
15459    /// A unicast logical endpoint does not have a notion of adding devices via [`cuLogicalEndpointAddDevice`]. However, a call to [`cuLogicalEndpointQuery`] must still be made to ensure that the logical endpoint is ready for memory binding and access.
15460    ///
15461    /// Memory is bound to the logical endpoint via either [`cuLogicalEndpointBindAddr`] or [`cuLogicalEndpointBindMem`], and can be unbound via [`cuLogicalEndpointUnbind`]. The total amount of memory that can be bound per device is specified by [`CUlogicalEndpointProp::size`](CUlogicalEndpointProp_struct::size). This size must be a multiple of the value for `bindAlignment` as returned by [`cuLogicalEndpointGetLimits`]. The maximum size for the logical endpoint cannot exceed the value for `maxSize` as returned by [`cuLogicalEndpointGetLimits`]. The bind alignment and maximum size depend on the properties of the logical endpoint.
15462    ///
15463    /// # Parameters
15464    ///
15465    /// - `leId`: Logical endpoint id that will be associated with the newly created logical endpoint.
15466    /// - `prop`: Properties of the logical endpoint to create.
15467    ///
15468    /// # Return value
15469    ///
15470    /// - [`CUresult::CUDA_SUCCESS`]
15471    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
15472    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
15473    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
15474    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
15475    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
15476    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
15477    ///
15478    /// See also: [`cuLogicalEndpointIdReserve`], [`cuLogicalEndpointIdRelease`], [`cuLogicalEndpointAddDevice`], [`cuLogicalEndpointDestroy`], [`cuLogicalEndpointBindAddr`], [`cuLogicalEndpointBindMem`], [`cuLogicalEndpointUnbind`], [`cuLogicalEndpointExport`], [`cuLogicalEndpointImport`], [`cuLogicalEndpointGetLimits`], [`cuLogicalEndpointQuery`].
15479    pub fn cuLogicalEndpointCreate(
15480        leId: CUlogicalEndpointId,
15481        prop: *const CUlogicalEndpointProp,
15482    ) -> CUresult;
15483}
15484singe_loader::functions! { crate::DRIVER;
15485    /// Associates a device to a multicast logical endpoint.
15486    ///
15487    /// Associates a device to a logical endpoint. The type of the logical endpoint must be [`CUlogicalEndpointType::CU_LOGICAL_ENDPOINT_TYPE_MULTICAST`]. The added device will be a part of the multicast team of size specified by CUlogicalEndpointProp::multicast::numDevices during [`cuLogicalEndpointCreate`]. The association of the device to the multicast logical endpoint is permanent during the life time of the multicast logical endpoint. All devices must be added to the multicast logical endpoint before any memory can be bound to any device in the team. A multicast logical endpoint will not be ready for use until all devices have been added. User can query whether the logical endpoint is ready for use via [`cuLogicalEndpointQuery`].
15488    ///
15489    /// This call may fail with [`cudaError_enum::CUDA_ERROR_INVALID_DEVICE`] if the device specified by `dev` does not belong to the same clique as the other devices previously added to this multicast logical endpoint.
15490    ///
15491    /// # Parameters
15492    ///
15493    /// - `leId`: Logical endpoint id representing a multicast logical endpoint.
15494    /// - `dev`: Device that will be associated with the multicast logical endpoint.
15495    ///
15496    /// # Return value
15497    ///
15498    /// - [`CUresult::CUDA_SUCCESS`]
15499    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
15500    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
15501    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
15502    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
15503    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
15504    ///
15505    /// See also: [`cuLogicalEndpointCreate`], [`cuLogicalEndpointIdReserve`], [`cuLogicalEndpointIdRelease`], [`cuLogicalEndpointDestroy`], [`cuLogicalEndpointBindAddr`], [`cuLogicalEndpointBindMem`], [`cuLogicalEndpointUnbind`], [`cuLogicalEndpointExport`], [`cuLogicalEndpointImport`], [`cuLogicalEndpointGetLimits`], [`cuLogicalEndpointQuery`].
15506    pub fn cuLogicalEndpointAddDevice(
15507        leId: CUlogicalEndpointId,
15508        dev: CUdevice,
15509    ) -> CUresult;
15510}
15511singe_loader::functions! { crate::DRIVER;
15512    /// Removes the association of the logical endpoint from the logical endpoint id.
15513    ///
15514    /// Removes the association between the logical endpoint id and the logical endpoint resources. Any memory bound by this process to any device associated with the logical endpoint will be unbound. If this was the last reference to the logical endpoint, all associated resources will be destroyed.
15515    ///
15516    /// # Parameters
15517    ///
15518    /// - `leId`: Logical endpoint id of the logical endpoint to be destroyed.
15519    ///
15520    /// # Return value
15521    ///
15522    /// - [`CUresult::CUDA_SUCCESS`]
15523    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
15524    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
15525    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
15526    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
15527    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
15528    ///
15529    /// See also: [`cuLogicalEndpointCreate`], [`cuLogicalEndpointIdReserve`], [`cuLogicalEndpointIdRelease`], [`cuLogicalEndpointAddDevice`], [`cuLogicalEndpointBindAddr`], [`cuLogicalEndpointBindMem`], [`cuLogicalEndpointUnbind`], [`cuLogicalEndpointExport`], [`cuLogicalEndpointImport`], [`cuLogicalEndpointGetLimits`], [`cuLogicalEndpointQuery`].
15530    pub fn cuLogicalEndpointDestroy(leId: CUlogicalEndpointId) -> CUresult;
15531}
15532singe_loader::functions! { crate::DRIVER;
15533    /// Bind a memory allocation represented by a virtual address to a logical endpoint.
15534    ///
15535    /// Binds the memory allocation specified by its mapped address `ptr` to a logical endpoint represented by `leId` at the offset `offset`. The memory must have been allocated via [`cuMemCreate`] or `cudaMallocAsync`. The intended `size` of the bind, the `offset` in the logical endpoint range and `ptr` must be multiples of the value for `bindAlignment` as returned by [`cuLogicalEndpointGetLimits`].
15536    ///
15537    /// The `size` cannot be larger than the size of the allocated memory. Similarly the `size` + `offset` cannot be larger than the total size of the logical endpoint.
15538    ///
15539    /// For device memory, i.e., type [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`], the memory allocation must have been created on the device specified by `dev`. For host NUMA memory, i.e., type [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`], the memory allocation must have been created on the CPU NUMA node closest to `dev`. That is, the value returned when querying [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_HOST_NUMA_ID`] for `dev`, must be the CPU NUMA node where the memory was allocated.
15540    ///
15541    /// For multicast endpoints, the device named by `dev` must have been added to the multicast team via [`cuLogicalEndpointAddDevice`].
15542    ///
15543    /// For unicast endpoints the device named by `dev` must be the owner device specified during [`cuLogicalEndpointCreate`] via `CUlogicalEndpointProp::unicast::device`.
15544    ///
15545    /// Externally shareable as well as imported multicast endpoints can be bound only to externally shareable memory. Imported unicast endpoints cannot be bound to any memory.
15546    ///
15547    /// This call will return [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] if [`cuLogicalEndpointQuery`] has not been called for the logical endpoint to ensure that the endpoint is ready for memory binding.
15548    ///
15549    /// Note that this call will return [`cudaError_enum::CUDA_ERROR_OUT_OF_MEMORY`] if there are insufficient resources required to perform the bind. This call may also return [`cudaError_enum::CUDA_ERROR_SYSTEM_NOT_READY`] if the necessary system software is not initialized or running. This call may return [`cudaError_enum::CUDA_ERROR_ILLEGAL_STATE`] if the system configuration is in an illegal state. In such cases, to continue using logical endpoints, verify that the system configuration is in a valid state and all required driver daemons are running properly.
15550    ///
15551    /// # Parameters
15552    ///
15553    /// - `leId`: Logical endpoint to which memory will be associated.
15554    /// - `dev`: Device on which the memory will be bound to the logical endpoint.
15555    /// - `offset`: Offset into the logical endpoint space.
15556    /// - `ptr`: Virtual address of the memory allocation.
15557    /// - `size`: Size of memory that will be bound to the logical endpoint.
15558    /// - `flags`: Flags for future use, must be zero for now.
15559    ///
15560    /// # Return value
15561    ///
15562    /// - [`CUresult::CUDA_SUCCESS`]
15563    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
15564    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
15565    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
15566    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
15567    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
15568    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
15569    /// - [`CUresult::CUDA_ERROR_SYSTEM_NOT_READY`]
15570    /// - [`CUresult::CUDA_ERROR_ILLEGAL_STATE`]
15571    ///
15572    /// See also: [`cuLogicalEndpointCreate`], [`cuLogicalEndpointIdReserve`], [`cuLogicalEndpointIdRelease`], [`cuLogicalEndpointAddDevice`], [`cuLogicalEndpointDestroy`], [`cuLogicalEndpointBindMem`], [`cuLogicalEndpointUnbind`], [`cuLogicalEndpointExport`], [`cuLogicalEndpointImport`], [`cuLogicalEndpointGetLimits`], [`cuLogicalEndpointQuery`].
15573    pub fn cuLogicalEndpointBindAddr(
15574        leId: CUlogicalEndpointId,
15575        dev: CUdevice,
15576        offset: cuuint64_t,
15577        ptr: *mut ::core::ffi::c_void,
15578        size: cuuint64_t,
15579        flags: ::core::ffi::c_ulonglong,
15580    ) -> CUresult;
15581}
15582singe_loader::functions! { crate::DRIVER;
15583    /// Binds memory object represented by a handle to the logical endpoint.
15584    ///
15585    /// Binds the memory allocation specified by `memHandle` to a logical endpoint represented by `leId` at the offset `offset`. The memory must have been allocated via [`cuMemCreate`]. The intended `size` of the bind, the offset in the logical endpoint range `offset` and the offset in the memory handle `memOffset` must be multiples of the value for `bindAlignment` as returned by [`cuLogicalEndpointGetLimits`].
15586    ///
15587    /// The `size` + `memOffset` cannot be larger than the size of the allocated memory. Similarly the `size` + `offset` cannot be larger than the total size of the logical endpoint.
15588    ///
15589    /// For device memory, i.e., type [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`], the memory allocation must have been created on the device specified by `dev`. For host NUMA memory, i.e., type [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`], the memory allocation must have been created on the CPU NUMA node closest to `dev`. That is, the value returned when querying [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_HOST_NUMA_ID`] for `dev`, must be the CPU NUMA node where the memory was allocated.
15590    ///
15591    /// For multicast endpoints, the device named by `dev` must have been added to the multicast team via [`cuLogicalEndpointAddDevice`].
15592    ///
15593    /// For unicast endpoints the device named by `dev` must be the owner device specified during [`cuLogicalEndpointCreate`] via `CUlogicalEndpointProp::unicast::device`.
15594    ///
15595    /// Externally shareable as well as imported multicast endpoints can be bound only to externally shareable memory. Imported unicast endpoints cannot be bound to any memory.
15596    ///
15597    /// This call will return [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] if [`cuLogicalEndpointQuery`] has not been called for the logical endpoint to ensure that the endpoint is ready for memory binding.
15598    ///
15599    /// Note that this call will return [`cudaError_enum::CUDA_ERROR_OUT_OF_MEMORY`] if there are insufficient resources required to perform the bind. This call may also return [`cudaError_enum::CUDA_ERROR_SYSTEM_NOT_READY`] if the necessary system software is not initialized or running. This call may return [`cudaError_enum::CUDA_ERROR_ILLEGAL_STATE`] if the system configuration is in an illegal state. In such cases, to continue using logical endpoints, verify that the system configuration is in a valid state and all required driver daemons are running properly.
15600    ///
15601    /// # Parameters
15602    ///
15603    /// - `leId`: Logical endpoint to which memory will be associated.
15604    /// - `dev`: Device on which the memory will be bound to the logical endpoint.
15605    /// - `offset`: Offset into the logical endpoint space.
15606    /// - `memHandle`: Handle representing a memory allocation.
15607    /// - `memOffset`: Offset into the memory for the attachment.
15608    /// - `size`: Size of memory that will be bound to the logical endpoint.
15609    /// - `flags`: Flags for future use, must be zero for now.
15610    ///
15611    /// # Return value
15612    ///
15613    /// - [`CUresult::CUDA_SUCCESS`]
15614    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
15615    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
15616    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
15617    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
15618    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
15619    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
15620    /// - [`CUresult::CUDA_ERROR_SYSTEM_NOT_READY`]
15621    /// - [`CUresult::CUDA_ERROR_ILLEGAL_STATE`]
15622    ///
15623    /// See also: [`cuLogicalEndpointCreate`], [`cuLogicalEndpointIdReserve`], [`cuLogicalEndpointIdRelease`], [`cuLogicalEndpointAddDevice`], [`cuLogicalEndpointDestroy`], [`cuLogicalEndpointBindAddr`], [`cuLogicalEndpointUnbind`], [`cuLogicalEndpointExport`], [`cuLogicalEndpointImport`], [`cuLogicalEndpointGetLimits`], [`cuLogicalEndpointQuery`].
15624    pub fn cuLogicalEndpointBindMem(
15625        leId: CUlogicalEndpointId,
15626        dev: CUdevice,
15627        offset: cuuint64_t,
15628        memHandle: CUmemGenericAllocationHandle,
15629        memOffset: cuuint64_t,
15630        size: cuuint64_t,
15631        flags: ::core::ffi::c_ulonglong,
15632    ) -> CUresult;
15633}
15634singe_loader::functions! { crate::DRIVER;
15635    /// Unbinds any binding at offset from the logical endpoint.
15636    ///
15637    /// Unbinds any memory allocations bound to the logical endpoint on `dev` at `offset` and up to the given `size`. The intended `size` of the unbind and the offset in the logical endpoint range `offset` must be multiples of the value for `bindAlignment` as returned by [`cuLogicalEndpointGetLimits`].
15638    ///
15639    /// Note: The `offset` must correspond to a value specified during a bind call. The `size` must either match the bind call of the offset or be the combined `size` of multiple bind calls. The `size` + `offset` must fully enclose all bindings that are covered.
15640    ///
15641    /// # Parameters
15642    ///
15643    /// - `leId`: Logical endpoint id representing a logical endpoint.
15644    /// - `dev`: Device on which the memory is bound to the logical endpoint.
15645    /// - `offset`: Offset into the logical endpoint.
15646    /// - `size`: Desired size to unbind.
15647    ///
15648    /// # Return value
15649    ///
15650    /// - [`CUresult::CUDA_SUCCESS`]
15651    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
15652    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
15653    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
15654    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
15655    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
15656    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
15657    /// - [`CUresult::CUDA_ERROR_SYSTEM_NOT_READY`]
15658    /// - [`CUresult::CUDA_ERROR_ILLEGAL_STATE`]
15659    ///
15660    /// See also: [`cuLogicalEndpointCreate`], [`cuLogicalEndpointIdReserve`], [`cuLogicalEndpointIdRelease`], [`cuLogicalEndpointAddDevice`], [`cuLogicalEndpointDestroy`], [`cuLogicalEndpointBindAddr`], [`cuLogicalEndpointBindMem`], [`cuLogicalEndpointExport`], [`cuLogicalEndpointImport`], [`cuLogicalEndpointGetLimits`], [`cuLogicalEndpointQuery`].
15661    pub fn cuLogicalEndpointUnbind(
15662        leId: CUlogicalEndpointId,
15663        dev: CUdevice,
15664        offset: cuuint64_t,
15665        size: cuuint64_t,
15666    ) -> CUresult;
15667}
15668singe_loader::functions! { crate::DRIVER;
15669    /// Exports a logical endpoint associated with leId to an IPC handle.
15670    ///
15671    /// Given a logical endpoint id `leId`, create a shareable handle `handle` that can be used to share the logical endpoint with other processes. The recipient process can convert the shareable handle back into a logical endpoint id using [`cuLogicalEndpointImport`]. The implementation of what this `handle` is and how it can be transfered is defined by the requested handle type in `handletype`.
15672    ///
15673    /// # Parameters
15674    ///
15675    /// - `handle`: Pointer to the location in which to store the requested handle type.
15676    /// - `leId`: Logical endpoint id of logical endpoint.
15677    /// - `handleType`: Type of shareable handle requested. Defines type and size of the handle output parameter.
15678    ///
15679    /// # Return value
15680    ///
15681    /// - [`CUresult::CUDA_SUCCESS`]
15682    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
15683    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
15684    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
15685    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
15686    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
15687    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
15688    ///
15689    /// See also: [`cuLogicalEndpointCreate`], [`cuLogicalEndpointIdReserve`], [`cuLogicalEndpointIdRelease`], [`cuLogicalEndpointAddDevice`], [`cuLogicalEndpointDestroy`], [`cuLogicalEndpointBindAddr`], [`cuLogicalEndpointBindMem`], [`cuLogicalEndpointUnbind`], [`cuLogicalEndpointImport`], [`cuLogicalEndpointGetLimits`], [`cuLogicalEndpointQuery`].
15690    pub fn cuLogicalEndpointExport(
15691        handle: *mut ::core::ffi::c_void,
15692        leId: CUlogicalEndpointId,
15693        handleType: CUlogicalEndpointIpcHandleType,
15694    ) -> CUresult;
15695}
15696singe_loader::functions! { crate::DRIVER;
15697    /// Imports a logical endpoint from the given IPC handle and associates it with a logical endpoint id.
15698    ///
15699    /// Imports a logical endpoint from the given IPC `handle` and associates it with the logical endpoint id specified by `leId`.
15700    ///
15701    /// If the current process cannot support the logical endpoint described by the shareable handle, this API will error as [`cudaError_enum::CUDA_ERROR_NOT_SUPPORTED`]. If `handle` is of type [`CUlogicalEndpointIpcHandleType::CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_FABRIC`] and the importer process does not have access permissions, then [`cudaError_enum::CUDA_ERROR_NOT_PERMITTED`] will be returned.
15702    ///
15703    /// # Parameters
15704    ///
15705    /// - `leId`: Logical endpoint id that will be used to access the exported logical endpoint.
15706    /// - `handle`: Shareable handle representing the logical endpoint that is to be imported.
15707    /// - `handleType`: Handle type of the exported handle.
15708    ///
15709    /// # Return value
15710    ///
15711    /// - [`CUresult::CUDA_SUCCESS`]
15712    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
15713    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
15714    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
15715    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
15716    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
15717    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
15718    ///
15719    /// See also: [`cuLogicalEndpointCreate`], [`cuLogicalEndpointIdReserve`], [`cuLogicalEndpointIdRelease`], [`cuLogicalEndpointAddDevice`], [`cuLogicalEndpointDestroy`], [`cuLogicalEndpointBindAddr`], [`cuLogicalEndpointBindMem`], [`cuLogicalEndpointUnbind`], [`cuLogicalEndpointExport`], [`cuLogicalEndpointGetLimits`], [`cuLogicalEndpointQuery`].
15720    pub fn cuLogicalEndpointImport(
15721        leId: CUlogicalEndpointId,
15722        handle: *const ::core::ffi::c_void,
15723        handleType: CUlogicalEndpointIpcHandleType,
15724    ) -> CUresult;
15725}
15726singe_loader::functions! { crate::DRIVER;
15727    /// Calculates the minimum alignment and the maximum size for the given logical endpoint properties.
15728    ///
15729    /// The `bindAlignment` can be used as a multiple for size and bind offset values. The `maxSize` is the maximum size of the logical endpoint. If `maxSize` is less than [`CUlogicalEndpointProp`]:size the user must adjust the request to the smaller value.
15730    ///
15731    /// # Parameters
15732    ///
15733    /// - `bindAlignment`: Minimum alignment granularity of the proposed logical endpoint.
15734    /// - `maxSize`: Maximum size of the logical endpoint.
15735    /// - `prop`: Properties of the logical endpoint.
15736    ///
15737    /// # Return value
15738    ///
15739    /// - [`CUresult::CUDA_SUCCESS`]
15740    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
15741    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
15742    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
15743    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
15744    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
15745    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
15746    /// - [`CUresult::CUDA_ERROR_SYSTEM_NOT_READY`]
15747    /// - [`CUresult::CUDA_ERROR_ILLEGAL_STATE`]
15748    ///
15749    /// See also: [`cuLogicalEndpointCreate`], [`cuLogicalEndpointIdReserve`], [`cuLogicalEndpointIdRelease`], [`cuLogicalEndpointAddDevice`], [`cuLogicalEndpointDestroy`], [`cuLogicalEndpointBindAddr`], [`cuLogicalEndpointBindMem`], [`cuLogicalEndpointUnbind`], [`cuLogicalEndpointExport`], [`cuLogicalEndpointImport`], [`cuLogicalEndpointQuery`].
15750    pub fn cuLogicalEndpointGetLimits(
15751        bindAlignment: *mut cuuint64_t,
15752        maxSize: *mut cuuint64_t,
15753        prop: *const CUlogicalEndpointProp,
15754    ) -> CUresult;
15755}
15756singe_loader::functions! { crate::DRIVER;
15757    /// Determines if all logical endpoints in the range have been successfully constructed.
15758    ///
15759    /// Queries the driver to determine if all logical endpoints in the given range starting at `leId` and extending for `count` have been successfully constructed.
15760    ///
15761    /// Provides a mechanism to ensure that it is safe to begin using a logical endpoint ID. Using a logical endpoint ID before verifying that it is fully constructed can result in undefined behavior.
15762    ///
15763    /// This is not a blocking API, it returns immediately with a `queryStatus` of 0 if any logical endpoint ID in the given range is not fully constructed, and a non-zero value otherwise.
15764    ///
15765    /// Construction of a multicast logical endpoint may fail here if the devices added via [`cuLogicalEndpointAddDevice`] do not belong to the same clique.
15766    ///
15767    /// This API may return [`cudaError_enum::CUDA_ERROR_ILLEGAL_STATE`] if no devices are found on which this logical endpoint can be accessed.
15768    ///
15769    /// # Parameters
15770    ///
15771    /// - `leId`: First logical endpoint ID to be queried.
15772    /// - `count`: Number of logical endpoints IDs to be queried.
15773    /// - `queryStatus`: Status of the logical endpoints. Returns 0 if any logical endpoint in the given range is not fully constructed, and non-zero if all logical endpoints in the given range are fully constructed.
15774    ///
15775    /// # Return value
15776    ///
15777    /// - [`CUresult::CUDA_SUCCESS`]
15778    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
15779    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
15780    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
15781    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
15782    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
15783    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
15784    /// - [`CUresult::CUDA_ERROR_SYSTEM_NOT_READY`]
15785    /// - [`CUresult::CUDA_ERROR_ILLEGAL_STATE`]
15786    ///
15787    /// See also: [`cuLogicalEndpointCreate`], [`cuLogicalEndpointIdReserve`], [`cuLogicalEndpointIdRelease`], [`cuLogicalEndpointAddDevice`], [`cuLogicalEndpointDestroy`], [`cuLogicalEndpointBindAddr`], [`cuLogicalEndpointBindMem`], [`cuLogicalEndpointUnbind`], [`cuLogicalEndpointExport`], [`cuLogicalEndpointImport`], [`cuLogicalEndpointGetLimits`].
15788    pub fn cuLogicalEndpointQuery(
15789        leId: CUlogicalEndpointId,
15790        count: cuuint32_t,
15791        queryStatus: *mut ::core::ffi::c_int,
15792    ) -> CUresult;
15793}
15794singe_loader::functions! { crate::DRIVER;
15795    /// Returns information about a pointer.
15796    ///
15797    /// The supported attributes are:
15798    ///
15799    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_CONTEXT`]:
15800    ///
15801    ///   Returns in `*data` the [`CUcontext`] in which `ptr` was allocated or registered. The type of `data` must be [`CUcontext`] \*.
15802    ///
15803    ///   If `ptr` was not allocated by, mapped by, or registered with a [`CUcontext`] which uses unified virtual addressing then [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned.
15804    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_MEMORY_TYPE`]:
15805    ///
15806    ///   Returns in `*data` the physical memory type of the memory that `ptr` addresses as a [`CUmemorytype`] enumerated value. The type of `data` must be unsigned int.
15807    ///
15808    ///   If `ptr` addresses device memory then `*data` is set to [`CUmemorytype_enum::CU_MEMORYTYPE_DEVICE`]. The particular [`CUdevice`] on which the memory resides is the [`CUdevice`] of the [`CUcontext`] returned by the [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_CONTEXT`] attribute of `ptr`.
15809    ///
15810    ///   If `ptr` addresses host memory then `*data` is set to [`CUmemorytype_enum::CU_MEMORYTYPE_HOST`].
15811    ///
15812    ///   If `ptr` was not allocated by, mapped by, or registered with a [`CUcontext`] which uses unified virtual addressing then [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned.
15813    ///
15814    ///   If the current [`CUcontext`] does not support unified virtual addressing then [`cudaError_enum::CUDA_ERROR_INVALID_CONTEXT`] is returned.
15815    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_DEVICE_POINTER`]:
15816    ///
15817    ///   Returns in `*data` the device pointer value through which `ptr` may be accessed by kernels running in the current [`CUcontext`]. The type of `data` must be CUdeviceptr \*.
15818    ///
15819    ///   If there exists no device pointer value through which kernels running in the current [`CUcontext`] may access `ptr` then [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned.
15820    ///
15821    ///   If there is no current [`CUcontext`] then [`cudaError_enum::CUDA_ERROR_INVALID_CONTEXT`] is returned.
15822    ///
15823    ///   Except in the exceptional disjoint addressing cases discussed below, the value returned in `*data` will equal the input value `ptr`.
15824    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_HOST_POINTER`]:
15825    ///
15826    ///   Returns in `*data` the host pointer value through which `ptr` may be accessed by by the host program. The type of `data` must be void \*\*. If there exists no host pointer value through which the host program may directly access `ptr` then [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned.
15827    ///
15828    ///   Except in the exceptional disjoint addressing cases discussed below, the value returned in `*data` will equal the input value `ptr`.
15829    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_P2P_TOKENS`]:
15830    ///
15831    ///   Returns in `*data` two tokens for use with the nv-p2p.h Linux kernel interface. `data` must be a struct of type CUDA_POINTER_ATTRIBUTE_P2P_TOKENS.
15832    ///
15833    ///   `ptr` must be a pointer to memory obtained from :cuMemAlloc(). Note that p2pToken and vaSpaceToken are only valid for the lifetime of the source allocation. A subsequent allocation at the same address may return completely different tokens. Querying this attribute has a side effect of setting the attribute [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_SYNC_MEMOPS`] for the region of memory that `ptr` points to.
15834    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_SYNC_MEMOPS`]:
15835    ///
15836    ///   A boolean attribute which when set, ensures that synchronous memory operations initiated on the region of memory that `ptr` points to will always synchronize. See further documentation in the section titled “API synchronization behavior” to learn more about cases when synchronous memory operations can exhibit asynchronous behavior.
15837    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_BUFFER_ID`]:
15838    ///
15839    ///   Returns in `*data` a buffer ID which is guaranteed to be unique within the process. `data` must point to an unsigned long long.
15840    ///
15841    ///   `ptr` must be a pointer to memory obtained from a CUDA memory allocation API. Every memory allocation from any of the CUDA memory allocation APIs will have a unique ID over a process lifetime. Subsequent allocations do not reuse IDs from previous freed allocations. IDs are only unique within a single process.
15842    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_IS_MANAGED`]:
15843    ///
15844    ///   Returns in `*data` a boolean that indicates whether the pointer points to managed memory or not.
15845    ///
15846    ///   If `ptr` is not a valid CUDA pointer then [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned.
15847    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL`]:
15848    ///
15849    ///   Returns in `*data` an integer representing a device ordinal of a device against which the memory was allocated or registered.
15850    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE`]:
15851    ///
15852    ///   Returns in `*data` a boolean that indicates if this pointer maps to an allocation that is suitable for `cudaIpcGetMemHandle`.
15853    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_RANGE_START_ADDR`]:
15854    ///
15855    ///   Returns in `*data` the starting address for the allocation referenced by the device pointer `ptr`. Note that this is not necessarily the address of the mapped region, but the address of the mappable address range `ptr` references (e.g. from [`cuMemAddressReserve`]).
15856    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_RANGE_SIZE`]:
15857    ///
15858    ///   Returns in `*data` the size for the allocation referenced by the device pointer `ptr`. Note that this is not necessarily the size of the mapped region, but the size of the mappable address range `ptr` references (e.g. from [`cuMemAddressReserve`]). To retrieve the size of the mapped region, see cuMemGetAddressRange
15859    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_MAPPED`]:
15860    ///
15861    ///   Returns in `*data` a boolean that indicates if this pointer is in a valid address range that is mapped to a backing allocation.
15862    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES`]:
15863    ///
15864    ///   Returns a bitmask of the allowed handle types for an allocation that may be passed to [`cuMemExportToShareableHandle`].
15865    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE`]:
15866    ///
15867    ///   Returns in `*data` a boolean that indicates if the memory this pointer is referencing can be used with the GPUDirect RDMA API.
15868    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE`]:
15869    ///
15870    ///   Returns in `*data` the handle to the mempool that the allocation was obtained from.
15871    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_IS_HW_DECOMPRESS_CAPABLE`]:
15872    ///
15873    ///   Returns in `*data` a boolean that indicates whether the pointer points to memory that is capable to be used for hardware accelerated decompression.
15874    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_LOCALITY_DOMAIN_ORDINAL`]:
15875    ///
15876    ///   Returns in `*data` an integer representing the locality domain ordinal of the allocation, or -1 if the allocation is not localized to a locality domain.
15877    ///
15878    /// Note that for most allocations in the unified virtual address space the host and device pointer for accessing the allocation will be the same. The exceptions to this are
15879    ///
15880    /// * user memory registered using cuMemHostRegister
15881    /// * host memory allocated using [`cuMemHostAlloc`] with the [`CU_MEMHOSTALLOC_WRITECOMBINED`] flag For these types of allocation there will exist separate, disjoint host and device addresses for accessing the allocation. In particular
15882    /// * The host address will correspond to an invalid unmapped device address (which will result in an exception if accessed from the device)
15883    /// * The device address will correspond to an invalid unmapped host address (which will result in an exception if accessed from the host). For these types of allocations, querying [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_HOST_POINTER`] and [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_DEVICE_POINTER`] may be used to retrieve the host and device addresses from either address.
15884    ///
15885    /// Note that this function may also return error codes from previous, asynchronous launches.
15886    ///
15887    /// # Parameters
15888    ///
15889    /// - `data`: Returned pointer attribute value.
15890    /// - `attribute`: Pointer attribute to query.
15891    /// - `ptr`: Pointer.
15892    ///
15893    /// # Return value
15894    ///
15895    /// - [`CUresult::CUDA_SUCCESS`]
15896    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
15897    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
15898    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
15899    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
15900    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
15901    ///
15902    /// See also: [`cuPointerSetAttribute`], [`cuMemAlloc`], [`cuMemFree`], [`cuMemAllocHost`], [`cuMemFreeHost`], [`cuMemHostAlloc`], [`cuMemHostRegister`], [`cuMemHostUnregister`], `cudaPointerGetAttributes`.
15903    pub fn cuPointerGetAttribute(
15904        data: *mut ::core::ffi::c_void,
15905        attribute: CUpointer_attribute,
15906        ptr: CUdeviceptr,
15907    ) -> CUresult;
15908}
15909singe_loader::functions! { crate::DRIVER;
15910    /// Prefetches memory to the specified destination location.
15911    ///
15912    /// Prefetches memory to the specified destination location. `devPtr` is the base device pointer of the memory to be prefetched and `location` specifies the destination location. `count` specifies the number of bytes to copy. `hStream` is the stream in which the operation is enqueued. The memory range must refer to managed memory allocated via [`cuMemAllocManaged`], via `cuMemAllocFromPool` from a managed memory pool or declared via **managed** variables.
15913    ///
15914    /// Specifying [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`] for [`CUmemLocation::type`](CUmemLocation_st::type_) will prefetch memory to GPU specified by device ordinal [CUmemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemLocation__v1.html#structcumemlocation__v1_1a1d7b65b482228d640b6f953196e460dc) which must have non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`]. Additionally, `hStream` must be associated with a device that has a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`]. Specifying [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST`] as [`CUmemLocation::type`](CUmemLocation_st::type_) will prefetch data to host memory. Applications can request prefetching memory to a specific host NUMA node by specifying [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`] for [`CUmemLocation::type`](CUmemLocation_st::type_) and a valid host NUMA node id in [CUmemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemLocation__v1.html#structcumemlocation__v1_1a1d7b65b482228d640b6f953196e460dc) Users can also request prefetching memory to the host NUMA node closest to the current thread’s CPU by specifying [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT`] for [`CUmemLocation::type`](CUmemLocation_st::type_). Note when [`CUmemLocation::type`](CUmemLocation_st::type_) is etiher [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST`] OR [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT`], [CUmemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemLocation__v1.html#structcumemlocation__v1_1a1d7b65b482228d640b6f953196e460dc) will be ignored. Prefetching to [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN`] locations is not supported.
15915    ///
15916    /// The start address and end address of the memory range will be rounded down and rounded up respectively to be aligned to CPU page size before the prefetch operation is enqueued in the stream.
15917    ///
15918    /// If no physical memory has been allocated for this region, then this memory region will be populated and mapped on the destination device. If there’s insufficient memory to prefetch the desired region, the Unified Memory driver may evict pages from other [`cuMemAllocManaged`] allocations to host memory in order to make room. Device memory allocated using cuMemAlloc or cuArrayCreate will not be evicted.
15919    ///
15920    /// By default, any mappings to the previous location of the migrated pages are removed and mappings for the new location are only setup on the destination location. The exact behavior however also depends on the settings applied to this memory range via cuMemAdvise as described below:
15921    ///
15922    /// If [`CUmem_advise_enum::CU_MEM_ADVISE_SET_READ_MOSTLY`] was set on any subset of this memory range, then that subset will create a read-only copy of the pages on destination location. If however the destination location is a host NUMA node, then any pages of that subset that are already in another host NUMA node will be transferred to the destination.
15923    ///
15924    /// If [`CUmem_advise_enum::CU_MEM_ADVISE_SET_PREFERRED_LOCATION`] was called on any subset of this memory range, then the pages will be migrated to `location` even if `location` is not the preferred location of any pages in the memory range.
15925    ///
15926    /// If [`CUmem_advise_enum::CU_MEM_ADVISE_SET_ACCESSED_BY`] was called on any subset of this memory range, then mappings to those pages from all the appropriate processors are updated to refer to the new location if establishing such a mapping is possible. Otherwise, those mappings are cleared.
15927    ///
15928    /// Note that this API is not required for functionality and only serves to improve performance by allowing the application to migrate data to a suitable location before it is accessed. Memory accesses to this range are always coherent and are allowed even when the data is actively being migrated.
15929    ///
15930    /// Note that this function is asynchronous with respect to the host and all work on other devices.
15931    ///
15932    /// Note that this function may also return error codes from previous, asynchronous launches.
15933    ///
15934    /// Note: This function exhibits asynchronous behavior for most use cases.
15935    ///
15936    /// Note: This function uses standard default stream semantics.
15937    ///
15938    /// # Parameters
15939    ///
15940    /// - `devPtr`: Pointer to be prefetched.
15941    /// - `count`: Size in bytes.
15942    /// - `location`: Location to prefetch to.
15943    /// - `flags`: flags for future use, must be zero now.
15944    /// - `hStream`: Stream to enqueue prefetch operation.
15945    ///
15946    /// # Return value
15947    ///
15948    /// - [`CUresult::CUDA_SUCCESS`]
15949    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
15950    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
15951    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
15952    ///
15953    /// See also: [`cuMemcpy`], [`cuMemcpyPeer`], [`cuMemcpyAsync`], [`cuMemcpy3DPeerAsync`], [`cuMemAdvise`], `cudaMemPrefetchAsync`.
15954    pub fn cuMemPrefetchAsync_v2(
15955        devPtr: CUdeviceptr,
15956        count: size_t,
15957        location: CUmemLocation,
15958        flags: ::core::ffi::c_uint,
15959        hStream: CUstream,
15960    ) -> CUresult;
15961}
15962singe_loader::functions! { crate::DRIVER;
15963    /// Advise about the usage of a given memory range.
15964    ///
15965    /// Advise the Unified Memory subsystem about the usage pattern for the memory range starting at `devPtr` with a size of `count` bytes. The start address and end address of the memory range will be rounded down and rounded up respectively to be aligned to CPU page size before the advice is applied. The memory range must refer to managed memory allocated via [`cuMemAllocManaged`] or declared via **managed** variables. The memory range could also refer to system-allocated pageable memory provided it represents a valid, host-accessible region of memory and all additional constraints imposed by `advice` as outlined below are also satisfied. Specifying an invalid system-allocated pageable memory range results in an error being returned.
15966    ///
15967    /// The `advice` parameter can take the following values:
15968    ///
15969    /// * [`CUmem_advise_enum::CU_MEM_ADVISE_SET_READ_MOSTLY`]: This implies that the data is mostly going to be read from and only occasionally written to. Any read accesses from any processor to this region will create a read-only copy of at least the accessed pages in that processor’s memory. Additionally, if cuMemPrefetchAsync is called on this region, it will create a read-only copy of the data on the destination processor. If the target location for cuMemPrefetchAsync is a host NUMA node and a read-only copy already exists on another host NUMA node, that copy will be migrated to the targeted host NUMA node. If any processor writes to this region, all copies of the corresponding page will be invalidated except for the one where the write occurred. If the writing processor is the CPU and the preferred location of the page is a host NUMA node, then the page will also be migrated to that host NUMA node. The `location` argument is ignored for this advice. Note that for a page to be read-duplicated, the accessing processor must either be the CPU or a GPU that has a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`]. Also, if a context is created on a device that does not have the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`] set, then read-duplication will not occur until all such contexts are destroyed. If the memory region refers to valid system-allocated pageable memory, then the accessing device must have a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`] for a read-only copy to be created on that device. Note however that if the accessing device also has a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES`], then setting this advice will not create a read-only copy when that device accesses this memory region.
15970    /// * [`CUmem_advise_enum::CU_MEM_ADVISE_UNSET_READ_MOSTLY`]: Undoes the effect of [`CUmem_advise_enum::CU_MEM_ADVISE_SET_READ_MOSTLY`] and also prevents the Unified Memory driver from attempting heuristic read-duplication on the memory range. Any read-duplicated copies of the data will be collapsed into a single copy. The location for the collapsed copy will be the preferred location if the page has a preferred location and one of the read-duplicated copies was resident at that location. Otherwise, the location chosen is arbitrary. Note: The `location` argument is ignored for this advice.
15971    /// * [`CUmem_advise_enum::CU_MEM_ADVISE_SET_PREFERRED_LOCATION`]: This advice sets the preferred location for the data to be the memory belonging to `location`. When [`CUmemLocation::type`](CUmemLocation_st::type_) is [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST`], [CUmemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemLocation__v1.html#structcumemlocation__v1_1a1d7b65b482228d640b6f953196e460dc) is ignored and the preferred location is set to be host memory. To set the preferred location to a specific host NUMA node, applications must set [`CUmemLocation::type`](CUmemLocation_st::type_) to [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`] and [CUmemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemLocation__v1.html#structcumemlocation__v1_1a1d7b65b482228d640b6f953196e460dc) must specify the NUMA ID of the host NUMA node. If [`CUmemLocation::type`](CUmemLocation_st::type_) is set to [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT`], [CUmemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemLocation__v1.html#structcumemlocation__v1_1a1d7b65b482228d640b6f953196e460dc) will be ignored and the host NUMA node closest to the calling thread’s CPU will be used as the preferred location. If [`CUmemLocation::type`](CUmemLocation_st::type_) is a [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`], then [CUmemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemLocation__v1.html#structcumemlocation__v1_1a1d7b65b482228d640b6f953196e460dc) must be a valid device ordinal and the device must have a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`]. A [`CUmemLocation::type`](CUmemLocation_st::type_) of [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN`] is unsupported. Setting the preferred location does not cause data to migrate to that location immediately. Instead, it guides the migration policy when a fault occurs on that memory region. If the data is already in its preferred location and the faulting processor can establish a mapping without requiring the data to be migrated, then data migration will be avoided. On the other hand, if the data is not in its preferred location or if a direct mapping cannot be established, then it will be migrated to the processor accessing it. It is important to note that setting the preferred location does not prevent data prefetching done using cuMemPrefetchAsync. Having a preferred location can override the page thrash detection and resolution logic in the Unified Memory driver. Normally, if a page is detected to be constantly thrashing between for example host and device memory, the page may eventually be pinned to host memory by the Unified Memory driver. But if the preferred location is set as device memory, then the page will continue to thrash indefinitely. If [`CUmem_advise_enum::CU_MEM_ADVISE_SET_READ_MOSTLY`] is also set on this memory region or any subset of it, then the policies associated with that advice will override the policies of this advice, unless read accesses from `location` will not result in a read-only copy being created on that procesor as outlined in description for the advice [`CUmem_advise_enum::CU_MEM_ADVISE_SET_READ_MOSTLY`]. If the memory region refers to valid system-allocated pageable memory, and [`CUmemLocation::type`](CUmemLocation_st::type_) is [`CUmemLocationType::CU_MEM_LOCATION_TYPE_DEVICE`] then [CUmemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemLocation__v1.html#structcumemlocation__v1_1a1d7b65b482228d640b6f953196e460dc) must be a valid device that has a non-zero alue for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`].
15972    /// * [`CUmem_advise_enum::CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION`]: Undoes the effect of [`CUmem_advise_enum::CU_MEM_ADVISE_SET_PREFERRED_LOCATION`] and changes the preferred location to none. The `location` argument is ignored for this advice.
15973    /// * [`CUmem_advise_enum::CU_MEM_ADVISE_SET_ACCESSED_BY`]: This advice implies that the data will be accessed by processor `location`. The [`CUmemLocation::type`](CUmemLocation_st::type_) must be either [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`] with [CUmemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemLocation__v1.html#structcumemlocation__v1_1a1d7b65b482228d640b6f953196e460dc) representing a valid device ordinal or [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST`] and [CUmemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemLocation__v1.html#structcumemlocation__v1_1a1d7b65b482228d640b6f953196e460dc) will be ignored. All other location types are invalid. If [CUmemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemLocation__v1.html#structcumemlocation__v1_1a1d7b65b482228d640b6f953196e460dc) is a GPU, then the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`] must be non-zero. This advice does not cause data migration and has no impact on the location of the data per se. Instead, it causes the data to always be mapped in the specified processor’s page tables, as long as the location of the data permits a mapping to be established. If the data gets migrated for any reason, the mappings are updated accordingly. This advice is recommended in scenarios where data locality is not important, but avoiding faults is. Consider for example a system containing multiple GPUs with peer-to-peer access enabled, where the data located on one GPU is occasionally accessed by peer GPUs. In such scenarios, migrating data over to the other GPUs is not as important because the accesses are infrequent and the overhead of migration may be too high. But preventing faults can still help improve performance, and so having a mapping set up in advance is useful. Note that on CPU access of this data, the data may be migrated to host memory because the CPU typically cannot access device memory directly. Any GPU that had the [`CUmem_advise_enum::CU_MEM_ADVISE_SET_ACCESSED_BY`] flag set for this data will now have its mapping updated to point to the page in host memory. If [`CUmem_advise_enum::CU_MEM_ADVISE_SET_READ_MOSTLY`] is also set on this memory region or any subset of it, then the policies associated with that advice will override the policies of this advice. Additionally, if the preferred location of this memory region or any subset of it is also `location`, then the policies associated with [`CUmem_advise_enum::CU_MEM_ADVISE_SET_PREFERRED_LOCATION`] will override the policies of this advice. If the memory region refers to valid system-allocated pageable memory, and [`CUmemLocation::type`](CUmemLocation_st::type_) is [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`] then device in [CUmemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemLocation__v1.html#structcumemlocation__v1_1a1d7b65b482228d640b6f953196e460dc) must have a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`]. Additionally, if [CUmemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemLocation__v1.html#structcumemlocation__v1_1a1d7b65b482228d640b6f953196e460dc) has a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES`], then this call has no effect.
15974    /// * [`CUmem_advise_enum::CU_MEM_ADVISE_UNSET_ACCESSED_BY`]: Undoes the effect of [`CUmem_advise_enum::CU_MEM_ADVISE_SET_ACCESSED_BY`]. Any mappings to the data from `location` may be removed at any time causing accesses to result in non-fatal page faults. If the memory region refers to valid system-allocated pageable memory, and [`CUmemLocation::type`](CUmemLocation_st::type_) is [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`] then device in [CUmemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemLocation__v1.html#structcumemlocation__v1_1a1d7b65b482228d640b6f953196e460dc) must have a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`]. Additionally, if [CUmemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUmemLocation__v1.html#structcumemlocation__v1_1a1d7b65b482228d640b6f953196e460dc) has a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES`], then this call has no effect.
15975    ///
15976    /// Note that this function may also return error codes from previous, asynchronous launches.
15977    ///
15978    /// Note: This function exhibits asynchronous behavior for most use cases.
15979    ///
15980    /// Note: This function uses standard default stream semantics.
15981    ///
15982    /// # Parameters
15983    ///
15984    /// - `devPtr`: Pointer to memory to set the advice for.
15985    /// - `count`: Size in bytes of the memory range.
15986    /// - `advice`: Advice to be applied for the specified memory range.
15987    /// - `location`: location to apply the advice for.
15988    ///
15989    /// # Return value
15990    ///
15991    /// - [`CUresult::CUDA_SUCCESS`]
15992    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
15993    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
15994    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
15995    ///
15996    /// See also: [`cuMemcpy`], [`cuMemcpyPeer`], [`cuMemcpyAsync`], [`cuMemcpy3DPeerAsync`], [`cuMemPrefetchAsync`], `cudaMemAdvise`.
15997    pub fn cuMemAdvise_v2(
15998        devPtr: CUdeviceptr,
15999        count: size_t,
16000        advice: CUmem_advise,
16001        location: CUmemLocation,
16002    ) -> CUresult;
16003}
16004singe_loader::functions! { crate::DRIVER;
16005    /// Performs a batch of memory prefetches asynchronously.
16006    ///
16007    /// Performs a batch of memory prefetches. The batch as a whole executes in stream order but operations within a batch are not guaranteed to execute in any specific order. All devices in the system must have a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`] otherwise the API will return an error.
16008    ///
16009    /// The semantics of the individual prefetch operations are as described in cuMemPrefetchAsync.
16010    ///
16011    /// Performs memory prefetch on address ranges specified in `dptrs` and `sizes`. Both arrays must be of the same length as specified by `count`. Each memory range specified must refer to managed memory allocated via [`cuMemAllocManaged`] or declared via **managed** variables or it may also refer to system-allocated memory when all devices have a non-zero value for [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`]. The prefetch location for every operation in the batch is specified in the `prefetchLocs` array. Each entry in this array can apply to more than one operation. This can be done by specifying in the `prefetchLocIdxs` array, the index of the first prefetch operation that the corresponding entry in the `prefetchLocs` array applies to. Both `prefetchLocs` and `prefetchLocIdxs` must be of the same length as specified by `numPrefetchLocs`. For example, if a batch has 10 prefetches listed in dptrs/sizes, the first 4 of which are to be prefetched to one location and the remaining 6 are to be prefetched to another, then `numPrefetchLocs` will be 2, `prefetchLocIdxs` will be {0, 4} and `prefetchLocs` will contain the two locations. Note the first entry in `prefetchLocIdxs` must always be 0. Also, each entry must be greater than the previous entry and the last entry should be less than `count`. Furthermore, `numPrefetchLocs` must be lesser than or equal to `count`.
16012    ///
16013    /// # Parameters
16014    ///
16015    /// - `dptrs`: Array of pointers to be prefetched.
16016    /// - `sizes`: Array of sizes for memory prefetch operations.
16017    /// - `count`: Size of `dptrs` and `sizes` arrays.
16018    /// - `prefetchLocs`: Array of locations to prefetch to.
16019    /// - `prefetchLocIdxs`: Array of indices to specify which operands each entry in the `prefetchLocs` array applies to. The locations specified in prefetchLocs\[k\] will be applied to copies starting from prefetchLocIdxs\[k\] through prefetchLocIdxs\[k+1\] - 1. Also prefetchLocs\[numPrefetchLocs - 1\] will apply to prefetches starting from prefetchLocIdxs\[numPrefetchLocs - 1\] through count - 1.
16020    /// - `numPrefetchLocs`: Size of `prefetchLocs` and `prefetchLocIdxs` arrays.
16021    /// - `flags`: Flags reserved for future use. Must be zero.
16022    /// - `hStream`: The stream to enqueue the operations in. Must not be legacy NULL stream.
16023    pub fn cuMemPrefetchBatchAsync(
16024        dptrs: *mut CUdeviceptr,
16025        sizes: *mut size_t,
16026        count: size_t,
16027        prefetchLocs: *mut CUmemLocation,
16028        prefetchLocIdxs: *mut size_t,
16029        numPrefetchLocs: size_t,
16030        flags: ::core::ffi::c_ulonglong,
16031        hStream: CUstream,
16032    ) -> CUresult;
16033}
16034singe_loader::functions! { crate::DRIVER;
16035    /// Performs a batch of memory discards asynchronously.
16036    ///
16037    /// Performs a batch of memory discards. The batch as a whole executes in stream order but operations within a batch are not guaranteed to execute in any specific order. All devices in the system must have a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`] otherwise the API will return an error.
16038    ///
16039    /// Discarding a memory range informs the driver that the contents of that range are no longer useful. Discarding memory ranges allows the driver to optimize certain data migrations and can also help reduce memory pressure. This operation can be undone on any part of the range by either writing to it or prefetching it via cuMemPrefetchAsync or cuMemPrefetchBatchAsync. Reading from a discarded range, without a subsequent write or prefetch to that part of the range, will return an indeterminate value. Note that any reads, writes or prefetches to any part of the memory range that occur simultaneously with the discard operation result in undefined behavior.
16040    ///
16041    /// Performs memory discard on address ranges specified in `dptrs` and `sizes`. Both arrays must be of the same length as specified by `count`. Each memory range specified must refer to managed memory allocated via [`cuMemAllocManaged`] or declared via **managed** variables or it may also refer to system-allocated memory when all devices have a non-zero value for [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`].
16042    ///
16043    /// # Parameters
16044    ///
16045    /// - `dptrs`: Array of pointers to be discarded.
16046    /// - `sizes`: Array of sizes for memory discard operations.
16047    /// - `count`: Size of `dptrs` and `sizes` arrays.
16048    /// - `flags`: Flags reserved for future use. Must be zero.
16049    /// - `hStream`: The stream to enqueue the operations in. Must not be legacy NULL stream.
16050    pub fn cuMemDiscardBatchAsync(
16051        dptrs: *mut CUdeviceptr,
16052        sizes: *mut size_t,
16053        count: size_t,
16054        flags: ::core::ffi::c_ulonglong,
16055        hStream: CUstream,
16056    ) -> CUresult;
16057}
16058singe_loader::functions! { crate::DRIVER;
16059    /// Performs a batch of memory discards and prefetches asynchronously.
16060    ///
16061    /// Performs a batch of memory discards followed by prefetches. The batch as a whole executes in stream order but operations within a batch are not guaranteed to execute in any specific order. All devices in the system must have a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`] otherwise the API will return an error.
16062    ///
16063    /// Calling cuMemDiscardAndPrefetchBatchAsync is semantically equivalent to calling cuMemDiscardBatchAsync followed by cuMemPrefetchBatchAsync, but is more optimal. For more details on what discarding and prefetching imply, please refer to cuMemDiscardBatchAsync and cuMemPrefetchBatchAsync respectively. Note that any reads, writes or prefetches to any part of the memory range that occur simultaneously with this combined discard+prefetch operation result in undefined behavior.
16064    ///
16065    /// Performs memory discard and prefetch on address ranges specified in `dptrs` and `sizes`. Both arrays must be of the same length as specified by `count`. Each memory range specified must refer to managed memory allocated via [`cuMemAllocManaged`] or declared via **managed** variables or it may also refer to system-allocated memory when all devices have a non-zero value for [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`]. Every operation in the batch has to be associated with a valid location to prefetch the address range to and specified in the `prefetchLocs` array. Each entry in this array can apply to more than one operation. This can be done by specifying in the `prefetchLocIdxs` array, the index of the first operation that the corresponding entry in the `prefetchLocs` array applies to. Both `prefetchLocs` and `prefetchLocIdxs` must be of the same length as specified by `numPrefetchLocs`. For example, if a batch has 10 operations listed in dptrs/sizes, the first 6 of which are to be prefetched to one location and the remaining 4 are to be prefetched to another, then `numPrefetchLocs` will be 2, `prefetchLocIdxs` will be {0, 6} and `prefetchLocs` will contain the two set of locations. Note the first entry in `prefetchLocIdxs` must always be 0. Also, each entry must be greater than the previous entry and the last entry should be less than `count`. Furthermore, `numPrefetchLocs` must be lesser than or equal to `count`.
16066    ///
16067    /// # Parameters
16068    ///
16069    /// - `dptrs`: Array of pointers to be discarded.
16070    /// - `sizes`: Array of sizes for memory discard operations.
16071    /// - `count`: Size of `dptrs` and `sizes` arrays.
16072    /// - `prefetchLocs`: Array of locations to prefetch to.
16073    /// - `prefetchLocIdxs`: Array of indices to specify which operands each entry in the `prefetchLocs` array applies to. The locations specified in prefetchLocs\[k\] will be applied to operations starting from prefetchLocIdxs\[k\] through prefetchLocIdxs\[k+1\] - 1. Also prefetchLocs\[numPrefetchLocs - 1\] will apply to copies starting from prefetchLocIdxs\[numPrefetchLocs - 1\] through count - 1.
16074    /// - `numPrefetchLocs`: Size of `prefetchLocs` and `prefetchLocIdxs` arrays.
16075    /// - `flags`: Flags reserved for future use. Must be zero.
16076    /// - `hStream`: The stream to enqueue the operations in. Must not be legacy NULL stream.
16077    pub fn cuMemDiscardAndPrefetchBatchAsync(
16078        dptrs: *mut CUdeviceptr,
16079        sizes: *mut size_t,
16080        count: size_t,
16081        prefetchLocs: *mut CUmemLocation,
16082        prefetchLocIdxs: *mut size_t,
16083        numPrefetchLocs: size_t,
16084        flags: ::core::ffi::c_ulonglong,
16085        hStream: CUstream,
16086    ) -> CUresult;
16087}
16088singe_loader::functions! { crate::DRIVER;
16089    /// Gets residency information for a memory address range.
16090    ///
16091    /// Retrieves memory location information for the specified address range starting at `ptr` with size `size`. The API summarizes the location information with a granularity specified by `summaryGranularity`. For each summary region, the API determines the most common location by sampling memory at intervals defined by `samplingGranularity` within that region.
16092    ///
16093    /// The location information is returned in the `location_out` array, with one entry per summary region. The total number of locations returned will be ceil(size/summaryGranularity). The user is expected to allocate the `location_out` array with sufficient memory.
16094    ///
16095    /// For example, with an address range of 1GB, a `summaryGranularity` of 128MB, and a `samplingGranularity` of 2MB, the function will:
16096    ///
16097    /// * Divide the 1GB range into 8 summary regions of 128MB each
16098    /// * Within each 128MB region, sample every 2MB to determine the most common location. If there is a tie a random winner is chosen.
16099    /// * Populate the `location_out` array with 8 entries, one for each 128MB region `summaryGranularity` should be less than or equal to `size` and greater than 0. `samplingGranularity` should be less than or equal to `summaryGranularity`. If the `samplingGranularity` is set to 0, a system dependent value is used as the granularity. In all other cases, the call returns [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`].
16100    ///
16101    /// When the memory is not resident on any processor, the call returns [`cudaError_enum::CUDA_SUCCESS`] and the returned location type for that interval is [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_NONE`].
16102    ///
16103    /// The memory range must refer to one of the following:
16104    ///
16105    /// * Managed memory allocated via [`cuMemAllocManaged`], via `cuMemAllocFromPool` from a managed memory pool or declared via **managed** variables.
16106    /// * System-allocated pageable memory that is not registered via cuMemHostRegister. If the memory range does not refer to one of the above, the call returns [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`].
16107    ///
16108    /// All devices on the system must have non-zero value of device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`]. If not, this call returns [`cudaError_enum::CUDA_ERROR_NOT_SUPPORTED`].
16109    ///
16110    /// Note that this function may also return error codes from previous, asynchronous launches.
16111    ///
16112    /// # Parameters
16113    ///
16114    /// - `ptr`: Starting address of the memory range to query.
16115    /// - `size`: Size in bytes of the memory range to query.
16116    /// - `summaryGranularity`: Granularity in bytes at which to summarize location information.
16117    /// - `samplingGranularity`: Granularity in bytes at which to sample memory within each summary region.
16118    /// - `location_out`: Array to store location information, one entry per summary region.
16119    ///
16120    /// # Return value
16121    ///
16122    /// - [`CUresult::CUDA_SUCCESS`]
16123    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
16124    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
16125    pub fn cuMemGetLocationInfo(
16126        ptr: CUdeviceptr,
16127        size: size_t,
16128        summaryGranularity: size_t,
16129        samplingGranularity: size_t,
16130        location_out: *mut CUmemLocation,
16131    ) -> CUresult;
16132}
16133singe_loader::functions! { crate::DRIVER;
16134    /// Query an attribute of a given memory range.
16135    ///
16136    /// Query an attribute about the memory range starting at `devPtr` with a size of `count` bytes. The memory range must refer to managed memory allocated via [`cuMemAllocManaged`] or declared via **managed** variables.
16137    ///
16138    /// The `attribute` parameter can take the following values:
16139    ///
16140    /// * [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY`]: If this attribute is specified, `data` will be interpreted as a 32-bit integer, and `dataSize` must be 4. The result returned will be 1 if all pages in the given memory range have read-duplication enabled, or 0 otherwise.
16141    /// * [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION`]: If this attribute is specified, `data` will be interpreted as a 32-bit integer, and `dataSize` must be 4. The result returned will be a GPU device id if all pages in the memory range have that GPU as their preferred location, or it will be CU_DEVICE_CPU if all pages in the memory range have the CPU as their preferred location, or it will be CU_DEVICE_INVALID if either all the pages don’t have the same preferred location or some of the pages don’t have a preferred location at all. Note that the actual location of the pages in the memory range at the time of the query may be different from the preferred location.
16142    /// * [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY`]: If this attribute is specified, `data` will be interpreted as an array of 32-bit integers, and `dataSize` must be a non-zero multiple of 4. The result returned will be a list of device ids that had [`CUmem_advise_enum::CU_MEM_ADVISE_SET_ACCESSED_BY`] set for that entire memory range. If any device does not have that advice set for the entire memory range, that device will not be included. If `data` is larger than the number of devices that have that advice set for that memory range, CU_DEVICE_INVALID will be returned in all the extra space provided. For ex., if `dataSize` is 12 (i.e. `data` has 3 elements) and only device 0 has the advice set, then the result returned will be { 0, CU_DEVICE_INVALID, CU_DEVICE_INVALID }. If `data` is smaller than the number of devices that have that advice set, then only as many devices will be returned as can fit in the array. There is no guarantee on which specific devices will be returned, however.
16143    /// * [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION`]: If this attribute is specified, `data` will be interpreted as a 32-bit integer, and `dataSize` must be 4. The result returned will be the last location to which all pages in the memory range were prefetched explicitly via cuMemPrefetchAsync. This will either be a GPU id or CU_DEVICE_CPU depending on whether the last location for prefetch was a GPU or the CPU respectively. If any page in the memory range was never explicitly prefetched or if all pages were not prefetched to the same location, CU_DEVICE_INVALID will be returned. Note that this simply returns the last location that the application requested to prefetch the memory range to. It gives no indication as to whether the prefetch operation to that location has completed or even begun.
16144    /// * [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_TYPE`]: If this attribute is specified, `data` will be interpreted as a [`CUmemLocationType`], and `dataSize` must be sizeof(CUmemLocationType). The [`CUmemLocationType`] returned will be [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`] if all pages in the memory range have the same GPU as their preferred location, or [`CUmemLocationType`] will be [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST`] if all pages in the memory range have the CPU as their preferred location, or it will be [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`] if all the pages in the memory range have the same host NUMA node ID as their preferred location or it will be [`CUmemLocationType::CU_MEM_LOCATION_TYPE_INVALID`] if either all the pages don’t have the same preferred location or some of the pages don’t have a preferred location at all. Note that the actual location type of the pages in the memory range at the time of the query may be different from the preferred location type.
16145    ///
16146    ///   + [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_ID`]: If this attribute is specified, `data` will be interpreted as a 32-bit integer, and `dataSize` must be 4. If the [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_TYPE`] query for the same address range returns [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`], it will be a valid device ordinal or if it returns [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`], it will be a valid host NUMA node ID or if it returns any other location type, the id should be ignored.
16147    /// * [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_TYPE`]: If this attribute is specified, `data` will be interpreted as a [`CUmemLocationType`], and `dataSize` must be sizeof(CUmemLocationType). The result returned will be the last location to which all pages in the memory range were prefetched explicitly via cuMemPrefetchAsync. The [`CUmemLocationType`] returned will be [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`] if the last prefetch location was a GPU or [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST`] if it was the CPU or [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`] if the last prefetch location was a specific host NUMA node. If any page in the memory range was never explicitly prefetched or if all pages were not prefetched to the same location, [`CUmemLocationType`] will be [`CUmemLocationType::CU_MEM_LOCATION_TYPE_INVALID`]. Note that this simply returns the last location type that the application requested to prefetch the memory range to. It gives no indication as to whether the prefetch operation to that location has completed or even begun.
16148    ///
16149    ///   + [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_ID`]: If this attribute is specified, `data` will be interpreted as a 32-bit integer, and `dataSize` must be 4. If the [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_TYPE`] query for the same address range returns [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`], it will be a valid device ordinal or if it returns [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`], it will be a valid host NUMA node ID or if it returns any other location type, the id should be ignored.
16150    ///
16151    /// Note that this function may also return error codes from previous, asynchronous launches.
16152    ///
16153    /// Note: This function exhibits asynchronous behavior for most use cases.
16154    ///
16155    /// Note: This function uses standard default stream semantics.
16156    ///
16157    /// # Parameters
16158    ///
16159    /// - `data`: A pointers to a memory location where the result of each attribute query will be written to.
16160    /// - `dataSize`: Array containing the size of data.
16161    /// - `attribute`: The attribute to query.
16162    /// - `devPtr`: Start of the range to query.
16163    /// - `count`: Size of the range to query.
16164    ///
16165    /// # Return value
16166    ///
16167    /// - [`CUresult::CUDA_SUCCESS`]
16168    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
16169    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
16170    ///
16171    /// See also: [`cuMemRangeGetAttributes`], [`cuMemPrefetchAsync`], [`cuMemAdvise`], `cudaMemRangeGetAttribute`.
16172    pub fn cuMemRangeGetAttribute(
16173        data: *mut ::core::ffi::c_void,
16174        dataSize: size_t,
16175        attribute: CUmem_range_attribute,
16176        devPtr: CUdeviceptr,
16177        count: size_t,
16178    ) -> CUresult;
16179}
16180singe_loader::functions! { crate::DRIVER;
16181    /// Query attributes of a given memory range.
16182    ///
16183    /// Query attributes of the memory range starting at `devPtr` with a size of `count` bytes. The memory range must refer to managed memory allocated via [`cuMemAllocManaged`] or declared via **managed** variables. The `attributes` array will be interpreted to have `numAttributes` entries. The `dataSizes` array will also be interpreted to have `numAttributes` entries. The results of the query will be stored in `data`.
16184    ///
16185    /// The list of supported attributes are given below. Please refer to [`cuMemRangeGetAttribute`] for attribute descriptions and restrictions.
16186    ///
16187    /// * [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY`]
16188    /// * [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION`]
16189    /// * [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY`]
16190    /// * [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION`]
16191    /// * [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_TYPE`]
16192    /// * [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_ID`]
16193    /// * [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_TYPE`]
16194    /// * [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_ID`].
16195    ///
16196    /// Note that this function may also return error codes from previous, asynchronous launches.
16197    ///
16198    /// # Parameters
16199    ///
16200    /// - `data`: A two-dimensional array containing pointers to memory locations where the result of each attribute query will be written to.
16201    /// - `dataSizes`: Array containing the sizes of each result.
16202    /// - `attributes`: An array of attributes to query (numAttributes and the number of attributes in this array should match).
16203    /// - `numAttributes`: Number of attributes to query.
16204    /// - `devPtr`: Start of the range to query.
16205    /// - `count`: Size of the range to query.
16206    ///
16207    /// # Return value
16208    ///
16209    /// - [`CUresult::CUDA_SUCCESS`]
16210    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
16211    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
16212    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
16213    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
16214    ///
16215    /// See also: [`cuMemRangeGetAttribute`], [`cuMemAdvise`], [`cuMemPrefetchAsync`], `cudaMemRangeGetAttributes`.
16216    pub fn cuMemRangeGetAttributes(
16217        data: *mut *mut ::core::ffi::c_void,
16218        dataSizes: *mut size_t,
16219        attributes: *mut CUmem_range_attribute,
16220        numAttributes: size_t,
16221        devPtr: CUdeviceptr,
16222        count: size_t,
16223    ) -> CUresult;
16224}
16225singe_loader::functions! { crate::DRIVER;
16226    /// Set attributes on a previously allocated memory region.
16227    ///
16228    /// The supported attributes are:
16229    ///
16230    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_SYNC_MEMOPS`]:
16231    ///
16232    ///   A boolean attribute that can either be set (1) or unset (0). When set, the region of memory that `ptr` points to is guaranteed to always synchronize memory operations that are synchronous. If there are some previously initiated synchronous memory operations that are pending when this attribute is set, the function does not return until those memory operations are complete. See further documentation in the section titled “API synchronization behavior” to learn more about cases when synchronous memory operations can exhibit asynchronous behavior. `value` will be considered as a pointer to an unsigned integer to which this attribute is to be set.
16233    ///
16234    /// Note that this function may also return error codes from previous, asynchronous launches.
16235    ///
16236    /// # Parameters
16237    ///
16238    /// - `value`: Pointer to memory containing the value to be set.
16239    /// - `attribute`: Pointer attribute to set.
16240    /// - `ptr`: Pointer to a memory region allocated using CUDA memory allocation APIs.
16241    ///
16242    /// # Return value
16243    ///
16244    /// - [`CUresult::CUDA_SUCCESS`]
16245    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
16246    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
16247    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
16248    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
16249    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
16250    ///
16251    /// See also: [`cuPointerGetAttribute`], [`cuPointerGetAttributes`], [`cuMemAlloc`], [`cuMemFree`], [`cuMemAllocHost`], [`cuMemFreeHost`], [`cuMemHostAlloc`], [`cuMemHostRegister`], [`cuMemHostUnregister`].
16252    pub fn cuPointerSetAttribute(
16253        value: *const ::core::ffi::c_void,
16254        attribute: CUpointer_attribute,
16255        ptr: CUdeviceptr,
16256    ) -> CUresult;
16257}
16258singe_loader::functions! { crate::DRIVER;
16259    /// Returns information about a pointer.
16260    ///
16261    /// The supported attributes are (refer to [`cuPointerGetAttribute`] for attribute descriptions and restrictions):
16262    ///
16263    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_CONTEXT`]
16264    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_MEMORY_TYPE`]
16265    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_DEVICE_POINTER`]
16266    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_HOST_POINTER`]
16267    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_SYNC_MEMOPS`]
16268    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_BUFFER_ID`]
16269    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_IS_MANAGED`]
16270    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL`]
16271    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_RANGE_START_ADDR`]
16272    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_RANGE_SIZE`]
16273    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_MAPPED`]
16274    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE`]
16275    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES`]
16276    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE`]
16277    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE`]
16278    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_IS_HW_DECOMPRESS_CAPABLE`]
16279    ///
16280    /// Unlike [`cuPointerGetAttribute`], this function will not return an error when the `ptr` encountered is not a valid CUDA pointer. Instead, the attributes are assigned default NULL values and [`CUresult::CUDA_SUCCESS`] is returned.
16281    ///
16282    /// If `ptr` was not allocated by, mapped by, or registered with a [`CUcontext`] which uses UVA (Unified Virtual Addressing), [`cudaError_enum::CUDA_ERROR_INVALID_CONTEXT`] is returned.
16283    ///
16284    /// Note that this function may also return error codes from previous, asynchronous launches.
16285    ///
16286    /// # Parameters
16287    ///
16288    /// - `numAttributes`: Number of attributes to query.
16289    /// - `attributes`: An array of attributes to query (numAttributes and the number of attributes in this array should match).
16290    /// - `data`: A two-dimensional array containing pointers to memory locations where the result of each attribute query will be written to.
16291    /// - `ptr`: Pointer to query.
16292    ///
16293    /// # Return value
16294    ///
16295    /// - [`CUresult::CUDA_SUCCESS`]
16296    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
16297    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
16298    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
16299    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
16300    ///
16301    /// See also: [`cuPointerGetAttribute`], [`cuPointerSetAttribute`], `cudaPointerGetAttributes`.
16302    pub fn cuPointerGetAttributes(
16303        numAttributes: ::core::ffi::c_uint,
16304        attributes: *mut CUpointer_attribute,
16305        data: *mut *mut ::core::ffi::c_void,
16306        ptr: CUdeviceptr,
16307    ) -> CUresult;
16308}
16309singe_loader::functions! { crate::DRIVER;
16310    /// Create a stream.
16311    ///
16312    /// Creates a stream and returns a handle in `phStream`. The `Flags` argument determines behaviors of the stream.
16313    ///
16314    /// Valid values for `Flags` are:
16315    ///
16316    /// * [`CUstream_flags_enum::CU_STREAM_DEFAULT`]: Default stream creation flag.
16317    /// * [`CUstream_flags_enum::CU_STREAM_NON_BLOCKING`]: Specifies that work running in the created stream may run concurrently with work in stream 0 (the NULL stream), and that the created stream should perform no implicit synchronization with stream 0.
16318    ///
16319    /// Note that this function may also return error codes from previous, asynchronous launches.
16320    ///
16321    /// # Parameters
16322    ///
16323    /// - `phStream`: Returned newly created stream.
16324    /// - `Flags`: Parameters for stream creation.
16325    ///
16326    /// # Return value
16327    ///
16328    /// - [`CUresult::CUDA_SUCCESS`]
16329    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
16330    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
16331    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
16332    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
16333    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
16334    /// - [`CUresult::CUDA_ERROR_EXTERNAL_DEVICE`]
16335    ///
16336    /// See also: [`cuStreamDestroy`], [`cuStreamCreateWithPriority`], [`cuGreenCtxStreamCreate`], [`cuStreamGetPriority`], [`cuStreamGetFlags`], [`cuStreamGetDevice`], [`cuStreamWaitEvent`], [`cuStreamQuery`], [`cuStreamSynchronize`], [`cuStreamAddCallback`], `cudaStreamCreate`, `cudaStreamCreateWithFlags`.
16337    pub fn cuStreamCreate(
16338        phStream: *mut CUstream,
16339        Flags: ::core::ffi::c_uint,
16340    ) -> CUresult;
16341}
16342singe_loader::functions! { crate::DRIVER;
16343    /// Create a stream with the given priority.
16344    ///
16345    /// Creates a stream with the specified priority and returns a handle in `phStream`. This affects the scheduling priority of work in the stream. Priorities provide a hint to preferentially run work with higher priority when possible, but do not preempt already-running work or provide any other functional guarantee on execution order.
16346    ///
16347    /// `priority` follows a convention where lower numbers represent higher priorities. ‘0’ represents default priority. The range of meaningful numerical priorities can be queried using [`cuCtxGetStreamPriorityRange`]. If the specified priority is outside the numerical range returned by [`cuCtxGetStreamPriorityRange`], it will automatically be clamped to the lowest or the highest number in the range.
16348    ///
16349    /// Note that this function may also return error codes from previous, asynchronous launches.
16350    ///
16351    /// Note: Stream priorities are supported only on GPUs with compute capability 3.5 or higher.
16352    ///
16353    /// Note: In the current implementation, only compute kernels launched in priority streams are affected by the stream’s priority. Stream priorities have no effect on host-to-device and device-to-host memory operations.
16354    ///
16355    /// # Parameters
16356    ///
16357    /// - `phStream`: Returned newly created stream.
16358    /// - `flags`: Flags for stream creation. See [`cuStreamCreate`] for a list of valid flags.
16359    /// - `priority`: Stream priority. Lower numbers represent higher priorities. See [`cuCtxGetStreamPriorityRange`] for more information about meaningful stream priorities that can be passed.
16360    ///
16361    /// # Return value
16362    ///
16363    /// - [`CUresult::CUDA_SUCCESS`]
16364    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
16365    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
16366    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
16367    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
16368    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
16369    /// - [`CUresult::CUDA_ERROR_EXTERNAL_DEVICE`]
16370    ///
16371    /// See also: [`cuStreamDestroy`], [`cuStreamCreate`], [`cuGreenCtxStreamCreate`], [`cuStreamGetPriority`], [`cuCtxGetStreamPriorityRange`], [`cuStreamGetFlags`], [`cuStreamGetDevice`], [`cuStreamWaitEvent`], [`cuStreamQuery`], [`cuStreamSynchronize`], [`cuStreamAddCallback`], `cudaStreamCreateWithPriority`.
16372    pub fn cuStreamCreateWithPriority(
16373        phStream: *mut CUstream,
16374        flags: ::core::ffi::c_uint,
16375        priority: ::core::ffi::c_int,
16376    ) -> CUresult;
16377}
16378singe_loader::functions! { crate::DRIVER;
16379    /// Begins capture to CIG on a stream.
16380    ///
16381    /// Support for CIG streams with D3D12 can be determined using [`cuDeviceGetAttribute`] with [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_D3D12_CIG_STREAMS_SUPPORTED`].
16382    ///
16383    /// Begin CIG (CUDA in Graphics) capture on `hStream` for the graphics API as provided in `streamCigCaptureParams`. When a stream is in CIG capture mode, all operations pushed into the stream will not be executed, but will instead be captured into a graphics API command list/command buffer. All kernel launches and memory copy/memory set operations on the CIG stream will be recorded. When the command list is executed by the graphics API, all the stream’s operations will execute in order along with other graphics API commands in the command list.
16384    ///
16385    /// CIG stream capture may not be initiated if `stream` is CU_STREAM_LEGACY. Capture must be ended on the same stream in which it was initiated, and it may only be initiated if the stream is not already in CIG capture mode.
16386    ///
16387    /// The context must be also created in CIG mode previously, otherwise this operation will fail and [`cudaError_enum::CUDA_ERROR_INVALID_CONTEXT`] will be returned.
16388    ///
16389    /// Data from the graphics client can be shared with CUDA via the `streamSharedData` in `streamCigCaptureParams`. The format of `streamSharedData` is dependent on the type of the graphics client. For D3D12, `streamSharedData` is an ID3D12CommandList object pointer. The command list must be in ready state for recording commands whenever kernels are launched on the stream. The command list provided must belong to the graphics API device that the CIG context was created with, otherwise the behavior will be undefined.
16390    ///
16391    /// The stream object may not be destroyed until its associated command list has finished executing on the GPU. The command list/command buffer used for capture may not be submitted for execution before a call to cuStreamEndCaptureToCig is made on the associated stream.
16392    ///
16393    /// Graphics resources to be accessed by work recorded on the CIG stream must use UAV barriers on the command list prior to recording work that accesses them on the stream.
16394    ///
16395    /// Resubmission of the same recorded command list is not allowed. Further more, care must be taken for the order of execution of the recorded CUDA work with regards to other CUDA work submitted under the same CIG context. Out-of-order execution can lead to device hangs or exceptions.
16396    ///
16397    /// CIG capture mode operates similarly to [`cuStreamBeginCapture`] with the [`CUstreamCaptureMode::CU_STREAM_CAPTURE_MODE_RELAXED`] option. There are additional limitations to streams in CIG capture mode. The following functions are not allowed for CIG streams whether directly or indirectly via a recorded graph launch: [`cuLaunchHostFunc`] [`cuStreamAddCallback`] [`cuStreamSynchronize`] cuStreamWaitValue32 cuStreamWaitValue64 cuStreamBatchMemOp cuStreamBeginCapture [`cuStreamBeginCaptureToGraph`] [`cuMemAllocAsync`] [`cuMemFreeAsync`].
16398    ///
16399    /// Note that this function may also return error codes from previous, asynchronous launches.
16400    ///
16401    /// # Parameters
16402    ///
16403    /// - `hStream`: Stream in which to initiate capture to CIG.
16404    /// - `streamCigCaptureParams`: CIG capture parameters.
16405    ///
16406    /// # Return value
16407    ///
16408    /// - [`CUresult::CUDA_SUCCESS`]
16409    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
16410    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
16411    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
16412    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
16413    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
16414    ///
16415    /// See also: [`cuStreamEndCaptureToCig`], [`cuStreamBeginCapture`], [`cuStreamWaitEvent`], [`cuStreamQuery`], [`cuStreamSynchronize`], [`cuStreamAddCallback`].
16416    pub fn cuStreamBeginCaptureToCig(
16417        hStream: CUstream,
16418        streamCigCaptureParams: *mut CUstreamCigCaptureParams,
16419    ) -> CUresult;
16420}
16421singe_loader::functions! { crate::DRIVER;
16422    /// Ends CIG capture on a stream.
16423    ///
16424    /// End CIG capture on `hStream`. Capture must have been initiated on `hStream` via a call to cuStreamBeginCaptureToCig. Once this function is called, `hStream` will exit CIG capture mode and return to its original state, thus removing all CIG stream restrictions. Also, the command list/command buffer that was associated with `hStream` in the previous call to cuStreamBeginCaptureToCig is now allowed to be submitted for execution on the graphics API. However, the stream may not be destroyed until execution of the command list is fully done on the GPU. This requirements extends also to all streams dependent on the CIG stream (e.g. via event waits).
16425    ///
16426    /// Note that this function may also return error codes from previous, asynchronous launches.
16427    ///
16428    /// # Parameters
16429    ///
16430    /// - `hStream`: Stream to end CIG capture
16431    ///
16432    /// # Return value
16433    ///
16434    /// - [`CUresult::CUDA_SUCCESS`]
16435    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
16436    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
16437    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
16438    /// - [`CUresult::CUDA_ERROR_STREAM_CAPTURE_WRONG_THREAD`]
16439    ///
16440    /// See also: [`cuStreamBeginCaptureToCig`].
16441    pub fn cuStreamEndCaptureToCig(hStream: CUstream) -> CUresult;
16442}
16443singe_loader::functions! { crate::DRIVER;
16444    /// Query the priority of a given stream.
16445    ///
16446    /// Query the priority of a stream created using [`cuStreamCreate`], [`cuStreamCreateWithPriority`] or [`cuGreenCtxStreamCreate`] and return the priority in `priority`. Note that if the stream was created with a priority outside the numerical range returned by [`cuCtxGetStreamPriorityRange`], this function returns the clamped priority. See [`cuStreamCreateWithPriority`] for details about priority clamping.
16447    ///
16448    /// Note that this function may also return error codes from previous, asynchronous launches.
16449    ///
16450    /// # Parameters
16451    ///
16452    /// - `hStream`: Handle to the stream to be queried.
16453    /// - `priority`: Pointer to a signed integer in which the stream’s priority is returned.
16454    ///
16455    /// # Return value
16456    ///
16457    /// - [`CUresult::CUDA_SUCCESS`]
16458    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
16459    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
16460    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
16461    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
16462    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
16463    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
16464    ///
16465    /// See also: [`cuStreamDestroy`], [`cuStreamCreate`], [`cuStreamCreateWithPriority`], [`cuGreenCtxStreamCreate`], [`cuCtxGetStreamPriorityRange`], [`cuStreamGetFlags`], [`cuStreamGetDevice`], `cudaStreamGetPriority`.
16466    pub fn cuStreamGetPriority(
16467        hStream: CUstream,
16468        priority: *mut ::core::ffi::c_int,
16469    ) -> CUresult;
16470}
16471singe_loader::functions! { crate::DRIVER;
16472    /// Returns the device handle of the stream.
16473    ///
16474    /// Returns in `*device` the device handle of the stream.
16475    ///
16476    /// Note that this function may also return error codes from previous, asynchronous launches.
16477    ///
16478    /// # Parameters
16479    ///
16480    /// - `hStream`: Handle to the stream to be queried.
16481    /// - `device`: Returns the device to which a stream belongs.
16482    ///
16483    /// # Return value
16484    ///
16485    /// - [`CUresult::CUDA_SUCCESS`]
16486    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
16487    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
16488    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
16489    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
16490    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
16491    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
16492    ///
16493    /// See also: [`cuStreamDestroy`], [`cuStreamCreate`], [`cuGreenCtxStreamCreate`], [`cuStreamGetFlags`].
16494    pub fn cuStreamGetDevice(hStream: CUstream, device: *mut CUdevice) -> CUresult;
16495}
16496singe_loader::functions! { crate::DRIVER;
16497    /// Query the flags of a given stream.
16498    ///
16499    /// Query the flags of a stream created using [`cuStreamCreate`], [`cuStreamCreateWithPriority`] or [`cuGreenCtxStreamCreate`] and return the flags in `flags`.
16500    ///
16501    /// Note that this function may also return error codes from previous, asynchronous launches.
16502    ///
16503    /// # Parameters
16504    ///
16505    /// - `hStream`: Handle to the stream to be queried.
16506    /// - `flags`: Pointer to an unsigned integer in which the stream’s flags are returned The value returned in `flags` is a logical ‘OR’ of all flags that were used while creating this stream. See [`cuStreamCreate`] for the list of valid flags.
16507    ///
16508    /// # Return value
16509    ///
16510    /// - [`CUresult::CUDA_SUCCESS`]
16511    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
16512    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
16513    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
16514    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
16515    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
16516    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
16517    ///
16518    /// See also: [`cuStreamDestroy`], [`cuStreamCreate`], [`cuGreenCtxStreamCreate`], [`cuStreamGetPriority`], `cudaStreamGetFlags`, [`cuStreamGetDevice`].
16519    pub fn cuStreamGetFlags(
16520        hStream: CUstream,
16521        flags: *mut ::core::ffi::c_uint,
16522    ) -> CUresult;
16523}
16524singe_loader::functions! { crate::DRIVER;
16525    /// Returns the unique Id associated with the stream handle supplied.
16526    ///
16527    /// Returns in `streamId` the unique Id which is associated with the given stream handle. The Id is unique for the life of the program.
16528    ///
16529    /// The stream handle `hStream` can refer to any of the following:
16530    ///
16531    /// * a stream created via any of the CUDA driver APIs such as [`cuStreamCreate`] and [`cuStreamCreateWithPriority`], or their runtime API equivalents such as `cudaStreamCreate`, `cudaStreamCreateWithFlags` and `cudaStreamCreateWithPriority`. Passing an invalid handle will result in undefined behavior.
16532    /// * any of the special streams such as the NULL stream, [CU_STREAM_LEGACY](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__TYPES.html#group__cuda__types_1gaa53e8210837f039dd6434a3a4c3324aa) and [CU_STREAM_PER_THREAD](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__TYPES.html#group__cuda__types_1ga02e40b82600f62c42ed29abb150f857c). The runtime API equivalents of these are also accepted, which are NULL, `cudaStreamLegacy` and `cudaStreamPerThread` respectively.
16533    ///
16534    /// Note that this function may also return error codes from previous, asynchronous launches.
16535    ///
16536    /// # Parameters
16537    ///
16538    /// - `hStream`: Handle to the stream to be queried.
16539    /// - `streamId`: Pointer to store the Id of the stream.
16540    ///
16541    /// # Return value
16542    ///
16543    /// - [`CUresult::CUDA_SUCCESS`]
16544    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
16545    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
16546    ///
16547    /// See also: [`cuStreamDestroy`], [`cuStreamCreate`], [`cuStreamGetPriority`], `cudaStreamGetId`.
16548    pub fn cuStreamGetId(
16549        hStream: CUstream,
16550        streamId: *mut ::core::ffi::c_ulonglong,
16551    ) -> CUresult;
16552}
16553singe_loader::functions! { crate::DRIVER;
16554    /// Query the context associated with a stream.
16555    ///
16556    /// Returns the CUDA context that the stream is associated with.
16557    ///
16558    /// If the stream was created via the API [`cuGreenCtxStreamCreate`], the returned context is equivalent to the one returned by [`cuCtxFromGreenCtx`] on the green context associated with the stream at creation time.
16559    ///
16560    /// The stream handle `hStream` can refer to any of the following:
16561    ///
16562    /// * a stream created via any of the CUDA driver APIs such as [`cuStreamCreate`] and [`cuStreamCreateWithPriority`], or their runtime API equivalents such as `cudaStreamCreate`, `cudaStreamCreateWithFlags` and `cudaStreamCreateWithPriority`. The returned context is the context that was active in the calling thread when the stream was created. Passing an invalid handle will result in undefined behavior.
16563    /// * any of the special streams such as the NULL stream, [CU_STREAM_LEGACY](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__TYPES.html#group__cuda__types_1gaa53e8210837f039dd6434a3a4c3324aa) and [CU_STREAM_PER_THREAD](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__TYPES.html#group__cuda__types_1ga02e40b82600f62c42ed29abb150f857c). The runtime API equivalents of these are also accepted, which are NULL, `cudaStreamLegacy` and `cudaStreamPerThread` respectively. Specifying any of the special handles will return the context current to the calling thread. If no context is current to the calling thread, [`cudaError_enum::CUDA_ERROR_INVALID_CONTEXT`] is returned.
16564    ///
16565    /// Note that this function may also return error codes from previous, asynchronous launches.
16566    ///
16567    /// # Parameters
16568    ///
16569    /// - `hStream`: Handle to the stream to be queried.
16570    /// - `pctx`: Returned context associated with the stream.
16571    ///
16572    /// # Return value
16573    ///
16574    /// - [`CUresult::CUDA_SUCCESS`]
16575    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
16576    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
16577    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
16578    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
16579    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
16580    ///
16581    /// See also: [`cuStreamDestroy`], [`cuStreamCreateWithPriority`], [`cuStreamGetPriority`], [`cuStreamGetFlags`], [`cuStreamGetDevice`], [`cuStreamWaitEvent`], [`cuStreamQuery`], [`cuStreamSynchronize`], [`cuStreamAddCallback`], `cudaStreamCreate`, `cudaStreamCreateWithFlags`.
16582    pub fn cuStreamGetCtx(hStream: CUstream, pctx: *mut CUcontext) -> CUresult;
16583}
16584singe_loader::functions! { crate::DRIVER;
16585    /// Query the contexts associated with a stream.
16586    ///
16587    /// Returns the contexts that the stream is associated with.
16588    ///
16589    /// If the stream is associated with a green context, the API returns the green context in `pGreenCtx` and the primary context of the associated device in `pCtx`.
16590    ///
16591    /// If the stream is associated with a regular context, the API returns the regular context in `pCtx` and NULL in `pGreenCtx`.
16592    ///
16593    /// The stream handle `hStream` can refer to any of the following:
16594    ///
16595    /// * a stream created via any of the CUDA driver APIs such as [`cuStreamCreate`], [`cuStreamCreateWithPriority`] and [`cuGreenCtxStreamCreate`], or their runtime API equivalents such as `cudaStreamCreate`, `cudaStreamCreateWithFlags` and `cudaStreamCreateWithPriority`. Passing an invalid handle will result in undefined behavior.
16596    /// * any of the special streams such as the NULL stream, [CU_STREAM_LEGACY](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__TYPES.html#group__cuda__types_1gaa53e8210837f039dd6434a3a4c3324aa) and [CU_STREAM_PER_THREAD](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__TYPES.html#group__cuda__types_1ga02e40b82600f62c42ed29abb150f857c). The runtime API equivalents of these are also accepted, which are NULL, `cudaStreamLegacy` and `cudaStreamPerThread` respectively. If any of the special handles are specified, the API will operate on the context current to the calling thread. If a green context (that was converted via [`cuCtxFromGreenCtx`] before setting it current) is current to the calling thread, the API will return the green context in `pGreenCtx` and the primary context of the associated device in `pCtx`. If a regular context is current, the API returns the regular context in `pCtx` and NULL in `pGreenCtx`. Note that specifying [CU_STREAM_PER_THREAD](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__TYPES.html#group__cuda__types_1ga02e40b82600f62c42ed29abb150f857c) or `cudaStreamPerThread` will return [`cudaError_enum::CUDA_ERROR_INVALID_HANDLE`] if a green context is current to the calling thread. If no context is current to the calling thread, [`cudaError_enum::CUDA_ERROR_INVALID_CONTEXT`] is returned.
16597    ///
16598    /// Note that this function may also return error codes from previous, asynchronous launches.
16599    ///
16600    /// # Parameters
16601    ///
16602    /// - `hStream`: Handle to the stream to be queried.
16603    /// - `pCtx`: Returned regular context associated with the stream.
16604    /// - `pGreenCtx`: Returned green context if the stream is associated with a green context or NULL if not.
16605    ///
16606    /// # Return value
16607    ///
16608    /// - [`CUresult::CUDA_SUCCESS`]
16609    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
16610    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
16611    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
16612    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
16613    ///
16614    /// See also: [`cuStreamDestroy`], [`cuStreamCreate`], [`cuStreamCreateWithPriority`], [`cuGreenCtxStreamCreate`], [`cuStreamGetPriority`], [`cuStreamGetFlags`], [`cuStreamGetDevice`], [`cuStreamWaitEvent`], [`cuStreamQuery`], [`cuStreamSynchronize`], [`cuStreamAddCallback`], `cudaStreamCreate`, `cudaStreamCreateWithFlags`.
16615    pub fn cuStreamGetCtx_v2(
16616        hStream: CUstream,
16617        pCtx: *mut CUcontext,
16618        pGreenCtx: *mut CUgreenCtx,
16619    ) -> CUresult;
16620}
16621singe_loader::functions! { crate::DRIVER;
16622    /// Make a compute stream wait on an event.
16623    ///
16624    /// Makes all future work submitted to `hStream` wait for all work captured in `hEvent`. See [`cuEventRecord`] for details on what is captured by an event. The synchronization will be performed efficiently on the device when applicable. `hEvent` may be from a different context or device than `hStream`.
16625    ///
16626    /// flags include:
16627    ///
16628    /// * [`CUevent_wait_flags_enum::CU_EVENT_WAIT_DEFAULT`]: Default event creation flag.
16629    /// * [`CUevent_wait_flags_enum::CU_EVENT_WAIT_EXTERNAL`]: Event is captured in the graph as an external event node when performing stream capture. This flag is invalid outside of stream capture.
16630    ///
16631    /// Note: This function uses standard default stream semantics.
16632    ///
16633    /// Note that this function may also return error codes from previous, asynchronous launches.
16634    ///
16635    /// # Parameters
16636    ///
16637    /// - `hStream`: Stream to wait.
16638    /// - `hEvent`: Event to wait on (may not be NULL).
16639    /// - `Flags`: See `CUevent_capture_flags`.
16640    ///
16641    /// # Return value
16642    ///
16643    /// - [`CUresult::CUDA_SUCCESS`]
16644    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
16645    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
16646    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
16647    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
16648    ///
16649    /// See also: [`cuStreamCreate`], [`cuEventRecord`], [`cuStreamQuery`], [`cuStreamSynchronize`], [`cuStreamAddCallback`], [`cuStreamDestroy`], `cudaStreamWaitEvent`.
16650    pub fn cuStreamWaitEvent(
16651        hStream: CUstream,
16652        hEvent: CUevent,
16653        Flags: ::core::ffi::c_uint,
16654    ) -> CUresult;
16655}
16656singe_loader::functions! { crate::DRIVER;
16657    /// Add a callback to a compute stream.
16658    ///
16659    /// Adds a callback to be called on the host after all currently enqueued items in the stream have completed. For each cuStreamAddCallback call, the callback will be executed exactly once. The callback will block later work in the stream until it is finished.
16660    ///
16661    /// The callback may be passed [`cudaError_enum::CUDA_SUCCESS`] or an error code. In the event of a device error, all subsequently executed callbacks will receive an appropriate [`CUresult`].
16662    ///
16663    /// Callbacks must not make any CUDA API calls. Attempting to use a CUDA API will result in [`cudaError_enum::CUDA_ERROR_NOT_PERMITTED`]. Callbacks must not perform any synchronization that may depend on outstanding device work or other callbacks that are not mandated to run earlier. Callbacks without a mandated order (in independent streams) execute in undefined order and may be serialized.
16664    ///
16665    /// For the purposes of Unified Memory, callback execution makes a number of guarantees:
16666    ///
16667    /// * The callback stream is considered idle for the duration of the callback. Thus, for example, a callback may always use memory attached to the callback stream.
16668    /// * The start of execution of a callback has the same effect as synchronizing an event recorded in the same stream immediately prior to the callback. It thus synchronizes streams which have been “joined” prior to the callback.
16669    /// * Adding device work to any stream does not have the effect of making the stream active until all preceding host functions and stream callbacks have executed. Thus, for example, a callback might use global attached memory even if work has been added to another stream, if the work has been ordered behind the callback with an event.
16670    /// * Completion of a callback does not cause a stream to become active except as described above. The callback stream will remain idle if no device work follows the callback, and will remain idle across consecutive callbacks without device work in between. Thus, for example, stream synchronization can be done by signaling from a callback at the end of the stream.
16671    ///
16672    /// Note: This function is slated for eventual deprecation and removal. If you do not require the callback to execute in case of a device error, consider using [`cuLaunchHostFunc`]. Additionally, this function is not supported with cuStreamBeginCapture and [`cuStreamEndCapture`], unlike [`cuLaunchHostFunc`].
16673    ///
16674    /// Note: This function uses standard default stream semantics.
16675    ///
16676    /// Note that this function may also return error codes from previous, asynchronous launches.
16677    ///
16678    /// # Parameters
16679    ///
16680    /// - `hStream`: Stream to add callback to.
16681    /// - `callback`: The function to call once preceding stream operations are complete.
16682    /// - `userData`: User specified data to be passed to the callback function.
16683    /// - `flags`: Reserved for future use, must be 0.
16684    ///
16685    /// # Return value
16686    ///
16687    /// - [`CUresult::CUDA_SUCCESS`]
16688    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
16689    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
16690    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
16691    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
16692    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
16693    ///
16694    /// See also: [`cuStreamCreate`], [`cuStreamQuery`], [`cuStreamSynchronize`], [`cuStreamWaitEvent`], [`cuStreamDestroy`], [`cuMemAllocManaged`], [`cuStreamAttachMemAsync`], [`cuLaunchHostFunc`], `cudaStreamAddCallback`.
16695    pub fn cuStreamAddCallback(
16696        hStream: CUstream,
16697        callback: CUstreamCallback,
16698        userData: *mut ::core::ffi::c_void,
16699        flags: ::core::ffi::c_uint,
16700    ) -> CUresult;
16701}
16702singe_loader::functions! { crate::DRIVER;
16703    /// Begins graph capture on a stream.
16704    ///
16705    /// Begin graph capture on `hStream`. When a stream is in capture mode, all operations pushed into the stream will not be executed, but will instead be captured into a graph, which will be returned via [`cuStreamEndCapture`]. Capture may not be initiated if `stream` is CU_STREAM_LEGACY. Capture must be ended on the same stream in which it was initiated, and it may only be initiated if the stream is not already in capture mode. The capture mode may be queried via [`cuStreamIsCapturing`]. A unique id representing the capture sequence may be queried via cuStreamGetCaptureInfo.
16706    ///
16707    /// If `mode` is not [`CUstreamCaptureMode::CU_STREAM_CAPTURE_MODE_RELAXED`], [`cuStreamEndCapture`] must be called on this stream from the same thread.
16708    ///
16709    /// Note: Kernels captured using this API must not use texture and surface references. Reading or writing through any texture or surface reference is undefined behavior. This restriction does not apply to texture and surface objects.
16710    ///
16711    /// Note that this function may also return error codes from previous, asynchronous launches.
16712    ///
16713    /// # Parameters
16714    ///
16715    /// - `hStream`: Stream in which to initiate capture.
16716    /// - `mode`: Controls the interaction of this capture sequence with other API calls that are potentially unsafe. For more details see [`cuThreadExchangeStreamCaptureMode`].
16717    ///
16718    /// # Return value
16719    ///
16720    /// - [`CUresult::CUDA_SUCCESS`]
16721    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
16722    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
16723    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
16724    ///
16725    /// See also: [`cuStreamCreate`], [`cuStreamIsCapturing`], [`cuStreamEndCapture`], [`cuThreadExchangeStreamCaptureMode`].
16726    pub fn cuStreamBeginCapture_v2(
16727        hStream: CUstream,
16728        mode: CUstreamCaptureMode,
16729    ) -> CUresult;
16730}
16731impl CUgraphRecaptureStatus_enum {
16732    /// Node is eligible for update in an instantiated graph.
16733    pub const CU_GRAPH_RECAPTURE_ELIGIBLE_FOR_UPDATE: CUgraphRecaptureStatus_enum = CUgraphRecaptureStatus_enum(
16734        0,
16735    );
16736    /// Parameter changes in the node cannot be applied to an instantiated graph.
16737    pub const CU_GRAPH_RECAPTURE_INELIGIBLE_FOR_UPDATE: CUgraphRecaptureStatus_enum = CUgraphRecaptureStatus_enum(
16738        1,
16739    );
16740    /// Error while attempting to recapture the node.
16741    ///
16742    /// The recapture will be ended regardless of the return value from the callback.
16743    pub const CU_GRAPH_RECAPTURE_ERROR: CUgraphRecaptureStatus_enum = CUgraphRecaptureStatus_enum(
16744        2,
16745    );
16746}
16747/// Whether a recaptured node can update an existing executable graph, or encountered an error.
16748#[repr(transparent)]
16749#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
16750pub struct CUgraphRecaptureStatus_enum(pub ::core::ffi::c_uint);
16751pub use self::CUgraphRecaptureStatus_enum as CUgraphRecaptureStatus;
16752/// Callback function invoked when node parameter mismatches are detected while recapturing to an existing graph.
16753///
16754/// Parameter struct pointers are only valid within the callback.
16755pub type CUgraphRecaptureCallback = ::core::option::Option<
16756    unsafe extern "C" fn(
16757        data: *mut ::core::ffi::c_void,
16758        node: CUgraphNode,
16759        originalParams: *const CUgraphNodeParams,
16760        recaptureParams: *const CUgraphNodeParams,
16761        status: CUgraphRecaptureStatus,
16762    ) -> CUresult,
16763>;
16764singe_loader::functions! { crate::DRIVER;
16765    /// Begin graph capture on a stream to an existing graph.
16766    ///
16767    /// Begin graph capture on `hStream` to the existing `hGraph`. The node creation order while recapturing the graph must be identical to the original graph. The recapture will fail immediately for:
16768    ///
16769    /// * Topology mismatches between the existing graph and the recaptured graph
16770    /// * Parameter mismatches for memory allocation or free nodes
16771    ///
16772    /// Any other node parameter mismatches during recapture can be configured to call the function provided in `callbackFunc`. The recapture will fail immediately if the callback returns anything other than [`CUresult::CUDA_SUCCESS`].
16773    ///
16774    /// If the recapture fails for any reason, the `graph` will be in an undefined state and should be destroyed.
16775    ///
16776    /// See cuStreamBeginCapture for additional detail on beginning the capture.
16777    ///
16778    /// Note: Any user objects associated with `graph` will be released prior to the recapture.
16779    ///
16780    /// Note that this function may also return error codes from previous, asynchronous launches.
16781    ///
16782    /// # Parameters
16783    ///
16784    /// - `hStream`: Stream in which to initiate capture.
16785    /// - `mode`: Controls the interaction of this capture sequence with other API calls that are potentially unsafe. For more details see [`cuThreadExchangeStreamCaptureMode`].
16786    /// - `hGraph`: Existing CUDA graph to be captured into.
16787    /// - `callbackFunc`: Function that will be called for all parameter mismatches from the original graph.
16788    /// - `userData`: A generic pointer to user data that is passed into the callback function.
16789    ///
16790    /// # Return value
16791    ///
16792    /// - [`CUresult::CUDA_SUCCESS`]
16793    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
16794    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
16795    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
16796    ///
16797    /// See also: [`cuStreamCreate`], [`cuStreamBeginCapture`], [`cuStreamIsCapturing`], [`cuStreamEndCapture`], [`cuThreadExchangeStreamCaptureMode`].
16798    pub fn cuStreamBeginRecaptureToGraph(
16799        hStream: CUstream,
16800        mode: CUstreamCaptureMode,
16801        hGraph: CUgraph,
16802        callbackFunc: CUgraphRecaptureCallback,
16803        userData: *mut ::core::ffi::c_void,
16804    ) -> CUresult;
16805}
16806singe_loader::functions! { crate::DRIVER;
16807    /// Begins graph capture on a stream to an existing graph.
16808    ///
16809    /// Begin graph capture on `hStream`, placing new nodes into an existing graph. When a stream is in capture mode, all operations pushed into the stream will not be executed, but will instead be captured into `hGraph`. The graph will not be instantiable until the user calls [`cuStreamEndCapture`].
16810    ///
16811    /// Capture may not be initiated if `stream` is CU_STREAM_LEGACY. Capture must be ended on the same stream in which it was initiated, and it may only be initiated if the stream is not already in capture mode. The capture mode may be queried via [`cuStreamIsCapturing`]. A unique id representing the capture sequence may be queried via cuStreamGetCaptureInfo.
16812    ///
16813    /// If `mode` is not [`CUstreamCaptureMode::CU_STREAM_CAPTURE_MODE_RELAXED`], [`cuStreamEndCapture`] must be called on this stream from the same thread.
16814    ///
16815    /// Note: Kernels captured using this API must not use texture and surface references. Reading or writing through any texture or surface reference is undefined behavior. This restriction does not apply to texture and surface objects.
16816    ///
16817    /// Note that this function may also return error codes from previous, asynchronous launches.
16818    ///
16819    /// # Parameters
16820    ///
16821    /// - `hStream`: Stream in which to initiate capture.
16822    /// - `hGraph`: Graph to capture into.
16823    /// - `dependencies`: Dependencies of the first node captured in the stream. Can be NULL if numDependencies is 0.
16824    /// - `dependencyData`: Optional array of data associated with each dependency.
16825    /// - `numDependencies`: Number of dependencies.
16826    /// - `mode`: Controls the interaction of this capture sequence with other API calls that are potentially unsafe. For more details see [`cuThreadExchangeStreamCaptureMode`].
16827    ///
16828    /// # Return value
16829    ///
16830    /// - [`CUresult::CUDA_SUCCESS`]
16831    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
16832    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
16833    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
16834    ///
16835    /// See also: [`cuStreamBeginCapture`], [`cuStreamCreate`], [`cuStreamIsCapturing`], [`cuStreamEndCapture`], [`cuThreadExchangeStreamCaptureMode`], [`cuGraphAddNode`].
16836    pub fn cuStreamBeginCaptureToGraph(
16837        hStream: CUstream,
16838        hGraph: CUgraph,
16839        dependencies: *const CUgraphNode,
16840        dependencyData: *const CUgraphEdgeData,
16841        numDependencies: size_t,
16842        mode: CUstreamCaptureMode,
16843    ) -> CUresult;
16844}
16845singe_loader::functions! { crate::DRIVER;
16846    /// Swaps the stream capture interaction mode for a thread.
16847    ///
16848    /// Sets the calling thread’s stream capture interaction mode to the value contained in `*mode`, and overwrites `*mode` with the previous mode for the thread. To facilitate deterministic behavior across function or module boundaries, callers are encouraged to use this API in a push-pop fashion:
16849    ///
16850    /// ```text
16851    /// CUstreamCaptureMode mode = desiredMode;
16852    /// cuThreadExchangeStreamCaptureMode(&mode);
16853    /// ...
16854    /// cuThreadExchangeStreamCaptureMode(&mode); // restore previous mode
16855    /// ```
16856    ///
16857    /// During stream capture (see cuStreamBeginCapture), some actions, such as a call to `cudaMalloc`, may be unsafe. In the case of `cudaMalloc`, the operation is not enqueued asynchronously to a stream, and is not observed by stream capture. Therefore, if the sequence of operations captured via cuStreamBeginCapture depended on the allocation being replayed whenever the graph is launched, the captured graph would be invalid.
16858    ///
16859    /// Therefore, stream capture places restrictions on API calls that can be made within or concurrently to a cuStreamBeginCapture-[`cuStreamEndCapture`] sequence. This behavior can be controlled via this API and flags to cuStreamBeginCapture.
16860    ///
16861    /// A thread’s mode is one of the following:
16862    ///
16863    /// * `CU_STREAM_CAPTURE_MODE_GLOBAL:` This is the default mode. If the local thread has an ongoing capture sequence that was not initiated with [`CUstreamCaptureMode::CU_STREAM_CAPTURE_MODE_RELAXED`] at [`cuStreamBeginCapture`], or if any other thread has a concurrent capture sequence initiated with [`CUstreamCaptureMode::CU_STREAM_CAPTURE_MODE_GLOBAL`], this thread is prohibited from potentially unsafe API calls.
16864    /// * `CU_STREAM_CAPTURE_MODE_THREAD_LOCAL:` If the local thread has an ongoing capture sequence not initiated with [`CUstreamCaptureMode::CU_STREAM_CAPTURE_MODE_RELAXED`], it is prohibited from potentially unsafe API calls. Concurrent capture sequences in other threads are ignored.
16865    /// * `CU_STREAM_CAPTURE_MODE_RELAXED:` The local thread is not prohibited from potentially unsafe API calls. Note that the thread is still prohibited from API calls which necessarily conflict with stream capture, for example, attempting [`cuEventQuery`] on an event that was last recorded inside a capture sequence.
16866    ///
16867    /// Note that this function may also return error codes from previous, asynchronous launches.
16868    ///
16869    /// # Parameters
16870    ///
16871    /// - `mode`: Pointer to mode value to swap with the current mode
16872    ///
16873    /// # Return value
16874    ///
16875    /// - [`CUresult::CUDA_SUCCESS`]
16876    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
16877    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
16878    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
16879    ///
16880    /// See also: [`cuStreamBeginCapture`].
16881    pub fn cuThreadExchangeStreamCaptureMode(mode: *mut CUstreamCaptureMode) -> CUresult;
16882}
16883singe_loader::functions! { crate::DRIVER;
16884    /// Ends capture on a stream, returning the captured graph.
16885    ///
16886    /// End capture on `hStream`, returning the captured graph via `phGraph`. Capture must have been initiated on `hStream` via a call to cuStreamBeginCapture. If capture was invalidated, due to a violation of the rules of stream capture, then a NULL graph will be returned.
16887    ///
16888    /// If the `mode` argument to cuStreamBeginCapture was not [`CUstreamCaptureMode::CU_STREAM_CAPTURE_MODE_RELAXED`], this call must be from the same thread as cuStreamBeginCapture.
16889    ///
16890    /// Note that this function may also return error codes from previous, asynchronous launches.
16891    ///
16892    /// # Parameters
16893    ///
16894    /// - `hStream`: Stream to query.
16895    /// - `phGraph`: The captured graph.
16896    ///
16897    /// # Return value
16898    ///
16899    /// - [`CUresult::CUDA_SUCCESS`]
16900    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
16901    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
16902    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
16903    /// - [`CUresult::CUDA_ERROR_STREAM_CAPTURE_WRONG_THREAD`]
16904    ///
16905    /// See also: [`cuStreamCreate`], [`cuStreamBeginCapture`], [`cuStreamIsCapturing`], [`cuGraphDestroy`].
16906    pub fn cuStreamEndCapture(hStream: CUstream, phGraph: *mut CUgraph) -> CUresult;
16907}
16908singe_loader::functions! { crate::DRIVER;
16909    /// Returns a stream’s capture status.
16910    ///
16911    /// Return the capture status of `hStream` via `captureStatus`. After a successful call, `*captureStatus` will contain one of the following:
16912    ///
16913    /// * [`CUstreamCaptureStatus_enum::CU_STREAM_CAPTURE_STATUS_NONE`]: The stream is not capturing.
16914    /// * [`CUstreamCaptureStatus_enum::CU_STREAM_CAPTURE_STATUS_ACTIVE`]: The stream is capturing.
16915    /// * [`CUstreamCaptureStatus_enum::CU_STREAM_CAPTURE_STATUS_INVALIDATED`]: The stream was capturing but an error has invalidated the capture sequence. The capture sequence must be terminated with [`cuStreamEndCapture`] on the stream where it was initiated in order to continue using `hStream`.
16916    ///
16917    /// Note that, if this is called on [CU_STREAM_LEGACY](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__TYPES.html#group__cuda__types_1gaa53e8210837f039dd6434a3a4c3324aa) (the “null stream”) while a blocking stream in the same context is capturing, it will return [`cudaError_enum::CUDA_ERROR_STREAM_CAPTURE_IMPLICIT`] and `*captureStatus` is unspecified after the call. The blocking stream capture is not invalidated.
16918    ///
16919    /// When a blocking stream is capturing, the legacy stream is in an unusable state until the blocking stream capture is terminated. The legacy stream is not supported for stream capture, but attempted use would have an implicit dependency on the capturing stream(s).
16920    ///
16921    /// Note that this function may also return error codes from previous, asynchronous launches.
16922    ///
16923    /// # Parameters
16924    ///
16925    /// - `hStream`: Stream to query.
16926    /// - `captureStatus`: Returns the stream’s capture status.
16927    ///
16928    /// # Return value
16929    ///
16930    /// - [`CUresult::CUDA_SUCCESS`]
16931    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
16932    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
16933    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
16934    /// - [`CUresult::CUDA_ERROR_STREAM_CAPTURE_IMPLICIT`]
16935    ///
16936    /// See also: [`cuStreamCreate`], [`cuStreamBeginCapture`], [`cuStreamEndCapture`].
16937    pub fn cuStreamIsCapturing(
16938        hStream: CUstream,
16939        captureStatus: *mut CUstreamCaptureStatus,
16940    ) -> CUresult;
16941}
16942singe_loader::functions! { crate::DRIVER;
16943    /// Query a stream’s capture state.
16944    ///
16945    /// Query stream state related to stream capture.
16946    ///
16947    /// If called on [CU_STREAM_LEGACY](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__TYPES.html#group__cuda__types_1gaa53e8210837f039dd6434a3a4c3324aa) (the “null stream”) while a stream not created with [`CUstream_flags_enum::CU_STREAM_NON_BLOCKING`] is capturing, returns [`cudaError_enum::CUDA_ERROR_STREAM_CAPTURE_IMPLICIT`].
16948    ///
16949    /// Valid data (other than capture status) is returned only if both of the following are true:
16950    ///
16951    /// * the call returns [`CUresult::CUDA_SUCCESS`]
16952    /// * the returned capture status is [`CUstreamCaptureStatus_enum::CU_STREAM_CAPTURE_STATUS_ACTIVE`]
16953    ///
16954    /// If `edgeData_out` is non-NULL then `dependencies_out` must be as well. If `dependencies_out` is non-NULL and `edgeData_out` is NULL, but there is non-zero edge data for one or more of the current stream dependencies, the call will return [`cudaError_enum::CUDA_ERROR_LOSSY_QUERY`].
16955    ///
16956    /// Note: Graph objects are not threadsafe. More here.
16957    ///
16958    /// Note that this function may also return error codes from previous, asynchronous launches.
16959    ///
16960    /// # Parameters
16961    ///
16962    /// - `hStream`: The stream to query.
16963    /// - `captureStatus_out`: Location to return the capture status of the stream; required.
16964    /// - `id_out`: Optional location to return an id for the capture sequence, which is unique over the lifetime of the process.
16965    /// - `graph_out`: Optional location to return the graph being captured into. All operations other than destroy and node removal are permitted on the graph while the capture sequence is in progress. This API does not transfer ownership of the graph, which is transferred or destroyed at [`cuStreamEndCapture`]. Note that the graph handle may be invalidated before end of capture for certain errors. Nodes that are or become unreachable from the original stream at [`cuStreamEndCapture`] due to direct actions on the graph do not trigger [`cudaError_enum::CUDA_ERROR_STREAM_CAPTURE_UNJOINED`].
16966    /// - `dependencies_out`: Optional location to store a pointer to an array of nodes. The next node to be captured in the stream will depend on this set of nodes, absent operations such as event wait which modify this set. The array pointer is valid until the next API call which operates on the stream or until the capture is terminated. The node handles may be copied out and are valid until they or the graph is destroyed. The driver-owned array may also be passed directly to APIs that operate on the graph (not the stream) without copying.
16967    /// - `edgeData_out`: Optional location to store a pointer to an array of graph edge data. This array parallels `dependencies_out`; the next node to be added has an edge to `dependencies_out`\[i\] with annotation `edgeData_out`\[i\] for each `i`. The array pointer is valid until the next API call which operates on the stream or until the capture is terminated.
16968    /// - `numDependencies_out`: Optional location to store the size of the array returned in dependencies_out.
16969    ///
16970    /// # Return value
16971    ///
16972    /// - [`CUresult::CUDA_SUCCESS`]
16973    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
16974    /// - [`CUresult::CUDA_ERROR_STREAM_CAPTURE_IMPLICIT`]
16975    /// - [`CUresult::CUDA_ERROR_LOSSY_QUERY`]
16976    ///
16977    /// See also: [`cuStreamBeginCapture`], [`cuStreamIsCapturing`], [`cuStreamUpdateCaptureDependencies`].
16978    pub fn cuStreamGetCaptureInfo_v3(
16979        hStream: CUstream,
16980        captureStatus_out: *mut CUstreamCaptureStatus,
16981        id_out: *mut cuuint64_t,
16982        graph_out: *mut CUgraph,
16983        dependencies_out: *mut *const CUgraphNode,
16984        edgeData_out: *mut *const CUgraphEdgeData,
16985        numDependencies_out: *mut size_t,
16986    ) -> CUresult;
16987}
16988singe_loader::functions! { crate::DRIVER;
16989    /// Update the set of dependencies in a capturing stream.
16990    ///
16991    /// Modifies the dependency set of a capturing stream. The dependency set is the set of nodes that the next captured node in the stream will depend on along with the edge data for those dependencies.
16992    ///
16993    /// Valid flags are [`CUstreamUpdateCaptureDependencies_flags_enum::CU_STREAM_ADD_CAPTURE_DEPENDENCIES`] and [`CUstreamUpdateCaptureDependencies_flags_enum::CU_STREAM_SET_CAPTURE_DEPENDENCIES`]. These control whether the set passed to the API is added to the existing set or replaces it. A flags value of 0 defaults to [`CUstreamUpdateCaptureDependencies_flags_enum::CU_STREAM_ADD_CAPTURE_DEPENDENCIES`].
16994    ///
16995    /// Nodes that are removed from the dependency set via this API do not result in [`cudaError_enum::CUDA_ERROR_STREAM_CAPTURE_UNJOINED`] if they are unreachable from the stream at [`cuStreamEndCapture`].
16996    ///
16997    /// Returns [`cudaError_enum::CUDA_ERROR_ILLEGAL_STATE`] if the stream is not capturing.
16998    ///
16999    /// # Parameters
17000    ///
17001    /// - `hStream`: The stream to update.
17002    /// - `dependencies`: The set of dependencies to add.
17003    /// - `dependencyData`: Optional array of data associated with each dependency.
17004    /// - `numDependencies`: The size of the dependencies array.
17005    /// - `flags`: See above.
17006    ///
17007    /// # Return value
17008    ///
17009    /// - [`CUresult::CUDA_SUCCESS`]
17010    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
17011    /// - [`CUresult::CUDA_ERROR_ILLEGAL_STATE`]
17012    ///
17013    /// See also: [`cuStreamBeginCapture`], [`cuStreamGetCaptureInfo`].
17014    pub fn cuStreamUpdateCaptureDependencies_v2(
17015        hStream: CUstream,
17016        dependencies: *mut CUgraphNode,
17017        dependencyData: *const CUgraphEdgeData,
17018        numDependencies: size_t,
17019        flags: ::core::ffi::c_uint,
17020    ) -> CUresult;
17021}
17022singe_loader::functions! { crate::DRIVER;
17023    /// Attach memory to a stream asynchronously.
17024    ///
17025    /// Enqueues an operation in `hStream` to specify stream association of `length` bytes of memory starting from `dptr`. This function is a stream-ordered operation, meaning that it is dependent on, and will only take effect when, previous work in stream has completed. Any previous association is automatically replaced.
17026    ///
17027    /// `dptr` must point to one of the following types of memories:
17028    ///
17029    /// * managed memory declared using the **managed** keyword or allocated with [`cuMemAllocManaged`].
17030    /// * a valid host-accessible region of system-allocated pageable memory. This type of memory may only be specified if the device associated with the stream reports a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`].
17031    ///
17032    /// For managed allocations, `length` must be either zero or the entire allocation’s size. Both indicate that the entire allocation’s stream association is being changed. Currently, it is not possible to change stream association for a portion of a managed allocation.
17033    ///
17034    /// For pageable host allocations, `length` must be non-zero.
17035    ///
17036    /// The stream association is specified using `flags` which must be one of [`CUmemAttach_flags`]. If the [`CUmemAttach_flags_enum::CU_MEM_ATTACH_GLOBAL`] flag is specified, the memory can be accessed by any stream on any device. If the [`CUmemAttach_flags_enum::CU_MEM_ATTACH_HOST`] flag is specified, the program makes a guarantee that it won’t access the memory on the device from any stream on a device that has a zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`]. If the [`CUmemAttach_flags_enum::CU_MEM_ATTACH_SINGLE`] flag is specified and `hStream` is associated with a device that has a zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`], the program makes a guarantee that it will only access the memory on the device from `hStream`. It is illegal to attach singly to the NULL stream, because the NULL stream is a virtual global stream and not a specific stream. An error will be returned in this case.
17037    ///
17038    /// When memory is associated with a single stream, the Unified Memory system will allow CPU access to this memory region so long as all operations in `hStream` have completed, regardless of whether other streams are active. In effect, this constrains exclusive ownership of the managed memory region by an active GPU to per-stream activity instead of whole-GPU activity.
17039    ///
17040    /// Accessing memory on the device from streams that are not associated with it will produce undefined results. No error checking is performed by the Unified Memory system to ensure that kernels launched into other streams do not access this region.
17041    ///
17042    /// It is a program’s responsibility to order calls to [`cuStreamAttachMemAsync`] via events, synchronization or other means to ensure legal access to memory at all times. Data visibility and coherency will be changed appropriately for all kernels which follow a stream-association change.
17043    ///
17044    /// If `hStream` is destroyed while data is associated with it, the association is removed and the association reverts to the default visibility of the allocation as specified at [`cuMemAllocManaged`]. For **managed** variables, the default association is always [`CUmemAttach_flags_enum::CU_MEM_ATTACH_GLOBAL`]. Note that destroying a stream is an asynchronous operation, and as a result, the change to default association won’t happen until all work in the stream has completed.
17045    ///
17046    /// Note: This function uses standard default stream semantics.
17047    ///
17048    /// Note that this function may also return error codes from previous, asynchronous launches.
17049    ///
17050    /// # Parameters
17051    ///
17052    /// - `hStream`: Stream in which to enqueue the attach operation.
17053    /// - `dptr`: Pointer to memory (must be a pointer to managed memory or to a valid host-accessible region of system-allocated pageable memory).
17054    /// - `length`: Length of memory.
17055    /// - `flags`: Must be one of [`CUmemAttach_flags`].
17056    ///
17057    /// # Return value
17058    ///
17059    /// - [`CUresult::CUDA_SUCCESS`]
17060    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
17061    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
17062    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
17063    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
17064    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
17065    ///
17066    /// See also: [`cuStreamCreate`], [`cuStreamQuery`], [`cuStreamSynchronize`], [`cuStreamWaitEvent`], [`cuStreamDestroy`], [`cuMemAllocManaged`], `cudaStreamAttachMemAsync`.
17067    pub fn cuStreamAttachMemAsync(
17068        hStream: CUstream,
17069        dptr: CUdeviceptr,
17070        length: size_t,
17071        flags: ::core::ffi::c_uint,
17072    ) -> CUresult;
17073}
17074singe_loader::functions! { crate::DRIVER;
17075    /// Determine status of a compute stream.
17076    ///
17077    /// Returns [`cudaError_enum::CUDA_SUCCESS`] if all operations in the stream specified by `hStream` have completed, or [`cudaError_enum::CUDA_ERROR_NOT_READY`] if not.
17078    ///
17079    /// For the purposes of Unified Memory, a return value of [`cudaError_enum::CUDA_SUCCESS`] is equivalent to having called [`cuStreamSynchronize`].
17080    ///
17081    /// Note: This function uses standard default stream semantics.
17082    ///
17083    /// Note that this function may also return error codes from previous, asynchronous launches.
17084    ///
17085    /// # Parameters
17086    ///
17087    /// - `hStream`: Stream to query status of
17088    ///
17089    /// # Return value
17090    ///
17091    /// - [`CUresult::CUDA_SUCCESS`]
17092    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
17093    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
17094    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
17095    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
17096    /// - [`CUresult::CUDA_ERROR_NOT_READY`]
17097    ///
17098    /// See also: [`cuStreamCreate`], [`cuStreamWaitEvent`], [`cuStreamDestroy`], [`cuStreamSynchronize`], [`cuStreamAddCallback`], `cudaStreamQuery`.
17099    pub fn cuStreamQuery(hStream: CUstream) -> CUresult;
17100}
17101singe_loader::functions! { crate::DRIVER;
17102    /// Wait until a stream’s tasks are completed.
17103    ///
17104    /// Waits until the device has completed all operations in the stream specified by `hStream`. If the context was created with the [`CUctx_flags_enum::CU_CTX_SCHED_BLOCKING_SYNC`] flag, the CPU thread will block until the stream is finished with all of its tasks.
17105    ///
17106    /// Note: This function uses standard default stream semantics.
17107    ///
17108    /// Note that this function may also return error codes from previous, asynchronous launches.
17109    ///
17110    /// # Parameters
17111    ///
17112    /// - `hStream`: Stream to wait for
17113    ///
17114    /// # Return value
17115    ///
17116    /// - [`CUresult::CUDA_SUCCESS`]
17117    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
17118    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
17119    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
17120    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
17121    ///
17122    /// See also: [`cuStreamCreate`], [`cuStreamDestroy`], [`cuStreamWaitEvent`], [`cuStreamQuery`], [`cuStreamAddCallback`], `cudaStreamSynchronize`.
17123    pub fn cuStreamSynchronize(hStream: CUstream) -> CUresult;
17124}
17125singe_loader::functions! { crate::DRIVER;
17126    /// Destroys a stream.
17127    ///
17128    /// Destroys the stream specified by `hStream`.
17129    ///
17130    /// In case the device is still doing work in the stream `hStream` when cuStreamDestroy() is called, the function will return immediately and the resources associated with `hStream` will be released automatically once the device has completed all work in `hStream`.
17131    ///
17132    /// Note that this function may also return error codes from previous, asynchronous launches.
17133    ///
17134    /// # Return value
17135    ///
17136    /// - [`CUresult::CUDA_SUCCESS`]
17137    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
17138    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
17139    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
17140    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
17141    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
17142    /// - [`CUresult::CUDA_ERROR_EXTERNAL_DEVICE`]
17143    ///
17144    /// See also: [`cuStreamCreate`], [`cuStreamWaitEvent`], [`cuStreamQuery`], [`cuStreamSynchronize`], [`cuStreamAddCallback`], `cudaStreamDestroy`.
17145    pub fn cuStreamDestroy_v2(hStream: CUstream) -> CUresult;
17146}
17147singe_loader::functions! { crate::DRIVER;
17148    /// Copies attributes from source stream to destination stream.
17149    ///
17150    /// Copies attributes from source stream `src` to destination stream `dst`. Both streams must have the same context.
17151    ///
17152    /// Note that this function may also return error codes from previous, asynchronous launches.
17153    ///
17154    /// # Parameters
17155    ///
17156    /// - `dst`: Destination stream.
17157    /// - `src`: Source stream For list of attributes see CUstreamAttrID.
17158    ///
17159    /// # Return value
17160    ///
17161    /// - [`CUresult::CUDA_SUCCESS`]
17162    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
17163    ///
17164    /// See also: [`CUaccessPolicyWindow`].
17165    pub fn cuStreamCopyAttributes(dst: CUstream, src: CUstream) -> CUresult;
17166}
17167singe_loader::functions! { crate::DRIVER;
17168    /// Queries stream attribute.
17169    ///
17170    /// Queries attribute `attr` from `hStream` and stores it in corresponding member of `value_out`.
17171    ///
17172    /// Note that this function may also return error codes from previous, asynchronous launches.
17173    ///
17174    /// # Return value
17175    ///
17176    /// - [`CUresult::CUDA_SUCCESS`]
17177    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
17178    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
17179    ///
17180    /// See also: [`CUaccessPolicyWindow`].
17181    pub fn cuStreamGetAttribute(
17182        hStream: CUstream,
17183        attr: CUstreamAttrID,
17184        value_out: *mut CUstreamAttrValue,
17185    ) -> CUresult;
17186}
17187singe_loader::functions! { crate::DRIVER;
17188    /// Sets stream attribute.
17189    ///
17190    /// Sets attribute `attr` on `hStream` from corresponding attribute of `value`. The updated attribute will be applied to subsequent work submitted to the stream. It will not affect previously submitted work.
17191    ///
17192    /// Note that this function may also return error codes from previous, asynchronous launches.
17193    ///
17194    /// # Return value
17195    ///
17196    /// - [`CUresult::CUDA_SUCCESS`]
17197    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
17198    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
17199    ///
17200    /// See also: [`CUaccessPolicyWindow`].
17201    pub fn cuStreamSetAttribute(
17202        hStream: CUstream,
17203        attr: CUstreamAttrID,
17204        value: *const CUstreamAttrValue,
17205    ) -> CUresult;
17206}
17207singe_loader::functions! { crate::DRIVER;
17208    /// Creates an event.
17209    ///
17210    /// Creates an event \*phEvent for the current context with the flags specified via `Flags`. Valid flags include:
17211    ///
17212    /// * [`CUevent_flags_enum::CU_EVENT_DEFAULT`]: Default event creation flag.
17213    /// * [`CUevent_flags_enum::CU_EVENT_BLOCKING_SYNC`]: Specifies that the created event should use blocking synchronization. A CPU thread that uses [`cuEventSynchronize`] to wait on an event created with this flag will block until the event has actually been recorded.
17214    /// * [`CUevent_flags_enum::CU_EVENT_DISABLE_TIMING`]: Specifies that the created event does not need to record timing data. Events created with this flag specified and the [`CUevent_flags_enum::CU_EVENT_BLOCKING_SYNC`] flag not specified will provide the best performance when used with [`cuStreamWaitEvent`] and [`cuEventQuery`].
17215    /// * [`CUevent_flags_enum::CU_EVENT_INTERPROCESS`]: Specifies that the created event may be used as an interprocess event by [`cuIpcGetEventHandle`]. [`CUevent_flags_enum::CU_EVENT_INTERPROCESS`] must be specified along with [`CUevent_flags_enum::CU_EVENT_DISABLE_TIMING`].
17216    ///
17217    /// Note that this function may also return error codes from previous, asynchronous launches.
17218    ///
17219    /// # Parameters
17220    ///
17221    /// - `phEvent`: Returns newly created event.
17222    /// - `Flags`: Event creation flags.
17223    ///
17224    /// # Return value
17225    ///
17226    /// - [`CUresult::CUDA_SUCCESS`]
17227    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
17228    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
17229    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
17230    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
17231    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
17232    ///
17233    /// See also: [`cuEventRecord`], [`cuEventQuery`], [`cuEventSynchronize`], [`cuEventDestroy`], [`cuEventElapsedTime`], `cudaEventCreate`, `cudaEventCreateWithFlags`.
17234    pub fn cuEventCreate(phEvent: *mut CUevent, Flags: ::core::ffi::c_uint) -> CUresult;
17235}
17236singe_loader::functions! { crate::DRIVER;
17237    /// Records an event.
17238    ///
17239    /// Captures in `hEvent` the contents of `hStream` at the time of this call. `hEvent` and `hStream` must be from the same context otherwise [`cudaError_enum::CUDA_ERROR_INVALID_HANDLE`] is returned. Calls such as [`cuEventQuery`] or [`cuStreamWaitEvent`] will then examine or wait for completion of the work that was captured. Uses of `hStream` after this call do not modify `hEvent`. See note on default stream behavior for what is captured in the default case.
17240    ///
17241    /// [`cuEventRecord`] can be called multiple times on the same event and will overwrite the previously captured state. Other APIs such as [`cuStreamWaitEvent`] use the most recently captured state at the time of the API call, and are not affected by later calls to [`cuEventRecord`]. Before the first call to [`cuEventRecord`], an event represents an empty set of work, so for example [`cuEventQuery`] would return [`cudaError_enum::CUDA_SUCCESS`].
17242    ///
17243    /// Note: This function uses standard default stream semantics.
17244    ///
17245    /// Note that this function may also return error codes from previous, asynchronous launches.
17246    ///
17247    /// # Parameters
17248    ///
17249    /// - `hEvent`: Event to record.
17250    /// - `hStream`: Stream to record event for.
17251    ///
17252    /// # Return value
17253    ///
17254    /// - [`CUresult::CUDA_SUCCESS`]
17255    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
17256    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
17257    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
17258    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
17259    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
17260    ///
17261    /// See also: [`cuEventCreate`], [`cuEventQuery`], [`cuEventSynchronize`], [`cuStreamWaitEvent`], [`cuEventDestroy`], [`cuEventElapsedTime`], `cudaEventRecord`, [`cuEventRecordWithFlags`].
17262    pub fn cuEventRecord(hEvent: CUevent, hStream: CUstream) -> CUresult;
17263}
17264singe_loader::functions! { crate::DRIVER;
17265    /// Records an event.
17266    ///
17267    /// Captures in `hEvent` the contents of `hStream` at the time of this call. `hEvent` and `hStream` must be from the same context otherwise [`cudaError_enum::CUDA_ERROR_INVALID_HANDLE`] is returned. Calls such as [`cuEventQuery`] or [`cuStreamWaitEvent`] will then examine or wait for completion of the work that was captured. Uses of `hStream` after this call do not modify `hEvent`. See note on default stream behavior for what is captured in the default case.
17268    ///
17269    /// [`cuEventRecordWithFlags`] can be called multiple times on the same event and will overwrite the previously captured state. Other APIs such as [`cuStreamWaitEvent`] use the most recently captured state at the time of the API call, and are not affected by later calls to [`cuEventRecordWithFlags`]. Before the first call to [`cuEventRecordWithFlags`], an event represents an empty set of work, so for example [`cuEventQuery`] would return [`cudaError_enum::CUDA_SUCCESS`].
17270    ///
17271    /// flags include:
17272    ///
17273    /// * [`CUevent_record_flags_enum::CU_EVENT_RECORD_DEFAULT`]: Default event creation flag.
17274    /// * [`CUevent_record_flags_enum::CU_EVENT_RECORD_EXTERNAL`]: Event is captured in the graph as an external event node when performing stream capture. This flag is invalid outside of stream capture.
17275    ///
17276    /// Note: This function uses standard default stream semantics.
17277    ///
17278    /// Note that this function may also return error codes from previous, asynchronous launches.
17279    ///
17280    /// # Parameters
17281    ///
17282    /// - `hEvent`: Event to record.
17283    /// - `hStream`: Stream to record event for.
17284    /// - `flags`: See `CUevent_capture_flags`.
17285    ///
17286    /// # Return value
17287    ///
17288    /// - [`CUresult::CUDA_SUCCESS`]
17289    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
17290    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
17291    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
17292    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
17293    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
17294    ///
17295    /// See also: [`cuEventCreate`], [`cuEventQuery`], [`cuEventSynchronize`], [`cuStreamWaitEvent`], [`cuEventDestroy`], [`cuEventElapsedTime`], [`cuEventRecord`], `cudaEventRecord`.
17296    pub fn cuEventRecordWithFlags(
17297        hEvent: CUevent,
17298        hStream: CUstream,
17299        flags: ::core::ffi::c_uint,
17300    ) -> CUresult;
17301}
17302singe_loader::functions! { crate::DRIVER;
17303    /// Queries an event’s status.
17304    ///
17305    /// Queries the status of all work currently captured by `hEvent`. See [`cuEventRecord`] for details on what is captured by an event.
17306    ///
17307    /// Returns [`cudaError_enum::CUDA_SUCCESS`] if all captured work has been completed, or [`cudaError_enum::CUDA_ERROR_NOT_READY`] if any captured work is incomplete.
17308    ///
17309    /// For the purposes of Unified Memory, a return value of [`cudaError_enum::CUDA_SUCCESS`] is equivalent to having called [`cuEventSynchronize`].
17310    ///
17311    /// Note that this function may also return error codes from previous, asynchronous launches.
17312    ///
17313    /// # Parameters
17314    ///
17315    /// - `hEvent`: Event to query
17316    ///
17317    /// # Return value
17318    ///
17319    /// - [`CUresult::CUDA_SUCCESS`]
17320    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
17321    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
17322    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
17323    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
17324    /// - [`CUresult::CUDA_ERROR_NOT_READY`]
17325    ///
17326    /// See also: [`cuEventCreate`], [`cuEventRecord`], [`cuEventSynchronize`], [`cuEventDestroy`], [`cuEventElapsedTime`], `cudaEventQuery`.
17327    pub fn cuEventQuery(hEvent: CUevent) -> CUresult;
17328}
17329singe_loader::functions! { crate::DRIVER;
17330    /// Waits for an event to complete.
17331    ///
17332    /// Waits until the completion of all work currently captured in `hEvent`. See [`cuEventRecord`] for details on what is captured by an event.
17333    ///
17334    /// Waiting for an event that was created with the [`CUevent_flags_enum::CU_EVENT_BLOCKING_SYNC`] flag will cause the calling CPU thread to block until the event has been completed by the device. If the [`CUevent_flags_enum::CU_EVENT_BLOCKING_SYNC`] flag has not been set, then the CPU thread will busy-wait until the event has been completed by the device.
17335    ///
17336    /// Note that this function may also return error codes from previous, asynchronous launches.
17337    ///
17338    /// # Parameters
17339    ///
17340    /// - `hEvent`: Event to wait for
17341    ///
17342    /// # Return value
17343    ///
17344    /// - [`CUresult::CUDA_SUCCESS`]
17345    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
17346    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
17347    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
17348    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
17349    ///
17350    /// See also: [`cuEventCreate`], [`cuEventRecord`], [`cuEventQuery`], [`cuEventDestroy`], [`cuEventElapsedTime`], `cudaEventSynchronize`.
17351    pub fn cuEventSynchronize(hEvent: CUevent) -> CUresult;
17352}
17353singe_loader::functions! { crate::DRIVER;
17354    /// Destroys an event.
17355    ///
17356    /// Destroys the event specified by `hEvent`.
17357    ///
17358    /// An event may be destroyed before it is complete (i.e., while [`cuEventQuery`] would return [`cudaError_enum::CUDA_ERROR_NOT_READY`]). In this case, the call does not block on completion of the event, and any associated resources will automatically be released asynchronously at completion.
17359    ///
17360    /// Note that this function may also return error codes from previous, asynchronous launches.
17361    ///
17362    /// # Return value
17363    ///
17364    /// - [`CUresult::CUDA_SUCCESS`]
17365    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
17366    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
17367    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
17368    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
17369    ///
17370    /// See also: [`cuEventCreate`], [`cuEventRecord`], [`cuEventQuery`], [`cuEventSynchronize`], [`cuEventElapsedTime`], `cudaEventDestroy`.
17371    pub fn cuEventDestroy_v2(hEvent: CUevent) -> CUresult;
17372}
17373singe_loader::functions! { crate::DRIVER;
17374    /// Computes the elapsed time between two events.
17375    ///
17376    /// Computes the elapsed time between two events (in milliseconds with a resolution of around 0.5 microseconds). Note this API is not guaranteed to return the latest errors for pending work. As such this API is intended to serve as an elapsed time calculation only and any polling for completion on the events to be compared should be done with [`cuEventQuery`] instead.
17377    ///
17378    /// If either event was last recorded in a non-NULL stream, the resulting time may be greater than expected (even if both used the same stream handle). This happens because the [`cuEventRecord`] operation takes place asynchronously and there is no guarantee that the measured latency is actually just between the two events. Any number of other different stream operations could execute in between the two measured events, thus altering the timing in a significant way.
17379    ///
17380    /// If [`cuEventRecord`] has not been called on either event then [`cudaError_enum::CUDA_ERROR_INVALID_HANDLE`] is returned. If [`cuEventRecord`] has been called on both events but one or both of them has not yet been completed (that is, [`cuEventQuery`] would return [`cudaError_enum::CUDA_ERROR_NOT_READY`] on at least one of the events), [`cudaError_enum::CUDA_ERROR_NOT_READY`] is returned. If either event was created with the [`CUevent_flags_enum::CU_EVENT_DISABLE_TIMING`] flag, then this function will return [`cudaError_enum::CUDA_ERROR_INVALID_HANDLE`].
17381    ///
17382    /// Note that this function may also return error codes from previous, asynchronous launches.
17383    ///
17384    /// # Parameters
17385    ///
17386    /// - `pMilliseconds`: Time between `hStart` and `hEnd` in ms.
17387    /// - `hStart`: Starting event.
17388    /// - `hEnd`: Ending event.
17389    ///
17390    /// # Return value
17391    ///
17392    /// - [`CUresult::CUDA_SUCCESS`]
17393    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
17394    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
17395    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
17396    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
17397    /// - [`CUresult::CUDA_ERROR_NOT_READY`]
17398    /// - [`CUresult::CUDA_ERROR_UNKNOWN`]
17399    ///
17400    /// See also: [`cuEventCreate`], [`cuEventRecord`], [`cuEventQuery`], [`cuEventSynchronize`], [`cuEventDestroy`], `cudaEventElapsedTime`.
17401    pub fn cuEventElapsedTime_v2(
17402        pMilliseconds: *mut f32,
17403        hStart: CUevent,
17404        hEnd: CUevent,
17405    ) -> CUresult;
17406}
17407singe_loader::functions! { crate::DRIVER;
17408    /// Imports an external memory object.
17409    ///
17410    /// Imports an externally allocated memory object and returns a handle to that in `extMem_out`.
17411    ///
17412    /// The properties of the handle being imported must be described in `memHandleDesc`. The CUDA_EXTERNAL_MEMORY_HANDLE_DESC structure is defined as follows:
17413    ///
17414    /// ```text
17415    /// typedef struct CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st {
17416    /// CUexternalMemoryHandleType type;
17417    /// union {
17418    /// int fd;
17419    /// struct {
17420    /// void *handle;
17421    /// const void *name;
17422    /// } win32;
17423    /// const void *nvSciBufObject;
17424    /// } handle;
17425    /// unsigned long long size;
17426    /// unsigned int flags;
17427    /// } CUDA_EXTERNAL_MEMORY_HANDLE_DESC;
17428    /// ```
17429    ///
17430    /// where [`CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type`](CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st::type_) specifies the type of handle being imported. [`CUexternalMemoryHandleType`] is defined as:
17431    ///
17432    /// ```text
17433    /// typedef enum CUexternalMemoryHandleType_enum {
17434    /// CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD          = 1,
17435    /// CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32       = 2,
17436    /// CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT   = 3,
17437    /// CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP         = 4,
17438    /// CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE     = 5,
17439    /// CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE     = 6,
17440    /// CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT = 7,
17441    /// CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF           = 8,
17442    /// CU_EXTERNAL_MEMORY_HANDLE_TYPE_DMABUF_FD          = 9
17443    /// } CUexternalMemoryHandleType;
17444    /// ```
17445    ///
17446    /// If [`CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type`](CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st::type_) is [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD`], then [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::fd](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structcuda__external__memory__handle__desc__v1_1a2e9d6e106e308d36e9cc29116d9959ec) must be a valid file descriptor referencing a memory object. Ownership of the file descriptor is transferred to the CUDA driver when the handle is imported successfully. Performing any operations on the file descriptor after it is imported results in undefined behavior.
17447    ///
17448    /// If [`CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type`](CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st::type_) is [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32`], then exactly one of [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::handle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structcuda__external__memory__handle__desc__v1_1a362b8ca729aa8b9256845d710b6e9cb5) and [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::name](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structcuda__external__memory__handle__desc__v1_1ae624f58523f45aeb074e67f552cad52b) must not be NULL. If [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::handle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structcuda__external__memory__handle__desc__v1_1a362b8ca729aa8b9256845d710b6e9cb5) is not NULL, then it must represent a valid shared NT handle that references a memory object. Ownership of this handle is not transferred to CUDA after the import operation, so the application must release the handle using the appropriate system call. If [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::name](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structcuda__external__memory__handle__desc__v1_1ae624f58523f45aeb074e67f552cad52b) is not NULL, then it must point to a NULL-terminated array of UTF-16 characters that refers to a memory object.
17449    ///
17450    /// If [`CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type`](CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st::type_) is [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT`], then [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::handle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structcuda__external__memory__handle__desc__v1_1a362b8ca729aa8b9256845d710b6e9cb5) must be non-NULL and [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::name](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structcuda__external__memory__handle__desc__v1_1ae624f58523f45aeb074e67f552cad52b) must be NULL. The handle specified must be a globally shared KMT handle. This handle does not hold a reference to the underlying object, and thus will be invalid when all references to the memory object are destroyed.
17451    ///
17452    /// If [`CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type`](CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st::type_) is [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP`], then exactly one of [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::handle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structcuda__external__memory__handle__desc__v1_1a362b8ca729aa8b9256845d710b6e9cb5) and [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::name](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structcuda__external__memory__handle__desc__v1_1ae624f58523f45aeb074e67f552cad52b) must not be NULL. If [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::handle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structcuda__external__memory__handle__desc__v1_1a362b8ca729aa8b9256845d710b6e9cb5) is not NULL, then it must represent a valid shared NT handle that is returned by ID3D12Device::CreateSharedHandle when referring to a ID3D12Heap object. This handle holds a reference to the underlying object. If [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::name](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structcuda__external__memory__handle__desc__v1_1ae624f58523f45aeb074e67f552cad52b) is not NULL, then it must point to a NULL-terminated array of UTF-16 characters that refers to a ID3D12Heap object.
17453    ///
17454    /// If [`CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type`](CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st::type_) is [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE`], then exactly one of [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::handle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structcuda__external__memory__handle__desc__v1_1a362b8ca729aa8b9256845d710b6e9cb5) and [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::name](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structcuda__external__memory__handle__desc__v1_1ae624f58523f45aeb074e67f552cad52b) must not be NULL. If [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::handle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structcuda__external__memory__handle__desc__v1_1a362b8ca729aa8b9256845d710b6e9cb5) is not NULL, then it must represent a valid shared NT handle that is returned by ID3D12Device::CreateSharedHandle when referring to a ID3D12Resource object. This handle holds a reference to the underlying object. If [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::name](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structcuda__external__memory__handle__desc__v1_1ae624f58523f45aeb074e67f552cad52b) is not NULL, then it must point to a NULL-terminated array of UTF-16 characters that refers to a ID3D12Resource object.
17455    ///
17456    /// If [`CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type`](CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st::type_) is [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE`], then [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::handle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structcuda__external__memory__handle__desc__v1_1a362b8ca729aa8b9256845d710b6e9cb5) must represent a valid shared NT handle that is returned by IDXGIResource1::CreateSharedHandle when referring to a ID3D11Resource object. If [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::name](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structcuda__external__memory__handle__desc__v1_1ae624f58523f45aeb074e67f552cad52b) is not NULL, then it must point to a NULL-terminated array of UTF-16 characters that refers to a ID3D11Resource object.
17457    ///
17458    /// If [`CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type`](CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st::type_) is [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT`], then [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::handle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structcuda__external__memory__handle__desc__v1_1a362b8ca729aa8b9256845d710b6e9cb5) must represent a valid shared KMT handle that is returned by IDXGIResource::GetSharedHandle when referring to a ID3D11Resource object and [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::name](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structcuda__external__memory__handle__desc__v1_1ae624f58523f45aeb074e67f552cad52b) must be NULL.
17459    ///
17460    /// If [`CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type`](CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st::type_) is [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF`], then [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::nvSciBufObject](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structcuda__external__memory__handle__desc__v1_1a8090da2b272e5d8624edcfb145c59eca) must be non-NULL and reference a valid NvSciBuf object. If the NvSciBuf object imported into CUDA is also mapped by other drivers, then the application must use [`cuWaitExternalSemaphoresAsync`] or [`cuSignalExternalSemaphoresAsync`] as appropriate barriers to maintain coherence between CUDA and the other drivers. See [`CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC`] and [`CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC`] for memory synchronization.
17461    ///
17462    /// If [`CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type`](CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st::type_) is [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_DMABUF_FD`], then [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::fd](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structcuda__external__memory__handle__desc__v1_1a2e9d6e106e308d36e9cc29116d9959ec) must be a valid file descriptor referencing a dma_buf object and [`CUDA_EXTERNAL_MEMORY_HANDLE_DESC::flags`](CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st::flags) must be zero. Importing a dma_buf object is supported only on Tegra platform starting with Thor series. Mapping an imported dma_buf object as CUDA mipmapped array using [`cuExternalMemoryGetMappedMipmappedArray`] is not supported.
17463    ///
17464    /// The size of the memory object must be specified in [`CUDA_EXTERNAL_MEMORY_HANDLE_DESC::size`](CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st::size).
17465    ///
17466    /// Specifying the flag [`CUDA_EXTERNAL_MEMORY_DEDICATED`] in [`CUDA_EXTERNAL_MEMORY_HANDLE_DESC::flags`](CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st::flags) indicates that the resource is a dedicated resource. The definition of what a dedicated resource is outside the scope of this extension. This flag must be set if [`CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type`](CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st::type_) is one of the following: [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE`] [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE`] [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT`].
17467    ///
17468    /// Note that this function may also return error codes from previous, asynchronous launches.
17469    ///
17470    /// Note: If the Vulkan memory imported into CUDA is mapped on the CPU then the application must use vkInvalidateMappedMemoryRanges/vkFlushMappedMemoryRanges as well as appropriate Vulkan pipeline barriers to maintain coherence between CPU and GPU. For more information on these APIs, please refer to “Synchronization
17471    ///
17472    /// and Cache Control” chapter from Vulkan specification.
17473    ///
17474    /// # Parameters
17475    ///
17476    /// - `extMem_out`: Returned handle to an external memory object.
17477    /// - `memHandleDesc`: Memory import handle descriptor.
17478    ///
17479    /// # Return value
17480    ///
17481    /// - [`CUresult::CUDA_SUCCESS`]
17482    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
17483    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
17484    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
17485    /// - [`CUresult::CUDA_ERROR_OPERATING_SYSTEM`]
17486    ///
17487    /// See also: [`cuDestroyExternalMemory`], [`cuExternalMemoryGetMappedBuffer`], [`cuExternalMemoryGetMappedMipmappedArray`].
17488    pub fn cuImportExternalMemory(
17489        extMem_out: *mut CUexternalMemory,
17490        memHandleDesc: *const CUDA_EXTERNAL_MEMORY_HANDLE_DESC,
17491    ) -> CUresult;
17492}
17493singe_loader::functions! { crate::DRIVER;
17494    /// Maps a buffer onto an imported memory object.
17495    ///
17496    /// Maps a buffer onto an imported memory object and returns a device pointer in `devPtr`.
17497    ///
17498    /// The properties of the buffer being mapped must be described in `bufferDesc`. The CUDA_EXTERNAL_MEMORY_BUFFER_DESC structure is defined as follows:
17499    ///
17500    /// ```text
17501    /// typedef struct CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st {
17502    /// unsigned long long offset;
17503    /// unsigned long long size;
17504    /// unsigned int flags;
17505    /// } CUDA_EXTERNAL_MEMORY_BUFFER_DESC;
17506    /// ```
17507    ///
17508    /// where [`CUDA_EXTERNAL_MEMORY_BUFFER_DESC::offset`](CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st::offset) is the offset in the memory object where the buffer’s base address is. [`CUDA_EXTERNAL_MEMORY_BUFFER_DESC::size`](CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st::size) is the size of the buffer. [`CUDA_EXTERNAL_MEMORY_BUFFER_DESC::flags`](CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st::flags) must be zero.
17509    ///
17510    /// The offset and size have to be suitably aligned to match the requirements of the external API. Mapping two buffers whose ranges overlap may or may not result in the same virtual address being returned for the overlapped portion. In such cases, the application must ensure that all accesses to that region from the GPU are volatile. Otherwise writes made via one address are not guaranteed to be visible via the other address, even if they’re issued by the same thread. It is recommended that applications map the combined range instead of mapping separate buffers and then apply the appropriate offsets to the returned pointer to derive the individual buffers.
17511    ///
17512    /// The returned pointer `devPtr` must be freed using cuMemFree.
17513    ///
17514    /// Note that this function may also return error codes from previous, asynchronous launches.
17515    ///
17516    /// # Parameters
17517    ///
17518    /// - `devPtr`: Returned device pointer to buffer.
17519    /// - `extMem`: Handle to external memory object.
17520    /// - `bufferDesc`: Buffer descriptor.
17521    ///
17522    /// # Return value
17523    ///
17524    /// - [`CUresult::CUDA_SUCCESS`]
17525    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
17526    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
17527    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
17528    ///
17529    /// See also: [`cuImportExternalMemory`], [`cuDestroyExternalMemory`], [`cuExternalMemoryGetMappedMipmappedArray`].
17530    pub fn cuExternalMemoryGetMappedBuffer(
17531        devPtr: *mut CUdeviceptr,
17532        extMem: CUexternalMemory,
17533        bufferDesc: *const CUDA_EXTERNAL_MEMORY_BUFFER_DESC,
17534    ) -> CUresult;
17535}
17536singe_loader::functions! { crate::DRIVER;
17537    /// Maps a CUDA mipmapped array onto an external memory object.
17538    ///
17539    /// Maps a CUDA mipmapped array onto an external object and returns a handle to it in `mipmap`.
17540    ///
17541    /// The properties of the CUDA mipmapped array being mapped must be described in `mipmapDesc`. The structure CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC is defined as follows:
17542    ///
17543    /// ```text
17544    /// typedef struct CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st {
17545    /// unsigned long long offset;
17546    /// CUDA_ARRAY3D_DESCRIPTOR arrayDesc;
17547    /// unsigned int numLevels;
17548    /// } CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC;
17549    /// ```
17550    ///
17551    /// where [`CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC::offset`](CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st::offset) is the offset in the memory object where the base level of the mipmap chain is. [`CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC::arrayDesc`](CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st::arrayDesc) describes the format, dimensions and type of the base level of the mipmap chain. For further details on these parameters, please refer to the documentation for [`cuMipmappedArrayCreate`]. Note that if the mipmapped array is bound as a color target in the graphics API, then the flag [`CUDA_ARRAY3D_COLOR_ATTACHMENT`] must be specified in `CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC::arrayDesc::Flags`. [`CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC::numLevels`](CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st::numLevels) specifies the total number of levels in the mipmap chain.
17552    ///
17553    /// If `extMem` was imported from a handle of type [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF`], then [`CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC::numLevels`](CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st::numLevels) must be equal to 1.
17554    ///
17555    /// Mapping `extMem` imported from a handle of type [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_DMABUF_FD`], is not supported.
17556    ///
17557    /// The returned CUDA mipmapped array must be freed using [`cuMipmappedArrayDestroy`].
17558    ///
17559    /// Note that this function may also return error codes from previous, asynchronous launches.
17560    ///
17561    /// # Parameters
17562    ///
17563    /// - `mipmap`: Returned CUDA mipmapped array.
17564    /// - `extMem`: Handle to external memory object.
17565    /// - `mipmapDesc`: CUDA array descriptor.
17566    ///
17567    /// # Return value
17568    ///
17569    /// - [`CUresult::CUDA_SUCCESS`]
17570    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
17571    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
17572    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
17573    ///
17574    /// See also: [`cuImportExternalMemory`], [`cuDestroyExternalMemory`], [`cuExternalMemoryGetMappedBuffer`].
17575    pub fn cuExternalMemoryGetMappedMipmappedArray(
17576        mipmap: *mut CUmipmappedArray,
17577        extMem: CUexternalMemory,
17578        mipmapDesc: *const CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC,
17579    ) -> CUresult;
17580}
17581singe_loader::functions! { crate::DRIVER;
17582    /// Destroys an external memory object.
17583    ///
17584    /// Destroys the specified external memory object. Any existing buffers and CUDA mipmapped arrays mapped onto this object must no longer be used and must be explicitly freed using cuMemFree and [`cuMipmappedArrayDestroy`] respectively.
17585    ///
17586    /// Note that this function may also return error codes from previous, asynchronous launches.
17587    ///
17588    /// # Parameters
17589    ///
17590    /// - `extMem`: External memory object to be destroyed
17591    ///
17592    /// # Return value
17593    ///
17594    /// - [`CUresult::CUDA_SUCCESS`]
17595    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
17596    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
17597    ///
17598    /// See also: [`cuImportExternalMemory`], [`cuExternalMemoryGetMappedBuffer`], [`cuExternalMemoryGetMappedMipmappedArray`].
17599    pub fn cuDestroyExternalMemory(extMem: CUexternalMemory) -> CUresult;
17600}
17601singe_loader::functions! { crate::DRIVER;
17602    /// Imports an external semaphore.
17603    ///
17604    /// Imports an externally allocated synchronization object and returns a handle to that in `extSem_out`.
17605    ///
17606    /// The properties of the handle being imported must be described in `semHandleDesc`. The CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC is defined as follows:
17607    ///
17608    /// ```text
17609    /// typedef struct CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st {
17610    /// CUexternalSemaphoreHandleType type;
17611    /// union {
17612    /// int fd;
17613    /// struct {
17614    /// void *handle;
17615    /// const void *name;
17616    /// } win32;
17617    /// const void* NvSciSyncObj;
17618    /// } handle;
17619    /// unsigned int flags;
17620    /// } CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC;
17621    /// ```
17622    ///
17623    /// where [`CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type`](CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st::type_) specifies the type of handle being imported. [`CUexternalSemaphoreHandleType`] is defined as:
17624    ///
17625    /// ```text
17626    /// typedef enum CUexternalSemaphoreHandleType_enum {
17627    /// CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD                = 1,
17628    /// CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32             = 2,
17629    /// CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT         = 3,
17630    /// CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE              = 4,
17631    /// CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE              = 5,
17632    /// CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC                = 6,
17633    /// CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX        = 7,
17634    /// CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT    = 8,
17635    /// CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD    = 9,
17636    /// CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32 = 10
17637    /// } CUexternalSemaphoreHandleType;
17638    /// ```
17639    ///
17640    /// If [`CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type`](CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st::type_) is [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD`], then [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::fd](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structcuda__external__semaphore__handle__desc__v1_1a90b7304a1421d26bb064bf4e0b66b3ce) must be a valid file descriptor referencing a synchronization object. Ownership of the file descriptor is transferred to the CUDA driver when the handle is imported successfully. Performing any operations on the file descriptor after it is imported results in undefined behavior.
17641    ///
17642    /// If [`CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type`](CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st::type_) is [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32`], then exactly one of [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structcuda__external__semaphore__handle__desc__v1_1a460e285314871e0bcccada6ddf78bdd5) and [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structcuda__external__semaphore__handle__desc__v1_1a156f86d10677dbd7a943969cb9b3f7ea) must not be NULL. If [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structcuda__external__semaphore__handle__desc__v1_1a460e285314871e0bcccada6ddf78bdd5) is not NULL, then it must represent a valid shared NT handle that references a synchronization object. Ownership of this handle is not transferred to CUDA after the import operation, so the application must release the handle using the appropriate system call. If [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structcuda__external__semaphore__handle__desc__v1_1a156f86d10677dbd7a943969cb9b3f7ea) is not NULL, then it must name a valid synchronization object.
17643    ///
17644    /// If [`CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type`](CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st::type_) is [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT`], then [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structcuda__external__semaphore__handle__desc__v1_1a460e285314871e0bcccada6ddf78bdd5) must be non-NULL and [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structcuda__external__semaphore__handle__desc__v1_1a156f86d10677dbd7a943969cb9b3f7ea) must be NULL. The handle specified must be a globally shared KMT handle. This handle does not hold a reference to the underlying object, and thus will be invalid when all references to the synchronization object are destroyed.
17645    ///
17646    /// If [`CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type`](CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st::type_) is [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE`], then exactly one of [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structcuda__external__semaphore__handle__desc__v1_1a460e285314871e0bcccada6ddf78bdd5) and [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structcuda__external__semaphore__handle__desc__v1_1a156f86d10677dbd7a943969cb9b3f7ea) must not be NULL. If [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structcuda__external__semaphore__handle__desc__v1_1a460e285314871e0bcccada6ddf78bdd5) is not NULL, then it must represent a valid shared NT handle that is returned by ID3D12Device::CreateSharedHandle when referring to a ID3D12Fence object. This handle holds a reference to the underlying object. If [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structcuda__external__semaphore__handle__desc__v1_1a156f86d10677dbd7a943969cb9b3f7ea) is not NULL, then it must name a valid synchronization object that refers to a valid ID3D12Fence object.
17647    ///
17648    /// If [`CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type`](CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st::type_) is [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE`], then [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structcuda__external__semaphore__handle__desc__v1_1a460e285314871e0bcccada6ddf78bdd5) represents a valid shared NT handle that is returned by ID3D11Fence::CreateSharedHandle. If [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structcuda__external__semaphore__handle__desc__v1_1a156f86d10677dbd7a943969cb9b3f7ea) is not NULL, then it must name a valid synchronization object that refers to a valid ID3D11Fence object.
17649    ///
17650    /// If [`CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type`](CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st::type_) is [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC`], then [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::nvSciSyncObj](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structcuda__external__semaphore__handle__desc__v1_1ab723f8210fdb7fe17b51cd9019ce109d) represents a valid NvSciSyncObj.
17651    ///
17652    /// [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX`], then [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structcuda__external__semaphore__handle__desc__v1_1a460e285314871e0bcccada6ddf78bdd5) represents a valid shared NT handle that is returned by IDXGIResource1::CreateSharedHandle when referring to a IDXGIKeyedMutex object. If [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structcuda__external__semaphore__handle__desc__v1_1a156f86d10677dbd7a943969cb9b3f7ea) is not NULL, then it must name a valid synchronization object that refers to a valid IDXGIKeyedMutex object.
17653    ///
17654    /// If [`CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type`](CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st::type_) is [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT`], then [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structcuda__external__semaphore__handle__desc__v1_1a460e285314871e0bcccada6ddf78bdd5) represents a valid shared KMT handle that is returned by IDXGIResource::GetSharedHandle when referring to a IDXGIKeyedMutex object and [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structcuda__external__semaphore__handle__desc__v1_1a156f86d10677dbd7a943969cb9b3f7ea) must be NULL.
17655    ///
17656    /// If [`CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type`](CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st::type_) is [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD`], then [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::fd](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structcuda__external__semaphore__handle__desc__v1_1a90b7304a1421d26bb064bf4e0b66b3ce) must be a valid file descriptor referencing a synchronization object. Ownership of the file descriptor is transferred to the CUDA driver when the handle is imported successfully. Performing any operations on the file descriptor after it is imported results in undefined behavior.
17657    ///
17658    /// If [`CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type`](CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st::type_) is [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32`], then exactly one of [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structcuda__external__semaphore__handle__desc__v1_1a460e285314871e0bcccada6ddf78bdd5) and [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structcuda__external__semaphore__handle__desc__v1_1a156f86d10677dbd7a943969cb9b3f7ea) must not be NULL. If [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structcuda__external__semaphore__handle__desc__v1_1a460e285314871e0bcccada6ddf78bdd5) is not NULL, then it must represent a valid shared NT handle that references a synchronization object. Ownership of this handle is not transferred to CUDA after the import operation, so the application must release the handle using the appropriate system call. If [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structcuda__external__semaphore__handle__desc__v1_1a156f86d10677dbd7a943969cb9b3f7ea) is not NULL, then it must name a valid synchronization object.
17659    ///
17660    /// Note that this function may also return error codes from previous, asynchronous launches.
17661    ///
17662    /// # Parameters
17663    ///
17664    /// - `extSem_out`: Returned handle to an external semaphore.
17665    /// - `semHandleDesc`: Semaphore import handle descriptor.
17666    ///
17667    /// # Return value
17668    ///
17669    /// - [`CUresult::CUDA_SUCCESS`]
17670    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
17671    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
17672    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
17673    /// - [`CUresult::CUDA_ERROR_OPERATING_SYSTEM`]
17674    ///
17675    /// See also: [`cuDestroyExternalSemaphore`], [`cuSignalExternalSemaphoresAsync`], [`cuWaitExternalSemaphoresAsync`].
17676    pub fn cuImportExternalSemaphore(
17677        extSem_out: *mut CUexternalSemaphore,
17678        semHandleDesc: *const CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC,
17679    ) -> CUresult;
17680}
17681singe_loader::functions! { crate::DRIVER;
17682    /// Signals a set of external semaphore objects.
17683    ///
17684    /// Enqueues a signal operation on a set of externally allocated semaphore object in the specified stream. The operations will be executed when all prior operations in the stream complete.
17685    ///
17686    /// The exact semantics of signaling a semaphore depends on the type of the object.
17687    ///
17688    /// If the semaphore object is any one of the following types: [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD`], [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32`], [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT`] then signaling the semaphore will set it to the signaled state.
17689    ///
17690    /// If the semaphore object is any one of the following types: [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE`], [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE`], [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD`], [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32`] then the semaphore will be set to the value specified in [CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS::params::fence::value](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__SIGNAL__PARAMS__v1.html#structcuda__external__semaphore__signal__params__v1_1acc09a37125bfd6f700e12983a22738e6).
17691    ///
17692    /// If the semaphore object is of the type [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC`] this API sets [CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS::params::nvSciSync::fence](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__SIGNAL__PARAMS__v1.html#structcuda__external__semaphore__signal__params__v1_1aeeaaad5a8fe7b0313c18aa4cc0ee2560) to a value that can be used by subsequent waiters of the same NvSciSync object to order operations with those currently submitted in `stream`. Such an update will overwrite previous contents of [CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS::params::nvSciSync::fence](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__SIGNAL__PARAMS__v1.html#structcuda__external__semaphore__signal__params__v1_1aeeaaad5a8fe7b0313c18aa4cc0ee2560). By default, signaling such an external semaphore object causes appropriate memory synchronization operations to be performed over all external memory objects that are imported as [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF`]. This ensures that any subsequent accesses made by other importers of the same set of NvSciBuf memory object(s) are coherent. These operations can be skipped by specifying the flag [`CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC`], which can be used as a performance optimization when data coherency is not required. But specifying this flag in scenarios where data coherency is required results in undefined behavior. Also, for semaphore object of the type [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC`], if the NvSciSyncAttrList used to create the NvSciSyncObj had not set the flags in [`cuDeviceGetNvSciSyncAttributes`] to CUDA_NVSCISYNC_ATTR_SIGNAL, this API will return [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]. NvSciSyncFence associated with semaphore object of the type [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC`] can be deterministic. For this the NvSciSyncAttrList used to create the semaphore object must have value of NvSciSyncAttrKey_RequireDeterministicFences key set to true. Deterministic fences allow users to enqueue a wait over the semaphore object even before corresponding signal is enqueued. For such a semaphore object, CUDA guarantees that each signal operation will increment the fence value by ‘1’. Users are expected to track count of signals enqueued on the semaphore object and insert waits accordingly. When such a semaphore object is signaled from multiple streams, due to concurrent stream execution, it is possible that the order in which the semaphore gets signaled is indeterministic. This could lead to waiters of the semaphore getting unblocked incorrectly. Users are expected to handle such situations, either by not using the same semaphore object with deterministic fence support enabled in different streams or by adding explicit dependency amongst such streams so that the semaphore is signaled in order. NvSciSyncFence associated with semaphore object of the type [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC`] can be timestamp enabled. For this the NvSciSyncAttrList used to create the object must have the value of NvSciSyncAttrKey_WaiterRequireTimestamps key set to true. Timestamps are emitted asynchronously by the GPU and CUDA saves the GPU timestamp in the corresponding NvSciSyncFence at the time of signal on GPU. Users are expected to convert GPU clocks to CPU clocks using appropriate scaling functions. Users are expected to wait for the completion of the fence before extracting timestamp using appropriate NvSciSync APIs. Users are expected to ensure that there is only one outstanding timestamp enabled fence per CUDA-NvSciSync object at any point of time, failing which leads to undefined behavior. Extracting the timestamp before the corresponding fence is signalled could lead to undefined behavior. Timestamp extracted via appropriate NvSciSync API would be in microseconds.
17693    ///
17694    /// If the semaphore object is any one of the following types: [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX`], [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT`] then the keyed mutex will be released with the key specified in `CUDA_EXTERNAL_SEMAPHORE_PARAMS::params::keyedmutex::key`.
17695    ///
17696    /// Note that this function may also return error codes from previous, asynchronous launches.
17697    ///
17698    /// # Parameters
17699    ///
17700    /// - `extSemArray`: Set of external semaphores to be signaled.
17701    /// - `paramsArray`: Array of semaphore parameters.
17702    /// - `numExtSems`: Number of semaphores to signal.
17703    /// - `stream`: Stream to enqueue the signal operations in.
17704    ///
17705    /// # Return value
17706    ///
17707    /// - [`CUresult::CUDA_SUCCESS`]
17708    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
17709    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
17710    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
17711    ///
17712    /// See also: [`cuImportExternalSemaphore`], [`cuDestroyExternalSemaphore`], [`cuWaitExternalSemaphoresAsync`].
17713    pub fn cuSignalExternalSemaphoresAsync(
17714        extSemArray: *const CUexternalSemaphore,
17715        paramsArray: *const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS,
17716        numExtSems: ::core::ffi::c_uint,
17717        stream: CUstream,
17718    ) -> CUresult;
17719}
17720singe_loader::functions! { crate::DRIVER;
17721    /// Waits on a set of external semaphore objects.
17722    ///
17723    /// Enqueues a wait operation on a set of externally allocated semaphore object in the specified stream. The operations will be executed when all prior operations in the stream complete.
17724    ///
17725    /// The exact semantics of waiting on a semaphore depends on the type of the object.
17726    ///
17727    /// If the semaphore object is any one of the following types: [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD`], [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32`], [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT`] then waiting on the semaphore will wait until the semaphore reaches the signaled state. The semaphore will then be reset to the unsignaled state. Therefore for every signal operation, there can only be one wait operation.
17728    ///
17729    /// If the semaphore object is any one of the following types: [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE`], [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE`], [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD`], [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32`] then waiting on the semaphore will wait until the value of the semaphore is greater than or equal to [CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS::params::fence::value](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__WAIT__PARAMS__v1.html#structcuda__external__semaphore__wait__params__v1_1a88ca51398134e22437eedca531fcb420).
17730    ///
17731    /// If the semaphore object is of the type [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC`] then, waiting on the semaphore will wait until the [CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS::params::nvSciSync::fence](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__SIGNAL__PARAMS__v1.html#structcuda__external__semaphore__signal__params__v1_1aeeaaad5a8fe7b0313c18aa4cc0ee2560) is signaled by the signaler of the NvSciSyncObj that was associated with this semaphore object. By default, waiting on such an external semaphore object causes appropriate memory synchronization operations to be performed over all external memory objects that are imported as [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF`]. This ensures that any subsequent accesses made by other importers of the same set of NvSciBuf memory object(s) are coherent. These operations can be skipped by specifying the flag [`CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC`], which can be used as a performance optimization when data coherency is not required. But specifying this flag in scenarios where data coherency is required results in undefined behavior. Also, for semaphore object of the type [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC`], if the NvSciSyncAttrList used to create the NvSciSyncObj had not set the flags in [`cuDeviceGetNvSciSyncAttributes`] to CUDA_NVSCISYNC_ATTR_WAIT, this API will return [`CUresult::CUDA_ERROR_NOT_SUPPORTED`].
17732    ///
17733    /// If the semaphore object is any one of the following types: [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX`], [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT`] then the keyed mutex will be acquired when it is released with the key specified in [CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS::params::keyedmutex::key](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__WAIT__PARAMS__v1.html#structcuda__external__semaphore__wait__params__v1_1a642d788e3027cd2677096b86b79f80ca) or until the timeout specified by [CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS::params::keyedmutex::timeoutMs](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__EXTERNAL__SEMAPHORE__WAIT__PARAMS__v1.html#structcuda__external__semaphore__wait__params__v1_1a3cb25740325fda8d63d4cfeed7f52844) has lapsed. The timeout interval can either be a finite value specified in milliseconds or an infinite value. In case an infinite value is specified the timeout never elapses. The windows INFINITE macro must be used to specify infinite timeout.
17734    ///
17735    /// Note that this function may also return error codes from previous, asynchronous launches.
17736    ///
17737    /// # Parameters
17738    ///
17739    /// - `extSemArray`: External semaphores to be waited on.
17740    /// - `paramsArray`: Array of semaphore parameters.
17741    /// - `numExtSems`: Number of semaphores to wait on.
17742    /// - `stream`: Stream to enqueue the wait operations in.
17743    ///
17744    /// # Return value
17745    ///
17746    /// - [`CUresult::CUDA_SUCCESS`]
17747    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
17748    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
17749    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
17750    /// - [`CUresult::CUDA_ERROR_TIMEOUT`]
17751    ///
17752    /// See also: [`cuImportExternalSemaphore`], [`cuDestroyExternalSemaphore`], [`cuSignalExternalSemaphoresAsync`].
17753    pub fn cuWaitExternalSemaphoresAsync(
17754        extSemArray: *const CUexternalSemaphore,
17755        paramsArray: *const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS,
17756        numExtSems: ::core::ffi::c_uint,
17757        stream: CUstream,
17758    ) -> CUresult;
17759}
17760singe_loader::functions! { crate::DRIVER;
17761    /// Destroys an external semaphore.
17762    ///
17763    /// Destroys an external semaphore object and releases any references to the underlying resource. Any outstanding signals or waits must have completed before the semaphore is destroyed.
17764    ///
17765    /// Note that this function may also return error codes from previous, asynchronous launches.
17766    ///
17767    /// # Parameters
17768    ///
17769    /// - `extSem`: External semaphore to be destroyed
17770    ///
17771    /// # Return value
17772    ///
17773    /// - [`CUresult::CUDA_SUCCESS`]
17774    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
17775    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
17776    ///
17777    /// See also: [`cuImportExternalSemaphore`], [`cuSignalExternalSemaphoresAsync`], [`cuWaitExternalSemaphoresAsync`].
17778    pub fn cuDestroyExternalSemaphore(extSem: CUexternalSemaphore) -> CUresult;
17779}
17780singe_loader::functions! { crate::DRIVER;
17781    /// Wait on a memory location.
17782    ///
17783    /// Enqueues a synchronization of the stream on the given memory location. Work ordered after the operation will block until the given condition on the memory is satisfied. By default, the condition is to wait for (int32_t)(\*addr - value) >= 0, a cyclic greater-or-equal. Other condition types can be specified via `flags`.
17784    ///
17785    /// If the memory was registered via cuMemHostRegister(), the device pointer should be obtained with cuMemHostGetDevicePointer(). This function cannot be used with managed memory ([`cuMemAllocManaged`]).
17786    ///
17787    /// Support for [`CUstreamWaitValue_flags::CU_STREAM_WAIT_VALUE_NOR`] can be queried with [`cuDeviceGetAttribute`] and `CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR_V2`.
17788    ///
17789    /// Note: Warning: Improper use of this API may deadlock the application. Synchronization ordering established through this API is not visible to CUDA. CUDA tasks that are (even indirectly) ordered by this API should also have that order expressed with CUDA-visible dependencies such as events. This ensures that the scheduler does not serialize them in an improper order.
17790    ///
17791    /// Note that this function may also return error codes from previous, asynchronous launches.
17792    ///
17793    /// # Parameters
17794    ///
17795    /// - `stream`: The stream to synchronize on the memory location.
17796    /// - `addr`: The memory location to wait on.
17797    /// - `value`: The value to compare with the memory location.
17798    /// - `flags`: See [`CUstreamWaitValue_flags`].
17799    ///
17800    /// # Return value
17801    ///
17802    /// - [`CUresult::CUDA_SUCCESS`]
17803    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
17804    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
17805    ///
17806    /// See also: [`cuStreamWaitValue64`], [`cuStreamWriteValue32`], [`cuStreamWriteValue64`], [`cuStreamBatchMemOp`], [`cuMemHostRegister`], [`cuStreamWaitEvent`].
17807    pub fn cuStreamWaitValue32_v2(
17808        stream: CUstream,
17809        addr: CUdeviceptr,
17810        value: cuuint32_t,
17811        flags: ::core::ffi::c_uint,
17812    ) -> CUresult;
17813}
17814singe_loader::functions! { crate::DRIVER;
17815    /// Wait on a memory location.
17816    ///
17817    /// Enqueues a synchronization of the stream on the given memory location. Work ordered after the operation will block until the given condition on the memory is satisfied. By default, the condition is to wait for (int64_t)(\*addr - value) >= 0, a cyclic greater-or-equal. Other condition types can be specified via `flags`.
17818    ///
17819    /// If the memory was registered via cuMemHostRegister(), the device pointer should be obtained with cuMemHostGetDevicePointer().
17820    ///
17821    /// Support for this can be queried with [`cuDeviceGetAttribute`] and [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS`].
17822    ///
17823    /// Note: Warning: Improper use of this API may deadlock the application. Synchronization ordering established through this API is not visible to CUDA. CUDA tasks that are (even indirectly) ordered by this API should also have that order expressed with CUDA-visible dependencies such as events. This ensures that the scheduler does not serialize them in an improper order.
17824    ///
17825    /// Note that this function may also return error codes from previous, asynchronous launches.
17826    ///
17827    /// # Parameters
17828    ///
17829    /// - `stream`: The stream to synchronize on the memory location.
17830    /// - `addr`: The memory location to wait on.
17831    /// - `value`: The value to compare with the memory location.
17832    /// - `flags`: See [`CUstreamWaitValue_flags`].
17833    ///
17834    /// # Return value
17835    ///
17836    /// - [`CUresult::CUDA_SUCCESS`]
17837    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
17838    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
17839    ///
17840    /// See also: [`cuStreamWaitValue32`], [`cuStreamWriteValue32`], [`cuStreamWriteValue64`], [`cuStreamBatchMemOp`], [`cuMemHostRegister`], [`cuStreamWaitEvent`].
17841    pub fn cuStreamWaitValue64_v2(
17842        stream: CUstream,
17843        addr: CUdeviceptr,
17844        value: cuuint64_t,
17845        flags: ::core::ffi::c_uint,
17846    ) -> CUresult;
17847}
17848singe_loader::functions! { crate::DRIVER;
17849    /// Write a value to memory.
17850    ///
17851    /// Write a value to memory.
17852    ///
17853    /// If the memory was registered via cuMemHostRegister(), the device pointer should be obtained with cuMemHostGetDevicePointer(). This function cannot be used with managed memory ([`cuMemAllocManaged`]).
17854    ///
17855    /// Note that this function may also return error codes from previous, asynchronous launches.
17856    ///
17857    /// # Parameters
17858    ///
17859    /// - `stream`: The stream to do the write in.
17860    /// - `addr`: The device address to write to.
17861    /// - `value`: The value to write.
17862    /// - `flags`: See [`CUstreamWriteValue_flags`].
17863    ///
17864    /// # Return value
17865    ///
17866    /// - [`CUresult::CUDA_SUCCESS`]
17867    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
17868    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
17869    ///
17870    /// See also: [`cuStreamWriteValue64`], [`cuStreamWaitValue32`], [`cuStreamWaitValue64`], [`cuStreamBatchMemOp`], [`cuMemHostRegister`], [`cuEventRecord`].
17871    pub fn cuStreamWriteValue32_v2(
17872        stream: CUstream,
17873        addr: CUdeviceptr,
17874        value: cuuint32_t,
17875        flags: ::core::ffi::c_uint,
17876    ) -> CUresult;
17877}
17878singe_loader::functions! { crate::DRIVER;
17879    /// Write a value to memory.
17880    ///
17881    /// Write a value to memory.
17882    ///
17883    /// If the memory was registered via cuMemHostRegister(), the device pointer should be obtained with cuMemHostGetDevicePointer().
17884    ///
17885    /// Support for this can be queried with [`cuDeviceGetAttribute`] and [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS`].
17886    ///
17887    /// Note that this function may also return error codes from previous, asynchronous launches.
17888    ///
17889    /// # Parameters
17890    ///
17891    /// - `stream`: The stream to do the write in.
17892    /// - `addr`: The device address to write to.
17893    /// - `value`: The value to write.
17894    /// - `flags`: See [`CUstreamWriteValue_flags`].
17895    ///
17896    /// # Return value
17897    ///
17898    /// - [`CUresult::CUDA_SUCCESS`]
17899    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
17900    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
17901    ///
17902    /// See also: [`cuStreamWriteValue32`], [`cuStreamWaitValue32`], [`cuStreamWaitValue64`], [`cuStreamBatchMemOp`], [`cuMemHostRegister`], [`cuEventRecord`].
17903    pub fn cuStreamWriteValue64_v2(
17904        stream: CUstream,
17905        addr: CUdeviceptr,
17906        value: cuuint64_t,
17907        flags: ::core::ffi::c_uint,
17908    ) -> CUresult;
17909}
17910singe_loader::functions! { crate::DRIVER;
17911    /// Batch operations to synchronize the stream via memory operations.
17912    ///
17913    /// This is a batch version of cuStreamWaitValue32() and cuStreamWriteValue32(). Batching operations may avoid some performance overhead in both the API call and the device execution versus adding them to the stream in separate API calls. The operations are enqueued in the order they appear in the array.
17914    ///
17915    /// See [`CUstreamBatchMemOpType`] for the full set of supported operations, and cuStreamWaitValue32(), cuStreamWaitValue64(), cuStreamWriteValue32(), and cuStreamWriteValue64() for details of specific operations.
17916    ///
17917    /// See related APIs for details on querying support for specific operations.
17918    ///
17919    /// Note: Warning: Improper use of this API may deadlock the application. Synchronization ordering established through this API is not visible to CUDA. CUDA tasks that are (even indirectly) ordered by this API should also have that order expressed with CUDA-visible dependencies such as events. This ensures that the scheduler does not serialize them in an improper order.
17920    ///
17921    /// Note that this function may also return error codes from previous, asynchronous launches.
17922    ///
17923    /// # Parameters
17924    ///
17925    /// - `stream`: The stream to enqueue the operations in.
17926    /// - `count`: The number of operations in the array. Must be less than 256.
17927    /// - `paramArray`: The types and parameters of the individual operations.
17928    /// - `flags`: Reserved for future expansion; must be 0.
17929    ///
17930    /// # Return value
17931    ///
17932    /// - [`CUresult::CUDA_SUCCESS`]
17933    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
17934    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
17935    ///
17936    /// See also: [`cuStreamWaitValue32`], [`cuStreamWaitValue64`], [`cuStreamWriteValue32`], [`cuStreamWriteValue64`], [`cuMemHostRegister`].
17937    pub fn cuStreamBatchMemOp_v2(
17938        stream: CUstream,
17939        count: ::core::ffi::c_uint,
17940        paramArray: *mut CUstreamBatchMemOpParams,
17941        flags: ::core::ffi::c_uint,
17942    ) -> CUresult;
17943}
17944singe_loader::functions! { crate::DRIVER;
17945    /// Returns information about a function.
17946    ///
17947    /// Returns in `*pi` the integer value of the attribute `attrib` on the kernel given by `hfunc`. The supported attributes are:
17948    ///
17949    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK`]: The maximum number of threads per block, beyond which a launch of the function would fail. This number depends on both the function and the device on which the function is currently loaded.
17950    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES`]: The size in bytes of statically-allocated shared memory per block required by this function. This does not include dynamically-allocated shared memory requested by the user at runtime.
17951    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES`]: The size in bytes of user-allocated constant memory required by this function.
17952    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES`]: The size in bytes of local memory used by each thread of this function.
17953    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_NUM_REGS`]: The number of registers used by each thread of this function.
17954    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_PTX_VERSION`]: The PTX virtual architecture version for which the function was compiled. This value is the major PTX version \* 10
17955    ///
17956    ///   + the minor PTX version, so a PTX version 1.3 function would return the value 13. Note that this may return the undefined value of 0 for cubins compiled prior to CUDA 3.0.
17957    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_BINARY_VERSION`]: The binary architecture version for which the function was compiled. This value is the major binary version \* 10 + the minor binary version, so a binary version 1.3 function would return the value 13. Note that this will return a value of 10 for legacy cubins that do not have a properly-encoded binary architecture version.
17958    /// * `CU_FUNC_CACHE_MODE_CA`: The attribute to indicate whether the function has been compiled with user specified option “-Xptxas –dlcm=ca” set .
17959    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES`]: The maximum size in bytes of dynamically-allocated shared memory.
17960    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT`]: Preferred shared memory-L1 cache split ratio in percent of total shared memory.
17961    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_CLUSTER_SIZE_MUST_BE_SET`]: If this attribute is set, the kernel must launch with a valid cluster size specified.
17962    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH`]: The required cluster width in blocks.
17963    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT`]: The required cluster height in blocks.
17964    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH`]: The required cluster depth in blocks.
17965    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED`]: Indicates whether the function can be launched with non-portable cluster size. 1 is allowed, 0 is disallowed. A non-portable cluster size may only function on the specific SKUs the program is tested on. The launch might fail if the program is run on a different hardware platform. CUDA API provides cudaOccupancyMaxActiveClusters to assist with checking whether the desired size can be launched on the current device. A portable cluster size is guaranteed to be functional on all compute capabilities higher than the target compute capability. The portable cluster size for sm_90 is 8 blocks per cluster. This value may increase for future compute capabilities. The specific hardware unit may support higher cluster sizes that’s not guaranteed to be portable.
17966    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE`]: The block scheduling policy of a function. The value type is CUclusterSchedulingPolicy.
17967    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_SHARED_MEMORY_MODE`]: The shared memory mode of a function. The value type is CUsharedMemoryMode / cudaSharedMemoryMode.
17968    ///
17969    /// With a few execeptions, function attributes may also be queried on unloaded function handles returned from [`cuModuleEnumerateFunctions`]. [`cudaError_enum::CUDA_ERROR_FUNCTION_NOT_LOADED`] is returned if the attribute requires a fully loaded function but the function is not loaded. The loading state of a function may be queried using `cuFuncIsloaded`. [`cuFuncLoad`] may be called to explicitly load a function before querying the following attributes that require the function to be loaded:
17970    ///
17971    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK`]
17972    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES`]
17973    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES`].
17974    ///
17975    /// Note that this function may also return error codes from previous, asynchronous launches.
17976    ///
17977    /// # Parameters
17978    ///
17979    /// - `pi`: Returned attribute value.
17980    /// - `attrib`: Attribute requested.
17981    /// - `hfunc`: Function to query attribute of.
17982    ///
17983    /// # Return value
17984    ///
17985    /// - [`CUresult::CUDA_SUCCESS`]
17986    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
17987    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
17988    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
17989    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
17990    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
17991    /// - [`CUresult::CUDA_ERROR_FUNCTION_NOT_LOADED`]
17992    ///
17993    /// See also: [`cuCtxGetCacheConfig`], [`cuCtxSetCacheConfig`], [`cuFuncSetCacheConfig`], [`cuLaunchKernel`], `cudaFuncGetAttributes`, `cudaFuncSetAttribute`, [`cuFuncIsLoaded`], [`cuFuncLoad`], [`cuKernelGetAttribute`].
17994    pub fn cuFuncGetAttribute(
17995        pi: *mut ::core::ffi::c_int,
17996        attrib: CUfunction_attribute,
17997        hfunc: CUfunction,
17998    ) -> CUresult;
17999}
18000singe_loader::functions! { crate::DRIVER;
18001    /// Sets information about a function.
18002    ///
18003    /// This call sets the value of a specified attribute `attrib` on the kernel given by `hfunc` to an integer value specified by `val` This function returns [`CUresult::CUDA_SUCCESS`] if the new value of the attribute could be successfully set. If the set fails, this call will return an error. Not all attributes can have values set. Attempting to set a value on a read-only attribute will result in an error ([`CUresult::CUDA_ERROR_INVALID_VALUE`])
18004    ///
18005    /// Supported attributes for the cuFuncSetAttribute call are:
18006    ///
18007    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES`]: This maximum size in bytes of dynamically-allocated shared memory. The value should contain the requested maximum size of dynamically-allocated shared memory. The sum of this value and the function attribute [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES`] cannot exceed the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN`]. The maximal size of requestable dynamic shared memory may differ by GPU architecture.
18008    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT`]: On devices where the L1 cache and shared memory use the same hardware resources, this sets the shared memory carveout preference, in percent of the total shared memory. See [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR`] This is only a hint, and the driver can choose a different ratio if required to execute the function.
18009    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH`]: The required cluster width in blocks. The width, height, and depth values must either all be 0 or all be positive. The validity of the cluster dimensions is checked at launch time. If the value is set during compile time, it cannot be set at runtime. Setting it at runtime will return [`CUresult::CUDA_ERROR_NOT_PERMITTED`].
18010    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT`]: The required cluster height in blocks. The width, height, and depth values must either all be 0 or all be positive. The validity of the cluster dimensions is checked at launch time. If the value is set during compile time, it cannot be set at runtime. Setting it at runtime will return [`CUresult::CUDA_ERROR_NOT_PERMITTED`].
18011    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH`]: The required cluster depth in blocks. The width, height, and depth values must either all be 0 or all be positive. The validity of the cluster dimensions is checked at launch time. If the value is set during compile time, it cannot be set at runtime. Setting it at runtime will return [`CUresult::CUDA_ERROR_NOT_PERMITTED`].
18012    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED`]: Indicates whether the function can be launched with non-portable cluster size. 1 is allowed, 0 is disallowed.
18013    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE`]: The block scheduling policy of a function. The value type is CUclusterSchedulingPolicy.
18014    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_SHARED_MEMORY_MODE`]: The shared memory mode of a function. The value type is CUsharedMemoryMode / cudaSharedMemoryMode.
18015    ///
18016    /// Note that this function may also return error codes from previous, asynchronous launches.
18017    ///
18018    /// # Parameters
18019    ///
18020    /// - `hfunc`: Function to query attribute of.
18021    /// - `attrib`: Attribute requested.
18022    /// - `value`: The value to set.
18023    ///
18024    /// # Return value
18025    ///
18026    /// - [`CUresult::CUDA_SUCCESS`]
18027    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
18028    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
18029    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
18030    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
18031    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
18032    ///
18033    /// See also: [`cuCtxGetCacheConfig`], [`cuCtxSetCacheConfig`], [`cuFuncSetCacheConfig`], [`cuLaunchKernel`], `cudaFuncGetAttributes`, `cudaFuncSetAttribute`, [`cuKernelSetAttribute`].
18034    pub fn cuFuncSetAttribute(
18035        hfunc: CUfunction,
18036        attrib: CUfunction_attribute,
18037        value: ::core::ffi::c_int,
18038    ) -> CUresult;
18039}
18040singe_loader::functions! { crate::DRIVER;
18041    /// Sets the preferred cache configuration for a device function.
18042    ///
18043    /// On devices where the L1 cache and shared memory use the same hardware resources, this sets through `config` the preferred cache configuration for the device function `hfunc`. This is only a preference. The driver will use the requested configuration if possible, but it is free to choose a different configuration if required to execute `hfunc`. Any context-wide preference set via [`cuCtxSetCacheConfig`] will be overridden by this per-function setting unless the per-function setting is [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_NONE`]. In that case, the current context-wide setting will be used.
18044    ///
18045    /// This setting does nothing on devices where the size of the L1 cache and shared memory are fixed.
18046    ///
18047    /// Launching a kernel with a different preference than the most recent preference setting may insert a device-side synchronization point.
18048    ///
18049    /// The supported cache configurations are:
18050    ///
18051    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_NONE`]: no preference for shared memory or L1 (default)
18052    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_SHARED`]: prefer larger shared memory and smaller L1 cache
18053    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_L1`]: prefer larger L1 cache and smaller shared memory
18054    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_EQUAL`]: prefer equal sized L1 cache and shared memory.
18055    ///
18056    /// Note that this function may also return error codes from previous, asynchronous launches.
18057    ///
18058    /// # Parameters
18059    ///
18060    /// - `hfunc`: Kernel to configure cache for.
18061    /// - `config`: Requested cache configuration.
18062    ///
18063    /// # Return value
18064    ///
18065    /// - [`CUresult::CUDA_SUCCESS`]
18066    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
18067    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
18068    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
18069    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
18070    ///
18071    /// See also: [`cuCtxGetCacheConfig`], [`cuCtxSetCacheConfig`], [`cuFuncGetAttribute`], [`cuLaunchKernel`], `cudaFuncSetCacheConfig`, [`cuKernelSetCacheConfig`].
18072    pub fn cuFuncSetCacheConfig(hfunc: CUfunction, config: CUfunc_cache) -> CUresult;
18073}
18074singe_loader::functions! { crate::DRIVER;
18075    /// Returns a module handle.
18076    ///
18077    /// Returns in `*hmod` the handle of the module that function `hfunc` is located in. The lifetime of the module corresponds to the lifetime of the context it was loaded in or until the module is explicitly unloaded.
18078    ///
18079    /// The CUDA runtime manages its own modules loaded into the primary context. If the handle returned by this API refers to a module loaded by the CUDA runtime, calling [`cuModuleUnload`] on that module will result in undefined behavior.
18080    ///
18081    /// Note that this function may also return error codes from previous, asynchronous launches.
18082    ///
18083    /// # Parameters
18084    ///
18085    /// - `hmod`: Returned module handle.
18086    /// - `hfunc`: Function to retrieve module for.
18087    ///
18088    /// # Return value
18089    ///
18090    /// - [`CUresult::CUDA_SUCCESS`]
18091    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
18092    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
18093    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
18094    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
18095    /// - [`CUresult::CUDA_ERROR_NOT_FOUND`]
18096    pub fn cuFuncGetModule(hmod: *mut CUmodule, hfunc: CUfunction) -> CUresult;
18097}
18098singe_loader::functions! { crate::DRIVER;
18099    /// Returns the function name for a [`CUfunction`] handle.
18100    ///
18101    /// Returns in `**name` the function name associated with the function handle `hfunc`. The function name is returned as a null-terminated string. The returned name is only valid when the function handle is valid. If the module is unloaded or reloaded, one must call the API again to get the updated name. This API may return a mangled name if the function is not declared as having C linkage. If either `**name` or `hfunc` is NULL, [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned.
18102    ///
18103    /// Note that this function may also return error codes from previous, asynchronous launches.
18104    ///
18105    /// # Parameters
18106    ///
18107    /// - `name`: The returned name of the function.
18108    /// - `hfunc`: The function handle to retrieve the name for.
18109    ///
18110    /// # Return value
18111    ///
18112    /// - [`CUresult::CUDA_SUCCESS`]
18113    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
18114    pub fn cuFuncGetName(
18115        name: *mut *const ::core::ffi::c_char,
18116        hfunc: CUfunction,
18117    ) -> CUresult;
18118}
18119singe_loader::functions! { crate::DRIVER;
18120    /// Returns the offset and size of a kernel parameter in the device-side parameter layout.
18121    ///
18122    /// Queries the kernel parameter at `paramIndex` into `func's` list of parameters, and returns in `paramOffset` and `paramSize` the offset and size, respectively, where the parameter will reside in the device-side parameter layout. This information can be used to update kernel node parameters from the device via `cudaGraphKernelNodeSetParam()` and `cudaGraphKernelNodeUpdatesApply()`. `paramIndex` must be less than the number of parameters that `func` takes. `paramSize` can be set to NULL if only the parameter offset is desired.
18123    ///
18124    /// Note that this function may also return error codes from previous, asynchronous launches.
18125    ///
18126    /// # Parameters
18127    ///
18128    /// - `func`: The function to query.
18129    /// - `paramIndex`: The parameter index to query.
18130    /// - `paramOffset`: Returns the offset into the device-side parameter layout at which the parameter resides.
18131    /// - `paramSize`: Optionally returns the size of the parameter in the device-side parameter layout.
18132    ///
18133    /// # Return value
18134    ///
18135    /// - [`CUresult::CUDA_SUCCESS`]
18136    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
18137    ///
18138    /// See also: [`cuKernelGetParamInfo`].
18139    pub fn cuFuncGetParamInfo(
18140        func: CUfunction,
18141        paramIndex: size_t,
18142        paramOffset: *mut size_t,
18143        paramSize: *mut size_t,
18144    ) -> CUresult;
18145}
18146singe_loader::functions! { crate::DRIVER;
18147    /// Returns the number of parameters used by the function.
18148    ///
18149    /// Queries the number of kernel parameters used by `func` and returns it in `paramCount`.
18150    ///
18151    /// Note that this function may also return error codes from previous, asynchronous launches.
18152    ///
18153    /// # Parameters
18154    ///
18155    /// - `func`: The function to query.
18156    /// - `paramCount`: Returns the number of parameters used by the function.
18157    ///
18158    /// # Return value
18159    ///
18160    /// - [`CUresult::CUDA_SUCCESS`]
18161    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
18162    ///
18163    /// See also: [`cuFuncGetParamInfo`].
18164    pub fn cuFuncGetParamCount(func: CUfunction, paramCount: *mut size_t) -> CUresult;
18165}
18166impl CUfunctionLoadingState_enum {
18167    /// The function has not yet been loaded onto the device.
18168    pub const CU_FUNCTION_LOADING_STATE_UNLOADED: CUfunctionLoadingState_enum = CUfunctionLoadingState_enum(
18169        0,
18170    );
18171    /// The function is loaded onto the device.
18172    pub const CU_FUNCTION_LOADING_STATE_LOADED: CUfunctionLoadingState_enum = CUfunctionLoadingState_enum(
18173        1,
18174    );
18175    /// End marker for native function-loading states.
18176    pub const CU_FUNCTION_LOADING_STATE_MAX: CUfunctionLoadingState_enum = CUfunctionLoadingState_enum(
18177        2,
18178    );
18179}
18180/// Whether the native code for a CUDA function has been loaded onto the device.
18181#[repr(transparent)]
18182#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
18183pub struct CUfunctionLoadingState_enum(pub ::core::ffi::c_uint);
18184pub use self::CUfunctionLoadingState_enum as CUfunctionLoadingState;
18185singe_loader::functions! { crate::DRIVER;
18186    /// Returns if the function is loaded.
18187    ///
18188    /// Returns in `state` the loading state of `function`.
18189    ///
18190    /// # Parameters
18191    ///
18192    /// - `state`: returned loading state.
18193    /// - `function`: the function to check.
18194    ///
18195    /// # Return value
18196    ///
18197    /// - [`CUresult::CUDA_SUCCESS`]
18198    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
18199    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
18200    ///
18201    /// See also: [`cuFuncLoad`], [`cuModuleEnumerateFunctions`].
18202    pub fn cuFuncIsLoaded(
18203        state: *mut CUfunctionLoadingState,
18204        function: CUfunction,
18205    ) -> CUresult;
18206}
18207singe_loader::functions! { crate::DRIVER;
18208    /// Loads a function.
18209    ///
18210    /// Finalizes function loading for `function`. Calling this API with a fully loaded function has no effect.
18211    ///
18212    /// # Parameters
18213    ///
18214    /// - `function`: the function to load
18215    ///
18216    /// # Return value
18217    ///
18218    /// - [`CUresult::CUDA_SUCCESS`]
18219    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
18220    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
18221    ///
18222    /// See also: [`cuModuleEnumerateFunctions`], [`cuFuncIsLoaded`].
18223    pub fn cuFuncLoad(function: CUfunction) -> CUresult;
18224}
18225singe_loader::functions! { crate::DRIVER;
18226    /// Launches a CUDA function [`CUfunction`] or a CUDA kernel [`CUkernel`].
18227    ///
18228    /// Invokes the function [`CUfunction`] or the kernel [`CUkernel`] `f` on a `gridDimX` x `gridDimY` x `gridDimZ` grid of blocks. Each block contains `blockDimX` x `blockDimY` x `blockDimZ` threads.
18229    ///
18230    /// `sharedMemBytes` sets the amount of dynamic shared memory that will be available to each thread block.
18231    ///
18232    /// Kernel parameters to `f` can be specified in one of two ways:
18233    ///
18234    /// 1) Kernel parameters can be specified via `kernelParams`. If `f` has N parameters, then `kernelParams` needs to be an array of N pointers. Each of `kernelParams`\[0\] through `kernelParams`\[N-1\] must point to a region of memory from which the actual kernel parameter will be copied. The number of kernel parameters and their offsets and sizes do not need to be specified as that information is retrieved directly from the kernel’s image.
18235    ///
18236    /// 2) Kernel parameters can also be packaged by the application into a single buffer that is passed in via the `extra` parameter. This places the burden on the application of knowing each kernel parameter’s size and alignment/padding within the buffer. Here is an example of using the `extra` parameter in this manner:
18237    ///
18238    /// ```text
18239    /// size_t argBufferSize;
18240    /// char argBuffer\[256\];
18241    ///
18242    /// // populate argBuffer and argBufferSize
18243    ///
18244    /// void *config[] = {
18245    /// CU_LAUNCH_PARAM_BUFFER_POINTER, argBuffer,
18246    /// CU_LAUNCH_PARAM_BUFFER_SIZE,    &argBufferSize,
18247    /// CU_LAUNCH_PARAM_END
18248    /// };
18249    /// status = cuLaunchKernel(f, gx, gy, gz, bx, by, bz, sh, s, NULL, config);
18250    /// ```
18251    ///
18252    /// The `extra` parameter exists to allow [`cuLaunchKernel`] to take additional less commonly used arguments. `extra` specifies a list of names of extra settings and their corresponding values. Each extra setting name is immediately followed by the corresponding value. The list must be terminated with either NULL or [CU_LAUNCH_PARAM_END](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__TYPES.html#group__cuda__types_1gad5c11cff5adfa5a69d66829399653532).
18253    ///
18254    /// * [CU_LAUNCH_PARAM_END](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__TYPES.html#group__cuda__types_1gad5c11cff5adfa5a69d66829399653532), which indicates the end of the `extra` array;
18255    /// * [CU_LAUNCH_PARAM_BUFFER_POINTER](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__TYPES.html#group__cuda__types_1ga36d10d0b40c51372877578a2cffd6acd), which specifies that the next value in `extra` will be a pointer to a buffer containing all the kernel parameters for launching kernel `f`;
18256    /// * [CU_LAUNCH_PARAM_BUFFER_SIZE](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__TYPES.html#group__cuda__types_1gaf339c057cd94562ead93a192e11c17e9), which specifies that the next value in `extra` will be a pointer to a size_t containing the size of the buffer specified with [CU_LAUNCH_PARAM_BUFFER_POINTER](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__TYPES.html#group__cuda__types_1ga36d10d0b40c51372877578a2cffd6acd);
18257    ///
18258    /// The error [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] will be returned if kernel parameters are specified with both `kernelParams` and `extra` (i.e. both `kernelParams` and `extra` are non-NULL).
18259    ///
18260    /// Calling [`cuLaunchKernel`] invalidates the persistent function state set through the following deprecated APIs: [`cuFuncSetBlockShape`], [`cuFuncSetSharedSize`], [`cuParamSetSize`], [`cuParamSeti`], [`cuParamSetf`], [`cuParamSetv`].
18261    ///
18262    /// Note that to use [`cuLaunchKernel`], the kernel `f` must either have been compiled with toolchain version 3.2 or later so that it will contain kernel parameter information, or have no kernel parameters. If either of these conditions is not met, then [`cuLaunchKernel`] will return [`cudaError_enum::CUDA_ERROR_INVALID_IMAGE`].
18263    ///
18264    /// Note that the API can also be used to launch context-less kernel [`CUkernel`] by querying the handle using [`cuLibraryGetKernel`] and then passing it to the API by casting to [`CUfunction`]. Here, the context to launch the kernel on will either be taken from the specified stream `hStream` or the current context in case of NULL stream.
18265    ///
18266    /// Note: This function uses standard default stream semantics.
18267    ///
18268    /// Note that this function may also return error codes from previous, asynchronous launches.
18269    ///
18270    /// # Parameters
18271    ///
18272    /// - `f`: Function [`CUfunction`] or Kernel [`CUkernel`] to launch.
18273    /// - `gridDimX`: Width of grid in blocks.
18274    /// - `gridDimY`: Height of grid in blocks.
18275    /// - `gridDimZ`: Depth of grid in blocks.
18276    /// - `blockDimX`: X dimension of each thread block.
18277    /// - `blockDimY`: Y dimension of each thread block.
18278    /// - `blockDimZ`: Z dimension of each thread block.
18279    /// - `sharedMemBytes`: Dynamic shared-memory size per thread block in bytes.
18280    /// - `hStream`: Stream identifier.
18281    /// - `kernelParams`: Array of pointers to kernel parameters.
18282    /// - `extra`: Extra options.
18283    ///
18284    /// # Return value
18285    ///
18286    /// - [`CUresult::CUDA_SUCCESS`]
18287    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
18288    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
18289    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
18290    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
18291    /// - [`CUresult::CUDA_ERROR_INVALID_IMAGE`]
18292    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
18293    /// - [`CUresult::CUDA_ERROR_LAUNCH_FAILED`]
18294    /// - [`CUresult::CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES`]
18295    /// - [`CUresult::CUDA_ERROR_LAUNCH_TIMEOUT`]
18296    /// - [`CUresult::CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING`]
18297    /// - [`CUresult::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED`]
18298    /// - [`CUresult::CUDA_ERROR_NOT_FOUND`]
18299    ///
18300    /// See also: [`cuCtxGetCacheConfig`], [`cuCtxSetCacheConfig`], [`cuFuncSetCacheConfig`], [`cuFuncGetAttribute`], `cudaLaunchKernel`, [`cuLibraryGetKernel`], [`cuKernelSetCacheConfig`], [`cuKernelGetAttribute`], [`cuKernelSetAttribute`].
18301    pub fn cuLaunchKernel(
18302        f: CUfunction,
18303        gridDimX: ::core::ffi::c_uint,
18304        gridDimY: ::core::ffi::c_uint,
18305        gridDimZ: ::core::ffi::c_uint,
18306        blockDimX: ::core::ffi::c_uint,
18307        blockDimY: ::core::ffi::c_uint,
18308        blockDimZ: ::core::ffi::c_uint,
18309        sharedMemBytes: ::core::ffi::c_uint,
18310        hStream: CUstream,
18311        kernelParams: *mut *mut ::core::ffi::c_void,
18312        extra: *mut *mut ::core::ffi::c_void,
18313    ) -> CUresult;
18314}
18315singe_loader::functions! { crate::DRIVER;
18316    /// Launches a CUDA function [`CUfunction`] or a CUDA kernel [`CUkernel`] with launch-time configuration.
18317    ///
18318    /// Invokes the function [`CUfunction`] or the kernel [`CUkernel`] `f` with the specified launch-time configuration `config`.
18319    ///
18320    /// The [`CUlaunchConfig`] structure is defined as:
18321    ///
18322    /// ```text
18323    /// typedef struct CUlaunchConfig_st {
18324    /// unsigned int gridDimX;
18325    /// unsigned int gridDimY;
18326    /// unsigned int gridDimZ;
18327    /// unsigned int blockDimX;
18328    /// unsigned int blockDimY;
18329    /// unsigned int blockDimZ;
18330    /// unsigned int sharedMemBytes;
18331    /// CUstream hStream;
18332    /// CUlaunchAttribute *attrs;
18333    /// unsigned int numAttrs;
18334    /// } CUlaunchConfig;
18335    /// ```
18336    ///
18337    /// where:
18338    ///
18339    /// * [`CUlaunchConfig::gridDimX`](CUlaunchConfig_st::gridDimX) is the width of the grid in blocks.
18340    /// * [`CUlaunchConfig::gridDimY`](CUlaunchConfig_st::gridDimY) is the height of the grid in blocks.
18341    /// * [`CUlaunchConfig::gridDimZ`](CUlaunchConfig_st::gridDimZ) is the depth of the grid in blocks.
18342    /// * [`CUlaunchConfig::blockDimX`](CUlaunchConfig_st::blockDimX) is the X dimension of each thread block.
18343    /// * [`CUlaunchConfig::blockDimX`](CUlaunchConfig_st::blockDimX) is the Y dimension of each thread block.
18344    /// * [`CUlaunchConfig::blockDimZ`](CUlaunchConfig_st::blockDimZ) is the Z dimension of each thread block.
18345    /// * [`CUlaunchConfig::sharedMemBytes`](CUlaunchConfig_st::sharedMemBytes) is the dynamic shared-memory size per thread block in bytes.
18346    /// * [`CUlaunchConfig::hStream`](CUlaunchConfig_st::hStream) is the handle to the stream to perform the launch in. The CUDA context associated with this stream must match that associated with function f.
18347    /// * [`CUlaunchConfig::attrs`](CUlaunchConfig_st::attrs) is an array of [`CUlaunchConfig::numAttrs`](CUlaunchConfig_st::numAttrs) continguous [`CUlaunchAttribute`] elements. The value of this pointer is not considered if [`CUlaunchConfig::numAttrs`](CUlaunchConfig_st::numAttrs) is zero. However, in that case, it is recommended to set the pointer to NULL.
18348    /// * [`CUlaunchConfig::numAttrs`](CUlaunchConfig_st::numAttrs) is the number of attributes populating the first [`CUlaunchConfig::numAttrs`](CUlaunchConfig_st::numAttrs) positions of the [`CUlaunchConfig::attrs`](CUlaunchConfig_st::attrs) array.
18349    ///
18350    /// Launch-time configuration is specified by adding entries to [`CUlaunchConfig::attrs`](CUlaunchConfig_st::attrs). Each entry is an attribute ID and a corresponding attribute value.
18351    ///
18352    /// The [`CUlaunchAttribute`] structure is defined as:
18353    ///
18354    /// ```text
18355    /// typedef struct CUlaunchAttribute_st {
18356    /// CUlaunchAttributeID id;
18357    /// CUlaunchAttributeValue value;
18358    /// } CUlaunchAttribute;
18359    /// ```
18360    ///
18361    /// where:
18362    ///
18363    /// * [`CUlaunchAttribute::id`](CUlaunchAttribute_st::id) is a unique enum identifying the attribute.
18364    /// * [`CUlaunchAttribute::value`](CUlaunchAttribute_st::value) is a union that hold the attribute value.
18365    ///
18366    /// An example of using the `config` parameter:
18367    ///
18368    /// ```text
18369    /// CUlaunchAttribute coopAttr = {.id = CU_LAUNCH_ATTRIBUTE_COOPERATIVE,
18370    /// .value = 1};
18371    /// CUlaunchConfig config = {... // set block and grid dimensions
18372    /// .attrs = &coopAttr,
18373    /// .numAttrs = 1};
18374    ///
18375    /// cuLaunchKernelEx(&config, kernel, NULL, NULL);
18376    /// ```
18377    ///
18378    /// The [`CUlaunchAttributeID`] enum is defined as:
18379    ///
18380    /// ```text
18381    /// typedef enum CUlaunchAttributeID_enum {
18382    /// CU_LAUNCH_ATTRIBUTE_IGNORE = 0,
18383    /// CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW   = 1,
18384    /// CU_LAUNCH_ATTRIBUTE_COOPERATIVE            = 2,
18385    /// CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY = 3,
18386    /// CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION                    = 4,
18387    /// CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE = 5,
18388    /// CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION    = 6,
18389    /// CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT                   = 7,
18390    /// CU_LAUNCH_ATTRIBUTE_PRIORITY               = 8,
18391    /// CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP    = 9,
18392    /// CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN        = 10,
18393    /// CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION = 11,
18394    /// CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT = 12,
18395    /// CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE = 13,
18396    /// } CUlaunchAttributeID;
18397    /// ```
18398    ///
18399    /// and the corresponding [`CUlaunchAttributeValue`] union as :
18400    ///
18401    /// ```text
18402    /// typedef union CUlaunchAttributeValue_union {
18403    /// CUaccessPolicyWindow accessPolicyWindow;
18404    /// int cooperative;
18405    /// CUsynchronizationPolicy syncPolicy;
18406    /// struct {
18407    /// unsigned int x;
18408    /// unsigned int y;
18409    /// unsigned int z;
18410    /// } clusterDim;
18411    /// CUclusterSchedulingPolicy clusterSchedulingPolicyPreference;
18412    /// int programmaticStreamSerializationAllowed;
18413    /// struct {
18414    /// CUevent event;
18415    /// int flags;
18416    /// int triggerAtBlockStart;
18417    /// } programmaticEvent;
18418    /// int priority;
18419    /// CUlaunchMemSyncDomainMap memSyncDomainMap;
18420    /// CUlaunchMemSyncDomain memSyncDomain;
18421    /// struct {
18422    /// unsigned int x;
18423    /// unsigned int y;
18424    /// unsigned int z;
18425    /// } preferredClusterDim;
18426    /// struct {
18427    /// CUevent event;
18428    /// int flags;
18429    /// } launchCompletionEvent;
18430    /// struct {
18431    /// int deviceUpdatable;
18432    /// CUgraphDeviceNode devNode;
18433    /// } deviceUpdatableKernelNode;
18434    /// } CUlaunchAttributeValue;
18435    /// ```
18436    ///
18437    /// Setting [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_COOPERATIVE`] to a non-zero value causes the kernel launch to be a cooperative launch, with exactly the same usage and semantics of [`cuLaunchCooperativeKernel`].
18438    ///
18439    /// Setting [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION`] to a non-zero values causes the kernel to use programmatic means to resolve its stream dependency — enabling the CUDA runtime to opportunistically allow the grid’s execution to overlap with the previous kernel in the stream, if that kernel requests the overlap.
18440    ///
18441    /// [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT`] records an event along with the kernel launch. Event recorded through this launch attribute is guaranteed to only trigger after all block in the associated kernel trigger the event. A block can trigger the event through PTX launchdep.release or CUDA builtin function cudaTriggerProgrammaticLaunchCompletion(). A trigger can also be inserted at the beginning of each block’s execution if triggerAtBlockStart is set to non-0. Note that dependents (including the CPU thread calling [`cuEventSynchronize`]) are not guaranteed to observe the release precisely when it is released. For example, [`cuEventSynchronize`] may only observe the event trigger long after the associated kernel has completed. This recording type is primarily meant for establishing programmatic dependency between device tasks. The event supplied must not be an interprocess or interop event. The event must disable timing (i.e. created with [`CUevent_flags_enum::CU_EVENT_DISABLE_TIMING`] flag set).
18442    ///
18443    /// [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT`] records an event along with the kernel launch. Nominally, the event is triggered once all blocks of the kernel have begun execution. Currently this is a best effort. If a kernel B has a launch completion dependency on a kernel A, B may wait until A is complete. Alternatively, blocks of B may begin before all blocks of A have begun, for example:
18444    ///
18445    /// * If B can claim execution resources unavailable to A, for example if they run on different GPUs.
18446    /// * If B is a higher priority than A.
18447    ///
18448    /// Exercise caution if such an ordering inversion could lead to deadlock. The event supplied must not be an interprocess or interop event. The event must disable timing (i.e. must be created with the [`CUevent_flags_enum::CU_EVENT_DISABLE_TIMING`] flag set).
18449    ///
18450    /// Setting [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE`] to 1 on a captured launch causes the resulting kernel node to be device-updatable. This attribute is specific to graphs, and passing it to a launch in a non-capturing stream results in an error. Passing a value other than 0 or 1 is not allowed.
18451    ///
18452    /// On success, a handle will be returned via `CUlaunchAttributeValue::deviceUpdatableKernelNode::devNode` which can be passed to the various device-side update functions to update the node’s kernel parameters from within another kernel. For more information on the types of device updates that can be made, as well as the relevant limitations thereof, see `cudaGraphKernelNodeUpdatesApply`.
18453    ///
18454    /// Kernel nodes which are device-updatable have additional restrictions compared to regular kernel nodes. Firstly, device-updatable nodes cannot be removed from their graph via [`cuGraphDestroyNode`]. Additionally, once opted-in to this functionality, a node cannot opt out, and any attempt to set the attribute to 0 will result in an error. Graphs containing one or more device-updatable node also do not allow multiple instantiation.
18455    ///
18456    /// [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION`] allows the kernel launch to specify a preferred substitute cluster dimension. Blocks may be grouped according to either the dimensions specified with this attribute (grouped into a “preferred substitute cluster”), or the one specified with [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION`]
18457    ///
18458    /// attribute (grouped into a “regular
18459    ///
18460    /// cluster”). The cluster dimensions of a “preferred substitute cluster” shall be an integer multiple greater than zero of the regular cluster dimensions. The device will attempt - on a best-effort basis - to group thread blocks into preferred clusters over grouping them into regular clusters. When it deems necessary (primarily when the device temporarily runs out of physical resources to launch the larger preferred clusters), the device may switch to launch the regular clusters instead to attempt to utilize as much of the physical device resources as possible.
18461    ///
18462    /// Each type of cluster will have its enumeration / coordinate setup as if the grid consists solely of its type of cluster. For example, if the preferred substitute cluster dimensions double the regular cluster dimensions, there might be simultaneously a regular cluster indexed at (1,0,0), and a preferred cluster indexed at (1,0,0). In this example, the preferred substitute cluster (1,0,0) replaces regular clusters (2,0,0) and (3,0,0) and groups their blocks.
18463    ///
18464    /// This attribute will only take effect when a regular cluster dimension has been specified. The preferred substitute The preferred substitute cluster dimension must be an integer multiple greater than zero of the regular cluster dimension and must divide the grid. It must also be no more than `maxBlocksPerCluster`, if it is set in the kernel’s `__launch_bounds__`. Otherwise it must be less than the maximum value the driver can support. Otherwise, setting this attribute to a value physically unable to fit on any particular device is permitted.
18465    ///
18466    /// The effect of other attributes is consistent with their effect when set via persistent APIs.
18467    ///
18468    /// See [`cuStreamSetAttribute`] for
18469    ///
18470    /// * [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW`]
18471    /// * [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY`]
18472    ///
18473    /// See [`cuFuncSetAttribute`] for
18474    ///
18475    /// * [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION`]
18476    /// * [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE`]
18477    ///
18478    /// Kernel parameters to `f` can be specified in the same ways that they can be using [`cuLaunchKernel`].
18479    ///
18480    /// Note that the API can also be used to launch context-less kernel [`CUkernel`] by querying the handle using [`cuLibraryGetKernel`] and then passing it to the API by casting to [`CUfunction`]. Here, the context to launch the kernel on will either be taken from the specified stream [`CUlaunchConfig::hStream`](CUlaunchConfig_st::hStream) or the current context in case of NULL stream.
18481    ///
18482    /// Note: This function uses standard default stream semantics.
18483    ///
18484    /// Note that this function may also return error codes from previous, asynchronous launches.
18485    ///
18486    /// # Parameters
18487    ///
18488    /// - `config`: Config to launch.
18489    /// - `f`: Function [`CUfunction`] or Kernel [`CUkernel`] to launch.
18490    /// - `kernelParams`: Array of pointers to kernel parameters.
18491    /// - `extra`: Extra options.
18492    ///
18493    /// # Return value
18494    ///
18495    /// - [`CUresult::CUDA_SUCCESS`]
18496    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
18497    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
18498    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
18499    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
18500    /// - [`CUresult::CUDA_ERROR_INVALID_IMAGE`]
18501    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
18502    /// - [`CUresult::CUDA_ERROR_LAUNCH_FAILED`]
18503    /// - [`CUresult::CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES`]
18504    /// - [`CUresult::CUDA_ERROR_LAUNCH_TIMEOUT`]
18505    /// - [`CUresult::CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING`]
18506    /// - [`CUresult::CUDA_ERROR_COOPERATIVE_LAUNCH_TOO_LARGE`]
18507    /// - [`CUresult::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED`]
18508    /// - [`CUresult::CUDA_ERROR_NOT_FOUND`]
18509    ///
18510    /// See also: [`cuCtxGetCacheConfig`], [`cuCtxSetCacheConfig`], [`cuFuncSetCacheConfig`], [`cuFuncGetAttribute`], `cudaLaunchKernel`, `cudaLaunchKernelEx`, [`cuLibraryGetKernel`], [`cuKernelSetCacheConfig`], [`cuKernelGetAttribute`], [`cuKernelSetAttribute`].
18511    pub fn cuLaunchKernelEx(
18512        config: *const CUlaunchConfig,
18513        f: CUfunction,
18514        kernelParams: *mut *mut ::core::ffi::c_void,
18515        extra: *mut *mut ::core::ffi::c_void,
18516    ) -> CUresult;
18517}
18518singe_loader::functions! { crate::DRIVER;
18519    /// Launches a CUDA function [`CUfunction`] or a CUDA kernel [`CUkernel`] where thread blocks can cooperate and synchronize as they execute.
18520    ///
18521    /// Invokes the function [`CUfunction`] or the kernel [`CUkernel`] `f` on a `gridDimX` x `gridDimY` x `gridDimZ` grid of blocks. Each block contains `blockDimX` x `blockDimY` x `blockDimZ` threads.
18522    ///
18523    /// `sharedMemBytes` sets the amount of dynamic shared memory that will be available to each thread block.
18524    ///
18525    /// The device on which this kernel is invoked must have a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH`].
18526    ///
18527    /// The total number of blocks launched cannot exceed the maximum number of blocks per multiprocessor as returned by [`cuOccupancyMaxActiveBlocksPerMultiprocessor`] (or [`cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags`]) times the number of multiprocessors as specified by the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT`].
18528    ///
18529    /// The kernel cannot make use of CUDA dynamic parallelism.
18530    ///
18531    /// Kernel parameters must be specified via `kernelParams`. If `f` has N parameters, then `kernelParams` needs to be an array of N pointers. Each of `kernelParams`\[0\] through `kernelParams`\[N-1\] must point to a region of memory from which the actual kernel parameter will be copied. The number of kernel parameters and their offsets and sizes do not need to be specified as that information is retrieved directly from the kernel’s image.
18532    ///
18533    /// Calling [`cuLaunchCooperativeKernel`] sets persistent function state that is the same as function state set through [`cuLaunchKernel`] API
18534    ///
18535    /// When the kernel `f` is launched via [`cuLaunchCooperativeKernel`], the previous block shape, shared size and parameter info associated with `f` is overwritten.
18536    ///
18537    /// Note that to use [`cuLaunchCooperativeKernel`], the kernel `f` must either have been compiled with toolchain version 3.2 or later so that it will contain kernel parameter information, or have no kernel parameters. If either of these conditions is not met, then [`cuLaunchCooperativeKernel`] will return [`cudaError_enum::CUDA_ERROR_INVALID_IMAGE`].
18538    ///
18539    /// Note that the API can also be used to launch context-less kernel [`CUkernel`] by querying the handle using [`cuLibraryGetKernel`] and then passing it to the API by casting to [`CUfunction`]. Here, the context to launch the kernel on will either be taken from the specified stream `hStream` or the current context in case of NULL stream.
18540    ///
18541    /// Note: This function uses standard default stream semantics.
18542    ///
18543    /// Note that this function may also return error codes from previous, asynchronous launches.
18544    ///
18545    /// # Parameters
18546    ///
18547    /// - `f`: Function [`CUfunction`] or Kernel [`CUkernel`] to launch.
18548    /// - `gridDimX`: Width of grid in blocks.
18549    /// - `gridDimY`: Height of grid in blocks.
18550    /// - `gridDimZ`: Depth of grid in blocks.
18551    /// - `blockDimX`: X dimension of each thread block.
18552    /// - `blockDimY`: Y dimension of each thread block.
18553    /// - `blockDimZ`: Z dimension of each thread block.
18554    /// - `sharedMemBytes`: Dynamic shared-memory size per thread block in bytes.
18555    /// - `hStream`: Stream identifier.
18556    /// - `kernelParams`: Array of pointers to kernel parameters.
18557    ///
18558    /// # Return value
18559    ///
18560    /// - [`CUresult::CUDA_SUCCESS`]
18561    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
18562    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
18563    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
18564    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
18565    /// - [`CUresult::CUDA_ERROR_INVALID_IMAGE`]
18566    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
18567    /// - [`CUresult::CUDA_ERROR_LAUNCH_FAILED`]
18568    /// - [`CUresult::CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES`]
18569    /// - [`CUresult::CUDA_ERROR_LAUNCH_TIMEOUT`]
18570    /// - [`CUresult::CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING`]
18571    /// - [`CUresult::CUDA_ERROR_COOPERATIVE_LAUNCH_TOO_LARGE`]
18572    /// - [`CUresult::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED`]
18573    /// - [`CUresult::CUDA_ERROR_NOT_FOUND`]
18574    ///
18575    /// See also: [`cuCtxGetCacheConfig`], [`cuCtxSetCacheConfig`], [`cuFuncSetCacheConfig`], [`cuFuncGetAttribute`], [`cuLaunchCooperativeKernelMultiDevice`], `cudaLaunchCooperativeKernel`, [`cuLibraryGetKernel`], [`cuKernelSetCacheConfig`], [`cuKernelGetAttribute`], [`cuKernelSetAttribute`].
18576    pub fn cuLaunchCooperativeKernel(
18577        f: CUfunction,
18578        gridDimX: ::core::ffi::c_uint,
18579        gridDimY: ::core::ffi::c_uint,
18580        gridDimZ: ::core::ffi::c_uint,
18581        blockDimX: ::core::ffi::c_uint,
18582        blockDimY: ::core::ffi::c_uint,
18583        blockDimZ: ::core::ffi::c_uint,
18584        sharedMemBytes: ::core::ffi::c_uint,
18585        hStream: CUstream,
18586        kernelParams: *mut *mut ::core::ffi::c_void,
18587    ) -> CUresult;
18588}
18589singe_loader::functions! { crate::DRIVER;
18590    /// Enqueues a host function call in a stream.
18591    ///
18592    /// Enqueues a host function to run in a stream. The function will be called after currently enqueued work and will block work added after it.
18593    ///
18594    /// The host function must not make any CUDA API calls. Attempting to use a CUDA API may result in [`cudaError_enum::CUDA_ERROR_NOT_PERMITTED`], but this is not required. The host function must not perform any synchronization that may depend on outstanding CUDA work not mandated to run earlier. Host functions without a mandated order (such as in independent streams) execute in undefined order and may be serialized.
18595    ///
18596    /// For the purposes of Unified Memory, execution makes a number of guarantees:
18597    ///
18598    /// * The stream is considered idle for the duration of the function’s execution. Thus, for example, the function may always use memory attached to the stream it was enqueued in.
18599    /// * The start of execution of the function has the same effect as synchronizing an event recorded in the same stream immediately prior to the function. It thus synchronizes streams which have been “joined” prior to the function.
18600    /// * Adding device work to any stream does not have the effect of making the stream active until all preceding host functions and stream callbacks have executed. Thus, for example, a function might use global attached memory even if work has been added to another stream, if the work has been ordered behind the function call with an event.
18601    /// * Completion of the function does not cause a stream to become active except as described above. The stream will remain idle if no device work follows the function, and will remain idle across consecutive host functions or stream callbacks without device work in between. Thus, for example, stream synchronization can be done by signaling from a host function at the end of the stream.
18602    ///
18603    /// Note that, in contrast to [`cuStreamAddCallback`], the function will not be called in the event of an error in the CUDA context.
18604    ///
18605    /// Note: This function uses standard default stream semantics.
18606    ///
18607    /// Note that this function may also return error codes from previous, asynchronous launches.
18608    ///
18609    /// # Parameters
18610    ///
18611    /// - `hStream`: Stream to enqueue function call in.
18612    /// - `fn_`: The function to call once preceding stream operations are complete.
18613    /// - `userData`: User-specified data to be passed to the function.
18614    ///
18615    /// # Return value
18616    ///
18617    /// - [`CUresult::CUDA_SUCCESS`]
18618    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
18619    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
18620    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
18621    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
18622    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
18623    ///
18624    /// See also: [`cuStreamCreate`], [`cuStreamQuery`], [`cuStreamSynchronize`], [`cuStreamWaitEvent`], [`cuStreamDestroy`], [`cuMemAllocManaged`], [`cuStreamAttachMemAsync`], [`cuStreamAddCallback`].
18625    pub fn cuLaunchHostFunc(
18626        hStream: CUstream,
18627        fn_: CUhostFn,
18628        userData: *mut ::core::ffi::c_void,
18629    ) -> CUresult;
18630}
18631singe_loader::functions! { crate::DRIVER;
18632    /// Enqueues a host function call in a stream.
18633    ///
18634    /// Enqueues a host function to run in a stream. The function will be called after currently enqueued work and will block work added after it.
18635    ///
18636    /// The host function must not make any CUDA API calls. Attempting to use a CUDA API may result in [`cudaError_enum::CUDA_ERROR_NOT_PERMITTED`], but this is not required. The host function must not perform any synchronization that may depend on outstanding CUDA work not mandated to run earlier. Host functions without a mandated order (such as in independent streams) execute in undefined order and may be serialized.
18637    ///
18638    /// For the purposes of Unified Memory, execution makes a number of guarantees:
18639    ///
18640    /// * The stream is considered idle for the duration of the function’s execution. Thus, for example, the function may always use memory attached to the stream it was enqueued in.
18641    /// * The start of execution of the function has the same effect as synchronizing an event recorded in the same stream immediately prior to the function. It thus synchronizes streams which have been “joined” prior to the function.
18642    /// * Adding device work to any stream does not have the effect of making the stream active until all preceding host functions and stream callbacks have executed. Thus, for example, a function might use global attached memory even if work has been added to another stream, if the work has been ordered behind the function call with an event.
18643    /// * Completion of the function does not cause a stream to become active except as described above. The stream will remain idle if no device work follows the function, and will remain idle across consecutive host functions or stream callbacks without device work in between. Thus, for example, stream synchronization can be done by signaling from a host function at the end of the stream.
18644    ///
18645    /// Note that, in contrast to [`cuStreamAddCallback`], the function will not be called in the event of an error in the CUDA context.
18646    ///
18647    /// Note: This function uses standard default stream semantics.
18648    ///
18649    /// Note that this function may also return error codes from previous, asynchronous launches.
18650    ///
18651    /// # Parameters
18652    ///
18653    /// - `hStream`: Stream to enqueue function call in.
18654    /// - `fn_`: The function to call once preceding stream operations are complete.
18655    /// - `userData`: User-specified data to be passed to the function.
18656    /// - `syncMode`: Synchronization mode for the host function.
18657    ///
18658    /// # Return value
18659    ///
18660    /// - [`CUresult::CUDA_SUCCESS`]
18661    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
18662    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
18663    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
18664    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
18665    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
18666    ///
18667    /// See also: [`cuStreamCreate`], [`cuStreamQuery`], [`cuStreamSynchronize`], [`cuStreamWaitEvent`], [`cuStreamDestroy`], [`cuMemAllocManaged`], [`cuStreamAttachMemAsync`], [`cuStreamAddCallback`].
18668    pub fn cuLaunchHostFunc_v2(
18669        hStream: CUstream,
18670        fn_: CUhostFn,
18671        userData: *mut ::core::ffi::c_void,
18672        syncMode: ::core::ffi::c_uint,
18673    ) -> CUresult;
18674}
18675singe_loader::functions! { crate::DRIVER;
18676    /// Sets the block-dimensions for the function.
18677    ///
18678    /// Specifies the `x`, `y`, and `z` dimensions of the thread blocks that are created when the kernel given by `hfunc` is launched.
18679    ///
18680    /// Note that this function may also return error codes from previous, asynchronous launches.
18681    ///
18682    /// # Parameters
18683    ///
18684    /// - `hfunc`: Kernel to specify dimensions of.
18685    /// - `x`: X dimension.
18686    /// - `y`: Y dimension.
18687    /// - `z`: Z dimension.
18688    ///
18689    /// # Return value
18690    ///
18691    /// - [`CUresult::CUDA_SUCCESS`]
18692    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
18693    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
18694    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
18695    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
18696    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
18697    ///
18698    /// See also: [`cuFuncSetSharedSize`], [`cuFuncSetCacheConfig`], [`cuFuncGetAttribute`], [`cuParamSetSize`], [`cuParamSeti`], [`cuParamSetf`], [`cuParamSetv`], [`cuLaunch`], [`cuLaunchGrid`], [`cuLaunchGridAsync`], [`cuLaunchKernel`].
18699    #[deprecated]
18700    pub fn cuFuncSetBlockShape(
18701        hfunc: CUfunction,
18702        x: ::core::ffi::c_int,
18703        y: ::core::ffi::c_int,
18704        z: ::core::ffi::c_int,
18705    ) -> CUresult;
18706}
18707singe_loader::functions! { crate::DRIVER;
18708    /// Sets the dynamic shared-memory size for the function.
18709    ///
18710    /// Sets through `bytes` the amount of dynamic shared memory that will be available to each thread block when the kernel given by `hfunc` is launched.
18711    ///
18712    /// Note that this function may also return error codes from previous, asynchronous launches.
18713    ///
18714    /// # Parameters
18715    ///
18716    /// - `hfunc`: Kernel to specify dynamic shared-memory size for.
18717    /// - `bytes`: Dynamic shared-memory size per thread in bytes.
18718    ///
18719    /// # Return value
18720    ///
18721    /// - [`CUresult::CUDA_SUCCESS`]
18722    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
18723    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
18724    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
18725    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
18726    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
18727    ///
18728    /// See also: [`cuFuncSetBlockShape`], [`cuFuncSetCacheConfig`], [`cuFuncGetAttribute`], [`cuParamSetSize`], [`cuParamSeti`], [`cuParamSetf`], [`cuParamSetv`], [`cuLaunch`], [`cuLaunchGrid`], [`cuLaunchGridAsync`], [`cuLaunchKernel`].
18729    #[deprecated]
18730    pub fn cuFuncSetSharedSize(
18731        hfunc: CUfunction,
18732        bytes: ::core::ffi::c_uint,
18733    ) -> CUresult;
18734}
18735singe_loader::functions! { crate::DRIVER;
18736    /// Sets the parameter size for the function.
18737    ///
18738    /// Sets through `numbytes` the total size in bytes needed by the function parameters of the kernel corresponding to `hfunc`.
18739    ///
18740    /// Note that this function may also return error codes from previous, asynchronous launches.
18741    ///
18742    /// # Parameters
18743    ///
18744    /// - `hfunc`: Kernel to set parameter size for.
18745    /// - `numbytes`: Size of parameter list in bytes.
18746    ///
18747    /// # Return value
18748    ///
18749    /// - [`CUresult::CUDA_SUCCESS`]
18750    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
18751    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
18752    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
18753    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
18754    ///
18755    /// See also: [`cuFuncSetBlockShape`], [`cuFuncSetSharedSize`], [`cuFuncGetAttribute`], [`cuParamSetf`], [`cuParamSeti`], [`cuParamSetv`], [`cuLaunch`], [`cuLaunchGrid`], [`cuLaunchGridAsync`], [`cuLaunchKernel`].
18756    #[deprecated]
18757    pub fn cuParamSetSize(hfunc: CUfunction, numbytes: ::core::ffi::c_uint) -> CUresult;
18758}
18759singe_loader::functions! { crate::DRIVER;
18760    /// Adds an integer parameter to the function’s argument list.
18761    ///
18762    /// Sets an integer parameter that will be specified the next time the kernel corresponding to `hfunc` will be invoked. `offset` is a byte offset.
18763    ///
18764    /// Note that this function may also return error codes from previous, asynchronous launches.
18765    ///
18766    /// # Parameters
18767    ///
18768    /// - `hfunc`: Kernel to add parameter to.
18769    /// - `offset`: Offset to add parameter to argument list.
18770    /// - `value`: Value of parameter.
18771    ///
18772    /// # Return value
18773    ///
18774    /// - [`CUresult::CUDA_SUCCESS`]
18775    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
18776    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
18777    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
18778    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
18779    ///
18780    /// See also: [`cuFuncSetBlockShape`], [`cuFuncSetSharedSize`], [`cuFuncGetAttribute`], [`cuParamSetSize`], [`cuParamSetf`], [`cuParamSetv`], [`cuLaunch`], [`cuLaunchGrid`], [`cuLaunchGridAsync`], [`cuLaunchKernel`].
18781    #[deprecated]
18782    pub fn cuParamSeti(
18783        hfunc: CUfunction,
18784        offset: ::core::ffi::c_int,
18785        value: ::core::ffi::c_uint,
18786    ) -> CUresult;
18787}
18788singe_loader::functions! { crate::DRIVER;
18789    /// Adds a floating-point parameter to the function’s argument list.
18790    ///
18791    /// Sets a floating-point parameter that will be specified the next time the kernel corresponding to `hfunc` will be invoked. `offset` is a byte offset.
18792    ///
18793    /// Note that this function may also return error codes from previous, asynchronous launches.
18794    ///
18795    /// # Parameters
18796    ///
18797    /// - `hfunc`: Kernel to add parameter to.
18798    /// - `offset`: Offset to add parameter to argument list.
18799    /// - `value`: Value of parameter.
18800    ///
18801    /// # Return value
18802    ///
18803    /// - [`CUresult::CUDA_SUCCESS`]
18804    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
18805    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
18806    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
18807    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
18808    ///
18809    /// See also: [`cuFuncSetBlockShape`], [`cuFuncSetSharedSize`], [`cuFuncGetAttribute`], [`cuParamSetSize`], [`cuParamSeti`], [`cuParamSetv`], [`cuLaunch`], [`cuLaunchGrid`], [`cuLaunchGridAsync`], [`cuLaunchKernel`].
18810    #[deprecated]
18811    pub fn cuParamSetf(
18812        hfunc: CUfunction,
18813        offset: ::core::ffi::c_int,
18814        value: f32,
18815    ) -> CUresult;
18816}
18817singe_loader::functions! { crate::DRIVER;
18818    /// Adds arbitrary data to the function’s argument list.
18819    ///
18820    /// Copies an arbitrary amount of data (specified in `numbytes`) from `ptr` into the parameter space of the kernel corresponding to `hfunc`. `offset` is a byte offset.
18821    ///
18822    /// Note that this function may also return error codes from previous, asynchronous launches.
18823    ///
18824    /// # Parameters
18825    ///
18826    /// - `hfunc`: Kernel to add data to.
18827    /// - `offset`: Offset to add data to argument list.
18828    /// - `ptr`: Pointer to arbitrary data.
18829    /// - `numbytes`: Size of data to copy in bytes.
18830    ///
18831    /// # Return value
18832    ///
18833    /// - [`CUresult::CUDA_SUCCESS`]
18834    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
18835    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
18836    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
18837    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
18838    ///
18839    /// See also: [`cuFuncSetBlockShape`], [`cuFuncSetSharedSize`], [`cuFuncGetAttribute`], [`cuParamSetSize`], [`cuParamSetf`], [`cuParamSeti`], [`cuLaunch`], [`cuLaunchGrid`], [`cuLaunchGridAsync`], [`cuLaunchKernel`].
18840    #[deprecated]
18841    pub fn cuParamSetv(
18842        hfunc: CUfunction,
18843        offset: ::core::ffi::c_int,
18844        ptr: *mut ::core::ffi::c_void,
18845        numbytes: ::core::ffi::c_uint,
18846    ) -> CUresult;
18847}
18848singe_loader::functions! { crate::DRIVER;
18849    /// Launches a CUDA function.
18850    ///
18851    /// Invokes the kernel `f` on a 1 x 1 x 1 grid of blocks. The block contains the number of threads specified by a previous call to [`cuFuncSetBlockShape`].
18852    ///
18853    /// The block shape, dynamic shared memory size, and parameter information must be set using [`cuFuncSetBlockShape`], [`cuFuncSetSharedSize`], [`cuParamSetSize`], [`cuParamSeti`], [`cuParamSetf`], and [`cuParamSetv`] prior to calling this function.
18854    ///
18855    /// Launching a function via [`cuLaunchKernel`] invalidates the function’s block shape, dynamic shared memory size, and parameter information. After launching via cuLaunchKernel, this state must be re-initialized prior to calling this function. Failure to do so results in undefined behavior.
18856    ///
18857    /// Note that this function may also return error codes from previous, asynchronous launches.
18858    ///
18859    /// # Parameters
18860    ///
18861    /// - `f`: Kernel to launch
18862    ///
18863    /// # Return value
18864    ///
18865    /// - [`CUresult::CUDA_SUCCESS`]
18866    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
18867    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
18868    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
18869    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
18870    /// - [`CUresult::CUDA_ERROR_LAUNCH_FAILED`]
18871    /// - [`CUresult::CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES`]
18872    /// - [`CUresult::CUDA_ERROR_LAUNCH_TIMEOUT`]
18873    /// - [`CUresult::CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING`]
18874    /// - [`CUresult::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED`]
18875    ///
18876    /// See also: [`cuFuncSetBlockShape`], [`cuFuncSetSharedSize`], [`cuFuncGetAttribute`], [`cuParamSetSize`], [`cuParamSetf`], [`cuParamSeti`], [`cuParamSetv`], [`cuLaunchGrid`], [`cuLaunchGridAsync`], [`cuLaunchKernel`].
18877    #[deprecated]
18878    pub fn cuLaunch(f: CUfunction) -> CUresult;
18879}
18880singe_loader::functions! { crate::DRIVER;
18881    /// Launches a CUDA function.
18882    ///
18883    /// Invokes the kernel `f` on a `grid_width` x `grid_height` grid of blocks. Each block contains the number of threads specified by a previous call to [`cuFuncSetBlockShape`].
18884    ///
18885    /// The block shape, dynamic shared memory size, and parameter information must be set using [`cuFuncSetBlockShape`], [`cuFuncSetSharedSize`], [`cuParamSetSize`], [`cuParamSeti`], [`cuParamSetf`], and [`cuParamSetv`] prior to calling this function.
18886    ///
18887    /// Launching a function via [`cuLaunchKernel`] invalidates the function’s block shape, dynamic shared memory size, and parameter information. After launching via cuLaunchKernel, this state must be re-initialized prior to calling this function. Failure to do so results in undefined behavior.
18888    ///
18889    /// Note that this function may also return error codes from previous, asynchronous launches.
18890    ///
18891    /// # Parameters
18892    ///
18893    /// - `f`: Kernel to launch.
18894    /// - `grid_width`: Width of grid in blocks.
18895    /// - `grid_height`: Height of grid in blocks.
18896    ///
18897    /// # Return value
18898    ///
18899    /// - [`CUresult::CUDA_SUCCESS`]
18900    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
18901    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
18902    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
18903    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
18904    /// - [`CUresult::CUDA_ERROR_LAUNCH_FAILED`]
18905    /// - [`CUresult::CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES`]
18906    /// - [`CUresult::CUDA_ERROR_LAUNCH_TIMEOUT`]
18907    /// - [`CUresult::CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING`]
18908    /// - [`CUresult::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED`]
18909    ///
18910    /// See also: [`cuFuncSetBlockShape`], [`cuFuncSetSharedSize`], [`cuFuncGetAttribute`], [`cuParamSetSize`], [`cuParamSetf`], [`cuParamSeti`], [`cuParamSetv`], [`cuLaunch`], [`cuLaunchGridAsync`], [`cuLaunchKernel`].
18911    #[deprecated]
18912    pub fn cuLaunchGrid(
18913        f: CUfunction,
18914        grid_width: ::core::ffi::c_int,
18915        grid_height: ::core::ffi::c_int,
18916    ) -> CUresult;
18917}
18918singe_loader::functions! { crate::DRIVER;
18919    /// Launches a CUDA function.
18920    ///
18921    /// Invokes the kernel `f` on a `grid_width` x `grid_height` grid of blocks. Each block contains the number of threads specified by a previous call to [`cuFuncSetBlockShape`].
18922    ///
18923    /// The block shape, dynamic shared memory size, and parameter information must be set using [`cuFuncSetBlockShape`], [`cuFuncSetSharedSize`], [`cuParamSetSize`], [`cuParamSeti`], [`cuParamSetf`], and [`cuParamSetv`] prior to calling this function.
18924    ///
18925    /// Launching a function via [`cuLaunchKernel`] invalidates the function’s block shape, dynamic shared memory size, and parameter information. After launching via cuLaunchKernel, this state must be re-initialized prior to calling this function. Failure to do so results in undefined behavior.
18926    ///
18927    /// Note: In certain cases where cubins are created with no ABI (i.e., using `ptxas` `--abi-compile` `no`), this function may serialize kernel launches. The CUDA driver retains asynchronous behavior by growing the per-thread stack as needed per launch and not shrinking it afterwards.
18928    ///
18929    /// Note: This function uses standard default stream semantics.
18930    ///
18931    /// Note that this function may also return error codes from previous, asynchronous launches.
18932    ///
18933    /// # Parameters
18934    ///
18935    /// - `f`: Kernel to launch.
18936    /// - `grid_width`: Width of grid in blocks.
18937    /// - `grid_height`: Height of grid in blocks.
18938    /// - `hStream`: Stream identifier.
18939    ///
18940    /// # Return value
18941    ///
18942    /// - [`CUresult::CUDA_SUCCESS`]
18943    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
18944    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
18945    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
18946    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
18947    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
18948    /// - [`CUresult::CUDA_ERROR_LAUNCH_FAILED`]
18949    /// - [`CUresult::CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES`]
18950    /// - [`CUresult::CUDA_ERROR_LAUNCH_TIMEOUT`]
18951    /// - [`CUresult::CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING`]
18952    /// - [`CUresult::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED`]
18953    ///
18954    /// See also: [`cuFuncSetBlockShape`], [`cuFuncSetSharedSize`], [`cuFuncGetAttribute`], [`cuParamSetSize`], [`cuParamSetf`], [`cuParamSeti`], [`cuParamSetv`], [`cuLaunch`], [`cuLaunchGrid`], [`cuLaunchKernel`].
18955    #[deprecated]
18956    pub fn cuLaunchGridAsync(
18957        f: CUfunction,
18958        grid_width: ::core::ffi::c_int,
18959        grid_height: ::core::ffi::c_int,
18960        hStream: CUstream,
18961    ) -> CUresult;
18962}
18963singe_loader::functions! { crate::DRIVER;
18964    /// Launches CUDA functions on multiple devices where thread blocks can cooperate and synchronize as they execute.
18965    ///
18966    /// Invokes kernels as specified in the `launchParamsList` array where each element of the array specifies all the parameters required to perform a single kernel launch. These kernels can cooperate and synchronize as they execute. The size of the array is specified by `numDevices`.
18967    ///
18968    /// No two kernels can be launched on the same device. All the devices targeted by this multi-device launch must be identical. All devices must have a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH`].
18969    ///
18970    /// All kernels launched must be identical with respect to the compiled code. Note that any **device**, **constant** or **managed** variables present in the module that owns the kernel launched on each device, are independently instantiated on every device. It is the application’s responsibility to ensure these variables are initialized and used appropriately.
18971    ///
18972    /// The size of the grids as specified in blocks, the size of the blocks themselves and the amount of shared memory used by each thread block must also match across all launched kernels.
18973    ///
18974    /// The streams used to launch these kernels must have been created via either [`cuStreamCreate`] or [`cuStreamCreateWithPriority`]. The NULL stream or [CU_STREAM_LEGACY](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__TYPES.html#group__cuda__types_1gaa53e8210837f039dd6434a3a4c3324aa) or [CU_STREAM_PER_THREAD](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__TYPES.html#group__cuda__types_1ga02e40b82600f62c42ed29abb150f857c) cannot be used.
18975    ///
18976    /// The total number of blocks launched per kernel cannot exceed the maximum number of blocks per multiprocessor as returned by [`cuOccupancyMaxActiveBlocksPerMultiprocessor`] (or [`cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags`]) times the number of multiprocessors as specified by the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT`]. Since the total number of blocks launched per device has to match across all devices, the maximum number of blocks that can be launched per device will be limited by the device with the least number of multiprocessors.
18977    ///
18978    /// The kernels cannot make use of CUDA dynamic parallelism.
18979    ///
18980    /// The CUDA_LAUNCH_PARAMS structure is defined as:
18981    ///
18982    /// ```text
18983    /// typedef struct CUDA_LAUNCH_PARAMS_st
18984    /// {
18985    /// CUfunction function;
18986    /// unsigned int gridDimX;
18987    /// unsigned int gridDimY;
18988    /// unsigned int gridDimZ;
18989    /// unsigned int blockDimX;
18990    /// unsigned int blockDimY;
18991    /// unsigned int blockDimZ;
18992    /// unsigned int sharedMemBytes;
18993    /// CUstream hStream;
18994    /// void **kernelParams;
18995    /// } CUDA_LAUNCH_PARAMS;
18996    /// ```
18997    ///
18998    /// where:
18999    ///
19000    /// * [`CUDA_LAUNCH_PARAMS::function`](CUDA_LAUNCH_PARAMS_st::function) specifies the kernel to be launched. All functions must be identical with respect to the compiled code. Note that you can also specify context-less kernel [`CUkernel`] by querying the handle using [`cuLibraryGetKernel`] and then casting to [`CUfunction`]. In this case, the context to launch the kernel on be taken from the specified stream [`CUDA_LAUNCH_PARAMS::hStream`](CUDA_LAUNCH_PARAMS_st::hStream).
19001    /// * [`CUDA_LAUNCH_PARAMS::gridDimX`](CUDA_LAUNCH_PARAMS_st::gridDimX) is the width of the grid in blocks. This must match across all kernels launched.
19002    /// * [`CUDA_LAUNCH_PARAMS::gridDimY`](CUDA_LAUNCH_PARAMS_st::gridDimY) is the height of the grid in blocks. This must match across all kernels launched.
19003    /// * [`CUDA_LAUNCH_PARAMS::gridDimZ`](CUDA_LAUNCH_PARAMS_st::gridDimZ) is the depth of the grid in blocks. This must match across all kernels launched.
19004    /// * [`CUDA_LAUNCH_PARAMS::blockDimX`](CUDA_LAUNCH_PARAMS_st::blockDimX) is the X dimension of each thread block. This must match across all kernels launched.
19005    /// * [`CUDA_LAUNCH_PARAMS::blockDimX`](CUDA_LAUNCH_PARAMS_st::blockDimX) is the Y dimension of each thread block. This must match across all kernels launched.
19006    /// * [`CUDA_LAUNCH_PARAMS::blockDimZ`](CUDA_LAUNCH_PARAMS_st::blockDimZ) is the Z dimension of each thread block. This must match across all kernels launched.
19007    /// * [`CUDA_LAUNCH_PARAMS::sharedMemBytes`](CUDA_LAUNCH_PARAMS_st::sharedMemBytes) is the dynamic shared-memory size per thread block in bytes. This must match across all kernels launched.
19008    /// * [`CUDA_LAUNCH_PARAMS::hStream`](CUDA_LAUNCH_PARAMS_st::hStream) is the handle to the stream to perform the launch in. This cannot be the NULL stream or [CU_STREAM_LEGACY](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__TYPES.html#group__cuda__types_1gaa53e8210837f039dd6434a3a4c3324aa) or [CU_STREAM_PER_THREAD](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__TYPES.html#group__cuda__types_1ga02e40b82600f62c42ed29abb150f857c). The CUDA context associated with this stream must match that associated with [`CUDA_LAUNCH_PARAMS::function`](CUDA_LAUNCH_PARAMS_st::function).
19009    /// * [`CUDA_LAUNCH_PARAMS::kernelParams`](CUDA_LAUNCH_PARAMS_st::kernelParams) is an array of pointers to kernel parameters. If [`CUDA_LAUNCH_PARAMS::function`](CUDA_LAUNCH_PARAMS_st::function) has N parameters, then [`CUDA_LAUNCH_PARAMS::kernelParams`](CUDA_LAUNCH_PARAMS_st::kernelParams) needs to be an array of N pointers. Each of [`CUDA_LAUNCH_PARAMS::kernelParams`](CUDA_LAUNCH_PARAMS_st::kernelParams)\[0\] through [`CUDA_LAUNCH_PARAMS::kernelParams`](CUDA_LAUNCH_PARAMS_st::kernelParams)\[N-1\] must point to a region of memory from which the actual kernel parameter will be copied. The number of kernel parameters and their offsets and sizes do not need to be specified as that information is retrieved directly from the kernel’s image.
19010    ///
19011    /// By default, the kernel won’t begin execution on any GPU until all prior work in all the specified streams has completed. This behavior can be overridden by specifying the flag [`CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_PRE_LAUNCH_SYNC`]. When this flag is specified, each kernel will only wait for prior work in the stream corresponding to that GPU to complete before it begins execution.
19012    ///
19013    /// Similarly, by default, any subsequent work pushed in any of the specified streams will not begin execution until the kernels on all GPUs have completed. This behavior can be overridden by specifying the flag [`CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_POST_LAUNCH_SYNC`]. When this flag is specified, any subsequent work pushed in any of the specified streams will only wait for the kernel launched on the GPU corresponding to that stream to complete before it begins execution.
19014    ///
19015    /// Calling [`cuLaunchCooperativeKernelMultiDevice`] sets persistent function state that is the same as function state set through [`cuLaunchKernel`] API when called individually for each element in `launchParamsList`.
19016    ///
19017    /// When kernels are launched via [`cuLaunchCooperativeKernelMultiDevice`], the previous block shape, shared size and parameter info associated with each [`CUDA_LAUNCH_PARAMS::function`](CUDA_LAUNCH_PARAMS_st::function) in `launchParamsList` is overwritten.
19018    ///
19019    /// Note that to use [`cuLaunchCooperativeKernelMultiDevice`], the kernels must either have been compiled with toolchain version 3.2 or later so that it will contain kernel parameter information, or have no kernel parameters. If either of these conditions is not met, then [`cuLaunchCooperativeKernelMultiDevice`] will return [`cudaError_enum::CUDA_ERROR_INVALID_IMAGE`].
19020    ///
19021    /// Deprecated: This function is deprecated as of CUDA 11.3.
19022    ///
19023    /// Note: This function uses standard default stream semantics.
19024    ///
19025    /// Note that this function may also return error codes from previous, asynchronous launches.
19026    ///
19027    /// # Parameters
19028    ///
19029    /// - `launchParamsList`: List of launch parameters, one per device.
19030    /// - `numDevices`: Size of the `launchParamsList` array.
19031    /// - `flags`: Flags to control launch behavior.
19032    ///
19033    /// # Return value
19034    ///
19035    /// - [`CUresult::CUDA_SUCCESS`]
19036    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
19037    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
19038    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
19039    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
19040    /// - [`CUresult::CUDA_ERROR_INVALID_IMAGE`]
19041    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19042    /// - [`CUresult::CUDA_ERROR_LAUNCH_FAILED`]
19043    /// - [`CUresult::CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES`]
19044    /// - [`CUresult::CUDA_ERROR_LAUNCH_TIMEOUT`]
19045    /// - [`CUresult::CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING`]
19046    /// - [`CUresult::CUDA_ERROR_COOPERATIVE_LAUNCH_TOO_LARGE`]
19047    /// - [`CUresult::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED`]
19048    ///
19049    /// See also: [`cuCtxGetCacheConfig`], [`cuCtxSetCacheConfig`], [`cuFuncSetCacheConfig`], [`cuFuncGetAttribute`], [`cuLaunchCooperativeKernel`], `cudaLaunchCooperativeKernelMultiDevice`.
19050    #[deprecated]
19051    pub fn cuLaunchCooperativeKernelMultiDevice(
19052        launchParamsList: *mut CUDA_LAUNCH_PARAMS,
19053        numDevices: ::core::ffi::c_uint,
19054        flags: ::core::ffi::c_uint,
19055    ) -> CUresult;
19056}
19057singe_loader::functions! { crate::DRIVER;
19058    /// Adds a texture-reference to the function’s argument list.
19059    ///
19060    /// Makes the CUDA array or linear memory bound to the texture reference `hTexRef` available to a device program as a texture. In this version of CUDA, the texture-reference must be obtained via [`cuModuleGetTexRef`] and the `texunit` parameter must be set to [`CU_PARAM_TR_DEFAULT`].
19061    ///
19062    /// Note that this function may also return error codes from previous, asynchronous launches.
19063    ///
19064    /// # Parameters
19065    ///
19066    /// - `hfunc`: Kernel to add texture-reference to.
19067    /// - `texunit`: Texture unit (must be [`CU_PARAM_TR_DEFAULT`]).
19068    /// - `hTexRef`: Texture-reference to add to argument list.
19069    ///
19070    /// # Return value
19071    ///
19072    /// - [`CUresult::CUDA_SUCCESS`]
19073    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
19074    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
19075    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
19076    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19077    #[deprecated]
19078    pub fn cuParamSetTexRef(
19079        hfunc: CUfunction,
19080        texunit: ::core::ffi::c_int,
19081        hTexRef: CUtexref,
19082    ) -> CUresult;
19083}
19084singe_loader::functions! { crate::DRIVER;
19085    /// Sets the shared memory configuration for a device function.
19086    ///
19087    /// On devices with configurable shared memory banks, this function will force all subsequent launches of the specified device function to have the given shared memory bank size configuration. On any given launch of the function, the shared memory configuration of the device will be temporarily changed if needed to suit the function’s preferred configuration. Changes in shared memory configuration between subsequent launches of functions, may introduce a device side synchronization point.
19088    ///
19089    /// Any per-function setting of shared memory bank size set via [`cuFuncSetSharedMemConfig`] will override the context wide setting set with [`cuCtxSetSharedMemConfig`].
19090    ///
19091    /// Changing the shared memory bank size will not increase shared memory usage or affect occupancy of kernels, but may have major effects on performance. Larger bank sizes will allow for greater potential bandwidth to shared memory, but will change what kinds of accesses to shared memory will result in bank conflicts.
19092    ///
19093    /// This function will do nothing on devices with fixed shared memory bank size.
19094    ///
19095    /// The supported bank configurations are:
19096    ///
19097    /// * [`CUsharedconfig_enum::CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE`]: use the context’s shared memory configuration when launching this function.
19098    /// * [`CUsharedconfig_enum::CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE`]: set shared memory bank width to be natively four bytes when launching this function.
19099    /// * [`CUsharedconfig_enum::CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE`]: set shared memory bank width to be natively eight bytes when launching this function.
19100    ///
19101    /// Note that this function may also return error codes from previous, asynchronous launches.
19102    ///
19103    /// # Parameters
19104    ///
19105    /// - `hfunc`: kernel to be given a shared memory config.
19106    /// - `config`: requested shared memory configuration.
19107    ///
19108    /// # Return value
19109    ///
19110    /// - [`CUresult::CUDA_SUCCESS`]
19111    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19112    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
19113    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
19114    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
19115    ///
19116    /// See also: [`cuCtxGetCacheConfig`], [`cuCtxSetCacheConfig`], [`cuCtxGetSharedMemConfig`], [`cuCtxSetSharedMemConfig`], [`cuFuncGetAttribute`], [`cuLaunchKernel`], `cudaFuncSetSharedMemConfig`.
19117    #[deprecated]
19118    pub fn cuFuncSetSharedMemConfig(
19119        hfunc: CUfunction,
19120        config: CUsharedconfig,
19121    ) -> CUresult;
19122}
19123singe_loader::functions! { crate::DRIVER;
19124    /// Creates a graph.
19125    ///
19126    /// Creates an empty graph, which is returned via `phGraph`.
19127    ///
19128    /// Note: Graph objects are not threadsafe. More here.
19129    ///
19130    /// Note that this function may also return error codes from previous, asynchronous launches.
19131    ///
19132    /// # Parameters
19133    ///
19134    /// - `phGraph`: Returns newly created graph.
19135    /// - `flags`: Graph creation flags, must be 0.
19136    ///
19137    /// # Return value
19138    ///
19139    /// - [`CUresult::CUDA_SUCCESS`]
19140    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
19141    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
19142    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19143    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
19144    ///
19145    /// See also: [`cuGraphAddChildGraphNode`], [`cuGraphAddEmptyNode`], [`cuGraphAddKernelNode`], [`cuGraphAddHostNode`], [`cuGraphAddMemcpyNode`], [`cuGraphAddMemsetNode`], `cuGraphInstantiate`, [`cuGraphDestroy`], [`cuGraphGetNodes`], [`cuGraphGetRootNodes`], [`cuGraphGetEdges`], [`cuGraphClone`].
19146    pub fn cuGraphCreate(phGraph: *mut CUgraph, flags: ::core::ffi::c_uint) -> CUresult;
19147}
19148singe_loader::functions! { crate::DRIVER;
19149    /// Creates a kernel execution node and adds it to a graph.
19150    ///
19151    /// Creates a new kernel execution node and adds it to `hGraph` with `numDependencies` dependencies specified via `dependencies` and arguments specified in `nodeParams`. It is possible for `numDependencies` to be 0, in which case the node will be placed at the root of the graph. `dependencies` may not have any duplicate entries. A handle to the new node will be returned in `phGraphNode`.
19152    ///
19153    /// The CUDA_KERNEL_NODE_PARAMS structure is defined as:
19154    ///
19155    /// ```text
19156    /// typedef struct CUDA_KERNEL_NODE_PARAMS_st {
19157    /// CUfunction func;
19158    /// unsigned int gridDimX;
19159    /// unsigned int gridDimY;
19160    /// unsigned int gridDimZ;
19161    /// unsigned int blockDimX;
19162    /// unsigned int blockDimY;
19163    /// unsigned int blockDimZ;
19164    /// unsigned int sharedMemBytes;
19165    /// void **kernelParams;
19166    /// void **extra;
19167    /// CUkernel kern;
19168    /// CUcontext ctx;
19169    /// } CUDA_KERNEL_NODE_PARAMS;
19170    /// ```
19171    ///
19172    /// When the graph is launched, the node will invoke kernel `func` on a (`gridDimX` x `gridDimY` x `gridDimZ`) grid of blocks. Each block contains (`blockDimX` x `blockDimY` x `blockDimZ`) threads.
19173    ///
19174    /// `sharedMemBytes` sets the amount of dynamic shared memory that will be available to each thread block.
19175    ///
19176    /// Kernel parameters to `func` can be specified in one of two ways:
19177    ///
19178    /// 1) Kernel parameters can be specified via `kernelParams`. If the kernel has N parameters, then `kernelParams` needs to be an array of N pointers. Each pointer, from `kernelParams`\[0\] to `kernelParams`\[N-1\], points to the region of memory from which the actual parameter will be copied. The number of kernel parameters and their offsets and sizes do not need to be specified as that information is retrieved directly from the kernel’s image.
19179    ///
19180    /// 2) Kernel parameters for non-cooperative kernels can also be packaged by the application into a single buffer that is passed in via `extra`. This places the burden on the application of knowing each kernel parameter’s size and alignment/padding within the buffer. The `extra` parameter exists to allow this function to take additional less commonly used arguments. `extra` specifies a list of names of extra settings and their corresponding values. Each extra setting name is immediately followed by the corresponding value. The list must be terminated with either NULL or CU_LAUNCH_PARAM_END.
19181    ///
19182    /// * [CU_LAUNCH_PARAM_END](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__TYPES.html#group__cuda__types_1gad5c11cff5adfa5a69d66829399653532), which indicates the end of the `extra` array;
19183    /// * [CU_LAUNCH_PARAM_BUFFER_POINTER](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__TYPES.html#group__cuda__types_1ga36d10d0b40c51372877578a2cffd6acd), which specifies that the next value in `extra` will be a pointer to a buffer containing all the kernel parameters for launching kernel `func`;
19184    /// * [CU_LAUNCH_PARAM_BUFFER_SIZE](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__TYPES.html#group__cuda__types_1gaf339c057cd94562ead93a192e11c17e9), which specifies that the next value in `extra` will be a pointer to a size_t containing the size of the buffer specified with [CU_LAUNCH_PARAM_BUFFER_POINTER](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__TYPES.html#group__cuda__types_1ga36d10d0b40c51372877578a2cffd6acd);
19185    ///
19186    /// The error [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] will be returned if kernel parameters are specified with both `kernelParams` and `extra` (i.e. both `kernelParams` and `extra` are non-NULL). [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] will be returned if `extra` is used for a cooperative kernel.
19187    ///
19188    /// The `kernelParams` or `extra` array, as well as the argument values it points to, are copied during this call.
19189    ///
19190    /// Note: Kernels launched using graphs must not use texture and surface references. Reading or writing through any texture or surface reference is undefined behavior. This restriction does not apply to texture and surface objects.
19191    ///
19192    /// Note: Graph objects are not threadsafe. More here.
19193    ///
19194    /// Note that this function may also return error codes from previous, asynchronous launches.
19195    ///
19196    /// # Parameters
19197    ///
19198    /// - `phGraphNode`: Returns newly created node.
19199    /// - `hGraph`: Graph to which to add the node.
19200    /// - `dependencies`: Dependencies of the node.
19201    /// - `numDependencies`: Number of dependencies.
19202    /// - `nodeParams`: Parameters for the GPU execution node.
19203    ///
19204    /// # Return value
19205    ///
19206    /// - [`CUresult::CUDA_SUCCESS`]
19207    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
19208    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
19209    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19210    ///
19211    /// See also: [`cuGraphAddNode`], [`cuLaunchKernel`], [`cuLaunchCooperativeKernel`], [`cuGraphKernelNodeGetParams`], [`cuGraphKernelNodeSetParams`], [`cuGraphCreate`], [`cuGraphDestroyNode`], [`cuGraphAddChildGraphNode`], [`cuGraphAddEmptyNode`], [`cuGraphAddHostNode`], [`cuGraphAddMemcpyNode`], [`cuGraphAddMemsetNode`].
19212    pub fn cuGraphAddKernelNode_v2(
19213        phGraphNode: *mut CUgraphNode,
19214        hGraph: CUgraph,
19215        dependencies: *const CUgraphNode,
19216        numDependencies: size_t,
19217        nodeParams: *const CUDA_KERNEL_NODE_PARAMS,
19218    ) -> CUresult;
19219}
19220singe_loader::functions! { crate::DRIVER;
19221    /// Returns a kernel node’s parameters.
19222    ///
19223    /// Returns the parameters of kernel node `hNode` in `nodeParams`. The `kernelParams` or `extra` array returned in `nodeParams`, as well as the argument values it points to, are owned by the node. This memory remains valid until the node is destroyed or its parameters are modified, and should not be modified directly. Use cuGraphKernelNodeSetParams to update the parameters of this node.
19224    ///
19225    /// The params will contain either `kernelParams` or `extra`, according to which of these was most recently set on the node.
19226    ///
19227    /// Note: Graph objects are not threadsafe. More here.
19228    ///
19229    /// Note that this function may also return error codes from previous, asynchronous launches.
19230    ///
19231    /// # Parameters
19232    ///
19233    /// - `hNode`: Node to get the parameters for.
19234    /// - `nodeParams`: Pointer to return the parameters.
19235    ///
19236    /// # Return value
19237    ///
19238    /// - [`CUresult::CUDA_SUCCESS`]
19239    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
19240    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
19241    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19242    ///
19243    /// See also: [`cuGraphNodeGetParams`], [`cuLaunchKernel`], [`cuGraphAddKernelNode`], [`cuGraphKernelNodeSetParams`].
19244    pub fn cuGraphKernelNodeGetParams_v2(
19245        hNode: CUgraphNode,
19246        nodeParams: *mut CUDA_KERNEL_NODE_PARAMS,
19247    ) -> CUresult;
19248}
19249singe_loader::functions! { crate::DRIVER;
19250    /// Sets a kernel node’s parameters.
19251    ///
19252    /// Sets the parameters of kernel node `hNode` to `nodeParams`.
19253    ///
19254    /// Note: Graph objects are not threadsafe. More here.
19255    ///
19256    /// Note that this function may also return error codes from previous, asynchronous launches.
19257    ///
19258    /// # Parameters
19259    ///
19260    /// - `hNode`: Node to set the parameters for.
19261    /// - `nodeParams`: Parameters to copy.
19262    ///
19263    /// # Return value
19264    ///
19265    /// - [`CUresult::CUDA_SUCCESS`]
19266    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19267    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
19268    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
19269    ///
19270    /// See also: [`cuGraphNodeSetParams`], [`cuLaunchKernel`], [`cuGraphAddKernelNode`], [`cuGraphKernelNodeGetParams`].
19271    pub fn cuGraphKernelNodeSetParams_v2(
19272        hNode: CUgraphNode,
19273        nodeParams: *const CUDA_KERNEL_NODE_PARAMS,
19274    ) -> CUresult;
19275}
19276singe_loader::functions! { crate::DRIVER;
19277    /// Creates a memcpy node and adds it to a graph.
19278    ///
19279    /// Creates a new memcpy node and adds it to `hGraph` with `numDependencies` dependencies specified via `dependencies`. It is possible for `numDependencies` to be 0, in which case the node will be placed at the root of the graph. `dependencies` may not have any duplicate entries. A handle to the new node will be returned in `phGraphNode`.
19280    ///
19281    /// When the graph is launched, the node will perform the memcpy described by `copyParams`. See cuMemcpy3D() for a description of the structure and its restrictions.
19282    ///
19283    /// Memcpy nodes have some additional restrictions with regards to managed memory, if the system contains at least one device which has a zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`]. If one or more of the operands refer to managed memory, then using the memory type [`CUmemorytype_enum::CU_MEMORYTYPE_UNIFIED`] is disallowed for those operand(s). The managed memory will be treated as residing on either the host or the device, depending on which memory type is specified.
19284    ///
19285    /// Note: Graph objects are not threadsafe. More here.
19286    ///
19287    /// Note that this function may also return error codes from previous, asynchronous launches.
19288    ///
19289    /// # Parameters
19290    ///
19291    /// - `phGraphNode`: Returns newly created node.
19292    /// - `hGraph`: Graph to which to add the node.
19293    /// - `dependencies`: Dependencies of the node.
19294    /// - `numDependencies`: Number of dependencies.
19295    /// - `copyParams`: Parameters for the memory copy.
19296    /// - `ctx`: Context on which to run the node.
19297    ///
19298    /// # Return value
19299    ///
19300    /// - [`CUresult::CUDA_SUCCESS`]
19301    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
19302    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
19303    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19304    ///
19305    /// See also: [`cuGraphAddNode`], [`cuMemcpy3D`], [`cuGraphMemcpyNodeGetParams`], [`cuGraphMemcpyNodeSetParams`], [`cuGraphCreate`], [`cuGraphDestroyNode`], [`cuGraphAddChildGraphNode`], [`cuGraphAddEmptyNode`], [`cuGraphAddKernelNode`], [`cuGraphAddHostNode`], [`cuGraphAddMemsetNode`].
19306    pub fn cuGraphAddMemcpyNode(
19307        phGraphNode: *mut CUgraphNode,
19308        hGraph: CUgraph,
19309        dependencies: *const CUgraphNode,
19310        numDependencies: size_t,
19311        copyParams: *const CUDA_MEMCPY3D,
19312        ctx: CUcontext,
19313    ) -> CUresult;
19314}
19315singe_loader::functions! { crate::DRIVER;
19316    /// Returns a memcpy node’s parameters.
19317    ///
19318    /// Returns the parameters of memcpy node `hNode` in `nodeParams`.
19319    ///
19320    /// Note: Graph objects are not threadsafe. More here.
19321    ///
19322    /// Note that this function may also return error codes from previous, asynchronous launches.
19323    ///
19324    /// # Parameters
19325    ///
19326    /// - `hNode`: Node to get the parameters for.
19327    /// - `nodeParams`: Pointer to return the parameters.
19328    ///
19329    /// # Return value
19330    ///
19331    /// - [`CUresult::CUDA_SUCCESS`]
19332    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
19333    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
19334    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19335    ///
19336    /// See also: [`cuGraphNodeGetParams`], [`cuMemcpy3D`], [`cuGraphAddMemcpyNode`], [`cuGraphMemcpyNodeSetParams`].
19337    pub fn cuGraphMemcpyNodeGetParams(
19338        hNode: CUgraphNode,
19339        nodeParams: *mut CUDA_MEMCPY3D,
19340    ) -> CUresult;
19341}
19342singe_loader::functions! { crate::DRIVER;
19343    /// Sets a memcpy node’s parameters.
19344    ///
19345    /// Sets the parameters of memcpy node `hNode` to `nodeParams`.
19346    ///
19347    /// Note: Graph objects are not threadsafe. More here.
19348    ///
19349    /// Note that this function may also return error codes from previous, asynchronous launches.
19350    ///
19351    /// # Parameters
19352    ///
19353    /// - `hNode`: Node to set the parameters for.
19354    /// - `nodeParams`: Parameters to copy.
19355    ///
19356    /// # Return value
19357    ///
19358    /// - [`CUresult::CUDA_SUCCESS`]
19359    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
19360    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
19361    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19362    ///
19363    /// See also: [`cuGraphNodeSetParams`], [`cuMemcpy3D`], [`cuGraphAddMemcpyNode`], [`cuGraphMemcpyNodeGetParams`].
19364    pub fn cuGraphMemcpyNodeSetParams(
19365        hNode: CUgraphNode,
19366        nodeParams: *const CUDA_MEMCPY3D,
19367    ) -> CUresult;
19368}
19369singe_loader::functions! { crate::DRIVER;
19370    /// Creates a memset node and adds it to a graph.
19371    ///
19372    /// Creates a new memset node and adds it to `hGraph` with `numDependencies` dependencies specified via `dependencies`. It is possible for `numDependencies` to be 0, in which case the node will be placed at the root of the graph. `dependencies` may not have any duplicate entries. A handle to the new node will be returned in `phGraphNode`.
19373    ///
19374    /// The element size must be 1, 2, or 4 bytes. When the graph is launched, the node will perform the memset described by `memsetParams`.
19375    ///
19376    /// Note: Graph objects are not threadsafe. More here.
19377    ///
19378    /// Note that this function may also return error codes from previous, asynchronous launches.
19379    ///
19380    /// # Parameters
19381    ///
19382    /// - `phGraphNode`: Returns newly created node.
19383    /// - `hGraph`: Graph to which to add the node.
19384    /// - `dependencies`: Dependencies of the node.
19385    /// - `numDependencies`: Number of dependencies.
19386    /// - `memsetParams`: Parameters for the memory set.
19387    /// - `ctx`: Context on which to run the node.
19388    ///
19389    /// # Return value
19390    ///
19391    /// - [`CUresult::CUDA_SUCCESS`]
19392    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
19393    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
19394    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19395    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
19396    ///
19397    /// See also: [`cuGraphAddNode`], [`cuMemsetD2D32`], [`cuGraphMemsetNodeGetParams`], [`cuGraphMemsetNodeSetParams`], [`cuGraphCreate`], [`cuGraphDestroyNode`], [`cuGraphAddChildGraphNode`], [`cuGraphAddEmptyNode`], [`cuGraphAddKernelNode`], [`cuGraphAddHostNode`], [`cuGraphAddMemcpyNode`].
19398    pub fn cuGraphAddMemsetNode(
19399        phGraphNode: *mut CUgraphNode,
19400        hGraph: CUgraph,
19401        dependencies: *const CUgraphNode,
19402        numDependencies: size_t,
19403        memsetParams: *const CUDA_MEMSET_NODE_PARAMS,
19404        ctx: CUcontext,
19405    ) -> CUresult;
19406}
19407singe_loader::functions! { crate::DRIVER;
19408    /// Returns a memset node’s parameters.
19409    ///
19410    /// Returns the parameters of memset node `hNode` in `nodeParams`.
19411    ///
19412    /// Note: Graph objects are not threadsafe. More here.
19413    ///
19414    /// Note that this function may also return error codes from previous, asynchronous launches.
19415    ///
19416    /// # Parameters
19417    ///
19418    /// - `hNode`: Node to get the parameters for.
19419    /// - `nodeParams`: Pointer to return the parameters.
19420    ///
19421    /// # Return value
19422    ///
19423    /// - [`CUresult::CUDA_SUCCESS`]
19424    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
19425    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
19426    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19427    ///
19428    /// See also: [`cuGraphNodeGetParams`], [`cuMemsetD2D32`], [`cuGraphAddMemsetNode`], [`cuGraphMemsetNodeSetParams`].
19429    pub fn cuGraphMemsetNodeGetParams(
19430        hNode: CUgraphNode,
19431        nodeParams: *mut CUDA_MEMSET_NODE_PARAMS,
19432    ) -> CUresult;
19433}
19434singe_loader::functions! { crate::DRIVER;
19435    /// Sets a memset node’s parameters.
19436    ///
19437    /// Sets the parameters of memset node `hNode` to `nodeParams`.
19438    ///
19439    /// Note: Graph objects are not threadsafe. More here.
19440    ///
19441    /// Note that this function may also return error codes from previous, asynchronous launches.
19442    ///
19443    /// # Parameters
19444    ///
19445    /// - `hNode`: Node to set the parameters for.
19446    /// - `nodeParams`: Parameters to copy.
19447    ///
19448    /// # Return value
19449    ///
19450    /// - [`CUresult::CUDA_SUCCESS`]
19451    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
19452    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
19453    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19454    ///
19455    /// See also: [`cuGraphNodeSetParams`], [`cuMemsetD2D32`], [`cuGraphAddMemsetNode`], [`cuGraphMemsetNodeGetParams`].
19456    pub fn cuGraphMemsetNodeSetParams(
19457        hNode: CUgraphNode,
19458        nodeParams: *const CUDA_MEMSET_NODE_PARAMS,
19459    ) -> CUresult;
19460}
19461singe_loader::functions! { crate::DRIVER;
19462    /// Creates a host execution node and adds it to a graph.
19463    ///
19464    /// Creates a new CPU execution node and adds it to `hGraph` with `numDependencies` dependencies specified via `dependencies` and arguments specified in `nodeParams`. It is possible for `numDependencies` to be 0, in which case the node will be placed at the root of the graph. `dependencies` may not have any duplicate entries. A handle to the new node will be returned in `phGraphNode`.
19465    ///
19466    /// When the graph is launched, the node will invoke the specified CPU function. Host nodes are not supported under MPS with pre-Volta GPUs.
19467    ///
19468    /// Note: Graph objects are not threadsafe. More here.
19469    ///
19470    /// Note that this function may also return error codes from previous, asynchronous launches.
19471    ///
19472    /// # Parameters
19473    ///
19474    /// - `phGraphNode`: Returns newly created node.
19475    /// - `hGraph`: Graph to which to add the node.
19476    /// - `dependencies`: Dependencies of the node.
19477    /// - `numDependencies`: Number of dependencies.
19478    /// - `nodeParams`: Parameters for the host node.
19479    ///
19480    /// # Return value
19481    ///
19482    /// - [`CUresult::CUDA_SUCCESS`]
19483    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
19484    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
19485    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
19486    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19487    ///
19488    /// See also: [`cuGraphAddNode`], [`cuLaunchHostFunc`], [`cuGraphHostNodeGetParams`], [`cuGraphHostNodeSetParams`], [`cuGraphCreate`], [`cuGraphDestroyNode`], [`cuGraphAddChildGraphNode`], [`cuGraphAddEmptyNode`], [`cuGraphAddKernelNode`], [`cuGraphAddMemcpyNode`], [`cuGraphAddMemsetNode`].
19489    pub fn cuGraphAddHostNode(
19490        phGraphNode: *mut CUgraphNode,
19491        hGraph: CUgraph,
19492        dependencies: *const CUgraphNode,
19493        numDependencies: size_t,
19494        nodeParams: *const CUDA_HOST_NODE_PARAMS,
19495    ) -> CUresult;
19496}
19497singe_loader::functions! { crate::DRIVER;
19498    /// Returns a host node’s parameters.
19499    ///
19500    /// Returns the parameters of host node `hNode` in `nodeParams`.
19501    ///
19502    /// Note: Graph objects are not threadsafe. More here.
19503    ///
19504    /// Note that this function may also return error codes from previous, asynchronous launches.
19505    ///
19506    /// # Parameters
19507    ///
19508    /// - `hNode`: Node to get the parameters for.
19509    /// - `nodeParams`: Pointer to return the parameters.
19510    ///
19511    /// # Return value
19512    ///
19513    /// - [`CUresult::CUDA_SUCCESS`]
19514    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
19515    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
19516    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19517    ///
19518    /// See also: [`cuGraphNodeGetParams`], [`cuLaunchHostFunc`], [`cuGraphAddHostNode`], [`cuGraphHostNodeSetParams`].
19519    pub fn cuGraphHostNodeGetParams(
19520        hNode: CUgraphNode,
19521        nodeParams: *mut CUDA_HOST_NODE_PARAMS,
19522    ) -> CUresult;
19523}
19524singe_loader::functions! { crate::DRIVER;
19525    /// Sets a host node’s parameters.
19526    ///
19527    /// Sets the parameters of host node `hNode` to `nodeParams`.
19528    ///
19529    /// Note: Graph objects are not threadsafe. More here.
19530    ///
19531    /// Note that this function may also return error codes from previous, asynchronous launches.
19532    ///
19533    /// # Parameters
19534    ///
19535    /// - `hNode`: Node to set the parameters for.
19536    /// - `nodeParams`: Parameters to copy.
19537    ///
19538    /// # Return value
19539    ///
19540    /// - [`CUresult::CUDA_SUCCESS`]
19541    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
19542    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
19543    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19544    ///
19545    /// See also: [`cuGraphNodeSetParams`], [`cuLaunchHostFunc`], [`cuGraphAddHostNode`], [`cuGraphHostNodeGetParams`].
19546    pub fn cuGraphHostNodeSetParams(
19547        hNode: CUgraphNode,
19548        nodeParams: *const CUDA_HOST_NODE_PARAMS,
19549    ) -> CUresult;
19550}
19551singe_loader::functions! { crate::DRIVER;
19552    /// Creates a child graph node and adds it to a graph.
19553    ///
19554    /// Creates a new node which executes an embedded graph, and adds it to `hGraph` with `numDependencies` dependencies specified via `dependencies`. It is possible for `numDependencies` to be 0, in which case the node will be placed at the root of the graph. `dependencies` may not have any duplicate entries. A handle to the new node will be returned in `phGraphNode`.
19555    ///
19556    /// If `childGraph` contains allocation nodes, free nodes, or conditional nodes, this call will return an error.
19557    ///
19558    /// The node executes an embedded child graph. The child graph is cloned in this call.
19559    ///
19560    /// Note: Graph objects are not threadsafe. More here.
19561    ///
19562    /// Note that this function may also return error codes from previous, asynchronous launches.
19563    ///
19564    /// # Parameters
19565    ///
19566    /// - `phGraphNode`: Returns newly created node.
19567    /// - `hGraph`: Graph to which to add the node.
19568    /// - `dependencies`: Dependencies of the node.
19569    /// - `numDependencies`: Number of dependencies.
19570    /// - `childGraph`: The graph to clone into this node.
19571    ///
19572    /// # Return value
19573    ///
19574    /// - [`CUresult::CUDA_SUCCESS`]
19575    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
19576    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
19577    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19578    ///
19579    /// See also: [`cuGraphAddNode`], [`cuGraphChildGraphNodeGetGraph`], [`cuGraphCreate`], [`cuGraphDestroyNode`], [`cuGraphAddEmptyNode`], [`cuGraphAddKernelNode`], [`cuGraphAddHostNode`], [`cuGraphAddMemcpyNode`], [`cuGraphAddMemsetNode`], [`cuGraphClone`].
19580    pub fn cuGraphAddChildGraphNode(
19581        phGraphNode: *mut CUgraphNode,
19582        hGraph: CUgraph,
19583        dependencies: *const CUgraphNode,
19584        numDependencies: size_t,
19585        childGraph: CUgraph,
19586    ) -> CUresult;
19587}
19588singe_loader::functions! { crate::DRIVER;
19589    /// Gets a handle to the embedded graph of a child graph node.
19590    ///
19591    /// Gets a handle to the embedded graph in a child graph node. This call does not clone the graph. Changes to the graph will be reflected in the node, and the node retains ownership of the graph.
19592    ///
19593    /// Allocation and free nodes cannot be added to the returned graph. Attempting to do so will return an error.
19594    ///
19595    /// Note: Graph objects are not threadsafe. More here.
19596    ///
19597    /// Note that this function may also return error codes from previous, asynchronous launches.
19598    ///
19599    /// # Parameters
19600    ///
19601    /// - `hNode`: Node to get the embedded graph for.
19602    /// - `phGraph`: Location to store a handle to the graph.
19603    ///
19604    /// # Return value
19605    ///
19606    /// - [`CUresult::CUDA_SUCCESS`]
19607    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
19608    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
19609    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19610    ///
19611    /// See also: [`cuGraphAddChildGraphNode`], [`cuGraphNodeFindInClone`].
19612    pub fn cuGraphChildGraphNodeGetGraph(
19613        hNode: CUgraphNode,
19614        phGraph: *mut CUgraph,
19615    ) -> CUresult;
19616}
19617singe_loader::functions! { crate::DRIVER;
19618    /// Creates an empty node and adds it to a graph.
19619    ///
19620    /// Creates a new node which performs no operation, and adds it to `hGraph` with `numDependencies` dependencies specified via `dependencies`. It is possible for `numDependencies` to be 0, in which case the node will be placed at the root of the graph. `dependencies` may not have any duplicate entries. A handle to the new node will be returned in `phGraphNode`.
19621    ///
19622    /// An empty node performs no operation during execution, but can be used for transitive ordering. For example, a phased execution graph with 2 groups of n nodes with a barrier between them can be represented using an empty node and 2\*n dependency edges, rather than no empty node and n^2 dependency edges.
19623    ///
19624    /// Note: Graph objects are not threadsafe. More here.
19625    ///
19626    /// Note that this function may also return error codes from previous, asynchronous launches.
19627    ///
19628    /// # Parameters
19629    ///
19630    /// - `phGraphNode`: Returns newly created node.
19631    /// - `hGraph`: Graph to which to add the node.
19632    /// - `dependencies`: Dependencies of the node.
19633    /// - `numDependencies`: Number of dependencies.
19634    ///
19635    /// # Return value
19636    ///
19637    /// - [`CUresult::CUDA_SUCCESS`]
19638    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
19639    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
19640    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19641    ///
19642    /// See also: [`cuGraphAddNode`], [`cuGraphCreate`], [`cuGraphDestroyNode`], [`cuGraphAddChildGraphNode`], [`cuGraphAddKernelNode`], [`cuGraphAddHostNode`], [`cuGraphAddMemcpyNode`], [`cuGraphAddMemsetNode`].
19643    pub fn cuGraphAddEmptyNode(
19644        phGraphNode: *mut CUgraphNode,
19645        hGraph: CUgraph,
19646        dependencies: *const CUgraphNode,
19647        numDependencies: size_t,
19648    ) -> CUresult;
19649}
19650singe_loader::functions! { crate::DRIVER;
19651    /// Creates an event record node and adds it to a graph.
19652    ///
19653    /// Creates a new event record node and adds it to `hGraph` with `numDependencies` dependencies specified via `dependencies` and event specified in `event`. It is possible for `numDependencies` to be 0, in which case the node will be placed at the root of the graph. `dependencies` may not have any duplicate entries. A handle to the new node will be returned in `phGraphNode`.
19654    ///
19655    /// Each launch of the graph will record `event` to capture execution of the node’s dependencies.
19656    ///
19657    /// Note: Graph objects are not threadsafe. More here.
19658    ///
19659    /// Note that this function may also return error codes from previous, asynchronous launches.
19660    ///
19661    /// # Parameters
19662    ///
19663    /// - `phGraphNode`: Returns newly created node.
19664    /// - `hGraph`: Graph to which to add the node.
19665    /// - `dependencies`: Dependencies of the node.
19666    /// - `numDependencies`: Number of dependencies.
19667    /// - `event`: Event for the node.
19668    ///
19669    /// # Return value
19670    ///
19671    /// - [`CUresult::CUDA_SUCCESS`]
19672    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
19673    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
19674    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
19675    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19676    ///
19677    /// See also: [`cuGraphAddNode`], [`cuGraphAddEventWaitNode`], [`cuEventRecordWithFlags`], [`cuStreamWaitEvent`], [`cuGraphCreate`], [`cuGraphDestroyNode`], [`cuGraphAddChildGraphNode`], [`cuGraphAddEmptyNode`], [`cuGraphAddKernelNode`], [`cuGraphAddMemcpyNode`], [`cuGraphAddMemsetNode`].
19678    pub fn cuGraphAddEventRecordNode(
19679        phGraphNode: *mut CUgraphNode,
19680        hGraph: CUgraph,
19681        dependencies: *const CUgraphNode,
19682        numDependencies: size_t,
19683        event: CUevent,
19684    ) -> CUresult;
19685}
19686singe_loader::functions! { crate::DRIVER;
19687    /// Returns the event associated with an event record node.
19688    ///
19689    /// Returns the event of event record node `hNode` in `event_out`.
19690    ///
19691    /// Note: Graph objects are not threadsafe. More here.
19692    ///
19693    /// Note that this function may also return error codes from previous, asynchronous launches.
19694    ///
19695    /// # Parameters
19696    ///
19697    /// - `hNode`: Node to get the event for.
19698    /// - `event_out`: Pointer to return the event.
19699    ///
19700    /// # Return value
19701    ///
19702    /// - [`CUresult::CUDA_SUCCESS`]
19703    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
19704    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
19705    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19706    ///
19707    /// See also: [`cuGraphAddEventRecordNode`], [`cuGraphEventRecordNodeSetEvent`], [`cuGraphEventWaitNodeGetEvent`], [`cuEventRecordWithFlags`], [`cuStreamWaitEvent`].
19708    pub fn cuGraphEventRecordNodeGetEvent(
19709        hNode: CUgraphNode,
19710        event_out: *mut CUevent,
19711    ) -> CUresult;
19712}
19713singe_loader::functions! { crate::DRIVER;
19714    /// Sets an event record node’s event.
19715    ///
19716    /// Sets the event of event record node `hNode` to `event`.
19717    ///
19718    /// Note: This function will reset the node’s context to the event’s device context.
19719    ///
19720    /// Note: Graph objects are not threadsafe. More here.
19721    ///
19722    /// Note that this function may also return error codes from previous, asynchronous launches.
19723    ///
19724    /// # Parameters
19725    ///
19726    /// - `hNode`: Node to set the event for.
19727    /// - `event`: Event to use.
19728    ///
19729    /// # Return value
19730    ///
19731    /// - [`CUresult::CUDA_SUCCESS`]
19732    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19733    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
19734    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
19735    ///
19736    /// See also: [`cuGraphNodeSetParams`], [`cuGraphAddEventRecordNode`], [`cuGraphEventRecordNodeGetEvent`], [`cuGraphEventWaitNodeSetEvent`], [`cuEventRecordWithFlags`], [`cuStreamWaitEvent`].
19737    pub fn cuGraphEventRecordNodeSetEvent(
19738        hNode: CUgraphNode,
19739        event: CUevent,
19740    ) -> CUresult;
19741}
19742singe_loader::functions! { crate::DRIVER;
19743    /// Creates an event wait node and adds it to a graph.
19744    ///
19745    /// Creates a new event wait node and adds it to `hGraph` with `numDependencies` dependencies specified via `dependencies` and event specified in `event`. It is possible for `numDependencies` to be 0, in which case the node will be placed at the root of the graph. `dependencies` may not have any duplicate entries. A handle to the new node will be returned in `phGraphNode`.
19746    ///
19747    /// The graph node will wait for all work captured in `event`. See [`cuEventRecord`] for details on what is captured by an event. `event` may be from a different context or device than the launch stream.
19748    ///
19749    /// Note: Graph objects are not threadsafe. More here.
19750    ///
19751    /// Note that this function may also return error codes from previous, asynchronous launches.
19752    ///
19753    /// # Parameters
19754    ///
19755    /// - `phGraphNode`: Returns newly created node.
19756    /// - `hGraph`: Graph to which to add the node.
19757    /// - `dependencies`: Dependencies of the node.
19758    /// - `numDependencies`: Number of dependencies.
19759    /// - `event`: Event for the node.
19760    ///
19761    /// # Return value
19762    ///
19763    /// - [`CUresult::CUDA_SUCCESS`]
19764    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
19765    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
19766    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
19767    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19768    ///
19769    /// See also: [`cuGraphAddNode`], [`cuGraphAddEventRecordNode`], [`cuEventRecordWithFlags`], [`cuStreamWaitEvent`], [`cuGraphCreate`], [`cuGraphDestroyNode`], [`cuGraphAddChildGraphNode`], [`cuGraphAddEmptyNode`], [`cuGraphAddKernelNode`], [`cuGraphAddMemcpyNode`], [`cuGraphAddMemsetNode`].
19770    pub fn cuGraphAddEventWaitNode(
19771        phGraphNode: *mut CUgraphNode,
19772        hGraph: CUgraph,
19773        dependencies: *const CUgraphNode,
19774        numDependencies: size_t,
19775        event: CUevent,
19776    ) -> CUresult;
19777}
19778singe_loader::functions! { crate::DRIVER;
19779    /// Returns the event associated with an event wait node.
19780    ///
19781    /// Returns the event of event wait node `hNode` in `event_out`.
19782    ///
19783    /// Note: Graph objects are not threadsafe. More here.
19784    ///
19785    /// Note that this function may also return error codes from previous, asynchronous launches.
19786    ///
19787    /// # Parameters
19788    ///
19789    /// - `hNode`: Node to get the event for.
19790    /// - `event_out`: Pointer to return the event.
19791    ///
19792    /// # Return value
19793    ///
19794    /// - [`CUresult::CUDA_SUCCESS`]
19795    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
19796    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
19797    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19798    ///
19799    /// See also: [`cuGraphAddEventWaitNode`], [`cuGraphEventWaitNodeSetEvent`], [`cuGraphEventRecordNodeGetEvent`], [`cuEventRecordWithFlags`], [`cuStreamWaitEvent`].
19800    pub fn cuGraphEventWaitNodeGetEvent(
19801        hNode: CUgraphNode,
19802        event_out: *mut CUevent,
19803    ) -> CUresult;
19804}
19805singe_loader::functions! { crate::DRIVER;
19806    /// Sets an event wait node’s event.
19807    ///
19808    /// Sets the event of event wait node `hNode` to `event`.
19809    ///
19810    /// Note: Graph objects are not threadsafe. More here.
19811    ///
19812    /// Note that this function may also return error codes from previous, asynchronous launches.
19813    ///
19814    /// # Parameters
19815    ///
19816    /// - `hNode`: Node to set the event for.
19817    /// - `event`: Event to use.
19818    ///
19819    /// # Return value
19820    ///
19821    /// - [`CUresult::CUDA_SUCCESS`]
19822    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19823    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
19824    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
19825    ///
19826    /// See also: [`cuGraphNodeSetParams`], [`cuGraphAddEventWaitNode`], [`cuGraphEventWaitNodeGetEvent`], [`cuGraphEventRecordNodeSetEvent`], [`cuEventRecordWithFlags`], [`cuStreamWaitEvent`].
19827    pub fn cuGraphEventWaitNodeSetEvent(hNode: CUgraphNode, event: CUevent) -> CUresult;
19828}
19829singe_loader::functions! { crate::DRIVER;
19830    /// Creates an external semaphore signal node and adds it to a graph.
19831    ///
19832    /// Creates a new external semaphore signal node and adds it to `hGraph` with `numDependencies` dependencies specified via `dependencies` and arguments specified in `nodeParams`. It is possible for `numDependencies` to be 0, in which case the node will be placed at the root of the graph. `dependencies` may not have any duplicate entries. A handle to the new node will be returned in `phGraphNode`.
19833    ///
19834    /// Performs a signal operation on a set of externally allocated semaphore objects when the node is launched. The operation(s) will occur after all of the node’s dependencies have completed.
19835    ///
19836    /// Note: Graph objects are not threadsafe. More here.
19837    ///
19838    /// Note that this function may also return error codes from previous, asynchronous launches.
19839    ///
19840    /// # Parameters
19841    ///
19842    /// - `phGraphNode`: Returns newly created node.
19843    /// - `hGraph`: Graph to which to add the node.
19844    /// - `dependencies`: Dependencies of the node.
19845    /// - `numDependencies`: Number of dependencies.
19846    /// - `nodeParams`: Parameters for the node.
19847    ///
19848    /// # Return value
19849    ///
19850    /// - [`CUresult::CUDA_SUCCESS`]
19851    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
19852    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
19853    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
19854    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19855    ///
19856    /// See also: [`cuGraphAddNode`], [`cuGraphExternalSemaphoresSignalNodeGetParams`], [`cuGraphExternalSemaphoresSignalNodeSetParams`], [`cuGraphExecExternalSemaphoresSignalNodeSetParams`], [`cuGraphAddExternalSemaphoresWaitNode`], [`cuImportExternalSemaphore`], [`cuSignalExternalSemaphoresAsync`], [`cuWaitExternalSemaphoresAsync`], [`cuGraphCreate`], [`cuGraphDestroyNode`], [`cuGraphAddEventRecordNode`], [`cuGraphAddEventWaitNode`], [`cuGraphAddChildGraphNode`], [`cuGraphAddEmptyNode`], [`cuGraphAddKernelNode`], [`cuGraphAddMemcpyNode`], [`cuGraphAddMemsetNode`].
19857    pub fn cuGraphAddExternalSemaphoresSignalNode(
19858        phGraphNode: *mut CUgraphNode,
19859        hGraph: CUgraph,
19860        dependencies: *const CUgraphNode,
19861        numDependencies: size_t,
19862        nodeParams: *const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS,
19863    ) -> CUresult;
19864}
19865singe_loader::functions! { crate::DRIVER;
19866    /// Returns an external semaphore signal node’s parameters.
19867    ///
19868    /// Returns the parameters of an external semaphore signal node `hNode` in `params_out`. The `extSemArray` and `paramsArray` returned in `params_out`, are owned by the node. This memory remains valid until the node is destroyed or its parameters are modified, and should not be modified directly. Use [`cuGraphExternalSemaphoresSignalNodeSetParams`] to update the parameters of this node.
19869    ///
19870    /// Note: Graph objects are not threadsafe. More here.
19871    ///
19872    /// Note that this function may also return error codes from previous, asynchronous launches.
19873    ///
19874    /// # Parameters
19875    ///
19876    /// - `hNode`: Node to get the parameters for.
19877    /// - `params_out`: Pointer to return the parameters.
19878    ///
19879    /// # Return value
19880    ///
19881    /// - [`CUresult::CUDA_SUCCESS`]
19882    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
19883    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
19884    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19885    ///
19886    /// See also: [`cuGraphNodeGetParams`], [`cuLaunchKernel`], [`cuGraphAddExternalSemaphoresSignalNode`], [`cuGraphExternalSemaphoresSignalNodeSetParams`], [`cuGraphAddExternalSemaphoresWaitNode`], [`cuSignalExternalSemaphoresAsync`], [`cuWaitExternalSemaphoresAsync`].
19887    pub fn cuGraphExternalSemaphoresSignalNodeGetParams(
19888        hNode: CUgraphNode,
19889        params_out: *mut CUDA_EXT_SEM_SIGNAL_NODE_PARAMS,
19890    ) -> CUresult;
19891}
19892singe_loader::functions! { crate::DRIVER;
19893    /// Sets an external semaphore signal node’s parameters.
19894    ///
19895    /// Sets the parameters of an external semaphore signal node `hNode` to `nodeParams`.
19896    ///
19897    /// Note: Graph objects are not threadsafe. More here.
19898    ///
19899    /// Note that this function may also return error codes from previous, asynchronous launches.
19900    ///
19901    /// # Parameters
19902    ///
19903    /// - `hNode`: Node to set the parameters for.
19904    /// - `nodeParams`: Parameters to copy.
19905    ///
19906    /// # Return value
19907    ///
19908    /// - [`CUresult::CUDA_SUCCESS`]
19909    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19910    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
19911    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
19912    ///
19913    /// See also: [`cuGraphNodeSetParams`], [`cuGraphAddExternalSemaphoresSignalNode`], [`cuGraphAddExternalSemaphoresWaitNode`], [`cuSignalExternalSemaphoresAsync`], [`cuWaitExternalSemaphoresAsync`].
19914    pub fn cuGraphExternalSemaphoresSignalNodeSetParams(
19915        hNode: CUgraphNode,
19916        nodeParams: *const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS,
19917    ) -> CUresult;
19918}
19919singe_loader::functions! { crate::DRIVER;
19920    /// Creates an external semaphore wait node and adds it to a graph.
19921    ///
19922    /// Creates a new external semaphore wait node and adds it to `hGraph` with `numDependencies` dependencies specified via `dependencies` and arguments specified in `nodeParams`. It is possible for `numDependencies` to be 0, in which case the node will be placed at the root of the graph. `dependencies` may not have any duplicate entries. A handle to the new node will be returned in `phGraphNode`.
19923    ///
19924    /// Performs a wait operation on a set of externally allocated semaphore objects when the node is launched. The node’s dependencies will not be launched until the wait operation has completed.
19925    ///
19926    /// Note: Graph objects are not threadsafe. More here.
19927    ///
19928    /// Note that this function may also return error codes from previous, asynchronous launches.
19929    ///
19930    /// # Parameters
19931    ///
19932    /// - `phGraphNode`: Returns newly created node.
19933    /// - `hGraph`: Graph to which to add the node.
19934    /// - `dependencies`: Dependencies of the node.
19935    /// - `numDependencies`: Number of dependencies.
19936    /// - `nodeParams`: Parameters for the node.
19937    ///
19938    /// # Return value
19939    ///
19940    /// - [`CUresult::CUDA_SUCCESS`]
19941    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
19942    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
19943    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
19944    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19945    ///
19946    /// See also: [`cuGraphAddNode`], [`cuGraphExternalSemaphoresWaitNodeGetParams`], [`cuGraphExternalSemaphoresWaitNodeSetParams`], [`cuGraphExecExternalSemaphoresWaitNodeSetParams`], [`cuGraphAddExternalSemaphoresSignalNode`], [`cuImportExternalSemaphore`], [`cuSignalExternalSemaphoresAsync`], [`cuWaitExternalSemaphoresAsync`], [`cuGraphCreate`], [`cuGraphDestroyNode`], [`cuGraphAddEventRecordNode`], [`cuGraphAddEventWaitNode`], [`cuGraphAddChildGraphNode`], [`cuGraphAddEmptyNode`], [`cuGraphAddKernelNode`], [`cuGraphAddMemcpyNode`], [`cuGraphAddMemsetNode`].
19947    pub fn cuGraphAddExternalSemaphoresWaitNode(
19948        phGraphNode: *mut CUgraphNode,
19949        hGraph: CUgraph,
19950        dependencies: *const CUgraphNode,
19951        numDependencies: size_t,
19952        nodeParams: *const CUDA_EXT_SEM_WAIT_NODE_PARAMS,
19953    ) -> CUresult;
19954}
19955singe_loader::functions! { crate::DRIVER;
19956    /// Returns an external semaphore wait node’s parameters.
19957    ///
19958    /// Returns the parameters of an external semaphore wait node `hNode` in `params_out`. The `extSemArray` and `paramsArray` returned in `params_out`, are owned by the node. This memory remains valid until the node is destroyed or its parameters are modified, and should not be modified directly. Use [`cuGraphExternalSemaphoresSignalNodeSetParams`] to update the parameters of this node.
19959    ///
19960    /// Note: Graph objects are not threadsafe. More here.
19961    ///
19962    /// Note that this function may also return error codes from previous, asynchronous launches.
19963    ///
19964    /// # Parameters
19965    ///
19966    /// - `hNode`: Node to get the parameters for.
19967    /// - `params_out`: Pointer to return the parameters.
19968    ///
19969    /// # Return value
19970    ///
19971    /// - [`CUresult::CUDA_SUCCESS`]
19972    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
19973    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
19974    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
19975    ///
19976    /// See also: [`cuGraphNodeGetParams`], [`cuLaunchKernel`], [`cuGraphAddExternalSemaphoresWaitNode`], [`cuGraphExternalSemaphoresWaitNodeSetParams`], [`cuSignalExternalSemaphoresAsync`], [`cuWaitExternalSemaphoresAsync`].
19977    pub fn cuGraphExternalSemaphoresWaitNodeGetParams(
19978        hNode: CUgraphNode,
19979        params_out: *mut CUDA_EXT_SEM_WAIT_NODE_PARAMS,
19980    ) -> CUresult;
19981}
19982singe_loader::functions! { crate::DRIVER;
19983    /// Sets an external semaphore wait node’s parameters.
19984    ///
19985    /// Sets the parameters of an external semaphore wait node `hNode` to `nodeParams`.
19986    ///
19987    /// Note: Graph objects are not threadsafe. More here.
19988    ///
19989    /// Note that this function may also return error codes from previous, asynchronous launches.
19990    ///
19991    /// # Parameters
19992    ///
19993    /// - `hNode`: Node to set the parameters for.
19994    /// - `nodeParams`: Parameters to copy.
19995    ///
19996    /// # Return value
19997    ///
19998    /// - [`CUresult::CUDA_SUCCESS`]
19999    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
20000    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
20001    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
20002    ///
20003    /// See also: [`cuGraphNodeSetParams`], [`cuGraphAddExternalSemaphoresWaitNode`], [`cuSignalExternalSemaphoresAsync`], [`cuWaitExternalSemaphoresAsync`].
20004    pub fn cuGraphExternalSemaphoresWaitNodeSetParams(
20005        hNode: CUgraphNode,
20006        nodeParams: *const CUDA_EXT_SEM_WAIT_NODE_PARAMS,
20007    ) -> CUresult;
20008}
20009singe_loader::functions! { crate::DRIVER;
20010    /// Creates a batch memory operation node and adds it to a graph.
20011    ///
20012    /// Creates a new batch memory operation node and adds it to `hGraph` with `numDependencies` dependencies specified via `dependencies` and arguments specified in `nodeParams`. It is possible for `numDependencies` to be 0, in which case the node will be placed at the root of the graph. `dependencies` may not have any duplicate entries. A handle to the new node will be returned in `phGraphNode`.
20013    ///
20014    /// When the node is added, the paramArray inside `nodeParams` is copied and therefore it can be freed after the call returns.
20015    ///
20016    /// Note: Warning: Improper use of this API may deadlock the application. Synchronization ordering established through this API is not visible to CUDA. CUDA tasks that are (even indirectly) ordered by this API should also have that order expressed with CUDA-visible dependencies such as events. This ensures that the scheduler does not serialize them in an improper order.
20017    ///
20018    /// Note: Graph objects are not threadsafe. More here.
20019    ///
20020    /// Note that this function may also return error codes from previous, asynchronous launches.
20021    ///
20022    /// # Parameters
20023    ///
20024    /// - `phGraphNode`: Returns newly created node.
20025    /// - `hGraph`: Graph to which to add the node.
20026    /// - `dependencies`: Dependencies of the node.
20027    /// - `numDependencies`: Number of dependencies.
20028    /// - `nodeParams`: Parameters for the node.
20029    ///
20030    /// # Return value
20031    ///
20032    /// - [`CUresult::CUDA_SUCCESS`]
20033    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
20034    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
20035    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
20036    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
20037    ///
20038    /// See also: [`cuGraphAddNode`], [`cuStreamBatchMemOp`], [`cuStreamWaitValue32`], [`cuStreamWriteValue32`], [`cuStreamWaitValue64`], [`cuStreamWriteValue64`], [`cuGraphBatchMemOpNodeGetParams`], [`cuGraphBatchMemOpNodeSetParams`], [`cuGraphCreate`], [`cuGraphDestroyNode`], [`cuGraphAddChildGraphNode`], [`cuGraphAddEmptyNode`], [`cuGraphAddKernelNode`], [`cuGraphAddMemcpyNode`], [`cuGraphAddMemsetNode`].
20039    pub fn cuGraphAddBatchMemOpNode(
20040        phGraphNode: *mut CUgraphNode,
20041        hGraph: CUgraph,
20042        dependencies: *const CUgraphNode,
20043        numDependencies: size_t,
20044        nodeParams: *const CUDA_BATCH_MEM_OP_NODE_PARAMS,
20045    ) -> CUresult;
20046}
20047singe_loader::functions! { crate::DRIVER;
20048    /// Returns a batch mem op node’s parameters.
20049    ///
20050    /// Returns the parameters of batch mem op node `hNode` in `nodeParams_out`. The `paramArray` returned in `nodeParams_out` is owned by the node. This memory remains valid until the node is destroyed or its parameters are modified, and should not be modified directly. Use [`cuGraphBatchMemOpNodeSetParams`] to update the parameters of this node.
20051    ///
20052    /// Note: Graph objects are not threadsafe. More here.
20053    ///
20054    /// Note that this function may also return error codes from previous, asynchronous launches.
20055    ///
20056    /// # Parameters
20057    ///
20058    /// - `hNode`: Node to get the parameters for.
20059    /// - `nodeParams_out`: Pointer to return the parameters.
20060    ///
20061    /// # Return value
20062    ///
20063    /// - [`CUresult::CUDA_SUCCESS`]
20064    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
20065    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
20066    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
20067    ///
20068    /// See also: [`cuGraphNodeGetParams`], [`cuStreamBatchMemOp`], [`cuGraphAddBatchMemOpNode`], [`cuGraphBatchMemOpNodeSetParams`].
20069    pub fn cuGraphBatchMemOpNodeGetParams(
20070        hNode: CUgraphNode,
20071        nodeParams_out: *mut CUDA_BATCH_MEM_OP_NODE_PARAMS,
20072    ) -> CUresult;
20073}
20074singe_loader::functions! { crate::DRIVER;
20075    /// Sets a batch mem op node’s parameters.
20076    ///
20077    /// Sets the parameters of batch mem op node `hNode` to `nodeParams`.
20078    ///
20079    /// The paramArray inside `nodeParams` is copied and therefore it can be freed after the call returns.
20080    ///
20081    /// Note: Graph objects are not threadsafe. More here.
20082    ///
20083    /// Note that this function may also return error codes from previous, asynchronous launches.
20084    ///
20085    /// # Parameters
20086    ///
20087    /// - `hNode`: Node to set the parameters for.
20088    /// - `nodeParams`: Parameters to copy.
20089    ///
20090    /// # Return value
20091    ///
20092    /// - [`CUresult::CUDA_SUCCESS`]
20093    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
20094    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
20095    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
20096    ///
20097    /// See also: [`cuGraphNodeSetParams`], [`cuStreamBatchMemOp`], [`cuGraphAddBatchMemOpNode`], [`cuGraphBatchMemOpNodeGetParams`].
20098    pub fn cuGraphBatchMemOpNodeSetParams(
20099        hNode: CUgraphNode,
20100        nodeParams: *const CUDA_BATCH_MEM_OP_NODE_PARAMS,
20101    ) -> CUresult;
20102}
20103singe_loader::functions! { crate::DRIVER;
20104    /// Sets the parameters for a batch mem op node in the given graphExec.
20105    ///
20106    /// Sets the parameters of a batch mem op node in an executable graph `hGraphExec`. The node is identified by the corresponding node `hNode` in the non-executable graph, from which the executable graph was instantiated.
20107    ///
20108    /// The following fields on operations may be modified on an executable graph:
20109    ///
20110    /// op.waitValue.address op.waitValue.value\[64\] op.waitValue.flags bits corresponding to wait type (i.e. [`CUstreamWaitValue_flags::CU_STREAM_WAIT_VALUE_FLUSH`] bit cannot be modified) op.writeValue.address op.writeValue.value\[64\]
20111    ///
20112    /// Other fields, such as the context, count or type of operations, and other types of operations such as membars, may not be modified.
20113    ///
20114    /// `hNode` must not have been removed from the original graph.
20115    ///
20116    /// The modifications only affect future launches of `hGraphExec`. Already enqueued or running launches of `hGraphExec` are not affected by this call. `hNode` is also not modified by this call.
20117    ///
20118    /// The paramArray inside `nodeParams` is copied and therefore it can be freed after the call returns.
20119    ///
20120    /// Note: Graph objects are not threadsafe. More here.
20121    ///
20122    /// Note that this function may also return error codes from previous, asynchronous launches.
20123    ///
20124    /// # Parameters
20125    ///
20126    /// - `hGraphExec`: The executable graph in which to set the specified node.
20127    /// - `hNode`: Batch mem op node from the graph from which graphExec was instantiated.
20128    /// - `nodeParams`: Updated Parameters to set.
20129    ///
20130    /// # Return value
20131    ///
20132    /// - [`CUresult::CUDA_SUCCESS`]
20133    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
20134    ///
20135    /// See also: [`cuGraphExecNodeSetParams`], [`cuStreamBatchMemOp`], [`cuGraphAddBatchMemOpNode`], [`cuGraphBatchMemOpNodeGetParams`], [`cuGraphBatchMemOpNodeSetParams`], `cuGraphInstantiate`.
20136    pub fn cuGraphExecBatchMemOpNodeSetParams(
20137        hGraphExec: CUgraphExec,
20138        hNode: CUgraphNode,
20139        nodeParams: *const CUDA_BATCH_MEM_OP_NODE_PARAMS,
20140    ) -> CUresult;
20141}
20142singe_loader::functions! { crate::DRIVER;
20143    /// Creates an allocation node and adds it to a graph.
20144    ///
20145    /// Creates a new allocation node and adds it to `hGraph` with `numDependencies` dependencies specified via `dependencies` and arguments specified in `nodeParams`. It is possible for `numDependencies` to be 0, in which case the node will be placed at the root of the graph. `dependencies` may not have any duplicate entries. A handle to the new node will be returned in `phGraphNode`.
20146    ///
20147    /// When [`cuGraphAddMemAllocNode`] creates an allocation node, it returns the address of the allocation in `nodeParams.dptr`. The allocation’s address remains fixed across instantiations and launches.
20148    ///
20149    /// If the allocation is freed in the same graph, by creating a free node using [`cuGraphAddMemFreeNode`], the allocation can be accessed by nodes ordered after the allocation node but before the free node. These allocations cannot be freed outside the owning graph, and they can only be freed once in the owning graph.
20150    ///
20151    /// If the allocation is not freed in the same graph, then it can be accessed not only by nodes in the graph which are ordered after the allocation node, but also by stream operations ordered after the graph’s execution but before the allocation is freed.
20152    ///
20153    /// Allocations which are not freed in the same graph can be freed by:
20154    ///
20155    /// * passing the allocation to [`cuMemFreeAsync`] or cuMemFree;
20156    /// * launching a graph with a free node for that allocation; or
20157    /// * specifying [`CUgraphInstantiate_flags_enum::CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH`] during instantiation, which makes each launch behave as though it called [`cuMemFreeAsync`] for every unfreed allocation.
20158    ///
20159    /// It is not possible to free an allocation in both the owning graph and another graph. If the allocation is freed in the same graph, a free node cannot be added to another graph. If the allocation is freed in another graph, a free node can no longer be added to the owning graph.
20160    ///
20161    /// The following restrictions apply to graphs which contain allocation and/or memory free nodes:
20162    ///
20163    /// * Nodes and edges of the graph cannot be deleted.
20164    /// * The graph can only be used in a child node if the ownership is moved to the parent.
20165    /// * Only one instantiation of the graph may exist at any point in time.
20166    /// * The graph cannot be cloned.
20167    ///
20168    /// Note: Graph objects are not threadsafe. More here.
20169    ///
20170    /// Note that this function may also return error codes from previous, asynchronous launches.
20171    ///
20172    /// # Parameters
20173    ///
20174    /// - `phGraphNode`: Returns newly created node.
20175    /// - `hGraph`: Graph to which to add the node.
20176    /// - `dependencies`: Dependencies of the node.
20177    /// - `numDependencies`: Number of dependencies.
20178    /// - `nodeParams`: Parameters for the node.
20179    ///
20180    /// # Return value
20181    ///
20182    /// - [`CUresult::CUDA_SUCCESS`]
20183    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
20184    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
20185    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
20186    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
20187    ///
20188    /// See also: [`cuGraphAddNode`], [`cuGraphAddMemFreeNode`], [`cuGraphMemAllocNodeGetParams`], [`cuDeviceGraphMemTrim`], [`cuDeviceGetGraphMemAttribute`], [`cuDeviceSetGraphMemAttribute`], [`cuMemAllocAsync`], [`cuMemFreeAsync`], [`cuGraphCreate`], [`cuGraphDestroyNode`], [`cuGraphAddChildGraphNode`], [`cuGraphAddEmptyNode`], [`cuGraphAddEventRecordNode`], [`cuGraphAddEventWaitNode`], [`cuGraphAddExternalSemaphoresSignalNode`], [`cuGraphAddExternalSemaphoresWaitNode`], [`cuGraphAddKernelNode`], [`cuGraphAddMemcpyNode`], [`cuGraphAddMemsetNode`].
20189    pub fn cuGraphAddMemAllocNode(
20190        phGraphNode: *mut CUgraphNode,
20191        hGraph: CUgraph,
20192        dependencies: *const CUgraphNode,
20193        numDependencies: size_t,
20194        nodeParams: *mut CUDA_MEM_ALLOC_NODE_PARAMS,
20195    ) -> CUresult;
20196}
20197singe_loader::functions! { crate::DRIVER;
20198    /// Returns a memory alloc node’s parameters.
20199    ///
20200    /// Returns the parameters of a memory alloc node `hNode` in `params_out`. The `poolProps` and `accessDescs` returned in `params_out`, are owned by the node. This memory remains valid until the node is destroyed. The returned parameters must not be modified.
20201    ///
20202    /// Note: Graph objects are not threadsafe. More here.
20203    ///
20204    /// Note that this function may also return error codes from previous, asynchronous launches.
20205    ///
20206    /// # Parameters
20207    ///
20208    /// - `hNode`: Node to get the parameters for.
20209    /// - `params_out`: Pointer to return the parameters.
20210    ///
20211    /// # Return value
20212    ///
20213    /// - [`CUresult::CUDA_SUCCESS`]
20214    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
20215    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
20216    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
20217    ///
20218    /// See also: [`cuGraphNodeGetParams`], [`cuGraphAddMemAllocNode`], [`cuGraphMemFreeNodeGetParams`].
20219    pub fn cuGraphMemAllocNodeGetParams(
20220        hNode: CUgraphNode,
20221        params_out: *mut CUDA_MEM_ALLOC_NODE_PARAMS,
20222    ) -> CUresult;
20223}
20224singe_loader::functions! { crate::DRIVER;
20225    /// Creates a memory free node and adds it to a graph.
20226    ///
20227    /// Creates a new memory free node and adds it to `hGraph` with `numDependencies` dependencies specified via `dependencies` and arguments specified in `nodeParams`. It is possible for `numDependencies` to be 0, in which case the node will be placed at the root of the graph. `dependencies` may not have any duplicate entries. A handle to the new node will be returned in `phGraphNode`.
20228    ///
20229    /// [`cuGraphAddMemFreeNode`] will return [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] if the user attempts to free:
20230    ///
20231    /// * an allocation twice in the same graph.
20232    /// * an address that was not returned by an allocation node.
20233    /// * an invalid address.
20234    ///
20235    /// The following restrictions apply to graphs which contain allocation and/or memory free nodes:
20236    ///
20237    /// * Nodes and edges of the graph cannot be deleted.
20238    /// * The graph can only be used in a child node if the ownership is moved to the parent.
20239    /// * Only one instantiation of the graph may exist at any point in time.
20240    /// * The graph cannot be cloned.
20241    ///
20242    /// Note: Graph objects are not threadsafe. More here.
20243    ///
20244    /// Note that this function may also return error codes from previous, asynchronous launches.
20245    ///
20246    /// # Parameters
20247    ///
20248    /// - `phGraphNode`: Returns newly created node.
20249    /// - `hGraph`: Graph to which to add the node.
20250    /// - `dependencies`: Dependencies of the node.
20251    /// - `numDependencies`: Number of dependencies.
20252    /// - `dptr`: Address of memory to free.
20253    ///
20254    /// # Return value
20255    ///
20256    /// - [`CUresult::CUDA_SUCCESS`]
20257    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
20258    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
20259    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
20260    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
20261    ///
20262    /// See also: [`cuGraphAddNode`], [`cuGraphAddMemAllocNode`], [`cuGraphMemFreeNodeGetParams`], [`cuDeviceGraphMemTrim`], [`cuDeviceGetGraphMemAttribute`], [`cuDeviceSetGraphMemAttribute`], [`cuMemAllocAsync`], [`cuMemFreeAsync`], [`cuGraphCreate`], [`cuGraphDestroyNode`], [`cuGraphAddChildGraphNode`], [`cuGraphAddEmptyNode`], [`cuGraphAddEventRecordNode`], [`cuGraphAddEventWaitNode`], [`cuGraphAddExternalSemaphoresSignalNode`], [`cuGraphAddExternalSemaphoresWaitNode`], [`cuGraphAddKernelNode`], [`cuGraphAddMemcpyNode`], [`cuGraphAddMemsetNode`].
20263    pub fn cuGraphAddMemFreeNode(
20264        phGraphNode: *mut CUgraphNode,
20265        hGraph: CUgraph,
20266        dependencies: *const CUgraphNode,
20267        numDependencies: size_t,
20268        dptr: CUdeviceptr,
20269    ) -> CUresult;
20270}
20271singe_loader::functions! { crate::DRIVER;
20272    /// Returns a memory free node’s parameters.
20273    ///
20274    /// Returns the address of a memory free node `hNode` in `dptr_out`.
20275    ///
20276    /// Note: Graph objects are not threadsafe. More here.
20277    ///
20278    /// Note that this function may also return error codes from previous, asynchronous launches.
20279    ///
20280    /// # Parameters
20281    ///
20282    /// - `hNode`: Node to get the parameters for.
20283    /// - `dptr_out`: Pointer to return the device address.
20284    ///
20285    /// # Return value
20286    ///
20287    /// - [`CUresult::CUDA_SUCCESS`]
20288    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
20289    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
20290    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
20291    ///
20292    /// See also: [`cuGraphNodeGetParams`], [`cuGraphAddMemFreeNode`], [`cuGraphMemAllocNodeGetParams`].
20293    pub fn cuGraphMemFreeNodeGetParams(
20294        hNode: CUgraphNode,
20295        dptr_out: *mut CUdeviceptr,
20296    ) -> CUresult;
20297}
20298singe_loader::functions! { crate::DRIVER;
20299    /// Free unused memory that was cached on the specified device for use with graphs back to the OS.
20300    ///
20301    /// Blocks which are not in use by a graph that is either currently executing or scheduled to execute are freed back to the operating system.
20302    ///
20303    /// # Parameters
20304    ///
20305    /// - `device`: The device for which cached memory should be freed.
20306    ///
20307    /// # Return value
20308    ///
20309    /// - [`CUresult::CUDA_SUCCESS`]
20310    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
20311    ///
20312    /// See also: [`cuGraphAddMemAllocNode`], [`cuGraphAddMemFreeNode`], [`cuDeviceSetGraphMemAttribute`], [`cuDeviceGetGraphMemAttribute`].
20313    pub fn cuDeviceGraphMemTrim(device: CUdevice) -> CUresult;
20314}
20315singe_loader::functions! { crate::DRIVER;
20316    /// Query asynchronous allocation attributes related to graphs.
20317    ///
20318    /// Valid attributes are:
20319    ///
20320    /// * [`CUgraphMem_attribute_enum::CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT`]: Amount of memory, in bytes, currently associated with graphs
20321    /// * [`CUgraphMem_attribute_enum::CU_GRAPH_MEM_ATTR_USED_MEM_HIGH`]: High watermark of memory, in bytes, associated with graphs since the last time it was reset. High watermark can only be reset to zero.
20322    /// * [`CUgraphMem_attribute_enum::CU_GRAPH_MEM_ATTR_RESERVED_MEM_CURRENT`]: Amount of memory, in bytes, currently allocated for use by the CUDA graphs asynchronous allocator.
20323    /// * [`CUgraphMem_attribute_enum::CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH`]: High watermark of memory, in bytes, currently allocated for use by the CUDA graphs asynchronous allocator.
20324    ///
20325    /// # Parameters
20326    ///
20327    /// - `device`: Specifies the scope of the query.
20328    /// - `attr`: attribute to get.
20329    /// - `value`: retrieved value.
20330    ///
20331    /// # Return value
20332    ///
20333    /// - [`CUresult::CUDA_SUCCESS`]
20334    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
20335    ///
20336    /// See also: [`cuDeviceSetGraphMemAttribute`], [`cuGraphAddMemAllocNode`], [`cuGraphAddMemFreeNode`].
20337    pub fn cuDeviceGetGraphMemAttribute(
20338        device: CUdevice,
20339        attr: CUgraphMem_attribute,
20340        value: *mut ::core::ffi::c_void,
20341    ) -> CUresult;
20342}
20343singe_loader::functions! { crate::DRIVER;
20344    /// Set asynchronous allocation attributes related to graphs.
20345    ///
20346    /// Valid attributes are:
20347    ///
20348    /// * [`CUgraphMem_attribute_enum::CU_GRAPH_MEM_ATTR_USED_MEM_HIGH`]: High watermark of memory, in bytes, associated with graphs since the last time it was reset. High watermark can only be reset to zero.
20349    /// * [`CUgraphMem_attribute_enum::CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH`]: High watermark of memory, in bytes, currently allocated for use by the CUDA graphs asynchronous allocator.
20350    ///
20351    /// # Parameters
20352    ///
20353    /// - `device`: Specifies the scope of the query.
20354    /// - `attr`: attribute to get.
20355    /// - `value`: pointer to value to set.
20356    ///
20357    /// # Return value
20358    ///
20359    /// - [`CUresult::CUDA_SUCCESS`]
20360    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
20361    ///
20362    /// See also: [`cuDeviceGetGraphMemAttribute`], [`cuGraphAddMemAllocNode`], [`cuGraphAddMemFreeNode`].
20363    pub fn cuDeviceSetGraphMemAttribute(
20364        device: CUdevice,
20365        attr: CUgraphMem_attribute,
20366        value: *mut ::core::ffi::c_void,
20367    ) -> CUresult;
20368}
20369singe_loader::functions! { crate::DRIVER;
20370    /// Clones a graph.
20371    ///
20372    /// This function creates a copy of `originalGraph` and returns it in `phGraphClone`. All parameters are copied into the cloned graph. The original graph may be modified after this call without affecting the clone.
20373    ///
20374    /// Child graph nodes in the original graph are recursively copied into the clone.
20375    ///
20376    /// Note: Cloning is not supported for graphs which contain memory allocation nodes, memory free nodes, or conditional nodes.
20377    ///
20378    /// Note: Graph objects are not threadsafe. More here.
20379    ///
20380    /// Note that this function may also return error codes from previous, asynchronous launches.
20381    ///
20382    /// # Parameters
20383    ///
20384    /// - `phGraphClone`: Returns newly created cloned graph.
20385    /// - `originalGraph`: Graph to clone.
20386    ///
20387    /// # Return value
20388    ///
20389    /// - [`CUresult::CUDA_SUCCESS`]
20390    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
20391    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
20392    ///
20393    /// See also: [`cuGraphCreate`], [`cuGraphNodeFindInClone`].
20394    pub fn cuGraphClone(phGraphClone: *mut CUgraph, originalGraph: CUgraph) -> CUresult;
20395}
20396singe_loader::functions! { crate::DRIVER;
20397    /// Finds a cloned version of a node.
20398    ///
20399    /// This function returns the node in `hClonedGraph` corresponding to `hOriginalNode` in the original graph.
20400    ///
20401    /// `hClonedGraph` must have been cloned from `hOriginalGraph` via [`cuGraphClone`]. `hOriginalNode` must have been in `hOriginalGraph` at the time of the call to [`cuGraphClone`], and the corresponding cloned node in `hClonedGraph` must not have been removed. The cloned node is then returned via `phClonedNode`.
20402    ///
20403    /// Note: Graph objects are not threadsafe. More here.
20404    ///
20405    /// Note that this function may also return error codes from previous, asynchronous launches.
20406    ///
20407    /// # Parameters
20408    ///
20409    /// - `phNode`: Returns handle to the cloned node.
20410    /// - `hOriginalNode`: Handle to the original node.
20411    /// - `hClonedGraph`: Cloned graph to query.
20412    ///
20413    /// # Return value
20414    ///
20415    /// - [`CUresult::CUDA_SUCCESS`]
20416    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
20417    ///
20418    /// See also: [`cuGraphClone`].
20419    pub fn cuGraphNodeFindInClone(
20420        phNode: *mut CUgraphNode,
20421        hOriginalNode: CUgraphNode,
20422        hClonedGraph: CUgraph,
20423    ) -> CUresult;
20424}
20425singe_loader::functions! { crate::DRIVER;
20426    /// Returns a node’s type.
20427    ///
20428    /// Returns the node type of `hNode` in `type`.
20429    ///
20430    /// Note: Graph objects are not threadsafe. More here.
20431    ///
20432    /// Note that this function may also return error codes from previous, asynchronous launches.
20433    ///
20434    /// # Parameters
20435    ///
20436    /// - `hNode`: Node to query.
20437    /// - `type_`: Pointer to return the node type.
20438    ///
20439    /// # Return value
20440    ///
20441    /// - [`CUresult::CUDA_SUCCESS`]
20442    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
20443    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
20444    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
20445    ///
20446    /// See also: [`cuGraphGetNodes`], [`cuGraphGetRootNodes`], [`cuGraphChildGraphNodeGetGraph`], [`cuGraphKernelNodeGetParams`], [`cuGraphKernelNodeSetParams`], [`cuGraphHostNodeGetParams`], [`cuGraphHostNodeSetParams`], [`cuGraphMemcpyNodeGetParams`], [`cuGraphMemcpyNodeSetParams`], [`cuGraphMemsetNodeGetParams`], [`cuGraphMemsetNodeSetParams`].
20447    pub fn cuGraphNodeGetType(
20448        hNode: CUgraphNode,
20449        type_: *mut CUgraphNodeType,
20450    ) -> CUresult;
20451}
20452singe_loader::functions! { crate::DRIVER;
20453    /// Returns the graph that contains a given graph node.
20454    ///
20455    /// Returns the graph that contains `hNode` in `*phGraph`. If `hNode` is in a child graph, the child graph it is in is returned.
20456    ///
20457    /// # Parameters
20458    ///
20459    /// - `hNode`: Node to query.
20460    ///
20461    /// # Return value
20462    ///
20463    /// - [`CUresult::CUDA_SUCCESS`]
20464    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
20465    ///
20466    /// See also: [`cuGraphGetNodes`], [`cuGraphDebugDotPrint`], [`cuGraphNodeGetLocalId`], [`cuGraphNodeGetToolsId`], [`cuGraphGetId`], [`cuGraphExecGetId`].
20467    pub fn cuGraphNodeGetContainingGraph(
20468        hNode: CUgraphNode,
20469        phGraph: *mut CUgraph,
20470    ) -> CUresult;
20471}
20472singe_loader::functions! { crate::DRIVER;
20473    /// Returns the local node id of a given graph node.
20474    ///
20475    /// Returns the node id of `hNode` in `*nodeId`. The nodeId matches that referenced by [`cuGraphDebugDotPrint`]. The local nodeId and graphId together can uniquely identify the node.
20476    ///
20477    /// # Parameters
20478    ///
20479    /// - `hNode`: Node to query.
20480    /// - `nodeId`: Pointer to return the nodeId.
20481    ///
20482    /// # Return value
20483    ///
20484    /// - [`CUresult::CUDA_SUCCESS`]
20485    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
20486    ///
20487    /// See also: [`cuGraphGetNodes`], [`cuGraphDebugDotPrint`], [`cuGraphNodeGetContainingGraph`], [`cuGraphNodeGetToolsId`], [`cuGraphGetId`], [`cuGraphExecGetId`].
20488    pub fn cuGraphNodeGetLocalId(
20489        hNode: CUgraphNode,
20490        nodeId: *mut ::core::ffi::c_uint,
20491    ) -> CUresult;
20492}
20493singe_loader::functions! { crate::DRIVER;
20494    /// Returns an id used by tools to identify a given node.
20495    ///
20496    /// # Parameters
20497    ///
20498    /// - `hNode`: Node to query.
20499    ///
20500    /// # Return value
20501    ///
20502    /// - [`CUresult::CUDA_SUCCESS`]
20503    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
20504    ///
20505    /// See also: [`cuGraphGetNodes`], [`cuGraphDebugDotPrint`], [`cuGraphNodeGetContainingGraph`], [`cuGraphNodeGetLocalId`], [`cuGraphGetId`], [`cuGraphExecGetId`].
20506    pub fn cuGraphNodeGetToolsId(
20507        hNode: CUgraphNode,
20508        toolsNodeId: *mut ::core::ffi::c_ulonglong,
20509    ) -> CUresult;
20510}
20511singe_loader::functions! { crate::DRIVER;
20512    /// Returns the id of a given graph.
20513    ///
20514    /// Returns the id of `hGraph` in `*graphId`. The value in `*graphId` will match that referenced by [`cuGraphDebugDotPrint`].
20515    ///
20516    /// # Parameters
20517    ///
20518    /// - `hGraph`: Graph to query.
20519    ///
20520    /// # Return value
20521    ///
20522    /// - [`CUresult::CUDA_SUCCESS`]
20523    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
20524    ///
20525    /// See also: [`cuGraphGetNodes`], [`cuGraphDebugDotPrint`], [`cuGraphNodeGetContainingGraph`], [`cuGraphNodeGetLocalId`], [`cuGraphNodeGetToolsId`], [`cuGraphExecGetId`].
20526    pub fn cuGraphGetId(hGraph: CUgraph, graphId: *mut ::core::ffi::c_uint) -> CUresult;
20527}
20528singe_loader::functions! { crate::DRIVER;
20529    /// Returns the id of a given graph exec.
20530    ///
20531    /// Returns the id of `hGraphExec` in `*graphId`. The value in `*graphId` will match that referenced by [`cuGraphDebugDotPrint`].
20532    ///
20533    /// # Parameters
20534    ///
20535    /// - `hGraphExec`: Graph to query.
20536    ///
20537    /// # Return value
20538    ///
20539    /// - [`CUresult::CUDA_SUCCESS`]
20540    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
20541    ///
20542    /// See also: [`cuGraphGetNodes`], [`cuGraphDebugDotPrint`], [`cuGraphNodeGetContainingGraph`], [`cuGraphNodeGetLocalId`], [`cuGraphNodeGetToolsId`], [`cuGraphGetId`].
20543    pub fn cuGraphExecGetId(
20544        hGraphExec: CUgraphExec,
20545        graphId: *mut ::core::ffi::c_uint,
20546    ) -> CUresult;
20547}
20548singe_loader::functions! { crate::DRIVER;
20549    /// Returns a graph’s nodes.
20550    ///
20551    /// Returns a list of `hGraph's` nodes. `nodes` may be NULL, in which case this function will return the number of nodes in `numNodes`. Otherwise, `numNodes` entries will be filled in. If `numNodes` is higher than the actual number of nodes, the remaining entries in `nodes` will be set to NULL, and the number of nodes actually obtained will be returned in `numNodes`.
20552    ///
20553    /// Note: Graph objects are not threadsafe. More here.
20554    ///
20555    /// Note that this function may also return error codes from previous, asynchronous launches.
20556    ///
20557    /// # Parameters
20558    ///
20559    /// - `hGraph`: Graph to query.
20560    /// - `nodes`: Pointer to return the nodes.
20561    /// - `numNodes`: See description.
20562    ///
20563    /// # Return value
20564    ///
20565    /// - [`CUresult::CUDA_SUCCESS`]
20566    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
20567    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
20568    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
20569    ///
20570    /// See also: [`cuGraphCreate`], [`cuGraphGetRootNodes`], [`cuGraphGetEdges`], [`cuGraphNodeGetType`], [`cuGraphNodeGetDependencies`], [`cuGraphNodeGetDependentNodes`].
20571    pub fn cuGraphGetNodes(
20572        hGraph: CUgraph,
20573        nodes: *mut CUgraphNode,
20574        numNodes: *mut size_t,
20575    ) -> CUresult;
20576}
20577singe_loader::functions! { crate::DRIVER;
20578    /// Returns a graph’s root nodes.
20579    ///
20580    /// Returns a list of `hGraph's` root nodes. `rootNodes` may be NULL, in which case this function will return the number of root nodes in `numRootNodes`. Otherwise, `numRootNodes` entries will be filled in. If `numRootNodes` is higher than the actual number of root nodes, the remaining entries in `rootNodes` will be set to NULL, and the number of nodes actually obtained will be returned in `numRootNodes`.
20581    ///
20582    /// Note: Graph objects are not threadsafe. More here.
20583    ///
20584    /// Note that this function may also return error codes from previous, asynchronous launches.
20585    ///
20586    /// # Parameters
20587    ///
20588    /// - `hGraph`: Graph to query.
20589    /// - `rootNodes`: Pointer to return the root nodes.
20590    /// - `numRootNodes`: See description.
20591    ///
20592    /// # Return value
20593    ///
20594    /// - [`CUresult::CUDA_SUCCESS`]
20595    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
20596    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
20597    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
20598    ///
20599    /// See also: [`cuGraphCreate`], [`cuGraphGetNodes`], [`cuGraphGetEdges`], [`cuGraphNodeGetType`], [`cuGraphNodeGetDependencies`], [`cuGraphNodeGetDependentNodes`].
20600    pub fn cuGraphGetRootNodes(
20601        hGraph: CUgraph,
20602        rootNodes: *mut CUgraphNode,
20603        numRootNodes: *mut size_t,
20604    ) -> CUresult;
20605}
20606singe_loader::functions! { crate::DRIVER;
20607    /// Returns a graph’s dependency edges.
20608    ///
20609    /// Returns a list of `hGraph's` dependency edges. Edges are returned via corresponding indices in `from`, `to` and `edgeData`; that is, the node in `to`\[i\] has a dependency on the node in `from`\[i\] with data `edgeData`\[i\]. `from` and `to` may both be NULL, in which case this function only returns the number of edges in `numEdges`. Otherwise, `numEdges` entries will be filled in. If `numEdges` is higher than the actual number of edges, the remaining entries in `from` and `to` will be set to NULL, and the number of edges actually returned will be written to `numEdges`. `edgeData` may alone be NULL, in which case the edges must all have default (zeroed) edge data. Attempting a lossy query via NULL `edgeData` will result in [`cudaError_enum::CUDA_ERROR_LOSSY_QUERY`]. If `edgeData` is non-NULL then `from` and `to` must be as well.
20610    ///
20611    /// Note: Graph objects are not threadsafe. More here.
20612    ///
20613    /// Note that this function may also return error codes from previous, asynchronous launches.
20614    ///
20615    /// # Parameters
20616    ///
20617    /// - `hGraph`: Graph to get the edges from.
20618    /// - `from`: Location to return edge endpoints.
20619    /// - `to`: Location to return edge endpoints.
20620    /// - `edgeData`: Optional location to return edge data.
20621    /// - `numEdges`: See description.
20622    ///
20623    /// # Return value
20624    ///
20625    /// - [`CUresult::CUDA_SUCCESS`]
20626    /// - [`CUresult::CUDA_ERROR_LOSSY_QUERY`]
20627    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
20628    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
20629    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
20630    ///
20631    /// See also: [`cuGraphGetNodes`], [`cuGraphGetRootNodes`], [`cuGraphAddDependencies`], [`cuGraphRemoveDependencies`], [`cuGraphNodeGetDependencies`], [`cuGraphNodeGetDependentNodes`].
20632    pub fn cuGraphGetEdges_v2(
20633        hGraph: CUgraph,
20634        from: *mut CUgraphNode,
20635        to: *mut CUgraphNode,
20636        edgeData: *mut CUgraphEdgeData,
20637        numEdges: *mut size_t,
20638    ) -> CUresult;
20639}
20640singe_loader::functions! { crate::DRIVER;
20641    /// Returns a node’s dependencies.
20642    ///
20643    /// Returns a list of `node's` dependencies. `dependencies` may be NULL, in which case this function will return the number of dependencies in `numDependencies`. Otherwise, `numDependencies` entries will be filled in. If `numDependencies` is higher than the actual number of dependencies, the remaining entries in `dependencies` will be set to NULL, and the number of nodes actually obtained will be returned in `numDependencies`.
20644    ///
20645    /// Note that if an edge has non-zero (non-default) edge data and `edgeData` is NULL, this API will return [`cudaError_enum::CUDA_ERROR_LOSSY_QUERY`]. If `edgeData` is non-NULL, then `dependencies` must be as well.
20646    ///
20647    /// Note: Graph objects are not threadsafe. More here.
20648    ///
20649    /// Note that this function may also return error codes from previous, asynchronous launches.
20650    ///
20651    /// # Parameters
20652    ///
20653    /// - `hNode`: Node to query.
20654    /// - `dependencies`: Pointer to return the dependencies.
20655    /// - `edgeData`: Optional array to return edge data for each dependency.
20656    /// - `numDependencies`: See description.
20657    ///
20658    /// # Return value
20659    ///
20660    /// - [`CUresult::CUDA_SUCCESS`]
20661    /// - [`CUresult::CUDA_ERROR_LOSSY_QUERY`]
20662    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
20663    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
20664    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
20665    ///
20666    /// See also: [`cuGraphNodeGetDependentNodes`], [`cuGraphGetNodes`], [`cuGraphGetRootNodes`], [`cuGraphGetEdges`], [`cuGraphAddDependencies`], [`cuGraphRemoveDependencies`].
20667    pub fn cuGraphNodeGetDependencies_v2(
20668        hNode: CUgraphNode,
20669        dependencies: *mut CUgraphNode,
20670        edgeData: *mut CUgraphEdgeData,
20671        numDependencies: *mut size_t,
20672    ) -> CUresult;
20673}
20674singe_loader::functions! { crate::DRIVER;
20675    /// Returns a node’s dependent nodes.
20676    ///
20677    /// Returns a list of `node's` dependent nodes. `dependentNodes` may be NULL, in which case this function will return the number of dependent nodes in `numDependentNodes`. Otherwise, `numDependentNodes` entries will be filled in. If `numDependentNodes` is higher than the actual number of dependent nodes, the remaining entries in `dependentNodes` will be set to NULL, and the number of nodes actually obtained will be returned in `numDependentNodes`.
20678    ///
20679    /// Note that if an edge has non-zero (non-default) edge data and `edgeData` is NULL, this API will return [`cudaError_enum::CUDA_ERROR_LOSSY_QUERY`]. If `edgeData` is non-NULL, then `dependentNodes` must be as well.
20680    ///
20681    /// Note: Graph objects are not threadsafe. More here.
20682    ///
20683    /// Note that this function may also return error codes from previous, asynchronous launches.
20684    ///
20685    /// # Parameters
20686    ///
20687    /// - `hNode`: Node to query.
20688    /// - `dependentNodes`: Pointer to return the dependent nodes.
20689    /// - `edgeData`: Optional pointer to return edge data for dependent nodes.
20690    /// - `numDependentNodes`: See description.
20691    ///
20692    /// # Return value
20693    ///
20694    /// - [`CUresult::CUDA_SUCCESS`]
20695    /// - [`CUresult::CUDA_ERROR_LOSSY_QUERY`]
20696    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
20697    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
20698    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
20699    ///
20700    /// See also: [`cuGraphNodeGetDependencies`], [`cuGraphGetNodes`], [`cuGraphGetRootNodes`], [`cuGraphGetEdges`], [`cuGraphAddDependencies`], [`cuGraphRemoveDependencies`].
20701    pub fn cuGraphNodeGetDependentNodes_v2(
20702        hNode: CUgraphNode,
20703        dependentNodes: *mut CUgraphNode,
20704        edgeData: *mut CUgraphEdgeData,
20705        numDependentNodes: *mut size_t,
20706    ) -> CUresult;
20707}
20708singe_loader::functions! { crate::DRIVER;
20709    /// Adds dependency edges to a graph.
20710    ///
20711    /// The number of dependencies to be added is defined by `numDependencies` Elements in `from` and `to` at corresponding indices define a dependency. Each node in `from` and `to` must belong to `hGraph`.
20712    ///
20713    /// If `numDependencies` is 0, elements in `from` and `to` will be ignored. Specifying an existing dependency will return an error.
20714    ///
20715    /// Note: Graph objects are not threadsafe. More here.
20716    ///
20717    /// Note that this function may also return error codes from previous, asynchronous launches.
20718    ///
20719    /// # Parameters
20720    ///
20721    /// - `hGraph`: Graph to which dependencies are added.
20722    /// - `from`: Array of nodes that provide the dependencies.
20723    /// - `to`: Array of dependent nodes.
20724    /// - `edgeData`: Optional array of edge data. If NULL, default (zeroed) edge data is assumed.
20725    /// - `numDependencies`: Number of dependencies to be added.
20726    ///
20727    /// # Return value
20728    ///
20729    /// - [`CUresult::CUDA_SUCCESS`]
20730    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
20731    ///
20732    /// See also: [`cuGraphRemoveDependencies`], [`cuGraphGetEdges`], [`cuGraphNodeGetDependencies`], [`cuGraphNodeGetDependentNodes`].
20733    pub fn cuGraphAddDependencies_v2(
20734        hGraph: CUgraph,
20735        from: *const CUgraphNode,
20736        to: *const CUgraphNode,
20737        edgeData: *const CUgraphEdgeData,
20738        numDependencies: size_t,
20739    ) -> CUresult;
20740}
20741singe_loader::functions! { crate::DRIVER;
20742    /// Removes dependency edges from a graph.
20743    ///
20744    /// The number of `dependencies` to be removed is defined by `numDependencies`. Elements in `from` and `to` at corresponding indices define a dependency. Each node in `from` and `to` must belong to `hGraph`.
20745    ///
20746    /// If `numDependencies` is 0, elements in `from` and `to` will be ignored. Specifying an edge that does not exist in the graph, with data matching `edgeData`, results in an error. `edgeData` is nullable, which is equivalent to passing default (zeroed) data for each edge.
20747    ///
20748    /// Dependencies cannot be removed from graphs which contain allocation or free nodes. Any attempt to do so will return an error.
20749    ///
20750    /// Note: Graph objects are not threadsafe. More here.
20751    ///
20752    /// Note that this function may also return error codes from previous, asynchronous launches.
20753    ///
20754    /// # Parameters
20755    ///
20756    /// - `hGraph`: Graph from which to remove dependencies.
20757    /// - `from`: Array of nodes that provide the dependencies.
20758    /// - `to`: Array of dependent nodes.
20759    /// - `edgeData`: Optional array of edge data. If NULL, edge data is assumed to be default (zeroed).
20760    /// - `numDependencies`: Number of dependencies to be removed.
20761    ///
20762    /// # Return value
20763    ///
20764    /// - [`CUresult::CUDA_SUCCESS`]
20765    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
20766    ///
20767    /// See also: [`cuGraphAddDependencies`], [`cuGraphGetEdges`], [`cuGraphNodeGetDependencies`], [`cuGraphNodeGetDependentNodes`].
20768    pub fn cuGraphRemoveDependencies_v2(
20769        hGraph: CUgraph,
20770        from: *const CUgraphNode,
20771        to: *const CUgraphNode,
20772        edgeData: *const CUgraphEdgeData,
20773        numDependencies: size_t,
20774    ) -> CUresult;
20775}
20776singe_loader::functions! { crate::DRIVER;
20777    /// Remove a node from the graph.
20778    ///
20779    /// Removes `hNode` from its graph. This operation also severs any dependencies of other nodes on `hNode` and vice versa.
20780    ///
20781    /// Nodes which belong to a graph which contains allocation or free nodes cannot be destroyed. Any attempt to do so will return an error.
20782    ///
20783    /// Note: Graph objects are not threadsafe. More here.
20784    ///
20785    /// Note that this function may also return error codes from previous, asynchronous launches.
20786    ///
20787    /// # Parameters
20788    ///
20789    /// - `hNode`: Node to remove
20790    ///
20791    /// # Return value
20792    ///
20793    /// - [`CUresult::CUDA_SUCCESS`]
20794    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
20795    ///
20796    /// See also: [`cuGraphAddChildGraphNode`], [`cuGraphAddEmptyNode`], [`cuGraphAddKernelNode`], [`cuGraphAddHostNode`], [`cuGraphAddMemcpyNode`], [`cuGraphAddMemsetNode`].
20797    pub fn cuGraphDestroyNode(hNode: CUgraphNode) -> CUresult;
20798}
20799singe_loader::functions! { crate::DRIVER;
20800    /// Creates an executable graph from a graph
20801    ///
20802    /// Instantiates `hGraph` as an executable graph. The graph is validated for any structural constraints or intra-node constraints which were not previously validated. If instantiation is successful, a handle to the instantiated graph is returned in `phGraphExec`.
20803    ///
20804    /// The `flags` parameter controls the behavior of instantiation and subsequent graph launches.  Valid flags are:
20805    ///
20806    /// - [`CUgraphInstantiate_flags_enum::CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH`], which configures a graph containing memory allocation nodes to automatically free any unfreed memory allocations before the graph is relaunched.
20807    ///
20808    /// - [`CUgraphInstantiate_flags_enum::CUDA_GRAPH_INSTANTIATE_FLAG_DEVICE_LAUNCH`], which configures the graph for launch from the device. If this flag is passed, the executable graph handle returned can be used to launch the graph from both the host and device. This flag can only be used on platforms which support unified addressing. This flag cannot be used in conjunction with [`CUgraphInstantiate_flags_enum::CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH`].
20809    ///
20810    /// - [`CUgraphInstantiate_flags_enum::CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY`], which causes the graph to use the priorities from the per-node attributes rather than the priority of the launch stream during execution. Note that priorities are only available on kernel nodes, and are copied from stream priority during stream capture.
20811    ///
20812    /// If `hGraph` contains any allocation or free nodes, there can be at most one executable graph in existence for that graph at a time. An attempt to instantiate a second executable graph before destroying the first with [`cuGraphExecDestroy`] will result in an error. The same also applies if `hGraph` contains any device-updatable kernel nodes.
20813    ///
20814    /// If `hGraph` contains kernels which call device-side cudaGraphLaunch() from multiple contexts, this will result in an error.
20815    ///
20816    /// Graphs instantiated for launch on the device have additional restrictions which do not apply to host graphs:
20817    ///
20818    /// - The graph's nodes must reside on a single context.
20819    /// - The graph can only contain kernel nodes, memcpy nodes, memset nodes, and child graph nodes.
20820    /// - The graph cannot be empty and must contain at least one kernel, memcpy, or memset node. Operation-specific restrictions are outlined below.
20821    /// - Kernel nodes:
20822    /// - Use of CUDA Dynamic Parallelism is not permitted.
20823    /// - Cooperative launches are permitted as long as MPS is not in use.
20824    /// - Memcpy nodes:
20825    /// - Only copies involving device memory and/or pinned device-mapped host memory are permitted.
20826    /// - Copies involving CUDA arrays are not permitted.
20827    /// - Both operands must be accessible from the current context, and the current context must match the context of other nodes in the graph.
20828    ///
20829    /// Note: Graph objects are not threadsafe. More here.
20830    ///
20831    /// Note that this function may also return error codes from previous, asynchronous launches.
20832    ///
20833    /// # Parameters
20834    ///
20835    /// - `phGraphExec`: Returns instantiated graph
20836    /// - `hGraph`: Graph to instantiate
20837    /// - `flags`: Flags to control instantiation.  See [`CUgraphInstantiate_flags`].
20838    ///
20839    /// # Return value
20840    ///
20841    /// - [`cudaError_enum::CUDA_SUCCESS`]
20842    /// - [`cudaError_enum::CUDA_ERROR_DEINITIALIZED`]
20843    /// - [`cudaError_enum::CUDA_ERROR_NOT_INITIALIZED`]
20844    /// - [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`]
20845    ///
20846    /// See also: `cuGraphInstantiate`, [`cuGraphCreate`], [`cuGraphUpload`], [`cuGraphLaunch`], [`cuGraphExecDestroy`].
20847    pub fn cuGraphInstantiateWithFlags(
20848        phGraphExec: *mut CUgraphExec,
20849        hGraph: CUgraph,
20850        flags: ::core::ffi::c_ulonglong,
20851    ) -> CUresult;
20852}
20853singe_loader::functions! { crate::DRIVER;
20854    /// Creates an executable graph from a graph.
20855    ///
20856    /// Instantiates `hGraph` as an executable graph according to the `instantiateParams` structure. The graph is validated for any structural constraints or intra-node constraints which were not previously validated. If instantiation is successful, a handle to the instantiated graph is returned in `phGraphExec`.
20857    ///
20858    /// `instantiateParams` controls the behavior of instantiation and subsequent graph launches, as well as returning more detailed information in the event of an error. [`CUDA_GRAPH_INSTANTIATE_PARAMS`] is defined as:
20859    ///
20860    /// ```text
20861    /// typedef struct {
20862    /// cuuint64_t flags;
20863    /// CUstream hUploadStream;
20864    /// CUgraphNode hErrNode_out;
20865    /// CUgraphInstantiateResult result_out;
20866    /// } CUDA_GRAPH_INSTANTIATE_PARAMS;
20867    /// ```
20868    ///
20869    /// The `flags` field controls the behavior of instantiation and subsequent graph launches. Valid flags are:
20870    ///
20871    /// * [`CUgraphInstantiate_flags_enum::CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH`], which configures a graph containing memory allocation nodes to automatically free any unfreed memory allocations before the graph is relaunched.
20872    /// * [`CUgraphInstantiate_flags_enum::CUDA_GRAPH_INSTANTIATE_FLAG_UPLOAD`], which will perform an upload of the graph into `hUploadStream` once the graph has been instantiated.
20873    /// * [`CUgraphInstantiate_flags_enum::CUDA_GRAPH_INSTANTIATE_FLAG_DEVICE_LAUNCH`], which configures the graph for launch from the device. If this flag is passed, the executable graph handle returned can be used to launch the graph from both the host and device. This flag can only be used on platforms which support unified addressing. This flag cannot be used in conjunction with [`CUgraphInstantiate_flags_enum::CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH`].
20874    /// * [`CUgraphInstantiate_flags_enum::CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY`], which causes the graph to use the priorities from the per-node attributes rather than the priority of the launch stream during execution. Note that priorities are only available on kernel nodes, and are copied from stream priority during stream capture.
20875    ///
20876    /// If `hGraph` contains any allocation or free nodes, there can be at most one executable graph in existence for that graph at a time. An attempt to instantiate a second executable graph before destroying the first with [`cuGraphExecDestroy`] will result in an error. The same also applies if `hGraph` contains any device-updatable kernel nodes.
20877    ///
20878    /// If `hGraph` contains kernels which call device-side cudaGraphLaunch() from multiple contexts, this will result in an error.
20879    ///
20880    /// Graphs instantiated for launch on the device have additional restrictions which do not apply to host graphs:
20881    ///
20882    /// * The graph’s nodes must reside on a single context.
20883    /// * The graph can only contain kernel nodes, memcpy nodes, memset nodes, and child graph nodes.
20884    /// * The graph cannot be empty and must contain at least one kernel, memcpy, or memset node. Operation-specific restrictions are outlined below.
20885    /// * Kernel nodes:
20886    ///
20887    ///   + Use of CUDA Dynamic Parallelism is not permitted.
20888    ///   + Cooperative launches are permitted as long as MPS is not in use.
20889    /// * Memcpy nodes:
20890    ///
20891    ///   + Only copies involving device memory and/or pinned device-mapped host memory are permitted.
20892    ///   + Copies involving CUDA arrays are not permitted.
20893    ///   + Both operands must be accessible from the current context, and the current context must match the context of other nodes in the graph.
20894    ///
20895    /// In the event of an error, the `result_out` and `hErrNode_out` fields will contain more information about the nature of the error. Possible error reporting includes:
20896    ///
20897    /// * [`CUgraphInstantiateResult_enum::CUDA_GRAPH_INSTANTIATE_ERROR`], if passed an invalid value or if an unexpected error occurred which is described by the return value of the function. `hErrNode_out` will be set to NULL.
20898    /// * [`CUgraphInstantiateResult_enum::CUDA_GRAPH_INSTANTIATE_INVALID_STRUCTURE`], if the graph structure is invalid. `hErrNode_out` will be set to one of the offending nodes.
20899    /// * [`CUgraphInstantiateResult_enum::CUDA_GRAPH_INSTANTIATE_NODE_OPERATION_NOT_SUPPORTED`], if the graph is instantiated for device launch but contains a node of an unsupported node type, or a node which performs unsupported operations, such as use of CUDA dynamic parallelism within a kernel node. `hErrNode_out` will be set to this node.
20900    /// * [`CUgraphInstantiateResult_enum::CUDA_GRAPH_INSTANTIATE_MULTIPLE_CTXS_NOT_SUPPORTED`], if the graph is instantiated for device launch but a node’s context differs from that of another node. This error can also be returned if a graph is not instantiated for device launch and it contains kernels which call device-side cudaGraphLaunch() from multiple contexts. `hErrNode_out` will be set to this node.
20901    ///
20902    /// If instantiation is successful, `result_out` will be set to [`CUgraphInstantiateResult_enum::CUDA_GRAPH_INSTANTIATE_SUCCESS`], and `hErrNode_out` will be set to NULL.
20903    ///
20904    /// Note: Graph objects are not threadsafe. More here.
20905    ///
20906    /// Note that this function may also return error codes from previous, asynchronous launches.
20907    ///
20908    /// # Parameters
20909    ///
20910    /// - `phGraphExec`: Returns instantiated graph.
20911    /// - `hGraph`: Graph to instantiate.
20912    /// - `instantiateParams`: Instantiation parameters.
20913    ///
20914    /// # Return value
20915    ///
20916    /// - [`CUresult::CUDA_SUCCESS`]
20917    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
20918    ///
20919    /// See also: [`cuGraphCreate`], `cuGraphInstantiate`, [`cuGraphExecDestroy`].
20920    pub fn cuGraphInstantiateWithParams(
20921        phGraphExec: *mut CUgraphExec,
20922        hGraph: CUgraph,
20923        instantiateParams: *mut CUDA_GRAPH_INSTANTIATE_PARAMS,
20924    ) -> CUresult;
20925}
20926singe_loader::functions! { crate::DRIVER;
20927    /// Query the instantiation flags of an executable graph.
20928    ///
20929    /// Returns the flags that were passed to instantiation for the given executable graph. [`CUgraphInstantiate_flags_enum::CUDA_GRAPH_INSTANTIATE_FLAG_UPLOAD`] will not be returned by this API as it does not affect the resulting executable graph.
20930    ///
20931    /// Note: Graph objects are not threadsafe. More here.
20932    ///
20933    /// Note that this function may also return error codes from previous, asynchronous launches.
20934    ///
20935    /// # Parameters
20936    ///
20937    /// - `hGraphExec`: The executable graph to query.
20938    /// - `flags`: Returns the instantiation flags.
20939    ///
20940    /// # Return value
20941    ///
20942    /// - [`CUresult::CUDA_SUCCESS`]
20943    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
20944    ///
20945    /// See also: `cuGraphInstantiate`, [`cuGraphInstantiateWithParams`].
20946    pub fn cuGraphExecGetFlags(
20947        hGraphExec: CUgraphExec,
20948        flags: *mut cuuint64_t,
20949    ) -> CUresult;
20950}
20951singe_loader::functions! { crate::DRIVER;
20952    /// Sets the parameters for a kernel node in the given graphExec.
20953    ///
20954    /// Sets the parameters of a kernel node in an executable graph `hGraphExec`. The node is identified by the corresponding node `hNode` in the non-executable graph, from which the executable graph was instantiated.
20955    ///
20956    /// `hNode` must not have been removed from the original graph. All `nodeParams` fields may change, but the following restrictions apply to `func` updates:
20957    ///
20958    /// * The owning context of the function cannot change.
20959    /// * A node whose function originally did not use CUDA dynamic parallelism cannot be updated to a function which uses CDP
20960    /// * A node whose function originally did not make device-side update calls cannot be updated to a function which makes device-side update calls.
20961    /// * If `hGraphExec` was not instantiated for device launch, a node whose function originally did not use device-side cudaGraphLaunch() cannot be updated to a function which uses device-side cudaGraphLaunch() unless the node resides on the same context as nodes which contained such calls at instantiate-time. If no such calls were present at instantiation, these updates cannot be performed at all.
20962    ///
20963    /// The modifications only affect future launches of `hGraphExec`. Already enqueued or running launches of `hGraphExec` are not affected by this call. `hNode` is also not modified by this call.
20964    ///
20965    /// If `hNode` is a device-updatable kernel node, the next upload/launch of `hGraphExec` will overwrite any previous device-side updates. Additionally, applying host updates to a device-updatable kernel node while it is being updated from the device will result in undefined behavior.
20966    ///
20967    /// Note: Graph objects are not threadsafe. More here.
20968    ///
20969    /// Note that this function may also return error codes from previous, asynchronous launches.
20970    ///
20971    /// # Parameters
20972    ///
20973    /// - `hGraphExec`: The executable graph in which to set the specified node.
20974    /// - `hNode`: kernel node from the graph from which graphExec was instantiated.
20975    /// - `nodeParams`: Updated Parameters to set.
20976    ///
20977    /// # Return value
20978    ///
20979    /// - [`CUresult::CUDA_SUCCESS`]
20980    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
20981    ///
20982    /// See also: [`cuGraphExecNodeSetParams`], [`cuGraphAddKernelNode`], [`cuGraphKernelNodeSetParams`], [`cuGraphExecMemcpyNodeSetParams`], [`cuGraphExecMemsetNodeSetParams`], [`cuGraphExecHostNodeSetParams`], [`cuGraphExecChildGraphNodeSetParams`], [`cuGraphExecEventRecordNodeSetEvent`], [`cuGraphExecEventWaitNodeSetEvent`], [`cuGraphExecExternalSemaphoresSignalNodeSetParams`], [`cuGraphExecExternalSemaphoresWaitNodeSetParams`], [`cuGraphExecUpdate`], `cuGraphInstantiate`.
20983    pub fn cuGraphExecKernelNodeSetParams_v2(
20984        hGraphExec: CUgraphExec,
20985        hNode: CUgraphNode,
20986        nodeParams: *const CUDA_KERNEL_NODE_PARAMS,
20987    ) -> CUresult;
20988}
20989singe_loader::functions! { crate::DRIVER;
20990    /// Sets the parameters for a memcpy node in the given graphExec.
20991    ///
20992    /// Updates the work represented by `hNode` in `hGraphExec` as though `hNode` had contained `copyParams` at instantiation. hNode must remain in the graph which was used to instantiate `hGraphExec`. Changed edges to and from hNode are ignored.
20993    ///
20994    /// The source and destination memory in `copyParams` must be allocated from the same contexts as the original source and destination memory. Both the instantiation-time memory operands and the memory operands in `copyParams` must be 1-dimensional. Zero-length operations are not supported.
20995    ///
20996    /// The modifications only affect future launches of `hGraphExec`. Already enqueued or running launches of `hGraphExec` are not affected by this call. hNode is also not modified by this call.
20997    ///
20998    /// Returns [`CUresult::CUDA_ERROR_INVALID_VALUE`] if the memory operands’ mappings changed or either the original or new memory operands are multidimensional.
20999    ///
21000    /// Note: Graph objects are not threadsafe. More here.
21001    ///
21002    /// Note that this function may also return error codes from previous, asynchronous launches.
21003    ///
21004    /// # Parameters
21005    ///
21006    /// - `hGraphExec`: The executable graph in which to set the specified node.
21007    /// - `hNode`: Memcpy node from the graph which was used to instantiate graphExec.
21008    /// - `copyParams`: The updated parameters to set.
21009    /// - `ctx`: Context on which to run the node.
21010    ///
21011    /// # Return value
21012    ///
21013    /// - [`CUresult::CUDA_SUCCESS`]
21014    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21015    ///
21016    /// See also: [`cuGraphExecNodeSetParams`], [`cuGraphAddMemcpyNode`], [`cuGraphMemcpyNodeSetParams`], [`cuGraphExecKernelNodeSetParams`], [`cuGraphExecMemsetNodeSetParams`], [`cuGraphExecHostNodeSetParams`], [`cuGraphExecChildGraphNodeSetParams`], [`cuGraphExecEventRecordNodeSetEvent`], [`cuGraphExecEventWaitNodeSetEvent`], [`cuGraphExecExternalSemaphoresSignalNodeSetParams`], [`cuGraphExecExternalSemaphoresWaitNodeSetParams`], [`cuGraphExecUpdate`], `cuGraphInstantiate`.
21017    pub fn cuGraphExecMemcpyNodeSetParams(
21018        hGraphExec: CUgraphExec,
21019        hNode: CUgraphNode,
21020        copyParams: *const CUDA_MEMCPY3D,
21021        ctx: CUcontext,
21022    ) -> CUresult;
21023}
21024singe_loader::functions! { crate::DRIVER;
21025    /// Sets the parameters for a memset node in the given graphExec.
21026    ///
21027    /// Updates the work represented by `hNode` in `hGraphExec` as though `hNode` had contained `memsetParams` at instantiation. hNode must remain in the graph which was used to instantiate `hGraphExec`. Changed edges to and from hNode are ignored.
21028    ///
21029    /// Zero sized operations are not supported.
21030    ///
21031    /// The new destination pointer in memsetParams must be to the same kind of allocation as the original destination pointer and have the same context association and device mapping as the original destination pointer.
21032    ///
21033    /// Both the value and pointer address may be updated.
21034    ///
21035    /// Changing other aspects of the memset (width, height, element size or pitch) may cause the update to be rejected. Specifically, for 2d memsets, all dimension changes are rejected. For 1d memsets, changes in height are explicitly rejected and other changes are opportunistically allowed if the resulting work maps onto the work resources already allocated for the node.
21036    ///
21037    /// The modifications only affect future launches of `hGraphExec`. Already enqueued or running launches of `hGraphExec` are not affected by this call. hNode is also not modified by this call.
21038    ///
21039    /// Note: Graph objects are not threadsafe. More here.
21040    ///
21041    /// Note that this function may also return error codes from previous, asynchronous launches.
21042    ///
21043    /// # Parameters
21044    ///
21045    /// - `hGraphExec`: The executable graph in which to set the specified node.
21046    /// - `hNode`: Memset node from the graph which was used to instantiate graphExec.
21047    /// - `memsetParams`: The updated parameters to set.
21048    /// - `ctx`: Context on which to run the node.
21049    ///
21050    /// # Return value
21051    ///
21052    /// - [`CUresult::CUDA_SUCCESS`]
21053    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21054    ///
21055    /// See also: [`cuGraphExecNodeSetParams`], [`cuGraphAddMemsetNode`], [`cuGraphMemsetNodeSetParams`], [`cuGraphExecKernelNodeSetParams`], [`cuGraphExecMemcpyNodeSetParams`], [`cuGraphExecHostNodeSetParams`], [`cuGraphExecChildGraphNodeSetParams`], [`cuGraphExecEventRecordNodeSetEvent`], [`cuGraphExecEventWaitNodeSetEvent`], [`cuGraphExecExternalSemaphoresSignalNodeSetParams`], [`cuGraphExecExternalSemaphoresWaitNodeSetParams`], [`cuGraphExecUpdate`], `cuGraphInstantiate`.
21056    pub fn cuGraphExecMemsetNodeSetParams(
21057        hGraphExec: CUgraphExec,
21058        hNode: CUgraphNode,
21059        memsetParams: *const CUDA_MEMSET_NODE_PARAMS,
21060        ctx: CUcontext,
21061    ) -> CUresult;
21062}
21063singe_loader::functions! { crate::DRIVER;
21064    /// Sets the parameters for a host node in the given graphExec.
21065    ///
21066    /// Updates the work represented by `hNode` in `hGraphExec` as though `hNode` had contained `nodeParams` at instantiation. hNode must remain in the graph which was used to instantiate `hGraphExec`. Changed edges to and from hNode are ignored.
21067    ///
21068    /// The modifications only affect future launches of `hGraphExec`. Already enqueued or running launches of `hGraphExec` are not affected by this call. hNode is also not modified by this call.
21069    ///
21070    /// Note: Graph objects are not threadsafe. More here.
21071    ///
21072    /// Note that this function may also return error codes from previous, asynchronous launches.
21073    ///
21074    /// # Parameters
21075    ///
21076    /// - `hGraphExec`: The executable graph in which to set the specified node.
21077    /// - `hNode`: Host node from the graph which was used to instantiate graphExec.
21078    /// - `nodeParams`: The updated parameters to set.
21079    ///
21080    /// # Return value
21081    ///
21082    /// - [`CUresult::CUDA_SUCCESS`]
21083    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21084    ///
21085    /// See also: [`cuGraphExecNodeSetParams`], [`cuGraphAddHostNode`], [`cuGraphHostNodeSetParams`], [`cuGraphExecKernelNodeSetParams`], [`cuGraphExecMemcpyNodeSetParams`], [`cuGraphExecMemsetNodeSetParams`], [`cuGraphExecChildGraphNodeSetParams`], [`cuGraphExecEventRecordNodeSetEvent`], [`cuGraphExecEventWaitNodeSetEvent`], [`cuGraphExecExternalSemaphoresSignalNodeSetParams`], [`cuGraphExecExternalSemaphoresWaitNodeSetParams`], [`cuGraphExecUpdate`], `cuGraphInstantiate`.
21086    pub fn cuGraphExecHostNodeSetParams(
21087        hGraphExec: CUgraphExec,
21088        hNode: CUgraphNode,
21089        nodeParams: *const CUDA_HOST_NODE_PARAMS,
21090    ) -> CUresult;
21091}
21092singe_loader::functions! { crate::DRIVER;
21093    /// Updates node parameters in the child graph node in the given graphExec.
21094    ///
21095    /// Updates the work represented by `hNode` in `hGraphExec` as though the nodes contained in `hNode's` graph had the parameters contained in `childGraph's` nodes at instantiation. `hNode` must remain in the graph which was used to instantiate `hGraphExec`. Changed edges to and from `hNode` are ignored.
21096    ///
21097    /// The modifications only affect future launches of `hGraphExec`. Already enqueued or running launches of `hGraphExec` are not affected by this call. `hNode` is also not modified by this call.
21098    ///
21099    /// The topology of `childGraph`, as well as the node insertion order, must match that of the graph contained in `hNode`. See cuGraphExecUpdate() for a list of restrictions on what can be updated in an instantiated graph. The update is recursive, so child graph nodes contained within the top level child graph will also be updated.
21100    ///
21101    /// Note: Graph objects are not threadsafe. More here.
21102    ///
21103    /// Note that this function may also return error codes from previous, asynchronous launches.
21104    ///
21105    /// # Parameters
21106    ///
21107    /// - `hGraphExec`: The executable graph in which to set the specified node.
21108    /// - `hNode`: Host node from the graph which was used to instantiate graphExec.
21109    /// - `childGraph`: The graph supplying the updated parameters.
21110    ///
21111    /// # Return value
21112    ///
21113    /// - [`CUresult::CUDA_SUCCESS`]
21114    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21115    ///
21116    /// See also: [`cuGraphExecNodeSetParams`], [`cuGraphAddChildGraphNode`], [`cuGraphChildGraphNodeGetGraph`], [`cuGraphExecKernelNodeSetParams`], [`cuGraphExecMemcpyNodeSetParams`], [`cuGraphExecMemsetNodeSetParams`], [`cuGraphExecHostNodeSetParams`], [`cuGraphExecEventRecordNodeSetEvent`], [`cuGraphExecEventWaitNodeSetEvent`], [`cuGraphExecExternalSemaphoresSignalNodeSetParams`], [`cuGraphExecExternalSemaphoresWaitNodeSetParams`], [`cuGraphExecUpdate`], `cuGraphInstantiate`.
21117    pub fn cuGraphExecChildGraphNodeSetParams(
21118        hGraphExec: CUgraphExec,
21119        hNode: CUgraphNode,
21120        childGraph: CUgraph,
21121    ) -> CUresult;
21122}
21123singe_loader::functions! { crate::DRIVER;
21124    /// Sets the event for an event record node in the given graphExec.
21125    ///
21126    /// Sets the event of an event record node in an executable graph `hGraphExec`. The node is identified by the corresponding node `hNode` in the non-executable graph, from which the executable graph was instantiated.
21127    ///
21128    /// The modifications only affect future launches of `hGraphExec`. Already enqueued or running launches of `hGraphExec` are not affected by this call. `hNode` is also not modified by this call.
21129    ///
21130    /// Note: Graph objects are not threadsafe. More here.
21131    ///
21132    /// Note that this function may also return error codes from previous, asynchronous launches.
21133    ///
21134    /// # Parameters
21135    ///
21136    /// - `hGraphExec`: The executable graph in which to set the specified node.
21137    /// - `hNode`: event record node from the graph from which graphExec was instantiated.
21138    /// - `event`: Updated event to use.
21139    ///
21140    /// # Return value
21141    ///
21142    /// - [`CUresult::CUDA_SUCCESS`]
21143    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21144    ///
21145    /// See also: [`cuGraphExecNodeSetParams`], [`cuGraphAddEventRecordNode`], [`cuGraphEventRecordNodeGetEvent`], [`cuGraphEventWaitNodeSetEvent`], [`cuEventRecordWithFlags`], [`cuStreamWaitEvent`], [`cuGraphExecKernelNodeSetParams`], [`cuGraphExecMemcpyNodeSetParams`], [`cuGraphExecMemsetNodeSetParams`], [`cuGraphExecHostNodeSetParams`], [`cuGraphExecChildGraphNodeSetParams`], [`cuGraphExecEventWaitNodeSetEvent`], [`cuGraphExecExternalSemaphoresSignalNodeSetParams`], [`cuGraphExecExternalSemaphoresWaitNodeSetParams`], [`cuGraphExecUpdate`], `cuGraphInstantiate`.
21146    pub fn cuGraphExecEventRecordNodeSetEvent(
21147        hGraphExec: CUgraphExec,
21148        hNode: CUgraphNode,
21149        event: CUevent,
21150    ) -> CUresult;
21151}
21152singe_loader::functions! { crate::DRIVER;
21153    /// Sets the event for an event wait node in the given graphExec.
21154    ///
21155    /// Sets the event of an event wait node in an executable graph `hGraphExec`. The node is identified by the corresponding node `hNode` in the non-executable graph, from which the executable graph was instantiated.
21156    ///
21157    /// The modifications only affect future launches of `hGraphExec`. Already enqueued or running launches of `hGraphExec` are not affected by this call. `hNode` is also not modified by this call.
21158    ///
21159    /// Note: Graph objects are not threadsafe. More here.
21160    ///
21161    /// Note that this function may also return error codes from previous, asynchronous launches.
21162    ///
21163    /// # Parameters
21164    ///
21165    /// - `hGraphExec`: The executable graph in which to set the specified node.
21166    /// - `hNode`: event wait node from the graph from which graphExec was instantiated.
21167    /// - `event`: Updated event to use.
21168    ///
21169    /// # Return value
21170    ///
21171    /// - [`CUresult::CUDA_SUCCESS`]
21172    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21173    ///
21174    /// See also: [`cuGraphExecNodeSetParams`], [`cuGraphAddEventWaitNode`], [`cuGraphEventWaitNodeGetEvent`], [`cuGraphEventRecordNodeSetEvent`], [`cuEventRecordWithFlags`], [`cuStreamWaitEvent`], [`cuGraphExecKernelNodeSetParams`], [`cuGraphExecMemcpyNodeSetParams`], [`cuGraphExecMemsetNodeSetParams`], [`cuGraphExecHostNodeSetParams`], [`cuGraphExecChildGraphNodeSetParams`], [`cuGraphExecEventRecordNodeSetEvent`], [`cuGraphExecExternalSemaphoresSignalNodeSetParams`], [`cuGraphExecExternalSemaphoresWaitNodeSetParams`], [`cuGraphExecUpdate`], `cuGraphInstantiate`.
21175    pub fn cuGraphExecEventWaitNodeSetEvent(
21176        hGraphExec: CUgraphExec,
21177        hNode: CUgraphNode,
21178        event: CUevent,
21179    ) -> CUresult;
21180}
21181singe_loader::functions! { crate::DRIVER;
21182    /// Sets the parameters for an external semaphore signal node in the given graphExec.
21183    ///
21184    /// Sets the parameters of an external semaphore signal node in an executable graph `hGraphExec`. The node is identified by the corresponding node `hNode` in the non-executable graph, from which the executable graph was instantiated.
21185    ///
21186    /// `hNode` must not have been removed from the original graph.
21187    ///
21188    /// The modifications only affect future launches of `hGraphExec`. Already enqueued or running launches of `hGraphExec` are not affected by this call. `hNode` is also not modified by this call.
21189    ///
21190    /// Changing `nodeParams->numExtSems` is not supported.
21191    ///
21192    /// Note: Graph objects are not threadsafe. More here.
21193    ///
21194    /// Note that this function may also return error codes from previous, asynchronous launches.
21195    ///
21196    /// # Parameters
21197    ///
21198    /// - `hGraphExec`: The executable graph in which to set the specified node.
21199    /// - `hNode`: semaphore signal node from the graph from which graphExec was instantiated.
21200    /// - `nodeParams`: Updated Parameters to set.
21201    ///
21202    /// # Return value
21203    ///
21204    /// - [`CUresult::CUDA_SUCCESS`]
21205    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21206    ///
21207    /// See also: [`cuGraphExecNodeSetParams`], [`cuGraphAddExternalSemaphoresSignalNode`], [`cuImportExternalSemaphore`], [`cuSignalExternalSemaphoresAsync`], [`cuWaitExternalSemaphoresAsync`], [`cuGraphExecKernelNodeSetParams`], [`cuGraphExecMemcpyNodeSetParams`], [`cuGraphExecMemsetNodeSetParams`], [`cuGraphExecHostNodeSetParams`], [`cuGraphExecChildGraphNodeSetParams`], [`cuGraphExecEventRecordNodeSetEvent`], [`cuGraphExecEventWaitNodeSetEvent`], [`cuGraphExecExternalSemaphoresWaitNodeSetParams`], [`cuGraphExecUpdate`], `cuGraphInstantiate`.
21208    pub fn cuGraphExecExternalSemaphoresSignalNodeSetParams(
21209        hGraphExec: CUgraphExec,
21210        hNode: CUgraphNode,
21211        nodeParams: *const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS,
21212    ) -> CUresult;
21213}
21214singe_loader::functions! { crate::DRIVER;
21215    /// Sets the parameters for an external semaphore wait node in the given graphExec.
21216    ///
21217    /// Sets the parameters of an external semaphore wait node in an executable graph `hGraphExec`. The node is identified by the corresponding node `hNode` in the non-executable graph, from which the executable graph was instantiated.
21218    ///
21219    /// `hNode` must not have been removed from the original graph.
21220    ///
21221    /// The modifications only affect future launches of `hGraphExec`. Already enqueued or running launches of `hGraphExec` are not affected by this call. `hNode` is also not modified by this call.
21222    ///
21223    /// Changing `nodeParams->numExtSems` is not supported.
21224    ///
21225    /// Note: Graph objects are not threadsafe. More here.
21226    ///
21227    /// Note that this function may also return error codes from previous, asynchronous launches.
21228    ///
21229    /// # Parameters
21230    ///
21231    /// - `hGraphExec`: The executable graph in which to set the specified node.
21232    /// - `hNode`: semaphore wait node from the graph from which graphExec was instantiated.
21233    /// - `nodeParams`: Updated Parameters to set.
21234    ///
21235    /// # Return value
21236    ///
21237    /// - [`CUresult::CUDA_SUCCESS`]
21238    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21239    ///
21240    /// See also: [`cuGraphExecNodeSetParams`], [`cuGraphAddExternalSemaphoresWaitNode`], [`cuImportExternalSemaphore`], [`cuSignalExternalSemaphoresAsync`], [`cuWaitExternalSemaphoresAsync`], [`cuGraphExecKernelNodeSetParams`], [`cuGraphExecMemcpyNodeSetParams`], [`cuGraphExecMemsetNodeSetParams`], [`cuGraphExecHostNodeSetParams`], [`cuGraphExecChildGraphNodeSetParams`], [`cuGraphExecEventRecordNodeSetEvent`], [`cuGraphExecEventWaitNodeSetEvent`], [`cuGraphExecExternalSemaphoresSignalNodeSetParams`], [`cuGraphExecUpdate`], `cuGraphInstantiate`.
21241    pub fn cuGraphExecExternalSemaphoresWaitNodeSetParams(
21242        hGraphExec: CUgraphExec,
21243        hNode: CUgraphNode,
21244        nodeParams: *const CUDA_EXT_SEM_WAIT_NODE_PARAMS,
21245    ) -> CUresult;
21246}
21247singe_loader::functions! { crate::DRIVER;
21248    /// Enables or disables the specified node in the given graphExec.
21249    ///
21250    /// Sets `hNode` to be either enabled or disabled. Disabled nodes are functionally equivalent to empty nodes until they are reenabled. Existing node parameters are not affected by disabling/enabling the node.
21251    ///
21252    /// The node is identified by the corresponding node `hNode` in the non-executable graph, from which the executable graph was instantiated.
21253    ///
21254    /// `hNode` must not have been removed from the original graph.
21255    ///
21256    /// The modifications only affect future launches of `hGraphExec`. Already enqueued or running launches of `hGraphExec` are not affected by this call. `hNode` is also not modified by this call.
21257    ///
21258    /// If `hNode` is a device-updatable kernel node, the next upload/launch of `hGraphExec` will overwrite any previous device-side updates. Additionally, applying host updates to a device-updatable kernel node while it is being updated from the device will result in undefined behavior.
21259    ///
21260    /// Note: Currently only kernel, memset and memcpy nodes are supported.
21261    ///
21262    /// Note: Graph objects are not threadsafe. More here.
21263    ///
21264    /// Note that this function may also return error codes from previous, asynchronous launches.
21265    ///
21266    /// # Parameters
21267    ///
21268    /// - `hGraphExec`: The executable graph in which to set the specified node.
21269    /// - `hNode`: Node from the graph from which graphExec was instantiated.
21270    /// - `isEnabled`: Node is enabled if != 0, otherwise the node is disabled.
21271    ///
21272    /// # Return value
21273    ///
21274    /// - [`CUresult::CUDA_SUCCESS`]
21275    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21276    ///
21277    /// See also: [`cuGraphNodeGetEnabled`], [`cuGraphExecUpdate`], `cuGraphInstantiate`, [`cuGraphLaunch`].
21278    pub fn cuGraphNodeSetEnabled(
21279        hGraphExec: CUgraphExec,
21280        hNode: CUgraphNode,
21281        isEnabled: ::core::ffi::c_uint,
21282    ) -> CUresult;
21283}
21284singe_loader::functions! { crate::DRIVER;
21285    /// Query whether a node in the given graphExec is enabled.
21286    ///
21287    /// Sets isEnabled to 1 if `hNode` is enabled, or 0 if `hNode` is disabled.
21288    ///
21289    /// The node is identified by the corresponding node `hNode` in the non-executable graph, from which the executable graph was instantiated.
21290    ///
21291    /// `hNode` must not have been removed from the original graph.
21292    ///
21293    /// Note: Currently only kernel, memset and memcpy nodes are supported.
21294    ///
21295    /// Note: This function will not reflect device-side updates for device-updatable kernel nodes.
21296    ///
21297    /// Note: Graph objects are not threadsafe. More here.
21298    ///
21299    /// Note that this function may also return error codes from previous, asynchronous launches.
21300    ///
21301    /// # Parameters
21302    ///
21303    /// - `hGraphExec`: The executable graph in which to set the specified node.
21304    /// - `hNode`: Node from the graph from which graphExec was instantiated.
21305    /// - `isEnabled`: Location to return the enabled status of the node.
21306    ///
21307    /// # Return value
21308    ///
21309    /// - [`CUresult::CUDA_SUCCESS`]
21310    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21311    ///
21312    /// See also: [`cuGraphNodeSetEnabled`], [`cuGraphExecUpdate`], `cuGraphInstantiate`, [`cuGraphLaunch`].
21313    pub fn cuGraphNodeGetEnabled(
21314        hGraphExec: CUgraphExec,
21315        hNode: CUgraphNode,
21316        isEnabled: *mut ::core::ffi::c_uint,
21317    ) -> CUresult;
21318}
21319singe_loader::functions! { crate::DRIVER;
21320    /// Uploads an executable graph in a stream.
21321    ///
21322    /// Uploads `hGraphExec` to the device in `hStream` without executing it. Uploads of the same `hGraphExec` will be serialized. Each upload is ordered behind both any previous work in `hStream` and any previous launches of `hGraphExec`. Uses memory cached by `stream` to back the allocations owned by `hGraphExec`.
21323    ///
21324    /// Note: Graph objects are not threadsafe. More here.
21325    ///
21326    /// Note that this function may also return error codes from previous, asynchronous launches.
21327    ///
21328    /// # Parameters
21329    ///
21330    /// - `hGraphExec`: Executable graph to upload.
21331    /// - `hStream`: Stream in which to upload the graph.
21332    ///
21333    /// # Return value
21334    ///
21335    /// - [`CUresult::CUDA_SUCCESS`]
21336    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
21337    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
21338    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21339    ///
21340    /// See also: `cuGraphInstantiate`, [`cuGraphLaunch`], [`cuGraphExecDestroy`].
21341    pub fn cuGraphUpload(hGraphExec: CUgraphExec, hStream: CUstream) -> CUresult;
21342}
21343singe_loader::functions! { crate::DRIVER;
21344    /// Launches an executable graph in a stream.
21345    ///
21346    /// Executes `hGraphExec` in `hStream`. Only one instance of `hGraphExec` may be executing at a time. Each launch is ordered behind both any previous work in `hStream` and any previous launches of `hGraphExec`. To execute a graph concurrently, it must be instantiated multiple times into multiple executable graphs.
21347    ///
21348    /// If any allocations created by `hGraphExec` remain unfreed (from a previous launch) and `hGraphExec` was not instantiated with [`CUgraphInstantiate_flags_enum::CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH`], the launch will fail with [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`].
21349    ///
21350    /// Note: Graph objects are not threadsafe. More here.
21351    ///
21352    /// Note that this function may also return error codes from previous, asynchronous launches.
21353    ///
21354    /// # Parameters
21355    ///
21356    /// - `hGraphExec`: Executable graph to launch.
21357    /// - `hStream`: Stream in which to launch the graph.
21358    ///
21359    /// # Return value
21360    ///
21361    /// - [`CUresult::CUDA_SUCCESS`]
21362    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
21363    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
21364    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21365    ///
21366    /// See also: `cuGraphInstantiate`, [`cuGraphUpload`], [`cuGraphExecDestroy`].
21367    pub fn cuGraphLaunch(hGraphExec: CUgraphExec, hStream: CUstream) -> CUresult;
21368}
21369singe_loader::functions! { crate::DRIVER;
21370    /// Destroys an executable graph.
21371    ///
21372    /// Destroys the executable graph specified by `hGraphExec`, as well as all of its executable nodes. If the executable graph is in-flight, it will not be terminated, but rather freed asynchronously on completion.
21373    ///
21374    /// Note: Graph objects are not threadsafe. More here.
21375    ///
21376    /// Note that this function may also return error codes from previous, asynchronous launches.
21377    ///
21378    /// # Parameters
21379    ///
21380    /// - `hGraphExec`: Executable graph to destroy
21381    ///
21382    /// # Return value
21383    ///
21384    /// - [`CUresult::CUDA_SUCCESS`]
21385    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
21386    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
21387    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21388    ///
21389    /// See also: `cuGraphInstantiate`, [`cuGraphUpload`], [`cuGraphLaunch`].
21390    pub fn cuGraphExecDestroy(hGraphExec: CUgraphExec) -> CUresult;
21391}
21392singe_loader::functions! { crate::DRIVER;
21393    /// Destroys a graph.
21394    ///
21395    /// Destroys the graph specified by `hGraph`, as well as all of its nodes.
21396    ///
21397    /// Note: Graph objects are not threadsafe. More here.
21398    ///
21399    /// Note that this function may also return error codes from previous, asynchronous launches.
21400    ///
21401    /// # Parameters
21402    ///
21403    /// - `hGraph`: Graph to destroy
21404    ///
21405    /// # Return value
21406    ///
21407    /// - [`CUresult::CUDA_SUCCESS`]
21408    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
21409    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
21410    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21411    ///
21412    /// See also: [`cuGraphCreate`].
21413    pub fn cuGraphDestroy(hGraph: CUgraph) -> CUresult;
21414}
21415singe_loader::functions! { crate::DRIVER;
21416    /// Check whether an executable graph can be updated with a graph and perform the update if possible.
21417    ///
21418    /// Updates the node parameters in the instantiated graph specified by `hGraphExec` with the node parameters in a topologically identical graph specified by `hGraph`.
21419    ///
21420    /// Limitations:
21421    ///
21422    /// * Kernel nodes:
21423    ///
21424    ///   + The owning context of the function cannot change.
21425    ///   + A node whose function originally did not use CUDA dynamic parallelism cannot be updated to a function which uses CDP.
21426    ///   + A node whose function originally did not make device-side update calls cannot be updated to a function which makes device-side update calls.
21427    ///   + A cooperative node cannot be updated to a non-cooperative node, and vice-versa.
21428    ///   + If the graph was instantiated with [`CUgraphInstantiate_flags::CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY`], the priority attribute cannot change. Equality is checked on the originally requested priority values, before they are clamped to the device’s supported range.
21429    ///   + If `hGraphExec` was not instantiated for device launch, a node whose function originally did not use device-side cudaGraphLaunch() cannot be updated to a function which uses device-side cudaGraphLaunch() unless the node resides on the same context as nodes which contained such calls at instantiate-time. If no such calls were present at instantiation, these updates cannot be performed at all.
21430    ///   + Neither `hGraph` nor `hGraphExec` may contain device-updatable kernel nodes.
21431    /// * Memset and memcpy nodes:
21432    ///
21433    ///   + The CUDA device(s) to which the operand(s) was allocated/mapped cannot change.
21434    ///   + The source/destination memory must be allocated from the same contexts as the original source/destination memory.
21435    ///   + For 2d memsets, only address and assigned value may be updated.
21436    ///   + For 1d memsets, updating dimensions is also allowed, but may fail if the resulting operation doesn’t map onto the work resources already allocated for the node.
21437    /// * Additional memcpy node restrictions:
21438    ///
21439    ///   + Changing either the source or destination memory type(i.e. [`CUmemorytype::CU_MEMORYTYPE_DEVICE`], [`CUmemorytype::CU_MEMORYTYPE_ARRAY`], etc.) is not supported.
21440    /// * External semaphore wait nodes and record nodes:
21441    ///
21442    ///   + Changing the number of semaphores is not supported.
21443    /// * Conditional nodes:
21444    ///
21445    ///   + Changing node parameters is not supported.
21446    ///   + Changing parameters of nodes within the conditional body graph is subject to the rules above.
21447    ///   + Conditional handle flags and default values are updated as part of the graph update.
21448    ///
21449    /// Note: The API may add further restrictions in future releases. The return code should always be checked.
21450    ///
21451    /// cuGraphExecUpdate sets the result member of `resultInfo` to [`CUgraphExecUpdateResult::CU_GRAPH_EXEC_UPDATE_ERROR_TOPOLOGY_CHANGED`] under the following conditions:
21452    ///
21453    /// * The count of nodes directly in `hGraphExec` and `hGraph` differ, in which case resultInfo->errorNode is set to NULL.
21454    /// * `hGraph` has more exit nodes than `hGraph`, in which case resultInfo->errorNode is set to one of the exit nodes in hGraph.
21455    /// * A node in `hGraph` has a different number of dependencies than the node from `hGraphExec` it is paired with, in which case resultInfo->errorNode is set to the node from `hGraph`.
21456    /// * A node in `hGraph` has a dependency that does not match with the corresponding dependency of the paired node from `hGraphExec`. resultInfo->errorNode will be set to the node from `hGraph`. resultInfo->errorFromNode will be set to the mismatched dependency. The dependencies are paired based on edge order and a dependency does not match when the nodes are already paired based on other edges examined in the graph.
21457    ///
21458    /// cuGraphExecUpdate sets the result member of `resultInfo` to:
21459    ///
21460    /// * [`CUgraphExecUpdateResult::CU_GRAPH_EXEC_UPDATE_ERROR`] if passed an invalid value.
21461    /// * [`CUgraphExecUpdateResult::CU_GRAPH_EXEC_UPDATE_ERROR_TOPOLOGY_CHANGED`] if the graph topology changed
21462    /// * [`CUgraphExecUpdateResult::CU_GRAPH_EXEC_UPDATE_ERROR_NODE_TYPE_CHANGED`] if the type of a node changed, in which case `hErrorNode_out` is set to the node from `hGraph`.
21463    /// * [`CUgraphExecUpdateResult::CU_GRAPH_EXEC_UPDATE_ERROR_UNSUPPORTED_FUNCTION_CHANGE`] if the function changed in an unsupported way(see note above), in which case `hErrorNode_out` is set to the node from `hGraph`
21464    /// * [`CUgraphExecUpdateResult::CU_GRAPH_EXEC_UPDATE_ERROR_PARAMETERS_CHANGED`] if any parameters to a node changed in a way that is not supported, in which case `hErrorNode_out` is set to the node from `hGraph`.
21465    /// * [`CUgraphExecUpdateResult::CU_GRAPH_EXEC_UPDATE_ERROR_ATTRIBUTES_CHANGED`] if any attributes of a node changed in a way that is not supported, in which case `hErrorNode_out` is set to the node from `hGraph`.
21466    /// * [`CUgraphExecUpdateResult::CU_GRAPH_EXEC_UPDATE_ERROR_NOT_SUPPORTED`] if something about a node is unsupported, like the node’s type or configuration, in which case `hErrorNode_out` is set to the node from `hGraph`
21467    ///
21468    /// If the update fails for a reason not listed above, the result member of `resultInfo` will be set to [`CUgraphExecUpdateResult::CU_GRAPH_EXEC_UPDATE_ERROR`]. If the update succeeds, the result member will be set to [`CUgraphExecUpdateResult::CU_GRAPH_EXEC_UPDATE_SUCCESS`].
21469    ///
21470    /// cuGraphExecUpdate returns [`CUresult::CUDA_SUCCESS`] when the updated was performed successfully. It returns [`CUresult::CUDA_ERROR_GRAPH_EXEC_UPDATE_FAILURE`] if the graph update was not performed because it included changes which violated constraints specific to instantiated graph update.
21471    ///
21472    /// Note: Graph objects are not threadsafe. More here.
21473    ///
21474    /// Note that this function may also return error codes from previous, asynchronous launches.
21475    ///
21476    /// # Parameters
21477    ///
21478    /// - `hGraphExec`: The instantiated graph to be updated.
21479    /// - `hGraph`: The graph containing the updated parameters.
21480    /// - `resultInfo`: the error info structure.
21481    ///
21482    /// # Return value
21483    ///
21484    /// - [`CUresult::CUDA_SUCCESS`]
21485    /// - [`CUresult::CUDA_ERROR_GRAPH_EXEC_UPDATE_FAILURE`]
21486    ///
21487    /// See also: `cuGraphInstantiate`.
21488    pub fn cuGraphExecUpdate_v2(
21489        hGraphExec: CUgraphExec,
21490        hGraph: CUgraph,
21491        resultInfo: *mut CUgraphExecUpdateResultInfo,
21492    ) -> CUresult;
21493}
21494singe_loader::functions! { crate::DRIVER;
21495    /// Copies attributes from source node to destination node.
21496    ///
21497    /// Copies attributes from source node `src` to destination node `dst`. Both node must have the same context.
21498    ///
21499    /// Note that this function may also return error codes from previous, asynchronous launches.
21500    ///
21501    /// # Parameters
21502    ///
21503    /// - `dst`: Destination node.
21504    /// - `src`: Source node For list of attributes see CUkernelNodeAttrID.
21505    ///
21506    /// # Return value
21507    ///
21508    /// - [`CUresult::CUDA_SUCCESS`]
21509    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21510    ///
21511    /// See also: [`CUaccessPolicyWindow`].
21512    pub fn cuGraphKernelNodeCopyAttributes(
21513        dst: CUgraphNode,
21514        src: CUgraphNode,
21515    ) -> CUresult;
21516}
21517singe_loader::functions! { crate::DRIVER;
21518    /// Queries node attribute.
21519    ///
21520    /// Queries attribute `attr` from node `hNode` and stores it in corresponding member of `value_out`.
21521    ///
21522    /// Note that this function may also return error codes from previous, asynchronous launches.
21523    ///
21524    /// # Return value
21525    ///
21526    /// - [`CUresult::CUDA_SUCCESS`]
21527    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21528    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
21529    ///
21530    /// See also: [`CUaccessPolicyWindow`].
21531    pub fn cuGraphKernelNodeGetAttribute(
21532        hNode: CUgraphNode,
21533        attr: CUkernelNodeAttrID,
21534        value_out: *mut CUkernelNodeAttrValue,
21535    ) -> CUresult;
21536}
21537singe_loader::functions! { crate::DRIVER;
21538    /// Sets node attribute.
21539    ///
21540    /// Sets attribute `attr` on node `hNode` from corresponding attribute of `value`.
21541    ///
21542    /// Note that this function may also return error codes from previous, asynchronous launches.
21543    ///
21544    /// # Return value
21545    ///
21546    /// - [`CUresult::CUDA_SUCCESS`]
21547    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21548    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
21549    ///
21550    /// See also: [`CUaccessPolicyWindow`].
21551    pub fn cuGraphKernelNodeSetAttribute(
21552        hNode: CUgraphNode,
21553        attr: CUkernelNodeAttrID,
21554        value: *const CUkernelNodeAttrValue,
21555    ) -> CUresult;
21556}
21557singe_loader::functions! { crate::DRIVER;
21558    /// Write a DOT file describing graph structure.
21559    ///
21560    /// Using the provided `hGraph`, write to `path` a DOT formatted description of the graph. By default this includes the graph topology, node types, node id, kernel names and memcpy direction. `flags` can be specified to write more detailed information about each node type such as parameter values, kernel attributes, node and function handles.
21561    ///
21562    /// # Parameters
21563    ///
21564    /// - `hGraph`: The graph to create a DOT file from.
21565    /// - `path`: The path to write the DOT file to.
21566    /// - `flags`: Flags from CUgraphDebugDot_flags for specifying which additional node information to write.
21567    ///
21568    /// # Return value
21569    ///
21570    /// - [`CUresult::CUDA_SUCCESS`]
21571    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21572    /// - [`CUresult::CUDA_ERROR_OPERATING_SYSTEM`]
21573    pub fn cuGraphDebugDotPrint(
21574        hGraph: CUgraph,
21575        path: *const ::core::ffi::c_char,
21576        flags: ::core::ffi::c_uint,
21577    ) -> CUresult;
21578}
21579singe_loader::functions! { crate::DRIVER;
21580    /// Create a user object.
21581    ///
21582    /// Create a user object with the specified destructor callback and initial reference count. The initial references are owned by the caller.
21583    ///
21584    /// Destructor callbacks cannot make CUDA API calls and should avoid blocking behavior, as they are executed by a shared internal thread. Another thread may be signaled to perform such actions, if it does not block forward progress of tasks scheduled through CUDA.
21585    ///
21586    /// See CUDA User Objects in the CUDA C++ Programming Guide for more information on user objects.
21587    ///
21588    /// # Parameters
21589    ///
21590    /// - `object_out`: Location to return the user object handle.
21591    /// - `ptr`: The pointer to pass to the destroy function.
21592    /// - `destroy`: Callback to free the user object when it is no longer in use.
21593    /// - `initialRefcount`: The initial refcount to create the object with, typically 1. The initial references are owned by the calling thread.
21594    /// - `flags`: Currently it is required to pass [`CUuserObject_flags_enum::CU_USER_OBJECT_NO_DESTRUCTOR_SYNC`], which is the only defined flag. This indicates that the destroy callback cannot be waited on by any CUDA API. Users requiring synchronization of the callback should signal its completion manually.
21595    ///
21596    /// # Return value
21597    ///
21598    /// - [`CUresult::CUDA_SUCCESS`]
21599    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21600    ///
21601    /// See also: [`cuUserObjectRetain`], [`cuUserObjectRelease`], [`cuGraphRetainUserObject`], [`cuGraphReleaseUserObject`], [`cuGraphCreate`].
21602    pub fn cuUserObjectCreate(
21603        object_out: *mut CUuserObject,
21604        ptr: *mut ::core::ffi::c_void,
21605        destroy: CUhostFn,
21606        initialRefcount: ::core::ffi::c_uint,
21607        flags: ::core::ffi::c_uint,
21608    ) -> CUresult;
21609}
21610singe_loader::functions! { crate::DRIVER;
21611    /// Retain a reference to a user object.
21612    ///
21613    /// Retains new references to a user object. The new references are owned by the caller.
21614    ///
21615    /// See CUDA User Objects in the CUDA C++ Programming Guide for more information on user objects.
21616    ///
21617    /// # Parameters
21618    ///
21619    /// - `object`: The object to retain.
21620    /// - `count`: The number of references to retain, typically 1. Must be nonzero and not larger than INT_MAX.
21621    ///
21622    /// # Return value
21623    ///
21624    /// - [`CUresult::CUDA_SUCCESS`]
21625    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21626    ///
21627    /// See also: [`cuUserObjectCreate`], [`cuUserObjectRelease`], [`cuGraphRetainUserObject`], [`cuGraphReleaseUserObject`], [`cuGraphCreate`].
21628    pub fn cuUserObjectRetain(
21629        object: CUuserObject,
21630        count: ::core::ffi::c_uint,
21631    ) -> CUresult;
21632}
21633singe_loader::functions! { crate::DRIVER;
21634    /// Release a reference to a user object.
21635    ///
21636    /// Releases user object references owned by the caller. The object’s destructor is invoked if the reference count reaches zero.
21637    ///
21638    /// It is undefined behavior to release references not owned by the caller, or to use a user object handle after all references are released.
21639    ///
21640    /// See CUDA User Objects in the CUDA C++ Programming Guide for more information on user objects.
21641    ///
21642    /// # Parameters
21643    ///
21644    /// - `object`: The object to release.
21645    /// - `count`: The number of references to release, typically 1. Must be nonzero and not larger than INT_MAX.
21646    ///
21647    /// # Return value
21648    ///
21649    /// - [`CUresult::CUDA_SUCCESS`]
21650    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21651    ///
21652    /// See also: [`cuUserObjectCreate`], [`cuUserObjectRetain`], [`cuGraphRetainUserObject`], [`cuGraphReleaseUserObject`], [`cuGraphCreate`].
21653    pub fn cuUserObjectRelease(
21654        object: CUuserObject,
21655        count: ::core::ffi::c_uint,
21656    ) -> CUresult;
21657}
21658singe_loader::functions! { crate::DRIVER;
21659    /// Retain a reference to a user object from a graph.
21660    ///
21661    /// Creates or moves user object references that will be owned by a CUDA graph.
21662    ///
21663    /// See CUDA User Objects in the CUDA C++ Programming Guide for more information on user objects.
21664    ///
21665    /// # Parameters
21666    ///
21667    /// - `graph`: The graph to associate the reference with.
21668    /// - `object`: The user object to retain a reference for.
21669    /// - `count`: The number of references to add to the graph, typically 1. Must be nonzero and not larger than INT_MAX.
21670    /// - `flags`: The optional flag [`CUuserObjectRetain_flags_enum::CU_GRAPH_USER_OBJECT_MOVE`] transfers references from the calling thread, rather than create new references. Pass 0 to create new references.
21671    ///
21672    /// # Return value
21673    ///
21674    /// - [`CUresult::CUDA_SUCCESS`]
21675    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21676    ///
21677    /// See also: [`cuUserObjectCreate`], [`cuUserObjectRetain`], [`cuUserObjectRelease`], [`cuGraphReleaseUserObject`], [`cuGraphCreate`].
21678    pub fn cuGraphRetainUserObject(
21679        graph: CUgraph,
21680        object: CUuserObject,
21681        count: ::core::ffi::c_uint,
21682        flags: ::core::ffi::c_uint,
21683    ) -> CUresult;
21684}
21685singe_loader::functions! { crate::DRIVER;
21686    /// Release a user object reference from a graph.
21687    ///
21688    /// Releases user object references owned by a graph.
21689    ///
21690    /// See CUDA User Objects in the CUDA C++ Programming Guide for more information on user objects.
21691    ///
21692    /// # Parameters
21693    ///
21694    /// - `graph`: The graph that will release the reference.
21695    /// - `object`: The user object to release a reference for.
21696    /// - `count`: The number of references to release, typically 1. Must be nonzero and not larger than INT_MAX.
21697    ///
21698    /// # Return value
21699    ///
21700    /// - [`CUresult::CUDA_SUCCESS`]
21701    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21702    ///
21703    /// See also: [`cuUserObjectCreate`], [`cuUserObjectRetain`], [`cuUserObjectRelease`], [`cuGraphRetainUserObject`], [`cuGraphCreate`].
21704    pub fn cuGraphReleaseUserObject(
21705        graph: CUgraph,
21706        object: CUuserObject,
21707        count: ::core::ffi::c_uint,
21708    ) -> CUresult;
21709}
21710singe_loader::functions! { crate::DRIVER;
21711    /// Adds a node of arbitrary type to a graph.
21712    ///
21713    /// Creates a new node in `hGraph` described by `nodeParams` with `numDependencies` dependencies specified via `dependencies`. `numDependencies` may be 0. `dependencies` may be null if `numDependencies` is 0. `dependencies` may not have any duplicate entries.
21714    ///
21715    /// `nodeParams` is a tagged union. The node type should be specified in the `type` field, and type-specific parameters in the corresponding union member. All unused bytes - that is, `reserved0` and all bytes past the utilized union member - must be set to zero. It is recommended to use brace initialization or memset to ensure all bytes are initialized.
21716    ///
21717    /// Note that for some node types, `nodeParams` may contain “out parameters” which are modified during the call, such as `nodeParams->alloc.dptr`.
21718    ///
21719    /// A handle to the new node will be returned in `phGraphNode`.
21720    ///
21721    /// Note: Graph objects are not threadsafe. More here.
21722    ///
21723    /// Note that this function may also return error codes from previous, asynchronous launches.
21724    ///
21725    /// # Parameters
21726    ///
21727    /// - `phGraphNode`: Returns newly created node.
21728    /// - `hGraph`: Graph to which to add the node.
21729    /// - `dependencies`: Dependencies of the node.
21730    /// - `dependencyData`: Optional edge data for the dependencies. If NULL, the data is assumed to be default (zeroed) for all dependencies.
21731    /// - `numDependencies`: Number of dependencies.
21732    /// - `nodeParams`: Specification of the node.
21733    ///
21734    /// # Return value
21735    ///
21736    /// - [`CUresult::CUDA_SUCCESS`]
21737    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21738    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
21739    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
21740    ///
21741    /// See also: [`cuGraphCreate`], [`cuGraphNodeSetParams`], [`cuGraphExecNodeSetParams`].
21742    pub fn cuGraphAddNode_v2(
21743        phGraphNode: *mut CUgraphNode,
21744        hGraph: CUgraph,
21745        dependencies: *const CUgraphNode,
21746        dependencyData: *const CUgraphEdgeData,
21747        numDependencies: size_t,
21748        nodeParams: *mut CUgraphNodeParams,
21749    ) -> CUresult;
21750}
21751singe_loader::functions! { crate::DRIVER;
21752    /// Adds a node of arbitrary type to a graph.
21753    ///
21754    /// Creates a new node in `hGraph` described by `nodeParams` with `numDependencies` dependencies specified via `dependencies`. `numDependencies` may be 0. `dependencies` may be null if `numDependencies` is 0. `dependencies` may not have any duplicate entries.
21755    ///
21756    /// `nodeParams` is a tagged union. The node type should be specified in the `type` field, and type-specific parameters in the corresponding union member. All unused bytes - that is, `reserved0` and all bytes past the utilized union member - must be set to zero. It is recommended to use brace initialization or memset to ensure all bytes are initialized.
21757    ///
21758    /// Note that for some node types, `nodeParams` may contain “out parameters” which are modified during the call, such as `nodeParams->alloc.dptr`.
21759    ///
21760    /// For kernel nodes, if both the kernel node’s [`CUfunction`] and ctx are non-NULL, the underlying device context of ctx must match the device context that the [`CUfunction`] was loaded into; otherwise the call returns [`cudaError_enum::CUDA_ERROR_INVALID_CONTEXT`].
21761    ///
21762    /// A handle to the new node will be returned in `phGraphNode`.
21763    ///
21764    /// Note: Graph objects are not threadsafe. More here.
21765    ///
21766    /// Note that this function may also return error codes from previous, asynchronous launches.
21767    ///
21768    /// # Parameters
21769    ///
21770    /// - `phGraphNode`: Returns newly created node.
21771    /// - `hGraph`: Graph to which to add the node.
21772    /// - `dependencies`: Dependencies of the node.
21773    /// - `dependencyData`: Optional edge data for the dependencies. If NULL, the data is assumed to be default (zeroed) for all dependencies.
21774    /// - `numDependencies`: Number of dependencies.
21775    /// - `nodeParams`: Specification of the node.
21776    ///
21777    /// # Return value
21778    ///
21779    /// - [`CUresult::CUDA_SUCCESS`]
21780    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21781    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
21782    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
21783    ///
21784    /// See also: [`cuGraphCreate`], [`cuGraphNodeSetParams_v2`], [`cuGraphExecNodeSetParams`].
21785    pub fn cuGraphAddNode_v3(
21786        phGraphNode: *mut CUgraphNode,
21787        hGraph: CUgraph,
21788        dependencies: *const CUgraphNode,
21789        dependencyData: *const CUgraphEdgeData,
21790        numDependencies: size_t,
21791        nodeParams: *mut CUgraphNodeParams,
21792    ) -> CUresult;
21793}
21794singe_loader::functions! { crate::DRIVER;
21795    /// Update a graph node’s parameters.
21796    ///
21797    /// Sets the parameters of graph node `hNode` to `nodeParams`. The node type specified by `nodeParams->type` must match the type of `hNode`. `nodeParams` must be fully initialized and all unused bytes (reserved, padding) zeroed.
21798    ///
21799    /// Modifying parameters is not supported for node types [`CUgraphNodeType::CU_GRAPH_NODE_TYPE_MEM_ALLOC`] and [`CUgraphNodeType::CU_GRAPH_NODE_TYPE_MEM_FREE`].
21800    ///
21801    /// Note: Graph objects are not threadsafe. More here.
21802    ///
21803    /// Note that this function may also return error codes from previous, asynchronous launches.
21804    ///
21805    /// # Parameters
21806    ///
21807    /// - `hNode`: Node to set the parameters for.
21808    /// - `nodeParams`: Parameters to copy.
21809    ///
21810    /// # Return value
21811    ///
21812    /// - [`CUresult::CUDA_SUCCESS`]
21813    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21814    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
21815    ///
21816    /// See also: [`cuGraphAddNode`], [`cuGraphNodeGetParams`], [`cuGraphExecNodeSetParams`].
21817    pub fn cuGraphNodeSetParams(
21818        hNode: CUgraphNode,
21819        nodeParams: *mut CUgraphNodeParams,
21820    ) -> CUresult;
21821}
21822singe_loader::functions! { crate::DRIVER;
21823    /// Update a graph node’s parameters.
21824    ///
21825    /// Sets the parameters of graph node `hNode` to `nodeParams`. The node type specified by `nodeParams->type` must match the type of `hNode`. `nodeParams` must be fully initialized and all unused bytes (reserved, padding) zeroed.
21826    ///
21827    /// Modifying parameters is not supported for node types [`CUgraphNodeType::CU_GRAPH_NODE_TYPE_MEM_ALLOC`] and [`CUgraphNodeType::CU_GRAPH_NODE_TYPE_MEM_FREE`].
21828    ///
21829    /// For kernel nodes, if both the kernel node’s [`CUfunction`] and ctx are non-NULL, the underlying device context of ctx must match the device context that the [`CUfunction`] was loaded into; otherwise the call returns [`cudaError_enum::CUDA_ERROR_INVALID_CONTEXT`].
21830    ///
21831    /// Note: Graph objects are not threadsafe. More here.
21832    ///
21833    /// Note that this function may also return error codes from previous, asynchronous launches.
21834    ///
21835    /// # Parameters
21836    ///
21837    /// - `hNode`: Node to set the parameters for.
21838    /// - `nodeParams`: Parameters to copy.
21839    ///
21840    /// # Return value
21841    ///
21842    /// - [`CUresult::CUDA_SUCCESS`]
21843    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21844    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
21845    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
21846    ///
21847    /// See also: [`cuGraphAddNode_v3`], [`cuGraphNodeGetParams`], [`cuGraphExecNodeSetParams`].
21848    pub fn cuGraphNodeSetParams_v2(
21849        hNode: CUgraphNode,
21850        nodeParams: *mut CUgraphNodeParams,
21851    ) -> CUresult;
21852}
21853singe_loader::functions! { crate::DRIVER;
21854    /// Return a graph node’s parameters.
21855    ///
21856    /// Returns the parameters of graph node `hNode` in `*nodeParams`.
21857    ///
21858    /// Any pointers returned in `*nodeParams` point to driver-owned memory associated with the node. This memory remains valid until the node is destroyed. Any memory pointed to from `*nodeParams` must not be modified.
21859    ///
21860    /// The returned parameters are a description of the node, but may not be identical to the struct provided at creation and may not be suitable for direct creation of identical nodes. This is because parameters may be partially unspecified and filled in by the driver at creation, may reference non-copyable handles, or may describe ownership semantics or other parameters that govern behavior of node creation but are not part of the final functional descriptor.
21861    ///
21862    /// Note: Graph objects are not threadsafe. More here.
21863    ///
21864    /// Note that this function may also return error codes from previous, asynchronous launches.
21865    ///
21866    /// # Parameters
21867    ///
21868    /// - `hNode`: Node to get the parameters for.
21869    /// - `nodeParams`: Pointer to return the parameters.
21870    ///
21871    /// # Return value
21872    ///
21873    /// - [`CUresult::CUDA_SUCCESS`]
21874    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
21875    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
21876    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21877    ///
21878    /// See also: [`cuGraphNodeSetParams`], [`cuGraphAddNode`], [`cuGraphExecNodeSetParams`].
21879    pub fn cuGraphNodeGetParams(
21880        hNode: CUgraphNode,
21881        nodeParams: *mut CUgraphNodeParams,
21882    ) -> CUresult;
21883}
21884singe_loader::functions! { crate::DRIVER;
21885    /// Update a graph node’s parameters in an instantiated graph.
21886    ///
21887    /// Sets the parameters of a node in an executable graph `hGraphExec`. The node is identified by the corresponding node `hNode` in the non-executable graph from which the executable graph was instantiated. `hNode` must not have been removed from the original graph.
21888    ///
21889    /// The modifications only affect future launches of `hGraphExec`. Already enqueued or running launches of `hGraphExec` are not affected by this call. `hNode` is also not modified by this call.
21890    ///
21891    /// Allowed changes to parameters on executable graphs are as follows:
21892    ///
21893    /// | Node type | Allowed changes |
21894    /// | --- | --- |
21895    /// | kernel | See cuGraphExecKernelNodeSetParams |
21896    /// | memcpy | Addresses for 1-dimensional copies if allocated in same context; see [`cuGraphExecMemcpyNodeSetParams`] |
21897    /// | memset | Addresses for 1-dimensional memsets if allocated in same context; see [`cuGraphExecMemsetNodeSetParams`] |
21898    /// | host | Context changes are not allowed |
21899    /// | child graph | Topology must match and restrictions apply recursively; see cuGraphExecUpdate |
21900    /// | event wait | Unrestricted |
21901    /// | event record | Event only, context changes are not allowed |
21902    /// | external semaphore signal | Number of semaphore operations and context cannot change |
21903    /// | external semaphore wait | Number of semaphore operations and context cannot change |
21904    /// | memory allocation | API unsupported |
21905    /// | memory free | API unsupported |
21906    /// | batch memops | Addresses, values, and operation type for wait operations; see [`cuGraphExecBatchMemOpNodeSetParams`] |
21907    ///
21908    /// Note: Graph objects are not threadsafe. More here.
21909    ///
21910    /// Note that this function may also return error codes from previous, asynchronous launches.
21911    ///
21912    /// # Parameters
21913    ///
21914    /// - `hGraphExec`: The executable graph in which to update the specified node.
21915    /// - `hNode`: Corresponding node from the graph from which graphExec was instantiated.
21916    /// - `nodeParams`: Updated Parameters to set.
21917    ///
21918    /// # Return value
21919    ///
21920    /// - [`CUresult::CUDA_SUCCESS`]
21921    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21922    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
21923    ///
21924    /// See also: [`cuGraphAddNode`], [`cuGraphNodeSetParams`], [`cuGraphExecUpdate`], `cuGraphInstantiate`.
21925    pub fn cuGraphExecNodeSetParams(
21926        hGraphExec: CUgraphExec,
21927        hNode: CUgraphNode,
21928        nodeParams: *mut CUgraphNodeParams,
21929    ) -> CUresult;
21930}
21931singe_loader::functions! { crate::DRIVER;
21932    /// Create a conditional handle.
21933    ///
21934    /// Creates a conditional handle associated with `hGraph`.
21935    ///
21936    /// The conditional handle must be associated with a conditional node in this graph or one of its children.
21937    ///
21938    /// Handles not associated with a conditional node may cause graph instantiation to fail.
21939    ///
21940    /// Handles can only be set from the context with which they are associated.
21941    ///
21942    /// Note: Graph objects are not threadsafe. More here.
21943    ///
21944    /// Note that this function may also return error codes from previous, asynchronous launches.
21945    ///
21946    /// # Parameters
21947    ///
21948    /// - `pHandle_out`: Pointer used to return the handle to the caller.
21949    /// - `hGraph`: Graph which will contain the conditional node using this handle.
21950    /// - `ctx`: Context for the handle and associated conditional node.
21951    /// - `defaultLaunchValue`: Optional initial value for the conditional variable. Applied at the beginning of each graph execution if CU_GRAPH_COND_ASSIGN_DEFAULT is set in `flags`.
21952    /// - `flags`: Currently must be CU_GRAPH_COND_ASSIGN_DEFAULT or 0.
21953    ///
21954    /// # Return value
21955    ///
21956    /// - [`CUresult::CUDA_SUCCESS`]
21957    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21958    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
21959    ///
21960    /// See also: [`cuGraphAddNode`].
21961    pub fn cuGraphConditionalHandleCreate(
21962        pHandle_out: *mut CUgraphConditionalHandle,
21963        hGraph: CUgraph,
21964        ctx: CUcontext,
21965        defaultLaunchValue: ::core::ffi::c_uint,
21966        flags: ::core::ffi::c_uint,
21967    ) -> CUresult;
21968}
21969singe_loader::functions! { crate::DRIVER;
21970    /// Returns occupancy of a function.
21971    ///
21972    /// Returns in `*numBlocks` the number of the maximum active blocks per streaming multiprocessor.
21973    ///
21974    /// Note that the API can also be used with context-less kernel [`CUkernel`] by querying the handle using [`cuLibraryGetKernel`] and then passing it to the API by casting to [`CUfunction`]. Here, the context to use for calculations will be the current context.
21975    ///
21976    /// Note that this function may also return error codes from previous, asynchronous launches.
21977    ///
21978    /// # Parameters
21979    ///
21980    /// - `numBlocks`: Returned occupancy.
21981    /// - `func`: Kernel for which occupancy is calculated.
21982    /// - `blockSize`: Block size the kernel is intended to be launched with.
21983    /// - `dynamicSMemSize`: Per-block dynamic shared memory usage intended, in bytes.
21984    ///
21985    /// # Return value
21986    ///
21987    /// - [`CUresult::CUDA_SUCCESS`]
21988    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
21989    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
21990    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
21991    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
21992    /// - [`CUresult::CUDA_ERROR_UNKNOWN`]
21993    ///
21994    /// See also: `cudaOccupancyMaxActiveBlocksPerMultiprocessor`.
21995    pub fn cuOccupancyMaxActiveBlocksPerMultiprocessor(
21996        numBlocks: *mut ::core::ffi::c_int,
21997        func: CUfunction,
21998        blockSize: ::core::ffi::c_int,
21999        dynamicSMemSize: size_t,
22000    ) -> CUresult;
22001}
22002singe_loader::functions! { crate::DRIVER;
22003    /// Returns occupancy of a function.
22004    ///
22005    /// Returns in `*numBlocks` the number of the maximum active blocks per streaming multiprocessor.
22006    ///
22007    /// The `Flags` parameter controls how special cases are handled. The valid flags are:
22008    ///
22009    /// * [`CUoccupancy_flags_enum::CU_OCCUPANCY_DEFAULT`], which maintains the default behavior as [`cuOccupancyMaxActiveBlocksPerMultiprocessor`];
22010    /// * [`CUoccupancy_flags_enum::CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE`], which suppresses the default behavior on platform where global caching affects occupancy. On such platforms, if caching is enabled, but per-block SM resource usage would result in zero occupancy, the occupancy calculator will calculate the occupancy as if caching is disabled. Setting [`CUoccupancy_flags_enum::CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE`] makes the occupancy calculator to return 0 in such cases. More information can be found about this feature in the “Unified L1/Texture Cache” section of the Maxwell tuning guide.
22011    ///
22012    /// Note that the API can also be with launch context-less kernel [`CUkernel`] by querying the handle using [`cuLibraryGetKernel`] and then passing it to the API by casting to [`CUfunction`]. Here, the context to use for calculations will be the current context.
22013    ///
22014    /// Note that this function may also return error codes from previous, asynchronous launches.
22015    ///
22016    /// # Parameters
22017    ///
22018    /// - `numBlocks`: Returned occupancy.
22019    /// - `func`: Kernel for which occupancy is calculated.
22020    /// - `blockSize`: Block size the kernel is intended to be launched with.
22021    /// - `dynamicSMemSize`: Per-block dynamic shared memory usage intended, in bytes.
22022    /// - `flags`: Requested behavior for the occupancy calculator.
22023    ///
22024    /// # Return value
22025    ///
22026    /// - [`CUresult::CUDA_SUCCESS`]
22027    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22028    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22029    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22030    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22031    /// - [`CUresult::CUDA_ERROR_UNKNOWN`]
22032    ///
22033    /// See also: `cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags`.
22034    pub fn cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(
22035        numBlocks: *mut ::core::ffi::c_int,
22036        func: CUfunction,
22037        blockSize: ::core::ffi::c_int,
22038        dynamicSMemSize: size_t,
22039        flags: ::core::ffi::c_uint,
22040    ) -> CUresult;
22041}
22042singe_loader::functions! { crate::DRIVER;
22043    /// Suggest a launch configuration with reasonable occupancy.
22044    ///
22045    /// Returns in `*blockSize` a reasonable block size that can achieve the maximum occupancy (or, the maximum number of active warps with the fewest blocks per multiprocessor), and in `*minGridSize` the minimum grid size to achieve the maximum occupancy.
22046    ///
22047    /// If `blockSizeLimit` is 0, the configurator will use the maximum block size permitted by the device / function instead.
22048    ///
22049    /// If per-block dynamic shared memory allocation is not needed, the user should leave both `blockSizeToDynamicSMemSize` and `dynamicSMemSize` as 0.
22050    ///
22051    /// If per-block dynamic shared memory allocation is needed, then if the dynamic shared memory size is constant regardless of block size, the size should be passed through `dynamicSMemSize`, and `blockSizeToDynamicSMemSize` should be NULL.
22052    ///
22053    /// Otherwise, if the per-block dynamic shared memory size varies with different block sizes, the user needs to provide a unary function through `blockSizeToDynamicSMemSize` that computes the dynamic shared memory needed by `func` for any given block size. `dynamicSMemSize` is ignored. An example signature is:
22054    ///
22055    /// ```text
22056    /// // Take block size, returns dynamic shared memory needed
22057    /// size_t blockToSmem(int blockSize);
22058    /// ```
22059    ///
22060    /// Note that the API can also be used with context-less kernel [`CUkernel`] by querying the handle using [`cuLibraryGetKernel`] and then passing it to the API by casting to [`CUfunction`]. Here, the context to use for calculations will be the current context.
22061    ///
22062    /// Note that this function may also return error codes from previous, asynchronous launches.
22063    ///
22064    /// # Parameters
22065    ///
22066    /// - `minGridSize`: Returned minimum grid size needed to achieve the maximum occupancy.
22067    /// - `blockSize`: Returned maximum block size that can achieve the maximum occupancy.
22068    /// - `func`: Kernel for which launch configuration is calculated.
22069    /// - `blockSizeToDynamicSMemSize`: A function that calculates how much per-block dynamic shared memory `func` uses based on the block size.
22070    /// - `dynamicSMemSize`: Dynamic shared memory usage intended, in bytes.
22071    /// - `blockSizeLimit`: The maximum block size `func` is designed to handle.
22072    ///
22073    /// # Return value
22074    ///
22075    /// - [`CUresult::CUDA_SUCCESS`]
22076    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22077    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22078    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22079    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22080    /// - [`CUresult::CUDA_ERROR_UNKNOWN`]
22081    ///
22082    /// See also: `cudaOccupancyMaxPotentialBlockSize`.
22083    pub fn cuOccupancyMaxPotentialBlockSize(
22084        minGridSize: *mut ::core::ffi::c_int,
22085        blockSize: *mut ::core::ffi::c_int,
22086        func: CUfunction,
22087        blockSizeToDynamicSMemSize: CUoccupancyB2DSize,
22088        dynamicSMemSize: size_t,
22089        blockSizeLimit: ::core::ffi::c_int,
22090    ) -> CUresult;
22091}
22092singe_loader::functions! { crate::DRIVER;
22093    /// Suggest a launch configuration with reasonable occupancy.
22094    ///
22095    /// An extended version of [`cuOccupancyMaxPotentialBlockSize`]. In addition to arguments passed to [`cuOccupancyMaxPotentialBlockSize`], [`cuOccupancyMaxPotentialBlockSizeWithFlags`] also takes a `Flags` parameter.
22096    ///
22097    /// The `Flags` parameter controls how special cases are handled. The valid flags are:
22098    ///
22099    /// * [`CUoccupancy_flags_enum::CU_OCCUPANCY_DEFAULT`], which maintains the default behavior as [`cuOccupancyMaxPotentialBlockSize`];
22100    /// * [`CUoccupancy_flags_enum::CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE`], which suppresses the default behavior on platform where global caching affects occupancy. On such platforms, the launch configurations that produces maximal occupancy might not support global caching. Setting [`CUoccupancy_flags_enum::CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE`] guarantees that the produced launch configuration is global caching compatible at a potential cost of occupancy. More information can be found about this feature in the “Unified L1/Texture Cache” section of the Maxwell tuning guide.
22101    ///
22102    /// Note that the API can also be used with context-less kernel [`CUkernel`] by querying the handle using [`cuLibraryGetKernel`] and then passing it to the API by casting to [`CUfunction`]. Here, the context to use for calculations will be the current context.
22103    ///
22104    /// Note that this function may also return error codes from previous, asynchronous launches.
22105    ///
22106    /// # Parameters
22107    ///
22108    /// - `minGridSize`: Returned minimum grid size needed to achieve the maximum occupancy.
22109    /// - `blockSize`: Returned maximum block size that can achieve the maximum occupancy.
22110    /// - `func`: Kernel for which launch configuration is calculated.
22111    /// - `blockSizeToDynamicSMemSize`: A function that calculates how much per-block dynamic shared memory `func` uses based on the block size.
22112    /// - `dynamicSMemSize`: Dynamic shared memory usage intended, in bytes.
22113    /// - `blockSizeLimit`: The maximum block size `func` is designed to handle.
22114    /// - `flags`: Options.
22115    ///
22116    /// # Return value
22117    ///
22118    /// - [`CUresult::CUDA_SUCCESS`]
22119    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22120    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22121    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22122    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22123    /// - [`CUresult::CUDA_ERROR_UNKNOWN`]
22124    ///
22125    /// See also: `cudaOccupancyMaxPotentialBlockSizeWithFlags`.
22126    pub fn cuOccupancyMaxPotentialBlockSizeWithFlags(
22127        minGridSize: *mut ::core::ffi::c_int,
22128        blockSize: *mut ::core::ffi::c_int,
22129        func: CUfunction,
22130        blockSizeToDynamicSMemSize: CUoccupancyB2DSize,
22131        dynamicSMemSize: size_t,
22132        blockSizeLimit: ::core::ffi::c_int,
22133        flags: ::core::ffi::c_uint,
22134    ) -> CUresult;
22135}
22136singe_loader::functions! { crate::DRIVER;
22137    /// Returns dynamic shared memory available per block when launching `numBlocks` blocks on SM.
22138    ///
22139    /// Returns in `*dynamicSmemSize` the maximum size of dynamic shared memory to allow `numBlocks` blocks per SM.
22140    ///
22141    /// Note that the API can also be used with context-less kernel [`CUkernel`] by querying the handle using [`cuLibraryGetKernel`] and then passing it to the API by casting to [`CUfunction`]. Here, the context to use for calculations will be the current context.
22142    ///
22143    /// Note that this function may also return error codes from previous, asynchronous launches.
22144    ///
22145    /// # Parameters
22146    ///
22147    /// - `dynamicSmemSize`: Returned maximum dynamic shared memory.
22148    /// - `func`: Kernel function for which occupancy is calculated.
22149    /// - `numBlocks`: Number of blocks to fit on SM.
22150    /// - `blockSize`: Size of the blocks.
22151    ///
22152    /// # Return value
22153    ///
22154    /// - [`CUresult::CUDA_SUCCESS`]
22155    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22156    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22157    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22158    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22159    /// - [`CUresult::CUDA_ERROR_UNKNOWN`]
22160    pub fn cuOccupancyAvailableDynamicSMemPerBlock(
22161        dynamicSmemSize: *mut size_t,
22162        func: CUfunction,
22163        numBlocks: ::core::ffi::c_int,
22164        blockSize: ::core::ffi::c_int,
22165    ) -> CUresult;
22166}
22167singe_loader::functions! { crate::DRIVER;
22168    /// Given the kernel function (`func`) and launch configuration (`config`), return the maximum cluster size in `*clusterSize`.
22169    ///
22170    /// The cluster dimensions in `config` are ignored. If func has a required cluster size set (see `cudaFuncGetAttributes` / [`cuFuncGetAttribute`]),`*clusterSize` will reflect the required cluster size.
22171    ///
22172    /// By default this function will always return a value that’s portable on future hardware. A higher value may be returned if the kernel function allows non-portable cluster sizes.
22173    ///
22174    /// This function will respect the compile time launch bounds.
22175    ///
22176    /// Note that the API can also be used with context-less kernel [`CUkernel`] by querying the handle using [`cuLibraryGetKernel`] and then passing it to the API by casting to [`CUfunction`]. Here, the context to use for calculations will either be taken from the specified stream `config->hStream` or the current context in case of NULL stream.
22177    ///
22178    /// Note that this function may also return error codes from previous, asynchronous launches.
22179    ///
22180    /// # Parameters
22181    ///
22182    /// - `clusterSize`: Returned maximum cluster size that can be launched for the given kernel function and launch configuration.
22183    /// - `func`: Kernel function for which maximum cluster size is calculated.
22184    /// - `config`: Launch configuration for the given kernel function.
22185    ///
22186    /// # Return value
22187    ///
22188    /// - [`CUresult::CUDA_SUCCESS`]
22189    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22190    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22191    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22192    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22193    /// - [`CUresult::CUDA_ERROR_UNKNOWN`]
22194    ///
22195    /// See also: `cudaFuncGetAttributes`, [`cuFuncGetAttribute`].
22196    pub fn cuOccupancyMaxPotentialClusterSize(
22197        clusterSize: *mut ::core::ffi::c_int,
22198        func: CUfunction,
22199        config: *const CUlaunchConfig,
22200    ) -> CUresult;
22201}
22202singe_loader::functions! { crate::DRIVER;
22203    /// Given the kernel function (`func`) and launch configuration (`config`), return the maximum number of clusters that could co-exist on the target device in `*numClusters`.
22204    ///
22205    /// If the function has required cluster size already set (see `cudaFuncGetAttributes` / [`cuFuncGetAttribute`]), the cluster size from config must either be unspecified or match the required size. Without required sizes, the cluster size must be specified in config, else the function will return an error.
22206    ///
22207    /// Note that various attributes of the kernel function may affect occupancy calculation. Runtime environment may affect how the hardware schedules the clusters, so the calculated occupancy is not guaranteed to be achievable.
22208    ///
22209    /// Note that the API can also be used with context-less kernel [`CUkernel`] by querying the handle using [`cuLibraryGetKernel`] and then passing it to the API by casting to [`CUfunction`]. Here, the context to use for calculations will either be taken from the specified stream `config->hStream` or the current context in case of NULL stream.
22210    ///
22211    /// Note that this function may also return error codes from previous, asynchronous launches.
22212    ///
22213    /// # Parameters
22214    ///
22215    /// - `numClusters`: Returned maximum number of clusters that could co-exist on the target device.
22216    /// - `func`: Kernel function for which maximum number of clusters are calculated.
22217    /// - `config`: Launch configuration for the given kernel function.
22218    ///
22219    /// # Return value
22220    ///
22221    /// - [`CUresult::CUDA_SUCCESS`]
22222    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22223    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22224    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22225    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22226    /// - [`CUresult::CUDA_ERROR_INVALID_CLUSTER_SIZE`]
22227    /// - [`CUresult::CUDA_ERROR_UNKNOWN`]
22228    ///
22229    /// See also: `cudaFuncGetAttributes`, [`cuFuncGetAttribute`].
22230    pub fn cuOccupancyMaxActiveClusters(
22231        numClusters: *mut ::core::ffi::c_int,
22232        func: CUfunction,
22233        config: *const CUlaunchConfig,
22234    ) -> CUresult;
22235}
22236singe_loader::functions! { crate::DRIVER;
22237    /// Binds an array as a texture reference.
22238    ///
22239    /// Binds the CUDA array `hArray` to the texture reference `hTexRef`. Any previous address or CUDA array state associated with the texture reference is superseded by this function. `Flags` must be set to [`CU_TRSA_OVERRIDE_FORMAT`]. Any CUDA array previously bound to `hTexRef` is unbound.
22240    ///
22241    /// # Parameters
22242    ///
22243    /// - `hTexRef`: Texture reference to bind.
22244    /// - `hArray`: Array to bind.
22245    /// - `Flags`: Options (must be [`CU_TRSA_OVERRIDE_FORMAT`]).
22246    ///
22247    /// # Return value
22248    ///
22249    /// - [`CUresult::CUDA_SUCCESS`]
22250    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22251    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22252    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22253    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22254    ///
22255    /// See also: [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D`], [`cuTexRefSetAddressMode`], [`cuTexRefSetFilterMode`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
22256    #[deprecated]
22257    pub fn cuTexRefSetArray(
22258        hTexRef: CUtexref,
22259        hArray: CUarray,
22260        Flags: ::core::ffi::c_uint,
22261    ) -> CUresult;
22262}
22263singe_loader::functions! { crate::DRIVER;
22264    /// Binds a mipmapped array to a texture reference.
22265    ///
22266    /// Binds the CUDA mipmapped array `hMipmappedArray` to the texture reference `hTexRef`. Any previous address or CUDA array state associated with the texture reference is superseded by this function. `Flags` must be set to [`CU_TRSA_OVERRIDE_FORMAT`]. Any CUDA array previously bound to `hTexRef` is unbound.
22267    ///
22268    /// # Parameters
22269    ///
22270    /// - `hTexRef`: Texture reference to bind.
22271    /// - `hMipmappedArray`: Mipmapped array to bind.
22272    /// - `Flags`: Options (must be [`CU_TRSA_OVERRIDE_FORMAT`]).
22273    ///
22274    /// # Return value
22275    ///
22276    /// - [`CUresult::CUDA_SUCCESS`]
22277    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22278    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22279    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22280    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22281    ///
22282    /// See also: [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D`], [`cuTexRefSetAddressMode`], [`cuTexRefSetFilterMode`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
22283    #[deprecated]
22284    pub fn cuTexRefSetMipmappedArray(
22285        hTexRef: CUtexref,
22286        hMipmappedArray: CUmipmappedArray,
22287        Flags: ::core::ffi::c_uint,
22288    ) -> CUresult;
22289}
22290singe_loader::functions! { crate::DRIVER;
22291    /// Binds an address as a texture reference.
22292    ///
22293    /// Binds a linear address range to the texture reference `hTexRef`. Any previous address or CUDA array state associated with the texture reference is superseded by this function. Any memory previously bound to `hTexRef` is unbound.
22294    ///
22295    /// Since the hardware enforces an alignment requirement on texture base addresses, cuTexRefSetAddress() passes back a byte offset in `*ByteOffset` that must be applied to texture fetches in order to read from the desired memory. This offset must be divided by the texel size and passed to kernels that read from the texture so they can be applied to the `tex1Dfetch()` function.
22296    ///
22297    /// If the device memory pointer was returned from cuMemAlloc(), the offset is guaranteed to be 0 and NULL may be passed as the `ByteOffset` parameter.
22298    ///
22299    /// The total number of elements (or texels) in the linear address range cannot exceed [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH`]. The number of elements is computed as (`bytes` / bytesPerElement), where bytesPerElement is determined from the data format and number of components set using [`cuTexRefSetFormat`].
22300    ///
22301    /// # Parameters
22302    ///
22303    /// - `ByteOffset`: Returned byte offset.
22304    /// - `hTexRef`: Texture reference to bind.
22305    /// - `dptr`: Device pointer to bind.
22306    /// - `bytes`: Size of memory to bind in bytes.
22307    ///
22308    /// # Return value
22309    ///
22310    /// - [`CUresult::CUDA_SUCCESS`]
22311    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22312    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22313    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22314    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22315    ///
22316    /// See also: [`cuTexRefSetAddress2D`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFilterMode`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
22317    #[deprecated]
22318    pub fn cuTexRefSetAddress_v2(
22319        ByteOffset: *mut size_t,
22320        hTexRef: CUtexref,
22321        dptr: CUdeviceptr,
22322        bytes: size_t,
22323    ) -> CUresult;
22324}
22325singe_loader::functions! { crate::DRIVER;
22326    /// Binds an address as a 2D texture reference.
22327    ///
22328    /// Binds a linear address range to the texture reference `hTexRef`. Any previous address or CUDA array state associated with the texture reference is superseded by this function. Any memory previously bound to `hTexRef` is unbound.
22329    ///
22330    /// Using a `tex2D()` function inside a kernel requires a call to either [`cuTexRefSetArray`] to bind the corresponding texture reference to an array, or cuTexRefSetAddress2D() to bind the texture reference to linear memory.
22331    ///
22332    /// Function calls to [`cuTexRefSetFormat`] cannot follow calls to cuTexRefSetAddress2D() for the same texture reference.
22333    ///
22334    /// It is required that `dptr` be aligned to the appropriate hardware-specific texture alignment. You can query this value using the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT`]. If an unaligned `dptr` is supplied, [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned.
22335    ///
22336    /// `Pitch` has to be aligned to the hardware-specific texture pitch alignment. This value can be queried using the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT`]. If an unaligned `Pitch` is supplied, [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned.
22337    ///
22338    /// Width and Height, which are specified in elements (or texels), cannot exceed [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH`] and [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT`] respectively. `Pitch`, which is specified in bytes, cannot exceed [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH`].
22339    ///
22340    /// # Parameters
22341    ///
22342    /// - `hTexRef`: Texture reference to bind.
22343    /// - `desc`: Descriptor of CUDA array.
22344    /// - `dptr`: Device pointer to bind.
22345    /// - `Pitch`: Line pitch in bytes.
22346    ///
22347    /// # Return value
22348    ///
22349    /// - [`CUresult::CUDA_SUCCESS`]
22350    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22351    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22352    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22353    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22354    ///
22355    /// See also: [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFilterMode`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
22356    #[deprecated]
22357    pub fn cuTexRefSetAddress2D_v3(
22358        hTexRef: CUtexref,
22359        desc: *const CUDA_ARRAY_DESCRIPTOR,
22360        dptr: CUdeviceptr,
22361        Pitch: size_t,
22362    ) -> CUresult;
22363}
22364singe_loader::functions! { crate::DRIVER;
22365    /// Sets the format for a texture reference.
22366    ///
22367    /// Specifies the format of the data to be read by the texture reference `hTexRef`. `fmt` and `NumPackedComponents` are exactly analogous to the `Format` and `NumChannels` members of the CUDA_ARRAY_DESCRIPTOR structure: They specify the format of each component and the number of components per array element.
22368    ///
22369    /// # Parameters
22370    ///
22371    /// - `hTexRef`: Texture reference.
22372    /// - `fmt`: Format to set.
22373    /// - `NumPackedComponents`: Number of components per array element.
22374    ///
22375    /// # Return value
22376    ///
22377    /// - [`CUresult::CUDA_SUCCESS`]
22378    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22379    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22380    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22381    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22382    ///
22383    /// See also: [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFilterMode`], [`cuTexRefSetFlags`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`], `cudaCreateChannelDesc`.
22384    #[deprecated]
22385    pub fn cuTexRefSetFormat(
22386        hTexRef: CUtexref,
22387        fmt: CUarray_format,
22388        NumPackedComponents: ::core::ffi::c_int,
22389    ) -> CUresult;
22390}
22391singe_loader::functions! { crate::DRIVER;
22392    /// Sets the addressing mode for a texture reference.
22393    ///
22394    /// Specifies the addressing mode `am` for the given dimension `dim` of the texture reference `hTexRef`. If `dim` is zero, the addressing mode is applied to the first parameter of the functions used to fetch from the texture; if `dim` is 1, the second, and so on. [`CUaddress_mode`] is defined as:
22395    ///
22396    /// ```text
22397    /// typedef enum CUaddress_mode_enum {
22398    ///    CU_TR_ADDRESS_MODE_WRAP = 0,
22399    ///    CU_TR_ADDRESS_MODE_CLAMP = 1,
22400    ///    CU_TR_ADDRESS_MODE_MIRROR = 2,
22401    ///    CU_TR_ADDRESS_MODE_BORDER = 3
22402    /// } CUaddress_mode;
22403    /// ```
22404    ///
22405    /// Note that this call has no effect if `hTexRef` is bound to linear memory. Also, if the flag, [`CU_TRSF_NORMALIZED_COORDINATES`], is not set, the only supported address mode is [`CUaddress_mode_enum::CU_TR_ADDRESS_MODE_CLAMP`].
22406    ///
22407    /// # Parameters
22408    ///
22409    /// - `hTexRef`: Texture reference.
22410    /// - `dim`: Dimension.
22411    /// - `am`: Addressing mode to set.
22412    ///
22413    /// # Return value
22414    ///
22415    /// - [`CUresult::CUDA_SUCCESS`]
22416    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22417    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22418    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22419    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22420    ///
22421    /// See also: [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D`], [`cuTexRefSetArray`], [`cuTexRefSetFilterMode`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
22422    #[deprecated]
22423    pub fn cuTexRefSetAddressMode(
22424        hTexRef: CUtexref,
22425        dim: ::core::ffi::c_int,
22426        am: CUaddress_mode,
22427    ) -> CUresult;
22428}
22429singe_loader::functions! { crate::DRIVER;
22430    /// Sets the filtering mode for a texture reference.
22431    ///
22432    /// Specifies the filtering mode `fm` to be used when reading memory through the texture reference `hTexRef`. [`CUfilter_mode_enum`] is defined as:
22433    ///
22434    /// ```text
22435    /// typedef enum CUfilter_mode_enum {
22436    ///    CU_TR_FILTER_MODE_POINT = 0,
22437    ///    CU_TR_FILTER_MODE_LINEAR = 1
22438    /// } CUfilter_mode;
22439    /// ```
22440    ///
22441    /// Note that this call has no effect if `hTexRef` is bound to linear memory.
22442    ///
22443    /// # Parameters
22444    ///
22445    /// - `hTexRef`: Texture reference.
22446    /// - `fm`: Filtering mode to set.
22447    ///
22448    /// # Return value
22449    ///
22450    /// - [`CUresult::CUDA_SUCCESS`]
22451    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22452    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22453    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22454    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22455    ///
22456    /// See also: [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
22457    #[deprecated]
22458    pub fn cuTexRefSetFilterMode(hTexRef: CUtexref, fm: CUfilter_mode) -> CUresult;
22459}
22460singe_loader::functions! { crate::DRIVER;
22461    /// Sets the mipmap filtering mode for a texture reference.
22462    ///
22463    /// Specifies the mipmap filtering mode `fm` to be used when reading memory through the texture reference `hTexRef`. [`CUfilter_mode_enum`] is defined as:
22464    ///
22465    /// ```text
22466    /// typedef enum CUfilter_mode_enum {
22467    ///    CU_TR_FILTER_MODE_POINT = 0,
22468    ///    CU_TR_FILTER_MODE_LINEAR = 1
22469    /// } CUfilter_mode;
22470    /// ```
22471    ///
22472    /// Note that this call has no effect if `hTexRef` is not bound to a mipmapped array.
22473    ///
22474    /// # Parameters
22475    ///
22476    /// - `hTexRef`: Texture reference.
22477    /// - `fm`: Filtering mode to set.
22478    ///
22479    /// # Return value
22480    ///
22481    /// - [`CUresult::CUDA_SUCCESS`]
22482    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22483    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22484    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22485    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22486    ///
22487    /// See also: [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
22488    #[deprecated]
22489    pub fn cuTexRefSetMipmapFilterMode(hTexRef: CUtexref, fm: CUfilter_mode) -> CUresult;
22490}
22491singe_loader::functions! { crate::DRIVER;
22492    /// Sets the mipmap level bias for a texture reference.
22493    ///
22494    /// Specifies the mipmap level bias `bias` to be added to the specified mipmap level when reading memory through the texture reference `hTexRef`.
22495    ///
22496    /// Note that this call has no effect if `hTexRef` is not bound to a mipmapped array.
22497    ///
22498    /// # Parameters
22499    ///
22500    /// - `hTexRef`: Texture reference.
22501    /// - `bias`: Mipmap level bias.
22502    ///
22503    /// # Return value
22504    ///
22505    /// - [`CUresult::CUDA_SUCCESS`]
22506    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22507    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22508    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22509    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22510    ///
22511    /// See also: [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
22512    #[deprecated]
22513    pub fn cuTexRefSetMipmapLevelBias(hTexRef: CUtexref, bias: f32) -> CUresult;
22514}
22515singe_loader::functions! { crate::DRIVER;
22516    /// Sets the mipmap min/max mipmap level clamps for a texture reference.
22517    ///
22518    /// Specifies the min/max mipmap level clamps, `minMipmapLevelClamp` and `maxMipmapLevelClamp` respectively, to be used when reading memory through the texture reference `hTexRef`.
22519    ///
22520    /// Note that this call has no effect if `hTexRef` is not bound to a mipmapped array.
22521    ///
22522    /// # Parameters
22523    ///
22524    /// - `hTexRef`: Texture reference.
22525    /// - `minMipmapLevelClamp`: Mipmap min level clamp.
22526    /// - `maxMipmapLevelClamp`: Mipmap max level clamp.
22527    ///
22528    /// # Return value
22529    ///
22530    /// - [`CUresult::CUDA_SUCCESS`]
22531    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22532    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22533    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22534    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22535    ///
22536    /// See also: [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
22537    #[deprecated]
22538    pub fn cuTexRefSetMipmapLevelClamp(
22539        hTexRef: CUtexref,
22540        minMipmapLevelClamp: f32,
22541        maxMipmapLevelClamp: f32,
22542    ) -> CUresult;
22543}
22544singe_loader::functions! { crate::DRIVER;
22545    /// Sets the maximum anisotropy for a texture reference.
22546    ///
22547    /// Specifies the maximum anisotropy `maxAniso` to be used when reading memory through the texture reference `hTexRef`.
22548    ///
22549    /// Note that this call has no effect if `hTexRef` is bound to linear memory.
22550    ///
22551    /// # Parameters
22552    ///
22553    /// - `hTexRef`: Texture reference.
22554    /// - `maxAniso`: Maximum anisotropy.
22555    ///
22556    /// # Return value
22557    ///
22558    /// - [`CUresult::CUDA_SUCCESS`]
22559    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22560    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22561    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22562    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22563    ///
22564    /// See also: [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
22565    #[deprecated]
22566    pub fn cuTexRefSetMaxAnisotropy(
22567        hTexRef: CUtexref,
22568        maxAniso: ::core::ffi::c_uint,
22569    ) -> CUresult;
22570}
22571singe_loader::functions! { crate::DRIVER;
22572    /// Sets the border color for a texture reference.
22573    ///
22574    /// Specifies the value of the RGBA color via the `pBorderColor` to the texture reference `hTexRef`. The color value supports only float type and holds color components in the following sequence: pBorderColor\[0\] holds ‘R’ component pBorderColor\[1\] holds ‘G’ component pBorderColor\[2\] holds ‘B’ component pBorderColor\[3\] holds ‘A’ component
22575    ///
22576    /// Note that the color values can be set only when the Address mode is set to [`CUaddress_mode::CU_TR_ADDRESS_MODE_BORDER`] using [`cuTexRefSetAddressMode`]. Applications using integer border color values have to “reinterpret_cast” their values to float.
22577    ///
22578    /// # Parameters
22579    ///
22580    /// - `hTexRef`: Texture reference.
22581    /// - `pBorderColor`: RGBA color.
22582    ///
22583    /// # Return value
22584    ///
22585    /// - [`CUresult::CUDA_SUCCESS`]
22586    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22587    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22588    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22589    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22590    ///
22591    /// See also: [`cuTexRefSetAddressMode`], [`cuTexRefGetAddressMode`], [`cuTexRefGetBorderColor`].
22592    #[deprecated]
22593    pub fn cuTexRefSetBorderColor(hTexRef: CUtexref, pBorderColor: *mut f32) -> CUresult;
22594}
22595singe_loader::functions! { crate::DRIVER;
22596    /// Sets the flags for a texture reference.
22597    ///
22598    /// Specifies optional flags via `Flags` to specify the behavior of data returned through the texture reference `hTexRef`. The valid flags are:
22599    ///
22600    /// * [`CU_TRSF_READ_AS_INTEGER`], which suppresses the default behavior of having the texture promote integer data to floating point data in the range \[0, 1\]. Note that texture with 32-bit integer format would not be promoted, regardless of whether or not this flag is specified;
22601    /// * [`CU_TRSF_NORMALIZED_COORDINATES`], which suppresses the default behavior of having the texture coordinates range from [0, Dim) where Dim is the width or height of the CUDA array. Instead, the texture coordinates [0, 1.0) reference the entire breadth of the array dimension;
22602    /// * [`CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION`], which disables any trilinear filtering optimizations. Trilinear optimizations improve texture filtering performance by allowing bilinear filtering on textures in scenarios where it can closely approximate the expected results.
22603    ///
22604    /// # Parameters
22605    ///
22606    /// - `hTexRef`: Texture reference.
22607    /// - `Flags`: Optional flags to set.
22608    ///
22609    /// # Return value
22610    ///
22611    /// - [`CUresult::CUDA_SUCCESS`]
22612    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22613    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22614    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22615    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22616    ///
22617    /// See also: [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFilterMode`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
22618    #[deprecated]
22619    pub fn cuTexRefSetFlags(hTexRef: CUtexref, Flags: ::core::ffi::c_uint) -> CUresult;
22620}
22621singe_loader::functions! { crate::DRIVER;
22622    /// Gets the address associated with a texture reference.
22623    ///
22624    /// Returns in `*pdptr` the base address bound to the texture reference `hTexRef`, or returns [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] if the texture reference is not bound to any device memory range.
22625    ///
22626    /// # Parameters
22627    ///
22628    /// - `pdptr`: Returned device address.
22629    /// - `hTexRef`: Texture reference.
22630    ///
22631    /// # Return value
22632    ///
22633    /// - [`CUresult::CUDA_SUCCESS`]
22634    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22635    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22636    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22637    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22638    ///
22639    /// See also: [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFilterMode`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
22640    #[deprecated]
22641    pub fn cuTexRefGetAddress_v2(pdptr: *mut CUdeviceptr, hTexRef: CUtexref) -> CUresult;
22642}
22643singe_loader::functions! { crate::DRIVER;
22644    /// Gets the array bound to a texture reference.
22645    ///
22646    /// Returns in `*phArray` the CUDA array bound to the texture reference `hTexRef`, or returns [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] if the texture reference is not bound to any CUDA array.
22647    ///
22648    /// # Parameters
22649    ///
22650    /// - `phArray`: Returned array.
22651    /// - `hTexRef`: Texture reference.
22652    ///
22653    /// # Return value
22654    ///
22655    /// - [`CUresult::CUDA_SUCCESS`]
22656    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22657    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22658    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22659    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22660    ///
22661    /// See also: [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFilterMode`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
22662    #[deprecated]
22663    pub fn cuTexRefGetArray(phArray: *mut CUarray, hTexRef: CUtexref) -> CUresult;
22664}
22665singe_loader::functions! { crate::DRIVER;
22666    /// Gets the mipmapped array bound to a texture reference.
22667    ///
22668    /// Returns in `*phMipmappedArray` the CUDA mipmapped array bound to the texture reference `hTexRef`, or returns [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] if the texture reference is not bound to any CUDA mipmapped array.
22669    ///
22670    /// # Parameters
22671    ///
22672    /// - `phMipmappedArray`: Returned mipmapped array.
22673    /// - `hTexRef`: Texture reference.
22674    ///
22675    /// # Return value
22676    ///
22677    /// - [`CUresult::CUDA_SUCCESS`]
22678    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22679    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22680    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22681    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22682    ///
22683    /// See also: [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFilterMode`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
22684    #[deprecated]
22685    pub fn cuTexRefGetMipmappedArray(
22686        phMipmappedArray: *mut CUmipmappedArray,
22687        hTexRef: CUtexref,
22688    ) -> CUresult;
22689}
22690singe_loader::functions! { crate::DRIVER;
22691    /// Gets the addressing mode used by a texture reference.
22692    ///
22693    /// Returns in `*pam` the addressing mode corresponding to the dimension `dim` of the texture reference `hTexRef`. Currently, the only valid value for `dim` are 0 and 1.
22694    ///
22695    /// # Parameters
22696    ///
22697    /// - `pam`: Returned addressing mode.
22698    /// - `hTexRef`: Texture reference.
22699    /// - `dim`: Dimension.
22700    ///
22701    /// # Return value
22702    ///
22703    /// - [`CUresult::CUDA_SUCCESS`]
22704    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22705    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22706    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22707    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22708    ///
22709    /// See also: [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFilterMode`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
22710    #[deprecated]
22711    pub fn cuTexRefGetAddressMode(
22712        pam: *mut CUaddress_mode,
22713        hTexRef: CUtexref,
22714        dim: ::core::ffi::c_int,
22715    ) -> CUresult;
22716}
22717singe_loader::functions! { crate::DRIVER;
22718    /// Gets the filter-mode used by a texture reference.
22719    ///
22720    /// Returns in `*pfm` the filtering mode of the texture reference `hTexRef`.
22721    ///
22722    /// # Parameters
22723    ///
22724    /// - `pfm`: Returned filtering mode.
22725    /// - `hTexRef`: Texture reference.
22726    ///
22727    /// # Return value
22728    ///
22729    /// - [`CUresult::CUDA_SUCCESS`]
22730    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22731    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22732    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22733    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22734    ///
22735    /// See also: [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFilterMode`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
22736    #[deprecated]
22737    pub fn cuTexRefGetFilterMode(pfm: *mut CUfilter_mode, hTexRef: CUtexref) -> CUresult;
22738}
22739singe_loader::functions! { crate::DRIVER;
22740    /// Gets the format used by a texture reference.
22741    ///
22742    /// Returns in `*pFormat` and `*pNumChannels` the format and number of components of the CUDA array bound to the texture reference `hTexRef`. If `pFormat` or `pNumChannels` is NULL, it will be ignored.
22743    ///
22744    /// # Parameters
22745    ///
22746    /// - `pFormat`: Returned format.
22747    /// - `pNumChannels`: Returned number of components.
22748    /// - `hTexRef`: Texture reference.
22749    ///
22750    /// # Return value
22751    ///
22752    /// - [`CUresult::CUDA_SUCCESS`]
22753    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22754    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22755    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22756    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22757    ///
22758    /// See also: [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFilterMode`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`].
22759    #[deprecated]
22760    pub fn cuTexRefGetFormat(
22761        pFormat: *mut CUarray_format,
22762        pNumChannels: *mut ::core::ffi::c_int,
22763        hTexRef: CUtexref,
22764    ) -> CUresult;
22765}
22766singe_loader::functions! { crate::DRIVER;
22767    /// Gets the mipmap filtering mode for a texture reference.
22768    ///
22769    /// Returns the mipmap filtering mode in `pfm` that’s used when reading memory through the texture reference `hTexRef`.
22770    ///
22771    /// # Parameters
22772    ///
22773    /// - `pfm`: Returned mipmap filtering mode.
22774    /// - `hTexRef`: Texture reference.
22775    ///
22776    /// # Return value
22777    ///
22778    /// - [`CUresult::CUDA_SUCCESS`]
22779    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22780    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22781    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22782    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22783    ///
22784    /// See also: [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
22785    #[deprecated]
22786    pub fn cuTexRefGetMipmapFilterMode(
22787        pfm: *mut CUfilter_mode,
22788        hTexRef: CUtexref,
22789    ) -> CUresult;
22790}
22791singe_loader::functions! { crate::DRIVER;
22792    /// Gets the mipmap level bias for a texture reference.
22793    ///
22794    /// Returns the mipmap level bias in `pBias` that’s added to the specified mipmap level when reading memory through the texture reference `hTexRef`.
22795    ///
22796    /// # Parameters
22797    ///
22798    /// - `pbias`: Returned mipmap level bias.
22799    /// - `hTexRef`: Texture reference.
22800    ///
22801    /// # Return value
22802    ///
22803    /// - [`CUresult::CUDA_SUCCESS`]
22804    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22805    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22806    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22807    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22808    ///
22809    /// See also: [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
22810    #[deprecated]
22811    pub fn cuTexRefGetMipmapLevelBias(pbias: *mut f32, hTexRef: CUtexref) -> CUresult;
22812}
22813singe_loader::functions! { crate::DRIVER;
22814    /// Gets the min/max mipmap level clamps for a texture reference.
22815    ///
22816    /// Returns the min/max mipmap level clamps in `pminMipmapLevelClamp` and `pmaxMipmapLevelClamp` that’s used when reading memory through the texture reference `hTexRef`.
22817    ///
22818    /// # Parameters
22819    ///
22820    /// - `pminMipmapLevelClamp`: Returned mipmap min level clamp.
22821    /// - `pmaxMipmapLevelClamp`: Returned mipmap max level clamp.
22822    /// - `hTexRef`: Texture reference.
22823    ///
22824    /// # Return value
22825    ///
22826    /// - [`CUresult::CUDA_SUCCESS`]
22827    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22828    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22829    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22830    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22831    ///
22832    /// See also: [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
22833    #[deprecated]
22834    pub fn cuTexRefGetMipmapLevelClamp(
22835        pminMipmapLevelClamp: *mut f32,
22836        pmaxMipmapLevelClamp: *mut f32,
22837        hTexRef: CUtexref,
22838    ) -> CUresult;
22839}
22840singe_loader::functions! { crate::DRIVER;
22841    /// Gets the maximum anisotropy for a texture reference.
22842    ///
22843    /// Returns the maximum anisotropy in `pmaxAniso` that’s used when reading memory through the texture reference `hTexRef`.
22844    ///
22845    /// # Parameters
22846    ///
22847    /// - `pmaxAniso`: Returned maximum anisotropy.
22848    /// - `hTexRef`: Texture reference.
22849    ///
22850    /// # Return value
22851    ///
22852    /// - [`CUresult::CUDA_SUCCESS`]
22853    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22854    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22855    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22856    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22857    ///
22858    /// See also: [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
22859    #[deprecated]
22860    pub fn cuTexRefGetMaxAnisotropy(
22861        pmaxAniso: *mut ::core::ffi::c_int,
22862        hTexRef: CUtexref,
22863    ) -> CUresult;
22864}
22865singe_loader::functions! { crate::DRIVER;
22866    /// Gets the border color used by a texture reference.
22867    ///
22868    /// Returns in `pBorderColor`, values of the RGBA color used by the texture reference `hTexRef`. The color value is of type float and holds color components in the following sequence: pBorderColor\[0\] holds ‘R’ component pBorderColor\[1\] holds ‘G’ component pBorderColor\[2\] holds ‘B’ component pBorderColor\[3\] holds ‘A’ component.
22869    ///
22870    /// # Parameters
22871    ///
22872    /// - `pBorderColor`: Returned Type and Value of RGBA color.
22873    /// - `hTexRef`: Texture reference.
22874    ///
22875    /// # Return value
22876    ///
22877    /// - [`CUresult::CUDA_SUCCESS`]
22878    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22879    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22880    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22881    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22882    ///
22883    /// See also: [`cuTexRefSetAddressMode`], [`cuTexRefSetBorderColor`].
22884    #[deprecated]
22885    pub fn cuTexRefGetBorderColor(pBorderColor: *mut f32, hTexRef: CUtexref) -> CUresult;
22886}
22887singe_loader::functions! { crate::DRIVER;
22888    /// Gets the flags used by a texture reference.
22889    ///
22890    /// Returns in `*pFlags` the flags of the texture reference `hTexRef`.
22891    ///
22892    /// # Parameters
22893    ///
22894    /// - `pFlags`: Returned flags.
22895    /// - `hTexRef`: Texture reference.
22896    ///
22897    /// # Return value
22898    ///
22899    /// - [`CUresult::CUDA_SUCCESS`]
22900    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22901    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22902    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22903    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22904    ///
22905    /// See also: [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFilterMode`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFormat`].
22906    #[deprecated]
22907    pub fn cuTexRefGetFlags(
22908        pFlags: *mut ::core::ffi::c_uint,
22909        hTexRef: CUtexref,
22910    ) -> CUresult;
22911}
22912singe_loader::functions! { crate::DRIVER;
22913    /// Creates a texture reference.
22914    ///
22915    /// Creates a texture reference and returns its handle in `*pTexRef`. Once created, the application must call [`cuTexRefSetArray`] or cuTexRefSetAddress() to associate the reference with allocated memory. Other texture reference functions are used to specify the format and interpretation (addressing, filtering, etc.) to be used when the memory is read through this texture reference.
22916    ///
22917    /// # Parameters
22918    ///
22919    /// - `pTexRef`: Returned texture reference
22920    ///
22921    /// # Return value
22922    ///
22923    /// - [`CUresult::CUDA_SUCCESS`]
22924    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22925    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22926    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22927    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22928    ///
22929    /// See also: [`cuTexRefDestroy`].
22930    #[deprecated]
22931    pub fn cuTexRefCreate(pTexRef: *mut CUtexref) -> CUresult;
22932}
22933singe_loader::functions! { crate::DRIVER;
22934    /// Destroys a texture reference.
22935    ///
22936    /// Destroys the texture reference specified by `hTexRef`.
22937    ///
22938    /// # Parameters
22939    ///
22940    /// - `hTexRef`: Texture reference to destroy
22941    ///
22942    /// # Return value
22943    ///
22944    /// - [`CUresult::CUDA_SUCCESS`]
22945    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22946    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22947    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22948    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22949    ///
22950    /// See also: [`cuTexRefCreate`].
22951    #[deprecated]
22952    pub fn cuTexRefDestroy(hTexRef: CUtexref) -> CUresult;
22953}
22954singe_loader::functions! { crate::DRIVER;
22955    /// Sets the CUDA array for a surface reference.
22956    ///
22957    /// Sets the CUDA array `hArray` to be read and written by the surface reference `hSurfRef`. Any previous CUDA array state associated with the surface reference is superseded by this function. `Flags` must be set to 0. The [`CUDA_ARRAY3D_SURFACE_LDST`] flag must have been set for the CUDA array. Any CUDA array previously bound to `hSurfRef` is unbound.
22958    ///
22959    /// # Parameters
22960    ///
22961    /// - `hSurfRef`: Surface reference handle.
22962    /// - `hArray`: CUDA array handle.
22963    /// - `Flags`: set to 0.
22964    ///
22965    /// # Return value
22966    ///
22967    /// - [`CUresult::CUDA_SUCCESS`]
22968    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22969    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22970    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22971    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22972    ///
22973    /// See also: [`cuModuleGetSurfRef`], [`cuSurfRefGetArray`].
22974    #[deprecated]
22975    pub fn cuSurfRefSetArray(
22976        hSurfRef: CUsurfref,
22977        hArray: CUarray,
22978        Flags: ::core::ffi::c_uint,
22979    ) -> CUresult;
22980}
22981singe_loader::functions! { crate::DRIVER;
22982    /// Passes back the CUDA array bound to a surface reference.
22983    ///
22984    /// Returns in `*phArray` the CUDA array bound to the surface reference `hSurfRef`, or returns [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] if the surface reference is not bound to any CUDA array.
22985    ///
22986    /// # Parameters
22987    ///
22988    /// - `phArray`: Surface reference handle.
22989    /// - `hSurfRef`: Surface reference handle.
22990    ///
22991    /// # Return value
22992    ///
22993    /// - [`CUresult::CUDA_SUCCESS`]
22994    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
22995    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
22996    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
22997    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
22998    ///
22999    /// See also: [`cuModuleGetSurfRef`], [`cuSurfRefSetArray`].
23000    #[deprecated]
23001    pub fn cuSurfRefGetArray(phArray: *mut CUarray, hSurfRef: CUsurfref) -> CUresult;
23002}
23003singe_loader::functions! { crate::DRIVER;
23004    /// Creates a texture object.
23005    ///
23006    /// Creates a texture object and returns it in `pTexObject`. `pResDesc` describes the data to texture from. `pTexDesc` describes how the data should be sampled. `pResViewDesc` is an optional argument that specifies an alternate format for the data described by `pResDesc`, and also describes the subresource region to restrict access to when texturing. `pResViewDesc` can only be specified if the type of resource is a CUDA array or a CUDA mipmapped array not in a block compressed format.
23007    ///
23008    /// Texture objects are only supported on devices of compute capability 3.0 or higher. Additionally, a texture object is an opaque value, and, as such, should only be accessed through CUDA API calls.
23009    ///
23010    /// The CUDA_RESOURCE_DESC structure is defined as:
23011    ///
23012    /// ```text
23013    /// typedef struct CUDA_RESOURCE_DESC_st
23014    /// {
23015    /// CUresourcetype resType;
23016    ///
23017    /// union {
23018    /// struct {
23019    /// CUarray hArray;
23020    /// } array;
23021    /// struct {
23022    /// CUmipmappedArray hMipmappedArray;
23023    /// } mipmap;
23024    /// struct {
23025    /// CUdeviceptr devPtr;
23026    /// CUarray_format format;
23027    /// unsigned int numChannels;
23028    /// size_t sizeInBytes;
23029    /// } linear;
23030    /// struct {
23031    /// CUdeviceptr devPtr;
23032    /// CUarray_format format;
23033    /// unsigned int numChannels;
23034    /// size_t width;
23035    /// size_t height;
23036    /// size_t pitchInBytes;
23037    /// } pitch2D;
23038    /// } res;
23039    ///
23040    /// unsigned int flags;
23041    /// } CUDA_RESOURCE_DESC;
23042    /// ```
23043    ///
23044    /// where:
23045    ///
23046    /// * [`CUDA_RESOURCE_DESC::resType`](CUDA_RESOURCE_DESC_st::resType) specifies the type of resource to texture from. CUresourceType is defined as:
23047    ///
23048    /// ```text
23049    ///   typedef enum CUresourcetype_enum {
23050    /// CU_RESOURCE_TYPE_ARRAY           = 0x00,
23051    /// CU_RESOURCE_TYPE_MIPMAPPED_ARRAY = 0x01,
23052    /// CU_RESOURCE_TYPE_LINEAR          = 0x02,
23053    /// CU_RESOURCE_TYPE_PITCH2D         = 0x03
23054    ///   } CUresourcetype;
23055    /// ```
23056    ///
23057    /// * `flags` must be set to zero.
23058    ///
23059    /// If [`CUDA_RESOURCE_DESC::resType`](CUDA_RESOURCE_DESC_st::resType) is set to [`CUresourcetype_enum::CU_RESOURCE_TYPE_ARRAY`], [CUDA_RESOURCE_DESC::res::array::hArray](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__RESOURCE__DESC__v1.html#structcuda__resource__desc__v1_1ae6a102dea60961fe2cb7beb001798ca0) must be set to a valid CUDA array handle.
23060    ///
23061    /// If [`CUDA_RESOURCE_DESC::resType`](CUDA_RESOURCE_DESC_st::resType) is set to [`CUresourcetype_enum::CU_RESOURCE_TYPE_MIPMAPPED_ARRAY`], [CUDA_RESOURCE_DESC::res::mipmap::hMipmappedArray](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__RESOURCE__DESC__v1.html#structcuda__resource__desc__v1_1ab0035de20041a96ab8323b822f322d8d) must be set to a valid CUDA mipmapped array handle.
23062    ///
23063    /// If [`CUDA_RESOURCE_DESC::resType`](CUDA_RESOURCE_DESC_st::resType) is set to [`CUresourcetype_enum::CU_RESOURCE_TYPE_LINEAR`], [CUDA_RESOURCE_DESC::res::linear::devPtr](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__RESOURCE__DESC__v1.html#structcuda__resource__desc__v1_1afa8f3b87957717a778c36b485c7236b5) must be set to a valid device pointer, that is aligned to [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT`]. [CUDA_RESOURCE_DESC::res::linear::format](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__RESOURCE__DESC__v1.html#structcuda__resource__desc__v1_1ad07a5747eecb15d4b479cd9e3864465f) and [CUDA_RESOURCE_DESC::res::linear::numChannels](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__RESOURCE__DESC__v1.html#structcuda__resource__desc__v1_1a7fea7c6024998f2c8c975d6784046eb7) describe the format of each component and the number of components per array element. [CUDA_RESOURCE_DESC::res::linear::sizeInBytes](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__RESOURCE__DESC__v1.html#structcuda__resource__desc__v1_1ac1c62b982fbc20c3ba6e41e93a2d71b3) specifies the size of the array in bytes. The total number of elements in the linear address range cannot exceed [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH`]. The number of elements is computed as (sizeInBytes / (sizeof(format) \* numChannels)).
23064    ///
23065    /// If [`CUDA_RESOURCE_DESC::resType`](CUDA_RESOURCE_DESC_st::resType) is set to [`CUresourcetype_enum::CU_RESOURCE_TYPE_PITCH2D`], [CUDA_RESOURCE_DESC::res::pitch2D::devPtr](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__RESOURCE__DESC__v1.html#structcuda__resource__desc__v1_1afa8f3b87957717a778c36b485c7236b5) must be set to a valid device pointer, that is aligned to [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT`]. [CUDA_RESOURCE_DESC::res::pitch2D::format](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__RESOURCE__DESC__v1.html#structcuda__resource__desc__v1_1ad07a5747eecb15d4b479cd9e3864465f) and [CUDA_RESOURCE_DESC::res::pitch2D::numChannels](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__RESOURCE__DESC__v1.html#structcuda__resource__desc__v1_1a7fea7c6024998f2c8c975d6784046eb7) describe the format of each component and the number of components per array element. [CUDA_RESOURCE_DESC::res::pitch2D::width](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__RESOURCE__DESC__v1.html#structcuda__resource__desc__v1_1a26793a723abb5c307b98146cf636171c) and [CUDA_RESOURCE_DESC::res::pitch2D::height](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__RESOURCE__DESC__v1.html#structcuda__resource__desc__v1_1a2222116c853642da33cf418a3a9f657e) specify the width and height of the array in elements, and cannot exceed [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH`] and [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT`] respectively. [CUDA_RESOURCE_DESC::res::pitch2D::pitchInBytes](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__RESOURCE__DESC__v1.html#structcuda__resource__desc__v1_1aaa79f5dfdd2e343cdae8219fb5933d13) specifies the pitch between two rows in bytes and has to be aligned to [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT`]. Pitch cannot exceed [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH`].
23066    ///
23067    /// The CUDA_TEXTURE_DESC struct is defined as
23068    ///
23069    /// ```text
23070    /// typedef struct CUDA_TEXTURE_DESC_st {
23071    /// CUaddress_mode addressMode\[3\];
23072    /// CUfilter_mode filterMode;
23073    /// unsigned int flags;
23074    /// unsigned int maxAnisotropy;
23075    /// CUfilter_mode mipmapFilterMode;
23076    /// float mipmapLevelBias;
23077    /// float minMipmapLevelClamp;
23078    /// float maxMipmapLevelClamp;
23079    /// } CUDA_TEXTURE_DESC;
23080    /// ```
23081    ///
23082    /// where
23083    ///
23084    /// * [`CUDA_TEXTURE_DESC::addressMode`](CUDA_TEXTURE_DESC_st::addressMode) specifies the addressing mode for each dimension of the texture data. [`CUaddress_mode`] is defined as:
23085    ///
23086    /// ```text
23087    ///   typedef enum CUaddress_mode_enum {
23088    /// CU_TR_ADDRESS_MODE_WRAP = 0,
23089    /// CU_TR_ADDRESS_MODE_CLAMP = 1,
23090    /// CU_TR_ADDRESS_MODE_MIRROR = 2,
23091    /// CU_TR_ADDRESS_MODE_BORDER = 3
23092    ///   } CUaddress_mode;
23093    /// ```
23094    ///
23095    ///   This is ignored if [`CUDA_RESOURCE_DESC::resType`](CUDA_RESOURCE_DESC_st::resType) is [`CUresourcetype_enum::CU_RESOURCE_TYPE_LINEAR`]. Also, if the flag, [`CU_TRSF_NORMALIZED_COORDINATES`] is not set, the only supported address mode is [`CUaddress_mode_enum::CU_TR_ADDRESS_MODE_CLAMP`].
23096    /// * [`CUDA_TEXTURE_DESC::filterMode`](CUDA_TEXTURE_DESC_st::filterMode) specifies the filtering mode to be used when fetching from the texture. CUfilter_mode is defined as:
23097    ///
23098    /// ```text
23099    ///   typedef enum CUfilter_mode_enum {
23100    /// CU_TR_FILTER_MODE_POINT = 0,
23101    /// CU_TR_FILTER_MODE_LINEAR = 1
23102    ///   } CUfilter_mode;
23103    /// ```
23104    ///
23105    ///   This is ignored if [`CUDA_RESOURCE_DESC::resType`](CUDA_RESOURCE_DESC_st::resType) is [`CUresourcetype_enum::CU_RESOURCE_TYPE_LINEAR`].
23106    /// * [`CUDA_TEXTURE_DESC::flags`](CUDA_TEXTURE_DESC_st::flags) can be any combination of the following:
23107    ///
23108    ///   + [`CU_TRSF_READ_AS_INTEGER`], which suppresses the default behavior of having the texture promote integer data to floating point data in the range \[0, 1\]. Note that texture with 32-bit integer format would not be promoted, regardless of whether or not this flag is specified.
23109    ///   + [`CU_TRSF_NORMALIZED_COORDINATES`], which suppresses the default behavior of having the texture coordinates range from [0, Dim) where Dim is the width or height of the CUDA array. Instead, the texture coordinates [0, 1.0) reference the entire breadth of the array dimension; Note that for CUDA mipmapped arrays, this flag has to be set.
23110    ///   + [`CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION`], which disables any trilinear filtering optimizations. Trilinear optimizations improve texture filtering performance by allowing bilinear filtering on textures in scenarios where it can closely approximate the expected results.
23111    ///   + [`CU_TRSF_SEAMLESS_CUBEMAP`], which enables seamless cube map filtering. This flag can only be specified if the underlying resource is a CUDA array or a CUDA mipmapped array that was created with the flag [`CUDA_ARRAY3D_CUBEMAP`]. When seamless cube map filtering is enabled, texture address modes specified by [`CUDA_TEXTURE_DESC::addressMode`](CUDA_TEXTURE_DESC_st::addressMode) are ignored. Instead, if the [`CUDA_TEXTURE_DESC::filterMode`](CUDA_TEXTURE_DESC_st::filterMode) is set to [`CUfilter_mode_enum::CU_TR_FILTER_MODE_POINT`] the address mode [`CUaddress_mode_enum::CU_TR_ADDRESS_MODE_CLAMP`] will be applied for all dimensions. If the [`CUDA_TEXTURE_DESC::filterMode`](CUDA_TEXTURE_DESC_st::filterMode) is set to [`CUfilter_mode_enum::CU_TR_FILTER_MODE_LINEAR`] seamless cube map filtering will be performed when sampling along the cube face borders.
23112    /// * [`CUDA_TEXTURE_DESC::maxAnisotropy`](CUDA_TEXTURE_DESC_st::maxAnisotropy) specifies the maximum anisotropy ratio to be used when doing anisotropic filtering. This value will be clamped to the range \[1,16\].
23113    /// * [`CUDA_TEXTURE_DESC::mipmapFilterMode`](CUDA_TEXTURE_DESC_st::mipmapFilterMode) specifies the filter mode when the calculated mipmap level lies between two defined mipmap levels.
23114    /// * [`CUDA_TEXTURE_DESC::mipmapLevelBias`](CUDA_TEXTURE_DESC_st::mipmapLevelBias) specifies the offset to be applied to the calculated mipmap level.
23115    /// * [`CUDA_TEXTURE_DESC::minMipmapLevelClamp`](CUDA_TEXTURE_DESC_st::minMipmapLevelClamp) specifies the lower end of the mipmap level range to clamp access to.
23116    /// * [`CUDA_TEXTURE_DESC::maxMipmapLevelClamp`](CUDA_TEXTURE_DESC_st::maxMipmapLevelClamp) specifies the upper end of the mipmap level range to clamp access to.
23117    ///
23118    /// The CUDA_RESOURCE_VIEW_DESC struct is defined as
23119    ///
23120    /// ```text
23121    /// typedef struct CUDA_RESOURCE_VIEW_DESC_st
23122    /// {
23123    /// CUresourceViewFormat format;
23124    /// size_t width;
23125    /// size_t height;
23126    /// size_t depth;
23127    /// unsigned int firstMipmapLevel;
23128    /// unsigned int lastMipmapLevel;
23129    /// unsigned int firstLayer;
23130    /// unsigned int lastLayer;
23131    /// } CUDA_RESOURCE_VIEW_DESC;
23132    /// ```
23133    ///
23134    /// where:
23135    ///
23136    /// * [`CUDA_RESOURCE_VIEW_DESC::format`](CUDA_RESOURCE_VIEW_DESC_st::format) specifies how the data contained in the CUDA array or CUDA mipmapped array should be interpreted. Note that this can incur a change in size of the texture data. If the resource view format is a block compressed format, then the underlying CUDA array or CUDA mipmapped array has to have a base of format [`CUarray_format_enum::CU_AD_FORMAT_UNSIGNED_INT32`]. with 2 or 4 channels, depending on the block compressed format. For ex., BC1 and BC4 require the underlying CUDA array to have a format of [`CUarray_format_enum::CU_AD_FORMAT_UNSIGNED_INT32`] with 2 channels. The other BC formats require the underlying resource to have the same base format but with 4 channels.
23137    /// * [`CUDA_RESOURCE_VIEW_DESC::width`](CUDA_RESOURCE_VIEW_DESC_st::width) specifies the new width of the texture data. If the resource view format is a block compressed format, this value has to be 4 times the original width of the resource. For non block compressed formats, this value has to be equal to that of the original resource.
23138    /// * [`CUDA_RESOURCE_VIEW_DESC::height`](CUDA_RESOURCE_VIEW_DESC_st::height) specifies the new height of the texture data. If the resource view format is a block compressed format, this value has to be 4 times the original height of the resource. For non block compressed formats, this value has to be equal to that of the original resource.
23139    /// * [`CUDA_RESOURCE_VIEW_DESC::depth`](CUDA_RESOURCE_VIEW_DESC_st::depth) specifies the new depth of the texture data. This value has to be equal to that of the original resource.
23140    /// * [`CUDA_RESOURCE_VIEW_DESC::firstMipmapLevel`](CUDA_RESOURCE_VIEW_DESC_st::firstMipmapLevel) specifies the most detailed mipmap level. This will be the new mipmap level zero. For non-mipmapped resources, this value has to be zero.[`CUDA_TEXTURE_DESC::minMipmapLevelClamp`](CUDA_TEXTURE_DESC_st::minMipmapLevelClamp) and [`CUDA_TEXTURE_DESC::maxMipmapLevelClamp`](CUDA_TEXTURE_DESC_st::maxMipmapLevelClamp) will be relative to this value. For ex., if the firstMipmapLevel is set to 2, and a minMipmapLevelClamp of 1.2 is specified, then the actual minimum mipmap level clamp will be 3.2.
23141    /// * [`CUDA_RESOURCE_VIEW_DESC::lastMipmapLevel`](CUDA_RESOURCE_VIEW_DESC_st::lastMipmapLevel) specifies the least detailed mipmap level. For non-mipmapped resources, this value has to be zero.
23142    /// * [`CUDA_RESOURCE_VIEW_DESC::firstLayer`](CUDA_RESOURCE_VIEW_DESC_st::firstLayer) specifies the first layer index for layered textures. This will be the new layer zero. For non-layered resources, this value has to be zero.
23143    /// * [`CUDA_RESOURCE_VIEW_DESC::lastLayer`](CUDA_RESOURCE_VIEW_DESC_st::lastLayer) specifies the last layer index for layered textures. For non-layered resources, this value has to be zero.
23144    ///
23145    /// # Parameters
23146    ///
23147    /// - `pTexObject`: Texture object to create.
23148    /// - `pResDesc`: Resource descriptor.
23149    /// - `pTexDesc`: Texture descriptor.
23150    /// - `pResViewDesc`: Resource view descriptor.
23151    ///
23152    /// # Return value
23153    ///
23154    /// - [`CUresult::CUDA_SUCCESS`]
23155    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
23156    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
23157    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
23158    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
23159    ///
23160    /// See also: [`cuTexObjectDestroy`], `cudaCreateTextureObject`.
23161    pub fn cuTexObjectCreate(
23162        pTexObject: *mut CUtexObject,
23163        pResDesc: *const CUDA_RESOURCE_DESC,
23164        pTexDesc: *const CUDA_TEXTURE_DESC,
23165        pResViewDesc: *const CUDA_RESOURCE_VIEW_DESC,
23166    ) -> CUresult;
23167}
23168singe_loader::functions! { crate::DRIVER;
23169    /// Destroys a texture object.
23170    ///
23171    /// Destroys the texture object specified by `texObject`.
23172    ///
23173    /// # Parameters
23174    ///
23175    /// - `texObject`: Texture object to destroy
23176    ///
23177    /// # Return value
23178    ///
23179    /// - [`CUresult::CUDA_SUCCESS`]
23180    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
23181    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
23182    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
23183    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
23184    ///
23185    /// See also: [`cuTexObjectCreate`], `cudaDestroyTextureObject`.
23186    pub fn cuTexObjectDestroy(texObject: CUtexObject) -> CUresult;
23187}
23188singe_loader::functions! { crate::DRIVER;
23189    /// Returns a texture object’s resource descriptor.
23190    ///
23191    /// Returns the resource descriptor for the texture object specified by `texObject`.
23192    ///
23193    /// # Parameters
23194    ///
23195    /// - `pResDesc`: Resource descriptor.
23196    /// - `texObject`: Texture object.
23197    ///
23198    /// # Return value
23199    ///
23200    /// - [`CUresult::CUDA_SUCCESS`]
23201    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
23202    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
23203    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
23204    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
23205    ///
23206    /// See also: [`cuTexObjectCreate`], `cudaGetTextureObjectResourceDesc`.
23207    pub fn cuTexObjectGetResourceDesc(
23208        pResDesc: *mut CUDA_RESOURCE_DESC,
23209        texObject: CUtexObject,
23210    ) -> CUresult;
23211}
23212singe_loader::functions! { crate::DRIVER;
23213    /// Returns a texture object’s texture descriptor.
23214    ///
23215    /// Returns the texture descriptor for the texture object specified by `texObject`.
23216    ///
23217    /// # Parameters
23218    ///
23219    /// - `pTexDesc`: Texture descriptor.
23220    /// - `texObject`: Texture object.
23221    ///
23222    /// # Return value
23223    ///
23224    /// - [`CUresult::CUDA_SUCCESS`]
23225    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
23226    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
23227    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
23228    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
23229    ///
23230    /// See also: [`cuTexObjectCreate`], `cudaGetTextureObjectTextureDesc`.
23231    pub fn cuTexObjectGetTextureDesc(
23232        pTexDesc: *mut CUDA_TEXTURE_DESC,
23233        texObject: CUtexObject,
23234    ) -> CUresult;
23235}
23236singe_loader::functions! { crate::DRIVER;
23237    /// Returns a texture object’s resource view descriptor.
23238    ///
23239    /// Returns the resource view descriptor for the texture object specified by `texObject`. If no resource view was set for `texObject`, the [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned.
23240    ///
23241    /// # Parameters
23242    ///
23243    /// - `pResViewDesc`: Resource view descriptor.
23244    /// - `texObject`: Texture object.
23245    ///
23246    /// # Return value
23247    ///
23248    /// - [`CUresult::CUDA_SUCCESS`]
23249    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
23250    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
23251    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
23252    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
23253    ///
23254    /// See also: [`cuTexObjectCreate`], `cudaGetTextureObjectResourceViewDesc`.
23255    pub fn cuTexObjectGetResourceViewDesc(
23256        pResViewDesc: *mut CUDA_RESOURCE_VIEW_DESC,
23257        texObject: CUtexObject,
23258    ) -> CUresult;
23259}
23260singe_loader::functions! { crate::DRIVER;
23261    /// Creates a surface object.
23262    ///
23263    /// Creates a surface object and returns it in `pSurfObject`. `pResDesc` describes the data to perform surface load/stores on. [`CUDA_RESOURCE_DESC::resType`](CUDA_RESOURCE_DESC_st::resType) must be [`CUresourcetype_enum::CU_RESOURCE_TYPE_ARRAY`] and [CUDA_RESOURCE_DESC::res::array::hArray](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/structCUDA__RESOURCE__DESC__v1.html#structcuda__resource__desc__v1_1ae6a102dea60961fe2cb7beb001798ca0) must be set to a valid CUDA array handle. [`CUDA_RESOURCE_DESC::flags`](CUDA_RESOURCE_DESC_st::flags) must be set to zero.
23264    ///
23265    /// Surface objects are only supported on devices of compute capability 3.0 or higher. Additionally, a surface object is an opaque value, and, as such, should only be accessed through CUDA API calls.
23266    ///
23267    /// # Parameters
23268    ///
23269    /// - `pSurfObject`: Surface object to create.
23270    /// - `pResDesc`: Resource descriptor.
23271    ///
23272    /// # Return value
23273    ///
23274    /// - [`CUresult::CUDA_SUCCESS`]
23275    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
23276    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
23277    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
23278    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
23279    ///
23280    /// See also: [`cuSurfObjectDestroy`], `cudaCreateSurfaceObject`.
23281    pub fn cuSurfObjectCreate(
23282        pSurfObject: *mut CUsurfObject,
23283        pResDesc: *const CUDA_RESOURCE_DESC,
23284    ) -> CUresult;
23285}
23286singe_loader::functions! { crate::DRIVER;
23287    /// Destroys a surface object.
23288    ///
23289    /// Destroys the surface object specified by `surfObject`.
23290    ///
23291    /// # Parameters
23292    ///
23293    /// - `surfObject`: Surface object to destroy
23294    ///
23295    /// # Return value
23296    ///
23297    /// - [`CUresult::CUDA_SUCCESS`]
23298    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
23299    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
23300    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
23301    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
23302    ///
23303    /// See also: [`cuSurfObjectCreate`], `cudaDestroySurfaceObject`.
23304    pub fn cuSurfObjectDestroy(surfObject: CUsurfObject) -> CUresult;
23305}
23306singe_loader::functions! { crate::DRIVER;
23307    /// Returns a surface object’s resource descriptor.
23308    ///
23309    /// Returns the resource descriptor for the surface object specified by `surfObject`.
23310    ///
23311    /// # Parameters
23312    ///
23313    /// - `pResDesc`: Resource descriptor.
23314    /// - `surfObject`: Surface object.
23315    ///
23316    /// # Return value
23317    ///
23318    /// - [`CUresult::CUDA_SUCCESS`]
23319    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
23320    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
23321    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
23322    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
23323    ///
23324    /// See also: [`cuSurfObjectCreate`], `cudaGetSurfaceObjectResourceDesc`.
23325    pub fn cuSurfObjectGetResourceDesc(
23326        pResDesc: *mut CUDA_RESOURCE_DESC,
23327        surfObject: CUsurfObject,
23328    ) -> CUresult;
23329}
23330singe_loader::functions! { crate::DRIVER;
23331    /// Create a tensor map descriptor object representing tiled memory region.
23332    ///
23333    /// Creates a descriptor for Tensor Memory Access (TMA) object specified by the parameters describing a tiled region and returns it in `tensorMap`.
23334    ///
23335    /// Tensor map objects are only supported on devices of compute capability 9.0 or higher. Additionally, a tensor map object is an opaque value, and, as such, should only be accessed through CUDA APIs and PTX.
23336    ///
23337    /// The parameters passed are bound to the following requirements:
23338    ///
23339    /// * `tensorMap` address must be aligned to 64 bytes.
23340    /// * `tensorDataType` has to be an enum from [`CUtensorMapDataType`] which is defined as:
23341    ///
23342    /// ```text
23343    ///   typedef enum CUtensorMapDataType_enum {
23344    /// CU_TENSOR_MAP_DATA_TYPE_UINT8 = 0,       // 1 byte
23345    /// CU_TENSOR_MAP_DATA_TYPE_UINT16,          // 2 bytes
23346    /// CU_TENSOR_MAP_DATA_TYPE_UINT32,          // 4 bytes
23347    /// CU_TENSOR_MAP_DATA_TYPE_INT32,           // 4 bytes
23348    /// CU_TENSOR_MAP_DATA_TYPE_UINT64,          // 8 bytes
23349    /// CU_TENSOR_MAP_DATA_TYPE_INT64,           // 8 bytes
23350    /// CU_TENSOR_MAP_DATA_TYPE_FLOAT16,         // 2 bytes
23351    /// CU_TENSOR_MAP_DATA_TYPE_FLOAT32,         // 4 bytes
23352    /// CU_TENSOR_MAP_DATA_TYPE_FLOAT64,         // 8 bytes
23353    /// CU_TENSOR_MAP_DATA_TYPE_BFLOAT16,        // 2 bytes
23354    /// CU_TENSOR_MAP_DATA_TYPE_FLOAT32_FTZ,     // 4 bytes
23355    /// CU_TENSOR_MAP_DATA_TYPE_TFLOAT32,        // 4 bytes
23356    /// CU_TENSOR_MAP_DATA_TYPE_TFLOAT32_FTZ,    // 4 bytes
23357    /// CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B,    // 4 bits
23358    /// CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B,   // 4 bits
23359    /// CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B    // 6 bits
23360    ///   } CUtensorMapDataType;
23361    /// ```
23362    ///
23363    ///   [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B`] copies ‘16 x U4’ packed values to memory aligned as 8 bytes. There are no gaps between packed values. [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`] copies ‘16 x U4’ packed values to memory aligned as 16 bytes. There are 8 byte gaps between every 8 byte chunk of packed values. [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] copies ‘16 x U6’ packed values to memory aligned as 16 bytes. There are 4 byte gaps between every 12 byte chunk of packed values.
23364    /// * `tensorRank` must be non-zero and less than or equal to the maximum supported dimensionality of 5. If `interleave` is not [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_NONE`], then `tensorRank` must additionally be greater than or equal to 3.
23365    /// * `globalAddress`, which specifies the starting address of the memory region described, must be 16 byte aligned. The following requirements need to also be met:
23366    ///
23367    ///   + When `interleave` is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_32B`], `globalAddress` must be 32 byte aligned.
23368    ///   + When `tensorDataType` is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] or [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], `globalAddress` must be 32 byte aligned.
23369    ///
23370    /// `globalDim` array, which specifies tensor size of each of the `tensorRank` dimensions, must be non-zero and less than or equal to 2^32. Additionally, the following requirements need to be met for the packed data types:
23371    ///
23372    /// * When `tensorDataType` is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] or [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], globalDim\[0\] must be a multiple of 128.
23373    /// * When `tensorDataType` is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B`], `globalDim`\[0\] must be a multiple of 2.
23374    /// * Dimension for the packed data types must reflect the number of individual U# values.
23375    ///
23376    /// `globalStrides` array, which specifies tensor stride of each of the lower `tensorRank` - 1 dimensions in bytes, must be a multiple of 16 and less than 2^40. Additionally, the following requirements need to be met:
23377    ///
23378    /// * When `interleave` is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_32B`], the strides must be a multiple of 32.
23379    /// * When `tensorDataType` is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] or [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], the strides must be a multiple of 32. Each following dimension specified includes previous dimension stride:
23380    ///
23381    /// ```text
23382    ///   globalStrides\[0\] = globalDim\[0\] * elementSizeInBytes(tensorDataType) + padding\[0\];
23383    ///   for (i = 1; i < tensorRank - 1; i++)
23384    /// globalStrides\[i\] = globalStrides\[i – 1\] * (globalDim\[i\] + padding\[i\]);
23385    /// assert(globalStrides\[i\] >= globalDim\[i\]);
23386    /// ```
23387    ///
23388    /// `boxDim` array, which specifies number of elements to be traversed along each of the `tensorRank` dimensions, must be non-zero and less than or equal to 256. Additionally, the following requirements need to be met:
23389    ///
23390    /// * When `interleave` is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_NONE`], { `boxDim`\[0\] \* elementSizeInBytes( `tensorDataType` ) } must be a multiple of 16 bytes.
23391    /// * When `tensorDataType` is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] or [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], boxDim\[0\] must be 128.
23392    ///
23393    /// `elementStrides` array, which specifies the iteration step along each of the `tensorRank` dimensions, must be non-zero and less than or equal to 8. Note that when `interleave` is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_NONE`], the first element of this array is ignored since TMA doesn’t support the stride for dimension zero. When all elements of `elementStrides` array is one, `boxDim` specifies the number of elements to load. However, if the `elementStrides`\[i\] is not equal to one, then TMA loads ceil( `boxDim`\[i\] / `elementStrides`\[i\]) number of elements along i-th dimension. To load N elements along i-th dimension, `boxDim`\[i\] must be set to N \* `elementStrides`\[i\].
23394    ///
23395    /// * `interleave` specifies the interleaved layout of type [`CUtensorMapInterleave`], which is defined as:
23396    ///
23397    /// ```text
23398    ///   typedef enum CUtensorMapInterleave_enum {
23399    /// CU_TENSOR_MAP_INTERLEAVE_NONE = 0,
23400    /// CU_TENSOR_MAP_INTERLEAVE_16B,
23401    /// CU_TENSOR_MAP_INTERLEAVE_32B
23402    ///   } CUtensorMapInterleave;
23403    /// ```
23404    ///
23405    ///   TMA supports interleaved layouts like NC/8HWC8 where C8 utilizes 16 bytes in memory assuming 2 byte per channel or NC/16HWC16 where C16 uses 32 bytes. When `interleave` is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_NONE`] and `swizzle` is not [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_NONE`], the bounding box inner dimension (computed as `boxDim`\[0\] multiplied by element size derived from `tensorDataType`) must be less than or equal to the swizzle size.
23406    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_32B`] requires the bounding box inner dimension to be &lt;= 32.
23407    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_64B`] requires the bounding box inner dimension to be &lt;= 64.
23408    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B`]\* require the bounding box inner dimension to be &lt;= 128. Additionally, `tensorDataType` of [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] requires `interleave` to be [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_NONE`].
23409    /// * `swizzle`, which specifies the shared memory bank swizzling pattern, has to be of type [`CUtensorMapSwizzle`] which is defined as:
23410    ///
23411    /// ```text
23412    ///   typedef enum CUtensorMapSwizzle_enum {
23413    /// CU_TENSOR_MAP_SWIZZLE_NONE = 0,
23414    /// CU_TENSOR_MAP_SWIZZLE_32B,                   // Swizzle 16B chunks within 32B  span
23415    /// CU_TENSOR_MAP_SWIZZLE_64B,                   // Swizzle 16B chunks within 64B  span
23416    /// CU_TENSOR_MAP_SWIZZLE_128B,                  // Swizzle 16B chunks within 128B span
23417    /// CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B,         // Swizzle 32B chunks within 128B span
23418    /// CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B_FLIP_8B, // Swizzle 32B chunks within 128B span, additionally swap lower 8B with upper 8B within each 16B for every alternate row
23419    /// CU_TENSOR_MAP_SWIZZLE_128B_ATOM_64B,         // Swizzle 64B chunks within 128B span
23420    ///   } CUtensorMapSwizzle;
23421    /// ```
23422    ///
23423    ///   Data are organized in a specific order in global memory; however, this may not match the order in which the application accesses data in shared memory. This difference in data organization may cause bank conflicts when shared memory is accessed. In order to avoid this problem, data can be loaded to shared memory with shuffling across shared memory banks. When `interleave` is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_32B`], `swizzle` must be [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_32B`]. Other interleave modes can have any swizzling pattern. When the `tensorDataType` is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`], only the following swizzle modes are supported:
23424    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_NONE`] (Load & Store)
23425    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B`] (Load & Store)
23426    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B`] (Load & Store)
23427    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B_ATOM_64B`] (Store only) When the `tensorDataType` is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], only the following swizzle modes are supported:
23428    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_NONE`] (Load only)
23429    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B`] (Load only)
23430    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B`] (Load only)
23431    /// * `l2Promotion` specifies L2 fetch size which indicates the byte granurality at which L2 requests is filled from DRAM. It must be of type [`CUtensorMapL2promotion`], which is defined as:
23432    ///
23433    /// ```text
23434    ///   typedef enum CUtensorMapL2promotion_enum {
23435    /// CU_TENSOR_MAP_L2_PROMOTION_NONE = 0,
23436    /// CU_TENSOR_MAP_L2_PROMOTION_L2_64B,
23437    /// CU_TENSOR_MAP_L2_PROMOTION_L2_128B,
23438    /// CU_TENSOR_MAP_L2_PROMOTION_L2_256B
23439    ///   } CUtensorMapL2promotion;
23440    /// ```
23441    /// * `oobFill`, which indicates whether zero or a special NaN constant should be used to fill out-of-bound elements, must be of type [`CUtensorMapFloatOOBfill`] which is defined as:
23442    ///
23443    /// ```text
23444    ///   typedef enum CUtensorMapFloatOOBfill_enum {
23445    /// CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE = 0,
23446    /// CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA
23447    ///   } CUtensorMapFloatOOBfill;
23448    /// ```
23449    ///
23450    ///   Note that [`CUtensorMapFloatOOBfill::CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA`] can only be used when `tensorDataType` represents a floating-point data type, and when `tensorDataType` is not [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B`], [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], and [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`].
23451    ///
23452    /// # Parameters
23453    ///
23454    /// - `tensorMap`: Tensor map object to create.
23455    /// - `tensorDataType`: Tensor data type.
23456    /// - `tensorRank`: Dimensionality of tensor.
23457    /// - `globalAddress`: Starting address of memory region described by tensor.
23458    /// - `globalDim`: Array containing tensor size (number of elements) along each of the `tensorRank` dimensions.
23459    /// - `globalStrides`: Array containing stride size (in bytes) along each of the `tensorRank` - 1 dimensions.
23460    /// - `boxDim`: Array containing traversal box size (number of elments) along each of the `tensorRank` dimensions. Specifies how many elements to be traversed along each tensor dimension.
23461    /// - `elementStrides`: Array containing traversal stride in each of the `tensorRank` dimensions.
23462    /// - `interleave`: Type of interleaved layout the tensor addresses.
23463    /// - `swizzle`: Bank swizzling pattern inside shared memory.
23464    /// - `l2Promotion`: L2 promotion size.
23465    /// - `oobFill`: Indicate whether zero or special NaN constant must be used to fill out-of-bound elements.
23466    ///
23467    /// # Return value
23468    ///
23469    /// - [`CUresult::CUDA_SUCCESS`]
23470    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
23471    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
23472    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
23473    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
23474    ///
23475    /// See also: [`cuTensorMapEncodeIm2col`], [`cuTensorMapEncodeIm2colWide`], [`cuTensorMapReplaceAddress`].
23476    pub fn cuTensorMapEncodeTiled(
23477        tensorMap: *mut CUtensorMap,
23478        tensorDataType: CUtensorMapDataType,
23479        tensorRank: cuuint32_t,
23480        globalAddress: *mut ::core::ffi::c_void,
23481        globalDim: *const cuuint64_t,
23482        globalStrides: *const cuuint64_t,
23483        boxDim: *const cuuint32_t,
23484        elementStrides: *const cuuint32_t,
23485        interleave: CUtensorMapInterleave,
23486        swizzle: CUtensorMapSwizzle,
23487        l2Promotion: CUtensorMapL2promotion,
23488        oobFill: CUtensorMapFloatOOBfill,
23489    ) -> CUresult;
23490}
23491singe_loader::functions! { crate::DRIVER;
23492    /// Create a tensor map descriptor object representing im2col memory region.
23493    ///
23494    /// Creates a descriptor for Tensor Memory Access (TMA) object specified by the parameters describing a im2col memory layout and returns it in `tensorMap`.
23495    ///
23496    /// Tensor map objects are only supported on devices of compute capability 9.0 or higher. Additionally, a tensor map object is an opaque value, and, as such, should only be accessed through CUDA APIs and PTX.
23497    ///
23498    /// The parameters passed are bound to the following requirements:
23499    ///
23500    /// * `tensorMap` address must be aligned to 64 bytes.
23501    /// * `tensorDataType` has to be an enum from [`CUtensorMapDataType`] which is defined as:
23502    ///
23503    /// ```text
23504    ///   typedef enum CUtensorMapDataType_enum {
23505    /// CU_TENSOR_MAP_DATA_TYPE_UINT8 = 0,       // 1 byte
23506    /// CU_TENSOR_MAP_DATA_TYPE_UINT16,          // 2 bytes
23507    /// CU_TENSOR_MAP_DATA_TYPE_UINT32,          // 4 bytes
23508    /// CU_TENSOR_MAP_DATA_TYPE_INT32,           // 4 bytes
23509    /// CU_TENSOR_MAP_DATA_TYPE_UINT64,          // 8 bytes
23510    /// CU_TENSOR_MAP_DATA_TYPE_INT64,           // 8 bytes
23511    /// CU_TENSOR_MAP_DATA_TYPE_FLOAT16,         // 2 bytes
23512    /// CU_TENSOR_MAP_DATA_TYPE_FLOAT32,         // 4 bytes
23513    /// CU_TENSOR_MAP_DATA_TYPE_FLOAT64,         // 8 bytes
23514    /// CU_TENSOR_MAP_DATA_TYPE_BFLOAT16,        // 2 bytes
23515    /// CU_TENSOR_MAP_DATA_TYPE_FLOAT32_FTZ,     // 4 bytes
23516    /// CU_TENSOR_MAP_DATA_TYPE_TFLOAT32,        // 4 bytes
23517    /// CU_TENSOR_MAP_DATA_TYPE_TFLOAT32_FTZ     // 4 bytes
23518    /// CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B,    // 4 bits
23519    /// CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B,   // 4 bits
23520    /// CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B    // 6 bits
23521    ///   } CUtensorMapDataType;
23522    /// ```
23523    ///
23524    ///   [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B`] copies ‘16 x U4’ packed values to memory aligned as 8 bytes. There are no gaps between packed values. [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`] copies ‘16 x U4’ packed values to memory aligned as 16 bytes. There are 8 byte gaps between every 8 byte chunk of packed values. [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] copies ‘16 x U6’ packed values to memory aligned as 16 bytes. There are 4 byte gaps between every 12 byte chunk of packed values.
23525    /// * `tensorRank`, which specifies the number of tensor dimensions, must be 3, 4, or 5.
23526    /// * `globalAddress`, which specifies the starting address of the memory region described, must be 16 byte aligned. The following requirements need to also be met:
23527    ///
23528    ///   + When `interleave` is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_32B`], `globalAddress` must be 32 byte aligned.
23529    ///   + When `tensorDataType` is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] or [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], `globalAddress` must be 32 byte aligned.
23530    /// * `globalDim` array, which specifies tensor size of each of the `tensorRank` dimensions, must be non-zero and less than or equal to 2^32. Additionally, the following requirements need to be met for the packed data types:
23531    ///
23532    ///   + When `tensorDataType` is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] or [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], globalDim\[0\] must be a multiple of 128.
23533    ///   + When `tensorDataType` is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B`], `globalDim`\[0\] must be a multiple of 2.
23534    ///   + Dimension for the packed data types must reflect the number of individual U# values.
23535    /// * `globalStrides` array, which specifies tensor stride of each of the lower `tensorRank` - 1 dimensions in bytes, must be a multiple of 16 and less than 2^40. Additionally, the following requirements need to be met:
23536    ///
23537    ///   + When `interleave` is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_32B`], the strides must be a multiple of 32.
23538    ///   + When `tensorDataType` is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] or [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], the strides must be a multiple of 32. Each following dimension specified includes previous dimension stride:
23539    ///
23540    /// ```text
23541    /// globalStrides\[0\] = globalDim\[0\] * elementSizeInBytes(tensorDataType) + padding\[0\];
23542    /// for (i = 1; i < tensorRank - 1; i++)
23543    /// globalStrides\[i\] = globalStrides\[i – 1\] * (globalDim\[i\] + padding\[i\]);
23544    /// assert(globalStrides\[i\] >= globalDim\[i\]);
23545    /// ```
23546    /// * `pixelBoxLowerCorner` array specifies the coordinate offsets {D, H, W} of the bounding box from top/left/front corner. The number of offsets and their precision depend on the tensor dimensionality:
23547    ///
23548    ///   + When `tensorRank` is 3, one signed offset within range \[-32768, 32767\] is supported.
23549    ///   + When `tensorRank` is 4, two signed offsets each within range \[-128, 127\] are supported.
23550    ///   + When `tensorRank` is 5, three offsets each within range \[-16, 15\] are supported.
23551    /// * `pixelBoxUpperCorner` array specifies the coordinate offsets {D, H, W} of the bounding box from bottom/right/back corner. The number of offsets and their precision depend on the tensor dimensionality:
23552    ///
23553    ///   + When `tensorRank` is 3, one signed offset within range \[-32768, 32767\] is supported.
23554    ///   + When `tensorRank` is 4, two signed offsets each within range \[-128, 127\] are supported.
23555    ///   + When `tensorRank` is 5, three offsets each within range \[-16, 15\] are supported. The bounding box specified by `pixelBoxLowerCorner` and `pixelBoxUpperCorner` must have non-zero area.
23556    /// * `channelsPerPixel`, which specifies the number of elements which must be accessed along C dimension, must be less than or equal to 256. Additionally, when `tensorDataType` is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] or [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], `channelsPerPixel` must be 128.
23557    /// * `pixelsPerColumn`, which specifies the number of elements that must be accessed along the {N, D, H, W} dimensions, must be less than or equal to 1024.
23558    /// * `elementStrides` array, which specifies the iteration step along each of the `tensorRank` dimensions, must be non-zero and less than or equal to 8. Note that when `interleave` is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_NONE`], the first element of this array is ignored since TMA doesn’t support the stride for dimension zero. When all elements of the `elementStrides` array are one, `boxDim` specifies the number of elements to load. However, if `elementStrides`\[i\] is not equal to one for some `i`, then TMA loads ceil( `boxDim`\[i\] / `elementStrides`\[i\]) number of elements along i-th dimension. To load N elements along i-th dimension, `boxDim`\[i\] must be set to N \* `elementStrides`\[i\].
23559    /// * `interleave` specifies the interleaved layout of type [`CUtensorMapInterleave`], which is defined as:
23560    ///
23561    /// ```text
23562    ///   typedef enum CUtensorMapInterleave_enum {
23563    /// CU_TENSOR_MAP_INTERLEAVE_NONE = 0,
23564    /// CU_TENSOR_MAP_INTERLEAVE_16B,
23565    /// CU_TENSOR_MAP_INTERLEAVE_32B
23566    ///   } CUtensorMapInterleave;
23567    /// ```
23568    ///
23569    ///   TMA supports interleaved layouts like NC/8HWC8 where C8 utilizes 16 bytes in memory assuming 2 byte per channel or NC/16HWC16 where C16 uses 32 bytes. When `interleave` is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_NONE`] and `swizzle` is not [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_NONE`], the bounding box inner dimension (computed as `channelsPerPixel` multiplied by element size in bytes derived from `tensorDataType`) must be less than or equal to the swizzle size.
23570    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_32B`] requires the bounding box inner dimension to be &lt;= 32.
23571    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_64B`] requires the bounding box inner dimension to be &lt;= 64.
23572    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B`]\* require the bounding box inner dimension to be &lt;= 128. Additionally, `tensorDataType` of [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] requires `interleave` to be [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_NONE`].
23573    /// * `swizzle`, which specifies the shared memory bank swizzling pattern, has to be of type [`CUtensorMapSwizzle`] which is defined as:
23574    ///
23575    /// ```text
23576    ///   typedef enum CUtensorMapSwizzle_enum {
23577    /// CU_TENSOR_MAP_SWIZZLE_NONE = 0,
23578    /// CU_TENSOR_MAP_SWIZZLE_32B,                   // Swizzle 16B chunks within 32B  span
23579    /// CU_TENSOR_MAP_SWIZZLE_64B,                   // Swizzle 16B chunks within 64B  span
23580    /// CU_TENSOR_MAP_SWIZZLE_128B,                  // Swizzle 16B chunks within 128B span
23581    /// CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B,         // Swizzle 32B chunks within 128B span
23582    /// CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B_FLIP_8B, // Swizzle 32B chunks within 128B span, additionally swap lower 8B with upper 8B within each 16B for every alternate row
23583    /// CU_TENSOR_MAP_SWIZZLE_128B_ATOM_64B,         // Swizzle 64B chunks within 128B span
23584    ///   } CUtensorMapSwizzle;
23585    /// ```
23586    ///
23587    ///   Data are organized in a specific order in global memory; however, this may not match the order in which the application accesses data in shared memory. This difference in data organization may cause bank conflicts when shared memory is accessed. In order to avoid this problem, data can be loaded to shared memory with shuffling across shared memory banks. When `interleave` is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_32B`], `swizzle` must be [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_32B`]. Other interleave modes can have any swizzling pattern. When the `tensorDataType` is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`], only the following swizzle modes are supported:
23588    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_NONE`] (Load & Store)
23589    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B`] (Load & Store)
23590    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B`] (Load & Store)
23591    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B_ATOM_64B`] (Store only) When the `tensorDataType` is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], only the following swizzle modes are supported:
23592    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_NONE`] (Load only)
23593    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B`] (Load only)
23594    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B`] (Load only)
23595    /// * `l2Promotion` specifies L2 fetch size which indicates the byte granularity at which L2 requests are filled from DRAM. It must be of type [`CUtensorMapL2promotion`], which is defined as:
23596    ///
23597    /// ```text
23598    ///   typedef enum CUtensorMapL2promotion_enum {
23599    /// CU_TENSOR_MAP_L2_PROMOTION_NONE = 0,
23600    /// CU_TENSOR_MAP_L2_PROMOTION_L2_64B,
23601    /// CU_TENSOR_MAP_L2_PROMOTION_L2_128B,
23602    /// CU_TENSOR_MAP_L2_PROMOTION_L2_256B
23603    ///   } CUtensorMapL2promotion;
23604    /// ```
23605    /// * `oobFill`, which indicates whether zero or a special NaN constant should be used to fill out-of-bound elements, must be of type [`CUtensorMapFloatOOBfill`] which is defined as:
23606    ///
23607    /// ```text
23608    ///   typedef enum CUtensorMapFloatOOBfill_enum {
23609    /// CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE = 0,
23610    /// CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA
23611    ///   } CUtensorMapFloatOOBfill;
23612    /// ```
23613    ///
23614    ///   Note that [`CUtensorMapFloatOOBfill::CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA`] can only be used when `tensorDataType` represents a floating-point data type, and when `tensorDataType` is not [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B`], [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], and [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`].
23615    ///
23616    /// # Parameters
23617    ///
23618    /// - `tensorMap`: Tensor map object to create.
23619    /// - `tensorDataType`: Tensor data type.
23620    /// - `tensorRank`: Dimensionality of tensor; must be at least 3.
23621    /// - `globalAddress`: Starting address of memory region described by tensor.
23622    /// - `globalDim`: Array containing tensor size (number of elements) along each of the `tensorRank` dimensions.
23623    /// - `globalStrides`: Array containing stride size (in bytes) along each of the `tensorRank` - 1 dimensions.
23624    /// - `pixelBoxLowerCorner`: Array containing DHW dimensions of lower box corner.
23625    /// - `pixelBoxUpperCorner`: Array containing DHW dimensions of upper box corner.
23626    /// - `channelsPerPixel`: Number of channels per pixel.
23627    /// - `pixelsPerColumn`: Number of pixels per column.
23628    /// - `elementStrides`: Array containing traversal stride in each of the `tensorRank` dimensions.
23629    /// - `interleave`: Type of interleaved layout the tensor addresses.
23630    /// - `swizzle`: Bank swizzling pattern inside shared memory.
23631    /// - `l2Promotion`: L2 promotion size.
23632    /// - `oobFill`: Indicate whether zero or special NaN constant will be used to fill out-of-bound elements.
23633    ///
23634    /// # Return value
23635    ///
23636    /// - [`CUresult::CUDA_SUCCESS`]
23637    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
23638    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
23639    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
23640    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
23641    ///
23642    /// See also: [`cuTensorMapEncodeTiled`], [`cuTensorMapEncodeIm2colWide`], [`cuTensorMapReplaceAddress`].
23643    pub fn cuTensorMapEncodeIm2col(
23644        tensorMap: *mut CUtensorMap,
23645        tensorDataType: CUtensorMapDataType,
23646        tensorRank: cuuint32_t,
23647        globalAddress: *mut ::core::ffi::c_void,
23648        globalDim: *const cuuint64_t,
23649        globalStrides: *const cuuint64_t,
23650        pixelBoxLowerCorner: *const ::core::ffi::c_int,
23651        pixelBoxUpperCorner: *const ::core::ffi::c_int,
23652        channelsPerPixel: cuuint32_t,
23653        pixelsPerColumn: cuuint32_t,
23654        elementStrides: *const cuuint32_t,
23655        interleave: CUtensorMapInterleave,
23656        swizzle: CUtensorMapSwizzle,
23657        l2Promotion: CUtensorMapL2promotion,
23658        oobFill: CUtensorMapFloatOOBfill,
23659    ) -> CUresult;
23660}
23661singe_loader::functions! { crate::DRIVER;
23662    /// Create a tensor map descriptor object representing im2col memory region, but where the elements are exclusively loaded along the W dimension.
23663    ///
23664    /// Creates a descriptor for Tensor Memory Access (TMA) object specified by the parameters describing a im2col memory layout and where the row is always loaded along the W dimensuin and returns it in `tensorMap`. This assumes the tensor layout in memory is either NDHWC, NHWC, or NWC.
23665    ///
23666    /// This API is only supported on devices of compute capability 10.0 or higher. Additionally, a tensor map object is an opaque value, and, as such, should only be accessed through CUDA APIs and PTX.
23667    ///
23668    /// The parameters passed are bound to the following requirements:
23669    ///
23670    /// * `tensorMap` address must be aligned to 64 bytes.
23671    /// * `tensorDataType` has to be an enum from [`CUtensorMapDataType`] which is defined as:
23672    ///
23673    /// ```text
23674    ///   typedef enum CUtensorMapDataType_enum {
23675    /// CU_TENSOR_MAP_DATA_TYPE_UINT8 = 0,       // 1 byte
23676    /// CU_TENSOR_MAP_DATA_TYPE_UINT16,          // 2 bytes
23677    /// CU_TENSOR_MAP_DATA_TYPE_UINT32,          // 4 bytes
23678    /// CU_TENSOR_MAP_DATA_TYPE_INT32,           // 4 bytes
23679    /// CU_TENSOR_MAP_DATA_TYPE_UINT64,          // 8 bytes
23680    /// CU_TENSOR_MAP_DATA_TYPE_INT64,           // 8 bytes
23681    /// CU_TENSOR_MAP_DATA_TYPE_FLOAT16,         // 2 bytes
23682    /// CU_TENSOR_MAP_DATA_TYPE_FLOAT32,         // 4 bytes
23683    /// CU_TENSOR_MAP_DATA_TYPE_FLOAT64,         // 8 bytes
23684    /// CU_TENSOR_MAP_DATA_TYPE_BFLOAT16,        // 2 bytes
23685    /// CU_TENSOR_MAP_DATA_TYPE_FLOAT32_FTZ,     // 4 bytes
23686    /// CU_TENSOR_MAP_DATA_TYPE_TFLOAT32,        // 4 bytes
23687    /// CU_TENSOR_MAP_DATA_TYPE_TFLOAT32_FTZ     // 4 bytes
23688    /// CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B,    // 4 bits
23689    /// CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B,   // 4 bits
23690    /// CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B    // 6 bits
23691    ///   } CUtensorMapDataType;
23692    /// ```
23693    ///
23694    ///   [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B`] copies ‘16 x U4’ packed values to memory aligned as 8 bytes. There are no gaps between packed values. [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`] copies ‘16 x U4’ packed values to memory aligned as 16 bytes. There are 8 byte gaps between every 8 byte chunk of packed values. [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] copies ‘16 x U6’ packed values to memory aligned as 16 bytes. There are 4 byte gaps between every 12 byte chunk of packed values.
23695    /// * `tensorRank`, which specifies the number of tensor dimensions, must be 3, 4, or 5.
23696    /// * `globalAddress`, which specifies the starting address of the memory region described, must be 16 byte aligned. The following requirements need to also be met:
23697    ///
23698    ///   + When `interleave` is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_32B`], `globalAddress` must be 32 byte aligned.
23699    ///   + When `tensorDataType` is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] or [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], `globalAddress` must be 32 byte aligned.
23700    ///
23701    /// `globalDim` array, which specifies tensor size of each of the `tensorRank` dimensions, must be non-zero and less than or equal to 2^32. Additionally, the following requirements need to be met for the packed data types:
23702    ///
23703    /// * When `tensorDataType` is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] or [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], globalDim\[0\] must be a multiple of 128.
23704    /// * When `tensorDataType` is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B`], `globalDim`\[0\] must be a multiple of 2.
23705    /// * Dimension for the packed data types must reflect the number of individual U# values.
23706    ///
23707    /// `globalStrides` array, which specifies tensor stride of each of the lower `tensorRank` - 1 dimensions in bytes, must be a multiple of 16 and less than 2^40. Additionally, the following requirements need to be met:
23708    ///
23709    /// * When `interleave` is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_32B`], the strides must be a multiple of 32.
23710    /// * When `tensorDataType` is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] or [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], the strides must be a multiple of 32. Each following dimension specified includes previous dimension stride:
23711    ///
23712    /// ```text
23713    ///   globalStrides\[0\] = globalDim\[0\] * elementSizeInBytes(tensorDataType) + padding\[0\];
23714    ///   for (i = 1; i < tensorRank - 1; i++)
23715    /// globalStrides\[i\] = globalStrides\[i – 1\] * (globalDim\[i\] + padding\[i\]);
23716    /// assert(globalStrides\[i\] >= globalDim\[i\]);
23717    /// ```
23718    ///
23719    /// `pixelBoxLowerCornerWidth` specifies the coordinate offset W of the bounding box from left corner. The offset must be within range \[-32768, 32767\].
23720    ///
23721    /// * `pixelBoxUpperCornerWidth` specifies the coordinate offset W of the bounding box from right corner. The offset must be within range \[-32768, 32767\].
23722    ///
23723    /// The bounding box specified by `pixelBoxLowerCornerWidth` and `pixelBoxUpperCornerWidth` must have non-zero area. Note that the size of the box along D and H dimensions is always equal to one.
23724    ///
23725    /// * `channelsPerPixel`, which specifies the number of elements which must be accessed along C dimension, must be less than or equal to 256. Additionally, when `tensorDataType` is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] or [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], `channelsPerPixel` must be 128.
23726    /// * `pixelsPerColumn`, which specifies the number of elements that must be accessed along the W dimension, must be less than or equal to 1024. This field is ignored when `mode` is [`CUtensorMapIm2ColWideMode::CU_TENSOR_MAP_IM2COL_WIDE_MODE_W128`].
23727    /// * `elementStrides` array, which specifies the iteration step along each of the `tensorRank` dimensions, must be non-zero and less than or equal to 8. Note that when `interleave` is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_NONE`], the first element of this array is ignored since TMA doesn’t support the stride for dimension zero. When all elements of the `elementStrides` array are one, `boxDim` specifies the number of elements to load. However, if `elementStrides`\[i\] is not equal to one for some `i`, then TMA loads ceil( `boxDim`\[i\] / `elementStrides`\[i\]) number of elements along i-th dimension. To load N elements along i-th dimension, `boxDim`\[i\] must be set to N \* `elementStrides`\[i\].
23728    /// * `interleave` specifies the interleaved layout of type [`CUtensorMapInterleave`], which is defined as:
23729    ///
23730    /// ```text
23731    ///   typedef enum CUtensorMapInterleave_enum {
23732    /// CU_TENSOR_MAP_INTERLEAVE_NONE = 0,
23733    /// CU_TENSOR_MAP_INTERLEAVE_16B,
23734    /// CU_TENSOR_MAP_INTERLEAVE_32B
23735    ///   } CUtensorMapInterleave;
23736    /// ```
23737    ///
23738    ///   TMA supports interleaved layouts like NC/8HWC8 where C8 utilizes 16 bytes in memory assuming 2 byte per channel or NC/16HWC16 where C16 uses 32 bytes. When `interleave` is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_NONE`], the bounding box inner dimension (computed as `channelsPerPixel` multiplied by element size in bytes derived from `tensorDataType`) must be less than or equal to the swizzle size.
23739    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_64B`] requires the bounding box inner dimension to be &lt;= 64.
23740    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B`]\* require the bounding box inner dimension to be &lt;= 128. Additionally, `tensorDataType` of [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] requires `interleave` to be [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_NONE`].
23741    /// * `mode`, which describes loading of elements loaded along the W dimension, has to be one of the following [`CUtensorMapIm2ColWideMode`] types:
23742    ///
23743    /// ```text
23744    ///   CU_TENSOR_MAP_IM2COL_WIDE_MODE_W,
23745    ///   CU_TENSOR_MAP_IM2COL_WIDE_MODE_W128
23746    /// ```
23747    ///
23748    ///   [`CUtensorMapIm2ColWideMode::CU_TENSOR_MAP_IM2COL_WIDE_MODE_W`] allows the number of elements loaded along the W dimension to be specified via the `pixelsPerColumn` field.
23749    /// * `swizzle`, which specifies the shared memory bank swizzling pattern, must be one of the following [`CUtensorMapSwizzle`] modes (other swizzle modes are not supported):
23750    ///
23751    /// ```text
23752    ///   typedef enum CUtensorMapSwizzle_enum {
23753    /// CU_TENSOR_MAP_SWIZZLE_64B,                   // Swizzle 16B chunks within 64B  span
23754    /// CU_TENSOR_MAP_SWIZZLE_128B,                  // Swizzle 16B chunks within 128B span
23755    /// CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B,         // Swizzle 32B chunks within 128B span
23756    ///   } CUtensorMapSwizzle;
23757    /// ```
23758    ///
23759    ///   Data are organized in a specific order in global memory; however, this may not match the order in which the application accesses data in shared memory. This difference in data organization may cause bank conflicts when shared memory is accessed. In order to avoid this problem, data can be loaded to shared memory with shuffling across shared memory banks. When the `tensorDataType` is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`], only the following swizzle modes are supported:
23760    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_64B`] (Store only)
23761    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B`] (Load & Store)
23762    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B`] (Load & Store) When the `tensorDataType` is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], only the following swizzle modes are supported:
23763    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B`] (Load only)
23764    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B`] (Load only)
23765    ///
23766    /// Additionally, `CU_TENSOR_MAP_SWIZZLE_96B` is supported only when `mode` is [`CUtensorMapIm2ColWideMode::CU_TENSOR_MAP_IM2COL_WIDE_MODE_W`].
23767    ///
23768    /// * `l2Promotion` specifies L2 fetch size which indicates the byte granularity at which L2 requests are filled from DRAM. It must be of type [`CUtensorMapL2promotion`], which is defined as:
23769    ///
23770    /// ```text
23771    ///   typedef enum CUtensorMapL2promotion_enum {
23772    /// CU_TENSOR_MAP_L2_PROMOTION_NONE = 0,
23773    /// CU_TENSOR_MAP_L2_PROMOTION_L2_64B,
23774    /// CU_TENSOR_MAP_L2_PROMOTION_L2_128B,
23775    /// CU_TENSOR_MAP_L2_PROMOTION_L2_256B
23776    ///   } CUtensorMapL2promotion;
23777    /// ```
23778    /// * `oobFill`, which indicates whether zero or a special NaN constant should be used to fill out-of-bound elements, must be of type [`CUtensorMapFloatOOBfill`] which is defined as:
23779    ///
23780    /// ```text
23781    ///   typedef enum CUtensorMapFloatOOBfill_enum {
23782    /// CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE = 0,
23783    /// CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA
23784    ///   } CUtensorMapFloatOOBfill;
23785    /// ```
23786    ///
23787    ///   Note that [`CUtensorMapFloatOOBfill::CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA`] can only be used when `tensorDataType` represents a floating-point data type, and when `tensorDataType` is not [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B`], [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], and [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`].
23788    ///
23789    /// # Parameters
23790    ///
23791    /// - `tensorMap`: Tensor map object to create.
23792    /// - `tensorDataType`: Tensor data type.
23793    /// - `tensorRank`: Dimensionality of tensor; must be at least 3.
23794    /// - `globalAddress`: Starting address of memory region described by tensor.
23795    /// - `globalDim`: Array containing tensor size (number of elements) along each of the `tensorRank` dimensions.
23796    /// - `globalStrides`: Array containing stride size (in bytes) along each of the `tensorRank` - 1 dimensions.
23797    /// - `pixelBoxLowerCornerWidth`: Width offset of left box corner.
23798    /// - `pixelBoxUpperCornerWidth`: Width offset of right box corner.
23799    /// - `channelsPerPixel`: Number of channels per pixel.
23800    /// - `pixelsPerColumn`: Number of pixels per column.
23801    /// - `elementStrides`: Array containing traversal stride in each of the `tensorRank` dimensions.
23802    /// - `interleave`: Type of interleaved layout the tensor addresses.
23803    /// - `mode`: W or W128 mode.
23804    /// - `swizzle`: Bank swizzling pattern inside shared memory.
23805    /// - `l2Promotion`: L2 promotion size.
23806    /// - `oobFill`: Indicate whether zero or special NaN constant will be used to fill out-of-bound elements.
23807    ///
23808    /// # Return value
23809    ///
23810    /// - [`CUresult::CUDA_SUCCESS`]
23811    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
23812    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
23813    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
23814    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
23815    ///
23816    /// See also: [`cuTensorMapEncodeTiled`], [`cuTensorMapEncodeIm2col`], [`cuTensorMapReplaceAddress`].
23817    pub fn cuTensorMapEncodeIm2colWide(
23818        tensorMap: *mut CUtensorMap,
23819        tensorDataType: CUtensorMapDataType,
23820        tensorRank: cuuint32_t,
23821        globalAddress: *mut ::core::ffi::c_void,
23822        globalDim: *const cuuint64_t,
23823        globalStrides: *const cuuint64_t,
23824        pixelBoxLowerCornerWidth: ::core::ffi::c_int,
23825        pixelBoxUpperCornerWidth: ::core::ffi::c_int,
23826        channelsPerPixel: cuuint32_t,
23827        pixelsPerColumn: cuuint32_t,
23828        elementStrides: *const cuuint32_t,
23829        interleave: CUtensorMapInterleave,
23830        mode: CUtensorMapIm2ColWideMode,
23831        swizzle: CUtensorMapSwizzle,
23832        l2Promotion: CUtensorMapL2promotion,
23833        oobFill: CUtensorMapFloatOOBfill,
23834    ) -> CUresult;
23835}
23836singe_loader::functions! { crate::DRIVER;
23837    /// Modify an existing tensor map descriptor with an updated global address.
23838    ///
23839    /// Modifies the descriptor for Tensor Memory Access (TMA) object passed in `tensorMap` with an updated `globalAddress`.
23840    ///
23841    /// Tensor map objects are only supported on devices of compute capability 9.0 or higher. Additionally, a tensor map object is an opaque value, and, as such, should only be accessed through CUDA API calls.
23842    ///
23843    /// # Parameters
23844    ///
23845    /// - `tensorMap`: Tensor map object to modify.
23846    /// - `globalAddress`: Starting address of memory region described by tensor, must follow previous alignment requirements.
23847    ///
23848    /// # Return value
23849    ///
23850    /// - [`CUresult::CUDA_SUCCESS`]
23851    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
23852    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
23853    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
23854    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
23855    ///
23856    /// See also: [`cuTensorMapEncodeTiled`], [`cuTensorMapEncodeIm2col`], [`cuTensorMapEncodeIm2colWide`].
23857    pub fn cuTensorMapReplaceAddress(
23858        tensorMap: *mut CUtensorMap,
23859        globalAddress: *mut ::core::ffi::c_void,
23860    ) -> CUresult;
23861}
23862singe_loader::functions! { crate::DRIVER;
23863    /// Queries if a device may directly access a peer device’s memory.
23864    ///
23865    /// Returns in `*canAccessPeer` a value of 1 if contexts on `dev` are capable of directly accessing memory from contexts on `peerDev` and 0 otherwise. If direct access of `peerDev` from `dev` is possible, then access may be enabled on two specific contexts by calling [`cuCtxEnablePeerAccess`].
23866    ///
23867    /// Note that this function may also return error codes from previous, asynchronous launches.
23868    ///
23869    /// # Parameters
23870    ///
23871    /// - `canAccessPeer`: Returned access capability.
23872    /// - `dev`: Device from which allocations on `peerDev` are to be directly accessed.
23873    /// - `peerDev`: Device on which the allocations to be directly accessed by `dev` reside.
23874    ///
23875    /// # Return value
23876    ///
23877    /// - [`CUresult::CUDA_SUCCESS`]
23878    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
23879    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
23880    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
23881    ///
23882    /// See also: [`cuCtxEnablePeerAccess`], [`cuCtxDisablePeerAccess`], `cudaDeviceCanAccessPeer`.
23883    pub fn cuDeviceCanAccessPeer(
23884        canAccessPeer: *mut ::core::ffi::c_int,
23885        dev: CUdevice,
23886        peerDev: CUdevice,
23887    ) -> CUresult;
23888}
23889singe_loader::functions! { crate::DRIVER;
23890    /// Enables direct access to memory allocations in a peer context.
23891    ///
23892    /// If both the current context and `peerContext` are on devices which support unified addressing (as may be queried using [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING`]) and same major compute capability, then on success all allocations from `peerContext` will immediately be accessible by the current context. See [Unified Addressing](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__UNIFIED.html#group__cuda__unified) for additional details.
23893    ///
23894    /// Note that access granted by this call is unidirectional and that in order to access memory from the current context in `peerContext`, a separate symmetric call to [`cuCtxEnablePeerAccess`] is required.
23895    ///
23896    /// Note that there are both device-wide and system-wide limitations per system configuration, as noted in the CUDA Programming Guide under the section “Peer-to-Peer Memory Access”.
23897    ///
23898    /// Returns [`cudaError_enum::CUDA_ERROR_PEER_ACCESS_UNSUPPORTED`] if [`cuDeviceCanAccessPeer`] indicates that the [`CUdevice`] of the current context cannot directly access memory from the [`CUdevice`] of `peerContext`.
23899    ///
23900    /// Returns [`cudaError_enum::CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED`] if direct access of `peerContext` from the current context has already been enabled.
23901    ///
23902    /// Returns [`cudaError_enum::CUDA_ERROR_TOO_MANY_PEERS`] if direct peer access is not possible because hardware resources required for peer access have been exhausted.
23903    ///
23904    /// Returns [`cudaError_enum::CUDA_ERROR_INVALID_CONTEXT`] if there is no current context, `peerContext` is not a valid context, or if the current context is `peerContext`.
23905    ///
23906    /// Returns [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] if `Flags` is not 0.
23907    ///
23908    /// Note that this function may also return error codes from previous, asynchronous launches.
23909    ///
23910    /// # Parameters
23911    ///
23912    /// - `peerContext`: Peer context to enable direct access to from the current context.
23913    /// - `Flags`: Reserved for future use and must be set to 0.
23914    ///
23915    /// # Return value
23916    ///
23917    /// - [`CUresult::CUDA_SUCCESS`]
23918    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
23919    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
23920    /// - [`CUresult::CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED`]
23921    /// - [`CUresult::CUDA_ERROR_TOO_MANY_PEERS`]
23922    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
23923    /// - [`CUresult::CUDA_ERROR_PEER_ACCESS_UNSUPPORTED`]
23924    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
23925    ///
23926    /// See also: [`cuDeviceCanAccessPeer`], [`cuCtxDisablePeerAccess`], `cudaDeviceEnablePeerAccess`.
23927    pub fn cuCtxEnablePeerAccess(
23928        peerContext: CUcontext,
23929        Flags: ::core::ffi::c_uint,
23930    ) -> CUresult;
23931}
23932singe_loader::functions! { crate::DRIVER;
23933    /// Disables direct access to memory allocations in a peer context and unregisters any registered allocations.
23934    ///
23935    /// Returns [`cudaError_enum::CUDA_ERROR_PEER_ACCESS_NOT_ENABLED`] if direct peer access has not yet been enabled from `peerContext` to the current context.
23936    ///
23937    /// Returns [`cudaError_enum::CUDA_ERROR_INVALID_CONTEXT`] if there is no current context, or if `peerContext` is not a valid context.
23938    ///
23939    /// Note that this function may also return error codes from previous, asynchronous launches.
23940    ///
23941    /// # Parameters
23942    ///
23943    /// - `peerContext`: Peer context to disable direct access to
23944    ///
23945    /// # Return value
23946    ///
23947    /// - [`CUresult::CUDA_SUCCESS`]
23948    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
23949    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
23950    /// - [`CUresult::CUDA_ERROR_PEER_ACCESS_NOT_ENABLED`]
23951    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
23952    ///
23953    /// See also: [`cuDeviceCanAccessPeer`], [`cuCtxEnablePeerAccess`], `cudaDeviceDisablePeerAccess`.
23954    pub fn cuCtxDisablePeerAccess(peerContext: CUcontext) -> CUresult;
23955}
23956singe_loader::functions! { crate::DRIVER;
23957    /// Queries attributes of the link between two devices.
23958    ///
23959    /// Returns in `*value` the value of the requested attribute `attrib` of the link between `srcDevice` and `dstDevice`. The supported attributes are:
23960    ///
23961    /// * [`CUdevice_P2PAttribute_enum::CU_DEVICE_P2P_ATTRIBUTE_PERFORMANCE_RANK`]: A relative value indicating the performance of the link between two devices.
23962    /// * [`CUdevice_P2PAttribute_enum::CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED`] P2P: 1 if P2P Access is enable.
23963    /// * [`CUdevice_P2PAttribute_enum::CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED`]: 1 if all CUDA-valid atomic operations over the link are supported.
23964    /// * [`CUdevice_P2PAttribute_enum::CU_DEVICE_P2P_ATTRIBUTE_CUDA_ARRAY_ACCESS_SUPPORTED`]: 1 if cudaArray can be accessed over the link.
23965    /// * [`CUdevice_P2PAttribute_enum::CU_DEVICE_P2P_ATTRIBUTE_ONLY_PARTIAL_NATIVE_ATOMIC_SUPPORTED`]: 1 if some CUDA-valid atomic operations over the link are supported. Information about specific operations can be retrieved with [`cuDeviceGetP2PAtomicCapabilities`].
23966    ///
23967    /// Returns [`cudaError_enum::CUDA_ERROR_INVALID_DEVICE`] if `srcDevice` or `dstDevice` are not valid or if they represent the same device.
23968    ///
23969    /// Returns [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] if `attrib` is not valid or if `value` is a null pointer.
23970    ///
23971    /// Note that this function may also return error codes from previous, asynchronous launches.
23972    ///
23973    /// # Parameters
23974    ///
23975    /// - `value`: Returned value of the requested attribute.
23976    /// - `attrib`: The requested attribute of the link between `srcDevice` and `dstDevice`.
23977    /// - `srcDevice`: The source device of the target link.
23978    /// - `dstDevice`: The destination device of the target link.
23979    ///
23980    /// # Return value
23981    ///
23982    /// - [`CUresult::CUDA_SUCCESS`]
23983    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
23984    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
23985    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
23986    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
23987    ///
23988    /// See also: [`cuCtxEnablePeerAccess`], [`cuCtxDisablePeerAccess`], [`cuDeviceCanAccessPeer`], [`cuDeviceGetP2PAtomicCapabilities`], `cudaDeviceGetP2PAttribute`.
23989    pub fn cuDeviceGetP2PAttribute(
23990        value: *mut ::core::ffi::c_int,
23991        attrib: CUdevice_P2PAttribute,
23992        srcDevice: CUdevice,
23993        dstDevice: CUdevice,
23994    ) -> CUresult;
23995}
23996singe_loader::functions! { crate::DRIVER;
23997    /// Queries details about atomic operations supported between two devices.
23998    ///
23999    /// Returns in `*capabilities` the details about requested atomic `*operations` over the link between `srcDevice` and `dstDevice`. The allocated size of `*operations` and `*capabilities` must be `count`.
24000    ///
24001    /// For each [`CUatomicOperation`] in `*operations`, the corresponding result in `*capabilities` will be a bitmask indicating which of [`CUatomicOperationCapability`] the link supports natively.
24002    ///
24003    /// Returns [`cudaError_enum::CUDA_ERROR_INVALID_DEVICE`] if `srcDevice` or `dstDevice` are not valid or if they represent the same device.
24004    ///
24005    /// Returns [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] if `*capabilities` or `*operations` is NULL, if `count` is 0, or if any of `*operations` is not valid.
24006    ///
24007    /// Note that this function may also return error codes from previous, asynchronous launches.
24008    ///
24009    /// # Parameters
24010    ///
24011    /// - `capabilities`: Returned capability details of each requested operation.
24012    /// - `operations`: Requested operations.
24013    /// - `count`: Count of requested operations and size of capabilities.
24014    /// - `srcDevice`: The source device of the target link.
24015    /// - `dstDevice`: The destination device of the target link.
24016    ///
24017    /// # Return value
24018    ///
24019    /// - [`CUresult::CUDA_SUCCESS`]
24020    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
24021    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
24022    ///
24023    /// See also: [`cuDeviceGetP2PAttribute`], `cudaDeviceGetP2PAttribute`, `cudaDeviceGetP2PAtomicCapabilities`.
24024    pub fn cuDeviceGetP2PAtomicCapabilities(
24025        capabilities: *mut ::core::ffi::c_uint,
24026        operations: *const CUatomicOperation,
24027        count: ::core::ffi::c_uint,
24028        srcDevice: CUdevice,
24029        dstDevice: CUdevice,
24030    ) -> CUresult;
24031}
24032singe_loader::functions! { crate::DRIVER;
24033    /// Unregisters a graphics resource for access by CUDA.
24034    ///
24035    /// Unregisters the graphics resource `resource` so it is not accessible by CUDA unless registered again.
24036    ///
24037    /// If `resource` is invalid then [`cudaError_enum::CUDA_ERROR_INVALID_HANDLE`] is returned.
24038    ///
24039    /// Note that this function may also return error codes from previous, asynchronous launches.
24040    ///
24041    /// # Parameters
24042    ///
24043    /// - `resource`: Resource to unregister
24044    ///
24045    /// # Return value
24046    ///
24047    /// - [`CUresult::CUDA_SUCCESS`]
24048    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
24049    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
24050    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
24051    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
24052    /// - [`CUresult::CUDA_ERROR_UNKNOWN`]
24053    ///
24054    /// See also: [`cuGraphicsD3D9RegisterResource`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__D3D9.html#group__cuda__d3d9_1ga391835e0d3c5a34bdba99840157194bf), [`cuGraphicsD3D10RegisterResource`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__D3D10.html#group__cuda__d3d10_1ga87fb2a189c27c4b63538d23f53b2c8e6), [`cuGraphicsD3D11RegisterResource`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__D3D11.html#group__cuda__d3d11_1ga4c02792aa87c3acc255b9de15b0509da), [`cuGraphicsGLRegisterBuffer`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__GL.html#group__cuda__gl_1gad530f66cc9ab43a31a98527e75f343a0), [`cuGraphicsGLRegisterImage`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__GL.html#group__cuda__gl_1ga52c3a36c4c92611b6fcf0662b2f74e40), `cudaGraphicsUnregisterResource`.
24055    pub fn cuGraphicsUnregisterResource(resource: CUgraphicsResource) -> CUresult;
24056}
24057singe_loader::functions! { crate::DRIVER;
24058    /// Get an array through which to access a subresource of a mapped graphics resource.
24059    ///
24060    /// Returns in `*pArray` an array through which the subresource of the mapped graphics resource `resource` which corresponds to array index `arrayIndex` and mipmap level `mipLevel` may be accessed. The value set in `*pArray` may change every time that `resource` is mapped.
24061    ///
24062    /// If `resource` is not a texture then it cannot be accessed via an array and [`cudaError_enum::CUDA_ERROR_NOT_MAPPED_AS_ARRAY`] is returned. If `arrayIndex` is not a valid array index for `resource` then [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned. If `mipLevel` is not a valid mipmap level for `resource` then [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned. If `resource` is not mapped then [`cudaError_enum::CUDA_ERROR_NOT_MAPPED`] is returned.
24063    ///
24064    /// Note that this function may also return error codes from previous, asynchronous launches.
24065    ///
24066    /// # Parameters
24067    ///
24068    /// - `pArray`: Returned array through which a subresource of `resource` may be accessed.
24069    /// - `resource`: Mapped resource to access.
24070    /// - `arrayIndex`: Array index for array textures or cubemap face index as defined by [`CUarray_cubemap_face`] for cubemap textures for the subresource to access.
24071    /// - `mipLevel`: Mipmap level for the subresource to access.
24072    ///
24073    /// # Return value
24074    ///
24075    /// - [`CUresult::CUDA_SUCCESS`]
24076    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
24077    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
24078    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
24079    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
24080    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
24081    /// - [`CUresult::CUDA_ERROR_NOT_MAPPED`]
24082    /// - [`CUresult::CUDA_ERROR_NOT_MAPPED_AS_ARRAY`]
24083    ///
24084    /// See also: [`cuGraphicsResourceGetMappedPointer`], `cudaGraphicsSubResourceGetMappedArray`.
24085    pub fn cuGraphicsSubResourceGetMappedArray(
24086        pArray: *mut CUarray,
24087        resource: CUgraphicsResource,
24088        arrayIndex: ::core::ffi::c_uint,
24089        mipLevel: ::core::ffi::c_uint,
24090    ) -> CUresult;
24091}
24092singe_loader::functions! { crate::DRIVER;
24093    /// Get a mipmapped array through which to access a mapped graphics resource.
24094    ///
24095    /// Returns in `*pMipmappedArray` a mipmapped array through which the mapped graphics resource `resource`. The value set in `*pMipmappedArray` may change every time that `resource` is mapped.
24096    ///
24097    /// If `resource` is not a texture then it cannot be accessed via a mipmapped array and [`cudaError_enum::CUDA_ERROR_NOT_MAPPED_AS_ARRAY`] is returned. If `resource` is not mapped then [`cudaError_enum::CUDA_ERROR_NOT_MAPPED`] is returned.
24098    ///
24099    /// Note that this function may also return error codes from previous, asynchronous launches.
24100    ///
24101    /// # Parameters
24102    ///
24103    /// - `pMipmappedArray`: Returned mipmapped array through which `resource` may be accessed.
24104    /// - `resource`: Mapped resource to access.
24105    ///
24106    /// # Return value
24107    ///
24108    /// - [`CUresult::CUDA_SUCCESS`]
24109    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
24110    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
24111    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
24112    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
24113    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
24114    /// - [`CUresult::CUDA_ERROR_NOT_MAPPED`]
24115    /// - [`CUresult::CUDA_ERROR_NOT_MAPPED_AS_ARRAY`]
24116    ///
24117    /// See also: [`cuGraphicsResourceGetMappedPointer`], `cudaGraphicsResourceGetMappedMipmappedArray`.
24118    pub fn cuGraphicsResourceGetMappedMipmappedArray(
24119        pMipmappedArray: *mut CUmipmappedArray,
24120        resource: CUgraphicsResource,
24121    ) -> CUresult;
24122}
24123singe_loader::functions! { crate::DRIVER;
24124    /// Get a device pointer through which to access a mapped graphics resource.
24125    ///
24126    /// Returns in `*pDevPtr` a pointer through which the mapped graphics resource `resource` may be accessed. Returns in `pSize` the size of the memory in bytes which may be accessed from that pointer. The value set in `pPointer` may change every time that `resource` is mapped.
24127    ///
24128    /// If `resource` is not a buffer then it cannot be accessed via a pointer and [`cudaError_enum::CUDA_ERROR_NOT_MAPPED_AS_POINTER`] is returned. If `resource` is not mapped then [`cudaError_enum::CUDA_ERROR_NOT_MAPPED`] is returned.
24129    ///
24130    /// * See also
24131    ///
24132    ///   [`cuGraphicsMapResources`], [`cuGraphicsSubResourceGetMappedArray`], `cudaGraphicsResourceGetMappedPointer`.
24133    ///
24134    /// Note that this function may also return error codes from previous, asynchronous launches.
24135    ///
24136    /// # Parameters
24137    ///
24138    /// - `pDevPtr`: Returned pointer through which `resource` may be accessed.
24139    /// - `pSize`: Returned size of the buffer accessible starting at `*pPointer`.
24140    /// - `resource`: Mapped resource to access.
24141    ///
24142    /// # Return value
24143    ///
24144    /// - [`CUresult::CUDA_SUCCESS`]
24145    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
24146    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
24147    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
24148    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
24149    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
24150    /// - [`CUresult::CUDA_ERROR_NOT_MAPPED`]
24151    /// - [`CUresult::CUDA_ERROR_NOT_MAPPED_AS_POINTER`]
24152    pub fn cuGraphicsResourceGetMappedPointer_v2(
24153        pDevPtr: *mut CUdeviceptr,
24154        pSize: *mut size_t,
24155        resource: CUgraphicsResource,
24156    ) -> CUresult;
24157}
24158singe_loader::functions! { crate::DRIVER;
24159    /// Set usage flags for mapping a graphics resource.
24160    ///
24161    /// Set `flags` for mapping the graphics resource `resource`.
24162    ///
24163    /// Changes to `flags` will take effect the next time `resource` is mapped. The `flags` argument may be any of the following:
24164    ///
24165    /// * [`CUgraphicsMapResourceFlags::CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE`]: Specifies no hints about how this resource will be used. It is therefore assumed that this resource will be read from and written to by CUDA kernels. This is the default value.
24166    /// * `CU_GRAPHICS_MAP_RESOURCE_FLAGS_READONLY`: Specifies that CUDA kernels which access this resource will not write to this resource.
24167    /// * `CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITEDISCARD`: Specifies that CUDA kernels which access this resource will not read from this resource and will write over the entire contents of the resource, so none of the data previously stored in the resource will be preserved.
24168    ///
24169    /// If `resource` is presently mapped for access by CUDA then [`cudaError_enum::CUDA_ERROR_ALREADY_MAPPED`] is returned. If `flags` is not one of the above values then [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned.
24170    ///
24171    /// Note that this function may also return error codes from previous, asynchronous launches.
24172    ///
24173    /// # Parameters
24174    ///
24175    /// - `resource`: Registered resource to set flags for.
24176    /// - `flags`: Parameters for resource mapping.
24177    ///
24178    /// # Return value
24179    ///
24180    /// - [`CUresult::CUDA_SUCCESS`]
24181    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
24182    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
24183    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
24184    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
24185    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
24186    /// - [`CUresult::CUDA_ERROR_ALREADY_MAPPED`]
24187    ///
24188    /// See also: [`cuGraphicsMapResources`], `cudaGraphicsResourceSetMapFlags`.
24189    pub fn cuGraphicsResourceSetMapFlags_v2(
24190        resource: CUgraphicsResource,
24191        flags: ::core::ffi::c_uint,
24192    ) -> CUresult;
24193}
24194singe_loader::functions! { crate::DRIVER;
24195    /// Map graphics resources for access by CUDA.
24196    ///
24197    /// Maps the `count` graphics resources in `resources` for access by CUDA.
24198    ///
24199    /// The resources in `resources` may be accessed by CUDA until they are unmapped. The graphics API from which `resources` were registered should not access any resources while they are mapped by CUDA. If an application does so, the results are undefined.
24200    ///
24201    /// This function provides the synchronization guarantee that any graphics calls issued before [`cuGraphicsMapResources`] will complete before any subsequent CUDA work issued in `stream` begins.
24202    ///
24203    /// If `resources` includes any duplicate entries then [`cudaError_enum::CUDA_ERROR_INVALID_HANDLE`] is returned. If any of `resources` are presently mapped for access by CUDA then [`cudaError_enum::CUDA_ERROR_ALREADY_MAPPED`] is returned.
24204    ///
24205    /// Note: This function uses standard default stream semantics.
24206    ///
24207    /// Note that this function may also return error codes from previous, asynchronous launches.
24208    ///
24209    /// # Parameters
24210    ///
24211    /// - `count`: Number of resources to map.
24212    /// - `resources`: Resources to map for CUDA usage.
24213    /// - `hStream`: Stream with which to synchronize.
24214    ///
24215    /// # Return value
24216    ///
24217    /// - [`CUresult::CUDA_SUCCESS`]
24218    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
24219    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
24220    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
24221    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
24222    /// - [`CUresult::CUDA_ERROR_ALREADY_MAPPED`]
24223    /// - [`CUresult::CUDA_ERROR_UNKNOWN`]
24224    ///
24225    /// See also: [`cuGraphicsResourceGetMappedPointer`], [`cuGraphicsSubResourceGetMappedArray`], [`cuGraphicsUnmapResources`], `cudaGraphicsMapResources`.
24226    pub fn cuGraphicsMapResources(
24227        count: ::core::ffi::c_uint,
24228        resources: *mut CUgraphicsResource,
24229        hStream: CUstream,
24230    ) -> CUresult;
24231}
24232singe_loader::functions! { crate::DRIVER;
24233    /// Unmap graphics resources.
24234    ///
24235    /// Unmaps the `count` graphics resources in `resources`.
24236    ///
24237    /// Once unmapped, the resources in `resources` may not be accessed by CUDA until they are mapped again.
24238    ///
24239    /// This function provides the synchronization guarantee that any CUDA work issued in `stream` before [`cuGraphicsUnmapResources`] will complete before any subsequently issued graphics work begins.
24240    ///
24241    /// If `resources` includes any duplicate entries then [`cudaError_enum::CUDA_ERROR_INVALID_HANDLE`] is returned. If any of `resources` are not presently mapped for access by CUDA then [`cudaError_enum::CUDA_ERROR_NOT_MAPPED`] is returned.
24242    ///
24243    /// Note: This function uses standard default stream semantics.
24244    ///
24245    /// Note that this function may also return error codes from previous, asynchronous launches.
24246    ///
24247    /// # Parameters
24248    ///
24249    /// - `count`: Number of resources to unmap.
24250    /// - `resources`: Resources to unmap.
24251    /// - `hStream`: Stream with which to synchronize.
24252    ///
24253    /// # Return value
24254    ///
24255    /// - [`CUresult::CUDA_SUCCESS`]
24256    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
24257    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
24258    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
24259    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
24260    /// - [`CUresult::CUDA_ERROR_NOT_MAPPED`]
24261    /// - [`CUresult::CUDA_ERROR_UNKNOWN`]
24262    ///
24263    /// See also: [`cuGraphicsMapResources`], `cudaGraphicsUnmapResources`.
24264    pub fn cuGraphicsUnmapResources(
24265        count: ::core::ffi::c_uint,
24266        resources: *mut CUgraphicsResource,
24267        hStream: CUstream,
24268    ) -> CUresult;
24269}
24270singe_loader::functions! { crate::DRIVER;
24271    /// Returns the requested driver API function pointer.
24272    ///
24273    /// Returns in `**pfn` the address of the CUDA driver function for the requested CUDA version and flags.
24274    ///
24275    /// The CUDA version is specified as (1000 \* major + 10 \* minor), so CUDA 11.2 should be specified as 11020. For a requested driver symbol, if the specified CUDA version is greater than or equal to the CUDA version in which the driver symbol was introduced, this API will return the function pointer to the corresponding versioned function. If the specified CUDA version is greater than the driver version, the API will return [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`].
24276    ///
24277    /// The pointer returned by the API should be cast to a function pointer matching the requested driver function’s definition in the API header file. The function pointer typedef can be picked up from the corresponding typedefs header file. For example, cudaTypedefs.h consists of function pointer typedefs for driver APIs defined in [cuda.h](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/cuda_8h.html#cuda-8h).
24278    ///
24279    /// The API will return [`cudaError_enum::CUDA_SUCCESS`] and set the returned `pfn` to NULL if the requested driver function is not supported on the platform, no ABI compatible driver function exists for the specified `cudaVersion` or if the driver symbol is invalid.
24280    ///
24281    /// It will also set the optional `symbolStatus` to one of the values in [`CUdriverProcAddressQueryResult`] with the following meanings:
24282    ///
24283    /// * [`CUdriverProcAddressQueryResult_enum::CU_GET_PROC_ADDRESS_SUCCESS`] - The requested symbol was succesfully found based on input arguments and `pfn` is valid
24284    /// * [`CUdriverProcAddressQueryResult_enum::CU_GET_PROC_ADDRESS_SYMBOL_NOT_FOUND`] - The requested symbol was not found
24285    /// * [`CUdriverProcAddressQueryResult_enum::CU_GET_PROC_ADDRESS_VERSION_NOT_SUFFICIENT`] - The requested symbol was found but is not supported by cudaVersion specified
24286    ///
24287    /// The requested flags can be:
24288    ///
24289    /// * [`CUdriverProcAddress_flags_enum::CU_GET_PROC_ADDRESS_DEFAULT`]: This is the default mode. This is equivalent to [`CUdriverProcAddress_flags_enum::CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM`] if the code is compiled with —default-stream per-thread compilation flag or the macro CUDA_API_PER_THREAD_DEFAULT_STREAM is defined; [`CUdriverProcAddress_flags_enum::CU_GET_PROC_ADDRESS_LEGACY_STREAM`] otherwise.
24290    /// * [`CUdriverProcAddress_flags_enum::CU_GET_PROC_ADDRESS_LEGACY_STREAM`]: This will enable the search for all driver symbols that match the requested driver symbol name except the corresponding per-thread versions.
24291    /// * [`CUdriverProcAddress_flags_enum::CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM`]: This will enable the search for all driver symbols that match the requested driver symbol name including the per-thread versions. If a per-thread version is not found, the API will return the legacy version of the driver function.
24292    ///
24293    /// Note: Version mixing among CUDA-defined types and driver API versions is strongly discouraged and doing so can result in an undefined behavior. More here.
24294    ///
24295    /// # Parameters
24296    ///
24297    /// - `symbol`: The base name of the driver API function to look for. As an example, for the driver API [`cuMemAlloc_v2`], `symbol` would be cuMemAlloc and `cudaVersion` would be the ABI compatible CUDA version for the _v2 variant.
24298    /// - `pfn`: Location to return the function pointer to the requested driver function.
24299    /// - `cudaVersion`: The CUDA version to look for the requested driver symbol.
24300    /// - `flags`: Flags to specify search options.
24301    /// - `symbolStatus`: Optional location to store the status of the search for `symbol` based on `cudaVersion`. See [`CUdriverProcAddressQueryResult`] for possible values.
24302    ///
24303    /// # Return value
24304    ///
24305    /// - [`CUresult::CUDA_SUCCESS`]
24306    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
24307    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
24308    ///
24309    /// See also: `cudaGetDriverEntryPointByVersion`.
24310    pub fn cuGetProcAddress_v2(
24311        symbol: *const ::core::ffi::c_char,
24312        pfn: *mut *mut ::core::ffi::c_void,
24313        cudaVersion: ::core::ffi::c_int,
24314        flags: cuuint64_t,
24315        symbolStatus: *mut CUdriverProcAddressQueryResult,
24316    ) -> CUresult;
24317}
24318impl CUcoredumpSettings_enum {
24319    /// Bool where `true` means that GPU exceptions from this context will create a coredump at the location specified by [`CUcoredumpSettings_enum::CU_COREDUMP_FILE`]. The default value is `false` unless set to `true` globally or locally, or the CU_CTX_USER_COREDUMP_ENABLE flag was set during context creation.
24320    pub const CU_COREDUMP_ENABLE_ON_EXCEPTION: CUcoredumpSettings_enum = CUcoredumpSettings_enum(
24321        1,
24322    );
24323    /// Bool where `true` means that the host CPU will also create a coredump. The default value is `true` unless set to `false` globally or or locally. This value is deprecated as of CUDA 12.5 - raise the [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_ABORT`] flag to disable host device abort() if needed.
24324    pub const CU_COREDUMP_TRIGGER_HOST: CUcoredumpSettings_enum = CUcoredumpSettings_enum(
24325        2,
24326    );
24327    /// Bool where `true` means that any resulting coredumps will not have a dump of GPU memory or non-reloc ELF images. The default value is `false` unless set to `true` globally or locally. This attribute is deprecated as of CUDA 12.5, please use [`CUcoredumpSettings_enum::CU_COREDUMP_GENERATION_FLAGS`] instead.
24328    pub const CU_COREDUMP_LIGHTWEIGHT: CUcoredumpSettings_enum = CUcoredumpSettings_enum(
24329        3,
24330    );
24331    /// Bool where `true` means that a coredump can be created by writing to the system pipe specified by [`CUcoredumpSettings_enum::CU_COREDUMP_PIPE`]. The default value is `false` unless set to `true` globally or locally.
24332    pub const CU_COREDUMP_ENABLE_USER_TRIGGER: CUcoredumpSettings_enum = CUcoredumpSettings_enum(
24333        4,
24334    );
24335    /// String of up to 1023 characters that defines the location where any coredumps generated by this context will be written. The default value is `core`.cuda.HOSTNAME.PID where `HOSTNAME` is the host name of the machine running the CUDA applications and `PID` is the process ID of the CUDA application.
24336    pub const CU_COREDUMP_FILE: CUcoredumpSettings_enum = CUcoredumpSettings_enum(5);
24337    /// String of up to 1023 characters that defines the name of the pipe that will be monitored if user-triggered coredumps are enabled. The default value is `corepipe`.cuda.HOSTNAME.PID where `HOSTNAME` is the host name of the machine running the CUDA application and `PID` is the process ID of the CUDA application.
24338    pub const CU_COREDUMP_PIPE: CUcoredumpSettings_enum = CUcoredumpSettings_enum(6);
24339    /// An integer with values to allow granular control the data contained in a coredump specified as a bitwise OR combination of the following values:
24340    pub const CU_COREDUMP_GENERATION_FLAGS: CUcoredumpSettings_enum = CUcoredumpSettings_enum(
24341        7,
24342    );
24343    /// End marker for native GPU coredump setting identifiers.
24344    pub const CU_COREDUMP_MAX: CUcoredumpSettings_enum = CUcoredumpSettings_enum(8);
24345}
24346/// Flags for choosing a coredump attribute to get/set.
24347#[repr(transparent)]
24348#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
24349pub struct CUcoredumpSettings_enum(pub ::core::ffi::c_uint);
24350pub use self::CUcoredumpSettings_enum as CUcoredumpSettings;
24351impl CUCoredumpGenerationFlags {
24352    /// if set by itself, coredump generation returns to its default settings of including all memory regions that it is able to access
24353    pub const CU_COREDUMP_DEFAULT_FLAGS: CUCoredumpGenerationFlags = CUCoredumpGenerationFlags(
24354        0,
24355    );
24356    /// Coredump will not include the data from CUDA source modules that are not relocated at runtime.
24357    pub const CU_COREDUMP_SKIP_NONRELOCATED_ELF_IMAGES: CUCoredumpGenerationFlags = CUCoredumpGenerationFlags(
24358        1,
24359    );
24360    /// Coredump will not include device-side global data that does not belong to any context.
24361    pub const CU_COREDUMP_SKIP_GLOBAL_MEMORY: CUCoredumpGenerationFlags = CUCoredumpGenerationFlags(
24362        2,
24363    );
24364    /// Coredump will not include grid-scale shared memory for the warp that the dumped kernel belonged to.
24365    pub const CU_COREDUMP_SKIP_SHARED_MEMORY: CUCoredumpGenerationFlags = CUCoredumpGenerationFlags(
24366        4,
24367    );
24368    /// Coredump will not include local memory from the kernel.
24369    pub const CU_COREDUMP_SKIP_LOCAL_MEMORY: CUCoredumpGenerationFlags = CUCoredumpGenerationFlags(
24370        8,
24371    );
24372    /// If set, GPU exceptions will not raise an abort() in the host CPU process. Same functional goal as [`CUcoredumpSettings_enum::CU_COREDUMP_TRIGGER_HOST`] but better reflects the default behavior.
24373    pub const CU_COREDUMP_SKIP_ABORT: CUCoredumpGenerationFlags = CUCoredumpGenerationFlags(
24374        16,
24375    );
24376    /// Coredump will not include constbank memory.
24377    pub const CU_COREDUMP_SKIP_CONSTBANK_MEMORY: CUCoredumpGenerationFlags = CUCoredumpGenerationFlags(
24378        32,
24379    );
24380    /// The generated coredump will be compressed with gzip, and .gz suffix will be appended to the filename, if it's not a part of it already.
24381    pub const CU_COREDUMP_GZIP_COMPRESS: CUCoredumpGenerationFlags = CUCoredumpGenerationFlags(
24382        64,
24383    );
24384    /// The coredump will only include contexts that have encountered an exception or a trap.
24385    pub const CU_COREDUMP_FAULTED_CONTEXTS_ONLY: CUCoredumpGenerationFlags = CUCoredumpGenerationFlags(
24386        128,
24387    );
24388    /// By default, when coredumps are requested, the GPU will ensure memory faults and other errors prevent warps from exiting, if possible. This can potentially affect the performance of the application. Setting this flag will disable this functionality, making it possible for faulted warps to exit, but also avoiding the potential performance hit.
24389    pub const CU_COREDUMP_NO_ERRBAR_AT_EXIT: CUCoredumpGenerationFlags = CUCoredumpGenerationFlags(
24390        1073741824,
24391    );
24392    /// Setting this flag will disable actual generation of the coredump file, but exception details will still be logged.
24393    pub const CU_COREDUMP_LOG_ONLY: CUCoredumpGenerationFlags = CUCoredumpGenerationFlags(
24394        -2147483648,
24395    );
24396    /// Enables all of the above options. Equiavlent to setting the [`CUcoredumpSettings_enum::CU_COREDUMP_LIGHTWEIGHT`] attribute to `true`.
24397    pub const CU_COREDUMP_LIGHTWEIGHT_FLAGS: CUCoredumpGenerationFlags = CUCoredumpGenerationFlags(
24398        47,
24399    );
24400}
24401/// Flags for controlling coredump contents.
24402#[repr(transparent)]
24403#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
24404pub struct CUCoredumpGenerationFlags(pub ::core::ffi::c_int);
24405singe_loader::functions! { crate::DRIVER;
24406    /// Allows caller to fetch a coredump attribute value for the current context.
24407    ///
24408    /// Returns in `*value` the requested value specified by `attrib`. It is up to the caller to ensure that the data type and size of `*value` matches the request.
24409    ///
24410    /// If the caller calls this function with `*value` equal to NULL, the size of the memory region (in bytes) expected for `attrib` will be placed in `size`.
24411    ///
24412    /// The supported attributes are:
24413    ///
24414    /// * [`CUcoredumpSettings::CU_COREDUMP_ENABLE_ON_EXCEPTION`]: Bool where `true` means that GPU exceptions from this context will create a coredump at the location specified by [`CUcoredumpSettings::CU_COREDUMP_FILE`]. The default value is `false` unless set to `true` globally or locally, or the [`CUctx_flags::CU_CTX_USER_COREDUMP_ENABLE`] flag was set during context creation.
24415    /// * [`CUcoredumpSettings::CU_COREDUMP_TRIGGER_HOST`]: Bool where `true` means that the host CPU will also create a coredump. The default value is `true` unless set to `false` globally or or locally. This value is deprecated as of CUDA 12.5 - raise the [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_ABORT`] flag to disable host device abort() if needed.
24416    /// * [`CUcoredumpSettings::CU_COREDUMP_LIGHTWEIGHT`]: Bool where `true` means that any resulting coredumps will not have a dump of GPU memory or non-reloc ELF images. The default value is `false` unless set to `true` globally or locally. This attribute is deprecated as of CUDA 12.5, please use [`CUcoredumpSettings::CU_COREDUMP_GENERATION_FLAGS`] instead.
24417    /// * [`CUcoredumpSettings::CU_COREDUMP_ENABLE_USER_TRIGGER`]: Bool where `true` means that a coredump can be created by writing to the system pipe specified by [`CUcoredumpSettings::CU_COREDUMP_PIPE`]. The default value is `false` unless set to `true` globally or locally.
24418    /// * [`CUcoredumpSettings::CU_COREDUMP_FILE`]: String of up to 1023 characters that defines the location where any coredumps generated by this context will be written. The default value is `core`.cuda.HOSTNAME.PID where `HOSTNAME` is the host name of the machine running the CUDA applications and `PID` is the process ID of the CUDA application.
24419    /// * [`CUcoredumpSettings::CU_COREDUMP_PIPE`]: String of up to 1023 characters that defines the name of the pipe that will be monitored if user-triggered coredumps are enabled. The default value is `corepipe`.cuda.HOSTNAME.PID where `HOSTNAME` is the host name of the machine running the CUDA application and `PID` is the process ID of the CUDA application.
24420    /// * [`CUcoredumpSettings::CU_COREDUMP_GENERATION_FLAGS`]: An integer with values to allow granular control the data contained in a coredump specified as a bitwise OR combination of the following values:
24421    ///
24422    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_DEFAULT_FLAGS`] - if set by itself, coredump generation returns to its default settings of including all memory regions that it is able to access
24423    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_NONRELOCATED_ELF_IMAGES`] - Coredump will not include the data from CUDA source modules that are not relocated at runtime.
24424    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_GLOBAL_MEMORY`] - Coredump will not include device-side global data that does not belong to any context.
24425    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_SHARED_MEMORY`] - Coredump will not include grid-scale shared memory for the warp that the dumped kernel belonged to.
24426    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_LOCAL_MEMORY`] - Coredump will not include local memory from the kernel.
24427    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_LIGHTWEIGHT_FLAGS`] - Enables all of the above options. Equiavlent to setting the [`CUcoredumpSettings::CU_COREDUMP_LIGHTWEIGHT`] attribute to `true`.
24428    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_ABORT`] - If set, GPU exceptions will not raise an abort() in the host CPU process. Same functional goal as [`CUcoredumpSettings::CU_COREDUMP_TRIGGER_HOST`] but better reflects the default behavior.
24429    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_CONSTBANK_MEMORY`] - Coredump will not include constbank memory.
24430    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_GZIP_COMPRESS`] - The generated coredump will be compressed with gzip, and .gz suffix will be appended to the filename, if it’s not a part of it already.
24431    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_FAULTED_CONTEXTS_ONLY`] - The coredump will only include contexts that have encountered an exception or a trap.
24432    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_NO_ERRBAR_AT_EXIT`] - By default, when coredumps are requested, the GPU will ensure memory faults and other errors prevent warps from exiting, if possible. This can potentially affect the performance of the application. Setting this flag will disable this functionality, making it possible for faulted warps to exit, but also avoiding the potential performance hit.
24433    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_LOG_ONLY`] - Setting this flag will disable actual generation of the coredump file, but exception details will still be logged.
24434    ///
24435    /// # Parameters
24436    ///
24437    /// - `attrib`: The enum defining which value to fetch.
24438    /// - `value`: void\* containing the requested data.
24439    /// - `size`: The size of the memory region `value` points to.
24440    ///
24441    /// # Return value
24442    ///
24443    /// - [`CUresult::CUDA_SUCCESS`]
24444    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
24445    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
24446    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
24447    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
24448    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
24449    /// - [`CUresult::CUDA_ERROR_CONTEXT_IS_DESTROYED`]
24450    ///
24451    /// See also: [`cuCoredumpGetAttributeGlobal`], [`cuCoredumpSetAttribute`], [`cuCoredumpSetAttributeGlobal`].
24452    pub fn cuCoredumpGetAttribute(
24453        attrib: CUcoredumpSettings,
24454        value: *mut ::core::ffi::c_void,
24455        size: *mut size_t,
24456    ) -> CUresult;
24457}
24458singe_loader::functions! { crate::DRIVER;
24459    /// Allows caller to fetch a coredump attribute value for the entire application.
24460    ///
24461    /// Returns in `*value` the requested value specified by `attrib`. It is up to the caller to ensure that the data type and size of `*value` matches the request.
24462    ///
24463    /// If the caller calls this function with `*value` equal to NULL, the size of the memory region (in bytes) expected for `attrib` will be placed in `size`.
24464    ///
24465    /// The supported attributes are:
24466    ///
24467    /// * [`CUcoredumpSettings::CU_COREDUMP_ENABLE_ON_EXCEPTION`]: Bool where `true` means that GPU exceptions from this context will create a coredump at the location specified by [`CUcoredumpSettings::CU_COREDUMP_FILE`]. The default value is `false`.
24468    /// * [`CUcoredumpSettings::CU_COREDUMP_TRIGGER_HOST`]: Bool where `true` means that the host CPU will also create a coredump. The default value is `true` unless set to `false` globally or or locally. This value is deprecated as of CUDA 12.5 - raise the [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_ABORT`] flag to disable host device abort() if needed.
24469    /// * [`CUcoredumpSettings::CU_COREDUMP_LIGHTWEIGHT`]: Bool where `true` means that any resulting coredumps will not have a dump of GPU memory or non-reloc ELF images. The default value is `false`. This attribute is deprecated as of CUDA 12.5, please use [`CUcoredumpSettings::CU_COREDUMP_GENERATION_FLAGS`] instead.
24470    /// * [`CUcoredumpSettings::CU_COREDUMP_ENABLE_USER_TRIGGER`]: Bool where `true` means that a coredump can be created by writing to the system pipe specified by [`CUcoredumpSettings::CU_COREDUMP_PIPE`]. The default value is `false`.
24471    /// * [`CUcoredumpSettings::CU_COREDUMP_FILE`]: String of up to 1023 characters that defines the location where any coredumps generated by this context will be written. The default value is `core`.cuda.HOSTNAME.PID where `HOSTNAME` is the host name of the machine running the CUDA applications and `PID` is the process ID of the CUDA application.
24472    /// * [`CUcoredumpSettings::CU_COREDUMP_PIPE`]: String of up to 1023 characters that defines the name of the pipe that will be monitored if user-triggered coredumps are enabled. The default value is `corepipe`.cuda.HOSTNAME.PID where `HOSTNAME` is the host name of the machine running the CUDA application and `PID` is the process ID of the CUDA application.
24473    /// * [`CUcoredumpSettings::CU_COREDUMP_GENERATION_FLAGS`]: An integer with values to allow granular control the data contained in a coredump specified as a bitwise OR combination of the following values:
24474    ///
24475    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_DEFAULT_FLAGS`] - if set by itself, coredump generation returns to its default settings of including all memory regions that it is able to access
24476    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_NONRELOCATED_ELF_IMAGES`] - Coredump will not include the data from CUDA source modules that are not relocated at runtime.
24477    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_GLOBAL_MEMORY`] - Coredump will not include device-side global data that does not belong to any context.
24478    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_SHARED_MEMORY`] - Coredump will not include grid-scale shared memory for the warp that the dumped kernel belonged to.
24479    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_LOCAL_MEMORY`] - Coredump will not include local memory from the kernel.
24480    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_LIGHTWEIGHT_FLAGS`] - Enables all of the above options. Equiavlent to setting the [`CUcoredumpSettings::CU_COREDUMP_LIGHTWEIGHT`] attribute to `true`.
24481    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_ABORT`] - If set, GPU exceptions will not raise an abort() in the host CPU process. Same functional goal as [`CUcoredumpSettings::CU_COREDUMP_TRIGGER_HOST`] but better reflects the default behavior.
24482    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_CONSTBANK_MEMORY`] - Coredump will not include constbank memory.
24483    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_GZIP_COMPRESS`] - The generated coredump will be compressed with gzip, and .gz suffix will be appended to the filename, if it’s not a part of it already.
24484    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_FAULTED_CONTEXTS_ONLY`] - The coredump will only include contexts that have encountered an exception or a trap.
24485    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_NO_ERRBAR_AT_EXIT`] - By default, when coredumps are requested, the GPU will ensure memory faults and other errors prevent warps from exiting, if possible. This can potentially affect the performance of the application. Setting this flag will disable this functionality, making it possible for faulted warps to exit, but also avoiding the potential performance hit.
24486    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_LOG_ONLY`] - Setting this flag will disable actual generation of the coredump file, but exception details will still be logged.
24487    ///
24488    /// # Parameters
24489    ///
24490    /// - `attrib`: The enum defining which value to fetch.
24491    /// - `value`: void\* containing the requested data.
24492    /// - `size`: The size of the memory region `value` points to.
24493    ///
24494    /// # Return value
24495    ///
24496    /// - [`CUresult::CUDA_SUCCESS`]
24497    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
24498    ///
24499    /// See also: [`cuCoredumpGetAttribute`], [`cuCoredumpSetAttribute`], [`cuCoredumpSetAttributeGlobal`].
24500    pub fn cuCoredumpGetAttributeGlobal(
24501        attrib: CUcoredumpSettings,
24502        value: *mut ::core::ffi::c_void,
24503        size: *mut size_t,
24504    ) -> CUresult;
24505}
24506singe_loader::functions! { crate::DRIVER;
24507    /// Allows caller to set a coredump attribute value for the current context.
24508    ///
24509    /// This function should be considered an alternate interface to the CUDA-GDB environment variables defined in this document: <https://docs.nvidia.com/cuda/cuda-gdb/index.html#gpu-coredump>
24510    ///
24511    /// An important design decision to note is that any coredump environment variable values set before CUDA initializes will take permanent precedence over any values set with this function. This decision was made to ensure no change in behavior for any users that may be currently using these variables to get coredumps.
24512    ///
24513    /// `*value` shall contain the requested value specified by `set`. It is up to the caller to ensure that the data type and size of `*value` matches the request.
24514    ///
24515    /// If the caller calls this function with `*value` equal to NULL, the size of the memory region (in bytes) expected for `set` will be placed in `size`.
24516    ///
24517    /// /note This function will return [`cudaError_enum::CUDA_ERROR_NOT_SUPPORTED`] if the caller attempts to set [`CUcoredumpSettings::CU_COREDUMP_ENABLE_ON_EXCEPTION`] on a GPU of with Compute Capability &lt; 6.0. [`cuCoredumpSetAttributeGlobal`] works on those platforms as an alternative.
24518    ///
24519    /// /note [`CUcoredumpSettings::CU_COREDUMP_ENABLE_USER_TRIGGER`] and [`CUcoredumpSettings::CU_COREDUMP_PIPE`] cannot be set on a per-context basis.
24520    ///
24521    /// The supported attributes are:
24522    ///
24523    /// * [`CUcoredumpSettings::CU_COREDUMP_ENABLE_ON_EXCEPTION`]: Bool where `true` means that GPU exceptions from this context will create a coredump at the location specified by [`CUcoredumpSettings::CU_COREDUMP_FILE`]. The default value is `false`.
24524    /// * [`CUcoredumpSettings::CU_COREDUMP_TRIGGER_HOST`]: Bool where `true` means that the host CPU will also create a coredump. The default value is `true` unless set to `false` globally or or locally. This value is deprecated as of CUDA 12.5 - raise the [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_ABORT`] flag to disable host device abort() if needed.
24525    /// * [`CUcoredumpSettings::CU_COREDUMP_LIGHTWEIGHT`]: Bool where `true` means that any resulting coredumps will not have a dump of GPU memory or non-reloc ELF images. The default value is `false`. This attribute is deprecated as of CUDA 12.5, please use [`CUcoredumpSettings::CU_COREDUMP_GENERATION_FLAGS`] instead.
24526    /// * [`CUcoredumpSettings::CU_COREDUMP_FILE`]: String of up to 1023 characters that defines the location where any coredumps generated by this context will be written. The default value is `core`.cuda.HOSTNAME.PID where `HOSTNAME` is the host name of the machine running the CUDA applications and `PID` is the process ID of the CUDA application.
24527    /// * [`CUcoredumpSettings::CU_COREDUMP_GENERATION_FLAGS`]: An integer with values to allow granular control the data contained in a coredump specified as a bitwise OR combination of the following values:
24528    ///
24529    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_DEFAULT_FLAGS`] - if set by itself, coredump generation returns to its default settings of including all memory regions that it is able to access
24530    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_NONRELOCATED_ELF_IMAGES`] - Coredump will not include the data from CUDA source modules that are not relocated at runtime.
24531    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_GLOBAL_MEMORY`] - Coredump will not include device-side global data that does not belong to any context.
24532    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_SHARED_MEMORY`] - Coredump will not include grid-scale shared memory for the warp that the dumped kernel belonged to.
24533    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_LOCAL_MEMORY`] - Coredump will not include local memory from the kernel.
24534    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_LIGHTWEIGHT_FLAGS`] - Enables all of the above options. Equiavlent to setting the [`CUcoredumpSettings::CU_COREDUMP_LIGHTWEIGHT`] attribute to `true`.
24535    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_ABORT`] - If set, GPU exceptions will not raise an abort() in the host CPU process. Same functional goal as [`CUcoredumpSettings::CU_COREDUMP_TRIGGER_HOST`] but better reflects the default behavior.
24536    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_CONSTBANK_MEMORY`] - Coredump will not include constbank memory.
24537    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_GZIP_COMPRESS`] - The generated coredump will be compressed with gzip, and .gz suffix will be appended to the filename, if it’s not a part of it already.
24538    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_FAULTED_CONTEXTS_ONLY`] - The coredump will only include contexts that have encountered an exception or a trap.
24539    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_NO_ERRBAR_AT_EXIT`] - By default, when coredumps are requested, the GPU will ensure memory faults and other errors prevent warps from exiting, if possible. This can potentially affect the performance of the application. Setting this flag will disable this functionality, making it possible for faulted warps to exit, but also avoiding the potential performance hit.
24540    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_LOG_ONLY`] - Setting this flag will disable actual generation of the coredump file, but exception details will still be logged.
24541    ///
24542    /// Note: [`CUcoredumpSettings::CU_COREDUMP_GENERATION_FLAGS`] replaces all previously set coredump flags. Mixing [`CUcoredumpSettings::CU_COREDUMP_GENERATION_FLAGS`] with the deprecated boolean attributes ([`CUcoredumpSettings::CU_COREDUMP_TRIGGER_HOST`], [`CUcoredumpSettings::CU_COREDUMP_LIGHTWEIGHT`]) can result in undefined behavior. To avoid issues, either use only [`CUcoredumpSettings::CU_COREDUMP_GENERATION_FLAGS`] or combine all desired flag bits (including [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_ABORT`]) in a single call.
24543    ///
24544    /// # Parameters
24545    ///
24546    /// - `attrib`: The enum defining which value to set.
24547    /// - `value`: void\* containing the requested data.
24548    /// - `size`: The size of the memory region `value` points to.
24549    ///
24550    /// # Return value
24551    ///
24552    /// - [`CUresult::CUDA_SUCCESS`]
24553    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
24554    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
24555    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
24556    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
24557    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
24558    /// - [`CUresult::CUDA_ERROR_CONTEXT_IS_DESTROYED`]
24559    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
24560    ///
24561    /// See also: [`cuCoredumpGetAttributeGlobal`], [`cuCoredumpGetAttribute`], [`cuCoredumpSetAttributeGlobal`].
24562    pub fn cuCoredumpSetAttribute(
24563        attrib: CUcoredumpSettings,
24564        value: *mut ::core::ffi::c_void,
24565        size: *mut size_t,
24566    ) -> CUresult;
24567}
24568singe_loader::functions! { crate::DRIVER;
24569    /// Allows caller to set a coredump attribute value globally.
24570    ///
24571    /// This function should be considered an alternate interface to the CUDA-GDB environment variables defined in this document: <https://docs.nvidia.com/cuda/cuda-gdb/index.html#gpu-coredump>
24572    ///
24573    /// An important design decision to note is that any coredump environment variable values set before CUDA initializes will take permanent precedence over any values set with this function. This decision was made to ensure no change in behavior for any users that may be currently using these variables to get coredumps.
24574    ///
24575    /// `*value` shall contain the requested value specified by `set`. It is up to the caller to ensure that the data type and size of `*value` matches the request.
24576    ///
24577    /// If the caller calls this function with `*value` equal to NULL, the size of the memory region (in bytes) expected for `set` will be placed in `size`.
24578    ///
24579    /// The supported attributes are:
24580    ///
24581    /// * [`CUcoredumpSettings::CU_COREDUMP_ENABLE_ON_EXCEPTION`]: Bool where `true` means that GPU exceptions from this context will create a coredump at the location specified by [`CUcoredumpSettings::CU_COREDUMP_FILE`]. The default value is `false`.
24582    /// * [`CUcoredumpSettings::CU_COREDUMP_TRIGGER_HOST`]: Bool where `true` means that the host CPU will also create a coredump. The default value is `true` unless set to `false` globally or or locally. This value is deprecated as of CUDA 12.5 - raise the [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_ABORT`] flag to disable host device abort() if needed.
24583    /// * [`CUcoredumpSettings::CU_COREDUMP_LIGHTWEIGHT`]: Bool where `true` means that any resulting coredumps will not have a dump of GPU memory or non-reloc ELF images. The default value is `false`. This attribute is deprecated as of CUDA 12.5, please use [`CUcoredumpSettings::CU_COREDUMP_GENERATION_FLAGS`] instead.
24584    /// * [`CUcoredumpSettings::CU_COREDUMP_ENABLE_USER_TRIGGER`]: Bool where `true` means that a coredump can be created by writing to the system pipe specified by [`CUcoredumpSettings::CU_COREDUMP_PIPE`]. The default value is `false`.
24585    /// * [`CUcoredumpSettings::CU_COREDUMP_FILE`]: String of up to 1023 characters that defines the location where any coredumps generated by this context will be written. The default value is `core`.cuda.HOSTNAME.PID where `HOSTNAME` is the host name of the machine running the CUDA applications and `PID` is the process ID of the CUDA application.
24586    /// * [`CUcoredumpSettings::CU_COREDUMP_PIPE`]: String of up to 1023 characters that defines the name of the pipe that will be monitored if user-triggered coredumps are enabled. This value may not be changed after [`CUcoredumpSettings::CU_COREDUMP_ENABLE_USER_TRIGGER`] is set to `true`. The default value is `corepipe`.cuda.HOSTNAME.PID where `HOSTNAME` is the host name of the machine running the CUDA application and `PID` is the process ID of the CUDA application.
24587    /// * [`CUcoredumpSettings::CU_COREDUMP_GENERATION_FLAGS`]: An integer with values to allow granular control the data contained in a coredump specified as a bitwise OR combination of the following values:
24588    ///
24589    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_DEFAULT_FLAGS`] - if set by itself, coredump generation returns to its default settings of including all memory regions that it is able to access
24590    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_NONRELOCATED_ELF_IMAGES`] - Coredump will not include the data from CUDA source modules that are not relocated at runtime.
24591    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_GLOBAL_MEMORY`] - Coredump will not include device-side global data that does not belong to any context.
24592    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_SHARED_MEMORY`] - Coredump will not include grid-scale shared memory for the warp that the dumped kernel belonged to.
24593    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_LOCAL_MEMORY`] - Coredump will not include local memory from the kernel.
24594    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_LIGHTWEIGHT_FLAGS`] - Enables all of the above options. Equiavlent to setting the [`CUcoredumpSettings::CU_COREDUMP_LIGHTWEIGHT`] attribute to `true`.
24595    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_ABORT`] - If set, GPU exceptions will not raise an abort() in the host CPU process. Same functional goal as [`CUcoredumpSettings::CU_COREDUMP_TRIGGER_HOST`] but better reflects the default behavior.
24596    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_CONSTBANK_MEMORY`] - Coredump will not include constbank memory.
24597    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_GZIP_COMPRESS`] - The generated coredump will be compressed with gzip, and .gz suffix will be appended to the filename, if it’s not a part of it already.
24598    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_FAULTED_CONTEXTS_ONLY`] - The coredump will only include contexts that have encountered an exception or a trap.
24599    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_NO_ERRBAR_AT_EXIT`] - By default, when coredumps are requested, the GPU will ensure memory faults and other errors prevent warps from exiting, if possible. This can potentially affect the performance of the application. Setting this flag will disable this functionality, making it possible for faulted warps to exit, but also avoiding the potential performance hit.
24600    ///   + [`CUCoredumpGenerationFlags::CU_COREDUMP_LOG_ONLY`] - Setting this flag will disable actual generation of the coredump file, but exception details will still be logged.
24601    ///
24602    /// Note: [`CUcoredumpSettings::CU_COREDUMP_GENERATION_FLAGS`] replaces all previously set coredump flags. Mixing [`CUcoredumpSettings::CU_COREDUMP_GENERATION_FLAGS`] with the deprecated boolean attributes ([`CUcoredumpSettings::CU_COREDUMP_TRIGGER_HOST`], [`CUcoredumpSettings::CU_COREDUMP_LIGHTWEIGHT`]) can result in undefined behavior. To avoid issues, either use only [`CUcoredumpSettings::CU_COREDUMP_GENERATION_FLAGS`] or combine all desired flag bits (including [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_ABORT`]) in a single call.
24603    ///
24604    /// # Parameters
24605    ///
24606    /// - `attrib`: The enum defining which value to set.
24607    /// - `value`: void\* containing the requested data.
24608    /// - `size`: The size of the memory region `value` points to.
24609    ///
24610    /// # Return value
24611    ///
24612    /// - [`CUresult::CUDA_SUCCESS`]
24613    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
24614    /// - [`CUresult::CUDA_ERROR_NOT_PERMITTED`]
24615    ///
24616    /// See also: [`cuCoredumpGetAttribute`], [`cuCoredumpGetAttributeGlobal`], [`cuCoredumpSetAttribute`].
24617    pub fn cuCoredumpSetAttributeGlobal(
24618        attrib: CUcoredumpSettings,
24619        value: *mut ::core::ffi::c_void,
24620        size: *mut size_t,
24621    ) -> CUresult;
24622}
24623/// Incomplete native type used by [`CUcoredumpCallbackHandle`] handles. The native API owns its layout.
24624#[repr(C)]
24625#[derive(Debug, Copy, Clone)]
24626pub struct CUcoredumpCallbackEntry_st {
24627    _unused: [u8; 0],
24628}
24629/// Opaque handle representing a registered coredump status callback.
24630///
24631/// This handle is returned when registering a callback and must be provided when deregistering the callback.
24632pub type CUcoredumpCallbackHandle = *mut CUcoredumpCallbackEntry_st;
24633/// Callback function prototype for GPU coredump status notifications.
24634///
24635/// This callback will be invoked when a GPU coredump begins or completes, depending on which registration function was used. The callback executes synchronously during the coredump process.
24636pub type CUcoredumpStatusCallback = ::core::option::Option<
24637    unsafe extern "C" fn(
24638        userData: *mut ::core::ffi::c_void,
24639        pid: ::core::ffi::c_int,
24640        dev: CUdevice,
24641    ),
24642>;
24643singe_loader::functions! { crate::DRIVER;
24644    /// Register a callback to be invoked when a GPU coredump begins.
24645    ///
24646    /// This function registers a callback that will be called when a GPU coredump is initiated, before any coredump data is collected. Callbacks are executed in the order they were registered. The same callback function can be registered multiple times with different userData, and each registration will receive a unique handle.
24647    ///
24648    /// Note: Callbacks execute synchronously during the coredump process and will block coredump progress while running.
24649    ///
24650    /// # Parameters
24651    ///
24652    /// - `callback`: The callback function to register.
24653    /// - `userData`: User data pointer to pass to the callback.
24654    /// - `callbackOut`: Location to store the callback handle (optional, may be NULL).
24655    ///
24656    /// # Return value
24657    ///
24658    /// - [`CUresult::CUDA_SUCCESS`]
24659    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
24660    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
24661    ///
24662    /// See also: [`cuCoredumpDeregisterStartCallback`], [`cuCoredumpRegisterCompleteCallback`].
24663    pub fn cuCoredumpRegisterStartCallback(
24664        callback: CUcoredumpStatusCallback,
24665        userData: *mut ::core::ffi::c_void,
24666        callbackOut: *mut CUcoredumpCallbackHandle,
24667    ) -> CUresult;
24668}
24669singe_loader::functions! { crate::DRIVER;
24670    /// Register a callback to be invoked when a GPU coredump completes.
24671    ///
24672    /// This function registers a callback that will be called when a GPU coredump has been fully collected and written to disk. Callbacks are executed in the order they were registered. The same callback function can be registered multiple times with different userData, and each registration will receive a unique handle.
24673    ///
24674    /// Note: Callbacks execute synchronously during the coredump process and will block coredump progress while running.
24675    ///
24676    /// # Parameters
24677    ///
24678    /// - `callback`: The callback function to register.
24679    /// - `userData`: User data pointer to pass to the callback.
24680    /// - `callbackOut`: Location to store the callback handle (optional, may be NULL).
24681    ///
24682    /// # Return value
24683    ///
24684    /// - [`CUresult::CUDA_SUCCESS`]
24685    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
24686    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
24687    ///
24688    /// See also: [`cuCoredumpDeregisterCompleteCallback`], [`cuCoredumpRegisterStartCallback`].
24689    pub fn cuCoredumpRegisterCompleteCallback(
24690        callback: CUcoredumpStatusCallback,
24691        userData: *mut ::core::ffi::c_void,
24692        callbackOut: *mut CUcoredumpCallbackHandle,
24693    ) -> CUresult;
24694}
24695singe_loader::functions! { crate::DRIVER;
24696    /// Deregister a previously registered coredump start callback.
24697    ///
24698    /// This function removes a callback that was registered with [`cuCoredumpRegisterStartCallback`]. The callback handle becomes invalid after this call.
24699    ///
24700    /// Note: It is the caller’s responsibility to deregister callbacks before they go out of scope.
24701    ///
24702    /// # Parameters
24703    ///
24704    /// - `callback`: The callback handle to deregister
24705    ///
24706    /// # Return value
24707    ///
24708    /// - [`CUresult::CUDA_SUCCESS`]
24709    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
24710    ///
24711    /// See also: [`cuCoredumpRegisterStartCallback`].
24712    pub fn cuCoredumpDeregisterStartCallback(
24713        callback: CUcoredumpCallbackHandle,
24714    ) -> CUresult;
24715}
24716singe_loader::functions! { crate::DRIVER;
24717    /// Deregister a previously registered coredump complete callback.
24718    ///
24719    /// This function removes a callback that was registered with [`cuCoredumpRegisterCompleteCallback`]. The callback handle becomes invalid after this call.
24720    ///
24721    /// Note: It is the caller’s responsibility to deregister callbacks before they go out of scope.
24722    ///
24723    /// # Parameters
24724    ///
24725    /// - `callback`: The callback handle to deregister
24726    ///
24727    /// # Return value
24728    ///
24729    /// - [`CUresult::CUDA_SUCCESS`]
24730    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
24731    ///
24732    /// See also: [`cuCoredumpRegisterCompleteCallback`].
24733    pub fn cuCoredumpDeregisterCompleteCallback(
24734        callback: CUcoredumpCallbackHandle,
24735    ) -> CUresult;
24736}
24737singe_loader::functions! { crate::DRIVER;
24738    /// Retrieves a driver export table identified by `pExportTableId` and writes its address to `ppExportTable`. The table layout is defined by the interface associated with that identifier. Returns a CUDA driver status code.
24739    pub fn cuGetExportTable(
24740        ppExportTable: *mut *const ::core::ffi::c_void,
24741        pExportTableId: *const CUuuid,
24742    ) -> CUresult;
24743}
24744/// Incomplete native type used by [`CUdevResourceDesc`] handles. The native API owns its layout.
24745#[repr(C)]
24746#[derive(Debug, Copy, Clone)]
24747pub struct CUdevResourceDesc_st {
24748    _unused: [u8; 0],
24749}
24750/// An opaque descriptor handle. The descriptor encapsulates multiple created and configured resources. Created via [`cuDevResourceGenerateDesc`].
24751pub type CUdevResourceDesc = *mut CUdevResourceDesc_st;
24752impl CUgreenCtxCreate_flags {
24753    /// Default behavior.
24754    pub const CU_GREEN_CTX_NONE: CUgreenCtxCreate_flags = CUgreenCtxCreate_flags(0);
24755    /// Creates a default stream to use inside the green context.
24756    pub const CU_GREEN_CTX_DEFAULT_STREAM: CUgreenCtxCreate_flags = CUgreenCtxCreate_flags(
24757        1,
24758    );
24759}
24760/// Flags for green context creation.
24761#[repr(transparent)]
24762#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
24763pub struct CUgreenCtxCreate_flags(pub ::core::ffi::c_uint);
24764impl CUdevSmResourceGroup_flags {
24765    /// Uses the default SM-resource grouping policy.
24766    pub const CU_DEV_SM_RESOURCE_GROUP_DEFAULT: CUdevSmResourceGroup_flags = CUdevSmResourceGroup_flags(
24767        0,
24768    );
24769    /// Treats constraints as a hint, ignoring them if necessary to reach the requested `smCount`. Lets `smCount` be a non-multiple of `coscheduledSmCount`, filling the difference between SM count and already assigned co-scheduled groupings with other SMs. This lets any resulting group behave similar to the `remainder` group for example. When used with [`CUdevSmResourceGroup_flags::CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID`], backfill fills up to the requested `smCount` using the target locality domain first, then SMs not attributed to any locality domain, then SMs from other locality domains. If no SMs can be found in the requested locality domain, CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION is returned.
24770    pub const CU_DEV_SM_RESOURCE_GROUP_BACKFILL: CUdevSmResourceGroup_flags = CUdevSmResourceGroup_flags(
24771        1,
24772    );
24773    /// The SMs must be located on a specific locality domain, specified by localityDomainId.
24774    pub const CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID: CUdevSmResourceGroup_flags = CUdevSmResourceGroup_flags(
24775        2,
24776    );
24777}
24778/// Flags for a [`CUdevSmResource`] group.
24779#[repr(transparent)]
24780#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
24781pub struct CUdevSmResourceGroup_flags(pub ::core::ffi::c_uint);
24782impl CUdevSmResourceSplitByCount_flags {
24783    /// Lower the minimum SM count and alignment, and treat each SM independent of its hierarchy. This allows more fine grained partitions but at the cost of advanced features (such as large clusters on compute capability 9.0+).
24784    pub const CU_DEV_SM_RESOURCE_SPLIT_IGNORE_SM_COSCHEDULING: CUdevSmResourceSplitByCount_flags = CUdevSmResourceSplitByCount_flags(
24785        1,
24786    );
24787    /// Compute Capability 9.0+ only. Attempt to create groups that may allow for maximally sized thread clusters. This can be queried post green context creation using [`cuOccupancyMaxPotentialClusterSize`].
24788    pub const CU_DEV_SM_RESOURCE_SPLIT_MAX_POTENTIAL_CLUSTER_SIZE: CUdevSmResourceSplitByCount_flags = CUdevSmResourceSplitByCount_flags(
24789        2,
24790    );
24791}
24792/// Flags controlling SM-resource partition granularity and supported thread-block cluster sizes.
24793#[repr(transparent)]
24794#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
24795pub struct CUdevSmResourceSplitByCount_flags(pub ::core::ffi::c_uint);
24796impl CUdevResourceType {
24797    /// No valid device resource kind is selected.
24798    pub const CU_DEV_RESOURCE_TYPE_INVALID: CUdevResourceType = CUdevResourceType(0);
24799    /// Streaming multiprocessors related information.
24800    pub const CU_DEV_RESOURCE_TYPE_SM: CUdevResourceType = CUdevResourceType(1);
24801    /// Workqueue configuration related information.
24802    pub const CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG: CUdevResourceType = CUdevResourceType(
24803        1000,
24804    );
24805    /// Pre-existing workqueue related information.
24806    pub const CU_DEV_RESOURCE_TYPE_WORKQUEUE: CUdevResourceType = CUdevResourceType(
24807        10000,
24808    );
24809}
24810/// Type of resource.
24811#[repr(transparent)]
24812#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
24813pub struct CUdevResourceType(pub ::core::ffi::c_uint);
24814/// Data for SM-related resources All parameters in this structure are OUTPUT only. Do not write to any of the fields in this structure.
24815#[repr(C)]
24816#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
24817pub struct CUdevSmResource_st {
24818    /// The amount of streaming multiprocessors available in this resource.
24819    pub smCount: ::core::ffi::c_uint,
24820    /// The minimum number of streaming multiprocessors required to partition this resource.
24821    pub minSmPartitionSize: ::core::ffi::c_uint,
24822    /// The number of streaming multiprocessors in this resource that are guaranteed to be co-scheduled on the same GPU processing cluster.
24823    ///
24824    /// smCount will be a multiple of this value, unless the backfill flag is set.
24825    pub smCoscheduledAlignment: ::core::ffi::c_uint,
24826    /// The flags set on this SM resource.
24827    ///
24828    /// For possible values see [`CUdevSmResourceGroup_flags`].
24829    pub flags: ::core::ffi::c_uint,
24830    /// Locality domain that the SM must be located on.
24831    ///
24832    /// Only valid if [`CUdevSmResourceGroup_flags::CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID`] is set in flags. If the backfill flag is set, SMs may be assigned from other locality domains.
24833    pub localityDomainId: ::core::ffi::c_uint,
24834}
24835/// Data for SM-related resources All parameters in this structure are OUTPUT only. Do not write to any of the fields in this structure.
24836pub type CUdevSmResource = CUdevSmResource_st;
24837impl CUdevWorkqueueConfigScope {
24838    /// Use all shared workqueue resources across all contexts.
24839    ///
24840    /// Default driver behavior.
24841    pub const CU_WORKQUEUE_SCOPE_DEVICE_CTX: CUdevWorkqueueConfigScope = CUdevWorkqueueConfigScope(
24842        0,
24843    );
24844    /// When possible, use non-overlapping workqueue resources with other balanced green contexts.
24845    pub const CU_WORKQUEUE_SCOPE_GREEN_CTX_BALANCED: CUdevWorkqueueConfigScope = CUdevWorkqueueConfigScope(
24846        1,
24847    );
24848}
24849/// Sharing scope for workqueues.
24850#[repr(transparent)]
24851#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
24852pub struct CUdevWorkqueueConfigScope(pub ::core::ffi::c_uint);
24853/// Data for workqueue configuration related resources.
24854#[repr(C)]
24855#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
24856pub struct CUdevWorkqueueConfigResource_st {
24857    /// The device on which the workqueue resources are available.
24858    pub device: CUdevice,
24859    /// The expected maximum number of concurrent stream-ordered workloads.
24860    pub wqConcurrencyLimit: ::core::ffi::c_uint,
24861    /// The sharing scope for the workqueue resources.
24862    pub sharingScope: CUdevWorkqueueConfigScope,
24863}
24864impl Default for CUdevWorkqueueConfigResource_st {
24865    fn default() -> Self {
24866        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
24867        unsafe {
24868            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
24869            s.assume_init()
24870        }
24871    }
24872}
24873/// Data for workqueue configuration related resources.
24874pub type CUdevWorkqueueConfigResource = CUdevWorkqueueConfigResource_st;
24875/// Handle to a pre-existing workqueue related resource.
24876#[repr(C)]
24877#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
24878pub struct CUdevWorkqueueResource_st {
24879    /// Reserved for future use.
24880    pub reserved: [::core::ffi::c_uchar; 40usize],
24881}
24882impl Default for CUdevWorkqueueResource_st {
24883    fn default() -> Self {
24884        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
24885        unsafe {
24886            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
24887            s.assume_init()
24888        }
24889    }
24890}
24891/// Handle to a pre-existing workqueue related resource.
24892pub type CUdevWorkqueueResource = CUdevWorkqueueResource_st;
24893/// Input data for splitting SMs.
24894#[repr(C)]
24895#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
24896pub struct CU_DEV_SM_RESOURCE_GROUP_PARAMS_st {
24897    /// The amount of SMs available in this resource.
24898    pub smCount: ::core::ffi::c_uint,
24899    /// The amount of co-scheduled SMs grouped together for locality purposes.
24900    pub coscheduledSmCount: ::core::ffi::c_uint,
24901    /// When possible, combine co-scheduled groups together into larger groups of this size.
24902    pub preferredCoscheduledSmCount: ::core::ffi::c_uint,
24903    /// The flags set on this SM resource group.
24904    ///
24905    /// For possible values see [`CUdevSmResourceGroup_flags`].
24906    pub flags: ::core::ffi::c_uint,
24907    /// Locality domain that the SM must be located on.
24908    ///
24909    /// Only valid if [`CUdevSmResourceGroup_flags::CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID`] is set in flags.
24910    pub localityDomainId: ::core::ffi::c_uint,
24911    /// Reserved storage in the native ABI.
24912    pub reserved: [::core::ffi::c_uint; 11usize],
24913}
24914/// Input data for splitting SMs.
24915pub type CU_DEV_SM_RESOURCE_GROUP_PARAMS = CU_DEV_SM_RESOURCE_GROUP_PARAMS_st;
24916/// A tagged union describing different resources identified by the type field. This structure should not be directly modified outside of the API that created it.
24917///
24918/// ```text
24919///  struct {
24920///      CUdevResourceType type;
24921///      union {
24922///          CUdevSmResource sm;
24923///            CUdevWorkqueueConfigResource wqConfig;
24924///            CUdevWorkqueueResource wq;
24925///      };
24926///  };
24927/// ```
24928///
24929/// - If `type` is [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_INVALID`], this resoure is not valid and cannot be further accessed.
24930/// - If `type` is [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_SM`], the [`CUdevSmResource`] structure `sm` is filled in. For example, `sm.smCount` will reflect the amount of streaming multiprocessors available in this resource.
24931/// - If `type` is [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG`], the [`CUdevWorkqueueConfigResource`] structure `wqConfig` is filled in.
24932/// - If `type` is [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_WORKQUEUE`], the [`CUdevWorkqueueResource`] structure `wq` is filled in.
24933#[repr(C)]
24934#[derive(Copy, Clone)]
24935pub struct CUdevResource_st {
24936    /// Type of resource, dictates which union field was last set.
24937    pub type_: CUdevResourceType,
24938    /// Internal padding in the native ABI layout.
24939    pub _internal_padding: [::core::ffi::c_uchar; 92usize],
24940    /// Anonymous native member. See [`CUdevResource_st__bindgen_ty_1`] for its fields.
24941    pub __bindgen_anon_1: CUdevResource_st__bindgen_ty_1,
24942    /// Link to another resource in a native device-resource chain.
24943    pub nextResource: *mut CUdevResource_st,
24944}
24945/// Anonymous native union in [`CUdevResource_st`]. Its members share the same storage.
24946#[repr(C)]
24947#[derive(Copy, Clone)]
24948pub union CUdevResource_st__bindgen_ty_1 {
24949    /// Resource corresponding to CU_DEV_RESOURCE_TYPE_SM `type`.
24950    pub sm: CUdevSmResource,
24951    /// Resource corresponding to CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG `type`.
24952    pub wqConfig: CUdevWorkqueueConfigResource,
24953    /// Resource corresponding to CU_DEV_RESOURCE_TYPE_WORKQUEUE `type`.
24954    pub wq: CUdevWorkqueueResource,
24955    /// Storage that fixes the native union's ABI size.
24956    pub _oversize: [::core::ffi::c_uchar; 40usize],
24957}
24958impl Default for CUdevResource_st__bindgen_ty_1 {
24959    fn default() -> Self {
24960        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
24961        unsafe {
24962            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
24963            s.assume_init()
24964        }
24965    }
24966}
24967impl Default for CUdevResource_st {
24968    fn default() -> Self {
24969        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
24970        unsafe {
24971            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
24972            s.assume_init()
24973        }
24974    }
24975}
24976/// A tagged union describing different resources identified by the type field. This structure should not be directly modified outside of the API that created it.
24977///
24978/// ```text
24979/// struct {
24980/// CUdevResourceType type;
24981/// union {
24982/// CUdevSmResource sm;
24983/// CUdevWorkqueueConfigResource wqConfig;
24984/// CUdevWorkqueueResource wq;
24985/// };
24986/// };
24987/// ```
24988///
24989/// * If `type` is [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_INVALID`], this resource is not valid and cannot be further accessed.
24990/// * If `type` is [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_SM`], the [`CUdevSmResource`] structure `sm` is filled in. For example, `sm.smCount` will reflect the amount of streaming multiprocessors available in this resource.
24991/// * If `type` is [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG`], the [`CUdevWorkqueueConfigResource`] structure `wqConfig` is filled in.
24992/// * If `type` is [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_WORKQUEUE`], the [`CUdevWorkqueueResource`] structure `wq` is filled in.
24993pub type CUdevResource_v1 = CUdevResource_st;
24994/// A tagged union describing different resources identified by the type field. This structure should not be directly modified outside of the API that created it.
24995///
24996/// ```text
24997/// struct {
24998/// CUdevResourceType type;
24999/// union {
25000/// CUdevSmResource sm;
25001/// CUdevWorkqueueConfigResource wqConfig;
25002/// CUdevWorkqueueResource wq;
25003/// };
25004/// };
25005/// ```
25006///
25007/// * If `type` is [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_INVALID`], this resource is not valid and cannot be further accessed.
25008/// * If `type` is [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_SM`], the [`CUdevSmResource`] structure `sm` is filled in. For example, `sm.smCount` will reflect the amount of streaming multiprocessors available in this resource.
25009/// * If `type` is [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG`], the [`CUdevWorkqueueConfigResource`] structure `wqConfig` is filled in.
25010/// * If `type` is [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_WORKQUEUE`], the [`CUdevWorkqueueResource`] structure `wq` is filled in.
25011pub type CUdevResource = CUdevResource_v1;
25012singe_loader::functions! { crate::DRIVER;
25013    /// Creates a green context with a specified set of resources.
25014    ///
25015    /// This API creates a green context with the resources specified in the descriptor `desc` and returns it in the handle represented by `phCtx`. This API will retain the primary context on device `dev`, which will is released when the green context is destroyed. It is advised to have the primary context active before calling this API to avoid the heavy cost of triggering primary context initialization and deinitialization multiple times.
25016    ///
25017    /// The API does not set the green context current. In order to set it current, you need to explicitly set it current by first converting the green context to a CUcontext using [`cuCtxFromGreenCtx`] and subsequently calling [`cuCtxSetCurrent`] / cuCtxPushCurrent. It should be noted that a green context can be current to only one thread at a time. There is no internal synchronization to make API calls accessing the same green context from multiple threads work.
25018    ///
25019    /// Note: The API is not supported on 32-bit platforms.
25020    ///
25021    /// The supported flags are:
25022    ///
25023    /// * [`CUgreenCtxCreate_flags::CU_GREEN_CTX_NONE`]: Default behavior.
25024    /// * [`CUgreenCtxCreate_flags::CU_GREEN_CTX_DEFAULT_STREAM`]: Creates a default stream to use inside the green context.
25025    ///
25026    /// # Parameters
25027    ///
25028    /// - `phCtx`: Pointer for the output handle to the green context.
25029    /// - `desc`: Descriptor generated via [`cuDevResourceGenerateDesc`] which contains the set of resources to be used.
25030    /// - `dev`: Device on which to create the green context.
25031    /// - `flags`: One of the supported green context creation flags.
25032    ///
25033    /// # Return value
25034    ///
25035    /// - [`CUresult::CUDA_SUCCESS`]
25036    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
25037    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
25038    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
25039    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
25040    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
25041    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
25042    ///
25043    /// See also: [`cuGreenCtxDestroy`], [`cuCtxFromGreenCtx`], [`cuCtxSetCurrent`], [`cuCtxPushCurrent`], [`cuDevResourceGenerateDesc`], [`cuDevicePrimaryCtxRetain`], [`cuCtxCreate`].
25044    pub fn cuGreenCtxCreate(
25045        phCtx: *mut CUgreenCtx,
25046        desc: CUdevResourceDesc,
25047        dev: CUdevice,
25048        flags: ::core::ffi::c_uint,
25049    ) -> CUresult;
25050}
25051singe_loader::functions! { crate::DRIVER;
25052    /// Destroys a green context.
25053    ///
25054    /// Destroys the green context, releasing the primary context of the device that this green context was created for. Any resources provisioned for this green context (that were initially available via the resource descriptor) are released as well. The API does not destroy streams created via [`cuGreenCtxStreamCreate`], [`cuStreamCreate`], or [`cuStreamCreateWithPriority`]. Users are expected to destroy these streams explicitly using cuStreamDestroy to avoid resource leaks. Once the green context is destroyed, any subsequent API calls involving these streams will return [`cudaError_enum::CUDA_ERROR_STREAM_DETACHED`] with the exception of the following APIs:
25055    ///
25056    /// * cuStreamDestroy.
25057    ///
25058    /// Additionally, the API will invalidate all active captures on these streams.
25059    ///
25060    /// # Parameters
25061    ///
25062    /// - `hCtx`: Green context to be destroyed
25063    ///
25064    /// # Return value
25065    ///
25066    /// - [`CUresult::CUDA_SUCCESS`]
25067    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
25068    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
25069    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
25070    /// - [`CUresult::CUDA_ERROR_CONTEXT_IS_DESTROYED`]
25071    ///
25072    /// See also: [`cuGreenCtxCreate`], [`cuCtxDestroy`].
25073    pub fn cuGreenCtxDestroy(hCtx: CUgreenCtx) -> CUresult;
25074}
25075singe_loader::functions! { crate::DRIVER;
25076    /// Returns a [`CUcontext`] handle for a green context.
25077    ///
25078    /// This API returns in `pContext` a [`CUcontext`] handle that represents the specified green context `hCtx`. The returned handle can be passed to CUDA APIs that accept a [`CUcontext`] and will be treated as if it were a primary context, while still honoring the resources and configuration associated with `hCtx` as applicable.
25079    ///
25080    /// Applications that wish to use a green context with CUDA APIs that require a [`CUcontext`] must use this API to obtain a handle to a [`CUcontext`] representing the green context. Otherwise, passing a green context to such APIs will fail with [`cudaError_enum::CUDA_ERROR_INVALID_CONTEXT`].
25081    ///
25082    /// The [`CUcontext`] returned by [`cuCtxFromGreenCtx`] may be passed to CUDA Driver APIs that accept a [`CUcontext`].
25083    ///
25084    /// * For APIs whose semantics are independent of green context resources, the operation is performed identically to how it would perform with a primary context.
25085    /// * For APIs whose behavior depends on green context resources (for example, kernel launch), the operation is performed using the resources and configuration of the specified green context `hCtx`.
25086    ///
25087    /// This call does not create a new independent context and does not change the underlying context lifetime. The validity of the returned `pContext` is tied to `hCtx`, and no additional destruction or release is required beyond correctly managing `hCtx` with the green context APIs. Destroying `pContext` via cuCtxDestroy is undefined behavior.
25088    ///
25089    /// # Parameters
25090    ///
25091    /// - `pContext`: Returned [`CUcontext`] with green context resources.
25092    /// - `hCtx`: Green context to convert.
25093    ///
25094    /// # Return value
25095    ///
25096    /// - [`CUresult::CUDA_SUCCESS`]
25097    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
25098    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
25099    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
25100    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
25101    ///
25102    /// See also: [`cuGreenCtxCreate`].
25103    pub fn cuCtxFromGreenCtx(pContext: *mut CUcontext, hCtx: CUgreenCtx) -> CUresult;
25104}
25105singe_loader::functions! { crate::DRIVER;
25106    /// Get device resources.
25107    ///
25108    /// Get the `type` resources available to the `device`. This may often be the starting point for further partitioning or configuring of resources.
25109    ///
25110    /// Note: The API is not supported on 32-bit platforms.
25111    ///
25112    /// # Parameters
25113    ///
25114    /// - `device`: Device to get resource for.
25115    /// - `resource`: Output pointer to a [`CUdevResource`] structure.
25116    /// - `type_`: Type of resource to retrieve.
25117    ///
25118    /// # Return value
25119    ///
25120    /// - [`CUresult::CUDA_SUCCESS`]
25121    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
25122    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
25123    /// - [`CUresult::CUDA_ERROR_INVALID_RESOURCE_TYPE`]
25124    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
25125    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
25126    ///
25127    /// See also: [`cuDevResourceGenerateDesc`].
25128    pub fn cuDeviceGetDevResource(
25129        device: CUdevice,
25130        resource: *mut CUdevResource,
25131        type_: CUdevResourceType,
25132    ) -> CUresult;
25133}
25134singe_loader::functions! { crate::DRIVER;
25135    /// Get context resources.
25136    ///
25137    /// Get the `type` resources available to the context represented by `hCtx`
25138    /// Note: The API is not supported on 32-bit platforms.
25139    ///
25140    /// # Parameters
25141    ///
25142    /// - `hCtx`: Context to get resource for.
25143    /// - `resource`: Output pointer to a [`CUdevResource`] structure.
25144    /// - `type_`: Type of resource to retrieve.
25145    ///
25146    /// # Return value
25147    ///
25148    /// - [`CUresult::CUDA_SUCCESS`]
25149    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
25150    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
25151    /// - [`CUresult::CUDA_ERROR_INVALID_RESOURCE_TYPE`]
25152    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
25153    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
25154    ///
25155    /// See also: [`cuDevResourceGenerateDesc`].
25156    pub fn cuCtxGetDevResource(
25157        hCtx: CUcontext,
25158        resource: *mut CUdevResource,
25159        type_: CUdevResourceType,
25160    ) -> CUresult;
25161}
25162singe_loader::functions! { crate::DRIVER;
25163    /// Get green context resources.
25164    ///
25165    /// Get the `type` resources available to the green context represented by `hCtx`.
25166    ///
25167    /// # Parameters
25168    ///
25169    /// - `hCtx`: Green context to get resource for.
25170    /// - `resource`: Output pointer to a [`CUdevResource`] structure.
25171    /// - `type_`: Type of resource to retrieve.
25172    ///
25173    /// # Return value
25174    ///
25175    /// - [`CUresult::CUDA_SUCCESS`]
25176    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
25177    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
25178    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
25179    /// - [`CUresult::CUDA_ERROR_INVALID_RESOURCE_TYPE`]
25180    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
25181    ///
25182    /// See also: [`cuDevResourceGenerateDesc`].
25183    pub fn cuGreenCtxGetDevResource(
25184        hCtx: CUgreenCtx,
25185        resource: *mut CUdevResource,
25186        type_: CUdevResourceType,
25187    ) -> CUresult;
25188}
25189singe_loader::functions! { crate::DRIVER;
25190    /// Splits [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_SM`] resources.
25191    ///
25192    /// Splits [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_SM`] resources into `nbGroups`, adhering to the minimum SM count specified in `minCount` and the usage flags in `flags`. If `result` is NULL, the API simulates a split and provides the amount of groups that would be created in `nbGroups`. Otherwise, `nbGroups` must point to the amount of elements in `result` and on return, the API will overwrite `nbGroups` with the amount actually created. The groups are written to the array in `result`. `nbGroups` can be less than the total amount if a smaller number of groups is needed.
25193    ///
25194    /// This API is used to spatially partition the input resource. The input resource needs to come from one of [`cuDeviceGetDevResource`], [`cuCtxGetDevResource`], or [`cuGreenCtxGetDevResource`]. A limitation of the API is that the output results cannot be split again without first creating a descriptor and a green context with that descriptor.
25195    ///
25196    /// When creating the groups, the API will take into account the performance and functional characteristics of the input resource, and guarantee a split that will create a disjoint set of symmetrical partitions. This may lead to fewer groups created than purely dividing the total SM count by the `minCount` due to cluster requirements or alignment and granularity requirements for the minCount. These requirements can be queried with [`cuDeviceGetDevResource`], [`cuCtxGetDevResource`], and [`cuGreenCtxGetDevResource`] for [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_SM`], using the `minSmPartitionSize` and `smCoscheduledAlignment` fields to determine minimum partition size and alignment granularity, respectively.
25197    ///
25198    /// The `remainder` set does not have the same functional or performance guarantees as the groups in `result`. Its use should be carefully planned and future partitions of the `remainder` set are discouraged.
25199    ///
25200    /// The following flags are supported:
25201    ///
25202    /// * [`CUdevSmResourceSplitByCount_flags::CU_DEV_SM_RESOURCE_SPLIT_IGNORE_SM_COSCHEDULING`]: Lower the minimum SM count and alignment, and treat each SM independent of its hierarchy. This allows more fine grained partitions but at the cost of advanced features (such as large clusters on compute capability 9.0+).
25203    /// * [`CUdevSmResourceSplitByCount_flags::CU_DEV_SM_RESOURCE_SPLIT_MAX_POTENTIAL_CLUSTER_SIZE`]: Compute Capability 9.0+ only. Attempt to create groups that may allow for maximally sized thread clusters. This can be queried post green context creation using [`cuOccupancyMaxPotentialClusterSize`].
25204    ///
25205    /// A successful API call must either have:
25206    ///
25207    /// * A valid array of `result` pointers of size passed in `nbGroups`, with `input` of type [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_SM`]. Value of `minCount` must be between 0 and the SM count specified in `input`. `remainder` may be NULL.
25208    /// * NULL passed in for `result`, with a valid integer pointer in `nbGroups` and `input` of type [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_SM`]. Value of `minCount` must be between 0 and the SM count specified in `input`. `remainder` may be NULL. This queries the number of groups that would be created by the API.
25209    ///
25210    /// Note: The API is not supported on 32-bit platforms.
25211    ///
25212    /// # Parameters
25213    ///
25214    /// - `result`: Output array of [`CUdevResource`] resources. Can be NULL to query the number of groups.
25215    /// - `nbGroups`: This is a pointer, specifying the number of groups that would be or should be created as described below.
25216    /// - `input`: Input SM resource to be split. Must be a valid [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_SM`] resource.
25217    /// - `remainder`: If the input resource cannot be cleanly split among `nbGroups`, the remainder is placed in here. Can be ommitted (NULL) if the user does not need the remaining set.
25218    /// - `flags`: Flags specifying how these partitions are used or which constraints to abide by when splitting the input. Zero is valid for default behavior.
25219    /// - `minCount`: Minimum number of SMs required.
25220    ///
25221    /// # Return value
25222    ///
25223    /// - [`CUresult::CUDA_SUCCESS`]
25224    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
25225    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
25226    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
25227    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
25228    /// - [`CUresult::CUDA_ERROR_INVALID_RESOURCE_TYPE`]
25229    /// - [`CUresult::CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION`]
25230    ///
25231    /// See also: [`cuGreenCtxGetDevResource`], [`cuCtxGetDevResource`], [`cuDeviceGetDevResource`].
25232    pub fn cuDevSmResourceSplitByCount(
25233        result: *mut CUdevResource,
25234        nbGroups: *mut ::core::ffi::c_uint,
25235        input: *const CUdevResource,
25236        remainder: *mut CUdevResource,
25237        flags: ::core::ffi::c_uint,
25238        minCount: ::core::ffi::c_uint,
25239    ) -> CUresult;
25240}
25241singe_loader::functions! { crate::DRIVER;
25242    /// Splits a [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_SM`] resource into structured groups.
25243    ///
25244    /// This API will split a resource of [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_SM`] into `nbGroups` structured device resource groups (the `result` array), as well as an optional `remainder`, according to a set of requirements specified in the `groupParams` array. The term “structured” is a trait that specifies the `result` has SMs that are co-scheduled together. This co-scheduling can be specified via the `coscheduledSmCount` field of the `groupParams` structure, while the `smCount` will specify how many SMs are required in total for that result. The remainder is always “unstructured”, it does not have any set guarantees with respect to co-scheduling and those properties will need to either be queried via the occupancy set of APIs or further split into structured groups by this API.
25245    ///
25246    /// The API has a discovery mode for use cases where it is difficult to know ahead of time what the SM count should be. Discovery happens when the `smCount` field of a given `groupParams` array entry is set to 0 - the smCount will be filled in by the API with the derived SM count according to the provided `groupParams` fields and constraints. Discovery can be used with both a valid result array and with a NULL `result` pointer value. The latter is useful in situations where the smCount will end up being zero, which is an invalid value to create a result entry with, but allowed for discovery purposes when the `result` is NULL.
25247    ///
25248    /// The `groupParams` array is evaluated from index 0 to `nbGroups` - 1. For each index in the `groupParams` array, the API will evaluate which SMs may be a good fit based on constraints and assign those SMs to `result`. This evaluation order is important to consider when using discovery mode, as it helps discover the remaining SMs.
25249    ///
25250    /// For a valid call:
25251    ///
25252    /// * `result` should point to a [`CUdevResource`] array of size `nbGroups`, or alternatively, may be NULL, if the developer wishes for only the groupParams entries to be updated
25253    /// * `input` should be a valid [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_SM`] resource that originates from querying the green context, device context, or device.
25254    /// * The `remainder` group may be NULL.
25255    /// * There are no API `flags` at this time, so the value passed in should be 0.
25256    /// * A [`CU_DEV_SM_RESOURCE_GROUP_PARAMS`] array of size `nbGroups`. Each entry must be zero-initialized.
25257    ///
25258    ///   + `smCount:` must be either 0 or in the range of \[2,inputSmCount\] where inputSmCount is the amount of SMs the `input` resource has. `smCount` must be a multiple of 2, as well as a multiple of `coscheduledSmCount` if it is nonzero. When assigning SMs to a group (and if results are expected by having the `result` parameter set), `smCount` cannot end up with 0 or a value less than `coscheduledSmCount` otherwise [`CUresult::CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION`] will be returned.
25259    ///   + `coscheduledSmCount:` allows grouping SMs together in order to be able to launch clusters on Compute Architecture 9.0+. The default value may be queried from the device’s [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_SM`] resource (8 on Compute Architecture 9.0+ and 2 otherwise). The maximum is 32 on Compute Architecture 9.0+ and 2 otherwise. A `coscheduledSmCount` of 0 uses the default value internally while preserving 0 in `groupParams`. Cluster occupancy will be derived from the resulting SM topology.
25260    ///   + `preferredCoscheduledSmCount:` Attempts to merge `coscheduledSmCount` groups into larger groups, in order to make use of `preferredClusterDimensions` on Compute Architecture 10.0+. The default value is set to `coscheduledSmCount`.
25261    ///   + `flags:`
25262    ///
25263    /// - `CU_DEV_SM_RESOURCE_GROUP_BACKFILL:` Treats constraints as a hint, ignoring them if necessary to reach the requested `smCount`. Lets `smCount` be a non-multiple of `coscheduledSmCount`, filling the difference between SM count and already assigned co-scheduled groupings with other SMs. This lets any resulting group behave similar to the `remainder` group for example. When used with [`CUdevSmResourceGroup_flags::CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID`], backfill fills up to the requested `smCount` using the target locality domain first, then SMs not attributed to any locality domain, then SMs from other locality domains. If no SMs can be found in the requested locality domain, [`CUresult::CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION`] is returned.
25264    /// - `CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID:` Specifies that the SM partition should be localized to the specified `localityDomainId`.
25265    ///   + `localityDomainId:` Specifies the locality domain that the partitioned SMs must be located on. Only valid when [`CUdevSmResourceGroup_flags::CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID`] is set in flags.
25266    ///
25267    /// **Example params and their effect:**
25268    ///
25269    /// A groupParams array element is defined in the following order:
25270    ///
25271    /// ```text
25272    /// { .smCount, .coscheduledSmCount, .preferredCoscheduledSmCount, .flags, \/\* .reserved \*\/ }
25273    /// ```
25274    ///
25275    /// ```text
25276    /// // Example 1
25277    /// // Will discover how many SMs are available without imposing a co-scheduled group-size constraint.
25278    /// // The rest is placed in the optional remainder.
25279    /// CU_DEV_SM_RESOURCE_GROUP_PARAMS params { 0, 0, 0, 0, 0 };
25280    /// ```
25281    ///
25282    /// ```text
25283    /// // Example 2
25284    /// // Assuming the device has 10+ SMs, the result will have 10 SMs that are co-scheduled in groups of 2 SMs.
25285    /// // The rest is placed in the optional remainder.
25286    /// CU_DEV_SM_RESOURCE_GROUP_PARAMS params { 10, 2, 0, 0, 0 };
25287    /// // Setting the coscheduledSmCount to 2 guarantees that we can always have a valid result
25288    /// // as long as the SM count is less than or equal to the input resource SM count.
25289    /// ```
25290    ///
25291    /// ```text
25292    /// // Example 3
25293    /// // A single piece is split-off, but instead of assigning the rest to the remainder, a second group contains everything else
25294    /// // This assumes the device has 10+ SMs (8 of which are coscheduled in groups of 4),
25295    /// // otherwise the second group could end up with 0 SMs, which is not allowed.
25296    /// CU_DEV_SM_RESOURCE_GROUP_PARAMS params { {8, 4, 0, 0, 0}, {0, 2, 0, CU_DEV_SM_RESOURCE_GROUP_BACKFILL, 0 } }
25297    /// ```
25298    ///
25299    /// The difference between a catch-all param group as the last entry and the remainder is in two aspects:
25300    ///
25301    /// * The remainder may be NULL / _TYPE_INVALID (if there are no SMs remaining), while a result group must always be valid.
25302    /// * The remainder does not have a structure, while the result group will always need to adhere to a structure of coscheduledSmCount (even if its just 2), and therefore must always have enough coscheduled SMs to cover that requirement (even with the [`CUdevSmResourceGroup_flags::CU_DEV_SM_RESOURCE_GROUP_BACKFILL`] flag enabled).
25303    ///
25304    /// Splitting an input into N groups, can be accomplished by repeatedly splitting off 1 group and re-splitting the remainder (a bisect operation). However, it’s recommended to accomplish this with a single call wherever possible.
25305    ///
25306    /// # Parameters
25307    ///
25308    /// - `result`: Output array of [`CUdevResource`] resources. Can be NULL, alongside an smCount of 0, for discovery purpose.
25309    /// - `nbGroups`: Specifies the number of groups in `result` and `groupParams`.
25310    /// - `input`: Input SM resource to be split. Must be a valid [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_SM`] resource.
25311    /// - `remainder`: If splitting the input resource leaves any SMs, the remainder is placed in here.
25312    /// - `flags`: Flags specifying how the API should behave. The value should be 0 for now.
25313    /// - `groupParams`: Description of how the SMs should be split and assigned to the corresponding result entry.
25314    ///
25315    /// # Return value
25316    ///
25317    /// - [`CUresult::CUDA_SUCCESS`]
25318    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
25319    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
25320    /// - [`CUresult::CUDA_ERROR_INVALID_DEVICE`]
25321    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
25322    /// - [`CUresult::CUDA_ERROR_INVALID_RESOURCE_TYPE`]
25323    /// - [`CUresult::CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION`]
25324    ///
25325    /// See also: [`cuGreenCtxGetDevResource`], [`cuCtxGetDevResource`], [`cuDeviceGetDevResource`].
25326    pub fn cuDevSmResourceSplit(
25327        result: *mut CUdevResource,
25328        nbGroups: ::core::ffi::c_uint,
25329        input: *const CUdevResource,
25330        remainder: *mut CUdevResource,
25331        flags: ::core::ffi::c_uint,
25332        groupParams: *mut CU_DEV_SM_RESOURCE_GROUP_PARAMS,
25333    ) -> CUresult;
25334}
25335singe_loader::functions! { crate::DRIVER;
25336    /// Generate a resource descriptor.
25337    ///
25338    /// Generates a single resource descriptor with the set of resources specified in `resources`. The generated resource descriptor is necessary for the creation of green contexts via the [`cuGreenCtxCreate`] API. Resources of the same type can be passed in, provided they meet the requirements as noted below.
25339    ///
25340    /// A successful API call must have:
25341    ///
25342    /// * A valid output pointer for the `phDesc` descriptor as well as a valid array of `resources` pointers, with the array size passed in `nbResources`. If multiple resources are provided in `resources`, the device they came from must be the same, otherwise [`CUresult::CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION`] is returned. If multiple resources are provided in `resources` and they are of type [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_SM`], they must be outputs (whether `result` or `remaining`) from the same split API instance and have the same smCoscheduledAlignment and localityDomainId values, otherwise [`CUresult::CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION`] is returned.
25343    ///
25344    /// The output descriptor `phDesc` will remain valid for the lifetime of the process.
25345    ///
25346    /// Note: The API is not supported on 32-bit platforms.
25347    ///
25348    /// # Parameters
25349    ///
25350    /// - `phDesc`: Output descriptor.
25351    /// - `resources`: Array of resources to be included in the descriptor.
25352    /// - `nbResources`: Number of resources passed in `resources`.
25353    ///
25354    /// # Return value
25355    ///
25356    /// - [`CUresult::CUDA_SUCCESS`]
25357    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
25358    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
25359    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
25360    /// - [`CUresult::CUDA_ERROR_INVALID_RESOURCE_TYPE`]
25361    /// - [`CUresult::CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION`]
25362    ///
25363    /// See also: [`cuDevSmResourceSplitByCount`].
25364    pub fn cuDevResourceGenerateDesc(
25365        phDesc: *mut CUdevResourceDesc,
25366        resources: *mut CUdevResource,
25367        nbResources: ::core::ffi::c_uint,
25368    ) -> CUresult;
25369}
25370singe_loader::functions! { crate::DRIVER;
25371    /// Records an event.
25372    ///
25373    /// Captures in `hEvent` all the activities of the green context of `hCtx` at the time of this call. `hEvent` and `hCtx` must be from the same primary context otherwise [`cudaError_enum::CUDA_ERROR_INVALID_HANDLE`] is returned. Calls such as [`cuEventQuery`] or [`cuGreenCtxWaitEvent`] will then examine or wait for completion of the work that was captured. Uses of `hCtx` after this call do not modify `hEvent`.
25374    ///
25375    /// Note: The API will return [`cudaError_enum::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED`] if the specified green context `hCtx` has a stream in the capture mode. In such a case, the call will invalidate all the conflicting captures.
25376    ///
25377    /// # Parameters
25378    ///
25379    /// - `hCtx`: Green context to record event for.
25380    /// - `hEvent`: Event to record.
25381    ///
25382    /// # Return value
25383    ///
25384    /// - [`CUresult::CUDA_SUCCESS`]
25385    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
25386    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
25387    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
25388    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
25389    /// - [`CUresult::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED`]
25390    ///
25391    /// See also: [`cuGreenCtxWaitEvent`], [`cuEventRecord`], [`cuCtxRecordEvent`], [`cuCtxWaitEvent`].
25392    pub fn cuGreenCtxRecordEvent(hCtx: CUgreenCtx, hEvent: CUevent) -> CUresult;
25393}
25394singe_loader::functions! { crate::DRIVER;
25395    /// Make a green context wait on an event.
25396    ///
25397    /// Makes all future work submitted to green context `hCtx` wait for all work captured in `hEvent`. The synchronization will be performed on the device and will not block the calling CPU thread. See [`cuGreenCtxRecordEvent`] or [`cuEventRecord`], for details on what is captured by an event.
25398    ///
25399    /// Note: `hEvent` may be from a different context or device than `hCtx`.
25400    ///
25401    /// Note: The API will return [`cudaError_enum::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED`] and invalidate the capture if the specified event `hEvent` is part of an ongoing capture sequence or if the specified green context `hCtx` has a stream in the capture mode.
25402    ///
25403    /// # Parameters
25404    ///
25405    /// - `hCtx`: Green context to wait.
25406    /// - `hEvent`: Event to wait on.
25407    ///
25408    /// # Return value
25409    ///
25410    /// - [`CUresult::CUDA_SUCCESS`]
25411    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
25412    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
25413    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
25414    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
25415    /// - [`CUresult::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED`]
25416    ///
25417    /// See also: [`cuGreenCtxRecordEvent`], [`cuStreamWaitEvent`], [`cuCtxRecordEvent`], [`cuCtxWaitEvent`].
25418    pub fn cuGreenCtxWaitEvent(hCtx: CUgreenCtx, hEvent: CUevent) -> CUresult;
25419}
25420singe_loader::functions! { crate::DRIVER;
25421    /// Query the green context associated with a stream.
25422    ///
25423    /// Returns the CUDA green context that the stream is associated with, or NULL if the stream is not associated with any green context.
25424    ///
25425    /// The stream handle `hStream` can refer to any of the following:
25426    ///
25427    /// * a stream created via any of the CUDA driver APIs such as [`cuStreamCreate`], [`cuStreamCreateWithPriority`] and [`cuGreenCtxStreamCreate`], or their runtime API equivalents such as `cudaStreamCreate`, `cudaStreamCreateWithFlags` and `cudaStreamCreateWithPriority`. If during stream creation the context that was active in the calling thread was obtained with cuCtxFromGreenCtx, that green context is returned in `phCtx`. Otherwise, `*phCtx` is set to NULL instead.
25428    /// * special stream such as the NULL stream or [CU_STREAM_LEGACY](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-driver-api/cuda_driver_api/group__CUDA__TYPES.html#group__cuda__types_1gaa53e8210837f039dd6434a3a4c3324aa). In that case if context that is active in the calling thread was obtained with cuCtxFromGreenCtx, that green context is returned. Otherwise, `*phCtx` is set to NULL instead.
25429    ///
25430    /// Passing an invalid handle will result in undefined behavior.
25431    ///
25432    /// Note that this function may also return error codes from previous, asynchronous launches.
25433    ///
25434    /// # Parameters
25435    ///
25436    /// - `hStream`: Handle to the stream to be queried.
25437    /// - `phCtx`: Returned green context associated with the stream.
25438    ///
25439    /// # Return value
25440    ///
25441    /// - [`CUresult::CUDA_SUCCESS`]
25442    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
25443    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
25444    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
25445    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
25446    ///
25447    /// See also: [`cuStreamDestroy`], [`cuStreamCreate`], [`cuStreamCreateWithPriority`], [`cuStreamGetCtx`], [`cuGreenCtxStreamCreate`], [`cuStreamGetPriority`], [`cuStreamGetFlags`], [`cuStreamGetDevice`], [`cuStreamWaitEvent`], [`cuStreamQuery`], [`cuStreamSynchronize`], [`cuStreamAddCallback`], `cudaStreamCreate`, `cudaStreamCreateWithFlags`.
25448    pub fn cuStreamGetGreenCtx(hStream: CUstream, phCtx: *mut CUgreenCtx) -> CUresult;
25449}
25450singe_loader::functions! { crate::DRIVER;
25451    /// Create a stream for use in the green context.
25452    ///
25453    /// Creates a stream for use in the specified green context `greenCtx` and returns a handle in `phStream`. The stream can be destroyed by calling cuStreamDestroy(). Note that the API ignores the context that is current to the calling thread and creates a stream in the specified green context `greenCtx`.
25454    ///
25455    /// The supported values for `flags` are:
25456    ///
25457    /// * [`CUstream_flags_enum::CU_STREAM_NON_BLOCKING`]: This must be specified. It indicates that work running in the created stream may run concurrently with work in the default stream, and that the created stream should perform no implicit synchronization with the default stream.
25458    ///
25459    /// Specifying `priority` affects the scheduling priority of work in the stream. Priorities provide a hint to preferentially run work with higher priority when possible, but do not preempt already-running work or provide any other functional guarantee on execution order. `priority` follows a convention where lower numbers represent higher priorities. ‘0’ represents default priority. The range of meaningful numerical priorities can be queried using [`cuCtxGetStreamPriorityRange`]. If the specified priority is outside the numerical range returned by [`cuCtxGetStreamPriorityRange`], it will automatically be clamped to the lowest or the highest number in the range.
25460    ///
25461    /// Note that this function may also return error codes from previous, asynchronous launches.
25462    ///
25463    /// Note: In the current implementation, only compute kernels launched in priority streams are affected by the stream’s priority. Stream priorities have no effect on host-to-device and device-to-host memory operations.
25464    ///
25465    /// # Parameters
25466    ///
25467    /// - `phStream`: Returned newly created stream.
25468    /// - `greenCtx`: Green context for which to create the stream for.
25469    /// - `flags`: Flags for stream creation. [`CUstream_flags::CU_STREAM_NON_BLOCKING`] must be specified.
25470    /// - `priority`: Stream priority. Lower numbers represent higher priorities. See [`cuCtxGetStreamPriorityRange`] for more information about meaningful stream priorities that can be passed.
25471    ///
25472    /// # Return value
25473    ///
25474    /// - [`CUresult::CUDA_SUCCESS`]
25475    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
25476    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
25477    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
25478    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
25479    /// - [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`]
25480    ///
25481    /// See also: [`cuStreamDestroy`], [`cuGreenCtxCreate`], [`cuStreamCreate`], [`cuStreamGetPriority`], [`cuCtxGetStreamPriorityRange`], [`cuStreamGetFlags`], [`cuStreamGetDevice`], [`cuStreamWaitEvent`], [`cuStreamQuery`], [`cuStreamSynchronize`], [`cuStreamAddCallback`], `cudaStreamCreateWithPriority`.
25482    pub fn cuGreenCtxStreamCreate(
25483        phStream: *mut CUstream,
25484        greenCtx: CUgreenCtx,
25485        flags: ::core::ffi::c_uint,
25486        priority: ::core::ffi::c_int,
25487    ) -> CUresult;
25488}
25489singe_loader::functions! { crate::DRIVER;
25490    /// Returns the unique Id associated with the green context supplied.
25491    ///
25492    /// Returns in `greenCtxId` the unique Id which is associated with a given green context. The Id is unique for the life of the program for this instance of CUDA. If green context is supplied as NULL and the current context is set to a green context, the Id of the current green context is returned.
25493    ///
25494    /// Note that this function may also return error codes from previous, asynchronous launches.
25495    ///
25496    /// # Parameters
25497    ///
25498    /// - `greenCtx`: Green context for which to obtain the Id.
25499    /// - `greenCtxId`: Pointer to store the Id of the green context.
25500    ///
25501    /// # Return value
25502    ///
25503    /// - [`CUresult::CUDA_SUCCESS`]
25504    /// - [`CUresult::CUDA_ERROR_CONTEXT_IS_DESTROYED`]
25505    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
25506    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
25507    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
25508    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
25509    ///
25510    /// See also: [`cuGreenCtxCreate`], [`cuGreenCtxDestroy`], [`cuCtxGetId`].
25511    pub fn cuGreenCtxGetId(
25512        greenCtx: CUgreenCtx,
25513        greenCtxId: *mut ::core::ffi::c_ulonglong,
25514    ) -> CUresult;
25515}
25516singe_loader::functions! { crate::DRIVER;
25517    /// Get stream resources.
25518    ///
25519    /// Get the `type` resources available to the `hStream` and store them in `resource`.
25520    ///
25521    /// Note: The API will return [`cudaError_enum::CUDA_ERROR_INVALID_RESOURCE_TYPE`] is `type` is [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG`] or [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_WORKQUEUE`].
25522    ///
25523    /// Note that this function may also return error codes from previous, asynchronous launches.
25524    ///
25525    /// # Parameters
25526    ///
25527    /// - `hStream`: Stream to get resource for.
25528    /// - `resource`: Output pointer to a [`CUdevResource`] structure.
25529    /// - `type_`: Type of resource to retrieve.
25530    ///
25531    /// # Return value
25532    ///
25533    /// - [`CUresult::CUDA_SUCCESS`]
25534    /// - [`CUresult::CUDA_ERROR_DEINITIALIZED`]
25535    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
25536    /// - [`CUresult::CUDA_ERROR_INVALID_RESOURCE_TYPE`]
25537    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
25538    /// - [`CUresult::CUDA_ERROR_INVALID_HANDLE`]
25539    ///
25540    /// See also: [`cuGreenCtxCreate`], [`cuGreenCtxStreamCreate`], [`cuStreamCreate`], [`cuDevSmResourceSplitByCount`], [`cuDevResourceGenerateDesc`], `cudaStreamGetDevResource`.
25541    pub fn cuStreamGetDevResource(
25542        hStream: CUstream,
25543        resource: *mut CUdevResource,
25544        type_: CUdevResourceType,
25545    ) -> CUresult;
25546}
25547impl CUlogLevel_enum {
25548    /// A CUDA driver error message.
25549    pub const CU_LOG_LEVEL_ERROR: CUlogLevel_enum = CUlogLevel_enum(0);
25550    /// A CUDA driver warning message.
25551    pub const CU_LOG_LEVEL_WARNING: CUlogLevel_enum = CUlogLevel_enum(1);
25552}
25553/// ___MANBRIEF___ error log management functions for the low-level CUDA API (___CURRENT_FILE___) ___ENDMANBRIEF___
25554///
25555/// This section describes the error log management functions of the low-level CUDA driver application programming interface.
25556///
25557/// @{
25558#[repr(transparent)]
25559#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
25560pub struct CUlogLevel_enum(pub ::core::ffi::c_uint);
25561pub use self::CUlogLevel_enum as CUlogLevel;
25562/// Incomplete native type used by [`CUlogsCallbackHandle`] handles. The native API owns its layout.
25563#[repr(C)]
25564#[derive(Debug, Copy, Clone)]
25565pub struct CUlogsCallbackEntry_st {
25566    _unused: [u8; 0],
25567}
25568/// Opaque registration handle returned by the CUDA driver logging callback API.
25569pub type CUlogsCallbackHandle = *mut CUlogsCallbackEntry_st;
25570/// ___MANBRIEF___ error log management functions for the low-level CUDA API (___CURRENT_FILE___) ___ENDMANBRIEF___
25571///
25572/// This section describes the error log management functions of the low-level CUDA driver application programming interface.
25573///
25574/// @{
25575pub type CUlogsCallback = ::core::option::Option<
25576    unsafe extern "C" fn(
25577        data: *mut ::core::ffi::c_void,
25578        logLevel: CUlogLevel,
25579        message: *mut ::core::ffi::c_char,
25580        length: size_t,
25581    ),
25582>;
25583/// Native cursor used to iterate through CUDA driver log messages.
25584pub type CUlogIterator = ::core::ffi::c_uint;
25585singe_loader::functions! { crate::DRIVER;
25586    /// Register a callback function to receive error log messages.
25587    ///
25588    /// # Parameters
25589    ///
25590    /// - `callbackFunc`: The function to register as a callback.
25591    /// - `userData`: A generic pointer to user data. This is passed into the callback function.
25592    /// - `callback_out`: Optional location to store the callback handle after it is registered.
25593    ///
25594    /// # Return value
25595    ///
25596    /// - [`CUresult::CUDA_SUCCESS`]
25597    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
25598    pub fn cuLogsRegisterCallback(
25599        callbackFunc: CUlogsCallback,
25600        userData: *mut ::core::ffi::c_void,
25601        callback_out: *mut CUlogsCallbackHandle,
25602    ) -> CUresult;
25603}
25604singe_loader::functions! { crate::DRIVER;
25605    /// Unregister a log message callback.
25606    ///
25607    /// # Parameters
25608    ///
25609    /// - `callback`: The callback instance to unregister from receiving log messages
25610    ///
25611    /// # Return value
25612    ///
25613    /// - [`CUresult::CUDA_SUCCESS`]
25614    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
25615    pub fn cuLogsUnregisterCallback(callback: CUlogsCallbackHandle) -> CUresult;
25616}
25617singe_loader::functions! { crate::DRIVER;
25618    /// Sets log iterator to point to the end of log buffer, where the next message would be written.
25619    ///
25620    /// # Parameters
25621    ///
25622    /// - `iterator_out`: Location to store an iterator to the current tail of the logs.
25623    /// - `flags`: Reserved for future use, must be 0.
25624    ///
25625    /// # Return value
25626    ///
25627    /// - [`CUresult::CUDA_SUCCESS`]
25628    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
25629    pub fn cuLogsCurrent(
25630        iterator_out: *mut CUlogIterator,
25631        flags: ::core::ffi::c_uint,
25632    ) -> CUresult;
25633}
25634singe_loader::functions! { crate::DRIVER;
25635    /// Dump accumulated driver logs into a file.
25636    ///
25637    /// Logs generated by the driver are stored in an internal buffer and can be copied out using this API. This API dumps all driver logs starting from `iterator` into `pathToFile` provided.
25638    ///
25639    /// Note: `iterator` is auto-advancing. Dumping logs will update the value of `iterator` to receive the next generated log.
25640    ///
25641    /// Note: The driver reserves limited memory for storing logs. The oldest logs may be overwritten and become unrecoverable. An indication will appear in the destination outupt if the logs have been truncated. Call dump after each failed API to mitigate this risk.
25642    ///
25643    /// # Parameters
25644    ///
25645    /// - `iterator`: Optional auto-advancing iterator specifying the starting log to read. NULL value dumps all logs.
25646    /// - `pathToFile`: Path to output file for dumping logs.
25647    /// - `flags`: Reserved for future use, must be 0.
25648    ///
25649    /// # Return value
25650    ///
25651    /// - [`CUresult::CUDA_SUCCESS`]
25652    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
25653    pub fn cuLogsDumpToFile(
25654        iterator: *mut CUlogIterator,
25655        pathToFile: *const ::core::ffi::c_char,
25656        flags: ::core::ffi::c_uint,
25657    ) -> CUresult;
25658}
25659singe_loader::functions! { crate::DRIVER;
25660    /// Dump accumulated driver logs into a buffer.
25661    ///
25662    /// Logs generated by the driver are stored in an internal buffer and can be copied out using this API. This API dumps driver logs from `iterator` into `buffer` up to the size specified in `*size`. The driver will always null terminate the buffer but there will not be a null character between log entries, only a newline \n. The driver will then return the actual number of bytes written in `*size`, excluding the null terminator. If there are no messages to dump, `*size` will be set to 0 and the function will return [`cudaError_enum::CUDA_SUCCESS`]. If the provided `buffer` is not large enough to hold any messages, `*size` will be set to 0 and the function will return [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`].
25663    ///
25664    /// Note: `iterator` is auto-advancing. Dumping logs will update the value of `iterator` to receive the next generated log.
25665    ///
25666    /// Note: The driver reserves limited memory for storing logs. The maximum size of the buffer is 25600 bytes. The oldest logs may be overwritten and become unrecoverable. An indication will appear in the destination outupt if the logs have been truncated. Call dump after each failed API to mitigate this risk.
25667    ///
25668    /// Note: If the provided value in `*size` is not large enough to hold all buffered messages, a message will be added at the head of the buffer indicating this. The driver then computes the number of messages it is able to store in `buffer` and writes it out. The final message in `buffer` will always be the most recent log message as of when the API is called.
25669    ///
25670    /// # Parameters
25671    ///
25672    /// - `iterator`: Optional auto-advancing iterator specifying the starting log to read. NULL value dumps all logs.
25673    /// - `buffer`: Pointer to dump logs.
25674    /// - `size`: See description.
25675    /// - `flags`: Reserved for future use, must be 0.
25676    ///
25677    /// # Return value
25678    ///
25679    /// - [`CUresult::CUDA_SUCCESS`]
25680    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
25681    pub fn cuLogsDumpToMemory(
25682        iterator: *mut CUlogIterator,
25683        buffer: *mut ::core::ffi::c_char,
25684        size: *mut size_t,
25685        flags: ::core::ffi::c_uint,
25686    ) -> CUresult;
25687}
25688singe_loader::functions! { crate::DRIVER;
25689    /// Returns the restore thread ID for a CUDA process.
25690    ///
25691    /// Returns in `*tid` the thread ID of the CUDA restore thread for the process specified by `pid`.
25692    ///
25693    /// # Parameters
25694    ///
25695    /// - `pid`: The process ID of the CUDA process.
25696    /// - `tid`: Returned restore thread ID.
25697    ///
25698    /// # Return value
25699    ///
25700    /// - [`CUresult::CUDA_SUCCESS`]
25701    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
25702    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
25703    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
25704    pub fn cuCheckpointProcessGetRestoreThreadId(
25705        pid: ::core::ffi::c_int,
25706        tid: *mut ::core::ffi::c_int,
25707    ) -> CUresult;
25708}
25709singe_loader::functions! { crate::DRIVER;
25710    /// Returns the process state of a CUDA process.
25711    ///
25712    /// Returns in `*state` the current state of the CUDA process specified by `pid`.
25713    ///
25714    /// # Parameters
25715    ///
25716    /// - `pid`: The process ID of the CUDA process.
25717    /// - `state`: Returned CUDA process state.
25718    ///
25719    /// # Return value
25720    ///
25721    /// - [`CUresult::CUDA_SUCCESS`]
25722    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
25723    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
25724    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
25725    pub fn cuCheckpointProcessGetState(
25726        pid: ::core::ffi::c_int,
25727        state: *mut CUprocessState,
25728    ) -> CUresult;
25729}
25730singe_loader::functions! { crate::DRIVER;
25731    /// Lock a running CUDA process.
25732    ///
25733    /// Lock the CUDA process specified by `pid` which will block further CUDA API calls. Process must be in the RUNNING state in order to lock.
25734    ///
25735    /// Upon successful return the process will be in the LOCKED state.
25736    ///
25737    /// If timeoutMs is specified and the timeout is reached the process will be left in the RUNNING state upon return.
25738    ///
25739    /// # Parameters
25740    ///
25741    /// - `pid`: The process ID of the CUDA process.
25742    /// - `args`: Optional lock operation arguments.
25743    ///
25744    /// # Return value
25745    ///
25746    /// - [`CUresult::CUDA_SUCCESS`]
25747    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
25748    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
25749    /// - [`CUresult::CUDA_ERROR_ILLEGAL_STATE`]
25750    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
25751    /// - [`CUresult::CUDA_ERROR_NOT_READY`]
25752    pub fn cuCheckpointProcessLock(
25753        pid: ::core::ffi::c_int,
25754        args: *mut CUcheckpointLockArgs,
25755    ) -> CUresult;
25756}
25757singe_loader::functions! { crate::DRIVER;
25758    /// Checkpoint a CUDA process’s GPU memory contents.
25759    ///
25760    /// Checkpoints a CUDA process specified by `pid`. The GPU memory contents will be brought into host memory or mapped onto the calling process’s GPUs for user-defined behavior. Underlying GPU references are released when checkpointing completes. The process must be in the [`CUprocessState_enum::CU_PROCESS_STATE_LOCKED`] state to checkpoint.
25761    ///
25762    /// When [`CUcheckpointCheckpointArgs::customStorageInfo_out`](CUcheckpointCheckpointArgs_st::customStorageInfo_out) is not NULL, all the GPU memory allocated by the process with `pid` will be mapped onto the calling process’s GPUs so the application can copy the memory to custom storage. Upon return of this call, the pointer referenced by [`CUcheckpointCheckpointArgs::customStorageInfo_out`](CUcheckpointCheckpointArgs_st::customStorageInfo_out) will point to a [`CUcheckpointCustomStorageInfo`] struct allocated and populated by the driver. For each GPU which contains data from the checkpointed process, there is a corresponding entry in the [`CUcheckpointCustomStoragePerDeviceData`] array.
25763    ///
25764    /// * The device pointers and sizes for the contiguously mapped memory on a particular GPU are set in the [`CUcheckpointCustomStoragePerDeviceData::devPtr`](CUcheckpointCustomStoragePerDeviceData_st::devPtr) and [`CUcheckpointCustomStoragePerDeviceData::size`](CUcheckpointCustomStoragePerDeviceData_st::size) fields respectively.
25765    /// * A stream belonging to the primary context of a particular GPU is set in [`CUcheckpointCustomStoragePerDeviceData::stream`](CUcheckpointCustomStoragePerDeviceData_st::stream). The application can use the stream to find out which GPU the memory is mapped on and to enqueue the copies to custom storage.
25766    ///
25767    /// The application is responsible for copying the mapped data from the GPU at the specified device address to custom storage. When checkpointing to custom storage, the application is expected to call [`cuCheckpointOperationComplete`]. The [`CUcheckpointCustomStorageInfo::handle`](CUcheckpointCustomStorageInfo_st::handle) set by this call should be passed to [`cuCheckpointOperationComplete`] in `handle`. The driver synchronizes all the streams in [`cuCheckpointOperationComplete`], at which point the copy to custom storage is considered complete.
25768    ///
25769    /// When checkpointing to custom storage, the application is expected to retain primary contexts of all the devices used by the process to be checkpointed. Otherwise [`cuCheckpointProcessCheckpoint`] will return [`cudaError_enum::CUDA_ERROR_INVALID_CONTEXT`]. Unlike other checkpoint operations, checkpointing to custom storage requires [`cuInit`] to have been called before execution. Checkpointing the calling process’s GPU memory to custom storage is not supported. Upon successful return, the target process will be in the [`CUprocessState_enum::CU_PROCESS_STATE_CHECKPOINTING`] state.
25770    ///
25771    /// When [`CUcheckpointCheckpointArgs::customStorageInfo_out`](CUcheckpointCheckpointArgs_st::customStorageInfo_out) is NULL, the GPU memory contents will be brought into host memory by [`cuCheckpointProcessCheckpoint`]. The application is not expected to copy the GPU memory contents. The application is also not expected to call [`cuCheckpointOperationComplete`]. Upon successful return, the target process will be in the [`CUprocessState_enum::CU_PROCESS_STATE_CHECKPOINTED`] state.
25772    ///
25773    /// # Parameters
25774    ///
25775    /// - `pid`: The process ID of the CUDA process.
25776    /// - `args`: Optional checkpoint operation arguments.
25777    ///
25778    /// # Return value
25779    ///
25780    /// - [`CUresult::CUDA_SUCCESS`]
25781    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
25782    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
25783    /// - [`CUresult::CUDA_ERROR_ILLEGAL_STATE`]
25784    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
25785    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
25786    pub fn cuCheckpointProcessCheckpoint(
25787        pid: ::core::ffi::c_int,
25788        args: *mut CUcheckpointCheckpointArgs,
25789    ) -> CUresult;
25790}
25791singe_loader::functions! { crate::DRIVER;
25792    /// Restore a CUDA process’s GPU memory contents from its last checkpoint.
25793    ///
25794    /// Restores a CUDA process specified by `pid` from its last checkpoint. Process must be in the [`CUprocessState_enum::CU_PROCESS_STATE_CHECKPOINTED`] state to restore.
25795    ///
25796    /// GPU UUID pairs can be specified in `args` to remap the process old GPUs onto new GPUs. The GPU to restore onto needs to have enough memory and be of the same chip type as the old GPU. If an array of GPU UUID pairs is specified, it must contain every checkpointed GPU.
25797    ///
25798    /// CUDA process restore requires persistence mode to be enabled or [`cuInit`] to have been called before execution.
25799    ///
25800    /// When [`CUcheckpointRestoreArgs::customStorageInfo_out`](CUcheckpointRestoreArgs_st::customStorageInfo_out) is not NULL, all the GPU memory to be restored for the process with `pid` will be mapped onto the calling process’s GPUs so the application can copy the memory back to the GPU.
25801    ///
25802    /// Upon return of this call, the pointer referenced by [`CUcheckpointRestoreArgs::customStorageInfo_out`](CUcheckpointRestoreArgs_st::customStorageInfo_out) will point to a [`CUcheckpointCustomStorageInfo`] struct allocated and populated by the driver. For each GPU which contains data from the restored process, there is a corresponding entry in the [`CUcheckpointCustomStoragePerDeviceData`] array.
25803    ///
25804    /// * The device pointers and sizes for the contiguously mapped memory on a particular GPU are set in the [`CUcheckpointCustomStoragePerDeviceData::devPtr`](CUcheckpointCustomStoragePerDeviceData_st::devPtr) and [`CUcheckpointCustomStoragePerDeviceData::size`](CUcheckpointCustomStoragePerDeviceData_st::size) fields respectively.
25805    /// * A stream belonging to the primary context of the GPU is set in [`CUcheckpointCustomStoragePerDeviceData::stream`](CUcheckpointCustomStoragePerDeviceData_st::stream). The application can use the stream to find out which GPU the memory is mapped on and to enqueue the copies from custom storage back to the GPU.
25806    ///
25807    /// The application is responsible for copying the data from custom storage to the GPU at the specified device address. When restoring from custom storage, the application is expected to call [`cuCheckpointOperationComplete`]. The [`CUcheckpointCustomStorageInfo::handle`](CUcheckpointCustomStorageInfo_st::handle) set by this call should be passed to [`cuCheckpointOperationComplete`] in `handle`. The driver synchronizes all the streams in [`cuCheckpointOperationComplete`], at which point the copy from custom storage is considered complete.
25808    ///
25809    /// When restoring from custom storage, the application is expected to retain primary contexts of all the devices used by the process to be restored. Otherwise [`cuCheckpointProcessRestore`] will return [`cudaError_enum::CUDA_ERROR_INVALID_CONTEXT`]
25810    ///
25811    /// . Restoring the calling process’s
25812    ///
25813    /// GPU memory from custom storage is not supported. Upon successful return, the target process will be in the
25814    ///
25815    /// [`CUprocessState_enum::CU_PROCESS_STATE_RESTORING`] state.
25816    ///
25817    /// When [`CUcheckpointRestoreArgs::customStorageInfo_out`](CUcheckpointRestoreArgs_st::customStorageInfo_out) is NULL, the GPU memory contents will be restored from host memory by [`cuCheckpointProcessRestore`]. The application is not expected to copy back the GPU memory contents. The application is also not expected to call [`cuCheckpointOperationComplete`]. Upon successful return, the target process will be in the [`CUprocessState_enum::CU_PROCESS_STATE_LOCKED`] state.
25818    ///
25819    /// # Parameters
25820    ///
25821    /// - `pid`: The process ID of the CUDA process.
25822    /// - `args`: Optional restore operation arguments.
25823    ///
25824    /// # Return value
25825    ///
25826    /// - [`CUresult::CUDA_SUCCESS`]
25827    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
25828    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
25829    /// - [`CUresult::CUDA_ERROR_ILLEGAL_STATE`]
25830    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
25831    /// - [`CUresult::CUDA_ERROR_INVALID_CONTEXT`]
25832    ///
25833    /// See also: [`cuInit`].
25834    pub fn cuCheckpointProcessRestore(
25835        pid: ::core::ffi::c_int,
25836        args: *mut CUcheckpointRestoreArgs,
25837    ) -> CUresult;
25838}
25839singe_loader::functions! { crate::DRIVER;
25840    /// Complete a custom-storage checkpoint or restore operation.
25841    ///
25842    /// After [`cuCheckpointProcessCheckpoint`] or [`cuCheckpointProcessRestore`] with custom storage, [`cuCheckpointOperationComplete`] should be called when the application has finished or enqueued (on a stream) the required copies (for checkpoint, GPU mappings to custom storage and for restore, custom storage into GPU mappings) so the driver can finish the operation.
25843    ///
25844    /// [`cuCheckpointOperationComplete`] will first synchronize on the streams returned by [`cuCheckpointProcessCheckpoint`] or [`cuCheckpointProcessRestore`]. The driver assumes that the application has completed copying the memory to or from custom storage once synchronization is done. None of the streams returned by [`cuCheckpointProcessCheckpoint`] or [`cuCheckpointProcessRestore`] should be in stream capture mode; any attempt to do so would result in [`cudaError_enum::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED`]. Once the synchronization is done, [`cuCheckpointOperationComplete`] will unmap the GPU memory that was mapped on each GPU in a particular [`cuCheckpointProcessCheckpoint`] or [`cuCheckpointProcessRestore`] operation. [`cuCheckpointOperationComplete`] identifies the operation to be completed using `handle`. This handle is set by [`cuCheckpointProcessCheckpoint`] or [`cuCheckpointProcessRestore`].
25845    ///
25846    /// When the call returns successfully, the target process will be in the [`CUprocessState_enum::CU_PROCESS_STATE_CHECKPOINTED`] state when completing a checkpoint operation or the [`CUprocessState_enum::CU_PROCESS_STATE_LOCKED`] state when completing a restore operation.
25847    ///
25848    /// # Parameters
25849    ///
25850    /// - `handle`: `CUcheckpointCustomStorageInfo::handle`(CUcheckpointCustomStorageInfo_st::handle) set by a prior [`cuCheckpointProcessCheckpoint`] or [`cuCheckpointProcessRestore`] call
25851    ///
25852    /// # Return value
25853    ///
25854    /// - [`CUresult::CUDA_SUCCESS`]
25855    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
25856    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
25857    /// - [`CUresult::CUDA_ERROR_ILLEGAL_STATE`]
25858    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
25859    pub fn cuCheckpointOperationComplete(
25860        handle: CUcheckpointOperationHandle,
25861    ) -> CUresult;
25862}
25863singe_loader::functions! { crate::DRIVER;
25864    /// Unlock a CUDA process to allow CUDA API calls.
25865    ///
25866    /// Unlocks a process specified by `pid` allowing it to resume making CUDA API calls. Process must be in the LOCKED state.
25867    ///
25868    /// Upon successful return the process will be in the RUNNING state.
25869    ///
25870    /// # Parameters
25871    ///
25872    /// - `pid`: The process ID of the CUDA process.
25873    /// - `args`: Optional unlock operation arguments.
25874    ///
25875    /// # Return value
25876    ///
25877    /// - [`CUresult::CUDA_SUCCESS`]
25878    /// - [`CUresult::CUDA_ERROR_INVALID_VALUE`]
25879    /// - [`CUresult::CUDA_ERROR_NOT_INITIALIZED`]
25880    /// - [`CUresult::CUDA_ERROR_ILLEGAL_STATE`]
25881    /// - [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
25882    pub fn cuCheckpointProcessUnlock(
25883        pid: ::core::ffi::c_int,
25884        args: *mut CUcheckpointUnlockArgs,
25885    ) -> CUresult;
25886}