Skip to main content

singe_cuda_sys/
runtime_sys_13040.rs

1/* automatically generated by rust-bindgen 0.72.1 */
2
3/// Compile-time CUDA runtime API version code. This identifies the headers used to generate these bindings, which may differ from the loaded library.
4pub const CUDART_VERSION: u32 = 13040;
5/// Selects a one-dimensional surface resource.
6pub const cudaSurfaceType1D: u32 = 1;
7/// Selects a two-dimensional surface resource.
8pub const cudaSurfaceType2D: u32 = 2;
9/// Selects a three-dimensional surface resource.
10pub const cudaSurfaceType3D: u32 = 3;
11/// Selects a cube-map surface resource.
12pub const cudaSurfaceTypeCubemap: u32 = 12;
13/// Selects a layered one-dimensional surface resource.
14pub const cudaSurfaceType1DLayered: u32 = 241;
15/// Selects a layered two-dimensional surface resource.
16pub const cudaSurfaceType2DLayered: u32 = 242;
17/// Selects a layered cube-map surface resource.
18pub const cudaSurfaceTypeCubemapLayered: u32 = 252;
19/// Selects a one-dimensional texture resource.
20pub const cudaTextureType1D: u32 = 1;
21/// Selects a two-dimensional texture resource.
22pub const cudaTextureType2D: u32 = 2;
23/// Selects a three-dimensional texture resource.
24pub const cudaTextureType3D: u32 = 3;
25/// Selects a cube-map texture resource.
26pub const cudaTextureTypeCubemap: u32 = 12;
27/// Selects a layered one-dimensional texture resource.
28pub const cudaTextureType1DLayered: u32 = 241;
29/// Selects a layered two-dimensional texture resource.
30pub const cudaTextureType2DLayered: u32 = 242;
31/// Selects a layered cube-map texture resource.
32pub const cudaTextureTypeCubemapLayered: u32 = 252;
33impl cudaRoundMode {
34    /// Rounds to the nearest representable value.
35    pub const cudaRoundNearest: cudaRoundMode = cudaRoundMode(0);
36    /// Rounds toward zero.
37    pub const cudaRoundZero: cudaRoundMode = cudaRoundMode(1);
38    /// Rounds toward positive infinity.
39    pub const cudaRoundPosInf: cudaRoundMode = cudaRoundMode(2);
40    /// Rounds toward negative infinity.
41    pub const cudaRoundMinInf: cudaRoundMode = cudaRoundMode(3);
42}
43/// Floating-point rounding direction for CUDA conversion operations.
44#[repr(transparent)]
45#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
46pub struct cudaRoundMode(pub ::core::ffi::c_uint);
47/// Unsigned C `size_t`, used for byte counts and object sizes in the native ABI.
48pub type size_t = ::core::ffi::c_ulong;
49impl cudaSurfaceBoundaryMode {
50    /// Zero boundary mode.
51    pub const cudaBoundaryModeZero: cudaSurfaceBoundaryMode = cudaSurfaceBoundaryMode(0);
52    /// Clamp boundary mode.
53    pub const cudaBoundaryModeClamp: cudaSurfaceBoundaryMode = cudaSurfaceBoundaryMode(
54        1,
55    );
56    /// Trap boundary mode.
57    pub const cudaBoundaryModeTrap: cudaSurfaceBoundaryMode = cudaSurfaceBoundaryMode(2);
58}
59/// CUDA Surface boundary modes.
60#[repr(transparent)]
61#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
62pub struct cudaSurfaceBoundaryMode(pub ::core::ffi::c_uint);
63impl cudaSurfaceFormatMode {
64    /// Forced format mode.
65    pub const cudaFormatModeForced: cudaSurfaceFormatMode = cudaSurfaceFormatMode(0);
66    /// Auto format mode.
67    pub const cudaFormatModeAuto: cudaSurfaceFormatMode = cudaSurfaceFormatMode(1);
68}
69/// CUDA Surface format modes.
70#[repr(transparent)]
71#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
72pub struct cudaSurfaceFormatMode(pub ::core::ffi::c_uint);
73/// An opaque value that represents a CUDA Surface object.
74pub type cudaSurfaceObject_t = ::core::ffi::c_ulonglong;
75impl cudaTextureAddressMode {
76    /// Wrapping address mode.
77    pub const cudaAddressModeWrap: cudaTextureAddressMode = cudaTextureAddressMode(0);
78    /// Clamp to edge address mode.
79    pub const cudaAddressModeClamp: cudaTextureAddressMode = cudaTextureAddressMode(1);
80    /// Mirror address mode.
81    pub const cudaAddressModeMirror: cudaTextureAddressMode = cudaTextureAddressMode(2);
82    /// Border address mode.
83    pub const cudaAddressModeBorder: cudaTextureAddressMode = cudaTextureAddressMode(3);
84}
85/// CUDA texture address modes.
86#[repr(transparent)]
87#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
88pub struct cudaTextureAddressMode(pub ::core::ffi::c_uint);
89impl cudaTextureFilterMode {
90    /// Point filter mode.
91    pub const cudaFilterModePoint: cudaTextureFilterMode = cudaTextureFilterMode(0);
92    /// Linear filter mode.
93    pub const cudaFilterModeLinear: cudaTextureFilterMode = cudaTextureFilterMode(1);
94}
95/// CUDA texture filter modes.
96#[repr(transparent)]
97#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
98pub struct cudaTextureFilterMode(pub ::core::ffi::c_uint);
99impl cudaTextureReadMode {
100    /// Read texture as specified element type.
101    pub const cudaReadModeElementType: cudaTextureReadMode = cudaTextureReadMode(0);
102    /// Read texture as normalized float.
103    pub const cudaReadModeNormalizedFloat: cudaTextureReadMode = cudaTextureReadMode(1);
104}
105/// CUDA texture read modes.
106#[repr(transparent)]
107#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
108pub struct cudaTextureReadMode(pub ::core::ffi::c_uint);
109/// CUDA texture descriptor.
110#[repr(C)]
111#[derive(Debug, Copy, Clone, PartialOrd, PartialEq)]
112pub struct cudaTextureDesc {
113    /// Texture address mode for up to 3 dimensions.
114    pub addressMode: [cudaTextureAddressMode; 3usize],
115    /// Texture filter mode.
116    pub filterMode: cudaTextureFilterMode,
117    /// Texture read mode.
118    pub readMode: cudaTextureReadMode,
119    /// Perform sRGB->linear conversion during texture read.
120    pub sRGB: ::core::ffi::c_int,
121    /// Texture Border Color.
122    pub borderColor: [f32; 4usize],
123    /// Indicates whether texture reads are normalized or not.
124    pub normalizedCoords: ::core::ffi::c_int,
125    /// Limit to the anisotropy ratio.
126    pub maxAnisotropy: ::core::ffi::c_uint,
127    /// Mipmap filter mode.
128    pub mipmapFilterMode: cudaTextureFilterMode,
129    /// Offset applied to the supplied mipmap level.
130    pub mipmapLevelBias: f32,
131    /// Lower end of the mipmap level range to clamp access to.
132    pub minMipmapLevelClamp: f32,
133    /// Upper end of the mipmap level range to clamp access to.
134    pub maxMipmapLevelClamp: f32,
135    /// Disable any trilinear filtering optimizations.
136    pub disableTrilinearOptimization: ::core::ffi::c_int,
137    /// Enable seamless cube map filtering.
138    pub seamlessCubemap: ::core::ffi::c_int,
139}
140impl Default for cudaTextureDesc {
141    fn default() -> Self {
142        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
143        unsafe {
144            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
145            s.assume_init()
146        }
147    }
148}
149/// An opaque value that represents a CUDA texture object.
150pub type cudaTextureObject_t = ::core::ffi::c_ulonglong;
151singe_loader::functions! { crate::RUNTIME;
152    /// Destroy all allocations and reset all state on the current device in the current process.
153    ///
154    /// Explicitly destroys and cleans up all resources associated with the current device in the current process. It is the caller’s responsibility to ensure that the resources are not accessed or passed in subsequent API calls and doing so will result in undefined behavior. These resources include CUDA types [`cudaStream_t`], [`cudaEvent_t`], [`cudaArray_t`], [`cudaMipmappedArray_t`], [`cudaPitchedPtr`], [`cudaTextureObject_t`], [`cudaSurfaceObject_t`], `textureReference`, `surfaceReference`, [`cudaExternalMemory_t`], [`cudaExternalSemaphore_t`] and [`cudaGraphicsResource_t`]. These resources also include memory allocations by [`cudaMalloc`], [`cudaMallocHost`], [`cudaMallocManaged`] and [`cudaMallocPitch`]. Any subsequent API call to this device will reinitialize the device.
155    ///
156    /// Note that this function will reset the device immediately. It is the caller’s responsibility to ensure that the device is not being accessed by any other host threads from the process when this function is called.
157    ///
158    /// Note: [`cudaDeviceReset`] will not destroy memory allocations by [`cudaMallocAsync`] and [`cudaMallocFromPoolAsync`]. These memory allocations need to be destroyed explicitly.
159    ///
160    /// Note: If a non-primary [`CUcontext`](crate::driver::CUcontext) is current to the thread, [`cudaDeviceReset`] will destroy only the internal CUDA RT state for that [`CUcontext`](crate::driver::CUcontext).
161    ///
162    /// Note that this function may also return error codes from previous, asynchronous launches.
163    ///
164    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
165    ///
166    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
167    ///
168    /// # Return value
169    ///
170    /// - [`cudaError_t::CUDA_SUCCESS`]
171    ///
172    /// See also: [`cudaDeviceSynchronize`].
173    pub fn cudaDeviceReset() -> cudaError_t;
174}
175singe_loader::functions! { crate::RUNTIME;
176    /// Wait for compute device to finish.
177    ///
178    /// Blocks until the device has completed all preceding requested tasks. [`cudaDeviceSynchronize`] returns an error if one of the preceding tasks has failed. If the [cudaDeviceScheduleBlockingSync](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga057e6912c52708b6aa86e79dd83d007c) flag was set for this device, the host thread will block until the device has finished its work.
179    ///
180    /// Note: Use of cudaDeviceSynchronize in device code was deprecated in CUDA 11.6 and removed for compute_90+ compilation. For compute capability &lt; 9.0, compile-time opt-in by specifying -D CUDA_FORCE_CDP1_IF_SUPPORTED is required to continue using [`cudaDeviceSynchronize`] in device code for now. Note that this is different from host-side cudaDeviceSynchronize, which is still supported.
181    ///
182    /// Note that this function may also return error codes from previous, asynchronous launches.
183    ///
184    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
185    ///
186    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
187    ///
188    /// # Return value
189    ///
190    /// - [`cudaError_t::CUDA_SUCCESS`]
191    /// - [`cudaError_t::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED`]
192    ///
193    /// See also: [`cudaDeviceReset`], [`cuCtxSynchronize`](crate::driver::cuCtxSynchronize).
194    pub fn cudaDeviceSynchronize() -> cudaError_t;
195}
196singe_loader::functions! { crate::RUNTIME;
197    /// Set resource limits.
198    ///
199    /// Setting `limit` to `value` is a request by the application to update the current limit maintained by the device. 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 [`cudaDeviceGetLimit`] to find out exactly what the limit has been set to.
200    ///
201    /// Setting each [`cudaLimit`] has its own specific restrictions, so each is discussed here.
202    ///
203    /// * [`cudaLimit::cudaLimitStackSize`] controls the stack size in bytes of each GPU thread.
204    /// * [`cudaLimit::cudaLimitPrintfFifoSize`] controls the size in bytes of the shared FIFO used by the `printf()` device system call. Setting [`cudaLimit::cudaLimitPrintfFifoSize`] must not be performed after launching any kernel that uses the `printf()` device system call - in such case [`cudaError_t::CUDA_ERROR_INVALID_VALUE`] will be returned.
205    /// * [`cudaLimit::cudaLimitMallocHeapSize`] controls the size in bytes of the heap used by the `malloc()` and `free()` device system calls. Setting [`cudaLimit::cudaLimitMallocHeapSize`] must not be performed after launching any kernel that uses the `malloc()` or `free()` device system calls - in such case [`cudaError_t::CUDA_ERROR_INVALID_VALUE`] will be returned.
206    /// * [`cudaLimit::cudaLimitDevRuntimeSyncDepth`] 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a265dbf94c45903cd582cfc40f93a176a) 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 runtime to reserve large amounts of device memory which can no longer be used for user allocations. If these reservations of device memory fail, [`cudaDeviceSetLimit`] will return [`cudaError_t::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 will results in error [`cudaError_t::CUDA_ERROR_UNSUPPORTED_LIMIT`] being returned.
207    /// * [`cudaLimit::cudaLimitDevRuntimePendingLaunchCount`] controls the maximum number of outstanding device runtime launches that can be made from the current device. 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a2372902b9ffd65825d138e16125b1376) 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 runtime to reserve larger amounts of device memory upfront which can no longer be used for allocations. If these reservations fail, [`cudaDeviceSetLimit`] will return [`cudaError_t::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_t::CUDA_ERROR_UNSUPPORTED_LIMIT`] being returned.
208    /// * [`cudaLimit::cudaLimitMaxL2FetchGranularity`] 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.
209    /// * [`cudaLimit::cudaLimitPersistingL2CacheSize`] 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.
210    ///
211    /// Note that this function may also return error codes from previous, asynchronous launches.
212    ///
213    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
214    ///
215    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
216    ///
217    /// # Parameters
218    ///
219    /// - `limit`: Limit to set.
220    /// - `value`: Size of limit.
221    ///
222    /// # Return value
223    ///
224    /// - [`cudaError_t::CUDA_SUCCESS`]
225    /// - [`cudaError_t::CUDA_ERROR_UNSUPPORTED_LIMIT`]
226    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
227    /// - [`cudaError_t::CUDA_ERROR_OUT_OF_MEMORY`]
228    ///
229    /// See also: [`cudaDeviceGetLimit`], [`cuCtxSetLimit`](crate::driver::cuCtxSetLimit).
230    pub fn cudaDeviceSetLimit(limit: cudaLimit, value: size_t) -> cudaError_t;
231}
232singe_loader::functions! { crate::RUNTIME;
233    /// Return resource limits.
234    ///
235    /// Returns in `*pValue` the current size of `limit`. The following [`cudaLimit`] values are supported.
236    ///
237    /// * [`cudaLimit::cudaLimitStackSize`] is the stack size in bytes of each GPU thread.
238    /// * [`cudaLimit::cudaLimitPrintfFifoSize`] is the size in bytes of the shared FIFO used by the `printf()` device system call.
239    /// * [`cudaLimit::cudaLimitMallocHeapSize`] is the size in bytes of the heap used by the `malloc()` and `free()` device system calls.
240    /// * [`cudaLimit::cudaLimitDevRuntimeSyncDepth`] is the maximum grid depth at which a thread can isssue the device runtime call [`cudaDeviceSynchronize`] to wait on child grid launches to complete. This functionality is removed for devices of compute capability >= 9.0, and hence will return error [`cudaError_t::CUDA_ERROR_UNSUPPORTED_LIMIT`] on such devices.
241    /// * [`cudaLimit::cudaLimitDevRuntimePendingLaunchCount`] is the maximum number of outstanding device runtime launches.
242    /// * [`cudaLimit::cudaLimitMaxL2FetchGranularity`] is the L2 cache fetch granularity.
243    /// * [`cudaLimit::cudaLimitPersistingL2CacheSize`] is the persisting L2 cache size in bytes.
244    ///
245    /// Note that this function may also return error codes from previous, asynchronous launches.
246    ///
247    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
248    ///
249    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
250    ///
251    /// # Parameters
252    ///
253    /// - `pValue`: Returned size of the limit.
254    /// - `limit`: Limit to query.
255    ///
256    /// # Return value
257    ///
258    /// - [`cudaError_t::CUDA_SUCCESS`]
259    /// - [`cudaError_t::CUDA_ERROR_UNSUPPORTED_LIMIT`]
260    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
261    ///
262    /// See also: [`cudaDeviceSetLimit`], [`cuCtxGetLimit`](crate::driver::cuCtxGetLimit).
263    pub fn cudaDeviceGetLimit(pValue: *mut size_t, limit: cudaLimit) -> cudaError_t;
264}
265singe_loader::functions! { crate::RUNTIME;
266    /// Returns the maximum number of elements allocatable in a 1D linear texture for a given element size.
267    ///
268    /// Returns in `maxWidthInElements` the maximum number of elements allocatable in a 1D linear texture for given format descriptor `fmtDesc`.
269    ///
270    /// Note that this function may also return error codes from previous, asynchronous launches.
271    ///
272    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
273    ///
274    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
275    ///
276    /// # Parameters
277    ///
278    /// - `maxWidthInElements`: Returns maximum number of texture elements allocatable for given `fmtDesc`.
279    /// - `fmtDesc`: Texture format description.
280    ///
281    /// # Return value
282    ///
283    /// - [`cudaError_t::CUDA_SUCCESS`]
284    /// - [`cudaError_t::CUDA_ERROR_UNSUPPORTED_LIMIT`]
285    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
286    ///
287    /// See also: [`cuDeviceGetTexture1DLinearMaxWidth`](crate::driver::cuDeviceGetTexture1DLinearMaxWidth).
288    pub fn cudaDeviceGetTexture1DLinearMaxWidth(
289        maxWidthInElements: *mut size_t,
290        fmtDesc: *const cudaChannelFormatDesc,
291        device: ::core::ffi::c_int,
292    ) -> cudaError_t;
293}
294singe_loader::functions! { crate::RUNTIME;
295    /// Returns the preferred cache configuration for the current device.
296    ///
297    /// On devices where the L1 cache and shared memory use the same hardware resources, this returns through `pCacheConfig` the preferred cache configuration for the current device. This is only a preference. The runtime will use the requested configuration if possible, but it is free to choose a different configuration if required to execute functions.
298    ///
299    /// This will return a `pCacheConfig` of [`cudaFuncCache::CU_FUNC_CACHE_PREFER_NONE`] on devices where the size of the L1 cache and shared memory are fixed.
300    ///
301    /// The supported cache configurations are:
302    ///
303    /// * [`cudaFuncCache::CU_FUNC_CACHE_PREFER_NONE`]: no preference for shared memory or L1 (default)
304    /// * [`cudaFuncCache::CU_FUNC_CACHE_PREFER_SHARED`]: prefer larger shared memory and smaller L1 cache
305    /// * [`cudaFuncCache::CU_FUNC_CACHE_PREFER_L1`]: prefer larger L1 cache and smaller shared memory
306    /// * [`cudaFuncCache::CU_FUNC_CACHE_PREFER_EQUAL`]: prefer equal size L1 cache and shared memory.
307    ///
308    /// Note that this function may also return error codes from previous, asynchronous launches.
309    ///
310    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
311    ///
312    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
313    ///
314    /// # Parameters
315    ///
316    /// - `pCacheConfig`: Returned cache configuration
317    ///
318    /// # Return value
319    ///
320    /// - [`cudaError_t::CUDA_SUCCESS`]
321    ///
322    /// See also: [`cudaDeviceSetCacheConfig`], [`cudaFuncSetCacheConfig`] (C API), [cudaFuncSetCacheConfig (C++ API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1ga981c8d74d33b21e7fd57609b7337653e), [`cuCtxGetCacheConfig`](crate::driver::cuCtxGetCacheConfig).
323    pub fn cudaDeviceGetCacheConfig(pCacheConfig: *mut cudaFuncCache) -> cudaError_t;
324}
325singe_loader::functions! { crate::RUNTIME;
326    /// Returns numerical values that correspond to the least and greatest stream priorities.
327    ///
328    /// 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 [`cudaStreamCreateWithPriority`] for details on creating a priority stream. A NULL may be passed in for `*leastPriority` or `*greatestPriority` if the value is not desired.
329    ///
330    /// This function will return ‘0’ in both `*leastPriority` and `*greatestPriority` if the current context’s device does not support stream priorities (see [`cudaDeviceGetAttribute`]).
331    ///
332    /// Note that this function may also return error codes from previous, asynchronous launches.
333    ///
334    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
335    ///
336    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
337    ///
338    /// # Parameters
339    ///
340    /// - `leastPriority`: Pointer to an int in which the numerical value for least stream priority is returned.
341    /// - `greatestPriority`: Pointer to an int in which the numerical value for greatest stream priority is returned.
342    ///
343    /// # Return value
344    ///
345    /// - [`cudaError_t::CUDA_SUCCESS`]
346    ///
347    /// See also: [`cudaStreamCreateWithPriority`], [`cudaStreamGetPriority`], [`cuCtxGetStreamPriorityRange`](crate::driver::cuCtxGetStreamPriorityRange).
348    pub fn cudaDeviceGetStreamPriorityRange(
349        leastPriority: *mut ::core::ffi::c_int,
350        greatestPriority: *mut ::core::ffi::c_int,
351    ) -> cudaError_t;
352}
353singe_loader::functions! { crate::RUNTIME;
354    /// Sets the preferred cache configuration for the current device.
355    ///
356    /// On devices where the L1 cache and shared memory use the same hardware resources, this sets through `cacheConfig` the preferred cache configuration for the current device. This is only a preference. The runtime 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 [cudaFuncSetCacheConfig (C API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__EXECUTION.html#group__cudart__execution_1ga6699ca1943ac2655effa0d571b2f4f15) or [cudaFuncSetCacheConfig (C++ API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1ga981c8d74d33b21e7fd57609b7337653e) will be preferred over this device-wide setting. Setting the device-wide cache configuration to [`cudaFuncCache::CU_FUNC_CACHE_PREFER_NONE`] will cause subsequent kernel launches to prefer to not change the cache configuration unless required to launch the kernel.
357    ///
358    /// This setting does nothing on devices where the size of the L1 cache and shared memory are fixed.
359    ///
360    /// Launching a kernel with a different preference than the most recent preference setting may insert a device-side synchronization point.
361    ///
362    /// The supported cache configurations are:
363    ///
364    /// * [`cudaFuncCache::CU_FUNC_CACHE_PREFER_NONE`]: no preference for shared memory or L1 (default)
365    /// * [`cudaFuncCache::CU_FUNC_CACHE_PREFER_SHARED`]: prefer larger shared memory and smaller L1 cache
366    /// * [`cudaFuncCache::CU_FUNC_CACHE_PREFER_L1`]: prefer larger L1 cache and smaller shared memory
367    /// * [`cudaFuncCache::CU_FUNC_CACHE_PREFER_EQUAL`]: prefer equal size L1 cache and shared memory.
368    ///
369    /// Note that this function may also return error codes from previous, asynchronous launches.
370    ///
371    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
372    ///
373    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
374    ///
375    /// # Parameters
376    ///
377    /// - `cacheConfig`: Requested cache configuration
378    ///
379    /// # Return value
380    ///
381    /// - [`cudaError_t::CUDA_SUCCESS`]
382    ///
383    /// See also: [`cudaDeviceGetCacheConfig`], [`cudaFuncSetCacheConfig`] (C API), [cudaFuncSetCacheConfig (C++ API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1ga981c8d74d33b21e7fd57609b7337653e), [`cuCtxSetCacheConfig`](crate::driver::cuCtxSetCacheConfig).
384    pub fn cudaDeviceSetCacheConfig(cacheConfig: cudaFuncCache) -> cudaError_t;
385}
386singe_loader::functions! { crate::RUNTIME;
387    /// Returns a handle to a compute device.
388    ///
389    /// Returns in `*device` a device ordinal given a PCI bus ID string.
390    ///
391    /// where `domain`, `bus`, `device`, and `function` are all hexadecimal values.
392    ///
393    /// Note that this function may also return error codes from previous, asynchronous launches.
394    ///
395    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
396    ///
397    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
398    ///
399    /// # Parameters
400    ///
401    /// - `device`: Returned device ordinal.
402    /// - `pciBusId`: String in one of the following forms.
403    ///
404    /// # Return value
405    ///
406    /// - [`cudaError_t::CUDA_SUCCESS`]
407    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
408    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
409    ///
410    /// See also: [`cudaDeviceGetPCIBusId`], [`cuDeviceGetByPCIBusId`](crate::driver::cuDeviceGetByPCIBusId).
411    pub fn cudaDeviceGetByPCIBusId(
412        device: *mut ::core::ffi::c_int,
413        pciBusId: *const ::core::ffi::c_char,
414    ) -> cudaError_t;
415}
416singe_loader::functions! { crate::RUNTIME;
417    /// Returns a PCI Bus Id string for the device.
418    ///
419    /// 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.
420    ///
421    /// where `domain`, `bus`, `device`, and `function` are all hexadecimal values. pciBusId should be large enough to store 13 characters including the NULL-terminator.
422    ///
423    /// Note that this function may also return error codes from previous, asynchronous launches.
424    ///
425    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
426    ///
427    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
428    ///
429    /// # Parameters
430    ///
431    /// - `pciBusId`: Returned identifier string for the device in the following format.
432    /// - `len`: Maximum length of string to store in `name`.
433    /// - `device`: Device to get identifier string for.
434    ///
435    /// # Return value
436    ///
437    /// - [`cudaError_t::CUDA_SUCCESS`]
438    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
439    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
440    ///
441    /// See also: [`cudaDeviceGetByPCIBusId`], [`cuDeviceGetPCIBusId`](crate::driver::cuDeviceGetPCIBusId).
442    pub fn cudaDeviceGetPCIBusId(
443        pciBusId: *mut ::core::ffi::c_char,
444        len: ::core::ffi::c_int,
445        device: ::core::ffi::c_int,
446    ) -> cudaError_t;
447}
448singe_loader::functions! { crate::RUNTIME;
449    /// Gets an interprocess handle for a previously allocated event.
450    ///
451    /// Takes as input a previously allocated event. This event must have been created with the [cudaEventInterprocess](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga49ec9cd742f8a3f6fde4ee72a66326f6) and [cudaEventDisableTiming](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gaa5d3eff7c3623e2be533968d9cc1ee7e) flags set. This opaque handle may be copied into other processes and opened with [`cudaIpcOpenEventHandle`] to allow efficient hardware synchronization between GPU work in different processes.
452    ///
453    /// After the event has been been opened in the importing process, [`cudaEventRecord`], [`cudaEventSynchronize`], [`cudaStreamWaitEvent`] and [`cudaEventQuery`] may be used in either process. Performing operations on the imported event after the exported event has been freed with [`cudaEventDestroy`] will result in undefined behavior.
454    ///
455    /// 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 [`cudaDeviceGetAttribute`] with [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED`].
456    ///
457    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
458    ///
459    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
460    ///
461    /// # Parameters
462    ///
463    /// - `handle`: Pointer to a user allocated cudaIpcEventHandle in which to return the opaque event handle.
464    /// - `event`: Event allocated with [cudaEventInterprocess](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga49ec9cd742f8a3f6fde4ee72a66326f6) and [cudaEventDisableTiming](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gaa5d3eff7c3623e2be533968d9cc1ee7e) flags.
465    ///
466    /// # Return value
467    ///
468    /// - [`cudaError_t::CUDA_SUCCESS`]
469    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
470    /// - [`cudaError_t::CUDA_ERROR_OUT_OF_MEMORY`]
471    /// - [`cudaError_t::CUDA_ERROR_MAP_FAILED`]
472    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
473    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
474    ///
475    /// See also: [`cudaEventCreate`], [`cudaEventDestroy`], [`cudaEventSynchronize`], [`cudaEventQuery`], [`cudaStreamWaitEvent`], [`cudaIpcOpenEventHandle`], [`cudaIpcGetMemHandle`], [`cudaIpcOpenMemHandle`], [`cudaIpcCloseMemHandle`], [`cuIpcGetEventHandle`](crate::driver::cuIpcGetEventHandle).
476    pub fn cudaIpcGetEventHandle(
477        handle: *mut cudaIpcEventHandle_t,
478        event: cudaEvent_t,
479    ) -> cudaError_t;
480}
481singe_loader::functions! { crate::RUNTIME;
482    /// Opens an interprocess event handle for use in the current process.
483    ///
484    /// Opens an interprocess event handle exported from another process with [`cudaIpcGetEventHandle`]. This function returns a [`cudaEvent_t`] that behaves like a locally created event with the [cudaEventDisableTiming](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gaa5d3eff7c3623e2be533968d9cc1ee7e) flag specified. This event must be freed with [`cudaEventDestroy`].
485    ///
486    /// Performing operations on the imported event after the exported event has been freed with [`cudaEventDestroy`] will result in undefined behavior.
487    ///
488    /// 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 [`cudaDeviceGetAttribute`] with [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED`].
489    ///
490    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
491    ///
492    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
493    ///
494    /// # Parameters
495    ///
496    /// - `event`: Returns the imported event.
497    /// - `handle`: Interprocess handle to open.
498    ///
499    /// # Return value
500    ///
501    /// - [`cudaError_t::CUDA_SUCCESS`]
502    /// - [`cudaError_t::CUDA_ERROR_MAP_FAILED`]
503    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
504    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
505    /// - [`cudaError_t::CUDA_ERROR_INVALID_CONTEXT`]
506    ///
507    /// See also: [`cudaEventCreate`], [`cudaEventDestroy`], [`cudaEventSynchronize`], [`cudaEventQuery`], [`cudaStreamWaitEvent`], [`cudaIpcGetEventHandle`], [`cudaIpcGetMemHandle`], [`cudaIpcOpenMemHandle`], [`cudaIpcCloseMemHandle`], [`cuIpcOpenEventHandle`](crate::driver::cuIpcOpenEventHandle).
508    pub fn cudaIpcOpenEventHandle(
509        event: *mut cudaEvent_t,
510        handle: cudaIpcEventHandle_t,
511    ) -> cudaError_t;
512}
513singe_loader::functions! { crate::RUNTIME;
514    /// Gets an interprocess memory handle for an existing device memory allocation.
515    ///
516    /// Takes a pointer to the base of an existing device memory allocation created with [`cudaMalloc`] 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.
517    ///
518    /// If a region of memory is freed with [`cudaFree`] and a subsequent call to [`cudaMalloc`] returns memory with the same device address, [`cudaIpcGetMemHandle`] will return a unique handle for the new memory.
519    ///
520    /// 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 [`cudaDeviceGetAttribute`] with [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED`].
521    ///
522    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
523    ///
524    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
525    ///
526    /// # Parameters
527    ///
528    /// - `handle`: Pointer to user allocated `cudaIpcMemHandle` to return the handle in.
529    /// - `devPtr`: Base pointer to previously allocated device memory.
530    ///
531    /// # Return value
532    ///
533    /// - [`cudaError_t::CUDA_SUCCESS`]
534    /// - [`cudaError_t::CUDA_ERROR_OUT_OF_MEMORY`]
535    /// - [`cudaError_t::CUDA_ERROR_MAP_FAILED`]
536    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
537    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
538    ///
539    /// See also: [`cudaMalloc`], [`cudaFree`], [`cudaIpcGetEventHandle`], [`cudaIpcOpenEventHandle`], [`cudaIpcOpenMemHandle`], [`cudaIpcCloseMemHandle`], [`cuIpcGetMemHandle`](crate::driver::cuIpcGetMemHandle).
540    pub fn cudaIpcGetMemHandle(
541        handle: *mut cudaIpcMemHandle_t,
542        devPtr: *mut ::core::ffi::c_void,
543    ) -> cudaError_t;
544}
545singe_loader::functions! { crate::RUNTIME;
546    /// Opens an interprocess memory handle exported from another process and returns a device pointer usable in the local process.
547    ///
548    /// Maps memory exported from another process with [`cudaIpcGetMemHandle`] into the current device address space. For contexts on different devices [`cudaIpcOpenMemHandle`] can attempt to enable peer access between the devices as if the user called [`cudaDeviceEnablePeerAccess`]. This behavior is controlled by the [cudaIpcMemLazyEnablePeerAccess](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga60f28a5142ee7ae0336dfa83fd54e006) flag. [`cudaDeviceCanAccessPeer`] can determine if a mapping is possible.
549    ///
550    /// [`cudaIpcOpenMemHandle`] can open handles to devices that may not be visible in the process calling the API.
551    ///
552    /// Contexts that may open `cudaIpcMemHandles` are restricted in the following way. `cudaIpcMemHandles` from each device in a given process may only be opened by one context per device per other process.
553    ///
554    /// 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.
555    ///
556    /// Memory returned from [`cudaIpcOpenMemHandle`] must be freed with [`cudaIpcCloseMemHandle`].
557    ///
558    /// Calling [`cudaFree`] on an exported memory region before calling [`cudaIpcCloseMemHandle`] in the importing context will result in undefined behavior.
559    ///
560    /// 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 [`cudaDeviceGetAttribute`] with [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED`].
561    ///
562    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
563    ///
564    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
565    ///
566    /// Note: No guarantees are made about the address returned in `*devPtr`.
567    ///
568    /// In particular, multiple processes may not receive the same address for the same
569    ///
570    /// `handle`.
571    ///
572    /// # Parameters
573    ///
574    /// - `devPtr`: Returned device pointer.
575    /// - `handle`: cudaIpcMemHandle to open.
576    /// - `flags`: Flags for this operation. Must be specified as [cudaIpcMemLazyEnablePeerAccess](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga60f28a5142ee7ae0336dfa83fd54e006).
577    ///
578    /// # Return value
579    ///
580    /// - [`cudaError_t::CUDA_SUCCESS`]
581    /// - [`cudaError_t::CUDA_ERROR_MAP_FAILED`]
582    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
583    /// - [`cudaError_t::CUDA_ERROR_INVALID_CONTEXT`]
584    /// - [`cudaError_t::CUDA_ERROR_TOO_MANY_PEERS`]
585    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
586    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
587    ///
588    /// See also: [`cudaMalloc`], [`cudaFree`], [`cudaIpcGetEventHandle`], [`cudaIpcOpenEventHandle`], [`cudaIpcGetMemHandle`], [`cudaIpcCloseMemHandle`], [`cudaDeviceEnablePeerAccess`], [`cudaDeviceCanAccessPeer`], [`cuIpcOpenMemHandle`](crate::driver::cuIpcOpenMemHandle).
589    pub fn cudaIpcOpenMemHandle(
590        devPtr: *mut *mut ::core::ffi::c_void,
591        handle: cudaIpcMemHandle_t,
592        flags: ::core::ffi::c_uint,
593    ) -> cudaError_t;
594}
595singe_loader::functions! { crate::RUNTIME;
596    /// Attempts to close memory mapped with cudaIpcOpenMemHandle.
597    ///
598    /// Decrements the reference count of the memory returnd by [`cudaIpcOpenMemHandle`] 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.
599    ///
600    /// Any resources used to enable peer access will be freed if this is the last mapping using them.
601    ///
602    /// 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 [`cudaDeviceGetAttribute`] with [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED`].
603    ///
604    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
605    ///
606    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
607    ///
608    /// # Parameters
609    ///
610    /// - `devPtr`: Device pointer returned by [`cudaIpcOpenMemHandle`]
611    ///
612    /// # Return value
613    ///
614    /// - [`cudaError_t::CUDA_SUCCESS`]
615    /// - [`cudaError_t::CUDA_ERROR_MAP_FAILED`]
616    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
617    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
618    ///
619    /// See also: [`cudaMalloc`], [`cudaFree`], [`cudaIpcGetEventHandle`], [`cudaIpcOpenEventHandle`], [`cudaIpcGetMemHandle`], [`cudaIpcOpenMemHandle`], [`cuIpcCloseMemHandle`](crate::driver::cuIpcCloseMemHandle).
620    pub fn cudaIpcCloseMemHandle(devPtr: *mut ::core::ffi::c_void) -> cudaError_t;
621}
622singe_loader::functions! { crate::RUNTIME;
623    /// Blocks until remote writes are visible to the specified scope.
624    ///
625    /// Blocks until remote writes to the target context via mappings created through GPUDirect RDMA APIs, like nvidia_p2p_get_pages (see <https://docs.nvidia.com/cuda/gpudirect-rdma> for more information), are visible to the specified scope.
626    ///
627    /// If the scope equals or lies within the scope indicated by [`cudaDeviceAttr::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.
628    ///
629    /// Users may query support for this API via [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_FLUSH_WRITES_OPTIONS`].
630    ///
631    /// Note that this function may also return error codes from previous, asynchronous launches.
632    ///
633    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
634    ///
635    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
636    ///
637    /// # Parameters
638    ///
639    /// - `target`: The target of the operation, see cudaFlushGPUDirectRDMAWritesTarget.
640    /// - `scope`: The scope of the operation, see cudaFlushGPUDirectRDMAWritesScope.
641    ///
642    /// # Return value
643    ///
644    /// - [`cudaError_t::CUDA_SUCCESS`]
645    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
646    ///
647    /// See also: [`cuFlushGPUDirectRDMAWrites`](crate::driver::cuFlushGPUDirectRDMAWrites).
648    pub fn cudaDeviceFlushGPUDirectRDMAWrites(
649        target: cudaFlushGPUDirectRDMAWritesTarget,
650        scope: cudaFlushGPUDirectRDMAWritesScope,
651    ) -> cudaError_t;
652}
653singe_loader::functions! { crate::RUNTIME;
654    /// Registers a callback function to receive async notifications.
655    ///
656    /// Registers `callbackFunc` to receive async notifications.
657    ///
658    /// The `userData` parameter is passed to the callback function at async notification time. Likewise, `callback` is also passed to the callback function to distinguish between multiple registered callbacks.
659    ///
660    /// The callback function being registered should be designed to return quickly (~10ms). Any long running tasks should be queued for execution on an application thread.
661    ///
662    /// Callbacks may not call cudaDeviceRegisterAsyncNotification or cudaDeviceUnregisterAsyncNotification. Doing so will result in [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`]. Async notification callbacks execute in an undefined order and may be serialized.
663    ///
664    /// Returns in `*callback` a handle representing the registered callback instance.
665    ///
666    /// Note that this function may also return error codes from previous, asynchronous launches.
667    ///
668    /// # Parameters
669    ///
670    /// - `device`: The device on which to register the callback.
671    /// - `callbackFunc`: The function to register as a callback.
672    /// - `userData`: A generic pointer to user data. This is passed into the callback function.
673    /// - `callback`: A handle representing the registered callback instance.
674    ///
675    /// # Return value
676    ///
677    /// - [`cudaError_t::CUDA_SUCCESS`]
678    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
679    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
680    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
681    /// - [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`]
682    /// - [`cudaError_t::CUDA_ERROR_UNKNOWN`]
683    ///
684    /// See also: [`cudaDeviceUnregisterAsyncNotification`].
685    pub fn cudaDeviceRegisterAsyncNotification(
686        device: ::core::ffi::c_int,
687        callbackFunc: cudaAsyncCallback,
688        userData: *mut ::core::ffi::c_void,
689        callback: *mut cudaAsyncCallbackHandle_t,
690    ) -> cudaError_t;
691}
692singe_loader::functions! { crate::RUNTIME;
693    /// Unregisters an async notification callback.
694    ///
695    /// Unregisters `callback` so that the corresponding callback function will stop receiving async notifications.
696    ///
697    /// Note that this function may also return error codes from previous, asynchronous launches.
698    ///
699    /// # Parameters
700    ///
701    /// - `device`: The device from which to remove `callback`.
702    /// - `callback`: The callback instance to unregister from receiving async notifications.
703    ///
704    /// # Return value
705    ///
706    /// - [`cudaError_t::CUDA_SUCCESS`]
707    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
708    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
709    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
710    /// - [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`]
711    /// - [`cudaError_t::CUDA_ERROR_UNKNOWN`]
712    ///
713    /// See also: [`cudaDeviceRegisterAsyncNotification`].
714    pub fn cudaDeviceUnregisterAsyncNotification(
715        device: ::core::ffi::c_int,
716        callback: cudaAsyncCallbackHandle_t,
717    ) -> cudaError_t;
718}
719singe_loader::functions! { crate::RUNTIME;
720    /// Returns the shared memory configuration for the current device.
721    ///
722    /// This function will return in `pConfig` the current size of shared memory banks on the current device. On devices with configurable shared memory banks, [`cudaDeviceSetSharedMemConfig`] can be used to change this setting, so that all subsequent kernel launches will by default use the new bank size. When [`cudaDeviceGetSharedMemConfig`] is called on devices without configurable shared memory, it will return the fixed bank size of the hardware.
723    ///
724    /// The returned bank configurations can be either:
725    ///
726    /// * cudaSharedMemBankSizeFourByte - shared memory bank width is four bytes.
727    /// * cudaSharedMemBankSizeEightByte - shared memory bank width is eight bytes.
728    ///
729    /// Note that this function may also return error codes from previous, asynchronous launches.
730    ///
731    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
732    ///
733    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
734    ///
735    /// # Parameters
736    ///
737    /// - `pConfig`: Returned cache configuration
738    ///
739    /// # Return value
740    ///
741    /// - [`cudaError_t::CUDA_SUCCESS`]
742    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
743    ///
744    /// See also: [`cudaDeviceSetCacheConfig`], [`cudaDeviceGetCacheConfig`], [`cudaDeviceSetSharedMemConfig`], [`cudaFuncSetCacheConfig`], [`cuCtxGetSharedMemConfig`](crate::driver::cuCtxGetSharedMemConfig).
745    #[deprecated]
746    pub fn cudaDeviceGetSharedMemConfig(
747        pConfig: *mut cudaSharedMemConfig,
748    ) -> cudaError_t;
749}
750singe_loader::functions! { crate::RUNTIME;
751    /// Sets the shared memory configuration for the current device.
752    ///
753    /// On devices with configurable shared memory banks, this function will set the shared memory bank size which is used for all subsequent kernel launches. Any per-function setting of shared memory set via [`cudaFuncSetSharedMemConfig`] will override the device wide setting.
754    ///
755    /// Changing the shared memory configuration between launches may introduce a device side synchronization point.
756    ///
757    /// 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.
758    ///
759    /// This function will do nothing on devices with fixed shared memory bank size.
760    ///
761    /// The supported bank configurations are:
762    ///
763    /// * cudaSharedMemBankSizeDefault: set bank width the device default (currently, four bytes)
764    /// * cudaSharedMemBankSizeFourByte: set shared memory bank width to be four bytes natively.
765    /// * cudaSharedMemBankSizeEightByte: set shared memory bank width to be eight bytes natively.
766    ///
767    /// Note that this function may also return error codes from previous, asynchronous launches.
768    ///
769    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
770    ///
771    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
772    ///
773    /// # Parameters
774    ///
775    /// - `config`: Requested cache configuration
776    ///
777    /// # Return value
778    ///
779    /// - [`cudaError_t::CUDA_SUCCESS`]
780    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
781    ///
782    /// See also: [`cudaDeviceSetCacheConfig`], [`cudaDeviceGetCacheConfig`], [`cudaDeviceGetSharedMemConfig`], [`cudaFuncSetCacheConfig`], [`cuCtxSetSharedMemConfig`](crate::driver::cuCtxSetSharedMemConfig).
783    #[deprecated]
784    pub fn cudaDeviceSetSharedMemConfig(config: cudaSharedMemConfig) -> cudaError_t;
785}
786singe_loader::functions! { crate::RUNTIME;
787    /// Returns the last error from a runtime call.
788    ///
789    /// Returns the last error that has been produced by any of the runtime calls in the same instance of the CUDA Runtime library in the host thread and resets it to [`cudaError_t::CUDA_SUCCESS`].
790    ///
791    /// Note: Multiple instances of the CUDA Runtime library can be present in an application when using a library that statically links the CUDA Runtime.
792    ///
793    /// Note that this function may also return error codes from previous, asynchronous launches.
794    ///
795    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
796    ///
797    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
798    ///
799    /// # Return value
800    ///
801    /// - [`cudaError_t::CUDA_SUCCESS`]
802    /// - [`cudaErrorMissingConfiguration`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a7697c0ee1bf14e2545f1272ac03ee3a2)
803    /// - [`cudaError_t::CUDA_ERROR_OUT_OF_MEMORY`]
804    /// - [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`]
805    /// - [`cudaError_t::CUDA_ERROR_LAUNCH_FAILED`]
806    /// - [`cudaError_t::CUDA_ERROR_LAUNCH_TIMEOUT`]
807    /// - [`cudaError_t::CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES`]
808    /// - [`cudaErrorInvalidDeviceFunction`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ab6af535e7e53d3f21e2437e8977b8c2e)
809    /// - [`cudaErrorInvalidConfiguration`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ad3934977826b2e1488dfeb7e0614e776)
810    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
811    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
812    /// - [`cudaErrorInvalidPitchValue`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a225c65c0348cced651d5dd87ccc22f48)
813    /// - [`cudaErrorInvalidSymbol`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a01a4a97f3060ec714ffa9dd650b9213a)
814    /// - [`cudaError_t::CUDA_ERROR_UNMAP_FAILED`]
815    /// - [`cudaErrorInvalidDevicePointer`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a5fa2f00ab72ab5cf649a0a32351a20bf)
816    /// - [`cudaErrorInvalidTexture`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ae4312b7621ebad05ce494249474a7e11)
817    /// - [`cudaErrorInvalidTextureBinding`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a2e73e27da21d74d0de9eaa8bcd61b527)
818    /// - [`cudaErrorInvalidChannelDescriptor`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a5abd0c4b36ef85f853c51bc18c516e0b)
819    /// - [`cudaErrorInvalidMemcpyDirection`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a72ce39cee8ef48a83b0191b2e33d2630)
820    /// - [`cudaErrorInvalidFilterSetting`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038aa4dc8c42993939bd4d3b0399dce9236b)
821    /// - [`cudaErrorInvalidNormSetting`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a7a9f85073ed9240040e505cb48db68ef)
822    /// - [`cudaError_t::CUDA_ERROR_UNKNOWN`]
823    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
824    /// - [`cudaErrorInsufficientDriver`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067)
825    /// - [`cudaError_t::CUDA_ERROR_NO_DEVICE`]
826    /// - [`cudaError_t::CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE`]
827    /// - [`cudaErrorStartupFailure`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a1c7fe018f3f2d9ede149e96d7379c9c5)
828    /// - [`cudaError_t::CUDA_ERROR_INVALID_PTX`]
829    /// - [`cudaError_t::CUDA_ERROR_UNSUPPORTED_PTX_VERSION`]
830    /// - [`cudaError_t::CUDA_ERROR_NO_BINARY_FOR_GPU`]
831    /// - [`cudaError_t::CUDA_ERROR_JIT_COMPILER_NOT_FOUND`]
832    /// - [`cudaError_t::CUDA_ERROR_JIT_COMPILATION_DISABLED`]
833    ///
834    /// See also: [`cudaPeekAtLastError`], [`cudaGetErrorName`], [`cudaGetErrorString`], [`cudaError`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga3f51e3575c2178246db0a94a430e0038).
835    pub fn cudaGetLastError() -> cudaError_t;
836}
837singe_loader::functions! { crate::RUNTIME;
838    /// Returns the last error from a runtime call.
839    ///
840    /// Returns the last error that has been produced by any of the runtime calls in the same instance of the CUDA Runtime library in the host thread. This call does not reset the error to [`cudaError_t::CUDA_SUCCESS`] like [`cudaGetLastError`].
841    ///
842    /// Note: Multiple instances of the CUDA Runtime library can be present in an application when using a library that statically links the CUDA Runtime.
843    ///
844    /// Note that this function may also return error codes from previous, asynchronous launches.
845    ///
846    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
847    ///
848    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
849    ///
850    /// # Return value
851    ///
852    /// - [`cudaError_t::CUDA_SUCCESS`]
853    /// - [`cudaErrorMissingConfiguration`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a7697c0ee1bf14e2545f1272ac03ee3a2)
854    /// - [`cudaError_t::CUDA_ERROR_OUT_OF_MEMORY`]
855    /// - [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`]
856    /// - [`cudaError_t::CUDA_ERROR_LAUNCH_FAILED`]
857    /// - [`cudaError_t::CUDA_ERROR_LAUNCH_TIMEOUT`]
858    /// - [`cudaError_t::CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES`]
859    /// - [`cudaErrorInvalidDeviceFunction`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ab6af535e7e53d3f21e2437e8977b8c2e)
860    /// - [`cudaErrorInvalidConfiguration`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ad3934977826b2e1488dfeb7e0614e776)
861    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
862    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
863    /// - [`cudaErrorInvalidPitchValue`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a225c65c0348cced651d5dd87ccc22f48)
864    /// - [`cudaErrorInvalidSymbol`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a01a4a97f3060ec714ffa9dd650b9213a)
865    /// - [`cudaError_t::CUDA_ERROR_UNMAP_FAILED`]
866    /// - [`cudaErrorInvalidDevicePointer`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a5fa2f00ab72ab5cf649a0a32351a20bf)
867    /// - [`cudaErrorInvalidTexture`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ae4312b7621ebad05ce494249474a7e11)
868    /// - [`cudaErrorInvalidTextureBinding`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a2e73e27da21d74d0de9eaa8bcd61b527)
869    /// - [`cudaErrorInvalidChannelDescriptor`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a5abd0c4b36ef85f853c51bc18c516e0b)
870    /// - [`cudaErrorInvalidMemcpyDirection`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a72ce39cee8ef48a83b0191b2e33d2630)
871    /// - [`cudaErrorInvalidFilterSetting`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038aa4dc8c42993939bd4d3b0399dce9236b)
872    /// - [`cudaErrorInvalidNormSetting`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a7a9f85073ed9240040e505cb48db68ef)
873    /// - [`cudaError_t::CUDA_ERROR_UNKNOWN`]
874    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
875    /// - [`cudaErrorInsufficientDriver`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067)
876    /// - [`cudaError_t::CUDA_ERROR_NO_DEVICE`]
877    /// - [`cudaError_t::CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE`]
878    /// - [`cudaErrorStartupFailure`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a1c7fe018f3f2d9ede149e96d7379c9c5)
879    /// - [`cudaError_t::CUDA_ERROR_INVALID_PTX`]
880    /// - [`cudaError_t::CUDA_ERROR_UNSUPPORTED_PTX_VERSION`]
881    /// - [`cudaError_t::CUDA_ERROR_NO_BINARY_FOR_GPU`]
882    /// - [`cudaError_t::CUDA_ERROR_JIT_COMPILER_NOT_FOUND`]
883    /// - [`cudaError_t::CUDA_ERROR_JIT_COMPILATION_DISABLED`]
884    ///
885    /// See also: [`cudaGetLastError`], [`cudaGetErrorName`], [`cudaGetErrorString`], [`cudaError`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga3f51e3575c2178246db0a94a430e0038).
886    pub fn cudaPeekAtLastError() -> cudaError_t;
887}
888singe_loader::functions! { crate::RUNTIME;
889    /// Returns the string representation of an error code enum name.
890    ///
891    /// Returns a string containing the name of an error code in the enum. If the error code is not recognized, “unrecognized error code” is returned.
892    ///
893    /// # Parameters
894    ///
895    /// - `error`: Error code to convert to string
896    ///
897    /// # Return value
898    ///
899    /// `char*` pointer to a NULL-terminated string.
900    ///
901    /// See also: [`cudaGetErrorString`], [`cudaGetLastError`], [`cudaPeekAtLastError`], [`cudaError`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga3f51e3575c2178246db0a94a430e0038), [`cuGetErrorName`](crate::driver::cuGetErrorName).
902    pub fn cudaGetErrorName(error: cudaError_t) -> *const ::core::ffi::c_char;
903}
904singe_loader::functions! { crate::RUNTIME;
905    /// Returns the description string for an error code.
906    ///
907    /// Returns the description string for an error code. If the error code is not recognized, “unrecognized error code” is returned.
908    ///
909    /// # Parameters
910    ///
911    /// - `error`: Error code to convert to string
912    ///
913    /// # Return value
914    ///
915    /// `char*` pointer to a NULL-terminated string.
916    ///
917    /// See also: [`cudaGetErrorName`], [`cudaGetLastError`], [`cudaPeekAtLastError`], [`cudaError`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga3f51e3575c2178246db0a94a430e0038), [`cuGetErrorString`](crate::driver::cuGetErrorString).
918    pub fn cudaGetErrorString(error: cudaError_t) -> *const ::core::ffi::c_char;
919}
920singe_loader::functions! { crate::RUNTIME;
921    /// Returns the number of compute-capable devices.
922    ///
923    /// Returns in `*count` the number of devices with compute capability greater or equal to 2.0 that are available for execution.
924    ///
925    /// Note that this function may also return error codes from previous, asynchronous launches.
926    ///
927    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
928    ///
929    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
930    ///
931    /// # Parameters
932    ///
933    /// - `count`: Returns the number of devices with compute capability greater or equal to 2.0
934    ///
935    /// # Return value
936    ///
937    /// - [`cudaError_t::CUDA_SUCCESS`]
938    ///
939    /// See also: [`cudaGetDevice`], [`cudaSetDevice`], [`cudaGetDeviceProperties`], [`cudaChooseDevice`], [`cudaInitDevice`], [`cuDeviceGetCount`](crate::driver::cuDeviceGetCount).
940    pub fn cudaGetDeviceCount(count: *mut ::core::ffi::c_int) -> cudaError_t;
941}
942singe_loader::functions! { crate::RUNTIME;
943    /// Returns information about the compute-device.
944    ///
945    /// Returns in `*prop` the properties of device `dev`.
946    ///
947    /// Note that this function may also return error codes from previous, asynchronous launches.
948    ///
949    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
950    ///
951    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
952    ///
953    /// # Parameters
954    ///
955    /// - `prop`: Properties for the specified device.
956    /// - `device`: Device number to get properties for.
957    ///
958    /// # Return value
959    ///
960    /// - [`cudaError_t::CUDA_SUCCESS`]
961    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
962    ///
963    /// See also: [`cudaGetDeviceCount`], [`cudaGetDevice`], [`cudaSetDevice`], [`cudaChooseDevice`], [`cudaDeviceGetAttribute`], [`cudaInitDevice`], [`cuDeviceGetAttribute`](crate::driver::cuDeviceGetAttribute), [`cuDeviceGetName`](crate::driver::cuDeviceGetName).
964    pub fn cudaGetDeviceProperties(
965        prop: *mut cudaDeviceProp,
966        device: ::core::ffi::c_int,
967    ) -> cudaError_t;
968}
969singe_loader::functions! { crate::RUNTIME;
970    /// Returns information about the device.
971    ///
972    /// Returns in `*value` the integer value of the attribute `attr` on device `device`.
973    ///
974    /// Note that this function may also return error codes from previous, asynchronous launches.
975    ///
976    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
977    ///
978    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
979    ///
980    /// # Parameters
981    ///
982    /// - `value`: Returned device attribute value.
983    /// - `attr`: Device attribute to query.
984    /// - `device`: Device number to query.
985    ///
986    /// # Return value
987    ///
988    /// - [`cudaError_t::CUDA_SUCCESS`]
989    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
990    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
991    ///
992    /// See also: [`cudaGetDeviceCount`], [`cudaGetDevice`], [`cudaSetDevice`], [`cudaChooseDevice`], [`cudaGetDeviceProperties`], [`cudaInitDevice`], [`cuDeviceGetAttribute`](crate::driver::cuDeviceGetAttribute).
993    pub fn cudaDeviceGetAttribute(
994        value: *mut ::core::ffi::c_int,
995        attr: cudaDeviceAttr,
996        device: ::core::ffi::c_int,
997    ) -> cudaError_t;
998}
999singe_loader::functions! { crate::RUNTIME;
1000    /// Queries details about atomic operations supported between the device and host.
1001    ///
1002    /// 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`.
1003    ///
1004    /// For each [`cudaAtomicOperation`] in `*operations`, the corresponding result in `*capabilities` will be a bitmask indicating which of [cudaAtomicOperationCapability](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga3ded8497f09d41455ea64acb7a880868) the link supports natively.
1005    ///
1006    /// Returns [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`] if `dev` is not valid.
1007    ///
1008    /// Returns [`cudaError_t::CUDA_ERROR_INVALID_VALUE`] if `*capabilities` or `*operations` is NULL, if `count` is 0, or if any of `*operations` is not valid.
1009    ///
1010    /// Note that this function may also return error codes from previous, asynchronous launches.
1011    ///
1012    /// # Parameters
1013    ///
1014    /// - `capabilities`: Returned capability details of each requested operation.
1015    /// - `operations`: Requested operations.
1016    /// - `count`: Count of requested operations and size of capabilities.
1017    ///
1018    /// # Return value
1019    ///
1020    /// - [`cudaError_t::CUDA_SUCCESS`]
1021    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
1022    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
1023    ///
1024    /// See also: [`cudaDeviceGetAttribute`], [`cudaDeviceGetP2PAtomicCapabilities`], `cuDeviceGeHostAtomicCapabilities`.
1025    pub fn cudaDeviceGetHostAtomicCapabilities(
1026        capabilities: *mut ::core::ffi::c_uint,
1027        operations: *const cudaAtomicOperation,
1028        count: ::core::ffi::c_uint,
1029        device: ::core::ffi::c_int,
1030    ) -> cudaError_t;
1031}
1032singe_loader::functions! { crate::RUNTIME;
1033    /// Returns the default mempool of a device.
1034    ///
1035    /// The default mempool of a device contains device memory from that device.
1036    ///
1037    /// Note that this function may also return error codes from previous, asynchronous launches.
1038    ///
1039    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
1040    ///
1041    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
1042    ///
1043    /// # Return value
1044    ///
1045    /// - [`cudaError_t::CUDA_SUCCESS`]
1046    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
1047    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
1048    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
1049    ///
1050    /// See also: [`cuDeviceGetDefaultMemPool`](crate::driver::cuDeviceGetDefaultMemPool), [`cudaMallocAsync`], [`cudaMemPoolTrimTo`], [`cudaMemPoolGetAttribute`], [`cudaDeviceSetMemPool`], [`cudaMemPoolSetAttribute`], [`cudaMemPoolSetAccess`].
1051    pub fn cudaDeviceGetDefaultMemPool(
1052        memPool: *mut cudaMemPool_t,
1053        device: ::core::ffi::c_int,
1054    ) -> cudaError_t;
1055}
1056singe_loader::functions! { crate::RUNTIME;
1057    /// Sets the current memory pool of a device.
1058    ///
1059    /// The memory pool must be local to the specified device. Unless a mempool is specified in the [`cudaMallocAsync`] call, [`cudaMallocAsync`] allocates from the current mempool of the provided stream’s device. By default, a device’s current memory pool is its default memory pool.
1060    ///
1061    /// Note: Use [`cudaMallocFromPoolAsync`] to specify asynchronous allocations from a device different than the one the stream runs on.
1062    ///
1063    /// Note that this function may also return error codes from previous, asynchronous launches.
1064    ///
1065    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
1066    ///
1067    /// # Return value
1068    ///
1069    /// - [`cudaError_t::CUDA_SUCCESS`]
1070    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
1071    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
1072    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
1073    ///
1074    /// See also: [`cuDeviceSetMemPool`](crate::driver::cuDeviceSetMemPool), [`cudaDeviceGetMemPool`], [`cudaDeviceGetDefaultMemPool`], [`cudaMemPoolCreate`], [`cudaMemPoolDestroy`], [`cudaMallocFromPoolAsync`].
1075    pub fn cudaDeviceSetMemPool(
1076        device: ::core::ffi::c_int,
1077        memPool: cudaMemPool_t,
1078    ) -> cudaError_t;
1079}
1080singe_loader::functions! { crate::RUNTIME;
1081    /// Gets the current mempool for a device.
1082    ///
1083    /// Returns the last pool provided to [`cudaDeviceSetMemPool`] for this device or the device’s default memory pool if [`cudaDeviceSetMemPool`] 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`](crate::driver::cuDeviceSetMemPool) or [`cudaDeviceSetMemPool`].
1084    ///
1085    /// Note that this function may also return error codes from previous, asynchronous launches.
1086    ///
1087    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
1088    ///
1089    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
1090    ///
1091    /// # Return value
1092    ///
1093    /// - [`cudaError_t::CUDA_SUCCESS`]
1094    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
1095    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
1096    ///
1097    /// See also: [`cuDeviceGetMemPool`](crate::driver::cuDeviceGetMemPool), [`cudaDeviceGetDefaultMemPool`], [`cudaDeviceSetMemPool`].
1098    pub fn cudaDeviceGetMemPool(
1099        memPool: *mut cudaMemPool_t,
1100        device: ::core::ffi::c_int,
1101    ) -> cudaError_t;
1102}
1103singe_loader::functions! { crate::RUNTIME;
1104    /// Return NvSciSync attributes that this device can support.
1105    ///
1106    /// Returns in `nvSciSyncAttrList`, the properties of NvSciSync that this CUDA device, `dev` can support. The returned `nvSciSyncAttrList` can be used to create an NvSciSync that matches this device’s capabilities.
1107    ///
1108    /// If NvSciSyncAttrKey_RequiredPerm field in `nvSciSyncAttrList` is already set this API will return [`cudaError_t::CUDA_ERROR_INVALID_VALUE`].
1109    ///
1110    /// The applications should set `nvSciSyncAttrList` to a valid NvSciSyncAttrList failing which this API will return `cudaErrorInvalidHandle`.
1111    ///
1112    /// The `flags` controls how applications intends to use the NvSciSync created from the `nvSciSyncAttrList`. The valid flags are:
1113    ///
1114    /// * [cudaNvSciSyncAttrSignal](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga8157cb1b3c077ba222a56779a37d3bd1), specifies that the applications intends to signal an NvSciSync on this CUDA device.
1115    /// * [cudaNvSciSyncAttrWait](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga407f1fe03a9f560b23220faa306e70cf), specifies that the applications intends to wait on an NvSciSync on this CUDA device.
1116    ///
1117    /// At least one of these flags must be set, failing which the API returns [`cudaError_t::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`.
1118    ///
1119    /// Note that this API updates the input `nvSciSyncAttrList` with values equivalent to the following public attribute key-values: NvSciSyncAttrKey_RequiredPerm is set to
1120    ///
1121    /// * NvSciSyncAccessPerm_SignalOnly if [cudaNvSciSyncAttrSignal](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga8157cb1b3c077ba222a56779a37d3bd1) is set in `flags`.
1122    /// * NvSciSyncAccessPerm_WaitOnly if [cudaNvSciSyncAttrWait](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga407f1fe03a9f560b23220faa306e70cf) is set in `flags`.
1123    /// * NvSciSyncAccessPerm_WaitSignal if both [cudaNvSciSyncAttrWait](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga407f1fe03a9f560b23220faa306e70cf) and [cudaNvSciSyncAttrSignal](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga8157cb1b3c077ba222a56779a37d3bd1) are set in `flags`. NvSciSyncAttrKey_PrimitiveInfo is set to
1124    /// * NvSciSyncAttrValPrimitiveType_SysmemSemaphore on any valid `device`.
1125    /// * NvSciSyncAttrValPrimitiveType_Syncpoint if `device` is a Tegra device.
1126    /// * NvSciSyncAttrValPrimitiveType_SysmemSemaphorePayload64b if `device` is GA10X+. NvSciSyncAttrKey_GpuId is set to the same UUID that is returned in `cudaDeviceProp.uuid` from `cudaDeviceGetProperties` for this `device`.
1127    ///
1128    /// [`cudaError_t::CUDA_SUCCESS`], [`cudaError_t::CUDA_ERROR_INVALID_CONTEXT`], [`cudaError_t::CUDA_ERROR_INVALID_VALUE`], `cudaErrorInvalidHandle`, [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`], [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`], [`cudaError_t::CUDA_ERROR_OUT_OF_MEMORY`].
1129    ///
1130    /// # Parameters
1131    ///
1132    /// - `nvSciSyncAttrList`: Return NvSciSync attributes supported.
1133    /// - `device`: Valid CUDA Device to get NvSciSync attributes for.
1134    /// - `flags`: flags describing NvSciSync usage.
1135    ///
1136    /// See also: [`cudaImportExternalSemaphore`], [`cudaDestroyExternalSemaphore`], [`cudaSignalExternalSemaphoresAsync`], [`cudaWaitExternalSemaphoresAsync`].
1137    pub fn cudaDeviceGetNvSciSyncAttributes(
1138        nvSciSyncAttrList: *mut ::core::ffi::c_void,
1139        device: ::core::ffi::c_int,
1140        flags: ::core::ffi::c_int,
1141    ) -> cudaError_t;
1142}
1143singe_loader::functions! { crate::RUNTIME;
1144    /// Queries attributes of the link between two devices.
1145    ///
1146    /// Returns in `*value` the value of the requested attribute `attrib` of the link between `srcDevice` and `dstDevice`. The supported attributes are:
1147    ///
1148    /// * [`cudaDeviceP2PAttr::CU_DEVICE_P2P_ATTRIBUTE_PERFORMANCE_RANK`]: A relative value indicating the performance of the link between two devices. Lower value means better performance (0 being the value used for most performant link).
1149    /// * [`cudaDeviceP2PAttr::CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED`]: 1 if peer access is enabled.
1150    /// * [`cudaDeviceP2PAttr::CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED`]: 1 if all native atomic operations over the link are supported.
1151    /// * [`cudaDeviceP2PAttr::CU_DEVICE_P2P_ATTRIBUTE_ACCESS_ACCESS_SUPPORTED`]: 1 if accessing CUDA arrays over the link is supported.
1152    /// * [`cudaDeviceP2PAttr::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 [`cudaDeviceGetP2PAtomicCapabilities`].
1153    ///
1154    /// Returns [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`] if `srcDevice` or `dstDevice` are not valid or if they represent the same device.
1155    ///
1156    /// Returns [`cudaError_t::CUDA_ERROR_INVALID_VALUE`] if `attrib` is not valid or if `value` is a null pointer.
1157    ///
1158    /// Note that this function may also return error codes from previous, asynchronous launches.
1159    ///
1160    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
1161    ///
1162    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
1163    ///
1164    /// # Parameters
1165    ///
1166    /// - `value`: Returned value of the requested attribute.
1167    /// - `srcDevice`: The source device of the target link.
1168    /// - `dstDevice`: The destination device of the target link.
1169    ///
1170    /// # Return value
1171    ///
1172    /// - [`cudaError_t::CUDA_SUCCESS`]
1173    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
1174    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
1175    ///
1176    /// See also: [`cudaDeviceEnablePeerAccess`], [`cudaDeviceDisablePeerAccess`], [`cudaDeviceCanAccessPeer`], [`cuDeviceGetP2PAttribute`](crate::driver::cuDeviceGetP2PAttribute), [`cudaDeviceGetP2PAtomicCapabilities`].
1177    pub fn cudaDeviceGetP2PAttribute(
1178        value: *mut ::core::ffi::c_int,
1179        attr: cudaDeviceP2PAttr,
1180        srcDevice: ::core::ffi::c_int,
1181        dstDevice: ::core::ffi::c_int,
1182    ) -> cudaError_t;
1183}
1184singe_loader::functions! { crate::RUNTIME;
1185    /// Queries details about atomic operations supported between two devices.
1186    ///
1187    /// 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`.
1188    ///
1189    /// For each [`cudaAtomicOperation`] in `*operations`, the corresponding result in `*capabilities` will be a bitmask indicating which of [cudaAtomicOperationCapability](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga3ded8497f09d41455ea64acb7a880868) the link supports natively.
1190    ///
1191    /// Returns [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`] if `srcDevice` or `dstDevice` are not valid or if they represent the same device.
1192    ///
1193    /// Returns [`cudaError_t::CUDA_ERROR_INVALID_VALUE`] if `*capabilities` or `*operations` is NULL, if `count` is 0, or if any of `*operations` is not valid.
1194    ///
1195    /// Note that this function may also return error codes from previous, asynchronous launches.
1196    ///
1197    /// # Parameters
1198    ///
1199    /// - `capabilities`: Returned capability details of each requested operation.
1200    /// - `operations`: Requested operations.
1201    /// - `count`: Count of requested operations and size of capabilities.
1202    /// - `srcDevice`: The source device of the target link.
1203    /// - `dstDevice`: The destination device of the target link.
1204    ///
1205    /// # Return value
1206    ///
1207    /// - [`cudaError_t::CUDA_SUCCESS`]
1208    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
1209    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
1210    ///
1211    /// See also: [`cudaDeviceGetP2PAttribute`], [`cuDeviceGetP2PAttribute`](crate::driver::cuDeviceGetP2PAttribute), [`cuDeviceGetP2PAtomicCapabilities`](crate::driver::cuDeviceGetP2PAtomicCapabilities).
1212    pub fn cudaDeviceGetP2PAtomicCapabilities(
1213        capabilities: *mut ::core::ffi::c_uint,
1214        operations: *const cudaAtomicOperation,
1215        count: ::core::ffi::c_uint,
1216        srcDevice: ::core::ffi::c_int,
1217        dstDevice: ::core::ffi::c_int,
1218    ) -> cudaError_t;
1219}
1220singe_loader::functions! { crate::RUNTIME;
1221    /// Select compute-device which best matches criteria.
1222    ///
1223    /// Returns in `*device` the device which has properties that best match `*prop`.
1224    ///
1225    /// Note that this function may also return error codes from previous, asynchronous launches.
1226    ///
1227    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
1228    ///
1229    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
1230    ///
1231    /// # Parameters
1232    ///
1233    /// - `device`: Device with best match.
1234    /// - `prop`: Desired device properties.
1235    ///
1236    /// # Return value
1237    ///
1238    /// - [`cudaError_t::CUDA_SUCCESS`]
1239    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
1240    ///
1241    /// See also: [`cudaGetDeviceCount`], [`cudaGetDevice`], [`cudaSetDevice`], [`cudaGetDeviceProperties`], [`cudaInitDevice`].
1242    pub fn cudaChooseDevice(
1243        device: *mut ::core::ffi::c_int,
1244        prop: *const cudaDeviceProp,
1245    ) -> cudaError_t;
1246}
1247singe_loader::functions! { crate::RUNTIME;
1248    /// Initialize device to be used for GPU executions.
1249    ///
1250    /// This function will initialize the CUDA Runtime structures and primary context on `device` when called, but the context will not be made current to `device`.
1251    ///
1252    /// When [cudaInitDeviceFlagsAreValid](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga2ff861a477ec064dcf01977194158e49) is set in `flags`, deviceFlags are applied to the requested device. The values of deviceFlags match those of the flags parameters in [`cudaSetDeviceFlags`]. The effect may be verified by [`cudaGetDeviceFlags`].
1253    ///
1254    /// This function will return an error if the device is in [`cudaComputeMode::cudaComputeModeExclusiveProcess`] and is occupied by another process or if the device is in [`cudaComputeMode::cudaComputeModeProhibited`].
1255    ///
1256    /// Note that this function may also return error codes from previous, asynchronous launches.
1257    ///
1258    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
1259    ///
1260    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
1261    ///
1262    /// # Parameters
1263    ///
1264    /// - `device`: Device on which the runtime will initialize itself.
1265    /// - `deviceFlags`: Parameters for device operation.
1266    /// - `flags`: Flags for controlling the device initialization.
1267    ///
1268    /// # Return value
1269    ///
1270    /// - [`cudaError_t::CUDA_SUCCESS`]
1271    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
1272    ///
1273    /// See also: [`cudaGetDeviceCount`], [`cudaGetDevice`], [`cudaGetDeviceProperties`], [`cudaChooseDevice`], [`cudaSetDevice`], [`cuCtxSetCurrent`](crate::driver::cuCtxSetCurrent).
1274    pub fn cudaInitDevice(
1275        device: ::core::ffi::c_int,
1276        deviceFlags: ::core::ffi::c_uint,
1277        flags: ::core::ffi::c_uint,
1278    ) -> cudaError_t;
1279}
1280singe_loader::functions! { crate::RUNTIME;
1281    /// Set device to be used for GPU executions.
1282    ///
1283    /// Sets `device` as the current device for the calling host thread. Valid device id’s are 0 to ([`cudaGetDeviceCount`] - 1).
1284    ///
1285    /// Any device memory subsequently allocated from this host thread using [`cudaMalloc`], [`cudaMallocPitch`] or [`cudaMallocArray`] will be physically resident on `device`. Any host memory allocated from this host thread using [`cudaMallocHost`] or [`cudaHostAlloc`] or [`cudaHostRegister`] will have its lifetime associated with `device`. Any streams or events created from this host thread will be associated with `device`. Any kernels launched from this host thread using the &lt;&lt;&lt;>>> operator or [`cudaLaunchKernel`] will be executed on `device`.
1286    ///
1287    /// This call may be made from any host thread, to any device, and at any time. This function will do no synchronization with the previous or new device, and should only take significant time when it initializes the runtime’s context state. This call will bind the primary context of the specified device to the calling thread and all the subsequent memory allocations, stream and event creations, and kernel launches will be associated with the primary context. This function will also immediately initialize the runtime state on the primary context, and the context will be current on `device` immediately. This function will return an error if the device is in [`cudaComputeMode::cudaComputeModeExclusiveProcess`] and is occupied by another process or if the device is in [`cudaComputeMode::cudaComputeModeProhibited`].
1288    ///
1289    /// It is not required to call [`cudaInitDevice`] before using this function.
1290    ///
1291    /// Note that this function may also return error codes from previous, asynchronous launches.
1292    ///
1293    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
1294    ///
1295    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
1296    ///
1297    /// # Parameters
1298    ///
1299    /// - `device`: Device on which the active host thread should execute the device code.
1300    ///
1301    /// # Return value
1302    ///
1303    /// - [`cudaError_t::CUDA_SUCCESS`]
1304    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]: cudaErrorDeviceUnavailable.
1305    ///
1306    /// See also: [`cudaGetDeviceCount`], [`cudaGetDevice`], [`cudaGetDeviceProperties`], [`cudaChooseDevice`], [`cudaInitDevice`], [`cuCtxSetCurrent`](crate::driver::cuCtxSetCurrent).
1307    pub fn cudaSetDevice(device: ::core::ffi::c_int) -> cudaError_t;
1308}
1309singe_loader::functions! { crate::RUNTIME;
1310    /// Returns which device is currently being used.
1311    ///
1312    /// Returns in `*device` the current device for the calling host thread.
1313    ///
1314    /// Note that this function may also return error codes from previous, asynchronous launches.
1315    ///
1316    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
1317    ///
1318    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
1319    ///
1320    /// # Parameters
1321    ///
1322    /// - `device`: Returns the device on which the active host thread executes the device code.
1323    ///
1324    /// # Return value
1325    ///
1326    /// - [`cudaError_t::CUDA_SUCCESS`]
1327    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]: cudaErrorDeviceUnavailable.
1328    ///
1329    /// See also: [`cudaGetDeviceCount`], [`cudaSetDevice`], [`cudaGetDeviceProperties`], [`cudaChooseDevice`], [`cuCtxGetCurrent`](crate::driver::cuCtxGetCurrent).
1330    pub fn cudaGetDevice(device: *mut ::core::ffi::c_int) -> cudaError_t;
1331}
1332singe_loader::functions! { crate::RUNTIME;
1333    /// Set a list of devices that can be used for CUDA.
1334    ///
1335    /// Sets a list of devices for CUDA execution in priority order using `device_arr`. The parameter `len` specifies the number of elements in the list. CUDA will try devices from the list sequentially until it finds one that works. If this function is not called, or if it is called with a `len` of 0, then CUDA will go back to its default behavior of trying devices sequentially from a default list containing all of the available CUDA devices in the system. If a specified device ID in the list does not exist, this function will return [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]. If `len` is not 0 and `device_arr` is NULL or if `len` exceeds the number of devices in the system, then [`cudaError_t::CUDA_ERROR_INVALID_VALUE`] is returned.
1336    ///
1337    /// Note that this function may also return error codes from previous, asynchronous launches.
1338    ///
1339    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
1340    ///
1341    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
1342    ///
1343    /// # Parameters
1344    ///
1345    /// - `device_arr`: List of devices to try.
1346    /// - `len`: Number of devices in specified list.
1347    ///
1348    /// # Return value
1349    ///
1350    /// - [`cudaError_t::CUDA_SUCCESS`]
1351    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
1352    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
1353    ///
1354    /// See also: [`cudaGetDeviceCount`], [`cudaSetDevice`], [`cudaGetDeviceProperties`], [`cudaSetDeviceFlags`], [`cudaChooseDevice`].
1355    pub fn cudaSetValidDevices(
1356        device_arr: *mut ::core::ffi::c_int,
1357        len: ::core::ffi::c_int,
1358    ) -> cudaError_t;
1359}
1360singe_loader::functions! { crate::RUNTIME;
1361    /// Sets flags to be used for device executions.
1362    ///
1363    /// Records `flags` as the flags for the current device. If the current device has been set and that device has already been initialized, the previous flags are overwritten. If the current device has not been initialized, it is initialized with the provided flags. If no device has been made current to the calling thread, a default device is selected and initialized with the provided flags.
1364    ///
1365    /// The three LSBs of the `flags` parameter can be used to control how the CPU thread interacts with the OS scheduler when waiting for results from the device.
1366    ///
1367    /// * [cudaDeviceScheduleAuto](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga3ade1dbaf4b222b22733cdfdcc026075): 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 device, otherwise CUDA will not yield while waiting for results and actively spin on the processor. Additionally, on Tegra devices, [cudaDeviceScheduleAuto](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga3ade1dbaf4b222b22733cdfdcc026075) uses a heuristic based on the power profile of the platform and may choose [cudaDeviceScheduleBlockingSync](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga057e6912c52708b6aa86e79dd83d007c) for low-powered devices.
1368    /// * [cudaDeviceScheduleSpin](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gaf01347c3dafebf07e1a0b4321a030a63): Instruct CUDA to actively spin when waiting for results from the device. This can decrease latency when waiting for the device, but may lower the performance of CPU threads if they are performing work in parallel with the CUDA thread.
1369    /// * [cudaDeviceScheduleYield](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gabc13c52d342c67ebf0f1f7af937735a8): Instruct CUDA to yield its thread when waiting for results from the device. This can increase latency when waiting for the device, but can increase the performance of CPU threads performing work in parallel with the device.
1370    /// * [cudaDeviceScheduleBlockingSync](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga057e6912c52708b6aa86e79dd83d007c): Instruct CUDA to block the CPU thread on a synchronization primitive when waiting for the device to finish work.
1371    /// * [cudaDeviceBlockingSync](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga130ddae663f1873258fee5a6e0808b71): Instruct CUDA to block the CPU thread on a synchronization primitive when waiting for the device to finish work. [Deprecated:](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/deprecated.html#deprecated) This flag was deprecated as of CUDA 4.0 and replaced with [cudaDeviceScheduleBlockingSync](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga057e6912c52708b6aa86e79dd83d007c).
1372    /// * [cudaDeviceMapHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga3762be9cccdd809a4ca128354fd134b0): This flag enables allocating pinned host memory that is accessible to the device. It is implicit for the runtime but may be absent if a context is created using the driver API. If this flag is not set, [`cudaHostGetDevicePointer`] will always return a failure code.
1373    /// * [cudaDeviceLmemResizeToMax](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gada5f97298bf704dd3b04cbac4819e6e3): 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:](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/deprecated.html#deprecated) This flag is deprecated and the behavior enabled by this flag is now the default and cannot be disabled.
1374    /// * [cudaDeviceSyncMemops](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gab5cbd9be7931e6c68d11e1175aa14c23): 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.
1375    ///
1376    /// Note that this function may also return error codes from previous, asynchronous launches.
1377    ///
1378    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
1379    ///
1380    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
1381    ///
1382    /// # Parameters
1383    ///
1384    /// - `flags`: Parameters for device operation
1385    ///
1386    /// # Return value
1387    ///
1388    /// - [`cudaError_t::CUDA_SUCCESS`]
1389    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
1390    ///
1391    /// See also: [`cudaGetDeviceFlags`], [`cudaGetDeviceCount`], [`cudaGetDevice`], [`cudaGetDeviceProperties`], [`cudaSetDevice`], [`cudaSetValidDevices`], [`cudaInitDevice`], [`cudaChooseDevice`], [`cuDevicePrimaryCtxSetFlags`](crate::driver::cuDevicePrimaryCtxSetFlags).
1392    pub fn cudaSetDeviceFlags(flags: ::core::ffi::c_uint) -> cudaError_t;
1393}
1394singe_loader::functions! { crate::RUNTIME;
1395    /// Gets the flags for the current device.
1396    ///
1397    /// Returns in `flags` the flags for the current device. If there is a current device for the calling thread, the flags for the device are returned. If there is no current device, the flags for the first device are returned, which may be the default flags. Compare to the behavior of [`cudaSetDeviceFlags`].
1398    ///
1399    /// Typically, the flags returned should match the behavior that will be seen if the calling thread uses a device after this call, without any change to the flags or current device inbetween by this or another thread. Note that if the device is not initialized, it is possible for another thread to change the flags for the current device before it is initialized. Additionally, when using exclusive mode, if this thread has not requested a specific device, it may use a device other than the first device, contrary to the assumption made by this function.
1400    ///
1401    /// If a context has been created via the driver API and is current to the calling thread, the flags for that context are always returned.
1402    ///
1403    /// Flags returned by this function may specifically include [cudaDeviceMapHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga3762be9cccdd809a4ca128354fd134b0) even though it is not accepted by [`cudaSetDeviceFlags`] because it is implicit in runtime API flags. The reason for this is that the current context may have been created via the driver API in which case the flag is not implicit and may be unset.
1404    ///
1405    /// Note that this function may also return error codes from previous, asynchronous launches.
1406    ///
1407    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
1408    ///
1409    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
1410    ///
1411    /// # Parameters
1412    ///
1413    /// - `flags`: Pointer to store the device flags
1414    ///
1415    /// # Return value
1416    ///
1417    /// - [`cudaError_t::CUDA_SUCCESS`]
1418    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
1419    ///
1420    /// See also: [`cudaGetDevice`], [`cudaGetDeviceProperties`], [`cudaSetDevice`], [`cudaSetDeviceFlags`], [`cudaInitDevice`], [`cuCtxGetFlags`](crate::driver::cuCtxGetFlags), [`cuDevicePrimaryCtxGetState`](crate::driver::cuDevicePrimaryCtxGetState).
1421    pub fn cudaGetDeviceFlags(flags: *mut ::core::ffi::c_uint) -> cudaError_t;
1422}
1423singe_loader::functions! { crate::RUNTIME;
1424    /// Create an asynchronous stream.
1425    ///
1426    /// Creates a new asynchronous stream on the context that is current to the calling host thread. If no context is current to the calling host thread, then the primary context for a device is selected, made current to the calling thread, and initialized before creating a stream on it.
1427    ///
1428    /// Note that this function may also return error codes from previous, asynchronous launches.
1429    ///
1430    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
1431    ///
1432    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
1433    ///
1434    /// # Parameters
1435    ///
1436    /// - `pStream`: Pointer to new stream identifier
1437    ///
1438    /// # Return value
1439    ///
1440    /// - [`cudaError_t::CUDA_SUCCESS`]
1441    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
1442    /// - [`cudaError_t::CUDA_ERROR_EXTERNAL_DEVICE`]
1443    ///
1444    /// See also: [`cudaStreamCreateWithPriority`], [`cudaStreamCreateWithFlags`], [`cudaStreamGetPriority`], [`cudaStreamGetFlags`], [`cudaStreamGetDevice`], [`cudaStreamGetDevResource`], [`cudaStreamQuery`], [`cudaStreamSynchronize`], [`cudaStreamWaitEvent`], [`cudaStreamAddCallback`], [`cudaSetDevice`], [`cudaStreamDestroy`], [`cuStreamCreate`](crate::driver::cuStreamCreate).
1445    pub fn cudaStreamCreate(pStream: *mut cudaStream_t) -> cudaError_t;
1446}
1447singe_loader::functions! { crate::RUNTIME;
1448    /// Create an asynchronous stream.
1449    ///
1450    /// Creates a new asynchronous stream on the context that is current to the calling host thread. If no context is current to the calling host thread, then the primary context for a device is selected, made current to the calling thread, and initialized before creating a stream on it. The `flags` argument determines the behaviors of the stream. Valid values for `flags` are
1451    ///
1452    /// * [`cudaStreamDefault`]: Default stream creation flag.
1453    /// * [`cudaStreamNonBlocking`]: 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.
1454    ///
1455    /// Note that this function may also return error codes from previous, asynchronous launches.
1456    ///
1457    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
1458    ///
1459    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
1460    ///
1461    /// # Parameters
1462    ///
1463    /// - `pStream`: Pointer to new stream identifier.
1464    /// - `flags`: Parameters for stream creation.
1465    ///
1466    /// # Return value
1467    ///
1468    /// - [`cudaError_t::CUDA_SUCCESS`]
1469    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
1470    /// - [`cudaError_t::CUDA_ERROR_EXTERNAL_DEVICE`]
1471    ///
1472    /// See also: [`cudaStreamCreate`], [`cudaStreamCreateWithPriority`], [`cudaStreamGetFlags`], [`cudaStreamGetDevice`], [`cudaStreamGetDevResource`], [`cudaStreamQuery`], [`cudaStreamSynchronize`], [`cudaStreamWaitEvent`], [`cudaStreamAddCallback`], [`cudaSetDevice`], [`cudaStreamDestroy`], [`cuStreamCreate`](crate::driver::cuStreamCreate).
1473    pub fn cudaStreamCreateWithFlags(
1474        pStream: *mut cudaStream_t,
1475        flags: ::core::ffi::c_uint,
1476    ) -> cudaError_t;
1477}
1478singe_loader::functions! { crate::RUNTIME;
1479    /// Create an asynchronous stream with the specified priority.
1480    ///
1481    /// Creates a stream with the specified priority and returns a handle in `pStream`. The stream is created on the context that is current to the calling host thread. If no context is current to the calling host thread, then the primary context for a device is selected, made current to the calling thread, and initialized before creating a stream on it. 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.
1482    ///
1483    /// `priority` follows a convention where lower numbers represent higher priorities. ‘0’ represents default priority. The range of meaningful numerical priorities can be queried using [`cudaDeviceGetStreamPriorityRange`]. If the specified priority is outside the numerical range returned by [`cudaDeviceGetStreamPriorityRange`], it will automatically be clamped to the lowest or the highest number in the range.
1484    ///
1485    /// Note that this function may also return error codes from previous, asynchronous launches.
1486    ///
1487    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
1488    ///
1489    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
1490    ///
1491    /// Note: Stream priorities are supported only on GPUs with compute capability 3.5 or higher.
1492    ///
1493    /// 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.
1494    ///
1495    /// # Parameters
1496    ///
1497    /// - `pStream`: Pointer to new stream identifier.
1498    /// - `flags`: Flags for stream creation. See [`cudaStreamCreateWithFlags`] for a list of valid flags that can be passed.
1499    /// - `priority`: Priority of the stream. Lower numbers represent higher priorities. See [`cudaDeviceGetStreamPriorityRange`] for more information about the meaningful stream priorities that can be passed.
1500    ///
1501    /// # Return value
1502    ///
1503    /// - [`cudaError_t::CUDA_SUCCESS`]
1504    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
1505    /// - [`cudaError_t::CUDA_ERROR_EXTERNAL_DEVICE`]
1506    ///
1507    /// See also: [`cudaStreamCreate`], [`cudaStreamCreateWithFlags`], [`cudaDeviceGetStreamPriorityRange`], [`cudaStreamGetPriority`], [`cudaStreamQuery`], [`cudaStreamWaitEvent`], [`cudaStreamAddCallback`], [`cudaStreamSynchronize`], [`cudaSetDevice`], [`cudaStreamDestroy`], [`cuStreamCreateWithPriority`](crate::driver::cuStreamCreateWithPriority).
1508    pub fn cudaStreamCreateWithPriority(
1509        pStream: *mut cudaStream_t,
1510        flags: ::core::ffi::c_uint,
1511        priority: ::core::ffi::c_int,
1512    ) -> cudaError_t;
1513}
1514singe_loader::functions! { crate::RUNTIME;
1515    /// Query the priority of a stream.
1516    ///
1517    /// Query the priority of a stream. The priority is returned in in `priority`. Note that if the stream was created with a priority outside the meaningful numerical range returned by [`cudaDeviceGetStreamPriorityRange`], this function returns the clamped priority. See [`cudaStreamCreateWithPriority`] for details about priority clamping.
1518    ///
1519    /// Note that this function may also return error codes from previous, asynchronous launches.
1520    ///
1521    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
1522    ///
1523    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
1524    ///
1525    /// # Parameters
1526    ///
1527    /// - `hStream`: Handle to the stream to be queried.
1528    /// - `priority`: Pointer to a signed integer in which the stream’s priority is returned.
1529    ///
1530    /// # Return value
1531    ///
1532    /// - [`cudaError_t::CUDA_SUCCESS`]
1533    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
1534    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
1535    ///
1536    /// See also: [`cudaStreamCreateWithPriority`], [`cudaDeviceGetStreamPriorityRange`], [`cudaStreamGetFlags`], [`cudaStreamGetDevice`], [`cudaStreamGetDevResource`], [`cuStreamGetPriority`](crate::driver::cuStreamGetPriority).
1537    pub fn cudaStreamGetPriority(
1538        hStream: cudaStream_t,
1539        priority: *mut ::core::ffi::c_int,
1540    ) -> cudaError_t;
1541}
1542singe_loader::functions! { crate::RUNTIME;
1543    /// Query the flags of a stream.
1544    ///
1545    /// Query the flags of a stream. The flags are returned in `flags`. See [`cudaStreamCreateWithFlags`] for a list of valid flags.
1546    ///
1547    /// Note: This function uses standard default stream semantics.
1548    ///
1549    /// Note that this function may also return error codes from previous, asynchronous launches.
1550    ///
1551    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
1552    ///
1553    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
1554    ///
1555    /// # Parameters
1556    ///
1557    /// - `hStream`: Handle to the stream to be queried.
1558    /// - `flags`: Pointer to an unsigned integer in which the stream’s flags are returned.
1559    ///
1560    /// # Return value
1561    ///
1562    /// - [`cudaError_t::CUDA_SUCCESS`]
1563    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
1564    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
1565    ///
1566    /// See also: [`cudaStreamCreateWithPriority`], [`cudaStreamCreateWithFlags`], [`cudaStreamGetPriority`], [`cudaStreamGetDevice`], [`cuStreamGetFlags`](crate::driver::cuStreamGetFlags).
1567    pub fn cudaStreamGetFlags(
1568        hStream: cudaStream_t,
1569        flags: *mut ::core::ffi::c_uint,
1570    ) -> cudaError_t;
1571}
1572singe_loader::functions! { crate::RUNTIME;
1573    /// Query the Id of a stream.
1574    ///
1575    /// Query the Id of a stream. The Id is returned in `streamId`. The Id is unique for the life of the program.
1576    ///
1577    /// The stream handle `hStream` can refer to any of the following:
1578    ///
1579    /// * a stream created via any of the CUDA runtime APIs such as [`cudaStreamCreate`], [`cudaStreamCreateWithFlags`] and [`cudaStreamCreateWithPriority`], or their driver API equivalents such as [`cuStreamCreate`](crate::driver::cuStreamCreate) or [`cuStreamCreateWithPriority`](crate::driver::cuStreamCreateWithPriority). Passing an invalid handle will result in undefined behavior.
1580    /// * any of the special streams such as the NULL stream, [cudaStreamLegacy](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4e62d09dde16ba457b0a97f3a5262246) and [cudaStreamPerThread](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga7b7129befd6f52708309acafd1c46197) respectively. The driver API equivalents of these are also accepted which are NULL, `CU_STREAM_LEGACY` and `CU_STREAM_PER_THREAD`.
1581    ///
1582    /// Note: This function uses standard default stream semantics.
1583    ///
1584    /// Note that this function may also return error codes from previous, asynchronous launches.
1585    ///
1586    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
1587    ///
1588    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
1589    ///
1590    /// # Parameters
1591    ///
1592    /// - `hStream`: Handle to the stream to be queried.
1593    /// - `streamId`: Pointer to an unsigned long long in which the stream Id is returned.
1594    ///
1595    /// # Return value
1596    ///
1597    /// - [`cudaError_t::CUDA_SUCCESS`]
1598    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
1599    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
1600    ///
1601    /// See also: [`cudaStreamCreateWithPriority`], [`cudaStreamCreateWithFlags`], [`cudaStreamGetPriority`], [`cudaStreamGetFlags`], [`cuStreamGetId`](crate::driver::cuStreamGetId).
1602    pub fn cudaStreamGetId(
1603        hStream: cudaStream_t,
1604        streamId: *mut ::core::ffi::c_ulonglong,
1605    ) -> cudaError_t;
1606}
1607singe_loader::functions! { crate::RUNTIME;
1608    /// Query the device of a stream.
1609    ///
1610    /// Returns in `*device` the device of the stream.
1611    ///
1612    /// Note: This function uses standard default stream semantics.
1613    ///
1614    /// Note that this function may also return error codes from previous, asynchronous launches.
1615    ///
1616    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
1617    ///
1618    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
1619    ///
1620    /// # Parameters
1621    ///
1622    /// - `hStream`: Handle to the stream to be queried.
1623    /// - `device`: Returns the device to which the stream belongs.
1624    ///
1625    /// # Return value
1626    ///
1627    /// - [`cudaError_t::CUDA_SUCCESS`]
1628    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]: cudaErrorDeviceUnavailable.
1629    ///
1630    /// See also: [`cudaSetDevice`], [`cudaGetDevice`], [`cudaStreamCreate`], [`cudaStreamGetPriority`], [`cudaStreamGetFlags`], [`cuStreamGetId`](crate::driver::cuStreamGetId).
1631    pub fn cudaStreamGetDevice(
1632        hStream: cudaStream_t,
1633        device: *mut ::core::ffi::c_int,
1634    ) -> cudaError_t;
1635}
1636singe_loader::functions! { crate::RUNTIME;
1637    /// Resets all persisting lines in cache to normal status.
1638    ///
1639    /// Resets all persisting lines in cache to normal status. Takes effect on function return.
1640    ///
1641    /// Note that this function may also return error codes from previous, asynchronous launches.
1642    ///
1643    /// # Return value
1644    ///
1645    /// - [`cudaError_t::CUDA_SUCCESS`]
1646    ///
1647    /// See also: [`cudaAccessPolicyWindow`].
1648    pub fn cudaCtxResetPersistingL2Cache() -> cudaError_t;
1649}
1650singe_loader::functions! { crate::RUNTIME;
1651    /// Copies attributes from source stream to destination stream.
1652    ///
1653    /// Copies attributes from source stream `src` to destination stream `dst`. Both streams must have the same context.
1654    ///
1655    /// Note that this function may also return error codes from previous, asynchronous launches.
1656    ///
1657    /// # Parameters
1658    ///
1659    /// - `dst`: Destination stream.
1660    /// - `src`: Source stream For attributes see cudaStreamAttrID.
1661    ///
1662    /// # Return value
1663    ///
1664    /// - [`cudaError_t::CUDA_SUCCESS`]
1665    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
1666    ///
1667    /// See also: [`cudaAccessPolicyWindow`].
1668    pub fn cudaStreamCopyAttributes(dst: cudaStream_t, src: cudaStream_t) -> cudaError_t;
1669}
1670singe_loader::functions! { crate::RUNTIME;
1671    /// Queries stream attribute.
1672    ///
1673    /// Queries attribute `attr` from `hStream` and stores it in corresponding member of `value_out`.
1674    ///
1675    /// Note that this function may also return error codes from previous, asynchronous launches.
1676    ///
1677    /// # Return value
1678    ///
1679    /// - [`cudaError_t::CUDA_SUCCESS`]
1680    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
1681    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
1682    ///
1683    /// See also: [`cudaAccessPolicyWindow`].
1684    pub fn cudaStreamGetAttribute(
1685        hStream: cudaStream_t,
1686        attr: cudaLaunchAttributeID,
1687        value_out: *mut cudaLaunchAttributeValue,
1688    ) -> cudaError_t;
1689}
1690singe_loader::functions! { crate::RUNTIME;
1691    /// Sets stream attribute.
1692    ///
1693    /// 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.
1694    ///
1695    /// Note that this function may also return error codes from previous, asynchronous launches.
1696    ///
1697    /// # Return value
1698    ///
1699    /// - [`cudaError_t::CUDA_SUCCESS`]
1700    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
1701    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
1702    ///
1703    /// See also: [`cudaAccessPolicyWindow`].
1704    pub fn cudaStreamSetAttribute(
1705        hStream: cudaStream_t,
1706        attr: cudaLaunchAttributeID,
1707        value: *const cudaLaunchAttributeValue,
1708    ) -> cudaError_t;
1709}
1710singe_loader::functions! { crate::RUNTIME;
1711    /// Destroys and cleans up an asynchronous stream.
1712    ///
1713    /// Destroys and cleans up the asynchronous stream specified by `stream`.
1714    ///
1715    /// In case the device is still doing work in the stream `stream` when [`cudaStreamDestroy`] is called, the function will return immediately and the resources associated with `stream` will be released automatically once the device has completed all work in `stream`.
1716    ///
1717    /// Note: This function uses standard default stream semantics.
1718    ///
1719    /// Note that this function may also return error codes from previous, asynchronous launches.
1720    ///
1721    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
1722    ///
1723    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
1724    ///
1725    /// Note: Use of the handle after this call is undefined behavior.
1726    ///
1727    /// # Parameters
1728    ///
1729    /// - `stream`: Stream identifier
1730    ///
1731    /// # Return value
1732    ///
1733    /// - [`cudaError_t::CUDA_SUCCESS`]
1734    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
1735    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
1736    /// - [`cudaError_t::CUDA_ERROR_EXTERNAL_DEVICE`]
1737    ///
1738    /// See also: [`cudaStreamCreate`], [`cudaStreamCreateWithFlags`], [`cudaStreamQuery`], [`cudaStreamWaitEvent`], [`cudaStreamSynchronize`], [`cudaStreamAddCallback`], [`cuStreamDestroy`](crate::driver::cuStreamDestroy).
1739    pub fn cudaStreamDestroy(stream: cudaStream_t) -> cudaError_t;
1740}
1741singe_loader::functions! { crate::RUNTIME;
1742    /// Make a compute stream wait on an event.
1743    ///
1744    /// Makes all future work submitted to `stream` wait for all work captured in `event`. See [`cudaEventRecord`] for details on what is captured by an event. The synchronization will be performed efficiently on the device when applicable. `event` may be from a different device than `stream`.
1745    ///
1746    /// flags include:
1747    ///
1748    /// * [cudaEventWaitDefault](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gaf8f19058a7cc2c3994c8f71590b8747e): Default event creation flag.
1749    /// * [cudaEventWaitExternal](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga0c23426b7252eaa9cef695859991304e): Event is captured in the graph as an external event node when performing stream capture.
1750    ///
1751    /// Note: This function uses standard default stream semantics.
1752    ///
1753    /// Note that this function may also return error codes from previous, asynchronous launches.
1754    ///
1755    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
1756    ///
1757    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
1758    ///
1759    /// # Parameters
1760    ///
1761    /// - `stream`: Stream to wait.
1762    /// - `event`: Event to wait on.
1763    /// - `flags`: Parameters for the operation(See above).
1764    ///
1765    /// # Return value
1766    ///
1767    /// - [`cudaError_t::CUDA_SUCCESS`]
1768    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
1769    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
1770    ///
1771    /// See also: [`cudaStreamCreate`], [`cudaStreamCreateWithFlags`], [`cudaStreamQuery`], [`cudaStreamSynchronize`], [`cudaStreamAddCallback`], [`cudaStreamDestroy`], [`cuStreamWaitEvent`](crate::driver::cuStreamWaitEvent).
1772    pub fn cudaStreamWaitEvent(
1773        stream: cudaStream_t,
1774        event: cudaEvent_t,
1775        flags: ::core::ffi::c_uint,
1776    ) -> cudaError_t;
1777}
1778/// Type of stream callback functions.
1779///
1780/// The stream as passed to [`cudaStreamAddCallback`], may be NULL.
1781///
1782/// [`cudaError_t::CUDA_SUCCESS`] or any persistent error on the stream.
1783///
1784/// User parameter provided at registration.
1785pub type cudaStreamCallback_t = ::core::option::Option<
1786    unsafe extern "C" fn(
1787        stream: cudaStream_t,
1788        status: cudaError_t,
1789        userData: *mut ::core::ffi::c_void,
1790    ),
1791>;
1792singe_loader::functions! { crate::RUNTIME;
1793    /// Add a callback to a compute stream.
1794    ///
1795    /// Adds a callback to be called on the host after all currently enqueued items in the stream have completed. For each cudaStreamAddCallback call, a callback will be executed exactly once. The callback will block later work in the stream until it is finished.
1796    ///
1797    /// The callback may be passed [`cudaError_t::CUDA_SUCCESS`] or an error code. In the event of a device error, all subsequently executed callbacks will receive an appropriate [`cudaError_t`].
1798    ///
1799    /// Callbacks must not make any CUDA API calls. Attempting to use CUDA APIs may result in [`cudaError_t::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.
1800    ///
1801    /// For the purposes of Unified Memory, callback execution makes a number of guarantees:
1802    ///
1803    /// * 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.
1804    /// * 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.
1805    /// * Adding device work to any stream does not have the effect of making the stream active until all preceding callbacks have executed. Thus, for example, a callback might use global attached memory even if work has been added to another stream, if it has been properly ordered with an event.
1806    /// * 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.
1807    ///
1808    /// 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 [`cudaLaunchHostFunc`]. Additionally, this function is not supported with [`cudaStreamBeginCapture`] and [`cudaStreamEndCapture`], unlike [`cudaLaunchHostFunc`].
1809    ///
1810    /// Note: This function uses standard default stream semantics.
1811    ///
1812    /// Note that this function may also return error codes from previous, asynchronous launches.
1813    ///
1814    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
1815    ///
1816    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
1817    ///
1818    /// # Parameters
1819    ///
1820    /// - `stream`: Stream to add callback to.
1821    /// - `callback`: The function to call once preceding stream operations are complete.
1822    /// - `userData`: User specified data to be passed to the callback function.
1823    /// - `flags`: Reserved for future use, must be 0.
1824    ///
1825    /// # Return value
1826    ///
1827    /// - [`cudaError_t::CUDA_SUCCESS`]
1828    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
1829    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
1830    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
1831    ///
1832    /// See also: [`cudaStreamCreate`], [`cudaStreamCreateWithFlags`], [`cudaStreamQuery`], [`cudaStreamSynchronize`], [`cudaStreamWaitEvent`], [`cudaStreamDestroy`], [`cudaMallocManaged`], [`cudaStreamAttachMemAsync`], [`cudaLaunchHostFunc`], [`cuStreamAddCallback`](crate::driver::cuStreamAddCallback).
1833    pub fn cudaStreamAddCallback(
1834        stream: cudaStream_t,
1835        callback: cudaStreamCallback_t,
1836        userData: *mut ::core::ffi::c_void,
1837        flags: ::core::ffi::c_uint,
1838    ) -> cudaError_t;
1839}
1840singe_loader::functions! { crate::RUNTIME;
1841    /// Waits for stream tasks to complete.
1842    ///
1843    /// Blocks until `stream` has completed all operations. If the [cudaDeviceScheduleBlockingSync](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga057e6912c52708b6aa86e79dd83d007c) flag was set for this device, the host thread will block until the stream is finished with all of its tasks.
1844    ///
1845    /// Note: This function uses standard default stream semantics.
1846    ///
1847    /// Note that this function may also return error codes from previous, asynchronous launches.
1848    ///
1849    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
1850    ///
1851    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
1852    ///
1853    /// # Parameters
1854    ///
1855    /// - `stream`: Stream identifier
1856    ///
1857    /// # Return value
1858    ///
1859    /// - [`cudaError_t::CUDA_SUCCESS`]
1860    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
1861    ///
1862    /// See also: [`cudaStreamCreate`], [`cudaStreamCreateWithFlags`], [`cudaStreamQuery`], [`cudaStreamWaitEvent`], [`cudaStreamAddCallback`], [`cudaStreamDestroy`], [`cuStreamSynchronize`](crate::driver::cuStreamSynchronize).
1863    pub fn cudaStreamSynchronize(stream: cudaStream_t) -> cudaError_t;
1864}
1865singe_loader::functions! { crate::RUNTIME;
1866    /// Queries an asynchronous stream for completion status.
1867    ///
1868    /// Returns [`cudaError_t::CUDA_SUCCESS`] if all operations in `stream` have completed, or [`cudaError_t::CUDA_ERROR_NOT_READY`] if not.
1869    ///
1870    /// For the purposes of Unified Memory, a return value of [`cudaError_t::CUDA_SUCCESS`] is equivalent to having called [`cudaStreamSynchronize`].
1871    ///
1872    /// Note: This function uses standard default stream semantics.
1873    ///
1874    /// Note that this function may also return error codes from previous, asynchronous launches.
1875    ///
1876    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
1877    ///
1878    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
1879    ///
1880    /// # Parameters
1881    ///
1882    /// - `stream`: Stream identifier
1883    ///
1884    /// # Return value
1885    ///
1886    /// - [`cudaError_t::CUDA_SUCCESS`]
1887    /// - [`cudaError_t::CUDA_ERROR_NOT_READY`]
1888    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
1889    ///
1890    /// See also: [`cudaStreamCreate`], [`cudaStreamCreateWithFlags`], [`cudaStreamWaitEvent`], [`cudaStreamSynchronize`], [`cudaStreamAddCallback`], [`cudaStreamDestroy`], [`cuStreamQuery`](crate::driver::cuStreamQuery).
1891    pub fn cudaStreamQuery(stream: cudaStream_t) -> cudaError_t;
1892}
1893singe_loader::functions! { crate::RUNTIME;
1894    /// Attach memory to a stream asynchronously.
1895    ///
1896    /// Enqueues an operation in `stream` to specify stream association of `length` bytes of memory starting from `devPtr`. 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.
1897    ///
1898    /// `devPtr` must point to an one of the following types of memories:
1899    ///
1900    /// * managed memory declared using the **managed** keyword or allocated with [`cudaMallocManaged`].
1901    /// * 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 [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`].
1902    ///
1903    /// 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.
1904    ///
1905    /// For pageable allocations, `length` must be non-zero.
1906    ///
1907    /// The stream association is specified using `flags` which must be one of [cudaMemAttachGlobal](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4808e47eba73eb94622ec70a9f9b91ff), [cudaMemAttachHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4f9a428d18fdd89a99441d0dd27131c0) or [cudaMemAttachSingle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gadc191442d08fc3a9de4cf055edfd2dbe). The default value for `flags` is [cudaMemAttachSingle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gadc191442d08fc3a9de4cf055edfd2dbe) If the [cudaMemAttachGlobal](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4808e47eba73eb94622ec70a9f9b91ff) flag is specified, the memory can be accessed by any stream on any device. If the [cudaMemAttachHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4f9a428d18fdd89a99441d0dd27131c0) 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 [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`]. If the [cudaMemAttachSingle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gadc191442d08fc3a9de4cf055edfd2dbe) flag is specified and `stream` is associated with a device that has a zero value for the device attribute [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`], the program makes a guarantee that it will only access the memory on the device from `stream`. 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.
1908    ///
1909    /// 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 `stream` 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.
1910    ///
1911    /// 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.
1912    ///
1913    /// It is a program’s responsibility to order calls to [`cudaStreamAttachMemAsync`] 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.
1914    ///
1915    /// If `stream` 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 [`cudaMallocManaged`]. For **managed** variables, the default association is always [cudaMemAttachGlobal](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4808e47eba73eb94622ec70a9f9b91ff). 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.
1916    ///
1917    /// Note that this function may also return error codes from previous, asynchronous launches.
1918    ///
1919    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
1920    ///
1921    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
1922    ///
1923    /// # Parameters
1924    ///
1925    /// - `stream`: Stream in which to enqueue the attach operation.
1926    /// - `devPtr`: Pointer to memory (must be a pointer to managed memory or to a valid host-accessible region of system-allocated memory).
1927    /// - `length`: Length of memory (defaults to zero).
1928    /// - `flags`: Must be one of [cudaMemAttachGlobal](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4808e47eba73eb94622ec70a9f9b91ff), [cudaMemAttachHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4f9a428d18fdd89a99441d0dd27131c0) or [cudaMemAttachSingle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gadc191442d08fc3a9de4cf055edfd2dbe) (defaults to [cudaMemAttachSingle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gadc191442d08fc3a9de4cf055edfd2dbe)).
1929    ///
1930    /// # Return value
1931    ///
1932    /// - [`cudaError_t::CUDA_SUCCESS`]
1933    /// - [`cudaError_t::CUDA_ERROR_NOT_READY`]
1934    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
1935    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
1936    ///
1937    /// See also: [`cudaStreamCreate`], [`cudaStreamCreateWithFlags`], [`cudaStreamWaitEvent`], [`cudaStreamSynchronize`], [`cudaStreamAddCallback`], [`cudaStreamDestroy`], [`cudaMallocManaged`], [`cuStreamAttachMemAsync`](crate::driver::cuStreamAttachMemAsync).
1938    pub fn cudaStreamAttachMemAsync(
1939        stream: cudaStream_t,
1940        devPtr: *mut ::core::ffi::c_void,
1941        length: size_t,
1942        flags: ::core::ffi::c_uint,
1943    ) -> cudaError_t;
1944}
1945singe_loader::functions! { crate::RUNTIME;
1946    /// Begins graph capture on a stream.
1947    ///
1948    /// Begin graph capture on `stream`. 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 [`cudaStreamEndCapture`]. Capture may not be initiated if `stream` is [cudaStreamLegacy](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4e62d09dde16ba457b0a97f3a5262246). 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 [`cudaStreamIsCapturing`]. A unique id representing the capture sequence may be queried via [`cudaStreamGetCaptureInfo`].
1949    ///
1950    /// If `mode` is not cudaStreamCaptureModeRelaxed, [`cudaStreamEndCapture`] must be called on this stream from the same thread.
1951    ///
1952    /// 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.
1953    ///
1954    /// Note that this function may also return error codes from previous, asynchronous launches.
1955    ///
1956    /// # Parameters
1957    ///
1958    /// - `stream`: Stream in which to initiate capture.
1959    /// - `mode`: Controls the interaction of this capture sequence with other API calls that are potentially unsafe. For more details see [`cudaThreadExchangeStreamCaptureMode`].
1960    ///
1961    /// # Return value
1962    ///
1963    /// - [`cudaError_t::CUDA_SUCCESS`]
1964    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
1965    ///
1966    /// See also: [`cudaStreamCreate`], [`cudaStreamIsCapturing`], [`cudaStreamEndCapture`], [`cudaThreadExchangeStreamCaptureMode`].
1967    pub fn cudaStreamBeginCapture(
1968        stream: cudaStream_t,
1969        mode: cudaStreamCaptureMode,
1970    ) -> cudaError_t;
1971}
1972/// Callback function invoked when node parameter mismatches are detected while recapturing to an existing graph. Parameter struct pointers are only valid within the callback.
1973///
1974/// User parameter provided at beginning of recapture
1975///
1976/// Graph node with the parameter mismatch
1977///
1978/// The original node parameters from the graph
1979///
1980/// The node parameters received during the recapture
1981///
1982/// status Status code for the recapture of the node
1983pub type cudaGraphRecaptureCallback_t = ::core::option::Option<
1984    unsafe extern "C" fn(
1985        data: *mut ::core::ffi::c_void,
1986        node: cudaGraphNode_t,
1987        originalParams: *const cudaGraphNodeParams,
1988        recaptureParams: *const cudaGraphNodeParams,
1989        status: cudaGraphRecaptureStatus,
1990    ) -> cudaError_t,
1991>;
1992/// Struct of user callback data that is invoked when node parameter mismatches are detected while recapturing to an existing graph.
1993#[repr(C)]
1994#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
1995pub struct cudaGraphRecaptureCallbackData {
1996    /// Callback function that will be invoked.
1997    pub callbackFunc: cudaGraphRecaptureCallback_t,
1998    /// Generic pointer that is passed to the callback function.
1999    pub userData: *mut ::core::ffi::c_void,
2000}
2001impl Default for cudaGraphRecaptureCallbackData {
2002    fn default() -> Self {
2003        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
2004        unsafe {
2005            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
2006            s.assume_init()
2007        }
2008    }
2009}
2010singe_loader::functions! { crate::RUNTIME;
2011    /// Begin graph capture on a stream to an existing graph.
2012    ///
2013    /// Begin graph capture on `stream` to the existing `graph`. The node creation order while recapturing the graph must be identical to the original graph. The recapture will fail immediately for:
2014    ///
2015    /// * Topology mismatches between the existing graph and the recaptured graph
2016    /// * Parameter mismatches for memory allocation or free nodes
2017    ///
2018    /// 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 cudaSuccess.
2019    ///
2020    /// If the recapture fails for any reason, the `graph` will be in an undefined state and should be destroyed.
2021    ///
2022    /// See cudaStreamBeginCapture for additional detail on beginning the capture.
2023    ///
2024    /// Note: Any user objects associated with `graph` will be released prior to the recapture.
2025    ///
2026    /// Note that this function may also return error codes from previous, asynchronous launches.
2027    ///
2028    /// # Parameters
2029    ///
2030    /// - `stream`: Stream in which to initiate capture.
2031    /// - `mode`: Controls the interaction of this capture sequence with other API calls that are potentially unsafe. For more details see [`cudaThreadExchangeStreamCaptureMode`].
2032    /// - `graph`: Existing CUDA graph to be captured into.
2033    /// - `callbackData`: Optional struct of callback data that will be invoked for all parameter mismatches from the original graph.
2034    ///
2035    /// # Return value
2036    ///
2037    /// - [`cudaError_t::CUDA_SUCCESS`]: cudaErrorDeinitialized, `cudaErrorNotInitialized`.
2038    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
2039    ///
2040    /// See also: [`cudaStreamCreate`], [`cudaStreamBeginCapture`], [`cudaStreamIsCapturing`], [`cudaStreamEndCapture`], [`cudaThreadExchangeStreamCaptureMode`].
2041    pub fn cudaStreamBeginRecaptureToGraph(
2042        stream: cudaStream_t,
2043        mode: cudaStreamCaptureMode,
2044        graph: cudaGraph_t,
2045        callbackData: *mut cudaGraphRecaptureCallbackData,
2046    ) -> cudaError_t;
2047}
2048singe_loader::functions! { crate::RUNTIME;
2049    /// Begins graph capture on a stream to an existing graph.
2050    ///
2051    /// Begin graph capture on `stream`. When a stream is in capture mode, all operations pushed into the stream will not be executed, but will instead be captured into `graph`, which will be returned via [`cudaStreamEndCapture`].
2052    ///
2053    /// Capture may not be initiated if `stream` is [cudaStreamLegacy](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4e62d09dde16ba457b0a97f3a5262246). 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 [`cudaStreamIsCapturing`]. A unique id representing the capture sequence may be queried via [`cudaStreamGetCaptureInfo`].
2054    ///
2055    /// If `mode` is not cudaStreamCaptureModeRelaxed, [`cudaStreamEndCapture`] must be called on this stream from the same thread.
2056    ///
2057    /// 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.
2058    ///
2059    /// Note that this function may also return error codes from previous, asynchronous launches.
2060    ///
2061    /// # Parameters
2062    ///
2063    /// - `stream`: Stream in which to initiate capture.
2064    /// - `graph`: Graph to capture into.
2065    /// - `dependencies`: Dependencies of the first node captured in the stream. Can be NULL if numDependencies is 0.
2066    /// - `dependencyData`: Optional array of data associated with each dependency.
2067    /// - `numDependencies`: Number of dependencies.
2068    /// - `mode`: Controls the interaction of this capture sequence with other API calls that are potentially unsafe. For more details see [`cudaThreadExchangeStreamCaptureMode`].
2069    ///
2070    /// # Return value
2071    ///
2072    /// - [`cudaError_t::CUDA_SUCCESS`]
2073    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
2074    ///
2075    /// See also: [`cudaStreamCreate`], [`cudaStreamIsCapturing`], [`cudaStreamEndCapture`], [`cudaThreadExchangeStreamCaptureMode`].
2076    pub fn cudaStreamBeginCaptureToGraph(
2077        stream: cudaStream_t,
2078        graph: cudaGraph_t,
2079        dependencies: *const cudaGraphNode_t,
2080        dependencyData: *const cudaGraphEdgeData,
2081        numDependencies: size_t,
2082        mode: cudaStreamCaptureMode,
2083    ) -> cudaError_t;
2084}
2085singe_loader::functions! { crate::RUNTIME;
2086    /// Swaps the stream capture interaction mode for a thread.
2087    ///
2088    /// 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:
2089    ///
2090    /// ```text
2091    /// cudaStreamCaptureMode mode = desiredMode;
2092    /// cudaThreadExchangeStreamCaptureMode(&mode);
2093    /// ...
2094    /// cudaThreadExchangeStreamCaptureMode(&mode); // restore previous mode
2095    /// ```
2096    ///
2097    /// During stream capture (see [`cudaStreamBeginCapture`]), 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 [`cudaStreamBeginCapture`] depended on the allocation being replayed whenever the graph is launched, the captured graph would be invalid.
2098    ///
2099    /// Therefore, stream capture places restrictions on API calls that can be made within or concurrently to a [`cudaStreamBeginCapture`]-[`cudaStreamEndCapture`] sequence. This behavior can be controlled via this API and flags to [`cudaStreamBeginCapture`].
2100    ///
2101    /// A thread’s mode is one of the following:
2102    ///
2103    /// * `cudaStreamCaptureModeGlobal:` This is the default mode. If the local thread has an ongoing capture sequence that was not initiated with [`cudaStreamCaptureMode::CU_STREAM_CAPTURE_MODE_RELAXED`] at [`cuStreamBeginCapture`](crate::driver::cuStreamBeginCapture), or if any other thread has a concurrent capture sequence initiated with [`cudaStreamCaptureMode::CU_STREAM_CAPTURE_MODE_GLOBAL`], this thread is prohibited from potentially unsafe API calls.
2104    /// * `cudaStreamCaptureModeThreadLocal:` If the local thread has an ongoing capture sequence not initiated with [`cudaStreamCaptureMode::CU_STREAM_CAPTURE_MODE_RELAXED`], it is prohibited from potentially unsafe API calls. Concurrent capture sequences in other threads are ignored.
2105    /// * `cudaStreamCaptureModeRelaxed:` 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 [`cudaEventQuery`] on an event that was last recorded inside a capture sequence.
2106    ///
2107    /// Note that this function may also return error codes from previous, asynchronous launches.
2108    ///
2109    /// # Parameters
2110    ///
2111    /// - `mode`: Pointer to mode value to swap with the current mode
2112    ///
2113    /// # Return value
2114    ///
2115    /// - [`cudaError_t::CUDA_SUCCESS`]
2116    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
2117    ///
2118    /// See also: [`cudaStreamBeginCapture`].
2119    pub fn cudaThreadExchangeStreamCaptureMode(
2120        mode: *mut cudaStreamCaptureMode,
2121    ) -> cudaError_t;
2122}
2123singe_loader::functions! { crate::RUNTIME;
2124    /// Ends capture on a stream, returning the captured graph.
2125    ///
2126    /// End capture on `stream`, returning the captured graph via `pGraph`. Capture must have been initiated on `stream` via a call to [`cudaStreamBeginCapture`]. If capture was invalidated, due to a violation of the rules of stream capture, then a NULL graph will be returned.
2127    ///
2128    /// If the `mode` argument to [`cudaStreamBeginCapture`] was not cudaStreamCaptureModeRelaxed, this call must be from the same thread as [`cudaStreamBeginCapture`].
2129    ///
2130    /// Note that this function may also return error codes from previous, asynchronous launches.
2131    ///
2132    /// # Parameters
2133    ///
2134    /// - `stream`: Stream to query.
2135    /// - `pGraph`: The captured graph.
2136    ///
2137    /// # Return value
2138    ///
2139    /// - [`cudaError_t::CUDA_SUCCESS`]
2140    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
2141    /// - [`cudaError_t::CUDA_ERROR_STREAM_CAPTURE_WRONG_THREAD`]
2142    ///
2143    /// See also: [`cudaStreamCreate`], [`cudaStreamBeginCapture`], [`cudaStreamIsCapturing`], [`cudaGraphDestroy`].
2144    pub fn cudaStreamEndCapture(
2145        stream: cudaStream_t,
2146        pGraph: *mut cudaGraph_t,
2147    ) -> cudaError_t;
2148}
2149singe_loader::functions! { crate::RUNTIME;
2150    /// Returns a stream’s capture status.
2151    ///
2152    /// Return the capture status of `stream` via `pCaptureStatus`. After a successful call, `*pCaptureStatus` will contain one of the following:
2153    ///
2154    /// * [`cudaStreamCaptureStatus::CU_STREAM_CAPTURE_STATUS_NONE`]: The stream is not capturing.
2155    /// * [`cudaStreamCaptureStatus::CU_STREAM_CAPTURE_STATUS_ACTIVE`]: The stream is capturing.
2156    /// * [`cudaStreamCaptureStatus::CU_STREAM_CAPTURE_STATUS_INVALIDATED`]: The stream was capturing but an error has invalidated the capture sequence. The capture sequence must be terminated with [`cudaStreamEndCapture`] on the stream where it was initiated in order to continue using `stream`.
2157    ///
2158    /// Note that, if this is called on [cudaStreamLegacy](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4e62d09dde16ba457b0a97f3a5262246) (the “null stream”) while a blocking stream on the same device is capturing, it will return [`cudaError_t::CUDA_ERROR_STREAM_CAPTURE_IMPLICIT`] and `*pCaptureStatus` is unspecified after the call. The blocking stream capture is not invalidated.
2159    ///
2160    /// 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).
2161    ///
2162    /// Note that this function may also return error codes from previous, asynchronous launches.
2163    ///
2164    /// # Parameters
2165    ///
2166    /// - `stream`: Stream to query.
2167    /// - `pCaptureStatus`: Returns the stream’s capture status.
2168    ///
2169    /// # Return value
2170    ///
2171    /// - [`cudaError_t::CUDA_SUCCESS`]
2172    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
2173    /// - [`cudaError_t::CUDA_ERROR_STREAM_CAPTURE_IMPLICIT`]
2174    ///
2175    /// See also: [`cudaStreamCreate`], [`cudaStreamBeginCapture`], [`cudaStreamEndCapture`].
2176    pub fn cudaStreamIsCapturing(
2177        stream: cudaStream_t,
2178        pCaptureStatus: *mut cudaStreamCaptureStatus,
2179    ) -> cudaError_t;
2180}
2181singe_loader::functions! { crate::RUNTIME;
2182    /// Query a stream’s capture state.
2183    ///
2184    /// Query stream state related to stream capture.
2185    ///
2186    /// If called on [cudaStreamLegacy](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4e62d09dde16ba457b0a97f3a5262246) (the “null stream”) while a stream not created with [`cudaStreamNonBlocking`] is capturing, returns [`cudaError_t::CUDA_ERROR_STREAM_CAPTURE_IMPLICIT`].
2187    ///
2188    /// Valid data (other than capture status) is returned only if both of the following are true:
2189    ///
2190    /// * the call returns cudaSuccess
2191    /// * the returned capture status is [`cudaStreamCaptureStatus::CU_STREAM_CAPTURE_STATUS_ACTIVE`]
2192    ///
2193    /// 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_t::CUDA_ERROR_LOSSY_QUERY`].
2194    ///
2195    /// Note: Graph objects are not threadsafe. More here.
2196    ///
2197    /// Note that this function may also return error codes from previous, asynchronous launches.
2198    ///
2199    /// # Parameters
2200    ///
2201    /// - `stream`: The stream to query.
2202    /// - `captureStatus_out`: Location to return the capture status of the stream; required.
2203    /// - `id_out`: Optional location to return an id for the capture sequence, which is unique over the lifetime of the process.
2204    /// - `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 [`cudaStreamEndCapture`]. 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 [`cudaStreamEndCapture`] due to direct actions on the graph do not trigger [`cudaError_t::CUDA_ERROR_STREAM_CAPTURE_UNJOINED`].
2205    /// - `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.
2206    /// - `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.
2207    /// - `numDependencies_out`: Optional location to store the size of the array returned in dependencies_out.
2208    ///
2209    /// # Return value
2210    ///
2211    /// - [`cudaError_t::CUDA_SUCCESS`]
2212    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
2213    /// - [`cudaError_t::CUDA_ERROR_STREAM_CAPTURE_IMPLICIT`]
2214    /// - [`cudaError_t::CUDA_ERROR_LOSSY_QUERY`]
2215    ///
2216    /// See also: [`cudaStreamBeginCapture`], [`cudaStreamIsCapturing`], [`cudaStreamUpdateCaptureDependencies`].
2217    pub fn cudaStreamGetCaptureInfo(
2218        stream: cudaStream_t,
2219        captureStatus_out: *mut cudaStreamCaptureStatus,
2220        id_out: *mut ::core::ffi::c_ulonglong,
2221        graph_out: *mut cudaGraph_t,
2222        dependencies_out: *mut *const cudaGraphNode_t,
2223        edgeData_out: *mut *const cudaGraphEdgeData,
2224        numDependencies_out: *mut size_t,
2225    ) -> cudaError_t;
2226}
2227singe_loader::functions! { crate::RUNTIME;
2228    /// Update the set of dependencies in a capturing stream.
2229    ///
2230    /// 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.
2231    ///
2232    /// Valid flags are [`cudaStreamUpdateCaptureDependenciesFlags::cudaStreamAddCaptureDependencies`] and [`cudaStreamUpdateCaptureDependenciesFlags::cudaStreamSetCaptureDependencies`]. 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 [`cudaStreamUpdateCaptureDependenciesFlags::cudaStreamAddCaptureDependencies`].
2233    ///
2234    /// Nodes that are removed from the dependency set via this API do not result in [`cudaError_t::CUDA_ERROR_STREAM_CAPTURE_UNJOINED`] if they are unreachable from the stream at [`cudaStreamEndCapture`].
2235    ///
2236    /// Returns [`cudaError_t::CUDA_ERROR_ILLEGAL_STATE`] if the stream is not capturing.
2237    ///
2238    /// Note that this function may also return error codes from previous, asynchronous launches.
2239    ///
2240    /// # Parameters
2241    ///
2242    /// - `stream`: The stream to update.
2243    /// - `dependencies`: The set of dependencies to add.
2244    /// - `dependencyData`: Optional array of data associated with each dependency.
2245    /// - `numDependencies`: The size of the dependencies array.
2246    /// - `flags`: See above.
2247    ///
2248    /// # Return value
2249    ///
2250    /// - [`cudaError_t::CUDA_SUCCESS`]
2251    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
2252    /// - [`cudaError_t::CUDA_ERROR_ILLEGAL_STATE`]
2253    ///
2254    /// See also: [`cudaStreamBeginCapture`], [`cudaStreamGetCaptureInfo`].
2255    pub fn cudaStreamUpdateCaptureDependencies(
2256        stream: cudaStream_t,
2257        dependencies: *mut cudaGraphNode_t,
2258        dependencyData: *const cudaGraphEdgeData,
2259        numDependencies: size_t,
2260        flags: ::core::ffi::c_uint,
2261    ) -> cudaError_t;
2262}
2263singe_loader::functions! { crate::RUNTIME;
2264    /// Creates an event object.
2265    ///
2266    /// Creates an event object for the current device using [cudaEventDefault](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga6f8811acffcc133b5e4a50de6646d18e).
2267    ///
2268    /// Note that this function may also return error codes from previous, asynchronous launches.
2269    ///
2270    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
2271    ///
2272    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
2273    ///
2274    /// # Parameters
2275    ///
2276    /// - `event`: Newly created event
2277    ///
2278    /// # Return value
2279    ///
2280    /// - [`cudaError_t::CUDA_SUCCESS`]
2281    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
2282    /// - [`cudaError_t::CUDA_ERROR_LAUNCH_FAILED`]
2283    /// - [`cudaError_t::CUDA_ERROR_OUT_OF_MEMORY`]
2284    ///
2285    /// See also: [cudaEventCreate (C++ API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1ga4b5fdb19d7fb5f6f8862559f9279f6c3), [`cudaEventCreateWithFlags`], [`cudaEventRecord`], [`cudaEventQuery`], [`cudaEventSynchronize`], [`cudaEventDestroy`], [`cudaEventElapsedTime`], [`cudaStreamWaitEvent`], [`cuEventCreate`](crate::driver::cuEventCreate).
2286    pub fn cudaEventCreate(event: *mut cudaEvent_t) -> cudaError_t;
2287}
2288singe_loader::functions! { crate::RUNTIME;
2289    /// Creates an event object with the specified flags.
2290    ///
2291    /// Creates an event object for the current device with the specified flags. Valid flags include:
2292    ///
2293    /// * [cudaEventDefault](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga6f8811acffcc133b5e4a50de6646d18e): Default event creation flag.
2294    /// * [cudaEventBlockingSync](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga26509a522be9d449aa7c8c279612452d): Specifies that event should use blocking synchronization. A host thread that uses [`cudaEventSynchronize`] to wait on an event created with this flag will block until the event actually completes.
2295    /// * [cudaEventDisableTiming](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gaa5d3eff7c3623e2be533968d9cc1ee7e): Specifies that the created event does not need to record timing data. Events created with this flag specified and the [cudaEventBlockingSync](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga26509a522be9d449aa7c8c279612452d) flag not specified will provide the best performance when used with [`cudaStreamWaitEvent`] and [`cudaEventQuery`].
2296    /// * [cudaEventInterprocess](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga49ec9cd742f8a3f6fde4ee72a66326f6): Specifies that the created event may be used as an interprocess event by [`cudaIpcGetEventHandle`]. [cudaEventInterprocess](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga49ec9cd742f8a3f6fde4ee72a66326f6) must be specified along with [cudaEventDisableTiming](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gaa5d3eff7c3623e2be533968d9cc1ee7e).
2297    ///
2298    /// Note that this function may also return error codes from previous, asynchronous launches.
2299    ///
2300    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
2301    ///
2302    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
2303    ///
2304    /// # Parameters
2305    ///
2306    /// - `event`: Newly created event.
2307    /// - `flags`: Flags for new event.
2308    ///
2309    /// # Return value
2310    ///
2311    /// - [`cudaError_t::CUDA_SUCCESS`]
2312    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
2313    /// - [`cudaError_t::CUDA_ERROR_LAUNCH_FAILED`]
2314    /// - [`cudaError_t::CUDA_ERROR_OUT_OF_MEMORY`]
2315    ///
2316    /// See also: [`cudaEventCreate`] (C API), [`cudaEventSynchronize`], [`cudaEventDestroy`], [`cudaEventElapsedTime`], [`cudaStreamWaitEvent`], [`cuEventCreate`](crate::driver::cuEventCreate).
2317    pub fn cudaEventCreateWithFlags(
2318        event: *mut cudaEvent_t,
2319        flags: ::core::ffi::c_uint,
2320    ) -> cudaError_t;
2321}
2322singe_loader::functions! { crate::RUNTIME;
2323    /// Records an event.
2324    ///
2325    /// Captures in `event` the contents of `stream` at the time of this call. `event` and `stream` must be on the same CUDA context. Calls such as [`cudaEventQuery`] or [`cudaStreamWaitEvent`] will then examine or wait for completion of the work that was captured. Uses of `stream` after this call do not modify `event`. See note on default stream behavior for what is captured in the default case.
2326    ///
2327    /// [`cudaEventRecord`] can be called multiple times on the same event and will overwrite the previously captured state. Other APIs such as [`cudaStreamWaitEvent`] use the most recently captured state at the time of the API call, and are not affected by later calls to [`cudaEventRecord`]. Before the first call to [`cudaEventRecord`], an event represents an empty set of work, so for example [`cudaEventQuery`] would return [`cudaError_t::CUDA_SUCCESS`].
2328    ///
2329    /// Note: This function uses standard default stream semantics.
2330    ///
2331    /// Note that this function may also return error codes from previous, asynchronous launches.
2332    ///
2333    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
2334    ///
2335    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
2336    ///
2337    /// Note: Returns [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`] in the event of being passed NULL as the input event.
2338    ///
2339    /// # Parameters
2340    ///
2341    /// - `event`: Event to record.
2342    /// - `stream`: Stream in which to record event.
2343    ///
2344    /// # Return value
2345    ///
2346    /// - [`cudaError_t::CUDA_SUCCESS`]
2347    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
2348    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
2349    /// - [`cudaError_t::CUDA_ERROR_LAUNCH_FAILED`]
2350    ///
2351    /// See also: [`cudaEventCreate`] (C API), [`cudaEventCreateWithFlags`], [`cudaEventQuery`], [`cudaEventSynchronize`], [`cudaEventDestroy`], [`cudaEventElapsedTime`], [`cudaStreamWaitEvent`], [`cudaEventRecordWithFlags`], [`cuEventRecord`](crate::driver::cuEventRecord).
2352    pub fn cudaEventRecord(event: cudaEvent_t, stream: cudaStream_t) -> cudaError_t;
2353}
2354singe_loader::functions! { crate::RUNTIME;
2355    /// Records an event.
2356    ///
2357    /// Captures in `event` the contents of `stream` at the time of this call. `event` and `stream` must be on the same CUDA context. Calls such as [`cudaEventQuery`] or [`cudaStreamWaitEvent`] will then examine or wait for completion of the work that was captured. Uses of `stream` after this call do not modify `event`. See note on default stream behavior for what is captured in the default case.
2358    ///
2359    /// [`cudaEventRecordWithFlags`] can be called multiple times on the same event and will overwrite the previously captured state. Other APIs such as [`cudaStreamWaitEvent`] use the most recently captured state at the time of the API call, and are not affected by later calls to [`cudaEventRecordWithFlags`]. Before the first call to [`cudaEventRecordWithFlags`], an event represents an empty set of work, so for example [`cudaEventQuery`] would return [`cudaError_t::CUDA_SUCCESS`].
2360    ///
2361    /// flags include:
2362    ///
2363    /// * [`cudaEventRecordDefault`]: Default event creation flag.
2364    /// * [`cudaEventRecordExternal`]: Event is captured in the graph as an external event node when performing stream capture.
2365    ///
2366    /// Note: This function uses standard default stream semantics.
2367    ///
2368    /// Note that this function may also return error codes from previous, asynchronous launches.
2369    ///
2370    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
2371    ///
2372    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
2373    ///
2374    /// Note: Returns [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`] in the event of being passed NULL as the input event.
2375    ///
2376    /// # Parameters
2377    ///
2378    /// - `event`: Event to record.
2379    /// - `stream`: Stream in which to record event.
2380    /// - `flags`: Parameters for the operation(See above).
2381    ///
2382    /// # Return value
2383    ///
2384    /// - [`cudaError_t::CUDA_SUCCESS`]
2385    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
2386    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
2387    /// - [`cudaError_t::CUDA_ERROR_LAUNCH_FAILED`]
2388    ///
2389    /// See also: [`cudaEventCreate`] (C API), [`cudaEventCreateWithFlags`], [`cudaEventQuery`], [`cudaEventSynchronize`], [`cudaEventDestroy`], [`cudaEventElapsedTime`], [`cudaStreamWaitEvent`], [`cudaEventRecord`], [`cuEventRecord`](crate::driver::cuEventRecord).
2390    pub fn cudaEventRecordWithFlags(
2391        event: cudaEvent_t,
2392        stream: cudaStream_t,
2393        flags: ::core::ffi::c_uint,
2394    ) -> cudaError_t;
2395}
2396singe_loader::functions! { crate::RUNTIME;
2397    /// Queries an event’s status.
2398    ///
2399    /// Queries the status of all work currently captured by `event`. See [`cudaEventRecord`] for details on what is captured by an event.
2400    ///
2401    /// Returns [`cudaError_t::CUDA_SUCCESS`] if all captured work has been completed, or [`cudaError_t::CUDA_ERROR_NOT_READY`] if any captured work is incomplete.
2402    ///
2403    /// For the purposes of Unified Memory, a return value of [`cudaError_t::CUDA_SUCCESS`] is equivalent to having called [`cudaEventSynchronize`].
2404    ///
2405    /// Note that this function may also return error codes from previous, asynchronous launches.
2406    ///
2407    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
2408    ///
2409    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
2410    ///
2411    /// Note: Returns [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`] in the event of being passed NULL as the input event.
2412    ///
2413    /// # Parameters
2414    ///
2415    /// - `event`: Event to query
2416    ///
2417    /// # Return value
2418    ///
2419    /// - [`cudaError_t::CUDA_SUCCESS`]
2420    /// - [`cudaError_t::CUDA_ERROR_NOT_READY`]
2421    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
2422    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
2423    /// - [`cudaError_t::CUDA_ERROR_LAUNCH_FAILED`]
2424    ///
2425    /// See also: [`cudaEventCreate`] (C API), [`cudaEventCreateWithFlags`], [`cudaEventRecord`], [`cudaEventSynchronize`], [`cudaEventDestroy`], [`cudaEventElapsedTime`], [`cuEventQuery`](crate::driver::cuEventQuery).
2426    pub fn cudaEventQuery(event: cudaEvent_t) -> cudaError_t;
2427}
2428singe_loader::functions! { crate::RUNTIME;
2429    /// Waits for an event to complete.
2430    ///
2431    /// Waits until the completion of all work currently captured in `event`. See [`cudaEventRecord`] for details on what is captured by an event.
2432    ///
2433    /// Waiting for an event that was created with the [cudaEventBlockingSync](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga26509a522be9d449aa7c8c279612452d) flag will cause the calling CPU thread to block until the event has been completed by the device. If the [cudaEventBlockingSync](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga26509a522be9d449aa7c8c279612452d) flag has not been set, then the CPU thread will busy-wait until the event has been completed by the device.
2434    ///
2435    /// Note that this function may also return error codes from previous, asynchronous launches.
2436    ///
2437    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
2438    ///
2439    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
2440    ///
2441    /// Note: Returns [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`] in the event of being passed NULL as the input event.
2442    ///
2443    /// # Parameters
2444    ///
2445    /// - `event`: Event to wait for
2446    ///
2447    /// # Return value
2448    ///
2449    /// - [`cudaError_t::CUDA_SUCCESS`]
2450    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
2451    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
2452    /// - [`cudaError_t::CUDA_ERROR_LAUNCH_FAILED`]
2453    ///
2454    /// See also: [`cudaEventCreate`] (C API), [`cudaEventCreateWithFlags`], [`cudaEventRecord`], [`cudaEventQuery`], [`cudaEventDestroy`], [`cudaEventElapsedTime`], [`cuEventSynchronize`](crate::driver::cuEventSynchronize).
2455    pub fn cudaEventSynchronize(event: cudaEvent_t) -> cudaError_t;
2456}
2457singe_loader::functions! { crate::RUNTIME;
2458    /// Destroys an event object.
2459    ///
2460    /// Destroys the event specified by `event`.
2461    ///
2462    /// An event may be destroyed before it is complete (i.e., while [`cudaEventQuery`] would return [`cudaError_t::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.
2463    ///
2464    /// Note that this function may also return error codes from previous, asynchronous launches.
2465    ///
2466    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
2467    ///
2468    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
2469    ///
2470    /// Note: Use of the handle after this call is undefined behavior.
2471    ///
2472    /// Note: Returns [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`] in the event of being passed NULL as the input event.
2473    ///
2474    /// # Parameters
2475    ///
2476    /// - `event`: Event to destroy
2477    ///
2478    /// # Return value
2479    ///
2480    /// - [`cudaError_t::CUDA_SUCCESS`]
2481    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
2482    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
2483    /// - [`cudaError_t::CUDA_ERROR_LAUNCH_FAILED`]
2484    ///
2485    /// See also: [`cudaEventCreate`] (C API), [`cudaEventCreateWithFlags`], [`cudaEventQuery`], [`cudaEventSynchronize`], [`cudaEventRecord`], [`cudaEventElapsedTime`], [`cuEventDestroy`](crate::driver::cuEventDestroy).
2486    pub fn cudaEventDestroy(event: cudaEvent_t) -> cudaError_t;
2487}
2488singe_loader::functions! { crate::RUNTIME;
2489    /// Computes the elapsed time between events.
2490    ///
2491    /// 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 a elapsed time calculation only and polling for completion on the events to be compared should be done with [`cudaEventQuery`] instead.
2492    ///
2493    /// 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 [`cudaEventRecord`] 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.
2494    ///
2495    /// If [`cudaEventRecord`] has not been called on either event, then [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`] is returned. If [`cudaEventRecord`] has been called on both events but one or both of them has not yet been completed (that is, [`cudaEventQuery`] would return [`cudaError_t::CUDA_ERROR_NOT_READY`] on at least one of the events), [`cudaError_t::CUDA_ERROR_NOT_READY`] is returned. If either event was created with the [cudaEventDisableTiming](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gaa5d3eff7c3623e2be533968d9cc1ee7e) flag, then this function will return [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`].
2496    ///
2497    /// Note that this function may also return error codes from previous, asynchronous launches.
2498    ///
2499    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
2500    ///
2501    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
2502    ///
2503    /// Note: Returns [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`] in the event of being passed NULL as the input event.
2504    ///
2505    /// # Parameters
2506    ///
2507    /// - `ms`: Time between `start` and `end` in ms.
2508    /// - `start`: Starting event.
2509    /// - `end`: Ending event.
2510    ///
2511    /// # Return value
2512    ///
2513    /// - [`cudaError_t::CUDA_SUCCESS`]
2514    /// - [`cudaError_t::CUDA_ERROR_NOT_READY`]
2515    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
2516    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
2517    /// - [`cudaError_t::CUDA_ERROR_LAUNCH_FAILED`]
2518    /// - [`cudaError_t::CUDA_ERROR_UNKNOWN`]
2519    ///
2520    /// See also: [`cudaEventCreate`] (C API), [`cudaEventCreateWithFlags`], [`cudaEventQuery`], [`cudaEventSynchronize`], [`cudaEventDestroy`], [`cudaEventRecord`], [`cuEventElapsedTime`](crate::driver::cuEventElapsedTime).
2521    pub fn cudaEventElapsedTime(
2522        ms: *mut f32,
2523        start: cudaEvent_t,
2524        end: cudaEvent_t,
2525    ) -> cudaError_t;
2526}
2527singe_loader::functions! { crate::RUNTIME;
2528    /// Imports an external memory object.
2529    ///
2530    /// Imports an externally allocated memory object and returns a handle to that in `extMem_out`.
2531    ///
2532    /// The properties of the handle being imported must be described in `memHandleDesc`. The [`cudaExternalMemoryHandleDesc`] structure is defined as follows:
2533    ///
2534    /// ```text
2535    /// typedef struct cudaExternalMemoryHandleDesc_st {
2536    /// cudaExternalMemoryHandleType type;
2537    /// union {
2538    /// int fd;
2539    /// struct {
2540    /// void *handle;
2541    /// const void *name;
2542    /// } win32;
2543    /// const void *nvSciBufObject;
2544    /// } handle;
2545    /// unsigned long long size;
2546    /// unsigned int flags;
2547    /// } cudaExternalMemoryHandleDesc;
2548    /// ```
2549    ///
2550    /// where [`cudaExternalMemoryHandleDesc::type`](cudaExternalMemoryHandleDesc::type_) specifies the type of handle being imported. [`cudaExternalMemoryHandleType`] is defined as:
2551    ///
2552    /// ```text
2553    /// typedef enum cudaExternalMemoryHandleType_enum {
2554    /// cudaExternalMemoryHandleTypeOpaqueFd         = 1,
2555    /// cudaExternalMemoryHandleTypeOpaqueWin32      = 2,
2556    /// cudaExternalMemoryHandleTypeOpaqueWin32Kmt   = 3,
2557    /// cudaExternalMemoryHandleTypeD3D12Heap        = 4,
2558    /// cudaExternalMemoryHandleTypeD3D12Resource    = 5,
2559    /// cudaExternalMemoryHandleTypeD3D11Resource    = 6,
2560    ///    cudaExternalMemoryHandleTypeD3D11ResourceKmt = 7,
2561    /// cudaExternalMemoryHandleTypeNvSciBuf         = 8
2562    /// } cudaExternalMemoryHandleType;
2563    /// ```
2564    ///
2565    /// If [`cudaExternalMemoryHandleDesc::type`](cudaExternalMemoryHandleDesc::type_) is [`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeOpaqueFd`], then `cudaExternalMemoryHandleDesc::handle::fd` 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.
2566    ///
2567    /// If [`cudaExternalMemoryHandleDesc::type`](cudaExternalMemoryHandleDesc::type_) is [`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeOpaqueWin32`], then exactly one of `cudaExternalMemoryHandleDesc::handle::win32::handle` and `cudaExternalMemoryHandleDesc::handle::win32::name` must not be NULL. If `cudaExternalMemoryHandleDesc::handle::win32::handle` 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 `cudaExternalMemoryHandleDesc::handle::win32::name` is not NULL, then it must point to a NULL-terminated array of UTF-16 characters that refers to a memory object.
2568    ///
2569    /// If [`cudaExternalMemoryHandleDesc::type`](cudaExternalMemoryHandleDesc::type_) is [`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeOpaqueWin32Kmt`], then `cudaExternalMemoryHandleDesc::handle::win32::handle` must be non-NULL and `cudaExternalMemoryHandleDesc::handle::win32::name` 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.
2570    ///
2571    /// If [`cudaExternalMemoryHandleDesc::type`](cudaExternalMemoryHandleDesc::type_) is [`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeD3D12Heap`], then exactly one of `cudaExternalMemoryHandleDesc::handle::win32::handle` and `cudaExternalMemoryHandleDesc::handle::win32::name` must not be NULL. If `cudaExternalMemoryHandleDesc::handle::win32::handle` 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 `cudaExternalMemoryHandleDesc::handle::win32::name` is not NULL, then it must point to a NULL-terminated array of UTF-16 characters that refers to a ID3D12Heap object.
2572    ///
2573    /// If [`cudaExternalMemoryHandleDesc::type`](cudaExternalMemoryHandleDesc::type_) is [`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeD3D12Resource`], then exactly one of `cudaExternalMemoryHandleDesc::handle::win32::handle` and `cudaExternalMemoryHandleDesc::handle::win32::name` must not be NULL. If `cudaExternalMemoryHandleDesc::handle::win32::handle` 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 `cudaExternalMemoryHandleDesc::handle::win32::name` is not NULL, then it must point to a NULL-terminated array of UTF-16 characters that refers to a ID3D12Resource object.
2574    ///
2575    /// If [`cudaExternalMemoryHandleDesc::type`](cudaExternalMemoryHandleDesc::type_) is [`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeD3D11Resource`]
2576    ///
2577    /// ,then exactly one of `cudaExternalMemoryHandleDesc::handle::win32::handle` and `cudaExternalMemoryHandleDesc::handle::win32::name` must not be NULL. If `cudaExternalMemoryHandleDesc::handle::win32::handle` is
2578    ///
2579    /// not NULL, then it must represent a valid shared NT handle that is
2580    ///
2581    /// returned by IDXGIResource1::CreateSharedHandle when referring to a ID3D11Resource object. If `cudaExternalMemoryHandleDesc::handle::win32::name` is not NULL, then it must point to a NULL-terminated array of UTF-16 characters that refers to a ID3D11Resource object.
2582    ///
2583    /// If [`cudaExternalMemoryHandleDesc::type`](cudaExternalMemoryHandleDesc::type_) is [`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeD3D11ResourceKmt`], then `cudaExternalMemoryHandleDesc::handle::win32::handle` must be non-NULL and `cudaExternalMemoryHandleDesc::handle::win32::name` must be NULL. The handle specified must be a valid shared KMT handle that is returned by IDXGIResource::GetSharedHandle when referring to a ID3D11Resource object.
2584    ///
2585    /// If [`cudaExternalMemoryHandleDesc::type`](cudaExternalMemoryHandleDesc::type_) is [`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeNvSciBuf`], then `cudaExternalMemoryHandleDesc::handle::nvSciBufObject` 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 [`cudaWaitExternalSemaphoresAsync`] or [`cudaSignalExternalSemaphoresAsync`] as approprriate barriers to maintain coherence between CUDA and the other drivers. See [cudaExternalSemaphoreWaitSkipNvSciBufMemSync](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga3643166ea40207f6a13f82ebd7b6c2c7) and [cudaExternalSemaphoreSignalSkipNvSciBufMemSync](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga39b71a7aa040658a7a280fcf31eb4a77) for memory synchronization.
2586    ///
2587    /// The size of the memory object must be specified in [`cudaExternalMemoryHandleDesc::size`](cudaExternalMemoryHandleDesc::size).
2588    ///
2589    /// Specifying the flag [cudaExternalMemoryDedicated](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gaea2031488a28bcdb7695e9bbaf25e149) in [`cudaExternalMemoryHandleDesc::flags`](cudaExternalMemoryHandleDesc::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 [`cudaExternalMemoryHandleDesc::type`](cudaExternalMemoryHandleDesc::type_) is one of the following: [`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeD3D12Resource`] [`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeD3D11Resource`] [`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeD3D11ResourceKmt`].
2590    ///
2591    /// Note that this function may also return error codes from previous, asynchronous launches.
2592    ///
2593    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
2594    ///
2595    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
2596    ///
2597    /// 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
2598    ///
2599    /// and Cache Control” chapter from Vulkan specification.
2600    ///
2601    /// # Parameters
2602    ///
2603    /// - `extMem_out`: Returned handle to an external memory object.
2604    /// - `memHandleDesc`: Memory import handle descriptor.
2605    ///
2606    /// # Return value
2607    ///
2608    /// - [`cudaError_t::CUDA_SUCCESS`]
2609    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
2610    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
2611    /// - [`cudaError_t::CUDA_ERROR_OPERATING_SYSTEM`]
2612    ///
2613    /// See also: [`cudaDestroyExternalMemory`], [`cudaExternalMemoryGetMappedBuffer`], [`cudaExternalMemoryGetMappedMipmappedArray`].
2614    pub fn cudaImportExternalMemory(
2615        extMem_out: *mut cudaExternalMemory_t,
2616        memHandleDesc: *const cudaExternalMemoryHandleDesc,
2617    ) -> cudaError_t;
2618}
2619singe_loader::functions! { crate::RUNTIME;
2620    /// Maps a buffer onto an imported memory object.
2621    ///
2622    /// Maps a buffer onto an imported memory object and returns a device pointer in `devPtr`.
2623    ///
2624    /// The properties of the buffer being mapped must be described in `bufferDesc`. The [`cudaExternalMemoryBufferDesc`] structure is defined as follows:
2625    ///
2626    /// ```text
2627    /// typedef struct cudaExternalMemoryBufferDesc_st {
2628    /// unsigned long long offset;
2629    /// unsigned long long size;
2630    /// unsigned int flags;
2631    /// } cudaExternalMemoryBufferDesc;
2632    /// ```
2633    ///
2634    /// where [`cudaExternalMemoryBufferDesc::offset`](cudaExternalMemoryBufferDesc::offset) is the offset in the memory object where the buffer’s base address is. [`cudaExternalMemoryBufferDesc::size`](cudaExternalMemoryBufferDesc::size) is the size of the buffer. [`cudaExternalMemoryBufferDesc::flags`](cudaExternalMemoryBufferDesc::flags) must be zero.
2635    ///
2636    /// 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.
2637    ///
2638    /// The returned pointer `devPtr` must be freed using [`cudaFree`].
2639    ///
2640    /// Note that this function may also return error codes from previous, asynchronous launches.
2641    ///
2642    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
2643    ///
2644    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
2645    ///
2646    /// # Parameters
2647    ///
2648    /// - `devPtr`: Returned device pointer to buffer.
2649    /// - `extMem`: Handle to external memory object.
2650    /// - `bufferDesc`: Buffer descriptor.
2651    ///
2652    /// # Return value
2653    ///
2654    /// - [`cudaError_t::CUDA_SUCCESS`]
2655    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
2656    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
2657    ///
2658    /// See also: [`cudaImportExternalMemory`], [`cudaDestroyExternalMemory`], [`cudaExternalMemoryGetMappedMipmappedArray`].
2659    pub fn cudaExternalMemoryGetMappedBuffer(
2660        devPtr: *mut *mut ::core::ffi::c_void,
2661        extMem: cudaExternalMemory_t,
2662        bufferDesc: *const cudaExternalMemoryBufferDesc,
2663    ) -> cudaError_t;
2664}
2665singe_loader::functions! { crate::RUNTIME;
2666    /// Maps a CUDA mipmapped array onto an external memory object.
2667    ///
2668    /// Maps a CUDA mipmapped array onto an external object and returns a handle to it in `mipmap`.
2669    ///
2670    /// The properties of the CUDA mipmapped array being mapped must be described in `mipmapDesc`. The structure [`cudaExternalMemoryMipmappedArrayDesc`] is defined as follows:
2671    ///
2672    /// ```text
2673    /// typedef struct cudaExternalMemoryMipmappedArrayDesc_st {
2674    /// unsigned long long offset;
2675    /// cudaChannelFormatDesc formatDesc;
2676    /// cudaExtent extent;
2677    /// unsigned int flags;
2678    /// unsigned int numLevels;
2679    /// } cudaExternalMemoryMipmappedArrayDesc;
2680    /// ```
2681    ///
2682    /// where [`cudaExternalMemoryMipmappedArrayDesc::offset`](cudaExternalMemoryMipmappedArrayDesc::offset) is the offset in the memory object where the base level of the mipmap chain is. [`cudaExternalMemoryMipmappedArrayDesc::formatDesc`](cudaExternalMemoryMipmappedArrayDesc::formatDesc) describes the format of the data. [`cudaExternalMemoryMipmappedArrayDesc::extent`](cudaExternalMemoryMipmappedArrayDesc::extent) specifies the dimensions of the base level of the mipmap chain. [`cudaExternalMemoryMipmappedArrayDesc::flags`](cudaExternalMemoryMipmappedArrayDesc::flags) are flags associated with CUDA mipmapped arrays. For further details, please refer to the documentation for [`cudaMalloc3DArray`]. Note that if the mipmapped array is bound as a color target in the graphics API, then the flag [cudaArrayColorAttachment](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gafec2b519ab85854efaa40e12f4e34ad3) must be specified in [`cudaExternalMemoryMipmappedArrayDesc::flags`](cudaExternalMemoryMipmappedArrayDesc::flags). [`cudaExternalMemoryMipmappedArrayDesc::numLevels`](cudaExternalMemoryMipmappedArrayDesc::numLevels) specifies the total number of levels in the mipmap chain.
2683    ///
2684    /// The returned CUDA mipmapped array must be freed using [`cudaFreeMipmappedArray`].
2685    ///
2686    /// Note that this function may also return error codes from previous, asynchronous launches.
2687    ///
2688    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
2689    ///
2690    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
2691    ///
2692    /// Note: If [`cudaExternalMemoryHandleDesc::type`](cudaExternalMemoryHandleDesc::type_) is [`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeNvSciBuf`], then [`cudaExternalMemoryMipmappedArrayDesc::numLevels`](cudaExternalMemoryMipmappedArrayDesc::numLevels) must not be greater than 1.
2693    ///
2694    /// # Parameters
2695    ///
2696    /// - `mipmap`: Returned CUDA mipmapped array.
2697    /// - `extMem`: Handle to external memory object.
2698    /// - `mipmapDesc`: CUDA array descriptor.
2699    ///
2700    /// # Return value
2701    ///
2702    /// - [`cudaError_t::CUDA_SUCCESS`]
2703    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
2704    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
2705    ///
2706    /// See also: [`cudaImportExternalMemory`], [`cudaDestroyExternalMemory`], [`cudaExternalMemoryGetMappedBuffer`].
2707    pub fn cudaExternalMemoryGetMappedMipmappedArray(
2708        mipmap: *mut cudaMipmappedArray_t,
2709        extMem: cudaExternalMemory_t,
2710        mipmapDesc: *const cudaExternalMemoryMipmappedArrayDesc,
2711    ) -> cudaError_t;
2712}
2713singe_loader::functions! { crate::RUNTIME;
2714    /// Destroys an external memory object.
2715    ///
2716    /// 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 [`cudaFree`] and [`cudaFreeMipmappedArray`] respectively.
2717    ///
2718    /// Note that this function may also return error codes from previous, asynchronous launches.
2719    ///
2720    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
2721    ///
2722    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
2723    ///
2724    /// Note: Use of the handle after this call is undefined behavior.
2725    ///
2726    /// # Parameters
2727    ///
2728    /// - `extMem`: External memory object to be destroyed
2729    ///
2730    /// # Return value
2731    ///
2732    /// - [`cudaError_t::CUDA_SUCCESS`]
2733    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
2734    ///
2735    /// See also: [`cudaImportExternalMemory`], [`cudaExternalMemoryGetMappedBuffer`], [`cudaExternalMemoryGetMappedMipmappedArray`].
2736    pub fn cudaDestroyExternalMemory(extMem: cudaExternalMemory_t) -> cudaError_t;
2737}
2738singe_loader::functions! { crate::RUNTIME;
2739    /// Imports an external semaphore.
2740    ///
2741    /// Imports an externally allocated synchronization object and returns a handle to that in `extSem_out`.
2742    ///
2743    /// The properties of the handle being imported must be described in `semHandleDesc`. The [`cudaExternalSemaphoreHandleDesc`] is defined as follows:
2744    ///
2745    /// ```text
2746    /// typedef struct cudaExternalSemaphoreHandleDesc_st {
2747    /// cudaExternalSemaphoreHandleType type;
2748    /// union {
2749    /// int fd;
2750    /// struct {
2751    /// void *handle;
2752    /// const void *name;
2753    /// } win32;
2754    /// const void* NvSciSyncObj;
2755    /// } handle;
2756    /// unsigned int flags;
2757    /// } cudaExternalSemaphoreHandleDesc;
2758    /// ```
2759    ///
2760    /// where [`cudaExternalSemaphoreHandleDesc::type`](cudaExternalSemaphoreHandleDesc::type_) specifies the type of handle being imported. [`cudaExternalSemaphoreHandleType`] is defined as:
2761    ///
2762    /// ```text
2763    /// typedef enum cudaExternalSemaphoreHandleType_enum {
2764    /// cudaExternalSemaphoreHandleTypeOpaqueFd                = 1,
2765    /// cudaExternalSemaphoreHandleTypeOpaqueWin32             = 2,
2766    /// cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt          = 3,
2767    /// cudaExternalSemaphoreHandleTypeD3D12Fence              = 4,
2768    /// cudaExternalSemaphoreHandleTypeD3D11Fence              = 5,
2769    /// cudaExternalSemaphoreHandleTypeNvSciSync               = 6,
2770    /// cudaExternalSemaphoreHandleTypeKeyedMutex              = 7,
2771    /// cudaExternalSemaphoreHandleTypeKeyedMutexKmt           = 8,
2772    /// cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd     = 9,
2773    /// cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32  = 10
2774    /// } cudaExternalSemaphoreHandleType;
2775    /// ```
2776    ///
2777    /// If [`cudaExternalSemaphoreHandleDesc::type`](cudaExternalSemaphoreHandleDesc::type_) is [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeOpaqueFd`], then `cudaExternalSemaphoreHandleDesc::handle::fd` 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.
2778    ///
2779    /// If [`cudaExternalSemaphoreHandleDesc::type`](cudaExternalSemaphoreHandleDesc::type_) is [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeOpaqueWin32`], then exactly one of `cudaExternalSemaphoreHandleDesc::handle::win32::handle` and `cudaExternalSemaphoreHandleDesc::handle::win32::name` must not be NULL. If `cudaExternalSemaphoreHandleDesc::handle::win32::handle` 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 `cudaExternalSemaphoreHandleDesc::handle::win32::name` is not NULL, then it must name a valid synchronization object.
2780    ///
2781    /// If [`cudaExternalSemaphoreHandleDesc::type`](cudaExternalSemaphoreHandleDesc::type_) is [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt`], then `cudaExternalSemaphoreHandleDesc::handle::win32::handle` must be non-NULL and `cudaExternalSemaphoreHandleDesc::handle::win32::name` 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.
2782    ///
2783    /// If [`cudaExternalSemaphoreHandleDesc::type`](cudaExternalSemaphoreHandleDesc::type_) is [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeD3D12Fence`], then exactly one of `cudaExternalSemaphoreHandleDesc::handle::win32::handle` and `cudaExternalSemaphoreHandleDesc::handle::win32::name` must not be NULL. If `cudaExternalSemaphoreHandleDesc::handle::win32::handle` 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 `cudaExternalSemaphoreHandleDesc::handle::win32::name` is not NULL, then it must name a valid synchronization object that refers to a valid ID3D12Fence object.
2784    ///
2785    /// If [`cudaExternalSemaphoreHandleDesc::type`](cudaExternalSemaphoreHandleDesc::type_) is [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeD3D11Fence`], then exactly one of `cudaExternalSemaphoreHandleDesc::handle::win32::handle` and `cudaExternalSemaphoreHandleDesc::handle::win32::name` must not be NULL. If `cudaExternalSemaphoreHandleDesc::handle::win32::handle` is not NULL, then it must represent a valid shared NT handle that is returned by ID3D11Fence::CreateSharedHandle. If `cudaExternalSemaphoreHandleDesc::handle::win32::name` is not NULL, then it must name a valid synchronization object that refers to a valid ID3D11Fence object.
2786    ///
2787    /// If [`cudaExternalSemaphoreHandleDesc::type`](cudaExternalSemaphoreHandleDesc::type_) is [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeNvSciSync`], then `cudaExternalSemaphoreHandleDesc::handle::nvSciSyncObj` represents a valid NvSciSyncObj.
2788    ///
2789    /// [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeKeyedMutex`], then exactly one of `cudaExternalSemaphoreHandleDesc::handle::win32::handle` and `cudaExternalSemaphoreHandleDesc::handle::win32::name` must not be NULL. If `cudaExternalSemaphoreHandleDesc::handle::win32::handle` is not NULL, then it represent a valid shared NT handle that is returned by IDXGIResource1::CreateSharedHandle when referring to a IDXGIKeyedMutex object.
2790    ///
2791    /// If [`cudaExternalSemaphoreHandleDesc::type`](cudaExternalSemaphoreHandleDesc::type_) is [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeKeyedMutexKmt`], then `cudaExternalSemaphoreHandleDesc::handle::win32::handle` must be non-NULL and `cudaExternalSemaphoreHandleDesc::handle::win32::name` must be NULL. The handle specified must represent a valid KMT handle that is returned by IDXGIResource::GetSharedHandle when referring to a IDXGIKeyedMutex object.
2792    ///
2793    /// If [`cudaExternalSemaphoreHandleDesc::type`](cudaExternalSemaphoreHandleDesc::type_) is [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd`], then `cudaExternalSemaphoreHandleDesc::handle::fd` 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.
2794    ///
2795    /// If [`cudaExternalSemaphoreHandleDesc::type`](cudaExternalSemaphoreHandleDesc::type_) is [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32`], then exactly one of `cudaExternalSemaphoreHandleDesc::handle::win32::handle` and `cudaExternalSemaphoreHandleDesc::handle::win32::name` must not be NULL. If `cudaExternalSemaphoreHandleDesc::handle::win32::handle` 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 `cudaExternalSemaphoreHandleDesc::handle::win32::name` is not NULL, then it must name a valid synchronization object.
2796    ///
2797    /// Note that this function may also return error codes from previous, asynchronous launches.
2798    ///
2799    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
2800    ///
2801    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
2802    ///
2803    /// # Parameters
2804    ///
2805    /// - `extSem_out`: Returned handle to an external semaphore.
2806    /// - `semHandleDesc`: Semaphore import handle descriptor.
2807    ///
2808    /// # Return value
2809    ///
2810    /// - [`cudaError_t::CUDA_SUCCESS`]
2811    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
2812    /// - [`cudaError_t::CUDA_ERROR_OPERATING_SYSTEM`]
2813    ///
2814    /// See also: [`cudaDestroyExternalSemaphore`], [`cudaSignalExternalSemaphoresAsync`], [`cudaWaitExternalSemaphoresAsync`].
2815    pub fn cudaImportExternalSemaphore(
2816        extSem_out: *mut cudaExternalSemaphore_t,
2817        semHandleDesc: *const cudaExternalSemaphoreHandleDesc,
2818    ) -> cudaError_t;
2819}
2820singe_loader::functions! { crate::RUNTIME;
2821    /// Signals a set of external semaphore objects.
2822    ///
2823    /// 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.
2824    ///
2825    /// The exact semantics of signaling a semaphore depends on the type of the object.
2826    ///
2827    /// If the semaphore object is any one of the following types: [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeOpaqueFd`], [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeOpaqueWin32`], [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt`] then signaling the semaphore will set it to the signaled state.
2828    ///
2829    /// If the semaphore object is any one of the following types: [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeD3D12Fence`], [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeD3D11Fence`], [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd`], [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32`] then the semaphore will be set to the value specified in `cudaExternalSemaphoreSignalParams::params::fence::value`.
2830    ///
2831    /// If the semaphore object is of the type [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeNvSciSync`] this API sets `cudaExternalSemaphoreSignalParams::params::nvSciSync::fence` 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 `cudaExternalSemaphoreSignalParams::params::nvSciSync::fence`. By default, signaling such an external semaphore object causes appropriate memory synchronization operations to be performed over all the external memory objects that are imported as [`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeNvSciBuf`]. 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 [cudaExternalSemaphoreSignalSkipNvSciBufMemSync](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga39b71a7aa040658a7a280fcf31eb4a77), 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 [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeNvSciSync`], if the NvSciSyncAttrList used to create the NvSciSyncObj had not set the flags in [`cudaDeviceGetNvSciSyncAttributes`] to cudaNvSciSyncAttrSignal, this API will return cudaErrorNotSupported.
2832    ///
2833    /// `cudaExternalSemaphoreSignalParams::params::nvSciSync::fence` associated with semaphore object of the type [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeNvSciSync`] 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. `cudaExternalSemaphoreSignalParams::params::nvSciSync::fence` associated with semaphore object of the type [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeNvSciSync`] 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.
2834    ///
2835    /// If the semaphore object is any one of the following types: [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeKeyedMutex`], [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeKeyedMutexKmt`], then the keyed mutex will be released with the key specified in `cudaExternalSemaphoreSignalParams::params::keyedmutex::key`.
2836    ///
2837    /// Note that this function may also return error codes from previous, asynchronous launches.
2838    ///
2839    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
2840    ///
2841    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
2842    ///
2843    /// # Parameters
2844    ///
2845    /// - `extSemArray`: Set of external semaphores to be signaled.
2846    /// - `paramsArray`: Array of semaphore parameters.
2847    /// - `numExtSems`: Number of semaphores to signal.
2848    /// - `stream`: Stream to enqueue the signal operations in.
2849    ///
2850    /// # Return value
2851    ///
2852    /// - [`cudaError_t::CUDA_SUCCESS`]
2853    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
2854    ///
2855    /// See also: [`cudaImportExternalSemaphore`], [`cudaDestroyExternalSemaphore`], [`cudaWaitExternalSemaphoresAsync`].
2856    pub fn cudaSignalExternalSemaphoresAsync(
2857        extSemArray: *const cudaExternalSemaphore_t,
2858        paramsArray: *const cudaExternalSemaphoreSignalParams,
2859        numExtSems: ::core::ffi::c_uint,
2860        stream: cudaStream_t,
2861    ) -> cudaError_t;
2862}
2863singe_loader::functions! { crate::RUNTIME;
2864    /// Waits on a set of external semaphore objects.
2865    ///
2866    /// 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.
2867    ///
2868    /// The exact semantics of waiting on a semaphore depends on the type of the object.
2869    ///
2870    /// If the semaphore object is any one of the following types: [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeOpaqueFd`], [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeOpaqueWin32`], [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt`] 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.
2871    ///
2872    /// If the semaphore object is any one of the following types: [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeD3D12Fence`], [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeD3D11Fence`], [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd`], [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32`] then waiting on the semaphore will wait until the value of the semaphore is greater than or equal to `cudaExternalSemaphoreWaitParams::params::fence::value`.
2873    ///
2874    /// If the semaphore object is of the type [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeNvSciSync`] then, waiting on the semaphore will wait until the `cudaExternalSemaphoreSignalParams::params::nvSciSync::fence` 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 [`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeNvSciBuf`]. 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 [cudaExternalSemaphoreWaitSkipNvSciBufMemSync](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga3643166ea40207f6a13f82ebd7b6c2c7), 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 [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeNvSciSync`], if the NvSciSyncAttrList used to create the NvSciSyncObj had not set the flags in [`cudaDeviceGetNvSciSyncAttributes`] to cudaNvSciSyncAttrWait, this API will return cudaErrorNotSupported.
2875    ///
2876    /// If the semaphore object is any one of the following types: [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeKeyedMutex`], [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeKeyedMutexKmt`], then the keyed mutex will be acquired when it is released with the key specified in `cudaExternalSemaphoreSignalParams::params::keyedmutex::key` or until the timeout specified by `cudaExternalSemaphoreSignalParams::params::keyedmutex::timeoutMs` 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.
2877    ///
2878    /// Note that this function may also return error codes from previous, asynchronous launches.
2879    ///
2880    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
2881    ///
2882    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
2883    ///
2884    /// # Parameters
2885    ///
2886    /// - `extSemArray`: External semaphores to be waited on.
2887    /// - `paramsArray`: Array of semaphore parameters.
2888    /// - `numExtSems`: Number of semaphores to wait on.
2889    /// - `stream`: Stream to enqueue the wait operations in.
2890    ///
2891    /// # Return value
2892    ///
2893    /// - [`cudaError_t::CUDA_SUCCESS`]
2894    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
2895    /// - [`cudaError_t::CUDA_ERROR_TIMEOUT`]
2896    ///
2897    /// See also: [`cudaImportExternalSemaphore`], [`cudaDestroyExternalSemaphore`], [`cudaSignalExternalSemaphoresAsync`].
2898    pub fn cudaWaitExternalSemaphoresAsync(
2899        extSemArray: *const cudaExternalSemaphore_t,
2900        paramsArray: *const cudaExternalSemaphoreWaitParams,
2901        numExtSems: ::core::ffi::c_uint,
2902        stream: cudaStream_t,
2903    ) -> cudaError_t;
2904}
2905singe_loader::functions! { crate::RUNTIME;
2906    /// Destroys an external semaphore.
2907    ///
2908    /// 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.
2909    ///
2910    /// Note that this function may also return error codes from previous, asynchronous launches.
2911    ///
2912    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
2913    ///
2914    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
2915    ///
2916    /// Note: Use of the handle after this call is undefined behavior.
2917    ///
2918    /// # Parameters
2919    ///
2920    /// - `extSem`: External semaphore to be destroyed
2921    ///
2922    /// # Return value
2923    ///
2924    /// - [`cudaError_t::CUDA_SUCCESS`]
2925    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
2926    ///
2927    /// See also: [`cudaImportExternalSemaphore`], [`cudaSignalExternalSemaphoresAsync`], [`cudaWaitExternalSemaphoresAsync`].
2928    pub fn cudaDestroyExternalSemaphore(extSem: cudaExternalSemaphore_t) -> cudaError_t;
2929}
2930singe_loader::functions! { crate::RUNTIME;
2931    /// Launches a device function.
2932    ///
2933    /// The function invokes kernel `func` on `gridDim` (`gridDim.x ``gridDim.y ``gridDim.z`) grid of blocks. Each block contains `blockDim` (`blockDim.x ``blockDim.y ``blockDim.z`) threads.
2934    ///
2935    /// If the kernel has N parameters the `args` should point to array of N pointers. Each pointer, from `args[0]` to `args[N - 1]`, point to the region of memory from which the actual parameter will be copied.
2936    ///
2937    /// For templated functions, pass the function symbol as follows: func_name&lt;template_arg_0,…,template_arg_N>
2938    ///
2939    /// `sharedMem` sets the amount of dynamic shared memory that will be available to each thread block.
2940    ///
2941    /// `stream` specifies a stream the invocation is associated to.
2942    ///
2943    /// Note: This function uses standard default stream semantics.
2944    ///
2945    /// Note that this function may also return error codes from previous, asynchronous launches.
2946    ///
2947    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
2948    ///
2949    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
2950    ///
2951    /// Note: The API can also be used with a kernel [`cudaKernel_t`] by querying the handle using [`cudaLibraryGetKernel`] or [`cudaGetKernel`] and then passing it to the API by casting to void\*. The symbol `entryFuncAddr` passed to [`cudaGetKernel`] should be a symbol that is registered with the same CUDA Runtime instance.
2952    ///
2953    /// Note: Passing a symbol that belongs that belongs to a different runtime instance will result in undefined behavior. The only type that can be reliably passed to a different runtime instance is [`cudaKernel_t`].
2954    ///
2955    /// # Parameters
2956    ///
2957    /// - `func`: Device function symbol.
2958    /// - `gridDim`: Grid dimentions.
2959    /// - `blockDim`: Block dimentions.
2960    /// - `args`: Arguments.
2961    /// - `sharedMem`: Shared memory.
2962    /// - `stream`: Stream identifier.
2963    ///
2964    /// # Return value
2965    ///
2966    /// - [`cudaError_t::CUDA_SUCCESS`]
2967    /// - [`cudaErrorInvalidDeviceFunction`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ab6af535e7e53d3f21e2437e8977b8c2e)
2968    /// - [`cudaErrorInvalidConfiguration`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ad3934977826b2e1488dfeb7e0614e776)
2969    /// - [`cudaError_t::CUDA_ERROR_LAUNCH_FAILED`]
2970    /// - [`cudaError_t::CUDA_ERROR_LAUNCH_TIMEOUT`]
2971    /// - [`cudaError_t::CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES`]
2972    /// - [`cudaError_t::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED`]
2973    /// - [`cudaError_t::CUDA_ERROR_INVALID_PTX`]
2974    /// - [`cudaError_t::CUDA_ERROR_UNSUPPORTED_PTX_VERSION`]
2975    /// - [`cudaError_t::CUDA_ERROR_NO_BINARY_FOR_GPU`]
2976    /// - [`cudaError_t::CUDA_ERROR_JIT_COMPILER_NOT_FOUND`]
2977    /// - [`cudaError_t::CUDA_ERROR_JIT_COMPILATION_DISABLED`]
2978    ///
2979    /// See also: (C++, API), [`cuLaunchKernel`](crate::driver::cuLaunchKernel).
2980    pub fn cudaLaunchKernel(
2981        func: *const ::core::ffi::c_void,
2982        gridDim: dim3,
2983        blockDim: dim3,
2984        args: *mut *mut ::core::ffi::c_void,
2985        sharedMem: size_t,
2986        stream: cudaStream_t,
2987    ) -> cudaError_t;
2988}
2989singe_loader::functions! { crate::RUNTIME;
2990    /// Launches a CUDA function with launch-time configuration.
2991    ///
2992    /// Note that the functionally equivalent variadic template [cudaLaunchKernelEx](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1ga7d9168c86a4293639c75ea437465ed53) is available for C++11 and newer.
2993    ///
2994    /// Invokes the kernel `func` on `config->gridDim` (`config->gridDim.x ``config->gridDim.y ``config->gridDim.z`) grid of blocks. Each block contains `config->blockDim` (`config->blockDim.x ``config->blockDim.y ``config->blockDim.z`) threads.
2995    ///
2996    /// `config->dynamicSmemBytes` sets the amount of dynamic shared memory that will be available to each thread block.
2997    ///
2998    /// `config->stream` specifies a stream the invocation is associated to.
2999    ///
3000    /// Configuration beyond grid and block dimensions, dynamic shared memory size, and stream can be provided with the following two fields of `config:`
3001    ///
3002    /// `config->attrs` is an array of `config->numAttrs` contiguous [`cudaLaunchAttribute`] elements. The value of this pointer is not considered if `config->numAttrs` is zero. However, in that case, it is recommended to set the pointer to NULL. `config->numAttrs` is the number of attributes populating the first `config->numAttrs` positions of the `config->attrs` array.
3003    ///
3004    /// If the kernel has N parameters the `args` should point to array of N pointers. Each pointer, from `args[0]` to `args[N - 1]`, point to the region of memory from which the actual parameter will be copied.
3005    ///
3006    /// N.B. This function is so named to avoid unintentionally invoking the templated version, `cudaLaunchKernelEx`, for kernels taking a single void\*\* or void\* parameter.
3007    ///
3008    /// Note: This function uses standard default stream semantics.
3009    ///
3010    /// Note that this function may also return error codes from previous, asynchronous launches.
3011    ///
3012    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
3013    ///
3014    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
3015    ///
3016    /// Note: The API can also be used with a kernel [`cudaKernel_t`] by querying the handle using [`cudaLibraryGetKernel`] or [`cudaGetKernel`] and then passing it to the API by casting to void\*. The symbol `entryFuncAddr` passed to [`cudaGetKernel`] should be a symbol that is registered with the same CUDA Runtime instance.
3017    ///
3018    /// Note: Passing a symbol that belongs that belongs to a different runtime instance will result in undefined behavior. The only type that can be reliably passed to a different runtime instance is [`cudaKernel_t`].
3019    ///
3020    /// # Parameters
3021    ///
3022    /// - `config`: Launch configuration.
3023    /// - `func`: Kernel to launch.
3024    /// - `args`: Array of pointers to kernel parameters.
3025    ///
3026    /// # Return value
3027    ///
3028    /// - [`cudaError_t::CUDA_SUCCESS`]
3029    /// - [`cudaErrorInvalidDeviceFunction`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ab6af535e7e53d3f21e2437e8977b8c2e)
3030    /// - [`cudaErrorInvalidConfiguration`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ad3934977826b2e1488dfeb7e0614e776)
3031    /// - [`cudaError_t::CUDA_ERROR_LAUNCH_FAILED`]
3032    /// - [`cudaError_t::CUDA_ERROR_LAUNCH_TIMEOUT`]
3033    /// - [`cudaError_t::CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES`]
3034    /// - [`cudaError_t::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED`]
3035    /// - [`cudaError_t::CUDA_ERROR_INVALID_PTX`]
3036    /// - [`cudaError_t::CUDA_ERROR_UNSUPPORTED_PTX_VERSION`]
3037    /// - [`cudaError_t::CUDA_ERROR_NO_BINARY_FOR_GPU`]
3038    /// - [`cudaError_t::CUDA_ERROR_JIT_COMPILER_NOT_FOUND`]
3039    /// - [`cudaError_t::CUDA_ERROR_JIT_COMPILATION_DISABLED`]
3040    ///
3041    /// See also: [`cudaLaunchKernelEx`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1ga7d9168c86a4293639c75ea437465ed53), (const, [`cudaLaunchConfig_t`], *config, `void`, (*kernel)(ExpTypes…), `ActTypes`, &&…, args), “cudaLaunchKernelEx, (C++, API)”, [`cuLaunchKernelEx`](crate::driver::cuLaunchKernelEx).
3042    pub fn cudaLaunchKernelExC(
3043        config: *const cudaLaunchConfig_t,
3044        func: *const ::core::ffi::c_void,
3045        args: *mut *mut ::core::ffi::c_void,
3046    ) -> cudaError_t;
3047}
3048singe_loader::functions! { crate::RUNTIME;
3049    /// Launches a device function where thread blocks can cooperate and synchronize as they execute.
3050    ///
3051    /// The function invokes kernel `func` on `gridDim` (`gridDim.x ``gridDim.y ``gridDim.z`) grid of blocks. Each block contains `blockDim` (`blockDim.x ``blockDim.y ``blockDim.z`) threads.
3052    ///
3053    /// The device on which this kernel is invoked must have a non-zero value for the device attribute [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH`].
3054    ///
3055    /// The total number of blocks launched cannot exceed the maximum number of blocks per multiprocessor as returned by [`cudaOccupancyMaxActiveBlocksPerMultiprocessor`] (or [`cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags`]) times the number of multiprocessors as specified by the device attribute [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT`].
3056    ///
3057    /// The kernel cannot make use of CUDA dynamic parallelism.
3058    ///
3059    /// If the kernel has N parameters the `args` should point to array of N pointers. Each pointer, from `args[0]` to `args[N - 1]`, point to the region of memory from which the actual parameter will be copied.
3060    ///
3061    /// For templated functions, pass the function symbol as follows: func_name&lt;template_arg_0,…,template_arg_N>
3062    ///
3063    /// `sharedMem` sets the amount of dynamic shared memory that will be available to each thread block.
3064    ///
3065    /// `stream` specifies a stream the invocation is associated to.
3066    ///
3067    /// Note: This function uses standard default stream semantics.
3068    ///
3069    /// Note that this function may also return error codes from previous, asynchronous launches.
3070    ///
3071    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
3072    ///
3073    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
3074    ///
3075    /// Note: The API can also be used with a kernel [`cudaKernel_t`] by querying the handle using [`cudaLibraryGetKernel`] or [`cudaGetKernel`] and then passing it to the API by casting to void\*. The symbol `entryFuncAddr` passed to [`cudaGetKernel`] should be a symbol that is registered with the same CUDA Runtime instance.
3076    ///
3077    /// Note: Passing a symbol that belongs that belongs to a different runtime instance will result in undefined behavior. The only type that can be reliably passed to a different runtime instance is [`cudaKernel_t`].
3078    ///
3079    /// # Parameters
3080    ///
3081    /// - `func`: Device function symbol.
3082    /// - `gridDim`: Grid dimentions.
3083    /// - `blockDim`: Block dimentions.
3084    /// - `args`: Arguments.
3085    /// - `sharedMem`: Shared memory.
3086    /// - `stream`: Stream identifier.
3087    ///
3088    /// # Return value
3089    ///
3090    /// - [`cudaError_t::CUDA_SUCCESS`]
3091    /// - [`cudaErrorInvalidDeviceFunction`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ab6af535e7e53d3f21e2437e8977b8c2e)
3092    /// - [`cudaErrorInvalidConfiguration`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ad3934977826b2e1488dfeb7e0614e776)
3093    /// - [`cudaError_t::CUDA_ERROR_LAUNCH_FAILED`]
3094    /// - [`cudaError_t::CUDA_ERROR_LAUNCH_TIMEOUT`]
3095    /// - [`cudaError_t::CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES`]
3096    /// - [`cudaError_t::CUDA_ERROR_COOPERATIVE_LAUNCH_TOO_LARGE`]
3097    /// - [`cudaError_t::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED`]
3098    ///
3099    /// See also: (C++, API), [`cuLaunchCooperativeKernel`](crate::driver::cuLaunchCooperativeKernel).
3100    pub fn cudaLaunchCooperativeKernel(
3101        func: *const ::core::ffi::c_void,
3102        gridDim: dim3,
3103        blockDim: dim3,
3104        args: *mut *mut ::core::ffi::c_void,
3105        sharedMem: size_t,
3106        stream: cudaStream_t,
3107    ) -> cudaError_t;
3108}
3109singe_loader::functions! { crate::RUNTIME;
3110    /// Sets the preferred cache configuration for a device function.
3111    ///
3112    /// On devices where the L1 cache and shared memory use the same hardware resources, this sets through `cacheConfig` the preferred cache configuration for the function specified via `func`. This is only a preference. The runtime will use the requested configuration if possible, but it is free to choose a different configuration if required to execute `func`.
3113    ///
3114    /// `func` is a device function symbol and must be declared as a `__global__` function. If the specified function does not exist, then [cudaErrorInvalidDeviceFunction](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ab6af535e7e53d3f21e2437e8977b8c2e) is returned. For templated functions, pass the function symbol as follows: func_name&lt;template_arg_0,…,template_arg_N>
3115    ///
3116    /// This setting does nothing on devices where the size of the L1 cache and shared memory are fixed.
3117    ///
3118    /// Launching a kernel with a different preference than the most recent preference setting may insert a device-side synchronization point.
3119    ///
3120    /// The supported cache configurations are:
3121    ///
3122    /// * [`cudaFuncCache::CU_FUNC_CACHE_PREFER_NONE`]: no preference for shared memory or L1 (default)
3123    /// * [`cudaFuncCache::CU_FUNC_CACHE_PREFER_SHARED`]: prefer larger shared memory and smaller L1 cache
3124    /// * [`cudaFuncCache::CU_FUNC_CACHE_PREFER_L1`]: prefer larger L1 cache and smaller shared memory
3125    /// * [`cudaFuncCache::CU_FUNC_CACHE_PREFER_EQUAL`]: prefer equal size L1 cache and shared memory.
3126    ///
3127    /// Note that this function may also return error codes from previous, asynchronous launches.
3128    ///
3129    /// Note: Use of a string naming a function as the `func` parameter was deprecated in CUDA 4.1 and removed in CUDA 5.0.
3130    ///
3131    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
3132    ///
3133    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
3134    ///
3135    /// Note: This API does not accept a [`cudaKernel_t`] casted as void\*. If cache config modification is required for a [`cudaKernel_t`] (or a *`global`* function), it can be replaced with a call to `cudaFuncSetAttributes` with the attribute [`cudaFuncAttribute::CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT`] to specify a more granular L1 cache and shared memory split configuration.
3136    ///
3137    /// # Parameters
3138    ///
3139    /// - `func`: Device function symbol.
3140    /// - `cacheConfig`: Requested cache configuration.
3141    ///
3142    /// # Return value
3143    ///
3144    /// - [`cudaError_t::CUDA_SUCCESS`]
3145    /// - [`cudaErrorInvalidDeviceFunction`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ab6af535e7e53d3f21e2437e8977b8c2e)
3146    ///
3147    /// See also: [cudaFuncSetCacheConfig (C++ API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1ga981c8d74d33b21e7fd57609b7337653e), [`cudaFuncGetAttributes`] (C API), [`cudaLaunchKernel`] (C API), [`cuFuncSetCacheConfig`](crate::driver::cuFuncSetCacheConfig).
3148    pub fn cudaFuncSetCacheConfig(
3149        func: *const ::core::ffi::c_void,
3150        cacheConfig: cudaFuncCache,
3151    ) -> cudaError_t;
3152}
3153singe_loader::functions! { crate::RUNTIME;
3154    /// Find out attributes for a given function.
3155    ///
3156    /// This function obtains the attributes of a function specified via `func`. `func` is a device function symbol and must be declared as a `__global__` function. The fetched attributes are placed in `attr`. If the specified function does not exist, then it is assumed to be a [`cudaKernel_t`] and used as is. For templated functions, pass the function symbol as follows: func_name&lt;template_arg_0,…,template_arg_N>
3157    ///
3158    /// Note that some function attributes such as [maxThreadsPerBlock](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaFuncAttributes.html#structcudafuncattributes_1ab8350f491105f159ff684f5c59167af0) may vary based on the device that is currently being used.
3159    ///
3160    /// Note that this function may also return error codes from previous, asynchronous launches.
3161    ///
3162    /// Note: Use of a string naming a function as the `func` parameter was deprecated in CUDA 4.1 and removed in CUDA 5.0.
3163    ///
3164    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
3165    ///
3166    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
3167    ///
3168    /// Note: The API can also be used with a kernel [`cudaKernel_t`] by querying the handle using [`cudaLibraryGetKernel`] or [`cudaGetKernel`] and then passing it to the API by casting to void\*. The symbol `entryFuncAddr` passed to [`cudaGetKernel`] should be a symbol that is registered with the same CUDA Runtime instance.
3169    ///
3170    /// Note: Passing a symbol that belongs that belongs to a different runtime instance will result in undefined behavior. The only type that can be reliably passed to a different runtime instance is [`cudaKernel_t`].
3171    ///
3172    /// # Parameters
3173    ///
3174    /// - `attr`: Return pointer to function’s attributes.
3175    /// - `func`: Device function symbol.
3176    ///
3177    /// # Return value
3178    ///
3179    /// - [`cudaError_t::CUDA_SUCCESS`]
3180    /// - [`cudaErrorInvalidDeviceFunction`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ab6af535e7e53d3f21e2437e8977b8c2e)
3181    ///
3182    /// See also: [`cudaFuncSetCacheConfig`] (C API), [cudaFuncGetAttributes (C++ API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1ga36a9bf322521126dd7148a21aa48ff6c), [`cudaLaunchKernel`] (C API), [`cuFuncGetAttribute`](crate::driver::cuFuncGetAttribute).
3183    pub fn cudaFuncGetAttributes(
3184        attr: *mut cudaFuncAttributes,
3185        func: *const ::core::ffi::c_void,
3186    ) -> cudaError_t;
3187}
3188singe_loader::functions! { crate::RUNTIME;
3189    /// Set attributes for a given function.
3190    ///
3191    /// This function sets the attributes of a function specified via `func`. The parameter `func` must be a pointer to a function that executes on the device. The parameter specified by `func` must be declared as a `__global__` function. The enumeration defined by `attr` is set to the value defined by `value`. If the specified function does not exist, then it is assumed to be a [`cudaKernel_t`] and used as is. If the specified attribute cannot be written, or if the value is incorrect, then [`cudaError_t::CUDA_ERROR_INVALID_VALUE`] is returned.
3192    ///
3193    /// Valid values for `attr` are:
3194    ///
3195    /// * [`cudaFuncAttribute::CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES`] - The requested maximum size in bytes of dynamically-allocated shared memory. The sum of this value and the function attribute `sharedSizeBytes` cannot exceed the device attribute [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN`]. The maximal size of requestable dynamic shared memory may differ by GPU architecture.
3196    /// * [`cudaFuncAttribute::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 [`cudaDeviceAttr::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.
3197    /// * [`cudaFuncAttribute::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 cudaErrorNotPermitted.
3198    /// * [`cudaFuncAttribute::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 cudaErrorNotPermitted.
3199    /// * [`cudaFuncAttribute::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 cudaErrorNotPermitted.
3200    /// * [`cudaFuncAttribute::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.
3201    /// * [`cudaFuncAttribute::CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE`]: The block scheduling policy of a function. The value type is cudaClusterSchedulingPolicy.
3202    ///
3203    /// cudaLaunchKernel (C++ API), [cudaFuncSetCacheConfig (C++ API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1ga981c8d74d33b21e7fd57609b7337653e), [cudaFuncGetAttributes (C API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__EXECUTION.html#group__cudart__execution_1gace91ab5ae929d84d16860e4d1a189754),.
3204    ///
3205    /// Note that this function may also return error codes from previous, asynchronous launches.
3206    ///
3207    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
3208    ///
3209    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
3210    ///
3211    /// Note: The API can also be used with a kernel [`cudaKernel_t`] by querying the handle using [`cudaLibraryGetKernel`] or [`cudaGetKernel`] and then passing it to the API by casting to void\*. The symbol `entryFuncAddr` passed to [`cudaGetKernel`] should be a symbol that is registered with the same CUDA Runtime instance.
3212    ///
3213    /// Note: Passing a symbol that belongs that belongs to a different runtime instance will result in undefined behavior. The only type that can be reliably passed to a different runtime instance is [`cudaKernel_t`].
3214    ///
3215    /// # Parameters
3216    ///
3217    /// - `func`: Function to get attributes of.
3218    /// - `attr`: Attribute to set.
3219    /// - `value`: Value to set.
3220    ///
3221    /// # Return value
3222    ///
3223    /// - [`cudaError_t::CUDA_SUCCESS`]
3224    /// - [`cudaErrorInvalidDeviceFunction`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ab6af535e7e53d3f21e2437e8977b8c2e)
3225    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
3226    pub fn cudaFuncSetAttribute(
3227        func: *const ::core::ffi::c_void,
3228        attr: cudaFuncAttribute,
3229        value: ::core::ffi::c_int,
3230    ) -> cudaError_t;
3231}
3232singe_loader::functions! { crate::RUNTIME;
3233    /// Returns the function name for a device entry function pointer.
3234    ///
3235    /// Returns in `**name` the function name associated with the symbol `func`. The function name is returned as a null-terminated string. This API may return a mangled name if the function is not declared as having C linkage. If `**name` is NULL, [`cudaError_t::CUDA_ERROR_INVALID_VALUE`] is returned. If `func` is not a device entry function, then it is assumed to be a [`cudaKernel_t`] and used as is.
3236    ///
3237    /// cudaFuncGetName (C++ API).
3238    ///
3239    /// Note that this function may also return error codes from previous, asynchronous launches.
3240    ///
3241    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
3242    ///
3243    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
3244    ///
3245    /// Note: The API can also be used with a kernel [`cudaKernel_t`] by querying the handle using [`cudaLibraryGetKernel`] or [`cudaGetKernel`] and then passing it to the API by casting to void\*. The symbol `entryFuncAddr` passed to [`cudaGetKernel`] should be a symbol that is registered with the same CUDA Runtime instance.
3246    ///
3247    /// Note: Passing a symbol that belongs that belongs to a different runtime instance will result in undefined behavior. The only type that can be reliably passed to a different runtime instance is [`cudaKernel_t`].
3248    ///
3249    /// # Parameters
3250    ///
3251    /// - `name`: The returned name of the function.
3252    /// - `func`: The function pointer to retrieve name for.
3253    ///
3254    /// # Return value
3255    ///
3256    /// - [`cudaError_t::CUDA_SUCCESS`]
3257    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
3258    /// - [`cudaErrorInvalidDeviceFunction`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ab6af535e7e53d3f21e2437e8977b8c2e)
3259    pub fn cudaFuncGetName(
3260        name: *mut *const ::core::ffi::c_char,
3261        func: *const ::core::ffi::c_void,
3262    ) -> cudaError_t;
3263}
3264singe_loader::functions! { crate::RUNTIME;
3265    /// Returns the offset and size of a kernel parameter in the device-side parameter layout.
3266    ///
3267    /// Queries the kernel parameter at `paramIndex` in `func's` list of parameters and returns parameter information via `paramOffset` and `paramSize`. `paramOffset` returns the offset of the parameter in the device-side parameter layout. `paramSize` returns the size in bytes of the parameter. This information can be used to update kernel node parameters from the device via [cudaGraphKernelNodeSetParam()](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__GRAPH.html#group__cudart__graph_1ga9171bc40a4f9be650b3fe867e8bfb549) and [cudaGraphKernelNodeUpdatesApply()](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__GRAPH.html#group__cudart__graph_1ga2d558cf37c9616365c67447e61ac0d6a). `paramIndex` must be less than the number of parameters that `func` takes.
3268    ///
3269    /// Note that this function may also return error codes from previous, asynchronous launches.
3270    ///
3271    /// Note: The API can also be used with a kernel [`cudaKernel_t`] by querying the handle using [`cudaLibraryGetKernel`] or [`cudaGetKernel`] and then passing it to the API by casting to void\*. The symbol `entryFuncAddr` passed to [`cudaGetKernel`] should be a symbol that is registered with the same CUDA Runtime instance.
3272    ///
3273    /// Note: Passing a symbol that belongs that belongs to a different runtime instance will result in undefined behavior. The only type that can be reliably passed to a different runtime instance is [`cudaKernel_t`].
3274    ///
3275    /// # Parameters
3276    ///
3277    /// - `func`: The function to query.
3278    /// - `paramIndex`: The parameter index to query.
3279    /// - `paramOffset`: The offset into the device-side parameter layout at which the parameter resides.
3280    /// - `paramSize`: The size of the parameter in the device-side parameter layout.
3281    ///
3282    /// # Return value
3283    ///
3284    /// CUDA_SUCCESS, [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`](crate::driver::cudaError_enum::CUDA_ERROR_INVALID_VALUE),.
3285    pub fn cudaFuncGetParamInfo(
3286        func: *const ::core::ffi::c_void,
3287        paramIndex: size_t,
3288        paramOffset: *mut size_t,
3289        paramSize: *mut size_t,
3290    ) -> cudaError_t;
3291}
3292singe_loader::functions! { crate::RUNTIME;
3293    /// Returns the number of parameters used by the function.
3294    ///
3295    /// Queries the number of kernel parameters used by `func` and returns it in `paramCount`.
3296    ///
3297    /// Note that this function may also return error codes from previous, asynchronous launches.
3298    ///
3299    /// Note: The API can also be used with a kernel [`cudaKernel_t`] by querying the handle using [`cudaLibraryGetKernel`] or [`cudaGetKernel`] and then passing it to the API by casting to void\*. The symbol `entryFuncAddr` passed to [`cudaGetKernel`] should be a symbol that is registered with the same CUDA Runtime instance.
3300    ///
3301    /// Note: Passing a symbol that belongs that belongs to a different runtime instance will result in undefined behavior. The only type that can be reliably passed to a different runtime instance is [`cudaKernel_t`].
3302    ///
3303    /// # Parameters
3304    ///
3305    /// - `func`: The function to query.
3306    /// - `paramCount`: Returns the number of parameters used by the function.
3307    ///
3308    /// # Return value
3309    ///
3310    /// CUDA_SUCCESS, [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`](crate::driver::cudaError_enum::CUDA_ERROR_INVALID_VALUE),.
3311    pub fn cudaFuncGetParamCount(
3312        func: *const ::core::ffi::c_void,
3313        paramCount: *mut size_t,
3314    ) -> cudaError_t;
3315}
3316singe_loader::functions! { crate::RUNTIME;
3317    /// Enqueues a host function call in a stream.
3318    ///
3319    /// 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.
3320    ///
3321    /// The host function must not make any CUDA API calls. Attempting to use a CUDA API may result in [`cudaError_t::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.
3322    ///
3323    /// For the purposes of Unified Memory, execution makes a number of guarantees:
3324    ///
3325    /// * 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.
3326    /// * 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.
3327    /// * 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.
3328    /// * 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.
3329    ///
3330    /// Note that, in constrast to [`cuStreamAddCallback`](crate::driver::cuStreamAddCallback), the function will not be called in the event of an error in the CUDA context.
3331    ///
3332    /// Note: This function uses standard default stream semantics.
3333    ///
3334    /// Note that this function may also return error codes from previous, asynchronous launches.
3335    ///
3336    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
3337    ///
3338    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
3339    ///
3340    /// # Parameters
3341    ///
3342    /// - `stream`: Stream to enqueue function call in.
3343    /// - `fn_`: The function to call once preceding stream operations are complete.
3344    /// - `userData`: User-specified data to be passed to the function.
3345    ///
3346    /// # Return value
3347    ///
3348    /// - [`cudaError_t::CUDA_SUCCESS`]
3349    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
3350    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
3351    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
3352    ///
3353    /// See also: [`cudaStreamCreate`], [`cudaStreamQuery`], [`cudaStreamSynchronize`], [`cudaStreamWaitEvent`], [`cudaStreamDestroy`], [`cudaMallocManaged`], [`cudaStreamAttachMemAsync`], [`cudaStreamAddCallback`], [`cuLaunchHostFunc`](crate::driver::cuLaunchHostFunc).
3354    pub fn cudaLaunchHostFunc(
3355        stream: cudaStream_t,
3356        fn_: cudaHostFn_t,
3357        userData: *mut ::core::ffi::c_void,
3358    ) -> cudaError_t;
3359}
3360singe_loader::functions! { crate::RUNTIME;
3361    /// Enqueues a host function call in a stream.
3362    ///
3363    /// 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.
3364    ///
3365    /// The host function must not make any CUDA API calls. Attempting to use a CUDA API may result in [`cudaError_t::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.
3366    ///
3367    /// For the purposes of Unified Memory, execution makes a number of guarantees:
3368    ///
3369    /// * 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.
3370    /// * 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.
3371    /// * 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.
3372    /// * 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.
3373    ///
3374    /// Note that, in constrast to [`cuStreamAddCallback`](crate::driver::cuStreamAddCallback), the function will not be called in the event of an error in the CUDA context.
3375    ///
3376    /// Note: This function uses standard default stream semantics.
3377    ///
3378    /// Note that this function may also return error codes from previous, asynchronous launches.
3379    ///
3380    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
3381    ///
3382    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
3383    ///
3384    /// # Parameters
3385    ///
3386    /// - `stream`: Stream to enqueue function call in.
3387    /// - `fn_`: The function to call once preceding stream operations are complete.
3388    /// - `userData`: User-specified data to be passed to the function.
3389    /// - `syncMode`: Sync mode for the host function.
3390    ///
3391    /// # Return value
3392    ///
3393    /// - [`cudaError_t::CUDA_SUCCESS`]
3394    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
3395    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
3396    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
3397    ///
3398    /// See also: [`cudaStreamCreate`], [`cudaStreamQuery`], [`cudaStreamSynchronize`], [`cudaStreamWaitEvent`], [`cudaStreamDestroy`], [`cudaMallocManaged`], [`cudaStreamAttachMemAsync`], [`cudaStreamAddCallback`], [`cuLaunchHostFunc`](crate::driver::cuLaunchHostFunc).
3399    pub fn cudaLaunchHostFunc_v2(
3400        stream: cudaStream_t,
3401        fn_: cudaHostFn_t,
3402        userData: *mut ::core::ffi::c_void,
3403        syncMode: ::core::ffi::c_uint,
3404    ) -> cudaError_t;
3405}
3406singe_loader::functions! { crate::RUNTIME;
3407    /// Sets the shared memory configuration for a device function.
3408    ///
3409    /// 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.
3410    ///
3411    /// Any per-function setting of shared memory bank size set via [`cudaFuncSetSharedMemConfig`] will override the device wide setting set by [`cudaDeviceSetSharedMemConfig`].
3412    ///
3413    /// 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.
3414    ///
3415    /// This function will do nothing on devices with fixed shared memory bank size.
3416    ///
3417    /// For templated functions, pass the function symbol as follows: func_name&lt;template_arg_0,…,template_arg_N>
3418    ///
3419    /// The supported bank configurations are:
3420    ///
3421    /// * cudaSharedMemBankSizeDefault: use the device’s shared memory configuration when launching this function.
3422    /// * cudaSharedMemBankSizeFourByte: set shared memory bank width to be four bytes natively when launching this function.
3423    /// * cudaSharedMemBankSizeEightByte: set shared memory bank width to be eight bytes natively when launching this function.
3424    ///
3425    /// Note that this function may also return error codes from previous, asynchronous launches.
3426    ///
3427    /// Note: Use of a string naming a function as the `func` parameter was deprecated in CUDA 4.1 and removed in CUDA 5.0.
3428    ///
3429    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
3430    ///
3431    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
3432    ///
3433    /// # Parameters
3434    ///
3435    /// - `func`: Device function symbol.
3436    /// - `config`: Requested shared memory configuration.
3437    ///
3438    /// # Return value
3439    ///
3440    /// - [`cudaError_t::CUDA_SUCCESS`]
3441    /// - [`cudaErrorInvalidDeviceFunction`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ab6af535e7e53d3f21e2437e8977b8c2e)
3442    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
3443    ///
3444    /// See also: [`cudaDeviceSetSharedMemConfig`], [`cudaDeviceGetSharedMemConfig`], [`cudaDeviceSetCacheConfig`], [`cudaDeviceGetCacheConfig`], [`cudaFuncSetCacheConfig`], [`cuFuncSetSharedMemConfig`](crate::driver::cuFuncSetSharedMemConfig).
3445    #[deprecated]
3446    pub fn cudaFuncSetSharedMemConfig(
3447        func: *const ::core::ffi::c_void,
3448        config: cudaSharedMemConfig,
3449    ) -> cudaError_t;
3450}
3451singe_loader::functions! { crate::RUNTIME;
3452    /// Returns occupancy for a device function.
3453    ///
3454    /// Returns in `*numBlocks` the maximum number of active blocks per streaming multiprocessor for the device function.
3455    ///
3456    /// Note that this function may also return error codes from previous, asynchronous launches.
3457    ///
3458    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
3459    ///
3460    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
3461    ///
3462    /// Note: The API can also be used with a kernel [`cudaKernel_t`] by querying the handle using [`cudaLibraryGetKernel`] or [`cudaGetKernel`] and then passing it to the API by casting to void\*. The symbol `entryFuncAddr` passed to [`cudaGetKernel`] should be a symbol that is registered with the same CUDA Runtime instance.
3463    ///
3464    /// Note: Passing a symbol that belongs that belongs to a different runtime instance will result in undefined behavior. The only type that can be reliably passed to a different runtime instance is [`cudaKernel_t`].
3465    ///
3466    /// # Parameters
3467    ///
3468    /// - `numBlocks`: Returned occupancy.
3469    /// - `func`: Kernel function for which occupancy is calculated.
3470    /// - `blockSize`: Block size the kernel is intended to be launched with.
3471    /// - `dynamicSMemSize`: Per-block dynamic shared memory usage intended, in bytes.
3472    ///
3473    /// # Return value
3474    ///
3475    /// - [`cudaError_t::CUDA_SUCCESS`]
3476    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
3477    /// - [`cudaErrorInvalidDeviceFunction`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ab6af535e7e53d3f21e2437e8977b8c2e)
3478    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
3479    /// - [`cudaError_t::CUDA_ERROR_UNKNOWN`]
3480    ///
3481    /// See also: [`cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags`], [cudaOccupancyMaxPotentialBlockSize (C++ API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1gab3e5d4de4f1b514811746129733f61a5), [cudaOccupancyMaxPotentialBlockSizeWithFlags (C++ API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1ga39214f0e1b063a3e54e108f8fab44e80), [cudaOccupancyMaxPotentialBlockSizeVariableSMem (C++ API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1ga26aa6bf18325fdc9341bf64785f04c23), [cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags (C++ API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1ga005a74fcd98441f5b5a1816baeba2b34), [`cudaOccupancyAvailableDynamicSMemPerBlock`], (C++, API), [`cuOccupancyMaxActiveBlocksPerMultiprocessor`](crate::driver::cuOccupancyMaxActiveBlocksPerMultiprocessor).
3482    pub fn cudaOccupancyMaxActiveBlocksPerMultiprocessor(
3483        numBlocks: *mut ::core::ffi::c_int,
3484        func: *const ::core::ffi::c_void,
3485        blockSize: ::core::ffi::c_int,
3486        dynamicSMemSize: size_t,
3487    ) -> cudaError_t;
3488}
3489singe_loader::functions! { crate::RUNTIME;
3490    /// Returns dynamic shared memory available per block when launching `numBlocks` blocks on SM.
3491    ///
3492    /// Returns in `*dynamicSmemSize` the maximum size of dynamic shared memory to allow `numBlocks` blocks per SM.
3493    ///
3494    /// Note that this function may also return error codes from previous, asynchronous launches.
3495    ///
3496    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
3497    ///
3498    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
3499    ///
3500    /// Note: The API can also be used with a kernel [`cudaKernel_t`] by querying the handle using [`cudaLibraryGetKernel`] or [`cudaGetKernel`] and then passing it to the API by casting to void\*. The symbol `entryFuncAddr` passed to [`cudaGetKernel`] should be a symbol that is registered with the same CUDA Runtime instance.
3501    ///
3502    /// Note: Passing a symbol that belongs that belongs to a different runtime instance will result in undefined behavior. The only type that can be reliably passed to a different runtime instance is [`cudaKernel_t`].
3503    ///
3504    /// # Parameters
3505    ///
3506    /// - `dynamicSmemSize`: Returned maximum dynamic shared memory.
3507    /// - `func`: Kernel function for which occupancy is calculated.
3508    /// - `numBlocks`: Number of blocks to fit on SM.
3509    /// - `blockSize`: Size of the block.
3510    ///
3511    /// # Return value
3512    ///
3513    /// - [`cudaError_t::CUDA_SUCCESS`]
3514    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
3515    /// - [`cudaErrorInvalidDeviceFunction`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ab6af535e7e53d3f21e2437e8977b8c2e)
3516    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
3517    /// - [`cudaError_t::CUDA_ERROR_UNKNOWN`]
3518    ///
3519    /// See also: [`cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags`], [cudaOccupancyMaxPotentialBlockSize (C++ API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1gab3e5d4de4f1b514811746129733f61a5), [cudaOccupancyMaxPotentialBlockSizeWithFlags (C++ API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1ga39214f0e1b063a3e54e108f8fab44e80), [cudaOccupancyMaxPotentialBlockSizeVariableSMem (C++ API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1ga26aa6bf18325fdc9341bf64785f04c23), [cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags (C++ API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1ga005a74fcd98441f5b5a1816baeba2b34).
3520    pub fn cudaOccupancyAvailableDynamicSMemPerBlock(
3521        dynamicSmemSize: *mut size_t,
3522        func: *const ::core::ffi::c_void,
3523        numBlocks: ::core::ffi::c_int,
3524        blockSize: ::core::ffi::c_int,
3525    ) -> cudaError_t;
3526}
3527singe_loader::functions! { crate::RUNTIME;
3528    /// Returns occupancy for a device function with the specified flags.
3529    ///
3530    /// Returns in `*numBlocks` the maximum number of active blocks per streaming multiprocessor for the device function.
3531    ///
3532    /// The `flags` parameter controls how special cases are handled. Valid flags include:
3533    ///
3534    /// * [cudaOccupancyDefault](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga11570371f508845a9df47b17f85d90ac): keeps the default behavior as [`cudaOccupancyMaxActiveBlocksPerMultiprocessor`]
3535    /// * [cudaOccupancyDisableCachingOverride](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga0a30e61b561f0678f1bf39eb051033bf): This flag 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 this flag 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.
3536    ///
3537    /// Note that this function may also return error codes from previous, asynchronous launches.
3538    ///
3539    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
3540    ///
3541    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
3542    ///
3543    /// Note: The API can also be used with a kernel [`cudaKernel_t`] by querying the handle using [`cudaLibraryGetKernel`] or [`cudaGetKernel`] and then passing it to the API by casting to void\*. The symbol `entryFuncAddr` passed to [`cudaGetKernel`] should be a symbol that is registered with the same CUDA Runtime instance.
3544    ///
3545    /// Note: Passing a symbol that belongs that belongs to a different runtime instance will result in undefined behavior. The only type that can be reliably passed to a different runtime instance is [`cudaKernel_t`].
3546    ///
3547    /// # Parameters
3548    ///
3549    /// - `numBlocks`: Returned occupancy.
3550    /// - `func`: Kernel function for which occupancy is calculated.
3551    /// - `blockSize`: Block size the kernel is intended to be launched with.
3552    /// - `dynamicSMemSize`: Per-block dynamic shared memory usage intended, in bytes.
3553    /// - `flags`: Requested behavior for the occupancy calculator.
3554    ///
3555    /// # Return value
3556    ///
3557    /// - [`cudaError_t::CUDA_SUCCESS`]
3558    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
3559    /// - [`cudaErrorInvalidDeviceFunction`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ab6af535e7e53d3f21e2437e8977b8c2e)
3560    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
3561    /// - [`cudaError_t::CUDA_ERROR_UNKNOWN`]
3562    ///
3563    /// See also: [`cudaOccupancyMaxActiveBlocksPerMultiprocessor`], [cudaOccupancyMaxPotentialBlockSize (C++ API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1gab3e5d4de4f1b514811746129733f61a5), [cudaOccupancyMaxPotentialBlockSizeWithFlags (C++ API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1ga39214f0e1b063a3e54e108f8fab44e80), [cudaOccupancyMaxPotentialBlockSizeVariableSMem (C++ API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1ga26aa6bf18325fdc9341bf64785f04c23), [cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags (C++ API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1ga005a74fcd98441f5b5a1816baeba2b34), [`cudaOccupancyAvailableDynamicSMemPerBlock`], (C++, API), [`cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags`](crate::driver::cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags).
3564    pub fn cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(
3565        numBlocks: *mut ::core::ffi::c_int,
3566        func: *const ::core::ffi::c_void,
3567        blockSize: ::core::ffi::c_int,
3568        dynamicSMemSize: size_t,
3569        flags: ::core::ffi::c_uint,
3570    ) -> cudaError_t;
3571}
3572singe_loader::functions! { crate::RUNTIME;
3573    /// Given the kernel function (`func`) and launch configuration (`config`), return the maximum cluster size in `*clusterSize`.
3574    ///
3575    /// The cluster dimensions in `config` are ignored. If func has a required cluster size set (see [`cudaFuncGetAttributes`]),`*clusterSize` will reflect the required cluster size.
3576    ///
3577    /// 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.
3578    ///
3579    /// This function will respect the compile time launch bounds.
3580    ///
3581    /// Note that this function may also return error codes from previous, asynchronous launches.
3582    ///
3583    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
3584    ///
3585    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
3586    ///
3587    /// Note: The API can also be used with a kernel [`cudaKernel_t`] by querying the handle using [`cudaLibraryGetKernel`] or [`cudaGetKernel`] and then passing it to the API by casting to void\*. The symbol `entryFuncAddr` passed to [`cudaGetKernel`] should be a symbol that is registered with the same CUDA Runtime instance.
3588    ///
3589    /// Note: Passing a symbol that belongs that belongs to a different runtime instance will result in undefined behavior. The only type that can be reliably passed to a different runtime instance is [`cudaKernel_t`].
3590    ///
3591    /// # Parameters
3592    ///
3593    /// - `clusterSize`: Returned maximum cluster size that can be launched for the given kernel function and launch configuration.
3594    /// - `func`: Kernel function for which maximum cluster size is calculated.
3595    ///
3596    /// # Return value
3597    ///
3598    /// - [`cudaError_t::CUDA_SUCCESS`]
3599    /// - [`cudaErrorInvalidDeviceFunction`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ab6af535e7e53d3f21e2437e8977b8c2e)
3600    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
3601    /// - [`cudaError_t::CUDA_ERROR_UNKNOWN`]
3602    ///
3603    /// See also: [`cudaFuncGetAttributes`], (C++, API), [`cuOccupancyMaxPotentialClusterSize`](crate::driver::cuOccupancyMaxPotentialClusterSize).
3604    pub fn cudaOccupancyMaxPotentialClusterSize(
3605        clusterSize: *mut ::core::ffi::c_int,
3606        func: *const ::core::ffi::c_void,
3607        launchConfig: *const cudaLaunchConfig_t,
3608    ) -> cudaError_t;
3609}
3610singe_loader::functions! { crate::RUNTIME;
3611    /// 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`.
3612    ///
3613    /// If the function has required cluster size already set (see [`cudaFuncGetAttributes`]), 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.
3614    ///
3615    /// 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.
3616    ///
3617    /// Note that this function may also return error codes from previous, asynchronous launches.
3618    ///
3619    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
3620    ///
3621    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
3622    ///
3623    /// Note: The API can also be used with a kernel [`cudaKernel_t`] by querying the handle using [`cudaLibraryGetKernel`] or [`cudaGetKernel`] and then passing it to the API by casting to void\*. The symbol `entryFuncAddr` passed to [`cudaGetKernel`] should be a symbol that is registered with the same CUDA Runtime instance.
3624    ///
3625    /// Note: Passing a symbol that belongs that belongs to a different runtime instance will result in undefined behavior. The only type that can be reliably passed to a different runtime instance is [`cudaKernel_t`].
3626    ///
3627    /// # Parameters
3628    ///
3629    /// - `numClusters`: Returned maximum number of clusters that could co-exist on the target device.
3630    /// - `func`: Kernel function for which maximum number of clusters are calculated.
3631    ///
3632    /// # Return value
3633    ///
3634    /// - [`cudaError_t::CUDA_SUCCESS`]
3635    /// - [`cudaErrorInvalidDeviceFunction`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ab6af535e7e53d3f21e2437e8977b8c2e)
3636    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
3637    /// - [`cudaError_t::CUDA_ERROR_INVALID_CLUSTER_SIZE`]
3638    /// - [`cudaError_t::CUDA_ERROR_UNKNOWN`]
3639    ///
3640    /// See also: [`cudaFuncGetAttributes`], (C++, API), [`cuOccupancyMaxActiveClusters`](crate::driver::cuOccupancyMaxActiveClusters).
3641    pub fn cudaOccupancyMaxActiveClusters(
3642        numClusters: *mut ::core::ffi::c_int,
3643        func: *const ::core::ffi::c_void,
3644        launchConfig: *const cudaLaunchConfig_t,
3645    ) -> cudaError_t;
3646}
3647singe_loader::functions! { crate::RUNTIME;
3648    /// Allocates memory that will be automatically managed by the Unified Memory system.
3649    ///
3650    /// Allocates `size` bytes of managed memory on the device and returns in `*devPtr` a pointer to the allocated memory. If the device doesn’t support allocating managed memory, [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`] is returned. Support for managed memory can be queried using the device attribute [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY`]. The allocated memory is suitably aligned for any kind of variable. The memory is not cleared. If `size` is 0, [`cudaMallocManaged`] returns [`cudaError_t::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.
3651    ///
3652    /// `flags` specifies the default stream association for this allocation. `flags` must be one of [cudaMemAttachGlobal](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4808e47eba73eb94622ec70a9f9b91ff) or [cudaMemAttachHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4f9a428d18fdd89a99441d0dd27131c0). The default value for `flags` is [cudaMemAttachGlobal](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4808e47eba73eb94622ec70a9f9b91ff). If [cudaMemAttachGlobal](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4808e47eba73eb94622ec70a9f9b91ff) is specified, then this memory is accessible from any stream on any device. If [cudaMemAttachHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4f9a428d18fdd89a99441d0dd27131c0) is specified, then the allocation should not be accessed from devices that have a zero value for the device attribute [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`]; an explicit call to [`cudaStreamAttachMemAsync`] will be required to enable access on such devices.
3653    ///
3654    /// If the association is later changed via [`cudaStreamAttachMemAsync`] to a single stream, the default association, as specifed during [`cudaMallocManaged`], is restored when that stream is destroyed. For **managed** variables, the default association is always [cudaMemAttachGlobal](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4808e47eba73eb94622ec70a9f9b91ff). 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.
3655    ///
3656    /// Memory allocated with [`cudaMallocManaged`] should be released with [`cudaFree`].
3657    ///
3658    /// Device memory oversubscription is possible for GPUs that have a non-zero value for the device attribute [`cudaDeviceAttr::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.
3659    ///
3660    /// In a system where all GPUs have a non-zero value for the device attribute [`cudaDeviceAttr::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 [`cudaMemAdvise`]. The application can also explicitly migrate memory to a desired processor’s memory via [`cudaMemPrefetchAsync`].
3661    ///
3662    /// In a multi-GPU system where all of the GPUs have a zero value for the device attribute [`cudaDeviceAttr::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 [`cudaMallocManaged`] 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.
3663    ///
3664    /// 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 [`cudaDeviceAttr::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.
3665    ///
3666    /// * 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 [`cudaDeviceAttr::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.
3667    /// * 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 devices used in that process that support managed memory have to be peer-to-peer compatible with each other. The error [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`] will be returned if a device that supports managed memory is used and it is not peer-to-peer compatible with any of the other managed memory supporting devices that were previously used in that process, even if [`cudaDeviceReset`] has been called on those devices. These environment variables are described in the CUDA programming guide under the “CUDA environment variables” section.
3668    ///
3669    /// Note that this function may also return error codes from previous, asynchronous launches.
3670    ///
3671    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
3672    ///
3673    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
3674    ///
3675    /// # Parameters
3676    ///
3677    /// - `devPtr`: Pointer to allocated device memory.
3678    /// - `size`: Requested allocation size in bytes.
3679    /// - `flags`: Must be either [cudaMemAttachGlobal](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4808e47eba73eb94622ec70a9f9b91ff) or [cudaMemAttachHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4f9a428d18fdd89a99441d0dd27131c0) (defaults to [cudaMemAttachGlobal](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4808e47eba73eb94622ec70a9f9b91ff)).
3680    ///
3681    /// # Return value
3682    ///
3683    /// - [`cudaError_t::CUDA_SUCCESS`]
3684    /// - [`cudaError_t::CUDA_ERROR_OUT_OF_MEMORY`]
3685    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
3686    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
3687    ///
3688    /// See also: [`cudaMallocPitch`], [`cudaFree`], [`cudaMallocArray`], [`cudaFreeArray`], [`cudaMalloc3D`], [`cudaMalloc3DArray`], [`cudaMallocHost`] (C API), [`cudaFreeHost`], [`cudaHostAlloc`], [`cudaDeviceGetAttribute`], [`cudaStreamAttachMemAsync`], [`cuMemAllocManaged`](crate::driver::cuMemAllocManaged).
3689    pub fn cudaMallocManaged(
3690        devPtr: *mut *mut ::core::ffi::c_void,
3691        size: size_t,
3692        flags: ::core::ffi::c_uint,
3693    ) -> cudaError_t;
3694}
3695singe_loader::functions! { crate::RUNTIME;
3696    /// Allocate memory on the device.
3697    ///
3698    /// Allocates `size` bytes of linear memory on the device and returns in `*devPtr` a pointer to the allocated memory. The allocated memory is suitably aligned for any kind of variable. The memory is not cleared. [`cudaMalloc`] returns [`cudaError_t::CUDA_ERROR_OUT_OF_MEMORY`] in case of failure.
3699    ///
3700    /// The device version of [`cudaFree`] cannot be used with a `*devPtr` allocated using the host API, and vice versa.
3701    ///
3702    /// Note that this function may also return error codes from previous, asynchronous launches.
3703    ///
3704    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
3705    ///
3706    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
3707    ///
3708    /// # Parameters
3709    ///
3710    /// - `devPtr`: Pointer to allocated device memory.
3711    /// - `size`: Requested allocation size in bytes.
3712    ///
3713    /// # Return value
3714    ///
3715    /// - [`cudaError_t::CUDA_SUCCESS`]
3716    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
3717    /// - [`cudaError_t::CUDA_ERROR_OUT_OF_MEMORY`]
3718    /// - [`cudaError_t::CUDA_ERROR_EXTERNAL_DEVICE`]
3719    ///
3720    /// See also: [`cudaMallocPitch`], [`cudaFree`], [`cudaMallocArray`], [`cudaFreeArray`], [`cudaMalloc3D`], [`cudaMalloc3DArray`], [`cudaMallocHost`] (C API), [`cudaFreeHost`], [`cudaHostAlloc`], [`cuMemAlloc`](crate::driver::cuMemAlloc).
3721    pub fn cudaMalloc(
3722        devPtr: *mut *mut ::core::ffi::c_void,
3723        size: size_t,
3724    ) -> cudaError_t;
3725}
3726singe_loader::functions! { crate::RUNTIME;
3727    /// Allocates page-locked memory on the host.
3728    ///
3729    /// Allocates `size` 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 [`cudaMemcpy*()`](cudaMemcpy). 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()`.
3730    ///
3731    /// On systems where `pageableMemoryAccessUsesHostPageTables` is true, [`cudaMallocHost`] may not page-lock the allocated memory.
3732    ///
3733    /// Page-locking excessive amounts of memory with [`cudaMallocHost`] 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.
3734    ///
3735    /// Note that this function may also return error codes from previous, asynchronous launches.
3736    ///
3737    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
3738    ///
3739    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
3740    ///
3741    /// # Parameters
3742    ///
3743    /// - `ptr`: Pointer to allocated host memory.
3744    /// - `size`: Requested allocation size in bytes.
3745    ///
3746    /// # Return value
3747    ///
3748    /// - [`cudaError_t::CUDA_SUCCESS`]
3749    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
3750    /// - [`cudaError_t::CUDA_ERROR_OUT_OF_MEMORY`]
3751    /// - [`cudaError_t::CUDA_ERROR_EXTERNAL_DEVICE`]
3752    ///
3753    /// See also: [`cudaMalloc`], [`cudaMallocPitch`], [`cudaMallocArray`], [`cudaMalloc3D`], [`cudaMalloc3DArray`], [`cudaHostAlloc`], [`cudaFree`], [`cudaFreeArray`], [cudaMallocHost (C++ API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1gad5c991beb38e2b8419f50285707ae87e), [`cudaFreeHost`], [`cuMemAllocHost`](crate::driver::cuMemAllocHost).
3754    pub fn cudaMallocHost(
3755        ptr: *mut *mut ::core::ffi::c_void,
3756        size: size_t,
3757    ) -> cudaError_t;
3758}
3759singe_loader::functions! { crate::RUNTIME;
3760    /// Allocates pitched memory on the device.
3761    ///
3762    /// Allocates at least `width` (in bytes) \* `height` bytes of linear memory on the device and returns in `*devPtr` 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. The pitch returned in `*pitch` by [`cudaMallocPitch`] 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:
3763    ///
3764    /// ```text
3765    /// T* pElement = (T*)((char*)BaseAddress + Row * pitch) + Column;
3766    /// ```
3767    ///
3768    /// For allocations of 2D arrays, it is recommended that programmers consider performing pitch allocations using [`cudaMallocPitch`]. Due to pitch 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).
3769    ///
3770    /// Note that this function may also return error codes from previous, asynchronous launches.
3771    ///
3772    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
3773    ///
3774    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
3775    ///
3776    /// # Parameters
3777    ///
3778    /// - `devPtr`: Pointer to allocated pitched device memory.
3779    /// - `pitch`: Pitch for allocation.
3780    /// - `width`: Requested pitched allocation width (in bytes).
3781    /// - `height`: Requested pitched allocation height.
3782    ///
3783    /// # Return value
3784    ///
3785    /// - [`cudaError_t::CUDA_SUCCESS`]
3786    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
3787    /// - [`cudaError_t::CUDA_ERROR_OUT_OF_MEMORY`]
3788    ///
3789    /// See also: [`cudaMalloc`], [`cudaFree`], [`cudaMallocArray`], [`cudaFreeArray`], [`cudaMallocHost`] (C API), [`cudaFreeHost`], [`cudaMalloc3D`], [`cudaMalloc3DArray`], [`cudaHostAlloc`], [`cuMemAllocPitch`](crate::driver::cuMemAllocPitch).
3790    pub fn cudaMallocPitch(
3791        devPtr: *mut *mut ::core::ffi::c_void,
3792        pitch: *mut size_t,
3793        width: size_t,
3794        height: size_t,
3795    ) -> cudaError_t;
3796}
3797singe_loader::functions! { crate::RUNTIME;
3798    /// Allocate an array on the device.
3799    ///
3800    /// Allocates a CUDA array according to the [`cudaChannelFormatDesc`] structure `desc` and returns a handle to the new CUDA array in `*array`.
3801    ///
3802    /// The [`cudaChannelFormatDesc`] is defined as:
3803    ///
3804    /// ```text
3805    /// struct cudaChannelFormatDesc {
3806    /// int x, y, z, w;
3807    /// enum cudaChannelFormatKind f;
3808    /// };
3809    /// ```
3810    ///
3811    /// where [`cudaChannelFormatKind`] is one of [`cudaChannelFormatKind::cudaChannelFormatKindSigned`] , [`cudaChannelFormatKind::cudaChannelFormatKindUnsigned`] , or [`cudaChannelFormatKind::cudaChannelFormatKindFloat`] .
3812    ///
3813    /// The `flags` parameter enables different options to be specified that affect the allocation, as follows.
3814    ///
3815    /// * [cudaArrayDefault](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga6c47e87081bfd4f6030937f99ef12412): This flag’s value is defined to be 0 and provides default array allocation
3816    /// * [cudaArraySurfaceLoadStore](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga8cb5bdac32ad53c423992a125b3f9a66): Allocates an array that can be read from or written to using a surface reference
3817    /// * [cudaArrayTextureGather](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga142b19a14d56a03b1e410430aa5202d1): This flag indicates that texture gather operations will be performed on the array.
3818    /// * [cudaArraySparse](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga42c353686a15da063dc7722594ae4bff): Allocates a CUDA array without physical backing memory. The subregions within this sparse array can later be mapped onto a physical memory allocation by calling [`cuMemMapArrayAsync`](crate::driver::cuMemMapArrayAsync). The physical backing memory must be allocated via [`cuMemCreate`](crate::driver::cuMemCreate).
3819    /// * [cudaArrayDeferredMapping](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga91a50795515848406a89c2e6cef2fb02): Allocates a CUDA array without physical backing memory. The entire array can later be mapped onto a physical memory allocation by calling [`cuMemMapArrayAsync`](crate::driver::cuMemMapArrayAsync). The physical backing memory must be allocated via [`cuMemCreate`](crate::driver::cuMemCreate).
3820    ///
3821    /// `width` and `height` must meet certain size requirements. See [`cudaMalloc3DArray`] for more details.
3822    ///
3823    /// Note that this function may also return error codes from previous, asynchronous launches.
3824    ///
3825    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
3826    ///
3827    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
3828    ///
3829    /// # Parameters
3830    ///
3831    /// - `array`: Pointer to allocated array in device memory.
3832    /// - `desc`: Requested channel format.
3833    /// - `width`: Requested array allocation width.
3834    /// - `height`: Requested array allocation height.
3835    /// - `flags`: Requested properties of allocated array.
3836    ///
3837    /// # Return value
3838    ///
3839    /// - [`cudaError_t::CUDA_SUCCESS`]
3840    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
3841    /// - [`cudaError_t::CUDA_ERROR_OUT_OF_MEMORY`]
3842    ///
3843    /// See also: [`cudaMalloc`], [`cudaMallocPitch`], [`cudaFree`], [`cudaFreeArray`], [`cudaMallocHost`] (C API), [`cudaFreeHost`], [`cudaMalloc3D`], [`cudaMalloc3DArray`], [`cudaHostAlloc`], [`cuArrayCreate`](crate::driver::cuArrayCreate).
3844    pub fn cudaMallocArray(
3845        array: *mut cudaArray_t,
3846        desc: *const cudaChannelFormatDesc,
3847        width: size_t,
3848        height: size_t,
3849        flags: ::core::ffi::c_uint,
3850    ) -> cudaError_t;
3851}
3852singe_loader::functions! { crate::RUNTIME;
3853    /// Frees memory on the device.
3854    ///
3855    /// Frees the memory space pointed to by `devPtr`, which must have been returned by a previous call to one of the following memory allocation APIs - [`cudaMalloc`], [`cudaMallocPitch`], [`cudaMallocManaged`], [`cudaMallocAsync`], [`cudaMallocFromPoolAsync`].
3856    ///
3857    /// Note - This API will not perform any implicit synchronization when the pointer was allocated with [`cudaMallocAsync`] or [`cudaMallocFromPoolAsync`]. Callers must ensure that all accesses to these pointer have completed before invoking [`cudaFree`]. For best performance and memory reuse, users should use [`cudaFreeAsync`] to free memory allocated via the stream ordered memory allocator. For all other pointers, this API may perform implicit synchronization.
3858    ///
3859    /// If [`cudaFree`](`devPtr`) has already been called before, an error is returned. If `devPtr` is 0, no operation is performed. [`cudaFree`] returns `cudaErrorValue` in case of failure.
3860    ///
3861    /// The device version of [`cudaFree`] cannot be used with a `*devPtr` allocated using the host API, and vice versa.
3862    ///
3863    /// Note that this function may also return error codes from previous, asynchronous launches.
3864    ///
3865    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
3866    ///
3867    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
3868    ///
3869    /// # Parameters
3870    ///
3871    /// - `devPtr`: Device pointer to memory to free
3872    ///
3873    /// # Return value
3874    ///
3875    /// - [`cudaError_t::CUDA_SUCCESS`]
3876    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
3877    ///
3878    /// See also: [`cudaMalloc`], [`cudaMallocPitch`], [`cudaMallocManaged`], [`cudaMallocArray`], [`cudaFreeArray`], [`cudaMallocAsync`], [`cudaMallocFromPoolAsync`], [`cudaMallocHost`] (C API), [`cudaFreeHost`], [`cudaMalloc3D`], [`cudaMalloc3DArray`], [`cudaFreeAsync`], [`cudaHostAlloc`], [`cuMemFree`](crate::driver::cuMemFree).
3879    pub fn cudaFree(devPtr: *mut ::core::ffi::c_void) -> cudaError_t;
3880}
3881singe_loader::functions! { crate::RUNTIME;
3882    /// Frees page-locked memory.
3883    ///
3884    /// Frees the memory space pointed to by `hostPtr`, which must have been returned by a previous call to [`cudaMallocHost`] or [`cudaHostAlloc`].
3885    ///
3886    /// Note that this function may also return error codes from previous, asynchronous launches.
3887    ///
3888    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
3889    ///
3890    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
3891    ///
3892    /// # Parameters
3893    ///
3894    /// - `ptr`: Pointer to memory to free
3895    ///
3896    /// # Return value
3897    ///
3898    /// - [`cudaError_t::CUDA_SUCCESS`]
3899    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
3900    ///
3901    /// See also: [`cudaMalloc`], [`cudaMallocPitch`], [`cudaFree`], [`cudaMallocArray`], [`cudaFreeArray`], [`cudaMallocHost`] (C API), [`cudaMalloc3D`], [`cudaMalloc3DArray`], [`cudaHostAlloc`], [`cuMemFreeHost`](crate::driver::cuMemFreeHost).
3902    pub fn cudaFreeHost(ptr: *mut ::core::ffi::c_void) -> cudaError_t;
3903}
3904singe_loader::functions! { crate::RUNTIME;
3905    /// Frees an array on the device.
3906    ///
3907    /// Frees the CUDA array `array`, which must have been returned by a previous call to [`cudaMallocArray`]. If `devPtr` is 0, no operation is performed.
3908    ///
3909    /// Note that this function may also return error codes from previous, asynchronous launches.
3910    ///
3911    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
3912    ///
3913    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
3914    ///
3915    /// # Parameters
3916    ///
3917    /// - `array`: Pointer to array to free
3918    ///
3919    /// # Return value
3920    ///
3921    /// - [`cudaError_t::CUDA_SUCCESS`]
3922    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
3923    ///
3924    /// See also: [`cudaMalloc`], [`cudaMallocPitch`], [`cudaFree`], [`cudaMallocArray`], [`cudaMallocHost`] (C API), [`cudaFreeHost`], [`cudaHostAlloc`], [`cuArrayDestroy`](crate::driver::cuArrayDestroy).
3925    pub fn cudaFreeArray(array: cudaArray_t) -> cudaError_t;
3926}
3927singe_loader::functions! { crate::RUNTIME;
3928    /// Frees a mipmapped array on the device.
3929    ///
3930    /// Frees the CUDA mipmapped array `mipmappedArray`, which must have been returned by a previous call to [`cudaMallocMipmappedArray`]. If `devPtr` is 0, no operation is performed.
3931    ///
3932    /// Note that this function may also return error codes from previous, asynchronous launches.
3933    ///
3934    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
3935    ///
3936    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
3937    ///
3938    /// # Parameters
3939    ///
3940    /// - `mipmappedArray`: Pointer to mipmapped array to free
3941    ///
3942    /// # Return value
3943    ///
3944    /// - [`cudaError_t::CUDA_SUCCESS`]
3945    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
3946    ///
3947    /// See also: [`cudaMalloc`], [`cudaMallocPitch`], [`cudaFree`], [`cudaMallocArray`], [`cudaMallocHost`] (C API), [`cudaFreeHost`], [`cudaHostAlloc`], [`cuMipmappedArrayDestroy`](crate::driver::cuMipmappedArrayDestroy).
3948    pub fn cudaFreeMipmappedArray(mipmappedArray: cudaMipmappedArray_t) -> cudaError_t;
3949}
3950singe_loader::functions! { crate::RUNTIME;
3951    /// Allocates page-locked memory on the host.
3952    ///
3953    /// Allocates `size` 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 [`cudaMemcpy`]. 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()`. Allocating excessive amounts of pinned 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.
3954    ///
3955    /// The `flags` parameter enables different options to be specified that affect the allocation, as follows.
3956    ///
3957    /// * [`cudaHostAllocDefault`]: This flag’s value is defined to be 0 and causes [`cudaHostAlloc`] to emulate [`cudaMallocHost`].
3958    /// * [`cudaHostAllocPortable`]: The memory returned by this call will be considered as pinned memory by all CUDA contexts, not just the one that performed the allocation.
3959    /// * [`cudaHostAllocMapped`]: Maps the allocation into the CUDA address space. The device pointer to the memory may be obtained by calling [`cudaHostGetDevicePointer`].
3960    /// * [`cudaHostAllocWriteCombined`]: 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 device via mapped pinned memory or host->device transfers.
3961    ///
3962    /// 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.
3963    ///
3964    /// In order for the [`cudaHostAllocMapped`] flag to have any effect, the CUDA context must support the [cudaDeviceMapHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga3762be9cccdd809a4ca128354fd134b0) flag, which can be checked via [`cudaGetDeviceFlags`]. The [cudaDeviceMapHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga3762be9cccdd809a4ca128354fd134b0) flag is implicitly set for contexts created via the runtime API.
3965    ///
3966    /// The [`cudaHostAllocMapped`] flag may be specified on CUDA contexts for devices that do not support mapped pinned memory. The failure is deferred to [`cudaHostGetDevicePointer`] because the memory may be mapped into other CUDA contexts via the [`cudaHostAllocPortable`] flag.
3967    ///
3968    /// Memory allocated by this function must be freed with [`cudaFreeHost`].
3969    ///
3970    /// Note that this function may also return error codes from previous, asynchronous launches.
3971    ///
3972    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
3973    ///
3974    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
3975    ///
3976    /// # Parameters
3977    ///
3978    /// - `pHost`: Device pointer to allocated memory.
3979    /// - `size`: Requested allocation size in bytes.
3980    /// - `flags`: Requested properties of allocated memory.
3981    ///
3982    /// # Return value
3983    ///
3984    /// - [`cudaError_t::CUDA_SUCCESS`]
3985    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
3986    /// - [`cudaError_t::CUDA_ERROR_OUT_OF_MEMORY`]
3987    /// - [`cudaError_t::CUDA_ERROR_EXTERNAL_DEVICE`]
3988    ///
3989    /// See also: [`cudaSetDeviceFlags`], [`cudaMallocHost`] (C API), [`cudaFreeHost`], [`cudaGetDeviceFlags`], [`cuMemHostAlloc`](crate::driver::cuMemHostAlloc).
3990    pub fn cudaHostAlloc(
3991        pHost: *mut *mut ::core::ffi::c_void,
3992        size: size_t,
3993        flags: ::core::ffi::c_uint,
3994    ) -> cudaError_t;
3995}
3996singe_loader::functions! { crate::RUNTIME;
3997    /// Registers an existing host memory range for use by CUDA.
3998    ///
3999    /// Page-locks the memory range specified by `ptr` and `size` and maps it for the device(s) as specified by `flags`. This memory range also is added to the same tracking mechanism as [`cudaHostAlloc`] to automatically accelerate calls to functions such as [`cudaMemcpy`]. 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.
4000    ///
4001    /// On systems where `pageableMemoryAccessUsesHostPageTables` is true, [`cudaHostRegister`] will not page-lock the memory range specified by `ptr` but only populate unpopulated pages.
4002    ///
4003    /// [`cudaHostRegister`] is supported only on I/O coherent devices that have a non-zero value for the device attribute [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_HOST_REGISTER_SUPPORTED`].
4004    ///
4005    /// The `flags` parameter enables different options to be specified that affect the allocation, as follows.
4006    ///
4007    /// * [`cudaHostRegisterDefault`]: On a system with unified virtual addressing, the memory will be both mapped and portable. On a system with no unified virtual addressing, the memory will be neither mapped nor portable.
4008    /// * [`cudaHostRegisterPortable`]: The memory returned by this call will be considered as pinned memory by all CUDA contexts, not just the one that performed the allocation.
4009    /// * [`cudaHostRegisterMapped`]: Maps the allocation into the CUDA address space. The device pointer to the memory may be obtained by calling [`cudaHostGetDevicePointer`].
4010    /// * [`cudaHostRegisterIoMemory`]: The passed memory pointer is treated as pointing to some memory-mapped I/O space, e.g. belonging to a third-party PCIe device, and it will marked as non cache-coherent and contiguous.
4011    /// * [`cudaHostRegisterReadOnly`]: The passed memory pointer is treated as pointing to memory that is considered read-only by the device. On platforms without [`cudaDeviceAttr::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 [`cudaDeviceAttr::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 [`cudaHostRegister`] to error with cudaErrorNotSupported.
4012    ///
4013    /// All of these flags are orthogonal to one another: a developer may page-lock memory that is portable or mapped with no restrictions.
4014    ///
4015    /// The CUDA context must have been created with the `cudaMapHost` flag in order for the [`cudaHostRegisterMapped`] flag to have any effect.
4016    ///
4017    /// The [`cudaHostRegisterMapped`] flag may be specified on CUDA contexts for devices that do not support mapped pinned memory. The failure is deferred to [`cudaHostGetDevicePointer`] because the memory may be mapped into other CUDA contexts via the [`cudaHostRegisterPortable`] flag.
4018    ///
4019    /// For devices that have a non-zero value for the device attribute [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM`], the memory can also be accessed from the device using the host pointer `ptr`. The device pointer returned by [`cudaHostGetDevicePointer`] 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 [`cudaHostGetDevicePointer`] 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 [`cudaHostGetDevicePointer`] 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.
4020    ///
4021    /// The memory page-locked by this function must be unregistered with [`cudaHostUnregister`].
4022    ///
4023    /// Note that this function may also return error codes from previous, asynchronous launches.
4024    ///
4025    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
4026    ///
4027    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
4028    ///
4029    /// # Parameters
4030    ///
4031    /// - `ptr`: Host pointer to memory to page-lock.
4032    /// - `size`: Size in bytes of the address range to page-lock in bytes.
4033    /// - `flags`: Flags for allocation request.
4034    ///
4035    /// # Return value
4036    ///
4037    /// - [`cudaError_t::CUDA_SUCCESS`]
4038    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
4039    /// - [`cudaError_t::CUDA_ERROR_OUT_OF_MEMORY`]
4040    /// - [`cudaError_t::CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED`]
4041    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
4042    /// - [`cudaError_t::CUDA_ERROR_EXTERNAL_DEVICE`]
4043    ///
4044    /// See also: [`cudaHostUnregister`], [`cudaHostGetFlags`], [`cudaHostGetDevicePointer`], [`cuMemHostRegister`](crate::driver::cuMemHostRegister).
4045    pub fn cudaHostRegister(
4046        ptr: *mut ::core::ffi::c_void,
4047        size: size_t,
4048        flags: ::core::ffi::c_uint,
4049    ) -> cudaError_t;
4050}
4051singe_loader::functions! { crate::RUNTIME;
4052    /// Unregisters a memory range that was registered with cudaHostRegister.
4053    ///
4054    /// Unmaps the memory range whose base address is specified by `ptr`, and makes it pageable again.
4055    ///
4056    /// The base address must be the same one specified to [`cudaHostRegister`].
4057    ///
4058    /// Note that this function may also return error codes from previous, asynchronous launches.
4059    ///
4060    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
4061    ///
4062    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
4063    ///
4064    /// # Parameters
4065    ///
4066    /// - `ptr`: Host pointer to memory to unregister
4067    ///
4068    /// # Return value
4069    ///
4070    /// - [`cudaError_t::CUDA_SUCCESS`]
4071    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
4072    /// - [`cudaError_t::CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED`]
4073    ///
4074    /// See also: [`cuMemHostUnregister`](crate::driver::cuMemHostUnregister).
4075    pub fn cudaHostUnregister(ptr: *mut ::core::ffi::c_void) -> cudaError_t;
4076}
4077singe_loader::functions! { crate::RUNTIME;
4078    /// Passes back device pointer of mapped host memory allocated by cudaHostAlloc or registered by cudaHostRegister.
4079    ///
4080    /// Passes back the device pointer corresponding to the mapped, pinned host buffer allocated by [`cudaHostAlloc`] or registered by [`cudaHostRegister`].
4081    ///
4082    /// [`cudaHostGetDevicePointer`] will fail if the [cudaDeviceMapHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga3762be9cccdd809a4ca128354fd134b0) flag was not specified before deferred context creation occurred, or if called on a device that does not support mapped, pinned memory.
4083    ///
4084    /// For devices that have a non-zero value for the device attribute [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM`], the memory can also be accessed from the device using the host pointer `pHost`. The device pointer returned by [`cudaHostGetDevicePointer`] may or may not match the original host pointer `pHost` 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 [`cudaHostGetDevicePointer`] will match the original pointer `pHost`. If any device visible to the application has a zero value for the device attribute, the device pointer returned by [`cudaHostGetDevicePointer`] will not match the original host pointer `pHost`, 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.
4085    ///
4086    /// `flags` provides for future releases. For now, it must be set to 0.
4087    ///
4088    /// Note that this function may also return error codes from previous, asynchronous launches.
4089    ///
4090    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
4091    ///
4092    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
4093    ///
4094    /// # Parameters
4095    ///
4096    /// - `pDevice`: Returned device pointer for mapped memory.
4097    /// - `pHost`: Requested host pointer mapping.
4098    /// - `flags`: Flags for extensions (must be 0 for now).
4099    ///
4100    /// # Return value
4101    ///
4102    /// - [`cudaError_t::CUDA_SUCCESS`]
4103    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
4104    /// - [`cudaError_t::CUDA_ERROR_OUT_OF_MEMORY`]
4105    ///
4106    /// See also: [`cudaSetDeviceFlags`], [`cudaHostAlloc`], [`cuMemHostGetDevicePointer`](crate::driver::cuMemHostGetDevicePointer).
4107    pub fn cudaHostGetDevicePointer(
4108        pDevice: *mut *mut ::core::ffi::c_void,
4109        pHost: *mut ::core::ffi::c_void,
4110        flags: ::core::ffi::c_uint,
4111    ) -> cudaError_t;
4112}
4113singe_loader::functions! { crate::RUNTIME;
4114    /// Passes back flags used to allocate pinned host memory allocated by cudaHostAlloc.
4115    ///
4116    /// [`cudaHostGetFlags`] will fail if the input pointer does not reside in an address range allocated by [`cudaHostAlloc`].
4117    ///
4118    /// Note that this function may also return error codes from previous, asynchronous launches.
4119    ///
4120    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
4121    ///
4122    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
4123    ///
4124    /// # Parameters
4125    ///
4126    /// - `pFlags`: Returned flags word.
4127    /// - `pHost`: Host pointer.
4128    ///
4129    /// # Return value
4130    ///
4131    /// - [`cudaError_t::CUDA_SUCCESS`]
4132    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
4133    ///
4134    /// See also: [`cudaHostAlloc`], [`cuMemHostGetFlags`](crate::driver::cuMemHostGetFlags).
4135    pub fn cudaHostGetFlags(
4136        pFlags: *mut ::core::ffi::c_uint,
4137        pHost: *mut ::core::ffi::c_void,
4138    ) -> cudaError_t;
4139}
4140singe_loader::functions! { crate::RUNTIME;
4141    /// Allocates logical 1D, 2D, or 3D memory objects on the device.
4142    ///
4143    /// Allocates at least `width` \* `height` \* `depth` bytes of linear memory on the device and returns a [`cudaPitchedPtr`] in which `ptr` is a pointer to the allocated memory. The function may pad the allocation to ensure hardware alignment requirements are met. The pitch returned in the `pitch` field of `pitchedDevPtr` is the width in bytes of the allocation.
4144    ///
4145    /// The returned [`cudaPitchedPtr`] contains additional fields `xsize` and `ysize`, the logical width and height of the allocation, which are equivalent to the `width` and `height` `extent` parameters provided by the programmer during allocation.
4146    ///
4147    /// For allocations of 2D and 3D objects, it is highly recommended that programmers perform allocations using [`cudaMalloc3D`] or [`cudaMallocPitch`]. Due to alignment restrictions in the hardware, this is especially true if the application will be performing memory copies involving 2D or 3D objects (whether linear memory or CUDA arrays).
4148    ///
4149    /// Note that this function may also return error codes from previous, asynchronous launches.
4150    ///
4151    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
4152    ///
4153    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
4154    ///
4155    /// # Parameters
4156    ///
4157    /// - `pitchedDevPtr`: Pointer to allocated pitched device memory.
4158    /// - `extent`: Requested allocation size (`width` field in bytes).
4159    ///
4160    /// # Return value
4161    ///
4162    /// - [`cudaError_t::CUDA_SUCCESS`]
4163    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
4164    /// - [`cudaError_t::CUDA_ERROR_OUT_OF_MEMORY`]
4165    ///
4166    /// See also: [`cudaMallocPitch`], [`cudaFree`], [`cudaMemcpy3D`], [`cudaMemset3D`], [`cudaMalloc3DArray`], [`cudaMallocArray`], [`cudaFreeArray`], [`cudaMallocHost`] (C API), [`cudaFreeHost`], [`cudaHostAlloc`], [`make_cudaPitchedPtr`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__MEMORY.html#group__cudart__memory_1gac3f66f8f11f9949768ae8d10cad5a1a0), [`make_cudaExtent`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__MEMORY.html#group__cudart__memory_1ga66d2e640656aa155d4ed6650fc7a2a5e), [`cuMemAllocPitch`](crate::driver::cuMemAllocPitch).
4167    pub fn cudaMalloc3D(
4168        pitchedDevPtr: *mut cudaPitchedPtr,
4169        extent: cudaExtent,
4170    ) -> cudaError_t;
4171}
4172singe_loader::functions! { crate::RUNTIME;
4173    /// Allocate an array on the device.
4174    ///
4175    /// Allocates a CUDA array according to the [`cudaChannelFormatDesc`] structure `desc` and returns a handle to the new CUDA array in `*array`.
4176    ///
4177    /// The [`cudaChannelFormatDesc`] is defined as:
4178    ///
4179    /// ```text
4180    /// struct cudaChannelFormatDesc {
4181    /// int x, y, z, w;
4182    /// enum cudaChannelFormatKind f;
4183    /// };
4184    /// ```
4185    ///
4186    /// where [`cudaChannelFormatKind`] is one of [`cudaChannelFormatKind::cudaChannelFormatKindSigned`] , [`cudaChannelFormatKind::cudaChannelFormatKindUnsigned`] , or [`cudaChannelFormatKind::cudaChannelFormatKindFloat`] .
4187    ///
4188    /// [`cudaMalloc3DArray`] can allocate the following:
4189    ///
4190    /// * A 1D array is allocated if the height and depth extents are both zero.
4191    /// * A 2D array is allocated if only the depth extent is zero.
4192    /// * A 3D array is allocated if all three extents are non-zero.
4193    /// * A 1D layered CUDA array is allocated if only the height extent is zero and the cudaArrayLayered flag is set. Each layer is a 1D array. The number of layers is determined by the depth extent.
4194    /// * A 2D layered CUDA array is allocated if all three extents are non-zero and the cudaArrayLayered flag is set. Each layer is a 2D array. The number of layers is determined by the depth extent.
4195    /// * A cubemap CUDA array is allocated if all three extents are non-zero and the cudaArrayCubemap 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 [cudaGraphicsCubeFace](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gabf3ce16a621826a09263b8a58902fee8).
4196    /// * A cubemap layered CUDA array is allocated if all three extents are non-zero, and both, cudaArrayCubemap and cudaArrayLayered 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.
4197    ///
4198    /// The `flags` parameter enables different options to be specified that affect the allocation, as follows.
4199    ///
4200    /// * [cudaArrayDefault](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga6c47e87081bfd4f6030937f99ef12412): This flag’s value is defined to be 0 and provides default array allocation
4201    /// * [cudaArrayLayered](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga6d9a27dfb1207df13de0e822f75f4ab8): Allocates a layered CUDA array, with the depth extent indicating the number of layers
4202    /// * [cudaArrayCubemap](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga802843d69ca8be35ee050ff66782179e): Allocates a cubemap CUDA array. Width must be equal to height, and depth must be six. If the cudaArrayLayered flag is also set, depth must be a multiple of six.
4203    /// * [cudaArraySurfaceLoadStore](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga8cb5bdac32ad53c423992a125b3f9a66): Allocates a CUDA array that could be read from or written to using a surface reference.
4204    /// * [cudaArrayTextureGather](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga142b19a14d56a03b1e410430aa5202d1): This flag indicates that texture gather operations will be performed on the CUDA array. Texture gather can only be performed on 2D CUDA arrays.
4205    /// * [cudaArraySparse](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga42c353686a15da063dc7722594ae4bff): Allocates a CUDA array without physical backing memory. The subregions within this sparse array can later be mapped onto a physical memory allocation by calling [`cuMemMapArrayAsync`](crate::driver::cuMemMapArrayAsync). This flag can only be used for creating 2D, 3D or 2D layered sparse CUDA arrays. The physical backing memory must be allocated via [`cuMemCreate`](crate::driver::cuMemCreate).
4206    /// * [cudaArrayDeferredMapping](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga91a50795515848406a89c2e6cef2fb02): Allocates a CUDA array without physical backing memory. The entire array can later be mapped onto a physical memory allocation by calling [`cuMemMapArrayAsync`](crate::driver::cuMemMapArrayAsync). The physical backing memory must be allocated via [`cuMemCreate`](crate::driver::cuMemCreate).
4207    ///
4208    /// The width, height and depth extents must meet certain size requirements as listed in the following table. All values are specified in elements.
4209    ///
4210    /// Note that 2D CUDA arrays have different size requirements if the [cudaArrayTextureGather](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga142b19a14d56a03b1e410430aa5202d1) flag is set. In that case, the valid range for (width, height, depth) is ((1,maxTexture2DGather\[0\]), (1,maxTexture2DGather\[1\]), 0).
4211    ///
4212    /// | CUDA array type | Valid extents that must always be met {(width range in elements), (height range), (depth range)} | Valid extents with cudaArraySurfaceLoadStore set {(width range in elements), (height range), (depth range)} |
4213    /// | --- | --- | --- |
4214    /// | 1D | { (1,maxTexture1D), 0, 0 } | { (1,maxSurface1D), 0, 0 } |
4215    /// | 2D | { (1,maxTexture2D\[0\]), (1,maxTexture2D\[1\]), 0 } | { (1,maxSurface2D\[0\]), (1,maxSurface2D\[1\]), 0 } |
4216    /// | 3D | { (1,maxTexture3D\[0\]), (1,maxTexture3D\[1\]), (1,maxTexture3D\[2\]) } OR { (1,maxTexture3DAlt\[0\]), (1,maxTexture3DAlt\[1\]), (1,maxTexture3DAlt\[2\]) } | { (1,maxSurface3D\[0\]), (1,maxSurface3D\[1\]), (1,maxSurface3D\[2\]) } |
4217    /// | 1D Layered | { (1,maxTexture1DLayered\[0\]), 0, (1,maxTexture1DLayered\[1\]) } | { (1,maxSurface1DLayered\[0\]), 0, (1,maxSurface1DLayered\[1\]) } |
4218    /// | 2D Layered | { (1,maxTexture2DLayered\[0\]), (1,maxTexture2DLayered\[1\]), (1,maxTexture2DLayered\[2\]) } | { (1,maxSurface2DLayered\[0\]), (1,maxSurface2DLayered\[1\]), (1,maxSurface2DLayered\[2\]) } |
4219    /// | Cubemap | { (1,maxTextureCubemap), (1,maxTextureCubemap), 6 } | { (1,maxSurfaceCubemap), (1,maxSurfaceCubemap), 6 } |
4220    /// | Cubemap Layered | { (1,maxTextureCubemapLayered\[0\]), (1,maxTextureCubemapLayered\[0\]), (1,maxTextureCubemapLayered\[1\]) } | { (1,maxSurfaceCubemapLayered\[0\]), (1,maxSurfaceCubemapLayered\[0\]), (1,maxSurfaceCubemapLayered\[1\]) } |
4221    ///
4222    /// Note that this function may also return error codes from previous, asynchronous launches.
4223    ///
4224    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
4225    ///
4226    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
4227    ///
4228    /// # Parameters
4229    ///
4230    /// - `array`: Pointer to allocated array in device memory.
4231    /// - `desc`: Requested channel format.
4232    /// - `extent`: Requested allocation size (`width` field in elements).
4233    /// - `flags`: Flags for extensions.
4234    ///
4235    /// # Return value
4236    ///
4237    /// - [`cudaError_t::CUDA_SUCCESS`]
4238    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
4239    /// - [`cudaError_t::CUDA_ERROR_OUT_OF_MEMORY`]
4240    ///
4241    /// See also: [`cudaMalloc3D`], [`cudaMalloc`], [`cudaMallocPitch`], [`cudaFree`], [`cudaFreeArray`], [`cudaMallocHost`] (C API), [`cudaFreeHost`], [`cudaHostAlloc`], [`make_cudaExtent`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__MEMORY.html#group__cudart__memory_1ga66d2e640656aa155d4ed6650fc7a2a5e), [`cuArray3DCreate`](crate::driver::cuArray3DCreate).
4242    pub fn cudaMalloc3DArray(
4243        array: *mut cudaArray_t,
4244        desc: *const cudaChannelFormatDesc,
4245        extent: cudaExtent,
4246        flags: ::core::ffi::c_uint,
4247    ) -> cudaError_t;
4248}
4249singe_loader::functions! { crate::RUNTIME;
4250    /// Allocate a mipmapped array on the device.
4251    ///
4252    /// Allocates a CUDA mipmapped array according to the [`cudaChannelFormatDesc`] structure `desc` and returns a handle to the new CUDA mipmapped array in `*mipmappedArray`. `numLevels` specifies the number of mipmap levels to be allocated. This value is clamped to the range \[1, 1 + floor(log2(max(width, height, depth)))\].
4253    ///
4254    /// The [`cudaChannelFormatDesc`] is defined as:
4255    ///
4256    /// ```text
4257    /// struct cudaChannelFormatDesc {
4258    /// int x, y, z, w;
4259    /// enum cudaChannelFormatKind f;
4260    /// };
4261    /// ```
4262    ///
4263    /// where [`cudaChannelFormatKind`] is one of [`cudaChannelFormatKind::cudaChannelFormatKindSigned`] , [`cudaChannelFormatKind::cudaChannelFormatKindUnsigned`] , or [`cudaChannelFormatKind::cudaChannelFormatKindFloat`] .
4264    ///
4265    /// [`cudaMallocMipmappedArray`] can allocate the following:
4266    ///
4267    /// * A 1D mipmapped array is allocated if the height and depth extents are both zero.
4268    /// * A 2D mipmapped array is allocated if only the depth extent is zero.
4269    /// * A 3D mipmapped array is allocated if all three extents are non-zero.
4270    /// * A 1D layered CUDA mipmapped array is allocated if only the height extent is zero and the cudaArrayLayered flag is set. Each layer is a 1D mipmapped array. The number of layers is determined by the depth extent.
4271    /// * A 2D layered CUDA mipmapped array is allocated if all three extents are non-zero and the cudaArrayLayered flag is set. Each layer is a 2D mipmapped array. The number of layers is determined by the depth extent.
4272    /// * A cubemap CUDA mipmapped array is allocated if all three extents are non-zero and the cudaArrayCubemap flag is set. Width must be equal to height, and depth must be six. The order of the six layers in memory is the same as that listed in [cudaGraphicsCubeFace](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gabf3ce16a621826a09263b8a58902fee8).
4273    /// * A cubemap layered CUDA mipmapped array is allocated if all three extents are non-zero, and both, cudaArrayCubemap and cudaArrayLayered flags are set. Width must be equal to height, and depth must be a multiple of six. A cubemap layered CUDA mipmapped array is a special type of 2D layered CUDA mipmapped array that consists of a collection of cubemap mipmapped arrays. The first six layers represent the first cubemap mipmapped array, the next six layers form the second cubemap mipmapped array, and so on.
4274    ///
4275    /// The `flags` parameter enables different options to be specified that affect the allocation, as follows.
4276    ///
4277    /// * [cudaArrayDefault](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga6c47e87081bfd4f6030937f99ef12412): This flag’s value is defined to be 0 and provides default mipmapped array allocation
4278    /// * [cudaArrayLayered](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga6d9a27dfb1207df13de0e822f75f4ab8): Allocates a layered CUDA mipmapped array, with the depth extent indicating the number of layers
4279    /// * [cudaArrayCubemap](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga802843d69ca8be35ee050ff66782179e): Allocates a cubemap CUDA mipmapped array. Width must be equal to height, and depth must be six. If the cudaArrayLayered flag is also set, depth must be a multiple of six.
4280    /// * [cudaArraySurfaceLoadStore](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga8cb5bdac32ad53c423992a125b3f9a66): This flag indicates that individual mipmap levels of the CUDA mipmapped array will be read from or written to using a surface reference.
4281    /// * [cudaArrayTextureGather](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga142b19a14d56a03b1e410430aa5202d1): This flag indicates that texture gather operations will be performed on the CUDA array. Texture gather can only be performed on 2D CUDA mipmapped arrays, and the gather operations are performed only on the most detailed mipmap level.
4282    /// * [cudaArraySparse](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga42c353686a15da063dc7722594ae4bff): Allocates a CUDA mipmapped array without physical backing memory. The subregions within this sparse array can later be mapped onto a physical memory allocation by calling [`cuMemMapArrayAsync`](crate::driver::cuMemMapArrayAsync). This flag can only be used for creating 2D, 3D or 2D layered sparse CUDA mipmapped arrays. The physical backing memory must be allocated via [`cuMemCreate`](crate::driver::cuMemCreate).
4283    /// * [cudaArrayDeferredMapping](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga91a50795515848406a89c2e6cef2fb02): Allocates a CUDA mipmapped array without physical backing memory. The entire array can later be mapped onto a physical memory allocation by calling [`cuMemMapArrayAsync`](crate::driver::cuMemMapArrayAsync). The physical backing memory must be allocated via [`cuMemCreate`](crate::driver::cuMemCreate).
4284    ///
4285    /// The width, height and depth extents must meet certain size requirements as listed in the following table. All values are specified in elements.
4286    ///
4287    /// | CUDA array type | Valid extents that must always be met {(width range in elements), (height range), (depth range)} | Valid extents with cudaArraySurfaceLoadStore set {(width range in elements), (height range), (depth range)} |
4288    /// | --- | --- | --- |
4289    /// | 1D | { (1,maxTexture1DMipmap), 0, 0 } | { (1,maxSurface1D), 0, 0 } |
4290    /// | 2D | { (1,maxTexture2DMipmap\[0\]), (1,maxTexture2DMipmap\[1\]), 0 } | { (1,maxSurface2D\[0\]), (1,maxSurface2D\[1\]), 0 } |
4291    /// | 3D | { (1,maxTexture3D\[0\]), (1,maxTexture3D\[1\]), (1,maxTexture3D\[2\]) } OR { (1,maxTexture3DAlt\[0\]), (1,maxTexture3DAlt\[1\]), (1,maxTexture3DAlt\[2\]) } | { (1,maxSurface3D\[0\]), (1,maxSurface3D\[1\]), (1,maxSurface3D\[2\]) } |
4292    /// | 1D Layered | { (1,maxTexture1DLayered\[0\]), 0, (1,maxTexture1DLayered\[1\]) } | { (1,maxSurface1DLayered\[0\]), 0, (1,maxSurface1DLayered\[1\]) } |
4293    /// | 2D Layered | { (1,maxTexture2DLayered\[0\]), (1,maxTexture2DLayered\[1\]), (1,maxTexture2DLayered\[2\]) } | { (1,maxSurface2DLayered\[0\]), (1,maxSurface2DLayered\[1\]), (1,maxSurface2DLayered\[2\]) } |
4294    /// | Cubemap | { (1,maxTextureCubemap), (1,maxTextureCubemap), 6 } | { (1,maxSurfaceCubemap), (1,maxSurfaceCubemap), 6 } |
4295    /// | Cubemap Layered | { (1,maxTextureCubemapLayered\[0\]), (1,maxTextureCubemapLayered\[0\]), (1,maxTextureCubemapLayered\[1\]) } | { (1,maxSurfaceCubemapLayered\[0\]), (1,maxSurfaceCubemapLayered\[0\]), (1,maxSurfaceCubemapLayered\[1\]) } |
4296    ///
4297    /// Note that this function may also return error codes from previous, asynchronous launches.
4298    ///
4299    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
4300    ///
4301    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
4302    ///
4303    /// # Parameters
4304    ///
4305    /// - `mipmappedArray`: Pointer to allocated mipmapped array in device memory.
4306    /// - `desc`: Requested channel format.
4307    /// - `extent`: Requested allocation size (`width` field in elements).
4308    /// - `numLevels`: Number of mipmap levels to allocate.
4309    /// - `flags`: Flags for extensions.
4310    ///
4311    /// # Return value
4312    ///
4313    /// - [`cudaError_t::CUDA_SUCCESS`]
4314    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
4315    /// - [`cudaError_t::CUDA_ERROR_OUT_OF_MEMORY`]
4316    ///
4317    /// See also: [`cudaMalloc3D`], [`cudaMalloc`], [`cudaMallocPitch`], [`cudaFree`], [`cudaFreeArray`], [`cudaMallocHost`] (C API), [`cudaFreeHost`], [`cudaHostAlloc`], [`make_cudaExtent`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__MEMORY.html#group__cudart__memory_1ga66d2e640656aa155d4ed6650fc7a2a5e), [`cuMipmappedArrayCreate`](crate::driver::cuMipmappedArrayCreate).
4318    pub fn cudaMallocMipmappedArray(
4319        mipmappedArray: *mut cudaMipmappedArray_t,
4320        desc: *const cudaChannelFormatDesc,
4321        extent: cudaExtent,
4322        numLevels: ::core::ffi::c_uint,
4323        flags: ::core::ffi::c_uint,
4324    ) -> cudaError_t;
4325}
4326singe_loader::functions! { crate::RUNTIME;
4327    /// Gets a mipmap level of a CUDA mipmapped array.
4328    ///
4329    /// Returns in `*levelArray` a CUDA array that represents a single mipmap level of the CUDA mipmapped array `mipmappedArray`.
4330    ///
4331    /// If `level` is greater than the maximum number of levels in this mipmapped array, [`cudaError_t::CUDA_ERROR_INVALID_VALUE`] is returned.
4332    ///
4333    /// If `mipmappedArray` is NULL, [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`] is returned.
4334    ///
4335    /// Note that this function may also return error codes from previous, asynchronous launches.
4336    ///
4337    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
4338    ///
4339    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
4340    ///
4341    /// # Parameters
4342    ///
4343    /// - `levelArray`: Returned mipmap level CUDA array.
4344    /// - `mipmappedArray`: CUDA mipmapped array.
4345    /// - `level`: Mipmap level.
4346    ///
4347    /// # Return value
4348    ///
4349    /// - [`cudaError_t::CUDA_SUCCESS`]
4350    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
4351    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
4352    ///
4353    /// See also: [`cudaMalloc3D`], [`cudaMalloc`], [`cudaMallocPitch`], [`cudaFree`], [`cudaFreeArray`], [`cudaMallocHost`] (C API), [`cudaFreeHost`], [`cudaHostAlloc`], [`make_cudaExtent`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__MEMORY.html#group__cudart__memory_1ga66d2e640656aa155d4ed6650fc7a2a5e), [`cuMipmappedArrayGetLevel`](crate::driver::cuMipmappedArrayGetLevel).
4354    pub fn cudaGetMipmappedArrayLevel(
4355        levelArray: *mut cudaArray_t,
4356        mipmappedArray: cudaMipmappedArray_const_t,
4357        level: ::core::ffi::c_uint,
4358    ) -> cudaError_t;
4359}
4360singe_loader::functions! { crate::RUNTIME;
4361    /// Copies data between 3D objects.
4362    ///
4363    /// ```text
4364    /// struct cudaExtent {
4365    ///   size_t width;
4366    ///   size_t height;
4367    ///   size_t depth;
4368    /// };
4369    /// struct cudaExtent make_cudaExtent(size_t w, size_t h, size_t d);
4370    ///
4371    /// struct cudaPos {
4372    ///   size_t x;
4373    ///   size_t y;
4374    ///   size_t z;
4375    /// };
4376    /// struct cudaPos make_cudaPos(size_t x, size_t y, size_t z);
4377    ///
4378    /// struct cudaMemcpy3DParms {
4379    ///   cudaArray_t           srcArray;
4380    ///   struct cudaPos        srcPos;
4381    ///   struct cudaPitchedPtr srcPtr;
4382    ///   cudaArray_t           dstArray;
4383    ///   struct cudaPos        dstPos;
4384    ///   struct cudaPitchedPtr dstPtr;
4385    ///   struct cudaExtent     extent;
4386    ///   enum cudaMemcpyKind   kind;
4387    /// };
4388    /// ```
4389    ///
4390    /// [`cudaMemcpy3D`] copies data betwen two 3D objects. The source and destination objects may be in either host memory, device memory, or a CUDA array. The source, destination, extent, and kind of copy performed is specified by the [`cudaMemcpy3DParms`] struct which should be initialized to zero before use:
4391    ///
4392    /// ```text
4393    /// cudaMemcpy3DParms myParms = {0};
4394    /// ```
4395    ///
4396    /// The struct passed to [`cudaMemcpy3D`] must specify one of `srcArray` or `srcPtr` and one of `dstArray` or `dstPtr`. Passing more than one non-zero source or destination will cause [`cudaMemcpy3D`] to return an error.
4397    ///
4398    /// The `srcPos` and `dstPos` fields are optional offsets into the source and destination objects and are defined in units of each object’s elements. The element for a host or device pointer is assumed to be **unsigned char**.
4399    ///
4400    /// The `extent` field defines the dimensions of the transferred area in elements. If a CUDA array is participating in the copy, the extent is defined in terms of that array’s elements. If no CUDA array is participating in the copy then the extents are defined in elements of **unsigned char**.
4401    ///
4402    /// The `kind` field defines the direction of the copy. It must be one of [`cudaMemcpyKind::cudaMemcpyHostToHost`], [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing. For [`cudaMemcpyKind::cudaMemcpyHostToHost`] or [`cudaMemcpyKind::cudaMemcpyHostToDevice`] or [`cudaMemcpyKind::cudaMemcpyDeviceToHost`] passed as kind and cudaArray type passed as source or destination, if the kind implies cudaArray type to be present on the host, [`cudaMemcpy3D`] will disregard that implication and silently correct the kind based on the fact that cudaArray type can only be present on the device.
4403    ///
4404    /// If the source and destination are both arrays, [`cudaMemcpy3D`] will return an error if they do not have the same element size.
4405    ///
4406    /// The source and destination object may not overlap. If overlapping source and destination objects are specified, undefined behavior will result.
4407    ///
4408    /// The source object must entirely contain the region defined by `srcPos` and `extent`. The destination object must entirely contain the region defined by `dstPos` and `extent`.
4409    ///
4410    /// [`cudaMemcpy3D`] returns an error if the pitch of `srcPtr` or `dstPtr` exceeds the maximum allowed. The pitch of a [`cudaPitchedPtr`] allocated with [`cudaMalloc3D`] will always be valid.
4411    ///
4412    /// Note that this function may also return error codes from previous, asynchronous launches.
4413    ///
4414    /// Note: This function exhibits synchronous behavior for most use cases.
4415    ///
4416    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
4417    ///
4418    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
4419    ///
4420    /// # Parameters
4421    ///
4422    /// - `p`: 3D memory copy parameters
4423    ///
4424    /// # Return value
4425    ///
4426    /// - [`cudaError_t::CUDA_SUCCESS`]
4427    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
4428    /// - [`cudaErrorInvalidPitchValue`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a225c65c0348cced651d5dd87ccc22f48)
4429    /// - [`cudaErrorInvalidMemcpyDirection`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a72ce39cee8ef48a83b0191b2e33d2630)
4430    ///
4431    /// See also: [`cudaMalloc3D`], [`cudaMalloc3DArray`], [`cudaMemset3D`], [`cudaMemcpy3DAsync`], [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpy2DToArray`], [`cudaMemcpy2DFromArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [`make_cudaExtent`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__MEMORY.html#group__cudart__memory_1ga66d2e640656aa155d4ed6650fc7a2a5e), [`make_cudaPos`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__MEMORY.html#group__cudart__memory_1gafdde5695fcf95a6ec8899c3943f7dd8c), [`cuMemcpy3D`](crate::driver::cuMemcpy3D).
4432    pub fn cudaMemcpy3D(p: *const cudaMemcpy3DParms) -> cudaError_t;
4433}
4434singe_loader::functions! { crate::RUNTIME;
4435    /// Copies memory between devices.
4436    ///
4437    /// Perform a 3D memory copy according to the parameters specified in `p`. See the definition of the [`cudaMemcpy3DPeerParms`] structure for documentation of its parameters.
4438    ///
4439    /// Note that this function is synchronous with respect to the host only if the source or destination of the transfer is host memory. Note also that this copy is serialized with respect to all pending and future asynchronous work in to the current device, the copy’s source device, and the copy’s destination device (use [`cudaMemcpy3DPeerAsync`] to avoid this synchronization).
4440    ///
4441    /// Note that this function may also return error codes from previous, asynchronous launches.
4442    ///
4443    /// Note: This function exhibits synchronous behavior for most use cases.
4444    ///
4445    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
4446    ///
4447    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
4448    ///
4449    /// # Parameters
4450    ///
4451    /// - `p`: Parameters for the memory copy
4452    ///
4453    /// # Return value
4454    ///
4455    /// - [`cudaError_t::CUDA_SUCCESS`]
4456    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
4457    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
4458    /// - [`cudaErrorInvalidPitchValue`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a225c65c0348cced651d5dd87ccc22f48)
4459    ///
4460    /// See also: [`cudaMemcpy`], [`cudaMemcpyPeer`], [`cudaMemcpyAsync`], [`cudaMemcpyPeerAsync`], [`cudaMemcpy3DPeerAsync`], [`cuMemcpy3DPeer`](crate::driver::cuMemcpy3DPeer).
4461    pub fn cudaMemcpy3DPeer(p: *const cudaMemcpy3DPeerParms) -> cudaError_t;
4462}
4463singe_loader::functions! { crate::RUNTIME;
4464    /// Copies data between 3D objects.
4465    ///
4466    /// ```text
4467    /// struct cudaExtent {
4468    ///   size_t width;
4469    ///   size_t height;
4470    ///   size_t depth;
4471    /// };
4472    /// struct cudaExtent make_cudaExtent(size_t w, size_t h, size_t d);
4473    ///
4474    /// struct cudaPos {
4475    ///   size_t x;
4476    ///   size_t y;
4477    ///   size_t z;
4478    /// };
4479    /// struct cudaPos make_cudaPos(size_t x, size_t y, size_t z);
4480    ///
4481    /// struct cudaMemcpy3DParms {
4482    ///   cudaArray_t           srcArray;
4483    ///   struct cudaPos        srcPos;
4484    ///   struct cudaPitchedPtr srcPtr;
4485    ///   cudaArray_t           dstArray;
4486    ///   struct cudaPos        dstPos;
4487    ///   struct cudaPitchedPtr dstPtr;
4488    ///   struct cudaExtent     extent;
4489    ///   enum cudaMemcpyKind   kind;
4490    /// };
4491    /// ```
4492    ///
4493    /// [`cudaMemcpy3DAsync`] copies data betwen two 3D objects. The source and destination objects may be in either host memory, device memory, or a CUDA array. The source, destination, extent, and kind of copy performed is specified by the [`cudaMemcpy3DParms`] struct which should be initialized to zero before use:
4494    ///
4495    /// ```text
4496    /// cudaMemcpy3DParms myParms = {0};
4497    /// ```
4498    ///
4499    /// The struct passed to [`cudaMemcpy3DAsync`] must specify one of `srcArray` or `srcPtr` and one of `dstArray` or `dstPtr`. Passing more than one non-zero source or destination will cause [`cudaMemcpy3DAsync`] to return an error.
4500    ///
4501    /// The `srcPos` and `dstPos` fields are optional offsets into the source and destination objects and are defined in units of each object’s elements. The element for a host or device pointer is assumed to be **unsigned char**. For CUDA arrays, positions must be in the range [0, 2048) for any dimension.
4502    ///
4503    /// The `extent` field defines the dimensions of the transferred area in elements. If a CUDA array is participating in the copy, the extent is defined in terms of that array’s elements. If no CUDA array is participating in the copy then the extents are defined in elements of **unsigned char**.
4504    ///
4505    /// The `kind` field defines the direction of the copy. It must be one of [`cudaMemcpyKind::cudaMemcpyHostToHost`], [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing. For [`cudaMemcpyKind::cudaMemcpyHostToHost`] or [`cudaMemcpyKind::cudaMemcpyHostToDevice`] or [`cudaMemcpyKind::cudaMemcpyDeviceToHost`] passed as kind and cudaArray type passed as source or destination, if the kind implies cudaArray type to be present on the host, [`cudaMemcpy3DAsync`] will disregard that implication and silently correct the kind based on the fact that cudaArray type can only be present on the device.
4506    ///
4507    /// If the source and destination are both arrays, [`cudaMemcpy3DAsync`] will return an error if they do not have the same element size.
4508    ///
4509    /// The source and destination object may not overlap. If overlapping source and destination objects are specified, undefined behavior will result.
4510    ///
4511    /// The source object must lie entirely within the region defined by `srcPos` and `extent`. The destination object must lie entirely within the region defined by `dstPos` and `extent`.
4512    ///
4513    /// [`cudaMemcpy3DAsync`] returns an error if the pitch of `srcPtr` or `dstPtr` exceeds the maximum allowed. The pitch of a [`cudaPitchedPtr`] allocated with [`cudaMalloc3D`] will always be valid.
4514    ///
4515    /// [`cudaMemcpy3DAsync`] is asynchronous with respect to the host, so the call may return before the copy is complete. The copy can optionally be associated to a stream by passing a non-zero `stream` argument. If `kind` is [`cudaMemcpyKind::cudaMemcpyHostToDevice`] or [`cudaMemcpyKind::cudaMemcpyDeviceToHost`] and `stream` is non-zero, the copy may overlap with operations in other streams.
4516    ///
4517    /// The device version of this function only handles device to device copies and cannot be given local or shared pointers.
4518    ///
4519    /// Note that this function may also return error codes from previous, asynchronous launches.
4520    ///
4521    /// Note: This function exhibits asynchronous behavior for most use cases.
4522    ///
4523    /// Note: This function uses standard default stream semantics.
4524    ///
4525    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
4526    ///
4527    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
4528    ///
4529    /// # Parameters
4530    ///
4531    /// - `p`: 3D memory copy parameters.
4532    /// - `stream`: Stream identifier.
4533    ///
4534    /// # Return value
4535    ///
4536    /// - [`cudaError_t::CUDA_SUCCESS`]
4537    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
4538    /// - [`cudaErrorInvalidPitchValue`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a225c65c0348cced651d5dd87ccc22f48)
4539    /// - [`cudaErrorInvalidMemcpyDirection`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a72ce39cee8ef48a83b0191b2e33d2630)
4540    ///
4541    /// See also: [`cudaMalloc3D`], [`cudaMalloc3DArray`], [`cudaMemset3D`], [`cudaMemcpy3D`], [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpy2DToArray`], :, [`cudaMemcpy2DFromArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [`make_cudaExtent`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__MEMORY.html#group__cudart__memory_1ga66d2e640656aa155d4ed6650fc7a2a5e), [`make_cudaPos`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__MEMORY.html#group__cudart__memory_1gafdde5695fcf95a6ec8899c3943f7dd8c), [`cuMemcpy3DAsync`](crate::driver::cuMemcpy3DAsync).
4542    pub fn cudaMemcpy3DAsync(
4543        p: *const cudaMemcpy3DParms,
4544        stream: cudaStream_t,
4545    ) -> cudaError_t;
4546}
4547singe_loader::functions! { crate::RUNTIME;
4548    /// Copies memory between devices asynchronously.
4549    ///
4550    /// Perform a 3D memory copy according to the parameters specified in `p`. See the definition of the [`cudaMemcpy3DPeerParms`] structure for documentation of its parameters.
4551    ///
4552    /// Note that this function may also return error codes from previous, asynchronous launches.
4553    ///
4554    /// Note: This function exhibits asynchronous behavior for most use cases.
4555    ///
4556    /// Note: This function uses standard default stream semantics.
4557    ///
4558    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
4559    ///
4560    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
4561    ///
4562    /// # Parameters
4563    ///
4564    /// - `p`: Parameters for the memory copy.
4565    /// - `stream`: Stream identifier.
4566    ///
4567    /// # Return value
4568    ///
4569    /// - [`cudaError_t::CUDA_SUCCESS`]
4570    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
4571    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
4572    /// - [`cudaErrorInvalidPitchValue`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a225c65c0348cced651d5dd87ccc22f48)
4573    ///
4574    /// See also: [`cudaMemcpy`], [`cudaMemcpyPeer`], [`cudaMemcpyAsync`], [`cudaMemcpyPeerAsync`], [`cuMemcpy3DPeerAsync`](crate::driver::cuMemcpy3DPeerAsync).
4575    pub fn cudaMemcpy3DPeerAsync(
4576        p: *const cudaMemcpy3DPeerParms,
4577        stream: cudaStream_t,
4578    ) -> cudaError_t;
4579}
4580singe_loader::functions! { crate::RUNTIME;
4581    /// Gets free and total device memory.
4582    ///
4583    /// 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.
4584    ///
4585    /// 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.
4586    ///
4587    /// Note that this function may also return error codes from previous, asynchronous launches.
4588    ///
4589    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
4590    ///
4591    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
4592    ///
4593    /// # Parameters
4594    ///
4595    /// - `free`: Returned free memory in bytes.
4596    /// - `total`: Returned total memory in bytes.
4597    ///
4598    /// # Return value
4599    ///
4600    /// - [`cudaError_t::CUDA_SUCCESS`]
4601    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
4602    /// - [`cudaError_t::CUDA_ERROR_LAUNCH_FAILED`]
4603    ///
4604    /// See also: [`cuMemGetInfo`](crate::driver::cuMemGetInfo).
4605    pub fn cudaMemGetInfo(free: *mut size_t, total: *mut size_t) -> cudaError_t;
4606}
4607singe_loader::functions! { crate::RUNTIME;
4608    /// Gets info about the specified cudaArray.
4609    ///
4610    /// Returns in `*desc`, `*extent` and `*flags` respectively, the type, shape and flags of `array`.
4611    ///
4612    /// Any of `*desc`, `*extent` and `*flags` may be specified as NULL.
4613    ///
4614    /// Note that this function may also return error codes from previous, asynchronous launches.
4615    ///
4616    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
4617    ///
4618    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
4619    ///
4620    /// # Parameters
4621    ///
4622    /// - `desc`: Returned array type.
4623    /// - `extent`: Returned array shape. 2D arrays will have depth of zero.
4624    /// - `flags`: Returned array flags.
4625    /// - `array`: The `cudaArray` to get info for.
4626    ///
4627    /// # Return value
4628    ///
4629    /// - [`cudaError_t::CUDA_SUCCESS`]
4630    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
4631    ///
4632    /// See also: [`cuArrayGetDescriptor`](crate::driver::cuArrayGetDescriptor), [`cuArray3DGetDescriptor`](crate::driver::cuArray3DGetDescriptor).
4633    pub fn cudaArrayGetInfo(
4634        desc: *mut cudaChannelFormatDesc,
4635        extent: *mut cudaExtent,
4636        flags: *mut ::core::ffi::c_uint,
4637        array: cudaArray_t,
4638    ) -> cudaError_t;
4639}
4640singe_loader::functions! { crate::RUNTIME;
4641    /// Gets a CUDA array plane from a CUDA array.
4642    ///
4643    /// Returns in `pPlaneArray` a CUDA array that represents a single format plane of the CUDA array `hArray`.
4644    ///
4645    /// 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: [`cudaChannelFormatKind::cudaChannelFormatKindNV12`], then [`cudaError_t::CUDA_ERROR_INVALID_VALUE`] is returned.
4646    ///
4647    /// Note that if the `hArray` has format [`cudaChannelFormatKind::cudaChannelFormatKindNV12`], then passing in 0 for `planeIdx` returns a CUDA array of the same size as `hArray` but with one 8-bit channel and [`cudaChannelFormatKind::cudaChannelFormatKindUnsigned`] as its format kind. If 1 is passed for `planeIdx`, then the returned CUDA array has half the height and width of `hArray` with two 8-bit channels and [`cudaChannelFormatKind::cudaChannelFormatKindUnsigned`] as its format kind.
4648    ///
4649    /// Note that this function may also return error codes from previous, asynchronous launches.
4650    ///
4651    /// # Parameters
4652    ///
4653    /// - `pPlaneArray`: Returned CUDA array referenced by the `planeIdx`.
4654    /// - `hArray`: CUDA array.
4655    /// - `planeIdx`: Plane index.
4656    ///
4657    /// # Return value
4658    ///
4659    /// - [`cudaError_t::CUDA_SUCCESS`]
4660    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
4661    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
4662    ///
4663    /// See also: [`cuArrayGetPlane`](crate::driver::cuArrayGetPlane).
4664    pub fn cudaArrayGetPlane(
4665        pPlaneArray: *mut cudaArray_t,
4666        hArray: cudaArray_t,
4667        planeIdx: ::core::ffi::c_uint,
4668    ) -> cudaError_t;
4669}
4670singe_loader::functions! { crate::RUNTIME;
4671    /// Returns the memory requirements of a CUDA array.
4672    ///
4673    /// Returns the memory requirements of a CUDA array in `memoryRequirements` If the CUDA array is not allocated with flag [cudaArrayDeferredMapping](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga91a50795515848406a89c2e6cef2fb02) [`cudaError_t::CUDA_ERROR_INVALID_VALUE`] will be returned.
4674    ///
4675    /// The returned value in [`cudaArrayMemoryRequirements::size`](crate::driver::CUDA_ARRAY_MEMORY_REQUIREMENTS_st::size) represents the total size of the CUDA array. The returned value in [`cudaArrayMemoryRequirements::alignment`](crate::driver::CUDA_ARRAY_MEMORY_REQUIREMENTS_st::alignment) represents the alignment necessary for mapping the CUDA array.
4676    ///
4677    /// # Parameters
4678    ///
4679    /// - `memoryRequirements`: Pointer to [`cudaArrayMemoryRequirements`].
4680    /// - `array`: CUDA array to get the memory requirements of.
4681    /// - `device`: Device to get the memory requirements for.
4682    ///
4683    /// # Return value
4684    ///
4685    /// - [`cudaError_t::CUDA_SUCCESS`]
4686    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
4687    ///
4688    /// See also: [`cudaMipmappedArrayGetMemoryRequirements`].
4689    pub fn cudaArrayGetMemoryRequirements(
4690        memoryRequirements: *mut cudaArrayMemoryRequirements,
4691        array: cudaArray_t,
4692        device: ::core::ffi::c_int,
4693    ) -> cudaError_t;
4694}
4695singe_loader::functions! { crate::RUNTIME;
4696    /// Returns the memory requirements of a CUDA mipmapped array.
4697    ///
4698    /// Returns the memory requirements of a CUDA mipmapped array in `memoryRequirements` If the CUDA mipmapped array is not allocated with flag [cudaArrayDeferredMapping](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga91a50795515848406a89c2e6cef2fb02) [`cudaError_t::CUDA_ERROR_INVALID_VALUE`] will be returned.
4699    ///
4700    /// The returned value in [`cudaArrayMemoryRequirements::size`](crate::driver::CUDA_ARRAY_MEMORY_REQUIREMENTS_st::size) represents the total size of the CUDA mipmapped array. The returned value in [`cudaArrayMemoryRequirements::alignment`](crate::driver::CUDA_ARRAY_MEMORY_REQUIREMENTS_st::alignment) represents the alignment necessary for mapping the CUDA mipmapped array.
4701    ///
4702    /// # Parameters
4703    ///
4704    /// - `memoryRequirements`: Pointer to [`cudaArrayMemoryRequirements`].
4705    /// - `mipmap`: CUDA mipmapped array to get the memory requirements of.
4706    /// - `device`: Device to get the memory requirements for.
4707    ///
4708    /// # Return value
4709    ///
4710    /// - [`cudaError_t::CUDA_SUCCESS`]
4711    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
4712    ///
4713    /// See also: [`cudaArrayGetMemoryRequirements`].
4714    pub fn cudaMipmappedArrayGetMemoryRequirements(
4715        memoryRequirements: *mut cudaArrayMemoryRequirements,
4716        mipmap: cudaMipmappedArray_t,
4717        device: ::core::ffi::c_int,
4718    ) -> cudaError_t;
4719}
4720singe_loader::functions! { crate::RUNTIME;
4721    /// Returns the layout properties of a sparse CUDA array.
4722    ///
4723    /// Returns the layout properties of a sparse CUDA array in `sparseProperties`. If the CUDA array is not allocated with flag [cudaArraySparse](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga42c353686a15da063dc7722594ae4bff) [`cudaError_t::CUDA_ERROR_INVALID_VALUE`] will be returned.
4724    ///
4725    /// If the returned value in [`cudaArraySparseProperties::flags`](crate::driver::CUDA_ARRAY_SPARSE_PROPERTIES_st::flags) contains [cudaArraySparsePropertiesSingleMipTail](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga6820071ffa1300699897eab8d319e4d9), then [`cudaArraySparseProperties::miptailSize`](crate::driver::CUDA_ARRAY_SPARSE_PROPERTIES_st::miptailSize) represents the total size of the array. Otherwise, it will be zero. Also, the returned value in [`cudaArraySparseProperties::miptailFirstLevel`](crate::driver::CUDA_ARRAY_SPARSE_PROPERTIES_st::miptailFirstLevel) is always zero. Note that the `array` must have been allocated using [`cudaMallocArray`] or [`cudaMalloc3DArray`]. For CUDA arrays obtained using `cudaMipmappedArrayGetLevel`, [`cudaError_t::CUDA_ERROR_INVALID_VALUE`] will be returned. Instead, [`cudaMipmappedArrayGetSparseProperties`] must be used to obtain the sparse properties of the entire CUDA mipmapped array to which `array` belongs to.
4726    ///
4727    /// # Parameters
4728    ///
4729    /// - `sparseProperties`: Pointer to return the [`cudaArraySparseProperties`].
4730    /// - `array`: The CUDA array to get the sparse properties of.
4731    ///
4732    /// # Return value
4733    ///
4734    /// - [`cudaError_t::CUDA_SUCCESS`]
4735    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
4736    ///
4737    /// See also: [`cudaMipmappedArrayGetSparseProperties`], [`cuMemMapArrayAsync`](crate::driver::cuMemMapArrayAsync).
4738    pub fn cudaArrayGetSparseProperties(
4739        sparseProperties: *mut cudaArraySparseProperties,
4740        array: cudaArray_t,
4741    ) -> cudaError_t;
4742}
4743singe_loader::functions! { crate::RUNTIME;
4744    /// Returns the layout properties of a sparse CUDA mipmapped array.
4745    ///
4746    /// Returns the sparse array layout properties in `sparseProperties`. If the CUDA mipmapped array is not allocated with flag [cudaArraySparse](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga42c353686a15da063dc7722594ae4bff) [`cudaError_t::CUDA_ERROR_INVALID_VALUE`] will be returned.
4747    ///
4748    /// For non-layered CUDA mipmapped arrays, [`cudaArraySparseProperties::miptailSize`](crate::driver::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 [`cudaArraySparseProperties::flags`](crate::driver::CUDA_ARRAY_SPARSE_PROPERTIES_st::flags) contains [cudaArraySparsePropertiesSingleMipTail](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga6820071ffa1300699897eab8d319e4d9), then [`cudaArraySparseProperties::miptailSize`](crate::driver::CUDA_ARRAY_SPARSE_PROPERTIES_st::miptailSize) specifies the size of the mip tail of all layers combined. Otherwise, [`cudaArraySparseProperties::miptailSize`](crate::driver::CUDA_ARRAY_SPARSE_PROPERTIES_st::miptailSize) specifies mip tail size per layer. The returned value of [`cudaArraySparseProperties::miptailFirstLevel`](crate::driver::CUDA_ARRAY_SPARSE_PROPERTIES_st::miptailFirstLevel) is valid only if [`cudaArraySparseProperties::miptailSize`](crate::driver::CUDA_ARRAY_SPARSE_PROPERTIES_st::miptailSize) is non-zero.
4749    ///
4750    /// # Parameters
4751    ///
4752    /// - `sparseProperties`: Pointer to return [`cudaArraySparseProperties`].
4753    /// - `mipmap`: The CUDA mipmapped array to get the sparse properties of.
4754    ///
4755    /// # Return value
4756    ///
4757    /// - [`cudaError_t::CUDA_SUCCESS`]
4758    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
4759    ///
4760    /// See also: [`cudaArrayGetSparseProperties`], [`cuMemMapArrayAsync`](crate::driver::cuMemMapArrayAsync).
4761    pub fn cudaMipmappedArrayGetSparseProperties(
4762        sparseProperties: *mut cudaArraySparseProperties,
4763        mipmap: cudaMipmappedArray_t,
4764    ) -> cudaError_t;
4765}
4766singe_loader::functions! { crate::RUNTIME;
4767    /// Copies data between host and device.
4768    ///
4769    /// Copies `count` bytes from the memory area pointed to by `src` to the memory area pointed to by `dst`, where `kind` specifies the direction of the copy, and must be one of [`cudaMemcpyKind::cudaMemcpyHostToHost`], [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing. Calling [`cudaMemcpy`] with dst and src pointers that do not match the direction of the copy results in an undefined behavior.
4770    ///
4771    /// Note that this function may also return error codes from previous, asynchronous launches.
4772    ///
4773    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
4774    ///
4775    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
4776    ///
4777    /// Note: This function exhibits synchronous behavior for most use cases.
4778    ///
4779    /// 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 CUDA_ERROR_INVALID_VALUE.
4780    ///
4781    /// # Parameters
4782    ///
4783    /// - `dst`: Destination memory address.
4784    /// - `src`: Source memory address.
4785    /// - `count`: Size in bytes to copy.
4786    /// - `kind`: Type of transfer.
4787    ///
4788    /// # Return value
4789    ///
4790    /// - [`cudaError_t::CUDA_SUCCESS`]
4791    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
4792    /// - [`cudaErrorInvalidMemcpyDirection`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a72ce39cee8ef48a83b0191b2e33d2630)
4793    ///
4794    /// See also: [`cudaMemcpy2D`], [`cudaMemcpy2DToArray`], [`cudaMemcpy2DFromArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [`cuMemcpyDtoH`](crate::driver::cuMemcpyDtoH), [`cuMemcpyHtoD`](crate::driver::cuMemcpyHtoD), [`cuMemcpyDtoD`](crate::driver::cuMemcpyDtoD), [`cuMemcpy`](crate::driver::cuMemcpy).
4795    pub fn cudaMemcpy(
4796        dst: *mut ::core::ffi::c_void,
4797        src: *const ::core::ffi::c_void,
4798        count: size_t,
4799        kind: cudaMemcpyKind,
4800    ) -> cudaError_t;
4801}
4802singe_loader::functions! { crate::RUNTIME;
4803    /// Copies memory between two devices.
4804    ///
4805    /// Copies memory from one device to memory on another device. `dst` is the base device pointer of the destination memory and `dstDevice` is the destination device. `src` is the base device pointer of the source memory and `srcDevice` is the source device. `count` specifies the number of bytes to copy.
4806    ///
4807    /// Note that this function is asynchronous with respect to the host, but serialized with respect all pending and future asynchronous work in to the current device, `srcDevice`, and `dstDevice` (use [`cudaMemcpyPeerAsync`] to avoid this synchronization).
4808    ///
4809    /// Note that this function may also return error codes from previous, asynchronous launches.
4810    ///
4811    /// Note: This function exhibits synchronous behavior for most use cases.
4812    ///
4813    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
4814    ///
4815    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
4816    ///
4817    /// # Parameters
4818    ///
4819    /// - `dst`: Destination device pointer.
4820    /// - `dstDevice`: Destination device.
4821    /// - `src`: Source device pointer.
4822    /// - `srcDevice`: Source device.
4823    /// - `count`: Size of memory copy in bytes.
4824    ///
4825    /// # Return value
4826    ///
4827    /// - [`cudaError_t::CUDA_SUCCESS`]
4828    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
4829    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
4830    ///
4831    /// See also: [`cudaMemcpy`], [`cudaMemcpyAsync`], [`cudaMemcpyPeerAsync`], [`cudaMemcpy3DPeerAsync`], [`cuMemcpyPeer`](crate::driver::cuMemcpyPeer).
4832    pub fn cudaMemcpyPeer(
4833        dst: *mut ::core::ffi::c_void,
4834        dstDevice: ::core::ffi::c_int,
4835        src: *const ::core::ffi::c_void,
4836        srcDevice: ::core::ffi::c_int,
4837        count: size_t,
4838    ) -> cudaError_t;
4839}
4840singe_loader::functions! { crate::RUNTIME;
4841    /// Copies data between host and device.
4842    ///
4843    /// Copies a matrix (`height` rows of `width` bytes each) from the memory area pointed to by `src` to the memory area pointed to by `dst`, where `kind` specifies the direction of the copy, and must be one of [`cudaMemcpyKind::cudaMemcpyHostToHost`], [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing. `dpitch` and `spitch` are the widths in memory in bytes of the 2D arrays pointed to by `dst` and `src`, including any padding added to the end of each row. The memory areas may not overlap. `width` must not exceed either `dpitch` or `spitch`. Calling [`cudaMemcpy2D`] with `dst` and `src` pointers that do not match the direction of the copy results in an undefined behavior. [`cudaMemcpy2D`] returns an error if `dpitch` or `spitch` exceeds the maximum allowed.
4844    ///
4845    /// Note that this function may also return error codes from previous, asynchronous launches.
4846    ///
4847    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
4848    ///
4849    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
4850    ///
4851    /// 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 CUDA_ERROR_INVALID_VALUE.
4852    ///
4853    /// # Parameters
4854    ///
4855    /// - `dst`: Destination memory address.
4856    /// - `dpitch`: Pitch of destination memory.
4857    /// - `src`: Source memory address.
4858    /// - `spitch`: Pitch of source memory.
4859    /// - `width`: Width of matrix transfer (columns in bytes).
4860    /// - `height`: Height of matrix transfer (rows).
4861    /// - `kind`: Type of transfer.
4862    ///
4863    /// # Return value
4864    ///
4865    /// - [`cudaError_t::CUDA_SUCCESS`]
4866    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
4867    /// - [`cudaErrorInvalidPitchValue`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a225c65c0348cced651d5dd87ccc22f48)
4868    /// - [`cudaErrorInvalidMemcpyDirection`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a72ce39cee8ef48a83b0191b2e33d2630)
4869    ///
4870    /// See also: [`cudaMemcpy`], [`cudaMemcpy2DToArray`], [`cudaMemcpy2DFromArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [`cuMemcpy2D`](crate::driver::cuMemcpy2D), [`cuMemcpy2DUnaligned`](crate::driver::cuMemcpy2DUnaligned).
4871    pub fn cudaMemcpy2D(
4872        dst: *mut ::core::ffi::c_void,
4873        dpitch: size_t,
4874        src: *const ::core::ffi::c_void,
4875        spitch: size_t,
4876        width: size_t,
4877        height: size_t,
4878        kind: cudaMemcpyKind,
4879    ) -> cudaError_t;
4880}
4881singe_loader::functions! { crate::RUNTIME;
4882    /// Copies data between host and device.
4883    ///
4884    /// Copies a matrix (`height` rows of `width` bytes each) from the memory area pointed to by `src` to the CUDA array `dst` starting at `hOffset` rows and `wOffset` bytes from the upper left corner, where `kind` specifies the direction of the copy, and must be one of [`cudaMemcpyKind::cudaMemcpyHostToHost`], [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing. `spitch` is the width in memory in bytes of the 2D array pointed to by `src`, including any padding added to the end of each row. `wOffset` + `width` must not exceed the width of the CUDA array `dst`. `width` must not exceed `spitch`. [`cudaMemcpy2DToArray`] returns an error if `spitch` exceeds the maximum allowed.
4885    ///
4886    /// Note that this function may also return error codes from previous, asynchronous launches.
4887    ///
4888    /// Note: This function exhibits synchronous behavior for most use cases.
4889    ///
4890    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
4891    ///
4892    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
4893    ///
4894    /// 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 CUDA_ERROR_INVALID_VALUE.
4895    ///
4896    /// # Parameters
4897    ///
4898    /// - `dst`: Destination memory address.
4899    /// - `wOffset`: Destination starting X offset (columns in bytes).
4900    /// - `hOffset`: Destination starting Y offset (rows).
4901    /// - `src`: Source memory address.
4902    /// - `spitch`: Pitch of source memory.
4903    /// - `width`: Width of matrix transfer (columns in bytes).
4904    /// - `height`: Height of matrix transfer (rows).
4905    /// - `kind`: Type of transfer.
4906    ///
4907    /// # Return value
4908    ///
4909    /// - [`cudaError_t::CUDA_SUCCESS`]
4910    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
4911    /// - [`cudaErrorInvalidPitchValue`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a225c65c0348cced651d5dd87ccc22f48)
4912    /// - [`cudaErrorInvalidMemcpyDirection`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a72ce39cee8ef48a83b0191b2e33d2630)
4913    ///
4914    /// See also: [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpy2DFromArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [`cuMemcpy2D`](crate::driver::cuMemcpy2D), [`cuMemcpy2DUnaligned`](crate::driver::cuMemcpy2DUnaligned).
4915    pub fn cudaMemcpy2DToArray(
4916        dst: cudaArray_t,
4917        wOffset: size_t,
4918        hOffset: size_t,
4919        src: *const ::core::ffi::c_void,
4920        spitch: size_t,
4921        width: size_t,
4922        height: size_t,
4923        kind: cudaMemcpyKind,
4924    ) -> cudaError_t;
4925}
4926singe_loader::functions! { crate::RUNTIME;
4927    /// Copies data between host and device.
4928    ///
4929    /// Copies a matrix (`height` rows of `width` bytes each) from the CUDA array `src` starting at `hOffset` rows and `wOffset` bytes from the upper left corner to the memory area pointed to by `dst`, where `kind` specifies the direction of the copy, and must be one of [`cudaMemcpyKind::cudaMemcpyHostToHost`], [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing. `dpitch` is the width in memory in bytes of the 2D array pointed to by `dst`, including any padding added to the end of each row. `wOffset` + `width` must not exceed the width of the CUDA array `src`. `width` must not exceed `dpitch`. [`cudaMemcpy2DFromArray`] returns an error if `dpitch` exceeds the maximum allowed.
4930    ///
4931    /// Note that this function may also return error codes from previous, asynchronous launches.
4932    ///
4933    /// Note: This function exhibits synchronous behavior for most use cases.
4934    ///
4935    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
4936    ///
4937    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
4938    ///
4939    /// 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 CUDA_ERROR_INVALID_VALUE.
4940    ///
4941    /// # Parameters
4942    ///
4943    /// - `dst`: Destination memory address.
4944    /// - `dpitch`: Pitch of destination memory.
4945    /// - `src`: Source memory address.
4946    /// - `wOffset`: Source starting X offset (columns in bytes).
4947    /// - `hOffset`: Source starting Y offset (rows).
4948    /// - `width`: Width of matrix transfer (columns in bytes).
4949    /// - `height`: Height of matrix transfer (rows).
4950    /// - `kind`: Type of transfer.
4951    ///
4952    /// # Return value
4953    ///
4954    /// - [`cudaError_t::CUDA_SUCCESS`]
4955    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
4956    /// - [`cudaErrorInvalidPitchValue`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a225c65c0348cced651d5dd87ccc22f48)
4957    /// - [`cudaErrorInvalidMemcpyDirection`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a72ce39cee8ef48a83b0191b2e33d2630)
4958    ///
4959    /// See also: [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpy2DToArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [`cuMemcpy2D`](crate::driver::cuMemcpy2D), [`cuMemcpy2DUnaligned`](crate::driver::cuMemcpy2DUnaligned).
4960    pub fn cudaMemcpy2DFromArray(
4961        dst: *mut ::core::ffi::c_void,
4962        dpitch: size_t,
4963        src: cudaArray_const_t,
4964        wOffset: size_t,
4965        hOffset: size_t,
4966        width: size_t,
4967        height: size_t,
4968        kind: cudaMemcpyKind,
4969    ) -> cudaError_t;
4970}
4971singe_loader::functions! { crate::RUNTIME;
4972    /// Copies data between host and device.
4973    ///
4974    /// Copies a matrix (`height` rows of `width` bytes each) from the CUDA array `src` starting at `hOffsetSrc` rows and `wOffsetSrc` bytes from the upper left corner to the CUDA array `dst` starting at `hOffsetDst` rows and `wOffsetDst` bytes from the upper left corner, where `kind` specifies the direction of the copy, and must be one of [`cudaMemcpyKind::cudaMemcpyHostToHost`], [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing. `wOffsetDst` + `width` must not exceed the width of the CUDA array `dst`. `wOffsetSrc` + `width` must not exceed the width of the CUDA array `src`.
4975    ///
4976    /// Note that this function may also return error codes from previous, asynchronous launches.
4977    ///
4978    /// Note: This function exhibits synchronous behavior for most use cases.
4979    ///
4980    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
4981    ///
4982    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
4983    ///
4984    /// # Parameters
4985    ///
4986    /// - `dst`: Destination memory address.
4987    /// - `wOffsetDst`: Destination starting X offset (columns in bytes).
4988    /// - `hOffsetDst`: Destination starting Y offset (rows).
4989    /// - `src`: Source memory address.
4990    /// - `wOffsetSrc`: Source starting X offset (columns in bytes).
4991    /// - `hOffsetSrc`: Source starting Y offset (rows).
4992    /// - `width`: Width of matrix transfer (columns in bytes).
4993    /// - `height`: Height of matrix transfer (rows).
4994    /// - `kind`: Type of transfer.
4995    ///
4996    /// # Return value
4997    ///
4998    /// - [`cudaError_t::CUDA_SUCCESS`]
4999    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
5000    /// - [`cudaErrorInvalidMemcpyDirection`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a72ce39cee8ef48a83b0191b2e33d2630)
5001    ///
5002    /// See also: [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpy2DToArray`], [`cudaMemcpy2DFromArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [`cuMemcpy2D`](crate::driver::cuMemcpy2D), [`cuMemcpy2DUnaligned`](crate::driver::cuMemcpy2DUnaligned).
5003    pub fn cudaMemcpy2DArrayToArray(
5004        dst: cudaArray_t,
5005        wOffsetDst: size_t,
5006        hOffsetDst: size_t,
5007        src: cudaArray_const_t,
5008        wOffsetSrc: size_t,
5009        hOffsetSrc: size_t,
5010        width: size_t,
5011        height: size_t,
5012        kind: cudaMemcpyKind,
5013    ) -> cudaError_t;
5014}
5015singe_loader::functions! { crate::RUNTIME;
5016    /// Copies data to the given symbol on the device.
5017    ///
5018    /// Copies `count` bytes from the memory area pointed to by `src` to the memory area pointed to by `offset` bytes from the start of symbol `symbol`. The memory areas may not overlap. `symbol` is a variable that resides in global or constant memory space. `kind` can be either [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing.
5019    ///
5020    /// Note that this function may also return error codes from previous, asynchronous launches.
5021    ///
5022    /// Note: This function exhibits synchronous behavior for most use cases.
5023    ///
5024    /// Note: Use of a string naming a variable as the `symbol` parameter was deprecated in CUDA 4.1 and removed in CUDA 5.0.
5025    ///
5026    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
5027    ///
5028    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
5029    ///
5030    /// # Parameters
5031    ///
5032    /// - `symbol`: Device symbol address.
5033    /// - `src`: Source memory address.
5034    /// - `count`: Size in bytes to copy.
5035    /// - `offset`: Offset from start of symbol in bytes.
5036    /// - `kind`: Type of transfer.
5037    ///
5038    /// # Return value
5039    ///
5040    /// - [`cudaError_t::CUDA_SUCCESS`]
5041    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
5042    /// - [`cudaErrorInvalidSymbol`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a01a4a97f3060ec714ffa9dd650b9213a)
5043    /// - [`cudaErrorInvalidMemcpyDirection`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a72ce39cee8ef48a83b0191b2e33d2630)
5044    /// - [`cudaError_t::CUDA_ERROR_NO_BINARY_FOR_GPU`]
5045    ///
5046    /// See also: [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpy2DToArray`], [`cudaMemcpy2DFromArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [`cuMemcpy`](crate::driver::cuMemcpy), [`cuMemcpyHtoD`](crate::driver::cuMemcpyHtoD), [`cuMemcpyDtoD`](crate::driver::cuMemcpyDtoD).
5047    pub fn cudaMemcpyToSymbol(
5048        symbol: *const ::core::ffi::c_void,
5049        src: *const ::core::ffi::c_void,
5050        count: size_t,
5051        offset: size_t,
5052        kind: cudaMemcpyKind,
5053    ) -> cudaError_t;
5054}
5055singe_loader::functions! { crate::RUNTIME;
5056    /// Copies data from the given symbol on the device.
5057    ///
5058    /// Copies `count` bytes from the memory area pointed to by `offset` bytes from the start of symbol `symbol` to the memory area pointed to by `dst`. The memory areas may not overlap. `symbol` is a variable that resides in global or constant memory space. `kind` can be either [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing.
5059    ///
5060    /// Note that this function may also return error codes from previous, asynchronous launches.
5061    ///
5062    /// Note: This function exhibits synchronous behavior for most use cases.
5063    ///
5064    /// Note: Use of a string naming a variable as the `symbol` parameter was deprecated in CUDA 4.1 and removed in CUDA 5.0.
5065    ///
5066    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
5067    ///
5068    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
5069    ///
5070    /// # Parameters
5071    ///
5072    /// - `dst`: Destination memory address.
5073    /// - `symbol`: Device symbol address.
5074    /// - `count`: Size in bytes to copy.
5075    /// - `offset`: Offset from start of symbol in bytes.
5076    /// - `kind`: Type of transfer.
5077    ///
5078    /// # Return value
5079    ///
5080    /// - [`cudaError_t::CUDA_SUCCESS`]
5081    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
5082    /// - [`cudaErrorInvalidSymbol`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a01a4a97f3060ec714ffa9dd650b9213a)
5083    /// - [`cudaErrorInvalidMemcpyDirection`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a72ce39cee8ef48a83b0191b2e33d2630)
5084    /// - [`cudaError_t::CUDA_ERROR_NO_BINARY_FOR_GPU`]
5085    ///
5086    /// See also: [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpy2DToArray`], [`cudaMemcpy2DFromArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [`cuMemcpy`](crate::driver::cuMemcpy), [`cuMemcpyDtoH`](crate::driver::cuMemcpyDtoH), [`cuMemcpyDtoD`](crate::driver::cuMemcpyDtoD).
5087    pub fn cudaMemcpyFromSymbol(
5088        dst: *mut ::core::ffi::c_void,
5089        symbol: *const ::core::ffi::c_void,
5090        count: size_t,
5091        offset: size_t,
5092        kind: cudaMemcpyKind,
5093    ) -> cudaError_t;
5094}
5095singe_loader::functions! { crate::RUNTIME;
5096    /// Copies data between host and device.
5097    ///
5098    /// Copies `count` bytes from the memory area pointed to by `src` to the memory area pointed to by `dst`, where `kind` specifies the direction of the copy, and must be one of [`cudaMemcpyKind::cudaMemcpyHostToHost`], [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing.
5099    ///
5100    /// The memory areas may not overlap. Calling [`cudaMemcpyAsync`] with `dst` and `src` pointers that do not match the direction of the copy results in an undefined behavior.
5101    ///
5102    /// [`cudaMemcpyAsync`] is asynchronous with respect to the host, so the call may return before the copy is complete. The copy can optionally be associated to a stream by passing a non-zero `stream` argument. If `kind` is [`cudaMemcpyKind::cudaMemcpyHostToDevice`] or [`cudaMemcpyKind::cudaMemcpyDeviceToHost`] and the `stream` is non-zero, the copy may overlap with operations in other streams.
5103    ///
5104    /// The device version of this function only handles device to device copies and cannot be given local or shared pointers.
5105    ///
5106    /// Note that this function may also return error codes from previous, asynchronous launches.
5107    ///
5108    /// Note: This function exhibits asynchronous behavior for most use cases.
5109    ///
5110    /// Note: This function uses standard default stream semantics.
5111    ///
5112    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
5113    ///
5114    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
5115    ///
5116    /// 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 CUDA_ERROR_INVALID_VALUE.
5117    ///
5118    /// # Parameters
5119    ///
5120    /// - `dst`: Destination memory address.
5121    /// - `src`: Source memory address.
5122    /// - `count`: Size in bytes to copy.
5123    /// - `kind`: Type of transfer.
5124    /// - `stream`: Stream identifier.
5125    ///
5126    /// # Return value
5127    ///
5128    /// - [`cudaError_t::CUDA_SUCCESS`]
5129    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
5130    /// - [`cudaErrorInvalidMemcpyDirection`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a72ce39cee8ef48a83b0191b2e33d2630)
5131    ///
5132    /// See also: [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpy2DToArray`], [`cudaMemcpy2DFromArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpy2DAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [`cuMemcpyAsync`](crate::driver::cuMemcpyAsync), [`cuMemcpyDtoHAsync`](crate::driver::cuMemcpyDtoHAsync), [`cuMemcpyHtoDAsync`](crate::driver::cuMemcpyHtoDAsync), [`cuMemcpyDtoDAsync`](crate::driver::cuMemcpyDtoDAsync).
5133    pub fn cudaMemcpyAsync(
5134        dst: *mut ::core::ffi::c_void,
5135        src: *const ::core::ffi::c_void,
5136        count: size_t,
5137        kind: cudaMemcpyKind,
5138        stream: cudaStream_t,
5139    ) -> cudaError_t;
5140}
5141singe_loader::functions! { crate::RUNTIME;
5142    /// Copies memory between two devices asynchronously.
5143    ///
5144    /// Copies memory from one device to memory on another device. `dst` is the base device pointer of the destination memory and `dstDevice` is the destination device. `src` is the base device pointer of the source memory and `srcDevice` is the source device. `count` specifies the number of bytes to copy.
5145    ///
5146    /// Note that this function is asynchronous with respect to the host and all work on other devices.
5147    ///
5148    /// Note that this function may also return error codes from previous, asynchronous launches.
5149    ///
5150    /// Note: This function exhibits asynchronous behavior for most use cases.
5151    ///
5152    /// Note: This function uses standard default stream semantics.
5153    ///
5154    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
5155    ///
5156    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
5157    ///
5158    /// # Parameters
5159    ///
5160    /// - `dst`: Destination device pointer.
5161    /// - `dstDevice`: Destination device.
5162    /// - `src`: Source device pointer.
5163    /// - `srcDevice`: Source device.
5164    /// - `count`: Size of memory copy in bytes.
5165    /// - `stream`: Stream identifier.
5166    ///
5167    /// # Return value
5168    ///
5169    /// - [`cudaError_t::CUDA_SUCCESS`]
5170    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
5171    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
5172    ///
5173    /// See also: [`cudaMemcpy`], [`cudaMemcpyPeer`], [`cudaMemcpyAsync`], [`cudaMemcpy3DPeerAsync`], [`cuMemcpyPeerAsync`](crate::driver::cuMemcpyPeerAsync).
5174    pub fn cudaMemcpyPeerAsync(
5175        dst: *mut ::core::ffi::c_void,
5176        dstDevice: ::core::ffi::c_int,
5177        src: *const ::core::ffi::c_void,
5178        srcDevice: ::core::ffi::c_int,
5179        count: size_t,
5180        stream: cudaStream_t,
5181    ) -> cudaError_t;
5182}
5183singe_loader::functions! { crate::RUNTIME;
5184    /// Performs a batch of memory copies asynchronously.
5185    ///
5186    /// 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 [`cudaMemcpy3DBatchAsync`].
5187    ///
5188    /// 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.
5189    ///
5190    /// 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`.
5191    ///
5192    /// The [`cudaMemcpyAttributes::srcAccessOrder`](crate::driver::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 [cudaMemcpySrcAccessOrderStream](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga1a0bf7e313a2ef3dcabacefcf8a013b5ab0c0860266a1fe9e640296317e8e32ae), then the source will be accessed in stream order. If the source access order is set to [cudaMemcpySrcAccessOrderDuringApiCall](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga1a0bf7e313a2ef3dcabacefcf8a013b5acf1101b874ba5ffe6ad6d89b7e807b29) 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 [cudaMemcpySrcAccessOrderAny](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga1a0bf7e313a2ef3dcabacefcf8a013b5a17b318d18bd58f8bfb6eb4b44a7d6949) 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 [`cudaMemcpyAttributes`] corresponding to it including the appropriate srcAccessOrder setting, otherwise the API will return [`cudaError_t::CUDA_ERROR_INVALID_VALUE`].
5193    ///
5194    /// The [`cudaMemcpyAttributes::srcLocHint`](crate::driver::CUmemcpyAttributes_st::srcLocHint) and [`cudaMemcpyAttributes::dstLocHint`](crate::driver::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 [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`] is true or system-allocated pageable memory on devices where [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`] is true. For other cases, these hints are ignored.
5195    ///
5196    /// The [`cudaMemcpyAttributes::flags`](crate::driver::CUmemcpyAttributes_st::flags) field can be used to specify certain flags for copies. Setting the [cudaMemcpyFlagPreferOverlapWithCompute](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ggae21aa0690949b1d1e5360e4edcf75dcfafef0e1bac799cb33d1ee092124ced948) 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.
5197    ///
5198    /// Note that this function may also return error codes from previous, asynchronous launches.
5199    ///
5200    /// Note: This function exhibits asynchronous behavior for most use cases.
5201    ///
5202    /// 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 CUDA_ERROR_INVALID_VALUE.
5203    ///
5204    /// # Parameters
5205    ///
5206    /// - `dsts`: Array of destination pointers.
5207    /// - `srcs`: Array of memcpy source pointers.
5208    /// - `sizes`: Array of sizes for memcpy operations.
5209    /// - `count`: Size of `dsts`, `srcs` and `sizes` arrays.
5210    /// - `attrs`: Array of memcpy attributes.
5211    /// - `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.
5212    /// - `numAttrs`: Size of `attrs` and `attrsIdxs` arrays.
5213    /// - `stream`: The stream to enqueue the operations in. Must not be legacy NULL stream.
5214    ///
5215    /// # Return value
5216    ///
5217    /// - [`cudaError_t::CUDA_SUCCESS`]
5218    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
5219    pub fn cudaMemcpyBatchAsync(
5220        dsts: *const *mut ::core::ffi::c_void,
5221        srcs: *const *const ::core::ffi::c_void,
5222        sizes: *const size_t,
5223        count: size_t,
5224        attrs: *mut cudaMemcpyAttributes,
5225        attrsIdxs: *mut size_t,
5226        numAttrs: size_t,
5227        stream: cudaStream_t,
5228    ) -> cudaError_t;
5229}
5230singe_loader::functions! { crate::RUNTIME;
5231    /// Performs a batch of 3D memory copies asynchronously.
5232    ///
5233    /// 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.
5234    ///
5235    /// 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 [`cudaMemcpy3DBatchOp::src`](crate::driver::CUDA_MEMCPY3D_BATCH_OP_st::src) and [`cudaMemcpy3DBatchOp::dst`](crate::driver::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 [`cudaMemcpy3DBatchOp::extent`](crate::driver::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.
5236    ///
5237    /// For a given operand, if cudaMemcpy3DOperand::type is specified as [cudaMemcpyOperandTypePointer](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ggada2d93832ded1a29fd7cb28a6261ee6ca395369a66615a9cacf1a734334859a67), then `cudaMemcpy3DOperand::op::ptr` will be used. The `cudaMemcpy3DOperand::op::ptr::ptr` field must contain the pointer where the copy should begin. The `cudaMemcpy3DOperand::op::ptr::rowLength` 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 `cudaMemcpy3DBatchOp::extent::width`. The `cudaMemcpy3DOperand::op::ptr::layerHeight` 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 `cudaMemcpy3DBatchOp::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 [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`] is true or system-allocated pageable memory on devices where [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`] is true, the `cudaMemcpy3DOperand::op::ptr::locHint` field can be used to hint the location of the operand.
5238    ///
5239    /// If an operand’s type is specified as [cudaMemcpyOperandTypeArray](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ggada2d93832ded1a29fd7cb28a6261ee6ca468b9e5daeac88a1cddc387310cb2952), then `cudaMemcpy3DOperand::op::array` will be used. The `cudaMemcpy3DOperand::op::array::array` field specifies the CUDA array and `cudaMemcpy3DOperand::op::array::offset` specifies the 3D offset into that array where the copy begins.
5240    ///
5241    /// The [`cudaMemcpyAttributes::srcAccessOrder`](crate::driver::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 [cudaMemcpySrcAccessOrderStream](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga1a0bf7e313a2ef3dcabacefcf8a013b5ab0c0860266a1fe9e640296317e8e32ae), then the source will be accessed in stream order. If the source access order is set to [cudaMemcpySrcAccessOrderDuringApiCall](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga1a0bf7e313a2ef3dcabacefcf8a013b5acf1101b874ba5ffe6ad6d89b7e807b29) 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 [cudaMemcpySrcAccessOrderAny](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga1a0bf7e313a2ef3dcabacefcf8a013b5a17b318d18bd58f8bfb6eb4b44a7d6949) 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_t::CUDA_ERROR_INVALID_VALUE`].
5242    ///
5243    /// The [`cudaMemcpyAttributes::flags`](crate::driver::CUmemcpyAttributes_st::flags) field can be used to specify certain flags for copies. Setting the [cudaMemcpyFlagPreferOverlapWithCompute](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ggae21aa0690949b1d1e5360e4edcf75dcfafef0e1bac799cb33d1ee092124ced948) 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.
5244    ///
5245    /// Note that this function may also return error codes from previous, asynchronous launches.
5246    ///
5247    /// Note: This function exhibits asynchronous behavior for most use cases.
5248    ///
5249    /// 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 CUDA_ERROR_INVALID_VALUE.
5250    ///
5251    /// # Parameters
5252    ///
5253    /// - `numOps`: Total number of memcpy operations.
5254    /// - `opList`: Array of size `numOps` containing the actual memcpy operations.
5255    /// - `flags`: Flags for future use, must be zero now.
5256    /// - `stream`: The stream to enqueue the operations in. Must not be default NULL stream.
5257    ///
5258    /// # Return value
5259    ///
5260    /// - [`cudaError_t::CUDA_SUCCESS`]
5261    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
5262    pub fn cudaMemcpy3DBatchAsync(
5263        numOps: size_t,
5264        opList: *mut cudaMemcpy3DBatchOp,
5265        flags: ::core::ffi::c_ulonglong,
5266        stream: cudaStream_t,
5267    ) -> cudaError_t;
5268}
5269singe_loader::functions! { crate::RUNTIME;
5270    /// Performs asynchronous memory copy operation with the specified attributes.
5271    ///
5272    /// 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 `stream` specifies the stream to enqueue the operation in.
5273    ///
5274    /// For more information regarding the attributes, please refer to [`cudaMemcpyAttributes`] and it’s usage desciption in::cudaMemcpyBatchAsync.
5275    ///
5276    /// Note that this function may also return error codes from previous, asynchronous launches.
5277    ///
5278    /// Note: This function exhibits asynchronous behavior for most use cases.
5279    ///
5280    /// 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 CUDA_ERROR_INVALID_VALUE.
5281    ///
5282    /// # Parameters
5283    ///
5284    /// - `dst`: Destination device pointer.
5285    /// - `src`: Source device pointer.
5286    /// - `size`: Number of bytes to copy.
5287    /// - `attr`: Attributes for the copy.
5288    /// - `stream`: Stream to enqueue the operation in.
5289    ///
5290    /// # Return value
5291    ///
5292    /// - [`cudaError_t::CUDA_SUCCESS`]
5293    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
5294    ///
5295    /// See also: [`cudaMemcpyBatchAsync`].
5296    pub fn cudaMemcpyWithAttributesAsync(
5297        dst: *mut ::core::ffi::c_void,
5298        src: *const ::core::ffi::c_void,
5299        size: size_t,
5300        attr: *mut cudaMemcpyAttributes,
5301        stream: cudaStream_t,
5302    ) -> cudaError_t;
5303}
5304singe_loader::functions! { crate::RUNTIME;
5305    /// Performs 3D asynchronous memory copy with the specified attributes.
5306    ///
5307    /// Performs the copy operation specified in `op`. `flags` specifies the flags for the copy and `stream` specifies the stream to enqueue the operation in.
5308    ///
5309    /// For more information regarding the operation, please refer to [`cudaMemcpy3DBatchOp`] and it’s usage desciption in::cudaMemcpy3DBatchAsync.
5310    ///
5311    /// Note that this function may also return error codes from previous, asynchronous launches.
5312    ///
5313    /// Note: This function exhibits asynchronous behavior for most use cases.
5314    ///
5315    /// 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 CUDA_ERROR_INVALID_VALUE.
5316    ///
5317    /// # Parameters
5318    ///
5319    /// - `op`: Operation to perform.
5320    /// - `flags`: Flags for the copy, must be zero now.
5321    /// - `stream`: Stream to enqueue the operation in.
5322    ///
5323    /// # Return value
5324    ///
5325    /// - [`cudaError_t::CUDA_SUCCESS`]
5326    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
5327    ///
5328    /// See also: [`cudaMemcpy3DBatchAsync`].
5329    pub fn cudaMemcpy3DWithAttributesAsync(
5330        op: *mut cudaMemcpy3DBatchOp,
5331        flags: ::core::ffi::c_ulonglong,
5332        stream: cudaStream_t,
5333    ) -> cudaError_t;
5334}
5335singe_loader::functions! { crate::RUNTIME;
5336    /// Copies data between host and device.
5337    ///
5338    /// Copies a matrix (`height` rows of `width` bytes each) from the memory area pointed to by `src` to the memory area pointed to by `dst`, where `kind` specifies the direction of the copy, and must be one of [`cudaMemcpyKind::cudaMemcpyHostToHost`], [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing. `dpitch` and `spitch` are the widths in memory in bytes of the 2D arrays pointed to by `dst` and `src`, including any padding added to the end of each row. The memory areas may not overlap. `width` must not exceed either `dpitch` or `spitch`.
5339    ///
5340    /// Calling [`cudaMemcpy2DAsync`] with `dst` and `src` pointers that do not match the direction of the copy results in an undefined behavior. [`cudaMemcpy2DAsync`] returns an error if `dpitch` or `spitch` is greater than the maximum allowed.
5341    ///
5342    /// [`cudaMemcpy2DAsync`] is asynchronous with respect to the host, so the call may return before the copy is complete. The copy can optionally be associated to a stream by passing a non-zero `stream` argument. If `kind` is [`cudaMemcpyKind::cudaMemcpyHostToDevice`] or [`cudaMemcpyKind::cudaMemcpyDeviceToHost`] and `stream` is non-zero, the copy may overlap with operations in other streams.
5343    ///
5344    /// The device version of this function only handles device to device copies and cannot be given local or shared pointers.
5345    ///
5346    /// Note that this function may also return error codes from previous, asynchronous launches.
5347    ///
5348    /// Note: This function exhibits asynchronous behavior for most use cases.
5349    ///
5350    /// Note: This function uses standard default stream semantics.
5351    ///
5352    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
5353    ///
5354    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
5355    ///
5356    /// 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 CUDA_ERROR_INVALID_VALUE.
5357    ///
5358    /// # Parameters
5359    ///
5360    /// - `dst`: Destination memory address.
5361    /// - `dpitch`: Pitch of destination memory.
5362    /// - `src`: Source memory address.
5363    /// - `spitch`: Pitch of source memory.
5364    /// - `width`: Width of matrix transfer (columns in bytes).
5365    /// - `height`: Height of matrix transfer (rows).
5366    /// - `kind`: Type of transfer.
5367    /// - `stream`: Stream identifier.
5368    ///
5369    /// # Return value
5370    ///
5371    /// - [`cudaError_t::CUDA_SUCCESS`]
5372    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
5373    /// - [`cudaErrorInvalidPitchValue`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a225c65c0348cced651d5dd87ccc22f48)
5374    /// - [`cudaErrorInvalidMemcpyDirection`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a72ce39cee8ef48a83b0191b2e33d2630)
5375    ///
5376    /// See also: [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpy2DToArray`], [`cudaMemcpy2DFromArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [`cuMemcpy2DAsync`](crate::driver::cuMemcpy2DAsync).
5377    pub fn cudaMemcpy2DAsync(
5378        dst: *mut ::core::ffi::c_void,
5379        dpitch: size_t,
5380        src: *const ::core::ffi::c_void,
5381        spitch: size_t,
5382        width: size_t,
5383        height: size_t,
5384        kind: cudaMemcpyKind,
5385        stream: cudaStream_t,
5386    ) -> cudaError_t;
5387}
5388singe_loader::functions! { crate::RUNTIME;
5389    /// Copies data between host and device.
5390    ///
5391    /// Copies a matrix (`height` rows of `width` bytes each) from the memory area pointed to by `src` to the CUDA array `dst` starting at `hOffset` rows and `wOffset` bytes from the upper left corner, where `kind` specifies the direction of the copy, and must be one of [`cudaMemcpyKind::cudaMemcpyHostToHost`], [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing. `spitch` is the width in memory in bytes of the 2D array pointed to by `src`, including any padding added to the end of each row. `wOffset` + `width` must not exceed the width of the CUDA array `dst`. `width` must not exceed `spitch`. [`cudaMemcpy2DToArrayAsync`] returns an error if `spitch` exceeds the maximum allowed.
5392    ///
5393    /// [`cudaMemcpy2DToArrayAsync`] is asynchronous with respect to the host, so the call may return before the copy is complete. The copy can optionally be associated to a stream by passing a non-zero `stream` argument. If `kind` is [`cudaMemcpyKind::cudaMemcpyHostToDevice`] or [`cudaMemcpyKind::cudaMemcpyDeviceToHost`] and `stream` is non-zero, the copy may overlap with operations in other streams.
5394    ///
5395    /// [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [`cuMemcpy2DAsync`](crate::driver::cuMemcpy2DAsync).
5396    ///
5397    /// Note that this function may also return error codes from previous, asynchronous launches.
5398    ///
5399    /// Note: This function exhibits asynchronous behavior for most use cases.
5400    ///
5401    /// Note: This function uses standard default stream semantics.
5402    ///
5403    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
5404    ///
5405    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
5406    ///
5407    /// 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 CUDA_ERROR_INVALID_VALUE.
5408    ///
5409    /// # Parameters
5410    ///
5411    /// - `dst`: Destination memory address.
5412    /// - `wOffset`: Destination starting X offset (columns in bytes).
5413    /// - `hOffset`: Destination starting Y offset (rows).
5414    /// - `src`: Source memory address.
5415    /// - `spitch`: Pitch of source memory.
5416    /// - `width`: Width of matrix transfer (columns in bytes).
5417    /// - `height`: Height of matrix transfer (rows).
5418    /// - `kind`: Type of transfer.
5419    /// - `stream`: Stream identifier.
5420    ///
5421    /// # Return value
5422    ///
5423    /// - [`cudaError_t::CUDA_SUCCESS`]
5424    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
5425    /// - [`cudaErrorInvalidPitchValue`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a225c65c0348cced651d5dd87ccc22f48)
5426    /// - [`cudaErrorInvalidMemcpyDirection`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a72ce39cee8ef48a83b0191b2e33d2630)
5427    ///
5428    /// See also: [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpy2DToArray`], [`cudaMemcpy2DFromArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`].
5429    pub fn cudaMemcpy2DToArrayAsync(
5430        dst: cudaArray_t,
5431        wOffset: size_t,
5432        hOffset: size_t,
5433        src: *const ::core::ffi::c_void,
5434        spitch: size_t,
5435        width: size_t,
5436        height: size_t,
5437        kind: cudaMemcpyKind,
5438        stream: cudaStream_t,
5439    ) -> cudaError_t;
5440}
5441singe_loader::functions! { crate::RUNTIME;
5442    /// Copies data between host and device.
5443    ///
5444    /// Copies a matrix (`height` rows of `width` bytes each) from the CUDA array `src` starting at `hOffset` rows and `wOffset` bytes from the upper left corner to the memory area pointed to by `dst`, where `kind` specifies the direction of the copy, and must be one of [`cudaMemcpyKind::cudaMemcpyHostToHost`], [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing. `dpitch` is the width in memory in bytes of the 2D array pointed to by `dst`, including any padding added to the end of each row. `wOffset` + `width` must not exceed the width of the CUDA array `src`. `width` must not exceed `dpitch`. [`cudaMemcpy2DFromArrayAsync`] returns an error if `dpitch` exceeds the maximum allowed.
5445    ///
5446    /// [`cudaMemcpy2DFromArrayAsync`] is asynchronous with respect to the host, so the call may return before the copy is complete. The copy can optionally be associated to a stream by passing a non-zero `stream` argument. If `kind` is [`cudaMemcpyKind::cudaMemcpyHostToDevice`] or [`cudaMemcpyKind::cudaMemcpyDeviceToHost`] and `stream` is non-zero, the copy may overlap with operations in other streams.
5447    ///
5448    /// [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [`cuMemcpy2DAsync`](crate::driver::cuMemcpy2DAsync).
5449    ///
5450    /// Note that this function may also return error codes from previous, asynchronous launches.
5451    ///
5452    /// Note: This function exhibits asynchronous behavior for most use cases.
5453    ///
5454    /// Note: This function uses standard default stream semantics.
5455    ///
5456    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
5457    ///
5458    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
5459    ///
5460    /// 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 CUDA_ERROR_INVALID_VALUE.
5461    ///
5462    /// # Parameters
5463    ///
5464    /// - `dst`: Destination memory address.
5465    /// - `dpitch`: Pitch of destination memory.
5466    /// - `src`: Source memory address.
5467    /// - `wOffset`: Source starting X offset (columns in bytes).
5468    /// - `hOffset`: Source starting Y offset (rows).
5469    /// - `width`: Width of matrix transfer (columns in bytes).
5470    /// - `height`: Height of matrix transfer (rows).
5471    /// - `kind`: Type of transfer.
5472    /// - `stream`: Stream identifier.
5473    ///
5474    /// # Return value
5475    ///
5476    /// - [`cudaError_t::CUDA_SUCCESS`]
5477    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
5478    /// - [`cudaErrorInvalidPitchValue`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a225c65c0348cced651d5dd87ccc22f48)
5479    /// - [`cudaErrorInvalidMemcpyDirection`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a72ce39cee8ef48a83b0191b2e33d2630)
5480    ///
5481    /// See also: [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpy2DToArray`], [`cudaMemcpy2DFromArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpy2DToArrayAsync`].
5482    pub fn cudaMemcpy2DFromArrayAsync(
5483        dst: *mut ::core::ffi::c_void,
5484        dpitch: size_t,
5485        src: cudaArray_const_t,
5486        wOffset: size_t,
5487        hOffset: size_t,
5488        width: size_t,
5489        height: size_t,
5490        kind: cudaMemcpyKind,
5491        stream: cudaStream_t,
5492    ) -> cudaError_t;
5493}
5494singe_loader::functions! { crate::RUNTIME;
5495    /// Copies data to the given symbol on the device.
5496    ///
5497    /// Copies `count` bytes from the memory area pointed to by `src` to the memory area pointed to by `offset` bytes from the start of symbol `symbol`. The memory areas may not overlap. `symbol` is a variable that resides in global or constant memory space. `kind` can be either [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing.
5498    ///
5499    /// [`cudaMemcpyToSymbolAsync`] is asynchronous with respect to the host, so the call may return before the copy is complete. The copy can optionally be associated to a stream by passing a non-zero `stream` argument. If `kind` is [`cudaMemcpyKind::cudaMemcpyHostToDevice`] and `stream` is non-zero, the copy may overlap with operations in other streams.
5500    ///
5501    /// Note that this function may also return error codes from previous, asynchronous launches.
5502    ///
5503    /// Note: This function exhibits asynchronous behavior for most use cases.
5504    ///
5505    /// Note: This function uses standard default stream semantics.
5506    ///
5507    /// Note: Use of a string naming a variable as the `symbol` parameter was deprecated in CUDA 4.1 and removed in CUDA 5.0.
5508    ///
5509    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
5510    ///
5511    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
5512    ///
5513    /// # Parameters
5514    ///
5515    /// - `symbol`: Device symbol address.
5516    /// - `src`: Source memory address.
5517    /// - `count`: Size in bytes to copy.
5518    /// - `offset`: Offset from start of symbol in bytes.
5519    /// - `kind`: Type of transfer.
5520    /// - `stream`: Stream identifier.
5521    ///
5522    /// # Return value
5523    ///
5524    /// - [`cudaError_t::CUDA_SUCCESS`]
5525    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
5526    /// - [`cudaErrorInvalidSymbol`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a01a4a97f3060ec714ffa9dd650b9213a)
5527    /// - [`cudaErrorInvalidMemcpyDirection`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a72ce39cee8ef48a83b0191b2e33d2630)
5528    /// - [`cudaError_t::CUDA_ERROR_NO_BINARY_FOR_GPU`]
5529    ///
5530    /// See also: [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpy2DToArray`], [`cudaMemcpy2DFromArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyFromSymbolAsync`], [`cuMemcpyAsync`](crate::driver::cuMemcpyAsync), [`cuMemcpyHtoDAsync`](crate::driver::cuMemcpyHtoDAsync), [`cuMemcpyDtoDAsync`](crate::driver::cuMemcpyDtoDAsync).
5531    pub fn cudaMemcpyToSymbolAsync(
5532        symbol: *const ::core::ffi::c_void,
5533        src: *const ::core::ffi::c_void,
5534        count: size_t,
5535        offset: size_t,
5536        kind: cudaMemcpyKind,
5537        stream: cudaStream_t,
5538    ) -> cudaError_t;
5539}
5540singe_loader::functions! { crate::RUNTIME;
5541    /// Copies data from the given symbol on the device.
5542    ///
5543    /// Copies `count` bytes from the memory area pointed to by `offset` bytes from the start of symbol `symbol` to the memory area pointed to by `dst`. The memory areas may not overlap. `symbol` is a variable that resides in global or constant memory space. `kind` can be either [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing.
5544    ///
5545    /// [`cudaMemcpyFromSymbolAsync`] is asynchronous with respect to the host, so the call may return before the copy is complete. The copy can optionally be associated to a stream by passing a non-zero `stream` argument. If `kind` is [`cudaMemcpyKind::cudaMemcpyDeviceToHost`] and `stream` is non-zero, the copy may overlap with operations in other streams.
5546    ///
5547    /// Note that this function may also return error codes from previous, asynchronous launches.
5548    ///
5549    /// Note: This function exhibits asynchronous behavior for most use cases.
5550    ///
5551    /// Note: This function uses standard default stream semantics.
5552    ///
5553    /// Note: Use of a string naming a variable as the `symbol` parameter was deprecated in CUDA 4.1 and removed in CUDA 5.0.
5554    ///
5555    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
5556    ///
5557    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
5558    ///
5559    /// # Parameters
5560    ///
5561    /// - `dst`: Destination memory address.
5562    /// - `symbol`: Device symbol address.
5563    /// - `count`: Size in bytes to copy.
5564    /// - `offset`: Offset from start of symbol in bytes.
5565    /// - `kind`: Type of transfer.
5566    /// - `stream`: Stream identifier.
5567    ///
5568    /// # Return value
5569    ///
5570    /// - [`cudaError_t::CUDA_SUCCESS`]
5571    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
5572    /// - [`cudaErrorInvalidSymbol`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a01a4a97f3060ec714ffa9dd650b9213a)
5573    /// - [`cudaErrorInvalidMemcpyDirection`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a72ce39cee8ef48a83b0191b2e33d2630)
5574    /// - [`cudaError_t::CUDA_ERROR_NO_BINARY_FOR_GPU`]
5575    ///
5576    /// See also: [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpy2DToArray`], [`cudaMemcpy2DFromArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cuMemcpyAsync`](crate::driver::cuMemcpyAsync), [`cuMemcpyDtoHAsync`](crate::driver::cuMemcpyDtoHAsync), [`cuMemcpyDtoDAsync`](crate::driver::cuMemcpyDtoDAsync).
5577    pub fn cudaMemcpyFromSymbolAsync(
5578        dst: *mut ::core::ffi::c_void,
5579        symbol: *const ::core::ffi::c_void,
5580        count: size_t,
5581        offset: size_t,
5582        kind: cudaMemcpyKind,
5583        stream: cudaStream_t,
5584    ) -> cudaError_t;
5585}
5586singe_loader::functions! { crate::RUNTIME;
5587    /// Initializes or sets device memory to a value.
5588    ///
5589    /// Fills the first `count` bytes of the memory area pointed to by `devPtr` with the constant byte value `value`.
5590    ///
5591    /// Note that this function is asynchronous with respect to the host unless `devPtr` refers to pinned host memory.
5592    ///
5593    /// Note that this function may also return error codes from previous, asynchronous launches.
5594    ///
5595    /// Note: See also memset synchronization details.
5596    ///
5597    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
5598    ///
5599    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
5600    ///
5601    /// # Parameters
5602    ///
5603    /// - `devPtr`: Pointer to device memory.
5604    /// - `value`: Value to set for each byte of specified memory.
5605    /// - `count`: Size in bytes to set.
5606    ///
5607    /// # Return value
5608    ///
5609    /// - [`cudaError_t::CUDA_SUCCESS`]
5610    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
5611    ///
5612    /// See also: [`cuMemsetD8`](crate::driver::cuMemsetD8), [`cuMemsetD16`](crate::driver::cuMemsetD16), [`cuMemsetD32`](crate::driver::cuMemsetD32).
5613    pub fn cudaMemset(
5614        devPtr: *mut ::core::ffi::c_void,
5615        value: ::core::ffi::c_int,
5616        count: size_t,
5617    ) -> cudaError_t;
5618}
5619singe_loader::functions! { crate::RUNTIME;
5620    /// Initializes or sets device memory to a value.
5621    ///
5622    /// Sets to the specified value `value` a matrix (`height` rows of `width` bytes each) pointed to by `dstPtr`. `pitch` is the width in bytes of the 2D array pointed to by `dstPtr`, including any padding added to the end of each row. This function performs fastest when the pitch is one that has been passed back by [`cudaMallocPitch`].
5623    ///
5624    /// Note that this function is asynchronous with respect to the host unless `devPtr` refers to pinned host memory.
5625    ///
5626    /// Note that this function may also return error codes from previous, asynchronous launches.
5627    ///
5628    /// Note: See also memset synchronization details.
5629    ///
5630    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
5631    ///
5632    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
5633    ///
5634    /// # Parameters
5635    ///
5636    /// - `devPtr`: Pointer to 2D device memory.
5637    /// - `pitch`: Pitch in bytes of 2D device memory(Unused if `height` is 1).
5638    /// - `value`: Value to set for each byte of specified memory.
5639    /// - `width`: Width of matrix set (columns in bytes).
5640    /// - `height`: Height of matrix set (rows).
5641    ///
5642    /// # Return value
5643    ///
5644    /// - [`cudaError_t::CUDA_SUCCESS`]
5645    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
5646    ///
5647    /// See also: [`cudaMemset`], [`cudaMemset3D`], [`cudaMemsetAsync`], [`cudaMemset2DAsync`], [`cudaMemset3DAsync`], [`cuMemsetD2D8`](crate::driver::cuMemsetD2D8), [`cuMemsetD2D16`](crate::driver::cuMemsetD2D16), [`cuMemsetD2D32`](crate::driver::cuMemsetD2D32).
5648    pub fn cudaMemset2D(
5649        devPtr: *mut ::core::ffi::c_void,
5650        pitch: size_t,
5651        value: ::core::ffi::c_int,
5652        width: size_t,
5653        height: size_t,
5654    ) -> cudaError_t;
5655}
5656singe_loader::functions! { crate::RUNTIME;
5657    /// Initializes or sets device memory to a value.
5658    ///
5659    /// Initializes each element of a 3D array to the specified value `value`. The object to initialize is defined by `pitchedDevPtr`. The `pitch` field of `pitchedDevPtr` is the width in memory in bytes of the 3D array pointed to by `pitchedDevPtr`, including any padding added to the end of each row. The `xsize` field specifies the logical width of each row in bytes, while the `ysize` field specifies the height of each 2D slice in rows. The `pitch` field of `pitchedDevPtr` is ignored when `height` and `depth` are both equal to 1.
5660    ///
5661    /// The extents of the initialized region are specified as a `width` in bytes, a `height` in rows, and a `depth` in slices.
5662    ///
5663    /// Extents with `width` greater than or equal to the `xsize` of `pitchedDevPtr` may perform significantly faster than extents narrower than the `xsize`. Secondarily, extents with `height` equal to the `ysize` of `pitchedDevPtr` will perform faster than when the `height` is shorter than the `ysize`.
5664    ///
5665    /// This function performs fastest when the `pitchedDevPtr` has been allocated by [`cudaMalloc3D`].
5666    ///
5667    /// Note that this function is asynchronous with respect to the host unless `pitchedDevPtr` refers to pinned host memory.
5668    ///
5669    /// Note that this function may also return error codes from previous, asynchronous launches.
5670    ///
5671    /// Note: See also memset synchronization details.
5672    ///
5673    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
5674    ///
5675    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
5676    ///
5677    /// # Parameters
5678    ///
5679    /// - `pitchedDevPtr`: Pointer to pitched device memory.
5680    /// - `value`: Value to set for each byte of specified memory.
5681    /// - `extent`: Size parameters for where to set device memory (`width` field in bytes).
5682    ///
5683    /// # Return value
5684    ///
5685    /// - [`cudaError_t::CUDA_SUCCESS`]
5686    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
5687    ///
5688    /// See also: [`cudaMemset`], [`cudaMemset2D`], [`cudaMemsetAsync`], [`cudaMemset2DAsync`], [`cudaMemset3DAsync`], [`cudaMalloc3D`], [`make_cudaPitchedPtr`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__MEMORY.html#group__cudart__memory_1gac3f66f8f11f9949768ae8d10cad5a1a0), [`make_cudaExtent`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__MEMORY.html#group__cudart__memory_1ga66d2e640656aa155d4ed6650fc7a2a5e).
5689    pub fn cudaMemset3D(
5690        pitchedDevPtr: cudaPitchedPtr,
5691        value: ::core::ffi::c_int,
5692        extent: cudaExtent,
5693    ) -> cudaError_t;
5694}
5695singe_loader::functions! { crate::RUNTIME;
5696    /// Initializes or sets device memory to a value.
5697    ///
5698    /// Fills the first `count` bytes of the memory area pointed to by `devPtr` with the constant byte value `value`.
5699    ///
5700    /// [`cudaMemsetAsync`] is asynchronous with respect to the host, so the call may return before the memset is complete. The operation can optionally be associated to a stream by passing a non-zero `stream` argument. If `stream` is non-zero, the operation may overlap with operations in other streams.
5701    ///
5702    /// The device version of this function only handles device to device copies and cannot be given local or shared pointers.
5703    ///
5704    /// Note that this function may also return error codes from previous, asynchronous launches.
5705    ///
5706    /// Note: See also memset synchronization details.
5707    ///
5708    /// Note: This function uses standard default stream semantics.
5709    ///
5710    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
5711    ///
5712    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
5713    ///
5714    /// # Parameters
5715    ///
5716    /// - `devPtr`: Pointer to device memory.
5717    /// - `value`: Value to set for each byte of specified memory.
5718    /// - `count`: Size in bytes to set.
5719    /// - `stream`: Stream identifier.
5720    ///
5721    /// # Return value
5722    ///
5723    /// - [`cudaError_t::CUDA_SUCCESS`]
5724    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
5725    ///
5726    /// See also: [`cudaMemset`], [`cudaMemset2D`], [`cudaMemset3D`], [`cudaMemset2DAsync`], [`cudaMemset3DAsync`], [`cuMemsetD8Async`](crate::driver::cuMemsetD8Async), [`cuMemsetD16Async`](crate::driver::cuMemsetD16Async), [`cuMemsetD32Async`](crate::driver::cuMemsetD32Async).
5727    pub fn cudaMemsetAsync(
5728        devPtr: *mut ::core::ffi::c_void,
5729        value: ::core::ffi::c_int,
5730        count: size_t,
5731        stream: cudaStream_t,
5732    ) -> cudaError_t;
5733}
5734singe_loader::functions! { crate::RUNTIME;
5735    /// Initializes or sets device memory to a value.
5736    ///
5737    /// Sets to the specified value `value` a matrix (`height` rows of `width` bytes each) pointed to by `dstPtr`. `pitch` is the width in bytes of the 2D array pointed to by `dstPtr`, including any padding added to the end of each row. This function performs fastest when the pitch is one that has been passed back by [`cudaMallocPitch`].
5738    ///
5739    /// [`cudaMemset2DAsync`] is asynchronous with respect to the host, so the call may return before the memset is complete. The operation can optionally be associated to a stream by passing a non-zero `stream` argument. If `stream` is non-zero, the operation may overlap with operations in other streams.
5740    ///
5741    /// The device version of this function only handles device to device copies and cannot be given local or shared pointers.
5742    ///
5743    /// Note that this function may also return error codes from previous, asynchronous launches.
5744    ///
5745    /// Note: See also memset synchronization details.
5746    ///
5747    /// Note: This function uses standard default stream semantics.
5748    ///
5749    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
5750    ///
5751    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
5752    ///
5753    /// # Parameters
5754    ///
5755    /// - `devPtr`: Pointer to 2D device memory.
5756    /// - `pitch`: Pitch in bytes of 2D device memory(Unused if `height` is 1).
5757    /// - `value`: Value to set for each byte of specified memory.
5758    /// - `width`: Width of matrix set (columns in bytes).
5759    /// - `height`: Height of matrix set (rows).
5760    /// - `stream`: Stream identifier.
5761    ///
5762    /// # Return value
5763    ///
5764    /// - [`cudaError_t::CUDA_SUCCESS`]
5765    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
5766    ///
5767    /// See also: [`cudaMemset`], [`cudaMemset2D`], [`cudaMemset3D`], [`cudaMemsetAsync`], [`cudaMemset3DAsync`], [`cuMemsetD2D8Async`](crate::driver::cuMemsetD2D8Async), [`cuMemsetD2D16Async`](crate::driver::cuMemsetD2D16Async), [`cuMemsetD2D32Async`](crate::driver::cuMemsetD2D32Async).
5768    pub fn cudaMemset2DAsync(
5769        devPtr: *mut ::core::ffi::c_void,
5770        pitch: size_t,
5771        value: ::core::ffi::c_int,
5772        width: size_t,
5773        height: size_t,
5774        stream: cudaStream_t,
5775    ) -> cudaError_t;
5776}
5777singe_loader::functions! { crate::RUNTIME;
5778    /// Initializes or sets device memory to a value.
5779    ///
5780    /// Initializes each element of a 3D array to the specified value `value`. The object to initialize is defined by `pitchedDevPtr`. The `pitch` field of `pitchedDevPtr` is the width in memory in bytes of the 3D array pointed to by `pitchedDevPtr`, including any padding added to the end of each row. The `xsize` field specifies the logical width of each row in bytes, while the `ysize` field specifies the height of each 2D slice in rows. The `pitch` field of `pitchedDevPtr` is ignored when `height` and `depth` are both equal to 1.
5781    ///
5782    /// The extents of the initialized region are specified as a `width` in bytes, a `height` in rows, and a `depth` in slices.
5783    ///
5784    /// Extents with `width` greater than or equal to the `xsize` of `pitchedDevPtr` may perform significantly faster than extents narrower than the `xsize`. Secondarily, extents with `height` equal to the `ysize` of `pitchedDevPtr` will perform faster than when the `height` is shorter than the `ysize`.
5785    ///
5786    /// This function performs fastest when the `pitchedDevPtr` has been allocated by [`cudaMalloc3D`].
5787    ///
5788    /// [`cudaMemset3DAsync`] is asynchronous with respect to the host, so the call may return before the memset is complete. The operation can optionally be associated to a stream by passing a non-zero `stream` argument. If `stream` is non-zero, the operation may overlap with operations in other streams.
5789    ///
5790    /// The device version of this function only handles device to device copies and cannot be given local or shared pointers.
5791    ///
5792    /// Note that this function may also return error codes from previous, asynchronous launches.
5793    ///
5794    /// Note: See also memset synchronization details.
5795    ///
5796    /// Note: This function uses standard default stream semantics.
5797    ///
5798    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
5799    ///
5800    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
5801    ///
5802    /// # Parameters
5803    ///
5804    /// - `pitchedDevPtr`: Pointer to pitched device memory.
5805    /// - `value`: Value to set for each byte of specified memory.
5806    /// - `extent`: Size parameters for where to set device memory (`width` field in bytes).
5807    /// - `stream`: Stream identifier.
5808    ///
5809    /// # Return value
5810    ///
5811    /// - [`cudaError_t::CUDA_SUCCESS`]
5812    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
5813    ///
5814    /// See also: [`cudaMemset`], [`cudaMemset2D`], [`cudaMemset3D`], [`cudaMemsetAsync`], [`cudaMemset2DAsync`], [`cudaMalloc3D`], [`make_cudaPitchedPtr`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__MEMORY.html#group__cudart__memory_1gac3f66f8f11f9949768ae8d10cad5a1a0), [`make_cudaExtent`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__MEMORY.html#group__cudart__memory_1ga66d2e640656aa155d4ed6650fc7a2a5e).
5815    pub fn cudaMemset3DAsync(
5816        pitchedDevPtr: cudaPitchedPtr,
5817        value: ::core::ffi::c_int,
5818        extent: cudaExtent,
5819        stream: cudaStream_t,
5820    ) -> cudaError_t;
5821}
5822singe_loader::functions! { crate::RUNTIME;
5823    /// Finds the address associated with a CUDA symbol.
5824    ///
5825    /// Returns in `*devPtr` the address of symbol `symbol` on the device. `symbol` is a variable that resides in global or constant memory space. If `symbol` cannot be found, or if `symbol` is not declared in the global or constant memory space, `*devPtr` is unchanged and the error [cudaErrorInvalidSymbol](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a01a4a97f3060ec714ffa9dd650b9213a) is returned.
5826    ///
5827    /// Note that this function may also return error codes from previous, asynchronous launches.
5828    ///
5829    /// Note: Use of a string naming a variable as the `symbol` parameter was deprecated in CUDA 4.1 and removed in CUDA 5.0.
5830    ///
5831    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
5832    ///
5833    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
5834    ///
5835    /// # Parameters
5836    ///
5837    /// - `devPtr`: Return device pointer associated with symbol.
5838    /// - `symbol`: Device symbol address.
5839    ///
5840    /// # Return value
5841    ///
5842    /// - [`cudaError_t::CUDA_SUCCESS`]
5843    /// - [`cudaErrorInvalidSymbol`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a01a4a97f3060ec714ffa9dd650b9213a)
5844    /// - [`cudaError_t::CUDA_ERROR_NO_BINARY_FOR_GPU`]
5845    ///
5846    /// See also: [cudaGetSymbolAddress (C++ API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1gab4ba467fefaf5bd30bfcc398cc8fe978), [`cudaGetSymbolSize`] (C API), [`cuModuleGetGlobal`](crate::driver::cuModuleGetGlobal).
5847    pub fn cudaGetSymbolAddress(
5848        devPtr: *mut *mut ::core::ffi::c_void,
5849        symbol: *const ::core::ffi::c_void,
5850    ) -> cudaError_t;
5851}
5852singe_loader::functions! { crate::RUNTIME;
5853    /// Finds the size of the object associated with a CUDA symbol.
5854    ///
5855    /// Returns in `*size` the size of symbol `symbol`. `symbol` is a variable that resides in global or constant memory space. If `symbol` cannot be found, or if `symbol` is not declared in global or constant memory space, `*size` is unchanged and the error [cudaErrorInvalidSymbol](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a01a4a97f3060ec714ffa9dd650b9213a) is returned.
5856    ///
5857    /// Note that this function may also return error codes from previous, asynchronous launches.
5858    ///
5859    /// Note: Use of a string naming a variable as the `symbol` parameter was deprecated in CUDA 4.1 and removed in CUDA 5.0.
5860    ///
5861    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
5862    ///
5863    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
5864    ///
5865    /// # Parameters
5866    ///
5867    /// - `size`: Size of object associated with symbol.
5868    /// - `symbol`: Device symbol address.
5869    ///
5870    /// # Return value
5871    ///
5872    /// - [`cudaError_t::CUDA_SUCCESS`]
5873    /// - [`cudaErrorInvalidSymbol`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a01a4a97f3060ec714ffa9dd650b9213a)
5874    /// - [`cudaError_t::CUDA_ERROR_NO_BINARY_FOR_GPU`]
5875    ///
5876    /// See also: [`cudaGetSymbolAddress`] (C API), [cudaGetSymbolSize (C++ API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1gab3d89a5d7d8d7fd72d9a99cf714fef9e), [`cuModuleGetGlobal`](crate::driver::cuModuleGetGlobal).
5877    pub fn cudaGetSymbolSize(
5878        size: *mut size_t,
5879        symbol: *const ::core::ffi::c_void,
5880    ) -> cudaError_t;
5881}
5882singe_loader::functions! { crate::RUNTIME;
5883    /// Prefetches memory to the specified destination location.
5884    ///
5885    /// 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. `stream` is the stream in which the operation is enqueued. The memory range must refer to managed memory allocated via [`cudaMallocManaged`] or declared via **managed** variables, or it may also refer to memory allocated from a managed memory pool, or it may also refer to system-allocated memory on systems with non-zero cudaDevAttrPageableMemoryAccess.
5886    ///
5887    /// Specifying [cudaMemLocationTypeDevice](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0ae479b8710f3c5270117ee9d8cf5868d4) for [`cudaMemLocation::type`](crate::driver::CUmemLocation_st::type_) will prefetch memory to GPU specified by device ordinal [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemLocation.html#structcudamemlocation_1a1c914cd5c3cc7323b4fde9756458efb0) which must have non-zero value for the device attribute `concurrentManagedAccess`. Additionally, `stream` must be associated with a device that has a non-zero value for the device attribute `concurrentManagedAccess`. Specifying [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a1ec97ff5f3c715e4b18e39dabf9e31c5) as [`cudaMemLocation::type`](crate::driver::CUmemLocation_st::type_) will prefetch data to host memory. Applications can request prefetching memory to a specific host NUMA node by specifying [cudaMemLocationTypeHostNuma](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a24dc63fb938dee27b41e3842da35d2d0) for [`cudaMemLocation::type`](crate::driver::CUmemLocation_st::type_) and a valid host NUMA node id in [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemLocation.html#structcudamemlocation_1a1c914cd5c3cc7323b4fde9756458efb0) Users can also request prefetching memory to the host NUMA node closest to the current thread’s CPU by specifying [cudaMemLocationTypeHostNumaCurrent](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0aa3925690e32332c940cb726ef56a4258) for [`cudaMemLocation::type`](crate::driver::CUmemLocation_st::type_). Note when [`cudaMemLocation::type`](crate::driver::CUmemLocation_st::type_) is etiher [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a1ec97ff5f3c715e4b18e39dabf9e31c5) OR [cudaMemLocationTypeHostNumaCurrent](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0aa3925690e32332c940cb726ef56a4258), [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemLocation.html#structcudamemlocation_1a1c914cd5c3cc7323b4fde9756458efb0) will be ignored. Prefetching to [cudaMemLocationTypeDeviceLocalityDomain](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a88b5d659aa9d7501f0382836eebb125b) locations is not supported.
5888    ///
5889    /// 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.
5890    ///
5891    /// 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 [`cudaMallocManaged`] allocations to host memory in order to make room. Device memory allocated using [`cudaMalloc`] or [`cudaMallocArray`] will not be evicted.
5892    ///
5893    /// 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`](crate::driver::cuMemAdvise) as described below:
5894    ///
5895    /// If [`cudaMemoryAdvise::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.
5896    ///
5897    /// If [`cudaMemoryAdvise::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.
5898    ///
5899    /// If [`cudaMemoryAdvise::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.
5900    ///
5901    /// 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.
5902    ///
5903    /// Note that this function is asynchronous with respect to the host and all work on other devices.
5904    ///
5905    /// Note that this function may also return error codes from previous, asynchronous launches.
5906    ///
5907    /// Note: This function exhibits asynchronous behavior for most use cases.
5908    ///
5909    /// Note: This function uses standard default stream semantics.
5910    ///
5911    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
5912    ///
5913    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
5914    ///
5915    /// # Parameters
5916    ///
5917    /// - `devPtr`: Pointer to be prefetched.
5918    /// - `count`: Size in bytes.
5919    /// - `location`: location to prefetch to.
5920    /// - `flags`: flags for future use, must be zero now.
5921    /// - `stream`: Stream to enqueue prefetch operation.
5922    ///
5923    /// # Return value
5924    ///
5925    /// - [`cudaError_t::CUDA_SUCCESS`]
5926    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
5927    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
5928    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
5929    ///
5930    /// See also: [`cudaMemcpy`], [`cudaMemcpyPeer`], [`cudaMemcpyAsync`], [`cudaMemcpy3DPeerAsync`], [`cudaMemAdvise`], [`cuMemPrefetchAsync`](crate::driver::cuMemPrefetchAsync).
5931    pub fn cudaMemPrefetchAsync(
5932        devPtr: *const ::core::ffi::c_void,
5933        count: size_t,
5934        location: cudaMemLocation,
5935        flags: ::core::ffi::c_uint,
5936        stream: cudaStream_t,
5937    ) -> cudaError_t;
5938}
5939singe_loader::functions! { crate::RUNTIME;
5940    /// Performs a batch of memory prefetches asynchronously.
5941    ///
5942    /// 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 [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`] otherwise the API will return an error.
5943    ///
5944    /// The semantics of the individual prefetch operations are as described in [`cudaMemPrefetchAsync`].
5945    ///
5946    /// 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 [`cudaMallocManaged`] or declared via **managed** variables or it may also refer to system-allocated memory when all devices have a non-zero value for [`cudaDeviceAttr::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`.
5947    ///
5948    /// # Parameters
5949    ///
5950    /// - `dptrs`: Array of pointers to be prefetched.
5951    /// - `sizes`: Array of sizes for memory prefetch operations.
5952    /// - `count`: Size of `dptrs` and `sizes` arrays.
5953    /// - `prefetchLocs`: Array of locations to prefetch to.
5954    /// - `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.
5955    /// - `numPrefetchLocs`: Size of `prefetchLocs` and `prefetchLocIdxs` arrays.
5956    /// - `flags`: Flags reserved for future use. Must be zero.
5957    /// - `stream`: The stream to enqueue the operations in. Must not be legacy NULL stream.
5958    pub fn cudaMemPrefetchBatchAsync(
5959        dptrs: *mut *mut ::core::ffi::c_void,
5960        sizes: *mut size_t,
5961        count: size_t,
5962        prefetchLocs: *mut cudaMemLocation,
5963        prefetchLocIdxs: *mut size_t,
5964        numPrefetchLocs: size_t,
5965        flags: ::core::ffi::c_ulonglong,
5966        stream: cudaStream_t,
5967    ) -> cudaError_t;
5968}
5969singe_loader::functions! { crate::RUNTIME;
5970    /// Performs a batch of memory discards asynchronously.
5971    ///
5972    /// 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 [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`] otherwise the API will return an error.
5973    ///
5974    /// 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 [`cudaMemPrefetchAsync`] or [`cudaMemPrefetchBatchAsync`]. 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.
5975    ///
5976    /// 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 [`cudaMallocManaged`] or declared via **managed** variables or it may also refer to system-allocated memory when all devices have a non-zero value for [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`].
5977    ///
5978    /// # Parameters
5979    ///
5980    /// - `dptrs`: Array of pointers to be discarded.
5981    /// - `sizes`: Array of sizes for memory discard operations.
5982    /// - `count`: Size of `dptrs` and `sizes` arrays.
5983    /// - `flags`: Flags reserved for future use. Must be zero.
5984    /// - `stream`: The stream to enqueue the operations in. Must not be legacy NULL stream.
5985    pub fn cudaMemDiscardBatchAsync(
5986        dptrs: *mut *mut ::core::ffi::c_void,
5987        sizes: *mut size_t,
5988        count: size_t,
5989        flags: ::core::ffi::c_ulonglong,
5990        stream: cudaStream_t,
5991    ) -> cudaError_t;
5992}
5993singe_loader::functions! { crate::RUNTIME;
5994    /// Performs a batch of memory discards and prefetches asynchronously.
5995    ///
5996    /// 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 [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`] otherwise the API will return an error.
5997    ///
5998    /// Calling [`cudaMemDiscardAndPrefetchBatchAsync`] is semantically equivalent to calling [`cudaMemDiscardBatchAsync`] followed by [`cudaMemPrefetchBatchAsync`], but is more optimal. For more details on what discarding and prefetching imply, please refer to [`cudaMemDiscardBatchAsync`] and [`cudaMemPrefetchBatchAsync`] 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.
5999    ///
6000    /// 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 [`cudaMallocManaged`] or declared via **managed** variables or it may also refer to system-allocated memory when all devices have a non-zero value for [`cudaDeviceAttr::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`.
6001    ///
6002    /// # Parameters
6003    ///
6004    /// - `dptrs`: Array of pointers to be discarded.
6005    /// - `sizes`: Array of sizes for memory discard operations.
6006    /// - `count`: Size of `dptrs` and `sizes` arrays.
6007    /// - `prefetchLocs`: Array of locations to prefetch to.
6008    /// - `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.
6009    /// - `numPrefetchLocs`: Size of `prefetchLocs` and `prefetchLocIdxs` arrays.
6010    /// - `flags`: Flags reserved for future use. Must be zero.
6011    /// - `stream`: The stream to enqueue the operations in. Must not be legacy NULL stream.
6012    pub fn cudaMemDiscardAndPrefetchBatchAsync(
6013        dptrs: *mut *mut ::core::ffi::c_void,
6014        sizes: *mut size_t,
6015        count: size_t,
6016        prefetchLocs: *mut cudaMemLocation,
6017        prefetchLocIdxs: *mut size_t,
6018        numPrefetchLocs: size_t,
6019        flags: ::core::ffi::c_ulonglong,
6020        stream: cudaStream_t,
6021    ) -> cudaError_t;
6022}
6023singe_loader::functions! { crate::RUNTIME;
6024    /// Gets location information for a memory address range.
6025    ///
6026    /// Retrieves memory location information for the specified address range starting at `ptr` with size `size`. The API determines the most common location by sampling memory at intervals defined by `samplingGranularity` within the whole interval.
6027    ///
6028    /// 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.
6029    ///
6030    /// For example, with an address range of 1GB, a `summaryGranularity` of 128MB, and a `samplingGranularity` of 2MB, the function will:
6031    ///
6032    /// * Divide the 1GB range into 8 summary regions of 128MB each
6033    /// * Within each 128MB region, sample every 2MB to determine the most common location. If there is a tie a random winner is chosen.
6034    /// * 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 it is set to a system dependent default value. In all other cases, the call returns [`cudaError_t::CUDA_ERROR_INVALID_VALUE`].
6035    ///
6036    /// When the memory is not resident on any processor, the call returns [`cudaError_t::CUDA_SUCCESS`] and the returned location type for that interval is [cudaMemLocationTypeNone](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a53b6266fa56e0b7efe6a0b78ed8e8f49).
6037    ///
6038    /// The memory range must refer to one of the following:
6039    ///
6040    /// * Managed memory allocated via [`cudaMallocManaged`], via [`cudaMallocFromPoolAsync`] from a managed memory pool or declared via **managed** variables.
6041    /// * System-allocated pageable memory that is not registered via [`cudaHostRegister`]. If the memory range does not refer to one of the above, the call returns [`cudaError_t::CUDA_ERROR_INVALID_VALUE`].
6042    ///
6043    /// All devices on the system must have non-zero value for the device attribute [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`]. If not, this call returns [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`].
6044    ///
6045    /// Note that this function may also return error codes from previous, asynchronous launches.
6046    ///
6047    /// # Parameters
6048    ///
6049    /// - `size`: Size in bytes of the memory range to query.
6050    /// - `summaryGranularity`: Granularity in bytes at which to summarize location information.
6051    /// - `samplingGranularity`: Granularity in bytes at which to sample memory within each summary region.
6052    /// - `location_out`: Array to store location information, one entry per summary region.
6053    ///
6054    /// # Return value
6055    ///
6056    /// - [`cudaError_t::CUDA_SUCCESS`]
6057    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
6058    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
6059    pub fn cudaMemGetLocationInfo(
6060        devPtr: *mut ::core::ffi::c_void,
6061        size: size_t,
6062        summaryGranularity: size_t,
6063        samplingGranularity: size_t,
6064        location_out: *mut cudaMemLocation,
6065    ) -> cudaError_t;
6066}
6067singe_loader::functions! { crate::RUNTIME;
6068    /// Advise about the usage of a given memory range.
6069    ///
6070    /// 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 [`cudaMallocManaged`] 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.
6071    ///
6072    /// The `advice` parameter can take the following values:
6073    ///
6074    /// * [`cudaMemoryAdvise::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 [`cudaMemPrefetchAsync`] or [`cudaMemPrefetchAsync`] is called on this region, it will create a read-only copy of the data on the destination processor. If the target location for [`cudaMemPrefetchAsync`] 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 [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`]. Also, if a context is created on a device that does not have the device attribute [`cudaDeviceAttr::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 [`cudaDeviceAttr::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 [`cudaDeviceAttr::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.
6075    /// * `cudaMemAdviceUnsetReadMostly`: Undoes the effect of [`cudaMemoryAdvise::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.
6076    /// * [`cudaMemoryAdvise::CU_MEM_ADVISE_SET_PREFERRED_LOCATION`]: This advice sets the preferred location for the data to be the memory belonging to `location`. When [`cudaMemLocation::type`](crate::driver::CUmemLocation_st::type_) is [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a1ec97ff5f3c715e4b18e39dabf9e31c5), [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemLocation.html#structcudamemlocation_1a1c914cd5c3cc7323b4fde9756458efb0) 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 [`cudaMemLocation::type`](crate::driver::CUmemLocation_st::type_) to [cudaMemLocationTypeHostNuma](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a24dc63fb938dee27b41e3842da35d2d0) and [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemLocation.html#structcudamemlocation_1a1c914cd5c3cc7323b4fde9756458efb0) must specify the NUMA ID of the host NUMA node. If [`cudaMemLocation::type`](crate::driver::CUmemLocation_st::type_) is set to [cudaMemLocationTypeHostNumaCurrent](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0aa3925690e32332c940cb726ef56a4258), [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemLocation.html#structcudamemlocation_1a1c914cd5c3cc7323b4fde9756458efb0) will be ignored and the host NUMA node closest to the calling thread’s CPU will be used as the preferred location. If [`cudaMemLocation::type`](crate::driver::CUmemLocation_st::type_) is a [cudaMemLocationTypeDevice](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0ae479b8710f3c5270117ee9d8cf5868d4), then [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemLocation.html#structcudamemlocation_1a1c914cd5c3cc7323b4fde9756458efb0) must be a valid device ordinal and the device must have a non-zero value for the device attribute [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`]. 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 [`cudaMemPrefetchAsync`]. 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 [`cudaMemoryAdvise::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 [`cudaMemoryAdvise::CU_MEM_ADVISE_SET_READ_MOSTLY`]. If the memory region refers to valid system-allocated pageable memory, and [`cudaMemLocation::type`](crate::driver::CUmemLocation_st::type_) is [cudaMemLocationTypeDevice](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0ae479b8710f3c5270117ee9d8cf5868d4) then [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemLocation.html#structcudamemlocation_1a1c914cd5c3cc7323b4fde9756458efb0) must be a valid device that has a non-zero alue for the device attribute [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`].
6077    /// * [`cudaMemoryAdvise::CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION`]: Undoes the effect of [`cudaMemoryAdvise::CU_MEM_ADVISE_SET_PREFERRED_LOCATION`] and changes the preferred location to none. The `location` argument is ignored for this advice.
6078    /// * [`cudaMemoryAdvise::CU_MEM_ADVISE_SET_ACCESSED_BY`]: This advice implies that the data will be accessed by processor `location`. The [`cudaMemLocation::type`](crate::driver::CUmemLocation_st::type_) must be either [cudaMemLocationTypeDevice](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0ae479b8710f3c5270117ee9d8cf5868d4) with [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemLocation.html#structcudamemlocation_1a1c914cd5c3cc7323b4fde9756458efb0) representing a valid device ordinal or [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a1ec97ff5f3c715e4b18e39dabf9e31c5) and [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemLocation.html#structcudamemlocation_1a1c914cd5c3cc7323b4fde9756458efb0) will be ignored. All other location types are invalid. If [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemLocation.html#structcudamemlocation_1a1c914cd5c3cc7323b4fde9756458efb0) is a GPU, then the device attribute [`cudaDeviceAttr::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 [`cudaMemoryAdvise::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 [`cudaMemoryAdvise::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`](crate::driver::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 [`cudaMemLocation::type`](crate::driver::CUmemLocation_st::type_) is [cudaMemLocationTypeDevice](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0ae479b8710f3c5270117ee9d8cf5868d4) then device in [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemLocation.html#structcudamemlocation_1a1c914cd5c3cc7323b4fde9756458efb0) must have a non-zero value for the device attribute [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`]. Additionally, if [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemLocation.html#structcudamemlocation_1a1c914cd5c3cc7323b4fde9756458efb0) has a non-zero value for the device attribute [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES`], then this call has no effect.
6079    /// * [`CUmem_advise_enum::CU_MEM_ADVISE_UNSET_ACCESSED_BY`](crate::driver::CUmem_advise_enum::CU_MEM_ADVISE_UNSET_ACCESSED_BY): Undoes the effect of [`cudaMemoryAdvise::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 [`cudaMemLocation::type`](crate::driver::CUmemLocation_st::type_) is [cudaMemLocationTypeDevice](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0ae479b8710f3c5270117ee9d8cf5868d4) then device in [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemLocation.html#structcudamemlocation_1a1c914cd5c3cc7323b4fde9756458efb0) must have a non-zero value for the device attribute [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`]. Additionally, if [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemLocation.html#structcudamemlocation_1a1c914cd5c3cc7323b4fde9756458efb0) has a non-zero value for the device attribute [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES`], then this call has no effect.
6080    ///
6081    /// Note that this function may also return error codes from previous, asynchronous launches.
6082    ///
6083    /// Note: This function exhibits asynchronous behavior for most use cases.
6084    ///
6085    /// Note: This function uses standard default stream semantics.
6086    ///
6087    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
6088    ///
6089    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
6090    ///
6091    /// # Parameters
6092    ///
6093    /// - `devPtr`: Pointer to memory to set the advice for.
6094    /// - `count`: Size in bytes of the memory range.
6095    /// - `advice`: Advice to be applied for the specified memory range.
6096    /// - `location`: location to apply the advice for.
6097    ///
6098    /// # Return value
6099    ///
6100    /// - [`cudaError_t::CUDA_SUCCESS`]
6101    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
6102    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
6103    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
6104    ///
6105    /// See also: [`cudaMemcpy`], [`cudaMemcpyPeer`], [`cudaMemcpyAsync`], [`cudaMemcpy3DPeerAsync`], [`cudaMemPrefetchAsync`], [`cuMemAdvise`](crate::driver::cuMemAdvise).
6106    pub fn cudaMemAdvise(
6107        devPtr: *const ::core::ffi::c_void,
6108        count: size_t,
6109        advice: cudaMemoryAdvise,
6110        location: cudaMemLocation,
6111    ) -> cudaError_t;
6112}
6113singe_loader::functions! { crate::RUNTIME;
6114    /// Query an attribute of a given memory range.
6115    ///
6116    /// 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 [`cudaMallocManaged`] or declared via **managed** variables.
6117    ///
6118    /// The `attribute` parameter can take the following values:
6119    ///
6120    /// * [`cudaMemRangeAttribute::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.
6121    /// * [`cudaMemRangeAttribute::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 cudaCpuDeviceId if all pages in the memory range have the CPU as their preferred location, or it will be cudaInvalidDeviceId 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.
6122    /// * [`cudaMemRangeAttribute::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 `cudaMemAdviceSetAccessedBy` 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, cudaInvalidDeviceId 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, cudaInvalidDeviceId, cudaInvalidDeviceId }. 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.
6123    /// * [`cudaMemRangeAttribute::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 [`cudaMemPrefetchAsync`]. This will either be a GPU id or cudaCpuDeviceId 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, cudaInvalidDeviceId will be returned. Note that this simply returns the last location that the applicaton 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.
6124    /// * [`cudaMemRangeAttribute::CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_TYPE`]: If this attribute is specified, `data` will be interpreted as a [cudaMemLocationType](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga2279aa08666f329f3ba4afe397fa60f0), and `dataSize` must be sizeof(cudaMemLocationType). The [cudaMemLocationType](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga2279aa08666f329f3ba4afe397fa60f0) returned will be [cudaMemLocationTypeDevice](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0ae479b8710f3c5270117ee9d8cf5868d4) if all pages in the memory range have the same GPU as their preferred location, or [cudaMemLocationType](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga2279aa08666f329f3ba4afe397fa60f0) will be [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a1ec97ff5f3c715e4b18e39dabf9e31c5) if all pages in the memory range have the CPU as their preferred location, or or it will be [cudaMemLocationTypeHostNuma](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a24dc63fb938dee27b41e3842da35d2d0) if all the pages in the memory range have the same host NUMA node ID as their preferred location or it will be cudaMemLocationTypeInvalid 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.
6125    ///
6126    ///   + [`cudaMemRangeAttribute::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 [`cudaMemRangeAttribute::CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_TYPE`] query for the same address range returns [cudaMemLocationTypeDevice](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0ae479b8710f3c5270117ee9d8cf5868d4), it will be a valid device ordinal or if it returns [cudaMemLocationTypeHostNuma](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a24dc63fb938dee27b41e3842da35d2d0), it will be a valid host NUMA node ID or if it returns any other location type, the id should be ignored.
6127    /// * [`cudaMemRangeAttribute::CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_TYPE`]: If this attribute is specified, `data` will be interpreted as a [cudaMemLocationType](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga2279aa08666f329f3ba4afe397fa60f0), and `dataSize` must be sizeof(cudaMemLocationType). The result returned will be the last location type to which all pages in the memory range were prefetched explicitly via [`cuMemPrefetchAsync`](crate::driver::cuMemPrefetchAsync). The [cudaMemLocationType](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga2279aa08666f329f3ba4afe397fa60f0) returned will be [cudaMemLocationTypeDevice](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0ae479b8710f3c5270117ee9d8cf5868d4) if the last prefetch location was the GPU or [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a1ec97ff5f3c715e4b18e39dabf9e31c5) if it was the CPU or [cudaMemLocationTypeHostNuma](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a24dc63fb938dee27b41e3842da35d2d0) 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`](crate::driver::CUmemLocationType) will be cudaMemLocationTypeInvalid. 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.
6128    ///
6129    ///   + [`cudaMemRangeAttribute::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 [`cudaMemRangeAttribute::CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_TYPE`] query for the same address range returns [cudaMemLocationTypeDevice](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0ae479b8710f3c5270117ee9d8cf5868d4), it will be a valid device ordinal or if it returns [cudaMemLocationTypeHostNuma](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a24dc63fb938dee27b41e3842da35d2d0), it will be a valid host NUMA node ID or if it returns any other location type, the id should be ignored.
6130    ///
6131    /// Note that this function may also return error codes from previous, asynchronous launches.
6132    ///
6133    /// Note: This function exhibits asynchronous behavior for most use cases.
6134    ///
6135    /// Note: This function uses standard default stream semantics.
6136    ///
6137    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
6138    ///
6139    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
6140    ///
6141    /// # Parameters
6142    ///
6143    /// - `data`: A pointers to a memory location where the result of each attribute query will be written to.
6144    /// - `dataSize`: Array containing the size of data.
6145    /// - `attribute`: The attribute to query.
6146    /// - `devPtr`: Start of the range to query.
6147    /// - `count`: Size of the range to query.
6148    ///
6149    /// # Return value
6150    ///
6151    /// - [`cudaError_t::CUDA_SUCCESS`]
6152    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
6153    ///
6154    /// See also: [`cudaMemRangeGetAttributes`], [`cudaMemPrefetchAsync`], [`cudaMemAdvise`], [`cuMemRangeGetAttribute`](crate::driver::cuMemRangeGetAttribute).
6155    pub fn cudaMemRangeGetAttribute(
6156        data: *mut ::core::ffi::c_void,
6157        dataSize: size_t,
6158        attribute: cudaMemRangeAttribute,
6159        devPtr: *const ::core::ffi::c_void,
6160        count: size_t,
6161    ) -> cudaError_t;
6162}
6163singe_loader::functions! { crate::RUNTIME;
6164    /// Query attributes of a given memory range.
6165    ///
6166    /// 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 [`cudaMallocManaged`] 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`.
6167    ///
6168    /// The list of supported attributes are given below. Please refer to [`cudaMemRangeGetAttribute`] for attribute descriptions and restrictions.
6169    ///
6170    /// * [`cudaMemRangeAttribute::CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY`]
6171    /// * [`cudaMemRangeAttribute::CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION`]
6172    /// * [`cudaMemRangeAttribute::CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY`]
6173    /// * [`cudaMemRangeAttribute::CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION`]
6174    /// * :: cudaMemRangeAttributePreferredLocationType
6175    /// * :: cudaMemRangeAttributePreferredLocationId
6176    /// * :: cudaMemRangeAttributeLastPrefetchLocationType
6177    /// * :: cudaMemRangeAttributeLastPrefetchLocationId.
6178    ///
6179    /// Note that this function may also return error codes from previous, asynchronous launches.
6180    ///
6181    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
6182    ///
6183    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
6184    ///
6185    /// # Parameters
6186    ///
6187    /// - `data`: A two-dimensional array containing pointers to memory locations where the result of each attribute query will be written to.
6188    /// - `dataSizes`: Array containing the sizes of each result.
6189    /// - `attributes`: An array of attributes to query (numAttributes and the number of attributes in this array should match).
6190    /// - `numAttributes`: Number of attributes to query.
6191    /// - `devPtr`: Start of the range to query.
6192    /// - `count`: Size of the range to query.
6193    ///
6194    /// # Return value
6195    ///
6196    /// - [`cudaError_t::CUDA_SUCCESS`]
6197    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
6198    ///
6199    /// See also: [`cudaMemRangeGetAttribute`], [`cudaMemAdvise`], [`cudaMemPrefetchAsync`], [`cuMemRangeGetAttributes`](crate::driver::cuMemRangeGetAttributes).
6200    pub fn cudaMemRangeGetAttributes(
6201        data: *mut *mut ::core::ffi::c_void,
6202        dataSizes: *mut size_t,
6203        attributes: *mut cudaMemRangeAttribute,
6204        numAttributes: size_t,
6205        devPtr: *const ::core::ffi::c_void,
6206        count: size_t,
6207    ) -> cudaError_t;
6208}
6209singe_loader::functions! { crate::RUNTIME;
6210    /// Copies data between host and device.
6211    ///
6212    /// Copies `count` bytes from the memory area pointed to by `src` to the CUDA array `dst` starting at `hOffset` rows and `wOffset` bytes from the upper left corner, where `kind` specifies the direction of the copy, and must be one of [`cudaMemcpyKind::cudaMemcpyHostToHost`], [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing.
6213    ///
6214    /// Note that this function may also return error codes from previous, asynchronous launches.
6215    ///
6216    /// Note: This function exhibits synchronous behavior for most use cases.
6217    ///
6218    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
6219    ///
6220    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
6221    ///
6222    /// # Parameters
6223    ///
6224    /// - `dst`: Destination memory address.
6225    /// - `wOffset`: Destination starting X offset (columns in bytes).
6226    /// - `hOffset`: Destination starting Y offset (rows).
6227    /// - `src`: Source memory address.
6228    /// - `count`: Size in bytes to copy.
6229    /// - `kind`: Type of transfer.
6230    ///
6231    /// # Return value
6232    ///
6233    /// - [`cudaError_t::CUDA_SUCCESS`]
6234    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
6235    /// - [`cudaErrorInvalidMemcpyDirection`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a72ce39cee8ef48a83b0191b2e33d2630)
6236    ///
6237    /// See also: [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpy2DToArray`], [`cudaMemcpyFromArray`], [`cudaMemcpy2DFromArray`], [`cudaMemcpyArrayToArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpyToArrayAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpyFromArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [`cuMemcpyHtoA`](crate::driver::cuMemcpyHtoA), [`cuMemcpyDtoA`](crate::driver::cuMemcpyDtoA).
6238    #[deprecated]
6239    pub fn cudaMemcpyToArray(
6240        dst: cudaArray_t,
6241        wOffset: size_t,
6242        hOffset: size_t,
6243        src: *const ::core::ffi::c_void,
6244        count: size_t,
6245        kind: cudaMemcpyKind,
6246    ) -> cudaError_t;
6247}
6248singe_loader::functions! { crate::RUNTIME;
6249    /// Copies data between host and device.
6250    ///
6251    /// Copies `count` bytes from the CUDA array `src` starting at `hOffset` rows and `wOffset` bytes from the upper left corner to the memory area pointed to by `dst`, where `kind` specifies the direction of the copy, and must be one of [`cudaMemcpyKind::cudaMemcpyHostToHost`], [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing.
6252    ///
6253    /// Note that this function may also return error codes from previous, asynchronous launches.
6254    ///
6255    /// Note: This function exhibits synchronous behavior for most use cases.
6256    ///
6257    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
6258    ///
6259    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
6260    ///
6261    /// # Parameters
6262    ///
6263    /// - `dst`: Destination memory address.
6264    /// - `src`: Source memory address.
6265    /// - `wOffset`: Source starting X offset (columns in bytes).
6266    /// - `hOffset`: Source starting Y offset (rows).
6267    /// - `count`: Size in bytes to copy.
6268    /// - `kind`: Type of transfer.
6269    ///
6270    /// # Return value
6271    ///
6272    /// - [`cudaError_t::CUDA_SUCCESS`]
6273    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
6274    /// - [`cudaErrorInvalidMemcpyDirection`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a72ce39cee8ef48a83b0191b2e33d2630)
6275    ///
6276    /// See also: [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpyToArray`], [`cudaMemcpy2DToArray`], [`cudaMemcpy2DFromArray`], [`cudaMemcpyArrayToArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpyToArrayAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpyFromArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [`cuMemcpyAtoH`](crate::driver::cuMemcpyAtoH), [`cuMemcpyAtoD`](crate::driver::cuMemcpyAtoD).
6277    #[deprecated]
6278    pub fn cudaMemcpyFromArray(
6279        dst: *mut ::core::ffi::c_void,
6280        src: cudaArray_const_t,
6281        wOffset: size_t,
6282        hOffset: size_t,
6283        count: size_t,
6284        kind: cudaMemcpyKind,
6285    ) -> cudaError_t;
6286}
6287singe_loader::functions! { crate::RUNTIME;
6288    /// Copies data between host and device.
6289    ///
6290    /// Copies `count` bytes from the CUDA array `src` starting at `hOffsetSrc` rows and `wOffsetSrc` bytes from the upper left corner to the CUDA array `dst` starting at `hOffsetDst` rows and `wOffsetDst` bytes from the upper left corner, where `kind` specifies the direction of the copy, and must be one of [`cudaMemcpyKind::cudaMemcpyHostToHost`], [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing.
6291    ///
6292    /// Note that this function may also return error codes from previous, asynchronous launches.
6293    ///
6294    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
6295    ///
6296    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
6297    ///
6298    /// # Parameters
6299    ///
6300    /// - `dst`: Destination memory address.
6301    /// - `wOffsetDst`: Destination starting X offset (columns in bytes).
6302    /// - `hOffsetDst`: Destination starting Y offset (rows).
6303    /// - `src`: Source memory address.
6304    /// - `wOffsetSrc`: Source starting X offset (columns in bytes).
6305    /// - `hOffsetSrc`: Source starting Y offset (rows).
6306    /// - `count`: Size in bytes to copy.
6307    /// - `kind`: Type of transfer.
6308    ///
6309    /// # Return value
6310    ///
6311    /// - [`cudaError_t::CUDA_SUCCESS`]
6312    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
6313    /// - [`cudaErrorInvalidMemcpyDirection`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a72ce39cee8ef48a83b0191b2e33d2630)
6314    ///
6315    /// See also: [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpyToArray`], [`cudaMemcpy2DToArray`], [`cudaMemcpyFromArray`], [`cudaMemcpy2DFromArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpyToArrayAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpyFromArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [`cuMemcpyAtoA`](crate::driver::cuMemcpyAtoA).
6316    #[deprecated]
6317    pub fn cudaMemcpyArrayToArray(
6318        dst: cudaArray_t,
6319        wOffsetDst: size_t,
6320        hOffsetDst: size_t,
6321        src: cudaArray_const_t,
6322        wOffsetSrc: size_t,
6323        hOffsetSrc: size_t,
6324        count: size_t,
6325        kind: cudaMemcpyKind,
6326    ) -> cudaError_t;
6327}
6328singe_loader::functions! { crate::RUNTIME;
6329    /// Copies data between host and device.
6330    ///
6331    /// Copies `count` bytes from the memory area pointed to by `src` to the CUDA array `dst` starting at `hOffset` rows and `wOffset` bytes from the upper left corner, where `kind` specifies the direction of the copy, and must be one of [`cudaMemcpyKind::cudaMemcpyHostToHost`], [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing.
6332    ///
6333    /// [`cudaMemcpyToArrayAsync`] is asynchronous with respect to the host, so the call may return before the copy is complete. The copy can optionally be associated to a stream by passing a non-zero `stream` argument. If `kind` is [`cudaMemcpyKind::cudaMemcpyHostToDevice`] or [`cudaMemcpyKind::cudaMemcpyDeviceToHost`] and `stream` is non-zero, the copy may overlap with operations in other streams.
6334    ///
6335    /// Note that this function may also return error codes from previous, asynchronous launches.
6336    ///
6337    /// Note: This function exhibits asynchronous behavior for most use cases.
6338    ///
6339    /// Note: This function uses standard default stream semantics.
6340    ///
6341    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
6342    ///
6343    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
6344    ///
6345    /// # Parameters
6346    ///
6347    /// - `dst`: Destination memory address.
6348    /// - `wOffset`: Destination starting X offset (columns in bytes).
6349    /// - `hOffset`: Destination starting Y offset (rows).
6350    /// - `src`: Source memory address.
6351    /// - `count`: Size in bytes to copy.
6352    /// - `kind`: Type of transfer.
6353    /// - `stream`: Stream identifier.
6354    ///
6355    /// # Return value
6356    ///
6357    /// - [`cudaError_t::CUDA_SUCCESS`]
6358    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
6359    /// - [`cudaErrorInvalidMemcpyDirection`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a72ce39cee8ef48a83b0191b2e33d2630)
6360    ///
6361    /// See also: [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpyToArray`], [`cudaMemcpy2DToArray`], [`cudaMemcpyFromArray`], [`cudaMemcpy2DFromArray`], [`cudaMemcpyArrayToArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpyFromArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [`cuMemcpyHtoAAsync`](crate::driver::cuMemcpyHtoAAsync), [`cuMemcpy2DAsync`](crate::driver::cuMemcpy2DAsync).
6362    #[deprecated]
6363    pub fn cudaMemcpyToArrayAsync(
6364        dst: cudaArray_t,
6365        wOffset: size_t,
6366        hOffset: size_t,
6367        src: *const ::core::ffi::c_void,
6368        count: size_t,
6369        kind: cudaMemcpyKind,
6370        stream: cudaStream_t,
6371    ) -> cudaError_t;
6372}
6373singe_loader::functions! { crate::RUNTIME;
6374    /// Copies data between host and device.
6375    ///
6376    /// Copies `count` bytes from the CUDA array `src` starting at `hOffset` rows and `wOffset` bytes from the upper left corner to the memory area pointed to by `dst`, where `kind` specifies the direction of the copy, and must be one of [`cudaMemcpyKind::cudaMemcpyHostToHost`], [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing.
6377    ///
6378    /// [`cudaMemcpyFromArrayAsync`] is asynchronous with respect to the host, so the call may return before the copy is complete. The copy can optionally be associated to a stream by passing a non-zero `stream` argument. If `kind` is [`cudaMemcpyKind::cudaMemcpyHostToDevice`] or [`cudaMemcpyKind::cudaMemcpyDeviceToHost`] and `stream` is non-zero, the copy may overlap with operations in other streams.
6379    ///
6380    /// Note that this function may also return error codes from previous, asynchronous launches.
6381    ///
6382    /// Note: This function exhibits asynchronous behavior for most use cases.
6383    ///
6384    /// Note: This function uses standard default stream semantics.
6385    ///
6386    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
6387    ///
6388    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
6389    ///
6390    /// # Parameters
6391    ///
6392    /// - `dst`: Destination memory address.
6393    /// - `src`: Source memory address.
6394    /// - `wOffset`: Source starting X offset (columns in bytes).
6395    /// - `hOffset`: Source starting Y offset (rows).
6396    /// - `count`: Size in bytes to copy.
6397    /// - `kind`: Type of transfer.
6398    /// - `stream`: Stream identifier.
6399    ///
6400    /// # Return value
6401    ///
6402    /// - [`cudaError_t::CUDA_SUCCESS`]
6403    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
6404    /// - [`cudaErrorInvalidMemcpyDirection`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a72ce39cee8ef48a83b0191b2e33d2630)
6405    ///
6406    /// See also: [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpyToArray`], [`cudaMemcpy2DToArray`], [`cudaMemcpyFromArray`], [`cudaMemcpy2DFromArray`], [`cudaMemcpyArrayToArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpyToArrayAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [`cuMemcpyAtoHAsync`](crate::driver::cuMemcpyAtoHAsync), [`cuMemcpy2DAsync`](crate::driver::cuMemcpy2DAsync).
6407    #[deprecated]
6408    pub fn cudaMemcpyFromArrayAsync(
6409        dst: *mut ::core::ffi::c_void,
6410        src: cudaArray_const_t,
6411        wOffset: size_t,
6412        hOffset: size_t,
6413        count: size_t,
6414        kind: cudaMemcpyKind,
6415        stream: cudaStream_t,
6416    ) -> cudaError_t;
6417}
6418singe_loader::functions! { crate::RUNTIME;
6419    /// Allocates memory with stream ordered semantics.
6420    ///
6421    /// 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 associated with the stream’s device.
6422    ///
6423    /// Note: The default memory pool of a device contains device memory from that device.
6424    ///
6425    /// 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.
6426    ///
6427    /// 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.
6428    ///
6429    /// Note that this function may also return error codes from previous, asynchronous launches.
6430    ///
6431    /// Note: This function uses standard default stream semantics.
6432    ///
6433    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
6434    ///
6435    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
6436    ///
6437    /// # Parameters
6438    ///
6439    /// - `devPtr`: Returned device pointer.
6440    /// - `size`: Number of bytes to allocate.
6441    /// - `hStream`: The stream establishing the stream ordering contract and the memory pool to allocate from.
6442    ///
6443    /// # Return value
6444    ///
6445    /// - [`cudaError_t::CUDA_SUCCESS`]
6446    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
6447    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]: cudaErrorOutOfMemory.
6448    ///
6449    /// See also: [`cuMemAllocAsync`](crate::driver::cuMemAllocAsync), [cudaMallocAsync (C++ API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1gaa31efcffc48981621feddd98d71a0feb), [`cudaMallocFromPoolAsync`], [`cudaFreeAsync`], [`cudaDeviceSetMemPool`], [`cudaDeviceGetDefaultMemPool`], [`cudaDeviceGetMemPool`], [`cudaMemPoolSetAccess`], [`cudaMemPoolSetAttribute`], [`cudaMemPoolGetAttribute`].
6450    pub fn cudaMallocAsync(
6451        devPtr: *mut *mut ::core::ffi::c_void,
6452        size: size_t,
6453        hStream: cudaStream_t,
6454    ) -> cudaError_t;
6455}
6456singe_loader::functions! { crate::RUNTIME;
6457    /// Frees memory with stream ordered semantics.
6458    ///
6459    /// 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.
6460    ///
6461    /// 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.
6462    ///
6463    /// Note that this function may also return error codes from previous, asynchronous launches.
6464    ///
6465    /// Note: This function uses standard default stream semantics.
6466    ///
6467    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
6468    ///
6469    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
6470    ///
6471    /// # Parameters
6472    ///
6473    /// - `hStream`: The stream establishing the stream ordering promise.
6474    ///
6475    /// # Return value
6476    ///
6477    /// - [`cudaError_t::CUDA_SUCCESS`]
6478    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
6479    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
6480    ///
6481    /// See also: [`cuMemFreeAsync`](crate::driver::cuMemFreeAsync), [`cudaMallocAsync`].
6482    pub fn cudaFreeAsync(
6483        devPtr: *mut ::core::ffi::c_void,
6484        hStream: cudaStream_t,
6485    ) -> cudaError_t;
6486}
6487singe_loader::functions! { crate::RUNTIME;
6488    /// Tries to release memory back to the OS.
6489    ///
6490    /// 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.
6491    ///
6492    /// Note: Allocations that have not been freed count as outstanding.
6493    ///
6494    /// 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.
6495    ///
6496    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
6497    ///
6498    /// # Parameters
6499    ///
6500    /// - `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.
6501    ///
6502    /// # Return value
6503    ///
6504    /// - [`cudaError_t::CUDA_SUCCESS`]
6505    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
6506    ///
6507    /// See also: [`cuMemPoolTrimTo`](crate::driver::cuMemPoolTrimTo), [`cudaMallocAsync`], [`cudaFreeAsync`], [`cudaDeviceGetDefaultMemPool`], [`cudaDeviceGetMemPool`], [`cudaMemPoolCreate`].
6508    pub fn cudaMemPoolTrimTo(
6509        memPool: cudaMemPool_t,
6510        minBytesToKeep: size_t,
6511    ) -> cudaError_t;
6512}
6513singe_loader::functions! { crate::RUNTIME;
6514    /// Sets attributes of a memory pool.
6515    ///
6516    /// Supported attributes are:
6517    ///
6518    /// * [`cudaMemPoolAttr::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)
6519    /// * [`cudaMemPoolAttr::CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES`]: (value type = int) Allow [`cudaMallocAsync`] 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)
6520    /// * [`cudaMemPoolAttr::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)
6521    /// * [`cudaMemPoolAttr::CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES`]: (value type = int) Allow [`cudaMallocAsync`] to insert new stream dependencies in order to establish the stream ordering required to reuse a piece of memory released by [`cudaFreeAsync`] (default enabled).
6522    /// * [`cudaMemPoolAttr::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.
6523    /// * [`cudaMemPoolAttr::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. It is illegal to set this attribute to a non-zero value.
6524    ///
6525    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
6526    ///
6527    /// # Parameters
6528    ///
6529    /// - `attr`: The attribute to modify.
6530    /// - `value`: Pointer to the value to assign.
6531    ///
6532    /// # Return value
6533    ///
6534    /// - [`cudaError_t::CUDA_SUCCESS`]
6535    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
6536    ///
6537    /// See also: [`cuMemPoolSetAttribute`](crate::driver::cuMemPoolSetAttribute), [`cudaMallocAsync`], [`cudaFreeAsync`], [`cudaDeviceGetDefaultMemPool`], [`cudaDeviceGetMemPool`], [`cudaMemPoolCreate`].
6538    pub fn cudaMemPoolSetAttribute(
6539        memPool: cudaMemPool_t,
6540        attr: cudaMemPoolAttr,
6541        value: *mut ::core::ffi::c_void,
6542    ) -> cudaError_t;
6543}
6544singe_loader::functions! { crate::RUNTIME;
6545    /// Gets attributes of a memory pool.
6546    ///
6547    /// Supported attributes are:
6548    ///
6549    /// * [`cudaMemPoolAttr::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)
6550    /// * [`cudaMemPoolAttr::CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES`]: (value type = int) Allow [`cudaMallocAsync`] 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)
6551    /// * [`cudaMemPoolAttr::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)
6552    /// * [`cudaMemPoolAttr::CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES`]: (value type = int) Allow [`cudaMallocAsync`] to insert new stream dependencies in order to establish the stream ordering required to reuse a piece of memory released by [`cudaFreeAsync`] (default enabled).
6553    /// * [`cudaMemPoolAttr::CU_MEMPOOL_ATTR_RESERVED_MEM_CURRENT`]: (value type = cuuint64_t) Amount of backing memory currently allocated for the mempool.
6554    /// * [`cudaMemPoolAttr::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.
6555    /// * [`cudaMemPoolAttr::CU_MEMPOOL_ATTR_USED_MEM_CURRENT`]: (value type = cuuint64_t) Amount of memory from the pool that is currently in use by the application.
6556    /// * [`cudaMemPoolAttr::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 since the last time it was reset.
6557    ///
6558    /// The following properties can be also be queried on imported and default pools:
6559    ///
6560    /// * [`cudaMemPoolAttr::CU_MEMPOOL_ATTR_ALLOCATION_TYPE`]: (value type = cudaMemAllocationType) The allocation type of the mempool
6561    /// * [`cudaMemPoolAttr::CU_MEMPOOL_ATTR_EXPORT_HANDLE_TYPES`]: (value type = cudaMemAllocationHandleType) Available export handle types for the mempool. For imported pools this value is always cudaMemHandleTypeNone as an imported pool cannot be re-exported
6562    /// * [`cudaMemPoolAttr::CU_MEMPOOL_ATTR_LOCATION_ID`]: (value type = int) The location id for the mempool. If the location type for this pool is cudaMemLocationTypeInvisible then ID will be cudaInvalidDeviceId.
6563    /// * [`cudaMemPoolAttr::CU_MEMPOOL_ATTR_LOCATION_TYPE`]: (value type = cudaMemLocationType) 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 cudaMemlocataionTypeInvisible.
6564    /// * [`cudaMemPoolAttr::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.
6565    /// * [`cudaMemPoolAttr::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 cudaMemAllocationTypeManaged and IPC imported pools this value will be system dependent.
6566    /// * [`cudaMemPoolAttr::CU_MEMPOOL_ATTR_HW_DECOMPRESS_ENABLED`]: (value type = int) Indicates whether the pool has hardware compresssion enabled.
6567    ///
6568    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
6569    ///
6570    /// # Parameters
6571    ///
6572    /// - `attr`: The attribute to get.
6573    /// - `value`: Retrieved value.
6574    ///
6575    /// # Return value
6576    ///
6577    /// - [`cudaError_t::CUDA_SUCCESS`]
6578    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
6579    ///
6580    /// See also: [`cuMemPoolGetAttribute`](crate::driver::cuMemPoolGetAttribute), [`cudaMallocAsync`], [`cudaFreeAsync`], [`cudaDeviceGetDefaultMemPool`], [`cudaDeviceGetMemPool`], [`cudaMemPoolCreate`].
6581    pub fn cudaMemPoolGetAttribute(
6582        memPool: cudaMemPool_t,
6583        attr: cudaMemPoolAttr,
6584        value: *mut ::core::ffi::c_void,
6585    ) -> cudaError_t;
6586}
6587singe_loader::functions! { crate::RUNTIME;
6588    /// Controls visibility of pools between devices.
6589    ///
6590    /// # Parameters
6591    ///
6592    /// - `count`: Number of descriptors in the map array.
6593    ///
6594    /// # Return value
6595    ///
6596    /// - [`cudaError_t::CUDA_SUCCESS`]
6597    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
6598    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
6599    ///
6600    /// See also: [`cuMemPoolSetAccess`](crate::driver::cuMemPoolSetAccess), [`cudaMemPoolGetAccess`], [`cudaMallocAsync`], [`cudaFreeAsync`].
6601    pub fn cudaMemPoolSetAccess(
6602        memPool: cudaMemPool_t,
6603        descList: *const cudaMemAccessDesc,
6604        count: size_t,
6605    ) -> cudaError_t;
6606}
6607singe_loader::functions! { crate::RUNTIME;
6608    /// Returns the accessibility of a pool from a device.
6609    ///
6610    /// Returns the accessibility of the pool’s memory from the specified location.
6611    ///
6612    /// # Parameters
6613    ///
6614    /// - `flags`: the accessibility of the pool from the specified location.
6615    /// - `memPool`: the pool being queried.
6616    /// - `location`: the location accessing the pool.
6617    ///
6618    /// See also: [`cuMemPoolGetAccess`](crate::driver::cuMemPoolGetAccess), [`cudaMemPoolSetAccess`].
6619    pub fn cudaMemPoolGetAccess(
6620        flags: *mut cudaMemAccessFlags,
6621        memPool: cudaMemPool_t,
6622        location: *mut cudaMemLocation,
6623    ) -> cudaError_t;
6624}
6625singe_loader::functions! { crate::RUNTIME;
6626    /// Creates a memory pool.
6627    ///
6628    /// 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.
6629    ///
6630    /// To create a memory pool for host memory not targeting a specific NUMA node, applications must set set `cudaMemPoolProps::cudaMemLocation::type` to [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a1ec97ff5f3c715e4b18e39dabf9e31c5). `cudaMemPoolProps::cudaMemLocation::id` is ignored for such pools. Pools created with the type [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a1ec97ff5f3c715e4b18e39dabf9e31c5) are not IPC capable and [`cudaMemPoolProps::handleTypes`](crate::driver::CUmemPoolProps_st::handleTypes) must be 0, any other values will result in [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]. To create a memory pool targeting a specific host NUMA node, applications must set `cudaMemPoolProps::cudaMemLocation::type` to [cudaMemLocationTypeHostNuma](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a24dc63fb938dee27b41e3842da35d2d0) and `cudaMemPoolProps::cudaMemLocation::id` must specify the NUMA ID of the host memory node. Specifying [cudaMemLocationTypeHostNumaCurrent](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0aa3925690e32332c940cb726ef56a4258) as the `cudaMemPoolProps::cudaMemLocation::type` will result in [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]. To create a memory pool targeting a specific device locality domain, applications must set `cudaMemPoolProps::cudaMemLocation::type` to [cudaMemLocationTypeDeviceLocalityDomain](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a88b5d659aa9d7501f0382836eebb125b), `cudaMemPoolProps::cudaMemLocation::localized`.deviceId must specify the device ID, and `cudaMemPoolProps::cudaMemLocation::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 [`cudaDeviceGetAttribute`] with the attribute [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_LOCALITY_DOMAIN_COUNT`]. By default, the pool’s memory will be accessible from the device it is allocated on. In the case of pools created with [cudaMemLocationTypeHostNuma](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a24dc63fb938dee27b41e3842da35d2d0) or [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a1ec97ff5f3c715e4b18e39dabf9e31c5), 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 [`cudaMemPoolProps::maxSize`](crate::driver::CUmemPoolProps_st::maxSize). If set to 0, the maximum size of the pool will default to a system dependent value.
6631    ///
6632    /// Applications that intend to use [`CUmemAllocationHandleType_enum::CU_MEM_HANDLE_TYPE_FABRIC`](crate::driver::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.
6633    ///
6634    /// When exporter and importer CUDA processes have been granted access to the same IMEX channel, they can securely share memory.
6635    ///
6636    /// 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.
6637    ///
6638    /// 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`
6639    ///
6640    /// To create a managed memory pool, applications must set [`cudaMemPoolProps`]:cudaMemAllocationType to [`cudaMemAllocationType::cudaMemAllocationTypeManaged`]. [`cudaMemAllocationHandleType`] must also be set to [`cudaMemAllocationHandleType::CU_MEM_HANDLE_TYPE_NONE`] since IPC is not supported. For managed memory pools, [`cudaMemLocation`] will be treated as the preferred location for all allocations created from the pool. An application can also set [cudaMemLocationTypeNone](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a53b6266fa56e0b7efe6a0b78ed8e8f49) to indicate no preferred location. [`cudaMemPoolProps::maxSize`](crate::driver::CUmemPoolProps_st::maxSize) must be set to zero for managed memory pools. [`cudaMemPoolProps::usage`](crate::driver::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 [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`].
6641    ///
6642    /// Note: Specifying [`cudaMemAllocationHandleType::CU_MEM_HANDLE_TYPE_NONE`] creates a memory pool that will not support IPC.
6643    ///
6644    /// # Return value
6645    ///
6646    /// - [`cudaError_t::CUDA_SUCCESS`]
6647    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
6648    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
6649    ///
6650    /// See also: [`cuMemPoolCreate`](crate::driver::cuMemPoolCreate), [`cudaDeviceSetMemPool`], [`cudaMallocFromPoolAsync`], [`cudaMemPoolExportToShareableHandle`], [`cudaDeviceGetDefaultMemPool`], [`cudaDeviceGetMemPool`].
6651    pub fn cudaMemPoolCreate(
6652        memPool: *mut cudaMemPool_t,
6653        poolProps: *const cudaMemPoolProps,
6654    ) -> cudaError_t;
6655}
6656singe_loader::functions! { crate::RUNTIME;
6657    /// Destroys the specified memory pool.
6658    ///
6659    /// If any pointers obtained from this pool haven’t been freed or the pool has free operations that haven’t completed when [`cudaMemPoolDestroy`] 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.
6660    ///
6661    /// Destroying the current mempool of a device sets the default mempool of that device as the current mempool for that device.
6662    ///
6663    /// Note: A device’s default memory pool cannot be destroyed.
6664    ///
6665    /// # Return value
6666    ///
6667    /// - [`cudaError_t::CUDA_SUCCESS`]
6668    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
6669    ///
6670    /// See also: [`cuMemPoolDestroy`](crate::driver::cuMemPoolDestroy), [`cudaFreeAsync`], [`cudaDeviceSetMemPool`], [`cudaDeviceGetDefaultMemPool`], [`cudaDeviceGetMemPool`], [`cudaMemPoolCreate`].
6671    pub fn cudaMemPoolDestroy(memPool: cudaMemPool_t) -> cudaError_t;
6672}
6673singe_loader::functions! { crate::RUNTIME;
6674    /// Returns the default memory pool for a given location and allocation type.
6675    ///
6676    /// The memory location can be of one of [cudaMemLocationTypeDevice](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0ae479b8710f3c5270117ee9d8cf5868d4), [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a1ec97ff5f3c715e4b18e39dabf9e31c5), [cudaMemLocationTypeHostNuma](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a24dc63fb938dee27b41e3842da35d2d0), or [cudaMemLocationTypeDeviceLocalityDomain](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a88b5d659aa9d7501f0382836eebb125b). The allocation type can be one of [`cudaMemAllocationType::cudaMemAllocationTypePinned`] or [`cudaMemAllocationType::cudaMemAllocationTypeManaged`]. When the allocation type is [`cudaMemAllocationType::cudaMemAllocationTypeManaged`], the location type can also be [cudaMemLocationTypeNone](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a53b6266fa56e0b7efe6a0b78ed8e8f49) to indicate no preferred location for the managed memory pool. [`cudaMemAllocationType::cudaMemAllocationTypeManaged`] can not be used with [cudaMemLocationTypeDeviceLocalityDomain](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a88b5d659aa9d7501f0382836eebb125b). In all other cases, the call return [`cudaError_t::CUDA_ERROR_INVALID_VALUE`].
6677    ///
6678    /// # Return value
6679    ///
6680    /// - [`cudaError_t::CUDA_SUCCESS`]
6681    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
6682    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
6683    ///
6684    /// See also: [`cuMemAllocAsync`](crate::driver::cuMemAllocAsync), [`cuMemPoolTrimTo`](crate::driver::cuMemPoolTrimTo), [`cuMemPoolGetAttribute`](crate::driver::cuMemPoolGetAttribute), [`cuMemPoolSetAttribute`](crate::driver::cuMemPoolSetAttribute), [`cuMemPoolSetAccess`](crate::driver::cuMemPoolSetAccess), [`cuMemGetMemPool`](crate::driver::cuMemGetMemPool), [`cuMemPoolCreate`](crate::driver::cuMemPoolCreate).
6685    pub fn cudaMemGetDefaultMemPool(
6686        memPool: *mut cudaMemPool_t,
6687        location: *mut cudaMemLocation,
6688        type_: cudaMemAllocationType,
6689    ) -> cudaError_t;
6690}
6691singe_loader::functions! { crate::RUNTIME;
6692    /// Gets the current memory pool for a given memory location and allocation type.
6693    ///
6694    /// The memory location can be of one of [cudaMemLocationTypeDevice](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0ae479b8710f3c5270117ee9d8cf5868d4), [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a1ec97ff5f3c715e4b18e39dabf9e31c5), [cudaMemLocationTypeHostNuma](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a24dc63fb938dee27b41e3842da35d2d0), or [cudaMemLocationTypeDeviceLocalityDomain](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a88b5d659aa9d7501f0382836eebb125b). The allocation type can be one of [`cudaMemAllocationType::cudaMemAllocationTypePinned`] or [`cudaMemAllocationType::cudaMemAllocationTypeManaged`]. When the allocation type is [`cudaMemAllocationType::cudaMemAllocationTypeManaged`], the location type can also be [cudaMemLocationTypeNone](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a53b6266fa56e0b7efe6a0b78ed8e8f49) to indicate no preferred location for the managed memory pool. [`cudaMemAllocationType::cudaMemAllocationTypeManaged`] can not be used with [cudaMemLocationTypeDeviceLocalityDomain](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a88b5d659aa9d7501f0382836eebb125b). In all other cases, the call return [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
6695    ///
6696    /// Returns the last pool provided to [`cudaMemSetMemPool`] or [`cudaDeviceSetMemPool`] for this location and allocation type or the location’s default memory pool if [`cudaMemSetMemPool`] or [`cudaDeviceSetMemPool`] for that allocType and location has never been called. By default the current mempool of a location is the default mempool for a device that can be obtained via cudaMemGetDefaultMemPool Otherwise the returned pool must have been set with [`cudaDeviceSetMemPool`].
6697    ///
6698    /// # Return value
6699    ///
6700    /// - [`cudaError_t::CUDA_SUCCESS`]
6701    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
6702    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
6703    ///
6704    /// See also: [`cuDeviceGetDefaultMemPool`](crate::driver::cuDeviceGetDefaultMemPool), [`cuMemPoolCreate`](crate::driver::cuMemPoolCreate), [`cuDeviceSetMemPool`](crate::driver::cuDeviceSetMemPool), [`cuMemSetMemPool`](crate::driver::cuMemSetMemPool).
6705    pub fn cudaMemGetMemPool(
6706        memPool: *mut cudaMemPool_t,
6707        location: *mut cudaMemLocation,
6708        type_: cudaMemAllocationType,
6709    ) -> cudaError_t;
6710}
6711singe_loader::functions! { crate::RUNTIME;
6712    /// Sets the current memory pool for a memory location and allocation type.
6713    ///
6714    /// The memory location can be of one of [cudaMemLocationTypeDevice](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0ae479b8710f3c5270117ee9d8cf5868d4), [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a1ec97ff5f3c715e4b18e39dabf9e31c5) [cudaMemLocationTypeHostNuma](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a24dc63fb938dee27b41e3842da35d2d0), or [cudaMemLocationTypeDeviceLocalityDomain](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a88b5d659aa9d7501f0382836eebb125b). The allocation type can be one of [`cudaMemAllocationType::cudaMemAllocationTypePinned`] or [`cudaMemAllocationType::cudaMemAllocationTypeManaged`]. When the allocation type is [`cudaMemAllocationType::cudaMemAllocationTypeManaged`], the location type can also be [cudaMemLocationTypeNone](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a53b6266fa56e0b7efe6a0b78ed8e8f49) to indicate no preferred location for the managed memory pool. [`cudaMemAllocationType::cudaMemAllocationTypeManaged`] can not be used with [cudaMemLocationTypeDeviceLocalityDomain](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a88b5d659aa9d7501f0382836eebb125b). In all other cases, the call return [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
6715    ///
6716    /// When a memory pool is set as the current memory pool, the location parameter should be the same as the location of the pool. If the location type or index don’t match, the call returns [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]. The type of memory pool should also match the parameter allocType. Else the call returns [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
6717    ///
6718    /// .
6719    ///
6720    /// By default, a memory location’s current memory pool is its default memory pool. If the location type is
6721    ///
6722    /// [cudaMemLocationTypeDevice](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0ae479b8710f3c5270117ee9d8cf5868d4) and the allocation type is [`cudaMemAllocationType::cudaMemAllocationTypePinned`] , then this API is the equivalent of calling [`cudaDeviceSetMemPool`] with the location id as the device. For further details on the implications, please refer to the documentation for [`cudaDeviceSetMemPool`] .
6723    ///
6724    /// Note: Use [`cudaMallocFromPoolAsync`] to specify asynchronous allocations from a device different than the one the stream runs on.
6725    ///
6726    /// # Return value
6727    ///
6728    /// - [`cudaError_t::CUDA_SUCCESS`]
6729    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
6730    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
6731    ///
6732    /// See also: [`cuDeviceGetDefaultMemPool`](crate::driver::cuDeviceGetDefaultMemPool), [`cuDeviceGetMemPool`](crate::driver::cuDeviceGetMemPool), [`cuMemGetMemPool`](crate::driver::cuMemGetMemPool), [`cuMemPoolCreate`](crate::driver::cuMemPoolCreate), [`cuMemPoolDestroy`](crate::driver::cuMemPoolDestroy), [`cuMemAllocFromPoolAsync`](crate::driver::cuMemAllocFromPoolAsync).
6733    pub fn cudaMemSetMemPool(
6734        location: *mut cudaMemLocation,
6735        type_: cudaMemAllocationType,
6736        memPool: cudaMemPool_t,
6737    ) -> cudaError_t;
6738}
6739singe_loader::functions! { crate::RUNTIME;
6740    /// Allocates memory from a specified pool with stream ordered semantics.
6741    ///
6742    /// Inserts an allocation operation into `stream`. 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.
6743    ///
6744    /// Note: The specified memory pool may be from a device different than that of the specified `stream`.
6745    /// * 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.
6746    ///
6747    /// 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.
6748    ///
6749    /// # Parameters
6750    ///
6751    /// - `ptr`: Returned device pointer.
6752    /// - `memPool`: The pool to allocate from.
6753    /// - `stream`: The stream establishing the stream ordering semantic.
6754    ///
6755    /// # Return value
6756    ///
6757    /// - [`cudaError_t::CUDA_SUCCESS`]
6758    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
6759    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]: cudaErrorOutOfMemory.
6760    ///
6761    /// See also: [`cuMemAllocFromPoolAsync`](crate::driver::cuMemAllocFromPoolAsync), [cudaMallocAsync (C++ API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1gaa31efcffc48981621feddd98d71a0feb), [`cudaMallocAsync`], [`cudaFreeAsync`], [`cudaDeviceGetDefaultMemPool`], [`cudaMemPoolCreate`], [`cudaMemPoolSetAccess`], [`cudaMemPoolSetAttribute`].
6762    pub fn cudaMallocFromPoolAsync(
6763        ptr: *mut *mut ::core::ffi::c_void,
6764        size: size_t,
6765        memPool: cudaMemPool_t,
6766        stream: cudaStream_t,
6767    ) -> cudaError_t;
6768}
6769singe_loader::functions! { crate::RUNTIME;
6770    /// Exports a memory pool to the requested handle type.
6771    ///
6772    /// 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 [`cudaMemPoolImportFromShareableHandle`]. Individual pointers can then be shared with the [`cudaMemPoolExportPointer`] and [`cudaMemPoolImportPointer`] APIs. The implementation of what the shareable handle is and how it can be transferred is defined by the requested handle type.
6773    ///
6774    /// Note: To create an IPC capable mempool, create a mempool with a CUmemAllocationHandleType other than cudaMemHandleTypeNone.
6775    ///
6776    /// # Parameters
6777    ///
6778    /// - `handleType`: the type of handle to create.
6779    /// - `flags`: must be 0.
6780    ///
6781    /// # Return value
6782    ///
6783    /// - [`cudaError_t::CUDA_SUCCESS`]
6784    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]: cudaErrorOutOfMemory.
6785    ///
6786    /// See also: [`cuMemPoolExportToShareableHandle`](crate::driver::cuMemPoolExportToShareableHandle), [`cudaMemPoolImportFromShareableHandle`], [`cudaMemPoolExportPointer`], [`cudaMemPoolImportPointer`].
6787    pub fn cudaMemPoolExportToShareableHandle(
6788        shareableHandle: *mut ::core::ffi::c_void,
6789        memPool: cudaMemPool_t,
6790        handleType: cudaMemAllocationHandleType,
6791        flags: ::core::ffi::c_uint,
6792    ) -> cudaError_t;
6793}
6794singe_loader::functions! { crate::RUNTIME;
6795    /// imports a memory pool from a shared handle.
6796    ///
6797    /// Specific allocations can be imported from the imported pool with [`cudaMemPoolImportPointer`].
6798    ///
6799    /// Note: Imported memory pools do not support creating new allocations. As such imported memory pools may not be used in [`cudaDeviceSetMemPool`] or [`cudaMallocFromPoolAsync`] calls.
6800    ///
6801    /// # Parameters
6802    ///
6803    /// - `handleType`: The type of handle being imported.
6804    /// - `flags`: must be 0.
6805    ///
6806    /// # Return value
6807    ///
6808    /// - [`cudaError_t::CUDA_SUCCESS`]
6809    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]: cudaErrorOutOfMemory.
6810    ///
6811    /// See also: [`cuMemPoolImportFromShareableHandle`](crate::driver::cuMemPoolImportFromShareableHandle), [`cudaMemPoolExportToShareableHandle`], [`cudaMemPoolExportPointer`], [`cudaMemPoolImportPointer`].
6812    pub fn cudaMemPoolImportFromShareableHandle(
6813        memPool: *mut cudaMemPool_t,
6814        shareableHandle: *mut ::core::ffi::c_void,
6815        handleType: cudaMemAllocationHandleType,
6816        flags: ::core::ffi::c_uint,
6817    ) -> cudaError_t;
6818}
6819singe_loader::functions! { crate::RUNTIME;
6820    /// Export data to share a memory pool allocation between processes.
6821    ///
6822    /// Constructs `shareData_out` for sharing a specific allocation from an already shared memory pool. The recipient process can import the allocation with the [`cudaMemPoolImportPointer`] api. The data is not a handle and may be shared through any IPC mechanism.
6823    ///
6824    /// # Parameters
6825    ///
6826    /// - `ptr`: pointer to memory being exported.
6827    ///
6828    /// # Return value
6829    ///
6830    /// - [`cudaError_t::CUDA_SUCCESS`]
6831    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]: cudaErrorOutOfMemory.
6832    ///
6833    /// See also: [`cuMemPoolExportPointer`](crate::driver::cuMemPoolExportPointer), [`cudaMemPoolExportToShareableHandle`], [`cudaMemPoolImportFromShareableHandle`], [`cudaMemPoolImportPointer`].
6834    pub fn cudaMemPoolExportPointer(
6835        exportData: *mut cudaMemPoolPtrExportData,
6836        ptr: *mut ::core::ffi::c_void,
6837    ) -> cudaError_t;
6838}
6839singe_loader::functions! { crate::RUNTIME;
6840    /// Import a memory pool allocation from another process.
6841    ///
6842    /// 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 cudaFree or cudaFreeAsync. If [`cudaFreeAsync`] is used, the free must be completed on the importing process before the free operation on the exporting process.
6843    ///
6844    /// Note: The [`cudaFreeAsync`] api may be used in the exporting process before the [`cudaFreeAsync`] operation completes in its stream as long as the [`cudaFreeAsync`] in the exporting process specifies a stream with a stream dependency on the importing process’s [`cudaFreeAsync`].
6845    ///
6846    /// # Return value
6847    ///
6848    /// CUDA_SUCCESS, [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`](crate::driver::cudaError_enum::CUDA_ERROR_INVALID_VALUE), [`cudaError_enum::CUDA_ERROR_NOT_INITIALIZED`](crate::driver::cudaError_enum::CUDA_ERROR_NOT_INITIALIZED), [`cudaError_enum::CUDA_ERROR_OUT_OF_MEMORY`](crate::driver::cudaError_enum::CUDA_ERROR_OUT_OF_MEMORY).
6849    ///
6850    /// See also: [`cuMemPoolImportPointer`](crate::driver::cuMemPoolImportPointer), [`cudaMemPoolExportToShareableHandle`], [`cudaMemPoolImportFromShareableHandle`], [`cudaMemPoolExportPointer`].
6851    pub fn cudaMemPoolImportPointer(
6852        ptr: *mut *mut ::core::ffi::c_void,
6853        memPool: cudaMemPool_t,
6854        exportData: *mut cudaMemPoolPtrExportData,
6855    ) -> cudaError_t;
6856}
6857singe_loader::functions! { crate::RUNTIME;
6858    /// Returns attributes about a specified pointer.
6859    ///
6860    /// Returns in `*attributes` the attributes of the pointer `ptr`. If pointer was not allocated in, mapped by or registered with context supporting unified addressing [`cudaError_t::CUDA_ERROR_INVALID_VALUE`] is returned.
6861    ///
6862    /// The [`cudaPointerAttributes`] structure is defined as:
6863    ///
6864    /// ```text
6865    /// struct cudaPointerAttributes {
6866    /// enum cudaMemoryType type;
6867    /// int device;
6868    /// void *devicePointer;
6869    /// void *hostPointer;
6870    /// int localityDomainOrdinal;
6871    /// }
6872    /// ```
6873    ///
6874    /// In this structure, the individual fields mean
6875    ///
6876    /// * [`cudaPointerAttributes::type`](cudaPointerAttributes::type_) identifies type of memory. It can be [`cudaMemoryType::cudaMemoryTypeUnregistered`] for unregistered host memory, [`cudaMemoryType::cudaMemoryTypeHost`] for registered host memory, [`cudaMemoryType::cudaMemoryTypeDevice`] for device memory or [`cudaMemoryType::cudaMemoryTypeManaged`] for managed memory.
6877    /// * [device](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaPointerAttributes.html#structcudapointerattributes_1a20015540684b0c85e0debf64923bedec) is the device against which `ptr` was allocated. If `ptr` has memory type [`cudaMemoryType::cudaMemoryTypeDevice`] then this identifies the device on which the memory referred to by `ptr` physically resides. If `ptr` has memory type [`cudaMemoryType::cudaMemoryTypeHost`] then this identifies the device which was current when the allocation was made (and if that device is deinitialized then this allocation will vanish with that device’s state).
6878    /// * [devicePointer](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaPointerAttributes.html#structcudapointerattributes_1a9edc9782e1ee337072994780fd3b675f) is the device pointer alias through which the memory referred to by `ptr` may be accessed on the current device. If the memory referred to by `ptr` cannot be accessed directly by the current device then this is NULL.
6879    /// * [hostPointer](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaPointerAttributes.html#structcudapointerattributes_1a19cbae18cd685096287e41cce1c9a087) is the host pointer alias through which the memory referred to by `ptr` may be accessed on the host. If the memory referred to by `ptr` cannot be accessed directly by the host then this is NULL.
6880    /// * localityDomainOrdinal is the locality domain ordinal for device allocations localized to a locality domain, or -1 when the allocation is not localized to a locality domain.
6881    ///
6882    /// Note: In CUDA 11.0 forward passing host pointer will return [`cudaMemoryType::cudaMemoryTypeUnregistered`] in [`cudaPointerAttributes::type`](cudaPointerAttributes::type_) and call will return [`cudaError_t::CUDA_SUCCESS`].
6883    ///
6884    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
6885    ///
6886    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
6887    ///
6888    /// # Parameters
6889    ///
6890    /// - `attributes`: Attributes for the specified pointer.
6891    /// - `ptr`: Pointer to get attributes for.
6892    ///
6893    /// # Return value
6894    ///
6895    /// - [`cudaError_t::CUDA_SUCCESS`]
6896    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
6897    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
6898    ///
6899    /// See also: [`cudaGetDeviceCount`], [`cudaGetDevice`], [`cudaSetDevice`], [`cudaChooseDevice`], [`cudaInitDevice`], [`cuPointerGetAttributes`](crate::driver::cuPointerGetAttributes).
6900    pub fn cudaPointerGetAttributes(
6901        attributes: *mut cudaPointerAttributes,
6902        ptr: *const ::core::ffi::c_void,
6903    ) -> cudaError_t;
6904}
6905singe_loader::functions! { crate::RUNTIME;
6906    /// Queries if a device may directly access a peer device’s memory.
6907    ///
6908    /// Returns in `*canAccessPeer` a value of 1 if device `device` is capable of directly accessing memory from `peerDevice` and 0 otherwise. If direct access of `peerDevice` from `device` is possible, then access may be enabled by calling [`cudaDeviceEnablePeerAccess`].
6909    ///
6910    /// Note that this function may also return error codes from previous, asynchronous launches.
6911    ///
6912    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
6913    ///
6914    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
6915    ///
6916    /// # Parameters
6917    ///
6918    /// - `canAccessPeer`: Returned access capability.
6919    /// - `device`: Device from which allocations on `peerDevice` are to be directly accessed.
6920    /// - `peerDevice`: Device on which the allocations to be directly accessed by `device` reside.
6921    ///
6922    /// # Return value
6923    ///
6924    /// - [`cudaError_t::CUDA_SUCCESS`]
6925    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
6926    ///
6927    /// See also: [`cudaDeviceEnablePeerAccess`], [`cudaDeviceDisablePeerAccess`], [`cuDeviceCanAccessPeer`](crate::driver::cuDeviceCanAccessPeer).
6928    pub fn cudaDeviceCanAccessPeer(
6929        canAccessPeer: *mut ::core::ffi::c_int,
6930        device: ::core::ffi::c_int,
6931        peerDevice: ::core::ffi::c_int,
6932    ) -> cudaError_t;
6933}
6934singe_loader::functions! { crate::RUNTIME;
6935    /// Enables direct access to memory allocations on a peer device.
6936    ///
6937    /// On success, all allocations from `peerDevice` will immediately be accessible by the current device. They will remain accessible until access is explicitly disabled using [`cudaDeviceDisablePeerAccess`] or either device is reset using [`cudaDeviceReset`].
6938    ///
6939    /// Note that access granted by this call is unidirectional and that in order to access memory on the current device from `peerDevice`, a separate symmetric call to [`cudaDeviceEnablePeerAccess`] is required.
6940    ///
6941    /// 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”.
6942    ///
6943    /// Returns [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`] if [`cudaDeviceCanAccessPeer`] indicates that the current device cannot directly access memory from `peerDevice`.
6944    ///
6945    /// Returns [`cudaError_t::CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED`] if direct access of `peerDevice` from the current device has already been enabled.
6946    ///
6947    /// Returns [`cudaError_t::CUDA_ERROR_INVALID_VALUE`] if `flags` is not 0.
6948    ///
6949    /// Note that this function may also return error codes from previous, asynchronous launches.
6950    ///
6951    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
6952    ///
6953    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
6954    ///
6955    /// # Parameters
6956    ///
6957    /// - `peerDevice`: Peer device to enable direct access to from the current device.
6958    /// - `flags`: Reserved for future use and must be set to 0.
6959    ///
6960    /// # Return value
6961    ///
6962    /// - [`cudaError_t::CUDA_SUCCESS`]
6963    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
6964    /// - [`cudaError_t::CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED`]
6965    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
6966    ///
6967    /// See also: [`cudaDeviceCanAccessPeer`], [`cudaDeviceDisablePeerAccess`], [`cuCtxEnablePeerAccess`](crate::driver::cuCtxEnablePeerAccess).
6968    pub fn cudaDeviceEnablePeerAccess(
6969        peerDevice: ::core::ffi::c_int,
6970        flags: ::core::ffi::c_uint,
6971    ) -> cudaError_t;
6972}
6973singe_loader::functions! { crate::RUNTIME;
6974    /// Disables direct access to memory allocations on a peer device.
6975    ///
6976    /// Returns [`cudaError_t::CUDA_ERROR_PEER_ACCESS_NOT_ENABLED`] if direct access to memory on `peerDevice` has not yet been enabled from the current device.
6977    ///
6978    /// Note that this function may also return error codes from previous, asynchronous launches.
6979    ///
6980    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
6981    ///
6982    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
6983    ///
6984    /// # Parameters
6985    ///
6986    /// - `peerDevice`: Peer device to disable direct access to
6987    ///
6988    /// # Return value
6989    ///
6990    /// - [`cudaError_t::CUDA_SUCCESS`]
6991    /// - [`cudaError_t::CUDA_ERROR_PEER_ACCESS_NOT_ENABLED`]
6992    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
6993    ///
6994    /// See also: [`cudaDeviceCanAccessPeer`], [`cudaDeviceEnablePeerAccess`], [`cuCtxDisablePeerAccess`](crate::driver::cuCtxDisablePeerAccess).
6995    pub fn cudaDeviceDisablePeerAccess(peerDevice: ::core::ffi::c_int) -> cudaError_t;
6996}
6997singe_loader::functions! { crate::RUNTIME;
6998    /// Unregisters a graphics resource for access by CUDA.
6999    ///
7000    /// Unregisters the graphics resource `resource` so it is not accessible by CUDA unless registered again.
7001    ///
7002    /// If `resource` is invalid then [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`] is returned.
7003    ///
7004    /// Note that this function may also return error codes from previous, asynchronous launches.
7005    ///
7006    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
7007    ///
7008    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
7009    ///
7010    /// Note: Use of the handle after this call is undefined behavior.
7011    ///
7012    /// # Parameters
7013    ///
7014    /// - `resource`: Resource to unregister
7015    ///
7016    /// # Return value
7017    ///
7018    /// - [`cudaError_t::CUDA_SUCCESS`]
7019    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
7020    /// - [`cudaError_t::CUDA_ERROR_UNKNOWN`]
7021    ///
7022    /// See also: [`cudaGraphicsD3D9RegisterResource`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__D3D9.html#group__cudart__d3d9_1gaab5efa8a8882a6e0ee99717a434730b0), [`cudaGraphicsD3D10RegisterResource`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__D3D10.html#group__cudart__d3d10_1ga438731f7af2b799fb757910be6cff62b), [`cudaGraphicsD3D11RegisterResource`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__D3D11.html#group__cudart__d3d11_1ga85d07753780643584b8febab0370623b), [`cudaGraphicsGLRegisterBuffer`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__OPENGL.html#group__cudart__opengl_1ga0fd33bea77ca7b1e69d1619caf44214b), [`cudaGraphicsGLRegisterImage`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__OPENGL.html#group__cudart__opengl_1ga80d12187ae7590807c7676697d9fe03d), [`cuGraphicsUnregisterResource`](crate::driver::cuGraphicsUnregisterResource).
7023    pub fn cudaGraphicsUnregisterResource(
7024        resource: cudaGraphicsResource_t,
7025    ) -> cudaError_t;
7026}
7027singe_loader::functions! { crate::RUNTIME;
7028    /// Set usage flags for mapping a graphics resource.
7029    ///
7030    /// Set `flags` for mapping the graphics resource `resource`.
7031    ///
7032    /// Changes to `flags` will take effect the next time `resource` is mapped. The `flags` argument may be any of the following:
7033    ///
7034    /// * [cudaGraphicsMapFlagsNone](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2c3c3a69caaf333d29d0b38b75de5ffda81ae074138583e9421692bec52bfe44b): Specifies no hints about how `resource` will be used. It is therefore assumed that CUDA may read from or write to `resource`.
7035    /// * [cudaGraphicsMapFlagsReadOnly](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2c3c3a69caaf333d29d0b38b75de5ffdae34096084cfafea1399b5682efd8b74c): Specifies that CUDA will not write to `resource`.
7036    /// * [cudaGraphicsMapFlagsWriteDiscard](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2c3c3a69caaf333d29d0b38b75de5ffda3d4fa7699e964ffc201daac20d2ecd6b): Specifies CUDA will not read from `resource` and will write over the entire contents of `resource`, so none of the data previously stored in `resource` will be preserved.
7037    ///
7038    /// If `resource` is presently mapped for access by CUDA then [`cudaError_t::CUDA_ERROR_UNKNOWN`] is returned. If `flags` is not one of the above values then [`cudaError_t::CUDA_ERROR_INVALID_VALUE`] is returned.
7039    ///
7040    /// Note that this function may also return error codes from previous, asynchronous launches.
7041    ///
7042    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
7043    ///
7044    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
7045    ///
7046    /// # Parameters
7047    ///
7048    /// - `resource`: Registered resource to set flags for.
7049    /// - `flags`: Parameters for resource mapping.
7050    ///
7051    /// # Return value
7052    ///
7053    /// - [`cudaError_t::CUDA_SUCCESS`]
7054    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
7055    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
7056    /// - [`cudaError_t::CUDA_ERROR_UNKNOWN`]
7057    ///
7058    /// See also: [`cudaGraphicsMapResources`], [`cuGraphicsResourceSetMapFlags`](crate::driver::cuGraphicsResourceSetMapFlags).
7059    pub fn cudaGraphicsResourceSetMapFlags(
7060        resource: cudaGraphicsResource_t,
7061        flags: ::core::ffi::c_uint,
7062    ) -> cudaError_t;
7063}
7064singe_loader::functions! { crate::RUNTIME;
7065    /// Map graphics resources for access by CUDA.
7066    ///
7067    /// Maps the `count` graphics resources in `resources` for access by CUDA.
7068    ///
7069    /// 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.
7070    ///
7071    /// This function provides the synchronization guarantee that any graphics calls issued before [`cudaGraphicsMapResources`] will complete before any subsequent CUDA work issued in `stream` begins.
7072    ///
7073    /// If `resources` contains any duplicate entries then [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`] is returned. If any of `resources` are presently mapped for access by CUDA then [`cudaError_t::CUDA_ERROR_UNKNOWN`] is returned.
7074    ///
7075    /// Note: This function uses standard default stream semantics.
7076    ///
7077    /// Note that this function may also return error codes from previous, asynchronous launches.
7078    ///
7079    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
7080    ///
7081    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
7082    ///
7083    /// # Parameters
7084    ///
7085    /// - `count`: Number of resources to map.
7086    /// - `resources`: Resources to map for CUDA.
7087    /// - `stream`: Stream for synchronization.
7088    ///
7089    /// # Return value
7090    ///
7091    /// - [`cudaError_t::CUDA_SUCCESS`]
7092    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
7093    /// - [`cudaError_t::CUDA_ERROR_UNKNOWN`]
7094    ///
7095    /// See also: [`cudaGraphicsResourceGetMappedPointer`], [`cudaGraphicsSubResourceGetMappedArray`], [`cudaGraphicsUnmapResources`], [`cuGraphicsMapResources`](crate::driver::cuGraphicsMapResources).
7096    pub fn cudaGraphicsMapResources(
7097        count: ::core::ffi::c_int,
7098        resources: *mut cudaGraphicsResource_t,
7099        stream: cudaStream_t,
7100    ) -> cudaError_t;
7101}
7102singe_loader::functions! { crate::RUNTIME;
7103    /// Unmap graphics resources.
7104    ///
7105    /// Unmaps the `count` graphics resources in `resources`.
7106    ///
7107    /// Once unmapped, the resources in `resources` may not be accessed by CUDA until they are mapped again.
7108    ///
7109    /// This function provides the synchronization guarantee that any CUDA work issued in `stream` before [`cudaGraphicsUnmapResources`] will complete before any subsequently issued graphics work begins.
7110    ///
7111    /// If `resources` contains any duplicate entries then [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`] is returned. If any of `resources` are not presently mapped for access by CUDA then [`cudaError_t::CUDA_ERROR_UNKNOWN`] is returned.
7112    ///
7113    /// Note: This function uses standard default stream semantics.
7114    ///
7115    /// Note that this function may also return error codes from previous, asynchronous launches.
7116    ///
7117    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
7118    ///
7119    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
7120    ///
7121    /// # Parameters
7122    ///
7123    /// - `count`: Number of resources to unmap.
7124    /// - `resources`: Resources to unmap.
7125    /// - `stream`: Stream for synchronization.
7126    ///
7127    /// # Return value
7128    ///
7129    /// - [`cudaError_t::CUDA_SUCCESS`]
7130    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
7131    /// - [`cudaError_t::CUDA_ERROR_UNKNOWN`]
7132    ///
7133    /// See also: [`cudaGraphicsMapResources`], [`cuGraphicsUnmapResources`](crate::driver::cuGraphicsUnmapResources).
7134    pub fn cudaGraphicsUnmapResources(
7135        count: ::core::ffi::c_int,
7136        resources: *mut cudaGraphicsResource_t,
7137        stream: cudaStream_t,
7138    ) -> cudaError_t;
7139}
7140singe_loader::functions! { crate::RUNTIME;
7141    /// Get an device pointer through which to access a mapped graphics resource.
7142    ///
7143    /// Returns in `*devPtr` a pointer through which the mapped graphics resource `resource` may be accessed. Returns in `*size` the size of the memory in bytes which may be accessed from that pointer. The value set in `devPtr` may change every time that `resource` is mapped.
7144    ///
7145    /// If `resource` is not a buffer then it cannot be accessed via a pointer and [`cudaError_t::CUDA_ERROR_UNKNOWN`] is returned. If `resource` is not mapped then [`cudaError_t::CUDA_ERROR_UNKNOWN`] is returned.
7146    ///
7147    /// * See also
7148    ///
7149    ///   [`cudaGraphicsMapResources`], [`cudaGraphicsSubResourceGetMappedArray`], [`cuGraphicsResourceGetMappedPointer`](crate::driver::cuGraphicsResourceGetMappedPointer).
7150    ///
7151    /// Note that this function may also return error codes from previous, asynchronous launches.
7152    ///
7153    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
7154    ///
7155    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
7156    ///
7157    /// # Parameters
7158    ///
7159    /// - `devPtr`: Returned pointer through which `resource` may be accessed.
7160    /// - `size`: Returned size of the buffer accessible starting at `*devPtr`.
7161    /// - `resource`: Mapped resource to access.
7162    ///
7163    /// # Return value
7164    ///
7165    /// - [`cudaError_t::CUDA_SUCCESS`]
7166    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
7167    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
7168    /// - [`cudaError_t::CUDA_ERROR_UNKNOWN`]
7169    pub fn cudaGraphicsResourceGetMappedPointer(
7170        devPtr: *mut *mut ::core::ffi::c_void,
7171        size: *mut size_t,
7172        resource: cudaGraphicsResource_t,
7173    ) -> cudaError_t;
7174}
7175singe_loader::functions! { crate::RUNTIME;
7176    /// Get an array through which to access a subresource of a mapped graphics resource.
7177    ///
7178    /// Returns in `*array` 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 `array` may change every time that `resource` is mapped.
7179    ///
7180    /// If `resource` is not a texture then it cannot be accessed via an array and [`cudaError_t::CUDA_ERROR_UNKNOWN`] is returned. If `arrayIndex` is not a valid array index for `resource` then [`cudaError_t::CUDA_ERROR_INVALID_VALUE`] is returned. If `mipLevel` is not a valid mipmap level for `resource` then [`cudaError_t::CUDA_ERROR_INVALID_VALUE`] is returned. If `resource` is not mapped then [`cudaError_t::CUDA_ERROR_UNKNOWN`] is returned.
7181    ///
7182    /// Note that this function may also return error codes from previous, asynchronous launches.
7183    ///
7184    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
7185    ///
7186    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
7187    ///
7188    /// # Parameters
7189    ///
7190    /// - `array`: Returned array through which a subresource of `resource` may be accessed.
7191    /// - `resource`: Mapped resource to access.
7192    /// - `arrayIndex`: Array index for array textures or cubemap face index as defined by [cudaGraphicsCubeFace](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gabf3ce16a621826a09263b8a58902fee8) for cubemap textures for the subresource to access.
7193    /// - `mipLevel`: Mipmap level for the subresource to access.
7194    ///
7195    /// # Return value
7196    ///
7197    /// - [`cudaError_t::CUDA_SUCCESS`]
7198    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
7199    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
7200    /// - [`cudaError_t::CUDA_ERROR_UNKNOWN`]
7201    ///
7202    /// See also: [`cudaGraphicsResourceGetMappedPointer`], [`cuGraphicsSubResourceGetMappedArray`](crate::driver::cuGraphicsSubResourceGetMappedArray).
7203    pub fn cudaGraphicsSubResourceGetMappedArray(
7204        array: *mut cudaArray_t,
7205        resource: cudaGraphicsResource_t,
7206        arrayIndex: ::core::ffi::c_uint,
7207        mipLevel: ::core::ffi::c_uint,
7208    ) -> cudaError_t;
7209}
7210singe_loader::functions! { crate::RUNTIME;
7211    /// Get a mipmapped array through which to access a mapped graphics resource.
7212    ///
7213    /// Returns in `*mipmappedArray` a mipmapped array through which the mapped graphics resource `resource` may be accessed. The value set in `mipmappedArray` may change every time that `resource` is mapped.
7214    ///
7215    /// If `resource` is not a texture then it cannot be accessed via an array and [`cudaError_t::CUDA_ERROR_UNKNOWN`] is returned. If `resource` is not mapped then [`cudaError_t::CUDA_ERROR_UNKNOWN`] is returned.
7216    ///
7217    /// Note that this function may also return error codes from previous, asynchronous launches.
7218    ///
7219    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
7220    ///
7221    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
7222    ///
7223    /// # Parameters
7224    ///
7225    /// - `mipmappedArray`: Returned mipmapped array through which `resource` may be accessed.
7226    /// - `resource`: Mapped resource to access.
7227    ///
7228    /// # Return value
7229    ///
7230    /// - [`cudaError_t::CUDA_SUCCESS`]
7231    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
7232    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
7233    /// - [`cudaError_t::CUDA_ERROR_UNKNOWN`]
7234    ///
7235    /// See also: [`cudaGraphicsResourceGetMappedPointer`], [`cuGraphicsResourceGetMappedMipmappedArray`](crate::driver::cuGraphicsResourceGetMappedMipmappedArray).
7236    pub fn cudaGraphicsResourceGetMappedMipmappedArray(
7237        mipmappedArray: *mut cudaMipmappedArray_t,
7238        resource: cudaGraphicsResource_t,
7239    ) -> cudaError_t;
7240}
7241singe_loader::functions! { crate::RUNTIME;
7242    /// Get the channel descriptor of an array.
7243    ///
7244    /// Returns in `*desc` the channel descriptor of the CUDA array `array`.
7245    ///
7246    /// Note that this function may also return error codes from previous, asynchronous launches.
7247    ///
7248    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
7249    ///
7250    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
7251    ///
7252    /// # Parameters
7253    ///
7254    /// - `desc`: Channel format.
7255    /// - `array`: Memory array on device.
7256    ///
7257    /// # Return value
7258    ///
7259    /// - [`cudaError_t::CUDA_SUCCESS`]
7260    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
7261    ///
7262    /// See also: [`cudaCreateChannelDesc`] (C API), [`cudaCreateTextureObject`], [`cudaCreateSurfaceObject`].
7263    pub fn cudaGetChannelDesc(
7264        desc: *mut cudaChannelFormatDesc,
7265        array: cudaArray_const_t,
7266    ) -> cudaError_t;
7267}
7268singe_loader::functions! { crate::RUNTIME;
7269    /// Returns a channel descriptor using the specified format.
7270    ///
7271    /// Returns a channel descriptor with format `f` and number of bits of each component `x`, `y`, `z`, and `w`. The [`cudaChannelFormatDesc`] is defined as:
7272    ///
7273    /// ```text
7274    /// struct cudaChannelFormatDesc {
7275    ///   int x, y, z, w;
7276    ///   enum cudaChannelFormatKind f;
7277    /// };
7278    /// ```
7279    ///
7280    /// where [`cudaChannelFormatKind`] is one of [`cudaChannelFormatKind::cudaChannelFormatKindSigned`], [`cudaChannelFormatKind::cudaChannelFormatKindUnsigned`], or [`cudaChannelFormatKind::cudaChannelFormatKindFloat`].
7281    ///
7282    /// # Parameters
7283    ///
7284    /// - `x`: X component.
7285    /// - `y`: Y component.
7286    /// - `z`: Z component.
7287    /// - `w`: W component.
7288    /// - `f`: Channel format.
7289    ///
7290    /// # Return value
7291    ///
7292    /// Channel descriptor with format `f`.
7293    ///
7294    /// See also: [cudaCreateChannelDesc (C++ API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1ga7a006216e07167cd4e01ffc90e08be37), [`cudaGetChannelDesc`], [`cudaCreateTextureObject`], [`cudaCreateSurfaceObject`].
7295    pub fn cudaCreateChannelDesc(
7296        x: ::core::ffi::c_int,
7297        y: ::core::ffi::c_int,
7298        z: ::core::ffi::c_int,
7299        w: ::core::ffi::c_int,
7300        f: cudaChannelFormatKind,
7301    ) -> cudaChannelFormatDesc;
7302}
7303singe_loader::functions! { crate::RUNTIME;
7304    /// Creates a texture object.
7305    ///
7306    /// 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.
7307    ///
7308    /// 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.
7309    ///
7310    /// The [`cudaResourceDesc`] structure is defined as:
7311    ///
7312    /// ```text
7313    /// struct cudaResourceDesc {
7314    /// enum cudaResourceType resType;
7315    ///
7316    /// union {
7317    /// struct {
7318    /// cudaArray_t array;
7319    /// } array;
7320    /// struct {
7321    /// cudaMipmappedArray_t mipmap;
7322    /// } mipmap;
7323    /// struct {
7324    /// void *devPtr;
7325    /// struct cudaChannelFormatDesc desc;
7326    /// size_t sizeInBytes;
7327    /// } linear;
7328    /// struct {
7329    /// void *devPtr;
7330    /// struct cudaChannelFormatDesc desc;
7331    /// size_t width;
7332    /// size_t height;
7333    /// size_t pitchInBytes;
7334    /// } pitch2D;
7335    /// } res;
7336    /// };
7337    /// ```
7338    ///
7339    /// where:
7340    ///
7341    /// * [`cudaResourceDesc::resType`](cudaResourceDesc::resType) specifies the type of resource to texture from. CUresourceType is defined as:
7342    ///
7343    /// ```text
7344    ///   enum cudaResourceType {
7345    /// cudaResourceTypeArray          = 0x00,
7346    /// cudaResourceTypeMipmappedArray = 0x01,
7347    /// cudaResourceTypeLinear         = 0x02,
7348    /// cudaResourceTypePitch2D        = 0x03
7349    ///   };
7350    /// ```
7351    ///
7352    /// The [`cudaTextureDesc`] struct is defined as
7353    ///
7354    /// ```text
7355    /// struct cudaTextureDesc {
7356    /// enum cudaTextureAddressMode addressMode\[3\];
7357    /// enum cudaTextureFilterMode  filterMode;
7358    /// enum cudaTextureReadMode    readMode;
7359    /// int                         sRGB;
7360    /// float                       borderColor\[4\];
7361    /// int                         normalizedCoords;
7362    /// unsigned int                maxAnisotropy;
7363    /// enum cudaTextureFilterMode  mipmapFilterMode;
7364    /// float                       mipmapLevelBias;
7365    /// float                       minMipmapLevelClamp;
7366    /// float                       maxMipmapLevelClamp;
7367    /// int                         disableTrilinearOptimization;
7368    /// int                         seamlessCubemap;
7369    /// };
7370    /// ```
7371    ///
7372    /// where
7373    ///
7374    /// * [`cudaTextureDesc::addressMode`](cudaTextureDesc::addressMode) specifies the addressing mode for each dimension of the texture data. [`cudaTextureAddressMode`] is defined as:
7375    ///
7376    /// ```text
7377    ///   enum cudaTextureAddressMode {
7378    /// cudaAddressModeWrap   = 0,
7379    /// cudaAddressModeClamp  = 1,
7380    /// cudaAddressModeMirror = 2,
7381    /// cudaAddressModeBorder = 3
7382    ///   };
7383    /// ```
7384    ///
7385    ///   This is ignored if [`cudaResourceDesc::resType`](cudaResourceDesc::resType) is [`cudaResourceType::cudaResourceTypeLinear`]. Also, if [`cudaTextureDesc::normalizedCoords`](cudaTextureDesc::normalizedCoords) is set to zero, [`cudaTextureAddressMode::cudaAddressModeWrap`] and [`cudaTextureAddressMode::cudaAddressModeMirror`] won’t be supported and will be switched to [`cudaTextureAddressMode::cudaAddressModeClamp`].
7386    /// * [`cudaTextureDesc::filterMode`](cudaTextureDesc::filterMode) specifies the filtering mode to be used when fetching from the texture. [`cudaTextureFilterMode`] is defined as:
7387    ///
7388    /// ```text
7389    ///   enum cudaTextureFilterMode {
7390    /// cudaFilterModePoint  = 0,
7391    /// cudaFilterModeLinear = 1
7392    ///   };
7393    /// ```
7394    ///
7395    ///   This is ignored if [`cudaResourceDesc::resType`](cudaResourceDesc::resType) is [`cudaResourceType::cudaResourceTypeLinear`].
7396    /// * [`cudaTextureDesc::readMode`](cudaTextureDesc::readMode) specifies whether integer data should be converted to floating point or not. [`cudaTextureReadMode`] is defined as:
7397    ///
7398    /// ```text
7399    ///   enum cudaTextureReadMode {
7400    /// cudaReadModeElementType     = 0,
7401    /// cudaReadModeNormalizedFloat = 1
7402    ///   };
7403    /// ```
7404    ///
7405    ///   Note that this applies only to 8-bit and 16-bit integer formats. 32-bit integer format would not be promoted, regardless of whether or not this [`cudaTextureDesc::readMode`](cudaTextureDesc::readMode) is set [`cudaTextureReadMode::cudaReadModeNormalizedFloat`] is specified.
7406    /// * [`cudaTextureDesc::sRGB`](cudaTextureDesc::sRGB) specifies whether sRGB to linear conversion should be performed during texture fetch.
7407    /// * [`cudaTextureDesc::borderColor`](cudaTextureDesc::borderColor) specifies the float values of color. where: [`cudaTextureDesc::borderColor`](cudaTextureDesc::borderColor)\[0\] contains value of ‘R’, [`cudaTextureDesc::borderColor`](cudaTextureDesc::borderColor)\[1\] contains value of ‘G’, [`cudaTextureDesc::borderColor`](cudaTextureDesc::borderColor)\[2\] contains value of ‘B’, [`cudaTextureDesc::borderColor`](cudaTextureDesc::borderColor)\[3\] contains value of ‘A’ Note that application using integer border color values will need to &lt;reinterpret_cast> these values to float. The values are set only when the addressing mode specified by [`cudaTextureDesc::addressMode`](cudaTextureDesc::addressMode) is cudaAddressModeBorder.
7408    /// * [`cudaTextureDesc::normalizedCoords`](cudaTextureDesc::normalizedCoords) specifies whether the texture coordinates will be normalized or not.
7409    /// * [`cudaTextureDesc::maxAnisotropy`](cudaTextureDesc::maxAnisotropy) specifies the maximum anistropy ratio to be used when doing anisotropic filtering. This value will be clamped to the range \[1,16\].
7410    /// * [`cudaTextureDesc::mipmapFilterMode`](cudaTextureDesc::mipmapFilterMode) specifies the filter mode when the calculated mipmap level lies between two defined mipmap levels.
7411    /// * [`cudaTextureDesc::mipmapLevelBias`](cudaTextureDesc::mipmapLevelBias) specifies the offset to be applied to the calculated mipmap level.
7412    /// * [`cudaTextureDesc::minMipmapLevelClamp`](cudaTextureDesc::minMipmapLevelClamp) specifies the lower end of the mipmap level range to clamp access to.
7413    /// * [`cudaTextureDesc::maxMipmapLevelClamp`](cudaTextureDesc::maxMipmapLevelClamp) specifies the upper end of the mipmap level range to clamp access to.
7414    /// * [`cudaTextureDesc::disableTrilinearOptimization`](cudaTextureDesc::disableTrilinearOptimization) specifies whether the trilinear filtering optimizations will be disabled.
7415    /// * [`cudaTextureDesc::seamlessCubemap`](cudaTextureDesc::seamlessCubemap) specifies whether seamless cube map filtering is enabled. 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 [cudaArrayCubemap](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga802843d69ca8be35ee050ff66782179e). When seamless cube map filtering is enabled, texture address modes specified by [`cudaTextureDesc::addressMode`](cudaTextureDesc::addressMode) are ignored. Instead, if the [`cudaTextureDesc::filterMode`](cudaTextureDesc::filterMode) is set to [`cudaTextureFilterMode::cudaFilterModePoint`] the address mode [`cudaTextureAddressMode::cudaAddressModeClamp`] will be applied for all dimensions. If the [`cudaTextureDesc::filterMode`](cudaTextureDesc::filterMode) is set to [`cudaTextureFilterMode::cudaFilterModeLinear`] seamless cube map filtering will be performed when sampling along the cube face borders.
7416    ///
7417    /// If [`cudaResourceDesc::resType`](cudaResourceDesc::resType) is set to [`cudaResourceType::cudaResourceTypeArray`], `cudaResourceDesc::res::array::array` must be set to a valid CUDA array handle.
7418    ///
7419    /// If [`cudaResourceDesc::resType`](cudaResourceDesc::resType) is set to [`cudaResourceType::cudaResourceTypeMipmappedArray`], `cudaResourceDesc::res::mipmap::mipmap` must be set to a valid CUDA mipmapped array handle and [`cudaTextureDesc::normalizedCoords`](cudaTextureDesc::normalizedCoords) must be set to true.
7420    ///
7421    /// If [`cudaResourceDesc::resType`](cudaResourceDesc::resType) is set to [`cudaResourceType::cudaResourceTypeLinear`], `cudaResourceDesc::res::linear::devPtr` must be set to a valid device pointer, that is aligned to [`cudaDeviceProp::textureAlignment`](cudaDeviceProp::textureAlignment). `cudaResourceDesc::res::linear::desc` describes the format and the number of components per array element. `cudaResourceDesc::res::linear::sizeInBytes` specifies the size of the array in bytes. The total number of elements in the linear address range cannot exceed [`cudaDeviceGetTexture1DLinearMaxWidth`]. The number of elements is computed as (sizeInBytes / sizeof(desc)).
7422    ///
7423    /// If [`cudaResourceDesc::resType`](cudaResourceDesc::resType) is set to [`cudaResourceType::cudaResourceTypePitch2D`], `cudaResourceDesc::res::pitch2D::devPtr` must be set to a valid device pointer, that is aligned to [`cudaDeviceProp::textureAlignment`](cudaDeviceProp::textureAlignment). `cudaResourceDesc::res::pitch2D::desc` describes the format and the number of components per array element. `cudaResourceDesc::res::pitch2D::width` and `cudaResourceDesc::res::pitch2D::height` specify the width and height of the array in elements, and cannot exceed [`cudaDeviceProp::maxTexture2DLinear`](cudaDeviceProp::maxTexture2DLinear)\[0\] and [`cudaDeviceProp::maxTexture2DLinear`](cudaDeviceProp::maxTexture2DLinear)\[1\] respectively. `cudaResourceDesc::res::pitch2D::pitchInBytes` specifies the pitch between two rows in bytes and has to be aligned to [`cudaDeviceProp::texturePitchAlignment`](cudaDeviceProp::texturePitchAlignment). Pitch cannot exceed [`cudaDeviceProp::maxTexture2DLinear`](cudaDeviceProp::maxTexture2DLinear)\[2\].
7424    ///
7425    /// The [`cudaResourceViewDesc`] struct is defined as
7426    ///
7427    /// ```text
7428    /// struct cudaResourceViewDesc {
7429    /// enum cudaResourceViewFormat format;
7430    /// size_t                      width;
7431    /// size_t                      height;
7432    /// size_t                      depth;
7433    /// unsigned int                firstMipmapLevel;
7434    /// unsigned int                lastMipmapLevel;
7435    /// unsigned int                firstLayer;
7436    /// unsigned int                lastLayer;
7437    /// };
7438    /// ```
7439    ///
7440    /// where:
7441    ///
7442    /// * [`cudaResourceViewDesc::format`](cudaResourceViewDesc::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 32-bit unsigned integer format with 2 or 4 channels, depending on the block compressed format. For ex., BC1 and BC4 require the underlying CUDA array to have a 32-bit unsigned int with 2 channels. The other BC formats require the underlying resource to have the same 32-bit unsigned int format but with 4 channels.
7443    /// * [`cudaResourceViewDesc::width`](cudaResourceViewDesc::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.
7444    /// * [`cudaResourceViewDesc::height`](cudaResourceViewDesc::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.
7445    /// * [`cudaResourceViewDesc::depth`](cudaResourceViewDesc::depth) specifies the new depth of the texture data. This value has to be equal to that of the original resource.
7446    /// * [`cudaResourceViewDesc::firstMipmapLevel`](cudaResourceViewDesc::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.[`cudaTextureDesc::minMipmapLevelClamp`](cudaTextureDesc::minMipmapLevelClamp) and [`cudaTextureDesc::maxMipmapLevelClamp`](cudaTextureDesc::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.
7447    /// * [`cudaResourceViewDesc::lastMipmapLevel`](cudaResourceViewDesc::lastMipmapLevel) specifies the least detailed mipmap level. For non-mipmapped resources, this value has to be zero.
7448    /// * [`cudaResourceViewDesc::firstLayer`](cudaResourceViewDesc::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.
7449    /// * [`cudaResourceViewDesc::lastLayer`](cudaResourceViewDesc::lastLayer) specifies the last layer index for layered textures. For non-layered resources, this value has to be zero.
7450    ///
7451    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
7452    ///
7453    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
7454    ///
7455    /// # Parameters
7456    ///
7457    /// - `pTexObject`: Texture object to create.
7458    /// - `pResDesc`: Resource descriptor.
7459    /// - `pTexDesc`: Texture descriptor.
7460    /// - `pResViewDesc`: Resource view descriptor.
7461    ///
7462    /// # Return value
7463    ///
7464    /// - [`cudaError_t::CUDA_SUCCESS`]
7465    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
7466    ///
7467    /// See also: [`cudaDestroyTextureObject`], [`cuTexObjectCreate`](crate::driver::cuTexObjectCreate).
7468    pub fn cudaCreateTextureObject(
7469        pTexObject: *mut cudaTextureObject_t,
7470        pResDesc: *const cudaResourceDesc,
7471        pTexDesc: *const cudaTextureDesc,
7472        pResViewDesc: *const cudaResourceViewDesc,
7473    ) -> cudaError_t;
7474}
7475singe_loader::functions! { crate::RUNTIME;
7476    /// Destroys a texture object.
7477    ///
7478    /// Destroys the texture object specified by `texObject`.
7479    ///
7480    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
7481    ///
7482    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
7483    ///
7484    /// Note: Use of the handle after this call is undefined behavior.
7485    ///
7486    /// # Parameters
7487    ///
7488    /// - `texObject`: Texture object to destroy
7489    ///
7490    /// # Return value
7491    ///
7492    /// - [`cudaError_t::CUDA_SUCCESS`]
7493    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
7494    ///
7495    /// See also: [`cudaCreateTextureObject`], [`cuTexObjectDestroy`](crate::driver::cuTexObjectDestroy).
7496    pub fn cudaDestroyTextureObject(texObject: cudaTextureObject_t) -> cudaError_t;
7497}
7498singe_loader::functions! { crate::RUNTIME;
7499    /// Returns a texture object’s resource descriptor.
7500    ///
7501    /// Returns the resource descriptor for the texture object specified by `texObject`.
7502    ///
7503    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
7504    ///
7505    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
7506    ///
7507    /// # Parameters
7508    ///
7509    /// - `pResDesc`: Resource descriptor.
7510    /// - `texObject`: Texture object.
7511    ///
7512    /// # Return value
7513    ///
7514    /// - [`cudaError_t::CUDA_SUCCESS`]
7515    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
7516    ///
7517    /// See also: [`cudaCreateTextureObject`], [`cuTexObjectGetResourceDesc`](crate::driver::cuTexObjectGetResourceDesc).
7518    pub fn cudaGetTextureObjectResourceDesc(
7519        pResDesc: *mut cudaResourceDesc,
7520        texObject: cudaTextureObject_t,
7521    ) -> cudaError_t;
7522}
7523singe_loader::functions! { crate::RUNTIME;
7524    /// Returns a texture object’s texture descriptor.
7525    ///
7526    /// Returns the texture descriptor for the texture object specified by `texObject`.
7527    ///
7528    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
7529    ///
7530    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
7531    ///
7532    /// # Parameters
7533    ///
7534    /// - `pTexDesc`: Texture descriptor.
7535    /// - `texObject`: Texture object.
7536    ///
7537    /// # Return value
7538    ///
7539    /// - [`cudaError_t::CUDA_SUCCESS`]
7540    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
7541    ///
7542    /// See also: [`cudaCreateTextureObject`], [`cuTexObjectGetTextureDesc`](crate::driver::cuTexObjectGetTextureDesc).
7543    pub fn cudaGetTextureObjectTextureDesc(
7544        pTexDesc: *mut cudaTextureDesc,
7545        texObject: cudaTextureObject_t,
7546    ) -> cudaError_t;
7547}
7548singe_loader::functions! { crate::RUNTIME;
7549    /// Returns a texture object’s resource view descriptor.
7550    ///
7551    /// Returns the resource view descriptor for the texture object specified by `texObject`. If no resource view was specified, [`cudaError_t::CUDA_ERROR_INVALID_VALUE`] is returned.
7552    ///
7553    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
7554    ///
7555    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
7556    ///
7557    /// # Parameters
7558    ///
7559    /// - `pResViewDesc`: Resource view descriptor.
7560    /// - `texObject`: Texture object.
7561    ///
7562    /// # Return value
7563    ///
7564    /// - [`cudaError_t::CUDA_SUCCESS`]
7565    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
7566    ///
7567    /// See also: [`cudaCreateTextureObject`], [`cuTexObjectGetResourceViewDesc`](crate::driver::cuTexObjectGetResourceViewDesc).
7568    pub fn cudaGetTextureObjectResourceViewDesc(
7569        pResViewDesc: *mut cudaResourceViewDesc,
7570        texObject: cudaTextureObject_t,
7571    ) -> cudaError_t;
7572}
7573singe_loader::functions! { crate::RUNTIME;
7574    /// Creates a surface object.
7575    ///
7576    /// Creates a surface object and returns it in `pSurfObject`. `pResDesc` describes the data to perform surface load/stores on. [`cudaResourceDesc::resType`](cudaResourceDesc::resType) must be [`cudaResourceType::cudaResourceTypeArray`] and `cudaResourceDesc::res::array::array` must be set to a valid CUDA array handle.
7577    ///
7578    /// 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.
7579    ///
7580    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
7581    ///
7582    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
7583    ///
7584    /// # Parameters
7585    ///
7586    /// - `pSurfObject`: Surface object to create.
7587    /// - `pResDesc`: Resource descriptor.
7588    ///
7589    /// # Return value
7590    ///
7591    /// - [`cudaError_t::CUDA_SUCCESS`]
7592    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
7593    /// - [`cudaErrorInvalidChannelDescriptor`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a5abd0c4b36ef85f853c51bc18c516e0b)
7594    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
7595    ///
7596    /// See also: [`cudaDestroySurfaceObject`], [`cuSurfObjectCreate`](crate::driver::cuSurfObjectCreate).
7597    pub fn cudaCreateSurfaceObject(
7598        pSurfObject: *mut cudaSurfaceObject_t,
7599        pResDesc: *const cudaResourceDesc,
7600    ) -> cudaError_t;
7601}
7602singe_loader::functions! { crate::RUNTIME;
7603    /// Destroys a surface object.
7604    ///
7605    /// Destroys the surface object specified by `surfObject`.
7606    ///
7607    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
7608    ///
7609    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
7610    ///
7611    /// Note: Use of the handle after this call is undefined behavior.
7612    ///
7613    /// # Parameters
7614    ///
7615    /// - `surfObject`: Surface object to destroy
7616    ///
7617    /// # Return value
7618    ///
7619    /// - [`cudaError_t::CUDA_SUCCESS`]
7620    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
7621    ///
7622    /// See also: [`cudaCreateSurfaceObject`], [`cuSurfObjectDestroy`](crate::driver::cuSurfObjectDestroy).
7623    pub fn cudaDestroySurfaceObject(surfObject: cudaSurfaceObject_t) -> cudaError_t;
7624}
7625singe_loader::functions! { crate::RUNTIME;
7626    /// Returns a surface object’s resource descriptor Returns the resource descriptor for the surface object specified by `surfObject`.
7627    ///
7628    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
7629    ///
7630    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
7631    ///
7632    /// # Parameters
7633    ///
7634    /// - `pResDesc`: Resource descriptor.
7635    /// - `surfObject`: Surface object.
7636    ///
7637    /// # Return value
7638    ///
7639    /// - [`cudaError_t::CUDA_SUCCESS`]
7640    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
7641    ///
7642    /// See also: [`cudaCreateSurfaceObject`], [`cuSurfObjectGetResourceDesc`](crate::driver::cuSurfObjectGetResourceDesc).
7643    pub fn cudaGetSurfaceObjectResourceDesc(
7644        pResDesc: *mut cudaResourceDesc,
7645        surfObject: cudaSurfaceObject_t,
7646    ) -> cudaError_t;
7647}
7648singe_loader::functions! { crate::RUNTIME;
7649    /// Returns the latest version of CUDA supported by the driver.
7650    ///
7651    /// Returns in `*driverVersion` the latest 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. If no driver is installed, then 0 is returned as the driver version.
7652    ///
7653    /// This function automatically returns [`cudaError_t::CUDA_ERROR_INVALID_VALUE`] if `driverVersion` is NULL.
7654    ///
7655    /// Note that this function may also return error codes from previous, asynchronous launches.
7656    ///
7657    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
7658    ///
7659    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
7660    ///
7661    /// # Parameters
7662    ///
7663    /// - `driverVersion`: Returns the CUDA driver version.
7664    ///
7665    /// # Return value
7666    ///
7667    /// - [`cudaError_t::CUDA_SUCCESS`]
7668    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
7669    ///
7670    /// See also: [`cudaRuntimeGetVersion`], [`cuDriverGetVersion`](crate::driver::cuDriverGetVersion).
7671    pub fn cudaDriverGetVersion(driverVersion: *mut ::core::ffi::c_int) -> cudaError_t;
7672}
7673singe_loader::functions! { crate::RUNTIME;
7674    /// Returns the CUDA Runtime version.
7675    ///
7676    /// Returns in `*runtimeVersion` the version number of the current CUDA Runtime instance. The version is returned as (1000 major + 10 minor). For example, CUDA 9.2 would be represented by 9020.
7677    ///
7678    /// As of CUDA 12.0, this function no longer initializes CUDA. The purpose of this API is solely to return a compile-time constant stating the CUDA Toolkit version in the above format.
7679    ///
7680    /// As of CUDA 13.0, on Windows, the `runtimeVersion` may not be the same as the CUDA Toolkit version the app was built with. Windows will use the CUDA Runtime packaged with the display driver, and that version will be reported.
7681    ///
7682    /// This function automatically returns [`cudaError_t::CUDA_ERROR_INVALID_VALUE`] if the `runtimeVersion` argument is NULL.
7683    ///
7684    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
7685    ///
7686    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
7687    ///
7688    /// # Parameters
7689    ///
7690    /// - `runtimeVersion`: Returns the CUDA Runtime version.
7691    ///
7692    /// # Return value
7693    ///
7694    /// - [`cudaError_t::CUDA_SUCCESS`]
7695    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
7696    ///
7697    /// See also: [`cudaDriverGetVersion`], [`cuDriverGetVersion`](crate::driver::cuDriverGetVersion).
7698    pub fn cudaRuntimeGetVersion(runtimeVersion: *mut ::core::ffi::c_int) -> cudaError_t;
7699}
7700/// Type of public error reporting callback functions.
7701///
7702/// User parameter provided at registration
7703///
7704/// Severity level of the log message
7705///
7706/// Error log message being reported
7707///
7708/// Length of the message in bytes
7709pub type cudaLogsCallback_t = ::core::option::Option<
7710    unsafe extern "C" fn(
7711        data: *mut ::core::ffi::c_void,
7712        logLevel: cudaLogLevel,
7713        message: *mut ::core::ffi::c_char,
7714        length: size_t,
7715    ),
7716>;
7717singe_loader::functions! { crate::RUNTIME;
7718    /// Register a callback function to receive error log messages.
7719    ///
7720    /// # Parameters
7721    ///
7722    /// - `callbackFunc`: The function to register as a callback.
7723    /// - `userData`: A generic pointer to user data. This is passed into the callback function.
7724    /// - `callback_out`: Optional location to store the callback handle after it is registered.
7725    ///
7726    /// # Return value
7727    ///
7728    /// - [`cudaError_t::CUDA_SUCCESS`]
7729    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
7730    pub fn cudaLogsRegisterCallback(
7731        callbackFunc: cudaLogsCallback_t,
7732        userData: *mut ::core::ffi::c_void,
7733        callback_out: *mut cudaLogsCallbackHandle,
7734    ) -> cudaError_t;
7735}
7736singe_loader::functions! { crate::RUNTIME;
7737    /// Unregister a log message callback.
7738    ///
7739    /// # Parameters
7740    ///
7741    /// - `callback`: The callback instance to unregister from receiving log messages
7742    ///
7743    /// # Return value
7744    ///
7745    /// - [`cudaError_t::CUDA_SUCCESS`]
7746    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
7747    pub fn cudaLogsUnregisterCallback(callback: cudaLogsCallbackHandle) -> cudaError_t;
7748}
7749singe_loader::functions! { crate::RUNTIME;
7750    /// Sets log iterator to point to the end of log buffer, where the next message would be written.
7751    ///
7752    /// # Parameters
7753    ///
7754    /// - `iterator_out`: Location to store an iterator to the current tail of the logs.
7755    /// - `flags`: Reserved for future use, must be 0.
7756    ///
7757    /// # Return value
7758    ///
7759    /// - [`cudaError_t::CUDA_SUCCESS`]
7760    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
7761    pub fn cudaLogsCurrent(
7762        iterator_out: *mut cudaLogIterator,
7763        flags: ::core::ffi::c_uint,
7764    ) -> cudaError_t;
7765}
7766singe_loader::functions! { crate::RUNTIME;
7767    /// Dump accumulated driver logs into a file.
7768    ///
7769    /// 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.
7770    ///
7771    /// Note: `iterator` is auto-advancing. Dumping logs will update the value of `iterator` to receive the next generated log.
7772    ///
7773    /// 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.
7774    ///
7775    /// # Parameters
7776    ///
7777    /// - `iterator`: Optional auto-advancing iterator specifying the starting log to read. NULL value dumps all logs.
7778    /// - `pathToFile`: Path to output file for dumping logs.
7779    /// - `flags`: Reserved for future use, must be 0.
7780    ///
7781    /// # Return value
7782    ///
7783    /// - [`cudaError_t::CUDA_SUCCESS`]
7784    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
7785    pub fn cudaLogsDumpToFile(
7786        iterator: *mut cudaLogIterator,
7787        pathToFile: *const ::core::ffi::c_char,
7788        flags: ::core::ffi::c_uint,
7789    ) -> cudaError_t;
7790}
7791singe_loader::functions! { crate::RUNTIME;
7792    /// Dump accumulated driver logs into a buffer.
7793    ///
7794    /// 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`](crate::driver::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`](crate::driver::cudaError_enum::CUDA_ERROR_INVALID_VALUE).
7795    ///
7796    /// Note: `iterator` is auto-advancing. Dumping logs will update the value of `iterator` to receive the next generated log.
7797    ///
7798    /// 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.
7799    ///
7800    /// 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.
7801    ///
7802    /// # Parameters
7803    ///
7804    /// - `iterator`: Optional auto-advancing iterator specifying the starting log to read. NULL value dumps all logs.
7805    /// - `buffer`: Pointer to dump logs.
7806    /// - `size`: See description.
7807    /// - `flags`: Reserved for future use, must be 0.
7808    ///
7809    /// # Return value
7810    ///
7811    /// - [`cudaError_t::CUDA_SUCCESS`]
7812    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
7813    pub fn cudaLogsDumpToMemory(
7814        iterator: *mut cudaLogIterator,
7815        buffer: *mut ::core::ffi::c_char,
7816        size: *mut size_t,
7817        flags: ::core::ffi::c_uint,
7818    ) -> cudaError_t;
7819}
7820singe_loader::functions! { crate::RUNTIME;
7821    /// Creates a graph.
7822    ///
7823    /// Creates an empty graph, which is returned via `pGraph`.
7824    ///
7825    /// Note: Graph objects are not threadsafe. More here.
7826    ///
7827    /// Note that this function may also return error codes from previous, asynchronous launches.
7828    ///
7829    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
7830    ///
7831    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
7832    ///
7833    /// # Parameters
7834    ///
7835    /// - `pGraph`: Returns newly created graph.
7836    /// - `flags`: Graph creation flags, must be 0.
7837    ///
7838    /// # Return value
7839    ///
7840    /// - [`cudaError_t::CUDA_SUCCESS`]
7841    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
7842    /// - [`cudaError_t::CUDA_ERROR_OUT_OF_MEMORY`]
7843    ///
7844    /// See also: [`cudaGraphAddChildGraphNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddHostNode`], [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemsetNode`], [`cudaGraphInstantiate`], [`cudaGraphDestroy`], [`cudaGraphGetNodes`], [`cudaGraphGetRootNodes`], [`cudaGraphGetEdges`], [`cudaGraphClone`].
7845    pub fn cudaGraphCreate(
7846        pGraph: *mut cudaGraph_t,
7847        flags: ::core::ffi::c_uint,
7848    ) -> cudaError_t;
7849}
7850singe_loader::functions! { crate::RUNTIME;
7851    /// Creates a kernel execution node and adds it to a graph.
7852    ///
7853    /// Creates a new kernel execution node and adds it to `graph` with `numDependencies` dependencies specified via `pDependencies` and arguments specified in `pNodeParams`. It is possible for `numDependencies` to be 0, in which case the node will be placed at the root of the graph. `pDependencies` may not have any duplicate entries. A handle to the new node will be returned in `pGraphNode`.
7854    ///
7855    /// The [`cudaKernelNodeParams`] structure is defined as:
7856    ///
7857    /// ```text
7858    /// struct cudaKernelNodeParams
7859    /// {
7860    /// void* func;
7861    /// dim3 gridDim;
7862    /// dim3 blockDim;
7863    /// unsigned int sharedMemBytes;
7864    /// void **kernelParams;
7865    /// void **extra;
7866    /// };
7867    /// ```
7868    ///
7869    /// When the graph is launched, the node will invoke kernel `func` on a (`gridDim.x` x `gridDim.y` x `gridDim.z`) grid of blocks. Each block contains (`blockDim.x` x `blockDim.y` x `blockDim.z`) threads.
7870    ///
7871    /// `sharedMem` sets the amount of dynamic shared memory that will be available to each thread block.
7872    ///
7873    /// Kernel parameters to `func` can be specified in one of two ways:
7874    ///
7875    /// 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.
7876    ///
7877    /// 2) Kernel parameters 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.
7878    ///
7879    /// * `CU_LAUNCH_PARAM_END`, which indicates the end of the `extra` array;
7880    /// * `CU_LAUNCH_PARAM_BUFFER_POINTER`, which specifies that the next value in `extra` will be a pointer to a buffer containing all the kernel parameters for launching kernel `func`;
7881    /// * `CU_LAUNCH_PARAM_BUFFER_SIZE`, 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`;
7882    ///
7883    /// The error [`cudaError_t::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).
7884    ///
7885    /// The `kernelParams` or `extra` array, as well as the argument values it points to, are copied during this call.
7886    ///
7887    /// 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.
7888    ///
7889    /// Note: Graph objects are not threadsafe. More here.
7890    ///
7891    /// Note that this function may also return error codes from previous, asynchronous launches.
7892    ///
7893    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
7894    ///
7895    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
7896    ///
7897    /// Note: The API can also be used with a kernel [`cudaKernel_t`] by querying the handle using [`cudaLibraryGetKernel`] or [`cudaGetKernel`] and then passing it to the API by casting to void\*. The symbol `entryFuncAddr` passed to [`cudaGetKernel`] should be a symbol that is registered with the same CUDA Runtime instance.
7898    ///
7899    /// Note: Passing a symbol that belongs that belongs to a different runtime instance will result in undefined behavior. The only type that can be reliably passed to a different runtime instance is [`cudaKernel_t`].
7900    ///
7901    /// # Parameters
7902    ///
7903    /// - `pGraphNode`: Returns newly created node.
7904    /// - `graph`: Graph to which to add the node.
7905    /// - `pDependencies`: Dependencies of the node.
7906    /// - `numDependencies`: Number of dependencies.
7907    /// - `pNodeParams`: Parameters for the GPU execution node.
7908    ///
7909    /// # Return value
7910    ///
7911    /// - [`cudaError_t::CUDA_SUCCESS`]
7912    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
7913    /// - [`cudaErrorInvalidDeviceFunction`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ab6af535e7e53d3f21e2437e8977b8c2e)
7914    ///
7915    /// See also: [`cudaGraphAddNode`], [`cudaLaunchKernel`], [`cudaGraphKernelNodeGetParams`], [`cudaGraphKernelNodeSetParams`], [`cudaGraphCreate`], [`cudaGraphDestroyNode`], [`cudaGraphAddChildGraphNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddHostNode`], [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemsetNode`].
7916    pub fn cudaGraphAddKernelNode(
7917        pGraphNode: *mut cudaGraphNode_t,
7918        graph: cudaGraph_t,
7919        pDependencies: *const cudaGraphNode_t,
7920        numDependencies: size_t,
7921        pNodeParams: *const cudaKernelNodeParams,
7922    ) -> cudaError_t;
7923}
7924singe_loader::functions! { crate::RUNTIME;
7925    /// Returns a kernel node’s parameters.
7926    ///
7927    /// Returns the parameters of kernel node `node` in `pNodeParams`. The `kernelParams` or `extra` array returned in `pNodeParams`, 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 [`cudaGraphKernelNodeSetParams`] to update the parameters of this node.
7928    ///
7929    /// The params will contain either `kernelParams` or `extra`, according to which of these was most recently set on the node.
7930    ///
7931    /// Note: Graph objects are not threadsafe. More here.
7932    ///
7933    /// Note that this function may also return error codes from previous, asynchronous launches.
7934    ///
7935    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
7936    ///
7937    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
7938    ///
7939    /// # Parameters
7940    ///
7941    /// - `node`: Node to get the parameters for.
7942    /// - `pNodeParams`: Pointer to return the parameters.
7943    ///
7944    /// # Return value
7945    ///
7946    /// - [`cudaError_t::CUDA_SUCCESS`]
7947    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
7948    /// - [`cudaErrorInvalidDeviceFunction`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ab6af535e7e53d3f21e2437e8977b8c2e)
7949    ///
7950    /// See also: [`cudaGraphNodeGetParams`], [`cudaLaunchKernel`], [`cudaGraphAddKernelNode`], [`cudaGraphKernelNodeSetParams`].
7951    pub fn cudaGraphKernelNodeGetParams(
7952        node: cudaGraphNode_t,
7953        pNodeParams: *mut cudaKernelNodeParams,
7954    ) -> cudaError_t;
7955}
7956singe_loader::functions! { crate::RUNTIME;
7957    /// Sets a kernel node’s parameters.
7958    ///
7959    /// Sets the parameters of kernel node `node` to `pNodeParams`.
7960    ///
7961    /// Note: Graph objects are not threadsafe. More here.
7962    ///
7963    /// Note that this function may also return error codes from previous, asynchronous launches.
7964    ///
7965    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
7966    ///
7967    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
7968    ///
7969    /// Note: The API can also be used with a kernel [`cudaKernel_t`] by querying the handle using [`cudaLibraryGetKernel`] or [`cudaGetKernel`] and then passing it to the API by casting to void\*. The symbol `entryFuncAddr` passed to [`cudaGetKernel`] should be a symbol that is registered with the same CUDA Runtime instance.
7970    ///
7971    /// Note: Passing a symbol that belongs that belongs to a different runtime instance will result in undefined behavior. The only type that can be reliably passed to a different runtime instance is [`cudaKernel_t`].
7972    ///
7973    /// # Parameters
7974    ///
7975    /// - `node`: Node to set the parameters for.
7976    /// - `pNodeParams`: Parameters to copy.
7977    ///
7978    /// # Return value
7979    ///
7980    /// - [`cudaError_t::CUDA_SUCCESS`]
7981    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
7982    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
7983    /// - [`cudaError_t::CUDA_ERROR_OUT_OF_MEMORY`]
7984    ///
7985    /// See also: [`cudaGraphNodeSetParams`], [`cudaLaunchKernel`], [`cudaGraphAddKernelNode`], [`cudaGraphKernelNodeGetParams`].
7986    pub fn cudaGraphKernelNodeSetParams(
7987        node: cudaGraphNode_t,
7988        pNodeParams: *const cudaKernelNodeParams,
7989    ) -> cudaError_t;
7990}
7991singe_loader::functions! { crate::RUNTIME;
7992    /// Copies attributes from source node to destination node.
7993    ///
7994    /// Copies attributes from source node `hSrc` to destination node `hDst`. Both node must have the same context.
7995    ///
7996    /// Note that this function may also return error codes from previous, asynchronous launches.
7997    ///
7998    /// # Parameters
7999    ///
8000    /// - `hDst`: Destination node.
8001    /// - `hSrc`: Source node For list of attributes see cudaKernelNodeAttrID.
8002    ///
8003    /// # Return value
8004    ///
8005    /// - [`cudaError_t::CUDA_SUCCESS`]: cudaErrorInvalidContext.
8006    ///
8007    /// See also: [`cudaAccessPolicyWindow`].
8008    pub fn cudaGraphKernelNodeCopyAttributes(
8009        hDst: cudaGraphNode_t,
8010        hSrc: cudaGraphNode_t,
8011    ) -> cudaError_t;
8012}
8013singe_loader::functions! { crate::RUNTIME;
8014    /// Queries node attribute.
8015    ///
8016    /// Queries attribute `attr` from node `hNode` and stores it in corresponding member of `value_out`.
8017    ///
8018    /// Note that this function may also return error codes from previous, asynchronous launches.
8019    ///
8020    /// # Return value
8021    ///
8022    /// - [`cudaError_t::CUDA_SUCCESS`]
8023    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
8024    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
8025    ///
8026    /// See also: [`cudaAccessPolicyWindow`].
8027    pub fn cudaGraphKernelNodeGetAttribute(
8028        hNode: cudaGraphNode_t,
8029        attr: cudaLaunchAttributeID,
8030        value_out: *mut cudaLaunchAttributeValue,
8031    ) -> cudaError_t;
8032}
8033singe_loader::functions! { crate::RUNTIME;
8034    /// Sets node attribute.
8035    ///
8036    /// Sets attribute `attr` on node `hNode` from corresponding attribute of `value`.
8037    ///
8038    /// Note that this function may also return error codes from previous, asynchronous launches.
8039    ///
8040    /// # Return value
8041    ///
8042    /// - [`cudaError_t::CUDA_SUCCESS`]
8043    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
8044    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
8045    ///
8046    /// See also: [`cudaAccessPolicyWindow`].
8047    pub fn cudaGraphKernelNodeSetAttribute(
8048        hNode: cudaGraphNode_t,
8049        attr: cudaLaunchAttributeID,
8050        value: *const cudaLaunchAttributeValue,
8051    ) -> cudaError_t;
8052}
8053singe_loader::functions! { crate::RUNTIME;
8054    /// Creates a memcpy node and adds it to a graph.
8055    ///
8056    /// Creates a new memcpy node and adds it to `graph` with `numDependencies` dependencies specified via `pDependencies`. It is possible for `numDependencies` to be 0, in which case the node will be placed at the root of the graph. `pDependencies` may not have any duplicate entries. A handle to the new node will be returned in `pGraphNode`.
8057    ///
8058    /// When the graph is launched, the node will perform the memcpy described by `pCopyParams`. See [`cudaMemcpy3D`] for a description of the structure and its restrictions.
8059    ///
8060    /// 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 [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`].
8061    ///
8062    /// Note: Graph objects are not threadsafe. More here.
8063    ///
8064    /// Note that this function may also return error codes from previous, asynchronous launches.
8065    ///
8066    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
8067    ///
8068    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
8069    ///
8070    /// # Parameters
8071    ///
8072    /// - `pGraphNode`: Returns newly created node.
8073    /// - `graph`: Graph to which to add the node.
8074    /// - `pDependencies`: Dependencies of the node.
8075    /// - `numDependencies`: Number of dependencies.
8076    /// - `pCopyParams`: Parameters for the memory copy.
8077    ///
8078    /// # Return value
8079    ///
8080    /// - [`cudaError_t::CUDA_SUCCESS`]
8081    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
8082    ///
8083    /// See also: [`cudaGraphAddNode`], [`cudaMemcpy3D`], [`cudaGraphAddMemcpyNodeToSymbol`], [`cudaGraphAddMemcpyNodeFromSymbol`], [`cudaGraphAddMemcpyNode1D`], [`cudaGraphMemcpyNodeGetParams`], [`cudaGraphMemcpyNodeSetParams`], [`cudaGraphCreate`], [`cudaGraphDestroyNode`], [`cudaGraphAddChildGraphNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddHostNode`], [`cudaGraphAddMemsetNode`].
8084    pub fn cudaGraphAddMemcpyNode(
8085        pGraphNode: *mut cudaGraphNode_t,
8086        graph: cudaGraph_t,
8087        pDependencies: *const cudaGraphNode_t,
8088        numDependencies: size_t,
8089        pCopyParams: *const cudaMemcpy3DParms,
8090    ) -> cudaError_t;
8091}
8092singe_loader::functions! { crate::RUNTIME;
8093    /// Creates a memcpy node to copy to a symbol on the device and adds it to a graph.
8094    ///
8095    /// Creates a new memcpy node to copy to `symbol` and adds it to `graph` with `numDependencies` dependencies specified via `pDependencies`. It is possible for `numDependencies` to be 0, in which case the node will be placed at the root of the graph. `pDependencies` may not have any duplicate entries. A handle to the new node will be returned in `pGraphNode`.
8096    ///
8097    /// When the graph is launched, the node will copy `count` bytes from the memory area pointed to by `src` to the memory area pointed to by `offset` bytes from the start of symbol `symbol`. The memory areas may not overlap. `symbol` is a variable that resides in global or constant memory space. `kind` can be either [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing.
8098    ///
8099    /// 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 [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`].
8100    ///
8101    /// Note: Graph objects are not threadsafe. More here.
8102    ///
8103    /// Note that this function may also return error codes from previous, asynchronous launches.
8104    ///
8105    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
8106    ///
8107    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
8108    ///
8109    /// # Parameters
8110    ///
8111    /// - `pGraphNode`: Returns newly created node.
8112    /// - `graph`: Graph to which to add the node.
8113    /// - `pDependencies`: Dependencies of the node.
8114    /// - `numDependencies`: Number of dependencies.
8115    /// - `symbol`: Device symbol address.
8116    /// - `src`: Source memory address.
8117    /// - `count`: Size in bytes to copy.
8118    /// - `offset`: Offset from start of symbol in bytes.
8119    /// - `kind`: Type of transfer.
8120    ///
8121    /// # Return value
8122    ///
8123    /// - [`cudaError_t::CUDA_SUCCESS`]
8124    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
8125    ///
8126    /// See also: [`cudaMemcpyToSymbol`], [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemcpyNodeFromSymbol`], [`cudaGraphMemcpyNodeGetParams`], [`cudaGraphMemcpyNodeSetParams`], [`cudaGraphMemcpyNodeSetParamsToSymbol`], [`cudaGraphMemcpyNodeSetParamsFromSymbol`], [`cudaGraphCreate`], [`cudaGraphDestroyNode`], [`cudaGraphAddChildGraphNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddHostNode`], [`cudaGraphAddMemsetNode`].
8127    pub fn cudaGraphAddMemcpyNodeToSymbol(
8128        pGraphNode: *mut cudaGraphNode_t,
8129        graph: cudaGraph_t,
8130        pDependencies: *const cudaGraphNode_t,
8131        numDependencies: size_t,
8132        symbol: *const ::core::ffi::c_void,
8133        src: *const ::core::ffi::c_void,
8134        count: size_t,
8135        offset: size_t,
8136        kind: cudaMemcpyKind,
8137    ) -> cudaError_t;
8138}
8139singe_loader::functions! { crate::RUNTIME;
8140    /// Creates a memcpy node to copy from a symbol on the device and adds it to a graph.
8141    ///
8142    /// Creates a new memcpy node to copy from `symbol` and adds it to `graph` with `numDependencies` dependencies specified via `pDependencies`. It is possible for `numDependencies` to be 0, in which case the node will be placed at the root of the graph. `pDependencies` may not have any duplicate entries. A handle to the new node will be returned in `pGraphNode`.
8143    ///
8144    /// When the graph is launched, the node will copy `count` bytes from the memory area pointed to by `offset` bytes from the start of symbol `symbol` to the memory area pointed to by `dst`. The memory areas may not overlap. `symbol` is a variable that resides in global or constant memory space. `kind` can be either [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing.
8145    ///
8146    /// 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 [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`].
8147    ///
8148    /// Note: Graph objects are not threadsafe. More here.
8149    ///
8150    /// Note that this function may also return error codes from previous, asynchronous launches.
8151    ///
8152    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
8153    ///
8154    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
8155    ///
8156    /// # Parameters
8157    ///
8158    /// - `pGraphNode`: Returns newly created node.
8159    /// - `graph`: Graph to which to add the node.
8160    /// - `pDependencies`: Dependencies of the node.
8161    /// - `numDependencies`: Number of dependencies.
8162    /// - `dst`: Destination memory address.
8163    /// - `symbol`: Device symbol address.
8164    /// - `count`: Size in bytes to copy.
8165    /// - `offset`: Offset from start of symbol in bytes.
8166    /// - `kind`: Type of transfer.
8167    ///
8168    /// # Return value
8169    ///
8170    /// - [`cudaError_t::CUDA_SUCCESS`]
8171    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
8172    ///
8173    /// See also: [`cudaMemcpyFromSymbol`], [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemcpyNodeToSymbol`], [`cudaGraphMemcpyNodeGetParams`], [`cudaGraphMemcpyNodeSetParams`], [`cudaGraphMemcpyNodeSetParamsFromSymbol`], [`cudaGraphMemcpyNodeSetParamsToSymbol`], [`cudaGraphCreate`], [`cudaGraphDestroyNode`], [`cudaGraphAddChildGraphNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddHostNode`], [`cudaGraphAddMemsetNode`].
8174    pub fn cudaGraphAddMemcpyNodeFromSymbol(
8175        pGraphNode: *mut cudaGraphNode_t,
8176        graph: cudaGraph_t,
8177        pDependencies: *const cudaGraphNode_t,
8178        numDependencies: size_t,
8179        dst: *mut ::core::ffi::c_void,
8180        symbol: *const ::core::ffi::c_void,
8181        count: size_t,
8182        offset: size_t,
8183        kind: cudaMemcpyKind,
8184    ) -> cudaError_t;
8185}
8186singe_loader::functions! { crate::RUNTIME;
8187    /// Creates a 1D memcpy node and adds it to a graph.
8188    ///
8189    /// Creates a new 1D memcpy node and adds it to `graph` with `numDependencies` dependencies specified via `pDependencies`. It is possible for `numDependencies` to be 0, in which case the node will be placed at the root of the graph. `pDependencies` may not have any duplicate entries. A handle to the new node will be returned in `pGraphNode`.
8190    ///
8191    /// When the graph is launched, the node will copy `count` bytes from the memory area pointed to by `src` to the memory area pointed to by `dst`, where `kind` specifies the direction of the copy, and must be one of [`cudaMemcpyKind::cudaMemcpyHostToHost`], [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing. Launching a memcpy node with dst and src pointers that do not match the direction of the copy results in an undefined behavior.
8192    ///
8193    /// 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 [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`].
8194    ///
8195    /// Note: Graph objects are not threadsafe. More here.
8196    ///
8197    /// Note that this function may also return error codes from previous, asynchronous launches.
8198    ///
8199    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
8200    ///
8201    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
8202    ///
8203    /// # Parameters
8204    ///
8205    /// - `pGraphNode`: Returns newly created node.
8206    /// - `graph`: Graph to which to add the node.
8207    /// - `pDependencies`: Dependencies of the node.
8208    /// - `numDependencies`: Number of dependencies.
8209    /// - `dst`: Destination memory address.
8210    /// - `src`: Source memory address.
8211    /// - `count`: Size in bytes to copy.
8212    /// - `kind`: Type of transfer.
8213    ///
8214    /// # Return value
8215    ///
8216    /// - [`cudaError_t::CUDA_SUCCESS`]
8217    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
8218    ///
8219    /// See also: [`cudaMemcpy`], [`cudaGraphAddMemcpyNode`], [`cudaGraphMemcpyNodeGetParams`], [`cudaGraphMemcpyNodeSetParams`], [`cudaGraphMemcpyNodeSetParams1D`], [`cudaGraphCreate`], [`cudaGraphDestroyNode`], [`cudaGraphAddChildGraphNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddHostNode`], [`cudaGraphAddMemsetNode`].
8220    pub fn cudaGraphAddMemcpyNode1D(
8221        pGraphNode: *mut cudaGraphNode_t,
8222        graph: cudaGraph_t,
8223        pDependencies: *const cudaGraphNode_t,
8224        numDependencies: size_t,
8225        dst: *mut ::core::ffi::c_void,
8226        src: *const ::core::ffi::c_void,
8227        count: size_t,
8228        kind: cudaMemcpyKind,
8229    ) -> cudaError_t;
8230}
8231singe_loader::functions! { crate::RUNTIME;
8232    /// Returns a memcpy node’s parameters.
8233    ///
8234    /// Returns the parameters of memcpy node `node` in `pNodeParams`.
8235    ///
8236    /// Note: Graph objects are not threadsafe. More here.
8237    ///
8238    /// Note that this function may also return error codes from previous, asynchronous launches.
8239    ///
8240    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
8241    ///
8242    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
8243    ///
8244    /// # Parameters
8245    ///
8246    /// - `node`: Node to get the parameters for.
8247    /// - `pNodeParams`: Pointer to return the parameters.
8248    ///
8249    /// # Return value
8250    ///
8251    /// - [`cudaError_t::CUDA_SUCCESS`]
8252    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
8253    ///
8254    /// See also: [`cudaGraphNodeGetParams`], [`cudaMemcpy3D`], [`cudaGraphAddMemcpyNode`], [`cudaGraphMemcpyNodeSetParams`].
8255    pub fn cudaGraphMemcpyNodeGetParams(
8256        node: cudaGraphNode_t,
8257        pNodeParams: *mut cudaMemcpy3DParms,
8258    ) -> cudaError_t;
8259}
8260singe_loader::functions! { crate::RUNTIME;
8261    /// Sets a memcpy node’s parameters.
8262    ///
8263    /// Sets the parameters of memcpy node `node` to `pNodeParams`.
8264    ///
8265    /// Note: Graph objects are not threadsafe. More here.
8266    ///
8267    /// Note that this function may also return error codes from previous, asynchronous launches.
8268    ///
8269    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
8270    ///
8271    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
8272    ///
8273    /// # Parameters
8274    ///
8275    /// - `node`: Node to set the parameters for.
8276    /// - `pNodeParams`: Parameters to copy.
8277    ///
8278    /// # Return value
8279    ///
8280    /// - [`cudaError_t::CUDA_SUCCESS`]
8281    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
8282    ///
8283    /// See also: [`cudaGraphNodeSetParams`], [`cudaMemcpy3D`], [`cudaGraphMemcpyNodeSetParamsToSymbol`], [`cudaGraphMemcpyNodeSetParamsFromSymbol`], [`cudaGraphMemcpyNodeSetParams1D`], [`cudaGraphAddMemcpyNode`], [`cudaGraphMemcpyNodeGetParams`].
8284    pub fn cudaGraphMemcpyNodeSetParams(
8285        node: cudaGraphNode_t,
8286        pNodeParams: *const cudaMemcpy3DParms,
8287    ) -> cudaError_t;
8288}
8289singe_loader::functions! { crate::RUNTIME;
8290    /// Sets a memcpy node’s parameters to copy to a symbol on the device.
8291    ///
8292    /// Sets the parameters of memcpy node `node` to the copy described by the provided parameters.
8293    ///
8294    /// When the graph is launched, the node will copy `count` bytes from the memory area pointed to by `src` to the memory area pointed to by `offset` bytes from the start of symbol `symbol`. The memory areas may not overlap. `symbol` is a variable that resides in global or constant memory space. `kind` can be either [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing.
8295    ///
8296    /// Note: Graph objects are not threadsafe. More here.
8297    ///
8298    /// Note that this function may also return error codes from previous, asynchronous launches.
8299    ///
8300    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
8301    ///
8302    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
8303    ///
8304    /// # Parameters
8305    ///
8306    /// - `node`: Node to set the parameters for.
8307    /// - `symbol`: Device symbol address.
8308    /// - `src`: Source memory address.
8309    /// - `count`: Size in bytes to copy.
8310    /// - `offset`: Offset from start of symbol in bytes.
8311    /// - `kind`: Type of transfer.
8312    ///
8313    /// # Return value
8314    ///
8315    /// - [`cudaError_t::CUDA_SUCCESS`]
8316    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
8317    ///
8318    /// See also: [`cudaMemcpyToSymbol`], [`cudaGraphMemcpyNodeSetParams`], [`cudaGraphMemcpyNodeSetParamsFromSymbol`], [`cudaGraphAddMemcpyNode`], [`cudaGraphMemcpyNodeGetParams`].
8319    pub fn cudaGraphMemcpyNodeSetParamsToSymbol(
8320        node: cudaGraphNode_t,
8321        symbol: *const ::core::ffi::c_void,
8322        src: *const ::core::ffi::c_void,
8323        count: size_t,
8324        offset: size_t,
8325        kind: cudaMemcpyKind,
8326    ) -> cudaError_t;
8327}
8328singe_loader::functions! { crate::RUNTIME;
8329    /// Sets a memcpy node’s parameters to copy from a symbol on the device.
8330    ///
8331    /// Sets the parameters of memcpy node `node` to the copy described by the provided parameters.
8332    ///
8333    /// When the graph is launched, the node will copy `count` bytes from the memory area pointed to by `offset` bytes from the start of symbol `symbol` to the memory area pointed to by `dst`. The memory areas may not overlap. `symbol` is a variable that resides in global or constant memory space. `kind` can be either [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing.
8334    ///
8335    /// Note: Graph objects are not threadsafe. More here.
8336    ///
8337    /// Note that this function may also return error codes from previous, asynchronous launches.
8338    ///
8339    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
8340    ///
8341    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
8342    ///
8343    /// # Parameters
8344    ///
8345    /// - `node`: Node to set the parameters for.
8346    /// - `dst`: Destination memory address.
8347    /// - `symbol`: Device symbol address.
8348    /// - `count`: Size in bytes to copy.
8349    /// - `offset`: Offset from start of symbol in bytes.
8350    /// - `kind`: Type of transfer.
8351    ///
8352    /// # Return value
8353    ///
8354    /// - [`cudaError_t::CUDA_SUCCESS`]
8355    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
8356    ///
8357    /// See also: [`cudaMemcpyFromSymbol`], [`cudaGraphMemcpyNodeSetParams`], [`cudaGraphMemcpyNodeSetParamsToSymbol`], [`cudaGraphAddMemcpyNode`], [`cudaGraphMemcpyNodeGetParams`].
8358    pub fn cudaGraphMemcpyNodeSetParamsFromSymbol(
8359        node: cudaGraphNode_t,
8360        dst: *mut ::core::ffi::c_void,
8361        symbol: *const ::core::ffi::c_void,
8362        count: size_t,
8363        offset: size_t,
8364        kind: cudaMemcpyKind,
8365    ) -> cudaError_t;
8366}
8367singe_loader::functions! { crate::RUNTIME;
8368    /// Sets a memcpy node’s parameters to perform a 1-dimensional copy.
8369    ///
8370    /// Sets the parameters of memcpy node `node` to the copy described by the provided parameters.
8371    ///
8372    /// When the graph is launched, the node will copy `count` bytes from the memory area pointed to by `src` to the memory area pointed to by `dst`, where `kind` specifies the direction of the copy, and must be one of [`cudaMemcpyKind::cudaMemcpyHostToHost`], [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing. Launching a memcpy node with dst and src pointers that do not match the direction of the copy results in an undefined behavior.
8373    ///
8374    /// Note: Graph objects are not threadsafe. More here.
8375    ///
8376    /// Note that this function may also return error codes from previous, asynchronous launches.
8377    ///
8378    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
8379    ///
8380    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
8381    ///
8382    /// # Parameters
8383    ///
8384    /// - `node`: Node to set the parameters for.
8385    /// - `dst`: Destination memory address.
8386    /// - `src`: Source memory address.
8387    /// - `count`: Size in bytes to copy.
8388    /// - `kind`: Type of transfer.
8389    ///
8390    /// # Return value
8391    ///
8392    /// - [`cudaError_t::CUDA_SUCCESS`]
8393    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
8394    ///
8395    /// See also: [`cudaMemcpy`], [`cudaGraphMemcpyNodeSetParams`], [`cudaGraphAddMemcpyNode`], [`cudaGraphMemcpyNodeGetParams`].
8396    pub fn cudaGraphMemcpyNodeSetParams1D(
8397        node: cudaGraphNode_t,
8398        dst: *mut ::core::ffi::c_void,
8399        src: *const ::core::ffi::c_void,
8400        count: size_t,
8401        kind: cudaMemcpyKind,
8402    ) -> cudaError_t;
8403}
8404singe_loader::functions! { crate::RUNTIME;
8405    /// Creates a memset node and adds it to a graph.
8406    ///
8407    /// Creates a new memset node and adds it to `graph` with `numDependencies` dependencies specified via `pDependencies`. It is possible for `numDependencies` to be 0, in which case the node will be placed at the root of the graph. `pDependencies` may not have any duplicate entries. A handle to the new node will be returned in `pGraphNode`.
8408    ///
8409    /// The element size must be 1, 2, or 4 bytes. When the graph is launched, the node will perform the memset described by `pMemsetParams`.
8410    ///
8411    /// Note: Graph objects are not threadsafe. More here.
8412    ///
8413    /// Note that this function may also return error codes from previous, asynchronous launches.
8414    ///
8415    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
8416    ///
8417    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
8418    ///
8419    /// # Parameters
8420    ///
8421    /// - `pGraphNode`: Returns newly created node.
8422    /// - `graph`: Graph to which to add the node.
8423    /// - `pDependencies`: Dependencies of the node.
8424    /// - `numDependencies`: Number of dependencies.
8425    /// - `pMemsetParams`: Parameters for the memory set.
8426    ///
8427    /// # Return value
8428    ///
8429    /// - [`cudaError_t::CUDA_SUCCESS`]
8430    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
8431    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
8432    ///
8433    /// See also: [`cudaGraphAddNode`], [`cudaMemset2D`], [`cudaGraphMemsetNodeGetParams`], [`cudaGraphMemsetNodeSetParams`], [`cudaGraphCreate`], [`cudaGraphDestroyNode`], [`cudaGraphAddChildGraphNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddHostNode`], [`cudaGraphAddMemcpyNode`].
8434    pub fn cudaGraphAddMemsetNode(
8435        pGraphNode: *mut cudaGraphNode_t,
8436        graph: cudaGraph_t,
8437        pDependencies: *const cudaGraphNode_t,
8438        numDependencies: size_t,
8439        pMemsetParams: *const cudaMemsetParams,
8440    ) -> cudaError_t;
8441}
8442singe_loader::functions! { crate::RUNTIME;
8443    /// Returns a memset node’s parameters.
8444    ///
8445    /// Returns the parameters of memset node `node` in `pNodeParams`.
8446    ///
8447    /// Note: Graph objects are not threadsafe. More here.
8448    ///
8449    /// Note that this function may also return error codes from previous, asynchronous launches.
8450    ///
8451    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
8452    ///
8453    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
8454    ///
8455    /// # Parameters
8456    ///
8457    /// - `node`: Node to get the parameters for.
8458    /// - `pNodeParams`: Pointer to return the parameters.
8459    ///
8460    /// # Return value
8461    ///
8462    /// - [`cudaError_t::CUDA_SUCCESS`]
8463    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
8464    ///
8465    /// See also: [`cudaGraphNodeGetParams`], [`cudaMemset2D`], [`cudaGraphAddMemsetNode`], [`cudaGraphMemsetNodeSetParams`].
8466    pub fn cudaGraphMemsetNodeGetParams(
8467        node: cudaGraphNode_t,
8468        pNodeParams: *mut cudaMemsetParams,
8469    ) -> cudaError_t;
8470}
8471singe_loader::functions! { crate::RUNTIME;
8472    /// Sets a memset node’s parameters.
8473    ///
8474    /// Sets the parameters of memset node `node` to `pNodeParams`.
8475    ///
8476    /// Note: Graph objects are not threadsafe. More here.
8477    ///
8478    /// Note that this function may also return error codes from previous, asynchronous launches.
8479    ///
8480    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
8481    ///
8482    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
8483    ///
8484    /// # Parameters
8485    ///
8486    /// - `node`: Node to set the parameters for.
8487    /// - `pNodeParams`: Parameters to copy.
8488    ///
8489    /// # Return value
8490    ///
8491    /// - [`cudaError_t::CUDA_SUCCESS`]
8492    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
8493    ///
8494    /// See also: [`cudaGraphNodeSetParams`], [`cudaMemset2D`], [`cudaGraphAddMemsetNode`], [`cudaGraphMemsetNodeGetParams`].
8495    pub fn cudaGraphMemsetNodeSetParams(
8496        node: cudaGraphNode_t,
8497        pNodeParams: *const cudaMemsetParams,
8498    ) -> cudaError_t;
8499}
8500singe_loader::functions! { crate::RUNTIME;
8501    /// Creates a host execution node and adds it to a graph.
8502    ///
8503    /// Creates a new CPU execution node and adds it to `graph` with `numDependencies` dependencies specified via `pDependencies` and arguments specified in `pNodeParams`. It is possible for `numDependencies` to be 0, in which case the node will be placed at the root of the graph. `pDependencies` may not have any duplicate entries. A handle to the new node will be returned in `pGraphNode`.
8504    ///
8505    /// When the graph is launched, the node will invoke the specified CPU function. Host nodes are not supported under MPS with pre-Volta GPUs.
8506    ///
8507    /// Note: Graph objects are not threadsafe. More here.
8508    ///
8509    /// Note that this function may also return error codes from previous, asynchronous launches.
8510    ///
8511    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
8512    ///
8513    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
8514    ///
8515    /// # Parameters
8516    ///
8517    /// - `pGraphNode`: Returns newly created node.
8518    /// - `graph`: Graph to which to add the node.
8519    /// - `pDependencies`: Dependencies of the node.
8520    /// - `numDependencies`: Number of dependencies.
8521    /// - `pNodeParams`: Parameters for the host node.
8522    ///
8523    /// # Return value
8524    ///
8525    /// - [`cudaError_t::CUDA_SUCCESS`]
8526    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
8527    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
8528    ///
8529    /// See also: [`cudaGraphAddNode`], [`cudaLaunchHostFunc`], [`cudaGraphHostNodeGetParams`], [`cudaGraphHostNodeSetParams`], [`cudaGraphCreate`], [`cudaGraphDestroyNode`], [`cudaGraphAddChildGraphNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemsetNode`].
8530    pub fn cudaGraphAddHostNode(
8531        pGraphNode: *mut cudaGraphNode_t,
8532        graph: cudaGraph_t,
8533        pDependencies: *const cudaGraphNode_t,
8534        numDependencies: size_t,
8535        pNodeParams: *const cudaHostNodeParams,
8536    ) -> cudaError_t;
8537}
8538singe_loader::functions! { crate::RUNTIME;
8539    /// Returns a host node’s parameters.
8540    ///
8541    /// Returns the parameters of host node `node` in `pNodeParams`.
8542    ///
8543    /// Note: Graph objects are not threadsafe. More here.
8544    ///
8545    /// Note that this function may also return error codes from previous, asynchronous launches.
8546    ///
8547    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
8548    ///
8549    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
8550    ///
8551    /// # Parameters
8552    ///
8553    /// - `node`: Node to get the parameters for.
8554    /// - `pNodeParams`: Pointer to return the parameters.
8555    ///
8556    /// # Return value
8557    ///
8558    /// - [`cudaError_t::CUDA_SUCCESS`]
8559    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
8560    ///
8561    /// See also: [`cudaGraphNodeGetParams`], [`cudaLaunchHostFunc`], [`cudaGraphAddHostNode`], [`cudaGraphHostNodeSetParams`].
8562    pub fn cudaGraphHostNodeGetParams(
8563        node: cudaGraphNode_t,
8564        pNodeParams: *mut cudaHostNodeParams,
8565    ) -> cudaError_t;
8566}
8567singe_loader::functions! { crate::RUNTIME;
8568    /// Sets a host node’s parameters.
8569    ///
8570    /// Sets the parameters of host node `node` to `nodeParams`.
8571    ///
8572    /// Note: Graph objects are not threadsafe. More here.
8573    ///
8574    /// Note that this function may also return error codes from previous, asynchronous launches.
8575    ///
8576    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
8577    ///
8578    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
8579    ///
8580    /// # Parameters
8581    ///
8582    /// - `node`: Node to set the parameters for.
8583    /// - `pNodeParams`: Parameters to copy.
8584    ///
8585    /// # Return value
8586    ///
8587    /// - [`cudaError_t::CUDA_SUCCESS`]
8588    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
8589    ///
8590    /// See also: [`cudaGraphNodeSetParams`], [`cudaLaunchHostFunc`], [`cudaGraphAddHostNode`], [`cudaGraphHostNodeGetParams`].
8591    pub fn cudaGraphHostNodeSetParams(
8592        node: cudaGraphNode_t,
8593        pNodeParams: *const cudaHostNodeParams,
8594    ) -> cudaError_t;
8595}
8596singe_loader::functions! { crate::RUNTIME;
8597    /// Creates a child graph node and adds it to a graph.
8598    ///
8599    /// Creates a new node which executes an embedded graph, and adds it to `graph` with `numDependencies` dependencies specified via `pDependencies`. It is possible for `numDependencies` to be 0, in which case the node will be placed at the root of the graph. `pDependencies` may not have any duplicate entries. A handle to the new node will be returned in `pGraphNode`.
8600    ///
8601    /// If `childGraph` contains allocation nodes, free nodes, or conditional nodes, this call will return an error.
8602    ///
8603    /// The node executes an embedded child graph. The child graph is cloned in this call.
8604    ///
8605    /// Note: Graph objects are not threadsafe. More here.
8606    ///
8607    /// Note that this function may also return error codes from previous, asynchronous launches.
8608    ///
8609    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
8610    ///
8611    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
8612    ///
8613    /// # Parameters
8614    ///
8615    /// - `pGraphNode`: Returns newly created node.
8616    /// - `graph`: Graph to which to add the node.
8617    /// - `pDependencies`: Dependencies of the node.
8618    /// - `numDependencies`: Number of dependencies.
8619    /// - `childGraph`: The graph to clone into this node.
8620    ///
8621    /// # Return value
8622    ///
8623    /// - [`cudaError_t::CUDA_SUCCESS`]
8624    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
8625    ///
8626    /// See also: [`cudaGraphAddNode`], [`cudaGraphChildGraphNodeGetGraph`], [`cudaGraphCreate`], [`cudaGraphDestroyNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddHostNode`], [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemsetNode`], [`cudaGraphClone`].
8627    pub fn cudaGraphAddChildGraphNode(
8628        pGraphNode: *mut cudaGraphNode_t,
8629        graph: cudaGraph_t,
8630        pDependencies: *const cudaGraphNode_t,
8631        numDependencies: size_t,
8632        childGraph: cudaGraph_t,
8633    ) -> cudaError_t;
8634}
8635singe_loader::functions! { crate::RUNTIME;
8636    /// Gets a handle to the embedded graph of a child graph node.
8637    ///
8638    /// 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.
8639    ///
8640    /// Allocation and free nodes cannot be added to the returned graph. Attempting to do so will return an error.
8641    ///
8642    /// Note: Graph objects are not threadsafe. More here.
8643    ///
8644    /// Note that this function may also return error codes from previous, asynchronous launches.
8645    ///
8646    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
8647    ///
8648    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
8649    ///
8650    /// # Parameters
8651    ///
8652    /// - `node`: Node to get the embedded graph for.
8653    /// - `pGraph`: Location to store a handle to the graph.
8654    ///
8655    /// # Return value
8656    ///
8657    /// - [`cudaError_t::CUDA_SUCCESS`]
8658    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
8659    ///
8660    /// See also: [`cudaGraphAddChildGraphNode`], [`cudaGraphNodeFindInClone`].
8661    pub fn cudaGraphChildGraphNodeGetGraph(
8662        node: cudaGraphNode_t,
8663        pGraph: *mut cudaGraph_t,
8664    ) -> cudaError_t;
8665}
8666singe_loader::functions! { crate::RUNTIME;
8667    /// Creates an empty node and adds it to a graph.
8668    ///
8669    /// Creates a new node which performs no operation, and adds it to `graph` with `numDependencies` dependencies specified via `pDependencies`. It is possible for `numDependencies` to be 0, in which case the node will be placed at the root of the graph. `pDependencies` may not have any duplicate entries. A handle to the new node will be returned in `pGraphNode`.
8670    ///
8671    /// 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.
8672    ///
8673    /// Note: Graph objects are not threadsafe. More here.
8674    ///
8675    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
8676    ///
8677    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
8678    ///
8679    /// # Parameters
8680    ///
8681    /// - `pGraphNode`: Returns newly created node.
8682    /// - `graph`: Graph to which to add the node.
8683    /// - `pDependencies`: Dependencies of the node.
8684    /// - `numDependencies`: Number of dependencies.
8685    ///
8686    /// # Return value
8687    ///
8688    /// - [`cudaError_t::CUDA_SUCCESS`]
8689    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
8690    ///
8691    /// See also: [`cudaGraphAddNode`], [`cudaGraphCreate`], [`cudaGraphDestroyNode`], [`cudaGraphAddChildGraphNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddHostNode`], [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemsetNode`].
8692    pub fn cudaGraphAddEmptyNode(
8693        pGraphNode: *mut cudaGraphNode_t,
8694        graph: cudaGraph_t,
8695        pDependencies: *const cudaGraphNode_t,
8696        numDependencies: size_t,
8697    ) -> cudaError_t;
8698}
8699singe_loader::functions! { crate::RUNTIME;
8700    /// Creates an event record node and adds it to a graph.
8701    ///
8702    /// 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`.
8703    ///
8704    /// Each launch of the graph will record `event` to capture execution of the node’s dependencies.
8705    ///
8706    /// These nodes may not be used in loops or conditionals.
8707    ///
8708    /// Note: Graph objects are not threadsafe. More here.
8709    ///
8710    /// Note that this function may also return error codes from previous, asynchronous launches.
8711    ///
8712    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
8713    ///
8714    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
8715    ///
8716    /// # Parameters
8717    ///
8718    /// - `numDependencies`: Number of dependencies.
8719    /// - `event`: Event for the node.
8720    ///
8721    /// # Return value
8722    ///
8723    /// - [`cudaError_t::CUDA_SUCCESS`]
8724    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
8725    ///
8726    /// See also: [`cudaGraphAddNode`], [`cudaGraphAddEventWaitNode`], [`cudaEventRecordWithFlags`], [`cudaStreamWaitEvent`], [`cudaGraphCreate`], [`cudaGraphDestroyNode`], [`cudaGraphAddChildGraphNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemsetNode`].
8727    pub fn cudaGraphAddEventRecordNode(
8728        pGraphNode: *mut cudaGraphNode_t,
8729        graph: cudaGraph_t,
8730        pDependencies: *const cudaGraphNode_t,
8731        numDependencies: size_t,
8732        event: cudaEvent_t,
8733    ) -> cudaError_t;
8734}
8735singe_loader::functions! { crate::RUNTIME;
8736    /// Returns the event associated with an event record node.
8737    ///
8738    /// Returns the event of event record node `hNode` in `event_out`.
8739    ///
8740    /// Note: Graph objects are not threadsafe. More here.
8741    ///
8742    /// Note that this function may also return error codes from previous, asynchronous launches.
8743    ///
8744    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
8745    ///
8746    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
8747    ///
8748    /// # Parameters
8749    ///
8750    /// - `event_out`: Pointer to return the event.
8751    ///
8752    /// # Return value
8753    ///
8754    /// - [`cudaError_t::CUDA_SUCCESS`]
8755    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
8756    ///
8757    /// See also: [`cudaGraphAddEventRecordNode`], [`cudaGraphEventRecordNodeSetEvent`], [`cudaGraphEventWaitNodeGetEvent`], [`cudaEventRecordWithFlags`], [`cudaStreamWaitEvent`].
8758    pub fn cudaGraphEventRecordNodeGetEvent(
8759        node: cudaGraphNode_t,
8760        event_out: *mut cudaEvent_t,
8761    ) -> cudaError_t;
8762}
8763singe_loader::functions! { crate::RUNTIME;
8764    /// Sets an event record node’s event.
8765    ///
8766    /// Sets the event of event record node `hNode` to `event`.
8767    ///
8768    /// Note: Graph objects are not threadsafe. More here.
8769    ///
8770    /// Note that this function may also return error codes from previous, asynchronous launches.
8771    ///
8772    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
8773    ///
8774    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
8775    ///
8776    /// # Parameters
8777    ///
8778    /// - `event`: Event to use.
8779    ///
8780    /// # Return value
8781    ///
8782    /// - [`cudaError_t::CUDA_SUCCESS`]
8783    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
8784    ///
8785    /// See also: [`cudaGraphNodeSetParams`], [`cudaGraphAddEventRecordNode`], [`cudaGraphEventRecordNodeGetEvent`], [`cudaGraphEventWaitNodeSetEvent`], [`cudaEventRecordWithFlags`], [`cudaStreamWaitEvent`].
8786    pub fn cudaGraphEventRecordNodeSetEvent(
8787        node: cudaGraphNode_t,
8788        event: cudaEvent_t,
8789    ) -> cudaError_t;
8790}
8791singe_loader::functions! { crate::RUNTIME;
8792    /// Creates an event wait node and adds it to a graph.
8793    ///
8794    /// 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`.
8795    ///
8796    /// The graph node will wait for all work captured in `event`. See [`cuEventRecord`](crate::driver::cuEventRecord) for details on what is captured by an event. The synchronization will be performed efficiently on the device when applicable. `event` may be from a different context or device than the launch stream.
8797    ///
8798    /// These nodes may not be used in loops or conditionals.
8799    ///
8800    /// Note: Graph objects are not threadsafe. More here.
8801    ///
8802    /// Note that this function may also return error codes from previous, asynchronous launches.
8803    ///
8804    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
8805    ///
8806    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
8807    ///
8808    /// # Parameters
8809    ///
8810    /// - `numDependencies`: Number of dependencies.
8811    /// - `event`: Event for the node.
8812    ///
8813    /// # Return value
8814    ///
8815    /// - [`cudaError_t::CUDA_SUCCESS`]
8816    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
8817    ///
8818    /// See also: [`cudaGraphAddNode`], [`cudaGraphAddEventRecordNode`], [`cudaEventRecordWithFlags`], [`cudaStreamWaitEvent`], [`cudaGraphCreate`], [`cudaGraphDestroyNode`], [`cudaGraphAddChildGraphNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemsetNode`].
8819    pub fn cudaGraphAddEventWaitNode(
8820        pGraphNode: *mut cudaGraphNode_t,
8821        graph: cudaGraph_t,
8822        pDependencies: *const cudaGraphNode_t,
8823        numDependencies: size_t,
8824        event: cudaEvent_t,
8825    ) -> cudaError_t;
8826}
8827singe_loader::functions! { crate::RUNTIME;
8828    /// Returns the event associated with an event wait node.
8829    ///
8830    /// Returns the event of event wait node `hNode` in `event_out`.
8831    ///
8832    /// Note: Graph objects are not threadsafe. More here.
8833    ///
8834    /// Note that this function may also return error codes from previous, asynchronous launches.
8835    ///
8836    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
8837    ///
8838    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
8839    ///
8840    /// # Parameters
8841    ///
8842    /// - `event_out`: Pointer to return the event.
8843    ///
8844    /// # Return value
8845    ///
8846    /// - [`cudaError_t::CUDA_SUCCESS`]
8847    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
8848    ///
8849    /// See also: [`cudaGraphAddEventWaitNode`], [`cudaGraphEventWaitNodeSetEvent`], [`cudaGraphEventRecordNodeGetEvent`], [`cudaEventRecordWithFlags`], [`cudaStreamWaitEvent`].
8850    pub fn cudaGraphEventWaitNodeGetEvent(
8851        node: cudaGraphNode_t,
8852        event_out: *mut cudaEvent_t,
8853    ) -> cudaError_t;
8854}
8855singe_loader::functions! { crate::RUNTIME;
8856    /// Sets an event wait node’s event.
8857    ///
8858    /// Sets the event of event wait node `hNode` to `event`.
8859    ///
8860    /// Note: Graph objects are not threadsafe. More here.
8861    ///
8862    /// Note that this function may also return error codes from previous, asynchronous launches.
8863    ///
8864    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
8865    ///
8866    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
8867    ///
8868    /// # Parameters
8869    ///
8870    /// - `event`: Event to use.
8871    ///
8872    /// # Return value
8873    ///
8874    /// - [`cudaError_t::CUDA_SUCCESS`]
8875    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
8876    ///
8877    /// See also: [`cudaGraphNodeSetParams`], [`cudaGraphAddEventWaitNode`], [`cudaGraphEventWaitNodeGetEvent`], [`cudaGraphEventRecordNodeSetEvent`], [`cudaEventRecordWithFlags`], [`cudaStreamWaitEvent`].
8878    pub fn cudaGraphEventWaitNodeSetEvent(
8879        node: cudaGraphNode_t,
8880        event: cudaEvent_t,
8881    ) -> cudaError_t;
8882}
8883singe_loader::functions! { crate::RUNTIME;
8884    /// Creates an external semaphore signal node and adds it to a graph.
8885    ///
8886    /// Creates a new external semaphore signal node and adds it to `graph` 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 `pGraphNode`.
8887    ///
8888    /// 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.
8889    ///
8890    /// Note: Graph objects are not threadsafe. More here.
8891    ///
8892    /// Note that this function may also return error codes from previous, asynchronous launches.
8893    ///
8894    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
8895    ///
8896    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
8897    ///
8898    /// # Parameters
8899    ///
8900    /// - `pGraphNode`: Returns newly created node.
8901    /// - `graph`: Graph to which to add the node.
8902    /// - `pDependencies`: Dependencies of the node.
8903    /// - `numDependencies`: Number of dependencies.
8904    /// - `nodeParams`: Parameters for the node.
8905    ///
8906    /// # Return value
8907    ///
8908    /// - [`cudaError_t::CUDA_SUCCESS`]
8909    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
8910    ///
8911    /// See also: [`cudaGraphAddNode`], [`cudaGraphExternalSemaphoresSignalNodeGetParams`], [`cudaGraphExternalSemaphoresSignalNodeSetParams`], [`cudaGraphExecExternalSemaphoresSignalNodeSetParams`], [`cudaGraphAddExternalSemaphoresWaitNode`], [`cudaImportExternalSemaphore`], [`cudaSignalExternalSemaphoresAsync`], [`cudaWaitExternalSemaphoresAsync`], [`cudaGraphCreate`], [`cudaGraphDestroyNode`], [`cudaGraphAddEventRecordNode`], [`cudaGraphAddEventWaitNode`], [`cudaGraphAddChildGraphNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemsetNode`].
8912    pub fn cudaGraphAddExternalSemaphoresSignalNode(
8913        pGraphNode: *mut cudaGraphNode_t,
8914        graph: cudaGraph_t,
8915        pDependencies: *const cudaGraphNode_t,
8916        numDependencies: size_t,
8917        nodeParams: *const cudaExternalSemaphoreSignalNodeParams,
8918    ) -> cudaError_t;
8919}
8920singe_loader::functions! { crate::RUNTIME;
8921    /// Returns an external semaphore signal node’s parameters.
8922    ///
8923    /// 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 [`cudaGraphExternalSemaphoresSignalNodeSetParams`] to update the parameters of this node.
8924    ///
8925    /// Note: Graph objects are not threadsafe. More here.
8926    ///
8927    /// Note that this function may also return error codes from previous, asynchronous launches.
8928    ///
8929    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
8930    ///
8931    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
8932    ///
8933    /// # Parameters
8934    ///
8935    /// - `hNode`: Node to get the parameters for.
8936    /// - `params_out`: Pointer to return the parameters.
8937    ///
8938    /// # Return value
8939    ///
8940    /// - [`cudaError_t::CUDA_SUCCESS`]
8941    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
8942    ///
8943    /// See also: [`cudaGraphNodeGetParams`], [`cudaLaunchKernel`], [`cudaGraphAddExternalSemaphoresSignalNode`], [`cudaGraphExternalSemaphoresSignalNodeSetParams`], [`cudaGraphAddExternalSemaphoresWaitNode`], [`cudaSignalExternalSemaphoresAsync`], [`cudaWaitExternalSemaphoresAsync`].
8944    pub fn cudaGraphExternalSemaphoresSignalNodeGetParams(
8945        hNode: cudaGraphNode_t,
8946        params_out: *mut cudaExternalSemaphoreSignalNodeParams,
8947    ) -> cudaError_t;
8948}
8949singe_loader::functions! { crate::RUNTIME;
8950    /// Sets an external semaphore signal node’s parameters.
8951    ///
8952    /// Sets the parameters of an external semaphore signal node `hNode` to `nodeParams`.
8953    ///
8954    /// Note: Graph objects are not threadsafe. More here.
8955    ///
8956    /// Note that this function may also return error codes from previous, asynchronous launches.
8957    ///
8958    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
8959    ///
8960    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
8961    ///
8962    /// # Parameters
8963    ///
8964    /// - `hNode`: Node to set the parameters for.
8965    /// - `nodeParams`: Parameters to copy.
8966    ///
8967    /// # Return value
8968    ///
8969    /// - [`cudaError_t::CUDA_SUCCESS`]
8970    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
8971    ///
8972    /// See also: [`cudaGraphNodeSetParams`], [`cudaGraphAddExternalSemaphoresSignalNode`], [`cudaGraphAddExternalSemaphoresWaitNode`], [`cudaSignalExternalSemaphoresAsync`], [`cudaWaitExternalSemaphoresAsync`].
8973    pub fn cudaGraphExternalSemaphoresSignalNodeSetParams(
8974        hNode: cudaGraphNode_t,
8975        nodeParams: *const cudaExternalSemaphoreSignalNodeParams,
8976    ) -> cudaError_t;
8977}
8978singe_loader::functions! { crate::RUNTIME;
8979    /// Creates an external semaphore wait node and adds it to a graph.
8980    ///
8981    /// Creates a new external semaphore wait node and adds it to `graph` 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 `pGraphNode`.
8982    ///
8983    /// 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.
8984    ///
8985    /// Note: Graph objects are not threadsafe. More here.
8986    ///
8987    /// Note that this function may also return error codes from previous, asynchronous launches.
8988    ///
8989    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
8990    ///
8991    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
8992    ///
8993    /// # Parameters
8994    ///
8995    /// - `pGraphNode`: Returns newly created node.
8996    /// - `graph`: Graph to which to add the node.
8997    /// - `pDependencies`: Dependencies of the node.
8998    /// - `numDependencies`: Number of dependencies.
8999    /// - `nodeParams`: Parameters for the node.
9000    ///
9001    /// # Return value
9002    ///
9003    /// - [`cudaError_t::CUDA_SUCCESS`]
9004    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
9005    ///
9006    /// See also: [`cudaGraphAddNode`], [`cudaGraphExternalSemaphoresWaitNodeGetParams`], [`cudaGraphExternalSemaphoresWaitNodeSetParams`], [`cudaGraphExecExternalSemaphoresWaitNodeSetParams`], [`cudaGraphAddExternalSemaphoresSignalNode`], [`cudaImportExternalSemaphore`], [`cudaSignalExternalSemaphoresAsync`], [`cudaWaitExternalSemaphoresAsync`], [`cudaGraphCreate`], [`cudaGraphDestroyNode`], [`cudaGraphAddEventRecordNode`], [`cudaGraphAddEventWaitNode`], [`cudaGraphAddChildGraphNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemsetNode`].
9007    pub fn cudaGraphAddExternalSemaphoresWaitNode(
9008        pGraphNode: *mut cudaGraphNode_t,
9009        graph: cudaGraph_t,
9010        pDependencies: *const cudaGraphNode_t,
9011        numDependencies: size_t,
9012        nodeParams: *const cudaExternalSemaphoreWaitNodeParams,
9013    ) -> cudaError_t;
9014}
9015singe_loader::functions! { crate::RUNTIME;
9016    /// Returns an external semaphore wait node’s parameters.
9017    ///
9018    /// 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 [`cudaGraphExternalSemaphoresSignalNodeSetParams`] to update the parameters of this node.
9019    ///
9020    /// Note: Graph objects are not threadsafe. More here.
9021    ///
9022    /// Note that this function may also return error codes from previous, asynchronous launches.
9023    ///
9024    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
9025    ///
9026    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
9027    ///
9028    /// # Parameters
9029    ///
9030    /// - `hNode`: Node to get the parameters for.
9031    /// - `params_out`: Pointer to return the parameters.
9032    ///
9033    /// # Return value
9034    ///
9035    /// - [`cudaError_t::CUDA_SUCCESS`]
9036    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
9037    ///
9038    /// See also: [`cudaGraphNodeGetParams`], [`cudaLaunchKernel`], [`cudaGraphAddExternalSemaphoresWaitNode`], [`cudaGraphExternalSemaphoresWaitNodeSetParams`], [`cudaSignalExternalSemaphoresAsync`], [`cudaWaitExternalSemaphoresAsync`].
9039    pub fn cudaGraphExternalSemaphoresWaitNodeGetParams(
9040        hNode: cudaGraphNode_t,
9041        params_out: *mut cudaExternalSemaphoreWaitNodeParams,
9042    ) -> cudaError_t;
9043}
9044singe_loader::functions! { crate::RUNTIME;
9045    /// Sets an external semaphore wait node’s parameters.
9046    ///
9047    /// Sets the parameters of an external semaphore wait node `hNode` to `nodeParams`.
9048    ///
9049    /// Note: Graph objects are not threadsafe. More here.
9050    ///
9051    /// Note that this function may also return error codes from previous, asynchronous launches.
9052    ///
9053    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
9054    ///
9055    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
9056    ///
9057    /// # Parameters
9058    ///
9059    /// - `hNode`: Node to set the parameters for.
9060    /// - `nodeParams`: Parameters to copy.
9061    ///
9062    /// # Return value
9063    ///
9064    /// - [`cudaError_t::CUDA_SUCCESS`]
9065    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
9066    ///
9067    /// See also: [`cudaGraphNodeSetParams`], [`cudaGraphAddExternalSemaphoresWaitNode`], [`cudaSignalExternalSemaphoresAsync`], [`cudaWaitExternalSemaphoresAsync`].
9068    pub fn cudaGraphExternalSemaphoresWaitNodeSetParams(
9069        hNode: cudaGraphNode_t,
9070        nodeParams: *const cudaExternalSemaphoreWaitNodeParams,
9071    ) -> cudaError_t;
9072}
9073singe_loader::functions! { crate::RUNTIME;
9074    /// Creates an allocation node and adds it to a graph.
9075    ///
9076    /// Creates a new allocation node and adds it to `graph` with `numDependencies` dependencies specified via `pDependencies` 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. `pDependencies` may not have any duplicate entries. A handle to the new node will be returned in `pGraphNode`.
9077    ///
9078    /// When [`cudaGraphAddMemAllocNode`] creates an allocation node, it returns the address of the allocation in `nodeParams.dptr`. The allocation’s address remains fixed across instantiations and launches.
9079    ///
9080    /// If the allocation is freed in the same graph, by creating a free node using [`cudaGraphAddMemFreeNode`], 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.
9081    ///
9082    /// 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.
9083    ///
9084    /// Allocations which are not freed in the same graph can be freed by:
9085    ///
9086    /// * passing the allocation to `cudaMemFreeAsync` or `cudaMemFree`;
9087    /// * launching a graph with a free node for that allocation; or
9088    /// * specifying [cudaGraphInstantiateFlagAutoFreeOnLaunch](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga638577f2b0f6a98b5e6a0e6a72d09004a4258c8d3adc203f97e73e92810e1785f) during instantiation, which makes each launch behave as though it called `cudaMemFreeAsync` for every unfreed allocation.
9089    ///
9090    /// 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.
9091    ///
9092    /// The following restrictions apply to graphs which contain allocation and/or memory free nodes:
9093    ///
9094    /// * Nodes and edges of the graph cannot be deleted.
9095    /// * The graph can only be used in a child node if the ownership is moved to the parent.
9096    /// * Only one instantiation of the graph may exist at any point in time.
9097    /// * The graph cannot be cloned.
9098    ///
9099    /// Note: Graph objects are not threadsafe. More here.
9100    ///
9101    /// Note that this function may also return error codes from previous, asynchronous launches.
9102    ///
9103    /// # Parameters
9104    ///
9105    /// - `pGraphNode`: Returns newly created node.
9106    /// - `graph`: Graph to which to add the node.
9107    /// - `pDependencies`: Dependencies of the node.
9108    /// - `numDependencies`: Number of dependencies.
9109    /// - `nodeParams`: Parameters for the node.
9110    ///
9111    /// # Return value
9112    ///
9113    /// - [`cudaError_t::CUDA_SUCCESS`]
9114    /// - [`cudaError_t::CUDA_ERROR_DEINITIALIZED`]
9115    /// - [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`]
9116    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
9117    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]: cudaErrorOutOfMemory.
9118    ///
9119    /// See also: [`cudaGraphAddNode`], [`cudaGraphAddMemFreeNode`], [`cudaGraphMemAllocNodeGetParams`], [`cudaDeviceGraphMemTrim`], [`cudaDeviceGetGraphMemAttribute`], [`cudaDeviceSetGraphMemAttribute`], [`cudaMallocAsync`], [`cudaFreeAsync`], [`cudaGraphCreate`], [`cudaGraphDestroyNode`], [`cudaGraphAddChildGraphNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddEventRecordNode`], [`cudaGraphAddEventWaitNode`], [`cudaGraphAddExternalSemaphoresSignalNode`], [`cudaGraphAddExternalSemaphoresWaitNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemsetNode`].
9120    pub fn cudaGraphAddMemAllocNode(
9121        pGraphNode: *mut cudaGraphNode_t,
9122        graph: cudaGraph_t,
9123        pDependencies: *const cudaGraphNode_t,
9124        numDependencies: size_t,
9125        nodeParams: *mut cudaMemAllocNodeParams,
9126    ) -> cudaError_t;
9127}
9128singe_loader::functions! { crate::RUNTIME;
9129    /// Returns a memory alloc node’s parameters.
9130    ///
9131    /// 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.
9132    ///
9133    /// Note: Graph objects are not threadsafe. More here.
9134    ///
9135    /// Note that this function may also return error codes from previous, asynchronous launches.
9136    ///
9137    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
9138    ///
9139    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
9140    ///
9141    /// # Parameters
9142    ///
9143    /// - `node`: Node to get the parameters for.
9144    /// - `params_out`: Pointer to return the parameters.
9145    ///
9146    /// # Return value
9147    ///
9148    /// - [`cudaError_t::CUDA_SUCCESS`]
9149    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
9150    ///
9151    /// See also: [`cudaGraphNodeGetParams`], [`cudaGraphAddMemAllocNode`], [`cudaGraphMemFreeNodeGetParams`].
9152    pub fn cudaGraphMemAllocNodeGetParams(
9153        node: cudaGraphNode_t,
9154        params_out: *mut cudaMemAllocNodeParams,
9155    ) -> cudaError_t;
9156}
9157singe_loader::functions! { crate::RUNTIME;
9158    /// Creates a memory free node and adds it to a graph.
9159    ///
9160    /// Creates a new memory free node and adds it to `graph` with `numDependencies` dependencies specified via `pDependencies` and address specified in `dptr`. It is possible for `numDependencies` to be 0, in which case the node will be placed at the root of the graph. `pDependencies` may not have any duplicate entries. A handle to the new node will be returned in `pGraphNode`.
9161    ///
9162    /// [`cudaGraphAddMemFreeNode`] will return [`cudaError_t::CUDA_ERROR_INVALID_VALUE`] if the user attempts to free:
9163    ///
9164    /// * an allocation twice in the same graph.
9165    /// * an address that was not returned by an allocation node.
9166    /// * an invalid address.
9167    ///
9168    /// The following restrictions apply to graphs which contain allocation and/or memory free nodes:
9169    ///
9170    /// * Nodes and edges of the graph cannot be deleted.
9171    /// * The graph can only be used in a child node if the ownership is moved to the parent.
9172    /// * Only one instantiation of the graph may exist at any point in time.
9173    /// * The graph cannot be cloned.
9174    ///
9175    /// Note: Graph objects are not threadsafe. More here.
9176    ///
9177    /// Note that this function may also return error codes from previous, asynchronous launches.
9178    ///
9179    /// # Parameters
9180    ///
9181    /// - `pGraphNode`: Returns newly created node.
9182    /// - `graph`: Graph to which to add the node.
9183    /// - `pDependencies`: Dependencies of the node.
9184    /// - `numDependencies`: Number of dependencies.
9185    /// - `dptr`: Address of memory to free.
9186    ///
9187    /// # Return value
9188    ///
9189    /// - [`cudaError_t::CUDA_SUCCESS`]
9190    /// - [`cudaError_t::CUDA_ERROR_DEINITIALIZED`]
9191    /// - [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`]
9192    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
9193    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]: cudaErrorOutOfMemory.
9194    ///
9195    /// See also: [`cudaGraphAddNode`], [`cudaGraphAddMemAllocNode`], [`cudaGraphMemFreeNodeGetParams`], [`cudaDeviceGraphMemTrim`], [`cudaDeviceGetGraphMemAttribute`], [`cudaDeviceSetGraphMemAttribute`], [`cudaMallocAsync`], [`cudaFreeAsync`], [`cudaGraphCreate`], [`cudaGraphDestroyNode`], [`cudaGraphAddChildGraphNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddEventRecordNode`], [`cudaGraphAddEventWaitNode`], [`cudaGraphAddExternalSemaphoresSignalNode`], [`cudaGraphAddExternalSemaphoresWaitNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemsetNode`].
9196    pub fn cudaGraphAddMemFreeNode(
9197        pGraphNode: *mut cudaGraphNode_t,
9198        graph: cudaGraph_t,
9199        pDependencies: *const cudaGraphNode_t,
9200        numDependencies: size_t,
9201        dptr: *mut ::core::ffi::c_void,
9202    ) -> cudaError_t;
9203}
9204singe_loader::functions! { crate::RUNTIME;
9205    /// Returns a memory free node’s parameters.
9206    ///
9207    /// Returns the address of a memory free node `hNode` in `dptr_out`.
9208    ///
9209    /// Note: Graph objects are not threadsafe. More here.
9210    ///
9211    /// Note that this function may also return error codes from previous, asynchronous launches.
9212    ///
9213    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
9214    ///
9215    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
9216    ///
9217    /// # Parameters
9218    ///
9219    /// - `node`: Node to get the parameters for.
9220    /// - `dptr_out`: Pointer to return the device address.
9221    ///
9222    /// # Return value
9223    ///
9224    /// - [`cudaError_t::CUDA_SUCCESS`]
9225    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
9226    ///
9227    /// See also: [`cudaGraphNodeGetParams`], [`cudaGraphAddMemFreeNode`].
9228    pub fn cudaGraphMemFreeNodeGetParams(
9229        node: cudaGraphNode_t,
9230        dptr_out: *mut ::core::ffi::c_void,
9231    ) -> cudaError_t;
9232}
9233singe_loader::functions! { crate::RUNTIME;
9234    /// Free unused memory that was cached on the specified device for use with graphs back to the OS.
9235    ///
9236    /// 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.
9237    ///
9238    /// Note: Graph objects are not threadsafe. More here.
9239    ///
9240    /// Note that this function may also return error codes from previous, asynchronous launches.
9241    ///
9242    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
9243    ///
9244    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
9245    ///
9246    /// # Parameters
9247    ///
9248    /// - `device`: The device for which cached memory should be freed.
9249    ///
9250    /// # Return value
9251    ///
9252    /// - [`cudaError_t::CUDA_SUCCESS`]
9253    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
9254    ///
9255    /// See also: [`cudaGraphAddMemAllocNode`], [`cudaGraphAddMemFreeNode`], [`cudaDeviceGetGraphMemAttribute`], [`cudaDeviceSetGraphMemAttribute`], [`cudaMallocAsync`], [`cudaFreeAsync`].
9256    pub fn cudaDeviceGraphMemTrim(device: ::core::ffi::c_int) -> cudaError_t;
9257}
9258singe_loader::functions! { crate::RUNTIME;
9259    /// Query asynchronous allocation attributes related to graphs.
9260    ///
9261    /// Valid attributes are:
9262    ///
9263    /// * [`cudaGraphMemAttributeType::CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT`]: Amount of memory, in bytes, currently associated with graphs
9264    /// * [`cudaGraphMemAttributeType::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.
9265    /// * [`cudaGraphMemAttributeType::CU_GRAPH_MEM_ATTR_RESERVED_MEM_CURRENT`]: Amount of memory, in bytes, currently allocated for use by the CUDA graphs asynchronous allocator.
9266    /// * [`cudaGraphMemAttributeType::CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH`]: High watermark of memory, in bytes, currently allocated for use by the CUDA graphs asynchronous allocator.
9267    ///
9268    /// Note: Graph objects are not threadsafe. More here.
9269    ///
9270    /// Note that this function may also return error codes from previous, asynchronous launches.
9271    ///
9272    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
9273    ///
9274    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
9275    ///
9276    /// # Parameters
9277    ///
9278    /// - `device`: Specifies the scope of the query.
9279    /// - `attr`: attribute to get.
9280    /// - `value`: retrieved value.
9281    ///
9282    /// # Return value
9283    ///
9284    /// - [`cudaError_t::CUDA_SUCCESS`]
9285    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
9286    ///
9287    /// See also: [`cudaDeviceSetGraphMemAttribute`], [`cudaGraphAddMemAllocNode`], [`cudaGraphAddMemFreeNode`], [`cudaDeviceGraphMemTrim`], [`cudaMallocAsync`], [`cudaFreeAsync`].
9288    pub fn cudaDeviceGetGraphMemAttribute(
9289        device: ::core::ffi::c_int,
9290        attr: cudaGraphMemAttributeType,
9291        value: *mut ::core::ffi::c_void,
9292    ) -> cudaError_t;
9293}
9294singe_loader::functions! { crate::RUNTIME;
9295    /// Set asynchronous allocation attributes related to graphs.
9296    ///
9297    /// Valid attributes are:
9298    ///
9299    /// * [`cudaGraphMemAttributeType::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.
9300    /// * [`cudaGraphMemAttributeType::CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH`]: High watermark of memory, in bytes, currently allocated for use by the CUDA graphs asynchronous allocator.
9301    ///
9302    /// Note: Graph objects are not threadsafe. More here.
9303    ///
9304    /// Note that this function may also return error codes from previous, asynchronous launches.
9305    ///
9306    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
9307    ///
9308    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
9309    ///
9310    /// # Parameters
9311    ///
9312    /// - `device`: Specifies the scope of the query.
9313    /// - `attr`: attribute to get.
9314    /// - `value`: pointer to value to set.
9315    ///
9316    /// # Return value
9317    ///
9318    /// - [`cudaError_t::CUDA_SUCCESS`]
9319    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
9320    ///
9321    /// See also: [`cudaDeviceGetGraphMemAttribute`], [`cudaGraphAddMemAllocNode`], [`cudaGraphAddMemFreeNode`], [`cudaDeviceGraphMemTrim`], [`cudaMallocAsync`], [`cudaFreeAsync`].
9322    pub fn cudaDeviceSetGraphMemAttribute(
9323        device: ::core::ffi::c_int,
9324        attr: cudaGraphMemAttributeType,
9325        value: *mut ::core::ffi::c_void,
9326    ) -> cudaError_t;
9327}
9328singe_loader::functions! { crate::RUNTIME;
9329    /// Clones a graph.
9330    ///
9331    /// This function creates a copy of `originalGraph` and returns it in `pGraphClone`. All parameters are copied into the cloned graph. The original graph may be modified after this call without affecting the clone.
9332    ///
9333    /// Child graph nodes in the original graph are recursively copied into the clone.
9334    ///
9335    /// Note: Cloning is not supported for graphs which contain memory allocation nodes, memory free nodes, or conditional nodes.
9336    ///
9337    /// Note: Graph objects are not threadsafe. More here.
9338    ///
9339    /// Note that this function may also return error codes from previous, asynchronous launches.
9340    ///
9341    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
9342    ///
9343    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
9344    ///
9345    /// # Parameters
9346    ///
9347    /// - `pGraphClone`: Returns newly created cloned graph.
9348    /// - `originalGraph`: Graph to clone.
9349    ///
9350    /// # Return value
9351    ///
9352    /// - [`cudaError_t::CUDA_SUCCESS`]
9353    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
9354    /// - [`cudaError_t::CUDA_ERROR_OUT_OF_MEMORY`]
9355    ///
9356    /// See also: [`cudaGraphCreate`], [`cudaGraphNodeFindInClone`].
9357    pub fn cudaGraphClone(
9358        pGraphClone: *mut cudaGraph_t,
9359        originalGraph: cudaGraph_t,
9360    ) -> cudaError_t;
9361}
9362singe_loader::functions! { crate::RUNTIME;
9363    /// Finds a cloned version of a node.
9364    ///
9365    /// This function returns the node in `clonedGraph` corresponding to `originalNode` in the original graph.
9366    ///
9367    /// `clonedGraph` must have been cloned from `originalGraph` via [`cudaGraphClone`]. `originalNode` must have been in `originalGraph` at the time of the call to [`cudaGraphClone`], and the corresponding cloned node in `clonedGraph` must not have been removed. The cloned node is then returned via `pClonedNode`.
9368    ///
9369    /// Note: Graph objects are not threadsafe. More here.
9370    ///
9371    /// Note that this function may also return error codes from previous, asynchronous launches.
9372    ///
9373    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
9374    ///
9375    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
9376    ///
9377    /// # Parameters
9378    ///
9379    /// - `pNode`: Returns handle to the cloned node.
9380    /// - `originalNode`: Handle to the original node.
9381    /// - `clonedGraph`: Cloned graph to query.
9382    ///
9383    /// # Return value
9384    ///
9385    /// - [`cudaError_t::CUDA_SUCCESS`]
9386    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
9387    ///
9388    /// See also: [`cudaGraphClone`].
9389    pub fn cudaGraphNodeFindInClone(
9390        pNode: *mut cudaGraphNode_t,
9391        originalNode: cudaGraphNode_t,
9392        clonedGraph: cudaGraph_t,
9393    ) -> cudaError_t;
9394}
9395singe_loader::functions! { crate::RUNTIME;
9396    /// Returns a node’s type.
9397    ///
9398    /// Returns the node type of `node` in `pType`.
9399    ///
9400    /// Note: Graph objects are not threadsafe. More here.
9401    ///
9402    /// Note that this function may also return error codes from previous, asynchronous launches.
9403    ///
9404    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
9405    ///
9406    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
9407    ///
9408    /// # Parameters
9409    ///
9410    /// - `node`: Node to query.
9411    /// - `pType`: Pointer to return the node type.
9412    ///
9413    /// # Return value
9414    ///
9415    /// - [`cudaError_t::CUDA_SUCCESS`]
9416    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
9417    ///
9418    /// See also: [`cudaGraphGetNodes`], [`cudaGraphGetRootNodes`], [`cudaGraphChildGraphNodeGetGraph`], [`cudaGraphKernelNodeGetParams`], [`cudaGraphKernelNodeSetParams`], [`cudaGraphHostNodeGetParams`], [`cudaGraphHostNodeSetParams`], [`cudaGraphMemcpyNodeGetParams`], [`cudaGraphMemcpyNodeSetParams`], [`cudaGraphMemsetNodeGetParams`], [`cudaGraphMemsetNodeSetParams`].
9419    pub fn cudaGraphNodeGetType(
9420        node: cudaGraphNode_t,
9421        pType: *mut cudaGraphNodeType,
9422    ) -> cudaError_t;
9423}
9424singe_loader::functions! { crate::RUNTIME;
9425    /// Returns the graph that contains a given graph node.
9426    ///
9427    /// Returns the graph that contains `hNode` in `*phGraph`. If hNode is in a child graph, the child graph it is in is returned.
9428    ///
9429    /// # Parameters
9430    ///
9431    /// - `hNode`: Node to query.
9432    /// - `phGraph`: Pointer to return the containing graph.
9433    ///
9434    /// # Return value
9435    ///
9436    /// - [`cudaError_t::CUDA_SUCCESS`]
9437    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
9438    ///
9439    /// See also: [`cudaGraphGetNodes`], [`cudaGraphDebugDotPrint`], [`cudaGraphNodeGetLocalId`], [`cudaGraphNodeGetToolsId`], [`cudaGraphGetId`], [`cudaGraphExecGetId`].
9440    pub fn cudaGraphNodeGetContainingGraph(
9441        hNode: cudaGraphNode_t,
9442        phGraph: *mut cudaGraph_t,
9443    ) -> cudaError_t;
9444}
9445singe_loader::functions! { crate::RUNTIME;
9446    /// Returns the node id of a given graph node.
9447    ///
9448    /// Returns the node id of `hNode` in `*nodeId`. The nodeId matches that referenced by [`cudaGraphDebugDotPrint`]. The local nodeId and graphId together can uniquely identify the node.
9449    ///
9450    /// # Parameters
9451    ///
9452    /// - `hNode`: Node to query.
9453    /// - `nodeId`: Pointer to return the nodeId.
9454    ///
9455    /// # Return value
9456    ///
9457    /// - [`cudaError_t::CUDA_SUCCESS`]
9458    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
9459    ///
9460    /// See also: [`cudaGraphGetNodes`], [`cudaGraphDebugDotPrint`], [`cudaGraphNodeGetContainingGraph`], [`cudaGraphNodeGetToolsId`], [`cudaGraphGetId`], [`cudaGraphExecGetId`].
9461    pub fn cudaGraphNodeGetLocalId(
9462        hNode: cudaGraphNode_t,
9463        nodeId: *mut ::core::ffi::c_uint,
9464    ) -> cudaError_t;
9465}
9466singe_loader::functions! { crate::RUNTIME;
9467    /// Returns an id used by tools to identify a given node.
9468    ///
9469    /// # Parameters
9470    ///
9471    /// - `hNode`: Node to query.
9472    ///
9473    /// # Return value
9474    ///
9475    /// CUDA_SUCCESS [`cudaError_t::CUDA_ERROR_INVALID_VALUE`].
9476    ///
9477    /// See also: [`cudaGraphGetNodes`], [`cudaGraphDebugDotPrint`], [`cudaGraphNodeGetContainingGraph`], [`cudaGraphNodeGetLocalId`], [`cudaGraphGetId`], [`cudaGraphExecGetId`].
9478    pub fn cudaGraphNodeGetToolsId(
9479        hNode: cudaGraphNode_t,
9480        toolsNodeId: *mut ::core::ffi::c_ulonglong,
9481    ) -> cudaError_t;
9482}
9483singe_loader::functions! { crate::RUNTIME;
9484    /// Returns the id of a given graph.
9485    ///
9486    /// Returns the id of `hGraph` in `*graphId`. The value in `*graphId` matches that referenced by [`cudaGraphDebugDotPrint`].
9487    ///
9488    /// # Parameters
9489    ///
9490    /// - `hGraph`: Graph to query.
9491    ///
9492    /// # Return value
9493    ///
9494    /// - [`cudaError_t::CUDA_SUCCESS`]
9495    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
9496    ///
9497    /// See also: [`cudaGraphGetNodes`], [`cudaGraphDebugDotPrint`], [`cudaGraphNodeGetContainingGraph`], [`cudaGraphNodeGetLocalId`], [`cudaGraphNodeGetToolsId`], [`cudaGraphExecGetId`].
9498    pub fn cudaGraphGetId(
9499        hGraph: cudaGraph_t,
9500        graphID: *mut ::core::ffi::c_uint,
9501    ) -> cudaError_t;
9502}
9503singe_loader::functions! { crate::RUNTIME;
9504    /// Returns the id of a given graph exec.
9505    ///
9506    /// Returns the id of `hGraphExec` in `*graphId`. The value in `*graphId` matches that referenced by [`cudaGraphDebugDotPrint`].
9507    ///
9508    /// # Parameters
9509    ///
9510    /// - `hGraphExec`: Graph to query.
9511    ///
9512    /// # Return value
9513    ///
9514    /// - [`cudaError_t::CUDA_SUCCESS`]
9515    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
9516    ///
9517    /// See also: [`cudaGraphGetNodes`], [`cudaGraphDebugDotPrint`], [`cudaGraphNodeGetContainingGraph`], [`cudaGraphNodeGetLocalId`], [`cudaGraphNodeGetToolsId`], [`cudaGraphGetId`].
9518    pub fn cudaGraphExecGetId(
9519        hGraphExec: cudaGraphExec_t,
9520        graphID: *mut ::core::ffi::c_uint,
9521    ) -> cudaError_t;
9522}
9523singe_loader::functions! { crate::RUNTIME;
9524    /// Returns a graph’s nodes.
9525    ///
9526    /// Returns a list of `graph'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`.
9527    ///
9528    /// Note: Graph objects are not threadsafe. More here.
9529    ///
9530    /// Note that this function may also return error codes from previous, asynchronous launches.
9531    ///
9532    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
9533    ///
9534    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
9535    ///
9536    /// # Parameters
9537    ///
9538    /// - `graph`: Graph to query.
9539    /// - `nodes`: Pointer to return the nodes.
9540    /// - `numNodes`: See description.
9541    ///
9542    /// # Return value
9543    ///
9544    /// - [`cudaError_t::CUDA_SUCCESS`]
9545    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
9546    ///
9547    /// See also: [`cudaGraphCreate`], [`cudaGraphGetRootNodes`], [`cudaGraphGetEdges`], [`cudaGraphNodeGetType`], [`cudaGraphNodeGetDependencies`], [`cudaGraphNodeGetDependentNodes`].
9548    pub fn cudaGraphGetNodes(
9549        graph: cudaGraph_t,
9550        nodes: *mut cudaGraphNode_t,
9551        numNodes: *mut size_t,
9552    ) -> cudaError_t;
9553}
9554singe_loader::functions! { crate::RUNTIME;
9555    /// Returns a graph’s root nodes.
9556    ///
9557    /// Returns a list of `graph's` root nodes. `pRootNodes` may be NULL, in which case this function will return the number of root nodes in `pNumRootNodes`. Otherwise, `pNumRootNodes` entries will be filled in. If `pNumRootNodes` is higher than the actual number of root nodes, the remaining entries in `pRootNodes` will be set to NULL, and the number of nodes actually obtained will be returned in `pNumRootNodes`.
9558    ///
9559    /// Note: Graph objects are not threadsafe. More here.
9560    ///
9561    /// Note that this function may also return error codes from previous, asynchronous launches.
9562    ///
9563    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
9564    ///
9565    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
9566    ///
9567    /// # Parameters
9568    ///
9569    /// - `graph`: Graph to query.
9570    /// - `pRootNodes`: Pointer to return the root nodes.
9571    /// - `pNumRootNodes`: See description.
9572    ///
9573    /// # Return value
9574    ///
9575    /// - [`cudaError_t::CUDA_SUCCESS`]
9576    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
9577    ///
9578    /// See also: [`cudaGraphCreate`], [`cudaGraphGetNodes`], [`cudaGraphGetEdges`], [`cudaGraphNodeGetType`], [`cudaGraphNodeGetDependencies`], [`cudaGraphNodeGetDependentNodes`].
9579    pub fn cudaGraphGetRootNodes(
9580        graph: cudaGraph_t,
9581        pRootNodes: *mut cudaGraphNode_t,
9582        pNumRootNodes: *mut size_t,
9583    ) -> cudaError_t;
9584}
9585singe_loader::functions! { crate::RUNTIME;
9586    /// Returns a graph’s dependency edges.
9587    ///
9588    /// Returns a list of `graph'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 losst query via NULL `edgeData` will result in [`cudaError_t::CUDA_ERROR_LOSSY_QUERY`]. If `edgeData` is non-NULL then `from` and `to` must be as well.
9589    ///
9590    /// Note: Graph objects are not threadsafe. More here.
9591    ///
9592    /// Note that this function may also return error codes from previous, asynchronous launches.
9593    ///
9594    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
9595    ///
9596    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
9597    ///
9598    /// # Parameters
9599    ///
9600    /// - `graph`: Graph to get the edges from.
9601    /// - `from`: Location to return edge endpoints.
9602    /// - `to`: Location to return edge endpoints.
9603    /// - `edgeData`: Optional location to return edge data.
9604    /// - `numEdges`: See description.
9605    ///
9606    /// # Return value
9607    ///
9608    /// - [`cudaError_t::CUDA_SUCCESS`]
9609    /// - [`cudaError_t::CUDA_ERROR_LOSSY_QUERY`]
9610    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
9611    ///
9612    /// See also: [`cudaGraphGetNodes`], [`cudaGraphGetRootNodes`], [`cudaGraphAddDependencies`], [`cudaGraphRemoveDependencies`], [`cudaGraphNodeGetDependencies`], [`cudaGraphNodeGetDependentNodes`].
9613    pub fn cudaGraphGetEdges(
9614        graph: cudaGraph_t,
9615        from: *mut cudaGraphNode_t,
9616        to: *mut cudaGraphNode_t,
9617        edgeData: *mut cudaGraphEdgeData,
9618        numEdges: *mut size_t,
9619    ) -> cudaError_t;
9620}
9621singe_loader::functions! { crate::RUNTIME;
9622    /// Returns a node’s dependencies.
9623    ///
9624    /// Returns a list of `node's` dependencies. `pDependencies` may be NULL, in which case this function will return the number of dependencies in `pNumDependencies`. Otherwise, `pNumDependencies` entries will be filled in. If `pNumDependencies` is higher than the actual number of dependencies, the remaining entries in `pDependencies` will be set to NULL, and the number of nodes actually obtained will be returned in `pNumDependencies`.
9625    ///
9626    /// Note that if an edge has non-zero (non-default) edge data and `edgeData` is NULL, this API will return [`cudaError_t::CUDA_ERROR_LOSSY_QUERY`]. If `edgeData` is non-NULL, then `pDependencies` must be as well.
9627    ///
9628    /// Note: Graph objects are not threadsafe. More here.
9629    ///
9630    /// Note that this function may also return error codes from previous, asynchronous launches.
9631    ///
9632    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
9633    ///
9634    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
9635    ///
9636    /// # Parameters
9637    ///
9638    /// - `node`: Node to query.
9639    /// - `pDependencies`: Pointer to return the dependencies.
9640    /// - `edgeData`: Optional array to return edge data for each dependency.
9641    /// - `pNumDependencies`: See description.
9642    ///
9643    /// # Return value
9644    ///
9645    /// - [`cudaError_t::CUDA_SUCCESS`]
9646    /// - [`cudaError_t::CUDA_ERROR_LOSSY_QUERY`]
9647    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
9648    ///
9649    /// See also: [`cudaGraphNodeGetDependentNodes`], [`cudaGraphGetNodes`], [`cudaGraphGetRootNodes`], [`cudaGraphGetEdges`], [`cudaGraphAddDependencies`], [`cudaGraphRemoveDependencies`].
9650    pub fn cudaGraphNodeGetDependencies(
9651        node: cudaGraphNode_t,
9652        pDependencies: *mut cudaGraphNode_t,
9653        edgeData: *mut cudaGraphEdgeData,
9654        pNumDependencies: *mut size_t,
9655    ) -> cudaError_t;
9656}
9657singe_loader::functions! { crate::RUNTIME;
9658    /// Returns a node’s dependent nodes.
9659    ///
9660    /// Returns a list of `node's` dependent nodes. `pDependentNodes` may be NULL, in which case this function will return the number of dependent nodes in `pNumDependentNodes`. Otherwise, `pNumDependentNodes` entries will be filled in. If `pNumDependentNodes` is higher than the actual number of dependent nodes, the remaining entries in `pDependentNodes` will be set to NULL, and the number of nodes actually obtained will be returned in `pNumDependentNodes`.
9661    ///
9662    /// Note that if an edge has non-zero (non-default) edge data and `edgeData` is NULL, this API will return [`cudaError_t::CUDA_ERROR_LOSSY_QUERY`]. If `edgeData` is non-NULL, then `pDependentNodes` must be as well.
9663    ///
9664    /// Note: Graph objects are not threadsafe. More here.
9665    ///
9666    /// Note that this function may also return error codes from previous, asynchronous launches.
9667    ///
9668    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
9669    ///
9670    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
9671    ///
9672    /// # Parameters
9673    ///
9674    /// - `node`: Node to query.
9675    /// - `pDependentNodes`: Pointer to return the dependent nodes.
9676    /// - `edgeData`: Optional pointer to return edge data for dependent nodes.
9677    /// - `pNumDependentNodes`: See description.
9678    ///
9679    /// # Return value
9680    ///
9681    /// - [`cudaError_t::CUDA_SUCCESS`]
9682    /// - [`cudaError_t::CUDA_ERROR_LOSSY_QUERY`]
9683    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
9684    ///
9685    /// See also: [`cudaGraphNodeGetDependencies`], [`cudaGraphGetNodes`], [`cudaGraphGetRootNodes`], [`cudaGraphGetEdges`], [`cudaGraphAddDependencies`], [`cudaGraphRemoveDependencies`].
9686    pub fn cudaGraphNodeGetDependentNodes(
9687        node: cudaGraphNode_t,
9688        pDependentNodes: *mut cudaGraphNode_t,
9689        edgeData: *mut cudaGraphEdgeData,
9690        pNumDependentNodes: *mut size_t,
9691    ) -> cudaError_t;
9692}
9693singe_loader::functions! { crate::RUNTIME;
9694    /// Adds dependency edges to a graph.
9695    ///
9696    /// The number of dependencies to be added is defined by `numDependencies` Elements in `pFrom` and `pTo` at corresponding indices define a dependency. Each node in `pFrom` and `pTo` must belong to `graph`.
9697    ///
9698    /// If `numDependencies` is 0, elements in `pFrom` and `pTo` will be ignored. Specifying an existing dependency will return an error.
9699    ///
9700    /// Note: Graph objects are not threadsafe. More here.
9701    ///
9702    /// Note that this function may also return error codes from previous, asynchronous launches.
9703    ///
9704    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
9705    ///
9706    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
9707    ///
9708    /// # Parameters
9709    ///
9710    /// - `graph`: Graph to which dependencies are added.
9711    /// - `from`: Array of nodes that provide the dependencies.
9712    /// - `to`: Array of dependent nodes.
9713    /// - `edgeData`: Optional array of edge data. If NULL, default (zeroed) edge data is assumed.
9714    /// - `numDependencies`: Number of dependencies to be added.
9715    ///
9716    /// # Return value
9717    ///
9718    /// - [`cudaError_t::CUDA_SUCCESS`]
9719    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
9720    ///
9721    /// See also: [`cudaGraphRemoveDependencies`], [`cudaGraphGetEdges`], [`cudaGraphNodeGetDependencies`], [`cudaGraphNodeGetDependentNodes`].
9722    pub fn cudaGraphAddDependencies(
9723        graph: cudaGraph_t,
9724        from: *const cudaGraphNode_t,
9725        to: *const cudaGraphNode_t,
9726        edgeData: *const cudaGraphEdgeData,
9727        numDependencies: size_t,
9728    ) -> cudaError_t;
9729}
9730singe_loader::functions! { crate::RUNTIME;
9731    /// Removes dependency edges from a graph.
9732    ///
9733    /// The number of `pDependencies` to be removed is defined by `numDependencies`. Elements in `pFrom` and `pTo` at corresponding indices define a dependency. Each node in `pFrom` and `pTo` must belong to `graph`.
9734    ///
9735    /// If `numDependencies` is 0, elements in `pFrom` and `pTo` 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.
9736    ///
9737    /// Note: Graph objects are not threadsafe. More here.
9738    ///
9739    /// Note that this function may also return error codes from previous, asynchronous launches.
9740    ///
9741    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
9742    ///
9743    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
9744    ///
9745    /// # Parameters
9746    ///
9747    /// - `graph`: Graph from which to remove dependencies.
9748    /// - `from`: Array of nodes that provide the dependencies.
9749    /// - `to`: Array of dependent nodes.
9750    /// - `edgeData`: Optional array of edge data. If NULL, edge data is assumed to be default (zeroed).
9751    /// - `numDependencies`: Number of dependencies to be removed.
9752    ///
9753    /// # Return value
9754    ///
9755    /// - [`cudaError_t::CUDA_SUCCESS`]
9756    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
9757    ///
9758    /// See also: [`cudaGraphAddDependencies`], [`cudaGraphGetEdges`], [`cudaGraphNodeGetDependencies`], [`cudaGraphNodeGetDependentNodes`].
9759    pub fn cudaGraphRemoveDependencies(
9760        graph: cudaGraph_t,
9761        from: *const cudaGraphNode_t,
9762        to: *const cudaGraphNode_t,
9763        edgeData: *const cudaGraphEdgeData,
9764        numDependencies: size_t,
9765    ) -> cudaError_t;
9766}
9767singe_loader::functions! { crate::RUNTIME;
9768    /// Remove a node from the graph.
9769    ///
9770    /// Removes `node` from its graph. This operation also severs any dependencies of other nodes on `node` and vice versa.
9771    ///
9772    /// Dependencies cannot be removed from graphs which contain allocation or free nodes. Any attempt to do so will return an error.
9773    ///
9774    /// Note: Graph objects are not threadsafe. More here.
9775    ///
9776    /// Note that this function may also return error codes from previous, asynchronous launches.
9777    ///
9778    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
9779    ///
9780    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
9781    ///
9782    /// Note: Use of the handle after this call is undefined behavior.
9783    ///
9784    /// # Parameters
9785    ///
9786    /// - `node`: Node to remove
9787    ///
9788    /// # Return value
9789    ///
9790    /// - [`cudaError_t::CUDA_SUCCESS`]
9791    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
9792    ///
9793    /// See also: [`cudaGraphAddChildGraphNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddHostNode`], [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemsetNode`].
9794    pub fn cudaGraphDestroyNode(node: cudaGraphNode_t) -> cudaError_t;
9795}
9796singe_loader::functions! { crate::RUNTIME;
9797    /// Creates an executable graph from a graph.
9798    ///
9799    /// Instantiates `graph` 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 `pGraphExec`.
9800    ///
9801    /// The `flags` parameter controls the behavior of instantiation and subsequent graph launches. Valid flags are:
9802    ///
9803    /// * [cudaGraphInstantiateFlagAutoFreeOnLaunch](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga638577f2b0f6a98b5e6a0e6a72d09004a4258c8d3adc203f97e73e92810e1785f), which configures a graph containing memory allocation nodes to automatically free any unfreed memory allocations before the graph is relaunched.
9804    /// * [cudaGraphInstantiateFlagDeviceLaunch](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga638577f2b0f6a98b5e6a0e6a72d09004a3fee5a1234b9f5d4ef329a660e6e3f5a), 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 cannot be used in conjunction with [cudaGraphInstantiateFlagAutoFreeOnLaunch](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga638577f2b0f6a98b5e6a0e6a72d09004a4258c8d3adc203f97e73e92810e1785f).
9805    /// * [cudaGraphInstantiateFlagUseNodePriority](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga638577f2b0f6a98b5e6a0e6a72d09004a95adbcaa8c89c323deec4b2070a4bab5), 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.
9806    ///
9807    /// If `graph` 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 [`cudaGraphExecDestroy`] will result in an error. The same also applies if `graph` contains any device-updatable kernel nodes.
9808    ///
9809    /// Graphs instantiated for launch on the device have additional restrictions which do not apply to host graphs:
9810    ///
9811    /// * The graph’s nodes must reside on a single device.
9812    /// * The graph can only contain kernel nodes, memcpy nodes, memset nodes, and child graph nodes.
9813    /// * The graph cannot be empty and must contain at least one kernel, memcpy, or memset node. Operation-specific restrictions are outlined below.
9814    /// * Kernel nodes:
9815    ///
9816    ///   + Use of CUDA Dynamic Parallelism is not permitted.
9817    ///   + Cooperative launches are permitted as long as MPS is not in use.
9818    /// * Memcpy nodes:
9819    ///
9820    ///   + Only copies involving device memory and/or pinned device-mapped host memory are permitted.
9821    ///   + Copies involving CUDA arrays are not permitted.
9822    ///   + Both operands must be accessible from the current device, and the current device must match the device of other nodes in the graph.
9823    ///
9824    /// If `graph` is not instantiated for launch on the device but contains kernels which call device-side [`cudaGraphLaunch`] from multiple devices, this will result in an error.
9825    ///
9826    /// Note: Graph objects are not threadsafe. More here.
9827    ///
9828    /// Note that this function may also return error codes from previous, asynchronous launches.
9829    ///
9830    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
9831    ///
9832    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
9833    ///
9834    /// # Parameters
9835    ///
9836    /// - `pGraphExec`: Returns instantiated graph.
9837    /// - `graph`: Graph to instantiate.
9838    /// - `flags`: Flags to control instantiation. See [`CUgraphInstantiate_flags`](crate::driver::CUgraphInstantiate_flags).
9839    ///
9840    /// # Return value
9841    ///
9842    /// - [`cudaError_t::CUDA_SUCCESS`]
9843    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
9844    ///
9845    /// See also: [`cudaGraphInstantiateWithFlags`], [`cudaGraphCreate`], [`cudaGraphUpload`], [`cudaGraphLaunch`], [`cudaGraphExecDestroy`].
9846    pub fn cudaGraphInstantiate(
9847        pGraphExec: *mut cudaGraphExec_t,
9848        graph: cudaGraph_t,
9849        flags: ::core::ffi::c_ulonglong,
9850    ) -> cudaError_t;
9851}
9852singe_loader::functions! { crate::RUNTIME;
9853    /// Creates an executable graph from a graph.
9854    ///
9855    /// Instantiates `graph` 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 `pGraphExec`.
9856    ///
9857    /// The `flags` parameter controls the behavior of instantiation and subsequent graph launches. Valid flags are:
9858    ///
9859    /// * [cudaGraphInstantiateFlagAutoFreeOnLaunch](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga638577f2b0f6a98b5e6a0e6a72d09004a4258c8d3adc203f97e73e92810e1785f), which configures a graph containing memory allocation nodes to automatically free any unfreed memory allocations before the graph is relaunched.
9860    /// * [cudaGraphInstantiateFlagDeviceLaunch](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga638577f2b0f6a98b5e6a0e6a72d09004a3fee5a1234b9f5d4ef329a660e6e3f5a), 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 [cudaGraphInstantiateFlagAutoFreeOnLaunch](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga638577f2b0f6a98b5e6a0e6a72d09004a4258c8d3adc203f97e73e92810e1785f).
9861    /// * [cudaGraphInstantiateFlagUseNodePriority](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga638577f2b0f6a98b5e6a0e6a72d09004a95adbcaa8c89c323deec4b2070a4bab5), 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.
9862    ///
9863    /// If `graph` 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 [`cudaGraphExecDestroy`] will result in an error. The same also applies if `graph` contains any device-updatable kernel nodes.
9864    ///
9865    /// If `graph` contains kernels which call device-side [`cudaGraphLaunch`] from multiple devices, this will result in an error.
9866    ///
9867    /// Graphs instantiated for launch on the device have additional restrictions which do not apply to host graphs:
9868    ///
9869    /// * The graph’s nodes must reside on a single device.
9870    /// * The graph can only contain kernel nodes, memcpy nodes, memset nodes, and child graph nodes.
9871    /// * The graph cannot be empty and must contain at least one kernel, memcpy, or memset node. Operation-specific restrictions are outlined below.
9872    /// * Kernel nodes:
9873    ///
9874    ///   + Use of CUDA Dynamic Parallelism is not permitted.
9875    ///   + Cooperative launches are permitted as long as MPS is not in use.
9876    /// * Memcpy nodes:
9877    ///
9878    ///   + Only copies involving device memory and/or pinned device-mapped host memory are permitted.
9879    ///   + Copies involving CUDA arrays are not permitted.
9880    ///   + Both operands must be accessible from the current device, and the current device must match the device of other nodes in the graph.
9881    ///
9882    /// Note: Graph objects are not threadsafe. More here.
9883    ///
9884    /// Note that this function may also return error codes from previous, asynchronous launches.
9885    ///
9886    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
9887    ///
9888    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
9889    ///
9890    /// # Parameters
9891    ///
9892    /// - `pGraphExec`: Returns instantiated graph.
9893    /// - `graph`: Graph to instantiate.
9894    /// - `flags`: Flags to control instantiation. See [`CUgraphInstantiate_flags`](crate::driver::CUgraphInstantiate_flags).
9895    ///
9896    /// # Return value
9897    ///
9898    /// - [`cudaError_t::CUDA_SUCCESS`]
9899    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
9900    ///
9901    /// See also: [`cudaGraphInstantiate`], [`cudaGraphCreate`], [`cudaGraphUpload`], [`cudaGraphLaunch`], [`cudaGraphExecDestroy`].
9902    pub fn cudaGraphInstantiateWithFlags(
9903        pGraphExec: *mut cudaGraphExec_t,
9904        graph: cudaGraph_t,
9905        flags: ::core::ffi::c_ulonglong,
9906    ) -> cudaError_t;
9907}
9908singe_loader::functions! { crate::RUNTIME;
9909    /// Creates an executable graph from a graph.
9910    ///
9911    /// Instantiates `graph` 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 `pGraphExec`.
9912    ///
9913    /// `instantiateParams` controls the behavior of instantiation and subsequent graph launches, as well as returning more detailed information in the event of an error. [`cudaGraphInstantiateParams`] is defined as:
9914    ///
9915    /// ```text
9916    /// typedef struct {
9917    /// unsigned long long flags;
9918    /// cudaStream_t uploadStream;
9919    /// cudaGraphNode_t errNode_out;
9920    /// cudaGraphInstantiateResult result_out;
9921    /// } cudaGraphInstantiateParams;
9922    /// ```
9923    ///
9924    /// The `flags` field controls the behavior of instantiation and subsequent graph launches. Valid flags are:
9925    ///
9926    /// * [cudaGraphInstantiateFlagAutoFreeOnLaunch](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga638577f2b0f6a98b5e6a0e6a72d09004a4258c8d3adc203f97e73e92810e1785f), which configures a graph containing memory allocation nodes to automatically free any unfreed memory allocations before the graph is relaunched.
9927    /// * [cudaGraphInstantiateFlagUpload](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga638577f2b0f6a98b5e6a0e6a72d09004a565872dd74cc9d97125bf43740345238), which will perform an upload of the graph into `uploadStream` once the graph has been instantiated.
9928    /// * [cudaGraphInstantiateFlagDeviceLaunch](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga638577f2b0f6a98b5e6a0e6a72d09004a3fee5a1234b9f5d4ef329a660e6e3f5a), 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 [cudaGraphInstantiateFlagAutoFreeOnLaunch](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga638577f2b0f6a98b5e6a0e6a72d09004a4258c8d3adc203f97e73e92810e1785f).
9929    /// * [cudaGraphInstantiateFlagUseNodePriority](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga638577f2b0f6a98b5e6a0e6a72d09004a95adbcaa8c89c323deec4b2070a4bab5), 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.
9930    ///
9931    /// If `graph` 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 [`cudaGraphExecDestroy`] will result in an error. The same also applies if `graph` contains any device-updatable kernel nodes.
9932    ///
9933    /// If `graph` contains kernels which call device-side [`cudaGraphLaunch`] from multiple devices, this will result in an error.
9934    ///
9935    /// Graphs instantiated for launch on the device have additional restrictions which do not apply to host graphs:
9936    ///
9937    /// * The graph’s nodes must reside on a single device.
9938    /// * The graph can only contain kernel nodes, memcpy nodes, memset nodes, and child graph nodes.
9939    /// * The graph cannot be empty and must contain at least one kernel, memcpy, or memset node. Operation-specific restrictions are outlined below.
9940    /// * Kernel nodes:
9941    ///
9942    ///   + Use of CUDA Dynamic Parallelism is not permitted.
9943    ///   + Cooperative launches are permitted as long as MPS is not in use.
9944    /// * Memcpy nodes:
9945    ///
9946    ///   + Only copies involving device memory and/or pinned device-mapped host memory are permitted.
9947    ///   + Copies involving CUDA arrays are not permitted.
9948    ///   + Both operands must be accessible from the current device, and the current device must match the device of other nodes in the graph.
9949    ///
9950    /// In the event of an error, the `result_out` and `errNode_out` fields will contain more information about the nature of the error. Possible error reporting includes:
9951    ///
9952    /// * [cudaGraphInstantiateError](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3faefd09000966e3b9d6ca5bcf7b2b9dab27a3438c6c187c9d105ff36692abebd), if passed an invalid value or if an unexpected error occurred which is described by the return value of the function. `errNode_out` will be set to NULL.
9953    /// * [cudaGraphInstantiateInvalidStructure](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3faefd09000966e3b9d6ca5bcf7b2b9da1f6436346e713fc9ddf43408e9b63da0), if the graph structure is invalid. `errNode_out` will be set to one of the offending nodes.
9954    /// * [cudaGraphInstantiateNodeOperationNotSupported](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3faefd09000966e3b9d6ca5bcf7b2b9dafe90eb1caaa8ce17e628dd5fa4651e25), 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. `errNode_out` will be set to this node.
9955    /// * [cudaGraphInstantiateMultipleDevicesNotSupported](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3faefd09000966e3b9d6ca5bcf7b2b9da344068129ac717f6ec29a4a6c88e90f0), if the graph is instantiated for device launch but a node’s device 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 devices. `errNode_out` will be set to this node.
9956    ///
9957    /// If instantiation is successful, `result_out` will be set to [cudaGraphInstantiateSuccess](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3faefd09000966e3b9d6ca5bcf7b2b9da6b92d94f90110623dafb5fe8081f6f45), and `hErrNode_out` will be set to NULL.
9958    ///
9959    /// Note: Graph objects are not threadsafe. More here.
9960    ///
9961    /// Note that this function may also return error codes from previous, asynchronous launches.
9962    ///
9963    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
9964    ///
9965    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
9966    ///
9967    /// # Parameters
9968    ///
9969    /// - `pGraphExec`: Returns instantiated graph.
9970    /// - `graph`: Graph to instantiate.
9971    /// - `instantiateParams`: Instantiation parameters.
9972    ///
9973    /// # Return value
9974    ///
9975    /// - [`cudaError_t::CUDA_SUCCESS`]
9976    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
9977    ///
9978    /// See also: [`cudaGraphCreate`], [`cudaGraphInstantiate`], [`cudaGraphInstantiateWithFlags`], [`cudaGraphExecDestroy`].
9979    pub fn cudaGraphInstantiateWithParams(
9980        pGraphExec: *mut cudaGraphExec_t,
9981        graph: cudaGraph_t,
9982        instantiateParams: *mut cudaGraphInstantiateParams,
9983    ) -> cudaError_t;
9984}
9985singe_loader::functions! { crate::RUNTIME;
9986    /// Query the instantiation flags of an executable graph.
9987    ///
9988    /// Returns the flags that were passed to instantiation for the given executable graph. [cudaGraphInstantiateFlagUpload](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga638577f2b0f6a98b5e6a0e6a72d09004a565872dd74cc9d97125bf43740345238) will not be returned by this API as it does not affect the resulting executable graph.
9989    ///
9990    /// Note: Graph objects are not threadsafe. More here.
9991    ///
9992    /// Note that this function may also return error codes from previous, asynchronous launches.
9993    ///
9994    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
9995    ///
9996    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
9997    ///
9998    /// # Parameters
9999    ///
10000    /// - `graphExec`: The executable graph to query.
10001    /// - `flags`: Returns the instantiation flags.
10002    ///
10003    /// # Return value
10004    ///
10005    /// - [`cudaError_t::CUDA_SUCCESS`]
10006    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
10007    ///
10008    /// See also: [`cudaGraphInstantiate`], [`cudaGraphInstantiateWithFlags`], [`cudaGraphInstantiateWithParams`].
10009    pub fn cudaGraphExecGetFlags(
10010        graphExec: cudaGraphExec_t,
10011        flags: *mut ::core::ffi::c_ulonglong,
10012    ) -> cudaError_t;
10013}
10014singe_loader::functions! { crate::RUNTIME;
10015    /// Sets the parameters for a kernel node in the given graphExec.
10016    ///
10017    /// Sets the parameters of a kernel node in an executable graph `hGraphExec`. The node is identified by the corresponding node `node` in the non-executable graph, from which the executable graph was instantiated.
10018    ///
10019    /// `node` must not have been removed from the original graph. All `nodeParams` fields may change, but the following restrictions apply to `func` updates:
10020    ///
10021    /// * The owning device of the function cannot change.
10022    /// * A node whose function originally did not use CUDA dynamic parallelism cannot be updated to a function which uses CDP
10023    /// * A node whose function originally did not make device-side update calls cannot be updated to a function which makes device-side update calls.
10024    /// * 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 device as nodes which contained such calls at instantiate-time. If no such calls were present at instantiation, these updates cannot be performed at all.
10025    ///
10026    /// The modifications only affect future launches of `hGraphExec`. Already enqueued or running launches of `hGraphExec` are not affected by this call. `node` is also not modified by this call.
10027    ///
10028    /// If `node` 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.
10029    ///
10030    /// Note: Graph objects are not threadsafe. More here.
10031    ///
10032    /// Note that this function may also return error codes from previous, asynchronous launches.
10033    ///
10034    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
10035    ///
10036    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
10037    ///
10038    /// Note: The API can also be used with a kernel [`cudaKernel_t`] by querying the handle using [`cudaLibraryGetKernel`] or [`cudaGetKernel`] and then passing it to the API by casting to void\*. The symbol `entryFuncAddr` passed to [`cudaGetKernel`] should be a symbol that is registered with the same CUDA Runtime instance.
10039    ///
10040    /// Note: Passing a symbol that belongs that belongs to a different runtime instance will result in undefined behavior. The only type that can be reliably passed to a different runtime instance is [`cudaKernel_t`].
10041    ///
10042    /// # Parameters
10043    ///
10044    /// - `hGraphExec`: The executable graph in which to set the specified node.
10045    /// - `node`: kernel node from the graph from which graphExec was instantiated.
10046    /// - `pNodeParams`: Updated Parameters to set.
10047    ///
10048    /// # Return value
10049    ///
10050    /// - [`cudaError_t::CUDA_SUCCESS`]
10051    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
10052    ///
10053    /// See also: [`cudaGraphExecNodeSetParams`], [`cudaGraphAddKernelNode`], [`cudaGraphKernelNodeSetParams`], [`cudaGraphExecMemcpyNodeSetParams`], [`cudaGraphExecMemsetNodeSetParams`], [`cudaGraphExecHostNodeSetParams`], [`cudaGraphExecChildGraphNodeSetParams`], [`cudaGraphExecEventRecordNodeSetEvent`], [`cudaGraphExecEventWaitNodeSetEvent`], [`cudaGraphExecExternalSemaphoresSignalNodeSetParams`], [`cudaGraphExecExternalSemaphoresWaitNodeSetParams`], [`cudaGraphExecUpdate`], [`cudaGraphInstantiate`].
10054    pub fn cudaGraphExecKernelNodeSetParams(
10055        hGraphExec: cudaGraphExec_t,
10056        node: cudaGraphNode_t,
10057        pNodeParams: *const cudaKernelNodeParams,
10058    ) -> cudaError_t;
10059}
10060singe_loader::functions! { crate::RUNTIME;
10061    /// Sets the parameters for a memcpy node in the given graphExec.
10062    ///
10063    /// Updates the work represented by `node` in `hGraphExec` as though `node` had contained `pNodeParams` at instantiation. `node` must remain in the graph which was used to instantiate `hGraphExec`. Changed edges to and from `node` are ignored.
10064    ///
10065    /// The source and destination memory in `pNodeParams` 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 `pNodeParams` must be 1-dimensional. Zero-length operations are not supported.
10066    ///
10067    /// The modifications only affect future launches of `hGraphExec`. Already enqueued or running launches of `hGraphExec` are not affected by this call. `node` is also not modified by this call.
10068    ///
10069    /// Returns [`cudaError_t::CUDA_ERROR_INVALID_VALUE`] if the memory operands’ mappings changed or either the original or new memory operands are multidimensional.
10070    ///
10071    /// Note: Graph objects are not threadsafe. More here.
10072    ///
10073    /// Note that this function may also return error codes from previous, asynchronous launches.
10074    ///
10075    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
10076    ///
10077    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
10078    ///
10079    /// # Parameters
10080    ///
10081    /// - `hGraphExec`: The executable graph in which to set the specified node.
10082    /// - `node`: Memcpy node from the graph which was used to instantiate graphExec.
10083    /// - `pNodeParams`: Updated Parameters to set.
10084    ///
10085    /// # Return value
10086    ///
10087    /// - [`cudaError_t::CUDA_SUCCESS`]
10088    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
10089    ///
10090    /// See also: [`cudaGraphExecNodeSetParams`], [`cudaGraphAddMemcpyNode`], [`cudaGraphMemcpyNodeSetParams`], [`cudaGraphExecMemcpyNodeSetParamsToSymbol`], [`cudaGraphExecMemcpyNodeSetParamsFromSymbol`], [`cudaGraphExecMemcpyNodeSetParams1D`], [`cudaGraphExecKernelNodeSetParams`], [`cudaGraphExecMemsetNodeSetParams`], [`cudaGraphExecHostNodeSetParams`], [`cudaGraphExecChildGraphNodeSetParams`], [`cudaGraphExecEventRecordNodeSetEvent`], [`cudaGraphExecEventWaitNodeSetEvent`], [`cudaGraphExecExternalSemaphoresSignalNodeSetParams`], [`cudaGraphExecExternalSemaphoresWaitNodeSetParams`], [`cudaGraphExecUpdate`], [`cudaGraphInstantiate`].
10091    pub fn cudaGraphExecMemcpyNodeSetParams(
10092        hGraphExec: cudaGraphExec_t,
10093        node: cudaGraphNode_t,
10094        pNodeParams: *const cudaMemcpy3DParms,
10095    ) -> cudaError_t;
10096}
10097singe_loader::functions! { crate::RUNTIME;
10098    /// Sets the parameters for a memcpy node in the given graphExec to copy to a symbol on the device.
10099    ///
10100    /// Updates the work represented by `node` in `hGraphExec` as though `node` had contained the given params at instantiation. `node` must remain in the graph which was used to instantiate `hGraphExec`. Changed edges to and from `node` are ignored.
10101    ///
10102    /// `src` and `symbol` must be allocated from the same contexts as the original source and destination memory. The instantiation-time memory operands must be 1-dimensional. Zero-length operations are not supported.
10103    ///
10104    /// The modifications only affect future launches of `hGraphExec`. Already enqueued or running launches of `hGraphExec` are not affected by this call. `node` is also not modified by this call.
10105    ///
10106    /// Returns [`cudaError_t::CUDA_ERROR_INVALID_VALUE`] if the memory operands’ mappings changed or the original memory operands are multidimensional.
10107    ///
10108    /// Note: Graph objects are not threadsafe. More here.
10109    ///
10110    /// Note that this function may also return error codes from previous, asynchronous launches.
10111    ///
10112    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
10113    ///
10114    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
10115    ///
10116    /// # Parameters
10117    ///
10118    /// - `hGraphExec`: The executable graph in which to set the specified node.
10119    /// - `node`: Memcpy node from the graph which was used to instantiate graphExec.
10120    /// - `symbol`: Device symbol address.
10121    /// - `src`: Source memory address.
10122    /// - `count`: Size in bytes to copy.
10123    /// - `offset`: Offset from start of symbol in bytes.
10124    /// - `kind`: Type of transfer.
10125    ///
10126    /// # Return value
10127    ///
10128    /// - [`cudaError_t::CUDA_SUCCESS`]
10129    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
10130    ///
10131    /// See also: [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemcpyNodeToSymbol`], [`cudaGraphMemcpyNodeSetParams`], [`cudaGraphMemcpyNodeSetParamsToSymbol`], [`cudaGraphExecMemcpyNodeSetParams`], [`cudaGraphExecMemcpyNodeSetParamsFromSymbol`], [`cudaGraphExecKernelNodeSetParams`], [`cudaGraphExecMemsetNodeSetParams`], [`cudaGraphExecHostNodeSetParams`], [`cudaGraphExecChildGraphNodeSetParams`], [`cudaGraphExecEventRecordNodeSetEvent`], [`cudaGraphExecEventWaitNodeSetEvent`], [`cudaGraphExecExternalSemaphoresSignalNodeSetParams`], [`cudaGraphExecExternalSemaphoresWaitNodeSetParams`], [`cudaGraphExecUpdate`], [`cudaGraphInstantiate`].
10132    pub fn cudaGraphExecMemcpyNodeSetParamsToSymbol(
10133        hGraphExec: cudaGraphExec_t,
10134        node: cudaGraphNode_t,
10135        symbol: *const ::core::ffi::c_void,
10136        src: *const ::core::ffi::c_void,
10137        count: size_t,
10138        offset: size_t,
10139        kind: cudaMemcpyKind,
10140    ) -> cudaError_t;
10141}
10142singe_loader::functions! { crate::RUNTIME;
10143    /// Sets the parameters for a memcpy node in the given graphExec to copy from a symbol on the device.
10144    ///
10145    /// Updates the work represented by `node` in `hGraphExec` as though `node` had contained the given params at instantiation. `node` must remain in the graph which was used to instantiate `hGraphExec`. Changed edges to and from `node` are ignored.
10146    ///
10147    /// `symbol` and `dst` must be allocated from the same contexts as the original source and destination memory. The instantiation-time memory operands must be 1-dimensional. Zero-length operations are not supported.
10148    ///
10149    /// The modifications only affect future launches of `hGraphExec`. Already enqueued or running launches of `hGraphExec` are not affected by this call. `node` is also not modified by this call.
10150    ///
10151    /// Returns [`cudaError_t::CUDA_ERROR_INVALID_VALUE`] if the memory operands’ mappings changed or the original memory operands are multidimensional.
10152    ///
10153    /// Note: Graph objects are not threadsafe. More here.
10154    ///
10155    /// Note that this function may also return error codes from previous, asynchronous launches.
10156    ///
10157    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
10158    ///
10159    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
10160    ///
10161    /// # Parameters
10162    ///
10163    /// - `hGraphExec`: The executable graph in which to set the specified node.
10164    /// - `node`: Memcpy node from the graph which was used to instantiate graphExec.
10165    /// - `dst`: Destination memory address.
10166    /// - `symbol`: Device symbol address.
10167    /// - `count`: Size in bytes to copy.
10168    /// - `offset`: Offset from start of symbol in bytes.
10169    /// - `kind`: Type of transfer.
10170    ///
10171    /// # Return value
10172    ///
10173    /// - [`cudaError_t::CUDA_SUCCESS`]
10174    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
10175    ///
10176    /// See also: [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemcpyNodeFromSymbol`], [`cudaGraphMemcpyNodeSetParams`], [`cudaGraphMemcpyNodeSetParamsFromSymbol`], [`cudaGraphExecMemcpyNodeSetParams`], [`cudaGraphExecMemcpyNodeSetParamsToSymbol`], [`cudaGraphExecKernelNodeSetParams`], [`cudaGraphExecMemsetNodeSetParams`], [`cudaGraphExecHostNodeSetParams`], [`cudaGraphExecChildGraphNodeSetParams`], [`cudaGraphExecEventRecordNodeSetEvent`], [`cudaGraphExecEventWaitNodeSetEvent`], [`cudaGraphExecExternalSemaphoresSignalNodeSetParams`], [`cudaGraphExecExternalSemaphoresWaitNodeSetParams`], [`cudaGraphExecUpdate`], [`cudaGraphInstantiate`].
10177    pub fn cudaGraphExecMemcpyNodeSetParamsFromSymbol(
10178        hGraphExec: cudaGraphExec_t,
10179        node: cudaGraphNode_t,
10180        dst: *mut ::core::ffi::c_void,
10181        symbol: *const ::core::ffi::c_void,
10182        count: size_t,
10183        offset: size_t,
10184        kind: cudaMemcpyKind,
10185    ) -> cudaError_t;
10186}
10187singe_loader::functions! { crate::RUNTIME;
10188    /// Sets the parameters for a memcpy node in the given graphExec to perform a 1-dimensional copy.
10189    ///
10190    /// Updates the work represented by `node` in `hGraphExec` as though `node` had contained the given params at instantiation. `node` must remain in the graph which was used to instantiate `hGraphExec`. Changed edges to and from `node` are ignored.
10191    ///
10192    /// `src` and `dst` must be allocated from the same contexts as the original source and destination memory. The instantiation-time memory operands must be 1-dimensional. Zero-length operations are not supported.
10193    ///
10194    /// The modifications only affect future launches of `hGraphExec`. Already enqueued or running launches of `hGraphExec` are not affected by this call. `node` is also not modified by this call.
10195    ///
10196    /// Returns [`cudaError_t::CUDA_ERROR_INVALID_VALUE`] if the memory operands’ mappings changed or the original memory operands are multidimensional.
10197    ///
10198    /// Note: Graph objects are not threadsafe. More here.
10199    ///
10200    /// Note that this function may also return error codes from previous, asynchronous launches.
10201    ///
10202    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
10203    ///
10204    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
10205    ///
10206    /// # Parameters
10207    ///
10208    /// - `hGraphExec`: The executable graph in which to set the specified node.
10209    /// - `node`: Memcpy node from the graph which was used to instantiate graphExec.
10210    /// - `dst`: Destination memory address.
10211    /// - `src`: Source memory address.
10212    /// - `count`: Size in bytes to copy.
10213    /// - `kind`: Type of transfer.
10214    ///
10215    /// # Return value
10216    ///
10217    /// - [`cudaError_t::CUDA_SUCCESS`]
10218    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
10219    ///
10220    /// See also: [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemcpyNode1D`], [`cudaGraphMemcpyNodeSetParams`], [`cudaGraphMemcpyNodeSetParams1D`], [`cudaGraphExecMemcpyNodeSetParams`], [`cudaGraphExecKernelNodeSetParams`], [`cudaGraphExecMemsetNodeSetParams`], [`cudaGraphExecHostNodeSetParams`], [`cudaGraphExecChildGraphNodeSetParams`], [`cudaGraphExecEventRecordNodeSetEvent`], [`cudaGraphExecEventWaitNodeSetEvent`], [`cudaGraphExecExternalSemaphoresSignalNodeSetParams`], [`cudaGraphExecExternalSemaphoresWaitNodeSetParams`], [`cudaGraphExecUpdate`], [`cudaGraphInstantiate`].
10221    pub fn cudaGraphExecMemcpyNodeSetParams1D(
10222        hGraphExec: cudaGraphExec_t,
10223        node: cudaGraphNode_t,
10224        dst: *mut ::core::ffi::c_void,
10225        src: *const ::core::ffi::c_void,
10226        count: size_t,
10227        kind: cudaMemcpyKind,
10228    ) -> cudaError_t;
10229}
10230singe_loader::functions! { crate::RUNTIME;
10231    /// Sets the parameters for a memset node in the given graphExec.
10232    ///
10233    /// Updates the work represented by `node` in `hGraphExec` as though `node` had contained `pNodeParams` at instantiation. `node` must remain in the graph which was used to instantiate `hGraphExec`. Changed edges to and from `node` are ignored.
10234    ///
10235    /// Zero sized operations are not supported.
10236    ///
10237    /// The new destination pointer in `pNodeParams` 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.
10238    ///
10239    /// Both the value and pointer address may be updated.
10240    ///
10241    /// 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.
10242    ///
10243    /// The modifications only affect future launches of `hGraphExec`. Already enqueued or running launches of `hGraphExec` are not affected by this call. `node` is also not modified by this call.
10244    ///
10245    /// Note: Graph objects are not threadsafe. More here.
10246    ///
10247    /// Note that this function may also return error codes from previous, asynchronous launches.
10248    ///
10249    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
10250    ///
10251    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
10252    ///
10253    /// # Parameters
10254    ///
10255    /// - `hGraphExec`: The executable graph in which to set the specified node.
10256    /// - `node`: Memset node from the graph which was used to instantiate graphExec.
10257    /// - `pNodeParams`: Updated Parameters to set.
10258    ///
10259    /// # Return value
10260    ///
10261    /// - [`cudaError_t::CUDA_SUCCESS`]
10262    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
10263    ///
10264    /// See also: [`cudaGraphExecNodeSetParams`], [`cudaGraphAddMemsetNode`], [`cudaGraphMemsetNodeSetParams`], [`cudaGraphExecKernelNodeSetParams`], [`cudaGraphExecMemcpyNodeSetParams`], [`cudaGraphExecHostNodeSetParams`], [`cudaGraphExecChildGraphNodeSetParams`], [`cudaGraphExecEventRecordNodeSetEvent`], [`cudaGraphExecEventWaitNodeSetEvent`], [`cudaGraphExecExternalSemaphoresSignalNodeSetParams`], [`cudaGraphExecExternalSemaphoresWaitNodeSetParams`], [`cudaGraphExecUpdate`], [`cudaGraphInstantiate`].
10265    pub fn cudaGraphExecMemsetNodeSetParams(
10266        hGraphExec: cudaGraphExec_t,
10267        node: cudaGraphNode_t,
10268        pNodeParams: *const cudaMemsetParams,
10269    ) -> cudaError_t;
10270}
10271singe_loader::functions! { crate::RUNTIME;
10272    /// Sets the parameters for a host node in the given graphExec.
10273    ///
10274    /// Updates the work represented by `node` in `hGraphExec` as though `node` had contained `pNodeParams` at instantiation. `node` must remain in the graph which was used to instantiate `hGraphExec`. Changed edges to and from `node` are ignored.
10275    ///
10276    /// The modifications only affect future launches of `hGraphExec`. Already enqueued or running launches of `hGraphExec` are not affected by this call. `node` is also not modified by this call.
10277    ///
10278    /// Note: Graph objects are not threadsafe. More here.
10279    ///
10280    /// Note that this function may also return error codes from previous, asynchronous launches.
10281    ///
10282    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
10283    ///
10284    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
10285    ///
10286    /// # Parameters
10287    ///
10288    /// - `hGraphExec`: The executable graph in which to set the specified node.
10289    /// - `node`: Host node from the graph which was used to instantiate graphExec.
10290    /// - `pNodeParams`: Updated Parameters to set.
10291    ///
10292    /// # Return value
10293    ///
10294    /// - [`cudaError_t::CUDA_SUCCESS`]
10295    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
10296    ///
10297    /// See also: [`cudaGraphExecNodeSetParams`], [`cudaGraphAddHostNode`], [`cudaGraphHostNodeSetParams`], [`cudaGraphExecKernelNodeSetParams`], [`cudaGraphExecMemcpyNodeSetParams`], [`cudaGraphExecMemsetNodeSetParams`], [`cudaGraphExecChildGraphNodeSetParams`], [`cudaGraphExecEventRecordNodeSetEvent`], [`cudaGraphExecEventWaitNodeSetEvent`], [`cudaGraphExecExternalSemaphoresSignalNodeSetParams`], [`cudaGraphExecExternalSemaphoresWaitNodeSetParams`], [`cudaGraphExecUpdate`], [`cudaGraphInstantiate`].
10298    pub fn cudaGraphExecHostNodeSetParams(
10299        hGraphExec: cudaGraphExec_t,
10300        node: cudaGraphNode_t,
10301        pNodeParams: *const cudaHostNodeParams,
10302    ) -> cudaError_t;
10303}
10304singe_loader::functions! { crate::RUNTIME;
10305    /// Updates node parameters in the child graph node in the given graphExec.
10306    ///
10307    /// Updates the work represented by `node` in `hGraphExec` as though the nodes contained in `node's` graph had the parameters contained in `childGraph's` nodes at instantiation. `node` must remain in the graph which was used to instantiate `hGraphExec`. Changed edges to and from `node` are ignored.
10308    ///
10309    /// The modifications only affect future launches of `hGraphExec`. Already enqueued or running launches of `hGraphExec` are not affected by this call. `node` is also not modified by this call.
10310    ///
10311    /// The topology of `childGraph`, as well as the node insertion order, must match that of the graph contained in `node`. See [`cudaGraphExecUpdate`] 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.
10312    ///
10313    /// Note: Graph objects are not threadsafe. More here.
10314    ///
10315    /// Note that this function may also return error codes from previous, asynchronous launches.
10316    ///
10317    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
10318    ///
10319    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
10320    ///
10321    /// # Parameters
10322    ///
10323    /// - `hGraphExec`: The executable graph in which to set the specified node.
10324    /// - `node`: Host node from the graph which was used to instantiate graphExec.
10325    /// - `childGraph`: The graph supplying the updated parameters.
10326    ///
10327    /// # Return value
10328    ///
10329    /// - [`cudaError_t::CUDA_SUCCESS`]
10330    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
10331    ///
10332    /// See also: [`cudaGraphExecNodeSetParams`], [`cudaGraphAddChildGraphNode`], [`cudaGraphChildGraphNodeGetGraph`], [`cudaGraphExecKernelNodeSetParams`], [`cudaGraphExecMemcpyNodeSetParams`], [`cudaGraphExecMemsetNodeSetParams`], [`cudaGraphExecHostNodeSetParams`], [`cudaGraphExecEventRecordNodeSetEvent`], [`cudaGraphExecEventWaitNodeSetEvent`], [`cudaGraphExecExternalSemaphoresSignalNodeSetParams`], [`cudaGraphExecExternalSemaphoresWaitNodeSetParams`], [`cudaGraphExecUpdate`], [`cudaGraphInstantiate`].
10333    pub fn cudaGraphExecChildGraphNodeSetParams(
10334        hGraphExec: cudaGraphExec_t,
10335        node: cudaGraphNode_t,
10336        childGraph: cudaGraph_t,
10337    ) -> cudaError_t;
10338}
10339singe_loader::functions! { crate::RUNTIME;
10340    /// Sets the event for an event record node in the given graphExec.
10341    ///
10342    /// 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.
10343    ///
10344    /// 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.
10345    ///
10346    /// Note: Graph objects are not threadsafe. More here.
10347    ///
10348    /// Note that this function may also return error codes from previous, asynchronous launches.
10349    ///
10350    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
10351    ///
10352    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
10353    ///
10354    /// # Parameters
10355    ///
10356    /// - `hGraphExec`: The executable graph in which to set the specified node.
10357    /// - `hNode`: Event record node from the graph from which graphExec was instantiated.
10358    /// - `event`: Updated event to use.
10359    ///
10360    /// # Return value
10361    ///
10362    /// - [`cudaError_t::CUDA_SUCCESS`]
10363    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
10364    ///
10365    /// See also: [`cudaGraphExecNodeSetParams`], [`cudaGraphAddEventRecordNode`], [`cudaGraphEventRecordNodeGetEvent`], [`cudaGraphEventWaitNodeSetEvent`], [`cudaEventRecordWithFlags`], [`cudaStreamWaitEvent`], [`cudaGraphExecKernelNodeSetParams`], [`cudaGraphExecMemcpyNodeSetParams`], [`cudaGraphExecMemsetNodeSetParams`], [`cudaGraphExecHostNodeSetParams`], [`cudaGraphExecChildGraphNodeSetParams`], [`cudaGraphExecEventWaitNodeSetEvent`], [`cudaGraphExecExternalSemaphoresSignalNodeSetParams`], [`cudaGraphExecExternalSemaphoresWaitNodeSetParams`], [`cudaGraphExecUpdate`], [`cudaGraphInstantiate`].
10366    pub fn cudaGraphExecEventRecordNodeSetEvent(
10367        hGraphExec: cudaGraphExec_t,
10368        hNode: cudaGraphNode_t,
10369        event: cudaEvent_t,
10370    ) -> cudaError_t;
10371}
10372singe_loader::functions! { crate::RUNTIME;
10373    /// Sets the event for an event wait node in the given graphExec.
10374    ///
10375    /// 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.
10376    ///
10377    /// 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.
10378    ///
10379    /// Note: Graph objects are not threadsafe. More here.
10380    ///
10381    /// Note that this function may also return error codes from previous, asynchronous launches.
10382    ///
10383    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
10384    ///
10385    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
10386    ///
10387    /// # Parameters
10388    ///
10389    /// - `hGraphExec`: The executable graph in which to set the specified node.
10390    /// - `hNode`: Event wait node from the graph from which graphExec was instantiated.
10391    /// - `event`: Updated event to use.
10392    ///
10393    /// # Return value
10394    ///
10395    /// - [`cudaError_t::CUDA_SUCCESS`]
10396    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
10397    ///
10398    /// See also: [`cudaGraphExecNodeSetParams`], [`cudaGraphAddEventWaitNode`], [`cudaGraphEventWaitNodeGetEvent`], [`cudaGraphEventRecordNodeSetEvent`], [`cudaEventRecordWithFlags`], [`cudaStreamWaitEvent`], [`cudaGraphExecKernelNodeSetParams`], [`cudaGraphExecMemcpyNodeSetParams`], [`cudaGraphExecMemsetNodeSetParams`], [`cudaGraphExecHostNodeSetParams`], [`cudaGraphExecChildGraphNodeSetParams`], [`cudaGraphExecEventRecordNodeSetEvent`], [`cudaGraphExecExternalSemaphoresSignalNodeSetParams`], [`cudaGraphExecExternalSemaphoresWaitNodeSetParams`], [`cudaGraphExecUpdate`], [`cudaGraphInstantiate`].
10399    pub fn cudaGraphExecEventWaitNodeSetEvent(
10400        hGraphExec: cudaGraphExec_t,
10401        hNode: cudaGraphNode_t,
10402        event: cudaEvent_t,
10403    ) -> cudaError_t;
10404}
10405singe_loader::functions! { crate::RUNTIME;
10406    /// Sets the parameters for an external semaphore signal node in the given graphExec.
10407    ///
10408    /// 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.
10409    ///
10410    /// `hNode` must not have been removed from the original graph.
10411    ///
10412    /// 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.
10413    ///
10414    /// Changing `nodeParams->numExtSems` is not supported.
10415    ///
10416    /// Note: Graph objects are not threadsafe. More here.
10417    ///
10418    /// Note that this function may also return error codes from previous, asynchronous launches.
10419    ///
10420    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
10421    ///
10422    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
10423    ///
10424    /// # Parameters
10425    ///
10426    /// - `hGraphExec`: The executable graph in which to set the specified node.
10427    /// - `hNode`: semaphore signal node from the graph from which graphExec was instantiated.
10428    /// - `nodeParams`: Updated Parameters to set.
10429    ///
10430    /// # Return value
10431    ///
10432    /// - [`cudaError_t::CUDA_SUCCESS`]
10433    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
10434    ///
10435    /// See also: [`cudaGraphExecNodeSetParams`], [`cudaGraphAddExternalSemaphoresSignalNode`], [`cudaImportExternalSemaphore`], [`cudaSignalExternalSemaphoresAsync`], [`cudaWaitExternalSemaphoresAsync`], [`cudaGraphExecKernelNodeSetParams`], [`cudaGraphExecMemcpyNodeSetParams`], [`cudaGraphExecMemsetNodeSetParams`], [`cudaGraphExecHostNodeSetParams`], [`cudaGraphExecChildGraphNodeSetParams`], [`cudaGraphExecEventRecordNodeSetEvent`], [`cudaGraphExecEventWaitNodeSetEvent`], [`cudaGraphExecExternalSemaphoresWaitNodeSetParams`], [`cudaGraphExecUpdate`], [`cudaGraphInstantiate`].
10436    pub fn cudaGraphExecExternalSemaphoresSignalNodeSetParams(
10437        hGraphExec: cudaGraphExec_t,
10438        hNode: cudaGraphNode_t,
10439        nodeParams: *const cudaExternalSemaphoreSignalNodeParams,
10440    ) -> cudaError_t;
10441}
10442singe_loader::functions! { crate::RUNTIME;
10443    /// Sets the parameters for an external semaphore wait node in the given graphExec.
10444    ///
10445    /// 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.
10446    ///
10447    /// `hNode` must not have been removed from the original graph.
10448    ///
10449    /// 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.
10450    ///
10451    /// Changing `nodeParams->numExtSems` is not supported.
10452    ///
10453    /// Note: Graph objects are not threadsafe. More here.
10454    ///
10455    /// Note that this function may also return error codes from previous, asynchronous launches.
10456    ///
10457    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
10458    ///
10459    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
10460    ///
10461    /// # Parameters
10462    ///
10463    /// - `hGraphExec`: The executable graph in which to set the specified node.
10464    /// - `hNode`: semaphore wait node from the graph from which graphExec was instantiated.
10465    /// - `nodeParams`: Updated Parameters to set.
10466    ///
10467    /// # Return value
10468    ///
10469    /// - [`cudaError_t::CUDA_SUCCESS`]
10470    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
10471    ///
10472    /// See also: [`cudaGraphExecNodeSetParams`], [`cudaGraphAddExternalSemaphoresWaitNode`], [`cudaImportExternalSemaphore`], [`cudaSignalExternalSemaphoresAsync`], [`cudaWaitExternalSemaphoresAsync`], [`cudaGraphExecKernelNodeSetParams`], [`cudaGraphExecMemcpyNodeSetParams`], [`cudaGraphExecMemsetNodeSetParams`], [`cudaGraphExecHostNodeSetParams`], [`cudaGraphExecChildGraphNodeSetParams`], [`cudaGraphExecEventRecordNodeSetEvent`], [`cudaGraphExecEventWaitNodeSetEvent`], [`cudaGraphExecExternalSemaphoresSignalNodeSetParams`], [`cudaGraphExecUpdate`], [`cudaGraphInstantiate`].
10473    pub fn cudaGraphExecExternalSemaphoresWaitNodeSetParams(
10474        hGraphExec: cudaGraphExec_t,
10475        hNode: cudaGraphNode_t,
10476        nodeParams: *const cudaExternalSemaphoreWaitNodeParams,
10477    ) -> cudaError_t;
10478}
10479singe_loader::functions! { crate::RUNTIME;
10480    /// Enables or disables the specified node in the given graphExec.
10481    ///
10482    /// 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.
10483    ///
10484    /// The node is identified by the corresponding node `hNode` in the non-executable graph, from which the executable graph was instantiated.
10485    ///
10486    /// `hNode` must not have been removed from the original graph.
10487    ///
10488    /// 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.
10489    ///
10490    /// Note: Currently only kernel, memset and memcpy nodes are supported.
10491    ///
10492    /// Note: Graph objects are not threadsafe. More here.
10493    ///
10494    /// Note that this function may also return error codes from previous, asynchronous launches.
10495    ///
10496    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
10497    ///
10498    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
10499    ///
10500    /// # Parameters
10501    ///
10502    /// - `hGraphExec`: The executable graph in which to set the specified node.
10503    /// - `hNode`: Node from the graph from which graphExec was instantiated.
10504    /// - `isEnabled`: Node is enabled if != 0, otherwise the node is disabled.
10505    ///
10506    /// # Return value
10507    ///
10508    /// - [`cudaError_t::CUDA_SUCCESS`]
10509    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
10510    ///
10511    /// See also: [`cudaGraphNodeGetEnabled`], [`cudaGraphExecUpdate`], [`cudaGraphInstantiate`], [`cudaGraphLaunch`].
10512    pub fn cudaGraphNodeSetEnabled(
10513        hGraphExec: cudaGraphExec_t,
10514        hNode: cudaGraphNode_t,
10515        isEnabled: ::core::ffi::c_uint,
10516    ) -> cudaError_t;
10517}
10518singe_loader::functions! { crate::RUNTIME;
10519    /// Query whether a node in the given graphExec is enabled.
10520    ///
10521    /// Sets isEnabled to 1 if `hNode` is enabled, or 0 if `hNode` is disabled.
10522    ///
10523    /// The node is identified by the corresponding node `hNode` in the non-executable graph, from which the executable graph was instantiated.
10524    ///
10525    /// `hNode` must not have been removed from the original graph.
10526    ///
10527    /// Note: Currently only kernel, memset and memcpy nodes are supported.
10528    ///
10529    /// Note: Graph objects are not threadsafe. More here.
10530    ///
10531    /// Note that this function may also return error codes from previous, asynchronous launches.
10532    ///
10533    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
10534    ///
10535    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
10536    ///
10537    /// # Parameters
10538    ///
10539    /// - `hGraphExec`: The executable graph in which to set the specified node.
10540    /// - `hNode`: Node from the graph from which graphExec was instantiated.
10541    /// - `isEnabled`: Location to return the enabled status of the node.
10542    ///
10543    /// # Return value
10544    ///
10545    /// - [`cudaError_t::CUDA_SUCCESS`]
10546    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
10547    ///
10548    /// See also: [`cudaGraphNodeSetEnabled`], [`cudaGraphExecUpdate`], [`cudaGraphInstantiate`], [`cudaGraphLaunch`].
10549    pub fn cudaGraphNodeGetEnabled(
10550        hGraphExec: cudaGraphExec_t,
10551        hNode: cudaGraphNode_t,
10552        isEnabled: *mut ::core::ffi::c_uint,
10553    ) -> cudaError_t;
10554}
10555singe_loader::functions! { crate::RUNTIME;
10556    /// Check whether an executable graph can be updated with a graph and perform the update if possible.
10557    ///
10558    /// Updates the node parameters in the instantiated graph specified by `hGraphExec` with the node parameters in a topologically identical graph specified by `hGraph`.
10559    ///
10560    /// Limitations:
10561    ///
10562    /// * Kernel nodes:
10563    ///
10564    ///   + The owning context of the function cannot change.
10565    ///   + A node whose function originally did not use CUDA dynamic parallelism cannot be updated to a function which uses CDP.
10566    ///   + A node whose function originally did not make device-side update calls cannot be updated to a function which makes device-side update calls.
10567    ///   + A cooperative node cannot be updated to a non-cooperative node, and vice-versa.
10568    ///   + If the graph was instantiated with cudaGraphInstantiateFlagUseNodePriority, the priority attribute cannot change. Equality is checked on the originally requested priority values, before they are clamped to the device’s supported range.
10569    ///   + 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 device as nodes which contained such calls at instantiate-time. If no such calls were present at instantiation, these updates cannot be performed at all.
10570    ///   + Neither `hGraph` nor `hGraphExec` may contain device-updatable kernel nodes.
10571    /// * Memset and memcpy nodes:
10572    ///
10573    ///   + The CUDA device(s) to which the operand(s) was allocated/mapped cannot change.
10574    ///   + The source/destination memory must be allocated from the same contexts as the original source/destination memory.
10575    ///   + For 2d memsets, only address and assigned value may be updated.
10576    ///   + 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.
10577    /// * Additional memcpy node restrictions:
10578    ///
10579    ///   + Changing either the source or destination memory type(i.e. CU_MEMORYTYPE_DEVICE, CU_MEMORYTYPE_ARRAY, etc.) is not supported.
10580    /// * Conditional nodes:
10581    ///
10582    ///   + Changing node parameters is not supported.
10583    ///   + Changing parameters of nodes within the conditional body graph is subject to the rules above.
10584    ///   + Conditional handle flags and default values are updated as part of the graph update.
10585    ///
10586    /// Note: The API may add further restrictions in future releases. The return code should always be checked.
10587    ///
10588    /// cudaGraphExecUpdate sets the result member of `resultInfo` to cudaGraphExecUpdateErrorTopologyChanged under the following conditions:
10589    ///
10590    /// * The count of nodes directly in `hGraphExec` and `hGraph` differ, in which case resultInfo->errorNode is set to NULL.
10591    /// * `hGraph` has more exit nodes than `hGraph`, in which case resultInfo->errorNode is set to one of the exit nodes in hGraph.
10592    /// * 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`.
10593    /// * 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.
10594    ///
10595    /// cudaGraphExecUpdate sets `the` result member of `resultInfo` to:
10596    ///
10597    /// * cudaGraphExecUpdateError if passed an invalid value.
10598    /// * cudaGraphExecUpdateErrorTopologyChanged if the graph topology changed
10599    /// * cudaGraphExecUpdateErrorNodeTypeChanged if the type of a node changed, in which case `hErrorNode_out` is set to the node from `hGraph`.
10600    /// * cudaGraphExecUpdateErrorFunctionChanged if the function of a kernel node changed (CUDA driver &lt; 11.2)
10601    /// * cudaGraphExecUpdateErrorUnsupportedFunctionChange if the func field of a kernel changed in an unsupported way(see note above), in which case `hErrorNode_out` is set to the node from `hGraph`
10602    /// * cudaGraphExecUpdateErrorParametersChanged 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`
10603    /// * cudaGraphExecUpdateErrorAttributesChanged 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`
10604    /// * cudaGraphExecUpdateErrorNotSupported 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`
10605    ///
10606    /// If the update fails for a reason not listed above, the result member of `resultInfo` will be set to cudaGraphExecUpdateError. If the update succeeds, the result member will be set to cudaGraphExecUpdateSuccess.
10607    ///
10608    /// cudaGraphExecUpdate returns cudaSuccess when the updated was performed successfully. It returns cudaErrorGraphExecUpdateFailure if the graph update was not performed because it included changes which violated constraints specific to instantiated graph update.
10609    ///
10610    /// Note: Graph objects are not threadsafe. More here.
10611    ///
10612    /// Note that this function may also return error codes from previous, asynchronous launches.
10613    ///
10614    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
10615    ///
10616    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
10617    ///
10618    /// # Parameters
10619    ///
10620    /// - `hGraphExec`: The instantiated graph to be updated.
10621    /// - `hGraph`: The graph containing the updated parameters.
10622    /// - `resultInfo`: the error info structure.
10623    ///
10624    /// # Return value
10625    ///
10626    /// - [`cudaError_t::CUDA_SUCCESS`]
10627    /// - [`cudaError_t::CUDA_ERROR_GRAPH_EXEC_UPDATE_FAILURE`]
10628    ///
10629    /// See also: [`cudaGraphInstantiate`].
10630    pub fn cudaGraphExecUpdate(
10631        hGraphExec: cudaGraphExec_t,
10632        hGraph: cudaGraph_t,
10633        resultInfo: *mut cudaGraphExecUpdateResultInfo,
10634    ) -> cudaError_t;
10635}
10636singe_loader::functions! { crate::RUNTIME;
10637    /// Uploads an executable graph in a stream.
10638    ///
10639    /// Uploads `graphExec` to the device in `stream` without executing it. Uploads of the same `graphExec` will be serialized. Each upload is ordered behind both any previous work in `stream` and any previous launches of `graphExec`. Uses memory cached by `stream` to back the allocations owned by `graphExec`.
10640    ///
10641    /// Note that this function may also return error codes from previous, asynchronous launches.
10642    ///
10643    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
10644    ///
10645    /// # Parameters
10646    ///
10647    /// - `graphExec`: Executable graph to upload.
10648    /// - `stream`: Stream in which to upload the graph.
10649    ///
10650    /// # Return value
10651    ///
10652    /// - [`cudaError_t::CUDA_SUCCESS`]
10653    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
10654    ///
10655    /// See also: [`cudaGraphInstantiate`], [`cudaGraphLaunch`], [`cudaGraphExecDestroy`].
10656    pub fn cudaGraphUpload(
10657        graphExec: cudaGraphExec_t,
10658        stream: cudaStream_t,
10659    ) -> cudaError_t;
10660}
10661singe_loader::functions! { crate::RUNTIME;
10662    /// Launches an executable graph in a stream.
10663    ///
10664    /// Executes `graphExec` in `stream`. Only one instance of `graphExec` may be executing at a time. Each launch is ordered behind both any previous work in `stream` and any previous launches of `graphExec`. To execute a graph concurrently, it must be instantiated multiple times into multiple executable graphs.
10665    ///
10666    /// If any allocations created by `graphExec` remain unfreed (from a previous launch) and `graphExec` was not instantiated with [cudaGraphInstantiateFlagAutoFreeOnLaunch](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga638577f2b0f6a98b5e6a0e6a72d09004a4258c8d3adc203f97e73e92810e1785f), the launch will fail with [`cudaError_t::CUDA_ERROR_INVALID_VALUE`].
10667    ///
10668    /// Note: Graph objects are not threadsafe. More here.
10669    ///
10670    /// Note that this function may also return error codes from previous, asynchronous launches.
10671    ///
10672    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
10673    ///
10674    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
10675    ///
10676    /// # Parameters
10677    ///
10678    /// - `graphExec`: Executable graph to launch.
10679    /// - `stream`: Stream in which to launch the graph.
10680    ///
10681    /// # Return value
10682    ///
10683    /// - [`cudaError_t::CUDA_SUCCESS`]
10684    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
10685    ///
10686    /// See also: [`cudaGraphInstantiate`], [`cudaGraphUpload`], [`cudaGraphExecDestroy`].
10687    pub fn cudaGraphLaunch(
10688        graphExec: cudaGraphExec_t,
10689        stream: cudaStream_t,
10690    ) -> cudaError_t;
10691}
10692singe_loader::functions! { crate::RUNTIME;
10693    /// Destroys an executable graph.
10694    ///
10695    /// Destroys the executable graph specified by `graphExec`.
10696    ///
10697    /// Note: Graph objects are not threadsafe. More here.
10698    ///
10699    /// Note that this function may also return error codes from previous, asynchronous launches.
10700    ///
10701    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
10702    ///
10703    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
10704    ///
10705    /// Note: Use of the handle after this call is undefined behavior.
10706    ///
10707    /// # Parameters
10708    ///
10709    /// - `graphExec`: Executable graph to destroy
10710    ///
10711    /// # Return value
10712    ///
10713    /// - [`cudaError_t::CUDA_SUCCESS`]
10714    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
10715    ///
10716    /// See also: [`cudaGraphInstantiate`], [`cudaGraphUpload`], [`cudaGraphLaunch`].
10717    pub fn cudaGraphExecDestroy(graphExec: cudaGraphExec_t) -> cudaError_t;
10718}
10719singe_loader::functions! { crate::RUNTIME;
10720    /// Destroys a graph.
10721    ///
10722    /// Destroys the graph specified by `graph`, as well as all of its nodes.
10723    ///
10724    /// Note: Graph objects are not threadsafe. More here.
10725    ///
10726    /// Note that this function may also return error codes from previous, asynchronous launches.
10727    ///
10728    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
10729    ///
10730    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
10731    ///
10732    /// Note: Use of the handle after this call is undefined behavior.
10733    ///
10734    /// # Parameters
10735    ///
10736    /// - `graph`: Graph to destroy
10737    ///
10738    /// # Return value
10739    ///
10740    /// - [`cudaError_t::CUDA_SUCCESS`]
10741    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
10742    ///
10743    /// See also: [`cudaGraphCreate`].
10744    pub fn cudaGraphDestroy(graph: cudaGraph_t) -> cudaError_t;
10745}
10746singe_loader::functions! { crate::RUNTIME;
10747    /// Write a DOT file describing graph structure.
10748    ///
10749    /// Using the provided `graph`, 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.
10750    ///
10751    /// # Parameters
10752    ///
10753    /// - `graph`: The graph to create a DOT file from.
10754    /// - `path`: The path to write the DOT file to.
10755    /// - `flags`: Flags from cudaGraphDebugDotFlags for specifying which additional node information to write.
10756    ///
10757    /// # Return value
10758    ///
10759    /// - [`cudaError_t::CUDA_SUCCESS`]
10760    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
10761    /// - [`cudaError_t::CUDA_ERROR_OPERATING_SYSTEM`]
10762    pub fn cudaGraphDebugDotPrint(
10763        graph: cudaGraph_t,
10764        path: *const ::core::ffi::c_char,
10765        flags: ::core::ffi::c_uint,
10766    ) -> cudaError_t;
10767}
10768singe_loader::functions! { crate::RUNTIME;
10769    /// Create a user object.
10770    ///
10771    /// Create a user object with the specified destructor callback and initial reference count. The initial references are owned by the caller.
10772    ///
10773    /// 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.
10774    ///
10775    /// See CUDA User Objects in the CUDA C++ Programming Guide for more information on user objects.
10776    ///
10777    /// # Parameters
10778    ///
10779    /// - `object_out`: Location to return the user object handle.
10780    /// - `ptr`: The pointer to pass to the destroy function.
10781    /// - `destroy`: Callback to free the user object when it is no longer in use.
10782    /// - `initialRefcount`: The initial refcount to create the object with, typically 1. The initial references are owned by the calling thread.
10783    /// - `flags`: Currently it is required to pass [cudaUserObjectNoDestructorSync](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ggaf4748f36762263564ca8a7a47fd902bbaca181af9d994c9a5290b509175ea99fe), 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.
10784    ///
10785    /// # Return value
10786    ///
10787    /// - [`cudaError_t::CUDA_SUCCESS`]
10788    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
10789    ///
10790    /// See also: [`cudaUserObjectRetain`], [`cudaUserObjectRelease`], [`cudaGraphRetainUserObject`], [`cudaGraphReleaseUserObject`], [`cudaGraphCreate`].
10791    pub fn cudaUserObjectCreate(
10792        object_out: *mut cudaUserObject_t,
10793        ptr: *mut ::core::ffi::c_void,
10794        destroy: cudaHostFn_t,
10795        initialRefcount: ::core::ffi::c_uint,
10796        flags: ::core::ffi::c_uint,
10797    ) -> cudaError_t;
10798}
10799singe_loader::functions! { crate::RUNTIME;
10800    /// Retain a reference to a user object.
10801    ///
10802    /// Retains new references to a user object. The new references are owned by the caller.
10803    ///
10804    /// See CUDA User Objects in the CUDA C++ Programming Guide for more information on user objects.
10805    ///
10806    /// # Parameters
10807    ///
10808    /// - `object`: The object to retain.
10809    /// - `count`: The number of references to retain, typically 1. Must be nonzero and not larger than INT_MAX.
10810    ///
10811    /// # Return value
10812    ///
10813    /// - [`cudaError_t::CUDA_SUCCESS`]
10814    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
10815    ///
10816    /// See also: [`cudaUserObjectCreate`], [`cudaUserObjectRelease`], [`cudaGraphRetainUserObject`], [`cudaGraphReleaseUserObject`], [`cudaGraphCreate`].
10817    pub fn cudaUserObjectRetain(
10818        object: cudaUserObject_t,
10819        count: ::core::ffi::c_uint,
10820    ) -> cudaError_t;
10821}
10822singe_loader::functions! { crate::RUNTIME;
10823    /// Release a reference to a user object.
10824    ///
10825    /// Releases user object references owned by the caller. The object’s destructor is invoked if the reference count reaches zero.
10826    ///
10827    /// It is undefined behavior to release references not owned by the caller, or to use a user object handle after all references are released.
10828    ///
10829    /// See CUDA User Objects in the CUDA C++ Programming Guide for more information on user objects.
10830    ///
10831    /// # Parameters
10832    ///
10833    /// - `object`: The object to release.
10834    /// - `count`: The number of references to release, typically 1. Must be nonzero and not larger than INT_MAX.
10835    ///
10836    /// # Return value
10837    ///
10838    /// - [`cudaError_t::CUDA_SUCCESS`]
10839    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
10840    ///
10841    /// See also: [`cudaUserObjectCreate`], [`cudaUserObjectRetain`], [`cudaGraphRetainUserObject`], [`cudaGraphReleaseUserObject`], [`cudaGraphCreate`].
10842    pub fn cudaUserObjectRelease(
10843        object: cudaUserObject_t,
10844        count: ::core::ffi::c_uint,
10845    ) -> cudaError_t;
10846}
10847singe_loader::functions! { crate::RUNTIME;
10848    /// Retain a reference to a user object from a graph.
10849    ///
10850    /// Creates or moves user object references that will be owned by a CUDA graph.
10851    ///
10852    /// See CUDA User Objects in the CUDA C++ Programming Guide for more information on user objects.
10853    ///
10854    /// # Parameters
10855    ///
10856    /// - `graph`: The graph to associate the reference with.
10857    /// - `object`: The user object to retain a reference for.
10858    /// - `count`: The number of references to add to the graph, typically 1. Must be nonzero and not larger than INT_MAX.
10859    /// - `flags`: The optional flag [cudaGraphUserObjectMove](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ggae53f516fc65103fccb14c83184188157a96b13064f28cdb8932c782b94ab5802f) transfers references from the calling thread, rather than create new references. Pass 0 to create new references.
10860    ///
10861    /// # Return value
10862    ///
10863    /// - [`cudaError_t::CUDA_SUCCESS`]
10864    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
10865    ///
10866    /// See also: [`cudaUserObjectCreate`], [`cudaUserObjectRetain`], [`cudaUserObjectRelease`], [`cudaGraphReleaseUserObject`], [`cudaGraphCreate`].
10867    pub fn cudaGraphRetainUserObject(
10868        graph: cudaGraph_t,
10869        object: cudaUserObject_t,
10870        count: ::core::ffi::c_uint,
10871        flags: ::core::ffi::c_uint,
10872    ) -> cudaError_t;
10873}
10874singe_loader::functions! { crate::RUNTIME;
10875    /// Release a user object reference from a graph.
10876    ///
10877    /// Releases user object references owned by a graph.
10878    ///
10879    /// See CUDA User Objects in the CUDA C++ Programming Guide for more information on user objects.
10880    ///
10881    /// # Parameters
10882    ///
10883    /// - `graph`: The graph that will release the reference.
10884    /// - `object`: The user object to release a reference for.
10885    /// - `count`: The number of references to release, typically 1. Must be nonzero and not larger than INT_MAX.
10886    ///
10887    /// # Return value
10888    ///
10889    /// - [`cudaError_t::CUDA_SUCCESS`]
10890    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
10891    ///
10892    /// See also: [`cudaUserObjectCreate`], [`cudaUserObjectRetain`], [`cudaUserObjectRelease`], [`cudaGraphRetainUserObject`], [`cudaGraphCreate`].
10893    pub fn cudaGraphReleaseUserObject(
10894        graph: cudaGraph_t,
10895        object: cudaUserObject_t,
10896        count: ::core::ffi::c_uint,
10897    ) -> cudaError_t;
10898}
10899singe_loader::functions! { crate::RUNTIME;
10900    /// Adds a node of arbitrary type to a graph.
10901    ///
10902    /// Creates a new node in `graph` described by `nodeParams` with `numDependencies` dependencies specified via `pDependencies`. `numDependencies` may be 0. `pDependencies` may be null if `numDependencies` is 0. `pDependencies` may not have any duplicate entries.
10903    ///
10904    /// `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.
10905    ///
10906    /// Note that for some node types, `nodeParams` may contain “out parameters” which are modified during the call, such as `nodeParams->alloc.dptr`.
10907    ///
10908    /// A handle to the new node will be returned in `phGraphNode`.
10909    ///
10910    /// Note: Graph objects are not threadsafe. More here.
10911    ///
10912    /// Note that this function may also return error codes from previous, asynchronous launches.
10913    ///
10914    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
10915    ///
10916    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
10917    ///
10918    /// # Parameters
10919    ///
10920    /// - `pGraphNode`: Returns newly created node.
10921    /// - `graph`: Graph to which to add the node.
10922    /// - `pDependencies`: Dependencies of the node.
10923    /// - `dependencyData`: Optional edge data for the dependencies. If NULL, the data is assumed to be default (zeroed) for all dependencies.
10924    /// - `numDependencies`: Number of dependencies.
10925    /// - `nodeParams`: Specification of the node.
10926    ///
10927    /// # Return value
10928    ///
10929    /// - [`cudaError_t::CUDA_SUCCESS`]
10930    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
10931    /// - [`cudaErrorInvalidDeviceFunction`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ab6af535e7e53d3f21e2437e8977b8c2e)
10932    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
10933    ///
10934    /// See also: [`cudaGraphCreate`], [`cudaGraphNodeSetParams`], [`cudaGraphExecNodeSetParams`].
10935    pub fn cudaGraphAddNode(
10936        pGraphNode: *mut cudaGraphNode_t,
10937        graph: cudaGraph_t,
10938        pDependencies: *const cudaGraphNode_t,
10939        dependencyData: *const cudaGraphEdgeData,
10940        numDependencies: size_t,
10941        nodeParams: *mut cudaGraphNodeParams,
10942    ) -> cudaError_t;
10943}
10944singe_loader::functions! { crate::RUNTIME;
10945    /// Update a graph node’s parameters.
10946    ///
10947    /// Sets the parameters of graph node `node` to `nodeParams`. The node type specified by `nodeParams->type` must match the type of `node`. `nodeParams` must be fully initialized and all unused bytes (reserved, padding) zeroed.
10948    ///
10949    /// Modifying parameters is not supported for node types cudaGraphNodeTypeMemAlloc and cudaGraphNodeTypeMemFree.
10950    ///
10951    /// Note: Graph objects are not threadsafe. More here.
10952    ///
10953    /// Note that this function may also return error codes from previous, asynchronous launches.
10954    ///
10955    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
10956    ///
10957    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
10958    ///
10959    /// # Parameters
10960    ///
10961    /// - `node`: Node to set the parameters for.
10962    /// - `nodeParams`: Parameters to copy.
10963    ///
10964    /// # Return value
10965    ///
10966    /// - [`cudaError_t::CUDA_SUCCESS`]
10967    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
10968    /// - [`cudaErrorInvalidDeviceFunction`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ab6af535e7e53d3f21e2437e8977b8c2e)
10969    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
10970    ///
10971    /// See also: [`cudaGraphNodeGetParams`], [`cudaGraphAddNode`], [`cudaGraphExecNodeSetParams`].
10972    pub fn cudaGraphNodeSetParams(
10973        node: cudaGraphNode_t,
10974        nodeParams: *mut cudaGraphNodeParams,
10975    ) -> cudaError_t;
10976}
10977singe_loader::functions! { crate::RUNTIME;
10978    /// Returns a graph node’s parameters.
10979    ///
10980    /// Returns the parameters of graph node `node` in `*nodeParams`.
10981    ///
10982    /// 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.
10983    ///
10984    /// 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.
10985    ///
10986    /// Note: Graph objects are not threadsafe. More here.
10987    ///
10988    /// Note that this function may also return error codes from previous, asynchronous launches.
10989    ///
10990    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
10991    ///
10992    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
10993    ///
10994    /// # Parameters
10995    ///
10996    /// - `node`: Node to get the parameters for.
10997    /// - `nodeParams`: Pointer to return the parameters.
10998    ///
10999    /// # Return value
11000    ///
11001    /// - [`cudaError_t::CUDA_SUCCESS`]
11002    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
11003    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
11004    ///
11005    /// See also: [`cudaGraphNodeSetParams`], [`cudaGraphAddNode`], [`cudaGraphExecNodeSetParams`].
11006    pub fn cudaGraphNodeGetParams(
11007        node: cudaGraphNode_t,
11008        nodeParams: *mut cudaGraphNodeParams,
11009    ) -> cudaError_t;
11010}
11011singe_loader::functions! { crate::RUNTIME;
11012    /// Update a graph node’s parameters in an instantiated graph.
11013    ///
11014    /// Sets the parameters of a node in an executable graph `graphExec`. The node is identified by the corresponding node `node` in the non-executable graph from which the executable graph was instantiated. `node` must not have been removed from the original graph.
11015    ///
11016    /// The modifications only affect future launches of `graphExec`. Already enqueued or running launches of `graphExec` are not affected by this call. `node` is also not modified by this call.
11017    ///
11018    /// Allowed changes to parameters on executable graphs are as follows:
11019    ///
11020    /// | Node type | Allowed changes |
11021    /// | --- | --- |
11022    /// | kernel | See [`cudaGraphExecKernelNodeSetParams`] |
11023    /// | memcpy | Addresses for 1-dimensional copies if allocated in same context; see [`cudaGraphExecMemcpyNodeSetParams`] |
11024    /// | memset | Addresses for 1-dimensional memsets if allocated in same context; see [`cudaGraphExecMemsetNodeSetParams`] |
11025    /// | host | Unrestricted |
11026    /// | child graph | Topology must match and restrictions apply recursively; see [`cudaGraphExecUpdate`] |
11027    /// | event wait | Unrestricted |
11028    /// | event record | Unrestricted |
11029    /// | external semaphore signal | Number of semaphore operations cannot change |
11030    /// | external semaphore wait | Number of semaphore operations cannot change |
11031    /// | memory allocation | API unsupported |
11032    /// | memory free | API unsupported |
11033    ///
11034    /// Note: Graph objects are not threadsafe. More here.
11035    ///
11036    /// Note that this function may also return error codes from previous, asynchronous launches.
11037    ///
11038    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
11039    ///
11040    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
11041    ///
11042    /// # Parameters
11043    ///
11044    /// - `graphExec`: The executable graph in which to update the specified node.
11045    /// - `node`: Corresponding node from the graph from which graphExec was instantiated.
11046    /// - `nodeParams`: Updated Parameters to set.
11047    ///
11048    /// # Return value
11049    ///
11050    /// - [`cudaError_t::CUDA_SUCCESS`]
11051    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
11052    /// - [`cudaErrorInvalidDeviceFunction`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ab6af535e7e53d3f21e2437e8977b8c2e)
11053    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
11054    ///
11055    /// See also: [`cudaGraphAddNode`], [`cudaGraphNodeSetParams`], [`cudaGraphExecUpdate`], [`cudaGraphInstantiate`].
11056    pub fn cudaGraphExecNodeSetParams(
11057        graphExec: cudaGraphExec_t,
11058        node: cudaGraphNode_t,
11059        nodeParams: *mut cudaGraphNodeParams,
11060    ) -> cudaError_t;
11061}
11062singe_loader::functions! { crate::RUNTIME;
11063    /// Create a conditional handle.
11064    ///
11065    /// Creates a conditional handle associated with `hGraph`.
11066    ///
11067    /// The conditional handle must be associated with a conditional node in this graph or one of its children.
11068    ///
11069    /// Handles not associated with a conditional node may cause graph instantiation to fail.
11070    ///
11071    /// Note: Graph objects are not threadsafe. More here.
11072    ///
11073    /// Note that this function may also return error codes from previous, asynchronous launches.
11074    ///
11075    /// # Parameters
11076    ///
11077    /// - `pHandle_out`: Pointer used to return the handle to the caller.
11078    /// - `graph`: Graph which will contain the conditional node using this handle.
11079    /// - `defaultLaunchValue`: Optional initial value for the conditional variable. Applied at the beginning of each graph execution if cudaGraphCondAssignDefault is set in `flags`.
11080    /// - `flags`: Currently must be cudaGraphCondAssignDefault or 0.
11081    ///
11082    /// # Return value
11083    ///
11084    /// CUDA_SUCCESS, [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`](crate::driver::cudaError_enum::CUDA_ERROR_INVALID_VALUE), [`cudaError_enum::CUDA_ERROR_NOT_SUPPORTED`](crate::driver::cudaError_enum::CUDA_ERROR_NOT_SUPPORTED).
11085    ///
11086    /// See also: [`cuGraphAddNode`](crate::driver::cuGraphAddNode).
11087    pub fn cudaGraphConditionalHandleCreate(
11088        pHandle_out: *mut cudaGraphConditionalHandle,
11089        graph: cudaGraph_t,
11090        defaultLaunchValue: ::core::ffi::c_uint,
11091        flags: ::core::ffi::c_uint,
11092    ) -> cudaError_t;
11093}
11094singe_loader::functions! { crate::RUNTIME;
11095    /// Create a conditional handle.
11096    ///
11097    /// Creates a conditional handle associated with `hGraph`.
11098    ///
11099    /// The conditional handle must be associated with a conditional node in this graph or one of its children.
11100    ///
11101    /// Handles not associated with a conditional node may cause graph instantiation to fail.
11102    ///
11103    /// Note: Graph objects are not threadsafe. More here.
11104    ///
11105    /// Note that this function may also return error codes from previous, asynchronous launches.
11106    ///
11107    /// # Parameters
11108    ///
11109    /// - `pHandle_out`: Pointer used to return the handle to the caller.
11110    /// - `graph`: Graph which will contain the conditional node using this handle.
11111    /// - `ctx`: Execution context for the handle and associated conditional node. If NULL, current context will be used.
11112    /// - `defaultLaunchValue`: Optional initial value for the conditional variable. Applied at the beginning of each graph execution if cudaGraphCondAssignDefault is set in `flags`.
11113    /// - `flags`: Currently must be cudaGraphCondAssignDefault or 0.
11114    ///
11115    /// # Return value
11116    ///
11117    /// CUDA_SUCCESS, [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`](crate::driver::cudaError_enum::CUDA_ERROR_INVALID_VALUE), [`cudaError_enum::CUDA_ERROR_NOT_SUPPORTED`](crate::driver::cudaError_enum::CUDA_ERROR_NOT_SUPPORTED).
11118    ///
11119    /// See also: [`cuGraphAddNode`](crate::driver::cuGraphAddNode).
11120    pub fn cudaGraphConditionalHandleCreate_v2(
11121        pHandle_out: *mut cudaGraphConditionalHandle,
11122        graph: cudaGraph_t,
11123        ctx: cudaExecutionContext_t,
11124        defaultLaunchValue: ::core::ffi::c_uint,
11125        flags: ::core::ffi::c_uint,
11126    ) -> cudaError_t;
11127}
11128singe_loader::functions! { crate::RUNTIME;
11129    /// Returns the requested driver API function pointer.
11130    ///
11131    /// Returns in `**funcPtr` the address of the CUDA driver function for the requested flags.
11132    ///
11133    /// For a requested driver symbol, if the CUDA version in which the driver symbol was introduced is less than or equal to the CUDA runtime version, the API will return the function pointer to the corresponding versioned driver function.
11134    ///
11135    /// 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.
11136    ///
11137    /// The API will return [`cudaError_t::CUDA_SUCCESS`] and set the returned `funcPtr` if the requested driver function is valid and supported on the platform.
11138    ///
11139    /// The API will return [`cudaError_t::CUDA_SUCCESS`] and set the returned `funcPtr` to NULL if the requested driver function is not supported on the platform, no ABI compatible driver function exists for the CUDA runtime version or if the driver symbol is invalid.
11140    ///
11141    /// It will also set the optional `driverStatus` to one of the values in [`cudaDriverEntryPointQueryResult`] with the following meanings:
11142    ///
11143    /// * [`cudaDriverEntryPointQueryResult::CU_GET_PROC_ADDRESS_SUCCESS`] - The requested symbol was succesfully found based on input arguments and `pfn` is valid
11144    /// * [`cudaDriverEntryPointQueryResult::CU_GET_PROC_ADDRESS_SYMBOL_NOT_FOUND`] - The requested symbol was not found
11145    /// * [`cudaDriverEntryPointQueryResult::CU_GET_PROC_ADDRESS_VERSION_NOT_SUFFICIENT`] - The requested symbol was found but is not supported by the current runtime version (CUDART_VERSION)
11146    ///
11147    /// The requested flags can be:
11148    ///
11149    /// * [cudaEnableDefault](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ggaf2f2b7ea8f2f705095200807ac5dfd61aa9c0bcf076678d03418b7922a39bb1d5): This is the default mode. This is equivalent to [cudaEnablePerThreadDefaultStream](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ggaf2f2b7ea8f2f705095200807ac5dfd61a1bd1da9af3fbaa465a199706ef94328f) if the code is compiled with —default-stream per-thread compilation flag or the macro CUDA_API_PER_THREAD_DEFAULT_STREAM is defined; [cudaEnableLegacyStream](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ggaf2f2b7ea8f2f705095200807ac5dfd61ae37885317cc9edcece9b5069b1494e1b) otherwise.
11150    /// * [cudaEnableLegacyStream](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ggaf2f2b7ea8f2f705095200807ac5dfd61ae37885317cc9edcece9b5069b1494e1b): This will enable the search for all driver symbols that match the requested driver symbol name except the corresponding per-thread versions.
11151    /// * [cudaEnablePerThreadDefaultStream](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ggaf2f2b7ea8f2f705095200807ac5dfd61a1bd1da9af3fbaa465a199706ef94328f): 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.
11152    ///
11153    /// Deprecated: This function is deprecated as of CUDA 13.0.
11154    ///
11155    /// Note: This API is deprecated and [`cudaGetDriverEntryPointByVersion`] (with a hardcoded `cudaVersion`) should be used instead.
11156    ///
11157    /// Note: Version mixing among CUDA-defined types and driver API versions is strongly discouraged and doing so can result in an undefined behavior. See Rules for version mixing.
11158    ///
11159    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
11160    ///
11161    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
11162    ///
11163    /// # Parameters
11164    ///
11165    /// - `symbol`: The base name of the driver API function to look for. As an example, for the driver API [`cuMemAlloc_v2`](crate::driver::cuMemAlloc_v2), `symbol` would be cuMemAlloc. Note that the API will use the CUDA runtime version to return the address to the most recent ABI compatible driver symbol, [`cuMemAlloc`](crate::driver::cuMemAlloc) or [`cuMemAlloc_v2`](crate::driver::cuMemAlloc_v2).
11166    /// - `funcPtr`: Location to return the function pointer to the requested driver function.
11167    /// - `flags`: Flags to specify search options.
11168    /// - `driverStatus`: Optional location to store the status of finding the symbol from the driver. See [`cudaDriverEntryPointQueryResult`] for possible values.
11169    ///
11170    /// # Return value
11171    ///
11172    /// - [`cudaError_t::CUDA_SUCCESS`]
11173    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
11174    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
11175    ///
11176    /// See also: [`cuGetProcAddress`](crate::driver::cuGetProcAddress).
11177    #[deprecated]
11178    pub fn cudaGetDriverEntryPoint(
11179        symbol: *const ::core::ffi::c_char,
11180        funcPtr: *mut *mut ::core::ffi::c_void,
11181        flags: ::core::ffi::c_ulonglong,
11182        driverStatus: *mut cudaDriverEntryPointQueryResult,
11183    ) -> cudaError_t;
11184}
11185singe_loader::functions! { crate::RUNTIME;
11186    /// Returns the requested driver API function pointer by CUDA version.
11187    ///
11188    /// Returns in `**funcPtr` the address of the CUDA driver function for the requested flags and CUDA driver version.
11189    ///
11190    /// 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_t::CUDA_ERROR_INVALID_VALUE`].
11191    ///
11192    /// 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.
11193    ///
11194    /// For the case where the CUDA version requested is greater than the CUDA Toolkit installed, there may not be an appropriate function pointer typedef in the corresponding header file and may need a custom typedef to match the driver function signature returned. This can be done by getting the typedefs from a later toolkit or creating appropriately matching custom function typedefs.
11195    ///
11196    /// The API will return [`cudaError_t::CUDA_SUCCESS`] and set the returned `funcPtr` if the requested driver function is valid and supported on the platform.
11197    ///
11198    /// The API will return [`cudaError_t::CUDA_SUCCESS`] and set the returned `funcPtr` to NULL if the requested driver function is not supported on the platform, no ABI compatible driver function exists for the requested version or if the driver symbol is invalid.
11199    ///
11200    /// It will also set the optional `driverStatus` to one of the values in [`cudaDriverEntryPointQueryResult`] with the following meanings:
11201    ///
11202    /// * [`cudaDriverEntryPointQueryResult::CU_GET_PROC_ADDRESS_SUCCESS`] - The requested symbol was succesfully found based on input arguments and `pfn` is valid
11203    /// * [`cudaDriverEntryPointQueryResult::CU_GET_PROC_ADDRESS_SYMBOL_NOT_FOUND`] - The requested symbol was not found
11204    /// * [`cudaDriverEntryPointQueryResult::CU_GET_PROC_ADDRESS_VERSION_NOT_SUFFICIENT`] - The requested symbol was found but is not supported by the specified version `cudaVersion`
11205    ///
11206    /// The requested flags can be:
11207    ///
11208    /// * [cudaEnableDefault](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ggaf2f2b7ea8f2f705095200807ac5dfd61aa9c0bcf076678d03418b7922a39bb1d5): This is the default mode. This is equivalent to [cudaEnablePerThreadDefaultStream](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ggaf2f2b7ea8f2f705095200807ac5dfd61a1bd1da9af3fbaa465a199706ef94328f) if the code is compiled with —default-stream per-thread compilation flag or the macro CUDA_API_PER_THREAD_DEFAULT_STREAM is defined; [cudaEnableLegacyStream](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ggaf2f2b7ea8f2f705095200807ac5dfd61ae37885317cc9edcece9b5069b1494e1b) otherwise.
11209    /// * [cudaEnableLegacyStream](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ggaf2f2b7ea8f2f705095200807ac5dfd61ae37885317cc9edcece9b5069b1494e1b): This will enable the search for all driver symbols that match the requested driver symbol name except the corresponding per-thread versions.
11210    /// * [cudaEnablePerThreadDefaultStream](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ggaf2f2b7ea8f2f705095200807ac5dfd61a1bd1da9af3fbaa465a199706ef94328f): 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.
11211    ///
11212    /// Note: Version mixing among CUDA-defined types and driver API versions is strongly discouraged and doing so can result in an undefined behavior. See Rules for version mixing.
11213    ///
11214    /// Note that this function may also return [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`], [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af5e52d1774934b77ba55d2aa2c063067) or [`cudaError_t::CUDA_ERROR_NO_DEVICE`] if this call tries to initialize internal CUDA RT state.
11215    ///
11216    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
11217    ///
11218    /// # Parameters
11219    ///
11220    /// - `symbol`: The base name of the driver API function to look for. As an example, for the driver API [`cuMemAlloc_v2`](crate::driver::cuMemAlloc_v2), `symbol` would be cuMemAlloc.
11221    /// - `funcPtr`: Location to return the function pointer to the requested driver function.
11222    /// - `cudaVersion`: The CUDA version to look for the requested driver symbol.
11223    /// - `flags`: Flags to specify search options.
11224    /// - `driverStatus`: Optional location to store the status of finding the symbol from the driver. See [`cudaDriverEntryPointQueryResult`] for possible values.
11225    ///
11226    /// # Return value
11227    ///
11228    /// - [`cudaError_t::CUDA_SUCCESS`]
11229    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
11230    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
11231    ///
11232    /// See also: [`cuGetProcAddress`](crate::driver::cuGetProcAddress).
11233    pub fn cudaGetDriverEntryPointByVersion(
11234        symbol: *const ::core::ffi::c_char,
11235        funcPtr: *mut *mut ::core::ffi::c_void,
11236        cudaVersion: ::core::ffi::c_uint,
11237        flags: ::core::ffi::c_ulonglong,
11238        driverStatus: *mut cudaDriverEntryPointQueryResult,
11239    ) -> cudaError_t;
11240}
11241singe_loader::functions! { crate::RUNTIME;
11242    /// Load a library with specified code and options.
11243    ///
11244    /// Takes a pointer `code` and loads the corresponding library `library` based on the application defined library loading mode:
11245    ///
11246    /// * 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 [`cudaLibraryUnload`].
11247    /// * 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.
11248    ///
11249    /// These environment variables are described in the CUDA programming guide under the “CUDA environment variables” section.
11250    ///
11251    /// 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. Please also see the documentation for nvrtc (<https://docs.nvidia.com/cuda/nvrtc/index.html>), nvjitlink (<https://docs.nvidia.com/cuda/nvjitlink/index.html>), and nvfatbin (<https://docs.nvidia.com/cuda/nvfatbin/index.html>) for more information on generating loadable code at runtime.
11252    ///
11253    /// 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`.
11254    ///
11255    /// 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`.
11256    ///
11257    /// # Parameters
11258    ///
11259    /// - `library`: Returned library.
11260    /// - `code`: Code to load.
11261    /// - `jitOptions`: Options for JIT.
11262    /// - `jitOptionsValues`: Option values for JIT.
11263    /// - `numJitOptions`: Number of options.
11264    /// - `libraryOptions`: Options for loading.
11265    /// - `libraryOptionValues`: Option values for loading.
11266    /// - `numLibraryOptions`: Number of options for loading.
11267    ///
11268    /// # Return value
11269    ///
11270    /// - [`cudaError_t::CUDA_SUCCESS`]
11271    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
11272    /// - [`cudaError_t::CUDA_ERROR_OUT_OF_MEMORY`]
11273    /// - [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`]
11274    /// - [`cudaError_t::CUDA_ERROR_DEINITIALIZED`]
11275    /// - [`cudaError_t::CUDA_ERROR_INVALID_PTX`]
11276    /// - [`cudaError_t::CUDA_ERROR_UNSUPPORTED_PTX_VERSION`]
11277    /// - [`cudaError_t::CUDA_ERROR_NO_BINARY_FOR_GPU`]
11278    /// - [`cudaError_t::CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND`]
11279    /// - [`cudaError_t::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED`]
11280    /// - [`cudaError_t::CUDA_ERROR_JIT_COMPILER_NOT_FOUND`]
11281    ///
11282    /// See also: [`cudaLibraryLoadFromFile`], [`cudaLibraryUnload`], [`cuLibraryLoadData`](crate::driver::cuLibraryLoadData).
11283    pub fn cudaLibraryLoadData(
11284        library: *mut cudaLibrary_t,
11285        code: *const ::core::ffi::c_void,
11286        jitOptions: *mut cudaJitOption,
11287        jitOptionsValues: *mut *mut ::core::ffi::c_void,
11288        numJitOptions: ::core::ffi::c_uint,
11289        libraryOptions: *mut cudaLibraryOption,
11290        libraryOptionValues: *mut *mut ::core::ffi::c_void,
11291        numLibraryOptions: ::core::ffi::c_uint,
11292    ) -> cudaError_t;
11293}
11294singe_loader::functions! { crate::RUNTIME;
11295    /// Load a library with specified file and options.
11296    ///
11297    /// Takes a pointer `code` and loads the corresponding library `library` based on the application defined library loading mode:
11298    ///
11299    /// * 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 [`cudaLibraryUnload`].
11300    /// * 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.
11301    ///
11302    /// These environment variables are described in the CUDA programming guide under the “CUDA environment variables” section.
11303    ///
11304    /// 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. Please also see the documentation for nvrtc (<https://docs.nvidia.com/cuda/nvrtc/index.html>), nvjitlink (<https://docs.nvidia.com/cuda/nvjitlink/index.html>), and nvfatbin (<https://docs.nvidia.com/cuda/nvfatbin/index.html>) for more information on generating loadable code at runtime.
11305    ///
11306    /// 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`.
11307    ///
11308    /// 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`.
11309    ///
11310    /// # Parameters
11311    ///
11312    /// - `library`: Returned library.
11313    /// - `fileName`: File to load from.
11314    /// - `jitOptions`: Options for JIT.
11315    /// - `jitOptionsValues`: Option values for JIT.
11316    /// - `numJitOptions`: Number of options.
11317    /// - `libraryOptions`: Options for loading.
11318    /// - `libraryOptionValues`: Option values for loading.
11319    /// - `numLibraryOptions`: Number of options for loading.
11320    ///
11321    /// # Return value
11322    ///
11323    /// - [`cudaError_t::CUDA_SUCCESS`]
11324    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
11325    /// - [`cudaError_t::CUDA_ERROR_OUT_OF_MEMORY`]
11326    /// - [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`]
11327    /// - [`cudaError_t::CUDA_ERROR_DEINITIALIZED`]
11328    /// - [`cudaError_t::CUDA_ERROR_INVALID_PTX`]
11329    /// - [`cudaError_t::CUDA_ERROR_UNSUPPORTED_PTX_VERSION`]
11330    /// - [`cudaError_t::CUDA_ERROR_NO_BINARY_FOR_GPU`]
11331    /// - [`cudaError_t::CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND`]
11332    /// - [`cudaError_t::CUDA_ERROR_SHARED_OBJECT_INIT_FAILED`]
11333    /// - [`cudaError_t::CUDA_ERROR_JIT_COMPILER_NOT_FOUND`]
11334    ///
11335    /// See also: [`cudaLibraryLoadData`], [`cudaLibraryUnload`], [`cuLibraryLoadFromFile`](crate::driver::cuLibraryLoadFromFile).
11336    pub fn cudaLibraryLoadFromFile(
11337        library: *mut cudaLibrary_t,
11338        fileName: *const ::core::ffi::c_char,
11339        jitOptions: *mut cudaJitOption,
11340        jitOptionsValues: *mut *mut ::core::ffi::c_void,
11341        numJitOptions: ::core::ffi::c_uint,
11342        libraryOptions: *mut cudaLibraryOption,
11343        libraryOptionValues: *mut *mut ::core::ffi::c_void,
11344        numLibraryOptions: ::core::ffi::c_uint,
11345    ) -> cudaError_t;
11346}
11347singe_loader::functions! { crate::RUNTIME;
11348    /// Unloads a library.
11349    ///
11350    /// Unloads the library specified with `library`.
11351    ///
11352    /// # Parameters
11353    ///
11354    /// - `library`: Library to unload
11355    ///
11356    /// # Return value
11357    ///
11358    /// - [`cudaError_t::CUDA_SUCCESS`]
11359    /// - [`cudaError_t::CUDA_ERROR_DEINITIALIZED`]
11360    /// - [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`]
11361    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
11362    ///
11363    /// See also: [`cudaLibraryLoadData`], [`cudaLibraryLoadFromFile`], [`cuLibraryUnload`](crate::driver::cuLibraryUnload).
11364    pub fn cudaLibraryUnload(library: cudaLibrary_t) -> cudaError_t;
11365}
11366singe_loader::functions! { crate::RUNTIME;
11367    /// Returns a kernel handle.
11368    ///
11369    /// 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_t::CUDA_ERROR_NOT_FOUND`].
11370    ///
11371    /// # Parameters
11372    ///
11373    /// - `pKernel`: Returned kernel handle.
11374    /// - `library`: Library to retrieve kernel from.
11375    /// - `name`: Name of kernel to retrieve.
11376    ///
11377    /// # Return value
11378    ///
11379    /// - [`cudaError_t::CUDA_SUCCESS`]
11380    /// - [`cudaError_t::CUDA_ERROR_DEINITIALIZED`]
11381    /// - [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`]
11382    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
11383    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
11384    /// - [`cudaError_t::CUDA_ERROR_NOT_FOUND`]
11385    ///
11386    /// See also: [`cudaLibraryLoadData`], [`cudaLibraryLoadFromFile`], [`cudaLibraryUnload`], [`cuLibraryGetKernel`](crate::driver::cuLibraryGetKernel).
11387    pub fn cudaLibraryGetKernel(
11388        pKernel: *mut cudaKernel_t,
11389        library: cudaLibrary_t,
11390        name: *const ::core::ffi::c_char,
11391    ) -> cudaError_t;
11392}
11393singe_loader::functions! { crate::RUNTIME;
11394    /// Returns a global device pointer.
11395    ///
11396    /// Returns in `*dptr` and `*bytes` the base pointer and size of the global with name `name` for the requested library `library` and the current device. If no global for the requested name `name` exists, the call returns [`cudaError_t::CUDA_ERROR_NOT_FOUND`]. One of the parameters `dptr` or `bytes` (not both) can be NULL in which case it is ignored. The returned `dptr` cannot be passed to the Symbol APIs such as [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaGetSymbolAddress`], or [`cudaGetSymbolSize`].
11397    ///
11398    /// # Parameters
11399    ///
11400    /// - `dptr`: Returned global device pointer for the requested library.
11401    /// - `bytes`: Returned global size in bytes.
11402    /// - `library`: Library to retrieve global from.
11403    /// - `name`: Name of global to retrieve.
11404    ///
11405    /// # Return value
11406    ///
11407    /// - [`cudaError_t::CUDA_SUCCESS`]
11408    /// - [`cudaError_t::CUDA_ERROR_DEINITIALIZED`]
11409    /// - [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`]
11410    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
11411    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
11412    /// - [`cudaError_t::CUDA_ERROR_NOT_FOUND`]
11413    /// - [`cudaError_t::CUDA_ERROR_INVALID_CONTEXT`]
11414    /// - [`cudaError_t::CUDA_ERROR_CONTEXT_IS_DESTROYED`]
11415    ///
11416    /// See also: [`cudaLibraryLoadData`], [`cudaLibraryLoadFromFile`], [`cudaLibraryUnload`], [`cudaLibraryGetManaged`], [`cuLibraryGetGlobal`](crate::driver::cuLibraryGetGlobal).
11417    pub fn cudaLibraryGetGlobal(
11418        dptr: *mut *mut ::core::ffi::c_void,
11419        bytes: *mut size_t,
11420        library: cudaLibrary_t,
11421        name: *const ::core::ffi::c_char,
11422    ) -> cudaError_t;
11423}
11424singe_loader::functions! { crate::RUNTIME;
11425    /// Returns a pointer to managed memory.
11426    ///
11427    /// 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_t::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. The returned `dptr` cannot be passed to the Symbol APIs such as [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaGetSymbolAddress`], or [`cudaGetSymbolSize`].
11428    ///
11429    /// # Parameters
11430    ///
11431    /// - `dptr`: Returned pointer to the managed memory.
11432    /// - `bytes`: Returned memory size in bytes.
11433    /// - `library`: Library to retrieve managed memory from.
11434    /// - `name`: Name of managed memory to retrieve.
11435    ///
11436    /// # Return value
11437    ///
11438    /// - [`cudaError_t::CUDA_SUCCESS`]
11439    /// - [`cudaError_t::CUDA_ERROR_DEINITIALIZED`]
11440    /// - [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`]
11441    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
11442    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
11443    /// - [`cudaError_t::CUDA_ERROR_NOT_FOUND`]
11444    ///
11445    /// See also: [`cudaLibraryLoadData`], [`cudaLibraryLoadFromFile`], [`cudaLibraryUnload`], [`cudaLibraryGetGlobal`], [`cuLibraryGetManaged`](crate::driver::cuLibraryGetManaged).
11446    pub fn cudaLibraryGetManaged(
11447        dptr: *mut *mut ::core::ffi::c_void,
11448        bytes: *mut size_t,
11449        library: cudaLibrary_t,
11450        name: *const ::core::ffi::c_char,
11451    ) -> cudaError_t;
11452}
11453singe_loader::functions! { crate::RUNTIME;
11454    /// Returns a pointer to a unified function.
11455    ///
11456    /// 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_t::CUDA_ERROR_NOT_FOUND`]. If there is no device with attribute [`cudaDeviceProp::unifiedFunctionPointers`](cudaDeviceProp::unifiedFunctionPointers) present in the system, the call may return [`cudaError_t::CUDA_ERROR_NOT_FOUND`].
11457    ///
11458    /// # Parameters
11459    ///
11460    /// - `fptr`: Returned pointer to a unified function.
11461    /// - `library`: Library to retrieve function pointer memory from.
11462    /// - `symbol`: Name of function pointer to retrieve.
11463    ///
11464    /// # Return value
11465    ///
11466    /// - [`cudaError_t::CUDA_SUCCESS`]
11467    /// - [`cudaError_t::CUDA_ERROR_DEINITIALIZED`]
11468    /// - [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`]
11469    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
11470    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
11471    /// - [`cudaError_t::CUDA_ERROR_NOT_FOUND`]
11472    ///
11473    /// See also: [`cudaLibraryLoadData`], [`cudaLibraryLoadFromFile`], [`cudaLibraryUnload`], [`cuLibraryGetUnifiedFunction`](crate::driver::cuLibraryGetUnifiedFunction).
11474    pub fn cudaLibraryGetUnifiedFunction(
11475        fptr: *mut *mut ::core::ffi::c_void,
11476        library: cudaLibrary_t,
11477        symbol: *const ::core::ffi::c_char,
11478    ) -> cudaError_t;
11479}
11480singe_loader::functions! { crate::RUNTIME;
11481    /// Returns the number of kernels within a library.
11482    ///
11483    /// Returns in `count` the number of kernels in `lib`.
11484    ///
11485    /// # Parameters
11486    ///
11487    /// - `count`: Number of kernels found within the library.
11488    /// - `lib`: Library to query.
11489    ///
11490    /// # Return value
11491    ///
11492    /// - [`cudaError_t::CUDA_SUCCESS`]
11493    /// - [`cudaError_t::CUDA_ERROR_DEINITIALIZED`]
11494    /// - [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`]
11495    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
11496    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
11497    ///
11498    /// See also: [`cudaLibraryEnumerateKernels`], [`cudaLibraryLoadFromFile`], [`cudaLibraryLoadData`], [`cuLibraryGetKernelCount`](crate::driver::cuLibraryGetKernelCount).
11499    pub fn cudaLibraryGetKernelCount(
11500        count: *mut ::core::ffi::c_uint,
11501        lib: cudaLibrary_t,
11502    ) -> cudaError_t;
11503}
11504singe_loader::functions! { crate::RUNTIME;
11505    /// Retrieve the kernel handles within a library.
11506    ///
11507    /// Returns in `kernels` a maximum number of `numKernels` kernel handles within `lib`. The returned kernel handle becomes invalid when the library is unloaded.
11508    ///
11509    /// # Parameters
11510    ///
11511    /// - `kernels`: Buffer where the kernel handles are returned to.
11512    /// - `numKernels`: Maximum number of kernel handles may be returned to the buffer.
11513    /// - `lib`: Library to query from.
11514    ///
11515    /// # Return value
11516    ///
11517    /// - [`cudaError_t::CUDA_SUCCESS`]
11518    /// - [`cudaError_t::CUDA_ERROR_DEINITIALIZED`]
11519    /// - [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`]
11520    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
11521    /// - [`cudaError_t::CUDA_ERROR_INVALID_HANDLE`]
11522    ///
11523    /// See also: [`cudaLibraryGetKernelCount`], [`cuLibraryEnumerateKernels`](crate::driver::cuLibraryEnumerateKernels).
11524    pub fn cudaLibraryEnumerateKernels(
11525        kernels: *mut cudaKernel_t,
11526        numKernels: ::core::ffi::c_uint,
11527        lib: cudaLibrary_t,
11528    ) -> cudaError_t;
11529}
11530singe_loader::functions! { crate::RUNTIME;
11531    /// Sets information about a kernel.
11532    ///
11533    /// This call sets the value of a specified attribute `attr` on the kernel `kernel` for the requested device `device` to an integer value specified by `value`. This function returns [`cudaError_t::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 ([`cudaError_t::CUDA_ERROR_INVALID_VALUE`])
11534    ///
11535    /// Note that attributes set using [`cudaFuncSetAttribute`] will override the attribute set by this API irrespective of whether the call to [`cudaFuncSetAttribute`] is made before or after this API call. Because of this and the stricter locking requirements mentioned below it is suggested that this call be used during the initialization path and not on each thread accessing `kernel` such as on kernel launches or on the critical path.
11536    ///
11537    /// Valid values for `attr` are:
11538    ///
11539    /// * [`cudaFuncAttribute::CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES`] - The requested maximum size in bytes of dynamically-allocated shared memory. The sum of this value and the function attribute `sharedSizeBytes` cannot exceed the device attribute [`cudaDeviceAttr::CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN`]. The maximal size of requestable dynamic shared memory may differ by GPU architecture.
11540    /// * [`cudaFuncAttribute::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 [`cudaDeviceAttr::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.
11541    /// * [`cudaFuncAttribute::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 cudaErrorNotPermitted.
11542    /// * [`cudaFuncAttribute::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 cudaErrorNotPermitted.
11543    /// * [`cudaFuncAttribute::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 cudaErrorNotPermitted.
11544    /// * [`cudaFuncAttribute::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.
11545    /// * [`cudaFuncAttribute::CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE`]: The block scheduling policy of a function. The value type is cudaClusterSchedulingPolicy.
11546    ///
11547    /// Note: The API has stricter locking requirements in comparison to its legacy counterpart [`cudaFuncSetAttribute`] 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.
11548    ///
11549    /// # Parameters
11550    ///
11551    /// - `kernel`: Kernel to set attribute of.
11552    /// - `attr`: Attribute requested.
11553    /// - `value`: Value to set.
11554    /// - `device`: Device to set attribute of.
11555    ///
11556    /// # Return value
11557    ///
11558    /// - [`cudaError_t::CUDA_SUCCESS`]
11559    /// - [`cudaErrorInvalidDeviceFunction`](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ab6af535e7e53d3f21e2437e8977b8c2e)
11560    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
11561    ///
11562    /// See also: [`cudaLibraryLoadData`], [`cudaLibraryLoadFromFile`], [`cudaLibraryUnload`], [`cudaLibraryGetKernel`], [`cudaLaunchKernel`], [`cudaFuncSetAttribute`], [`cuKernelSetAttribute`](crate::driver::cuKernelSetAttribute).
11563    pub fn cudaKernelSetAttributeForDevice(
11564        kernel: cudaKernel_t,
11565        attr: cudaFuncAttribute,
11566        value: ::core::ffi::c_int,
11567        device: ::core::ffi::c_int,
11568    ) -> cudaError_t;
11569}
11570singe_loader::functions! { crate::RUNTIME;
11571    /// Get device resources.
11572    ///
11573    /// Get the `type` resources available to the `device`. This may often be the starting point for further partitioning or configuring of resources.
11574    ///
11575    /// Note: The API is not supported on 32-bit platforms.
11576    ///
11577    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
11578    ///
11579    /// # Parameters
11580    ///
11581    /// - `device`: Device to get resource for.
11582    /// - `resource`: Output pointer to a [`cudaDevResource`] structure.
11583    /// - `type_`: Type of resource to retrieve.
11584    ///
11585    /// # Return value
11586    ///
11587    /// - [`cudaError_t::CUDA_SUCCESS`]
11588    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
11589    /// - [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`]
11590    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
11591    /// - [`cudaError_t::CUDA_ERROR_INVALID_RESOURCE_TYPE`]
11592    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
11593    /// - [`cudaError_t::CUDA_ERROR_DEINITIALIZED`]
11594    /// - [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`]
11595    ///
11596    /// See also: [`cuDeviceGetDevResource`](crate::driver::cuDeviceGetDevResource), [`cudaExecutionCtxGetDevResource`], [`cudaDevSmResourceSplit`], [`cudaDevResourceGenerateDesc`].
11597    pub fn cudaDeviceGetDevResource(
11598        device: ::core::ffi::c_int,
11599        resource: *mut cudaDevResource,
11600        type_: cudaDevResourceType,
11601    ) -> cudaError_t;
11602}
11603singe_loader::functions! { crate::RUNTIME;
11604    /// Splits [`cudaDevResourceType::cudaDevResourceTypeSm`] resources.
11605    ///
11606    /// Splits [`cudaDevResourceType::cudaDevResourceTypeSm`] 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.
11607    ///
11608    /// This API is used to spatially partition the input resource. The input resource needs to come from one of [`cudaDeviceGetDevResource`], or [`cudaExecutionCtxGetDevResource`]. 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.
11609    ///
11610    /// 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 [`cudaDeviceGetDevResource`], or [`cudaExecutionCtxGetDevResource`] for [`cudaDevResourceType::cudaDevResourceTypeSm`], using the `minSmPartitionSize` and `smCoscheduledAlignment` fields to determine minimum partition size and alignment granularity, respectively.
11611    ///
11612    /// 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.
11613    ///
11614    /// The following flags are supported:
11615    ///
11616    /// * `cudaDevSmResourceSplitIgnoreSmCoscheduling`: 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+).
11617    /// * `cudaDevSmResourceSplitMaxPotentialClusterSize`: 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 [`cudaOccupancyMaxPotentialClusterSize`].
11618    ///
11619    /// A successful API call must either have:
11620    ///
11621    /// * A valid array of `result` pointers of size passed in `nbGroups`, with `input` of type [`cudaDevResourceType::cudaDevResourceTypeSm`]. Value of `minCount` must be between 0 and the SM count specified in `input`. `remaining` may be NULL.
11622    /// * NULL passed in for `result`, with a valid integer pointer in `nbGroups` and `input` of type [`cudaDevResourceType::cudaDevResourceTypeSm`]. Value of `minCount` must be between 0 and the SM count specified in `input`. `remaining` may be NULL. This queries the number of groups that would be created by the API.
11623    ///
11624    /// Note: The API is not supported on 32-bit platforms.
11625    ///
11626    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
11627    ///
11628    /// # Parameters
11629    ///
11630    /// - `result`: Output array of [`cudaDevResource`] resources. Can be NULL to query the number of groups.
11631    /// - `nbGroups`: This is a pointer, specifying the number of groups that would be or should be created as described below.
11632    /// - `input`: Input SM resource to be split. Must be a valid [`cudaDevSmResource`] resource.
11633    /// - `remaining`: If the input resource cannot be cleanly split among `nbGroups`, the remaining is placed in here. Can be ommitted (NULL) if the user does not need the remaining set.
11634    /// - `flags`: Flags specifying how these partitions are used or which constraints to abide by when splitting the input. Zero is valid for default behavior.
11635    /// - `minCount`: Minimum number of SMs required.
11636    ///
11637    /// # Return value
11638    ///
11639    /// - [`cudaError_t::CUDA_SUCCESS`]
11640    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
11641    /// - [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`]
11642    /// - [`cudaError_t::CUDA_ERROR_INVALID_RESOURCE_TYPE`]
11643    /// - [`cudaError_t::CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION`]
11644    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
11645    /// - [`cudaError_t::CUDA_ERROR_DEINITIALIZED`]
11646    /// - [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`]
11647    ///
11648    /// See also: [`cuDevSmResourceSplitByCount`](crate::driver::cuDevSmResourceSplitByCount), [`cudaDeviceGetDevResource`], [`cudaExecutionCtxGetDevResource`], [`cudaDevResourceGenerateDesc`].
11649    pub fn cudaDevSmResourceSplitByCount(
11650        result: *mut cudaDevResource,
11651        nbGroups: *mut ::core::ffi::c_uint,
11652        input: *const cudaDevResource,
11653        remaining: *mut cudaDevResource,
11654        flags: ::core::ffi::c_uint,
11655        minCount: ::core::ffi::c_uint,
11656    ) -> cudaError_t;
11657}
11658singe_loader::functions! { crate::RUNTIME;
11659    /// Splits a [`cudaDevResourceType::cudaDevResourceTypeSm`] resource into structured groups.
11660    ///
11661    /// This API will split a resource of [`cudaDevResourceType::cudaDevResourceTypeSm`] 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.
11662    ///
11663    /// 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.
11664    ///
11665    /// 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.
11666    ///
11667    /// For a valid call:
11668    ///
11669    /// * `result` should point to a [`cudaDevResource`] array of size `nbGroups`, or alternatively, may be NULL, if the developer wishes for only the groupParams entries to be updated
11670    /// * `input` should be a valid [`cudaDevResourceType::cudaDevResourceTypeSm`] resource that originates from querying the execution context, or device.
11671    /// * The `remainder` group may be NULL.
11672    /// * There are no API `flags` at this time, so the value passed in should be 0.
11673    /// * A [`cudaDevSmResourceGroupParams`] array of size `nbGroups`. Each entry must be zero-initialized.
11674    ///
11675    ///   + `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`. 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 [`cudaError_t::CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION`] will be returned.
11676    ///   + `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 [`cudaDevResourceType::cudaDevResourceTypeSm`] resource (8 on Compute Architecture 9.0+ and 2 otherwise). The maximum is 32 on Compute Architecture 9.0+ and 2 otherwise.
11677    ///   + `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`.
11678    ///   + `flags:`
11679    ///
11680    /// - `cudaDevSmResourceGroupBackfill:` 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 `cudaDevSmResourceGroupLocalityDomainId`, 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, [`cudaError_t::CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION`] is returned.
11681    ///
11682    /// **Example params and their effect:**
11683    ///
11684    /// A groupParams array element is defined in the following order:
11685    ///
11686    /// ```text
11687    /// { .smCount, .coscheduledSmCount, .preferredCoscheduledSmCount, .flags, \/\* .reserved \*\/ }
11688    /// ```
11689    ///
11690    /// ```text
11691    /// // Example 1
11692    /// // Will discover how many SMs there are, that are co-scheduled in groups of smCoscheduledAlignment.
11693    /// // The rest is placed in the optional remainder.
11694    /// cudaDevSmResourceGroupParams params { 0, 0, 0, 0 };
11695    /// ```
11696    ///
11697    /// ```text
11698    /// // Example 2
11699    /// // Assuming the device has 10+ SMs, the result will have 10 SMs that are co-scheduled in groups of 2 SMs.
11700    /// // The rest is placed in the optional remainder.
11701    /// cudaDevSmResourceGroupParams params { 10, 2, 0, 0};
11702    /// // Setting the coscheduledSmCount to 2 guarantees that we can always have a valid result
11703    /// // as long as the SM count is less than or equal to the input resource SM count.
11704    /// ```
11705    ///
11706    /// ```text
11707    /// // Example 3
11708    /// // A single piece is split-off, but instead of assigning the rest to the remainder, a second group contains everything else
11709    /// // This assumes the device has 10+ SMs (8 of which are coscheduled in groups of 4),
11710    /// // otherwise the second group could end up with 0 SMs, which is not allowed.
11711    /// cudaDevSmResourceGroupParams params { {8, 4, 0, 0}, {0, 2, 0, cudaDevSmResourceGroupBackfill } }
11712    /// ```
11713    ///
11714    /// The difference between a catch-all param group as the last entry and the remainder is in two aspects:
11715    ///
11716    /// * The remainder may be NULL / _TYPE_INVALID (if there are no SMs remaining), while a result group must always be valid.
11717    /// * 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 `cudaDevSmResourceGroupBackfill` flag enabled).
11718    ///
11719    /// 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.
11720    ///
11721    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
11722    ///
11723    /// # Parameters
11724    ///
11725    /// - `result`: Output array of [`cudaDevResource`] resources. Can be NULL, alongside an smCount of 0, for discovery purpose.
11726    /// - `nbGroups`: Specifies the number of groups in `result` and `groupParams`.
11727    /// - `input`: Input SM resource to be split. Must be a valid [`cudaDevResourceType::cudaDevResourceTypeSm`] resource.
11728    /// - `remainder`: If splitting the input resource leaves any SMs, the remainder is placed in here.
11729    /// - `flags`: Flags specifying how the API should behave. The value should be 0 for now.
11730    /// - `groupParams`: Description of how the SMs should be split and assigned to the corresponding result entry.
11731    ///
11732    /// # Return value
11733    ///
11734    /// - [`cudaError_t::CUDA_SUCCESS`]
11735    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
11736    /// - [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`]
11737    /// - [`cudaError_t::CUDA_ERROR_INVALID_RESOURCE_TYPE`]
11738    /// - [`cudaError_t::CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION`]
11739    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
11740    /// - [`cudaError_t::CUDA_ERROR_DEINITIALIZED`]
11741    /// - [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`]
11742    ///
11743    /// See also: [`cuDevSmResourceSplit`](crate::driver::cuDevSmResourceSplit), [`cudaDeviceGetDevResource`], [`cudaExecutionCtxGetDevResource`], [`cudaDevResourceGenerateDesc`].
11744    pub fn cudaDevSmResourceSplit(
11745        result: *mut cudaDevResource,
11746        nbGroups: ::core::ffi::c_uint,
11747        input: *const cudaDevResource,
11748        remainder: *mut cudaDevResource,
11749        flags: ::core::ffi::c_uint,
11750        groupParams: *mut cudaDevSmResourceGroupParams,
11751    ) -> cudaError_t;
11752}
11753singe_loader::functions! { crate::RUNTIME;
11754    /// Generate a resource descriptor.
11755    ///
11756    /// 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 [`cudaGreenCtxCreate`] API. Resources of the same type can be passed in, provided they meet the requirements as noted below.
11757    ///
11758    /// A successful API call must have:
11759    ///
11760    /// * 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 [`cudaError_t::CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION`] is returned. If multiple resources are provided in `resources` and they are of type [`cudaDevResourceType::cudaDevResourceTypeSm`], they must be outputs (whether `result` or `remaining`) from the same split API instance and have the same smCoscheduledAlignment values, otherwise [`cudaError_t::CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION`] is returned.
11761    ///
11762    /// Note: The API is not supported on 32-bit platforms.
11763    ///
11764    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
11765    ///
11766    /// # Parameters
11767    ///
11768    /// - `phDesc`: Output descriptor.
11769    /// - `resources`: Array of resources to be included in the descriptor.
11770    /// - `nbResources`: Number of resources passed in `resources`.
11771    ///
11772    /// # Return value
11773    ///
11774    /// - [`cudaError_t::CUDA_SUCCESS`]
11775    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
11776    /// - [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`]
11777    /// - [`cudaError_t::CUDA_ERROR_INVALID_RESOURCE_TYPE`]
11778    /// - [`cudaError_t::CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION`]
11779    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]: cudaErrorOutOfMemory.
11780    /// - [`cudaError_t::CUDA_ERROR_DEINITIALIZED`]
11781    /// - [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`]
11782    ///
11783    /// See also: [`cuDevResourceGenerateDesc`](crate::driver::cuDevResourceGenerateDesc), [`cudaDeviceGetDevResource`], [`cudaExecutionCtxGetDevResource`], [`cudaDevSmResourceSplit`], [`cudaGreenCtxCreate`].
11784    pub fn cudaDevResourceGenerateDesc(
11785        phDesc: *mut cudaDevResourceDesc_t,
11786        resources: *mut cudaDevResource,
11787        nbResources: ::core::ffi::c_uint,
11788    ) -> cudaError_t;
11789}
11790singe_loader::functions! { crate::RUNTIME;
11791    /// Creates a green context with a specified set of resources.
11792    ///
11793    /// This API creates a green context with the resources specified in the descriptor `desc` and returns it in the handle represented by `phCtx`.
11794    ///
11795    /// This API retains the device’s primary context for the lifetime of the green context. The primary context will be released when the green context is destroyed. To avoid the overhead of repeated initialization and teardown, it is recommended to explicitly initialize the device’s primary context ahead of time using [`cudaInitDevice`]. This ensures that the primary context remains initialized throughout the program’s lifetime, minimizing overhead during green context creation and destruction.
11796    ///
11797    /// The API does not create a default stream for the green context. Developers are expected to create streams explicitly using [`cudaExecutionCtxStreamCreate`] to submit work to the green context.
11798    ///
11799    /// Note: The API is not supported on 32-bit platforms.
11800    ///
11801    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
11802    ///
11803    /// # Parameters
11804    ///
11805    /// - `phCtx`: Pointer for the output handle to the green context.
11806    /// - `desc`: Descriptor generated via [`cudaDevResourceGenerateDesc`] which contains the set of resources to be used.
11807    /// - `device`: Device on which to create the green context.
11808    /// - `flags`: Green context creation flags. Must be 0, currently reserved for future use.
11809    ///
11810    /// # Return value
11811    ///
11812    /// - [`cudaError_t::CUDA_SUCCESS`]
11813    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
11814    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
11815    /// - [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`]
11816    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]: cudaErrorOutOfMemory.
11817    /// - [`cudaError_t::CUDA_ERROR_DEINITIALIZED`]
11818    /// - [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`]
11819    ///
11820    /// See also: [`cudaDeviceGetDevResource`], [`cudaDevSmResourceSplit`], [`cudaDevResourceGenerateDesc`], [`cudaExecutionCtxGetDevResource`], [`cudaExecutionCtxDestroy`], [`cudaInitDevice`], [`cudaExecutionCtxStreamCreate`].
11821    pub fn cudaGreenCtxCreate(
11822        phCtx: *mut cudaExecutionContext_t,
11823        desc: cudaDevResourceDesc_t,
11824        device: ::core::ffi::c_int,
11825        flags: ::core::ffi::c_uint,
11826    ) -> cudaError_t;
11827}
11828singe_loader::functions! { crate::RUNTIME;
11829    /// Destroy a execution context.
11830    ///
11831    /// Destroys the specified execution context `ctx`. It is the responsibility of the caller to ensure that no API call issues using `ctx` while [`cudaExecutionCtxDestroy`] is executing or subsequently.
11832    ///
11833    /// If `ctx` is a green context, any resources provisioned for it (that were initially available via the resource descriptor) are released as well.
11834    ///
11835    /// The API does not destroy streams created via [`cudaExecutionCtxStreamCreate`]. Users are expected to destroy these streams explicitly using [`cudaStreamDestroy`] to avoid resource leaks. Once the execution context is destroyed, any subsequent API calls involving these streams will return [`cudaError_t::CUDA_ERROR_STREAM_DETACHED`] with the exception of the following APIs:
11836    ///
11837    /// * [`cudaStreamDestroy`]. Note this is only supported on CUDA drivers 13.1 and above.
11838    ///
11839    /// Additionally, the API will invalidate all active captures on these streams.
11840    ///
11841    /// Passing in a `ctx` that was not explicitly created via CUDA Runtime APIs is not allowed and will result in undefined behavior.
11842    ///
11843    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
11844    ///
11845    /// Note: The context parameter is required and the API ignores the context that is current to the calling thread. This enables explicit context-based programming without relying on thread-local state. If no context is specified, the API will return [`cudaError_t::CUDA_ERROR_INVALID_VALUE`].
11846    ///
11847    /// # Parameters
11848    ///
11849    /// - `ctx`: Execution context to destroy (required parameter, see note below)
11850    ///
11851    /// # Return value
11852    ///
11853    /// - [`cudaError_t::CUDA_SUCCESS`]
11854    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
11855    /// - [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`]
11856    /// - [`cudaError_t::CUDA_ERROR_DEINITIALIZED`]
11857    /// - [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`]
11858    ///
11859    /// See also: [`cudaGreenCtxCreate`].
11860    pub fn cudaExecutionCtxDestroy(ctx: cudaExecutionContext_t) -> cudaError_t;
11861}
11862singe_loader::functions! { crate::RUNTIME;
11863    /// Get context resources.
11864    ///
11865    /// Get the `type` resources available to context represented by `ctx`.
11866    ///
11867    /// Note: The API is not supported on 32-bit platforms.
11868    ///
11869    /// Note that this function may also return error codes from previous, asynchronous launches.
11870    ///
11871    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
11872    ///
11873    /// Note: The context parameter is required and the API ignores the context that is current to the calling thread. This enables explicit context-based programming without relying on thread-local state. If no context is specified, the API will return [`cudaError_t::CUDA_ERROR_INVALID_VALUE`].
11874    ///
11875    /// # Parameters
11876    ///
11877    /// - `ctx`: Execution context to get resource for (required parameter, see note below).
11878    /// - `resource`: Output pointer to a [`cudaDevResource`] structure.
11879    /// - `type_`: Type of resource to retrieve.
11880    ///
11881    /// # Return value
11882    ///
11883    /// - [`cudaError_t::CUDA_SUCCESS`]
11884    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
11885    /// - [`cudaError_t::CUDA_ERROR_NOT_SUPPORTED`]
11886    /// - [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`]
11887    /// - [`cudaError_t::CUDA_ERROR_DEINITIALIZED`]
11888    /// - [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`]
11889    ///
11890    /// See also: [`cudaDeviceGetDevResource`], [`cudaDevSmResourceSplit`], [`cudaDevResourceGenerateDesc`], [`cudaGreenCtxCreate`].
11891    pub fn cudaExecutionCtxGetDevResource(
11892        ctx: cudaExecutionContext_t,
11893        resource: *mut cudaDevResource,
11894        type_: cudaDevResourceType,
11895    ) -> cudaError_t;
11896}
11897singe_loader::functions! { crate::RUNTIME;
11898    /// Returns the device handle for the execution context.
11899    ///
11900    /// Returns in `*device` the handle of the specified execution context’s device. The execution context should not be NULL.
11901    ///
11902    /// Note that this function may also return error codes from previous, asynchronous launches.
11903    ///
11904    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
11905    ///
11906    /// Note: The context parameter is required and the API ignores the context that is current to the calling thread. This enables explicit context-based programming without relying on thread-local state. If no context is specified, the API will return [`cudaError_t::CUDA_ERROR_INVALID_VALUE`].
11907    ///
11908    /// # Parameters
11909    ///
11910    /// - `device`: Returned device handle for the specified execution context.
11911    /// - `ctx`: Execution context for which to obtain the device (required parameter, see note below).
11912    ///
11913    /// # Return value
11914    ///
11915    /// - [`cudaError_t::CUDA_SUCCESS`]
11916    /// - [`cudaError_t::CUDA_ERROR_DEINITIALIZED`]
11917    /// - [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`]
11918    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
11919    /// - [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`]
11920    ///
11921    /// See also: [`cudaGreenCtxCreate`], [`cudaExecutionCtxDestroy`], [`cuCtxGetDevice`](crate::driver::cuCtxGetDevice).
11922    pub fn cudaExecutionCtxGetDevice(
11923        device: *mut ::core::ffi::c_int,
11924        ctx: cudaExecutionContext_t,
11925    ) -> cudaError_t;
11926}
11927singe_loader::functions! { crate::RUNTIME;
11928    /// Returns the unique Id associated with the execution context supplied.
11929    ///
11930    /// 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. The execution context should not be NULL.
11931    ///
11932    /// Note that this function may also return error codes from previous, asynchronous launches.
11933    ///
11934    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
11935    ///
11936    /// Note: The context parameter is required and the API ignores the context that is current to the calling thread. This enables explicit context-based programming without relying on thread-local state. If no context is specified, the API will return [`cudaError_t::CUDA_ERROR_INVALID_VALUE`].
11937    ///
11938    /// # Parameters
11939    ///
11940    /// - `ctx`: Context for which to obtain the Id (required parameter, see note below).
11941    /// - `ctxId`: Pointer to store the Id of the context.
11942    ///
11943    /// # Return value
11944    ///
11945    /// - [`cudaError_t::CUDA_SUCCESS`]
11946    /// - [`cudaError_t::CUDA_ERROR_DEINITIALIZED`]
11947    /// - [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`]
11948    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
11949    /// - [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`]
11950    ///
11951    /// See also: [`cudaGreenCtxCreate`], [`cudaExecutionCtxDestroy`], [`cudaExecutionCtxGetDevice`], [`cuCtxGetId`](crate::driver::cuCtxGetId).
11952    pub fn cudaExecutionCtxGetId(
11953        ctx: cudaExecutionContext_t,
11954        ctxId: *mut ::core::ffi::c_ulonglong,
11955    ) -> cudaError_t;
11956}
11957singe_loader::functions! { crate::RUNTIME;
11958    /// Creates a stream and initializes it for the given execution context.
11959    ///
11960    /// The API creates a CUDA stream with the specified `flags` and `priority`, initializing it with resources as defined at the time of creating the specified `ctx`. Additionally, the API also enables work submitted to to the stream to be tracked under `ctx`.
11961    ///
11962    /// The supported values for `flags` are:
11963    ///
11964    /// * [`cudaStreamDefault`]: Default stream creation flag. This would be [`cudaStreamNonBlocking`] for streams created on a green context.
11965    /// * [`cudaStreamNonBlocking`]: 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
11966    ///
11967    /// 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 [`cudaDeviceGetStreamPriorityRange`]. If the specified priority is outside the numerical range returned by [`cudaDeviceGetStreamPriorityRange`], it will automatically be clamped to the lowest or the highest number in the range.
11968    ///
11969    /// Note that this function may also return error codes from previous, asynchronous launches.
11970    ///
11971    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
11972    ///
11973    /// Note: The context parameter is required and the API ignores the context that is current to the calling thread. This enables explicit context-based programming without relying on thread-local state. If no context is specified, the API will return [`cudaError_t::CUDA_ERROR_INVALID_VALUE`].
11974    ///
11975    /// 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.
11976    ///
11977    /// # Parameters
11978    ///
11979    /// - `phStream`: Returned stream handle.
11980    /// - `ctx`: Execution context to initialize the stream with (required parameter, see note below).
11981    /// - `flags`: Flags for stream creation.
11982    /// - `priority`: Stream priority.
11983    ///
11984    /// # Return value
11985    ///
11986    /// - [`cudaError_t::CUDA_SUCCESS`]
11987    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
11988    /// - [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`]: cudaErrorOutOfMemory.
11989    /// - [`cudaError_t::CUDA_ERROR_DEINITIALIZED`]
11990    /// - [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`]
11991    ///
11992    /// See also: [`cudaStreamDestroy`], [`cudaGreenCtxCreate`], [`cudaDeviceGetStreamPriorityRange`], [`cudaStreamGetFlags`], [`cudaStreamGetPriority`], [`cudaStreamGetDevice`], [`cudaStreamGetDevResource`], [`cudaLaunchKernel`], [`cudaEventRecord`], [`cudaStreamWaitEvent`], [`cudaStreamQuery`], [`cudaStreamSynchronize`], [`cudaStreamAddCallback`].
11993    pub fn cudaExecutionCtxStreamCreate(
11994        phStream: *mut cudaStream_t,
11995        ctx: cudaExecutionContext_t,
11996        flags: ::core::ffi::c_uint,
11997        priority: ::core::ffi::c_int,
11998    ) -> cudaError_t;
11999}
12000singe_loader::functions! { crate::RUNTIME;
12001    /// Block for the specified execution context’s tasks to complete.
12002    ///
12003    /// Blocks until the specified execution context has completed all preceding requested tasks. If the specified execution context is the device (primary) context obtained via [`cudaDeviceGetExecutionCtx`], green contexts that have been created on the device will also be synchronized.
12004    ///
12005    /// The API returns an error if one of the preceding tasks failed.
12006    ///
12007    /// Note that this function may also return error codes from previous, asynchronous launches.
12008    ///
12009    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
12010    ///
12011    /// Note: The context parameter is required and the API ignores the context that is current to the calling thread. This enables explicit context-based programming without relying on thread-local state. If no context is specified, the API will return [`cudaError_t::CUDA_ERROR_INVALID_VALUE`].
12012    ///
12013    /// # Parameters
12014    ///
12015    /// - `ctx`: Execution context to synchronize (required parameter, see note below)
12016    ///
12017    /// # Return value
12018    ///
12019    /// - [`cudaError_t::CUDA_SUCCESS`]
12020    /// - [`cudaError_t::CUDA_ERROR_DEINITIALIZED`]
12021    /// - [`cudaError_t::CUDA_ERROR_INVALID_CONTEXT`]
12022    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
12023    ///
12024    /// See also: [`cudaGreenCtxCreate`], [`cudaExecutionCtxDestroy`], [`cudaDeviceSynchronize`], [`cuCtxSynchronize_v2`](crate::driver::cuCtxSynchronize_v2).
12025    pub fn cudaExecutionCtxSynchronize(ctx: cudaExecutionContext_t) -> cudaError_t;
12026}
12027singe_loader::functions! { crate::RUNTIME;
12028    /// Get stream resources.
12029    ///
12030    /// Get the `type` resources available to the `hStream` and store them in `resource`.
12031    ///
12032    /// Note: The API will return [`cudaError_t::CUDA_ERROR_INVALID_RESOURCE_TYPE`] is `type` is [`cudaDevResourceType::cudaDevResourceTypeWorkqueueConfig`] or [`cudaDevResourceType::cudaDevResourceTypeWorkqueue`].
12033    ///
12034    /// Note that this function may also return error codes from previous, asynchronous launches.
12035    ///
12036    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
12037    ///
12038    /// # Parameters
12039    ///
12040    /// - `hStream`: Stream to get resource for.
12041    /// - `resource`: Output pointer to a [`cudaDevResource`] structure.
12042    /// - `type_`: Type of resource to retrieve.
12043    ///
12044    /// # Return value
12045    ///
12046    /// - [`cudaError_t::CUDA_SUCCESS`]
12047    /// - [`cudaError_t::CUDA_ERROR_DEINITIALIZED`]
12048    /// - [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`]
12049    /// - [`cudaError_t::CUDA_ERROR_INVALID_CONTEXT`]
12050    /// - [`cudaError_t::CUDA_ERROR_INVALID_RESOURCE_TYPE`]
12051    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]: cudaErrorInvalidHandle.
12052    /// - [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`]
12053    /// - [`cudaError_t::CUDA_ERROR_CALL_REQUIRES_NEWER_DRIVER`]
12054    ///
12055    /// See also: [`cudaGreenCtxCreate`], [`cudaExecutionCtxStreamCreate`], [`cudaStreamCreate`], [`cudaDevSmResourceSplit`], [`cudaDevResourceGenerateDesc`], [`cuStreamGetDevResource`](crate::driver::cuStreamGetDevResource).
12056    pub fn cudaStreamGetDevResource(
12057        hStream: cudaStream_t,
12058        resource: *mut cudaDevResource,
12059        type_: cudaDevResourceType,
12060    ) -> cudaError_t;
12061}
12062singe_loader::functions! { crate::RUNTIME;
12063    /// Records an event for the specified execution context.
12064    ///
12065    /// Captures in `event` all the activities of the execution context `ctx` at the time of this call. `event` and `ctx` must be from the same CUDA device, otherwise `cudaErrorInvalidHandle` will be returned. Calls such as [`cudaEventQuery`] or [`cudaExecutionCtxWaitEvent`] will then examine or wait for completion of the work that was captured. Uses of `ctx` after this call do not modify `event`. If the execution context passed to `ctx` is the device (primary) context obtained via [`cudaDeviceGetExecutionCtx`], `event` will capture all the activities of the green contexts created on the device as well.
12066    ///
12067    /// Note: The API will return [`cudaError_t::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED`] if the specified execution context `ctx` has a stream in the capture mode. In such a case, the call will invalidate all the conflicting captures.
12068    ///
12069    /// Note that this function may also return error codes from previous, asynchronous launches.
12070    ///
12071    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
12072    ///
12073    /// Note: The context parameter is required and the API ignores the context that is current to the calling thread. This enables explicit context-based programming without relying on thread-local state. If no context is specified, the API will return [`cudaError_t::CUDA_ERROR_INVALID_VALUE`].
12074    ///
12075    /// # Parameters
12076    ///
12077    /// - `ctx`: Execution context to record event for (required parameter, see note below).
12078    /// - `event`: Event to record.
12079    ///
12080    /// # Return value
12081    ///
12082    /// - [`cudaError_t::CUDA_SUCCESS`]
12083    /// - [`cudaError_t::CUDA_ERROR_DEINITIALIZED`]
12084    /// - [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`]: cudaErrorInvalidHandle.
12085    /// - [`cudaError_t::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED`]
12086    ///
12087    /// See also: [`cudaEventRecord`], [`cudaExecutionCtxWaitEvent`], [`cuCtxRecordEvent`](crate::driver::cuCtxRecordEvent), [`cuGreenCtxRecordEvent`](crate::driver::cuGreenCtxRecordEvent).
12088    pub fn cudaExecutionCtxRecordEvent(
12089        ctx: cudaExecutionContext_t,
12090        event: cudaEvent_t,
12091    ) -> cudaError_t;
12092}
12093singe_loader::functions! { crate::RUNTIME;
12094    /// Make an execution context wait on an event.
12095    ///
12096    /// Makes all future work submitted to execution context `ctx` wait for all work captured in `event`. The synchronization will be performed on the device and will not block the calling CPU thread. See [`cudaExecutionCtxRecordEvent`] for details on what is captured by an event. If the execution context passed to `ctx` is the device (primary) context obtained via [`cudaDeviceGetExecutionCtx`], all green contexts created on the device will wait for `event` as well.
12097    ///
12098    /// Note: `event` may be from a different execution context or device than `ctx`.
12099    ///
12100    /// Note: The API will return [`cudaError_t::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED`] and invalidate the capture if the specified event `event` is part of an ongoing capture sequence or if the specified execution context `ctx` has a stream in the capture mode.
12101    ///
12102    /// Note that this function may also return error codes from previous, asynchronous launches.
12103    ///
12104    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [`cudaError_t::CUDA_ERROR_NOT_PERMITTED`] may, but is not guaranteed to, be returned as a diagnostic in such case.
12105    ///
12106    /// Note: The context parameter is required and the API ignores the context that is current to the calling thread. This enables explicit context-based programming without relying on thread-local state. If no context is specified, the API will return [`cudaError_t::CUDA_ERROR_INVALID_VALUE`].
12107    ///
12108    /// # Parameters
12109    ///
12110    /// - `ctx`: Execution context to wait for (required parameter, see note below).
12111    /// - `event`: Event to wait on.
12112    ///
12113    /// # Return value
12114    ///
12115    /// - [`cudaError_t::CUDA_SUCCESS`]
12116    /// - [`cudaError_t::CUDA_ERROR_DEINITIALIZED`]
12117    /// - [`cudaError_t::CUDA_ERROR_NOT_INITIALIZED`]: cudaErrorInvalidHandle.
12118    /// - [`cudaError_t::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED`]
12119    ///
12120    /// See also: [`cudaExecutionCtxRecordEvent`], [`cudaStreamWaitEvent`], [`cuCtxWaitEvent`](crate::driver::cuCtxWaitEvent), [`cuGreenCtxWaitEvent`](crate::driver::cuGreenCtxWaitEvent).
12121    pub fn cudaExecutionCtxWaitEvent(
12122        ctx: cudaExecutionContext_t,
12123        event: cudaEvent_t,
12124    ) -> cudaError_t;
12125}
12126singe_loader::functions! { crate::RUNTIME;
12127    /// Returns the execution context for a device.
12128    ///
12129    /// Returns in `ctx` the execution context for the specified device. This is the device’s primary context. The returned context can then be passed to APIs that take in a cudaExecutionContext_t enabling explicit context-based programming without relying on thread-local state.
12130    ///
12131    /// Passing the returned execution context to [`cudaExecutionCtxDestroy`] is not allowed and will result in undefined behavior.
12132    ///
12133    /// # Parameters
12134    ///
12135    /// - `ctx`: Returns the device execution context.
12136    /// - `device`: Device to get the execution context for.
12137    ///
12138    /// # Return value
12139    ///
12140    /// - [`cudaError_t::CUDA_SUCCESS`]
12141    /// - [`cudaError_t::CUDA_ERROR_INVALID_VALUE`]
12142    /// - [`cudaError_t::CUDA_ERROR_INVALID_DEVICE`]
12143    ///
12144    /// See also: [`cudaExecutionCtxGetDevice`], [`cudaExecutionCtxGetId`].
12145    pub fn cudaDeviceGetExecutionCtx(
12146        ctx: *mut cudaExecutionContext_t,
12147        device: ::core::ffi::c_int,
12148    ) -> cudaError_t;
12149}
12150singe_loader::functions! { crate::RUNTIME;
12151    /// impl_private
12152    pub fn cudaGetExportTable(
12153        ppExportTable: *mut *const ::core::ffi::c_void,
12154        pExportTableId: *const cudaUUID_t,
12155    ) -> cudaError_t;
12156}
12157singe_loader::functions! { crate::RUNTIME;
12158    /// Get pointer to device entry function that matches entry function `symbolPtr`.
12159    ///
12160    /// Returns in `functionPtr` the device entry function corresponding to the symbol `symbolPtr`.
12161    ///
12162    /// # Parameters
12163    ///
12164    /// - `functionPtr`: Returns the device entry function.
12165    /// - `symbolPtr`: Pointer to device entry function to search for.
12166    ///
12167    /// # Return value
12168    ///
12169    /// - [`cudaError_t::CUDA_SUCCESS`]
12170    pub fn cudaGetFuncBySymbol(
12171        functionPtr: *mut cudaFunction_t,
12172        symbolPtr: *const ::core::ffi::c_void,
12173    ) -> cudaError_t;
12174}
12175singe_loader::functions! { crate::RUNTIME;
12176    /// Get pointer to device kernel that matches entry function `entryFuncAddr`.
12177    ///
12178    /// Returns in `kernelPtr` the device kernel corresponding to the entry function `entryFuncAddr`.
12179    ///
12180    /// Note that it is possible that there are multiple symbols belonging to different translation units with the same `entryFuncAddr` registered with this CUDA Runtime and so the order which the translation units are loaded and registered with the CUDA Runtime can lead to differing return pointers in `kernelPtr`. Suggested methods of ensuring uniqueness are to limit visibility of **global** device functions by using static or hidden visibility attribute in the respective translation units.
12181    ///
12182    /// # Parameters
12183    ///
12184    /// - `kernelPtr`: Returns the device kernel.
12185    /// - `entryFuncAddr`: Address of device entry function to search kernel for.
12186    ///
12187    /// # Return value
12188    ///
12189    /// - [`cudaError_t::CUDA_SUCCESS`]
12190    ///
12191    /// See also: (C++, API).
12192    pub fn cudaGetKernel(
12193        kernelPtr: *mut cudaKernel_t,
12194        entryFuncAddr: *const ::core::ffi::c_void,
12195    ) -> cudaError_t;
12196}